@@ -28,6 +28,7 @@ import (
2828
2929 "github.com/containerd/nerdctl/mod/tigron/expect"
3030 "github.com/containerd/nerdctl/mod/tigron/test"
31+ "github.com/containerd/nerdctl/mod/tigron/tig"
3132
3233 "github.com/containerd/nerdctl/v2/pkg/testutil"
3334 "github.com/containerd/nerdctl/v2/pkg/testutil/nerdtest"
@@ -64,7 +65,7 @@ func TestAttach(t *testing.T) {
6465 cmd .Run (& test.Expected {
6566 ExitCode : 0 ,
6667 Errors : []error {errors .New ("read detach keys" )},
67- Output : func (stdout string , info string , t * testing .T ) {
68+ Output : func (stdout string , t tig .T ) {
6869 assert .Assert (t , strings .Contains (helpers .Capture ("inspect" , "--format" , "json" , data .Identifier ()), "\" Running\" :true" ))
6970 },
7071 })
@@ -93,7 +94,7 @@ func TestAttach(t *testing.T) {
9394 Errors : []error {errors .New ("read detach keys" )},
9495 Output : expect .All (
9596 expect .Contains ("markmark" ),
96- func (stdout string , info string , t * testing .T ) {
97+ func (stdout string , t tig .T ) {
9798 assert .Assert (t , strings .Contains (helpers .Capture ("inspect" , "--format" , "json" , data .Identifier ()), "\" Running\" :true" ))
9899 },
99100 ),
@@ -125,7 +126,7 @@ func TestAttachDetachKeys(t *testing.T) {
125126 cmd .Run (& test.Expected {
126127 ExitCode : 0 ,
127128 Errors : []error {errors .New ("read detach keys" )},
128- Output : func (stdout string , info string , t * testing .T ) {
129+ Output : func (stdout string , t tig .T ) {
129130 assert .Assert (t , strings .Contains (helpers .Capture ("inspect" , "--format" , "json" , data .Identifier ()), "\" Running\" :true" ))
130131 },
131132 })
@@ -153,7 +154,7 @@ func TestAttachDetachKeys(t *testing.T) {
153154 Errors : []error {errors .New ("read detach keys" )},
154155 Output : expect .All (
155156 expect .Contains ("markmark" ),
156- func (stdout string , info string , t * testing .T ) {
157+ func (stdout string , t tig .T ) {
157158 assert .Assert (t , strings .Contains (helpers .Capture ("inspect" , "--format" , "json" , data .Identifier ()), "\" Running\" :true" ))
158159 },
159160 ),
@@ -182,8 +183,8 @@ func TestAttachForAutoRemovedContainer(t *testing.T) {
182183 cmd .Run (& test.Expected {
183184 ExitCode : 0 ,
184185 Errors : []error {errors .New ("read detach keys" )},
185- Output : func (stdout string , info string , t * testing .T ) {
186- assert .Assert (t , strings .Contains (helpers .Capture ("inspect" , "--format" , "json" , data .Identifier ()), "\" Running\" :true" ), info )
186+ Output : func (stdout string , t tig .T ) {
187+ assert .Assert (t , strings .Contains (helpers .Capture ("inspect" , "--format" , "json" , data .Identifier ()), "\" Running\" :true" ))
187188 },
188189 })
189190 }
@@ -202,7 +203,7 @@ func TestAttachForAutoRemovedContainer(t *testing.T) {
202203 ExitCode : 42 ,
203204 Output : expect .All (
204205 expect .Contains ("markmark" ),
205- func (stdout string , info string , t * testing .T ) {
206+ func (stdout string , t tig .T ) {
206207 assert .Assert (t , ! strings .Contains (helpers .Capture ("ps" , "-a" ), data .Identifier ()))
207208 },
208209 ),
@@ -226,7 +227,7 @@ func TestAttachNoStdin(t *testing.T) {
226227 cmd .Feed (bytes .NewReader ([]byte {16 , 17 })) // Ctrl-p, Ctrl-q to detach (https://en.wikipedia.org/wiki/C0_and_C1_control_codes)
227228 cmd .Run (& test.Expected {
228229 ExitCode : 0 ,
229- Output : func (stdout string , info string , t * testing .T ) {
230+ Output : func (stdout string , t tig .T ) {
230231 assert .Assert (t , strings .Contains (helpers .Capture ("inspect" , "--format" , "{{.State.Running}}" , data .Identifier ()), "true" ))
231232 },
232233 })
@@ -243,7 +244,7 @@ func TestAttachNoStdin(t *testing.T) {
243244 testCase .Expected = func (data test.Data , helpers test.Helpers ) * test.Expected {
244245 return & test.Expected {
245246 ExitCode : 0 , // Since it's a normal exit and not detach.
246- Output : func (stdout string , info string , t * testing .T ) {
247+ Output : func (stdout string , t tig .T ) {
247248 logs := helpers .Capture ("logs" , data .Identifier ())
248249 assert .Assert (t , ! strings .Contains (logs , "should-not-appear" ))
249250 },
0 commit comments