Showing the changes to git-object/tests/immutable/commit (1 of 2 files). Show all
Unified · Split
| @@ -24,5 +24,18 @@ fn only_title_trailing_newline_is_retained() { · 23 unmodified lines | |||
| 24 | body: None | 24 | body: None |
| 25 | } | 25 | } |
| 26 | ); | 26 | ); |
| 27 | assert_eq!(msg.summary().as_ref(), "hello there\n"); | 27 | assert_eq!(msg.summary().as_ref(), "hello there"); |
| 28 | } | ||
| 29 | |||
| 30 | #[test] | ||
| 31 | fn title_with_whitespace_and_body() { | ||
| 32 | let msg = MessageRef::from_bytes(b"hello \t \r\n there\nanother line\n\nthe body\n\n"); | ||
| 33 | assert_eq!(msg.summary().as_ref(), "hello there another line"); | ||
| 34 | assert_eq!( | ||
| 35 | msg, | ||
| 36 | MessageRef { | ||
| 37 | title: b"hello \t \r\n there\nanother line".as_bstr(), | ||
| 38 | body: Some(b"the body\n\n".as_bstr()) | ||
| 39 | } | ||
| 40 | ); | ||
| 28 | } | 41 | } |