mirror of
git://git.psyc.eu/libpsyc
synced 2024-08-15 03:19:02 +00:00
fixed bug in PacketId::from_bytes
This commit is contained in:
parent
5fb7482565
commit
2ca0949327
2 changed files with 19 additions and 6 deletions
|
@ -40,6 +40,19 @@ fn test_empty() {
|
|||
assert_eq!(parser.parse(&test_data).unwrap(), PsycListParserResult::Complete);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_empty_element() {
|
||||
let test_data = "|".to_string().into_bytes();
|
||||
|
||||
let mut parser = PsycListParser::new();
|
||||
|
||||
let expected = PsycListParserResult::ListElement {
|
||||
value: b""
|
||||
};
|
||||
|
||||
assert_eq!(parser.parse(&test_data).unwrap(), expected);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_incomplete() {
|
||||
let test_data1 = "|8 element".to_string().into_bytes();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue