(t *testing.T)
| 1328 | } |
| 1329 | |
| 1330 | func TestDecoder_ErrorUnused(t *testing.T) { |
| 1331 | t.Parallel() |
| 1332 | |
| 1333 | input := map[string]interface{}{ |
| 1334 | "vstring": "hello", |
| 1335 | "foo": "bar", |
| 1336 | } |
| 1337 | |
| 1338 | var result Basic |
| 1339 | config := &DecoderConfig{ |
| 1340 | ErrorUnused: true, |
| 1341 | Result: &result, |
| 1342 | } |
| 1343 | |
| 1344 | decoder, err := NewDecoder(config) |
| 1345 | if err != nil { |
| 1346 | t.Fatalf("err: %s", err) |
| 1347 | } |
| 1348 | |
| 1349 | err = decoder.Decode(input) |
| 1350 | if err == nil { |
| 1351 | t.Fatal("expected error") |
| 1352 | } |
| 1353 | } |
| 1354 | |
| 1355 | func TestDecoder_ErrorUnused_NotSetable(t *testing.T) { |
| 1356 | t.Parallel() |
nothing calls this directly
no test coverage detected