Showing the changes to git-object/tests/immutable/commit (1 of 3 files). Show all
Unified · Split
| @@ -27,6 +27,19 @@ fn title_and_body() { · 26 unmodified lines | |||
| 27 | assert_eq!(msg.summary().as_ref(), "hello"); | 27 | assert_eq!(msg.summary().as_ref(), "hello"); |
| 28 | } | 28 | } |
| 29 | 29 | ||
| 30 | #[test] | ||
| 31 | fn title_and_body_inconsistent_newlines() { | ||
| 32 | let msg = MessageRef::from_bytes(b"hello\n\r\nthere"); | ||
| 33 | assert_eq!( | ||
| 34 | msg, | ||
| 35 | MessageRef { | ||
| 36 | title: b"hello".as_bstr(), | ||
| 37 | body: Some("there".into()) | ||
| 38 | } | ||
| 39 | ); | ||
| 40 | assert_eq!(msg.summary().as_ref(), "hello"); | ||
| 41 | } | ||
| 42 | |||
| 30 | #[test] | 43 | #[test] |
| 31 | fn only_title_trailing_newline_is_retained() { | 44 | fn only_title_trailing_newline_is_retained() { |
| 32 | let msg = MessageRef::from_bytes(b"hello there\n"); | 45 | let msg = MessageRef::from_bytes(b"hello there\n"); |