Kevin Newton
0ebd37234e
[PRISM] Enable TestSyntax#test_unterminated_heredoc_cr
2024-05-23 12:41:22 -04:00
Kevin Newton
6d81ae3f01
[PRISM] Properly support 'it'
2024-05-22 16:34:04 -04:00
Kevin Newton
e575954887
[ruby/prism] Fix support for 'it' implicit local variable
...
https://github.com/ruby/prism/commit/53bbcfe513
2024-05-22 16:34:04 -04:00
Kevin Newton
b20adf90e3
[ruby/prism] Fix up ruby_parser interpolation concatenation
...
https://github.com/ruby/prism/commit/79cec4be22
2024-05-21 18:45:16 +00:00
Kevin Newton
89efb94fec
[ruby/prism] Reconfigure rationals
...
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 14:27:46 -04:00
Kevin Newton
16b0bb3d53
[PRISM] Enable TestSyntax#test_warn_balanced
2024-05-21 14:27:28 -04:00
Kevin Newton
bcbfc675a4
[PRISM] Enable TestSyntax#test_numbered_parameter
2024-05-21 12:56:20 -04:00
Kevin Newton
ff43b4a28b
[ruby/prism] Add error for numbered parameter used in inner block
...
https://github.com/ruby/prism/commit/c386ba6d48
2024-05-21 15:46:45 +00:00
Kevin Newton
6ddc0a8044
[PRISM] Enable TestRegexp#test_unescape
2024-05-20 21:25:51 -04:00
Kevin Newton
e82c7a0577
[PRISM] Enable TestRegexp#test_match_control_meta_escape
2024-05-20 21:25:51 -04:00
Jeremy Evans
86cf074fa1
Avoid array allocation for empty ruby2_keywords flagged keyword hash
...
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-21 05:33:57 +09:00
Jeremy Evans
2433b57b6a
Avoid hash allocation for empty ruby2_keywords flagged keyword hash
...
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-21 05:33:57 +09:00
Jeremy Evans
f021bcdbbe
Add allocation tests for ruby2_keywords
...
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-21 05:33:57 +09:00
Kevin Newton
78e504f21d
[PRISM] Enable TestPrism#test_truncated_source_line
2024-05-20 12:28:37 -04:00
Kevin Newton
ca5b458044
[PRISM] Match CRuby line semantics for evstr
2024-05-20 11:28:53 -04:00
Kevin Newton
785fba3b16
[PRISM] Enable TestSyntax#test_warn_balanced
2024-05-20 10:49:41 -04:00
Kevin Newton
e90e8f8bd3
[ruby/prism] Implement ambiguous binary operator warning
...
https://github.com/ruby/prism/commit/6258c3695f
2024-05-20 14:01:05 +00:00
Jean Boussier
0b38403328
Fix incorrect assertion in TestThreadInstrumentation
...
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 14:59:59 +09:00
Yusuke Endoh
eb410c9fde
[ruby/error_highlight] Load "did_you_mean" explicitly in test
...
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 03:47:22 +00:00
Nobuyoshi Nakada
a10a483af9
[rubygems/rubygems] Should rescue vendored net-http exception
...
https://github.com/rubygems/rubygems/commit/7d2c4cf364
2024-05-20 01:35:58 +00:00
Kevin Newton
cce7c25a42
[PRISM] Enable TestRequire
2024-05-17 16:42:14 -04:00
Kevin Newton
e61d24d77e
[PRISM] Enable passing IRB test
2024-05-17 11:29:00 -04:00
Kevin Newton
4ba0579da6
[PRISM] Enable TestSyntax#test_error_message_encoding
2024-05-17 10:33:42 -04:00
Kevin Newton
761b907024
[PRISM] Enable TestParse#test_truncated_source_line
2024-05-16 22:13:10 -04:00
Kevin Newton
854cbbd5a9
[PRISM] Enable TestParse#test_string
2024-05-16 15:35:22 -04:00
Kevin Newton
92af705498
[ruby/prism] Truncate source lines in errors messages when too long
...
https://github.com/ruby/prism/commit/72518f5716
2024-05-16 19:35:10 +00:00
Kevin Newton
98e1e610f6
[ruby/prism] Update more escape error messages to match CRuby
...
https://github.com/ruby/prism/commit/ab43b3ab66
2024-05-16 18:40:20 +00:00
Kevin Newton
012a80d768
[PRISM] Enable TestISeq#test_syntax_error_message
2024-05-16 14:21:47 -04:00
Kevin Newton
0b4cf461e0
[PRISM] Enable TestM17N#test_string_mixed_unicode
2024-05-16 14:12:09 -04:00
Kevin Newton
07241dfac8
[PRISM] Enable TestParse#test_question
2024-05-16 12:28:51 -04:00
Kevin Newton
7eb45a40fd
[PRISM] Enable TestParse#test_invalid_char
2024-05-16 12:28:51 -04:00
Kevin Newton
58f993c500
[PRISM] Enable TestParse#test_percent
2024-05-16 12:28:51 -04:00
Kevin Newton
52401a32e5
[PRISM] Enable TestSyntax#test_syntax_error_at_newline
2024-05-16 12:28:51 -04:00
Kevin Newton
14debd1321
[PRISM] Enable TestSyntax#test__END___cr
2024-05-16 12:28:51 -04:00
Kevin Newton
910bb49230
[ruby/prism] Update error message for invalid % at EOF
...
https://github.com/ruby/prism/commit/178d4f66fd
2024-05-16 14:52:34 +00:00
Kevin Newton
7a4b9d1614
[ruby/prism] Match CRuby error message for unknown % string
...
https://github.com/ruby/prism/commit/863197629c
2024-05-16 14:23:36 +00:00
Kevin Newton
011668883c
[ruby/prism] Always go to string lex mode even if EOF
...
https://github.com/ruby/prism/commit/57d5c9be2c
2024-05-16 14:16:32 +00:00
David Rodriguez
c55c11d7d5
[rubygems/rubygems] Fix binstubs sometimes not getting regenerated when `--destdir` is given
...
This was only working for gems also installed in the default gem home.
https://github.com/rubygems/rubygems/commit/47df02dbd9
2024-05-16 13:34:33 +00:00
David Rodriguez
5111b3d479
[rubygems/rubygems] Fix `gem uninstall --user-install` for symlinked HOME's
...
https://github.com/rubygems/rubygems/commit/7f0706a897
2024-05-16 11:55:53 +00:00
David Rodriguez
b19693f0ae
[rubygems/rubygems] Improve uninstaller tests
...
Tests have two copies of b-2 installed, one in default home and another
in user home. But only the one in default home was visible because of
not reloading paths. The user install test was working by chance.
https://github.com/rubygems/rubygems/commit/667537a08f
2024-05-16 11:55:53 +00:00
Nobuyoshi Nakada
2dd46bb82f
[Bug #20468 ] Fix safe navigation in `for` variable
2024-05-16 16:22:17 +09:00
Nobuyoshi Nakada
9d69619623
[rubygems/rubygems] Clean up generated and copied files
...
> leaving the files after gem rebuild was intentional, for local
> inspection, but the test suite should be made to clean up after
> itself independently of that.
https://github.com/rubygems/rubygems/pull/4913#issuecomment-2081710691
https://github.com/rubygems/rubygems/commit/185a2091fb
2024-05-16 04:54:44 +00:00
Kevin Newton
2aed14d65b
[PRISM] Enable TestParse#test_global_variable
2024-05-15 12:49:45 -04:00
Kevin Newton
cd8b28f0e7
[PRISM] Enable test_location_of_invalid_token
2024-05-15 12:49:45 -04:00
Kevin Newton
be239cc7bc
[PRISM] Enable TestParse#test_unexpected_eof
2024-05-15 12:49:45 -04:00
Kevin Newton
cabc0e093c
[PRISM] Enable TestParse#test_unexpected_token_after_numeric
2024-05-15 12:49:45 -04:00
Kevin Newton
901f4c3fb7
[PRISM] Temporarily exclude IRB test
2024-05-15 12:49:03 -04:00
Kevin Newton
c4a5866798
[ruby/prism] Replace end of file with end-of-input
...
https://github.com/ruby/prism/commit/dd532ded95
2024-05-15 15:44:16 +00:00
Nobuyoshi Nakada
e73f6618d5
[rubygems/rubygems] Do not override `@orig_env`
...
It is saved in `setup` and restored in `teardown`.
https://github.com/rubygems/rubygems/commit/880c5de667
2024-05-15 09:11:55 +00:00
Samuel Giddins
e33336cb37
[ruby/zlib] Avoid allocating intermediary strings when read/readpartial are passed an outbuf
...
This accounts for a significant number of string allocations when reading rubygems, but we can avoid that in many places by only copying into the outbuf when present
https://github.com/ruby/zlib/commit/d25ef406c1
2024-05-14 21:44:34 +00:00
David Rodriguez
965cb3ab4c
[rubygems/rubygems] Fix issue when cleaning up plugin stubs
...
When `gem uninstall <gem> --install-dir <dir>` is run, if the version
removed had a plugin, and that same version happened to also be
installed globally, then the plugin stub would fail to be removed.
https://github.com/rubygems/rubygems/commit/4e2fa0be77
2024-05-14 16:08:03 +00:00
David Rodriguez
bd84236169
[rubygems/rubygems] Extract a `Gem::SpecificationRecord` class
...
This class handles all logic to handle the list of specifications, given
a set of GEM_PATH directories. Makes `Gem::Specification` has less
responsibilities and will help with fixing some bugs next.
https://github.com/rubygems/rubygems/commit/df280dbbed
2024-05-14 16:08:03 +00:00
David Rodriguez
6454238072
[rubygems/rubygems] Make `Gem.clear_paths` test less implementation dependent
...
https://github.com/rubygems/rubygems/commit/b545daa95d
2024-05-14 16:08:01 +00:00
David Rodriguez
8d28e63566
[rubygems/rubygems] Simplify test teardown
...
If we move test directory removal to the very end, I think we should not
leak anything.
https://github.com/rubygems/rubygems/commit/fb3d8944b5
2024-05-14 16:08:00 +00:00
Andrew Konchin
b60f09442a
Fix TestPatternMatching#test_deconstruct_keys test
...
Before the change `C.keys` returned keys captured in some previous test case that by chance captured `nil` value what made this test passed successfully. Now it returns keys captured in this test case.
2024-05-14 15:43:28 +09:00
Mari Imaizumi
9d01f657b3
[ruby/reline] Implement the undo command
...
(https://github.com/ruby/reline/pull/701 )
* Refactor send
* Implement the undo command
* Fix @past_lines initialization
* Improve assertion
* Hide to save buffer in insert_pasted_text
* Replace @using_delete_command with @undoing
* Refactor `@past_lines`
https://github.com/ruby/reline/commit/4ab72f9cbd
2024-05-14 01:58:31 +00:00
Samuel Giddins
02c8e6583b
[rubygems/rubygems] Use a constant empty tar header to avoid extra allocations
...
https://github.com/rubygems/rubygems/commit/716666f65f
2024-05-13 13:01:44 +00:00
Vít Ondruch
5880103450
[rubygems/rubygems] Use spec.base_dir to remove plugins
...
The plugin loader from `@gem_home` was removed during uninstallation.
However, this could leave behind the plugins for `--user-install`
installed gems.
Use `Gem::Specifictaions#base_dir` instead. This ensures that the plugin
loader for associated .gemspec is uninstalled.
https://github.com/rubygems/rubygems/commit/6047f78210
2024-05-13 10:35:57 +00:00
David Rodriguez
a86ad47c94
[rubygems/rubygems] Improve plugin removal test
...
Instead of unit testing the `remove_plugins` method, test the whole
removal process.
https://github.com/rubygems/rubygems/commit/bfdc60af98
2024-05-13 10:35:57 +00:00
Nobuyoshi Nakada
5695c5df95
ripper: Fix opassign when assignment to backref variables
2024-05-12 15:38:22 +09:00
Nobuyoshi Nakada
a1fb6cc978
ripper: Use `$&` instead of quoting charaters in tests
2024-05-12 15:36:42 +09:00
Nobuyoshi Nakada
8b9b150512
[Bug #20481 ] Check for unmarshaling ivar
...
Prohibit setting instance variables of existing classes and modules
via link.
2024-05-12 13:57:15 +09:00
Nobuyoshi Nakada
d9e6e6fb60
[Bug #7759 ] Fix instance variable names to be checked
2024-05-12 13:55:56 +09:00
Nobuyoshi Nakada
4edd9b072c
[ruby/irb] Clean up tmpdir
...
https://github.com/ruby/irb/commit/7d60349499
2024-05-12 04:53:51 +00:00
yui-knk
7e604a0263
Fix SEGV when ripper hits `backref_error` on `command_asgn` or `arg`
2024-05-11 20:47:15 +09:00
tomoya ishida
68b6fe7048
[ruby/reline] Avoid STDIN.winsize called in `require "reline"`
...
(https://github.com/ruby/reline/pull/703 )
https://github.com/ruby/reline/commit/21891c47c4
2024-05-10 17:19:42 +00:00
Kevin Newton
2e4f3739fb
[PRISM] Enable passing argument forwarding tests
2024-05-10 13:09:16 -04:00
Kevin Newton
83f481ebf0
[ruby/prism] Enhance parameter forwarding error messages
...
https://github.com/ruby/prism/commit/826657232e
2024-05-10 15:54:15 +00:00
Kevin Newton
955f13238d
[PRISM] Enable passing IRB tests
2024-05-10 11:48:11 -04:00
Kevin Newton
2e44664547
[ruby/prism] operator rename
...
https://github.com/ruby/prism/commit/b5e47f5c42
2024-05-10 11:47:48 -04:00
Stan Lo
c68bb24088
[ruby/irb] Add a new initialization step to validate IRB.conf's
...
values
(https://github.com/ruby/irb/pull/953 )
Currently, users can only find out that they have set a wrong value
for IRB configs when the value is used, with opaque error messages like
"comparison of Integer with true failed (TypeError)".
This commit adds a new initialization step to validate the values of
some IRB configs, so that users can find out about the wrong values
during the initialization of IRB.
https://github.com/ruby/irb/commit/af8ef2948b
2024-05-10 11:40:58 +00:00
Kevin Newton
2f915e729a
[PRISM] Enable passing test_string
2024-05-10 00:54:31 -04:00
Kevin Newton
444030fc61
[PRISM] Enable passing tests
2024-05-09 09:38:43 -04:00
Jean Boussier
e82138e48a
Stabilize TestObjSpace#test_dump_special_consts
...
The test assumes `:foo` is a static symbol, but that is only true
if a literal `:foo` was parsed before `"foo".to_sym` was evaled:
```ruby
require 'objspace'
foo_sym = "foo".to_sym
puts ObjectSpace.dump(eval(":foo"))
```
```
{"address":"0x100fb46d0", "type":"SYMBOL", "shape_id":10, "slot_size":40, "class":"0x100d3e9c8", "frozen":true, "bytesize":3, "value":"foo", "memsize":40, "flags":{"wb_protected":true, "marking":true, "marked":true}}
```
2024-05-09 12:23:34 +02:00
tomoya ishida
26446cccc9
[ruby/reline] Implement bracketed paste insert
...
(https://github.com/ruby/reline/pull/655 )
https://github.com/ruby/reline/commit/e92dcbf514
2024-05-08 16:00:30 +00:00
Kevin Newton
06a1df3ef9
[PRISM] Enable more passing tests
2024-05-08 10:18:57 -04:00
Kevin Newton
ba062a6231
[PRISM] Use correct warning encoding
2024-05-08 08:12:17 -04:00
Nobuyoshi Nakada
5bb656e4f0
[Bug #20474 ] Keep spaces in leading blank line
2024-05-08 19:25:37 +09:00
Samuel Giddins
841b45a442
[ruby/openssl] Add to_text for PKCS7 and Timestamp::Response
...
https://github.com/ruby/openssl/commit/71cd1e3f5c
2024-05-08 09:39:13 +00:00
Kevin Newton
b4b39a6199
[PRISM] Enable test_methoddef_endless_command
2024-05-07 14:24:31 -04:00
Kevin Newton
2bfc48755e
[PRISM] Enable more passing tests
2024-05-07 14:24:31 -04:00
Kevin Newton
21b94ae0d1
[ruby/prism] Extend error message for unterminated HEREDOC
...
https://github.com/ruby/prism/commit/c1b07ec11b
2024-05-07 18:03:03 +00:00
Kevin Newton
eb8efa42f0
[ruby/prism] shareable_constant_value line warnings
...
https://github.com/ruby/prism/commit/8c984b6922
2024-05-07 14:56:48 +00:00
Yuta Saito
80adf6a18c
[rubygems/rubygems] Accept WASI as an OS name in Gem::Platform
...
https://github.com/rubygems/rubygems/commit/1209d3c6b0
2024-05-07 05:36:35 +00:00
Kevin Newton
481e16d58b
[PRISM] Support for compiling ractor constant path writes
2024-05-06 19:06:13 -04:00
David Rodriguez
00b1553dc6
[rubygems/rubygems] Remove more unnecessary compatibility code
...
https://github.com/rubygems/rubygems/commit/00d91f141b
2024-05-06 17:06:50 +00:00
Kevin Newton
e276929511
[PRISM] Enable test_unexpected_fraction
2024-05-06 12:09:48 -04:00
Kevin Newton
5e6bb0857a
[PRISM] Enable passing forwarding parameter tests
2024-05-06 12:09:30 -04:00
Kevin Newton
14d400829d
[PRISM] Enable passing test_brace_after_literal_argument test
2024-05-06 11:12:30 -04:00
Stan Lo
e973f9cbb3
[ruby/irb] Clarify that the context is IRB context
...
(https://github.com/ruby/irb/pull/950 )
https://github.com/ruby/irb/commit/8cde57f55a
2024-05-05 10:44:52 +00:00
Jean Boussier
7d42010fad
[ruby/openssl] read: don't clear buffer when nothing can be read
...
To be consistent with regular Ruby IOs:
```ruby
r, _ = IO.pipe
buf = "garbage".b
r.read_nonblock(10, buf, exception: false) # => :wait_readable
p buf # => "garbage"
```
Ref: 98b8944460
https://github.com/ruby/openssl/commit/08452993d6
2024-05-05 08:00:00 +00:00
tomoya ishida
d679afe9f9
[ruby/reline] Add name defined in readline to completion key
...
bindings C-i C-p C-n
(https://github.com/ruby/reline/pull/698 )
https://github.com/ruby/reline/commit/1314787bbb
2024-05-05 07:09:52 +00:00
Stan Lo
bd42f0898d
[ruby/irb] Improve help message for no meta commands
...
(https://github.com/ruby/irb/pull/948 )
* Remove unnecessary code from command tests
* Improve help message for no meta commands
1. Add placeholder values for both command category and description
2. Update help command's output to give different types of categories
more explicit ordering
https://github.com/ruby/irb/commit/b1ef58aeff
2024-05-04 03:32:34 +00:00
Stan Lo
fb2ea7084f
[ruby/irb] Use flag instead of caller for `debug`'s binding.irb
...
check
(https://github.com/ruby/irb/pull/947 )
https://github.com/ruby/irb/commit/4a4d7a4279
2024-05-04 03:22:17 +00:00
Kenichi Kamiya
a510175e8f
[ruby/irb] Avoid raising errors while running help for custom
...
commands
(https://github.com/ruby/irb/pull/944 )
* Avoid raising errors while running help for custom commands
Raising an error from the help command is not a pleasure for the
end user, even if the command does not define any attributes
* Update test/irb/command/test_custom_command.rb
---------
https://github.com/ruby/irb/commit/c8bba9f8dc
Co-authored-by: Stan Lo <stan001212@gmail.com>
2024-05-03 22:08:49 +00:00
Kenichi Kamiya
70db150fbc
[ruby/irb] Fix typos in test/irb/command/test_custom_command.rb
...
(https://github.com/ruby/irb/pull/945 )
https://github.com/ruby/irb/commit/f2b5fc192f
2024-05-03 21:34:34 +00:00
Kevin Newton
d4a6d0c177
[ruby/prism] Prism::Location#adjoin
...
https://github.com/ruby/prism/commit/a298db68e3
2024-05-03 19:14:03 +00:00
Kevin Newton
7a49edcf1f
[ruby/prism] Prism::Node#tunnel
...
https://github.com/ruby/prism/commit/0bf5d651da
2024-05-03 18:37:19 +00:00
Kevin Newton
c631679b94
[PRISM] Disallow &. in MLHS
2024-05-03 14:15:59 -04:00
Kevin Newton
31c69698a7
[PRISM] Enable passing test for **nil
2024-05-03 13:32:32 -04:00