parent
55f2519b16
commit
48308d45d9
2 changed files with 2 additions and 1 deletions
|
@ -65,7 +65,7 @@ func (d *decodeState) scanNext() {
|
||||||
func (d *decodeState) scanWhile(op int) (isFloat bool) {
|
func (d *decodeState) scanWhile(op int) (isFloat bool) {
|
||||||
s, data, i := &d.scan, d.data, d.off
|
s, data, i := &d.scan, d.data, d.off
|
||||||
for i < len(data) {
|
for i < len(data) {
|
||||||
if data[i] == '.' {
|
if data[i] == '.' || data[i] == 'e' || data[i] == 'E' {
|
||||||
isFloat = true
|
isFloat = true
|
||||||
}
|
}
|
||||||
newOp := s.step(s, data[i])
|
newOp := s.step(s, data[i])
|
||||||
|
|
|
@ -59,6 +59,7 @@ func TestJSON(t *testing.T) {
|
||||||
"arr": ARR{1, 2, 3, MAP{"a": false, "b": 109.4}}})
|
"arr": ARR{1, 2, 3, MAP{"a": false, "b": 109.4}}})
|
||||||
|
|
||||||
testJSONEncodeDecode(t, MAP{"id1": 7075984636689534001, "id2": 7075984636689534002})
|
testJSONEncodeDecode(t, MAP{"id1": 7075984636689534001, "id2": 7075984636689534002})
|
||||||
|
testJSONEncodeDecode(t, ARR{1e3, 1E7})
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestDecode(t *testing.T) {
|
func TestDecode(t *testing.T) {
|
||||||
|
|
Loading…
Reference in a new issue