renaming to_mom tests and improve guard

This commit is contained in:
Torsten Ruger 2017-09-04 21:00:29 +03:00
parent dab4e74659
commit 4f3a4387fc
3 changed files with 12 additions and 15 deletions

View File

@ -20,6 +20,6 @@ guard :minitest do # with Minitest::Unit
watch(%r{^lib/parfait/type.rb}) { Dir["test/parfait/type/test_*.rb"] }
# Vool to_mom compile process + # Ruby to vool compile process
watch(%r{^lib/vool/statements/(.+)_statement.rb}) { |m| ["test/vool/to_mom/test_#{m[1]}.rb" ,"test/vool/statements/test_#{m[1]}.rb"] }
watch(%r{^lib/vool/statements/(.+)_statement.rb}) { |m| ["test/vool/to_mom/test_#{m[1]}*.rb" ,"test/vool/statements/test_#{m[1]}.rb"] }
end

View File

@ -12,19 +12,16 @@ module Vool
end
def test_if_compiles_as_array
assert_equal Array , @first.class , @stats
end
def test_if_compiles_as_array_2
assert_equal 5 , @first.length , @stats
assert_equal Mom::IfStatement , @first.class , @stats
end
def test_condition_compiles_to_slot
assert_equal Mom::SlotConstant , @first.first.class
end
def test_condition_compiles_to_check_second
assert_equal Mom::TruthCheck , @first[1].class
assert_equal Mom::TruthCheck , @first.condition.class
end
def test_condition_is_send
assert_equal Vool::LocalVariable , @first[1].condition.class
assert_equal Vool::LocalVariable , @first.condition.condition.class
end
def test_hoisetd
assert_equal Mom::SlotConstant , @first.hoisted.class
end
end
end

View File

@ -12,16 +12,16 @@ module Vool
end
def test_if_compiles_as_array
assert_equal Array , @first.class , @stats
assert_equal Mom::IfStatement , @first.class , @stats
end
def test_condition_compiles_to_check
assert_equal Mom::TruthCheck , @first.first.class , @stats
assert_equal Mom::TruthCheck , @first.condition.class , @stats
end
def test_condition_is_instance
assert_equal Vool::InstanceVariable , @first.first.condition.class , @stats
assert_equal Vool::InstanceVariable , @first.condition.condition.class , @stats
end
def test_true_block_is_second
assert_equal @first[1] , @first.first.true_block , @stats
def test_nothing_hoisted
assert_nil @first.hoisted , @stats
end
end
end