Skip to content

Commit

Permalink
[add] more bad tests
Browse files Browse the repository at this point in the history
  • Loading branch information
KuronoSangatsu7 committed Apr 11, 2023
1 parent 29af591 commit 4b04b82
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ parser
*.o
lexer.cpp
*.out
**./outputs/
tests/outputs/
build/
20 changes: 20 additions & 0 deletions tests/inputs/invalid/syntax/undefined_routine.crbc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
routine div (x : real, y : real) : integer is

var z : real;
z := x / y;

return z;
end

routine main () : integer is

var x : real is divide( 4.4 , 2.2 );

if x > 1.1 then
print(1);
else
print(0);
end

return 0;
end
20 changes: 20 additions & 0 deletions tests/inputs/invalid/syntax/undefined_var.crbc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
routine div (x : real, y : real) is

var z : real;
z := x / b;

return z;
end

routine main () : integer is

var x : real is div( 4.4 , 2.2 );

if x > 1.1 then
print(1);
else
print(0);
end

return 0;
end
2 changes: 1 addition & 1 deletion tests/inputs/invalid/types/bad_routines/bad_return.crbc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
routine div (x : real, y : real) is
routine div (x : real, y : real) : integer is

var z : real;
z := x / y;
Expand Down

0 comments on commit 4b04b82

Please sign in to comment.