start testing builtin seperately

in terms of output only
This commit is contained in:
Torsten Ruger 2018-04-19 19:47:35 +03:00
parent 1741ad540e
commit a98d7630fb
3 changed files with 33 additions and 1 deletions

View File

@ -0,0 +1,13 @@
require_relative "../helper"
module Risc
module Builtin
class BuiltinTest < MiniTest::Test
include Ticker
def setup
@string_input = as_main(main)
super
end
end
end
end

View File

@ -0,0 +1,19 @@
require_relative "helper"
module Risc
module Builtin
class PlusTest < BuiltinTest
def main
"return 5 + 5"
end
def test_add
#show_main_ticks # get output of what is
run_all
assert_equal Parfait::Integer , get_return.class
assert_equal 10 , get_return.value
end
end
end
end

View File

@ -77,7 +77,7 @@ module Risc
end end
classes classes
end end
alias :run_all :all_classes
# for chaning the tests quickly output all instructions that are executed # for chaning the tests quickly output all instructions that are executed
def show_ticks def show_ticks
classes = all_classes classes = all_classes