(t *testing.T)
| 744 | ) |
| 745 | |
| 746 | func 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 | |
| 761 | func TestDecodeLines(t *testing.T) { |
| 762 | tests := []struct { |