Commit 9653ac05 authored by Corentin Noël's avatar Corentin Noël Committed by Rico Tzschichholz

tests: Add more "parser" tests to increase coverage

parent 1c408f61
......@@ -334,12 +334,62 @@ TESTS = \
annotations/description.vala \
annotations/noaccessormethod.test \
parser/assignment.vala \
parser/attribute-duplicate.test \
parser/attribute-wrong-number.test \
parser/constructor-no-new.test \
parser/constructor-no-static-class.test \
parser/continue-statement.vala \
parser/creation-no-abstract.test \
parser/creation-no-override.test \
parser/creation-no-virtual.test \
parser/delegate-no-new.test \
parser/destructor-no-new.test \
parser/destructor-no-static-class.test \
parser/destructor-wrong-name.test \
parser/do-statement.vala \
parser/expect-endbrace.test \
parser/expect-error.test \
parser/field-no-abstract.test \
parser/field-no-override.test \
parser/field-no-static-class.test \
parser/field-no-virtual.test \
parser/foreach-no-type.test \
parser/function-syntax-error.test \
parser/inner-array-size.test \
parser/invalid-brace.test \
parser/method-no-abstract-override.test \
parser/method-no-abstract-virtual-override.test \
parser/method-no-abstract-virtual.test \
parser/method-no-class-abstract.test \
parser/method-no-class-override.test \
parser/method-no-class-virtual.test \
parser/method-no-static-abstract.test \
parser/method-no-static-class.test \
parser/method-no-static-override.test \
parser/method-no-static-virtual.test \
parser/method-no-virtual-override.test \
parser/namespace-missing-bracket.test \
parser/preprocessor.vala \
parser/property-default-redefined.test \
parser/property-get-must-have-body.test \
parser/property-get-redefined.test \
parser/property-get-set-construct.test \
parser/property-no-abstract-override.test \
parser/property-no-abstract-virtual.test \
parser/property-no-abstract-virtual-override.test \
parser/property-no-static-class.test \
parser/property-no-virtual-override.test \
parser/property-set-must-have-body.test \
parser/property-set-redefined.test \
parser/signal-no-class.test \
parser/signal-no-static.test \
parser/statement-outside-root.test \
parser/switch-statement.vala \
parser/template.vala \
parser/tuple.vala \
parser/unsupported-property-async.test \
parser/unsupported-property-throws.test \
parser/yield-method.test \
semantic/field-accessibility.test \
semantic/field-compact-static.test \
semantic/field-external.test \
......
......@@ -6,9 +6,10 @@ void main () {
i *= 2;
i /= 2;
i |= 1;
i &= 1;
i &= 1;
i ^= 1;
i %= 1;
i = ~1;
i <<= 2;
i >>= 2;
}
Invalid Code
[CCode (cname = "test1"), CCode (cname = "test2")]
void main () {
}
Invalid Code
[Attribute (prop = -a)]
void main () {
}
Invalid Code
public class Test {
new construct {
}
}
void main () {
}
Invalid Code
public class Test {
static class construct {
}
}
void main () {
}
Invalid Code
public class Test {
abstract Test () {
}
}
void main () {
}
Invalid Code
public class Test {
override Test () {
}
}
void main () {
}
Invalid Code
public class Test {
virtual Test () {
}
}
void main () {
}
Invalid Code
public new delegate void MyDelegate ();
void main () {
}
Invalid Code
public class Test {
new ~Test () {
}
}
void main () {
}
Invalid Code
public class Test {
static class ~Test () {
}
}
void main () {
}
Invalid Code
public class Test {
~TestTypo () {
}
}
void main () {
}
Invalid Code
void main () {
if (true) {
return;
}
Invalid Code
public private class Test {
}
void main () {
}
Invalid Code
public class Test {
abstract int i;
}
void main () {
}
Invalid Code
public class Test {
override int i;
}
void main () {
}
Invalid Code
public class Test {
static class int i;
}
void main () {
}
Invalid Code
public class Test {
virtual int i;
}
void main () {
}
Invalid Code
void main () {
int[] test = {};
foreach (t in test) {
}
}
Invalid Code
void int main () {
}
Invalid Code
void main () {
var test = new string[4][];
}
Invalid Code
void main () {
}
}
Invalid Code
public class Test {
abstract override void test () {
}
}
void main () {
}
Invalid Code
public class Test {
abstract virtual override void test () {
}
}
void main () {
}
Invalid Code
public class Test {
abstract virtual void test () {
}
}
void main () {
}
Invalid Code
public class Test {
class abstract void test () {
}
}
void main () {
}
Invalid Code
public class Test {
class override void test () {
}
}
void main () {
}
Invalid Code
public class Test {
class virtual void test () {
}
}
void main () {
}
Invalid Code
public class Test {
static abstract void test () {
}
}
void main () {
}
Invalid Code
public class Test {
static class void test () {
}
}
void main () {
}
Invalid Code
public class Test {
static override void test () {
}
}
void main () {
}
Invalid Code
public class Test {
class virtual void test () {
}
}
void main () {
}
Invalid Code
public class Test {
abstract override void test () {
}
}
void main () {
}
Invalid Code
void main () {
}
namespace Test {
Invalid Code
public class Test {
public int i { get; set; default=0; default=1; }
}
void main () {
}
Invalid Code
public class Test {
public int i {
get;
set {
return 0;
}
}
}
void main () {
}
Invalid Code
public class Test {
public int i {
get;
get {
return 0;
}
set {
}
}
}
void main () {
}
Invalid Code
public class Test {
public int i { get; set; delete; }
}
void main () {
}
Invalid Code
public class Test {
abstract override int i { get; set; }
}
void main () {
}
Invalid Code
public class Test {
abstract virtual override int i { get; set; }
}
void main () {
}
Invalid Code
public class Test {
abstract virtual int i { get; set; }
}
void main () {
}
Invalid Code
public class Test {
static class int i { get; set; }
}
void main () {
}
Invalid Code
public class Test {
virtual override int i { get; set; }
}
void main () {
}
Invalid Code
public class Test {
public int i {
get {
return 0;
}
set;
}
}
void main () {
}
Invalid Code
public class Test {
public int i {
get {
return 0;
}
set;
set {
}
}
}
void main () {
}
Invalid Code
public class Test {
public class signal void test ();
}
void main () {
}
Invalid Code
public class Test {
public static signal void test ();
}
void main () {
}
Invalid Code
namespace Test {
var i = {};
}
void main () {
}
......@@ -11,4 +11,8 @@ void main () {
(i, j) = BAR;
assert (i == 42);
assert (j == 4711);
var (test, test2) = new int[] { 23, 51 };
assert (test == 23);
assert (test2 == 51);
}
Invalid Code
public class Test {
public async int i { get; set; }
}
void main () {
}
Invalid Code
public class Test {
public int i throws int { get; set; }
}
void main () {
}
Invalid Code
async void test () {
yield "";
}
void main () {
test.begin ();
}
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