7 qt "github.com/frankban/quicktest"
10 func TestWorseConnLastHelpful(t *testing.T) {
12 c.Check((&worseConnInput{}).Less(&worseConnInput{LastHelpful: time.Now()}), qt.IsTrue)
13 c.Check((&worseConnInput{}).Less(&worseConnInput{CompletedHandshake: time.Now()}), qt.IsTrue)
14 c.Check((&worseConnInput{LastHelpful: time.Now()}).Less(&worseConnInput{CompletedHandshake: time.Now()}), qt.IsFalse)
15 c.Check((&worseConnInput{
16 LastHelpful: time.Now(),
17 }).Less(&worseConnInput{
18 LastHelpful: time.Now(),
19 CompletedHandshake: time.Now(),
22 c.Check((&worseConnInput{
24 }).Less(&worseConnInput{
25 LastHelpful: now.Add(-time.Nanosecond),
26 CompletedHandshake: now,
28 readyPeerPriority := func() (peerPriority, error) {
31 c.Check((&worseConnInput{
32 GetPeerPriority: readyPeerPriority,
33 }).Less(&worseConnInput{
34 GetPeerPriority: readyPeerPriority,
37 c.Check((&worseConnInput{
38 GetPeerPriority: readyPeerPriority,
40 }).Less(&worseConnInput{
41 GetPeerPriority: readyPeerPriority,