Skip to content

Commit eb8c955

Browse files
committed
add tests for checking float with #(sharp) flag
1 parent ca6628b commit eb8c955

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/fmt/fmt_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,9 @@ var fmtTests = []struct {
463463
{"%#.4x", 1.0, "0x1.0000p+00"},
464464
{"%#.4g", 1.0, "1.000"},
465465
{"%#.4g", 100000.0, "1.000e+05"},
466+
{"%#.4g", 1.23, "1.230"},
467+
{"%#.4g", 0.123, "0.1230"},
468+
{"%#.4g", 0.12, "0.1200"},
466469
{"%#.0f", 123.0, "123."},
467470
{"%#.0e", 123.0, "1.e+02"},
468471
{"%#.0x", 123.0, "0x1.p+07"},

0 commit comments

Comments
 (0)