aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_symbol.rb
Commit message (Collapse)AuthorAgeFilesLines
* [Bug #18905] Check symbol name types more strictlyNobuyoshi Nakada2022-07-201-0/+13
|
* Added Symbol#nameNobuyoshi Nakada2020-09-041-0/+6
| | | https://bugs.ruby-lang.org/issues/16150#change-87446
* Suffixed memory leak tests as "memory_leak"Nobuyoshi Nakada2020-05-071-1/+1
| | | | So that `TEST_EXCLUDES` option in common.mk works.
* Cut down warm-up loops and gain main/warm-up ratioNobuyoshi Nakada2020-05-071-3/+5
|
* Proc from Symbol needs a receiverNobuyoshi Nakada2020-02-221-2/+10
| | | | | | | So its arity should be -2 instead of -1. [Bug #16640] https://bugs.ruby-lang.org/issues/16640#change-84337
* `Proc` made by `Symbol#to_proc` should be a lambda [Bug #16260]Nobuyoshi Nakada2020-02-221-0/+7
| | | | With refinements, too.
* `Proc` made by `Symbol#to_proc` should be a lambda [Bug #16260]Nobuyoshi Nakada2020-02-221-0/+4
|
* Revert "Regexp#match{?} with nil raises TypeError as String, Symbol (#1506)"NARUSE, Yui2019-12-041-5/+0
| | | | | This reverts commit 2a22a6b2d8465934e75520a7fdcf522d50890caf. Revert [Feature #13083]
* Added Symbol#start_with? and Symbol#end_with? method. [Feature #16348]NARUSE, Yui2019-11-281-0/+23
|
* Deprecate taint/trust and related methods, and make the methods no-opsJeremy Evans2019-11-181-8/+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.
* Regexp#match{?} with nil raises TypeError as String, Symbol (#1506)Kenichi Kamiya2019-10-171-0/+5
| | | | | | | | | | | | | | | | | | | | | | | * {String|Symbol}#match{?} with nil returns falsy To improve consistency with Regexp#match{?} * String#match(nil) returns `nil` instead of TypeError * String#match?(nil) returns `false` instead of TypeError * Symbol#match(nil) returns `nil` instead of TypeError * Symbol#match?(nil) returns `false` instead of TypeError * Prefer exception * Follow empty ENV * Drop outdated specs * Write ruby/spec for above https://github.com/ruby/ruby/pull/1506/files#r183242981 * Fix merge miss
* vm_args.c: search symbol proc in super classesnobu2018-12-301-0/+6
| | | | | | | | * vm_args.c (refine_sym_proc_call): traverse ancestors to search inherited methods for symbol proc. [ruby-dev:50741] [Bug #15489] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66658 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Enable refinements on symbol-proc in ruby-level methodsnobu2018-12-181-0/+30
| | | | | | | | | | | | | | * vm_args.c (refine_sym_proc_call): resolve refinements when the proc is invoked, instead of resolving at making the proc, to enable refinements on symbol-proc in ruby-level methods * vm.c (vm_cref_dup): clear cached symbol-procs when duplicating. [Bug #15114] [Fix GH-2039] From: manga_osyo <manga.osyo@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert "Symbol refinements"mrkn2018-12-041-26/+0
| | | | | | Due to assertion failures when VM_CHECK_MODE >= 2. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66182 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Symbol refinementsmrkn2018-12-041-0/+26
| | | | | | | | | * vm_args.c (refine_sym_proc_call): enalbe accidentally disabled refinements in Symbol#to_proc. [Bug #15114] From: osyo (manga osyo) <manga.osyo@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert "Symbol refinements"nobu2018-12-031-26/+0
| | | | | | Due to assertion failures when VM_CHECK_MODE >= 2. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Symbol refinementsnobu2018-12-031-0/+26
| | | | | | | | | * vm_args.c (refine_sym_proc_call): enalbe accidentally disabled refinements in Symbol#to_proc. [Bug #15114] From: osyo (manga osyo) <manga.osyo@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert "Symbol refinements [Bug #15114]"nobu2018-12-031-26/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Symbol refinements [Bug #15114]nobu2018-12-031-0/+26
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66149 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Suppress warning: method redefined; discarding old ==naruse2017-07-031-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Symbol#== should be able to be redefinedktsj2017-07-021-0/+12
| | | | | | | | | * vm.c (vm_init_redefined_flag): set redefinition flag for Symbol#==. The bug was introduced in r58895. * test/ruby/test_symbol.rb: test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_string.rb,test_symbol.rb: add some testsstomar2017-05-211-1/+5
| | | | | | | * test/ruby/test_string.rb: add more test cases for String#casecmp. * test/ruby/test_symbol.rb: ditto for Symbol#{casecmp,casecmp?}. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58836 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_symbol.rb: switch to assert_not_equalnobu2017-03-291-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_symbol.rb: new test for nondeterminismnormal2017-03-281-0/+10
| | | | | | | | | | | We need to ensure hashes for static symbols remain non-deterministic to avoid DoS attacks. This is currently the case since 2.4+, but was not for the 2.3 series. * test/ruby/test_symbol.rb (test_hash_nondeterministic): new test [ruby-core:80430] [Bug #13376] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58200 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_eval.c: Symbol#to_proc and instance_execnobu2016-12-261-0/+6
| | | | | | | * vm_eval.c (yield_under): should evaluate the proc on the first argument. [ruby-core:78839] [Bug #13074] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57194 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_symbol.rb: use begin;end; hacknobu2016-12-261-9/+18
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57193 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Increase timeoutnaruse2016-12-181-3/+3
| | | | | | http://rubyci.s3.amazonaws.com/unstable10s/ruby-trunk/log/20161215T021909Z.fail.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test for Symbol#match? [Feature #12898]nobu2016-12-121-0/+42
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix typoskazu2016-12-061-1/+1
| | | | | | | Patch by: Koichi ITO <koic.ito@gmail.com> [Fix GH-1498] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* implement String/Symbol#casecmp? including Unicode case foldingduerst2016-11-281-0/+8
| | | | | | | | | | | * string.c: Implement String#casecmp? and Symbol#casecmp? by using String#downcase :fold for Unicode case folding. This does not include options such as :turkic, because these currently cannot be combined with the :fold option. This implements feature #12786. * test/ruby/test_string.rb/test_symbol.rb: Tests for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_refinement.rb: test_symbol_procnobu2016-10-151-12/+0
| | | | | | | * test/ruby/test_refinement.rb (test_symbol_proc): move from test_symbol.rb [Feature #9451] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_args.c: allow refinements in Symbol procnobu2016-10-151-0/+12
| | | | | | | | | * vm_args.c (refine_sym_proc_call): search and call method with refinements. * vm_args.c (vm_caller_setup_arg_block): enable refinements when enabled in the caller. [Feature #9451] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Passed block symbol to procnobu2016-06-281-0/+29
| | | | | | | | * proc.c (passed_block): convert passed block symbol to proc. based on the patch by Daisuke Sato in [ruby-dev:49695]. [Bug #12531] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55531 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_insnhelper.c: check symbol proc to thrownobu2016-06-061-0/+9
| | | | | | | | * vm_insnhelper.c (vm_throw_start): check if the iseq is symbol proc, class definition should not be a symbol proc. [ruby-core:75856] [Bug #12462] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55297 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* proc.c: fail symbol proc bindingnobu2016-03-161-0/+9
| | | | | | | * proc.c (proc_binding): proc from symbol can not make a binding. [ruby-core:74100] [Bug #12137] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby: suppress parser warningsnobu2016-02-191-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c: Symbol#matchnobu2016-02-181-0/+24
| | | | | | | * string.c (sym_match_m): delegate to String#match but not String#=~. [ruby-core:72864] [Bug #11991] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* symbol.c: more informative error messagenobu2016-01-251-1/+1
| | | | | | | | * symbol.c (sym_check_asciionly): more informative error message with the encoding name and the inspected content. [ruby-core:73398] [Feature #12016] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* proc.c: fix infinite loopnobu2015-12-191-0/+12
| | | | | | | * proc.c (rb_proc_get_iseq): proc made from symbol does not have iseq. fix infinite loop. [ruby-core:72381] [Bug #11845] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53206 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * proc.c (rb_block_arity): should not call GetProcPtr() for symbols.shugo2015-12-171-0/+7
| | | | | | [ruby-core:72205] [Bug #11830] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53170 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
* symbol.c: not freeze the receivernobu2015-11-201-0/+8
| | | | | | | * symbol.c (rb_str_intern): should not freeze the receiver itself unexpectedly. [ruby-core:71611] [Bug #11721] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_symbol.rb (test_symbol_fstr_leak): add a warm-upodaira2015-10-161-2/+2
| | | | | | | code and check RSS to avoid false positive on AIX and false negative on Mac OS X. [Bug #10686] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52140 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* proc.c: void envnobu2015-10-151-0/+1
| | | | | | * proc.c (rb_sym_to_proc): make void env. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* proc.c: proc without envnobu2015-10-151-0/+8
| | | | | | | * proc.c (rb_sym_to_proc): move from string.c and create a Proc with no environments. [ruby-core:71088] [Bug #11594] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52129 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_args.c: wrap symbol ifuncnobu2015-10-061-0/+7
| | | | | | | * vm_args.c (args_setup_block_parameter): wrap a symbol in ifunc by a proc as a block parameter. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* proc.c: set ep properlynobu2015-10-051-0/+11
| | | | | | | * proc.c (proc_new): link ep to calling block. [ruby-core:70980] [Bug #11566] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52036 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_symbol.rb: relaxnobu2015-10-041-1/+1
| | | | | | | * test/ruby/test_symbol.rb (test_to_proc): relax timeout of r51991 too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_symbol.rb: reduce iterationnobu2015-10-031-1/+1
| | | | | | | * test/ruby/test_symbol.rb (test_to_proc): reduce iteration count more. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52011 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_symbol.rb: reduce iterationnobu2015-10-021-1/+1
| | | | | | | * test/ruby/test_symbol.rb (test_to_proc): reduce iteration count. actually it reproduced in 2 times. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52004 b2dd03c8-39d4-4d8f-98ff-823fe69b080e