mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Incorrect justify formatting of integers.
This commit is contained in:
@@ -1,5 +1,20 @@
|
||||
module std::io @test;
|
||||
|
||||
fn void printf_int()
|
||||
{
|
||||
String s;
|
||||
s = string::new_format("[%-10d]", 78);
|
||||
assert(s == "[78 ]");
|
||||
s = string::new_format("[%10d]", 78);
|
||||
assert(s == "[ 78]");
|
||||
s = string::new_format("[%010d]", 78);
|
||||
assert(s == "[0000000078]");
|
||||
s = string::new_format("[%+10d]", 78);
|
||||
assert(s == "[ +78]");
|
||||
s = string::new_format("[%-+10d]", 78);
|
||||
assert(s == "[+78 ]");
|
||||
}
|
||||
|
||||
fn void printf_a()
|
||||
{
|
||||
String s;
|
||||
|
||||
Reference in New Issue
Block a user