We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 6c34ec6 + cc012e4 commit 0c9cb1eCopy full SHA for 0c9cb1e
pq_test.go
@@ -53,10 +53,11 @@ func TestCorrectnessOfPop(t *testing.T) {
53
var priorities []int
54
var peekPriorities []int
55
for q.Len() > 0 {
56
- i := q.Pop().(*TestElem).Priority
57
- t.Logf("popped %v", i)
58
- priorities = append(priorities, i)
+ i := q.Peek().(*TestElem).Priority
59
peekPriorities = append(peekPriorities, i)
+ j := q.Pop().(*TestElem).Priority
+ t.Logf("popped %v", j)
60
+ priorities = append(priorities, j)
61
}
62
if !sort.IntsAreSorted(peekPriorities) {
63
t.Fatal("the values were not returned in sorted order")
0 commit comments