summaryrefslogtreecommitdiff
path: root/lib/dumpvar.t
diff options
context:
space:
mode:
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'