Skip to content

Commit fc395a5

Browse files
committed
fix tests
1 parent dbe84b7 commit fc395a5

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

simplejson_go10_test.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@ func TestSimplejsonGo10(t *testing.T) {
1212
js, err := NewJson([]byte(`{
1313
"test": {
1414
"array": [1, "2", 3],
15-
"arraywithsubs": [{"subkeyone": 1},
16-
{"subkeytwo": 2, "subkeythree": 3}]
15+
"arraywithsubs": [
16+
{"subkeyone": 1},
17+
{"subkeytwo": 2, "subkeythree": 3}
18+
],
19+
"bignum": 8000000000
1720
}
1821
}`))
1922

@@ -38,4 +41,6 @@ func TestSimplejsonGo10(t *testing.T) {
3841

3942
mm := js.Get("test").Get("arraywithsubs").GetIndex(0).MustMap()
4043
assert.Equal(t, mm, map[string]interface{}{"subkeyone": float64(1)})
44+
45+
assert.Equal(t, js.Get("test").Get("bignum").MustInt64(), int64(8000000000))
4146
}

simplejson_go11_test.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@ func TestSimplejsonGo11(t *testing.T) {
1313
js, err := NewJson([]byte(`{
1414
"test": {
1515
"array": [1, "2", 3],
16-
"arraywithsubs": [{"subkeyone": 1},
17-
{"subkeytwo": 2, "subkeythree": 3}]
16+
"arraywithsubs": [
17+
{"subkeyone": 1},
18+
{"subkeytwo": 2, "subkeythree": 3}
19+
],
20+
"bignum": 9223372036854775807
1821
}
1922
}`))
2023

@@ -41,4 +44,6 @@ func TestSimplejsonGo11(t *testing.T) {
4144

4245
mm := js.Get("test").Get("arraywithsubs").GetIndex(0).MustMap()
4346
assert.Equal(t, mm, map[string]interface{}{"subkeyone": json.Number("1")})
47+
48+
assert.Equal(t, js.Get("test").Get("bignum").MustInt64(), int64(9223372036854775807))
4449
}

simplejson_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ func TestSimplejson(t *testing.T) {
1818
{"subkeytwo": 2, "subkeythree": 3}],
1919
"int": 10,
2020
"float": 5.150,
21-
"bignum": 9223372036854775807,
2221
"string": "simplejson",
2322
"bool": true
2423
}
@@ -86,7 +85,6 @@ func TestSimplejson(t *testing.T) {
8685
assert.Equal(t, 10, gp2)
8786

8887
assert.Equal(t, js.Get("test").Get("bool").MustBool(), true)
89-
assert.Equal(t, js.Get("test").Get("bignum").MustInt64(), int64(9223372036854775807))
9088

9189
js.Set("float2", 300.0)
9290
assert.Equal(t, js.Get("float2").MustFloat64(), 300.0)

0 commit comments

Comments
 (0)