diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2016-12-10 16:02:47 +0900 |
|---|---|---|
| committer | GitHub <[email protected]> | 2016-12-10 16:02:47 +0900 |
| commit | 3cc913490b708fe4d0e78e48f86e6e39cf3d8576 (patch) | |
| tree | 90cac9474b018643579c88d8280950ec2d995524 /mrbgems/mruby-bin-mruby/bintest | |
| parent | d93422315cceb4fbe0fcb17d070f329518343e49 (diff) | |
| parent | f7a891fa8979bdb82410e1adc98765013cc29a79 (diff) | |
| download | mruby-3cc913490b708fe4d0e78e48f86e6e39cf3d8576.tar.gz mruby-3cc913490b708fe4d0e78e48f86e6e39cf3d8576.zip | |
Merge pull request #3329 from bouk/reuse
Mark all the built-in classes during GC sweep
Diffstat (limited to 'mrbgems/mruby-bin-mruby/bintest')
| -rw-r--r-- | mrbgems/mruby-bin-mruby/bintest/mruby.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/mrbgems/mruby-bin-mruby/bintest/mruby.rb b/mrbgems/mruby-bin-mruby/bintest/mruby.rb index 01fc94632..ad8ec3a0f 100644 --- a/mrbgems/mruby-bin-mruby/bintest/mruby.rb +++ b/mrbgems/mruby-bin-mruby/bintest/mruby.rb @@ -44,3 +44,17 @@ EOS script.flush assert_equal "\"test\"\n\"fin\"\n", `#{cmd('mruby')} #{script.path}` end + +assert('garbage collecting built-in classes') do + script = Tempfile.new('test.rb') + + script.write <<RUBY +NilClass = nil +GC.start +Array.dup +print nil.class.name +RUBY + script.flush + assert_equal "NilClass", `#{cmd('mruby')} #{script.path}` + assert_equal 0, $?.exitstatus +end |
