diff --git a/test/parfait/test_all.rb b/test/parfait/test_all.rb index 718e2ad6..5d9e88fd 100644 --- a/test/parfait/test_all.rb +++ b/test/parfait/test_all.rb @@ -1,10 +1,10 @@ require_relative "test_attributes" require_relative "test_class" require_relative "test_dictionary" -require_relative "test_named_list" require_relative "test_list" require_relative "test_message" -require_relative "test_typed_method" +require_relative "test_named_list" require_relative "test_object" require_relative "test_space" +require_relative "test_typed_method" require_relative "test_word" diff --git a/test/risc/interpreter/test_all.rb b/test/risc/interpreter/test_all.rb index 64c60c33..ea08fe74 100644 --- a/test/risc/interpreter/test_all.rb +++ b/test/risc/interpreter/test_all.rb @@ -1,9 +1,9 @@ require_relative "test_add" -require_relative "test_change" require_relative "test_byte_to_reg" require_relative "test_called_if" -require_relative "test_simple_if" -require_relative "test_puts" -require_relative "test_plus" +require_relative "test_change" require_relative "test_mult" +require_relative "test_plus" +require_relative "test_puts" require_relative "test_reg_to_byte" +require_relative "test_simple_if" diff --git a/test/rubyx/passes/test_all.rb b/test/rubyx/passes/test_all.rb index e0604a89..b20d9efd 100644 --- a/test/rubyx/passes/test_all.rb +++ b/test/rubyx/passes/test_all.rb @@ -1,3 +1,4 @@ -require_relative "test_type_collector" -require_relative "test_method_collector" require_relative "test_locals_collector" +require_relative "test_method_collector" +require_relative "test_normalizer" +require_relative "test_type_collector" diff --git a/test/rubyx/test_all.rb b/test/rubyx/test_all.rb index e6dcf3f7..d614f0aa 100644 --- a/test/rubyx/test_all.rb +++ b/test/rubyx/test_all.rb @@ -1,4 +1,4 @@ -require_relative "passes/test_all" require_relative "fragments/test_all" +require_relative "passes/test_all" require_relative "test_ruby_method" require_relative "test_ruby_compiler" diff --git a/test/test_all.rb b/test/test_all.rb index b9e59563..a925afdc 100644 --- a/test/test_all.rb +++ b/test/test_all.rb @@ -4,12 +4,12 @@ require_relative "elf/test_all" require_relative "lib/test_all" -require_relative "rubyx/test_all" - -require_relative "vool/test_all" - require_relative "parfait/test_all" require_relative "risc/test_all" +require_relative "rubyx/test_all" + require_relative "vm/test_all" + +require_relative "vool/test_all" diff --git a/test/vool/test_if_statement.rb b/test/vool/test_if_statement.rb index aeeba399..a176587f 100644 --- a/test/vool/test_if_statement.rb +++ b/test/vool/test_if_statement.rb @@ -6,12 +6,10 @@ module Vool def basic_if "if(10 < 12) ; true ; end" end - def test_if_basic lst = Compiler.compile( basic_if ) assert_equal IfStatement , lst.class end - def test_if_basic_cond lst = Compiler.compile( basic_if ) assert_equal SendStatement , lst.condition.class @@ -22,33 +20,10 @@ module Vool assert_nil lst.if_false end - def pest_if_basicr - @input = s(:statements, s(:if_statement, :plus, s(:condition, s(:operator_value, :-, s(:int, 10), s(:int, 12))), s(:true_statements, s(:return, s(:int, 3))), s(:false_statements, s(:return, s(:int, 4))))) - - @expect = [Label, LoadConstant, LoadConstant, OperatorInstruction, IsPlus, LoadConstant , - RegToSlot, Branch, Label, LoadConstant, RegToSlot, Label , - LoadConstant, SlotToReg, RegToSlot, Label, FunctionReturn] - assert_nil msg = check_nil , msg + def test_if_double + lst = Compiler.compile( "if(false) ; true ; else ; false; end" ) + assert_equal IfStatement , lst.class end - - def pest_if_small_minus - @input = s(:statements, s(:if_statement, :minus, s(:condition, s(:operator_value, :-, s(:int, 10), s(:int, 12))), s(:true_statements, s(:return, s(:int, 3))), s(:false_statements, nil))) - - @expect = [Label, LoadConstant, LoadConstant, OperatorInstruction, IsMinus, Branch , - Label, LoadConstant, RegToSlot, Label, LoadConstant, SlotToReg , - RegToSlot, Label, FunctionReturn] - assert_nil msg = check_nil , msg - end - - - def pest_if_small_zero - @input = s(:statements, s(:if_statement, :zero, s(:condition, s(:operator_value, :-, s(:int, 10), s(:int, 12))), s(:true_statements, s(:return, s(:int, 3))), s(:false_statements, nil))) - - @expect = [Label, LoadConstant, LoadConstant, OperatorInstruction, IsZero, Branch , - Label, LoadConstant, RegToSlot, Label, LoadConstant, SlotToReg , - RegToSlot, Label, FunctionReturn] - assert_nil msg = check_nil , msg - end end end