diff options
Diffstat (limited to 'pigeonhole/tests/multiscript/basic.svtest')
-rw-r--r-- | pigeonhole/tests/multiscript/basic.svtest | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/pigeonhole/tests/multiscript/basic.svtest b/pigeonhole/tests/multiscript/basic.svtest new file mode 100644 index 0000000..ce9bb66 --- /dev/null +++ b/pigeonhole/tests/multiscript/basic.svtest @@ -0,0 +1,91 @@ +require "vnd.dovecot.testsuite"; + +test_set "message" text: +From: stephan@example.org +Message-ID: <frop33333333333333333@frutsens.example.nl> +To: nico@frop.example.org +Subject: Frop. + +Friep. +. +; + +test "Append" { + if not allof ( + test_script_compile "fileinto-inbox.sieve", + test_script_run ){ + test_fail "failed to compile and run first script"; + } + + if not allof ( + test_script_compile "vacation.sieve", + test_script_run :append_result ) { + test_fail "failed to compile and run second script"; + } + + if not allof ( + test_script_compile "notify.sieve", + test_script_run :append_result ) { + test_fail "failed to compile and run third script"; + } + + if not test_result_action :index 1 "store" { + test_fail "first action is not 'store'"; + } + + if not test_result_action :index 2 "vacation" { + test_fail "second action is not 'vacation'"; + } + + if not test_result_action :index 3 "notify" { + test_fail "third action is not 'notify'"; + } + + if not test_result_execute { + test_fail "result execute failed"; + } +} + +test "Sequential Execute" { + if not allof ( + test_script_compile "fileinto-inbox.sieve", + test_script_run ) { + test_fail "failed to compile and run first script"; + } + + if not test_result_execute { + test_fail "result execute failed after first script"; + } + + if not allof ( + test_script_compile "vacation.sieve", + test_script_run :append_result ) { + test_fail "failed to compile and run second script"; + } + + if not test_result_execute { + test_fail "result execute failed after second script"; + } + + if not allof ( + test_script_compile "notify.sieve", + test_script_run :append_result ) { + test_fail "failed to compile and run third script"; + } + + if not test_result_execute { + test_fail "result execute failed after third script"; + } + + if not test_result_action :index 1 "store" { + test_fail "first action is not 'store'"; + } + + if not test_result_action :index 2 "vacation" { + test_fail "second action is not 'vacation'"; + } + + if not test_result_action :index 3 "notify" { + test_fail "third action is not 'notify'"; + } +} |