History

omg nom parsing works… (#198)

…but really, it's not super nice especially considering the counting of consumed bytes is based on ptr arithmetic.

Sebastian Thiel committed 5 years ago

Commit cd117041 parent d9afc223 files · +46 −55Browse files

Showing the changes to git-object/tests/immutable/commit (1 of 3 files). Show all

Unified · Split

git-object/tests/immutable/commit/message.rs+13−0
@@ -66,6 +66,19 @@ fn title_with_whitespace_and_body() { · 65 unmodified lines
6666 );
6767 }
6868
69+#[test]
70+fn title_with_more_whitespace_and_body() {
71+ let msg = MessageRef::from_bytes(b"hello \r\r\r\n there\nanother line\n\nthe body\n\n");
72+ assert_eq!(msg.summary().as_ref(), "hello there another line");
73+ assert_eq!(
74+ msg,
75+ MessageRef {
76+ title: b"hello \r\r\r\n there\nanother line".as_bstr(),
77+ body: Some(b"the body\n\n".as_bstr())
78+ }
79+ );
80+}
81+
6982 #[test]
7083 fn title_with_whitespace_and_body_windows_lineending() {
7184 let msg = MessageRef::from_bytes(b"hello \r\n \r\n there\nanother line\r\n\r\nthe body\n\r\n");