summaryrefslogtreecommitdiff
path: root/compat/json/borrowed_number_test.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2023-02-07 14:01:44 -0700
committerLuke Shumaker <lukeshu@lukeshu.com>2023-02-10 14:09:56 -0700
commit483bbdc970b26d774ace39edfde8420aba53b742 (patch)
treeee5fcacbba4d4eb7c44e4cb1f35fb950f11aee1d /compat/json/borrowed_number_test.go
parent480ccfd05a13ac36516c536a71203280a31b4d28 (diff)
Sync borrowed code from Go 1.20
New tests mean encode.go and compat.go also need some bugfixes.
Diffstat (limited to 'compat/json/borrowed_number_test.go')
-rw-r--r--compat/json/borrowed_number_test.go15
1 files changed, 0 insertions, 15 deletions
diff --git a/compat/json/borrowed_number_test.go b/compat/json/borrowed_number_test.go
index e7819c6..9709fb4 100644
--- a/compat/json/borrowed_number_test.go
+++ b/compat/json/borrowed_number_test.go
@@ -119,18 +119,3 @@ func TestNumberIsValid(t *testing.T) {
}
}
}
-
-func BenchmarkNumberIsValid(b *testing.B) {
- s := "-61657.61667E+61673"
- for i := 0; i < b.N; i++ {
- isValidNumber(s)
- }
-}
-
-func BenchmarkNumberIsValidRegexp(b *testing.B) {
- var jsonNumberRegexp = regexp.MustCompile(`^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$`)
- s := "-61657.61667E+61673"
- for i := 0; i < b.N; i++ {
- jsonNumberRegexp.MatchString(s)
- }
-}