Skip to content

Commit

Permalink
tests: imap4flags extension: Added more tests involving variables.
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanbosch committed Jan 4, 2018
1 parent b508744 commit 90fad4e
Showing 1 changed file with 72 additions and 0 deletions.
72 changes: 72 additions & 0 deletions tests/extensions/imap4flags/basic.svtest
Expand Up @@ -102,6 +102,78 @@ test "Flag operations" {
if hasflag "D" {
test_fail "removed flag still present";
}

set "var" "G";
addflag "${var}";

if not hasflag "G" {
test_fail "flag \"G\" not added";
}

if not hasflag "A" {
test_fail "flag \"A\" not retained";
}

if not hasflag :comparator "i;ascii-numeric" :count "eq" "6" {
test_fail "hasflag sees something other than six flags";
}
}

test "Variable flag operations" {
setflag "frop" "A";

if not hasflag "frop" "A" {
test_fail "hasflag misses set flag";
}

if hasflag :comparator "i;ascii-numeric" :count "gt" "frop" "1" {
test_fail "hasflag sees more than one flag";
}

addflag "frop" "B";

if not hasflag "frop" "B" {
test_fail "flag \"B\" not added";
}

if not hasflag "frop" "A" {
test_fail "flag \"A\" not retained";
}

if hasflag :comparator "i;ascii-numeric" :count "gt" "frop" "2" {
test_fail "hasflag sees more than two flags";
}

addflag "frop" ["C", "D", "E F"];

if not hasflag :comparator "i;ascii-numeric" :count "eq" "frop" "6" {
test_fail "hasflag sees something other than six flags";
}

removeflag "frop" ["D"];

if not hasflag :comparator "i;ascii-numeric" :count "eq" "frop" "5" {
test_fail "hasflag sees something other than five flags";
}

if hasflag "frop" "D" {
test_fail "removed flag still present";
}

set "var" "G";
addflag "frop" "${var}";

if not hasflag "frop" "G" {
test_fail "flag \"G\" not added";
}

if not hasflag "frop" "A" {
test_fail "flag \"A\" not retained";
}

if not hasflag :comparator "i;ascii-numeric" :count "eq" "frop" "6" {
test_fail "hasflag sees something other than six flags";
}
}

test "Setflag; string list" {
Expand Down

0 comments on commit 90fad4e

Please sign in to comment.