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
2727 assert_eq!(msg.summary().as_ref(), "hello");
2828 }
2929
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+
3043 #[test]
3144 fn only_title_trailing_newline_is_retained() {
3245 let msg = MessageRef::from_bytes(b"hello there\n");