diff --git a/tests/compile/errors.svtest b/tests/compile/errors.svtest index a5aa212dc5f1c727f54d47505f61854a422b579a..f17ea3f17fc48ae23128cb266ad78945634d85f0 100644 --- a/tests/compile/errors.svtest +++ b/tests/compile/errors.svtest @@ -242,6 +242,20 @@ test "Keep errors (FIXME: count only)" { } } +/* + * Fileinto command + */ + +test "Fileinto errors (FIXME: count only)" { + if test_script_compile "errors/fileinto.sieve" { + test_fail "compile should have failed."; + } + + if not test_error :count "eq" :comparator "i;ascii-numeric" "10" { + test_fail "wrong number of errors reported"; + } +} + /* * COMPARATOR errors */ diff --git a/tests/compile/errors/fileinto.sieve b/tests/compile/errors/fileinto.sieve new file mode 100644 index 0000000000000000000000000000000000000000..0598557dc6b9f2167d0e12876a7949d1517b1a20 --- /dev/null +++ b/tests/compile/errors/fileinto.sieve @@ -0,0 +1,38 @@ +require "fileinto"; +require "encoded-character"; + +/* + * Fileinto errors + * + * Total erors: 9 (+1 = 10) + */ + +# Missing string argument +fileinto; + +# Spurious test +fileinto true; + +# Spurious test +fileinto "Frop" true; + +# Spurious number argument +fileinto 33; + +# Spurious tag argument +fileinto :frop; + +# Spurious additional string argument +fileinto "Frop" "Friep"; + +# Spurious additional number argument +fileinto "Frop" 123; + +# Spurious additional tag argument +fileinto "Frop" :frop; + +# Bad mailbox name +fileinto "${hex:ff}rop"; + +# Not an error +fileinto "Frop";