Skip to content

Commit

Permalink
Avoid allocation storing last active time
Browse files Browse the repository at this point in the history
  • Loading branch information
paulwe committed Apr 30, 2024
1 parent 16a238a commit 13cf5dc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions candidate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,15 +184,15 @@ func TestCandidateLastSent(t *testing.T) {
assert.Equal(t, candidate.LastSent(), time.Time{})
now := time.Now()
candidate.setLastSent(now)
assert.Equal(t, candidate.LastSent(), now)
assert.EqualValues(t, 0, now.Sub(candidate.LastSent()))
}

func TestCandidateLastReceived(t *testing.T) {
candidate := candidateBase{}
assert.Equal(t, candidate.LastReceived(), time.Time{})
now := time.Now()
candidate.setLastReceived(now)
assert.Equal(t, candidate.LastReceived(), now)
assert.EqualValues(t, 0, now.Sub(candidate.LastReceived()))
}

func TestCandidateFoundation(t *testing.T) {
Expand Down

0 comments on commit 13cf5dc

Please sign in to comment.