]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Add "qualified member/symbol access" tests to increase coverage
authorRico Tzschichholz <ricotz@ubuntu.com>
Mon, 23 Sep 2019 15:38:44 +0000 (17:38 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sat, 5 Oct 2019 11:32:03 +0000 (13:32 +0200)
tests/Makefile.am
tests/parser/qualified-member-access.vala [new file with mode: 0644]
tests/parser/qualified-symbol-access.vala [new file with mode: 0644]

index 2fad21b568a45d87bce48ab1275c553761627921..c4891db2fd91cdc7138de5c25454f00eb40736cc 100644 (file)
@@ -578,6 +578,8 @@ TESTS = \
        parser/property-no-virtual-override.test \
        parser/property-set-must-have-body.test \
        parser/property-set-redefined.test \
+       parser/qualified-member-access.vala \
+       parser/qualified-symbol-access.vala \
        parser/signal-no-class.test \
        parser/signal-no-static.test \
        parser/statement-outside-root.test \
diff --git a/tests/parser/qualified-member-access.vala b/tests/parser/qualified-member-access.vala
new file mode 100644 (file)
index 0000000..ffa7348
--- /dev/null
@@ -0,0 +1,16 @@
+namespace Bar {
+       void foo () {
+               assert_not_reached ();
+       }
+
+       void bar () {
+               global::foo ();
+       }
+}
+
+void foo () {
+}
+
+void main () {
+       Bar.bar ();
+}
diff --git a/tests/parser/qualified-symbol-access.vala b/tests/parser/qualified-symbol-access.vala
new file mode 100644 (file)
index 0000000..d4d83eb
--- /dev/null
@@ -0,0 +1,18 @@
+namespace Bar {
+       class Foo {
+               public Foo () {
+                       assert_not_reached ();
+               }
+       }
+
+       void bar () {
+               new global::Foo ();
+       }
+}
+
+class Foo {
+}
+
+void main () {
+       Bar.bar ();
+}