Fix jsonpb for Go 1.8
An upcoming change in Go1.8 (https://go-review.googlesource.com/30371) changes
the output of JSON to be more compliant with the ES6 standard. This causes
the tests to fail.
We fix the test by simply bumping the floating point numbers higher to
always induce the scientific notation format in JSON.
PiperOrigin-RevId: 135504815
diff --git a/jsonpb/jsonpb_test.go b/jsonpb/jsonpb_test.go
index bd1449c..78f67c4 100644
--- a/jsonpb/jsonpb_test.go
+++ b/jsonpb/jsonpb_test.go
@@ -108,7 +108,7 @@
RSint32: []int32{-1, -2, -3},
RSint64: []int64{-6789012345, -3456789012},
RFloat: []float32{3.14, 6.28},
- RDouble: []float64{299792458, 6.62606957e-34},
+ RDouble: []float64{299792458 * 1e20, 6.62606957e-34},
RString: []string{"happy", "days"},
RBytes: [][]byte{[]byte("skittles"), []byte("m&m's")},
}
@@ -122,7 +122,7 @@
`"rSint32":[-1,-2,-3],` +
`"rSint64":["-6789012345","-3456789012"],` +
`"rFloat":[3.14,6.28],` +
- `"rDouble":[2.99792458e+08,6.62606957e-34],` +
+ `"rDouble":[2.99792458e+28,6.62606957e-34],` +
`"rString":["happy","days"],` +
`"rBytes":["c2tpdHRsZXM=","bSZtJ3M="]` +
`}`
@@ -165,7 +165,7 @@
6.28
],
"rDouble": [
- 2.99792458e+08,
+ 2.99792458e+28,
6.62606957e-34
],
"rString": [