rubyx/test/virtual/hello.rb
Torsten Ruger b980def84e move space to parfait
Also make the machine the singleton
and space hang off it

Many repercussions, not all fixed in this commit
2015-05-12 15:36:44 +03:00

43 lines
698 B
Ruby

require_relative "virtual_helper"
class HelloTest < MiniTest::Test
include VirtualHelper
def check
machine = Virtual::Machine.boot
expressions = machine.compile_main @string_input
writer = Elf::ObjectWriter.new(Virtual::Space.space)
writer.save "hello.o"
# puts Sof::Writer.write(expressions)
puts Sof::Writer.write(Virtual::Space.space)
end
def qtest_simplest_function
@string_input = <<HERE
def foo(x)
5
end
HERE
check
end
def ttest_puts_string
@string_input = <<HERE
def foo()
puts("Hello")
end
foo()
HERE
check
end
def test_string_put
@string_input = <<HERE
def foo()
"Hello".puts()
end
HERE
check
end
end