mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-04 15:51:15 -03:00
Fix and add tests for format_long_safe with negative numbers
This commit is contained in:
@@ -296,6 +296,12 @@ static void test_format(void)
|
||||
format_long_safe(buff1, j);
|
||||
sprintf(buff2, "%d", j);
|
||||
do_test(! strcmp(buff1, buff2));
|
||||
|
||||
wchar_t wbuf1[128], wbuf2[128];
|
||||
format_long_safe(wbuf1, j);
|
||||
swprintf(wbuf2, 128, L"%d", j);
|
||||
do_test(! wcscmp(wbuf1, wbuf2));
|
||||
|
||||
}
|
||||
|
||||
long q = LONG_MIN;
|
||||
@@ -303,7 +309,6 @@ static void test_format(void)
|
||||
format_long_safe(buff1, q);
|
||||
sprintf(buff2, "%ld", q);
|
||||
do_test(! strcmp(buff1, buff2));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user