Fix comparison bug
Unchanged high level test, ohh how great is testing
This commit is contained in:
parent
f03f445652
commit
fea98979e8
@ -32,7 +32,7 @@ module SlotMachine
|
||||
left.op :- , right
|
||||
end
|
||||
if_minus false_label
|
||||
if_not_zero( false_label ) if operator.to_s.length == 1
|
||||
if_zero( false_label ) if operator.to_s.length == 1
|
||||
add_code Risc::LoadConstant.new(to_s , Parfait.object_space.true_object, result)
|
||||
branch merge_label
|
||||
add_code false_label
|
||||
|
@ -32,7 +32,6 @@ module Risc
|
||||
run_main_return "5 > 5"
|
||||
assert_equal Parfait::FalseClass , get_message_return.class
|
||||
end
|
||||
|
||||
def test_smaller_or_true
|
||||
run_main_return "4 <= 5"
|
||||
assert_equal Parfait::TrueClass , get_message_return.class
|
||||
|
@ -38,7 +38,7 @@ module SlotMachine
|
||||
assert_slot_to_reg 4 , "message.arg1" , 2 , "message.arg1.data_1"
|
||||
assert_operator 5 , :- , "message.receiver.data_1" , "message.arg1.data_1" ,"op_-_"
|
||||
assert_minus 6 , "false_label_"
|
||||
assert_not_zero 7 , "false_label_"
|
||||
assert_zero 7 , "false_label_"
|
||||
assert_load 8 , Parfait::TrueClass , :result
|
||||
assert_branch 9 , "merge_label_"
|
||||
assert_label 10 , "false_label_"
|
||||
|
Loading…
x
Reference in New Issue
Block a user