History

Return to safety (#198)

Sebastian Thiel committed 5 years ago

Commit 35313b91 parent cd117043 files · +53 −28Browse 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
@@ -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]
31fn 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]
31fn only_title_trailing_newline_is_retained() {44fn 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");