Skip to content

Commit

Permalink
Move to stretchr/testify (#2521)
Browse files Browse the repository at this point in the history
  • Loading branch information
kislaykishore authored Sep 20, 2024
1 parent a738c2a commit d427815
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ import (

"github.com/googlecloudplatform/gcsfuse/v2/tools/integration_tests/util/log_parser/json_parser/read_logs"
"github.com/googlecloudplatform/gcsfuse/v2/tools/integration_tests/util/setup"
. "github.com/jacobsa/ogletest"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

const (
Expand Down Expand Up @@ -134,8 +135,9 @@ func TestParseLogFileSuccessful(t *testing.T) {
for _, tc := range tests {
t.Run(tc.name, func(t *testing.T) {
actual, err := read_logs.ParseReadLogsFromLogFile(tc.reader)
AssertEq(nil, err)
AssertTrue(reflect.DeepEqual(actual, tc.expected))

require.NoError(t, err)
assert.True(t, reflect.DeepEqual(actual, tc.expected))
})
}
}
Expand Down Expand Up @@ -180,8 +182,9 @@ func TestParseLogFileUnsuccessful(t *testing.T) {
for _, tc := range tests {
t.Run(tc.name, func(t *testing.T) {
_, err := read_logs.ParseReadLogsFromLogFile(tc.reader)
AssertNe(nil, err)
AssertTrue(strings.Contains(err.Error(), tc.errorString))

require.Error(t, err)
assert.True(t, strings.Contains(err.Error(), tc.errorString))
})
}
}

0 comments on commit d427815

Please sign in to comment.