summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2020-01-06script_compiled event on compile error.Koichi Sasada
script_compiled event for TracePoint should not be invoked on compile error (SyntaxError) because it is not "compiled". [Bug #16459]
2020-01-06Complete indented and quoted string correctlyaycabta
def foo ''.upca[TAB] This will be completed to be: def foo ''.upcase The indent was gone. This commit fixes the bug.
2020-01-03Call initialize_clone with freeze: false if clone called with freeze: falseJeremy Evans
This makes it possible to initialize_clone to correctly not freeze internal state if the freeze: false keyword is passed to clone. If clone is called with freeze: true or no keyword, do not pass a second argument to initialize_clone to keep backwards compatibility. This makes it so that external libraries that override initialize_clone but do not support the freeze keyword will fail with ArgumentError if passing freeze: false to clone. I think that is better than the current behavior, which succeeds but results in an unfrozen object with frozen internals. Fix related issues in set and delegate in stdlib. Fixes [Bug #14266] Notes: Merged: https://github.com/ruby/ruby/pull/2816
2020-01-03Make eval(code, binding) use (eval) as __FILE__ and 1 as __LINE__Jeremy Evans
This removes the warning that was added in 3802fb92ff8c83eed3e867db20f72c53932f542d, and switches the behavior so that the eval does not use the binding's __FILE__ and __LINE__ implicitly. Fixes [Bug #4352] Notes: Merged: https://github.com/ruby/ruby/pull/2816
2020-01-02Update tests for full keyword argument separationJeremy Evans
Notes: Merged: https://github.com/ruby/ruby/pull/2794
2020-01-02Fully separate positional arguments and keyword argumentsJeremy Evans
This removes the warnings added in 2.7, and changes the behavior so that a final positional hash is not treated as keywords or vice-versa. To handle the arg_setup_block splat case correctly with keyword arguments, we need to check if we are taking a keyword hash. That case didn't have a test, but it affects real-world code, so add a test for it. This removes rb_empty_keyword_given_p() and related code, as that is not needed in Ruby 3. The empty keyword case is the same as the no keyword case in Ruby 3. This changes rb_scan_args to implement keyword argument separation for C functions when the : character is used. For backwards compatibility, it returns a duped hash. This is a bad idea for performance, but not duping the hash breaks at least Enumerator::ArithmeticSequence#inspect. Instead of having RB_PASS_CALLED_KEYWORDS be a number, simplify the code by just making it be rb_keyword_given_p(). Notes: Merged: https://github.com/ruby/ruby/pull/2794
2020-01-02Check Module#ruby2_keywords arityNobuyoshi Nakada
It is considered a mistake, because calling this method with no arguments has no effect. Notes: Merged: https://github.com/ruby/ruby/pull/2806
2020-01-01Add load path and require for ruby/rubyaycabta
2020-01-01[ruby/irb] Fix lib name of OpenStructaycabta
https://github.com/ruby/irb/commit/1f3a84ab6b
2019-12-31Add "require 'openstruct'" what is forgottenaycabta
2019-12-31[ruby/irb] Add tests for RubyLexBen
The set_auto_indent method calculates the correct number of spaces for indenting a line. We think there might be a few bugs in this method so we are testing the current functionality to make sure nothing breaks when we address those bugs. Example test failure: ``` 1) Failure: TestIRB::TestRubyLex#test_auto_indent [/Users/Ben/Projects/irb/test/irb/test_ruby_lex.rb:75]: Calculated the wrong number of spaces for: def each_top_level_statement initialize_input catch(:TERM_INPUT) do loop do begin prompt unless l = lex throw :TERM_INPUT if @line == '' else . <10> expected but was <12>. ``` https://github.com/ruby/irb/commit/752d5597ab
2019-12-31Split test_nomethod_error.rbNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/2800
2019-12-31Split test_name_error.rbNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/2800
2019-12-31Split test_frozen_error.rbNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/2800
2019-12-31Fix the exception to be raisedNobuyoshi Nakada
`NoMethodError` has been raised instead of `FrozenError`. Notes: Merged: https://github.com/ruby/ruby/pull/2800
2019-12-31text/readline/test_readline.rb - fix skip on Reline (#2743)MSP-Greg
TestRelineAsReadline#test_input_metachar passes on MinGW
2019-12-30MinGW on Actions (#2791)MSP-Greg
* MinGW - skip spec in spec/ruby/optional/capi/thread_spec.rb C-API Thread function rb_thread_call_without_gvl -- runs a C function with the global lock unlocked and unlocks IO with the generic RUBY_UBF_IO stops/freezes spec tests See https://bugs.ruby-lang.org/issues/16265 * MinGW - skip test test/resolv/test_dns.rb Test times out in CI (both AppVeyor & Actions), cannot repo locally * MinGW - skip test test/ruby/test_thread_queue.rb * Add Actions mingw.yml
2019-12-30Decide lambdaness of (f << g) using g (#2729)Alan Wu
* Deciding lambdaness of (f << g) using g * Use version guards for spec changes Notes: Merged-By: XrXr
2019-12-29[ruby/io-console] Enable only interrupt bits on `intr: true`Nobuyoshi Nakada
https://github.com/ruby/io-console/commit/baaf929041
2019-12-27Add test_completion_with_indent_and_completer_quote_charactersaycabta
This is for 8a705245e55575d4d310a2e956b89a36a5931971.
2019-12-26Transform hash keys by a hash [Feature #16274]Nobuyoshi Nakada
2019-12-25range.c: Range#min with a beginless one now raise an explicit exceptionYusuke Endoh
[Bug #16450]
2019-12-25^D on non-empty line in vi mode behaves like Enteraycabta
2019-12-24Scale sleeping times to wait for the OS operationsNobuyoshi Nakada
2019-12-24The delete-char-or-list shows completed list when called at end of lineaycabta
It doesn't behave the same as the delete-char.
2019-12-24Synchronize with a Queue instead of sleepingNobuyoshi Nakada
2019-12-24Revert "Scale sleeping times"Koichi Sasada
This reverts commit e57d6194218efc73c30f3fed9dd321d2e357030b. Test fails: http://ci.rvm.jp/results/trunk-gc-asserts@ruby-sky1/2518563 http://ci.rvm.jp/results/trunk-gc_compact@silicon-docker/2518533
2019-12-24Scale sleeping timesNobuyoshi Nakada
2019-12-24Get rid of false positive misspellingsNobuyoshi Nakada
[Bug #16437]
2019-12-24[ruby/rdoc] Support newline in the middle of constant definitionaycabta
https://github.com/ruby/rdoc/commit/74d3984324
2019-12-24[ruby/rdoc] Treat Proc#call syntax sugar for constant correctlyaycabta
https://github.com/ruby/rdoc/commit/957d041ae0
2019-12-23Reword keyword arguments warning messages to convey these are deprecation ↵Marc-Andre Lafortune
warnings
2019-12-23ObjectSpace._id2ref should check liveness.Koichi Sasada
objspace->id_to_obj_tbl can contain died objects because of lazy sweep, so that it should check liveness.
2019-12-23Port ↵Yuki Nishijima
https://github.com/ruby/did_you_mean/commit/dd1dd86e6c3188c36224d5dd4389676e6653a727
2019-12-23Revert "Should return "." for File.extname("file.") also on Windows"NAKAMURA Usaku
We want to introduce consistency and better compatibility with unixen, but the Windows APIs doues not have consistency fundamentally and we can not found any logical way... This reverts commit 61aff0cd189e67fa6f2565639ad0128fa33b88fc.
2019-12-22fix a thread test.Koichi Sasada
* Use Queue for synchronization. * Don't use `sleep 0.2` and use `th.join` because created thread can raise an exception after 0.2 seconds.
2019-12-22compile.c: avoid newarraykwsplat for argumentsv2_7_0_rc2Yusuke Endoh
`foo(*rest, post, **empty_kw)` is compiled like `foo(*rest + [post, **empty_kw])`, and `**empty_kw` is removed by "newarraykwsplat" instruction. However, the method call still has a flag of KW_SPLAT, so "post" is considered as a keyword hash, which caused a segfault. Note that the flag cannot be removed if "empty_kw" is not always empty. This change fixes the issue by compiling arguments with "newarray" instead of "newarraykwsplat". [Bug #16442]
2019-12-22Should return "." for File.extname("file.") also on WindowsNAKAMURA Usaku
But not changes another cases, such as "file.rb." [Bug #15267]
2019-12-21Kernel#lambda: return forwarded block as non-lambda procAlan Wu
Before this commit, Kernel#lambda can't tell the difference between a directly passed literal block and one passed with an ampersand. A block passed with an ampersand is semantically speaking already a non-lambda proc. When Kernel#lambda receives a non-lambda proc, it should simply return it. Implementation wise, when the VM calls a method with a literal block, it places the code for the block on the calling control frame and passes a pointer (block handler) to the callee. Before this commit, the VM forwards block arguments by simply forwarding the block handler, which leaves the slot for block code unused when a control frame forwards its block argument. I use the vacant space to indicate that a frame has forwarded its block argument and inspect that in Kernel#lambda to detect forwarded blocks. This is a very ad-hoc solution and relies *heavily* on the way block passing works in the VM. However, it's the most self-contained solution I have. [Bug #15620] Notes: Merged: https://github.com/ruby/ruby/pull/2289
2019-12-21test/ruby/test_pattern_matching.rb: suppress "unused variable" warningYusuke Endoh
2019-12-20Added `-W:experimental` command line optionNobuyoshi Nakada
[Feature #16420]
2019-12-20Added `experimental` warning categoryNobuyoshi Nakada
[Feature #16420]
2019-12-20Added -W: command line optionNobuyoshi Nakada
To manage `Warning[category]` flags. Only `-W:deprecated` and `-W:no-deprecated` are available now. [Feature #16345]
2019-12-20vm_args.c: rephrase the warning message of keyword argument separationYusuke Endoh
(old) test.rb:4: warning: The last argument is used as the keyword parameter test.rb:1: warning: for `foo' defined here; maybe ** should be added to the call? (new) test.rb:4: warning: The last argument is used as keyword parameters; maybe ** should be added to the call test.rb:1: warning: The called method `foo' is defined here
2019-12-20Refined the warning message for $, and $;Nobuyoshi Nakada
[Bug #16438]
2019-12-20Refined the warning message for numbered-parameter like variablesNobuyoshi Nakada
[Bug #16438]
2019-12-20Refined the warning message for numbered-parameter like variablesNobuyoshi Nakada
[Bug #16438]
2019-12-20Makes the receiver to FrozenError.new a keyword parameterNobuyoshi Nakada
[Feature #16419]
2019-12-20Fixed misspellingsNobuyoshi Nakada
Fixed misspellings reported at [Bug #16437], for default gems.
2019-12-20Merge RubyGems 3.1.2Hiroshi SHIBATA