2015-11-07 16:39:17 +01:00
|
|
|
require_relative 'helper'
|
|
|
|
|
2015-11-07 18:38:52 +01:00
|
|
|
class TestLayoutRT < MiniTest::Test
|
2015-11-18 12:04:57 +01:00
|
|
|
include ParfaitTests
|
2015-11-07 16:39:17 +01:00
|
|
|
|
|
|
|
def test_main
|
2015-11-18 12:04:57 +01:00
|
|
|
@main = "return 1"
|
2015-11-07 21:26:06 +01:00
|
|
|
check_return 1
|
2015-11-07 16:39:17 +01:00
|
|
|
end
|
|
|
|
|
2015-11-20 12:26:35 +01:00
|
|
|
def check_return_class val
|
|
|
|
end
|
|
|
|
|
2015-11-07 16:39:17 +01:00
|
|
|
def test_get_layout
|
2015-11-18 12:04:57 +01:00
|
|
|
@main = "return get_layout()"
|
2015-11-20 12:26:35 +01:00
|
|
|
check
|
|
|
|
assert_equal Parfait::Layout , @interpreter.get_register(:r0).return_value.class
|
2015-11-07 16:39:17 +01:00
|
|
|
end
|
|
|
|
|
2015-11-07 18:38:52 +01:00
|
|
|
def test_get_class
|
2015-11-18 12:04:57 +01:00
|
|
|
@main = "return get_class()"
|
2015-11-20 12:26:35 +01:00
|
|
|
check
|
|
|
|
assert_equal Parfait::Layout , @interpreter.get_register(:r0).return_value.class
|
2015-11-07 18:38:52 +01:00
|
|
|
end
|
|
|
|
|
2015-11-07 23:55:37 +01:00
|
|
|
def test_puts_class
|
2015-11-18 12:04:57 +01:00
|
|
|
@main = <<HERE
|
2015-11-07 23:55:37 +01:00
|
|
|
Class c = get_class()
|
|
|
|
Word w = c.get_name()
|
|
|
|
w.putstring()
|
|
|
|
HERE
|
|
|
|
@stdout = "Space"
|
|
|
|
check
|
|
|
|
end
|
2015-11-07 16:39:17 +01:00
|
|
|
|
|
|
|
|
|
|
|
end
|