get guard to run several test on one change by setting up names accordingly

This commit is contained in:
Torsten Ruger 2017-04-12 20:18:41 +03:00
parent 21e426be71
commit 87133722b3
9 changed files with 40 additions and 11 deletions

View File

@ -16,4 +16,7 @@ guard :minitest do
watch(%r{^lib/typed/parfait/type.rb}) { |m| "test/typed/type/test_all.rb" }
watch(%r{^lib/typed/parfait/typed_method.rb}) { |m| "test/typed/type/test_method_api.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"] }
end

View File

@ -57,6 +57,7 @@ require_relative "statements/class_statement"
require_relative "statements/hash_statement"
require_relative "statements/if_statement"
require_relative "statements/logical_statement"
require_relative "statements/local_statement"
require_relative "statements/method_statement"
require_relative "statements/return_statement"
require_relative "statements/statements"

View File

@ -9,17 +9,7 @@ module Vool
super
end
end
class LocalAssignment < Assignment
# used to collect frame information
def add_local( array )
array << @name
end
def to_mom( method )
Mom::SlotConstant.new([:message , :self , @name] , @value)
end
end
class InstanceAssignment < Assignment
# used to collect type information
def add_ivar( array )

View File

@ -0,0 +1,14 @@
module Vool
class LocalAssignment < Assignment
# used to collect frame information
def add_local( array )
array << @name
end
def to_mom( method )
Mom::SlotConstant.new([:message , :self , @name] , @value)
end
end
end

View File

@ -21,5 +21,6 @@ module Vool
assert_equal :foo , lst.name
end
end
end

View File

@ -0,0 +1,16 @@
require_relative "helper"
module Vool
class TestLocal < MiniTest::Test
def test_local
lst = RubyCompiler.compile( "foo = bar")
assert_equal LocalAssignment , lst.class
end
def test_local_name
lst = RubyCompiler.compile( "foo = bar")
assert_equal :foo , lst.name
end
end
end

View File

@ -1,3 +1,4 @@
require_relative "helper"
require_relative "statements/test_all"
require_relative "compilers/test_all"
require_relative "to_mom/test_all"

View File

@ -0,0 +1,3 @@
require_relative "helper"
require_relative "test_local"
require_relative "test_ivar_assignment"

View File

@ -1,7 +1,7 @@
require_relative "helper"
module Vool
class TestAssignemnt < MiniTest::Test
class TestLocalMom < MiniTest::Test
include CompilerHelper
def setup