[vala/0.36: 130/212] tests: Add "template" parser test to increase coverage
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.36: 130/212] tests: Add "template" parser test to increase coverage
- Date: Sat, 14 Apr 2018 07:54:17 +0000 (UTC)
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]