~ubuntu-branches/ubuntu/raring/dovecot/raring

« back to all changes in this revision

Viewing changes to pigeonhole/tests/test-anyof.svtest

  • Committer: Package Import Robot
  • Author(s): Marco Nenciarini
  • Date: 2011-09-19 19:26:48 UTC
  • mfrom: (1.14.4 upstream)
  • mto: (4.8.2 experimental)
  • mto: This revision was merged to the branch mainline in revision 86.
  • Revision ID: package-import@ubuntu.com-20110919192648-ri3sovtiz334yori
Tags: 1:2.0.15-1
* [a22575a] New upstream version 2.0.15: (Closes: #642045)
    + doveadm altmove: Added -r parameter to move mails back to primary
      storage.
    - v2.0.14: Index reading could have eaten a lot of memory in some
      situations
    - doveadm index no longer affects future caching decisions
    - mbox: Fixed crash during mail delivery when mailbox didn't yet have
      GUID assigned to it.
    - zlib+mbox: Fetching last message from compressed mailboxes crashed.
    - lib-sql: Fixed load balancing and error
* [8ce5abc] Update pigeonhole to release 0.2.4
* [87658d2] Add dovecot-solr to dovecot-core's Suggests line.

Show diffs side-by-side

added added

removed removed

Lines of Context:
153
153
                test_fail "chose wrong last-false outcome: false";
154
154
        }
155
155
}
 
156
 
 
157
/*
 
158
 * TEST: Basic functionality: static/dynamic
 
159
 */
 
