@@ -131,7 +131,7 @@ func TestMyThing(t *testing.T) {
131
131
myTest.Command = test.Custom (" ls" )
132
132
133
133
// Set your expectations
134
- myTest.Expected = test.Expects (0 , nil , func (stdout, info string , t tig.T ){
134
+ myTest.Expected = test.Expects (0 , nil , func (stdout string , t tig.T ){
135
135
t.Helper ()
136
136
// Bla bla, do whatever advanced stuff and some asserts
137
137
})
@@ -143,7 +143,7 @@ func TestMyThing(t *testing.T) {
143
143
// You can of course generalize your comparator into a generator if it is going to be useful repeatedly
144
144
145
145
func MyComparatorGenerator (param1 , param2 any ) test .Comparator {
146
- return func (stdout, info string , t tig.T ) {
146
+ return func (stdout string , t tig.T ) {
147
147
t.Helper ()
148
148
// Do your thing...
149
149
// ...
@@ -155,10 +155,6 @@ func MyComparatorGenerator(param1, param2 any) test.Comparator {
155
155
You can now pass along ` MyComparator(comparisonString) ` as the third parameter of ` test.Expects ` , or compose it with
156
156
other comparators using ` expect.All(MyComparator(comparisonString), OtherComparator(somethingElse)) `
157
157
158
- Note that you have access to an opaque ` info ` string, that provides a brief formatted header message that assert
159
- will use in case of failure to provide context on the error.
160
- You may of course ignore it and write your own message.
161
-
162
158
### Advanced expectations
163
159
164
160
You may want to have expectations that contain a certain piece of data that is being used in the command or at
@@ -180,6 +176,7 @@ import (
180
176
181
177
" gotest.tools/v3/assert"
182
178
179
+ " github.com/containerd/nerdctl/mod/tigron/tig"
183
180
" github.com/containerd/nerdctl/mod/tigron/test"
184
181
)
185
182
0 commit comments