fix many tests with preloading
preloading, something akin to builtin, loads some very small predefined (macro) methods for the tests to work (ie call)
This commit is contained in:
20
test/support/preloader.rb
Normal file
20
test/support/preloader.rb
Normal file
@ -0,0 +1,20 @@
|
||||
module Preloader
|
||||
def builtin
|
||||
{
|
||||
"Integer.div4" => "def div4; X.div4;end",
|
||||
"Integer.ge" => "def >; X.comparison(:>);end",
|
||||
"Object.get" => "def get_internal_word(at); X.get_internal_word;end",
|
||||
}
|
||||
end
|
||||
def get_preload(preload)
|
||||
return "" unless preload
|
||||
preload.split(";").collect do |loads|
|
||||
raise "no preload #{loads}" unless builtin[loads]
|
||||
clazz , meth = loads.split(".")
|
||||
"class #{clazz}; #{builtin[loads]};end;"
|
||||
end.join
|
||||
end
|
||||
def preload
|
||||
get_preload(@preload)
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user