cvsuser 04/12/22 14:56:54
Modified: t/pmc objects.t
Log:
Classoffset tests
Revision Changes Path
1.63 +35 -2 parrot/t/pmc/objects.t
Index: objects.t
===================================================================
RCS file: /cvs/public/parrot/t/pmc/objects.t,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -r1.62 -r1.63
--- objects.t 22 Dec 2004 22:47:32 -0000 1.62
+++ objects.t 22 Dec 2004 22:56:54 -0000 1.63
@@ -1,6 +1,6 @@
#! perl -w
# Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
-# $Id: objects.t,v 1.62 2004/12/22 22:47:32 scog Exp $
+# $Id: objects.t,v 1.63 2004/12/22 22:56:54 scog Exp $
=head1 NAME
@@ -16,7 +16,7 @@
=cut
-use Parrot::Test tests => 53;
+use Parrot::Test tests => 56;
use Test::More;
output_is(<<'CODE', <<'OUTPUT', "findclass (base class)");
@@ -359,6 +359,39 @@
ok 1
OUTPUT
+output_like(<<'CODE', <<'OUTPUT', "classoffset: normal operation");
+ newclass P1, "Foo"
+ find_type I0, "Foo"
+ new P2, I0
+ classoffset I1, P2, "Foo"
+ print I1
+ end
+CODE
+/\d+/
+OUTPUT
+
+output_like(<<'CODE', <<'OUTPUT', "classoffset: invalid parent class");
+ newclass P1, "Foo"
+ find_type I0, "Foo"
+ new P2, I0
+ classoffset I1, P2, "Bar"
+ print I1
+ end
+CODE
+/Class not parent of object/
+OUTPUT
+
+output_like(<<'CODE', <<'OUTPUT', "classoffset: non-object argument");
+ newclass P1, "Foo"
+ find_type I0, "Foo"
+ new P2, .Undef
+ classoffset I1, P2, "Foo"
+ print I1
+ end
+CODE
+/Not an object/
+OUTPUT
+
output_is(<<'CODE', <<'OUTPUT', "set/get object attribs");
newclass P1, "Foo"
addattribute P1, "i"