diff options
| author | KOBAYASHI Shuji <[email protected]> | 2019-04-23 20:45:38 +0900 |
|---|---|---|
| committer | KOBAYASHI Shuji <[email protected]> | 2019-04-23 20:45:38 +0900 |
| commit | cc7f9190ba93ef45bf85a7278dffe6326cf620a3 (patch) | |
| tree | eeec7f6fa7152d8a04d8e401c44e9e825774498d /test/t/module.rb | |
| parent | 7cf1bc39a7184e92b0fe534e610b288accc61e5a (diff) | |
| download | mruby-cc7f9190ba93ef45bf85a7278dffe6326cf620a3.tar.gz mruby-cc7f9190ba93ef45bf85a7278dffe6326cf620a3.zip | |
Fix name assignment to frozen anonymous class/module
Fix the following issues:
A = Class.new.freeze #=> FrozenError
Module.new::B = Class.new.freeze #=> FrozenError
String::B = Module.new.freeze #=> FrozenError
Diffstat (limited to 'test/t/module.rb')
| -rw-r--r-- | test/t/module.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/t/module.rb b/test/t/module.rb index 09613e1bc..f4999019a 100644 --- a/test/t/module.rb +++ b/test/t/module.rb @@ -653,6 +653,10 @@ assert('Module#to_s') do assert_match "#<Module:0x*>", Module.new.to_s assert_match "#<Class:0x*>", Class.new.to_s + + assert_equal "FrozenClassToS", (FrozenClassToS = Class.new.freeze).to_s + assert_equal "Outer::A", (Outer::A = Module.new.freeze).to_s + assert_match "#<Module:0x*>::A", (Module.new::A = Class.new.freeze).to_s end assert('Module#inspect') do |
