some class field tests

This commit is contained in:
Torsten Ruger
2015-10-26 13:08:40 +02:00
parent dc58dbe2fe
commit b76c140d32
2 changed files with 28 additions and 4 deletions

View File

@ -20,5 +20,31 @@ HERE
@expect = [Label, SaveReturn,LoadConstant,Label,RegisterTransfer,GetSlot,FunctionReturn]
check
end
def test_class_field_value
@string_input = <<HERE
class Object
field int boo = 1
int main()
return 1
end
end
HERE
@expect = [Label, SaveReturn,LoadConstant,Label,RegisterTransfer,GetSlot,FunctionReturn]
assert_raises{check}
end
def test_class_field
@string_input = <<HERE
class Object
field int boo
int main()
return self.boo
end
end
HERE
@expect = [Label, SaveReturn,GetSlot,GetSlot,Label,RegisterTransfer,GetSlot,FunctionReturn]
check
end
end
end