Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions test/IMAPParsersTest.hs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ scriptedConnection steps = do
line :: String -> ReadStep
line = ReadLine . BS.pack

bytes :: String -> ReadStep
bytes = ReadBytes . BS.pack

okLine :: String -> ReadStep
okLine = line . ("000000 OK " ++)

Expand Down Expand Up @@ -438,6 +441,15 @@ imapFetchTest =
, okLine "STORE completed"
]
IMAP.store conn 42 (IMAP.PlusFlags [Seen])
, "fetch works when BODY precedes UID" ~: TestCase $ do
(conn, _) <- scriptedConnection
[ line "* 12 FETCH (BODY[] {5}"
, bytes "hello"
, line " UID 999)"
, okLine "FETCH completed"
]
fetched <- IMAP.fetch conn 999
BS.pack "hello" @=? fetched
]

testData = [ "base" ~: baseTest
Expand Down
Loading