]> 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>
Sun, 7 Jan 2018 19:26:03 +0000 (20:26 +0100)
tests/Makefile.am
tests/parser/template.vala [new file with mode: 0644]

index 33750cb500950dd35f8b2a63fbde8ef769170bb4..afcc04a4d22ae1554b56edd83af99bbb3eca44f3 100644 (file)
@@ -318,6 +318,7 @@ TESTS = \
        annotations/description.vala \
        annotations/noaccessormethod.test \
        parser/switch-statement.vala \
+       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 $");
+}