Exercism: Go version of the 'Leap' exercise.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
596 B

6 years ago
  1. package leap
  2. // Source: exercism/problem-specifications
  3. // Commit: 3134d31 leap 1.4.0: negative test: year divisible by 200, not by 400
  4. // Problem Specifications Version: 1.4.0
  5. var testCases = []struct {
  6. year int
  7. expected bool
  8. description string
  9. }{
  10. {2015, false, "year not divisible by 4: common year"},
  11. {1996, true, "year divisible by 4, not divisible by 100: leap year"},
  12. {2100, false, "year divisible by 100, not divisible by 400: common year"},
  13. {2000, true, "year divisible by 400: leap year"},
  14. {1800, false, "year divisible by 200, not divisible by 400: common year"},
  15. }