From 91eb50e03db186a7f9b2429e09d1571b0e4aca55 Mon Sep 17 00:00:00 2001 From: Stephan Bosch <stephan@rename-it.nl> Date: Sat, 2 Aug 2008 13:02:22 +0200 Subject: [PATCH] Testsuite: added new tests for the variables extension. --- TODO | 1 + tests/extensions/variables/errors.svtest | 2 +- tests/extensions/variables/errors/set.sieve | 3 +++ tests/extensions/variables/string.svtest | 9 +++++++++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/TODO b/TODO index 20c6231d4..b85c8c438 100644 --- a/TODO +++ b/TODO @@ -16,6 +16,7 @@ Next (in order of descending priority/precedence): nesting. - Limit the maximum number of included scripts - Make (configurable) limit on the number of redirects + - Implement limits recommended by the variables RFC (5229) - Malicious/Broken binary can allocate large variable storage * Finish the test suite for the base functionality * Make sure cmusieve can be replaced seamlessly with the new plugin. diff --git a/tests/extensions/variables/errors.svtest b/tests/extensions/variables/errors.svtest index afc130d44..bd1e3ada6 100644 --- a/tests/extensions/variables/errors.svtest +++ b/tests/extensions/variables/errors.svtest @@ -18,7 +18,7 @@ test "Invalid set command invocations (FIXME: count only)" { test_fail "compile should have failed"; } - if not test_error :count "eq" :comparator "i;ascii-numeric" "6" { + if not test_error :count "eq" :comparator "i;ascii-numeric" "7" { test_fail "wrong number of errors reported"; } } diff --git a/tests/extensions/variables/errors/set.sieve b/tests/extensions/variables/errors/set.sieve index f3cb5fd46..07c393a57 100644 --- a/tests/extensions/variables/errors/set.sieve +++ b/tests/extensions/variables/errors/set.sieve @@ -14,3 +14,6 @@ set "0" "frop"; # Not an error set :UPPER "name" "frop"; + +# Invalid tag +set :inner "name" "frop"; diff --git a/tests/extensions/variables/string.svtest b/tests/extensions/variables/string.svtest index a2d4aa6ec..13a998128 100644 --- a/tests/extensions/variables/string.svtest +++ b/tests/extensions/variables/string.svtest @@ -26,3 +26,12 @@ test "RFC example" { test_fail "test should have matched: \" ${state} \""; } } + +test "No whitespace stripping" { + set "vara" " value "; + set "varb" "value"; + + if not string :is :comparator "i;octet" "${vara}" " ${varb} " { + test_fail "string test seems to have stripped white space"; + } +} -- GitLab