test boundary
This commit is contained in:
parent
52dc154616
commit
337d1a47c4
1 changed files with 14 additions and 1 deletions
|
@ -24,6 +24,7 @@ pub enum PartNode<'a> {
|
||||||
Composite(PartHeader<'a>, Vec<PartNode<'a>>),
|
Composite(PartHeader<'a>, Vec<PartNode<'a>>),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum Delimiter {
|
pub enum Delimiter {
|
||||||
Next,
|
Next,
|
||||||
Last
|
Last
|
||||||
|
@ -44,6 +45,18 @@ mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_boundary() {
|
fn test_boundary_next() {
|
||||||
|
assert_eq!(
|
||||||
|
boundary(b"hello")(b"\r\n--hello\r\n"),
|
||||||
|
Ok((&b""[..], Delimiter::Next))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_boundary_last() {
|
||||||
|
assert_eq!(
|
||||||
|
boundary(b"hello")(b"\r\n--hello--\r\n"),
|
||||||
|
Ok((&b""[..], Delimiter::Last))
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue