Skip to content

Commit 08455d8

Browse files
committed
refactor(tests): move to only fail/pass
1 parent 7dab9b4 commit 08455d8

34 files changed

+82
-60
lines changed
File renamed without changes.

tests/fail/array_index_string.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
int main()
2+
{
3+
int arr[2];
4+
int x = arr["0"]; // E003: índice de array não numérico
5+
return 0;
6+
}

tests/fail/bad_if.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
int main()
2+
{
3+
if ("texto")
4+
{
5+
} // E002: condição não booleana em if (use comparação explícita)
6+
}

tests/fail/int_plus_string.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
int main()
2+
{
3+
int a = 1;
4+
char *s = "x";
5+
int z = a + s; // E001: tipo inválido em operação aritmética
6+
}

tests/fail/missing_return.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
int f(int a)
2+
{
3+
if (a > 0)
4+
return a;
5+
// falta return em outro ramo
6+
}
7+
8+
int main()
9+
{
10+
return 0;
11+
}
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
int main() {
1+
int main()
2+
{
23
int x = 1;
3-
{ int y = 2; }
4+
{
5+
int y = 2;
6+
}
47
y = 3; // fora do escopo
58
return 0;
69
}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
int main() {
1+
int main()
2+
{
23
int x = "hello";
34
return 0;
45
}

0 commit comments

Comments
 (0)