Use CRLF as line ending in test files
This commit is contained in:
parent
aa6580e0c3
commit
9675cdb545
23 changed files with 744 additions and 728 deletions
|
@ -851,7 +851,7 @@ mod tests {
|
||||||
for pref in prefixes.iter() {
|
for pref in prefixes.iter() {
|
||||||
println!("{}", pref);
|
println!("{}", pref);
|
||||||
let txt = fs::read(format!("{}.eml", pref))?;
|
let txt = fs::read(format!("{}.eml", pref))?;
|
||||||
let exp = fs::read(format!("{}.body", pref))?;
|
let exp = fs::read(format!("{}.dovecot.body", pref))?;
|
||||||
let message = Message::parse(&txt).unwrap();
|
let message = Message::parse(&txt).unwrap();
|
||||||
|
|
||||||
let mut resp = Vec::new();
|
let mut resp = Vec::new();
|
||||||
|
@ -864,6 +864,7 @@ mod tests {
|
||||||
let exp_str = String::from_utf8_lossy(exp_no_parenthesis).to_lowercase();
|
let exp_str = String::from_utf8_lossy(exp_no_parenthesis).to_lowercase();
|
||||||
|
|
||||||
println!("aerogramme: {}\ndovecot: {}", resp_str, exp_str);
|
println!("aerogramme: {}\ndovecot: {}", resp_str, exp_str);
|
||||||
|
//println!("\n\n {} \n\n", String::from_utf8_lossy(&resp));
|
||||||
assert_eq!(resp_str, exp_str);
|
assert_eq!(resp_str, exp_str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
BIN
tests/emails/thirdparty/005.eml
vendored
BIN
tests/emails/thirdparty/005.eml
vendored
Binary file not shown.
15
tests/unix2dos.py
Executable file
15
tests/unix2dos.py
Executable file
|
@ -0,0 +1,15 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
import sys
|
||||||
|
|
||||||
|
buf = ""
|
||||||
|
with open(sys.argv[1], 'r+b') as f:
|
||||||
|
buf = f.read()
|
||||||
|
|
||||||
|
if buf.find(b'\r\n'):
|
||||||
|
print(f"{sys.argv[1]} is already a CRLF file")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
buf = buf.replace(b'\n', b'\r\n')
|
||||||
|
|
||||||
|
with open(sys.argv[1], 'w+b') as f:
|
||||||
|
f.write(buf)
|
Loading…
Reference in a new issue