Skip to content

Commit 5d8d440

Browse files
committed
Rename yo_opt to from_yo (in tests)
1 parent ef4dc2b commit 5d8d440

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

src/naive/date/tests.rs

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -167,33 +167,33 @@ fn test_date_from_ymd() {
167167

168168
#[test]
169169
fn test_date_from_yo() {
170-
let yo_opt = NaiveDate::from_yo_opt;
170+
let from_yo = NaiveDate::from_yo_opt;
171171
let ymd = |y, m, d| NaiveDate::from_ymd_opt(y, m, d).unwrap();
172172

173-
assert_eq!(yo_opt(2012, 0), None);
174-
assert_eq!(yo_opt(2012, 1), Some(ymd(2012, 1, 1)));
175-
assert_eq!(yo_opt(2012, 2), Some(ymd(2012, 1, 2)));
176-
assert_eq!(yo_opt(2012, 32), Some(ymd(2012, 2, 1)));
177-
assert_eq!(yo_opt(2012, 60), Some(ymd(2012, 2, 29)));
178-
assert_eq!(yo_opt(2012, 61), Some(ymd(2012, 3, 1)));
179-
assert_eq!(yo_opt(2012, 100), Some(ymd(2012, 4, 9)));
180-
assert_eq!(yo_opt(2012, 200), Some(ymd(2012, 7, 18)));
181-
assert_eq!(yo_opt(2012, 300), Some(ymd(2012, 10, 26)));
182-
assert_eq!(yo_opt(2012, 366), Some(ymd(2012, 12, 31)));
183-
assert_eq!(yo_opt(2012, 367), None);
184-
assert_eq!(yo_opt(2012, 1 << 28 | 60), None);
185-
186-
assert_eq!(yo_opt(2014, 0), None);
187-
assert_eq!(yo_opt(2014, 1), Some(ymd(2014, 1, 1)));
188-
assert_eq!(yo_opt(2014, 2), Some(ymd(2014, 1, 2)));
189-
assert_eq!(yo_opt(2014, 32), Some(ymd(2014, 2, 1)));
190-
assert_eq!(yo_opt(2014, 59), Some(ymd(2014, 2, 28)));
191-
assert_eq!(yo_opt(2014, 60), Some(ymd(2014, 3, 1)));
192-
assert_eq!(yo_opt(2014, 100), Some(ymd(2014, 4, 10)));
193-
assert_eq!(yo_opt(2014, 200), Some(ymd(2014, 7, 19)));
194-
assert_eq!(yo_opt(2014, 300), Some(ymd(2014, 10, 27)));
195-
assert_eq!(yo_opt(2014, 365), Some(ymd(2014, 12, 31)));
196-
assert_eq!(yo_opt(2014, 366), None);
173+
assert_eq!(from_yo(2012, 0), None);
174+
assert_eq!(from_yo(2012, 1), Some(ymd(2012, 1, 1)));
175+
assert_eq!(from_yo(2012, 2), Some(ymd(2012, 1, 2)));
176+
assert_eq!(from_yo(2012, 32), Some(ymd(2012, 2, 1)));
177+
assert_eq!(from_yo(2012, 60), Some(ymd(2012, 2, 29)));
178+
assert_eq!(from_yo(2012, 61), Some(ymd(2012, 3, 1)));
179+
assert_eq!(from_yo(2012, 100), Some(ymd(2012, 4, 9)));
180+
assert_eq!(from_yo(2012, 200), Some(ymd(2012, 7, 18)));
181+
assert_eq!(from_yo(2012, 300), Some(ymd(2012, 10, 26)));
182+
assert_eq!(from_yo(2012, 366), Some(ymd(2012, 12, 31)));
183+
assert_eq!(from_yo(2012, 367), None);
184+
assert_eq!(from_yo(2012, 1 << 28 | 60), None);
185+
186+
assert_eq!(from_yo(2014, 0), None);
187+
assert_eq!(from_yo(2014, 1), Some(ymd(2014, 1, 1)));
188+
assert_eq!(from_yo(2014, 2), Some(ymd(2014, 1, 2)));
189+
assert_eq!(from_yo(2014, 32), Some(ymd(2014, 2, 1)));
190+
assert_eq!(from_yo(2014, 59), Some(ymd(2014, 2, 28)));
191+
assert_eq!(from_yo(2014, 60), Some(ymd(2014, 3, 1)));
192+
assert_eq!(from_yo(2014, 100), Some(ymd(2014, 4, 10)));
193+
assert_eq!(from_yo(2014, 200), Some(ymd(2014, 7, 19)));
194+
assert_eq!(from_yo(2014, 300), Some(ymd(2014, 10, 27)));
195+
assert_eq!(from_yo(2014, 365), Some(ymd(2014, 12, 31)));
196+
assert_eq!(from_yo(2014, 366), None);
197197
}
198198

199199
#[test]

0 commit comments

Comments
 (0)