[vala/staging] tests: Add "template" parser test to increase coverage
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/staging] tests: Add "template" parser test to increase coverage
- Date: Sun, 7 Jan 2018 20:04:10 +0000 (UTC)
commit 62b4b3ab9e77397f1f72a1f7fd54b519fbbf34f5
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 33750cb..afcc04a 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 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]