forked from starnakin/IronGOLEM
add: signed number
This commit is contained in:
@ -2,11 +2,12 @@ main()
|
||||
{
|
||||
name = "aton_s";
|
||||
|
||||
test_num(aton_s("33"), 33, "");
|
||||
test_num(aton_s(""), 0, "");
|
||||
test_num(aton_s("40"), 40, "");
|
||||
test_num(aton_s("1"), 1, "");
|
||||
test_num(aton_s("-"), 0, "");
|
||||
test_num(aton_s("-40"), 0 - 40, "");
|
||||
test_num(aton_s("-1"), 0 - 1, "");
|
||||
test_num_s(aton_s("33"), 33, "");
|
||||
test_num_s(aton_s(""), 0, "");
|
||||
test_num_s(aton_s("40"), 40, "");
|
||||
test_num_s(aton_s("1"), 1, "");
|
||||
test_num_s(aton_s("-"), 0, "");
|
||||
test_num_s(aton_s("-40"), 0 - 40, "");
|
||||
test_num_s(aton_s("-1"), 0 - 1, "");
|
||||
test_num_s(aton_s("-1"), 0 - 2, "");
|
||||
}
|
||||
|
22
tests/test.🗿
22
tests/test.🗿
@ -44,6 +44,28 @@ test_num(value, reach_value, 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);
|
||||
|
Reference in New Issue
Block a user