mirror of
https://github.com/gotify/server.git
synced 2024-01-28 15:20:56 +03:00
allow small time diff in message comparison
This commit is contained in:
@@ -238,7 +238,7 @@ func hasIDInclusiveBetween(t *testing.T, msgs []*model.Message, from, to, decrem
|
||||
|
||||
// assertEquals compares messages and correctly check dates
|
||||
func assertEquals(t *testing.T, left *model.Message, right *model.Message) {
|
||||
assert.Equal(t, left.Date.Unix(), right.Date.Unix())
|
||||
assert.InDelta(t, left.Date.Unix(), right.Date.Unix(), 5)
|
||||
left.Date = right.Date
|
||||
assert.Equal(t, left, right)
|
||||
}
|
||||
|
||||
5
test.sh
Normal file
5
test.sh
Normal file
@@ -0,0 +1,5 @@
|
||||
TEST_DB_DIALECT=mysql \
|
||||
TEST_DB_SETUP='mysql -u root -proot -e "create database gotify_test_<time>;"' \
|
||||
TEST_DB_CONNECTION='root:root@/gotify_test_<time>?charset=utf8&parseTime=True' \
|
||||
TEST_DB_TEARDOWN='mysql -u root -proot -e "drop database gotify_test_<time>;"' \
|
||||
go test -v ./...
|
||||
Reference in New Issue
Block a user