about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-05-14 03:32:01 +0000
committerEric Wong <e@80x24.org>2019-05-14 03:43:25 +0000
commit6062a213721155b945d43da33e723fbacbc8d7fe (patch)
tree45c4eea9c93e63eae4882ab753ed66e41c172a0c
parent46835d34029c92a2da886e5d0c17ec83cf86a209 (diff)
downloadpublic-inbox-6062a213721155b945d43da33e723fbacbc8d7fe.tar.gz
CentOS-7 needs the perl-Data-Dumper package, and the
test is small enough to roll our own escaping, here.
-rw-r--r--t/config.t12
1 files 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");
 }
 
 {