diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2018-02-05 16:19:56 +0100 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2018-02-05 16:19:56 +0100 |
commit | b03d7515ac261c85f5f6126cd6500087be0ee5ea (patch) | |
tree | 11c90a2550fdea7de4754630e4ba7eb6b5217e57 /tests/semantic | |
parent | 78c37a77eeea95526305c7907a379f86de958810 (diff) | |
download | vala-b03d7515ac261c85f5f6126cd6500087be0ee5ea.tar.gz |
tests: Add invalid "method" tests to increase coverage
Diffstat (limited to 'tests/semantic')
23 files changed, 185 insertions, 0 deletions
diff --git a/tests/semantic/method-abstract-body.test b/tests/semantic/method-abstract-body.test new file mode 100644 index 000000000..bfbf097f6 --- /dev/null +++ b/tests/semantic/method-abstract-body.test @@ -0,0 +1,9 @@ +Invalid Code + +abstract class Foo { + public abstract void foo () { + } +} + +void main () { +} diff --git a/tests/semantic/method-abstract.test b/tests/semantic/method-abstract.test new file mode 100644 index 000000000..fe8f7ae83 --- /dev/null +++ b/tests/semantic/method-abstract.test @@ -0,0 +1,8 @@ +Invalid Code + +struct Foo { + public abstract void foo (); +} + +void main () { +} diff --git a/tests/semantic/method-async-ref-parameter.test b/tests/semantic/method-async-ref-parameter.test new file mode 100644 index 000000000..47a8a938d --- /dev/null +++ b/tests/semantic/method-async-ref-parameter.test @@ -0,0 +1,8 @@ +Packages: gio-2.0 +Invalid Code + +async void foo (ref int i) { +} + +void main () { +} diff --git a/tests/semantic/method-body.test b/tests/semantic/method-body.test new file mode 100644 index 000000000..47a376360 --- /dev/null +++ b/tests/semantic/method-body.test @@ -0,0 +1,6 @@ +Invalid Code + +void foo (); + +void main () { +} diff --git a/tests/semantic/method-class-abstract.test b/tests/semantic/method-class-abstract.test new file mode 100644 index 000000000..08df0e7e1 --- /dev/null +++ b/tests/semantic/method-class-abstract.test @@ -0,0 +1,8 @@ +Invalid Code + +class Foo { + public abstract void foo (); +} + +void main () { +} diff --git a/tests/semantic/method-derived-compact.test b/tests/semantic/method-derived-compact.test new file mode 100644 index 000000000..ac257a9f9 --- /dev/null +++ b/tests/semantic/method-derived-compact.test @@ -0,0 +1,13 @@ +Invalid Code + +[Compact] +class Foo { +} + +class Bar : Foo { + public virtual void foo () { + } +} + +void main () { +} diff --git a/tests/semantic/method-error-accessibility.test b/tests/semantic/method-error-accessibility.test new file mode 100644 index 000000000..f150aa84b --- /dev/null +++ b/tests/semantic/method-error-accessibility.test @@ -0,0 +1,11 @@ +Invalid Code + +errordomain FooError { + BAR +} + +public void foo () throws FooError { +} + +void main () { +} diff --git a/tests/semantic/method-extern-abstract.test b/tests/semantic/method-extern-abstract.test new file mode 100644 index 000000000..e207baf90 --- /dev/null +++ b/tests/semantic/method-extern-abstract.test @@ -0,0 +1,8 @@ +Invalid Code + +abstract class Foo { + public extern abstract void foo (); +} + +void main () { +} diff --git a/tests/semantic/method-extern-body.test b/tests/semantic/method-extern-body.test new file mode 100644 index 000000000..0ca2dc8d1 --- /dev/null +++ b/tests/semantic/method-extern-body.test @@ -0,0 +1,7 @@ +Invalid Code + +extern void foo () { +} + +void main () { +} diff --git a/tests/semantic/method-extern-virtual.test b/tests/semantic/method-extern-virtual.test new file mode 100644 index 000000000..0cac0b57b --- /dev/null +++ b/tests/semantic/method-extern-virtual.test @@ -0,0 +1,8 @@ +Invalid Code + +class Foo { + public extern virtual void foo (); +} + +void main () { +} diff --git a/tests/semantic/method-main-async.test b/tests/semantic/method-main-async.test new file mode 100644 index 000000000..df468fa9f --- /dev/null +++ b/tests/semantic/method-main-async.test @@ -0,0 +1,5 @@ +Packages: gio-2.0 +Invalid Code + +async void main () { +} diff --git a/tests/semantic/method-main-inline.test b/tests/semantic/method-main-inline.test new file mode 100644 index 000000000..c2afe6447 --- /dev/null +++ b/tests/semantic/method-main-inline.test @@ -0,0 +1,4 @@ +Invalid Code + +inline void main () { +} diff --git a/tests/semantic/method-main-throws.test b/tests/semantic/method-main-throws.test new file mode 100644 index 000000000..56f0ba144 --- /dev/null +++ b/tests/semantic/method-main-throws.test @@ -0,0 +1,8 @@ +Invalid Code + +errordomain FooError { + BAR +} + +void main () throws FooError { +} diff --git a/tests/semantic/method-override.test b/tests/semantic/method-override.test new file mode 100644 index 000000000..a7cf1b4f7 --- /dev/null +++ b/tests/semantic/method-override.test @@ -0,0 +1,7 @@ +Invalid Code + +override void foo () { +} + +void main () { +} diff --git a/tests/semantic/method-postcondition.test b/tests/semantic/method-postcondition.test new file mode 100644 index 000000000..672c1471f --- /dev/null +++ b/tests/semantic/method-postcondition.test @@ -0,0 +1,7 @@ +Invalid Code + +void foo (int i) ensures (i) { +} + +void main () { +} diff --git a/tests/semantic/method-precondition.test b/tests/semantic/method-precondition.test new file mode 100644 index 000000000..019740ddf --- /dev/null +++ b/tests/semantic/method-precondition.test @@ -0,0 +1,7 @@ +Invalid Code + +void foo (int i) requires (i) { +} + +void main () { +} diff --git a/tests/semantic/method-private-abstract.test b/tests/semantic/method-private-abstract.test new file mode 100644 index 000000000..27ae82c3b --- /dev/null +++ b/tests/semantic/method-private-abstract.test @@ -0,0 +1,8 @@ +Invalid Code + +abstract class Foo { + abstract void foo (); +} + +void main () { +} diff --git a/tests/semantic/method-private-override.test b/tests/semantic/method-private-override.test new file mode 100644 index 000000000..def7d8632 --- /dev/null +++ b/tests/semantic/method-private-override.test @@ -0,0 +1,14 @@ +Invalid Code + +class Foo { + public virtual void foo () { + } +} + +class Bar : Foo { + override void foo () { + } +} + +void main () { +} diff --git a/tests/semantic/method-private-virtual.test b/tests/semantic/method-private-virtual.test new file mode 100644 index 000000000..956ca34d0 --- /dev/null +++ b/tests/semantic/method-private-virtual.test @@ -0,0 +1,9 @@ +Invalid Code + +class Foo { + virtual void foo () { + } +} + +void main () { +} diff --git a/tests/semantic/method-protected.test b/tests/semantic/method-protected.test new file mode 100644 index 000000000..c1740d496 --- /dev/null +++ b/tests/semantic/method-protected.test @@ -0,0 +1,7 @@ +Invalid Code + +protected void foo () { +} + +void main () { +} diff --git a/tests/semantic/method-return-accessibility.test b/tests/semantic/method-return-accessibility.test new file mode 100644 index 000000000..91c3c9675 --- /dev/null +++ b/tests/semantic/method-return-accessibility.test @@ -0,0 +1,10 @@ +Invalid Code + +class Foo { +} + +public Foo foo () { +} + +void main () { +} diff --git a/tests/semantic/method-virtual-body.test b/tests/semantic/method-virtual-body.test new file mode 100644 index 000000000..82fd2d7f4 --- /dev/null +++ b/tests/semantic/method-virtual-body.test @@ -0,0 +1,6 @@ +Invalid Code + +public void foo (); + +void main () { +} diff --git a/tests/semantic/method-virtual.test b/tests/semantic/method-virtual.test new file mode 100644 index 000000000..553cd5605 --- /dev/null +++ b/tests/semantic/method-virtual.test @@ -0,0 +1,7 @@ +Invalid Code + +virtual void foo () { +} + +void main () { +} |