Renaming Vool exppressions rightly
Class, Method and Lambda (was block) are expressions. Just making things clearer, especially for the blocks (ahem, lambdas) is matters. wip
This commit is contained in:
41
test/rubyx/parfait/test_data_object.rb
Normal file
41
test/rubyx/parfait/test_data_object.rb
Normal file
@ -0,0 +1,41 @@
|
||||
require_relative "helper"
|
||||
|
||||
module RubyX
|
||||
|
||||
class TestDatObjectCompile #< MiniTest::Test
|
||||
include ParfaitHelper
|
||||
def setup
|
||||
@compiler = compiler
|
||||
@compiler.ruby_to_vool load_parfait(:object)
|
||||
end
|
||||
def source
|
||||
load_parfait(:data_object)
|
||||
end
|
||||
def test_load
|
||||
assert source.include?("class DataObject")
|
||||
assert source.length > 1500 , source.length
|
||||
end
|
||||
def test_vool
|
||||
vool = @compiler.ruby_to_vool source
|
||||
assert_equ Vool::ScopeStatement , vool.class
|
||||
assert_equal Vool::ClassStatement , vool[0].class
|
||||
assert_equal Vool::ScopeStatement , vool[1].class
|
||||
assert_equal Vool::ClassStatement , vool[1][0].class
|
||||
assert_equal :DataObject , vool[1][0].name
|
||||
assert_equal :Data4 , vool[1][1].name
|
||||
assert_equal :Data8 , vool[1][2].name
|
||||
end
|
||||
def test_mom
|
||||
mom = @compiler.ruby_to_mom source
|
||||
assert_equal Mom::MomCollection , mom.class
|
||||
end
|
||||
def qtest_risc
|
||||
risc = compiler.ruby_to_risc source
|
||||
assert_equal Risc::RiscCollection , risc.class
|
||||
end
|
||||
def qtest_binary
|
||||
risc = compiler.ruby_to_binary source , :interpreter
|
||||
assert_equal Risc::Linker , risc.class
|
||||
end
|
||||
end
|
||||
end
|
32
test/rubyx/parfait/test_integer.rb
Normal file
32
test/rubyx/parfait/test_integer.rb
Normal file
@ -0,0 +1,32 @@
|
||||
require_relative "helper"
|
||||
|
||||
module RubyX
|
||||
|
||||
class TestIntegerCompile < MiniTest::Test
|
||||
include ParfaitHelper
|
||||
def source
|
||||
load_parfait(:integer)
|
||||
end
|
||||
def test_load
|
||||
assert source.include?("class Integer")
|
||||
assert source.length > 2000
|
||||
end
|
||||
def qtest_vool
|
||||
vool = compiler.ruby_to_vool source
|
||||
assert_equal Vool::ClassStatement , vool.class
|
||||
assert_equal :Object , vool.name
|
||||
end
|
||||
def qtest_mom
|
||||
mom = compiler.ruby_to_mom source
|
||||
assert_equal Mom::MomCollection , mom.class
|
||||
end
|
||||
def qtest_risc
|
||||
risc = compiler.ruby_to_risc source
|
||||
assert_equal Risc::RiscCollection , risc.class
|
||||
end
|
||||
def qtest_binary
|
||||
risc = compiler.ruby_to_binary source , :interpreter
|
||||
assert_equal Risc::Linker , risc.class
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user