17
17
package expect
18
18
19
19
import (
20
+ "encoding/hex"
20
21
"fmt"
21
22
"regexp"
22
23
"strings"
@@ -45,7 +46,8 @@ func Contains(compare string) test.Comparator {
45
46
return func (stdout , info string , t * testing.T ) {
46
47
t .Helper ()
47
48
assertive .Check (t , strings .Contains (stdout , compare ),
48
- fmt .Sprintf ("Output does not contain: %q" , compare )+ info )
49
+ fmt .Sprintf ("Output does not contain: %q" , compare ),
50
+ info )
49
51
}
50
52
}
51
53
@@ -56,7 +58,7 @@ func DoesNotContain(compare string) test.Comparator {
56
58
return func (stdout , info string , t * testing.T ) {
57
59
t .Helper ()
58
60
assertive .Check (t , ! strings .Contains (stdout , compare ),
59
- fmt .Sprintf ("Output should not contain: %q" , compare )+ info )
61
+ fmt .Sprintf ("Output should not contain: %q" , compare ), info )
60
62
}
61
63
}
62
64
@@ -65,10 +67,14 @@ func Equals(compare string) test.Comparator {
65
67
//nolint:thelper
66
68
return func (stdout , info string , t * testing.T ) {
67
69
t .Helper ()
70
+
71
+ hexdump := hex .Dump ([]byte (stdout ))
68
72
assertive .Check (
69
73
t ,
70
74
compare == stdout ,
71
- fmt .Sprintf ("Output is not equal to: %q" , compare )+ info ,
75
+ fmt .Sprintf ("Output is not equal to: %q" , compare ),
76
+ "\n " + hexdump ,
77
+ info ,
72
78
)
73
79
}
74
80
}
0 commit comments