MCPcopy Index your code
hub / github.com/segmentio/encoding / TestDecodeStructFieldCaseInsensitive

Function TestDecodeStructFieldCaseInsensitive

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

Source from the content-addressed store, hash-verified

744)
745
746func TestDecodeStructFieldCaseInsensitive(t *testing.T) {
747 b := []byte(`{ "type": "changed" }`)
748 s := struct {
749 Type string
750 }{"unchanged"}
751
752 if err := Unmarshal(b, &s); err != nil {
753 t.Error(err)
754 }
755
756 if s.Type != "changed" {
757 t.Error("s.Type: expected to be changed but found", s.Type)
758 }
759}
760
761func TestDecodeLines(t *testing.T) {
762 tests := []struct {

Callers

nothing calls this directly

Calls 2

UnmarshalFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…