Skip to content

Commit

Permalink
Move specific test into month module
Browse files Browse the repository at this point in the history
  • Loading branch information
djc committed Mar 22, 2022
1 parent abee666 commit 861378f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -942,11 +942,3 @@ fn test_num_days_from_ce_against_alternative_impl() {
assert_eq!(mid_year.num_days_from_ce(), num_days_from_ce(&mid_year), "on {:?}", mid_year);
}
}

#[test]
fn test_month_enum_succ_pred() {
assert_eq!(Month::January.succ(), Month::February);
assert_eq!(Month::December.succ(), Month::January);
assert_eq!(Month::January.pred(), Month::December);
assert_eq!(Month::February.pred(), Month::January);
}
13 changes: 13 additions & 0 deletions src/month.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,3 +304,16 @@ mod month_serde {
}
}
}

#[cfg(test)]
mod tests {
use super::Month;

#[test]
fn test_month_enum_succ_pred() {
assert_eq!(Month::January.succ(), Month::February);
assert_eq!(Month::December.succ(), Month::January);
assert_eq!(Month::January.pred(), Month::December);
assert_eq!(Month::February.pred(), Month::January);
}
}

0 comments on commit 861378f

Please sign in to comment.