@@ -16,15 +16,15 @@ type myException struct {
16
16
func TestTry (x * testing.T ) {
17
17
t := (* test .T )(x )
18
18
err := Try (func () {
19
- Throwf ("this is a test" )
19
+ Throwf ("%s" , " this is a test" )
20
20
}).Error ()
21
21
t .Assert (err != nil , "wanted a non nil error got %v" , err )
22
22
}
23
23
24
24
func TestTryPropogate (x * testing.T ) {
25
25
badfunc := func () {
26
26
Try (func () {
27
- Throwf ("test" , "this is a test" )
27
+ Throwf ("test: %s " , "this is a test" )
28
28
}).Unwind ()
29
29
}
30
30
t := (* test .T )(x )
@@ -37,7 +37,7 @@ func TestTryPropogate(x *testing.T) {
37
37
func TestTryCatch (x * testing.T ) {
38
38
t := (* test .T )(x )
39
39
err := Try (func () {
40
- Throwf ("this is a test" )
40
+ Throwf ("%s" , " this is a test" )
41
41
}).Catch (& Exception {}, func (e Throwable ) {
42
42
t .Log ("Caught" , e )
43
43
}).Error ()
@@ -49,7 +49,7 @@ func TestTryCatch(x *testing.T) {
49
49
func TestTryCatchMyExceptionFail (x * testing.T ) {
50
50
t := (* test .T )(x )
51
51
err := Try (func () {
52
- Throwf ("this is a test" )
52
+ Throwf ("%s" , " this is a test" )
53
53
}).Catch (& myException {}, func (e Throwable ) {
54
54
t .Log ("Caught" , e )
55
55
}).Error ()
@@ -79,7 +79,7 @@ func TestTryCatchMyExceptionWithException(x *testing.T) {
79
79
func TestTryCatchReraise (x * testing.T ) {
80
80
t := (* test .T )(x )
81
81
err := Try (func () {
82
- Throwf ("this is a test" )
82
+ Throwf ("%s" , " this is a test" )
83
83
}).Catch (& Exception {}, func (e Throwable ) {
84
84
t .Log ("Caught" , e )
85
85
Rethrow (e , Errorf ("rethrow" ))
@@ -93,7 +93,7 @@ func TestTryCatchFinally(x *testing.T) {
93
93
t := (* test .T )(x )
94
94
finally := false
95
95
err := Try (func () {
96
- Throwf ("this is a test" )
96
+ Throwf ("%s" , " this is a test" )
97
97
}).Catch (& Exception {}, func (e Throwable ) {
98
98
t .Log ("Caught" , e )
99
99
}).Finally (func () {
@@ -108,7 +108,7 @@ func TestTryCatchReraiseFinally(x *testing.T) {
108
108
t := (* test .T )(x )
109
109
finally := false
110
110
err := Try (func () {
111
- Throwf ("this is a test" )
111
+ Throwf ("%s" , " this is a test" )
112
112
}).Catch (& Exception {}, func (e Throwable ) {
113
113
t .Log ("Caught" , e )
114
114
Rethrow (e , Errorf ("rethrow" ))
@@ -124,7 +124,7 @@ func TestTryFinally(x *testing.T) {
124
124
t := (* test .T )(x )
125
125
finally := false
126
126
err := Try (func () {
127
- Throwf ("this is a test" )
127
+ Throwf ("%s" , " this is a test" )
128
128
}).Finally (func () {
129
129
t .Log ("finally" )
130
130
finally = true
0 commit comments