Skip to content

Commit

Permalink
Use longbridgeapp/assert instead of testify
Browse files Browse the repository at this point in the history
  • Loading branch information
huacnlee committed Jan 14, 2022
1 parent 31f443c commit af25fb6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ go 1.17
require (
github.com/longbridgeapp/assert v0.1.0
github.com/longbridgeapp/sqlparser v0.2.0
github.com/stretchr/testify v1.7.0
gorm.io/driver/postgres v1.1.0
gorm.io/gorm v1.21.16
gorm.io/hints v0.0.0-20210614014355-b8cf5492cb94
Expand All @@ -24,6 +23,7 @@ require (
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/stretchr/testify v1.7.0 // indirect
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97 // indirect
golang.org/x/text v0.3.6 // indirect
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect
Expand Down
4 changes: 2 additions & 2 deletions keygen/id_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import (
"testing"
"time"

"github.com/stretchr/testify/assert"
"github.com/longbridgeapp/assert"
)

func TestNext(t *testing.T) {
id := Next(24)
ipv4, err := getIPv4()

assert.Nil(t, err)
assert.GreaterOrEqual(t, time.Now().UnixNano()/1e6, int64(id>>int64(timeLeft))+twepoch)
assert.Equal(t, true, time.Now().UnixNano()/1e6 >= int64(id>>int64(timeLeft))+twepoch)
assert.Equal(t, int(ipv4[3])%64, getWorkerNumber(id))
assert.Equal(t, 24, TableIdx(id))
}
Expand Down

0 comments on commit af25fb6

Please sign in to comment.