Lots of preloading for tests

so many relied (implicitly( on some builtin function
after all can't do much in ruby without calling
Now all those dependencies are explicit
Small risc changes come because the macro version has a return label and unreachable label
This commit is contained in:
2019-09-13 14:07:12 +03:00
parent c9d7539479
commit 12b29285d7
52 changed files with 201 additions and 164 deletions

View File

@ -2,6 +2,7 @@ require_relative "helper"
module Elf
class SomethingTest < FullTest
include Preloader
def test_add
input = <<HERE
@ -22,7 +23,7 @@ module Elf
end
HERE
@exit_code = 4
check in_space(input) , "fibo"
check get_preload("Integer.lt;Integer.plus") + in_space(input) , "fibo"
end
end
end

View File

@ -6,9 +6,10 @@ module Elf
def test_string_put
hello = "Hello World!\n"
input = "return '#{hello}'.putstring"
preload = "class Word;def putstring;X.putstring;end;end;"
@stdout = hello
@exit_code = hello.length
check as_main(input), "hello"
check preload + as_main(input), "hello"
end
end
end