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

Testsuite: added match values test for the :regex match

parent ea223592
No related branches found
No related tags found
No related merge requests found
...@@ -27,6 +27,7 @@ test_cases = \ ...@@ -27,6 +27,7 @@ test_cases = \
tests/match-types/contains.svtest \ tests/match-types/contains.svtest \
tests/match-types/matches.svtest \ tests/match-types/matches.svtest \
tests/match-types/relational.svtest \ tests/match-types/relational.svtest \
tests/match-types/regex.svtest \
tests/address-parts/subaddress.svtest \ tests/address-parts/subaddress.svtest \
tests/extensions/encoded-character.svtest \ tests/extensions/encoded-character.svtest \
tests/extensions/envelope.svtest \ tests/extensions/envelope.svtest \
......
require "vnd.dovecot.testsuite";
require "regex";
require "variables";
# Test overwriting only on match
test "RFC - values overwrite" {
set "sentence1" "the cat jumps off the table";
set "sentence2" "the dog barks at the cat in the alley";
if not string :regex "${sentence1}" "the (.*) jumps off the (.*)" {
test_fail "failed to match first sentence";
}
if not string :is "${1}:${2}" "cat:table" {
test_fail "invalid match values";
}
if string :regex "${sentence2}" "the (.*) barks at the (.*) in the store" {
test_fail "should not have matched second sentence";
}
if not string :is "${1}:${2}" "cat:table" {
test_fail "should have preserved match values";
}
if not string :regex "${sentence2}" "the (.*) barks at the (.*) in the alley" {
test_fail "failed to match the second sentence (second time)";
}
if not string :is "${1}:${2}" "dog:cat" {
test_fail "should have overwritten match values";
}
}
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.