summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2024-04-03[ruby/prism] Update whitequark/parser testsKevin Newton
https://github.com/ruby/prism/commit/b1492ec87c
2024-04-03[ruby/prism] Match circular parameter error messageKevin Newton
https://github.com/ruby/prism/commit/c0381b10e4
2024-04-03Do not rely on ripper for magic comment testKevin Newton
2024-04-02[PRISM] Fix ISEQ loadKevin Newton
2024-04-02[PRISM] Document more reasons for failuresKevin Newton
2024-04-02[PRISM] Enable more passing parsing testsKevin Newton
2024-04-02[Feature #20345] Add `--target-rbconfig` option to mkmfYuta Saito
Introduce a new mkmf option `--target-rbconfig` to specify the RbConfig file for the deployment target platform. This option is useful for cross-compiling Ruby extensions without faking the global top-level `RbConfig` constant.
2024-04-02[Feature #20331] Simplify parser warnings for hash keys duplication and when ↵yui-knk
clause duplication This commit simplifies warnings for hash keys duplication and when clause duplication, based on the discussion of https://bugs.ruby-lang.org/issues/20331. Warnings are reported only when strings are same to ohters.
2024-04-01[ruby/prism] Match more error messagesKevin Newton
https://github.com/ruby/prism/commit/0cc3a9d63a
2024-04-01[PRISM] Enable passing pattern matching testsKevin Newton
2024-04-01[ruby/prism] Do not track locals starting with _Kevin Newton
https://github.com/ruby/prism/commit/0d5a6d936a
2024-04-01[ruby/prism] Use RubyVM::InstructionSequence instead of Ripper for validity ↵Kevin Newton
check https://github.com/ruby/prism/commit/ddec1c163d
2024-04-01[ruby/prism] Track duplicate hash keys for pattern matchingKevin Newton
https://github.com/ruby/prism/commit/71ea82f299
2024-04-01[ruby/prism] Track captures in pattern matching for duplicatesKevin Newton
https://github.com/ruby/prism/commit/aa2182f064
2024-04-01[ruby/reline] Refactor completiontomoya ishida
(https://github.com/ruby/reline/pull/647) * Refactor completion: split autocompletion and tabcompletion logic and state * Move completion candidate listup logic from dialog proc to LineEditor https://github.com/ruby/reline/commit/c3c09ac9c2
2024-04-01[ruby/reline] Align completion menu itemstomoya ishida
(https://github.com/ruby/reline/pull/613) https://github.com/ruby/reline/commit/a622704f62
2024-04-01Rename the variableNobuyoshi Nakada
It is not an empty gzipped data, a gzipped empty dump data.
2024-04-01Write gzipped data as binaryNobuyoshi Nakada
Be careful when writing binary data on Windows. ``` $ ruby -e 's = Gem::Util.gzip("\x04\x08[\x05".b); p s.index("\n"); puts IO::Buffer.for(s).hexdump' 6 0x00000000 1f 8b 08 00 6c 3d 0a 66 00 03 63 e1 88 66 05 00 ....l=.f..c..f.. 0x00000010 e3 69 10 89 04 00 00 00 .i...... ```
2024-04-01Use dummy data generated by RubyGemsHiroshi SHIBATA
2024-03-31[ruby/resolv] Add an explicit with_udp_and_tcp helper to test_dns.rbKJ Tsanaktsidis
This helper tries to bind UDP and TCP sockets to the same port, by retrying the bind if the randomly-assinged UDP port is already taken in TCP. This fixes a flaky test. [Bug #20403] https://github.com/ruby/resolv/commit/3d135f99d9
2024-03-29[PRISM] Fix error message for duplicate parameter nameKevin Newton
2024-03-29[PRISM] Have RubyVM::InstructionSequence.compile respect --parser=prismKevin Newton
2024-03-29[rubygems/rubygems] Add "gem rebuild" command.Ellen Marie Dash
https://github.com/rubygems/rubygems/commit/6d661573f0
2024-03-28[PRISM] Enable passing regexp testKevin Newton
2024-03-28[ruby/prism] Allow writing to keywords with named captures if they are ↵Kevin Newton
already locals https://github.com/ruby/prism/commit/418318e1c8
2024-03-28[ruby/prism] Reject invalid capture groups (keywords)Kevin Newton
https://github.com/ruby/prism/commit/bb78d83e88
2024-03-28[ruby/prism] Ensure deserialization works with errors+warnings>256Kevin Newton
https://github.com/ruby/prism/commit/f540e830b5
2024-03-28[ruby/prism] CLI -x flagKevin Newton
https://github.com/ruby/prism/commit/2068e3c30a
2024-03-28Use www.rfc-editor.org for RFC text.Hiroshi SHIBATA
We use the following site for that now: * https://tools.ietf.org/ or http * https://datatracker.ietf.org or http Today, IETF said the official site of RFC is www.rfc-editor.org. FYI: https://authors.ietf.org/en/references-in-rfcxml I replaced them to www.rfc-editor.org.
2024-03-28Set ASAN_OPTIONS=disable_coredump=0 for test_execopts_rlimit testKJ Tsanaktsidis
By default, ASAN sets RLIMIT_CORE to zero, "to avoid dumping a 16T+ core file" on 64 bit systems. These tests are just asserting on the expected value of RLIMIT_CORE, not actually dumping core files, so it's fine to disable that behaviour of ASAN for this test.
2024-03-28Disable ASAN handle_segv in test_rubyoptions.rbKJ Tsanaktsidis
ASAN registers a sigsegv handler and causes extra output to be emitted that these tests are not expecting.
2024-03-27[PRISM] Set path on syntax errorKevin Newton
2024-03-27[PRISM] Enable passing test for hash duplicated keysKevin Newton
2024-03-27[ruby/prism] Compare duplicates keys/whens for __FILE__Kevin Newton
https://github.com/ruby/prism/commit/85263ade63
2024-03-27[PRISM] Turn on passing testKevin Newton
2024-03-27[PRISM] Implicitly change encoding when a UTF-8 BOM is foundKevin Newton
2024-03-27[PRISM] Match style for invalid encoding errorKevin Newton
2024-03-28[ruby/stringio] Eagerly defrost chilled stringsÉtienne Barrié
[Feature #20390] https://github.com/ruby/stringio/commit/17ee957f34 Co-authored-by: Jean Boussier <byroot@ruby-lang.org>
2024-03-27Add array/hash implicit allocation testsJeremy Evans
These are designed to prevent allocation regressions (commits that increase the number of implicitly allocated arrays and hashes). We have already had three commits in the last couple weeks to fix allocation regressions: * 15dc3aaa311b32203d8ffb414bcf9b8e55ce5691 * aceee71c35e0b387691836e756b4e008efd84cf1 * c38878494377c94f2425a81e598260ea944ef7f3 This test suite should hopefully allow us to find such regressions in CI before commit, to avoid committing future allocation regressions. This uses assert_separately around each set of tests. Doing it for each individual check was too slow. Failures are gathered and reported at the end of the the suite as a single assertion, with the message describing all failures.
2024-03-27Revert "skip `test_gc_stress_at_startup`"Peter Zhu
This reverts commit 3680981c7b71df8c3a426164787ccefe5296bb25.
2024-03-27[PRISM] Enable passing syntax testsKevin Newton
2024-03-27[PRISM] Enable passing frozen string in array testKevin Newton
2024-03-27[PRISM] Enable passing heredoc testKevin Newton
2024-03-27[PRISM] Fix ASCII-compatible check for eval encodingKevin Newton
2024-03-27[ruby/strscan] Omit tests for `#scan_byte` and `#peek_byte` onAndrii Konchyn
TruffleRuby temporary (https://github.com/ruby/strscan/pull/91) The methods were added in #89 but they aren't implemented in TruffleRuby yet. So let's omit them for now to have CI green. https://github.com/ruby/strscan/commit/844d963b56
2024-03-27[ruby/openssl] Fix test_pkey_dsa.rb in FIPS.Jun Aruga
Note that I created the `dsa2048.pem` and signature text (`signature_encoded.txt`), that is used as a text to create the `signature0` in the `test_sign_verify` by the following steps with the `openssl` CLI on FIPS module. ``` $ OPENSSL_DIR="${HOME}/.local/openssl-3.3.0-dev-fips-debug-1f03d33ef5" $ export OPENSSL_CONF="${OPENSSL_DIR}/ssl/openssl_fips.cnf" $ "${OPENSSL_DIR}/bin/openssl" dsaparam -out dsaparam2048.pem 2048 $ "${OPENSSL_DIR}/bin/openssl" gendsa -out dsa2048.pem dsaparam2048.pem $ echo -n "Sign me!" > data.txt $ "${OPENSSL_DIR}/bin/openssl" dgst -sha256 -sign dsa2048.pem data.txt > signature.txt $ cat signature.txt | base64 > signature_encoded.txt ``` Skip the `test_DSAPrivateKey_encrypted` on FIPS because AES-128-CBC, the password based encryption used in the PEM format uses MD5 for deriving the encryption key from the password, and MD5 is not FIPS-approved. See also the comment on the `test/openssl/utils.rb#omit_on_fips`. https://github.com/ruby/openssl/commit/4bdcb419a9
2024-03-27[DOC] remove repetitive words in commentscrazeteam
Signed-off-by: crazeteam <lilujing@outlook.com>
2024-03-27Don't clear pending interrupts in the parent process. (#10365)Samuel Williams
2024-03-26[PRISM] Use correct encoding for regular expression literalsKevin Newton
2024-03-26[ruby/prism] Fix an incorrect range of `Prism::Location` when ↵Koichi ITO
`PM_ERR_RETURN_INVALID` This PR fixes the following incorrect range of `Prism::Location` when `PM_ERR_RETURN_INVALID`. It may be hard to tell from the text, but this Ruby error highlights `return`: ```console $ ruby -e 'class Foo return end' -e:1: Invalid return in class/module body class Foo return end -e: compile error (SyntaxError) ``` Previously, the error's `Prism::Location` pointed to `end`: ```console $ bundle exec ruby -Ilib -rprism -ve 'p Prism.parse("class Foo return end").errors' ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-darwin22] [#<Prism::ParseError @type=:return_invalid @message="invalid `return` in a class or module body" @location=#<Prism::Location @start_offset=17 @length=3 start_line=1> @level=:fatal>] After this fix, it will indicate `return`. ```console $ bundle exec ruby -Ilib -rprism -ve 'p Prism.parse("class Foo return end").errors' ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-darwin22] [#<Prism::ParseError @type=:return_invalid @message="invalid `return` in a class or module body" @location=#<Prism::Location @start_offset=10 @length=6 start_line=1> @level=:fatal>] ``` For reference, here are the before and after of `Prism::Translation::Parser`. Before: ```console $ bundle exec ruby -Ilib -rprism -rprism/translation/parser33 -ve 'p Prism::Translation::Parser33.parse("class Foo return end")' ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-darwin22] (string):1:18: error: invalid `return` in a class or module body (string):1: class Foo return end (string):1: ^~~ /Users/koic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/parser-3.3.0.5/lib/parser/diagnostic/engine.rb:72:in `process': invalid `return` in a class or module body (Parser::SyntaxError) from /Users/koic/src/github.com/ruby/prism/lib/prism/translation/parser.rb:220:in `block in unwrap' from /Users/koic/src/github.com/ruby/prism/lib/prism/translation/parser.rb:218:in `each' from /Users/koic/src/github.com/ruby/prism/lib/prism/translation/parser.rb:218:in `unwrap' from /Users/koic/src/github.com/ruby/prism/lib/prism/translation/parser.rb:49:in `parse' from /Users/koic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/parser-3.3.0.5/lib/parser/base.rb:33:in `parse' from -e:1:in `<main>' ``` After: ```console $ bundle exec ruby -Ilib -rprism -rprism/translation/parser33 -ve 'p Prism::Translation::Parser33.parse("class Foo return end")' ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-darwin22] (string):1:11: error: invalid `return` in a class or module body (string):1: class Foo return end (string):1: ^~~~~~ /Users/koic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/parser-3.3.0.5/lib/parser/diagnostic/engine.rb:72:in `process': invalid `return` in a class or module body (Parser::SyntaxError) from /Users/koic/src/github.com/ruby/prism/lib/prism/translation/parser.rb:220:in `block in unwrap' from /Users/koic/src/github.com/ruby/prism/lib/prism/translation/parser.rb:218:in `each' from /Users/koic/src/github.com/ruby/prism/lib/prism/translation/parser.rb:218:in `unwrap' from /Users/koic/src/github.com/ruby/prism/lib/prism/translation/parser.rb:49:in `parse' from /Users/koic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/parser-3.3.0.5/lib/parser/base.rb:33:in `parse' from -e:1:in `<main>' ``` This PR ensures that the originally intended `return` is highlighted as it should be. https://github.com/ruby/prism/commit/1f9af4d2ad