2 test_description='various settings for "notmuch search --output="'
7 test_begin_subtest "--output=threads"
8 notmuch search --output=threads '*' | sed -e s/thread:.*/thread:THREADID/ >OUTPUT
35 test_expect_equal_file OUTPUT EXPECTED
37 test_begin_subtest "--output=threads --format=json"
38 notmuch search --format=json --output=threads '*' | sed -e s/\".*\"/\"THREADID\"/ >OUTPUT
65 test_expect_equal_json "$(cat OUTPUT)" "$(cat EXPECTED)"
67 test_begin_subtest "--output=messages"
68 notmuch search --output=messages '*' >OUTPUT
70 id:4EFC743A.3060609@april.org
71 id:877h1wv7mg.fsf@inf-8657.int-evry.fr
72 id:1258544095-16616-1-git-send-email-chris@chris-wilson.co.uk
73 id:877htoqdbo.fsf@yoom.home.cworth.org
74 id:878we4qdqf.fsf@yoom.home.cworth.org
75 id:87aaykqe24.fsf@yoom.home.cworth.org
76 id:87bpj0qeng.fsf@yoom.home.cworth.org
77 id:87fx8cqf8v.fsf@yoom.home.cworth.org
78 id:87hbssqfix.fsf@yoom.home.cworth.org
79 id:87iqd8qgiz.fsf@yoom.home.cworth.org
80 id:87k4xoqgnl.fsf@yoom.home.cworth.org
81 id:87ocn0qh6d.fsf@yoom.home.cworth.org
82 id:87pr7gqidx.fsf@yoom.home.cworth.org
83 id:867hto2p0t.fsf@fortitudo.i-did-not-set--mail-host-address--so-tickle-me
84 id:1258532999-9316-1-git-send-email-keithp@keithp.com
85 id:86aayk2rbj.fsf@fortitudo.i-did-not-set--mail-host-address--so-tickle-me
86 id:86d43g2w3y.fsf@fortitudo.i-did-not-set--mail-host-address--so-tickle-me
87 id:ddd65cda0911172214t60d22b63hcfeb5a19ab54a39b@mail.gmail.com
88 id:86einw2xof.fsf@fortitudo.i-did-not-set--mail-host-address--so-tickle-me
89 id:736613.51770.qm@web113505.mail.gq1.yahoo.com
90 id:1258520223-15328-1-git-send-email-jan@ryngle.com
91 id:ddd65cda0911171950o4eea4389v86de9525e46052d3@mail.gmail.com
92 id:1258510940-7018-1-git-send-email-stewart@flamingspork.com
93 id:yunzl6kd1w0.fsf@aiko.keithp.com
94 id:yun1vjwegii.fsf@aiko.keithp.com
95 id:yun3a4cegoa.fsf@aiko.keithp.com
96 id:1258509400-32511-1-git-send-email-stewart@flamingspork.com
97 id:1258506353-20352-1-git-send-email-stewart@flamingspork.com
98 id:20091118010116.GC25380@dottiness.seas.harvard.edu
99 id:20091118005829.GB25380@dottiness.seas.harvard.edu
100 id:20091118005040.GA25380@dottiness.seas.harvard.edu
101 id:cf0c4d610911171623q3e27a0adx802e47039b57604b@mail.gmail.com
102 id:1258500222-32066-1-git-send-email-ingmar@exherbo.org
103 id:20091117232137.GA7669@griffis1.net
104 id:20091118002059.067214ed@hikari
105 id:1258498485-sup-142@elly
106 id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.gmail.com
107 id:f35dbb950911171435ieecd458o853c873e35f4be95@mail.gmail.com
108 id:1258496327-12086-1-git-send-email-jan@ryngle.com
109 id:1258493565-13508-1-git-send-email-keithp@keithp.com
110 id:yunaayketfm.fsf@aiko.keithp.com
111 id:yunbpj0etua.fsf@aiko.keithp.com
112 id:1258491078-29658-1-git-send-email-dottedmag@dottedmag.net
113 id:87fx8can9z.fsf@vertex.dottedmag
114 id:20091117203301.GV3165@dottiness.seas.harvard.edu
115 id:87lji4lx9v.fsf@yoom.home.cworth.org
116 id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com
117 id:87iqd9rn3l.fsf@vertex.dottedmag
118 id:20091117190054.GU3165@dottiness.seas.harvard.edu
119 id:87lji5cbwo.fsf@yoom.home.cworth.org
120 id:1258471718-6781-2-git-send-email-dottedmag@dottedmag.net
121 id:1258471718-6781-1-git-send-email-dottedmag@dottedmag.net
123 test_expect_equal_file OUTPUT EXPECTED
125 test_begin_subtest "--output=messages --format=json"
126 notmuch search --format=json --output=messages '*' >OUTPUT
128 ["4EFC743A.3060609@april.org",
129 "877h1wv7mg.fsf@inf-8657.int-evry.fr",
130 "1258544095-16616-1-git-send-email-chris@chris-wilson.co.uk",
131 "877htoqdbo.fsf@yoom.home.cworth.org",
132 "878we4qdqf.fsf@yoom.home.cworth.org",
133 "87aaykqe24.fsf@yoom.home.cworth.org",
134 "87bpj0qeng.fsf@yoom.home.cworth.org",
135 "87fx8cqf8v.fsf@yoom.home.cworth.org",
136 "87hbssqfix.fsf@yoom.home.cworth.org",
137 "87iqd8qgiz.fsf@yoom.home.cworth.org",
138 "87k4xoqgnl.fsf@yoom.home.cworth.org",
139 "87ocn0qh6d.fsf@yoom.home.cworth.org",
140 "87pr7gqidx.fsf@yoom.home.cworth.org",
141 "867hto2p0t.fsf@fortitudo.i-did-not-set--mail-host-address--so-tickle-me",
142 "1258532999-9316-1-git-send-email-keithp@keithp.com",
143 "86aayk2rbj.fsf@fortitudo.i-did-not-set--mail-host-address--so-tickle-me",
144 "86d43g2w3y.fsf@fortitudo.i-did-not-set--mail-host-address--so-tickle-me",
145 "ddd65cda0911172214t60d22b63hcfeb5a19ab54a39b@mail.gmail.com",
146 "86einw2xof.fsf@fortitudo.i-did-not-set--mail-host-address--so-tickle-me",
147 "736613.51770.qm@web113505.mail.gq1.yahoo.com",
148 "1258520223-15328-1-git-send-email-jan@ryngle.com",
149 "ddd65cda0911171950o4eea4389v86de9525e46052d3@mail.gmail.com",
150 "1258510940-7018-1-git-send-email-stewart@flamingspork.com",
151 "yunzl6kd1w0.fsf@aiko.keithp.com",
152 "yun1vjwegii.fsf@aiko.keithp.com",
153 "yun3a4cegoa.fsf@aiko.keithp.com",
154 "1258509400-32511-1-git-send-email-stewart@flamingspork.com",
155 "1258506353-20352-1-git-send-email-stewart@flamingspork.com",
156 "20091118010116.GC25380@dottiness.seas.harvard.edu",
157 "20091118005829.GB25380@dottiness.seas.harvard.edu",
158 "20091118005040.GA25380@dottiness.seas.harvard.edu",
159 "cf0c4d610911171623q3e27a0adx802e47039b57604b@mail.gmail.com",
160 "1258500222-32066-1-git-send-email-ingmar@exherbo.org",
161 "20091117232137.GA7669@griffis1.net",
162 "20091118002059.067214ed@hikari",
163 "1258498485-sup-142@elly",
164 "f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.gmail.com",
165 "f35dbb950911171435ieecd458o853c873e35f4be95@mail.gmail.com",
166 "1258496327-12086-1-git-send-email-jan@ryngle.com",
167 "1258493565-13508-1-git-send-email-keithp@keithp.com",
168 "yunaayketfm.fsf@aiko.keithp.com",
169 "yunbpj0etua.fsf@aiko.keithp.com",
170 "1258491078-29658-1-git-send-email-dottedmag@dottedmag.net",
171 "87fx8can9z.fsf@vertex.dottedmag",
172 "20091117203301.GV3165@dottiness.seas.harvard.edu",
173 "87lji4lx9v.fsf@yoom.home.cworth.org",
174 "cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com",
175 "87iqd9rn3l.fsf@vertex.dottedmag",
176 "20091117190054.GU3165@dottiness.seas.harvard.edu",
177 "87lji5cbwo.fsf@yoom.home.cworth.org",
178 "1258471718-6781-2-git-send-email-dottedmag@dottedmag.net",
179 "1258471718-6781-1-git-send-email-dottedmag@dottedmag.net"]
181 test_expect_equal_file OUTPUT EXPECTED
183 test_begin_subtest "--output=files"
184 notmuch search --output=files '*' | sed -e "s,$MAIL_DIR,MAIL_DIR," >OUTPUT
240 test_expect_equal_file OUTPUT EXPECTED
242 test_begin_subtest "--output=files --format=json"
243 notmuch search --format=json --output=files '*' | sed -e "s,$MAIL_DIR,MAIL_DIR," >OUTPUT
245 ["MAIL_DIR/cur/52:2,",
246 "MAIL_DIR/cur/53:2,",
247 "MAIL_DIR/cur/50:2,",
248 "MAIL_DIR/cur/49:2,",
249 "MAIL_DIR/cur/48:2,",
250 "MAIL_DIR/cur/47:2,",
251 "MAIL_DIR/cur/46:2,",
252 "MAIL_DIR/cur/45:2,",
253 "MAIL_DIR/cur/44:2,",
254 "MAIL_DIR/cur/43:2,",
255 "MAIL_DIR/cur/42:2,",
256 "MAIL_DIR/cur/41:2,",
257 "MAIL_DIR/cur/40:2,",
258 "MAIL_DIR/cur/39:2,",
259 "MAIL_DIR/cur/38:2,",
260 "MAIL_DIR/cur/37:2,",
261 "MAIL_DIR/cur/36:2,",
262 "MAIL_DIR/cur/35:2,",
263 "MAIL_DIR/cur/34:2,",
264 "MAIL_DIR/cur/33:2,",
265 "MAIL_DIR/cur/32:2,",
266 "MAIL_DIR/cur/31:2,",
267 "MAIL_DIR/cur/30:2,",
268 "MAIL_DIR/cur/29:2,",
269 "MAIL_DIR/cur/28:2,",
270 "MAIL_DIR/cur/27:2,",
271 "MAIL_DIR/cur/26:2,",
272 "MAIL_DIR/cur/25:2,",
273 "MAIL_DIR/cur/24:2,",
274 "MAIL_DIR/cur/23:2,",
275 "MAIL_DIR/cur/22:2,",
276 "MAIL_DIR/cur/21:2,",
277 "MAIL_DIR/cur/19:2,",
278 "MAIL_DIR/cur/18:2,",
279 "MAIL_DIR/cur/51:2,",
280 "MAIL_DIR/cur/20:2,",
281 "MAIL_DIR/cur/17:2,",
282 "MAIL_DIR/cur/16:2,",
283 "MAIL_DIR/cur/15:2,",
284 "MAIL_DIR/cur/14:2,",
285 "MAIL_DIR/cur/13:2,",
286 "MAIL_DIR/cur/12:2,",
287 "MAIL_DIR/cur/11:2,",
288 "MAIL_DIR/cur/10:2,",
289 "MAIL_DIR/cur/09:2,",
290 "MAIL_DIR/cur/08:2,",
291 "MAIL_DIR/cur/06:2,",
292 "MAIL_DIR/cur/05:2,",
293 "MAIL_DIR/cur/04:2,",
294 "MAIL_DIR/cur/03:2,",
295 "MAIL_DIR/cur/07:2,",
296 "MAIL_DIR/cur/02:2,",
297 "MAIL_DIR/cur/01:2,"]
299 test_expect_equal_file OUTPUT EXPECTED
301 test_begin_subtest "--output=tags"
302 notmuch search --output=tags '*' >OUTPUT
309 test_expect_equal_file OUTPUT EXPECTED
311 test_begin_subtest "--output=tags --format=json"
312 notmuch search --format=json --output=tags '*' >OUTPUT
319 test_expect_equal_file OUTPUT EXPECTED
321 test_begin_subtest "sanitize output for quoted-printable line-breaks in author and subject"
322 add_message "[subject]='two =?ISO-8859-1?Q?line=0A_subject?=
324 notmuch search id:"$gen_msg_id" | notmuch_search_sanitize >OUTPUT
326 thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; two line? subject headers (inbox unread)
328 test_expect_equal_file OUTPUT EXPECTED
330 test_begin_subtest "search for non-existent message prints nothing"
331 notmuch search "no-message-matches-this" > OUTPUT
333 test_expect_equal_file OUTPUT EXPECTED
335 test_begin_subtest "search --format=json for non-existent message prints proper empty json"
336 notmuch search --format=json "no-message-matches-this" > OUTPUT
338 test_expect_equal_file OUTPUT EXPECTED