-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
197 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
require "vnd.stalwart.testsuite"; | ||
require "vnd.stalwart.plugins"; | ||
require "vnd.stalwart.foreveryline"; | ||
require "relational"; | ||
require "body"; | ||
require "foreverypart"; | ||
require "variables"; | ||
require "extracttext"; | ||
|
||
test_set "message" text: | ||
From: "Cosmo Kramer" <kramer@kramerica.com> | ||
From: George Constanza <george@yankees.com> | ||
From: Art Vandelay <art@vandelay.com> (Vandelay Industries) | ||
To: "Colleagues": "James Smythe" <james@vandelay.com>; Friends: | ||
jane@example.com, =?UTF-8?Q?John_Sm=C3=AEth?= <john@example.com>; | ||
Date: Sat, 20 Nov 2021 14:22:01 -0800 | ||
Subject: Is dinner ready? | ||
|
||
Hi. | ||
|
||
We lost the game. | ||
Are you hungry yet? | ||
|
||
Joe. | ||
. | ||
; | ||
|
||
|
||
test "Functions" { | ||
if not string :is "${header.subject.len()}" "16" { | ||
test_fail "header.subject.len() is ${header.subject.len()}"; | ||
} | ||
|
||
set "my_untrimmed_text" " hello world "; | ||
if string :is "${my_untrimmed_text.trim()}" "${my_untrimmed_text}" { | ||
test_fail "trim() failed"; | ||
} | ||
|
||
if string :is "${my_untrimmed_text.trim().len()}" "${my_untrimmed_text.len()}" { | ||
test_fail "chained functions failed ${my_untrimmed_text.trim().len()} != ${my_untrimmed_text.len()}"; | ||
} | ||
} |