summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2020-07-04Fix non-numeric exclusive Range#minmax bugSam Bostock
The implementation of Range#minmax added in d5c60214c45 causes the following incorrect behaviour: ('a'...'c').minmax => ["a", ["a", "b"]] instead of ('a'...'c').minmax => ["a", "b"] This is because the C implementation of Range#minmax (range_minmax) directly delegates to the C implementation of Range#min (range_min) and Range#max (range_max), without changing the execution context. Range#max's C implementation (range_max), when given a non-numeric exclusive range, delegates to super, which is meant to call Enumerable#max. However, because range_max is called directly by range_minmax, super calls Enumerable#minmax instead, causing the incorrect nesting. Perhaps it is possible to change the execution context in an optimized manner, but the simplest solution seems to be to just explicitly delegate from Range#minmax to Range#min and Range#max. Notes: Merged: https://github.com/ruby/ruby/pull/3285
2020-07-03Make Kernel#then, #yield_self, #frozen? builtin (#3283)Takashi Kokubun
* Make Kernel#then, #yield_self, #frozen? builtin * Fix test_jit Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2020-07-03Rewrite Kernel#tap with Ruby (#3281)Takashi Kokubun
* Rewrite Kernel#tap with Ruby This was good for VM too, but of course my intention is to unblock JIT's inlining of a block over yield (inlining invokeyield has not been committed though). * Fix test_settracefunc About the :tap deletions, the :tap events are actually traced (we already have a TracePoint test for builtin methods), but it's filtered out by tp.path == "xyzzy" (it became "<internal:kernel>"). We could trace tp.path == "<internal:kernel>" cases too, but the lineno is impacted by kernel.rb changes and I didn't want to make it fragile for kernel.rb lineno changes. Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2020-07-03test/json/json_fixtures_test.rb: Prevent an "out of range" warningYusuke Endoh
``` /home/mame/work/ruby/.ext/common/json/common.rb:263: warning: Float 23456789012E666 out of range ```
2020-07-03Reintroduce c565dfb09ad7d55fa671f65cea7088a914bf1931Yusuke Endoh
2020-07-01Merge json-2.3.1 from flori/jsonHiroshi SHIBATA
2020-07-01[flori/json] Fix test that wasn't testing anythingMarc-Andre Lafortune
https://github.com/flori/json/commit/d5c6566b41
2020-06-28[ruby/fiddle] support for very old libffiNobuyoshi Nakada
Define `Fiddle::TYPE_VARIADIC` only when `ffi_prep_cif_var` is available, otherwise skip the test for it.
2020-06-27[ruby/fiddle] Support MSWIN (#43)Sutou Kouhei
https://github.com/ruby/fiddle/commit/f16e7ff6e0 Notes: Merged: https://github.com/ruby/ruby/pull/3265
2020-06-27[ruby/fiddle] test windows: use _snprintfSutou Kouhei
https://github.com/ruby/fiddle/commit/aa261bdb9f Notes: Merged: https://github.com/ruby/ruby/pull/3265
2020-06-27[ruby/fiddle] Add support for variadic argumentsSutou Kouhei
GitHub: fix GH-39 Reported by kojix2. Thanks!!! https://github.com/ruby/fiddle/commit/6c4cb904dc Notes: Merged: https://github.com/ruby/ruby/pull/3265
2020-06-26Revert "Try increasing read timeout of rinda tests"Takashi Kokubun
This reverts commit 5c03e4680e724faeedb2c5fc1581d5fcb66aaff2. I gave up stabilizing Rinda::TupleSpaceProxyTest#test_cancel_02. As the test uses sleep, it's probably not gonna be stable with --jit-wait. http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/3028276 http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/3028065 http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/3027857 http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/3027441
2020-06-27Suppress "assigned but unused variable" warningsKazuki Tsujimoto
2020-06-27Add #deconstruct cache to find patternVladimir Dementyev
Notes: Merged: https://github.com/ruby/ruby/pull/3104
2020-06-27Optimize array pattern matching by caching #deconstruct valueVladimir Dementyev
Notes: Merged: https://github.com/ruby/ruby/pull/3104
2020-06-26[ruby/fiddle] Fixed typosNobuyoshi Nakada
https://github.com/ruby/fiddle/commit/a09e66adf4 https://github.com/ruby/fiddle/commit/6cab9b45d6 https://github.com/ruby/fiddle/commit/ab72b19bed
2020-06-25Collect insns from a child processTakashi Kokubun
to make sure :opt_invokebuiltin_delegate_leave doesn't become :(trace_)opt_invokebuiltin_delegate. This is to prevent a warning like > /tmp/ruby/v3/src/trunk-test/test/ruby/test_jit.rb:618: warning: 'opt_invokebuiltin_delegate_leave' insn is not included in the script. Actual insns are: opt_invokebuiltin_delegate leave
2020-06-26test/ruby/test_settracefunc.rb: Suppress a warningYusuke Endoh
http://rubyci.s3.amazonaws.com/ubuntu2004/ruby-master/log/20200626T033003Z.log.html.gz ``` /home/chkbuild/chkbuild/tmp/build/20200626T033003Z/ruby/test/ruby/test_settracefunc.rb:2299: warning: ambiguous first argument; put parentheses or a space even after `/' operator ```
2020-06-25Try increasing read timeout of rinda testsTakashi Kokubun
To prevent random failure with --jit-wait like http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/3026615
2020-06-26fix return event and opt_invokebuiltin_delegate_leave (#3256)Koichi Sasada
If :return event is specified for a opt_invokebuiltin_delegate_leave and leave combination, the instructions should be opt_invokebuiltin_delegate trace_return instructions. To make it, opt_invokebuiltin_delegate_leave instruction will be changed to opt_invokebuiltin_delegate even if it is not an event target instruction. Notes: Merged-By: ko1 <ko1@atdot.net>
2020-06-24Do not JIT inline builtin methodsTakashi Kokubun
It's probably not worth it because there's nothing we can optimize in such builtin methods. It's worth JIT only when inlined.
2020-06-24Run a TracePoint test in an insolated processTakashi Kokubun
to prevent a random failure like http://ci.rvm.jp/results/trunk-random2@phosphorus-docker/3024287
2020-06-25Drop token info for endless method definitionNobuyoshi Nakada
Because it does not have closing `end`.
2020-06-25[ripper] added endless method definition event testsNobuyoshi Nakada
2020-06-24[ripper] fix mismatched indentations warning [Bug #16981]Nobuyoshi Nakada
The scanner location has to be set from `lex.ptok` before it is flushed by dispatching the scanner event.
2020-06-24[ripper] fail unless got warning as expectedNobuyoshi Nakada
2020-06-24Fix a random test failure by TracePointTakashi Kokubun
A test worker process may already be enabling TracePoint, which results in changing the insn name in this test. http://ci.rvm.jp/results/trunk-random0@phosphorus-docker/3022750
2020-06-23Trace :return of builtin methodsTakashi Kokubun
using opt_invokebuiltin_delegate_leave insn. Since Ruby 2.7, :return of methods using builtin have not been traced properly.
2020-06-23[ruby/psych] Fix anchor lookup with symbolized namesJean Boussier
https://github.com/ruby/psych/commit/ef74fc01e2
2020-06-22Skip test_read_body_block_mod for --jit-waitTakashi Kokubun
2020-06-22Fix Encoding::CompatibilityError in `FileUtils::Entry_#join`Kazuhiro NISHIYAMA
2020-06-22Fix typosKazuhiro NISHIYAMA
2020-06-22Revert d231b8f95b35d8a344cec4f62d7bbdf360a70e1c and add debug printKazuhiro NISHIYAMA
2020-06-22Add tests of nested multibyte path and DirectoryIndexKazuhiro NISHIYAMA
2020-06-22Fix remove_entry error when path encoding is not compatible UTF-8Kazuhiro NISHIYAMA
2020-06-22Check symlink in tmpdir and do not use empty pathKazuhiro NISHIYAMA
2020-06-21Try increasing read_timeout a little moreTakashi Kokubun
It failed again http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/3018488
2020-06-21Increase read_timeout for --jit-waitTakashi Kokubun
This tries to fix a random failure like http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/3017837
2020-06-21test/ruby/test_jit.rb: Change the condition to detect RHEL 7.1 s390xYusuke Endoh
2020-06-21Increase read timeout of FTP tests with --jit-waitTakashi Kokubun
Trying to eliminate some newer random failures http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/3016543
2020-06-20Skip a test_jit with builtin for rhel_zlinuxTakashi Kokubun
Either 95b0fed371 or 7561db8c00 started to cause https://rubyci.org/logs/rubyci.s3.amazonaws.com/rhel_zlinux/ruby-master/log/20200621T053303Z.fail.html.gz But so far no idea why it's happening. Until I get direct ssh access to debug the details, let me skip this as it's essentially not ruby's fault.
2020-06-21Prefer more descriptive assertion methodsNobuyoshi Nakada
2020-06-20Make Integer#zero? a separated method and builtin (#3226)Takashi Kokubun
A prerequisite to fix https://bugs.ruby-lang.org/issues/15589 with JIT. This commit alone doesn't make a significant difference yet, but I thought this commit should be committed independently. This method override was discussed in [Misc #16961]. Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2020-06-20[ruby/date] Fix cannot load complex into simple error when loading marshal ↵Jeremy Evans
dump (Fixes #20) This problem exists because Marshal.load calls Date.allocate, which uses a SimpleDateData. There doesn't seem to be any support for taking an existing Date instance and converting it from SimpleDateData to ComplexDateData. Work around this issue by making Date.allocate use a ComplexDateData. This causes problems in Date#initialize, so remove the Date#initialize method (keeping the date_initialize function, used internally for Date.civil). Alias Date.new to Date.civil, since they do the same thing. https://github.com/ruby/date/commit/6bb8d8fa0f
2020-06-20test/coverage/test_coverage.rb: Add a test for [Bug #16967]Yusuke Endoh
Notes: Merged: https://github.com/ruby/ruby/pull/3240
2020-06-19Implement Proc#== and #eql?Jeremy Evans
Previously, these were not implemented, and Object#== and #eql? were used. This tries to check the proc internals to make sure that procs created from separate blocks are treated as not equal, but procs created from the same block are treated as equal, even when the lazy proc allocation optimization is used. Implements [Feature #14267] Notes: Merged: https://github.com/ruby/ruby/pull/3174
2020-06-20Use section sign instead of Hiragana Letter AKazuhiro NISHIYAMA
It can convert to Windows-1252and Windows-31J. ``` "\u00a7".encode("Windows-1252") #=> "\xA7" "\u00a7".encode("Windows-31J") #=> "\x{8198}" ``` https://github.com/ruby/ruby/runs/788357527?check_suite_focus=true#step:14:959 ``` 1) Failure: WEBrick::TestFileHandler#test_cjk_in_path [D:/a/ruby/ruby/src/test/webrick/utils.rb:72]: exceptions on 2 threads: webrick log start: [2020-06-19 14:49:38] ERROR Encoding::CompatibilityError: incompatible character encodings: ASCII-8BIT and Windows-1252 D:/a/ruby/ruby/src/lib/webrick/httpservlet/filehandler.rb:341:in `+' D:/a/ruby/ruby/src/lib/webrick/httpservlet/filehandler.rb:341:in `set_filename' D:/a/ruby/ruby/src/lib/webrick/httpservlet/filehandler.rb:310:in `exec_handler' D:/a/ruby/ruby/src/lib/webrick/httpservlet/filehandler.rb:245:in `do_GET' D:/a/ruby/ruby/src/lib/webrick/httpservlet/abstract.rb:105:in `service' D:/a/ruby/ruby/src/lib/webrick/httpservlet/filehandler.rb:241:in `service' D:/a/ruby/ruby/src/lib/webrick/httpserver.rb:140:in `service' D:/a/ruby/ruby/src/lib/webrick/httpserver.rb:96:in `run' D:/a/ruby/ruby/src/lib/webrick/server.rb:307:in `block in start_thread' ```
2020-06-19Use filesystem encoding as FileHandler's encodingKazuhiro NISHIYAMA
instead of `@root.encoding`. And fallback to ASCII-8BIT when filesystem encoding is US-ASCII. When `@root.encoding` is not compatible filesystem encoding, `Encoding::CompatibilityError` raised at `webrick/httpservlet/filehandler.rb:341`. So `DocumentRoot` must be compatible with filesystem encoding.
2020-06-19Fix failure on mswin CIKazuhiro NISHIYAMA
https://rubyci.org/logs/mswinci.japaneast.cloudapp.azure.com/vc12-x64/ruby-master/log/20200619T054159Z.fail.html.gz ``` 1) Failure: WEBrick::TestFileHandler#test_cjk_in_path [D:/tmp/mswin-build20200619-14304-utgij/ruby/test/webrick/utils.rb:72]: exceptions on 2 threads: webrick log start: [2020-06-19 16:28:42] ERROR `/あ.txt' not found. webrick log end Filesystem encoding is Windows-31J. <"200"> expected but was <"404">. --- <[]> expected but was <["[2020-06-19 16:28:42] ERROR `/\xE3\x81\x82.txt' not found.\n"]>. ``` `prevent_directory_traversal` treats `path_info` as filesystem encoding. So path_info should be filesystem encoding in request URL. On some environments, fallback to ASCII-8BIT when EncodingError.
2020-06-19test/ruby/test_refinement.rb: suppress warning yb $VEROBSE = nilYusuke Endoh
http://rubyci.s3.amazonaws.com/ubuntu2004/ruby-master/log/20200619T003004Z.log.html.gz ``` /home/chkbuild/chkbuild/tmp/build/20200619T003004Z/ruby/test/ruby/test_refinement.rb:2428: warning: method redefined; discarding old foo /home/chkbuild/chkbuild/tmp/build/20200619T003004Z/ruby/test/ruby/test_refinement.rb:2418: warning: previous definition of foo was here ```