dovecot-2.2-pigeonhole: testsuite: date extension: Added test fo...
pigeonhole at rename-it.nl
pigeonhole at rename-it.nl
Sat Oct 13 11:36:20 EEST 2012
details: http://hg.rename-it.nl/dovecot-2.2-pigeonhole/rev/1963a329c539
changeset: 1691:1963a329c539
user: Stephan Bosch <stephan at rename-it.nl>
date: Wed Sep 26 21:52:32 2012 +0200
description:
testsuite: date extension: Added test for date comparisons.
diffstat:
tests/extensions/date/basic.svtest | 33 +++++++++++++++++++++++++++++++++
1 files changed, 33 insertions(+), 0 deletions(-)
diffs (40 lines):
diff -r bf7b7aa7f667 -r 1963a329c539 tests/extensions/date/basic.svtest
--- a/tests/extensions/date/basic.svtest Wed Sep 26 21:51:46 2012 +0200
+++ b/tests/extensions/date/basic.svtest Wed Sep 26 21:52:32 2012 +0200
@@ -39,3 +39,36 @@
test_fail "matched invalid date: ${0}";
}
}
+
+test "Comparison" {
+ if not date :is "delivery-date" "date" "2009-07-22" {
+ if date :matches "delivery-date" "date" "*" { set "date" "${1}"; }
+ test_fail "date is invalid: ${date}";
+ }
+
+ if not date :value "ge" "delivery-date" "date" "2009-07-22" {
+ test_fail "date comparison ge failed equal";
+ }
+
+ if not date :value "ge" "delivery-date" "date" "2009-07-21" {
+ test_fail "date comparison ge failed greater";
+ }
+
+ if anyof (not date :value "ge" "delivery-date" "date" "2009-06-22",
+ not date :value "ge" "date" "date" "2006-07-22" ) {
+ test_fail "date comparison ge failed much greater";
+ }
+
+ if not date :value "le" "delivery-date" "date" "2009-07-22" {
+ test_fail "date comparison le failed equal";
+ }
+
+ if not date :value "le" "delivery-date" "date" "2009-07-23" {
+ test_fail "date comparison le failed less";
+ }
+
+ if anyof (not date :value "le" "delivery-date" "date" "2009-09-22",
+ not date :value "le" "date" "date" "2012-07-22" ) {
+ test_fail "date comparison ge failed much less";
+ }
+}
More information about the dovecot-cvs
mailing list