7 BEGIN { $ntests = 33 };
9 use Test
::More tests
=> $ntests;
13 eval q{use Perl::Tidy};
15 diag
"Perl::Tidy not available";
16 ok
(1) for 1..$ntests;
19 use_ok
("Data::Peek", ":tidy");
20 die "Cannot load Data::Peek\n" if $@
;
23 my ($dump, $var) = ("", "");
26 my ($v, $exp, $re) = split m/\t+ */;
33 $v =~ s/^S:([^:]*):// and DDsort
($1), $v =~ m/^()/; # And reset $1 for below
37 ok
($dump = DDumper
($var), "DDumper ($v)");
38 $dump =~ s/\A\$VAR1 = //;
42 like
($dump, qr{$exp}ms, ".. content $re");
43 $1 and diag
"# '$1' (", length ($1), ")\n";
46 is
($dump, $exp, ".. content");
49 unlink "perltidy.LOG", "perltidy.ERR";
67 [0] \A\[\s*0\s*]\s*\Z tidy array 1
68 [0, 1] \A\[\s*0\s*,\s*1\s*]\s*\Z tidy array 2
69 [0,1,2] \A\[\s*0\s*,\s*1\s*,\s*2\s*]\s*\Z tidy array 3
70 [[0],{foo=>1}] \A\[\s*\[\s*0\s*]\s*,\s*\{\s*'foo
'\s*=>\s*1\s*}\s*]\s*\Z structure