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

Testsuite: added test for header folding.

parent 35e1b03b
No related branches found
No related tags found
No related merge requests found
...@@ -6,31 +6,34 @@ To: nico@vestingbar.nl ...@@ -6,31 +6,34 @@ To: nico@vestingbar.nl
Subject: Help Subject: Help
X-A: Text X-A: Text
X-B: Text X-B: Text
X-Multiline: This is a multi-line
header body, which should be
unfolded correctly.
Text Text
. .
; ;
test "STRIP-center" { test "Strip center" {
if not header :is "subject" "Help" { if not header :is "subject" "Help" {
test_fail "header test does not strip leading or trailing whitespace"; test_fail "header test does not strip leading or trailing whitespace";
} }
} }
test "STRIP-lead" { test "Strip lead" {
if not header :is "x-a" "Text" { if not header :is "x-a" "Text" {
test_fail "header test does not strip leading whitespace"; test_fail "header test does not strip leading whitespace";
} }
} }
test "STRIP-trail" { test "Strip trail" {
if not header :is "x-b" "Text" { if not header :is "x-b" "Text" {
test_fail "header test does not strip trailing whitespace"; test_fail "header test does not strip trailing whitespace";
} }
} }
test "CONTAINS-EMPTY-exist" { test "Contains empty - exist" {
if not header :contains "subject" "" { if not header :contains "subject" "" {
test_fail "header test :contains match type fails to match \"\" on existing header"; test_fail "header test :contains match type fails to match \"\" on existing header";
} }
...@@ -40,10 +43,15 @@ test "CONTAINS-EMPTY-exist" { ...@@ -40,10 +43,15 @@ test "CONTAINS-EMPTY-exist" {
} }
} }
test "CONTAINS-EMPTY-not-exist" { test "Contains empty - not exist" {
if header :contains "x-nonsense" "" { if header :contains "x-nonsense" "" {
test_fail "header test :contains match type matches \"\" on non-existant header"; test_fail "header test :contains match type matches \"\" on non-existant header";
} }
} }
test "Folded - equals" {
if not header :is "x-multiline"
"This is a multi-line header body, which should be unfolded correctly." {
test_fail "failed to properly unfold folded header.";
}
}
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.