summaryrefslogtreecommitdiff
path: root/test/test_set.rb
Commit message (Collapse)AuthorAgeFilesLines
* [ruby/set] Set#merge does not take keyword arguments as a HashAkinori MUSHA2023-02-241-0/+4
| | | | https://github.com/ruby/set/commit/ca1c9532a9
* [ruby/set] Set#merge takes many enumerable objects like Hash#merge! doesAkinori MUSHA2023-02-241-1/+10
| | | | https://github.com/ruby/set/commit/becaca994d
* [ruby/set] Get rid of use of `Gem::Version`Nobuyoshi Nakada2022-07-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | When retrying in ruby's test, it seems possible that `Gem` is not loaded. ``` 1) Error: TC_Set_Builtin#test_to_set: NameError: uninitialized constant TC_Set_Builtin::Gem /export/home/chkbuild/chkbuild-gcc/tmp/build/20220708T070011Z/ruby/test/test_set.rb:844:in `should_omit?' /export/home/chkbuild/chkbuild-gcc/tmp/build/20220708T070011Z/ruby/test/test_set.rb:869:in `test_to_set' 2) Error: TC_Set_Builtin#test_Set: NameError: uninitialized constant TC_Set_Builtin::Gem /export/home/chkbuild/chkbuild-gcc/tmp/build/20220708T070011Z/ruby/test/test_set.rb:844:in `should_omit?' /export/home/chkbuild/chkbuild-gcc/tmp/build/20220708T070011Z/ruby/test/test_set.rb:849:in `test_Set' ``` This is by `Gem::Version` only, just compare as array of integers instead. https://github.com/ruby/set/commit/cde0a4bbc7
* Make Set a builtin feature [Feature #16989]Akinori MUSHA2022-02-181-0/+39
|
* [ruby/set] Allow Set#intersect? and #disjoint? to accept array argumentJeremy Evans2021-07-291-1/+5
| | | | | | Implements [Feature #17838] https://github.com/ruby/set/commit/d9b389bafa
* Avoid rehashing in Hash#replace/dup/initialize_copy [Bug #16996]Marc-Andre Lafortune2021-03-181-4/+3
|
* Import set 1.0.0Akinori MUSHA2020-12-221-0/+5
| | | | | | | | - 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
* [ruby/set] Add `Set#<=>`Marc-Andre Lafortune2020-12-041-0/+18
| | | | https://github.com/ruby/set/commit/447974a374
* [ruby/set] Remove SortedSet implementationsAkinori MUSHA2020-12-041-118/+0
| | | | | | | | | | | | | It required RBTree to perform decently and the external dependency was not suitable for a standard library. The pure ruby fallback implementation was originally meant to be an example of how to write a subclass of Set, and its poor performance was not suitable for use in production. I decided it should be distributed as an external library instead of bundling it with Set. https://github.com/ruby/set/commit/dfcc8e568b
* [ruby/set] Resurrect support for Ruby 2.xAkinori MUSHA2020-12-041-1/+1
| | | | | | In Ruby 2.x, initialize_copy does not take a freeze option. https://github.com/ruby/set/commit/3da6c309df
* Make mutating the result of SortedSet#to_a not affect the setJeremy Evans2020-06-111-0/+3
| | | | Fixes [Bug #15834]
* Call initialize_clone with freeze: false if clone called with freeze: falseJeremy Evans2020-01-031-0/+11
| | | | | | | | | | | | | | | | | | | This makes it possible to initialize_clone to correctly not freeze internal state if the freeze: false keyword is passed to clone. If clone is called with freeze: true or no keyword, do not pass a second argument to initialize_clone to keep backwards compatibility. This makes it so that external libraries that override initialize_clone but do not support the freeze keyword will fail with ArgumentError if passing freeze: false to clone. I think that is better than the current behavior, which succeeds but results in an unfrozen object with frozen internals. Fix related issues in set and delegate in stdlib. Fixes [Bug #14266]
* Deprecate taint/trust and related methods, and make the methods no-opsJeremy Evans2019-11-181-9/+0
| | | | | | This removes the related tests, and puts the related specs behind version guards. This affects all code in lib, including some libraries that may want to support older versions of Ruby.
* Add a new #filter alias for #selecteregon2018-02-251-0/+18
| | | | | | | | | | | | | | | * In Enumerable, Enumerator::Lazy, Array, Hash and Set [Feature #13784] [ruby-core:82285] * Share specs for the various #select#select! methods and reuse them for #filter/#filter!. * Add corresponding filter tests for select tests. * Update NEWS. [Fix GH-1824] From: Alexander Patrick <adp90@case.edu> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62575 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add FrozenError as a subclass of RuntimeErrorshyouhei2017-12-121-4/+4
| | | | | | | | | | | | | | FrozenError will be used instead of RuntimeError for exceptions raised when there is an attempt to modify a frozen object. The reason for this change is to differentiate exceptions related to frozen objects from generic exceptions such as those generated by Kernel#raise without an exception class. From: Jeremy Evans <code@jeremyevans.net> Signed-off-by: Urabe Shyouhei <shyouhei@ruby-lang.org> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add `Set#reset`knu2017-10-221-0/+13
| | | | | | | This method resets the internal state of a set after modification to existing elements, reindexing and deduplicating them. [Feature #6589] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Allow a SortedSet to be frozen and still functional [Bug #12091]knu2017-10-211-0/+39
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Alias Set#=== to #include?knu2017-09-191-0/+17
| | | | | | | | * set.rb (Set#===): Added via [Feature #13801] by davidarnold. Closes #1673. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Alias Set#to_s to #inspect [ruby-core:81753] [Feature #13676]knu2017-07-141-0/+11
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Make tests for Set#inspect more straightforwardknu2017-07-141-5/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59331 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add Set#compare_by_identity and Set#compare_by_identity?knu2016-11-051-0/+19
| | | | | | | * lib/set.rb (Set#compare_by_identity, Set#compare_by_identity?): New methods. [Feature #12210] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/set.rb (Set#{delete_if,keep_if,collect!,reject!,select!,classify,divide},ktsj2016-05-041-0/+63
| | | | | | | | SortedSet#{delete_if,keep_if}): Return sized enumerators. * test/test_set.rb: add test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/test_set.rb: add missing test of Set#select!.ktsj2016-05-041-0/+12
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54901 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add frozen_string_literal: false for all filesnaruse2015-12-161-0/+1
| | | | | | When you change this to true, you may need to add more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/set.rb (#>=, #>, #<=, #<): Make use of Hash#>=, #>, #<, andknu2015-11-161-31/+42
| | | | | | #<= when comparing against an instance of the same kind. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/set.rb: Make Set#each and SortedSet#each generate a sizedknu2015-06-151-0/+27
| | | | | | | | | enumerator. [GH-931] by kachick (Kenichi Kamiya) * test/test_set.rb: Import tests from Set into SortedSet. [GH-931] by kachick (Kenichi Kamiya) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50908 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* use assert_raisenobu2015-06-021-19/+19
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/set.rb (Set#replace): Check if an object given is enumerableknu2014-08-061-0/+6
| | | | | | | before clearing self. Reported by yui-knk. [GH-675] https://github.com/ruby/ruby/pull/675 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Implement Set#clone. [Fixes GH-661]knu2014-08-061-0/+22
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/test_set.rb: remove commented out code.hsbt2014-02-271-49/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45198 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add some more tests.knu2013-07-301-0/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add Set#intersect? and #disjoint?.knu2013-07-301-0/+40
| | | | | | | | * lib/set.rb (Set#intersect?, Set#disjoint?): Add new methods for testing if two sets have any element in common. [ruby-core:45641] [Feature #6588] Based on the code by marcandre. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Define Set#to_set so that aSet.to_set returns self.knu2013-07-191-0/+3
| | | | | | | * lib/set.rb (Set#to_set): Define Set#to_set so that aSet.to_set returns self. [Fixes GH-359] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42051 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/set.rb (Set#freeze, taint, untaint): Save a "self" byknu2013-06-011-0/+21
| | | | | | utilizing super returning self, and add tests while at it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41022 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/set.rb (Set#delete_if, Set#keep_if): Make Set#delete_if andknu2013-05-181-0/+12
| | | | | | Set#keep_if more space and time efficient by avoiding to_a. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40819 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Move tests embedded in lib/set.rb to test/test_set.rb.knu2012-11-241-3/+638
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37839 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* use require_relative.akr2010-02-021-2/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26542 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/test_*.rb: Pathname#parent -> Pathname#dirname.nahi2004-01-131-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/inlinetest.rb, test/{test_generator.rb,test_ipaddr.rb,nahi2004-01-061-0/+4
test_pathname.rb,test_pp.rb,test_prettyprint.rb,test_set.rb, test_time.rb,test_tsort.rb: added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5385 b2dd03c8-39d4-4d8f-98ff-823fe69b080e