rename to get guard matches
This commit is contained in:
parent
aa6685a0cb
commit
9e89306733
@ -1,2 +1,2 @@
|
||||
require_relative "test_class"
|
||||
require_relative "test_collector"
|
||||
require_relative "test_type_collector"
|
||||
require_relative "test_method_collector"
|
||||
|
@ -1,29 +0,0 @@
|
||||
require_relative "helper"
|
||||
|
||||
module Melon
|
||||
class TestCollector < MiniTest::Test
|
||||
|
||||
def setup
|
||||
Register.machine.boot unless Register.machine.booted
|
||||
end
|
||||
|
||||
def test_ivar_name
|
||||
Compiler.compile "class TestIvar < Object ; def meth; @ivar;end; end"
|
||||
itest = Parfait::Space.object_space.get_class_by_name(:TestIvar)
|
||||
assert itest.instance_type.instance_names.include?(:ivar) , itest.instance_type.instance_names.inspect
|
||||
end
|
||||
|
||||
def test_ivar_assign
|
||||
Compiler.compile "class TestIvar2 < Object ; def meth; @ivar = 5 ;end; end"
|
||||
itest = Parfait::Space.object_space.get_class_by_name(:TestIvar2)
|
||||
assert itest.instance_type.instance_names.include?(:ivar) , itest.instance_type.instance_names.inspect
|
||||
end
|
||||
|
||||
def test_ivar_operator_assign
|
||||
Compiler.compile "class TestIvar3 < Object ; def meth; @ivar += 5 ;end; end"
|
||||
itest = Parfait::Space.object_space.get_class_by_name(:TestIvar3)
|
||||
assert itest.instance_type.instance_names.include?(:ivar) , itest.instance_type.instance_names.inspect
|
||||
end
|
||||
|
||||
end
|
||||
end
|
37
test/melon/compiler/test_type_collector.rb
Normal file
37
test/melon/compiler/test_type_collector.rb
Normal file
@ -0,0 +1,37 @@
|
||||
require_relative "helper"
|
||||
|
||||
module Melon
|
||||
class TestTypeCollector < MiniTest::Test
|
||||
|
||||
def setup
|
||||
Register.machine.boot unless Register.machine.booted
|
||||
end
|
||||
|
||||
def parse_collect( input )
|
||||
ast = Parser::Ruby22.parse input
|
||||
TypeCollector.new.collect(ast)
|
||||
end
|
||||
|
||||
def test_ivar_name
|
||||
hash = parse_collect "def meth; @ivar;end"
|
||||
assert hash[:ivar] , hash
|
||||
end
|
||||
|
||||
def test_ivar_assign
|
||||
hash = parse_collect "def meth; @ivar = 5;end"
|
||||
assert hash[:ivar] , hash
|
||||
end
|
||||
|
||||
def test_ivar_operator_assign
|
||||
hash = parse_collect "def meth; @ivar += 5;end"
|
||||
assert hash[:ivar] , hash
|
||||
end
|
||||
|
||||
def test_compile_class
|
||||
Compiler.compile "class TestIvar < Object ; def meth; @ivar;end; end"
|
||||
itest = Parfait::Space.object_space.get_class_by_name(:TestIvar)
|
||||
assert itest.instance_type.instance_names.include?(:ivar) , itest.instance_type.instance_names.inspect
|
||||
end
|
||||
|
||||
end
|
||||
end
|
@ -1 +1,2 @@
|
||||
require_relative "compiler/test_all"
|
||||
require_relative "test_compiler"
|
||||
|
Loading…
Reference in New Issue
Block a user