From 0aa7a39a4081eca3b971e72f9a73e7ca4aa7e6d6 Mon Sep 17 00:00:00 2001 From: Lucas Werkmeister Date: Sat, 7 May 2016 18:54:50 +0200 Subject: [PATCH] Rename data_* to date_* --- .../test/ceylon/time/testDateTime.ceylon | 102 ++++++++-------- test-source/test/ceylon/time/testDates.ceylon | 112 +++++++++--------- .../test/ceylon/time/testDayOfWeek.ceylon | 8 +- 3 files changed, 111 insertions(+), 111 deletions(-) diff --git a/test-source/test/ceylon/time/testDateTime.ceylon b/test-source/test/ceylon/time/testDateTime.ceylon index c601dcb9..c3f965b5 100644 --- a/test-source/test/ceylon/time/testDateTime.ceylon +++ b/test-source/test/ceylon/time/testDateTime.ceylon @@ -29,7 +29,7 @@ import ceylon.time.base { april } -DateTime data_1982_12_13_09_08_07_0050 = dateTime { +DateTime date_1982_12_13_09_08_07_0050 = dateTime { year = 1982; month = december; day = 13; hours = 9; minutes = 8; seconds = 7; milliseconds = 50; }; @@ -68,96 +68,96 @@ shared test void testEqualsAndHashDateTime() { } shared test void testPlusYears() { - assertEquals { expected = 2000; actual = data_1982_12_13_09_08_07_0050.plusYears(18).year; }; + assertEquals { expected = 2000; actual = date_1982_12_13_09_08_07_0050.plusYears(18).year; }; } shared test void testMinusYears() { - assertEquals { expected = 1964; actual = data_1982_12_13_09_08_07_0050.minusYears(18).year; }; + assertEquals { expected = 1964; actual = date_1982_12_13_09_08_07_0050.minusYears(18).year; }; } shared test void testPlusMonths() { - assertEquals { expected = january; actual = data_1982_12_13_09_08_07_0050.plusMonths(1).month; }; + assertEquals { expected = january; actual = date_1982_12_13_09_08_07_0050.plusMonths(1).month; }; } shared test void testMinusMonths() { - assertEquals { expected = november; actual = data_1982_12_13_09_08_07_0050.minusMonths(1).month; }; + assertEquals { expected = november; actual = date_1982_12_13_09_08_07_0050.minusMonths(1).month; }; } shared test void testPlusDays() { - assertEquals { expected = 15; actual = data_1982_12_13_09_08_07_0050.plusDays(2).day; }; + assertEquals { expected = 15; actual = date_1982_12_13_09_08_07_0050.plusDays(2).day; }; } shared test void testMinusDays() { - assertEquals { expected = 9; actual = data_1982_12_13_09_08_07_0050.minusDays(4).day; }; + assertEquals { expected = 9; actual = date_1982_12_13_09_08_07_0050.minusDays(4).day; }; } shared test void testPlusHours_DateTime() { - assertEquals { expected = 18; actual = data_1982_12_13_09_08_07_0050.plusHours(9).hours; }; + assertEquals { expected = 18; actual = date_1982_12_13_09_08_07_0050.plusHours(9).hours; }; - value data_1982_12_14_13 = data_1982_12_13_09_08_07_0050.plusHours(28); - assertEquals { expected = 13; actual = data_1982_12_14_13.hours; }; - assertEquals { expected = 14; actual = data_1982_12_14_13.day; }; + value date_1982_12_14_13 = date_1982_12_13_09_08_07_0050.plusHours(28); + assertEquals { expected = 13; actual = date_1982_12_14_13.hours; }; + assertEquals { expected = 14; actual = date_1982_12_14_13.day; }; } shared test void testMinusHours_DateTime() { - assertEquals { expected = 2; actual = data_1982_12_13_09_08_07_0050.minusHours(7).hours; }; + assertEquals { expected = 2; actual = date_1982_12_13_09_08_07_0050.minusHours(7).hours; }; - value data_1982_12_12_5 = data_1982_12_13_09_08_07_0050.minusHours(28); - assertEquals { expected = 5; actual = data_1982_12_12_5.hours; }; - assertEquals { expected = 12; actual = data_1982_12_12_5.day; }; + value date_1982_12_12_5 = date_1982_12_13_09_08_07_0050.minusHours(28); + assertEquals { expected = 5; actual = date_1982_12_12_5.hours; }; + assertEquals { expected = 12; actual = date_1982_12_12_5.day; }; } shared test void testPlusMinutes_DateTime() { - assertEquals { expected = 15; actual = data_1982_12_13_09_08_07_0050.plusMinutes(7).minutes; }; + assertEquals { expected = 15; actual = date_1982_12_13_09_08_07_0050.plusMinutes(7).minutes; }; - value data_1982_12_13_10_3 = data_1982_12_13_09_08_07_0050.plusMinutes(55); - assertEquals { expected = 3; actual = data_1982_12_13_10_3.minutes; }; - assertEquals { expected = 10; actual = data_1982_12_13_10_3.hours; }; + value date_1982_12_13_10_3 = date_1982_12_13_09_08_07_0050.plusMinutes(55); + assertEquals { expected = 3; actual = date_1982_12_13_10_3.minutes; }; + assertEquals { expected = 10; actual = date_1982_12_13_10_3.hours; }; } shared test void testMinusMinutes_DateTime() { - assertEquals { expected = 15; actual = data_1982_12_13_09_08_07_0050.plusMinutes(7).minutes; }; + assertEquals { expected = 15; actual = date_1982_12_13_09_08_07_0050.plusMinutes(7).minutes; }; - value data_1982_12_13_8_15 = data_1982_12_13_09_08_07_0050.minusMinutes(53); - assertEquals { expected = 15; actual = data_1982_12_13_8_15.minutes; }; - assertEquals { expected = 8; actual = data_1982_12_13_8_15.hours; }; + value date_1982_12_13_8_15 = date_1982_12_13_09_08_07_0050.minusMinutes(53); + assertEquals { expected = 15; actual = date_1982_12_13_8_15.minutes; }; + assertEquals { expected = 8; actual = date_1982_12_13_8_15.hours; }; } shared test void testPlusSeconds_DateTime() { - assertEquals { expected = 16; actual = data_1982_12_13_09_08_07_0050.plusSeconds(9).seconds; }; + assertEquals { expected = 16; actual = date_1982_12_13_09_08_07_0050.plusSeconds(9).seconds; }; - value data_1982_12_13_9_9_15 = data_1982_12_13_09_08_07_0050.plusSeconds(53+15); - assertEquals { expected = 15; actual = data_1982_12_13_9_9_15.seconds; }; - assertEquals { expected = 9; actual = data_1982_12_13_9_9_15.minutes; }; + value date_1982_12_13_9_9_15 = date_1982_12_13_09_08_07_0050.plusSeconds(53+15); + assertEquals { expected = 15; actual = date_1982_12_13_9_9_15.seconds; }; + assertEquals { expected = 9; actual = date_1982_12_13_9_9_15.minutes; }; } shared test void testMinusSeconds_DateTime() { - assertEquals { expected = 15; actual = data_1982_12_13_09_08_07_0050.plusMinutes(7).minutes; }; + assertEquals { expected = 15; actual = date_1982_12_13_09_08_07_0050.plusMinutes(7).minutes; }; - value data_1982_12_13_9_7_4 = data_1982_12_13_09_08_07_0050.minusSeconds(7+56); - assertEquals { expected = 4; actual = data_1982_12_13_9_7_4.seconds; }; - assertEquals { expected = 7; actual = data_1982_12_13_9_7_4.minutes; }; + value date_1982_12_13_9_7_4 = date_1982_12_13_09_08_07_0050.minusSeconds(7+56); + assertEquals { expected = 4; actual = date_1982_12_13_9_7_4.seconds; }; + assertEquals { expected = 7; actual = date_1982_12_13_9_7_4.minutes; }; } shared test void testPlusMillis_DateTime() { - assertEquals { expected = 150; actual = data_1982_12_13_09_08_07_0050.plusMilliseconds(100).milliseconds; }; + assertEquals { expected = 150; actual = date_1982_12_13_09_08_07_0050.plusMilliseconds(100).milliseconds; }; - value data_1982_12_13_9_8_15_300 = data_1982_12_13_09_08_07_0050.plusMilliseconds(950+7300); - assertEquals { expected = 300; actual = data_1982_12_13_9_8_15_300.milliseconds; }; - assertEquals { expected = 15; actual = data_1982_12_13_9_8_15_300.seconds; }; + value date_1982_12_13_9_8_15_300 = date_1982_12_13_09_08_07_0050.plusMilliseconds(950+7300); + assertEquals { expected = 300; actual = date_1982_12_13_9_8_15_300.milliseconds; }; + assertEquals { expected = 15; actual = date_1982_12_13_9_8_15_300.seconds; }; } shared test void testMinusMilliseconds_DateTime() { - assertEquals { expected = 950; actual = data_1982_12_13_09_08_07_0050.minusMilliseconds(100).milliseconds; }; + assertEquals { expected = 950; actual = date_1982_12_13_09_08_07_0050.minusMilliseconds(100).milliseconds; }; - value data_1982_12_13_9_8_4_100 = data_1982_12_13_09_08_07_0050.minusMilliseconds(50+2900); - assertEquals { expected = 100; actual = data_1982_12_13_9_8_4_100.milliseconds; }; - assertEquals { expected = 4; actual = data_1982_12_13_9_8_4_100.seconds; }; + value date_1982_12_13_9_8_4_100 = date_1982_12_13_09_08_07_0050.minusMilliseconds(50+2900); + assertEquals { expected = 100; actual = date_1982_12_13_9_8_4_100.milliseconds; }; + assertEquals { expected = 4; actual = date_1982_12_13_9_8_4_100.seconds; }; } shared test void testWithDay40_DateTime() { try { - data_1982_12_13_09_08_07_0050.withDay(40); + date_1982_12_13_09_08_07_0050.withDay(40); fail("Should throw exception..."); } catch( AssertionError e ) { assertTrue(e.message.contains("Invalid date")); @@ -166,7 +166,7 @@ shared test void testWithDay40_DateTime() { shared test void testWithDay0_DateTime() { try { - data_1982_12_13_09_08_07_0050.withDay(0); + date_1982_12_13_09_08_07_0050.withDay(0); fail("Should throw exception..."); } catch( AssertionError e ) { assertTrue(e.message.contains("Invalid date")); @@ -175,7 +175,7 @@ shared test void testWithDay0_DateTime() { shared test void testWithDayNegative_DateTime() { try { - data_1982_12_13_09_08_07_0050.withDay(-10); + date_1982_12_13_09_08_07_0050.withDay(-10); fail("Should throw exception..."); } catch( AssertionError e ) { assertTrue(e.message.contains("Invalid date")); @@ -197,7 +197,7 @@ shared test void testWithDay29FebLeap_DateTime() { shared test void testPredecessor_DateTime() { assertEquals{ - actual = data_1982_12_13_09_08_07_0050.predecessor; + actual = date_1982_12_13_09_08_07_0050.predecessor; expected = dateTime { year = 1982; month = december; day = 13; hours = 9; minutes = 8; seconds = 7; milliseconds = 49; @@ -207,7 +207,7 @@ shared test void testPredecessor_DateTime() { shared test void testSuccessor_DateTime() { assertEquals{ - actual = data_1982_12_13_09_08_07_0050.successor; + actual = date_1982_12_13_09_08_07_0050.successor; expected = dateTime { year = 1982; month = december; day = 13; hours = 9; minutes = 8; seconds = 7; milliseconds = 51; @@ -384,9 +384,9 @@ shared test void testPeriodPreviousStepByMs_DateTime() { } shared test void testEnumerableDateTime() { - assertEquals(data_1982_12_13_09_08_07_0050.offset(data_1982_12_13_09_08_07_0050), 0); - assertEquals(data_1982_12_13_09_08_07_0050.successor.offset(data_1982_12_13_09_08_07_0050), 1); - assertEquals(data_1982_12_13_09_08_07_0050.predecessor.offset(data_1982_12_13_09_08_07_0050), - 1); + assertEquals(date_1982_12_13_09_08_07_0050.offset(date_1982_12_13_09_08_07_0050), 0); + assertEquals(date_1982_12_13_09_08_07_0050.successor.offset(date_1982_12_13_09_08_07_0050), 1); + assertEquals(date_1982_12_13_09_08_07_0050.predecessor.offset(date_1982_12_13_09_08_07_0050), - 1); } shared test void testPeriodFromNewYear_DateTimeNegative() { @@ -410,10 +410,10 @@ shared test void testPeriodTimeStep() { } shared test void testStringDateTime() { - assertEquals { expected = "1982-12-13T09:08:07.050"; actual = data_1982_12_13_09_08_07_0050.string; }; - assertEquals { expected = "0000-12-13T09:08:07.050"; actual = data_1982_12_13_09_08_07_0050.withYear(0).string; }; - assertEquals { expected = "0010-12-13T09:08:07.050"; actual = data_1982_12_13_09_08_07_0050.withYear(10).string; }; - assertEquals { expected = "0100-12-13T09:08:07.050"; actual = data_1982_12_13_09_08_07_0050.withYear(100).string; }; + assertEquals { expected = "1982-12-13T09:08:07.050"; actual = date_1982_12_13_09_08_07_0050.string; }; + assertEquals { expected = "0000-12-13T09:08:07.050"; actual = date_1982_12_13_09_08_07_0050.withYear(0).string; }; + assertEquals { expected = "0010-12-13T09:08:07.050"; actual = date_1982_12_13_09_08_07_0050.withYear(10).string; }; + assertEquals { expected = "0100-12-13T09:08:07.050"; actual = date_1982_12_13_09_08_07_0050.withYear(100).string; }; } void assertFromToDateTime( Period period, DateTime from, DateTime to ) { diff --git a/test-source/test/ceylon/time/testDates.ceylon b/test-source/test/ceylon/time/testDates.ceylon index ddf7a3c9..b14ac47a 100644 --- a/test-source/test/ceylon/time/testDates.ceylon +++ b/test-source/test/ceylon/time/testDates.ceylon @@ -35,7 +35,7 @@ import ceylon.time.base { // Constants Boolean leapYear = true; -Date data_1982_12_13 = date( 1982, december, 13); +Date date_1982_12_13 = date( 1982, december, 13); // Table of test data from the book Calendrical Calculations shared test void test_sun_jul_24_minus586() => assertGregorianDate(-586, july, 24, sunday, !leapYear, 205); @@ -100,16 +100,16 @@ shared test void testWeekOfYear() { } shared test void testDatePlusDays() { - assertEquals( data_1982_12_13.plusDays( 0 ), data_1982_12_13 ); - assertEquals( data_1982_12_13.plusDays( 5 ), date( 1982, december, 18 ) ); - assertEquals( data_1982_12_13.plusDays( 45 ), date( 1983, january, 27 ) ); - assertEquals( data_1982_12_13.plusDays( 10954 ), date( 2012, december, 9 ) ); + assertEquals( date_1982_12_13.plusDays( 0 ), date_1982_12_13 ); + assertEquals( date_1982_12_13.plusDays( 5 ), date( 1982, december, 18 ) ); + assertEquals( date_1982_12_13.plusDays( 45 ), date( 1983, january, 27 ) ); + assertEquals( date_1982_12_13.plusDays( 10954 ), date( 2012, december, 9 ) ); } shared test void testDateMinusDays() { - assertEquals( data_1982_12_13.minusDays( 5 ), date( 1982, december, 8 ) ); - assertEquals( data_1982_12_13.minusDays( 0 ), data_1982_12_13 ); - assertEquals( date( 2012, december, 9 ).minusDays( 10954 ), data_1982_12_13 ); + assertEquals( date_1982_12_13.minusDays( 5 ), date( 1982, december, 8 ) ); + assertEquals( date_1982_12_13.minusDays( 0 ), date_1982_12_13 ); + assertEquals( date( 2012, december, 9 ).minusDays( 10954 ), date_1982_12_13 ); } shared test void testDatePlusMonthsLessDays() { @@ -117,13 +117,13 @@ shared test void testDatePlusMonthsLessDays() { } shared test void testDatePlusMonths() { - assertEquals( data_1982_12_13.plusMonths(0), data_1982_12_13 ); - assertEquals( data_1982_12_13.plusMonths(1), date( 1983, january, 13) ); - assertEquals( data_1982_12_13.plusMonths(12), date( 1983, december, 13) ); - assertEquals( data_1982_12_13.plusMonths(36), date( 1985, december, 13) ); + assertEquals( date_1982_12_13.plusMonths(0), date_1982_12_13 ); + assertEquals( date_1982_12_13.plusMonths(1), date( 1983, january, 13) ); + assertEquals( date_1982_12_13.plusMonths(12), date( 1983, december, 13) ); + assertEquals( date_1982_12_13.plusMonths(36), date( 1985, december, 13) ); - value data_2000_01_31 = date( 2000, january, 31 ); - assertEquals( data_2000_01_31.plusMonths(14), date( 2001, march, 31) ); + value date_2000_01_31 = date( 2000, january, 31 ); + assertEquals( date_2000_01_31.plusMonths(14), date( 2001, march, 31) ); } shared test void february29_plus_48_months() @@ -134,9 +134,9 @@ shared test void february29_plus_4_years() shared test void testDateMinusMonths() { - assertEquals( data_1982_12_13.minusMonths(0), data_1982_12_13 ); - assertEquals( data_1982_12_13.minusMonths(1), date( 1982, november, 13) ); - assertEquals( data_1982_12_13.minusMonths(12), date( 1981, december, 13) ); + assertEquals( date_1982_12_13.minusMonths(0), date_1982_12_13 ); + assertEquals( date_1982_12_13.minusMonths(1), date( 1982, november, 13) ); + assertEquals( date_1982_12_13.minusMonths(12), date( 1981, december, 13) ); } shared test void testDateMinusLessDays() { @@ -144,9 +144,9 @@ shared test void testDateMinusLessDays() { } shared test void testDatePlusYears() { - assertEquals( data_1982_12_13.plusYears(0), data_1982_12_13 ); - assertEquals( data_1982_12_13.plusYears(18), date( 2000, december, 13) ); - assertEquals( data_1982_12_13.plusYears(30), date( 2012, december, 13) ); + assertEquals( date_1982_12_13.plusYears(0), date_1982_12_13 ); + assertEquals( date_1982_12_13.plusYears(18), date( 2000, december, 13) ); + assertEquals( date_1982_12_13.plusYears(30), date( 2012, december, 13) ); } shared test void testPlusYearsLessDays() { @@ -154,9 +154,9 @@ shared test void testPlusYearsLessDays() { } shared test void testDateMinusYears() { - value data_2000_01_31 = date( 2000, january, 31); - assertEquals( data_2000_01_31.minusYears(1), date( 1999, january, 31) ); - assertEquals( data_1982_12_13.minusYears(10), date( 1972, december, 13) ); + value date_2000_01_31 = date( 2000, january, 31); + assertEquals( date_2000_01_31.minusYears(1), date( 1999, january, 31) ); + assertEquals( date_1982_12_13.minusYears(10), date( 1972, december, 13) ); } shared test void testMinusYearsLessDays() { @@ -164,36 +164,36 @@ shared test void testMinusYearsLessDays() { } shared test void testDatePlusWeeks() { - assertEquals( data_1982_12_13.plusWeeks(1).dayOfWeek, data_1982_12_13.dayOfWeek ); - assertEquals( data_1982_12_13.plusWeeks(1), date( 1982, december, 20) ); - assertEquals( data_1982_12_13.plusWeeks(3), date( 1983, january, 3) ); + assertEquals( date_1982_12_13.plusWeeks(1).dayOfWeek, date_1982_12_13.dayOfWeek ); + assertEquals( date_1982_12_13.plusWeeks(1), date( 1982, december, 20) ); + assertEquals( date_1982_12_13.plusWeeks(3), date( 1983, january, 3) ); } shared test void testDateMinusWeeks(){ - assertEquals( data_1982_12_13.minusWeeks(1), date( 1982, december, 6) ); - assertEquals( data_1982_12_13.minusWeeks(3), date( 1982, november, 22) ); - assertEquals( data_1982_12_13.minusWeeks(3).dayOfWeek, date( 1982, november, 22).dayOfWeek ); + assertEquals( date_1982_12_13.minusWeeks(1), date( 1982, december, 6) ); + assertEquals( date_1982_12_13.minusWeeks(3), date( 1982, november, 22) ); + assertEquals( date_1982_12_13.minusWeeks(3).dayOfWeek, date( 1982, november, 22).dayOfWeek ); } shared test void testWithDay() { - assertEquals( data_1982_12_13.withDay(13), data_1982_12_13 ); - assertEquals( data_1982_12_13.withDay(17), date( 1982, december, 17) ); - assertTrue( data_1982_12_13.withDay(17) <=> date( 1982, december, 17) == equal); + assertEquals( date_1982_12_13.withDay(13), date_1982_12_13 ); + assertEquals( date_1982_12_13.withDay(17), date( 1982, december, 17) ); + assertTrue( date_1982_12_13.withDay(17) <=> date( 1982, december, 17) == equal); } void assertThrowsInvalidDate(void operation()) => assertThat(operation).hasMessage((String message) => message.contains("Invalid date value")); shared test void testWithDay40() => assertThrowsInvalidDate { - void operation() => data_1982_12_13.withDay(40); + void operation() => date_1982_12_13.withDay(40); }; shared test void testWithDay0() => assertThrowsInvalidDate { - void operation() => data_1982_12_13.withDay(0); + void operation() => date_1982_12_13.withDay(0); }; shared test void testWithDayNegative() => assertThrowsInvalidDate { - void operation() => data_1982_12_13.withDay(-10); + void operation() => date_1982_12_13.withDay(-10); }; shared test void testWithDay29FebNotLeap() => assertThrowsInvalidDate { @@ -210,15 +210,15 @@ shared test void testWithMonthLessDaysException() => assertThrowsInvalidDate { }; shared test void testWithMonth() { - assertEquals( data_1982_12_13.withMonth(december), data_1982_12_13 ); - assertEquals( data_1982_12_13.withMonth(january), date( 1982, january, 13) ); - assertTrue( data_1982_12_13.withMonth(january) <=> date( 1982, january, 13) == equal); + assertEquals( date_1982_12_13.withMonth(december), date_1982_12_13 ); + assertEquals( date_1982_12_13.withMonth(january), date( 1982, january, 13) ); + assertTrue( date_1982_12_13.withMonth(january) <=> date( 1982, january, 13) == equal); } shared test void testWithYear() { - assertEquals( data_1982_12_13.withYear(1982), data_1982_12_13 ); - assertEquals( data_1982_12_13.withYear(2000), date( 2000, december, 13) ); - assertEquals( data_1982_12_13.withYear(1800), date( 1800, december, 13) ); + assertEquals( date_1982_12_13.withYear(1982), date_1982_12_13 ); + assertEquals( date_1982_12_13.withYear(2000), date( 2000, december, 13) ); + assertEquals( date_1982_12_13.withYear(1800), date( 1800, december, 13) ); } shared test void testWithYearLeap() => assertThrowsInvalidDate { @@ -226,10 +226,10 @@ shared test void testWithYearLeap() => assertThrowsInvalidDate { }; shared test void testOrdinal() { - Date data_1983_01_01 = date( 1983, january, 1 ); + Date date_1983_01_01 = date( 1983, january, 1 ); variable value cont = 0; - for ( Date date in data_1982_12_13..data_1983_01_01 ) { - assertEquals( data_1982_12_13.plusDays(cont++), date ); + for ( Date date in date_1982_12_13..date_1983_01_01 ) { + assertEquals( date_1982_12_13.plusDays(cont++), date ); } } @@ -239,7 +239,7 @@ shared test void testPlusPeriod_Date() { months = 2; days = 3; }; - value newDataAmount = data_1982_12_13.plus( period_0001_02_03 ); + value newDataAmount = date_1982_12_13.plus( period_0001_02_03 ); assertEquals( newDataAmount.year, 1984 ); assertEquals( newDataAmount.month, february ); assertEquals( newDataAmount.day, 16 ); @@ -251,22 +251,22 @@ shared test void testMinusPeriod_Date() { months = 2; days = 3; }; - value newDataAmount = data_1982_12_13.minus( period_0001_02_03 ); + value newDataAmount = date_1982_12_13.minus( period_0001_02_03 ); assertEquals( newDataAmount.year, 1981 ); assertEquals( newDataAmount.month, october ); assertEquals( newDataAmount.day, 10 ); } shared test void testPredecessor() { - assertEquals(data_1982_12_13.predecessor, date(1982, december, 12)); + assertEquals(date_1982_12_13.predecessor, date(1982, december, 12)); } shared test void testSuccessor() { - assertEquals(data_1982_12_13.successor, date(1982, december, 14)); + assertEquals(date_1982_12_13.successor, date(1982, december, 14)); } shared test void testString() { - assertEquals( data_1982_12_13.string, "1982-12-13" ); + assertEquals( date_1982_12_13.string, "1982-12-13" ); assertEquals( date(2012, january, 1 ).string, "2012-01-01" ); assertEquals( date(0, january, 1 ).string, "0000-01-01" ); assertEquals( date(10, january, 1 ).string, "0010-01-01" ); @@ -279,16 +279,16 @@ shared test void testAt() { } shared test void testAtInvalidHour() - => assertThat(() => data_1982_12_13.at( time(-10, 0) )).hasMessage((String message) => message.contains("Hours value should be between 0 and 23")); + => assertThat(() => date_1982_12_13.at( time(-10, 0) )).hasMessage((String message) => message.contains("Hours value should be between 0 and 23")); shared test void testAtInvalidMinute() - => assertThat(() => data_1982_12_13.at( time(10, 60) )).hasMessage((String message) => message.contains("Minutes value should be between 0 and 59")); + => assertThat(() => date_1982_12_13.at( time(10, 60) )).hasMessage((String message) => message.contains("Minutes value should be between 0 and 59")); shared test void testAtInvalidSecond() - => assertThat(() => data_1982_12_13.at( time(10, 59, -1) )).hasMessage((String message) => message.contains("Seconds value should be between 0 and 59")); + => assertThat(() => date_1982_12_13.at( time(10, 59, -1) )).hasMessage((String message) => message.contains("Seconds value should be between 0 and 59")); shared test void testAtInvalidMillis() - => assertThat(() => data_1982_12_13.at( time(10, 59, 59, 1000) )).hasMessage((String message) => message.contains("Milliseconds value should be between 0 and 999")); + => assertThat(() => date_1982_12_13.at( time(10, 59, 59, 1000) )).hasMessage((String message) => message.contains("Milliseconds value should be between 0 and 999")); shared test void testPeriodFrom() { Period period = Period{ years = 2; months = 2; days = 3;}; @@ -503,9 +503,9 @@ shared test void testPeriodFromAfterDate() { } shared test void testEnumerableDate() { - assertEquals(data_1982_12_13.offset(data_1982_12_13) , 0); - assertEquals(data_1982_12_13.successor.offset(data_1982_12_13), 1); - assertEquals(data_1982_12_13.predecessor.offset(data_1982_12_13), - 1); + assertEquals(date_1982_12_13.offset(date_1982_12_13) , 0); + assertEquals(date_1982_12_13.successor.offset(date_1982_12_13), 1); + assertEquals(date_1982_12_13.predecessor.offset(date_1982_12_13), - 1); } shared test void testEqualsAndHashDate() { diff --git a/test-source/test/ceylon/time/testDayOfWeek.ceylon b/test-source/test/ceylon/time/testDayOfWeek.ceylon index 8aad57a3..711804f8 100644 --- a/test-source/test/ceylon/time/testDayOfWeek.ceylon +++ b/test-source/test/ceylon/time/testDayOfWeek.ceylon @@ -85,10 +85,10 @@ shared test void testComparable_friday_Weekday() { } shared test void testOrdinal_Weekday() { - value data_1982_12_13 = date( 1982, december, 13); - value data_1983_01_01 = date( 1983, january, 1 ); - variable value dow = data_1982_12_13.dayOfWeek; - for ( Date date in data_1982_12_13..data_1983_01_01 ) { + value date_1982_12_13 = date( 1982, december, 13); + value date_1983_01_01 = date( 1983, january, 1 ); + variable value dow = date_1982_12_13.dayOfWeek; + for ( Date date in date_1982_12_13..date_1983_01_01 ) { assertEquals { actual = date.dayOfWeek; expected = dow++; }; } }