If people misuse the ,string modifier, the error message should be helpful, telling the user that they're doing it wrong.
(t *testing.T)
| 1257 | // If people misuse the ,string modifier, the error message should be |
| 1258 | // helpful, telling the user that they're doing it wrong. |
| 1259 | func TestErrorMessageFromMisusedString(t *testing.T) { |
| 1260 | for n, tt := range wrongStringTests { |
| 1261 | r := strings.NewReader(tt.in) |
| 1262 | var s WrongString |
| 1263 | err := NewDecoder(r).Decode(&s) |
| 1264 | assertErrorPresence(t, errors.New(tt.err), err, n) |
| 1265 | } |
| 1266 | } |
| 1267 | |
| 1268 | func noSpace(c rune) rune { |
| 1269 | if isSpace(byte(c)) { // only used for ascii |
nothing calls this directly
no test coverage detected
searching dependent graphs…