]> 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 11:05:01 +0000 (13:05 +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 9bc3fc265d3dc31e9143a4e895f11e0eed3411ab..34bedbdb7dd3d5d4456c1ab3cfbaec1ed324505b 100644 (file)
@@ -487,6 +487,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.test \
        parser/yield-return.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 () {
+}