summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2023-10-25Strip trailing spaces [ci skip]Nobuyoshi Nakada
2023-10-25Fixup 5461bc18f88Hiroshi SHIBATA
2023-10-25omit failing test at arm64-neoverse-n1Hiroshi SHIBATA
2023-10-25Add tests for passing nil to Comparable#clamp(min, max)Kouhei Yanagita
2023-10-25Fix [Bug #19632]: Disable external iterator for frozen enumerator (#7791)Hiroya Fujinami
* Fix [Bug #19632]: Disable external iterator for frozen enumerator Currently, methods to manipulate an external iterator like `#next` and `#feed` can be called even if a receiver of an enumerator is frozen. However, these methods change the state of an external iterator in an enumerator. Therefore, it seems a BUG to me, and these methods should raise FrozenError if the receiver is frozen. This fixed the following methods to raise FrozenError if the receiver is frozen. - `Enumerator#next` - `Enumerator#next_values` - `Enumerator#peek` - `Enumerator#peek_values` - `Enumerator#feed` - `Enumerator#rewind` * Fix a typo in the document Thanks @Maumagnaguagno.
2023-10-24Remove SHAPE_MAX_NUM_IVSAaron Patterson
There is no longer a limit on the number of IVs you can store. SHAPE_MAX_NUM_IVS was used to work around the IV10K problem (the well known problem where setting 10k instance variables in a row would be too slow). The redblack tree works well at any shape depth, even depths greater than 80, and solves the IV10K problem.
2023-10-24geniv objects can become too complexAaron Patterson
2023-10-23[PRISM] Implement compilation for PreExecutionNodesJemma Issroff
2023-10-23[PRISM] Fix AssocSplat nodeJemma Issroff
This commit emits the correct instructions for hashes which have both AssocSplat and Assoc nodes contained within them
2023-10-23[rubygems/rubygems] Ignore non-tar format `.gem` files during searchdearblue
Previously, `rake install` or `rake update` would fail if there was a non-tar format `.gem` file in the current working directory. https://github.com/rubygems/rubygems/commit/f562788f1d
2023-10-23[PRISM] Fix __LINE__ to be 1-indexed by defaultJemma Issroff
2023-10-23[PRISM] Add several testsJemma Issroff
2023-10-23[PRISM] Fix compilation for IfNode, UnlessNodeJemma Issroff
This properly implements the branch condition for FlipFlopNodes on If / UnlessNodes, and also fixes the bug in UnlessNodes
2023-10-23[PRISM] Add tests for BlockNode, BlockLocalVariableNode, BlockParamet… (#8725)Jemma Issroff
[PRISM] Add tests for BlockNode, BlockLocalVariableNode, BlockParametersNode
2023-10-21[rubygems/rubygems] Gem::NameTuple equality ignores Gem::Platform/string ↵Martin Emde
platform variation https://github.com/rubygems/rubygems/commit/49aaa46708
2023-10-21[ruby/irb] Minor refactors around irb.rbStan Lo
(https://github.com/ruby/irb/pull/736) * Remove dead method * Simplify IRB.version * Move private Irb methods together * Centralise @CONF initialization/assignment in init.rb * Move attr_* calls above initialize method https://github.com/ruby/irb/commit/cf23be4395
2023-10-21Raise TypeError for bad IO::Buffer.map argument (#8728)Charles Oliver Nutter
* Raise TypeError when IO::Buffer.map argument is neither IO nor implements #fileno * Use UNREACHABLE_CODE Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org> * Use macro for undef check Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org> --------- Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2023-10-21Extract IO::Buffer.for string locking test (#8729)Charles Oliver Nutter
String locking with locktmp is not really part of the public API, and the test relies in a side effect of using it to protect the buffer. On other implementations without locktmp this does not fail. Separate into its own test so it can be excluded from public API expectations.
2023-10-20YJIT: Skip printing stats at exit if --yjit-disable (#8727)Takashi Kokubun
2023-10-20[PRISM] Setup encodings in prism compilerJemma Issroff
2023-10-20YJIT: On test_bug_19316, only check the resultAlan Wu
Because the `&` call checks for interrupts, the test was accidentally timing dependent. Stop checking for exits. [Bug #19921] Reported-by: Vít Ondruch <vondruch@redhat.com> Reported-by: Mamoru Tasaka <mtasaka@fedoraproject.org>
2023-10-20Add tests for all implemented nodes, leave ones that need fixing commented outJemma Issroff
2023-10-20Added TODOs on all implemented nodes, matched orderingJemma Issroff
2023-10-20[PRISM] Fixed StringConcatNode, uncommented testsJemma Issroff
2023-10-20[Bug #19966] [PRISM] Fix singleton method definitionNobuyoshi Nakada
2023-10-20[PRISM] Enclose in the test classNobuyoshi Nakada
2023-10-19YJIT: Make test_yjit.rb faster with --yjit-stats=quietAlan Wu
The for-human stats summaries are not relevant for the children `test_yjit.rb` spawns. Avoid compiling and running the printing code. On a -O0 dev build this halves the time for `test_yjit.rb` on my machine.
2023-10-19YJIT: Print exit reasons on failure in test_yjit.rbAlan Wu
For <https://bugs.ruby-lang.org/issues/19921>, I suspect the test is failing due to a timing related interrupt, which on paper could happen with slow-enough GC runs. In any case, it's helpful for debugging to have more information when tests fail. Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
2023-10-19YJIT: Add RubyVM::YJIT.enable (#8705)Takashi Kokubun
2023-10-18Skip some timeout tests on s390xYusuke Endoh
They are too unstable on the machine. ``` 1) Failure: TestRegexp#test_timeout_shorter_than_global [/home/chkbuild/chkbuild/tmp/build/20231018T230003Z/ruby/test/ruby/test_regexp.rb:1788]: Expected |0.2 - 0.962938869| (0.7629388690000001) to be <= 0.15000000000000002. ``` https://rubyci.s3.amazonaws.com/s390x/ruby-master/log/20231018T230003Z.fail.html.gz ``` 1) Failure: TestRegexp#test_timeout_longer_than_global [/home/chkbuild/chkbuild/tmp/build/20231017T140006Z/ruby/test/ruby/test_regexp.rb:1788]: Expected |0.5 - 1.040696078| (0.5406960780000001) to be <= 0.375. ``` https://rubyci.s3.amazonaws.com/s390x/ruby-master/log/20231017T140006Z.fail.html.gz
2023-10-18Use assert_separately to avoid defining `foo`Aaron Patterson
When we eval the iseqs generated by prism, they can have side effects like defining methods. In this case, we were defining the method "foo", but other tests were expecting that the foo method would _not_ be defined.
2023-10-18Temporarily removed location code on scope nodesJemma Issroff
2023-10-18Remove pm_compile_context_t, move the context onto ScopeNodeJemma Issroff
We changed ScopeNodes to point to their parent (previous) ScopeNodes. Accordingly, we can remove pm_compile_context_t, and store all necessary context in ScopeNodes, allowing us to access locals from outer scopes.
2023-10-18Add test for many ivarsKatherine Oelsner
Co-authored-by: John Hawthorn <john@hawthorn.email>
2023-10-18[ruby/drb] Support :SSL{Min,Max}Version config optionsJeremy Evans
These are necessary to get the tests passing with LibreSSL 3.8.1+, which dropped support for TLSv1.0 and TLSv1.1 for security reasons. This updates the tests to use TLSv1.2 on OpenBSD. This is only strictly necessary on OpenBSD 7.4+, but it will work fine in previous versions as well. https://github.com/ruby/drb/commit/32707b2db5
2023-10-18[ruby/prism] Fix lex compat when dedent should be 0Kevin Newton
https://github.com/ruby/prism/commit/41c0e0e06e
2023-10-18[ruby/prism] Add * and & to methods with ...Kevin Newton
https://github.com/ruby/prism/commit/e8114a786a
2023-10-18[ruby/prism] Use the unescaped regexp to scan for capture groupsKevin Newton
https://github.com/ruby/prism/commit/555551e8f2
2023-10-18[ruby/prism] Index{Operator,And,Or}WriteNodeKevin Newton
Right now, our Call{Operator,And,Or}WriteNode nodes represent two different concepts: ```ruby foo.bar += 1 foo[bar] += 1 ``` These two statements are different in what they can support. The former can never have arguments (or an opening_loc or closing_loc). The former can also never have a block. Also, the former is a variable method name. The latter is always going to be []/[]=, it can have any number of arguments including blocks (`foo[&bar] ||= 1`), and will always have an opening_loc and closing_loc. Furthermore, these statements end of having to take different paths through the various compilers because with the latter you have to consider the arguments and the block, whereas the former can perform some additional peephole optimizations since there are fewer values on the stack. For these reasons, I'm introducing Index{Operator,And,Or}WriteNode. These nodes never have a read_name or write_name on them because they are always []/[]=. They also support blocks, which the previous write nodes didn't. As a benefit of introducing these nodes, I've removed the opening_loc, closing_loc, and arguments from the older write nodes because they will always be null. For the serialized format, both of these nodes end up being smaller, and for in-memory we're storing fewer things in general, so we have savings all around. I don't love that we are introducing another node that is a call node since we generally want consumers to only have to handle a single call, but these nodes are so specific that they would have to be handled separately anyway since in fact call 2 methods. https://github.com/ruby/prism/commit/70155db9cd
2023-10-18[rubygems/rubygems] Allow uninstalling multiple versions of same gemKyle Stevens
Currently, you can install multiple versions of the same gem just fine: ``` $ gem install simplecov:0.19.0 simplecov:0.22.0 Fetching simplecov-0.19.0.gem Successfully installed simplecov-0.19.0 Parsing documentation for simplecov-0.19.0 Installing ri documentation for simplecov-0.19.0 Done installing documentation for simplecov after 0 seconds Fetching simplecov-0.22.0.gem Successfully installed simplecov-0.22.0 Parsing documentation for simplecov-0.22.0 Installing ri documentation for simplecov-0.22.0 Done installing documentation for simplecov after 0 seconds 2 gems installed ``` But to uninstall both of them, you need to run the equivalent uninstall command twice: ``` ~$ gem uninstall simplecov:0.19.0 simplecov:0.22.0 Successfully uninstalled simplecov-0.22.0 ~$ gem uninstall simplecov:0.19.0 simplecov:0.22.0 Gem 'simplecov' is not installed Successfully uninstalled simplecov-0.19.0 ``` This resolves that problem by using the gem's full name (which includes the version) when tracking which ones have already been uninstalled so when it gets to the second version listed it doesn't think it was already uninstalled. https://github.com/rubygems/rubygems/commit/d96101b753
2023-10-18Show backtraces when failedKoichi Sasada
If `assert_equal(backtrace_locations.size, profile_frames.size)` in `TestProfileFrames#test_matches_backtrace_locations_main_thread` failed, we do not have enough information about it like that: ``` 1) Failure: TestProfileFrames#test_matches_backtrace_locations_main_thread [/home/runner/work/ruby/ruby/src/test/-ext-/debug/test_profile_frames.rb:148]: <31> expected but was <30>. ``` This patch shows both `backtrace_locations` and `profile_frames` if failed.
2023-10-18Loosen assertion for flaky weak references testPeter Zhu
2023-10-18YJIT: Use RbConfig.ruby instead of EnvUtil.rubybin (#8689)Takashi Kokubun
Some people encounter an issue that test_yjit uses the installed Ruby instead of the currently-running Ruby. It's fixed when they remove the installed Ruby. However, test_yjit should run the currently-running Ruby for testing YJIT in subprocesses. EnvUtil is unfortunately used outside tests as well, so for compatibility reasons, this commit only changes the argument given to EnvUtil.invoke_ruby to always use RbConfig.ruby. Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
2023-10-17[ruby/prism] Ensure last encoding flag winseileencodes
You can't encoding a string with more than one encoding so ensure that the last one wins. https://github.com/ruby/prism/commit/4182c988c9
2023-10-17"+MN" in descriptionKoichi Sasada
If `RUBY_MN_THREADS=1` is given, this patch shows `+MN` in `RUBY_DESCRIPTION` like: ``` $ RUBY_MN_THREADS=1 ./miniruby --yjit -v ruby 3.3.0dev (2023-10-17T04:10:14Z master 908f8fffa2) +YJIT +MN [x86_64-linux] ``` Before this patch, a warning is displayed if `$VERBOSE` is given. However it can make troubles with tests (with `$VERBOSE`), do not show any warning with a MN threads configuration.
2023-10-17[ruby/prism] Fix up super with a blockargKevin Newton
https://github.com/ruby/prism/commit/0ea19ed823
2023-10-16[ruby/prism] Additionally handle encoding comments in vim modeKevin Newton
https://github.com/ruby/prism/commit/bf9bdb9d82
2023-10-16[ruby/prism] Parse all magic commentsKevin Newton
https://github.com/ruby/prism/commit/2b3d59f424
2023-10-16[ruby/net-http] Force TLS version to 1.2 when using LibreSSLJeremy Evans
This comment previously specified TLS 1.2, but actually set the version to TLS 1.0. LibreSSL 3.8.1 (included in OpenBSD 7.4) dropped support for TLS 1.0/1.1 for security reasons, which broke this test. Switch the test to use TLS 1.2 as documented so it will continue to work on OpenBSD 7.4+. https://github.com/ruby/net-http/commit/97be4de53a
2023-10-16[PRISM] Compile AliasGlobalVariableNode (#8675)Jemma Issroff