]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Add some "using directive" tests to increase coverage
authorRico Tzschichholz <ricotz@ubuntu.com>
Sat, 27 Oct 2018 10:43:19 +0000 (12:43 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sat, 27 Oct 2018 20:43:09 +0000 (22:43 +0200)
tests/Makefile.am
tests/parser/using-ambiguous-reference.test [new file with mode: 0644]
tests/parser/using-directive.vala [new file with mode: 0644]
tests/parser/using-invalid-namespace.test [new file with mode: 0644]

index 4e707572e77b681e1a51f213bccfa421e3a3c5dc..c2f538961aacafe19f758f59a5e8bf41ec35d081 100644 (file)
@@ -485,6 +485,9 @@ TESTS = \
        parser/tuple.vala \
        parser/unsupported-property-async.test \
        parser/unsupported-property-throws.test \
+       parser/using-ambiguous-reference.test \
+       parser/using-directive.vala \
+       parser/using-invalid-namespace.test \
        parser/yield-method.test \
        parser/yield-return.vala \
        parser/bug728574.vala \
diff --git a/tests/parser/using-ambiguous-reference.test b/tests/parser/using-ambiguous-reference.test
new file mode 100644 (file)
index 0000000..57feb98
--- /dev/null
@@ -0,0 +1,18 @@
+Invalid Code
+
+using Foo;
+using Bar;
+
+namespace Foo {
+       public void manam () {
+       }
+}
+
+namespace Bar {
+       public void manam () {
+       }
+}
+
+void main () {
+       manam ();
+}
diff --git a/tests/parser/using-directive.vala b/tests/parser/using-directive.vala
new file mode 100644 (file)
index 0000000..6959f73
--- /dev/null
@@ -0,0 +1,16 @@
+namespace Foo {
+       using Bar;
+
+       public void foo () {
+               bar ();
+       }
+}
+
+namespace Bar {
+       public void bar () {
+       }
+}
+
+void main () {
+       Foo.foo ();
+}
diff --git a/tests/parser/using-invalid-namespace.test b/tests/parser/using-invalid-namespace.test
new file mode 100644 (file)
index 0000000..9f1a350
--- /dev/null
@@ -0,0 +1,6 @@
+Invalid Code
+
+using UnknownNamespace;
+
+void main () {
+}