Skip to content

Commit

Permalink
Fix inconsistent encoding of months
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarek Ankowski authored and svtk committed Mar 19, 2018
1 parent 1d173f9 commit 56efcf3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/iii_conventions/n30DestructuringDeclarations.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ fun isLeapDay(date: MyDate): Boolean {
// val (year, month, dayOfMonth) = date
//
// // 29 February of a leap year
// return isLeapYear(year) && month == 2 && dayOfMonth == 29
// return isLeapYear(year) && month == 1 && dayOfMonth == 29
}

// Years which are multiples of four (with the exception of years divisible by 100 but not by 400)
Expand Down
4 changes: 2 additions & 2 deletions test/iii_conventions/N30DestructuringDeclarationsKtTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import org.junit.Test

class N30DestructuringDeclarationsKtTest {
@Test fun testIsLeapDay() {
assertTrue(isLeapDay(MyDate(2016, 2, 29)))
assertFalse(isLeapDay(MyDate(2015, 2, 29)))
assertTrue(isLeapDay(MyDate(2016, 1, 29)))
assertFalse(isLeapDay(MyDate(2015, 1, 29)))
}
}

0 comments on commit 56efcf3

Please sign in to comment.