summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2021-08-31[rubygems/rubygems] Rename `Gem::PrintableUri#parsed_uri?` to ↵Daniel Niknam
`Gem::PrintableUri#valid_uri?` https://github.com/rubygems/rubygems/commit/a5177709c9 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Refactor `Gem::RemoteFetcher::FetchError` initializer to ↵Daniel Niknam
`build` method The `initialize` method is already doing a lot and by adding the `Gem::PrintableUri` to redact sensitive information, things are getting complicated and hard to read here. For the start, I have refactored the `initialize` method into a class method called `build`. https://github.com/rubygems/rubygems/commit/4312e8fdf5 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Using `Gem::PrintableUri` in `Gem::Request` classDaniel Niknam
The `@uri` variable could be a source URI with a credential. Using `Gem::PrintableUri` to make sure we are redacting sensitive information from it when logging on verbose mode. https://github.com/rubygems/rubygems/commit/f566787211 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Using `Gem::PrintableUri` in ↵Daniel Niknam
`Gem::Commands::InstallCommand` class The `x.source.uri` could be a source URI with a credential. Using `Gem::PrintableUri` to make sure we are redacting sensitive information from it. https://github.com/rubygems/rubygems/commit/8755ee0aaa Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Introduce `Gem::PrintableUri` that would redact URIs to ↵Daniel Niknam
be used on outputs We need to redact URI credential in several places and copy pasting the code into each part of it is not ideal. This class is responsible for parsing URI strings and redacting credential from it. Also, it will handle URI object in the same manner. We will be reusing this class whenever we need to print/display a URI to users. URI with the following format will be redacted: - Token: `http://my-secure-token@example.com` => `http://REDACTED@example.com` - Username & Password: `http://my-username:my-secure-password@example.com` => `http://my-username:REDACTED@example.com` - x-oauth-basic: `http://my-secure-token:x-oauth-basic@example.com` => `http://REDACTED:x-oauth-basic@example.com` https://github.com/rubygems/rubygems/commit/f1e45d3a89 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Add a few tests for `Gem::UriParser.parse_uri`Daniel Niknam
https://github.com/rubygems/rubygems/commit/1ea73df161 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Pick the last founded gems when fetching metadataDaniel Niknam
https://github.com/rubygems/rubygems/commit/e3d150d822 Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net> Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Remove unused fileDavid Rodríguez
No longer used since https://github.com/rubygems/rubygems/commit/b7f6270b9e5e15591cd679f60fa8f43e6763f3f5. https://github.com/rubygems/rubygems/commit/76803894a0 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Remove helper method not buying us muchDavid Rodríguez
https://github.com/rubygems/rubygems/commit/81dc685d20 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Remove MacOS specific extra GEM_PATHDavid Rodríguez
They should properly configure `GEM_PATH` instead. https://github.com/rubygems/rubygems/commit/3bd9ae33ca Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Replace StandardError with ExceptionDaniel Niknam
We think it's unlikely that `rubygems/defaults/operating_system` could be shipped with a SyntaxError so StandardError could be better choice to prevent "false positives" errors. https://github.com/rubygems/rubygems/commit/1f73e784dd Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Reword the messageDaniel Niknam
For errors that could happened while loading `rubygems/defaults/operating_system` https://github.com/rubygems/rubygems/commit/6e1e2141f8 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Exclude truffleruby from the test for failure of ↵Daniel Niknam
operating_system.rb truffleruby does not raise any error when requiring `rubygems`. https://github.com/rubygems/rubygems/commit/21e2fcd0b2 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Enhance error handling when loading the ↵Daniel Niknam
rubygems/defaults/operating_system file When loading `rubygems/defaults/operating_system` - we want to keep it silent if the raised exception is a LoadError - we want to print a message in other cases and ask users to report the issue to their OS support. Ruby 3 comes with special error handling for loading `rubygems` and it will show a warning when LoadError exception raised for requiring 'rubygem'. Because of that, we decided to leave the LoadError scenario as it is. Reference: https://github.com/ruby/ruby/blob/d1998d8767affe58be0bd09ec536dae9198a7fbd/gem_prelude.rb#L1-L5 https://github.com/rubygems/rubygems/commit/0a97e12fe1 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Also load user installed rubygems pluginsDavid Rodríguez
https://github.com/rubygems/rubygems/commit/82960c262f Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Recommend `bundle install` rather than `gem install -g`David Rodríguez
https://github.com/rubygems/rubygems/commit/4028cbc408 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Refactor reseting `RUBYGEMS_GEMDEPS` in testsDavid Rodríguez
https://github.com/rubygems/rubygems/commit/91dca11112 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Use `Gem.use_gemdeps` only from binstubsDavid Rodríguez
The previous behavior was to automatically require `bundler/setup` everytime `rubygems` was required, which I think was too much. https://github.com/rubygems/rubygems/commit/b25379a295 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Remove misleading commentDavid Rodríguez
When I read, I thought the assertion was incorrect. It's doing the right thing, though. https://github.com/rubygems/rubygems/commit/e72c27367a Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Remove unnecessary spec manipulationDavid Rodríguez
https://github.com/rubygems/rubygems/commit/c7c00c280f Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Remove redundant part of error messageDavid Rodríguez
It doesn't really add much, in my opinion. We want to be helpful, but also concise when possible. https://github.com/rubygems/rubygems/commit/9d56009cf7 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31Omit some tests until debugging is completeaycabta
2021-08-31[Feature #16972] Add mode: option to Pathname#mkpathNobuyoshi Nakada
2021-08-30[ruby/irb] Relax backtrace nest levelsNobuyoshi Nakada
https://github.com/ruby/irb/commit/fb637bc68f
2021-08-30[ruby/irb] Added the extra stdout message with test-unitHiroshi SHIBATA
https://github.com/ruby/irb/commit/b153d587a1
2021-08-30[ruby/irb] Use capture_output instead of capture_ioHiroshi SHIBATA
https://github.com/ruby/irb/commit/077e4ae7de
2021-08-30[ruby/irb] Use pend instead of skipHiroshi SHIBATA
https://github.com/ruby/irb/commit/f441ce35bf
2021-08-30Add --autocomplete / --noautocomplete optionsaycabta
2021-08-30[ruby/reline] Disable autocompletion in testsaycabta
https://github.com/ruby/reline/commit/9b1913567a
2021-08-30[ruby/irb] Remove path settings for debuggingaycabta
https://github.com/ruby/irb/commit/48029944a5
2021-08-29Support tracing of attr_reader and attr_writerJeremy Evans
In vm_call_method_each_type, check for c_call and c_return events before dispatching to vm_call_ivar and vm_call_attrset. With this approach, the call cache will still dispatch directly to those functions, so this change will only decrease performance for the first (uncached) call, and even then, the performance decrease is very minimal. This approach requires that we clear the call caches when tracing is enabled or disabled. The approach currently switches all vm_call_ivar and vm_call_attrset call caches to vm_call_general any time tracing is enabled or disabled. So it could theoretically result in a slowdown for code that constantly enables or disables tracing. This approach does not handle targeted tracepoints, but from my testing, c_call and c_return events are not supported for targeted tracepoints, so that shouldn't matter. This includes a benchmark showing the performance decrease is minimal if detectable at all. Fixes [Bug #16383] Fixes [Bug #10470] Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com> Notes: Merged: https://github.com/ruby/ruby/pull/4767
2021-08-29[ruby/reline] Fix tests so that the completion journey starts on first C-n/C-paycabta
https://github.com/ruby/reline/commit/52a40f2cd3
2021-08-29Free previously used tables [Bug #18134]Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/4788
2021-08-29Add negative position tests [Bug #18138]Nobuyoshi Nakada
2021-08-29Add out of range tests for Array#slice!Nobuyoshi Nakada
2021-08-26Fix example fiber scheduler reg. writable eventsLars Kanis
There were two issues: 1. When an IO object is waiting for writablility only (as in test_tcp_accept) the selected hash is empty. Therefore selected[fiber] returns nil but needs to default to 0 in order to be or'ed with IO::WRITABLE. 2. When an IO object is waiting for read- or writability (as in test_tcp_connect), but only one of these two events arrive, the Fiber and IO object need to be removed from the other `@readable` or `@writable` list. Notes: Merged: https://github.com/ruby/ruby/pull/4777
2021-08-24Fix warnings in test_optimization.rbJeremy Evans
These were introduced in the test for tracing optimized methods added in 48c8df9e0eb295af06d593ce37ce1933c0ee1d90.
2021-08-24[ruby/fiddle] Simplify libc and libm path logics ↵Nobuyoshi Nakada
(https://github.com/ruby/fiddle/pull/91) * Simplify libc_so and libm_so If nil, no need to set to nil. * Get rid of repeating inversions https://github.com/ruby/fiddle/commit/4323e689d8
2021-08-24[ruby/fiddle] Improve "offsetof" calculations ↵Aaron Patterson
(https://github.com/ruby/fiddle/pull/90) I need to get the offset of members inside sub structures. This patch adds sub-structure offset support for structs. https://github.com/ruby/fiddle/commit/cf78eddbb6
2021-08-22Fix Marshal.dump(closed_io) to raise TypeError and allow encoding on closed IOLars Kanis
Mashalling a closed IO object raised "closed stream (IOError)" before instead of TypeError. This changes IO#(in|ex)ternal_encoding to still return the encoding even if the underlying FD is closed. Fixes bug #18077 Notes: Merged: https://github.com/ruby/ruby/pull/4758
2021-08-21Allow tracing of optimized methodsJeremy Evans
This updates the trace instructions to directly dispatch to opt_send_without_block. So this should cause no slowdown in non-trace mode. To enable the tracing of the optimized methods, RUBY_EVENT_C_CALL and RUBY_EVENT_C_RETURN are added as events to the specialized instructions. Fixes [Bug #14870] Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com> Notes: Merged: https://github.com/ruby/ruby/pull/4739 Merged-By: jeremyevans <code@jeremyevans.net>
2021-08-20[ruby/error_highlight] Fixed the argument for DidYouMean.formatter=Yusuke Endoh
Looks like this bug was hidden by did_you_mean's rescuing any exceptions. https://github.com/ruby/error_highlight/commit/7a8f0b4796
2021-08-20ast.c: Rename "save_script_lines" to "keep_script_lines"Yusuke Endoh
... as per ko1's preference. He is preparing to extend this feature to ISeq for his new debugger. He prefers "keep" to "save" for this wording. This API is internal and not included in any released version, so I change it in advance.
2021-08-20Module#ancestors should not return superclasses of refinementsShugo Maeda
[ruby-core:86949] [Bug #14744] Reported by Eregon (Benoit Daloze). Thanks!
2021-08-19Remove old warning aged nearly 8 yearsNobuyoshi Nakada
2021-08-19Allow omission of parentheses in one line pattern matching [Feature #16182]Kazuki Tsujimoto
2021-08-17Take into account data in emoji-variation-sequences.txt in tests.Martin Dürst
The emoji data in emoji-variation-sequences.txt was not used for in test/ruby/enc/test_emoji_breaks.rb, for unknown reasons. It turned out that the format of each of the emoji data/test files is slightly different, and that we didn't take into account that empty fields after a semicolon, as present in emoji-variation-sequences.txt, led to less fields than expected when using split. This addresses issue #18027.
2021-08-15Extract the wrapped value when yydebug [Bug #18075]Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/4742
2021-08-15Show verbose error messages when single pattern match failsKazuki Tsujimoto
[0] => [0, *, a] #=> [0] length mismatch (given 1, expected 2+) (NoMatchingPatternError) Ignore test failures of typeprof caused by this change for now.
2021-08-14[ruby/readline-ext] Give up Editlineaycabta
https://github.com/ruby/readline-ext/commit/d924cfc1e6