mirror of
https://github.com/pion/ice.git
synced 2025-12-24 13:38:03 +08:00
Use 1 microsecond tolerance for equality tests
This commit is contained in:
committed by
Joe Turki
parent
e5a0d2a0b3
commit
c21e2f1d35
@@ -185,7 +185,7 @@ func TestCandidateLastSent(t *testing.T) {
|
||||
require.Equal(t, candidate.LastSent(), time.Time{})
|
||||
now := time.Now()
|
||||
candidate.setLastSent(now)
|
||||
require.Equal(t, candidate.LastSent(), now)
|
||||
require.WithinDuration(t, candidate.LastSent(), now, 1*time.Microsecond)
|
||||
}
|
||||
|
||||
func TestCandidateLastReceived(t *testing.T) {
|
||||
@@ -193,7 +193,7 @@ func TestCandidateLastReceived(t *testing.T) {
|
||||
require.Equal(t, candidate.LastReceived(), time.Time{})
|
||||
now := time.Now()
|
||||
candidate.setLastReceived(now)
|
||||
require.Equal(t, candidate.LastReceived(), now)
|
||||
require.WithinDuration(t, candidate.LastReceived(), now, 1*time.Microsecond)
|
||||
}
|
||||
|
||||
func TestCandidateFoundation(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user