2015-10-14 14:17:33 +02:00
|
|
|
require_relative "compiler_helper"
|
|
|
|
|
|
|
|
module Virtual
|
|
|
|
class TestFunctions < MiniTest::Test
|
|
|
|
include CompilerHelper
|
|
|
|
|
|
|
|
def setup
|
|
|
|
Virtual.machine.boot
|
|
|
|
end
|
|
|
|
|
|
|
|
#reset the compiler (other than other tests that need to fake their inside a method)
|
|
|
|
def set_main compiler
|
|
|
|
compiler.set_main(nil)
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_puts
|
|
|
|
@root = :function_definition
|
|
|
|
@string_input = <<HERE
|
2015-10-14 15:16:03 +02:00
|
|
|
int puts(Word str)
|
2015-10-14 14:17:33 +02:00
|
|
|
main()
|
|
|
|
end
|
|
|
|
HERE
|
|
|
|
@output = AST::Node
|
|
|
|
check
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|