path: root/test
AgeCommit message (Collapse)Author
2019-11-29`LoadError` is not a subclass of `StandardError`Nobuyoshi Nakada
2019-11-29Skip useless testNobuyoshi Nakada
`JSONGeneratorTest#test_remove_const_seg` is meaningful only for the extension library version, but nonsense for pure ruby version.
2019-11-29* remove trailing spaces. [ci skip]git
2019-11-29fastpath for ivar read of FL_EXIVAR objects.Koichi Sasada
vm_getivar() provides fastpath for T_OBJECT by caching an index of ivar. This patch also provides fastpath for FL_EXIVAR objects. FL_EXIVAR objects have an each ivar array and index can be cached as T_OBJECT. To access this ivar array, generic_iv_tbl is exposed by rb_ivar_generic_ivtbl() (declared in variable.h which is newly introduced). Benchmark script: Benchmark.driver(repeat_count: 3){|x| x.executable name: 'clean', command: %w'../clean/miniruby' x.executable name: 'trunk', command: %w'./miniruby' objs = [, 'str', {a: 1, b: 2}, [1, 2]] objs.each.with_index{|obj, i| rep = obj.inspect rep = '' if /\#/ =~ rep x.prelude str = %Q{ v#{i} = #{rep} def v#{i}.foo @iv # ivar access method (attr_reader) end v#{i}.instance_variable_set(:@iv, :iv) } puts str %Q{ v#{i}.foo } } } Result: # T_OBJECT clean: 85387141.8 i/s trunk: 85249373.6 i/s - 1.00x slower # T_STRING trunk: 57894407.5 i/s clean: 39957178.6 i/s - 1.45x slower # T_HASH trunk: 56629413.2 i/s clean: 39227088.9 i/s - 1.44x slower # T_ARRAY trunk: 55797530.2 i/s clean: 38263572.9 i/s - 1.46x slower
2019-11-28Added Symbol#start_with? and Symbol#end_with? method. [Feature #16348]NARUSE, Yui
2019-11-28Make prepending a refined module after inclusion not break refinementsJeremy Evans
After the previous commit, this was still broken. The reason it was broken is that a refined module that hasn't been prepended to yet keeps the refined methods in the module's method table. When prepending, the module's method table is moved to the origin iclass, and then the refined methods are moved from the method table to a new method table in the module itself. Unfortunately, that means that if a class has included the module, prepending breaks the refinements, because when the methods are moved from the origin iclass method table to the module method table, they are removed from the method table from the iclass created when the module was included earlier. Fix this by always creating an origin class when including a module that has any refinements, even if the refinements are not currently used. I wasn't sure the best way to do that. The approach I choose was to use an object flag. The flag is set on the module when Module#refine is called, and if the flag is present when the module is included in another module or class, an origin iclass is created for the module. Fixes [Bug #13446] Notes: Merged:
2019-11-28Honor refinements for modules that prepend other modulesJeremy Evans
This previously did not work, and the reason it did not work is that: 1) Refining a module or class that prepends other modules places the refinements in the class itself and not the origin iclass. 2) Inclusion of a module that prepends other modules skips the module itself, including only iclasses for the prepended modules and the origin iclass. Those two behaviors combined meant that the method table for the refined methods for the included module never ends up in the method lookup chain for the class including the module. Fix this by not skipping the module itself when the module is included. This requires some code rearranging in rb_include_class_new to make sure the correct method tables and origin settings are used for the created iclass. As origin iclasses shouldn't be exposed to Ruby, this also requires skipping modules that have origin iclasses in Module#ancestors (classes that have origin iclasses were already skipped). Fixes [Bug #16242] Notes: Merged:
2019-11-28Add require "irb" to test/irb/test_completion.rbaycabta
2019-11-28Fix regexp to complete complex literalaycabta
IRB completion logic always needed exponential notation for complex literal such as 3e6i but it's bug. I fixed to support complex literal without exponential notation such as 3i.
2019-11-28Raise `NoMatchingPatternError` when expr `in` pat doesn't matchNobuyoshi Nakada
* `expr in pattern` should raise `NoMatchingError` when unmatched * `expr in pattern` should return `nil`. (this is unspecified, but this feature is experimental, at all) [Feature #16355]
2019-11-28Fix ghost method line noaycabta
2019-11-27Don't modify rest array when using ruby2_keywordsJeremy Evans
Previously, the rest array was modified, but it turns out that is not necessary. Not modifying the rest array fixes cases when the rest array is used more than once. Notes: Merged:
2019-11-26[ripper] Fixed unique key check in pattern matchingNobuyoshi Nakada
Check keys * by an internal table, instead of unstable dispatched results * and by parsed key values, instead of escaped forms in the source
2019-11-25[ripper] Quoted label without expression must be a local variableNobuyoshi Nakada
The difference from 0b8c73aa65add5c57b46b0cfdf4e661508802172 is to add the result of `string_add` event to marking objects. ```C RNODE($1)->nd_rval = add_mark_object(p, $$); ```
2019-11-23Use realpath to try to fix failures with symlinksKazuhiro NISHIYAMA
2019-11-23Tracer.set_get_line_procs should support block and Proc objectaycabta
Original Tracer.set_get_line_procs is implemented by "def set_get_line_procs(p = proc)". It means that original Tracer.set_get_line_procs supports block and Proc object.
2019-11-23Tracer.add_filter should support block and Proc objectaycabta
Original Tracer.add_filter is implemented by "def add_filter(p = proc)". It means that original Tracer.add_filter supports block and Proc object.
2019-11-23Skip test_validate_gemspec when tarball and git installed tooKazuhiro NISHIYAMA
`git --version` failed as expected when git is not installed, but unexpectedly pass when git installed and pwd is not in git working directory. So use `git rev-parse` instead, and it failed when git installed too.
2019-11-21Support %U/%u/%W/%w/%V/%g/%G formats in Time.strptimeJeremy Evans
Most of these formats were documented as supported, but were not actually supported. Document that %g and %G are supported. If %U/%W is specified without yday and mon/mday are not specified, then Date.strptime is used to get the appropriate yday. If cwyear is specifier without the year, or cwday and cweek are specified without mday and mon, then use Date.strptime and convert the resulting value to Time, since Time.make_time cannot handle those conversions Fixes [Bug #9836] Fixes [Bug #14241] Notes: Merged:
2019-11-21Add test/reline/test_string_processing.rbaycabta
2019-11-21Use singleline/multiline instead of readline/reidlineaycabta
2019-11-21Refined inspection of argument forwardingNobuyoshi Nakada
2019-11-21Change argument `Proc` to `#call` defined object.manga_osyo
This is the same as the behavior of Readline.
2019-11-20Add tests of argument forwarding's parameters and inspectKazuhiro NISHIYAMA
2019-11-20Update representation (discussed on ruby tracker)zverok
Notes: Merged:
2019-11-20Fix test_module.rbzverok
Notes: Merged:
2019-11-20Method parameters inspectzverok
Example: def m(a, b=nil, *c, d:, e: nil, **rest, &block) end p method(:m) #=> #<Method: m(a, b=<default>, *c, d:, e: <default>, **rest, &block) ...> Notes: Merged:
2019-11-20Generate history file path correctly when $HOME/.irbrc doesn't existaycabta
2019-11-19Fix memory corruption in Enumerable#reverse_each [ruby-dev:50867] [Bug #16354]Kazuki Tsujimoto
2019-11-20Revert "[ripper] Quoted label without expression must be a local variable"Nobuyoshi Nakada
This reverts commit 0b8c73aa65add5c57b46b0cfdf4e661508802172, which seems breaking RVALUE consistency check.
2019-11-19Avoid needless object allocationKazuki Tsujimoto
2019-11-19Add a testKazuhiro NISHIYAMA
and rename from b.rb [ruby-core:95055] [Bug #16177]
2019-11-19[ripper] Quoted label without expression must be a local variableNobuyoshi Nakada
2019-11-19Prefer dedecated assertionsNobuyoshi Nakada
2019-11-18pack is not using invokebuiltin anymoreTakashi Kokubun
2019-11-18test/-ext-/string/test_fstring.rb: suppress a warning for taintYusuke Endoh
2019-11-18catch up last commit.Koichi Sasada
Array#pack uses `opt_invokebuiltin_delegate_leave` now.
2019-11-18More fixes for $SAFE/taint post mergingJeremy Evans
Notes: Merged:
2019-11-18Deprecate taint/trust and related methods, and make the methods no-opsJeremy Evans
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. Notes: Merged:
2019-11-18Warn on access/modify of $SAFE, and remove effects of modifying $SAFEJeremy Evans
This removes the security features added by $SAFE = 1, and warns for access or modification of $SAFE from Ruby-level, as well as warning when calling all public C functions related to $SAFE. This modifies some internal functions that took a safe level argument to no longer take the argument. rb_require_safe now warns, rb_require_string has been added as a version that takes a VALUE and does not warn. One public C function that still takes a safe level argument and that this doesn't warn for is rb_eval_cmd. We may want to consider adding an alternative method that does not take a safe level argument, and warn for rb_eval_cmd. Notes: Merged:
2019-11-17Fix typosKazuhiro NISHIYAMA
2019-11-15Implement em_set_mark and em_exchange_markaycabta
2019-11-14`#@1` is no longer an embedded variableNobuyoshi Nakada
2019-11-14test/ruby/test_proc.rb: suppress "method redefined" warningsYusuke Endoh
2019-11-13Suspend many fibers test on JIT for nowTakashi Kokubun No C backtrace information and this is hard to fix immediately. As CI doesn't provide helpful information, this should be debugged locally or at least have more logs there.
2019-11-12Skip tailcall test for MJITTakashi Kokubun
failing in
2019-11-13Avoid top-level search for nested constant reference from nil in defined?Dylan Thacker-Smith
Fixes [Bug #16332] Constant access was changed to no longer allow top-level constant access through `nil`, but `defined?` wasn't changed at the same time to stay consistent. Use a separate defined type to distinguish between a constant referenced from the current lexical scope and one referenced from another namespace. Notes: Merged:
2019-11-13Suppress warnings except for when last evaluationaycabta
Co-authored-by: Kazuhiro NISHIYAMA <>
2019-11-12Migrate Wercker MJIT tests to Actions (#2676)Takashi Kokubun
* Migrate Wercker MJIT tests to Actions * Support pull request for testing * Capitalize other jobs too * Make it a command name for consistency [ci skip] * Remove wercker.yml * Add --jit-verbose=2 for debugging * Install MJIT headers * Separate install for sudo * Trigger build Notes: Merged-By: k0kubun <>
2019-11-12Show the name `Kernel#proc` in the warning messageNobuyoshi Nakada