mirror of
https://github.com/sony/sonyflake.git
synced 2026-11-28 08:56:28 +00:00
Fix time duration comparison in ToTime test to ensure correct validation of generated timestamps. (#76)
This commit is contained in:
1 parent
2343cac676
commit
114716564a
1 file changed
+1
-1
@@ -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