get guard to run several test on one change by setting up names accordingly
This commit is contained in:
parent
21e426be71
commit
87133722b3
@ -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
|
||||
|
@ -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"
|
||||
|
@ -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 )
|
||||
|
14
lib/vool/statements/local_statement.rb
Normal file
14
lib/vool/statements/local_statement.rb
Normal 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
|
@ -21,5 +21,6 @@ module Vool
|
||||
assert_equal :foo , lst.name
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
|
16
test/vool/statements/test_local.rb
Normal file
16
test/vool/statements/test_local.rb
Normal 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
|
@ -1,3 +1,4 @@
|
||||
require_relative "helper"
|
||||
require_relative "statements/test_all"
|
||||
require_relative "compilers/test_all"
|
||||
require_relative "to_mom/test_all"
|
||||
|
3
test/vool/to_mom/test_all.rb
Normal file
3
test/vool/to_mom/test_all.rb
Normal file
@ -0,0 +1,3 @@
|
||||
require_relative "helper"
|
||||
require_relative "test_local"
|
||||
require_relative "test_ivar_assignment"
|
@ -1,7 +1,7 @@
|
||||
require_relative "helper"
|
||||
|
||||
module Vool
|
||||
class TestAssignemnt < MiniTest::Test
|
||||
class TestLocalMom < MiniTest::Test
|
||||
include CompilerHelper
|
||||
|
||||
def setup
|
Loading…
Reference in New Issue
Block a user