Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[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@sterlink.net> (perlDreamer++)


git-svn-id: https://svn.parrot.org/parrot/trunk@20773 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information...
commit 7e08161f94fea704146de6c6fca9e1fddcd15439 1 parent e68a64b
@pmichaud pmichaud authored
View
3  MANIFEST
@@ -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/03-unless.t [nqp]
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]
View
4 MANIFEST.SKIP
@@ -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/
View
10 languages/nqp/t/02-if-else.t
@@ -9,15 +9,17 @@ if 1 { say("ok 1 # on one line with else"); } else { say("not ok 1 # on one line
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");
View
5 languages/nqp/t/02-if.t
@@ -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 1 {
}
if 0 {
- say("not ok 4 # multi-line if");
+ print("not ");
}
+say("ok 4 # multi-line if, false condition causes block not to execute");
View
10 languages/nqp/t/03-unless-else.t
@@ -10,16 +10,18 @@ line with else")}
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");
View
5 languages/nqp/t/03-unless.t
@@ -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 0 {
}
unless 1 {
- say("not ok 4 # testing conditional");
+ print("not ");
}
+say("ok 4 # testing conditional");
View
27 languages/nqp/t/07-boolean.t
@@ -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');
Please sign in to comment.
Something went wrong with that request. Please try again.