refactor send vool tests
This commit is contained in:
parent
26fe77ed68
commit
08d0aae79e
@ -1,6 +1,15 @@
|
|||||||
|
require_relative "../helper"
|
||||||
|
|
||||||
module Vool
|
module Vool
|
||||||
# relies on @ins and receiver_type method
|
# relies on @ins and receiver_type method
|
||||||
module SimpleSendHarness
|
module SimpleSendHarness
|
||||||
|
include MomCompile
|
||||||
|
|
||||||
|
def setup
|
||||||
|
Risc.machine.boot
|
||||||
|
@ins = compile_first_method( send_method )
|
||||||
|
end
|
||||||
|
|
||||||
def test_compiles_not_array
|
def test_compiles_not_array
|
||||||
assert Array != @ins.class , @ins
|
assert Array != @ins.class , @ins
|
||||||
end
|
end
|
@ -1,18 +1,12 @@
|
|||||||
require_relative "../helper"
|
require_relative "helper"
|
||||||
require_relative "simple_send_harness"
|
|
||||||
|
|
||||||
module Vool
|
module Vool
|
||||||
class TestSendSelfMom < MiniTest::Test
|
class TestSendSelfMom < MiniTest::Test
|
||||||
include MomCompile
|
|
||||||
include SimpleSendHarness
|
include SimpleSendHarness
|
||||||
include Mom
|
include Mom
|
||||||
|
|
||||||
def do_setup(str)
|
def send_method
|
||||||
Risc.machine.boot
|
"self.get_internal_word(0)"
|
||||||
@ins = compile_first_method( str)
|
|
||||||
end
|
|
||||||
def setup
|
|
||||||
do_setup("self.get_internal_word(0)")
|
|
||||||
end
|
end
|
||||||
def test_receiver
|
def test_receiver
|
||||||
assert_equal SlotDefinition, @ins.next.receiver.class
|
assert_equal SlotDefinition, @ins.next.receiver.class
|
||||||
@ -32,8 +26,8 @@ module Vool
|
|||||||
end
|
end
|
||||||
class TestSendSelfImplicitMom < TestSendSelfMom
|
class TestSendSelfImplicitMom < TestSendSelfMom
|
||||||
|
|
||||||
def setup
|
def send_method
|
||||||
do_setup( "get_internal_word(0)")
|
"get_internal_word(0)"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -1,14 +1,11 @@
|
|||||||
require_relative "../helper"
|
require_relative "helper"
|
||||||
require_relative "simple_send_harness"
|
|
||||||
|
|
||||||
module Vool
|
module Vool
|
||||||
class TestSendSimpleMom < MiniTest::Test
|
class TestSendSimpleMom < MiniTest::Test
|
||||||
include MomCompile
|
|
||||||
include SimpleSendHarness
|
include SimpleSendHarness
|
||||||
|
|
||||||
def setup
|
def send_method
|
||||||
Risc.machine.boot
|
"5.div4"
|
||||||
@ins = compile_first_method( "5.div4")
|
|
||||||
end
|
end
|
||||||
def receiver
|
def receiver
|
||||||
[Mom::IntegerConstant , 5]
|
[Mom::IntegerConstant , 5]
|
||||||
|
@ -1,14 +1,11 @@
|
|||||||
require_relative "../helper"
|
require_relative "helper"
|
||||||
require_relative "simple_send_harness"
|
|
||||||
|
|
||||||
module Vool
|
module Vool
|
||||||
class TestSendSimpleArgsMom < MiniTest::Test
|
class TestSendSimpleArgsMom < MiniTest::Test
|
||||||
include MomCompile
|
|
||||||
include SimpleSendHarness
|
include SimpleSendHarness
|
||||||
|
|
||||||
def setup
|
def send_method
|
||||||
Risc.machine.boot
|
"5.div4(1,2)"
|
||||||
@ins = compile_first_method( "5.div4(1,2)")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def receiver
|
def receiver
|
||||||
|
@ -1,14 +1,11 @@
|
|||||||
require_relative "../helper"
|
require_relative "helper"
|
||||||
require_relative "simple_send_harness"
|
|
||||||
|
|
||||||
module Vool
|
module Vool
|
||||||
class TestSendSimpleStringArgsMom < MiniTest::Test
|
class TestSendSimpleStringArgsMom < MiniTest::Test
|
||||||
include MomCompile
|
|
||||||
include SimpleSendHarness
|
include SimpleSendHarness
|
||||||
|
|
||||||
def setup
|
def send_method
|
||||||
Risc.machine.boot
|
"'5'.get_internal_byte(1)"
|
||||||
@ins = compile_first_method( "'5'.get_internal_byte(1)")
|
|
||||||
end
|
end
|
||||||
def receiver
|
def receiver
|
||||||
[Mom::StringConstant , "5"]
|
[Mom::StringConstant , "5"]
|
||||||
|
Loading…
Reference in New Issue
Block a user