foreach my $i (@_) { 0 }
####
# 58 tests with not, not optimized
+my $c;
x() unless $a;
x() if not $a and $b;
x() if $a and not $b;
x() if $a or not $b;
x() unless not $a or $b;
x() unless $a or not $b;
+x() if $a and not $b and $c;
+x() if not $a and $b and not $c;
+x() unless $a and not $b and $c;
+x() unless not $a and $b and not $c;
+x() if $a or not $b or $c;
+x() if not $a or $b or not $c;
+x() unless $a or not $b or $c;
+x() unless not $a or $b or not $c;
####
# 59 tests with not, optimized
+my $c;
x() if not $a;
x() unless not $a;
x() if not $a and not $b;
x() unless not $a and not $b;
x() if not $a or not $b;
x() unless not $a or not $b;
+x() if not $a and not $b and $c;
+x() unless not $a and not $b and $c;
+x() if not $a or not $b or $c;
+x() unless not $a or not $b or $c;
+x() if not $a and not $b and not $c;
+x() unless not $a and not $b and not $c;
+x() if not $a or not $b or not $c;
+x() unless not $a or not $b or not $c;
+x() unless not $a or not $b or not $c;
>>>>
+my $c;
x() unless $a;
x() if $a;
x() unless $a or $b;
x() if $a or $b;
x() unless $a and $b;
-x() unless not $a && $b;
+x() if $a and $b;
+x() if not $a || $b and $c;
+x() unless not $a || $b and $c;
+x() if not $a && $b or $c;
+x() unless not $a && $b or $c;
+x() unless $a or $b or $c;
+x() if $a or $b or $c;
+x() unless $a and $b and $c;
+x() if $a and $b and $c;
+x() unless not $a && $b && $c;
type = OP_OR;
else
type = OP_AND;
- o = first;
- first = *firstp = cUNOPo->op_first;
- if (o->op_next)
- first->op_next = o->op_next;
- cUNOPo->op_first = NULL;
- op_free(o);
+ op_null(first);
if (other->op_type == OP_NOT) { /* !a AND|OR !b => !(a OR|AND b) */
- o = other;
- other = *otherp = cUNOPo->op_first;
- if (o->op_next)
- other->op_next = o->op_next;
- cUNOPo->op_first = NULL;
- op_free(o);
+ op_null(other);
prepend_not = 1; /* prepend a NOT op later */
}
}
@INC = '../lib';
}
-print "1..9\n";
+print "1..11\n";
my $test = 0;
for my $i (undef, 0 .. 2, "", "0 but true") {
print "not " unless $i == 8;
print "ok ", ++$test, "\n";
-($x, $y) = (0, 9);
-$i = !$x && $y;
+++$y;
+$i = !$x || !$x || !$x || $y;
print "not " unless $i == 9;
print "ok ", ++$test, "\n";
+
+$x = 0;
+++$y;
+$i = !$x && $y;
+print "not " unless $i == 10;
+print "ok ", ++$test, "\n";
+
+++$y;
+$i = !$x && !$x && !$x && $y;
+print "not " unless $i == 11;
+print "ok ", ++$test, "\n";