blob 1c137481e2cb7c74dacf50dfb6bd926b32b677c6 1059 bytes (raw)
name: test/date-parser # note: path name is non-authoritative(*)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
| | #!/bin/bash
test_description="date parser"
. ./test-lib.sh
# Note: 2011-1-11 is Tuesday
test_begin_subtest "Date/time parsing"
cat > input <<EOF
now -> 2011-01-11 11:11:00
2010-1-1 -> 2010-01-01 00:00:00
Jan 2 -> 2011-01-02 00:00:00
last Friday -> 2011-01-07 00:00:00
2 hours ago -> 2011-01-11 09:11:00
last month -> 2010-12-11 11:11:00
month ago -> 2010-12-11 11:11:00
8am -> 2011-01-11 08:00:00
9:15 -> 2011-01-11 09:15:00
12:34 -> 2011-01-11 12:34:00
EOF
output=$(../getdate-test "2011-1-11 11:11" < input)
test_expect_equal "$output" "$(cat input)"
test_begin_subtest "Broken - implicitely, we mean the past"
cat > input <<EOF
monday -> 2011-01-10 00:00:00
yesterday -> 2011-01-10 00:00:00
tomorrow -> 2011-01-12 00:00:00
EOF
output=$(../getdate-test "2011-1-11 11:11" < input)
test_expect_equal "$output" "$(cat input)"
# TODO: Some values should depend whether used with after/before (e.g.
# query "before:yesterday or after:yesterday" should return everything
# except mails from yesterday)
test_done
|
debug log:
solving 1c13748 ...
found 1c13748 in https://yhetil.org/notmuch/1295783247-21900-5-git-send-email-sojkam1@fel.cvut.cz/
applying [1/1] https://yhetil.org/notmuch/1295783247-21900-5-git-send-email-sojkam1@fel.cvut.cz/
diff --git a/test/date-parser b/test/date-parser
new file mode 100755
index 0000000..1c13748
Checking patch test/date-parser...
Applied patch test/date-parser cleanly.
index at:
100755 1c137481e2cb7c74dacf50dfb6bd926b32b677c6 test/date-parser
(*) Git path names are given by the tree(s) the blob belongs to.
Blobs themselves have no identifier aside from the hash of its contents.^
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).