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"] } watch(%r{^lib/parfait/type.rb}) { Dir["test/parfait/type/test_*.rb"] }
# Vool to_mom compile process + # Ruby to vool compile process # 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 end

View File

@ -12,19 +12,16 @@ module Vool
end end
def test_if_compiles_as_array def test_if_compiles_as_array
assert_equal Array , @first.class , @stats assert_equal Mom::IfStatement , @first.class , @stats
end
def test_if_compiles_as_array_2
assert_equal 5 , @first.length , @stats
end end
def test_condition_compiles_to_slot def test_condition_compiles_to_slot
assert_equal Mom::SlotConstant , @first.first.class assert_equal Mom::TruthCheck , @first.condition.class
end
def test_condition_compiles_to_check_second
assert_equal Mom::TruthCheck , @first[1].class
end end
def test_condition_is_send 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 end
end end

View File

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