more tests

This commit is contained in:
gluax 2021-06-22 14:31:45 -07:00
parent af1aca3d9f
commit 957d73f33f
14 changed files with 75 additions and 10 deletions

View File

@ -0,0 +1,11 @@
/*
namespace: Compile
expectation: Fail
input_file: input/different_types_signed_fail.in
input_file: input/different_types_const_signed_fail.in
input_file: input/main_fail_type.in
*/
function main(const a: i32) {
let b = a * 2;
}

View File

@ -0,0 +1,11 @@
/*
namespace: Compile
expectation: Fail
input_file: input/different_types_const_unsigned_fail.in
input_file: input/different_types_unsigned_fail.in
input_file: input/main_fail_type.in
*/
function main(const a: u32) {
let b = a * 2;
}

View File

@ -1,10 +0,0 @@
/*
namespace: Compile
expectation: Fail
input_file: input/different_types_fail.in
input_file: input/main_fail_type.in
*/
function main(a: u32) {
let b = a * 2;
}

View File

@ -0,0 +1,11 @@
/*
namespace: Compile
expectation: Fail
input_file: input/different_types_signed_fail.in
input_file: input/different_types_const_signed_fail.in
input_file: input/var_in_both_sections_fail.in
*/
function main(a: i32) {
let b = a * 2;
}

View File

@ -0,0 +1,11 @@
/*
namespace: Compile
expectation: Fail
input_file: input/different_types_const_unsigned_fail.in
input_file: input/different_types_unsigned_fail.in
input_file: input/var_in_both_sections_fail.in
*/
function main(a: u32) {
let b = a * 2;
}

View File

@ -0,0 +1,2 @@
[constants]
a: i32 = 2i8;

View File

@ -0,0 +1,2 @@
[main]
a: i32 = 2i8;

View File

@ -0,0 +1,2 @@
[constants]
a: u32 = 2u8;

View File

@ -0,0 +1,5 @@
[main]
a: u32 = 2u32;
[constants]
a: u32 = 2u32;

View File

@ -0,0 +1,5 @@
---
namespace: Compile
expectation: Fail
outputs:
- " --> compiler-test:3:21\n |\n 3 | function main(const a: i32) {\n | ^\n |\n = Expected input variable `a` to be constant. Move input variable `a` to [constants] section of input file"

View File

@ -0,0 +1,5 @@
---
namespace: Compile
expectation: Fail
outputs:
- " --> compiler-test:3:21\n |\n 3 | function main(const a: u32) {\n | ^\n |\n = Expected input variable `a` to be constant. Move input variable `a` to [constants] section of input file"

View File

@ -0,0 +1,5 @@
---
namespace: Compile
expectation: Fail
outputs:
- " --> compiler-test:3:15\n |\n 3 | function main(a: i32) {\n | ^\n |\n = Input variable a declared twice"

View File

@ -0,0 +1,5 @@
---
namespace: Compile
expectation: Fail
outputs:
- " --> compiler-test:3:15\n |\n 3 | function main(a: u32) {\n | ^\n |\n = Input variable a declared twice"