aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_set.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_set.rb')
-rw-r--r--test/test_set.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/test_set.rb b/test/test_set.rb
index 15c5a13d21..2adbadddcf 100644
--- a/test/test_set.rb
+++ b/test/test_set.rb
@@ -708,6 +708,26 @@ class TC_SortedSet < Test::Unit::TestCase
set << 42
assert_equal(7, e.size)
end
+
+ def test_superset
+ set = SortedSet.new([1,2,3])
+
+ assert_equal(false, set.superset?(Set.new([1,2,3,4])))
+ assert_equal(true, set >= SortedSet.new([1,2,3]))
+
+ assert_equal(false, set.proper_superset?(Set.new([1,2,3,4])))
+ assert_equal(false, set > SortedSet.new([1,2,3]))
+ end
+
+ def test_subset
+ set = SortedSet.new([1,2,3])
+
+ assert_equal(true, set.subset?(Set.new([1,2,3,4])))
+ assert_equal(true, set <= SortedSet.new([1,2,3]))
+
+ assert_equal(true, set.proper_subset?(Set.new([1,2,3,4])))
+ assert_equal(false, set < SortedSet.new([1,2,3]))
+ end
end
class TC_Enumerable < Test::Unit::TestCase