2 test_description="message id parsing"
4 . $(dirname "$0")/test-lib.sh || exit 1
6 test_begin_subtest "good message ids"
7 ${TEST_DIRECTORY}/message-id-parse <<EOF >OUTPUT
8 <018b1a8f2d1df62e804ce88b65401304832dfbbf.1346614915.git.jani@nikula.org>
9 <1530507300.raoomurnbf.astroid@strange.none>
10 <1258787708-21121-2-git-send-email-keithp@keithp.com>
13 GOOD: 018b1a8f2d1df62e804ce88b65401304832dfbbf.1346614915.git.jani@nikula.org
14 GOOD: 1530507300.raoomurnbf.astroid@strange.none
15 GOOD: 1258787708-21121-2-git-send-email-keithp@keithp.com
17 test_expect_equal_file EXPECTED OUTPUT
19 test_begin_subtest "leading and trailing space is OK"
20 ${TEST_DIRECTORY}/message-id-parse <<EOF >OUTPUT
21 <018b1a8f2d1df62e804ce88b65401304832dfbbf.1346614915.git.jani@nikula.org>
22 <1530507300.raoomurnbf.astroid@strange.none>
23 <1258787708-21121-2-git-send-email-keithp@keithp.com>
26 GOOD: 018b1a8f2d1df62e804ce88b65401304832dfbbf.1346614915.git.jani@nikula.org
27 GOOD: 1530507300.raoomurnbf.astroid@strange.none
28 GOOD: 1258787708-21121-2-git-send-email-keithp@keithp.com
30 test_expect_equal_file EXPECTED OUTPUT
32 test_begin_subtest "<> delimiters are required"
33 ${TEST_DIRECTORY}/message-id-parse <<EOF >OUTPUT
34 018b1a8f2d1df62e804ce88b65401304832dfbbf.1346614915.git.jani@nikula.org>
35 <1530507300.raoomurnbf.astroid@strange.none
36 1258787708-21121-2-git-send-email-keithp@keithp.com
39 BAD: 018b1a8f2d1df62e804ce88b65401304832dfbbf.1346614915.git.jani@nikula.org>
40 BAD: <1530507300.raoomurnbf.astroid@strange.none
41 BAD: 1258787708-21121-2-git-send-email-keithp@keithp.com
43 test_expect_equal_file EXPECTED OUTPUT
45 test_begin_subtest "embedded whitespace is forbidden"
46 ${TEST_DIRECTORY}/message-id-parse <<EOF >OUTPUT
47 <018b1a8f2d1df62e804ce88b65401304832dfbbf.1346614915 .git.jani@nikula.org>
48 <1530507300.raoomurnbf.astroid @strange.none>
49 <1258787708-21121-
\f2-git-send-email-keithp@keithp.com>
52 BAD: <018b1a8f2d1df62e804ce88b65401304832dfbbf.1346614915 .git.jani@nikula.org>
53 BAD: <1530507300.raoomurnbf.astroid @strange.none>
54 BAD: <1258787708-21121-
\f2-git-send-email-keithp@keithp.com>
56 test_expect_equal_file EXPECTED OUTPUT
59 test_begin_subtest "folded real life bad In-Reply-To values"
60 ${TEST_DIRECTORY}/message-id-parse <<EOF >OUTPUT
61 <22597.31869.380767.339702@chiark.greenend.org.uk> (Ian Jackson's message of "Mon, 5 Dec 2016 14:41:01 +0000")
62 <20170625141242.loaalhis2eodo66n@gaara.hadrons.org> <149719990964.27883.13021127452105787770.reportbug@seneca.home.org>
63 Your message of Tue, 09 Dec 2014 13:21:11 +0100. <1900758.CgLNVPbY9N@liber>
66 BAD: <22597.31869.380767.339702@chiark.greenend.org.uk> (Ian Jackson's message of "Mon, 5 Dec 2016 14:41:01 +0000")
67 BAD: <20170625141242.loaalhis2eodo66n@gaara.hadrons.org> <149719990964.27883.13021127452105787770.reportbug@seneca.home.org>
68 BAD: Your message of Tue, 09 Dec 2014 13:21:11 +0100. <1900758.CgLNVPbY9N@liber>
70 test_expect_equal_file EXPECTED OUTPUT