From: Hugo van der Sanden Date: Tue, 18 Mar 2003 00:52:09 +0000 (+0000) Subject: add tests for existing behaviour of undef postinc/dec X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f9b9d3d602f1928e77e0ee656b078cbea0c8bae8;p=p5sagit%2Fp5-mst-13.2.git add tests for existing behaviour of undef postinc/dec p4raw-id: //depot/perl@19016 --- diff --git a/t/op/inc.t b/t/op/inc.t index f360c03..56d27d2 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 {