diff options
author | Remi Lespinet <remi.lespinet@ensimag.grenoble-inp.fr> | 2015-07-07 15:38:15 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-07-07 23:38:20 +0200 |
commit | 8d314d7afec5adaaa8e22332e39fe84a39584653 (patch) | |
tree | 4ce65606a30b62be55579e4b022e8201bf08fee5 /t/t9000-addresses.sh | |
parent | send-email: minor code refactoring (diff) | |
download | git-8d314d7afec5adaaa8e22332e39fe84a39584653.tar.xz git-8d314d7afec5adaaa8e22332e39fe84a39584653.zip |
send-email: reduce dependencies impact on parse_address_line
parse_address_line had not the same behavior whether the user had
Mail::Address or not. Teach parse_address_line to behave like
Mail::Address.
When the user input is correct, this implementation behaves
exactly like Mail::Address except when there are quotes
inside the name:
"Jane Do"e <jdoe@example.com>
In this case the result of parse_address_line is:
With M::A : "Jane Do" e <jdoe@example.com>
Without : "Jane Do e" <jdoe@example.com>
When the user input is not correct, the behavior is also mostly
the same.
Unlike Mail::Address, this doesn't parse groups and recursive
commentaries.
Signed-off-by: Remi Lespinet <remi.lespinet@ensimag.grenoble-inp.fr>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9000-addresses.sh')
-rwxr-xr-x | t/t9000-addresses.sh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/t/t9000-addresses.sh b/t/t9000-addresses.sh new file mode 100755 index 0000000000..a1ebef6de2 --- /dev/null +++ b/t/t9000-addresses.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +test_description='compare address parsing with and without Mail::Address' +. ./test-lib.sh + +if ! test_have_prereq PERL; then + skip_all='skipping perl interface tests, perl not available' + test_done +fi + +perl -MTest::More -e 0 2>/dev/null || { + skip_all="Perl Test::More unavailable, skipping test" + test_done +} + +perl -MMail::Address -e 0 2>/dev/null || { + skip_all="Perl Mail::Address unavailable, skipping test" + test_done +} + +test_external_has_tap=1 + +test_external_without_stderr \ + 'Perl address parsing function' \ + perl "$TEST_DIRECTORY"/t9000/test.pl + +test_done |