[vala/0.36] tests: Add "template" parser test to increase coverage



commit f9cb6bde7cfcf1223e39ea8509203b414c2c9962
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Sat Jan 6 23:17:36 2018 +0100

    tests: Add "template" parser test to increase coverage

 tests/Makefile.am          |    1 +
 tests/parser/template.vala |   12 ++++++++++++
 2 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 05be0df..96016d5 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -311,6 +311,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
index 0000000..b4a0736
--- /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 $");
+}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]