start testing builtin seperately
in terms of output only
This commit is contained in:
parent
1741ad540e
commit
a98d7630fb
13
test/risc/builtin/helper.rb
Normal file
13
test/risc/builtin/helper.rb
Normal 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
|
19
test/risc/builtin/test_plus.rb
Normal file
19
test/risc/builtin/test_plus.rb
Normal 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
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user