test compatibility layer

test from and to std/parfait objects
for list and word for now
moved some of that code to virtual, out of parfait
This commit is contained in:
Torsten Ruger
2015-05-18 10:47:29 +03:00
parent f7eb888c36
commit cfc2c474b2
9 changed files with 86 additions and 25 deletions

View File

@ -84,6 +84,18 @@ module Parfait
return if old_length >= len
internal_object_grow(len + 1)
end
def ==(other)
# this should call parfait get_class, alas that is not implemented yet
return false if other.class != self.class
return false if other.get_length != self.get_length
index = self.get_length
while(index > 0)
return false if other.get(index) != self.get(index)
index = index - 1
end
return true
end
#many basic List functions can not be defined in ruby, such as
# get/set/length/add/delete
# so they must be defined as CompiledMethods in Builtin::Kernel