mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@4f59d86
This commit is contained in:
parent
342fbae83c
commit
148961adcd
47 changed files with 725 additions and 61 deletions
|
@ -796,3 +796,32 @@ describe 'Local variable shadowing' do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'Allowed characters' do
|
||||
ruby_version_is "2.6" do
|
||||
# new feature in 2.6 -- https://bugs.ruby-lang.org/issues/13770
|
||||
it 'does not allow non-ASCII upcased characters at the beginning' do
|
||||
-> do
|
||||
eval <<-CODE
|
||||
def test
|
||||
ἍBB = 1
|
||||
end
|
||||
CODE
|
||||
end.should raise_error(SyntaxError, /dynamic constant assignment/)
|
||||
end
|
||||
end
|
||||
|
||||
it 'allows non-ASCII lowercased characters at the beginning' do
|
||||
result = nil
|
||||
|
||||
eval <<-CODE
|
||||
def test
|
||||
μ = 1
|
||||
end
|
||||
|
||||
result = test
|
||||
CODE
|
||||
|
||||
result.should == 1
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue