Skip to content

Commit f82b2e9

Browse files
authored
Add a test to construct clock with negative 120 minutes (#996)
* Add a test to construct clock with negative 120 minutes * Cover hour wrapping as well
1 parent c096ca3 commit f82b2e9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

exercises/clock/tests/clock.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,12 @@ fn test_negative_sixty_minutes_is_prev_hour() {
111111
assert_eq!(Clock::new(2, -60).to_string(), "01:00");
112112
}
113113

114+
#[test]
115+
#[ignore]
116+
fn test_negative_one_twenty_minutes_is_two_prev_hours() {
117+
assert_eq!(Clock::new(1, -120).to_string(), "23:00");
118+
}
119+
114120
#[test]
115121
#[ignore]
116122
fn test_negative_hour_and_minutes_both_roll_over() {

0 commit comments

Comments
 (0)