diff options
author | Akinori MUSHA <knu@idaemons.org> | 2020-12-22 12:20:21 +0900 |
---|---|---|
committer | Akinori MUSHA <knu@idaemons.org> | 2020-12-22 12:20:21 +0900 |
commit | 3fa4bd82928983cf5f6711c130711502397e05e2 (patch) | |
tree | db80a406ef9497d1e53ac26c43ffa275edf2e61e /test/test_set.rb | |
parent | 63b872c409ec441718f55c60362a441cf108cfc0 (diff) | |
download | ruby-3fa4bd82928983cf5f6711c130711502397e05e2.tar.gz |
Import set 1.0.0
- SortedSet has been removed for dependency and performance reasons.
- Set#join is added as a shorthand for `.to_a.join`.
- Set#<=> is added.
https://github.com/ruby/set/blob/v1.0.0/CHANGELOG.md
Diffstat (limited to 'test/test_set.rb')
-rw-r--r-- | test/test_set.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/test_set.rb b/test/test_set.rb index 05431e4c63..e62f30d852 100644 --- a/test/test_set.rb +++ b/test/test_set.rb @@ -759,6 +759,11 @@ class TC_Set < Test::Unit::TestCase assert_equal Set[1,2,3], set1 end if Kernel.instance_method(:initialize_clone).arity != 1 + def test_join + assert_equal('123', Set[1, 2, 3].join) + assert_equal('1 & 2 & 3', Set[1, 2, 3].join(' & ')) + end + def test_inspect set1 = Set[1, 2] assert_equal('#<Set: {1, 2}>', set1.inspect) |