Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3-pq
Commits
0c9cb1e2
Unverified
Commit
0c9cb1e2
authored
Oct 30, 2019
by
Steven Allen
Committed by
GitHub
Oct 30, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4 from ipfs/fix/peek-test
Fix Peek() test
parents
6c34ec60
cc012e40
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
pq_test.go
pq_test.go
+4
-3
No files found.
pq_test.go
View file @
0c9cb1e2
...
...
@@ -53,10 +53,11 @@ func TestCorrectnessOfPop(t *testing.T) {
var
priorities
[]
int
var
peekPriorities
[]
int
for
q
.
Len
()
>
0
{
i
:=
q
.
Pop
()
.
(
*
TestElem
)
.
Priority
t
.
Logf
(
"popped %v"
,
i
)
priorities
=
append
(
priorities
,
i
)
i
:=
q
.
Peek
()
.
(
*
TestElem
)
.
Priority
peekPriorities
=
append
(
peekPriorities
,
i
)
j
:=
q
.
Pop
()
.
(
*
TestElem
)
.
Priority
t
.
Logf
(
"popped %v"
,
j
)
priorities
=
append
(
priorities
,
j
)
}
if
!
sort
.
IntsAreSorted
(
peekPriorities
)
{
t
.
Fatal
(
"the values were not returned in sorted order"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment