From 6062a213721155b945d43da33e723fbacbc8d7fe Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 14 May 2019 03:32:01 +0000 Subject: [PATCH] t/config.t: remove Data::Dumper dependency CentOS-7 needs the perl-Data-Dumper package, and the test is small enough to roll our own escaping, here. --- t/config.t | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/t/config.t b/t/config.t index ad738bd3..f0c274b9 100644 --- a/t/config.t +++ b/t/config.t @@ -127,10 +127,13 @@ my @invalid = ( ); -require Data::Dumper; +my %X = ("\0" => '\\0', "\b" => '\\b', "\f" => '\\f', "'" => "\\'"); +my $xre = join('|', keys %X); + for my $s (@invalid) { - my $d = Data::Dumper->new([$s])->Terse(1)->Indent(0)->Dump; - ok(!PublicInbox::Config::valid_inbox_name($s), "$d name rejected"); + my $d = $s; + $d =~ s/($xre)/$X{$1}/g; + ok(!PublicInbox::Config::valid_inbox_name($s), "`$d' name rejected"); } # obviously-valid examples @@ -146,8 +149,7 @@ my @valid = qw(a a@example a@example.com); # '!', '$', '=', '+' push @valid, qw[bang! ca$h less< more> 1% (parens) &more eql= +plus], '#hash'; for my $s (@valid) { - my $d = Data::Dumper->new([$s])->Terse(1)->Indent(0)->Dump; - ok(PublicInbox::Config::valid_inbox_name($s), "$d name accepted"); + ok(PublicInbox::Config::valid_inbox_name($s), "`$s' name accepted"); } { -- 2.44.0