Commit graph

16449 commits

Author SHA1 Message Date
Nobuyoshi Nakada
bf97415c02 Removed deprecated Dir.exists? and File.exists? 2021-12-28 18:36:30 +09:00
Takashi Kokubun
eb49aa3119
Fix test_rubyoptions for MinGW (#5363)
* Fix test_rubyoptions for MinGW

follows up a74a2f456a

* Require jit_support

* Fix MinGW platform

* Handle MinGW UCRT

and fix the prefix

* Make it more robust
2021-12-27 22:22:09 -08:00
David Rodríguez
be476f38f9 [rubygems/rubygems] Don't crash when updating to an unsupported rubygems-update version
b0badcd00a
2021-12-27 22:57:46 +09:00
U.Nakamura
a74a2f456a Now YJIT can be enabled on mswin64 2021-12-27 17:29:16 +09:00
Nobuyoshi Nakada
c956f979e5
Initialize Struct by calling with keyword arguments 2021-12-26 23:28:54 +09:00
Nobuyoshi Nakada
69f03c864e
Remove Refinement#include and Refinement#prepend 2021-12-26 23:28:54 +09:00
Nobuyoshi Nakada
39bc5de833
Remove tainted and trusted features
Already these had been announced to be removed in 3.2.
2021-12-26 23:28:54 +09:00
Yusuke Endoh
0dc7816c43 Make RubyVM::AST.of work with code written in -e command-line option
[Bug #18434]
2021-12-26 20:57:34 +09:00
Nobuyoshi Nakada
0867b638af Raise proper exception when month argument is not a name
https://bugs.ruby-lang.org/issues/17485#change-89871
2021-12-25 18:03:50 +09:00
Yusuke Nakamura
44bfe72892 [ruby/openssl] Add tast cases to OpenSSL::BN using ractor
OpenSSL::BN has been make ractor-safed in 9e7cf9e ,
but there was no test.
And to use 'ractor' annotation, update test-unit to v3.4.6 or higher.

7541a66911
2021-12-25 03:31:59 +09:00
aycabta
c815c0be46 [ruby/reline] Escape newline(s) in dynamic prompt
9b209ee1ea
2021-12-25 00:32:58 +09:00
aycabta
b0db420b0e [ruby/reline] Escape newline(s) in prompt
b545459fca
2021-12-25 00:32:57 +09:00
aycabta
20dae14ba9 Increase wait time 2021-12-25 00:20:53 +09:00
aycabta
a88169bbe9 Wait for output results to test correctly 2021-12-25 00:20:53 +09:00
Yuki Nishijima
03c54a09ec Revert "Revert "Replace an deprecated constant with a new one in did_you_mean""
This reverts commit 1527f7569b.
2021-12-24 23:21:55 +09:00
Yuki Nishijima
f9712b029b Sync did_you_mean 2021-12-24 23:20:30 +09:00
aycabta
0aca70e559 Output log after loading class to test 2021-12-24 22:29:06 +09:00
aycabta
0fbf1f193a Add logging about timeout 2021-12-24 20:55:59 +09:00
aycabta
5138ef3875 Kill process before assertion fails 2021-12-24 20:44:02 +09:00
aycabta
bad1e153d4 [ruby/reline] Implement em_kill_line
9fca6ceb45
2021-12-24 18:23:28 +09:00
aycabta
6c3cc9c58a [ruby/reline] Rename the wrong name "em-kill-line" with the correct name "unix-line-discard"
da7af35d1f
2021-12-24 18:23:28 +09:00
aycabta
9de42d3b34 [ruby/reline] Bind ed-kill-line to C-u on emacs mode
9ab99574f5
2021-12-24 18:23:28 +09:00
Nobuyoshi Nakada
517964d57b
Move embedded lines outside the here document
So that the actually run test code corresponds to the source file
line-by-line.
2021-12-24 17:33:45 +09:00
aycabta
f8a0ef30b2 Set time limit for waiting for terminating process within a test 2021-12-24 17:12:01 +09:00
Yusuke Endoh
424800f707 [ruby/reline] Fix test input_keys to handle "hankaku" characters correctly on Windows
The method "input_keys" in test/reline/helper.rb handles a single-byte
and 8-bit charater as an input with the meta key.
However, "test_halfwidth_kana_width_dakuten" in test/reline/test_key_actor_emacs.rb
uses a string that contains "hankaku" characters.
A "hankaku" character is not with the meta key, but it is a single-byte
and 8-bit character on Windows-31J encoding, which confused "input_keys"
method. This caused the following error.

41997092/job/ejm77qxgvnlpdwvg
```
  1) Failure:
Reline::KeyActor::Emacs::Test#test_halfwidth_kana_width_dakuten [C:/projects/ruby/test/reline/test_key_actor_emacs.rb:2311]:
<"\xB6\xDE\xB7\xDE\xB9\xDE\xBA\xDE" (#<Encoding:Windows-31J>)> expected but was
<"\e^\e^\e^\e:\e^" (#<Encoding:Windows-31J>)> in <Terminal #<Encoding:Windows-31J>>
.
<8> expected but was
<10>.
Finished tests in 1045.472722s, 19.3922 tests/s, 2609.4320 assertions/s.
```

This change introduces "input_raw_keys" that does not convert a
single-byte and 8-bit character to "with the meta key", and use it in
the test in question.

f6ae0e5d19
2021-12-24 15:01:17 +09:00
Sutou Kouhei
1a1550ba5d [ruby/csv] test: reduce size for stability on GitHub Actions
68461aead5
2021-12-24 14:35:33 +09:00
Sutou Kouhei
22ef4f6445 [ruby/csv] Revert "parser: fix a keep bug that some texts may be dropped unexpectedly"
This reverts commit 5c6523da0a.

This introduces another pbolem. We should try again later.

43a1d6fff1
2021-12-24 14:35:33 +09:00
Sutou Kouhei
4a5d372ca8 [ruby/csv] parser: fix a keep bug that some texts may be dropped unexpectedly
Ruby: [Bug #18245] [ruby-core:105587]

Reported by Hassan Abdul Rehman.

5c6523da0a
2021-12-24 14:35:33 +09:00
adamroyjones
c70dc3cafb [ruby/csv] Add handling for ambiguous parsing options (https://github.com/ruby/csv/pull/226)
GitHub: fix GH-225

With Ruby 3.0.2 and csv 3.2.1, the file

```ruby
require "csv"
File.open("example.tsv", "w") { |f| f.puts("foo\t\tbar") }
CSV.read("example.tsv", col_sep: "\t", strip: true)
```

produces the error

```
lib/csv/parser.rb:935:in `parse_quotable_robust': TODO: Meaningful
message in line 1. (CSV::MalformedCSVError)
```

However, the CSV in this example is not malformed; instead, ambiguous
options were provided to the parser. It is not obvious (to me) whether
the string should be parsed as

- `["foo\t\tbar"]`,
- `["foo", "bar"]`,
- `["foo", "", "bar"]`, or
- `["foo", nil, "bar"]`.

This commit adds code that raises an exception when this situation is
encountered. Specifically, it checks if the column separator either ends
with or starts with the characters that would be stripped away.

This commit also adds unit tests and updates the documentation.

cc317dd42d
2021-12-24 14:35:33 +09:00
Nobuyoshi Nakada
47c53af168 [ruby/csv] Fix typos [ci skip] (https://github.com/ruby/csv/pull/224)
27c0b66c8f
2021-12-24 14:35:33 +09:00
aycabta
ae770cc372 [ruby/reline] Add encoding info to an assertion of editing line
22d9262d79
2021-12-24 11:03:34 +09:00
Hiroshi SHIBATA
b0ad6cb371 Merge RubyGems-3.3.2 and Bundler-2.3.2 2021-12-24 10:35:31 +09:00
Kenta Murata
a1d9fbef05
[ruby/bigdecimal] Fix the result precision of BigDecimal#divmod
a32f6cb9e2
2021-12-24 02:29:01 +09:00
Kenta Murata
79712fc083
[ruby/bigdecimal] Let BigDecimal#quo accept precision
Fix GH-214.

13e0e93f37
2021-12-24 02:29:00 +09:00
Kenta Murata
98918209b7
[ruby/bigdecimal] Allow passing both float and precision in BigDecimal#div
Fix GH-212.

900bb7fcf5
2021-12-24 02:29:00 +09:00
Kenta Murata
84ae7a5df9
[ruby/bigdecimal] Add BigDecimal#precision_scale
c019caeaba
2021-12-24 02:28:59 +09:00
Kenta Murata
aca96f7ec7
[ruby/bigdecimal] Add BigDecimal#scale
Fixes GH-198.

4fbec55680
2021-12-24 02:28:58 +09:00
Kenta Murata
d905abb457
[ruby/bigdecimal] Fix BigDecimal#precision for single DECDIG case
Fix GH-205

7d198394a2
2021-12-24 02:28:56 +09:00
Kenta Murata
75f552e973
[ruby/bigdecimal] Fix the precision of the adjusted quotient
8dc8cd339d
2021-12-24 02:28:56 +09:00
Kenta Murata
7b2cfce543
[ruby/bigdecimal] Let BigDecimal_DoDivmod use the same precision calculation as BigDecimal_divide
11cb2c8840
2021-12-24 02:28:55 +09:00
Kenta Murata
e1265c8198
[ruby/bigdecimal] Use larger precision in divide for irrational or recurring results
Just in case for irrational or recurring results, the precision of the
quotient is set to at least more than 2*Float::DIG plus alpha.

[Bug #13754] [Fix GH-94]

99442c75d3
2021-12-24 02:28:55 +09:00
Kenta Murata
b2a74948b6
[ruby/bigdecimal] Add tests for the issue GH-192
e864828b47
2021-12-24 02:28:54 +09:00
Kenta Murata
70f2b62dfe
[ruby/bigdecimal] Use values in RbConfig::LIMITS in test
14e35f5a70
2021-12-24 02:28:52 +09:00
Kenta Murata
247d8d2815
[ruby/bigdecimal] Fix the style in test/bigdecimal/test_bigdecimal.rb
aa31ef2f33
2021-12-24 02:28:51 +09:00
Jean Boussier
ec478d947f
[ruby/bigdecimal] Fix negative Bignum conversion
Introduced in 4792a917d8

`rb_absint_size` return the number of bytes needed to fit
the absolute integer, but negative integers need the sign, so one more
bit, and potentially one more byte.

0f3d5d0eb7
2021-12-24 02:28:51 +09:00
Kenta Murata
c539cfd235
[ruby/bigdecimal] Fix test against #196
a834eb92a2
2021-12-24 02:28:51 +09:00
aycabta
547c27e9e7 [ruby/reline] Add a test for halfwidth kana width dakuten
0895a0d4a1
2021-12-24 00:51:48 +09:00
Yuki Nishijima
1527f7569b Revert "Replace an deprecated constant with a new one in did_you_mean"
This reverts commit 573d9d3a4a.
2021-12-23 10:48:27 +09:00
Yuki Nishijima
de841e2e28 Revert the commits for did_you_mean
This reverts commit feaf4fbc3f.
This reverts commit 0d4bfbdbe1.
This reverts commit ac4e0978ee.
2021-12-23 10:09:10 +09:00
Hiroshi SHIBATA
fb1ab27f53 Merge RubyGems-3.3.1 and Bundler-2.3.1 2021-12-23 09:44:45 +09:00