File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 77 "reflect"
88)
99
10+ // ErrIntentional is a sentinel error represents intentional error in the test.
11+ var ErrIntentional = errors .New ("testr: intentional error" )
12+
1013// T represents testing.T.
1114type T interface {
1215 Helper ()
Original file line number Diff line number Diff line change 11package testr_test
22
33import (
4- "errors"
54 "testing"
65
76 "github.com/smoothprogrammer/testr"
@@ -354,11 +353,11 @@ func TestNilT(t *testing.T) {
354353func TestMust (t * testing.T ) {
355354 assert := testr .New (t )
356355 testr .Must (nil )
357- assert .Panic (func () { testr .Must (errors . New ( "intentional error" ) ) })
356+ assert .Panic (func () { testr .Must (testr . ErrIntentional ) })
358357}
359358
360359func TestMustV (t * testing.T ) {
361360 assert := testr .New (t )
362361 assert .Equal (testr .MustV ("ok" , nil ), "ok" )
363- assert .Panic (func () { testr .MustV ("panic" , errors . New ( "intentional error" ) ) })
362+ assert .Panic (func () { testr .MustV ("panic" , testr . ErrIntentional ) })
364363}
You can’t perform that action at this time.
0 commit comments