Skip to content

Commit

Permalink
chore: using testify
Browse files Browse the repository at this point in the history
testify is the default here.
  • Loading branch information
ricardomaraschini committed Jan 4, 2023
1 parent 361a546 commit 13965b1
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions pkg/migrate/migrate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3118,23 +3118,14 @@ func Test_readLineWithTimeout(t *testing.T) {
},
} {
t.Run(tt.name, func(t *testing.T) {
req := require.New(t)
var reader = &mockReader{fn: tt.fn}
line, err := readLineWithTimeout(reader, tt.timeout)
if err != nil {
if len(tt.err) == 0 {
t.Errorf("unexpected error: %s", err)
} else if !strings.Contains(err.Error(), tt.err) {
t.Errorf("expecting %q, %q received instead", tt.err, err)
}
return
}

if len(tt.err) > 0 {
t.Errorf("expecting error %q, nil received instead", tt.err)
return
if len(tt.err) == 0 {
req.NoError(err, "unexpected error %v", err)
} else {
req.ErrorContains(err, tt.err)
}

req := require.New(t)
req.Equal(line, tt.output, "expected %q, received %q", string(tt.output), string(line))
})
}
Expand Down

0 comments on commit 13965b1

Please sign in to comment.