1
0
Fork 0
mirror of https://github.com/tailix/libkernaux.git synced 2024-11-27 11:14:42 -05:00

Add more tests for "kernaux_itoa"

This commit is contained in:
Alex Kotov 2020-11-30 05:52:29 +05:00
parent 10bf7e804b
commit 0c0bde186f
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08

View file

@ -68,7 +68,7 @@ int main()
{
char buffer[10];
kernaux_itoa(495, buffer, 10);
kernaux_itoa(495, buffer, 'd');
assert(buffer[0] == '4');
assert(buffer[1] == '9');
@ -76,5 +76,18 @@ int main()
assert(buffer[3] == '\0');
}
{
char buffer[10];
kernaux_itoa(-7012, buffer, 'd');
assert(buffer[0] == '-');
assert(buffer[1] == '7');
assert(buffer[2] == '0');
assert(buffer[3] == '1');
assert(buffer[4] == '2');
assert(buffer[5] == '\0');
}
return 0;
}