Skip to content

Commit

Permalink
Use PanicsWithValue in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tmthrgd committed Dec 2, 2017
1 parent 566a6f8 commit ab90073
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gzip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ func TestGzipLevelHandler(t *testing.T) {
}

func TestCompressionLevelPanicsForInvalid(t *testing.T) {
assert.Panics(t, func() {
assert.PanicsWithValue(t, "gziphandler: invalid compression level requested", func() {
CompressionLevel(-42)
}, "CompressionLevel did not panic on invalid level")

assert.Panics(t, func() {
assert.PanicsWithValue(t, "gziphandler: invalid compression level requested", func() {
CompressionLevel(42)
}, "CompressionLevel did not panic on invalid level")
}
Expand Down Expand Up @@ -184,7 +184,7 @@ func TestGzipHandlerMinSize(t *testing.T) {
}

func TestMinSizePanicsForInvalid(t *testing.T) {
assert.Panics(t, func() {
assert.PanicsWithValue(t, "gziphandler: minimum size must not be negative", func() {
MinSize(-10)
}, "MinSize did not panic on negative size")
}
Expand Down

0 comments on commit ab90073

Please sign in to comment.