Torsten Rüger
0725f02e9a
start at Object get_interna_word using the pattern to replace the whole risc method with a single mom instruction. Copying the original risc code into the instrucitons to_risc also adding some very basic tests
25 lines
601 B
Ruby
25 lines
601 B
Ruby
require_relative "helper"
|
|
|
|
module Risc
|
|
module Builtin
|
|
class TestObjectFunction1 < BootTest
|
|
def setup
|
|
super
|
|
@method = get_compiler(:get_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 20 , @method.to_risc.risc_instructions.length
|
|
end
|
|
end
|
|
end
|
|
end
|