160
 
 
161
test "Basic functionality: static/dynamic" {
 
162
        /* All true */
 
163
 
 
164
        if anyof ( true, exists "to", exists "cc" ) {
 
165
                /* Correct */
 
166
        } else {
 
167
                test_fail "chose wrong all-true first-static outcome: false";
 
168
        }
 
169
 
 
170
        if anyof ( exists "from", true, exists "cc" ) {
 
171
                /* Correct */
 
172
        } else {
 
173
                test_fail "chose wrong all-true second-static outcome: false";
 
174
        }
 
175
 
 
176
        if anyof ( exists "from", exists "to", true ) {
 
177
                /* Correct */
 
178
        } else {
 
179
                test_fail "chose wrong all-true third-static outcome: false";
 
180
        }
 
181
 
 
182
        /* All false */
 
183
 
 
184
        if anyof ( false, exists "frop", exists "frml" ) {
 
185
                test_fail "chose wrong all-false first-static outcome: true";
 
186
        } else {
 
187
                /* Correct */
 
188
        }
 
189
 
 
190
        if anyof ( exists "friep", false, exists "frml" ) {
 
191
                test_fail "chose wrong all-false second-static outcome: true";
 
192
        } else {
 
193
                /* Correct */
 
194
        }
 
195
 
 
196
        if anyof ( exists "friep", exists "frop", false ) {
 
197
                test_fail "chose wrong all-false third-static outcome: true";
 
198
        } else {
 
199
                /* Correct */
 
200
        }
 
201
 
 
202
        /* First true */
 
203
 
 
204
        if anyof ( true, exists "frop", exists "frml" ) {
 
205
                /* Correct */
 
206
        } else {
 
207
                test_fail "chose wrong first-true first-static outcome: false";
 
208
        }
 
209
 
 
210
        if anyof ( exists "to", false, exists "frml" ) {
 
211
                /* Correct */
 
212
        } else {
 
213
                test_fail "chose wrong first-true second-static outcome: false";
 
214
        }
 
215
 
 
216
        if anyof ( exists "to", exists "frop", false ) {
 
217
                /* Correct */
 
218
        } else {
 
219
                test_fail "chose wrong first-true third-static outcome: false";
 
220
        }
 
221
 
 
222
        /* Second true */
 
223
 
 
224
        if anyof ( false, exists "from", exists "frml" ) {
 
225
                /* Correct */
 
226
        } else {
 
227
                test_fail "chose wrong second-true first-static outcome: false";
 
228
        }
 
229
 
 
230
        if anyof ( exists "friep", true, exists "frml" ) {
 
231
                /* Correct */
 
232
        } else {
 
233
                test_fail "chose wrong second-true second-static outcome: false";
 
234
        }
 
235
 
 
236
        if anyof ( exists "friep", exists "from", false ) {
 
237
                /* Correct */
 
238
        } else {
 
239
                test_fail "chose wrong second-true third-static outcome: false";
 
240
        }
 
241
 
 
242
        /* Last true */
 
243
 
 
244
        if anyof ( false, exists "frop", exists "cc" ) {
 
245
                /* Correct */
 
246
        } else {
 
247
                test_fail "chose wrong last-true first-static outcome: false";
 
248
        }
 
249
 
 
250
        if anyof ( exists "friep", false, exists "cc" ) {
 
251
                /* Correct */
 
252
        } else {
 
253
                test_fail "chose wrong last-true second-static outcome: false";
 
254
        }
 
255
 
 
256
        if anyof ( exists "friep", exists "frop", true ) {
 
257
                /* Correct */
 
258
        } else {
 
259
                test_fail "chose wrong last-true third-static outcome: false";
 
260
        }
 
261
 
 
262
        /* First false */
 
263
 
 
264
        if anyof ( false, exists "from", exists "cc" ) {
 
265
                /* Correct */
 
266
        } else {
 
267
                test_fail "chose wrong first-false first-static outcome: false";
 
268
        }
 
269
 
 
270
        if anyof ( exists "friep", true, exists "cc" ) {
 
271
                /* Correct */
 
272
        } else {
 
273
                test_fail "chose wrong first-false second-static outcome: false";
 
274
        }
 
275
 
 
276
        if anyof ( exists "friep", exists "from", true ) {
 
277
                /* Correct */
 
278
        } else {
 
279
                test_fail "chose wrong first-false third-static outcome: false";
 
280
        }
 
281
 
 
282
        /* Second false */
 
283
 
 
284
        if anyof ( true, exists "frop", exists "cc" ) {
 
285
                /* Correct */
 
286
        } else {
 
287
                test_fail "chose wrong second-false first-static outcome: false";
 
288
        }
 
289
 
 
290
        if anyof ( exists "to", false, exists "cc" ) {
 
291
                /* Correct */
 
292
        } else {
 
293
                test_fail "chose wrong second-false second-static outcome: false";
 
294
        }
 
295
 
 
296
        if anyof ( exists "to", exists "frop", true ) {
 
297
                /* Correct */
 
298
        } else {
 
299
                test_fail "chose wrong second-false third-static outcome: false";
 
300
        }
 
301
 
 
302
        /* Third false */
 
303
 
 
304
        if anyof ( true, exists "from", exists "frml" ) {
 
305
                /* Correct */
 
306
        } else {
 
307
                test_fail "chose wrong last-false first-static outcome: false";
 
308
        }
 
309
 
 
310
        if anyof ( exists "to", true, exists "frml" ) {
 
311
                /* Correct */
 
312
        } else {
 
313
                test_fail "chose wrong last-false second-static outcome: false";
 
314
        }
 
315
 
 
316
        if anyof ( exists "to", exists "from", false ) {
 
317
                /* Correct */
 
318
        } else {
 
319
                test_fail "chose wrong last-false third-static outcome: false";
 
320
        }
 
321
}
 
322
 
 
323
/*
 
324
 * TEST: Basic functionality: nesting
 
325
 */
 
