Commit graph

16449 commits

Author SHA1 Message Date
Jonathan
42dcac00b1 [rubygems/rubygems] Update gem request tests to pass a Gem::Uri into the Gem::Request class
e8e7c2078f
2021-09-22 10:14:33 +09:00
Ellen Marie Dash
cd2e6318f6 [rubygems/rubygems] Only check if descriptions *start with* FIXME/TODO
It doesn't make much sense to just forbid certain words in descriptions.

7890c98415
2021-09-22 10:13:49 +09:00
Nobuyoshi Nakada
4576cdca73 [ruby/irb] Fix argument order
05c65858a0
2021-09-21 23:28:02 +09:00
Samuel Williams
cb8434563d Add alternative optional hook for scheduler_close to allow public usage of close. 2021-09-20 22:07:58 +12:00
Nobuyoshi Nakada
2e3d43e577 Allow to include uninitialized modules [Bug #18177]
The module that is about to be included is considered initialized.
2021-09-20 15:23:00 +09:00
Lars Kanis
576b2e64cd MINGW-UCRT: Set CONFIG['arch'] and RUBY_PLATFORM to "x64-mingw-ucrt"
This allows easy differentiation between ABI incompatible platforms like MSWIN64 and MSVCRT-based MINGW32.
This also implicates a distinct rubygem platform which is also "x64-mingw-ucrt".

Although the term "mingw32" is the OS-part for 64 bit systems as well, the "32" is misleading and confusing for many users.
Therefore the new platform string drops the "32" from the OS part to just "mingw".
This conforms to the common practice of windows platform testing per RUBY_PLATFORM=~/mswin|mingw/ .
2021-09-20 00:15:30 +09:00
Lars Kanis
70cefcfa0f Adjust test to set+get big values on all platforms and add MINGW-UCRT
Previously the test verified on MSWIN that huge values can not be stored in environment variables but that they can on others.
IMHO the intention of the test should not change between platforms.
Therefore this adjusts the test to have the same intention - that is to store a big value.

This also fixes compatibility with MINGW-UCRT, which previously failed with:
  <Errno::EINVAL: Invalid argument - ruby_setenv(foo)>
    test/ruby/test_env.rb:512:in `[]='
    test/ruby/test_env.rb:512:in `block in test_huge_value'
2021-09-20 00:15:30 +09:00
Jeremy Evans
162ad65fdd Revert "Do not load file with same realpath twice when requiring"
This reverts commit ddb85c5d2b.

This commit causes unexpected warnings in TestTranscode#test_loading_race
occasionally in CI.
2021-09-18 17:37:35 -07:00
Jeremy Evans
ddb85c5d2b Do not load file with same realpath twice when requiring
This fixes issues with paths being loaded twice in certain cases
when symlinks are used.

It took me multiple attempts to get this working.  My original
attempt tried to convert paths to realpaths before adding them
to $LOADED_FEATURES.  Unfortunately, this doesn't work well
with the loaded feature index, which is based off load paths
and not realpaths. While I was able to get require working, I'm
fairly sure the loaded feature index was not being used as
expected, which would have significant performance implications.
Additionally, I was never able to get that approach working with
autoload when autoloading a non-realpath file. It also broke
some specs.

This takes a more conservative approach. Directly before loading the
file, if the file with the same realpath has been required, the
loading of the file is skipped. The realpaths are stored as
fstrings in a hidden hash.

When rebuilding the loaded feature index, the hash of realpaths
is also rebuilt.  I'm guessing this makes rebuilding process
slower, but I don think that is a hot path. In general, modifying
loaded features is only done when reloading, and that tends to be
in non-production environments.

Change test_require_with_loaded_features_pop test to use 30 threads
and 300 iterations, instead of 4 threads and 1000 iterations.
I saw only sporadic failures with 4/1000, but consistent failures
30/300 threads. These failures were due to the fact that the
concurrent deletions from $LOADED_FEATURES in other threads can
result in rb_ary_entry returning nil when rebuilding the loaded
features index.

To avoid concurrency issues when rebuilding the loaded features
index, the building of the index itself is left alone, and
afterwards, a separate loop is done on a copy of the loaded feature
snapshot in order to rebuild the realpaths hash.

Fixes [Bug #17885]
2021-09-18 07:05:23 -09:00
Yusuke Endoh
1b300789ff ast.c: AST.of against C method should return nil (as Ruby 2.6--3.0) 2021-09-18 21:52:18 +09:00
Yusuke Endoh
ed9d9cee76 ast.c: AST.of checks if a given method object is defined in C
[Bug #18178]
2021-09-18 21:28:35 +09:00
Nobuyoshi Nakada
fd918d1afa
Removed Module.allocate [Bug #17048] 2021-09-17 11:14:08 +09:00
Nobuyoshi Nakada
178ee1e801
Already initialized modules cannot be replaced [Bug #17048] 2021-09-17 11:14:04 +09:00
Nobuyoshi Nakada
475a4651b6
[Feature #18172] Fix duplicate test name 2021-09-17 08:38:29 +09:00
Nobuyoshi Nakada
f2cb6288bc
[Feature #18172] Add MatchData#match_length
The method to return the length of the matched substring
corresponding to the given argument.
2021-09-16 19:55:06 +09:00
Nobuyoshi Nakada
09d724e6f8
[Feature #18172] Add MatchData#match
The method to return the single matched substring corresponding to
the given argument.
2021-09-16 19:55:06 +09:00
Nobuyoshi Nakada
ddb32e6616
[Bug #18173] Update loaded_features_index
If $LOADED_FEATURES is changed in the just required file, also the
index table needs to be updated before loaded_features_snapshot is
reset.  If the snapshot is reset without updating the table, the
name of the added feature will not be found.
2021-09-16 18:48:20 +09:00
Olle Jonsson
645acf5771 [ruby/racc] Prefer __dir__ over File.dirname(__FILE__)
c49df40658
2021-09-15 16:20:18 +09:00
Shugo Maeda
fae0f2486d
Add test cases for constants and keywords 2021-09-15 16:11:40 +09:00
Hiroshi SHIBATA
f650ca7568
[ruby/racc] Rename helper to case 2021-09-15 08:52:49 +09:00
Hiroshi SHIBATA
845ab32a29
[ruby/racc] Ignored loading CoreAssertions in test case
1f8b05b298
2021-09-15 08:49:24 +09:00
Hiroshi SHIBATA
8f6b42e0cb
[ruby/logger] Ignored loading CoreAssertions in test runner
2fd5401ad6
2021-09-15 08:49:24 +09:00
Jean Boussier
89242279e6 Marshal.load: do not call the proc until strings have their encoding
Ref: https://bugs.ruby-lang.org/issues/18141
2021-09-15 08:00:18 +09:00
Jeremy Evans
57d315c937 Handle overwriting Object::ENV in spawn
Instead of looking for Object::ENV (which can be overwritten),
directly look for the envtbl variable.  As that is static in hash.c,
and the lookup code is in process.c, add a couple non-static
functions that will return envtbl (or envtbl#to_hash).

Fixes [Bug #18164]
2021-09-14 05:55:14 -09:00
aycabta
881136d2ff [ruby/reline] The behaviour of Alt+key on Windows is changed
ref. dc2cf90fa6

4d1518aafc
2021-09-14 05:39:18 +09:00
Hiroshi SHIBATA
ec6f04c092
Use capture_output instead of capture_io 2021-09-13 21:14:42 +09:00
Brandon Weaver
4676921730 Adds mixed hash value and value omission tests
Introduces specification tests for mixed values and value omissions for
Hashes and keyword arguments, such as `{ a:, b:, c: 3 }`.
2021-09-13 13:54:03 +09:00
Hiroshi SHIBATA
ec6b444fbf
Fixed leaked file descriptor
Leaked file descriptor: TestRDocGeneratorDarkfish#test_template_stylesheets: 11 : #<File:./tmp20210913-30865-7c4ey8/hoge20210913-30865-evm2uo.css>
2021-09-13 09:36:42 +09:00
Nobuyoshi Nakada
99d8c4832a Preserve the encoding of the argument in IndexError [Bug #18160] 2021-09-12 11:16:51 +09:00
Shugo Maeda
7686776c05
Hash values should be omitted in Ripper results 2021-09-11 22:03:10 +09:00
Shugo Maeda
297f9b8d4c
Add documentation and tests for keyword argument value omission
[Feature #14579]
2021-09-11 20:23:36 +09:00
Nobuyoshi Nakada
7899866849
Another test for [Feature #14579]
The value of the dynamic key cannot be omitted for now.
2021-09-11 19:09:37 +09:00
Shugo Maeda
c60dbcd1c5
Allow value omission in Hash literals
`{x:, y:}` is a syntax sugar of `{x: x, y: y}`.
2021-09-11 18:52:25 +09:00
Nobuyoshi Nakada
0fbde94b27 [ruby/rdoc] Convert upper case copyright and registered marks
3bca7dc093
2021-09-11 17:03:52 +09:00
Nobuyoshi Nakada
bc0ea95ca8 [ruby/rdoc] Convert tick double quote in character entity references
6ed889aac9
2021-09-11 17:03:38 +09:00
Nobuyoshi Nakada
6944163415 [ruby/rdoc] Convert a backtick to an open single quote
82eaefbae4
2021-09-11 17:03:33 +09:00
Nobuyoshi Nakada
c5c0f5c652 [ruby/rdoc] Convert single quotes in character entity references
As well as double quotes.

https://github.com/ruby/rdoc/pull/824#discussion_r683173389

09002bdab5
2021-09-11 17:03:26 +09:00
Hiroshi SHIBATA
2bc85766c0
[ruby/net-http] Use omit instead of skip for test-unit
5bb14fd3bc
2021-09-11 10:25:34 +09:00
Hiroshi SHIBATA
151a1cd45e Fixed inconsistent require order for assertions and core_assertions 2021-09-11 08:48:03 +09:00
Hiroshi SHIBATA
1e18f4e60f Use Test::Unit::Runner instead of MiniTest::Unit 2021-09-11 08:48:03 +09:00
Hiroshi SHIBATA
78ec066347 Use CoreAssertions instead of Assertions 2021-09-11 08:48:03 +09:00
Hiroshi SHIBATA
871e7b5f55 Use MiniTest 2021-09-11 08:48:03 +09:00
aycabta
3e038ab1c7 [ruby/irb] Ignore invalid 3 colons in completion
5e29e3e39c
2021-09-11 04:41:20 +09:00
aycabta
5dc753df47 [ruby/reline] Move #pointer from DialogRenderInfo to Dialog
92dbac0bff
2021-09-10 11:38:54 +09:00
aycabta
4c896cda37 [ruby/reline] Fix scroll range of a script for tests
6ceebe52bc
2021-09-10 10:57:16 +09:00
aycabta
e5c40c3dc9 [ruby/reline] Add tests that column of dialog with scrollbar is moved without garbase
45c70d6222
2021-09-10 09:06:48 +09:00
aycabta
199a681d71 [ruby/reline] Add a test that text under dialog appears
0b63bd56ce
2021-09-10 09:06:39 +09:00
aycabta
a22c04a1d9 [ruby/reline] Add a test that autocomplete doesn't crash after 2nd line
f682c74975
2021-09-10 09:06:29 +09:00
aycabta
d1498f93ab [ruby/reline] Add a test that dialog doesn't crash when callback returns nil
2c6f604b98
2021-09-10 09:06:19 +09:00
aycabta
b00522608f [ruby/reline] Add a test that autocompletion returns to the original text
d80880e56b
2021-09-10 09:06:08 +09:00