From 073efc43a68cbd6852939ccaf644dbb380cdc143 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 25 Jun 2016 21:29:43 +0000 Subject: view: safer and optional quoting for --in-reply-to arg Angle brackets around the --in-reply-to= arg for git send-email has been optional since git v1.5.3.2, so strip them and make the command-line argument easier-to-type. --- t/view.t | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 't') diff --git a/t/view.t b/t/view.t index 4ce3c773..8a898feb 100644 --- a/t/view.t +++ b/t/view.t @@ -4,8 +4,20 @@ use strict; use warnings; use Test::More; use Email::MIME; -use PublicInbox::View; use Plack::Util; +use_ok 'PublicInbox::View'; + +my @q = ( + 'foo@bar', 'foo@bar', + 'a b', "'a b'", + "a'b", "'a'\\''b'", +); +while (@q) { + my $input = shift @q; + my $expect = shift @q; + my $res = PublicInbox::View::squote_maybe($input); + is($res, $expect, "quote $input => $res"); +} # FIXME: make this test less fragile my $ctx = { -- cgit v1.2.3-24-ge0c7