MCPcopy Create free account
hub / github.com/buger/jsonparser / TestGetEscapedKey

Function TestGetEscapedKey

deep_spec_test.go:1069–1078  ·  view source on GitHub ↗

Verifies: SYS-REQ-024 [boundary] Escaped key in payload matches decoded path segment.

(t *testing.T)

Source from the content-addressed store, hash-verified

1067// Verifies: SYS-REQ-024 [boundary]
1068// Escaped key in payload matches decoded path segment.
1069func TestGetEscapedKey(t *testing.T) {
1070 data := []byte(`{"a\nb":42}`)
1071 val, _, _, err := Get(data, "a\nb")
1072 if err != nil {
1073 t.Fatalf("Get escaped key error: %v", err)
1074 }
1075 if string(val) != "42" {
1076 t.Fatalf("Get escaped key = %q, want %q", string(val), "42")
1077 }
1078}
1079
1080// Verifies: SYS-REQ-025 [boundary]
1081// String value returned without surrounding quotes and without unescaping.

Callers

nothing calls this directly

Calls 1

GetFunction · 0.85

Tested by

no test coverage detected