first steps to defining specialised slot classes
getting rid of the mess in SlotDefinition (wip)
This commit is contained in:
@ -3,7 +3,7 @@ require_relative "helper"
|
||||
module SlotMachine
|
||||
class TestArgumentTransfer < SlotMachineInstructionTest
|
||||
def instruction
|
||||
receiver = SlotDefinition.new(:message , [:receiver])
|
||||
receiver = MessageDefinition.new( [:receiver])
|
||||
arg = SlotLoad.new("test", [:message, :caller] , [:message,:type] )
|
||||
ArgumentTransfer.new("" , receiver ,[arg])
|
||||
end
|
||||
|
@ -3,7 +3,7 @@ require_relative "helper"
|
||||
module SlotMachine
|
||||
class TestNotSameCheck < SlotMachineInstructionTest
|
||||
def instruction
|
||||
target = SlotDefinition.new(:message , :caller)
|
||||
target = SlotDefinition.for(:message , :caller)
|
||||
NotSameCheck.new(target , target , Label.new("ok" , "target"))
|
||||
end
|
||||
def test_len
|
||||
|
@ -4,7 +4,7 @@ module SlotMachine
|
||||
class TestSlotDefinitionBasics < MiniTest::Test
|
||||
|
||||
def slot(slot = :caller)
|
||||
SlotDefinition.new(:message , slot)
|
||||
MessageDefinition.new(slot)
|
||||
end
|
||||
def test_create_ok1
|
||||
assert_equal :message , slot.known_object
|
||||
|
@ -6,7 +6,7 @@ module SlotMachine
|
||||
def setup
|
||||
Parfait.boot!(Parfait.default_test_options)
|
||||
@compiler = Risc::FakeCompiler.new
|
||||
@definition = SlotDefinition.new(StringConstant.new("hi") , [])
|
||||
@definition = SlotDefinition.for(StringConstant.new("hi") , [])
|
||||
@register = @definition.to_register(@compiler , InstructionMock.new)
|
||||
@instruction = @compiler.instructions.first
|
||||
end
|
||||
@ -27,7 +27,7 @@ module SlotMachine
|
||||
def setup
|
||||
Parfait.boot!(Parfait.default_test_options)
|
||||
@compiler = Risc::FakeCompiler.new
|
||||
@definition = SlotDefinition.new(StringConstant.new("hi") , [:type])
|
||||
@definition = SlotDefinition.for(StringConstant.new("hi") , [:type])
|
||||
@register = @definition.to_register(@compiler , InstructionMock.new)
|
||||
@instruction = @compiler.instructions.first
|
||||
end
|
||||
|
@ -5,7 +5,7 @@ module SlotMachine
|
||||
def setup
|
||||
Parfait.boot!(Parfait.default_test_options)
|
||||
@compiler = Risc::FakeCompiler.new
|
||||
@definition = SlotDefinition.new(:message , :caller)
|
||||
@definition = MessageDefinition.new( :caller)
|
||||
@register = @definition.to_register(@compiler , "fake source")
|
||||
@instruction = @compiler.instructions.first
|
||||
end
|
||||
|
@ -5,7 +5,7 @@ module SlotMachine
|
||||
def setup
|
||||
Parfait.boot!(Parfait.default_test_options)
|
||||
@compiler = Risc::FakeCompiler.new
|
||||
@definition = SlotDefinition.new(:message , [:caller , :type])
|
||||
@definition = MessageDefinition.new( [:caller , :type])
|
||||
@register = @definition.to_register(@compiler , InstructionMock.new)
|
||||
end
|
||||
def test_def_next_class
|
||||
|
@ -3,7 +3,7 @@ require_relative "helper"
|
||||
module SlotMachine
|
||||
class TestSameCheck < SlotMachineInstructionTest
|
||||
def instruction
|
||||
target = SlotDefinition.new(:message , :caller)
|
||||
target = MessageDefinition.new( :caller)
|
||||
TruthCheck.new(target , Label.new("ok" , "target"))
|
||||
end
|
||||
def test_len
|
||||
|
Reference in New Issue
Block a user