Skip to content

Commit

Permalink
fix: make status check easier to read
Browse files Browse the repository at this point in the history
  • Loading branch information
crhntr committed Oct 1, 2024
1 parent 17eb092 commit 86fff33
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions cmd/muxt/testdata/generate/templates_input_validation.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ func Test(t *testing.T) {

res := rec.Result()

if res.StatusCode != http.StatusBadRequest {
t.Error("expected bad request")
if got, exp := res.StatusCode, http.StatusBadRequest; got != exp {
t.Error("expected", http.StatusText(exp), "got", http.StatusText(got))
}
})
t.Run("at min", func(t *testing.T) {
Expand All @@ -71,8 +71,8 @@ func Test(t *testing.T) {

res := rec.Result()

if res.StatusCode != http.StatusOK {
t.Error("expected ok")
if got, exp := res.StatusCode, http.StatusOK; got != exp {
t.Error("expected", http.StatusText(exp), "got", http.StatusText(got))
}
})
t.Run("above max", func(t *testing.T) {
Expand All @@ -83,8 +83,8 @@ func Test(t *testing.T) {

res := rec.Result()

if res.StatusCode != http.StatusBadRequest {
t.Error("expected bad request")
if got, exp := res.StatusCode, http.StatusBadRequest; got != exp {
t.Error("expected", http.StatusText(exp), "got", http.StatusText(got))
}
})
t.Run("at max", func(t *testing.T) {
Expand All @@ -95,8 +95,8 @@ func Test(t *testing.T) {

res := rec.Result()

if res.StatusCode != http.StatusOK {
t.Error("expected ok")
if got, exp := res.StatusCode, http.StatusOK; got != exp {
t.Error("expected", http.StatusText(exp), "got", http.StatusText(got))
}
})
t.Run("in range", func(t *testing.T) {
Expand All @@ -107,8 +107,8 @@ func Test(t *testing.T) {

res := rec.Result()

if res.StatusCode != http.StatusOK {
t.Error("expected ok")
if got, exp := res.StatusCode, http.StatusOK; got != exp {
t.Error("expected", http.StatusText(exp), "got", http.StatusText(got))
}
})
}

0 comments on commit 86fff33

Please sign in to comment.