diff options
author | Giuliano Belinassi <giuliano.belinassi@usp.br> | 2020-08-22 17:43:43 -0300 |
---|---|---|
committer | Giuliano Belinassi <giuliano.belinassi@usp.br> | 2020-08-22 17:43:43 -0300 |
commit | a926878ddbd5a98b272c22171ce58663fc04c3e0 (patch) | |
tree | 86af256e5d9a9c06263c00adc90e5fe348008c43 /libgo/go/fmt/fmt_test.go | |
parent | 542730f087133690b47e036dfd43eb0db8a650ce (diff) | |
parent | 07cbaed8ba7d1b6e4ab3a9f44175502a4e1ecdb1 (diff) | |
download | gcc-devel/autopar_devel.zip gcc-devel/autopar_devel.tar.gz gcc-devel/autopar_devel.tar.bz2 |
Merge branch 'autopar_rebase2' into autopar_develdevel/autopar_devel
Quickly commit changes in the rebase branch.
Diffstat (limited to 'libgo/go/fmt/fmt_test.go')
-rw-r--r-- | libgo/go/fmt/fmt_test.go | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/libgo/go/fmt/fmt_test.go b/libgo/go/fmt/fmt_test.go index b9e3bc6..550c196 100644 --- a/libgo/go/fmt/fmt_test.go +++ b/libgo/go/fmt/fmt_test.go @@ -236,10 +236,10 @@ var fmtTests = []struct { {"%#q", "\U0010ffff", "``"}, {"%#+q", "\U0010ffff", "``"}, // Runes that are not valid. - {"%q", string(0x110000), `"�"`}, - {"%+q", string(0x110000), `"\ufffd"`}, - {"%#q", string(0x110000), "`�`"}, - {"%#+q", string(0x110000), "`�`"}, + {"%q", string(rune(0x110000)), `"�"`}, + {"%+q", string(rune(0x110000)), `"\ufffd"`}, + {"%#q", string(rune(0x110000)), "`�`"}, + {"%#+q", string(rune(0x110000)), "`�`"}, // characters {"%c", uint('x'), "x"}, @@ -463,6 +463,15 @@ var fmtTests = []struct { {"%#.4x", 1.0, "0x1.0000p+00"}, {"%#.4g", 1.0, "1.000"}, {"%#.4g", 100000.0, "1.000e+05"}, + {"%#.4g", 1.234, "1.234"}, + {"%#.4g", 0.1234, "0.1234"}, + {"%#.4g", 1.23, "1.230"}, + {"%#.4g", 0.123, "0.1230"}, + {"%#.4g", 1.2, "1.200"}, + {"%#.4g", 0.12, "0.1200"}, + {"%#.4g", 10.2, "10.20"}, + {"%#.4g", 0.0, "0.000"}, + {"%#.4g", 0.012, "0.01200"}, {"%#.0f", 123.0, "123."}, {"%#.0e", 123.0, "1.e+02"}, {"%#.0x", 123.0, "0x1.p+07"}, @@ -1459,7 +1468,7 @@ func (flagPrinter) Format(f State, c rune) { s := "%" for i := 0; i < 128; i++ { if f.Flag(i) { - s += string(i) + s += string(rune(i)) } } if w, ok := f.Width(); ok { |