Skip to content

Commit 2451e17

Browse files
committed
move test
1 parent ea3c725 commit 2451e17

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

components/calendar/src/date.rs

+20
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,7 @@ impl<A> Copy for Date<A> where A: AsCalendar + Copy {}
460460
#[cfg(test)]
461461
mod tests {
462462
use super::*;
463+
use crate::types::Weekday;
463464

464465
#[test]
465466
fn test_ord() {
@@ -489,4 +490,23 @@ mod tests {
489490
}
490491
}
491492
}
493+
494+
#[test]
495+
fn test_day_of_week() {
496+
// June 23, 2021 is a Wednesday
497+
assert_eq!(
498+
Date::try_new_iso(2021, 6, 23).unwrap().day_of_week(),
499+
Weekday::Wednesday,
500+
);
501+
// Feb 2, 1983 was a Wednesday
502+
assert_eq!(
503+
Date::try_new_iso(1983, 2, 2).unwrap().day_of_week(),
504+
Weekday::Wednesday,
505+
);
506+
// Jan 21, 2021 was a Tuesday
507+
assert_eq!(
508+
Date::try_new_iso(2020, 1, 21).unwrap().day_of_week(),
509+
Weekday::Tuesday,
510+
);
511+
}
492512
}

0 commit comments

Comments
 (0)