mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-08 23:43:11 -06:00
collapse three equivalent case statements into one
This commit is contained in:
parent
4c3a526e1b
commit
2b5fbea6db
|
|
@ -541,17 +541,7 @@ func Test_register(t *testing.T) {
|
||||||
resp = Register(req, userAPI, &cfg.ClientAPI)
|
resp = Register(req, userAPI, &cfg.ClientAPI)
|
||||||
|
|
||||||
switch resp.JSON.(type) {
|
switch resp.JSON.(type) {
|
||||||
case spec.InternalServerError:
|
case spec.InternalServerError, spec.MatrixError, util.JSONResponse:
|
||||||
if !reflect.DeepEqual(tc.wantResponse, resp) {
|
|
||||||
t.Fatalf("unexpected response: %+v, want: %+v", resp, tc.wantResponse)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
case spec.MatrixError:
|
|
||||||
if !reflect.DeepEqual(tc.wantResponse, resp) {
|
|
||||||
t.Fatalf("unexpected response: %+v, want: %+v", resp, tc.wantResponse)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
case util.JSONResponse:
|
|
||||||
if !reflect.DeepEqual(tc.wantResponse, resp) {
|
if !reflect.DeepEqual(tc.wantResponse, resp) {
|
||||||
t.Fatalf("unexpected response: %+v, want: %+v", resp, tc.wantResponse)
|
t.Fatalf("unexpected response: %+v, want: %+v", resp, tc.wantResponse)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue