add decent method to get the programs return to interpreter

only had such methods in tests, but they really belong in code
also adding fake values to true ,false and nil
This commit is contained in:
2020-03-28 18:39:49 +02:00
parent 8fa00d1413
commit 8dfcc0f5de
5 changed files with 35 additions and 4 deletions

View File

@ -38,6 +38,10 @@ module Risc
def test_pos
assert_equal 1 , @interpreter.clock
end
def test_return_value
@interpreter.run_all
assert_equal 5 , @interpreter.get_sys_return
end
end
class TestInterpreterTicks < MiniTest::Test
include Ticker
@ -98,7 +102,7 @@ module Risc
def test_tick_15 #more than a binary code worth
15.times {@interpreter.tick}
end
class TestInterpreterDies #< MiniTest::Test
class TestInterpreterDies < MiniTest::Test
include Ticker
def setup
@string_input = as_main("random.call")