add: test init

This commit is contained in:
Camille Chauvet 2023-06-12 18:26:35 +00:00
parent c928153a54
commit 37d2b05896
2 changed files with 35 additions and 0 deletions

4
test.sh Executable file
View File

@ -0,0 +1,4 @@
cat src/$1.🗿 tests/$1.🗿 tests/test.🗿 >tmp.🗿
golemc tmp.🗿 > tmp.asm
orgaasm tmp.asm tmp.rom
orgaemu tmp.rom

31
tests/test.🗿 Normal file
View File

@ -0,0 +1,31 @@
putstr(str){
local i;
i = 0;
loop {
if ([str + i] == 0)
return;
wrt [str + i];
i++;
}
}
test(value, reach_value, error_message)
{
putstr(name);
if (value != reach_value)
{
putstr(": ERROR: ");
putstr(", ");
putstr(error_message);
putstr(" [");
putstr(reach_value);
putstr(" != ");
putstr(value);
putstr("]");
}
else
{
putstr(": OK: ");
}
wrt '\n';
}