Swap assert.Eqaul actual/expected (#849)
This commit is contained in:
1 parent
f8577519b6
commit
4e31fdb10e
10 files changed
+42
-42
No files matched your search
@@ -1120,7 +1120,7 @@ func TestDb_DoTx(t *testing.T) {
|
||||
got, err := w.DoTx(context.Background(), 1, ExpBackoff{}, func(Reader, Writer) error { return stderrors.New("not a retry error") })
|
||||
require.Error(err)
|
||||
assert.Equal(RetryInfo{}, got)
|
||||
assert.NotEqual(err, oplog.ErrTicketAlreadyRedeemed)
|
||||
assert.NotEqual(oplog.ErrTicketAlreadyRedeemed, err)
|
||||
})
|
||||
t.Run("too-many-retries", func(t *testing.T) {
|
||||
assert, require := assert.New(t), require.New(t)
|
||||
|
||||
@@ -28,7 +28,7 @@ func Test_TimestampValue(t *testing.T) {
|
||||
ts := Timestamp{Timestamp: ×tamp.Timestamp{Seconds: maxValidSeconds, Nanos: 0}}
|
||||
v, err := ts.Value()
|
||||
assert.True(err != nil)
|
||||
assert.Equal(err.Error(), "timestamp: seconds:253402300800 after 10000-01-01")
|
||||
assert.Equal("timestamp: seconds:253402300800 after 10000-01-01", err.Error())
|
||||
assert.Equal(v, utcDate(10000, 1, 1))
|
||||
})
|
||||
}
|
||||
@@ -55,14 +55,14 @@ func Test_TimestampScan(t *testing.T) {
|
||||
ts := Timestamp{}
|
||||
err := ts.Scan(v)
|
||||
assert.True(err != nil)
|
||||
assert.Equal(err.Error(), "Not a protobuf Timestamp")
|
||||
assert.Equal("Not a protobuf Timestamp", err.Error())
|
||||
})
|
||||
t.Run("invalid time", func(t *testing.T) {
|
||||
v := time.Unix(maxValidSeconds, 0)
|
||||
ts := Timestamp{}
|
||||
err := ts.Scan(v)
|
||||
assert.True(err != nil)
|
||||
assert.Equal(err.Error(), "error converting the timestamp: timestamp: seconds:253402300800 after 10000-01-01")
|
||||
assert.Equal("error converting the timestamp: timestamp: seconds:253402300800 after 10000-01-01", err.Error())
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user