diff options
author | Tim Culverhouse <tim@timculverhouse.com> | 2022-08-01 12:18:23 -0500 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-08-03 22:37:03 +0200 |
commit | 23ee64b057ab2556d30ece6170e9fd716015946f (patch) | |
tree | 7dc0012b9d8c0aea548c9c529077d4d30a11c2c6 /worker/imap/seqmap_test.go | |
parent | d925ac8f7247613e28325c01a6614c37e8cbc7a0 (diff) | |
download | aerc-23ee64b057ab2556d30ece6170e9fd716015946f.tar.gz |
seqmap: re-order test asserts
Reorder seqmap asserts to properly show display expected and actual when
performing go test -v ./...
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'worker/imap/seqmap_test.go')
-rw-r--r-- | worker/imap/seqmap_test.go | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/worker/imap/seqmap_test.go b/worker/imap/seqmap_test.go index 0fa87119..10d67f3d 100644 --- a/worker/imap/seqmap_test.go +++ b/worker/imap/seqmap_test.go @@ -14,43 +14,43 @@ func TestSeqMap(t *testing.T) { var found bool assert := assert.New(t) - assert.Equal(seqmap.Size(), 0) + assert.Equal(0, seqmap.Size()) _, found = seqmap.Get(42) - assert.Equal(found, false) + assert.Equal(false, found) _, found = seqmap.Pop(0) - assert.Equal(found, false) + assert.Equal(false, found) seqmap.Put(1, 1337) seqmap.Put(2, 42) seqmap.Put(3, 1107) - assert.Equal(seqmap.Size(), 3) + assert.Equal(3, seqmap.Size()) _, found = seqmap.Pop(0) - assert.Equal(found, false) + assert.Equal(false, found) uid, found = seqmap.Get(1) - assert.Equal(uid, uint32(1337)) - assert.Equal(found, true) + assert.Equal(uint32(1337), uid) + assert.Equal(true, found) uid, found = seqmap.Pop(1) - assert.Equal(uid, uint32(1337)) - assert.Equal(found, true) - assert.Equal(seqmap.Size(), 2) + assert.Equal(uint32(1337), uid) + assert.Equal(true, found) + assert.Equal(2, seqmap.Size()) // Repop the same seqnum should work because of the syncing _, found = seqmap.Pop(1) - assert.Equal(found, true) - assert.Equal(seqmap.Size(), 1) + assert.Equal(true, found) + assert.Equal(1, seqmap.Size()) // sync means we already have a 1. This is replacing that UID so the size // shouldn't increase seqmap.Put(1, 7331) - assert.Equal(seqmap.Size(), 1) + assert.Equal(1, seqmap.Size()) seqmap.Clear() - assert.Equal(seqmap.Size(), 0) + assert.Equal(0, seqmap.Size()) var wg sync.WaitGroup wg.Add(1) @@ -77,5 +77,5 @@ func TestSeqMap(t *testing.T) { }() wg.Wait() - assert.Equal(seqmap.Size(), 0) + assert.Equal(0, seqmap.Size()) } |