]> git.notmuchmail.org Git - notmuch/blob - test/t0007-uuencode.sh
Convert the actual tests to the new framework
[notmuch] / test / t0007-uuencode.sh
1 #!/bin/bash
2 test_description="handling of uuencoded data"
3 . ./test-lib.sh
4 test_expect_success 'Generate message' '
5
6 add_message [subject]=uuencodetest "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" \
7 "[body]=\"This message is used to ensure that notmuch correctly handles a
8 message containing a block of uuencoded data. First, we have a marker
9 this content beforeuudata . Then we beging the uunencoded data itself:
10
11 begin 644 bogus-uuencoded-data
12 M0123456789012345678901234567890123456789012345678901234567890
13 MOBVIOUSLY, THIS IS NOT ANY SORT OF USEFUL UUNECODED DATA.    
14 MINSTEAD THIS IS JUST A WAY TO ENSURE THAT THIS BLOCK OF DATA 
15 MIS CORRECTLY IGNORED WHEN NOTMUCH CREATES ITS INDEX. SO WE   
16 MINCLUDE A DURINGUUDATA MARKER THAT SHOULD NOT RESULT IN ANY  
17 MSEARCH RESULT.                                               
18 \\\`
19 end
20
21 Finally, we have our afteruudata marker as well.\""
22
23 '
24 test_expect_success "Ensure content before uu data is indexed" '
25 output=$($NOTMUCH search beforeuudata | notmuch_search_sanitize) &&
26 pass_if_equal "$output" "thread:XXX   2000-01-01 [1/1] Notmuch Test Suite; uuencodetest (inbox unread)"
27 '
28 test_expect_success "Ensure uu data is not indexed" '
29 output=$($NOTMUCH search DURINGUUDATA | notmuch_search_sanitize) &&
30 pass_if_equal "$output" ""
31 '
32 test_expect_success "Ensure content after uu data is indexed" '
33 output=$($NOTMUCH search afteruudata | notmuch_search_sanitize) &&
34 pass_if_equal "$output" "thread:XXX   2000-01-01 [1/1] Notmuch Test Suite; uuencodetest (inbox unread)"
35 '
36 test_done