transformed object builtins
This commit is contained in:
@ -2,7 +2,7 @@ require_relative "helper"
|
||||
|
||||
module Risc
|
||||
module Builtin
|
||||
class TestObjectFunction1 < BootTest
|
||||
class TestObjectFunctionGet < BootTest
|
||||
def setup
|
||||
super
|
||||
@method = get_compiler(:get_internal_word)
|
||||
@ -20,5 +20,77 @@ module Risc
|
||||
assert_equal 20 , @method.to_risc.risc_instructions.length
|
||||
end
|
||||
end
|
||||
class TestObjectFunctionSet < BootTest
|
||||
def setup
|
||||
super
|
||||
@method = get_compiler(:set_internal_word)
|
||||
end
|
||||
def test_has_get_internal
|
||||
assert_equal Mom::MethodCompiler , @method.class
|
||||
end
|
||||
def test_mom_length
|
||||
assert_equal 5 , @method.mom_instructions.length
|
||||
end
|
||||
def test_compile
|
||||
assert_equal Risc::MethodCompiler , @method.to_risc.class
|
||||
end
|
||||
def test_risc_length
|
||||
assert_equal 21 , @method.to_risc.risc_instructions.length
|
||||
end
|
||||
end
|
||||
class TestObjectFunctionMissing < BootTest
|
||||
def setup
|
||||
super
|
||||
@method = get_compiler(:method_missing)
|
||||
end
|
||||
def test_has_get_internal
|
||||
assert_equal Mom::MethodCompiler , @method.class
|
||||
end
|
||||
def test_mom_length
|
||||
assert_equal 5 , @method.mom_instructions.length
|
||||
end
|
||||
def test_compile
|
||||
assert_equal Risc::MethodCompiler , @method.to_risc.class
|
||||
end
|
||||
def test_risc_length
|
||||
assert_equal 48 , @method.to_risc.risc_instructions.length
|
||||
end
|
||||
end
|
||||
class TestObjectFunctionExit < BootTest
|
||||
def setup
|
||||
super
|
||||
@method = get_compiler(:exit)
|
||||
end
|
||||
def test_has_get_internal
|
||||
assert_equal Mom::MethodCompiler , @method.class
|
||||
end
|
||||
def test_mom_length
|
||||
assert_equal 5 , @method.mom_instructions.length
|
||||
end
|
||||
def test_compile
|
||||
assert_equal Risc::MethodCompiler , @method.to_risc.class
|
||||
end
|
||||
def test_risc_length
|
||||
assert_equal 46 , @method.to_risc.risc_instructions.length
|
||||
end
|
||||
end
|
||||
class TestObjectFunctionInit < BootTest
|
||||
def setup
|
||||
super
|
||||
@method = get_compiler(:__init__)
|
||||
end
|
||||
def test_has_get_internal
|
||||
assert_equal Mom::MethodCompiler , @method.class
|
||||
end
|
||||
def test_mom_length
|
||||
assert_equal 5 , @method.mom_instructions.length
|
||||
end
|
||||
def test_compile
|
||||
assert_equal Risc::MethodCompiler , @method.to_risc.class
|
||||
end
|
||||
def test_risc_length
|
||||
assert_equal 48 , @method.to_risc.risc_instructions.length
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -14,7 +14,7 @@ module Risc
|
||||
assert_equal Array, @functions.class
|
||||
end
|
||||
def test_boot_function_length
|
||||
assert_equal 2, @functions.length
|
||||
assert_equal 6, @functions.length
|
||||
end
|
||||
def test_boot_function_first
|
||||
assert_equal Mom::MethodCompiler, @functions.first.class
|
||||
|
Reference in New Issue
Block a user