2018-04-23 12:16:46 +02:00
|
|
|
require_relative "../helper"
|
2018-04-20 18:38:33 +02:00
|
|
|
|
|
|
|
module Risc
|
|
|
|
class InterpreterWhileCount < MiniTest::Test
|
|
|
|
include Ticker
|
2019-09-13 13:07:12 +02:00
|
|
|
include Preloader
|
2018-04-20 18:38:33 +02:00
|
|
|
|
|
|
|
def setup
|
2019-09-13 13:07:12 +02:00
|
|
|
@preload = "Integer.gt;Integer.plus"
|
2018-04-23 18:39:16 +02:00
|
|
|
@string_input = as_main 'a = -1; while( 0 > a); a = 1 + a;end;return a'
|
2018-04-20 18:38:33 +02:00
|
|
|
super
|
|
|
|
end
|
|
|
|
|
2018-08-06 13:07:17 +02:00
|
|
|
def test_while
|
|
|
|
run_all
|
|
|
|
assert_equal 0 , get_return
|
2018-04-20 18:38:33 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|