From: Rico Tzschichholz Date: Sat, 6 Jan 2018 22:17:36 +0000 (+0100) Subject: tests: Add "template" parser test to increase coverage X-Git-Tag: 0.39.4~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=62b4b3ab9e77397f1f72a1f7fd54b519fbbf34f5;p=thirdparty%2Fvala.git tests: Add "template" parser test to increase coverage --- diff --git a/tests/Makefile.am b/tests/Makefile.am index 33750cb50..afcc04a4d 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -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 index 000000000..b4a073676 --- /dev/null +++ b/tests/parser/template.vala @@ -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 $"); +}