testing to_s on Code
This commit is contained in:
parent
a8f3d5a634
commit
266764be06
@ -21,7 +21,7 @@ module Typed
|
||||
end
|
||||
class FalseExpression < Expression
|
||||
def to_s
|
||||
false
|
||||
"false"
|
||||
end
|
||||
end
|
||||
class NilExpression < Expression
|
||||
|
@ -6,6 +6,7 @@ module ExpressionHelper
|
||||
Register.machine.boot unless Register.machine.booted
|
||||
compiler = Typed::MethodCompiler.new Register.machine.space.get_main
|
||||
code = Typed.ast_to_code @input
|
||||
assert code.to_s , @input
|
||||
produced = compiler.process( code )
|
||||
assert @output , "No output given"
|
||||
assert_equal produced.class , @output , "Wrong class"
|
||||
|
@ -13,7 +13,9 @@ module Statements
|
||||
def check
|
||||
assert @expect , "No output given"
|
||||
compiler = Typed::MethodCompiler.new
|
||||
produced = compiler.process( Typed.ast_to_code( @input) )
|
||||
code = Typed.ast_to_code( @input )
|
||||
assert code.to_s , @input
|
||||
produced = compiler.process( code )
|
||||
produced = Register.machine.space.get_main.instructions
|
||||
compare_instructions produced , @expect
|
||||
produced
|
||||
|
Loading…
Reference in New Issue
Block a user