Commit graph

15017 commits

Author SHA1 Message Date
Hiroshi SHIBATA
f6c3228794 [ruby/drb] Use omit instead of skip for test-unit
0da149e7a9
2021-09-28 17:31:08 +09:00
rm155
cefa029573 [ruby/ostruct] Allow properties to be accessed even when the object is moved to another Ractor (https://github.com/ruby/ostruct/pull/29)
d85639f2f5
2021-09-28 17:30:06 +09:00
aycabta
c4acde8959 [ruby/reline] Ignore NUL by ed_quoted_insert
43b7c01a98
2021-09-28 14:15:49 +09:00
John Bachir
1147136b8a [ruby/timeout] test that yield is given number of seconds
ec5a614334
2021-09-28 06:05:50 +09:00
Nobuyoshi Nakada
dfa67db62b
Show failed environment variables 2021-09-27 20:47:44 +09:00
John Bachir
582602d142 [ruby/timeout] test for basic functionality
1c6bb90aea
2021-09-27 13:22:46 +09:00
aycabta
40a65030e5 Pend test_complete_require_library_name_first 2021-09-24 22:56:38 +09:00
Lucas Kanashiro
61aedb28ef [rubygems/rubygems] Use pend instead of skip in the absence of git in test helper
798a93a98c
2021-09-24 10:57:27 +09:00
huangduirong
b1ab1ee046 [rubygems/rubygems] Fix error message building changing password of source
Do not change the password of the input parameter source during
anonymization, by using the proper helper instead of changing the
original uri directly.

eaa2dd8a97
2021-09-24 10:57:03 +09:00
Nobuyoshi Nakada
b929af430c Use the flag for uninitialized module [Bug #18185]
Make `Module#ancestors` not to include `BasicObject`.
2021-09-24 08:29:00 +09:00
Nobuyoshi Nakada
65285bf673 Consider modified modules initialized [Bug #18185] 2021-09-24 08:29:00 +09:00
Nobuyoshi Nakada
96c8964e0e
Revive the test using US-ASCII incompatible symbol 2021-09-23 22:04:19 +09:00
Nobuyoshi Nakada
ede95f541b [ruby/irb] Ignore any encoding errors while symbol completion
daa65cded1
2021-09-23 18:01:36 +09:00
Nobuyoshi Nakada
49af9012a2
Prohibit invalid encoding symbols [Bug #18184] 2021-09-23 16:02:44 +09:00
Nobuyoshi Nakada
552728a23a
Check the encoding of ruby2_keywords_flag [Bug #18184] 2021-09-23 00:07:17 +09:00
Kaíque Kandy Koga
782d1d876b [ruby/irb] Use typed spaces when the line is inside the here documents
Use first method instead of square brackets to support 2.5 and 2.6 versions

Use tokens

Clear check_newline_depth_difference

6fec2a5d46
2021-09-22 23:26:41 +09:00
Nobuyoshi Nakada
7c0230b05d
Check the entire name as ruby2_keywords_flag [Bug #18184] 2021-09-22 19:04:55 +09:00
Jonathan
13bb16f41e [rubygems/rubygems] Fix bug where redacted credentials are sent to server
Implement deep cloning for `Gem::Uri` class to fix a bug where redacting
credentials modifies the URI string in place instead of returning a
modified copy.

eafb5a279b
2021-09-22 10:14:48 +09:00
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