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 7
7
"reflect"
8
8
)
9
9
10
+ // ErrIntentional is a sentinel error represents intentional error in the test.
11
+ var ErrIntentional = errors .New ("testr: intentional error" )
12
+
10
13
// T represents testing.T.
11
14
type T interface {
12
15
Helper ()
Original file line number Diff line number Diff line change 1
1
package testr_test
2
2
3
3
import (
4
- "errors"
5
4
"testing"
6
5
7
6
"github.com/smoothprogrammer/testr"
@@ -354,11 +353,11 @@ func TestNilT(t *testing.T) {
354
353
func TestMust (t * testing.T ) {
355
354
assert := testr .New (t )
356
355
testr .Must (nil )
357
- assert .Panic (func () { testr .Must (errors . New ( "intentional error" ) ) })
356
+ assert .Panic (func () { testr .Must (testr . ErrIntentional ) })
358
357
}
359
358
360
359
func TestMustV (t * testing.T ) {
361
360
assert := testr .New (t )
362
361
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 ) })
364
363
}
You can’t perform that action at this time.
0 commit comments