Skip to content

Commit

Permalink
Envelope to regex test (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdecimus committed Sep 2, 2024
1 parent b8d5d52 commit 82ef6a3
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/testsuite.svtest
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
require "vnd.stalwart.testsuite";
require "envelope";
require "regex";
require "variables";

/* Test message environment */

Expand Down Expand Up @@ -79,5 +81,14 @@ test "Envelope Environment" {
if not envelope :is "auth" "zilla" {
test_fail "envelope.auth data not reset properly (2).";
}*/
}

test_set "envelope.to" "alias.bob@domain";
if envelope :regex "to" "alias\.([^.]+)@(.+)$" {
set "to" "${1}@${2}";
if not string :is "${to}" "bob@domain" {
test_fail "exact match fails '${to}' '${2}'";
}
} else {
test_fail "envelope.to regex failed.";
}
}

0 comments on commit 82ef6a3

Please sign in to comment.