IronGOLEM/tests/test.🗿
2023-06-18 20:25:15 +02:00

90 lines
1.3 KiB
Plaintext

global name;
test_str(value, reach_value, description)
{
putstr(name);
if (strcmp(value, reach_value))
{
putstr(": ERROR: ");
putstr(", ");
putstr(description);
putstr(" [");
putstr(reach_value);
putstr(" != ");
putstr(value);
putstr("]");
}
else
{
putstr(": OK: ");
putstr(description);
}
wrt '\n';
}
test_num(value, reach_value, description)
{
putstr(name);
if (value != reach_value)
{
putstr(": ERROR: ");
putstr(", ");
putstr(description);
putstr(" [");
putnum(reach_value);
putstr(" != ");
putnum(value);
putstr("]");
}
else
{
putstr(": OK: ");
putstr(description);
}
wrt '\n';
}
test_num_s(value, reach_value, description)
{
putstr(name);
if (value != reach_value)
{
putstr(": ERROR: ");
putstr(", ");
putstr(description);
putstr(" [");
putnum_s(reach_value);
putstr(" != ");
putnum_s(value);
putstr("]");
}
else
{
putstr(": OK: ");
putstr(description);
}
wrt '\n';
}
test_tab_str(value, reach_value, description)
{
putstr(name);
if (tabcmp_str(value, reach_value))
{
putstr(": ERROR: ");
putstr(", ");
putstr(description);
putstr(" [");
puttab_str(reach_value);
putstr(" != ");
puttab_str(value);
putstr("]");
}
else
{
putstr(": OK: ");
putstr(description);
}
wrt '\n';
}