added support for edge cases

This commit is contained in:
didier amyot committed 2015-03-09 22:54:28 -07:00
1 parent 72e5ece491
commit ed5aa0347a
2 files changed
+30 -16

No files matched your search

+15
View File
@@ -153,8 +153,23 @@ func TestSortStreams(t *testing.T) {
t.Error()
}
if s := SortStreams(CreateStream()); !streamEqual(s) {
t.Error()
}
if s := SortStreams(CreateStream(1, 4), CreateStream(0, 5)); !streamEqual(s, 0, 1, 4, 5) {
t.Error()
}
if s := SortStreams(CreateStream(1, 2), CreateStream(3, 4), CreateStream(5, 6)); !streamEqual(s, 1, 2, 3, 4, 5, 6) {
t.Error()
}
if s := SortStreams(CreateStream(1, 2), CreateStream()); !streamEqual(s, 1, 2) {
t.Error()
}
if s := SortStreams(CreateStream(), CreateStream(1, 2)); !streamEqual(s, 1, 2) {
t.Error()
}
}