Files
rubyx/test/rubyx/test_rubyx_compiler3.rb
Torsten Rüger d1f8733623 Rename Vool to Sol
Simple is really the descriptive name for the layer
Sure, it is "virtual" but that is not as important as the fact that it is simple (or simplified)
Also objct (based really) is better, since orientated implies it is a little like that, but only orientated, not really it. Sol only has objects, nothing else
Just cause i was renaming anyway
2019-10-04 00:38:47 +03:00

43 lines
1.5 KiB
Ruby

require_relative "helper"
module RubyX
class TestRubyXCompilerBinary < MiniTest::Test
include ScopeHelper
include RubyXHelper
def space_source_for( name )
"class Space ; def #{name}(arg);return arg;end; end"
end
def test_platform_option
options = RubyX.interpreter_test_options
options.delete(:platform)
assert_raises{ RubyXCompiler.ruby_to_binary(space_source_for("main"), options)}
end
def test_return_linker
@linker = RubyXCompiler.ruby_to_binary(space_source_for("main"), RubyX.interpreter_test_options)
assert_equal Risc::Linker , @linker.class
end
def test_one_sol_call
compiler = RubyXCompiler.new(RubyX.default_test_options)
compiler.ruby_to_sol(space_source_for("main"))
assert_equal Sol::ClassExpression , compiler.sol.class
end
def test_two_sol_calls
compiler = RubyXCompiler.new(RubyX.default_test_options)
compiler.ruby_to_sol(space_source_for("main"))
compiler.ruby_to_sol(space_source_for("twain"))
assert_equal Sol::ScopeStatement , compiler.sol.class
assert_equal 2 , compiler.sol.length
end
def test_bin_two_sources
compiler = RubyXCompiler.new(RubyX.default_test_options)
compiler.ruby_to_sol(space_source_for("main"))
compiler.ruby_to_sol(space_source_for("twain"))
assert_equal 2 , compiler.sol.length
linker = compiler.to_binary(:interpreter)
assert_equal Risc::Linker , linker.class
assert_equal 4 , linker.assemblers.length
end
end
end