Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update all the test_script files to use TAP functions and add a new s…
…yntax test for script dispatching
- Loading branch information
1 parent
1f866c4
commit ec3a907
Showing
5 changed files
with
18 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ src/gen_*.pir | |
*.c | ||
*.o | ||
*.pbc | ||
*~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
% Test that a script file (without a function declaration) is executed directly | ||
printf("ok 13\n"); | ||
ok(1, "executed script"); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,4 @@ | ||
% A more complicated test script with if statements to prove that it still works | ||
% as a script | ||
% Second test that a script executes as expected. | ||
|
||
x = 1; | ||
if x == 1 | ||
printf("ok 14\n"); | ||
else | ||
printf("not ok 14\n"); | ||
endif | ||
is(x, 1, "this script works too") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
% Test that if there is a function declaration here, we call that instead of | ||
% other stuff in the file | ||
% Test that if there is a function declaration here of the same name, we | ||
% call that instead of other stuff in the file | ||
|
||
printf("not ok 15\n"); | ||
ok(0, "executed other stuff") | ||
|
||
function test_script3() | ||
printf("ok 15\n"); | ||
ok(1, "executed correctly"); | ||
endfunction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
plan(3); | ||
|
||
addpath("t/lib/"); | ||
|
||
% Show that we can find and execute a script file | ||
test_script(); % Test 1 | ||
|
||
test_script2(); % Test 2 | ||
|
||
test_script3(); % Test 3 |