more some tests
This commit is contained in:
parent
19dd7b96d6
commit
afe16868b5
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user