summaryrefslogtreecommitdiff
path: root/test/ruby
AgeCommit message (Collapse)Author
2023-10-28Extract transcoding assertionsNobuyoshi Nakada
- Prefix `check_both_ways` with `assert_` to show proper failure lines. - Extract dedicated assertions for Encoding::UndefinedConversionError and Encoding::InvalidByteSequenceError.
2023-10-27Make get_next_shape_internal idempotentJean Boussier
Since the check for MAX_SHAPE_ID was done before even checking if the transition we're looking for even exists, as soon as the max shape is reached, get_next_shape_internal would always return `TOO_COMPLEX` regardless of whether the transition we're looking for already exist or not. In addition to entirely de-optimize all newly created objects, it also made an assertion fail in `vm_setivar`: ``` vm_setivar:rb_shape_get_next_iv_shape(rb_shape_get_shape_by_id(source_shape_id), id) == dest_shape ```
2023-10-27Revert "Add debug info for flaky test_warmup_frees_pages"Peter Zhu
This reverts commit db3b814cb0ff6ffe83fe0c4f66cd6ce8951c3ca7. This debugging information is no longer needed.
2023-10-27[Feature #19244] Windows: Prefer USERPROFILE over HOMEPATH on startup as wellLars Kanis
2023-10-26[PRISM] Implement regex encoding flagseileencodes
Added the correct encoding to the allocated regex. This required making a new method to set the encoding and pass that to `rb_enc_reg_new` instead of `rb_reg_new`. The former `rb_reg_new` would set the encoding to ASCII8BIT regardless of encoding flag.
2023-10-26add more shapes testslukeg
2023-10-26teach prism define to compile basic typesHParker
2023-10-26[PRISM] Implement compilation for ConstantPathAndWriteNodeJemma Issroff
2023-10-26[PRISM] Implement compilation for ConstantPathOrWriteNodeJemma Issroff
2023-10-26[PRISM] Implemented ConstantPathOperatorWriteNodeJemma Issroff
2023-10-26[PRISM] Implement compilation for CaseNodeJemma Issroff
2023-10-26[PRISM] Rename new tests to use `assert_prism_eval`Jemma Issroff
2023-10-26[PRISM] Refactor tests to deconflict with existing testsJemma Issroff
2023-10-26[PRISM] Implement CallOperatorWriteNodeJemma Issroff
2023-10-26[PRISM] Implement compilation for CallOrWriteNodeJemma Issroff
2023-10-26[PRISM] Implemented compilation for CallAndWriteNodeJemma Issroff
2023-10-26Prevent a warning: assigned but unused variable - zYusuke Endoh
2023-10-26[Feature #19362] Call `#initialize_dup` hook at `Proc#dup`Nobuyoshi Nakada
2023-10-26[Bug #19973] Warn duplicated keyword arguments after keyword splatNobuyoshi Nakada
2023-10-26Make beginless Range#size return nil if it ends with non-numericfn ⌃ ⌥
2023-10-25Fix few test_prism_eval that snuck inHParker
2023-10-25Use `assert_prism_eval` over `test_prism_eval` in helpereileencodes
When we use `test_prism_eval`, failed tests will point to the line number of the `test_prism_eval` method definition instead of the test that failed. If we use `assert_prism_eval` instead, failed tests will properly poin to the test that failed because the test framework knows to stop the backtrace earlier. Before line number in failure points to helper definition: ``` Prism::TestCompilePrism#test_RegularExpressionNode = 0.21 s 1) Failure: Prism::TestCompilePrism#test_RegularExpressionNode [test/ruby/test_compile_prism.rb:755]: </pit/> (Windows-31J) expected but was </pit/> (US-ASCII). ``` After line number in failure points to test that failed: ``` Prism::TestCompilePrism#test_RegularExpressionNode = 0.00 s 1) Failure: Prism::TestCompilePrism#test_RegularExpressionNode [test/ruby/test_compile_prism.rb:334]: </pit/> (Windows-31J) expected but was </pit/> (US-ASCII). ```
2023-10-25[PRISM] Add tests for ParametersNodeJemma Issroff
2023-10-25[PRISM] Implement NoKeywordsParameterNodeJemma Issroff
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[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-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