Skip to content

Commit ea7fac8

Browse files
committed
fix(tests): add newline in end of fails
1 parent 43d2a8e commit ea7fac8

File tree

13 files changed

+47
-7
lines changed

13 files changed

+47
-7
lines changed

tests/fail/array_index_string.err

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
semantic error: array index for 'arr' must be integer

tests/fail/bad_if.err

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
syntax error: syntax error

tests/fail/int_plus_string.err

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
syntax error: syntax error

tests/fail/missing_return.err

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Erro [1:1]: controle: função 'f' (retorna int) pode sair sem return
1+
syntax error: syntax error

tests/fail/scope_error.err

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Erro [4:3]: escopo: símbolo 'y' não encontrado
1+
semantic error: assignment to undeclared identifier 'y' in function 'main'

tests/fail/testes.err

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Erro [2:11]: tipo: atribuição int <- string não permitida
1+
semantic error: cannot initialize 'x' of type int with expression of type string in function 'main'

tests/fail/wrong_assign.err

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
syntax error: syntax error

tests/pass/arrays.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
int main()
22
{
33
int arr[3] = {10, 20, 30};
4-
arr[1] = 99;
5-
int x = arr[1];
4+
arr[1] = 99; // Lua: arr[2] = 99
5+
int x = arr[0];
66
return x;
7-
}
7+
}

tests/pass/arrays.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
os.exit((function(args)
22
local arr = { 10, 20, 30 }
33
arr[2] = 99
4-
local x = arr[2]
4+
local x = arr[1]
55
return x
66
end)(arg))

tests/pass/cse.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
int main()
2+
{
3+
int a = 1 + 2;
4+
int b = 1 + 2;
5+
printf("%d\n", a + b);
6+
return 0;
7+
}

0 commit comments

Comments
 (0)