|
| 1 | +package multi_test_failures |
| 2 | + |
| 3 | +import "core:testing" |
| 4 | + |
| 5 | +@(test) |
| 6 | +/// description = year not divisible by 4 in common year |
| 7 | +test_year_not_divisible_by_4_in_common_year :: proc(t: ^testing.T) { |
| 8 | + testing.expect(t, !is_leap_year(2015)) |
| 9 | +} |
| 10 | + |
| 11 | +@(test) |
| 12 | +/// description = year divisible by 2, not divisible by 4 in common year |
| 13 | +test_year_divisible_by_2_not_divisible_by_4_in_common_year :: proc(t: ^testing.T) { |
| 14 | + testing.expect(t, !is_leap_year(1970)) |
| 15 | +} |
| 16 | + |
| 17 | +@(test) |
| 18 | +/// description = year divisible by 4, not divisible by 100 in leap year |
| 19 | +test_year_divisible_by_4_not_divisible_by_100_in_leap_year :: proc(t: ^testing.T) { |
| 20 | + testing.expect(t, is_leap_year(1996)) |
| 21 | +} |
| 22 | + |
| 23 | +@(test) |
| 24 | +/// description = year divisible by 4 and 5 is still a leap year |
| 25 | +test_year_divisible_by_4_and_5_is_still_a_leap_year :: proc(t: ^testing.T) { |
| 26 | + testing.expect(t, is_leap_year(1960)) |
| 27 | +} |
| 28 | + |
| 29 | +@(test) |
| 30 | +/// description = year divisible by 100, not divisible by 400 in common year |
| 31 | +test_year_divisible_by_100_not_divisible_by_400_in_common_year :: proc(t: ^testing.T) { |
| 32 | + testing.expect(t, !is_leap_year(2100)) |
| 33 | +} |
| 34 | + |
| 35 | +@(test) |
| 36 | +/// description = year divisible by 100 but not by 3 is still not a leap year |
| 37 | +test_year_divisible_by_100_but_not_by_3_is_still_not_a_leap_year :: proc(t: ^testing.T) { |
| 38 | + testing.expect(t, !is_leap_year(1900)) |
| 39 | +} |
| 40 | + |
| 41 | +@(test) |
| 42 | +/// description = year divisible by 400 is leap year |
| 43 | +test_year_divisible_by_400_is_leap_year :: proc(t: ^testing.T) { |
| 44 | + testing.expect(t, is_leap_year(2000)) |
| 45 | +} |
| 46 | + |
| 47 | +@(test) |
| 48 | +/// description = year divisible by 400 but not by 125 is still a leap year |
| 49 | +test_year_divisible_by_400_but_not_by_125_is_still_a_leap_year :: proc(t: ^testing.T) { |
| 50 | + testing.expect(t, is_leap_year(2400)) |
| 51 | +} |
| 52 | + |
| 53 | +@(test) |
| 54 | +/// description = year divisible by 200, not divisible by 400 in common year |
| 55 | +test_year_divisible_by_200_not_divisible_by_400_in_common_year :: proc(t: ^testing.T) { |
| 56 | + testing.expect(t, !is_leap_year(1800)) |
| 57 | +} |
0 commit comments