From 106d2da5a0129097668f9aa1f300bf12766adbe2 Mon Sep 17 00:00:00 2001 From: starnakin Date: Wed, 26 Jul 2023 10:20:02 +0200 Subject: [PATCH] add: geadline test --- test.sh | 7 ++++++- tests/geadline.input | 3 +++ tests/geadline.🗿 | 22 ++++++++++++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 tests/geadline.input create mode 100644 tests/geadline.🗿 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); +}