better framework for running arm test
more explicit, rather than gobbling files, pass code in preload is available (so code does not have to be duplicated) interpret first, so bad mistakes get caught no ssh, just qemu-arm, configure through env
This commit is contained in:
31
test/mains/test_assign.rb
Normal file
31
test/mains/test_assign.rb
Normal file
@ -0,0 +1,31 @@
|
||||
require_relative "helper"
|
||||
|
||||
module Mains
|
||||
class AssignTester < MiniTest::Test
|
||||
include MainsHelper
|
||||
|
||||
def test_local
|
||||
@input = as_main 'a = 15 ; return a'
|
||||
assert_result 15 , ""
|
||||
end
|
||||
|
||||
def test_plus
|
||||
@preload = "Integer.plus"
|
||||
@input = as_main("a = 5 + 5 ; return a")
|
||||
assert_result 10 , ""
|
||||
end
|
||||
|
||||
def test_plus2
|
||||
@preload = "Integer.plus"
|
||||
@input = as_main("a = 5 ;a = 5 + a ; return a")
|
||||
assert_result 10 , ""
|
||||
end
|
||||
|
||||
def test_plus3
|
||||
@preload = "Integer.plus"
|
||||
@input = as_main("a = 5 ;a = 5 + a ;a = a + 5; return a")
|
||||
assert_result 15 , ""
|
||||
end
|
||||
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user