From b25fe4549c158d58a3275261d29f1332930dd3aa Mon Sep 17 00:00:00 2001 From: Konstantin Date: Wed, 11 Apr 2018 23:16:23 +0200 Subject: [PATCH] =?UTF-8?q?added=20test=20for=20date=20comparison=20for=20?= =?UTF-8?q?max=20january=20vs=20max=20february=20on=20a=20non=20leap=20yea?= =?UTF-8?q?r=CB=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/iii_conventions/N25ComparisonKtTest.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/iii_conventions/N25ComparisonKtTest.kt b/test/iii_conventions/N25ComparisonKtTest.kt index 4031bc681..2592c5fe3 100644 --- a/test/iii_conventions/N25ComparisonKtTest.kt +++ b/test/iii_conventions/N25ComparisonKtTest.kt @@ -22,6 +22,12 @@ class N25ComparisonKtTest { assertTrue("The date ${first.s} should be after ${second.s}", first > second) } + @Test fun testMaxJanuaryBeforeMaxFebruaryNotLeapYear() { + val first = MyDate(2015, 1, 31) + val second = MyDate(2015, 2, 28) + assertTrue("The date ${first.s} should be before ${second.s}", first < second) + } + /* If you declare 'compareTo' as an extension function, remove this one to make the code compile */ operator fun MyDate.compareTo(other: MyDate): Int = todoTask25() } \ No newline at end of file