diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2007-03-30 07:48:59 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2007-03-30 07:48:59 +0000 |
commit | abc718f2ca5cfe66c838e1324c1c153a085fea8b (patch) | |
tree | 23211c9fc93b1552429344d0efc4a0a611dd54ac /t | |
parent | 37723ebb3f0f145b85438cb89891a2c80a5f149e (diff) | |
download | perl-abc718f2ca5cfe66c838e1324c1c153a085fea8b.tar.gz |
Add two deprecation warnings:
Opening dirhandle %s also as a file
Opening filehandle %s also as a directory
p4raw-id: //depot/perl@30780
Diffstat (limited to 't')
-rw-r--r-- | t/lib/warnings/pp_sys | 26 | ||||
-rw-r--r-- | t/op/chdir.t | 7 |
2 files changed, 31 insertions, 2 deletions
diff --git a/t/lib/warnings/pp_sys b/t/lib/warnings/pp_sys index 0dd3efea7a..2e9c613b02 100644 --- a/t/lib/warnings/pp_sys +++ b/t/lib/warnings/pp_sys @@ -494,3 +494,29 @@ chdir() on unopened filehandle FOO at - line 20. chdir() on closed filehandle BAR at - line 21. chdir() on unopened filehandle $dh at - line 22. chdir() on closed filehandle $fh at - line 23. +######## +# pp_sys.c [pp_open] +use warnings; +opendir FOO, "."; +opendir my $foo, "."; +open FOO, "TEST"; +open $foo, "TEST"; +no warnings qw(io deprecated); +open FOO, "TEST"; +open $foo, "TEST"; +EXPECT +Opening dirhandle FOO also as a file at - line 5. +Opening dirhandle $foo also as a file at - line 6. +######## +# pp_sys.c [pp_open_dir] +use warnings; +open FOO, "TEST"; +open my $foo, "TEST"; +opendir FOO, "."; +opendir $foo, "."; +no warnings qw(io deprecated); +opendir FOO, "."; +opendir $foo, "."; +EXPECT +Opening filehandle FOO also as a directory at - line 5. +Opening filehandle $foo also as a directory at - line 6. diff --git a/t/op/chdir.t b/t/op/chdir.t index 79b91fffa1..db58e126de 100644 --- a/t/op/chdir.t +++ b/t/op/chdir.t @@ -78,8 +78,11 @@ SKIP: { ok(-d "op", "verify that we are back"); # And now the ambiguous case - ok(opendir(H, "op"), "opendir op") or diag $!; - ok(open(H, "<", "base"), "open base") or diag $!; + { + no warnings qw<io deprecated>; + ok(opendir(H, "op"), "opendir op") or diag $!; + ok(open(H, "<", "base"), "open base") or diag $!; + } if (($Config{d_dirfd} || "") eq "define") { ok(chdir(H), "fchdir to op"); ok(-f "chdir.t", "verify that we are in 'op'"); |