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:
parent
10bf7e804b
commit
0c0bde186f
1 changed files with 14 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue