aboutsummaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Allow specifying arbitrary MJIT flags by --jit-debugTakashi Kokubun2019-12-011-0/+6
| | | | | | | | This is a secret feature for me. It's only for testing and any behavior with this flag override is unsupported. I needed this because I sometimes want to add debug options but do not want to disable optimizations, for using Linux perf.
* Relax test strictness for error message from KeyErrorYuki Nishijima2019-11-301-1/+1
|
* Relax test requirements for DYM's verbose formatterYuki Nishijima2019-11-301-2/+1
|
* remove spaces to pass a test.Koichi Sasada2019-12-011-1/+1
| | | | | | 23d7f4c5e1ce164e78d77de694dccc0c41f6de3d breaks a test which expect to match error message. To avoid this failure, use #strip for expect and actual results.
* * remove trailing spaces. [ci skip]git2019-12-011-1/+1
|
* Promote did_you_mean to default gemKevin Deisz2019-11-3018-0/+1156
| | | | At the moment, there are some problems with regard to bundler + did_you_mean because of did_you_mean being a bundled gem. Since the vendored version of thor inside bundler and ruby itself explicitly requires did_you_mean, it can become difficult to load it when using Bundler.setup. See this issue: https://github.com/yuki24/did_you_mean/issues/117#issuecomment-482733159 for more details.
* ENV.update should not call block on existing keysNobuyoshi Nakada2019-11-301-1/+1
| | | | [Bug #16192]
* Revert "[ruby/fileutils] Fix #install with "X" mode option"Hiroshi SHIBATA2019-11-301-2/+0
| | | | | | This reverts commit eab88d20eaa925d5e61a2a65820a099b46ccf3f8. The some CI was broken with this.
* [ruby/webrick] Check the feature by itself, instead of the version numberNobuyoshi Nakada2019-11-301-1/+1
| | | | https://github.com/ruby/webrick/commit/79d7922de9
* [ruby/webrick] Enabled chunked encoding if Transfer-Encoding: chunked header ↵Jeremy Evans2019-11-301-0/+7
| | | | | | | | | | is set Patch from Leonard Garvey. Fixes Ruby Bug 9986. https://github.com/ruby/webrick/commit/8cff7f3995
* [ruby/webrick] Allow WEBrick::HTTPServlet::CGIHandler :CGIInterpreter option ↵Jeremy Evans2019-11-302-1/+9
| | | | | | | | | | to be array This way you don't need to escape each entry. Implements Ruby Feature 15170. https://github.com/ruby/webrick/commit/d8086e600c
* [ruby/fileutils] Fix #install with "X" mode optionNobuyoshi Nakada2019-11-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `FileUtils#install` methed raises an unexpected `TypeError`, when called with `mode:` option which has `"X"`. ``` $ ruby -rfileutils -e 'FileUtils.install("tmp/a", "tmp/b", mode: "o+X")' /opt/local/lib/ruby/2.7.0/fileutils.rb:942:in `directory?': no implicit conversion of File::Stat into String (TypeError) from /opt/local/lib/ruby/2.7.0/fileutils.rb:942:in `block (3 levels) in symbolic_modes_to_i' from /opt/local/lib/ruby/2.7.0/fileutils.rb:933:in `each_char' from /opt/local/lib/ruby/2.7.0/fileutils.rb:933:in `each' from /opt/local/lib/ruby/2.7.0/fileutils.rb:933:in `inject' from /opt/local/lib/ruby/2.7.0/fileutils.rb:933:in `block (2 levels) in symbolic_modes_to_i' from /opt/local/lib/ruby/2.7.0/fileutils.rb:931:in `each' from /opt/local/lib/ruby/2.7.0/fileutils.rb:931:in `each_slice' from /opt/local/lib/ruby/2.7.0/fileutils.rb:931:in `block in symbolic_modes_to_i' from /opt/local/lib/ruby/2.7.0/fileutils.rb:926:in `each' from /opt/local/lib/ruby/2.7.0/fileutils.rb:926:in `inject' from /opt/local/lib/ruby/2.7.0/fileutils.rb:926:in `symbolic_modes_to_i' from /opt/local/lib/ruby/2.7.0/fileutils.rb:973:in `fu_mode' from /opt/local/lib/ruby/2.7.0/fileutils.rb:883:in `block in install' from /opt/local/lib/ruby/2.7.0/fileutils.rb:1588:in `block in fu_each_src_dest' from /opt/local/lib/ruby/2.7.0/fileutils.rb:1604:in `fu_each_src_dest0' from /opt/local/lib/ruby/2.7.0/fileutils.rb:1586:in `fu_each_src_dest' from /opt/local/lib/ruby/2.7.0/fileutils.rb:877:in `install' from -e:1:in `<main>' ``` In spite of that `symbolic_modes_to_i` considers the `File::Stat` `path` case at the beginning, in `"X"` case, `path` is passed to `FileTest.directory?` method which requires a `String`. In such case, the mode in `path` should be examined instead. https://github.com/ruby/fileutils/commit/2ea54ade2f
* [ruby/fileutils] Added `test_install_mode_option`Nobuyoshi Nakada2019-11-301-0/+24
| | | | https://github.com/ruby/fileutils/commit/bb10efe104
* [ruby/forwardable] Fix keyword argument separation warnings on Ruby 2.7+Jeremy Evans2019-11-301-0/+16
| | | | | | Do so in a way that is also compatible with previous versions. https://github.com/ruby/forwardable/commit/b2dd340988
* Supress class variable overtaken warning when original modules are the sameJeremy Evans2019-11-291-0/+23
| | | | | This issue was exposed by recent commits to better support including refined modules.
* Make single line pattern matching void expressionNobuyoshi Nakada2019-11-301-2/+2
| | | | | Instead of returning `nil`, raise a syntax error if its value is used. [Feature #16355]
* check interrupts at each frame pop timing.Koichi Sasada2019-11-292-3/+5
| | | | | | | | | | | | | | | | | | Asynchronous events such as signal trap, finalization timing, thread switching and so on are managed by "interrupt_flag". Ruby's threads check this flag periodically and if a thread does not check this flag, above events doesn't happen. This checking is CHECK_INTS() (related) macro and it is placed at some places (laeve instruction and so on). However, at the end of C methods, C blocks (IMEMO_IFUNC) etc there are no checking and it can introduce uninterruptible thread. To modify this situation, we decide to place CHECK_INTS() at vm_pop_frame(). It increases interrupt checking points. [Bug #16366] This patch can introduce unexpected events...
* Reduce duplicated warnings for the change of Ruby 3 keyword argumentsYusuke Endoh2019-11-292-29/+140
| | | | | | | | | | | | | | | By this change, the following code prints only one warning. ``` def foo(**opt); end 100.times { foo({kw:1}) } ``` A global variable `st_table *caller_to_callees` is a map from caller to a set of callee methods. It remembers that a warning is already printed for each pair of caller and callee. [Feature #16289]
* vm_method.c: add top-level ruby2_keywordsYusuke Endoh2019-11-291-0/+12
| | | | | | This is a top-level version of Module#ruby2_keywords. It can be used for functions (top-level methods) that delegates arguments. [Feature #16364]
* `LoadError` is not a subclass of `StandardError`Nobuyoshi Nakada2019-11-291-1/+5
|
* Skip useless testNobuyoshi Nakada2019-11-291-1/+1
| | | | | `JSONGeneratorTest#test_remove_const_seg` is meaningful only for the extension library version, but nonsense for pure ruby version.
* * remove trailing spaces. [ci skip]git2019-11-291-1/+1
|
* fastpath for ivar read of FL_EXIVAR objects.Koichi Sasada2019-11-291-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 = [Object.new, 'str', {a: 1, b: 2}, [1, 2]] objs.each.with_index{|obj, i| rep = obj.inspect rep = 'Object.new' 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 x.report %Q{ v#{i}.foo } } } Result: v0.foo # T_OBJECT clean: 85387141.8 i/s trunk: 85249373.6 i/s - 1.00x slower v1.foo # T_STRING trunk: 57894407.5 i/s clean: 39957178.6 i/s - 1.45x slower v2.foo # T_HASH trunk: 56629413.2 i/s clean: 39227088.9 i/s - 1.44x slower v3.foo # T_ARRAY trunk: 55797530.2 i/s clean: 38263572.9 i/s - 1.46x slower
* Added Symbol#start_with? and Symbol#end_with? method. [Feature #16348]NARUSE, Yui2019-11-281-0/+23
|
* Make prepending a refined module after inclusion not break refinementsJeremy Evans2019-11-281-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | 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]
* Honor refinements for modules that prepend other modulesJeremy Evans2019-11-281-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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]
* Add require "irb" to test/irb/test_completion.rbaycabta2019-11-281-1/+2
|
* Fix regexp to complete complex literalaycabta2019-11-281-0/+5
| | | | | | 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.
* Raise `NoMatchingPatternError` when expr `in` pat doesn't matchNobuyoshi Nakada2019-11-281-1/+4
| | | | | | | | * `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]
* Fix ghost method line noaycabta2019-11-281-3/+5
|
* Don't modify rest array when using ruby2_keywordsJeremy Evans2019-11-271-0/+9
| | | | | | 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.
* [ripper] Fixed unique key check in pattern matchingNobuyoshi Nakada2019-11-261-0/+25
| | | | | | Check keys * by an internal table, instead of unstable dispatched results * and by parsed key values, instead of escaped forms in the source
* [ripper] Quoted label without expression must be a local variableNobuyoshi Nakada2019-11-251-0/+3
| | | | | | | | | 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, $$); ```
* Use realpath to try to fix failures with symlinksKazuhiro NISHIYAMA2019-11-231-0/+2
|
* Tracer.set_get_line_procs should support block and Proc objectaycabta2019-11-231-0/+103
| | | | | | 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.
* Tracer.add_filter should support block and Proc objectaycabta2019-11-231-0/+73
| | | | | Original Tracer.add_filter is implemented by "def add_filter(p = proc)". It means that original Tracer.add_filter supports block and Proc object.
* Skip test_validate_gemspec when tarball and git installed tooKazuhiro NISHIYAMA2019-11-231-1/+1
| | | | | | `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.
* Support %U/%u/%W/%w/%V/%g/%G formats in Time.strptimeJeremy Evans2019-11-211-0/+11
| | | | | | | | | | | | | | | | 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]
* Add test/reline/test_string_processing.rbaycabta2019-11-211-0/+23
|
* Use singleline/multiline instead of readline/reidlineaycabta2019-11-211-1/+1
|
* Refined inspection of argument forwardingNobuyoshi Nakada2019-11-211-2/+4
|
* Change argument `Proc` to `#call` defined object.manga_osyo2019-11-211-0/+24
| | | | This is the same as the behavior of Readline.
* Add tests of argument forwarding's parameters and inspectKazuhiro NISHIYAMA2019-11-201-0/+5
|
* Update representation (discussed on ruby tracker)zverok2019-11-201-20/+20
|
* Fix test_module.rbzverok2019-11-201-1/+1
|
* Method parameters inspectzverok2019-11-201-6/+63
| | | | | | | | | 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) ...>
* Generate history file path correctly when $HOME/.irbrc doesn't existaycabta2019-11-201-0/+40
|
* Fix memory corruption in Enumerable#reverse_each [ruby-dev:50867] [Bug #16354]Kazuki Tsujimoto2019-11-191-0/+13
|
* Revert "[ripper] Quoted label without expression must be a local variable"Nobuyoshi Nakada2019-11-201-3/+0
| | | | | This reverts commit 0b8c73aa65add5c57b46b0cfdf4e661508802172, which seems breaking RVALUE consistency check.
* Avoid needless object allocationKazuki Tsujimoto2019-11-192-1/+3
|