rubyx/test/vm/method_compiler/test_field_access.rb
Torsten Ruger 8dbbffd58e fix tests for NameExpression split
also necessitates giving method name without the wrapping expression
which is simpler anyway
2017-01-16 09:34:47 +02:00

35 lines
829 B
Ruby

require_relative "helper"
module Register
class TestFields < MiniTest::Test
include ExpressionHelper
include AST::Sexp
def setup
Register.machine.boot
end
def test_field_not_defined
@root = :field_access
@input = s(:field_access, s(:receiver, s(:known, :self)), s(:field, s(:ivar, :a)))
assert_raises(RuntimeError) { check }
end
def test_field_not_space
@root = :field_access
@input = s(:field_access, s(:receiver, s(:known, :self)), s(:field, s(:ivar, :space)))
assert_raises(RuntimeError) { check }
end
def test_field
add_space_field(:bro,:Object)
@root = :field_access
@input = s(:field_access,s(:receiver, s(:known, :self)),s(:field,s(:ivar, :bro)))
@output = Register::RegisterValue
check
end
end
end