diff options
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_set.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_set.rb b/test/ruby/test_set.rb index 6dec0d41ae..e8ac3e329e 100644 --- a/test/ruby/test_set.rb +++ b/test/ruby/test_set.rb @@ -703,6 +703,17 @@ class TC_Set < Test::Unit::TestCase } end + def test_xor_does_not_mutate_other_set + a = Set[1] + b = Set[1, 2] + original_b = b.dup + + result = a ^ b + + assert_equal(original_b, b) + assert_equal(Set[2], result) + end + def test_eq set1 = Set[2,3,1] set2 = Set[1,2,3] |
