diff options
author | Hugo van der Sanden <hv@crypt.compulink.co.uk> | 1997-08-07 00:00:00 +0000 |
---|---|---|
committer | Tim Bunce <Tim.Bunce@ig.co.uk> | 1997-08-07 00:00:00 +1200 |
commit | 146da353faca1399b07ed7c6c1913003df1f962b (patch) | |
tree | 928408ec6b0c70648171493358af285f8e9e74d1 /t | |
parent | 850679cbd6d7696aaa31935fd76b8f1385efbd64 (diff) | |
download | perl-146da353faca1399b07ed7c6c1913003df1f962b.tar.gz |
Add xor tests to test suite
Subject: Re: Parser nit: possible [PATCH]
In <199706250602.CAA13384@rio.atlantic.net>, Chip Salzenberg writes:
:According to Hugo van der Sanden:
:> Can anyone explain why the parser code for OROP is different from
:> that for ANDOP? I include a patch for what I think it should be,
:> but I don't understand why all tests succeed both with and without
:> this patch.
:Because OROP is a token that's used for both "or" and "xor",
:whereas ANDOP is specific to the single keyword "and".
Ah, in that case the problem is that 'xor' appears nowhere in the
test suite. Patch below adds 4 new tests that normally succeed; my
previous (erroneous) patch causes the first of them to fail.
p5p-msgid: 199706250730.IAA06097@crypt.compulink.co.uk
Diffstat (limited to 't')
-rwxr-xr-x | t/comp/cmdopt.t | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/t/comp/cmdopt.t b/t/comp/cmdopt.t index 4d5c78a4cb..3f701a456a 100755 --- a/t/comp/cmdopt.t +++ b/t/comp/cmdopt.t @@ -2,7 +2,7 @@ # $RCSfile: cmdopt.t,v $$Revision: 4.1 $$Date: 92/08/07 18:27:17 $ -print "1..40\n"; +print "1..44\n"; # test the optimization of constants @@ -81,3 +81,10 @@ if ($a !~ /a/ || $x) { print "ok 38\n";} else { print "not ok 38\n";} $x = ''; if ($a =~ /a/ || $x) { print "ok 39\n";} else { print "not ok 39\n";} if ($a !~ /a/ || $x) { print "not ok 40\n";} else { print "ok 40\n";} + +$x = 1; +if ($a eq 'a' xor $x) { print "not ok 41\n";} else { print "ok 41\n";} +if ($a ne 'a' xor $x) { print "ok 42\n";} else { print "not ok 42\n";} +$x = ''; +if ($a eq 'a' xor $x) { print "ok 43\n";} else { print "not ok 43\n";} +if ($a ne 'a' xor $x) { print "not ok 44\n";} else { print "ok 44\n";} |