]> 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>
Mon, 23 Sep 2019 17:52:47 +0000 (19:52 +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 9e5190a5b51d68319016591067759eed90e2b2e1..30f87c9ae22b164f719e845276223d41760db905 100644 (file)
@@ -583,6 +583,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 ();
+}