2018-06-30 18:20:17 +02:00
|
|
|
|
|
|
|
require_relative "helper"
|
|
|
|
|
|
|
|
module Vool
|
|
|
|
class TestClassStatement < MiniTest::Test
|
|
|
|
include MomCompile
|
|
|
|
|
|
|
|
def setup
|
|
|
|
Parfait.boot!
|
2018-07-01 10:59:52 +02:00
|
|
|
@ret = compile_mom( "class Test ; def main(); return 1; end; end;")
|
2018-06-30 18:20:17 +02:00
|
|
|
end
|
|
|
|
|
2018-07-01 10:59:52 +02:00
|
|
|
def test_return_class
|
2018-07-01 20:26:45 +02:00
|
|
|
assert_equal Mom::MomCompiler , @ret.class
|
2018-07-01 10:59:52 +02:00
|
|
|
end
|
|
|
|
def test_has_compilers
|
|
|
|
assert_equal Risc::MethodCompiler , @ret.method_compilers.first.class
|
2018-06-30 18:20:17 +02:00
|
|
|
end
|
2018-07-01 20:51:48 +02:00
|
|
|
|
|
|
|
def test_constant
|
|
|
|
assert @ret.method_compilers.first.add_constant( Parfait::Integer.new(5) )
|
|
|
|
end
|
|
|
|
|
2018-06-30 18:20:17 +02:00
|
|
|
end
|
|
|
|
end
|