Skip to content
Snippets Groups Projects
Commit d4ee6c85 authored by Stephan Bosch's avatar Stephan Bosch
Browse files

tests: imap4flags extension: Added more tests involving variables.

parent 8b9f5e2e
No related branches found
No related tags found
No related merge requests found
...@@ -102,6 +102,78 @@ test "Flag operations" { ...@@ -102,6 +102,78 @@ test "Flag operations" {
if hasflag "D" { if hasflag "D" {
test_fail "removed flag still present"; 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" { test "Setflag; string list" {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment

Consent

On this website, we use the web analytics service Matomo to analyze and review the use of our website. Through the collected statistics, we can improve our offerings and make them more appealing for you. Here, you can decide whether to allow us to process your data and set corresponding cookies for these purposes, in addition to technically necessary cookies. Further information on data protection—especially regarding "cookies" and "Matomo"—can be found in our privacy policy. You can withdraw your consent at any time.