326
 
 
327
test "Basic functionality: nesting" {
 
328
        /* Static */
 
329
 
 
330
        if anyof ( anyof(false, false), anyof(false, false) ) {
 
331
                test_fail "chose wrong static nesting ((false, false),(false,false)) outcome: true";
 
332
        } else {
 
333
                /* Correct */
 
334
        }
 
335
 
 
336
        if anyof ( anyof(true, false), anyof(false, false) ) {
 
337
                /* Correct */
 
338
        } else {
 
339
                test_fail "chose wrong static nesting ((true, false),(false,false)) outcome: false";
 
340
        }
 
341
 
 
342
        if anyof ( anyof(false, true), anyof(false, false) ) {
 
343
                /* Correct */
 
344
        } else {
 
345
                test_fail "chose wrong static nesting ((false, true),(false,false)) outcome: false";
 
346
        }
 
347
 
 
348
        if anyof ( anyof(false, false), anyof(true, false) ) {
 
349
                /* Correct */
 
350
        } else {
 
351
                test_fail "chose wrong static nesting ((false, false),(true,false)) outcome: false";
 
352
        }
 
353
 
 
354
        if anyof ( anyof(false, false), anyof(false, true) ) {
 
355
                /* Correct */
 
356
        } else {
 
357
                test_fail "chose wrong static nesting ((false, false),(false,true)) outcome: false";
 
358
        }
 
359
 
 
360
        if anyof ( anyof(true, false), anyof(false, true) ) {
 
361
                /* Correct */
 
362
        } else {
 
363
                test_fail "chose wrong static nesting ((true, false),(false,true)) outcome: false";
 
364
        }
 
365
 
 
366
        /* Dynamic */
 
367
 
 
368
        if anyof ( anyof(exists "frop", exists "friep"), anyof(exists "frml", exists "fruts") ) {
 
369
                test_fail "chose wrong dynamic nesting ((false, false),(false,false)) outcome: true";
 
370
        } else {
 
371
                /* Correct */
 
372
        }
 
373
 
 
374
        if anyof ( anyof(exists "to", exists "friep"), anyof(exists "frml", exists "fruts") ) {
 
375
                /* Correct */
 
376
        } else {
 
377
                test_fail "chose wrong dynamic nesting ((true, false),(false,false)) outcome: false";
 
378
        }
 
379
 
 
380
        if anyof ( anyof(exists "frop", exists "from"), anyof(exists "frml", exists "fruts") ) {
 
381
                /* Correct */
 
382
        } else {
 
383
                test_fail "chose wrong dynamic nesting ((false, true),(false,false)) outcome: false";
 
384
        }
 
385
 
 
386
        if anyof ( anyof(exists "frop", exists "friep"), anyof(exists "cc", exists "fruts") ) {
 
387
                /* Correct */
 
388
        } else {
 
389
                test_fail "chose wrong dynamic nesting ((false, false),(true,false)) outcome: false";
 
390
        }
 
391
 
 
392
        if anyof ( anyof(exists "frop", exists "friep"), anyof(exists "frml", exists "subject") ) {
 
393
                /* Correct */
 
394
        } else {
 
395
                test_fail "chose wrong dynamic nesting ((false, false),(false,true)) outcome: false";
 
396
        }
 
397
 
 
398
        if anyof ( anyof(exists "to", exists "friep"), anyof(exists "frml", exists "subject") ) {
 
399
                /* Correct */
 
400
        } else {
 
401
                test_fail "chose wrong dynamic nesting ((true, false),(false,true)) outcome: false";
 
402
        }
 
403
 
 
404
        /* Static/Dynamic */
 
405
 
 
406
        if anyof ( anyof(false, exists "friep"), anyof(exists "frml", exists "fruts") ) {
 
407
                test_fail "chose wrong static/dynamic nesting ((false, false),(false,false)) outcome: true";
 
408
        } else {
 
409
                /* Correct */
 
410
        }
 
411
 
 
412
        if anyof ( anyof(exists "to", false), anyof(exists "frml", exists "fruts") ) {
 
413
                /* Correct */
 
414
        } else {
 
415
                test_fail "chose wrong static/dynamic nesting ((true, false),(false,false)) outcome: false";
 
416
        }
 
417
 
 
418
        if anyof ( anyof(exists "frop", exists "from"), anyof(false, exists "fruts") ) {
 
419
                /* Correct */
 
420
        } else {
 
421
                test_fail "chose wrong static/dynamic nesting ((false, true),(false,false)) outcome: false";
 
422
        }
 
423
 
 
424
        if anyof ( anyof(exists "frop", exists "friep"), anyof(exists "cc", false) ) {
 
425
                /* Correct */
 
426
        } else {
 
427
                test_fail "chose wrong static/dynamic nesting ((false, false),(true,false)) outcome: false";
 
428
        }
 
429
 
 
430
        if anyof ( anyof(exists "frop", exists "friep"), anyof(exists "frml", true) ) {
 
431
                /* Correct */
 
432
        } else {
 
433
                test_fail "chose wrong static/dynamic nesting ((false, false),(false,true)) outcome: false";
 
434
        }
 
435
 
 
436
        if anyof ( anyof(true, exists "friep"), anyof(false, exists "subject") ) {
 
437
                /* Correct */
 
438
        } else {
 
439
                test_fail "chose wrong dynamic nesting ((true, false),(false,true)) outcome: false";
 
440
        }
 
441
 
 
442
}