remove unused methods
and a whole lot more index fixes
This commit is contained in:
@ -57,40 +57,40 @@ module Parfait
|
||||
end
|
||||
|
||||
def test_local1
|
||||
assert_equal 2 , @method.frame_length , @method.frame_type.inspect
|
||||
assert_equal 3 , @method.frame_type.get_length , @method.frame_type.inspect
|
||||
assert_equal Symbol , @method.frame_type.names.first.class
|
||||
assert_equal :local_bar , @method.locals_name(0)
|
||||
assert_equal :local_bar , @method.frame_type.name_at(1)
|
||||
end
|
||||
|
||||
def test_has_local
|
||||
assert_equal 0 , @method.has_local(:local_bar)
|
||||
assert_equal 1 , @method.has_local(:local_foo)
|
||||
assert_equal 1 , @method.has_local(:local_bar)
|
||||
assert_equal 2 , @method.has_local(:local_foo)
|
||||
end
|
||||
|
||||
def test_add_local
|
||||
@method.add_local(:foo2 , :Object)
|
||||
assert_equal 3 , @method.frame_length
|
||||
assert_equal :foo2 , @method.locals_name(2)
|
||||
assert_equal :Object , @method.locals_type(2)
|
||||
assert_equal 4 , @method.frame_type.get_length
|
||||
assert_equal :foo2 , @method.frame_type.name_at(3)
|
||||
assert_equal :Object , @method.frame_type.type_at(3)
|
||||
end
|
||||
|
||||
def test_get_locals_name1
|
||||
index = @method.has_local(:local_bar)
|
||||
assert_equal 0 , index
|
||||
assert_equal :local_bar , @method.locals_name(index)
|
||||
assert_equal 1 , index
|
||||
assert_equal :local_bar , @method.frame_type.name_at(index)
|
||||
end
|
||||
def test_get_frame_type1
|
||||
index = @method.has_local(:local_bar)
|
||||
assert_equal :Integer , @method.locals_type(index)
|
||||
assert_equal :Integer , @method.frame_type.type_at(index)
|
||||
end
|
||||
def test_get_locals_name2
|
||||
index = @method.has_local(:local_foo)
|
||||
assert_equal 1 , index
|
||||
assert_equal :local_foo , @method.locals_name(index)
|
||||
assert_equal 2 , index
|
||||
assert_equal :local_foo , @method.frame_type.name_at(index)
|
||||
end
|
||||
def test_get_frame_type2
|
||||
index = @method.has_local(:local_bar)
|
||||
assert_equal :Integer , @method.locals_type(index)
|
||||
assert_equal :Integer , @method.frame_type.type_at(index)
|
||||
end
|
||||
def test_created_with_binary
|
||||
assert @method.binary
|
||||
|
@ -37,21 +37,21 @@ module Risc
|
||||
sl = main_ticks( 31 )
|
||||
assert_equal SlotToReg , sl.class
|
||||
assert_equal :r0 , sl.array.symbol #load from message
|
||||
assert_equal 3 , sl.index
|
||||
assert_equal 2 , sl.index
|
||||
assert_equal :r1 , sl.register.symbol
|
||||
end
|
||||
def test_slot_args #load args from message
|
||||
sl = main_ticks( 32 )
|
||||
assert_equal SlotToReg , sl.class
|
||||
assert_equal :r0 , sl.array.symbol #load from message
|
||||
assert_equal 9 , sl.index
|
||||
assert_equal 8 , sl.index
|
||||
assert_equal :r2 , sl.register.symbol
|
||||
end
|
||||
def test_slot_arg #load arg 1, destructively from args
|
||||
sl = main_ticks( 33 )
|
||||
assert_equal SlotToReg , sl.class
|
||||
assert_equal :r2 , sl.array.symbol #load from message
|
||||
assert_equal 2 , sl.index
|
||||
assert_equal 1 , sl.index
|
||||
assert_equal :r2 , sl.register.symbol
|
||||
end
|
||||
def test_slot_int1 #load int from object
|
||||
@ -79,7 +79,7 @@ module Risc
|
||||
sl = main_ticks(38)
|
||||
assert_equal SlotToReg , sl.class
|
||||
assert_equal :r3 , sl.array.symbol #load from space
|
||||
assert_equal 5 , sl.index
|
||||
assert_equal 4 , sl.index
|
||||
assert_equal :r2 , sl.register.symbol
|
||||
assert_equal Parfait::Integer , @interpreter.get_register(:r2).class
|
||||
end
|
||||
@ -87,7 +87,7 @@ module Risc
|
||||
sl = main_ticks(39)
|
||||
assert_equal SlotToReg , sl.class
|
||||
assert_equal :r2 , sl.array.symbol #load from next_int
|
||||
assert_equal 2 , sl.index
|
||||
assert_equal 1 , sl.index
|
||||
assert_equal :r4 , sl.register.symbol
|
||||
assert_equal Parfait::Integer , @interpreter.get_register(:r4).class
|
||||
end
|
||||
@ -95,7 +95,7 @@ module Risc
|
||||
sl = main_ticks(40)
|
||||
assert_equal RegToSlot , sl.class
|
||||
assert_equal :r3 , sl.array.symbol #store to space
|
||||
assert_equal 5 , sl.index
|
||||
assert_equal 4 , sl.index
|
||||
assert_equal :r4 , sl.register.symbol
|
||||
end
|
||||
def test_sys
|
||||
|
@ -27,7 +27,7 @@ module Vool
|
||||
left = @ins.next(1).arguments[0].left
|
||||
assert_equal Symbol, left.known_object.class
|
||||
assert_equal :message, left.known_object
|
||||
assert_equal [:next_message, :arguments, 2], left.slots
|
||||
assert_equal [:next_message, :arguments, 1], left.slots
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -18,7 +18,7 @@ module Vool
|
||||
def test_args_one_str
|
||||
assert_equal Mom::IntegerConstant, @ins.next.arguments[0].right.known_object.class
|
||||
assert_equal 1, @ins.next.arguments[0].right.known_object.value
|
||||
assert_equal [:next_message, :arguments, 2], @ins.next.arguments[0].left.slots
|
||||
assert_equal [:next_message, :arguments, 1], @ins.next.arguments[0].left.slots
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user