Commit graph

16449 commits

Author SHA1 Message Date
Sutou Kouhei
37d16bb9dc
[ruby/fiddle] test: use double quote for string literal
fab7eab95b
2021-07-13 19:37:45 +09:00
Sutou Kouhei
5516d74ad2
[ruby/fiddle] test: add a test for win32_last_socket_error
c86cec03cd
2021-07-13 19:37:45 +09:00
Sutou Kouhei
303ab5da8b
[ruby/fiddle] test: add missing receiver
1da3b4af16
2021-07-13 19:37:45 +09:00
Sutou Kouhei
d1eeb9fec9
[ruby/fiddle] windows: use GetLastError() for win32_last_error
Ruby: [Bug #11579]

Patch by cremno phobia. Thanks!!!

760a8f9b14
2021-07-13 19:37:45 +09:00
Yusuke Endoh
5fd5d71a4b [ruby/error_highlight] Support a file that has no final newline
9d671284cb
2021-07-13 16:54:17 +09:00
Yusuke Endoh
23c8bc367c [ruby/error_highlight] Support hard tabs
Now, the highlight line is created by replacing non-tab characters with
spaces, and keeping all hard tabs as-is. This means the highlight line
has the completely same indentation as the code snippet line.

Fixes #7

38f20fa542
2021-07-13 16:51:02 +09:00
Yusuke Endoh
84fea8ee39 [ruby/error_highlight] Update a test for multibyte characters
2fc70d7f8e
2021-07-12 16:48:52 +09:00
Jeremy Evans
8065670cfb [ruby/date] Fix comparison with Float::INFINITY
Fixes [Bug #17945]

953d907238
2021-07-11 20:28:21 +09:00
aycabta
947d0198e0 [ruby/irb] Show LANG and LC_ALL env by irb_info
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>

b431742430
2021-07-11 06:12:07 +09:00
Nobuyoshi Nakada
491ab2820a
Remove half-defined Reline on LoadError
When fiddle is not avaiable, reline/terminfo depending on it also
fails.
2021-07-10 21:02:50 +09:00
Nobuyoshi Nakada
d172f8ac09
Skip fiddle tests if fiddle is not avaiable 2021-07-10 19:14:40 +09:00
Nobuyoshi Nakada
524513be39
mkmf.rb: try linking at try_var
To check for variables accessible but not declared.
2021-07-08 18:18:35 +09:00
Nobuyoshi Nakada
7a2383b5c1
Split test of Hash.[] and add assertion for default value/proc
For a73f13c907.
2021-07-08 16:47:30 +09:00
Martin Dürst
3b36e34b90 Adapt test_emoji_breaks.rb to Unicode 13.0.0/Emoji 13.0
- Add UNICODE_VERSION,... to deal with new location of some
  of the emoji-related data files.
- Introduce class BreakFile to handle various file properties.
- Adapt main code to use BreakFile.
2021-07-08 14:45:03 +09:00
Hiroshi SHIBATA
c082c6eb7c Sync RubyGems and Bundler with upstream 2021-07-07 15:31:52 +09:00
David Rodríguez
6e2240a2f9 Sync latest bundler & rubygems development version 2021-07-07 13:30:20 +09:00
Nobuyoshi Nakada
3dacc14fd3 [ruby/rdoc] Fix links without paths
424bd5db4d
2021-07-05 11:34:37 +09:00
Nobuyoshi Nakada
f88a9097a4 [ruby/rdoc] Fix for explicit http link
caf234665c
2021-07-05 11:34:35 +09:00
Nobuyoshi Nakada
7c8aa0a5d2 [ruby/rdoc] Allow a label in a link to another document text
85bb2d33bb
2021-07-05 11:34:33 +09:00
Nobuyoshi Nakada
46ab28d6c9 [ruby/rdoc] Fix assertions which look very likely unintended
dc7c890a3d
2021-07-05 11:34:31 +09:00
aycabta
caa123b50e [ruby/rdoc] Support ActiveSupport::Concern.included
ref. 168ddaa08a/activerecord/lib/active_record/core.rb (L9-L20)

a2d651dade

Co-authored-by: Fumiaki MATSUSHIMA <mtsmfm@gmail.com>
2021-07-05 11:34:29 +09:00
Nobuyoshi Nakada
2f3edf28f3 [ruby/rdoc] Prefer omit to pend
These conditions are not temporary, rather platform dependent.

https://github.com/ruby/rdoc/pull/815#discussion_r654660411

92545fa250
2021-07-05 11:34:27 +09:00
Ulysse Buonomo
ec9a9af375 [ruby/rdoc] Fix chained inclusion ancestors_of
Fixes #814

Signed-off-by: Ulysse Buonomo <buonomo.ulysse@gmail.com>

b45f747216
2021-07-05 11:34:25 +09:00
Nobuyoshi Nakada
0a32cefabd
Add domain check macros 2021-07-04 22:15:59 +09:00
Nobuyoshi Nakada
2488589b2f
Removed extra double quotes from domain error messages 2021-07-04 15:28:25 +09:00
Nobuyoshi Nakada
2d3572a154
Separate toolchain dependent test 2021-07-03 22:11:24 +09:00
Nobuyoshi Nakada
8ebb5e23eb Keep GC disabled until VM bootstrap has done [Bug #17583] 2021-07-01 18:49:17 -07:00
Martin Dürst
f6539202c5 - add regression tests for U+6E7F (湿) in ISO-2022-JP
In ISO-2022-JP, the bytes use to code are the same as those for "<>".
  This adds regression tests to make sure that these bytes, when representing
  湿, are NOT escaped with encode("ISO-2022-JP, xml: :text) or similar.
  These are additional regression tests for #12052.
2021-07-01 17:33:43 +09:00
Samuel Williams
42130a64f0
Replace copy coroutine with pthread implementation. 2021-07-01 11:23:03 +12:00
Masataka Pocke Kuwabara
e8c2b03ee1 [ruby/irb] Fix error on ls object_cant_define_singleton
such as `ls 42`, `ls :sym` and so on

b1d436a853
2021-06-30 20:55:18 +09:00
Yusuke Endoh
b270b5df2c Prevent "warning: ambiguity between regexp and two divisions" 2021-06-30 13:41:18 +09:00
Yusuke Endoh
f428ced69c [ruby/error_highlight] Experimentally support a custom formatter
f40a1de20e
2021-06-30 12:49:18 +09:00
Alan Wu
3dd3ea092a Use Module#ancestors order in recursive constant lookup
Before this commit, const_get with inherit=true and constant lookup
expressions searched the ancestors of the starting point in an order
different from `starting_point.ancestors`.

Items in the ancestry list introduced through prepend were searched
after searching the module they were prepended into. This oddity allowed
for situations where constant lookups gave different results even though
`starting_point.ancestors` is the same.

Do the lookup in the same order as `starting_point.ancestors` by
skipping classes and modules that have an origin iclass. The origin
iclass is in the super chain after the prepended modules.

Note that just like before this commit, the starting point of the
constant lookup is always the first item that we search, regardless of
the presence of any prepended modules.

[Bug #17887]
2021-06-30 10:49:27 +09:00
Yusuke Endoh
9438c99590 Rename error_squiggle to error_highlight 2021-06-29 23:45:49 +09:00
Yusuke Endoh
e946049665 [WIP] add error_squiggle gem
```
$ ./local/bin/ruby -e '1.time {}'
-e:1:in `<main>': undefined method `time' for 1:Integer (NoMethodError)

1.time {}
 ^^^^^
Did you mean?  times
```

https://bugs.ruby-lang.org/issues/17930
2021-06-29 23:45:49 +09:00
Samuel Williams
5e75280c8e Add basic test for updated IO wait functions. 2021-06-29 23:54:41 +12:00
Yusuke Endoh
39f99b8176 Use assert_not_match "Did you mean?" for UncorrectableNameCheckTest
... instead of exact matching. I'm now creating a built-in gem that
modifies Exception's error message, so the expectation value is changed.

IMO, it is good to check that did_you_mean suggestion is NOT added in
the uncorrectable case.

ebe88ec4d2
2021-06-29 15:49:51 +09:00
Nobuyoshi Nakada
9eae8cdefb
Prefer qualified names under Thread 2021-06-29 11:41:10 +09:00
Nobuyoshi Nakada
13939d61b4
Check if closed after each yield [Bug #17661] 2021-06-27 11:18:41 +09:00
Jeremy Evans
e86c1f6fc5
Work around issue transcoding issue with non-ASCII compatible encodings and xml escaping
When using a non-ASCII compatible source and destination encoding
and xml escaping (the :xml option to String#encode), the resulting
string was broken, as it used the correct non-ASCII compatible
encoding, but contained data that was ASCII-compatible instead of
compatible with the string's encoding.

Work around this issue by detecting the case where both the
source and destination encoding are non-ASCII compatible, and
transcoding the source string from the non-ASCII compatible
encoding to UTF-8. The xml escaping code will correctly handle
the UTF-8 source string and the return the correctly encoded
and escaped value.

Fixes [Bug #12052]

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2021-06-26 12:32:39 -07:00
Nobuyoshi Nakada
391abc543c
Scan the coderange in the given encoding 2021-06-26 16:05:15 +09:00
aycabta
5ffb313ccc Revert "Revert "[ruby/reline] Fix failed test""
I'm so sorry, the previous revert was just a mistake.

This reverts commit 9103c3ba8b.
2021-06-25 18:56:46 +09:00
aycabta
9103c3ba8b Revert "[ruby/reline] Fix failed test"
This reverts commit 491591c7cee842601118efc2698e0e41283827b3.
2021-06-25 17:42:45 +09:00
ima1zumi
d340b091a8 [ruby/reline] Fix failed test
For ruby/ruby repository's AppVeyor CI (Windows environment), `Reline::IOGate.encoding` will be changed from `UTF-8` to `Windows-31J` after the test is run.
So, when `test/reline/test_key_actor_emacs.rb` is loaded, `Reline::IOGate.encoding == Encoding::UTF_8` will be `true`,
but at the time of test execution, `Reline::IOGate.encoding` is `Windows-31J`.
For this reason, I changed the test method to check `Reline::IOGate.encoding` in the test method.

10e1ce3320
2021-06-25 17:42:45 +09:00
Jean Boussier
71344a1d63 [ruby/racc] Stop compressing integer lists
It is unclear why this was implemented, I assume
it was for performance back in 2006.

However today, this compression defeats bytecode caching
entirely and end up being counter productive.

ae3703c1d0
2021-06-25 17:23:06 +09:00
Jeremy Evans
be230615d0 Remove shift of ep when computing Proc#hash
The shift was causing far fewer unique values of hash than expected.

Fix pointed out by xtkoba (Tee KOBAYASHI)

Fixes [Bug #17951]
2021-06-24 12:25:33 -07:00
Jeremy Evans
a2592702ae Actually ignore FNM_CASEFOLD flag in Dir.glob
This was already documented as being ignored, but it wasn't being
ignored, causing an issue in a particular case where a UTF-8
pattern was provided and a filename was tested that wasn't valid
UTF-8.

Fixes [Bug #14456]
2021-06-24 12:22:09 -07:00
eileencodes
31f4d26273 Check type of instruction - can be INSN or ADJUST
If the type is ADJUST we don't want to treat it like an INSN so we have
to check the type before reading from `insn_info.events`.

[Bug #18001] [ruby-core:104371]

Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2021-06-23 11:34:37 -07:00
aycabta
557b4eb4aa Add detailed message to assert_external_string_equal 2021-06-23 21:00:48 +09:00
Nobuyoshi Nakada
298d65b1e4
Discard RDOCOPT environment variable to make tests stable 2021-06-23 18:57:39 +09:00