|
5 | 5 | {
|
6 | 6 | "name": "TestLeapYears/ year not divisible by 4 in common year",
|
7 | 7 | "status": "fail",
|
8 |
| - "test_code": "func TestLeapYears(t *testing.T) {\n\tfor _, tc := range testCases {\n\t\tt.Run(tc.description, func(t *testing.T) {\n\t\t\tactual := IsLeapYear(tc.year)\n\t\t\tif actual != tc.expected {\n\t\t\t\tt.Fatalf(\"IsLeapYear(%d) = %t, want %t\", tc.year, actual, tc.expected)\n\t\t\t}\n\t\t})\n\t}\n}", |
| 8 | + "test_code": "func TestLeapYears(t *testing.T) {\n\ttc := struct {\n\t\tdescription string\n\t\tyear int\n\t\texpected bool\n\t}{\n\t\tdescription: \"year not divisible by 4 in common year\",\n\t\tyear: 2015,\n\t\texpected: false,\n\t}\n\n\tactual := IsLeapYear(tc.year)\n\tif actual != tc.expected {\n\t\tt.Fatalf(\"IsLeapYear(%d) = %t, want %t\", tc.year, actual, tc.expected)\n\t}\n\n}", |
9 | 9 | "message": "\n=== RUN TestLeapYears/year_not_divisible_by_4_in_common_year\n\n leap_test.go:10: IsLeapYear(2015) = true, want false\n\n--- FAIL: TestLeapYears/year_not_divisible_by_4_in_common_year (0.00s)\n"
|
10 | 10 | },
|
11 | 11 | {
|
12 | 12 | "name": "TestLeapYears/ year divisible by 2, not divisible by 4 in common year",
|
13 | 13 | "status": "fail",
|
14 |
| - "test_code": "func TestLeapYears(t *testing.T) {\n\tfor _, tc := range testCases {\n\t\tt.Run(tc.description, func(t *testing.T) {\n\t\t\tactual := IsLeapYear(tc.year)\n\t\t\tif actual != tc.expected {\n\t\t\t\tt.Fatalf(\"IsLeapYear(%d) = %t, want %t\", tc.year, actual, tc.expected)\n\t\t\t}\n\t\t})\n\t}\n}", |
| 14 | + "test_code": "func TestLeapYears(t *testing.T) {\n\ttc := struct {\n\t\tdescription string\n\t\tyear int\n\t\texpected bool\n\t}{\n\t\tdescription: \"year divisible by 2, not divisible by 4 in common year\",\n\t\tyear: 1970,\n\t\texpected: false,\n\t}\n\n\tactual := IsLeapYear(tc.year)\n\tif actual != tc.expected {\n\t\tt.Fatalf(\"IsLeapYear(%d) = %t, want %t\", tc.year, actual, tc.expected)\n\t}\n\n}", |
15 | 15 | "message": "\n=== RUN TestLeapYears/year_divisible_by_2,_not_divisible_by_4_in_common_year\n\n leap_test.go:10: IsLeapYear(1970) = true, want false\n\n--- FAIL: TestLeapYears/year_divisible_by_2,_not_divisible_by_4_in_common_year (0.00s)\n"
|
16 | 16 | },
|
17 | 17 | {
|
18 | 18 | "name": "TestLeapYears/ year divisible by 4, not divisible by 100 in leap year",
|
19 | 19 | "status": "fail",
|
20 |
| - "test_code": "func TestLeapYears(t *testing.T) {\n\tfor _, tc := range testCases {\n\t\tt.Run(tc.description, func(t *testing.T) {\n\t\t\tactual := IsLeapYear(tc.year)\n\t\t\tif actual != tc.expected {\n\t\t\t\tt.Fatalf(\"IsLeapYear(%d) = %t, want %t\", tc.year, actual, tc.expected)\n\t\t\t}\n\t\t})\n\t}\n}", |
| 20 | + "test_code": "func TestLeapYears(t *testing.T) {\n\ttc := struct {\n\t\tdescription string\n\t\tyear int\n\t\texpected bool\n\t}{\n\t\tdescription: \"year divisible by 4, not divisible by 100 in leap year\",\n\t\tyear: 1996,\n\t\texpected: true,\n\t}\n\n\tactual := IsLeapYear(tc.year)\n\tif actual != tc.expected {\n\t\tt.Fatalf(\"IsLeapYear(%d) = %t, want %t\", tc.year, actual, tc.expected)\n\t}\n\n}", |
21 | 21 | "message": "\n=== RUN TestLeapYears/year_divisible_by_4,_not_divisible_by_100_in_leap_year\n\n leap_test.go:10: IsLeapYear(1996) = false, want true\n\n--- FAIL: TestLeapYears/year_divisible_by_4,_not_divisible_by_100_in_leap_year (0.00s)\n"
|
22 | 22 | },
|
23 | 23 | {
|
24 | 24 | "name": "TestLeapYears/ year divisible by 4 and 5 is still a leap year",
|
25 | 25 | "status": "fail",
|
26 |
| - "test_code": "func TestLeapYears(t *testing.T) {\n\tfor _, tc := range testCases {\n\t\tt.Run(tc.description, func(t *testing.T) {\n\t\t\tactual := IsLeapYear(tc.year)\n\t\t\tif actual != tc.expected {\n\t\t\t\tt.Fatalf(\"IsLeapYear(%d) = %t, want %t\", tc.year, actual, tc.expected)\n\t\t\t}\n\t\t})\n\t}\n}", |
| 26 | + "test_code": "func TestLeapYears(t *testing.T) {\n\ttc := struct {\n\t\tdescription string\n\t\tyear int\n\t\texpected bool\n\t}{\n\t\tdescription: \"year divisible by 4 and 5 is still a leap year\",\n\t\tyear: 1960,\n\t\texpected: true,\n\t}\n\n\tactual := IsLeapYear(tc.year)\n\tif actual != tc.expected {\n\t\tt.Fatalf(\"IsLeapYear(%d) = %t, want %t\", tc.year, actual, tc.expected)\n\t}\n\n}", |
27 | 27 | "message": "\n=== RUN TestLeapYears/year_divisible_by_4_and_5_is_still_a_leap_year\n\n leap_test.go:10: IsLeapYear(1960) = false, want true\n\n--- FAIL: TestLeapYears/year_divisible_by_4_and_5_is_still_a_leap_year (0.00s)\n"
|
28 | 28 | },
|
29 | 29 | {
|
30 | 30 | "name": "TestLeapYears/ year divisible by 100, not divisible by 400 in common year",
|
31 | 31 | "status": "fail",
|
32 |
| - "test_code": "func TestLeapYears(t *testing.T) {\n\tfor _, tc := range testCases {\n\t\tt.Run(tc.description, func(t *testing.T) {\n\t\t\tactual := IsLeapYear(tc.year)\n\t\t\tif actual != tc.expected {\n\t\t\t\tt.Fatalf(\"IsLeapYear(%d) = %t, want %t\", tc.year, actual, tc.expected)\n\t\t\t}\n\t\t})\n\t}\n}", |
| 32 | + "test_code": "func TestLeapYears(t *testing.T) {\n\ttc := struct {\n\t\tdescription string\n\t\tyear int\n\t\texpected bool\n\t}{\n\t\tdescription: \"year divisible by 100, not divisible by 400 in common year\",\n\t\tyear: 2100,\n\t\texpected: false,\n\t}\n\n\tactual := IsLeapYear(tc.year)\n\tif actual != tc.expected {\n\t\tt.Fatalf(\"IsLeapYear(%d) = %t, want %t\", tc.year, actual, tc.expected)\n\t}\n\n}", |
33 | 33 | "message": "\n=== RUN TestLeapYears/year_divisible_by_100,_not_divisible_by_400_in_common_year\n\n leap_test.go:10: IsLeapYear(2100) = true, want false\n\n--- FAIL: TestLeapYears/year_divisible_by_100,_not_divisible_by_400_in_common_year (0.00s)\n"
|
34 | 34 | },
|
35 | 35 | {
|
36 | 36 | "name": "TestLeapYears/ year divisible by 100 but not by 3 is still not a leap year",
|
37 | 37 | "status": "fail",
|
38 |
| - "test_code": "func TestLeapYears(t *testing.T) {\n\tfor _, tc := range testCases {\n\t\tt.Run(tc.description, func(t *testing.T) {\n\t\t\tactual := IsLeapYear(tc.year)\n\t\t\tif actual != tc.expected {\n\t\t\t\tt.Fatalf(\"IsLeapYear(%d) = %t, want %t\", tc.year, actual, tc.expected)\n\t\t\t}\n\t\t})\n\t}\n}", |
| 38 | + "test_code": "func TestLeapYears(t *testing.T) {\n\ttc := struct {\n\t\tdescription string\n\t\tyear int\n\t\texpected bool\n\t}{\n\t\tdescription: \"year divisible by 100 but not by 3 is still not a leap year\",\n\t\tyear: 1900,\n\t\texpected: false,\n\t}\n\n\tactual := IsLeapYear(tc.year)\n\tif actual != tc.expected {\n\t\tt.Fatalf(\"IsLeapYear(%d) = %t, want %t\", tc.year, actual, tc.expected)\n\t}\n\n}", |
39 | 39 | "message": "\n=== RUN TestLeapYears/year_divisible_by_100_but_not_by_3_is_still_not_a_leap_year\n\n leap_test.go:10: IsLeapYear(1900) = true, want false\n\n--- FAIL: TestLeapYears/year_divisible_by_100_but_not_by_3_is_still_not_a_leap_year (0.00s)\n"
|
40 | 40 | },
|
41 | 41 | {
|
42 | 42 | "name": "TestLeapYears/ year divisible by 400 is leap year",
|
43 | 43 | "status": "fail",
|
44 |
| - "test_code": "func TestLeapYears(t *testing.T) {\n\tfor _, tc := range testCases {\n\t\tt.Run(tc.description, func(t *testing.T) {\n\t\t\tactual := IsLeapYear(tc.year)\n\t\t\tif actual != tc.expected {\n\t\t\t\tt.Fatalf(\"IsLeapYear(%d) = %t, want %t\", tc.year, actual, tc.expected)\n\t\t\t}\n\t\t})\n\t}\n}", |
| 44 | + "test_code": "func TestLeapYears(t *testing.T) {\n\ttc := struct {\n\t\tdescription string\n\t\tyear int\n\t\texpected bool\n\t}{\n\t\tdescription: \"year divisible by 400 is leap year\",\n\t\tyear: 2000,\n\t\texpected: true,\n\t}\n\n\tactual := IsLeapYear(tc.year)\n\tif actual != tc.expected {\n\t\tt.Fatalf(\"IsLeapYear(%d) = %t, want %t\", tc.year, actual, tc.expected)\n\t}\n\n}", |
45 | 45 | "message": "\n=== RUN TestLeapYears/year_divisible_by_400_is_leap_year\n\n leap_test.go:10: IsLeapYear(2000) = false, want true\n\n--- FAIL: TestLeapYears/year_divisible_by_400_is_leap_year (0.00s)\n"
|
46 | 46 | },
|
47 | 47 | {
|
48 | 48 | "name": "TestLeapYears/ year divisible by 400 but not by 125 is still a leap year",
|
49 | 49 | "status": "fail",
|
50 |
| - "test_code": "func TestLeapYears(t *testing.T) {\n\tfor _, tc := range testCases {\n\t\tt.Run(tc.description, func(t *testing.T) {\n\t\t\tactual := IsLeapYear(tc.year)\n\t\t\tif actual != tc.expected {\n\t\t\t\tt.Fatalf(\"IsLeapYear(%d) = %t, want %t\", tc.year, actual, tc.expected)\n\t\t\t}\n\t\t})\n\t}\n}", |
| 50 | + "test_code": "func TestLeapYears(t *testing.T) {\n\ttc := struct {\n\t\tdescription string\n\t\tyear int\n\t\texpected bool\n\t}{\n\t\tdescription: \"year divisible by 400 but not by 125 is still a leap year\",\n\t\tyear: 2400,\n\t\texpected: true,\n\t}\n\n\tactual := IsLeapYear(tc.year)\n\tif actual != tc.expected {\n\t\tt.Fatalf(\"IsLeapYear(%d) = %t, want %t\", tc.year, actual, tc.expected)\n\t}\n\n}", |
51 | 51 | "message": "\n=== RUN TestLeapYears/year_divisible_by_400_but_not_by_125_is_still_a_leap_year\n\n leap_test.go:10: IsLeapYear(2400) = false, want true\n\n--- FAIL: TestLeapYears/year_divisible_by_400_but_not_by_125_is_still_a_leap_year (0.00s)\n"
|
52 | 52 | },
|
53 | 53 | {
|
54 | 54 | "name": "TestLeapYears/ year divisible by 200, not divisible by 400 in common year",
|
55 | 55 | "status": "fail",
|
56 |
| - "test_code": "func TestLeapYears(t *testing.T) {\n\tfor _, tc := range testCases {\n\t\tt.Run(tc.description, func(t *testing.T) {\n\t\t\tactual := IsLeapYear(tc.year)\n\t\t\tif actual != tc.expected {\n\t\t\t\tt.Fatalf(\"IsLeapYear(%d) = %t, want %t\", tc.year, actual, tc.expected)\n\t\t\t}\n\t\t})\n\t}\n}", |
| 56 | + "test_code": "func TestLeapYears(t *testing.T) {\n\ttc := struct {\n\t\tdescription string\n\t\tyear int\n\t\texpected bool\n\t}{\n\t\tdescription: \"year divisible by 200, not divisible by 400 in common year\",\n\t\tyear: 1800,\n\t\texpected: false,\n\t}\n\n\tactual := IsLeapYear(tc.year)\n\tif actual != tc.expected {\n\t\tt.Fatalf(\"IsLeapYear(%d) = %t, want %t\", tc.year, actual, tc.expected)\n\t}\n\n}", |
57 | 57 | "message": "\n=== RUN TestLeapYears/year_divisible_by_200,_not_divisible_by_400_in_common_year\n\n leap_test.go:10: IsLeapYear(1800) = true, want false\n\n--- FAIL: TestLeapYears/year_divisible_by_200,_not_divisible_by_400_in_common_year (0.00s)\n"
|
58 | 58 | }
|
59 | 59 | ]
|
|
0 commit comments