rubyx/test/vm/method_compiler/test_class.rb

32 lines
1.1 KiB
Ruby
Raw Normal View History

2015-10-25 12:19:18 +01:00
require_relative 'helper'
module Register
class TestClassStatements < MiniTest::Test
include Statements
2015-10-25 12:19:18 +01:00
def class_def
clean_compile :Bar, :buh, {}, s(:statements, s(:return, s(:int, 1)))
end
2016-12-10 21:41:49 +01:00
def test_class_call
#FIXME class call
# class_def
# @input = s(:statements, s(:return, s(:call, s(:name, :buh), s(:arguments), s(:receiver, s(:class_name, :Bar)))))
#
# @expect = [Label, SlotToReg, LoadConstant, RegToSlot, LoadConstant, RegToSlot, LoadConstant ,
# RegToSlot, LoadConstant, RegToSlot, RegisterTransfer, FunctionCall, Label, RegisterTransfer ,
# SlotToReg, SlotToReg, RegToSlot, Label, FunctionReturn]
# check
end
2015-10-26 21:23:06 +01:00
def test_class_field
# clean_compile :Space, s(:class_field, :Integer, :boo2)
#FIXME class_field handling unclear at the moment
# @input =s(:statements, s(:return, s(:field_access, s(:receiver, s(:name, :self)),
# s(:field,s(:name, :boo2)))))
# @expect = [Label, SlotToReg,SlotToReg,RegToSlot,Label,FunctionReturn]
# check
end
2015-10-26 12:08:40 +01:00
end
2015-10-25 12:19:18 +01:00
end