aboutsummaryrefslogtreecommitdiff
path: root/tests/common/fragments.rs
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2024-01-04 12:09:16 +0100
committerQuentin Dufour <quentin@deuxfleurs.fr>2024-01-04 12:09:16 +0100
commit7ae9966675c85b34f1a99d81062b44b74385a15b (patch)
tree9f52832b90685913beda8f1bf19a22b2ec7bc6c6 /tests/common/fragments.rs
parent3f5d7fa766c268923c0c2c6e1dd50f4693f51a44 (diff)
downloadaerogramme-7ae9966675c85b34f1a99d81062b44b74385a15b.tar.gz
aerogramme-7ae9966675c85b34f1a99d81062b44b74385a15b.zip
test enable
Diffstat (limited to 'tests/common/fragments.rs')
-rw-r--r--tests/common/fragments.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/common/fragments.rs b/tests/common/fragments.rs
index c8d5ef1..3ed14cc 100644
--- a/tests/common/fragments.rs
+++ b/tests/common/fragments.rs
@@ -35,6 +35,7 @@ pub enum Extension {
Unselect,
Move,
CondStore,
+ LiteralPlus,
}
pub enum Enable {
@@ -72,9 +73,10 @@ pub fn capability(imap: &mut TcpStream, ext: Extension) -> Result<()> {
Extension::Unselect => Some("UNSELECT"),
Extension::Move => Some("MOVE"),
Extension::CondStore => Some("CONDSTORE"),
+ Extension::LiteralPlus => Some("LITERAL+"),
};
- let mut buffer: [u8; 1500] = [0; 1500];
+ let mut buffer: [u8; 6000] = [0; 6000];
let read = read_lines(imap, &mut buffer, Some(&b"5 OK"[..]))?;
let srv_msg = std::str::from_utf8(read)?;
assert!(srv_msg.contains("IMAP4REV1"));
@@ -97,6 +99,15 @@ pub fn login(imap: &mut TcpStream, account: Account) -> Result<()> {
Ok(())
}
+pub fn login_with_literal(imap: &mut TcpStream, account: Account) -> Result<()> {
+ let mut buffer: [u8; 1500] = [0; 1500];
+
+ assert!(matches!(account, Account::Alice));
+ imap.write(&b"10 login {5+}\r\nalice {7+}\r\nhunter2\r\n"[..])?;
+ let _read = read_lines(imap, &mut buffer, Some(&b"10 OK"[..]))?;
+ Ok(())
+}
+
pub fn create_mailbox(imap: &mut TcpStream, mbx: Mailbox) -> Result<()> {
let mut buffer: [u8; 1500] = [0; 1500];