]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Add "template" parser test to increase coverage
authorRico Tzschichholz <ricotz@ubuntu.com>
Sat, 6 Jan 2018 22:17:36 +0000 (23:17 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Wed, 10 Jan 2018 19:44:52 +0000 (20:44 +0100)
tests/Makefile.am
tests/parser/template.vala [new file with mode: 0644]

index 4ad6f65cb1f10842d5f3fc5a7ac80b7b5697cb70..fab97764be453024cfa081d409f06b9163359e42 100644 (file)
@@ -313,6 +313,7 @@ TESTS = \
        annotations/deprecated.vala \
        annotations/description.vala \
        annotations/noaccessormethod.test \
+       parser/template.vala \
        $(NULL)
 
 NON_NULL_TESTS = \
diff --git a/tests/parser/template.vala b/tests/parser/template.vala
new file mode 100644 (file)
index 0000000..b4a0736
--- /dev/null
@@ -0,0 +1,12 @@
+unowned string m () {
+       return "foo";
+}
+
+void main () {
+       string result;
+       result = @"";
+
+       int i = 42;
+       result = @"i=$i m=$(m ()) $$";
+       assert (result == "i=42 m=foo $");
+}