summaryrefslogtreecommitdiff
path: root/t/op
diff options
context:
space:
mode:
authorYitzchak Scott-Thoennes <sthoenna@efn.org>2000-10-26 07:00:03 -0700
committerJarkko Hietaniemi <jhi@iki.fi>2000-10-27 11:59:42 +0000
commit5e66d4f1f8d408decca63565193d2b1424d52c7c (patch)
treeb59e0734953e2cf6e61e80ed9a24afc32d652a16 /t/op
parent212e9bde36d67cbc2224ba0368de4e495465a342 (diff)
downloadperl-5e66d4f1f8d408decca63565193d2b1424d52c7c.tar.gz
[ID 20001026.006] C<use integer; $x += 1> gives uninitialized warning
Message-Id: <200010262100.e9QL03U06386@garcia.efn.org> p4raw-id: //depot/perl@7454
Diffstat (limited to 't/op')
-rwxr-xr-xt/op/assignwarn.t16
1 files changed, 14 insertions, 2 deletions
diff --git a/t/op/assignwarn.t b/t/op/assignwarn.t
index 2d05b82289..aff433c464 100755
--- a/t/op/assignwarn.t
+++ b/t/op/assignwarn.t
@@ -21,7 +21,7 @@ sub ok { print $_[1] ? "ok " : "not ok ", $_[0], "\n"; }
sub uninitialized { $warn =~ s/Use of uninitialized value[^\n]+\n//s; }
-print "1..23\n";
+print "1..32\n";
{ my $x; $x ++; ok 1, ! uninitialized; }
{ my $x; $x --; ok 2, ! uninitialized; }
@@ -55,7 +55,19 @@ print "1..23\n";
{ my $x; $x |= "x"; ok 21, ! uninitialized; }
{ my $x; $x ^= "x"; ok 22, ! uninitialized; }
-ok 23, $warn eq '';
+{ use integer; my $x; $x += 1; ok 23, ! uninitialized; }
+{ use integer; my $x; $x -= 1; ok 24, ! uninitialized; }
+
+{ use integer; my $x; $x *= 1; ok 25, uninitialized; }
+{ use integer; my $x; $x /= 1; ok 26, uninitialized; }
+{ use integer; my $x; $x %= 1; ok 27, uninitialized; }
+
+{ use integer; my $x; $x ++; ok 28, ! uninitialized; }
+{ use integer; my $x; $x --; ok 29, ! uninitialized; }
+{ use integer; my $x; ++ $x; ok 30, ! uninitialized; }
+{ use integer; my $x; -- $x; ok 31, ! uninitialized; }
+
+ok 32, $warn eq '';
# If we got any errors that we were not expecting, then print them
print map "#$_\n", split /\n/, $warn if length $warn;