From: Rico Tzschichholz Date: Sat, 27 Oct 2018 10:43:19 +0000 (+0200) Subject: tests: Add some "using directive" tests to increase coverage X-Git-Tag: 0.43.1~167 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7f477deb206ea0c8ab8550be75619ee44a106677;p=thirdparty%2Fvala.git tests: Add some "using directive" tests to increase coverage --- diff --git a/tests/Makefile.am b/tests/Makefile.am index 9bc3fc265..34bedbdb7 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -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 index 000000000..57feb98ca --- /dev/null +++ b/tests/parser/using-ambiguous-reference.test @@ -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 index 000000000..6959f734b --- /dev/null +++ b/tests/parser/using-directive.vala @@ -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 index 000000000..9f1a35071 --- /dev/null +++ b/tests/parser/using-invalid-namespace.test @@ -0,0 +1,6 @@ +Invalid Code + +using UnknownNamespace; + +void main () { +}