MCPcopy Create free account
hub / github.com/segmentio/encoding / TestDontMatchCaseIncensitiveStructFields

Function TestDontMatchCaseIncensitiveStructFields

json/json_test.go:928–941  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

926}
927
928func TestDontMatchCaseIncensitiveStructFields(t *testing.T) {
929 b := []byte(`{ "type": "changed" }`)
930 s := struct {
931 Type string
932 }{"unchanged"}
933
934 if _, err := Parse(b, &s, DontMatchCaseInsensitiveStructFields); err != nil {
935 t.Error(err)
936 }
937
938 if s.Type != "unchanged" {
939 t.Error("s.Type: expected to be unchanged but found", s.Type)
940 }
941}
942
943func TestMarshalFuzzBugs(t *testing.T) {
944 tests := []struct {

Callers

nothing calls this directly

Calls 2

ParseFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…