new test to run out of ints

This commit is contained in:
Torsten Ruger 2018-08-08 12:03:17 +03:00
parent 6200a35562
commit f5ea51c4d0
2 changed files with 18 additions and 1 deletions

17
test/mains/test_new.rb Normal file
View File

@ -0,0 +1,17 @@
require_relative 'helper'
module Mains
class TestNew < MiniTest::Test
include Risc::Ticker
def setup
@string_input = as_main("a = 98 ; while(a>0) ; a = a - 1 ; end ; return a")
super
end
def test_chain # max 98 iterations on 300 integers
run_all
assert_equal 0 , get_return , " "
end
end
end

View File

@ -14,7 +14,7 @@ module Risc
end end
def test_minus_neg def test_minus_neg
run_main_return "5 - 15" run_main_return "5 - 15"
assert_equal -10 , get_return assert_equal( -10 , get_return)
end end
def test_rshift def test_rshift
run_main_return "#{2**8} >> 3" run_main_return "#{2**8} >> 3"