Skip to content

Commit eb11b31

Browse files
committed
added test for padding fill char utf
1 parent a8130cb commit eb11b31

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/std/fmt.zig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2809,6 +2809,15 @@ test "padding" {
28092809
try expectFmt("a====", "{c:=<5}", .{'a'});
28102810
}
28112811

2812+
test "padding fill char utf" {
2813+
try expectFmt("──crêpe───", "{s:─^10}", .{"crêpe"});
2814+
try expectFmt("─────crêpe", "{s:─>10}", .{"crêpe"});
2815+
try expectFmt("crêpe─────", "{s:─<10}", .{"crêpe"});
2816+
try expectFmt("────a", "{c:─>5}", .{'a'});
2817+
try expectFmt("──a──", "{c:─^5}", .{'a'});
2818+
try expectFmt("a────", "{c:─<5}", .{'a'});
2819+
}
2820+
28122821
test "decimal float padding" {
28132822
const number: f32 = 3.1415;
28142823
try expectFmt("left-pad: **3.141\n", "left-pad: {d:*>7.3}\n", .{number});

0 commit comments

Comments
 (0)