1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Assoc pattern matching (#3703)

[Feature #17260] One-line pattern matching using tASSOC

R-assignment is rejected instead.
This commit is contained in:
Nobuyoshi Nakada 2020-10-26 18:00:24 +09:00 committed by GitHub
parent cffdacb15a
commit 52c630da00
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
Notes: git 2020-10-26 18:00:56 +09:00
Merged-By: nobu <nobu@ruby-lang.org>
8 changed files with 37 additions and 65 deletions

View file

@ -68,13 +68,13 @@ describe "Processing RUBYOPT" do
it "suppresses experimental warnings for '-W:no-experimental'" do
ENV["RUBYOPT"] = '-W:no-experimental'
result = ruby_exe('0 in a', args: '2>&1')
result = ruby_exe('case 0; in a; end', args: '2>&1')
result.should == ""
end
it "suppresses deprecation and experimental warnings for '-W:no-deprecated -W:no-experimental'" do
ENV["RUBYOPT"] = '-W:no-deprecated -W:no-experimental'
result = ruby_exe('($; = "") in a', args: '2>&1')
result = ruby_exe('case ($; = ""); in a; end', args: '2>&1')
result.should == ""
end
end