require "vnd.stalwart.testsuite"; require "comparator-i;ascii-numeric"; require "relational"; require "variables"; require "editheader"; test "Invalid field-name" { if test_script_compile "errors/field-name.sieve" { test_fail "compile should have failed"; } } test "Invalid field-name at runtime " { if not test_script_compile "errors/field-name-runtime.sieve" { test_fail "compile failed"; } } test "Invalid field value" { if not test_script_compile "errors/field-value.sieve" { test_fail "compile failed"; } } test "Command syntax (FIXME: count only)" { if test_script_compile "errors/command-syntax.sieve" { test_fail "compile should have failed"; } } /* * TEST - Size limit */ test "Size limit" { test_config_set "sieve_editheader_max_header_size" "4096"; if not test_script_compile "errors/size-limit.sieve" { test_fail "compile should have succeeded"; } test_config_set "sieve_editheader_max_header_size" "1024"; test_config_reload :extension "editheader"; if test_script_compile "errors/size-limit.sieve" { test_fail "compile should have failed"; } } /* * TEST - Size limit at runtime */ test_config_set "sieve_editheader_max_header_size" ""; test_config_reload :extension "editheader"; test "Size limit at runtime" { if not test_script_compile "errors/size-limit-runtime.sieve" { test_fail "compile should have succeeded"; } test_config_set "sieve_editheader_max_header_size" "1024"; test_config_reload :extension "editheader"; if not test_script_compile "errors/size-limit-runtime.sieve" { test_fail "compile should have succeeded"; } } /* * TEST - Implicit keep at runtime error */ test_set "message" text: From: stephan@example.com To: tss@example.com Subject: Frop Frop! . ; test "Implicit keep at runtime error" { if not test_script_compile "errors/runtime-error.sieve" { test_fail "compile failed"; } }