summaryrefslogtreecommitdiff
path: root/rust/leap/tests/leap.rs
blob: 371f27e32f0c8c40698f9783af6503be8aa42123 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
use leap::*;

#[test]
fn year_not_divisible_by_4_in_common_year() {
    assert!(!is_leap_year(2015));
}

#[test]
#[ignore]
fn year_divisible_by_2_not_divisible_by_4_in_common_year() {
    assert!(!is_leap_year(1970));
}

#[test]
#[ignore]
fn year_divisible_by_4_not_divisible_by_100_in_leap_year() {
    assert!(is_leap_year(1996));
}

#[test]
#[ignore]
fn year_divisible_by_4_and_5_is_still_a_leap_year() {
    assert!(is_leap_year(1960));
}

#[test]
#[ignore]
fn year_divisible_by_100_not_divisible_by_400_in_common_year() {
    assert!(!is_leap_year(2100));
}

#[test]
#[ignore]
fn year_divisible_by_100_but_not_by_3_is_still_not_a_leap_year() {
    assert!(!is_leap_year(1900));
}

#[test]
#[ignore]
fn year_divisible_by_400_is_leap_year() {
    assert!(is_leap_year(2000));
}

#[test]
#[ignore]
fn year_divisible_by_400_but_not_by_125_is_still_a_leap_year() {
    assert!(is_leap_year(2400));
}

#[test]
#[ignore]
fn year_divisible_by_200_not_divisible_by_400_in_common_year() {
    assert!(!is_leap_year(1800));
}