refactor: split flat internal/ module into modules-per-cmd (#64)
This commit is contained in:
20
internal/testutils/utils.go
Normal file
20
internal/testutils/utils.go
Normal file
@ -0,0 +1,20 @@
|
||||
package testutils
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func MatchLines(t *testing.T, expectedLines []string, lines []string) {
|
||||
var nonEmptyLines []string
|
||||
for _, l := range lines {
|
||||
if l != "" {
|
||||
nonEmptyLines = append(nonEmptyLines, l)
|
||||
}
|
||||
}
|
||||
require.Equal(t, len(expectedLines), len(nonEmptyLines))
|
||||
for i, expected := range expectedLines {
|
||||
require.Regexp(t, expected, nonEmptyLines[i])
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user