$ go test -v -run TestConfiguration*
(t *testing.T)
| 12 | // $ go test -v -run TestConfiguration* |
| 13 | |
| 14 | func TestConfigurationStatic(t *testing.T) { |
| 15 | def := DefaultConfiguration() |
| 16 | |
| 17 | app := New() |
| 18 | afterNew := *app.config |
| 19 | |
| 20 | if !reflect.DeepEqual(def, afterNew) { |
| 21 | t.Fatalf("Default configuration is not the same after New expected:\n %#v \ngot:\n %#v", def, afterNew) |
| 22 | } |
| 23 | |
| 24 | afterNew.Charset = "changed" |
| 25 | |
| 26 | if reflect.DeepEqual(def, afterNew) { |
| 27 | t.Fatalf("Configuration should be not equal, got: %#v", afterNew) |
| 28 | } |
| 29 | |
| 30 | app = New().Configure(WithConfiguration(Configuration{DisableBodyConsumptionOnUnmarshal: true})) |
| 31 | |
| 32 | afterNew = *app.config |
| 33 | |
| 34 | if !app.config.DisableBodyConsumptionOnUnmarshal { |
| 35 | t.Fatalf("Passing a Configuration field as Option fails, expected DisableBodyConsumptionOnUnmarshal to be true but was false") |
| 36 | } |
| 37 | |
| 38 | app = New() // empty , means defaults so |
| 39 | if !reflect.DeepEqual(def, *app.config) { |
| 40 | t.Fatalf("Default configuration is not the same after New expected:\n %#v \ngot:\n %#v", def, *app.config) |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | func TestConfigurationOptions(t *testing.T) { |
| 45 | charset := "MYCHARSET" |
nothing calls this directly
no test coverage detected
searching dependent graphs…