GODT-1152: Correctly resolve wildcard sequence/UID set

This commit is contained in:
James Houlahan
2021-04-30 10:35:34 +00:00
committed by Jakub Cuth
parent 323303a98b
commit 27cfda680d
5 changed files with 129 additions and 31 deletions

View File

@ -11,7 +11,15 @@ Feature: IMAP fetch messages
Then IMAP response is "OK"
And IMAP response has 10 messages
Scenario: Fetch first few message of inbox
Scenario: Fetch of inbox by UID
Given there are 10 messages in mailbox "INBOX" for "user"
And there is IMAP client logged in as "user"
And there is IMAP client selected in "INBOX"
When IMAP client fetches by UID "1:*"
Then IMAP response is "OK"
And IMAP response has 10 messages
Scenario: Fetch first few messages of inbox
Given there are 10 messages in mailbox "INBOX" for "user"
And there is IMAP client logged in as "user"
And there is IMAP client selected in "INBOX"
@ -19,6 +27,78 @@ Feature: IMAP fetch messages
Then IMAP response is "OK"
And IMAP response has 5 messages
Scenario: Fetch first few messages of inbox
Given there are 10 messages in mailbox "INBOX" for "user"
And there is IMAP client logged in as "user"
And there is IMAP client selected in "INBOX"
When IMAP client fetches by UID "1:5"
Then IMAP response is "OK"
And IMAP response has 5 messages
Scenario: Fetch last few messages of inbox using wildcard
Given there are 10 messages in mailbox "INBOX" for "user"
And there is IMAP client logged in as "user"
And there is IMAP client selected in "INBOX"
When IMAP client fetches "6:*"
Then IMAP response is "OK"
And IMAP response has 5 messages
Scenario: Fetch last few messages of inbox using wildcard by UID
Given there are 10 messages in mailbox "INBOX" for "user"
And there is IMAP client logged in as "user"
And there is IMAP client selected in "INBOX"
When IMAP client fetches by UID "6:*"
Then IMAP response is "OK"
And IMAP response has 5 messages
Scenario: Fetch last message of inbox using wildcard
Given there are 10 messages in mailbox "INBOX" for "user"
And there is IMAP client logged in as "user"
And there is IMAP client selected in "INBOX"
When IMAP client fetches "*"
Then IMAP response is "OK"
And IMAP response has 1 message
Scenario: Fetch last message of inbox using wildcard by UID
Given there are 10 messages in mailbox "INBOX" for "user"
And there is IMAP client logged in as "user"
And there is IMAP client selected in "INBOX"
When IMAP client fetches by UID "*"
Then IMAP response is "OK"
And IMAP response has 1 message
Scenario: Fetch backwards range using wildcard
Given there are 10 messages in mailbox "INBOX" for "user"
And there is IMAP client logged in as "user"
And there is IMAP client selected in "INBOX"
When IMAP client fetches "*:1"
Then IMAP response is "OK"
And IMAP response has 10 messages
Scenario: Fetch backwards range using wildcard by UID
Given there are 10 messages in mailbox "INBOX" for "user"
And there is IMAP client logged in as "user"
And there is IMAP client selected in "INBOX"
When IMAP client fetches by UID "*:1"
Then IMAP response is "OK"
And IMAP response has 10 messages
Scenario: Fetch overshot range using wildcard returns last message
Given there are 10 messages in mailbox "INBOX" for "user"
And there is IMAP client logged in as "user"
And there is IMAP client selected in "INBOX"
When IMAP client fetches "20:*"
Then IMAP response is "OK"
And IMAP response has 1 message
Scenario: Fetch overshot range using wildcard by UID returns last message
Given there are 10 messages in mailbox "INBOX" for "user"
And there is IMAP client logged in as "user"
And there is IMAP client selected in "INBOX"
When IMAP client fetches by UID "20:*"
Then IMAP response is "OK"
And IMAP response has 1 message
Scenario: Fetch of custom mailbox
Given there are 10 messages in mailbox "Folders/mbox" for "user"
And there is IMAP client logged in as "user"
@ -27,7 +107,8 @@ Feature: IMAP fetch messages
Then IMAP response is "OK"
And IMAP response has 10 messages
Scenario: Fetch of emtpy mailbox
# This test is wrong! RFC says it should return "BAD" (GODT-1153).
Scenario: Fetch of empty mailbox
Given there is IMAP client logged in as "user"
And there is IMAP client selected in "Folders/mbox"
When IMAP client fetches "1:*"
@ -42,14 +123,6 @@ Feature: IMAP fetch messages
Then IMAP response is "OK"
And IMAP response has 100 messages
Scenario: Fetch returns alsways latest messages
Given there are 10 messages in mailbox "Folders/mbox" for "user"
And there is IMAP client logged in as "user"
And there is IMAP client selected in "Folders/mbox"
When IMAP client fetches by UID "11:*"
Then IMAP response is "OK"
And IMAP response has 1 message
Scenario: Fetch returns also messages that are marked as deleted
Given there are messages in mailbox "Folders/mbox" for "user"
| from | to | subject | body | read | starred | deleted |