2019-09-06 12:59:33 +02:00
|
|
|
require_relative "helper"
|
|
|
|
|
|
|
|
module Ruby
|
|
|
|
class ModuleNameTest < Minitest::Test
|
|
|
|
include RubyTests
|
|
|
|
|
2019-09-06 20:00:37 +02:00
|
|
|
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
|
2019-09-06 12:59:33 +02:00
|
|
|
end
|
|
|
|
def test_parfait_module_const
|
2019-09-06 20:00:37 +02:00
|
|
|
assert_equal IntegerConstant, compile("module Parfait ; 1;end").class
|
2019-09-06 12:59:33 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
def test_module_parfait_removed
|
|
|
|
exp = compile( "::Parfait::Object" )
|
|
|
|
assert_equal ModuleName , exp.class
|
|
|
|
assert_equal :Object , exp.name
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|