Author: bernhard
Date: Thu Nov 27 11:25:17 2008
New Revision: 33274
Added:
trunk/languages/pipp/t/in_php/array.t (contents, props changed)
- copied, changed from r33266, /trunk/languages/pipp/t/php/array.t
Removed:
trunk/languages/pipp/t/php/array.t
Modified:
trunk/MANIFEST
trunk/languages/pipp/t/in_php/02_sanity.t
Log:
[Pipp] Convert array.t from Perl 5 to PHP
Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST (original)
+++ trunk/MANIFEST Thu Nov 27 11:25:17 2008
@@ -1,7 +1,7 @@
# ex: set ro:
# $Id$
#
-# generated by tools/dev/mk_manifest_and_skip.pl Wed Nov 26 19:14:21 2008 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Thu Nov 27 19:05:40 2008 UT
#
# See tools/dev/install_files.pl for documentation on the
# format of this file.
@@ -2397,8 +2397,8 @@
languages/pipp/t/harness [pipp]
languages/pipp/t/in_php/01_sea_only.t [pipp]
languages/pipp/t/in_php/02_sanity.t [pipp]
+languages/pipp/t/in_php/array.t [pipp]
languages/pipp/t/php/arithmetics.t [pipp]
-languages/pipp/t/php/array.t [pipp]
languages/pipp/t/php/base64.t [pipp]
languages/pipp/t/php/basic.t [pipp]
languages/pipp/t/php/builtin.t [pipp]
Modified: trunk/languages/pipp/t/in_php/02_sanity.t
==============================================================================
--- trunk/languages/pipp/t/in_php/02_sanity.t (original)
+++ trunk/languages/pipp/t/in_php/02_sanity.t Thu Nov 27 11:25:17 2008
@@ -1,5 +1,8 @@
<?php
+# Copyright (C) 2008, The Perl Foundation.
+# $Id$
+
require_once 'Test.php';
plan( 4 );
Copied: trunk/languages/pipp/t/in_php/array.t (from r33266,
/trunk/languages/pipp/t/php/array.t)
==============================================================================
--- /trunk/languages/pipp/t/php/array.t (original)
+++ trunk/languages/pipp/t/in_php/array.t Thu Nov 27 11:25:17 2008
@@ -1,9 +1,13 @@
+<?php
+
# Copyright (C) 2008, The Perl Foundation.
# $Id$
+/*
+
=head1 NAME
-pipp/t/array.t - tests for Pipp
+t/in_php/array.t - tests for the PhpArray type
=head1 DESCRIPTION
@@ -15,77 +19,43 @@
=cut
-# pragmata
-use strict;
-use warnings;
+*/
-use FindBin;
-use lib "$FindBin::Bin/../../../../lib", "$FindBin::Bin/../../lib";
+require_once 'Test.php';
-use Parrot::Config ();
-use Parrot::Test;
-use Test::More tests => 6;
+plan(8);
+$count = 1;
-
-language_output_is( 'Pipp', <<'CODE', <<'OUT', 'less than' );
-<?php
$hello['world'] = 'hi';
-echo $hello['world'];
-echo "\n";
-?>
-CODE
-hi
-OUT
+$hello['World'] = 'Hi';
+$hello['WORLD'] = 'HI';
-language_output_is( 'Pipp', <<'CODE', <<'OUT', 'less than' );
-<?php
-$hello['world'] = 'hi';
-echo $hello['world'];
-echo "\n";
-?>
-CODE
-hi
-OUT
+is( $hello['world'], 'hi', "hello['world']", $count);
+$count++;
-language_output_is( 'Pipp', <<'CODE', <<'OUT', 'less than' );
-<?php
-$hello['world'] = 'hi';
-echo $hello['world'];
-echo "\n";
-CODE
-hi
-OUT
+is( $hello['World'], 'Hi', "hello['World']", $count);
+$count++;
+
+is( $hello['WORLD'], 'HI', "hello['WORLD']", $count);
+$count++;
-language_output_is( 'Pipp', <<'CODE', <<'OUT', 'array with integer index' );
-<?php
-$thrice[3] = 9;
-echo $thrice[3];
-echo "\n";
-CODE
-9
-OUT
-language_output_is( 'Pipp', <<'CODE', <<'OUT', 'string interpolation' );
-<?php
$thrice[3] = 9;
-echo "3 times 3 equals $thrice[3]\n";
-CODE
-3 times 3 equals 9
-OUT
+$thrice[2] = 6;
-language_output_is( 'Pipp', <<'CODE', <<'OUT', 'count' );
-<?php
- $hello['world'] = 'hi';
- $hello['World'] = 'Hi';
- echo count($hello), "\n";
+is( $thrice[3], 9, "thrice[3]", $count);
+$count++;
+
+is( $thrice[2], 6, "thrice[2]", $count);
+$count++;
+
+is( "3 times 3 equals $thrice[3]", "3 time 3 equals 9", "3 times 3 equals 9",
$count);
+$count++;
+
+is( count($hello), 3, 'count of $hello', $count );
+$count++;
+is( count($thrice), 2, 'count of $thrice', $count );
+$count++;
+
+# vim: expandtab shiftwidth=4 ft=php:
?>
-CODE
-2
-OUT
-
-# Local Variables:
-# mode: cperl
-# cperl-indent-level: 4
-# fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4: