perl.cvs.parrot
[Top] [All Lists]

[svn:parrot] r20773 - in trunk: . languages/nqp/t

Subject: [svn:parrot] r20773 - in trunk: . languages/nqp/t
From:
Date: Tue, 21 Aug 2007 15:37:31 -0700 PDT
Newsgroups: perl.cvs.parrot

Author: pmichaud
Date: Tue Aug 21 15:37:30 2007
New Revision: 20773

Added:
   trunk/languages/nqp/t/07-boolean.t   (contents, props changed)
Modified:
   trunk/MANIFEST
   trunk/MANIFEST.SKIP
   trunk/languages/nqp/t/02-if-else.t
   trunk/languages/nqp/t/02-if.t
   trunk/languages/nqp/t/03-unless-else.t
   trunk/languages/nqp/t/03-unless.t

Log:
[nqp]:
* Refactor and clean some tests.
* Add in the t/07-boolean.t file that was omitted from the previous commit.
* Patch courtesy Colin Kuskie <ckuskie@xxxxxxxxxxxx> (perlDreamer++)


Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST      (original)
+++ trunk/MANIFEST      Tue Aug 21 15:37:30 2007
@@ -1,7 +1,7 @@
 # ex: set ro:
 # $Id$
 #
-# generated by tools/dev/mk_manifest_and_skip.pl Mon Aug 20 22:48:28 2007 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Tue Aug 21 22:36:15 2007 UT
 #
 # See tools/dev/install_files.pl for documentation on the
 # format of this file.
@@ -1678,6 +1678,7 @@
 languages/nqp/t/04-comments.t                               [nqp]
 languages/nqp/t/05-pod.t                                    [nqp]
 languages/nqp/t/06-args-pos.t                               [nqp]
+languages/nqp/t/07-boolean.t                                [nqp]
 languages/nqp/t/08-blocks.t                                 [nqp]
 languages/nqp/t/09-var.t                                    [nqp]
 languages/nqp/t/10-sub.t                                    [nqp]

Modified: trunk/MANIFEST.SKIP
==============================================================================
--- trunk/MANIFEST.SKIP (original)
+++ trunk/MANIFEST.SKIP Tue Aug 21 15:37:30 2007
@@ -1,6 +1,6 @@
 # ex: set ro:
 # $Id$
-# generated by tools/dev/mk_manifest_and_skip.pl Sat Aug 11 01:28:58 2007 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Tue Aug 21 22:36:15 2007 UT
 #
 # This file should contain a transcript of the svn:ignore properties
 # of the directories in the Parrot subversion repository. (Needed for
@@ -905,6 +905,8 @@
 # generated from svn:ignore of 'languages/nqp/'
 ^languages/nqp/Makefile$
 ^languages/nqp/Makefile/
+^languages/nqp/nqp\.pbc$
+^languages/nqp/nqp\.pbc/
 # generated from svn:ignore of 'languages/nqp/src/'
 ^languages/nqp/src/Grammar_gen\.pir$
 ^languages/nqp/src/Grammar_gen\.pir/

Modified: trunk/languages/nqp/t/02-if-else.t
==============================================================================
--- trunk/languages/nqp/t/02-if-else.t  (original)
+++ trunk/languages/nqp/t/02-if-else.t  Tue Aug 21 15:37:30 2007
@@ -9,15 +9,17 @@
 say("ok 2 # statements following if with else are okay");
 
 if 1 {
-    say("ok 3 # multi-line if with else");
+    print("ok 3");
 }
 else {
-    say("not ok 3 # multi-line if with else");
+    print("not ok 3");
 }
+say(" # multi-line if with else");
 
 if 0 {
-    say("not ok 4 # multi-line if, else branch");
+    print("not ok 4");
 }
 else {
-    say("ok 4 # multi-line if, else branch");
+    print("ok 4");
 }
+say(" # multi-line if, else branch");

Modified: trunk/languages/nqp/t/02-if.t
==============================================================================
--- trunk/languages/nqp/t/02-if.t       (original)
+++ trunk/languages/nqp/t/02-if.t       Tue Aug 21 15:37:30 2007
@@ -2,7 +2,7 @@
 
 # check literals
 
-say('1..3');
+say('1..4');
 
 if 1 { say("ok 1 # on one line"); }
 
@@ -13,5 +13,6 @@
 }
 
 if 0 {
-    say("not ok 4 # multi-line if");
+    print("not ");
 }
+say("ok 4 # multi-line if, false condition causes block not to execute");

Modified: trunk/languages/nqp/t/03-unless-else.t
==============================================================================
--- trunk/languages/nqp/t/03-unless-else.t      (original)
+++ trunk/languages/nqp/t/03-unless-else.t      Tue Aug 21 15:37:30 2007
@@ -10,16 +10,18 @@
 say("ok 2 # statements following unless with else are okay");
 
 unless 0 {
-    say("ok 3 # multi-line unless with else");
+    print("ok 3");
 }
 else {
-    say("not ok 3 # multi-line unless with else");
+    print("not ok 3");
 }
+say(" # multi-line unless with else");
 
 unless 1 {
-    say("not ok 4 # multi-line unless, else branch");
+    print("not ok 4");
 }
 else {
-    say("ok 4 # multi-line unless, else branch");
+    print("ok 4");
 }
+say(" # multi-line unless, else branch");
 

Modified: trunk/languages/nqp/t/03-unless.t
==============================================================================
--- trunk/languages/nqp/t/03-unless.t   (original)
+++ trunk/languages/nqp/t/03-unless.t   Tue Aug 21 15:37:30 2007
@@ -2,7 +2,7 @@
 
 # check literals
 
-say('1..3');
+say('1..4');
 
 unless 0 { say("ok 1 # on one line"); }
 
@@ -13,5 +13,6 @@
 }
 
 unless 1 {
-    say("not ok 4 # testing conditional");
+    print("not ");
 }
+say("ok 4 # testing conditional");

Added: trunk/languages/nqp/t/07-boolean.t
==============================================================================
--- (empty file)
+++ trunk/languages/nqp/t/07-boolean.t  Tue Aug 21 15:37:30 2007
@@ -0,0 +1,27 @@
+#!./parrot
+
+# Testing boolean context operators, ! and ?
+
+plan(8);
+
+##Negation
+ok(!0,   'prefix negation on integer 0');
+ok(!"0", 'prefix negation on string 0');
+
+if !1 {
+    print("not");
+}
+ok(1, "negating integer 1");
+
+ok(!!1, 'double negation on 1');
+
+##Boolean context
+ok(?1,    'prefix negation on integer 1');
+ok(?"10", 'prefix negation on string 10');
+
+if ?0 {
+    print("not");
+}
+ok(1, "boolean integer 0");
+
+ok(!?!?1, 'spaghetti chaining');

<Prev in Thread] Current Thread [Next in Thread>
  • [svn:parrot] r20773 - in trunk: . languages/nqp/t, pmichaud <=