aboutsummaryrefslogtreecommitdiffstats
path: root/spec
Commit message (Collapse)AuthorAgeFilesLines
* [rubygems/rubygems] Fix inline mode with multiple sourcesDavid Rodríguez2023-06-061-0/+25
| | | | | | | | | | | | If we're in inline mode, Bundler first resolves using only local gems, and if some gems are missing, then it re-resolves using remote gems. However, "source resolution" from the initial "local" try was being memoized, resulting in Bundler not looking for some gems remotely in the second resolution. This commit forces a proper re-resolve in this case. https://github.com/rubygems/rubygems/commit/fdc631075e
* rb_io_descriptor() is available since 3.1Benoit Daloze2023-06-011-1/+1
|
* Hide the usage of `rb_io_t` where possible. (#7880)Samuel Williams2023-06-011-1/+9
| | | This retries the compatible parts of the previously reverted PR so we can continue to update related code without breaking backwards compatibility.
* Revert "Hide most of the implementation of `struct rb_io`. (#6511)"NARUSE, Yui2023-06-011-9/+1
| | | | | | | | | This reverts commit 18e55fc1e1ec20e8f3166e3059e76c885fc9f8f2. fix [Bug #19704] https://bugs.ruby-lang.org/issues/19704 This breaks compatibility for extension libraries. Such changes need a discussion.
* [rubygems/rubygems] tool_dir needs to handle ruby/ruby repo nowHiroshi SHIBATA2023-05-311-3/+3
| | | | https://github.com/rubygems/rubygems/commit/550d90f4ba
* Merge RubyGems/Bundler master from 4076391fce5847689bf2ec402b17133fe4e32285Hiroshi SHIBATA2023-05-305-9/+35
|
* Hide most of the implementation of `struct rb_io`. (#6511)Samuel Williams2023-05-301-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Add rb_io_path and rb_io_open_descriptor. * Use rb_io_open_descriptor to create PTY objects * Rename FMODE_PREP -> FMODE_EXTERNAL and expose it FMODE_PREP I believe refers to the concept of a "pre-prepared" file, but FMODE_EXTERNAL is clearer about what the file descriptor represents and aligns with language in the IO::Buffer module. * Ensure that rb_io_open_descriptor closes the FD if it fails If FMODE_EXTERNAL is not set, then it's guaranteed that Ruby will be responsible for closing your file, eventually, if you pass it to rb_io_open_descriptor, even if it raises an exception. * Rename IS_EXTERNAL_FD -> RUBY_IO_EXTERNAL_P * Expose `rb_io_closed_p`. * Add `rb_io_mode` to get IO mode. --------- Co-authored-by: KJ Tsanaktsidis <ktsanaktsidis@zendesk.com>
* Refactor guards for Time.new specBenoit Daloze2023-05-291-10/+13
|
* Unify error messages of rb_num2ulong and rb_num2ullPeter Zhu2023-05-291-1/+8
| | | | | The error messages were slightly different due, which causes different behaviour on 32-bit and 64-bit systems.
* Update to ruby/spec@c3677cfBenoit Daloze2023-05-2956-132/+1452
|
* Fix "runs a C function with the global lock unlocked and unlocks IO with the ↵Samuel Williams2023-05-242-17/+17
| | | | | | | | | generic RUBY_UBF_IO" on Windows. (#7848) * Enable borked spec. * Ensure win32 wrappers are visible and used. * Reorganise `read`/`write`/`pipe` in `thread_spec.c`.
* Add a newline at EOF [ci skip]Nobuyoshi Nakada2023-05-241-1/+1
|
* Add support for pread/pwrite on windows. (#7827)Samuel Williams2023-05-243-69/+66
|
* Hash.new: print a deprecation warning when receiving keyword arguments (#7828)Jean byroot Boussier2023-05-234-5/+18
| | | | | | | | | | [Feature #19236] In Ruby 3.3, `Hash.new` shall print a deprecation warning if keyword arguments are passed instead of treating them as an implicit positional Hash. This will allow to safely introduce a `capacity` keyword argument in 3.4 Co-authored-by: Jean Boussier <byroot@ruby-lang.org>
* Manually merge syntax_suggest-1.1.0Hiroshi SHIBATA2023-05-234-37/+205
|
* [ruby/syntax_suggest] Fixschneems2023-05-231-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://github.com/ruby/syntax_suggest/pull/187 Handle if/else with empty/comment line Reported in #187 this code: ``` class Foo def foo if cond? foo else # comment end end # ... def bar if @recv end_is_missing_here end end ``` Triggers an incorrect suggestion: ``` Unmatched keyword, missing `end' ? 1 class Foo 2 def foo > 3 if cond? > 5 else 8 end 16 end ``` Part of the issue is that while scanning we're using newlines to determine when to stop and pause. This is useful for determining logically smaller chunks to evaluate but in this case it causes us to pause before grabbing the "end" that is right below the newline. This problem is similar to https://github.com/ruby/syntax_suggest/pull/179. However in the case of expanding same indentation "neighbors" I want to always grab all empty values at the end of the scan. I don't want to do that when changing indentation levels as it affects scan results. There may be some way to normalize this behavior between the two, but the tests really don't like that change. To fix this issue for expanding against different indentation I needed a way to first try and grab any additional newlines with the ability to rollback that guess. In #192 I experimented with decoupling scanning from the AroundBlockScan logic. It also added the ability to take a snapshot of the current scanner and rollback to prior changes. With this ability in place now we: - Grab extra empties before looking at the above/below line for the matching keyword/end statement - If there's a match, grab it - If there's no match, discard the newlines we picked up in the evaluation That solves the issue. https://github.com/ruby/syntax_suggest/commit/513646b912
* [ruby/syntax_suggest] Refactor Scanner logic out of AroundBlockScan ↵schneems2023-05-233-4/+68
| | | | | | | | | | | | | | | | | | | introduce history AroundBlockScan started as a utility class that was meant to be used as a DSL for scanning and making new blocks. As logic got added to this class it became hard to reason about what exactly is being mutated when. I pulled the scanning logic out into it's own class which gives us a clean separation of concerns. This allowed me to remove a lot of accessors that aren't core to the logic provided by AroundBlockScan. In addition to this refactor the ScanHistory class can snapshot a scan. This allows us to be more aggressive with scans in the future as we can now snapshot and rollback if it didn't turn out the way we wanted. The change comes with a minor perf impact: before: 5.092678 0.104299 5.196977 ( 5.226494) after: 5.128536 0.099871 5.228407 ( 5.249542) This represents a 0.996x change in speed (where 1x would be no change and 2x would be twice as fast). This is a 0.38% decrease in performance which is negligible. It's likely coming from the extra blocks being created while scanning. This is negligible and if the history feature works well we might be able to make better block decisions which is means fewer calls to ripper which is the biggest bottleneck. While this doesn't fix https://github.com/ruby/syntax_suggest/issues/187 it's a good intermediate step that will hopefully make working on that issue easier. https://github.com/ruby/syntax_suggest/commit/ad8487d8aa
* Fix typo in spec file description [ci skip]Ivanov-Anton2023-05-211-1/+1
| | | fixed typo for spec description
* Add Fiber#kill, similar to Thread#kill. (#7823)Samuel Williams2023-05-181-0/+90
|
* fix wording of spec description [ci skip]Martin Dürst2023-05-131-1/+1
|
* [Bug #19597] Freeze script nameNobuyoshi Nakada2023-05-101-2/+4
|
* Merge https://github.com/rubygems/rubygems/pull/6655 manually.Hiroshi SHIBATA2023-05-101-7/+35
|
* Relax regexp for console assertionHiroshi SHIBATA2023-05-092-2/+2
|
* marshal.c: shallow freeze user objectsJean Boussier2023-04-261-9/+7
| | | | | | When `freeze: true` argument is passed. [Bug #19427]
* Update to ruby/spec@7f6ca5bBenoit Daloze2023-04-252-1/+2
|
* Workaround CRuby adding x86_64-linux-fake in $LOADED_FEATURESBenoit Daloze2023-04-251-1/+5
|
* Update to ruby/spec@7f69c86Benoit Daloze2023-04-2599-183/+2316
|
* Update to ruby/mspec@1d8cf64Benoit Daloze2023-04-256-80/+3
|
* [ruby/syntax_suggest] Clean up outputschneems2023-04-253-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I previously left a comment stating I didn't know why a certain method existed. In investigating the code in `CaptureCodeContext#capture_before_after_kws` I found that it was added as to give a slightly less noisy output. The docs for AroundBlockScan#capture_neighbor_context only describe keywords as being a primary concern. I modified that code to only include lines that are keywords or ends. This reduces the output noise even more. This allows me to remove that `start_at_next_line` method. One weird side effect of the prior logic is it would cause this code to produce this output: ``` class OH def hello def hai end end ``` ``` 1 class OH > 2 def hello 4 def hai 5 end 6 end ``` But this code to produce this output: ``` class OH def hello def hai end end ``` ``` 1 class OH > 2 def hello 4 end 5 end ``` Note the missing `def hai`. The only difference between them is that space. With this change, they're now both consistent. https://github.com/ruby/syntax_suggest/commit/4a54767a3e
* [ruby/syntax_suggest] standardrb --fix-unsafely spec/spec_helper.rbHiroshi SHIBATA2023-04-251-1/+1
| | | | https://github.com/ruby/syntax_suggest/commit/6e266b3b2b
* Allow anonymous memberless StructJeremy Evans2023-04-241-0/+14
| | | | | | | Previously, named memberless Structs were allowed, but anonymous memberless Structs were not. Fixes [Bug #19416]
* Check the precision of `getrusage` at runtimeNobuyoshi Nakada2023-04-231-1/+11
|
* Fix a guard of `Process.times`Nobuyoshi Nakada2023-04-221-8/+5
| | | | | | `GETRUSAGE_BASED_CLOCK_PROCESS_CPUTIME_ID` clock uses `getrusage` always if available as the name states. That is if it is implemented `getrusage` is available, regardless microseconds in its results.
* Fix an example of `Process.times`Nobuyoshi Nakada2023-04-221-1/+1
| | | | | | | | Prior to commit 5806c54447439f2ba22892e4045e78dd80f96f0c, it was "at least one result with precision beyond milliseconds (with none-zero microseconds) should exist"; after this commit, "at least one result should have zero microseconds". This chance is lower than the previous condition.
* Skip when unix socket path is too longNobuyoshi Nakada2023-04-211-1/+3
| | | | | Eventually the path directly under "/tmp" is complained by `rm_r` in spec/mspec/lib/mspec/helpers/fs.rb.
* [rubygems/rubygems] Revert "Bundler::YAMLSerializer.load couldn't raise ↵Hiroshi SHIBATA2023-04-201-0/+23
| | | | | | | | error when invalid yaml was provided" This reverts commit https://github.com/rubygems/rubygems/commit/cfcfde04c783. https://github.com/rubygems/rubygems/commit/ac21ae7083
* Use ASCII-compatible encoding for testsNobuyoshi Nakada2023-04-202-0/+0
| | | | | | Since these files are written in a wide character encoding, stop at first NUL byte and are actually empty. ASCII-incompatible encodings have never been supported as source encoding.
* [rubygems/rubygems] Bundler::YAMLSerializer.load couldn't raise error when ↵Hiroshi SHIBATA2023-04-191-23/+0
| | | | | | invalid yaml was provided https://github.com/rubygems/rubygems/commit/cfcfde04c7
* MatchData#named_captures: add optional symbolize_names keyword (#6952)Vladimir Dementyev2023-04-191-0/+12
|
* Add spec for `Warning[:performance]`Jean Boussier2023-04-171-0/+7
| | | | [Feature #19538]
* Implement ObjectSpace::WeakMap#delete and ObjectSpace::WeakKeyMap#deleteJean Boussier2023-04-152-0/+70
| | | | | | [Feature #19561] It's useful to be able to remove references from weak maps.
* * append newline at EOF. [ci skip]git2023-04-151-1/+1
|
* Add specs for ObjectSpace::WeakKeyMapJean Boussier2023-04-155-0/+161
| | | | [Feature #18498]
* Revert "Add specs for ObjectSpace::WeakKeyMap"Jean Boussier2023-04-145-151/+0
| | | | This reverts commit fce8f9f24e4903784266fc9694f86ddd930d6141.
* Add specs for ObjectSpace::WeakKeyMapJean Boussier2023-04-145-0/+151
| | | | [Feature #18498]
* [Bug #19533] Add spec of infinite range inclusionNobuyoshi Nakada2023-04-141-0/+6
|
* Removed file that is part of d89cc317c642848008f5b17a82196d25ddcdf124Hiroshi SHIBATA2023-04-111-16/+0
|
* [rubygems/rubygems] Remove one fallback to full indexes on big gemfilesDavid Rodríguez2023-04-074-32/+8
| | | | | | | | | | | | | | | | | | | If Gemfile has a lot of dependencies, we have an optimization that uses the full index in that case, assuming it's going to be faster. I think this is an old optimization that predates compact index API times, I believe we no longer need it these days. Also, since a few releases ago we check for circular dependencies when resolving by looping through all versions of each name and removing those that have circular dependencies that would trip up the resolver. This loop becomes actually very slow when full indexes are used because to find dependencies of a gemspec, we need to explicitly fetch the marshaled gemspec (`gemspec.rz` endpoint) for it, so the optimization has the opposite effect of making things very slow. https://github.com/rubygems/rubygems/commit/2f46289bd3
* [Bug #19584] Register global variables before assignmentNobuyoshi Nakada2023-04-071-3/+3
|
* Load only SyntaxSuggest::VERSION for version checkHiroshi SHIBATA2023-04-061-1/+1
|