tests/sprintf: add tests for float zero padding
@@ -64,6 +64,10 @@ int main() {
assert(!strcmp(buf, " INF") || !strcmp(buf, "INFINITY"));
sprintf(buf, "%4F", NAN);
assert(!strcmp(buf, " NAN"));
+ sprintf(buf, "%05.2f", 1.0);
+ assert(!strcmp(buf, "01.00"));
+ sprintf(buf, "%09f", INFINITY); // 0 ignored when padding infs
+ assert(!strcmp(buf, " inf") || !strcmp(buf, " infinity"));
// TODO: We don't yet round properly
// sprintf(buf, "%5.2f", 1.2);
// assert(!strcmp(buf, " 1.20"));
