finish the idea behind #8, conditionally creating variables
by using space? , the ? makes for conditional creation of the variable This is especially useful for constants (ie space)
This commit is contained in:
@ -25,6 +25,17 @@ module Risc
|
||||
def test_caller_reg
|
||||
assert_equal :Message , @builder.infer_type(:caller_reg).class_name
|
||||
end
|
||||
def test_define_twice
|
||||
@builder.caller_reg!
|
||||
assert_raises{ @builder.caller_reg! }
|
||||
end
|
||||
def test_define_conditionally_first
|
||||
assert_equal :r1 , @builder.caller_reg?.symbol
|
||||
end
|
||||
def test_define_conditionally_again
|
||||
first = @builder.caller_reg!
|
||||
assert_equal first , @builder.caller_reg?
|
||||
end
|
||||
def test_caller_tmp
|
||||
assert_equal :Message , @builder.infer_type(:caller_tmp).class_name
|
||||
end
|
||||
|
Reference in New Issue
Block a user