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