more some tests

This commit is contained in:
Torsten Ruger 2015-11-30 16:10:08 +02:00
parent 19dd7b96d6
commit afe16868b5
3 changed files with 32 additions and 7 deletions

View File

@ -1,7 +1,6 @@
class Layout < Object class Layout < Object
field Class object_class
Class object_class() field List instance_methods
return self.object_class field Integer indexed_length
end
end end

View File

@ -6,7 +6,12 @@ class Object
Class get_class() Class get_class()
Layout l = self.layout Layout l = self.layout
return l.object_class() return l.object_class
end end
Word get_class_name()
Layout l = self.layout
Class c = l.object_class
return c.name
end
end end

View File

@ -25,13 +25,34 @@ class TestLayoutRT < MiniTest::Test
def test_puts_class def test_puts_class
@main = <<HERE @main = <<HERE
Class c = get_class() Word w = get_class_name()
Word w = c.get_name()
w.putstring() w.putstring()
HERE HERE
@stdout = "Space" @stdout = "Space"
check check
end end
def test_puts_layout_space
@main = <<HERE
Layout l = get_layout()
Word w = l.get_class_name()
w.putstring()
HERE
@stdout = "Layout"
check
end
# copy of register parfait tests, in order
def test_message_layout
@main = <<HERE
Message m = self.first_message
m = m.next_message
Word w = m.get_class_name()
w.putstring()
HERE
@stdout = "Message"
check
end
end end