summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2024-05-28[PRISM] Enable TestAssignmentGen#test_assignmentKevin Newton
2024-05-28[PRISM] Enable TestISeq#test_trace_pointsKevin Newton
2024-05-28[PRISM] Enable TestISeq#test_each_childKevin Newton
2024-05-28Make ensure first lineno the first line of the ensureKevin Newton
Previously, ensure ISEQs took their first line number from the line number coming from the AST. However, if this is coming from an empty `begin`..`end` inside of a method, this can be all of the way back to the method declaration. Instead, this commit changes it to be the first line number of the ensure block itself. The first_lineno field is only accessible through manual ISEQ compilation or through tracepoint. Either way, this will be more accurate for targeting going forward.
2024-05-28[PRISM] Enable TestSyntax#test_dedented_heredoc_continued_lineKevin Newton
2024-05-29[Bug #20438] Disallow "%\n" and "%\0"Nobuyoshi Nakada
2024-05-28Stop marking chilled strings as frozenÉtienne Barrié
They were initially made frozen to avoid false positives for cases such as: str = str.dup if str.frozen? But this may cause bugs and is generally confusing for users. [Feature #20205] Co-authored-by: Jean Boussier <byroot@ruby-lang.org>
2024-05-28Make test_nested_timeouts less flakyYusuke Endoh
This test randomly fails due to the bug reported in [Bug #20314], where the two timeouts are too close so that they can expire at the same time. As a workaround, this change increases the time difference between timeouts. This will reduce the probability of simultaneous expirations and lower flakiness.
2024-05-27[ruby/reline] Implement the redo commandverdy89
(https://github.com/ruby/reline/pull/707) * Implement the redo command * Commented out a test that does not pass * Changed key assignment for redo from "\C-[" to "\C-g" * Changed redo key assignment from `\C-g` to `\M-\C-_` * Revert the first implemantation * Implemented redo by sharing `@past_lines` between undo and redo * Fixed the index of past_lines that is updated when the cursor is moved * Fixed deletion of the redo history in regular input * Renamed variables: past_lines -> input_lines * Rename @position to @input_lines_position * Deleted unused variables: `@old_byte_pointer` and `@old_line_index` https://github.com/ruby/reline/commit/0b2d9fab5f
2024-05-27Add a debug print for a random failureYusuke Endoh
``` 1) Error: TestRubyLiteral#test_float: ArgumentError: SyntaxError#path changed: "(eval at /home/chkbuild/chkbuild/tmp/build/20240527T050036Z/ruby/test/ruby/test_literal.rb:642)"->"(eval at /home/chkbuild/chkbuild/tmp/build/20240527T050036Z/ruby/test/ruby/test_literal.rb:642)" ``` https://rubyci.s3.amazonaws.com/s390x/ruby-master/log/20240527T050036Z.fail.html.gz
2024-05-26Debug unexpectedly changed pathNobuyoshi Nakada
2024-05-26[ruby/reline] allow space in config valueGo
(https://github.com/ruby/reline/pull/705) * allow space in config value fix https://github.com/ruby/reline/pull/657 * remove inline comments * Revert "remove inline comments" This reverts commit https://github.com/ruby/reline/commit/2438347c1a10. * refactoring * remove unnecessary comment handling https://github.com/ruby/reline/commit/d60f1e1e39
2024-05-25[Bug #20510] Do not count optional hash argument for `IO.new`Nobuyoshi Nakada
Since `IO.new` accepts one or two positional arguments except for the optional hash argument, exclude the optional hash argument from the check for delegation to `IO.new`.
2024-05-24[ruby/prism] Fix up ruby_parser string concatKevin Newton
https://github.com/ruby/prism/commit/4b06eae0df
2024-05-24[ruby/prism] Remove Debug moduleKevin Newton
https://github.com/ruby/prism/commit/4d8929ff6a
2024-05-24[ruby/prism] Remove error formatting, put directly in CRubyKevin Newton
https://github.com/ruby/prism/commit/53b2866487
2024-05-24[ruby/prism] Remove Debug#named_capturesKevin Newton
https://github.com/ruby/prism/commit/5050dfbe70
2024-05-24[ruby/prism] Remove various unused memsize infraKevin Newton
https://github.com/ruby/prism/commit/283938ed1f
2024-05-24[ruby/prism] Remove Debug::integer_parseKevin Newton
https://github.com/ruby/prism/commit/14e397598b
2024-05-24[ruby/prism] Remove Debug::static_inspectKevin Newton
https://github.com/ruby/prism/commit/486c71c426
2024-05-24Update duplicated when clause warning messageKevin Newton
2024-05-24[ruby/prism] Update duplicated when error messageKevin Newton
https://github.com/ruby/prism/commit/54316fd8a0
2024-05-23[PRISM] Update remaining test excludesKevin Newton
2024-05-23[ruby/prism] Raise `void value expression` in begin clauseseileencodes
In some cases Prism was either not raising an appropriate `void value expression` error, or raising that error when the syntax is considered valid. To fix this Prism needs to check whether we have other clauses on the `begin` rather than just returning `cast->statements`. * If the `cast->statements` are null and the `cast->ensure_clause` is not null, set the code to `cast->ensure_clause` * else * If there is a `cast->rescue_clause` * Check if `cast->statements` are null and `cast->rescue_clause->statements` are null, and return `NULL` * Check if there is an `else_clause`, and set the node to `cast->else_clause`. * Otherwise return `cast->statements` as the node * return `cast->statements` as the node See tests for test cases. Note I took these directly from CRuby so if desired I can delete them since the test will now pass. This only fixes one test in the `test_parse` file, taking failures from 14 to 13. This fixes `TestParse#test_void_value_in_rhs` and is related to issue #2791. https://github.com/ruby/prism/commit/398152b412
2024-05-23Introduce a specialize instruction for Array#packNobuyoshi Nakada
Instructions for this code: ```ruby # frozen_string_literal: true [a].pack("C") ``` Before this commit: ``` == disasm: #<ISeq:<main>@test.rb:1 (1,0)-(3,13)> 0000 putself ( 3)[Li] 0001 opt_send_without_block <calldata!mid:a, argc:0, FCALL|VCALL|ARGS_SIMPLE> 0003 newarray 1 0005 putobject "C" 0007 opt_send_without_block <calldata!mid:pack, argc:1, ARGS_SIMPLE> 0009 leave ``` After this commit: ``` == disasm: #<ISeq:<main>@test.rb:1 (1,0)-(3,13)> 0000 putself ( 3)[Li] 0001 opt_send_without_block <calldata!mid:a, argc:0, FCALL|VCALL|ARGS_SIMPLE> 0003 putobject "C" 0005 opt_newarray_send 2, :pack 0008 leave ``` Co-authored-by: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com> Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2024-05-23[PRISM] Fix up some masgn topn calculationsKevin Newton
2024-05-23[PRISM] Enable TestSyntax#test_unterminated_heredoc_crKevin Newton
2024-05-22[PRISM] Properly support 'it'Kevin Newton
2024-05-22[ruby/prism] Fix support for 'it' implicit local variableKevin Newton
https://github.com/ruby/prism/commit/53bbcfe513
2024-05-21[ruby/prism] Fix up ruby_parser interpolation concatenationKevin Newton
https://github.com/ruby/prism/commit/79cec4be22
2024-05-21[ruby/prism] Reconfigure rationalsKevin Newton
This eliminates the subnode on RationalNode and replaces it with two integer fields, which represent the ratio for the rational. It also reduces those two integers if they both fit into 32 bits. Importantly, this PR does not implement bignum reduction. That's something I'd like to consider for the future, but it's simple enough for now to leave them unreduced, which makes it more useful than it used to be. https://github.com/ruby/prism/commit/86e06c7068
2024-05-21[PRISM] Enable TestSyntax#test_warn_balancedKevin Newton
2024-05-21[PRISM] Enable TestSyntax#test_numbered_parameterKevin Newton
2024-05-21[ruby/prism] Add error for numbered parameter used in inner blockKevin Newton
https://github.com/ruby/prism/commit/c386ba6d48
2024-05-20[PRISM] Enable TestRegexp#test_unescapeKevin Newton
2024-05-20[PRISM] Enable TestRegexp#test_match_control_meta_escapeKevin Newton
2024-05-21Avoid array allocation for empty ruby2_keywords flagged keyword hashJeremy Evans
If the method being called does not have a positional splat parameter, there is no point in allocating the array, as decrementing given_argc is sufficient to ensure the empty keyword hash is not considered an argument, assuming that we are calling a method/lambda and not a regular proc.
2024-05-21Avoid hash allocation for empty ruby2_keywords flagged keyword hashJeremy Evans
If the method being called does not have a keyword splat parameter, there is no point in allocating the hash, because the hash will be unused (as empty keyword hashes are ignored).
2024-05-21Add allocation tests for ruby2_keywordsJeremy Evans
This tests ruby2_keywords flagged methods, as well as passing ruby2_keywords flagged hashes to other methods. Some of the behavior here is questionable, such as allocating different numbers of objects depending on whether a block is passed or whether YJIT is enabled. I think there are likely ways to eliminate allocations in certain cases. However, this gives us a baseline and shows us where it is possible to make improvements.
2024-05-20[PRISM] Enable TestPrism#test_truncated_source_lineKevin Newton
2024-05-20[PRISM] Match CRuby line semantics for evstrKevin Newton
2024-05-20[PRISM] Enable TestSyntax#test_warn_balancedKevin Newton
2024-05-20[ruby/prism] Implement ambiguous binary operator warningKevin Newton
https://github.com/ruby/prism/commit/6258c3695f
2024-05-20Fix incorrect assertion in TestThreadInstrumentationJean Boussier
The test meant to assert the thread is suspended at least once, but was actually asserting to it to be suspected at least twice.
2024-05-20[ruby/error_highlight] Load "did_you_mean" explicitly in testYusuke Endoh
I'm not sure how it works, but I seem to get an error `undefined method 'formatter' for module DidYouMean` in parallel mode of `make test-all`. https://app.launchableinc.com/organizations/ruby/workspaces/ruby/data/test-paths/file%3Dtest%2Ferror_highlight%2Ftest_error_highlight.rb%23class%3DErrorHighlightTest%23testcase%3Dtest_explicit_raise_name_error?organizationId=ruby&workspaceId=ruby&testPathId=file%3Dtest%2Ferror_highlight%2Ftest_error_highlight.rb%23class%3DErrorHighlightTest%23testcase%3Dtest_explicit_raise_name_error&testSessionStatus=flake https://github.com/ruby/error_highlight/commit/f931b42430
2024-05-20[rubygems/rubygems] Should rescue vendored net-http exceptionNobuyoshi Nakada
https://github.com/rubygems/rubygems/commit/7d2c4cf364
2024-05-17[PRISM] Enable TestRequireKevin Newton
2024-05-17[PRISM] Enable passing IRB testKevin Newton
2024-05-17[PRISM] Enable TestSyntax#test_error_message_encodingKevin Newton
2024-05-16[PRISM] Enable TestParse#test_truncated_source_lineKevin Newton