Skip to content

Commit

Permalink
add another very special commit for parsing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Aug 1, 2023
1 parent d3f65d8 commit f852243
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
26 changes: 26 additions & 0 deletions gix-object/tests/commit/from_bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,32 @@ fn pre_epoch() -> crate::Result {
Ok(())
}

#[test]
fn double_dash_special_time_offset() -> crate::Result {
let signature = || SignatureRef {
name: "name".into(),
email: "name@example.com".into(),
time: Time {
seconds: 1288373970,
offset: -252000,
sign: Sign::Minus,
},
};
assert_eq!(
CommitRef::from_bytes(&fixture_name("commit", "double-dash-date-offset.txt"))?,
CommitRef {
tree: b"0a851d7a2a66084ab10516c406a405d147e974ad".as_bstr(),
parents: SmallVec::from(vec![b"31350f4f0f459485eff2131517e3450cf251f6fa".as_bstr()]),
author: signature(),
committer: signature(),
encoding: None,
message: "msg\n".into(),
extra_headers: vec![]
}
);
Ok(())
}

#[test]
fn with_trailer() -> crate::Result {
let kim = SignatureRef {
Expand Down
6 changes: 6 additions & 0 deletions gix-object/tests/fixtures/commit/double-dash-date-offset.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
tree 0a851d7a2a66084ab10516c406a405d147e974ad
parent 31350f4f0f459485eff2131517e3450cf251f6fa
author name <name@example.com> 1288373970 --700
committer name <name@example.com> 1288373970 --700

msg

0 comments on commit f852243

Please sign in to comment.