fix module handling at ruby level

Was returning arrays instead of Statements, which messed things up
This commit is contained in:
2019-09-06 21:00:37 +03:00
parent 646797301e
commit 363d1cb36f
5 changed files with 29 additions and 13 deletions

View File

@ -4,11 +4,14 @@ module Ruby
class ModuleNameTest < Minitest::Test
include RubyTests
def test_parfait_module
assert_equal [nil], compile("module Parfait ; end")
def test_parfait_module_scoped
lst = compile("module Parfait ; 1 ; 1 ; end")
assert_equal ScopeStatement, lst.class
assert_equal IntegerConstant, lst.first.class
assert_equal 2, lst.length
end
def test_parfait_module_const
assert_equal IntegerConstant, compile("module Parfait ; 1;end").first.class
assert_equal IntegerConstant, compile("module Parfait ; 1;end").class
end
def test_module_parfait_removed