Skip to content

Commit 11a5fa2

Browse files
committed
refactor
1 parent 8e6f4a9 commit 11a5fa2

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

Diff for: git-date/src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
#![forbid(unsafe_code)]
1010
#![deny(missing_docs, rust_2018_idioms)]
1111

12-
use bstr::BStr;
13-
1412
///
1513
pub mod time;
1614

Diff for: git-date/src/parse.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
use crate::Time;
2+
use bstr::BStr;
3+
14
#[allow(missing_docs)]
25
pub fn parse(input: &BStr) -> Option<Time> {
36
// TODO: actual implementation, this is just to not constantly fail

Diff for: git-date/tests/time/mod.rs

+17
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,20 @@ mod format {
7272
}
7373
}
7474
}
75+
76+
mod parse {
77+
use git_date::time::Sign;
78+
use git_date::Time;
79+
80+
#[test]
81+
fn special_time_is_ok_for_now() {
82+
assert_eq!(
83+
git_date::parse("1979-02-26 18:30:00".into()).unwrap(),
84+
Time {
85+
seconds_since_unix_epoch: 42,
86+
offset_in_seconds: 1800,
87+
sign: Sign::Plus,
88+
}
89+
);
90+
}
91+
}

0 commit comments

Comments
 (0)