summaryrefslogtreecommitdiff
path: root/lib/dumpvar.t
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2003-09-19 04:46:39 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2003-09-19 04:46:39 +0000
commit2c227d667bcf910e7fef2feea02fec7046f3cb13 (patch)
tree3c22677b364e5daa7e8cb8026a0a10b04079fa45 /lib/dumpvar.t
parentf338af47923def4d535e1fd32a0aeee66b1f733b (diff)
downloadperl-2c227d667bcf910e7fef2feea02fec7046f3cb13.tar.gz
Tests for change #21284.
p4raw-link: @21284 on //depot/perl: f338af47923def4d535e1fd32a0aeee66b1f733b p4raw-id: //depot/perl@21285
Diffstat (limited to 'lib/dumpvar.t')
-rw-r--r--lib/dumpvar.t30
1 files changed, 29 insertions, 1 deletions
diff --git a/lib/dumpvar.t b/lib/dumpvar.t
index 4101940886..f13bcee9ac 100644
--- a/lib/dumpvar.t
+++ b/lib/dumpvar.t
@@ -26,11 +26,12 @@ sub unctrl { print dumpvar::unctrl($_[0]), "\n" }
sub uniescape { print dumpvar::uniescape($_[0]), "\n" }
sub stringify { print dumpvar::stringify($_[0]), "\n" }
sub dumpvalue {
+ # Call main::dumpValue exactly as the perl5db.pl calls it.
local $\ = '';
local $, = '';
local $" = ' ';
my @params = @_;
- &main::dumpValue(\@params, -1);
+ &main::dumpValue(\@params,-1);
}
package Foo;
@@ -173,11 +174,22 @@ EXPECT
1 2
2 3
########
+dumpValue([1..3]);
+EXPECT
+0 1
+1 2
+2 3
+########
dumpValue({1..4},1);
EXPECT
1 => 2
3 => 4
########
+dumpValue({1..4});
+EXPECT
+1 => 2
+3 => 4
+########
dumpValue($foo,1);
EXPECT
0 1
@@ -186,6 +198,14 @@ EXPECT
3 4
4 5
########
+dumpValue($foo);
+EXPECT
+0 1
+1 2
+2 3
+3 4
+4 5
+########
dumpValue($bar,1);
EXPECT
0 1
@@ -194,6 +214,14 @@ EXPECT
3 4
4 5
########
+dumpValue($bar);
+EXPECT
+0 1
+1 2
+2 3
+3 4
+4 5
+########
dumpvalue("a");
EXPECT
0 'a'