diff options
author | Hugo van der Sanden <hv@crypt.org> | 2003-03-18 00:52:09 +0000 |
---|---|---|
committer | hv <hv@crypt.org> | 2003-03-18 00:52:09 +0000 |
commit | f9b9d3d602f1928e77e0ee656b078cbea0c8bae8 (patch) | |
tree | 9671cee15efd1566130f23f4901d69ff9efebfc3 /t | |
parent | 1e54a23f69c13441d458c7cf39ddbc3bb8a7079f (diff) | |
download | perl-f9b9d3d602f1928e77e0ee656b078cbea0c8bae8.tar.gz |
add tests for existing behaviour of undef postinc/dec
p4raw-id: //depot/perl@19016
Diffstat (limited to 't')
-rwxr-xr-x | t/op/inc.t | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/t/op/inc.t b/t/op/inc.t index f360c031fe..56d27d20a5 100755 --- a/t/op/inc.t +++ b/t/op/inc.t @@ -2,7 +2,7 @@ # use strict; -print "1..24\n"; +print "1..26\n"; my $test = 1; @@ -87,6 +87,12 @@ $b = -$a; $b=$b-1; ok ($b == -(++$a), $a); +$a = undef; +ok ($a++ eq '0', do { $a=undef; $a++ }, "postinc undef returns '0'"); + +$a = undef; +ok (!defined($a--), do { $a=undef; $a-- }, "postdec undef returns undef"); + # Verify that shared hash keys become unshared. sub check_same { |