We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1eca229 commit cadeaabCopy full SHA for cadeaab
git-date/tests/time/parse.rs
@@ -15,7 +15,7 @@ fn special_time_is_ok_for_now() {
15
}
16
17
#[test]
18
-fn parse() {
+fn short() {
19
assert_eq!(
20
git_date::parse("1979-02-26"),
21
Some(Time {
@@ -25,7 +25,10 @@ fn parse() {
25
}),
26
"could not parse with SHORT format"
27
);
28
+}
29
30
+#[test]
31
+fn rfc2822() {
32
33
git_date::parse("Thu, 18 Aug 2022 12:45:06 +0800"),
34
@@ -35,7 +38,10 @@ fn parse() {
35
38
36
39
"could not parse with RFC2822 format"
37
40
41
42
43
44
+fn relative() {
45
let two_weeks_ago = git_date::parse("2 weeks ago").expect("valid time");
46
assert_eq!(Sign::Plus, two_weeks_ago.sign);
47
assert_eq!(0, two_weeks_ago.offset_in_seconds);
0 commit comments