[vala/staging] tests: Add some "using directive" tests to increase coverage
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/staging] tests: Add some "using directive" tests to increase coverage
- Date: Sat, 27 Oct 2018 11:12:29 +0000 (UTC)
commit 7f477deb206ea0c8ab8550be75619ee44a106677
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Sat Oct 27 12:43:19 2018 +0200
tests: Add some "using directive" tests to increase coverage
tests/Makefile.am | 3 +++
tests/parser/using-ambiguous-reference.test | 18 ++++++++++++++++++
tests/parser/using-directive.vala | 16 ++++++++++++++++
tests/parser/using-invalid-namespace.test | 6 ++++++
4 files changed, 43 insertions(+)
---
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 () {
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]