Commit 6fe9a8b7 authored by Rico Tzschichholz's avatar Rico Tzschichholz

tests: Add invalid assignment tests to increase coverage

parent 0df98c57
......@@ -467,6 +467,11 @@ TESTS = \
parser/yield-method.test \
parser/bug728574.vala \
parser/bug749576.vala \
semantic/assignment-element-incompatible-ownership.test \
semantic/assignment-element-incompatible-type.test \
semantic/assignment-same-variable.vala \
semantic/assignment-signal-incompatible-method.test \
semantic/assignment-signal-incompatible-type.test \
semantic/class-base-type-invalid.test \
semantic/class-base-type-less-accessible.test \
semantic/class-compact-derived-instance-field.test \
......
Invalid Code
void main () {
string s = "bar";
(unowned string)[] sa = { "foo" };
sa[0] = (owned) s;
}
Invalid Code
void main () {
string[] sa = { "foo" };
sa[0] = 42;
}
class Foo {
public int i = 23;
public Foo () {
i = i;
}
}
int i;
void main () {
string s = "foo";
s = s;
i = 42;
i = i;
}
Invalid Code
class Foo {
signal void bar ();
Foo () {
bar += foo;
}
void foo (string s) {
}
}
void main () {
}
Invalid Code
class Foo {
signal void bar ();
Foo () {
bar += "foo";
}
}
void main () {
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment