Skip to content

Commit f852243

Browse files
committed
add another very special commit for parsing tests
1 parent d3f65d8 commit f852243

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

gix-object/tests/commit/from_bytes.rs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,32 @@ fn pre_epoch() -> crate::Result {
160160
Ok(())
161161
}
162162

163+
#[test]
164+
fn double_dash_special_time_offset() -> crate::Result {
165+
let signature = || SignatureRef {
166+
name: "name".into(),
167+
email: "[email protected]".into(),
168+
time: Time {
169+
seconds: 1288373970,
170+
offset: -252000,
171+
sign: Sign::Minus,
172+
},
173+
};
174+
assert_eq!(
175+
CommitRef::from_bytes(&fixture_name("commit", "double-dash-date-offset.txt"))?,
176+
CommitRef {
177+
tree: b"0a851d7a2a66084ab10516c406a405d147e974ad".as_bstr(),
178+
parents: SmallVec::from(vec![b"31350f4f0f459485eff2131517e3450cf251f6fa".as_bstr()]),
179+
author: signature(),
180+
committer: signature(),
181+
encoding: None,
182+
message: "msg\n".into(),
183+
extra_headers: vec![]
184+
}
185+
);
186+
Ok(())
187+
}
188+
163189
#[test]
164190
fn with_trailer() -> crate::Result {
165191
let kim = SignatureRef {
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
tree 0a851d7a2a66084ab10516c406a405d147e974ad
2+
parent 31350f4f0f459485eff2131517e3450cf251f6fa
3+
author name <[email protected]> 1288373970 --700
4+
committer name <[email protected]> 1288373970 --700
5+
6+
msg

0 commit comments

Comments
 (0)