Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/sorted_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
class SortedSet < Set
# Creates a SortedSet. See Set.new for details.
def initialize(*args)
@hash = RBTree.new
@hash = RBTree.new(false)
super
end
end
4 changes: 4 additions & 0 deletions test/test_sorted_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ def test_sortedset
assert_same(nil, ret)
assert_equal(['four', 'one', 'three', 'two'], s.to_a)
assert_equal(['four', 'one', 'three', 'two'], a)

s = SortedSet.new([1,2,3])
assert_equal(true, s.include?(1))
assert_equal(false, s.include?(5))
end

def test_each
Expand Down