(t *testing.T)
| 3 | import "testing" |
| 4 | |
| 5 | func TestDecodeError(t *testing.T) { |
| 6 | t.Parallel() |
| 7 | |
| 8 | _, err := UnmarshalItem([]string{"invalid-é"}) |
| 9 | |
| 10 | if err.Error() != "unmarshal error: character 8" { |
| 11 | t.Error("invalid error") |
| 12 | } |
| 13 | |
| 14 | _, err = UnmarshalItem([]string{`"é"`}) |
| 15 | if err.Error() != "invalid string format: character 2" { |
| 16 | t.Error("invalid error") |
| 17 | } |
| 18 | |
| 19 | if err.(*UnmarshalError).Unwrap().Error() != "invalid string format" { |
| 20 | t.Error("invalid wrapped error") |
| 21 | } |
| 22 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…