cvsuser 04/12/21 13:03:12
Modified: t/pmc fixedpmcarray.t
Log:
Add test for truth/falsehood of array; exercises the code in
Parrot_FixedPMCArray_get_bool.
Revision Changes Path
1.9 +31 -2 parrot/t/pmc/fixedpmcarray.t
Index: fixedpmcarray.t
===================================================================
RCS file: /cvs/public/parrot/t/pmc/fixedpmcarray.t,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- fixedpmcarray.t 16 Dec 2004 19:22:46 -0000 1.8
+++ fixedpmcarray.t 21 Dec 2004 21:03:12 -0000 1.9
@@ -1,6 +1,6 @@
#! perl -w
# Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
-# $Id: fixedpmcarray.t,v 1.8 2004/12/16 19:22:46 chromatic Exp $
+# $Id: fixedpmcarray.t,v 1.9 2004/12/21 21:03:12 scog Exp $
=head1 NAME
@@ -17,7 +17,7 @@
=cut
-use Parrot::Test tests => 10;
+use Parrot::Test tests => 11;
use Test::More;
my $fp_equality_macro = <<'ENDOFMACRO';
@@ -98,6 +98,35 @@
OUTPUT
#VIM's syntax highlighter needs this line
+output_is(<<'CODE', <<'OUTPUT', "Truth and falsehood");
+ new P0, .FixedPMCArray
+
+ set P0, 0
+ if P0, NOK_1
+ branch OK_1
+NOK_1: print "not "
+OK_1: print "ok 1\n"
+ unless P0, OK_2
+ print "not "
+OK_2: print "ok 2\n"
+
+ set P0, 1
+ unless P0, NOK_3
+ branch OK_3
+NOK_3: print "not "
+OK_3: print "ok 3\n"
+ if P0, OK_4
+ print "not "
+OK_4: print "ok 4\n"
+
+ end
+CODE
+ok 1
+ok 2
+ok 3
+ok 4
+OUTPUT
+
output_is(<<'CODE', <<'OUTPUT', "Setting first element");
new P0, .FixedPMCArray
set P0, 1