(t *testing.T)
| 1353 | } |
| 1354 | |
| 1355 | func TestDecoder_ErrorUnused_NotSetable(t *testing.T) { |
| 1356 | t.Parallel() |
| 1357 | |
| 1358 | // lowercase vsilent is unexported and cannot be set |
| 1359 | input := map[string]interface{}{ |
| 1360 | "vsilent": "false", |
| 1361 | } |
| 1362 | |
| 1363 | var result Basic |
| 1364 | config := &DecoderConfig{ |
| 1365 | ErrorUnused: true, |
| 1366 | Result: &result, |
| 1367 | } |
| 1368 | |
| 1369 | decoder, err := NewDecoder(config) |
| 1370 | if err != nil { |
| 1371 | t.Fatalf("err: %s", err) |
| 1372 | } |
| 1373 | |
| 1374 | err = decoder.Decode(input) |
| 1375 | if err == nil { |
| 1376 | t.Fatal("expected error") |
| 1377 | } |
| 1378 | } |
| 1379 | func TestDecoder_ErrorUnset(t *testing.T) { |
| 1380 | t.Parallel() |
| 1381 |
nothing calls this directly
no test coverage detected