1require "vnd.dovecot.testsuite"; 2 3test_set "message" text: 4From: stephan@example.org 5Message-ID: <frop33333333333333333@nl.example.com> 6To: nico@frop.example.org 7Subject: Frop. 8 9Friep. 10. 11; 12 13test "Graceful Conflicts" { 14 if not allof ( 15 test_script_compile "fileinto-inbox.sieve", 16 test_script_run ){ 17 test_fail "failed to compile and run first script"; 18 } 19 20 if not test_result_execute { 21 test_fail "result execute failed after first script"; 22 } 23 24 if not allof ( 25 test_script_compile "reject-1.sieve", 26 test_script_run :append_result ) { 27 test_fail "failed to compile and run second script"; 28 } 29 30 if not test_result_execute { 31 test_fail "result execute failed after second script"; 32 } 33 34 if not allof ( 35 test_script_compile "reject-2.sieve", 36 test_script_run :append_result ) { 37 test_fail "failed to compile and run third script"; 38 } 39 40 if not test_result_execute { 41 test_fail "result execute failed after third script"; 42 } 43 44 if not test_result_action :index 1 "store" { 45 test_result_print; 46 test_fail "first action is not 'store'"; 47 } 48 49 if not test_result_action :index 2 "reject" { 50 test_result_print; 51 test_fail "first reject action not retained"; 52 } 53 54 if test_result_action :index 3 "reject" { 55 test_result_print; 56 test_fail "second reject action not discarded"; 57 } 58 59} 60 61test "Duplicates" { 62 if not allof ( 63 test_script_compile "fileinto-inbox.sieve", 64 test_script_run ){ 65 test_fail "failed to compile and run first script"; 66 } 67 68 if not test_result_execute { 69 test_fail "result execute failed after first script"; 70 } 71 72 if not allof ( 73 test_script_compile "fileinto-inbox.sieve", 74 test_script_run :append_result ) { 75 test_fail "failed to compile and run second script"; 76 } 77 78 if not test_result_execute { 79 test_fail "result execute failed after second script"; 80 } 81 82 if not allof ( 83 test_script_compile "keep.sieve", 84 test_script_run :append_result ) { 85 test_fail "failed to compile and run third script"; 86 } 87 88 if not test_result_execute { 89 test_fail "result execute failed after third script"; 90 } 91 92 if not test_result_action :index 1 "keep" { 93 test_fail "first action is not 'keep'"; 94 } 95 96 if test_result_action :index 2 "store" { 97 test_fail "fileinto action not discarded"; 98 } 99} 100 101