mirror of
https://github.com/sony/sonyflake.git
synced 2026-01-07 11:45:12 +00:00
Compare commits
2 Commits
2343cac676
...
0cdef9e4fe
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0cdef9e4fe | ||
|
|
114716564a |
@@ -358,7 +358,7 @@ func TestLower16BitPrivateIP(t *testing.T) {
|
||||
func TestToTime(t *testing.T) {
|
||||
start := time.Now()
|
||||
sf := newSonyflake(t, Settings{
|
||||
TimeUnit: time.Millisecond,
|
||||
TimeUnit: 100 * time.Millisecond,
|
||||
StartTime: start,
|
||||
})
|
||||
|
||||
@@ -366,7 +366,7 @@ func TestToTime(t *testing.T) {
|
||||
|
||||
tm := sf.ToTime(id)
|
||||
diff := tm.Sub(start)
|
||||
if diff < 0 || diff >= time.Duration(sf.timeUnit) {
|
||||
if diff < 0 || diff > time.Duration(sf.timeUnit) {
|
||||
t.Errorf("unexpected time: %v", tm)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user