diff --git a/test.sh b/test.sh index 148d930..918df05 100755 --- a/test.sh +++ b/test.sh @@ -6,7 +6,12 @@ tester() cat src/*.🗿 tests/$val.🗿 tests/test.🗿 >tmp.🗿 golemc tmp.🗿 > tmp.asm orgaasm tmp.asm tmp.rom - orgaemu tmp.rom + if [ $val == "geadline" ] + then + orgaemu tmp.rom < tests/$val.input + else + orgaemu tmp.rom + fi echo done } diff --git a/tests/geadline.input b/tests/geadline.input new file mode 100644 index 0000000..625fff9 --- /dev/null +++ b/tests/geadline.input @@ -0,0 +1,3 @@ +yo +bozo +z^[[Dbo^[[C^[[C^[[Co diff --git a/tests/geadline.🗿 b/tests/geadline.🗿 new file mode 100644 index 0000000..c21636d --- /dev/null +++ b/tests/geadline.🗿 @@ -0,0 +1,22 @@ +main() +{ + local ptr; + + name = "geadline"; + + ptr = geadline(""); + test_str(ptr, "yo", ""); + free(ptr); + + ptr = geadline(""); + test_str(ptr, "bozo", ""); + free(ptr); + + ptr = geadline(""); + test_str(ptr, "bozo", "arrow"); + free(ptr); + + ptr = geadline(""); + test_num(ptr, 0, ""); + free(ptr); +}