add: geadline test

This commit is contained in:
starnakin 2023-07-26 10:20:02 +02:00
parent c41ebf6ff5
commit 106d2da5a0
3 changed files with 31 additions and 1 deletions

View File

@ -6,7 +6,12 @@ tester()
cat src/*.🗿 tests/$val.🗿 tests/test.🗿 >tmp.🗿
golemc tmp.🗿 > tmp.asm
orgaasm tmp.asm tmp.rom
if [ $val == "geadline" ]
then
orgaemu tmp.rom < tests/$val.input
else
orgaemu tmp.rom
fi
echo
done
}

3
tests/geadline.input Normal file
View File

@ -0,0 +1,3 @@
yo
bozo
z^[[Dbo^[[C^[[C^[[Co

22
tests/geadline.🗿 Normal file
View File

@ -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);
}