diff options
| author | Narihiro Nakamura <[email protected]> | 2013-01-07 12:06:32 +0900 |
|---|---|---|
| committer | Narihiro Nakamura <[email protected]> | 2013-01-07 16:31:42 +0900 |
| commit | f7c6d8acc8111312e9f57d2e145509c690ec13aa (patch) | |
| tree | b8cf5cc239ab11ad17285278904900bf4eae79d1 /test | |
| parent | 4258d7735beec9252bf6cb282fb704cb2cbe9ce9 (diff) | |
| download | mruby-f7c6d8acc8111312e9f57d2e145509c690ec13aa.tar.gz mruby-f7c6d8acc8111312e9f57d2e145509c690ec13aa.zip | |
add test cases for GC API
Diffstat (limited to 'test')
| -rw-r--r-- | test/t/gc.rb | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/test/t/gc.rb b/test/t/gc.rb new file mode 100644 index 000000000..410272797 --- /dev/null +++ b/test/t/gc.rb @@ -0,0 +1,45 @@ +# Not ISO specified + +assert('GC.enable') do + GC.disable == false + GC.enable == true + GC.enable == false +end + +assert('GC.disable') do + begin + GC.disable == false + GC.disable == true + ensure + GC.enable + end +end + +assert('GC.interval_ratio=') do + origin = GC.interval_ratio + begin + (GC.interval_ratio = 150) == 150 + ensure + GC.interval_ratio = origin + end +end + +assert('GC.step_ratio=') do + origin = GC.step_ratio + begin + (GC.step_ratio = 150) == 150 + ensure + GC.step_ratio = origin + end +end + +assert('GC.generational_mode=') do + origin = GC.generational_mode + begin + (GC.generational_mode = false) == false + (GC.generational_mode = true) == true + (GC.generational_mode = true) == true + ensure + GC.generational_mode = origin + end +end |
