MCPcopy Create free account
hub / github.com/tidwall/gjson / TestNumFloatString

Function TestNumFloatString

gjson_test.go:1313–1320  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1311}
1312
1313func TestNumFloatString(t *testing.T) {
1314 var i int64 = -9007199254740993
1315 j := fmt.Sprintf(`{"data":[ "hello", %d ]}`, i) //No quotes around value!!
1316 res := Get(j, "data.1")
1317 if res.String() != "-9007199254740993" {
1318 t.Fatalf("expected '%v', got '%v'", "-9007199254740993", res.String())
1319 }
1320}
1321
1322func TestDuplicateKeys(t *testing.T) {
1323 // this is valid json according to the JSON spec

Callers

nothing calls this directly

Calls 2

GetFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…