cvsuser     04/12/29 15:38:09

  Modified:    t/pmc    resizablestringarray.t
  Log:
   Tests for clone op, plus for various exceptional conditions.
  
  Revision  Changes    Path
  1.7       +40 -2     parrot/t/pmc/resizablestringarray.t
  
  Index: resizablestringarray.t
  ===================================================================
  RCS file: /cvs/public/parrot/t/pmc/resizablestringarray.t,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- resizablestringarray.t    16 Dec 2004 19:22:46 -0000      1.6
  +++ resizablestringarray.t    29 Dec 2004 23:38:09 -0000      1.7
  @@ -1,6 +1,6 @@
   #! perl -w
   # Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
  -# $Id: resizablestringarray.t,v 1.6 2004/12/16 19:22:46 chromatic Exp $
  +# $Id: resizablestringarray.t,v 1.7 2004/12/29 23:38:09 scog Exp $
   
   =head1 NAME
   
  @@ -17,7 +17,7 @@
   
   =cut
   
  -use Parrot::Test tests => 9;
  +use Parrot::Test tests => 12;
   use Test::More;
   
   my $fp_equality_macro = <<'ENDOFMACRO';
  @@ -314,3 +314,41 @@
   2011
   two zero one zero
   OUTPUT
  +
  +output_is(<< 'CODE', << 'OUTPUT', "clone");
  +     new P0, .ResizableStringArray
  +     set P0, 1024
  +     set I0, 0
  +L1:  set P0[I0], I0
  +     inc I0
  +     lt I0, 1024, L1
  +     clone P1, P0
  +     set P0, 0
  +     set S0, P1[0]
  +     print S0
  +     print "\n"
  +     set S0, P1[1023]
  +     print S0
  +     print "\n"
  +     end
  +CODE
  +0
  +1023
  +OUTPUT
  +
  +output_is(<< 'CODE', << 'OUTPUT', "Resizing to negative value");
  +     new P0, .ResizableStringArray
  +     set P0, -1
  +     end
  +CODE
  +ResizableStringArray: Can't resize!
  +OUTPUT
  +
  +output_is(<< 'CODE', << 'OUTPUT', "Retrieving from negative index");
  +     new P0, .ResizableStringArray
  +     set P0, 100
  +     set S0, P0[-1]
  +     end
  +CODE
  +ResizableStringArray: index out of bounds!
  +OUTPUT
  
  
  

Reply via email to