Skip to content

Commit 0c9cb1e

Browse files
authored
Merge pull request #4 from ipfs/fix/peek-test
Fix Peek() test
2 parents 6c34ec6 + cc012e4 commit 0c9cb1e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pq_test.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,11 @@ func TestCorrectnessOfPop(t *testing.T) {
5353
var priorities []int
5454
var peekPriorities []int
5555
for q.Len() > 0 {
56-
i := q.Pop().(*TestElem).Priority
57-
t.Logf("popped %v", i)
58-
priorities = append(priorities, i)
56+
i := q.Peek().(*TestElem).Priority
5957
peekPriorities = append(peekPriorities, i)
58+
j := q.Pop().(*TestElem).Priority
59+
t.Logf("popped %v", j)
60+
priorities = append(priorities, j)
6061
}
6162
if !sort.IntsAreSorted(peekPriorities) {
6263
t.Fatal("the values were not returned in sorted order")

0 commit comments

Comments
 (0)