1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
This commit is contained in:
Benoit Daloze 2020-10-24 15:52:37 +02:00
parent 342fbae83c
commit 148961adcd
47 changed files with 725 additions and 61 deletions

View file

@ -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