start to test if

truth check is only half done
This commit is contained in:
Torsten Ruger
2018-03-19 21:20:11 +05:30
parent 63c1468e1e
commit c8980595a3
2 changed files with 39 additions and 8 deletions

View File

@ -0,0 +1,23 @@
require_relative "helper"
module Risc
class TestIfNoElse < MiniTest::Test
include Statements
def setup
super
@input = "if(@a) ; arg = 5 ; end"
@expect = [SlotToReg, SlotToReg, LoadConstant, IsSame, Label, LoadConstant ,
SlotToReg, RegToSlot, Label]
end
def test_if_instructions
assert_nil msg = check_nil , msg
end
def ttest_if_instructions
produced = produce_body
assert_equal 5 , produced.class , produced
end
end
end