[svn:parrot] r42483 - in trunk: . t/op

dukeleto at svn.parrot.org dukeleto at svn.parrot.org
Fri Nov 13 10:18:42 UTC 2009


Author: dukeleto
Date: Fri Nov 13 10:18:38 2009
New Revision: 42483
URL: https://trac.parrot.org/parrot/changeset/42483

Log:
[t][TT #1122] Convert t/op/literal.t to PIR and keep old PASM tests in t/op/literal-old.t, mgrimes++

Added:
   trunk/t/op/literal-old.t
      - copied unchanged from r42480, trunk/t/op/literal.t
Modified:
   trunk/MANIFEST
   trunk/t/op/literal.t

Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST	Fri Nov 13 09:43:18 2009	(r42482)
+++ trunk/MANIFEST	Fri Nov 13 10:18:38 2009	(r42483)
@@ -1,7 +1,7 @@
 # ex: set ro:
 # $Id$
 #
-# generated by tools/dev/mk_manifest_and_skip.pl Thu Nov 12 19:25:29 2009 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Fri Nov 13 09:56:40 2009 UT
 #
 # See below for documentation on the format of this file.
 #
@@ -1823,6 +1823,7 @@
 t/op/jit.t                                                  [test]
 t/op/jitn.t                                                 [test]
 t/op/lexicals.t                                             [test]
+t/op/literal-old.t                                          [test]
 t/op/literal.t                                              [test]
 t/op/load_bytecode.t                                        [test]
 t/op/number.t                                               [test]

Copied: trunk/t/op/literal-old.t (from r42480, trunk/t/op/literal.t)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/t/op/literal-old.t	Fri Nov 13 10:18:38 2009	(r42483, copy of r42480, trunk/t/op/literal.t)
@@ -0,0 +1,74 @@
+#!perl
+# Copyright (C) 2001-2005, Parrot Foundation.
+# $Id$
+
+use strict;
+use warnings;
+use lib qw( . lib ../lib ../../lib );
+use Test::More;
+use Parrot::Test tests => 2;
+
+=head1 NAME
+
+t/op/literal.t - Testing the PIR and PASM lexer
+
+=head1 SYNOPSIS
+
+        % prove t/op/literal.t
+
+=head1 DESCRIPTION
+
+Test lexing of literal numbers.
+Taken from from the 2nd aoudad book (page 127).
+
+=head1 TODO
+
+More tests are welcome.
+
+=head1 SEE ALSO
+
+L<https://rt.perl.org/rt3/Ticket/Display.html?id=31197>
+
+=cut
+
+pasm_output_is( <<'CODE', <<'OUTPUT', "integer literals in PASM" );
+        print 0x2A
+        print "\n"
+        print 0X2A
+        print "\n"
+        print 0b101010
+        print "\n"
+        print 0B101010
+        print "\n"
+        end
+CODE
+42
+42
+42
+42
+OUTPUT
+
+pir_output_is( <<'CODE', <<'OUTPUT', "integer literals in PIR" );
+.sub test :main
+        print 0x2A
+        print "\n"
+        print 0X2A
+        print "\n"
+        print 0b101010
+        print "\n"
+        print 0B101010
+        print "\n"
+.end
+CODE
+42
+42
+42
+42
+OUTPUT
+
+# Local Variables:
+#   mode: cperl
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:

Modified: trunk/t/op/literal.t
==============================================================================
--- trunk/t/op/literal.t	Fri Nov 13 09:43:18 2009	(r42482)
+++ trunk/t/op/literal.t	Fri Nov 13 10:18:38 2009	(r42483)
@@ -1,16 +1,10 @@
-#!perl
+#!parrot
 # Copyright (C) 2001-2005, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-use Test::More;
-use Parrot::Test tests => 2;
-
 =head1 NAME
 
-t/op/literal.t - Testing the PIR and PASM lexer
+t/op/literal.t - Testing the PIR lexer
 
 =head1 SYNOPSIS
 
@@ -18,57 +12,28 @@
 
 =head1 DESCRIPTION
 
-Test lexing of literal numbers.
-Taken from from the 2nd aoudad book (page 127).
-
-=head1 TODO
-
-More tests are welcome.
+Tests the lexing of literal numbers.  Taken from from the 2nd
+aoudad book (page 127).
 
-=head1 SEE ALSO
+=cut
 
-L<https://rt.perl.org/rt3/Ticket/Display.html?id=31197>
+.sub main :main
+    .include 'test_more.pir'
 
-=cut
+    plan(4)
+    test_integer_literals_in_pir()
+.end
 
-pasm_output_is( <<'CODE', <<'OUTPUT', "integer literals in PASM" );
-        print 0x2A
-        print "\n"
-        print 0X2A
-        print "\n"
-        print 0b101010
-        print "\n"
-        print 0B101010
-        print "\n"
-        end
-CODE
-42
-42
-42
-42
-OUTPUT
-
-pir_output_is( <<'CODE', <<'OUTPUT', "integer literals in PIR" );
-.sub test :main
-        print 0x2A
-        print "\n"
-        print 0X2A
-        print "\n"
-        print 0b101010
-        print "\n"
-        print 0B101010
-        print "\n"
+.sub test_integer_literals_in_pir
+    is( 0x2A, 42, 'Integer hex literals in PIR' )
+    is( 0X2A, 42, 'Integer hex literals in PIR' )
+    is( 0b101010, 42, 'Integer binary literals in PIR' )
+    is( 0B101010, 42, 'Integer binary literals in PIR' )
 .end
-CODE
-42
-42
-42
-42
-OUTPUT
 
 # Local Variables:
-#   mode: cperl
+#   mode: pir
 #   cperl-indent-level: 4
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 ft=pir:


More information about the parrot-commits mailing list