aboutsummaryrefslogtreecommitdiff
path: root/src/strconv/ftoa_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/strconv/ftoa_test.go')
-rw-r--r--src/strconv/ftoa_test.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/strconv/ftoa_test.go b/src/strconv/ftoa_test.go
index 755c986b86..99cca17542 100644
--- a/src/strconv/ftoa_test.go
+++ b/src/strconv/ftoa_test.go
@@ -212,6 +212,15 @@ func TestFtoaRandom(t *testing.T) {
}
}
+func TestFormatFloatInvalidBitSize(t *testing.T) {
+ defer func() {
+ if r := recover(); r == nil {
+ t.Fatalf("expected panic due to invalid bitSize")
+ }
+ }()
+ _ = FormatFloat(3.14, 'g', -1, 100)
+}
+
var ftoaBenches = []struct {
name string
float float64