class CalendarT issubclassof TestDriver functions public tests : () -> seqof TestCase
tests() ==
[ new CalendarT12(), new CalendarT11(), new CalendarT10(), new CalendarT09(), --new CalendarT08(), --deleted new CalendarT07(), new CalendarT06(), new CalendarT05(), new CalendarT03(), new CalendarT02(), new CalendarT01(), new CalendarT04()
]; end CalendarT
class CalendarT05 issubclassof TestCase operations protected test: () ==> bool
test() == let jc = new JapaneseCalendar(),
d0711 = jc.getDateFromString("20010711") in
(
jc.setToday(jc.getDateFrom_yyyy_mm_dd(2001,3,1)); let d0301 = jc.today() in return
d0711.EQ(jc.getDateFrom_yyyy_mm_dd(2001, 7, 11)) and
jc.EQ(d0711,jc.getDateFrom_yyyy_mm_dd(2001, 7, 11)) and
d0301.LT(d0711) and
jc.LT(d0301, d0711) and
d0711.GT(d0301) and
jc.GT(d0711,d0301) and
d0711.GE(d0711) and d0711.GE(d0301) and
jc.GE(d0711,d0711) and jc.GE(d0711,d0301) and
d0711.LE(d0711) and d0301.LE(d0711) and
jc.LE(d0711,d0711) and jc.LE(d0301,d0711)
)
; protected setUp: () ==> ()
setUp() == TestName := "CalendarT05:\tCompare date."; protected tearDown: () ==> ()
tearDown() == return; end CalendarT05
class CalendarT06 issubclassof TestCase, CalendarDefinition operations protected test: () ==> bool
test() == let jc = new JapaneseCalendar(),
d10010301 = jc.getDateFromString("10010301"),
d0711 = jc.getDateFromString("20010711") in
( let d0301 = jc.today() in return
jc.firstDayOfTheWeekInMonth(2000,3,<Wed>).get_yyyy_mm_dd() = mk_( 2000,3,1 ) and
jc.firstDayOfTheWeekInMonth(2001,7,<Sun>).get_yyyy_mm_dd() = mk_( 2001,7,1 ) and
jc.lastDayOfTheWeekInMonth(2000,2,<Tue>).get_yyyy_mm_dd() = mk_( 2000,2,29 ) and
jc.lastDayOfTheWeekInMonth(2001,7,<Sun>).get_yyyy_mm_dd() = mk_( 2001,7,29 ) and
jc.getNthDayOfTheWeek(2001,7,5,<Sun>).get_yyyy_mm_dd() = mk_( 2001,7,29 ) and
jc.getNthDayOfTheWeek(2001,7,6,<Sun>) = falseand
jc.getNumberOfTheDayOfWeek(d0711,d0301,<Sun>) = 19 and
jc.getNumberOfTheDayOfWeek(d0711,d10010301,<Sun>) = 52196 and
jc.getNumberOfDayOfTheWeekFromName(<Thu>) = 4 and
jc.getNumberOfDayOfTheWeekFromName(<Fri>) = 5 and
jc.getNumberOfDayOfTheWeekFromName(<Sat>) = 6 and
jc.getNumberOfDayOfTheWeekFromName(<Sun>) = 0
)
; protected setUp: () ==> ()
setUp() == TestName := "CalendarT06:\tGet day of the week."; protected tearDown: () ==> ()
tearDown() == return; end CalendarT06
class CalendarT07 issubclassof TestCase operations protected test: () ==> bool
test() == let jc = new JapaneseCalendar() in return
jc.getDateFromString("sahara") = falseand
jc.getDateFromString("20011232") = falseand
jc.getDateFromString("20011231").date2Str() = "20011231"
; protected setUp: () ==> ()
setUp() == TestName := "CalendarT07:\tgetDateFromString"; protected tearDown: () ==> ()
tearDown() == return; end CalendarT07
class CalendarT09 issubclassof TestCase, CalendarDefinition operations protected test: () ==> bool
test() == let jc = new JapaneseCalendar() in return
jc.today().EQ(jc.getDateFrom_yyyy_mm_dd(2001, 3, 1)) and
jc.readFromFiletoday(homedir ^ "/temp/BaseDay.txt").EQ(jc.getDateFrom_yyyy_mm_dd(2003, 10, 24))
; protected setUp: () ==> ()
setUp() == TestName := "CalendarT09:\tRead today datefrom a file."; protected tearDown: () ==> ()
tearDown() == return;
end CalendarT09
class CalendarT10 issubclassof TestCase operations protected test: () ==> bool
test() == let jc = new JapaneseCalendar() in return
jc.getLastDayOfMonth(2004, 1).EQ(jc.getDateFrom_yyyy_mm_dd(2004, 1, 31)) and
jc.getLastDayOfMonth(2004, 2).EQ(jc.getDateFrom_yyyy_mm_dd(2004, 2, 29)) and
jc.getLastDayOfMonth(2004, 3).EQ(jc.getDateFrom_yyyy_mm_dd(2004, 3, 31)) and
jc.getLastDayOfMonth(2004, 4).EQ(jc.getDateFrom_yyyy_mm_dd(2004, 4, 30)) and
jc.getLastDayOfMonth(2004, 5).EQ(jc.getDateFrom_yyyy_mm_dd(2004, 5, 31)) and
jc.getLastDayOfMonth(2004, 6).EQ(jc.getDateFrom_yyyy_mm_dd(2004, 6, 30)) and
jc.getLastDayOfMonth(2004, 7).EQ(jc.getDateFrom_yyyy_mm_dd(2004, 7, 31)) and
jc.getLastDayOfMonth(2004, 8).EQ(jc.getDateFrom_yyyy_mm_dd(2004, 8, 31)) and
jc.getLastDayOfMonth(2004, 9).EQ(jc.getDateFrom_yyyy_mm_dd(2004, 9, 30)) and
jc.getLastDayOfMonth(2004, 10).EQ(jc.getDateFrom_yyyy_mm_dd(2004, 10, 31)) and
jc.getLastDayOfMonth(2004, 11).EQ(jc.getDateFrom_yyyy_mm_dd(2004, 11, 30)) and
jc.getLastDayOfMonth(2004, 12).EQ(jc.getDateFrom_yyyy_mm_dd(2004, 12, 31)) and
jc.getLastDayOfMonth(2003, 13).EQ(jc.getDateFrom_yyyy_mm_dd(2004, 1, 31)) and
jc.getLastDayOfMonth(2003, 8+6).EQ(jc.getDateFrom_yyyy_mm_dd(2004, 2, 29)) and
jc.getLastDayOfMonth(2003, 15).EQ(jc.getDateFrom_yyyy_mm_dd(2004, 3, 31)) and
jc.getLastDayOfMonth(2003, 16).EQ(jc.getDateFrom_yyyy_mm_dd(2004, 4, 30)) and
jc.getLastDayOfMonth(2003, 17).EQ(jc.getDateFrom_yyyy_mm_dd(2004, 5, 31)) and
jc.getLastDayOfMonth(2003, 18).EQ(jc.getDateFrom_yyyy_mm_dd(2004, 6, 30)) and
jc.getLastDayOfMonth(2003, 19).EQ(jc.getDateFrom_yyyy_mm_dd(2004, 7, 31)) and
jc.getLastDayOfMonth(2003, 20).EQ(jc.getDateFrom_yyyy_mm_dd(2004, 8, 31)) and
jc.getLastDayOfMonth(2003, 21).EQ(jc.getDateFrom_yyyy_mm_dd(2004, 9, 30)) and
jc.getLastDayOfMonth(2003, 22).EQ(jc.getDateFrom_yyyy_mm_dd(2004, 10, 31)) and
jc.getLastDayOfMonth(2003, 23).EQ(jc.getDateFrom_yyyy_mm_dd(2004, 11, 30)) and
jc.getLastDayOfMonth(2003, 24).EQ(jc.getDateFrom_yyyy_mm_dd(2004, 12, 31)) and
jc.getLastDayOfMonth(2005, 2).EQ(jc.getDateFrom_yyyy_mm_dd(2005, 2, 28))
; protected setUp: () ==> ()
setUp() == TestName := "CalendarT10:\tGet the end of month."; protected tearDown: () ==> ()
tearDown() == return; end CalendarT10
class CalendarT11 issubclassof TestCase operations protected test: () ==> bool
test() == let jc = new JapaneseCalendar() in return
jc.getRegularDate(2004, 1, 1).EQ(jc.getDateFrom_yyyy_mm_dd(2004, 1, 1)) and
jc.getRegularDate(2003, 12, 32).EQ(jc.getDateFrom_yyyy_mm_dd(2004, 1, 1)) and
jc.getRegularDate(2003, 24, 32).EQ(jc.getDateFrom_yyyy_mm_dd(2005, 1, 1)) and
jc.getRegularDate(2003, 13, 1).EQ(jc.getDateFrom_yyyy_mm_dd(2004, 1, 1)) and
jc.getRegularDate(2004, 1, 32).EQ(jc.getDateFrom_yyyy_mm_dd(2004, 2, 1)) and
jc.getRegularDate(2004, 2, 0).EQ(jc.getDateFrom_yyyy_mm_dd(2004, 1, 31)) and
jc.getRegularDate(2004, 2, 28).EQ(jc.getDateFrom_yyyy_mm_dd(2004, 2, 28)) and
jc.getRegularDate(2004, 2, 29).EQ(jc.getDateFrom_yyyy_mm_dd(2004, 2, 29)) and
jc.getRegularDate(2004, 3, 0).EQ(jc.getDateFrom_yyyy_mm_dd(2004, 2, 29)) and
jc.getRegularDate(2004, 3, -1).EQ(jc.getDateFrom_yyyy_mm_dd(2004, 2, 28)) and
jc.getRegularDate(2003, 2, 29).EQ(jc.getDateFrom_yyyy_mm_dd(2003, 3, 1)) and
jc.getRegularDate(2004, 4, 1).EQ(jc.getDateFrom_yyyy_mm_dd(2004, 4, 1)) and
jc.getRegularDate(2004, 0, 1).EQ(jc.getDateFrom_yyyy_mm_dd(2003, 12, 1)) and
jc.getRegularDate(2004, -1, 1).EQ(jc.getDateFrom_yyyy_mm_dd(2003, 11, 1)) and
jc.getRegularDate(2004, -10, 29).EQ(jc.getDateFrom_yyyy_mm_dd(2003, 3, 1)) and
jc.getRegularDate(2004, -10, 28).EQ(jc.getDateFrom_yyyy_mm_dd(2003, 2, 28)) and
jc.getRegularDate(2004, -11, 1).EQ(jc.getDateFrom_yyyy_mm_dd(2003, 1, 1)) and
jc.getRegularDate(2004, -12, 1).EQ(jc.getDateFrom_yyyy_mm_dd(2002, 12, 1))
; protected setUp: () ==> ()
setUp() == TestName := "CalendarT11:\tgetRegularDate"; protected tearDown: () ==> ()
tearDown() == return; end CalendarT11
class CalendarT12 issubclassof TestCase operations protected test: () ==> bool
test() == let jc = new JapaneseCalendar() in return
jc.getRegularMonth(2004, 1) = mk_(2004, 1) and
jc.getRegularMonth(2004, 2) = mk_(2004, 2) and
jc.getRegularMonth(2004, 3) = mk_(2004, 3) and
jc.getRegularMonth(2004, 4) = mk_(2004, 4) and
jc.getRegularMonth(2004, 5) = mk_(2004, 5) and
jc.getRegularMonth(2004, 6) = mk_(2004, 6) and
jc.getRegularMonth(2004, 7) = mk_(2004, 7) and
jc.getRegularMonth(2004, 8) = mk_(2004, 8) and
jc.getRegularMonth(2004, 9) = mk_(2004, 9) and
jc.getRegularMonth(2004, 10) = mk_(2004, 10) and
jc.getRegularMonth(2004, 11) = mk_(2004, 11) and
jc.getRegularMonth(2004, 12) = mk_(2004, 12) and
jc.getRegularMonth(2004, 13) = mk_(2005, 1) and
jc.getRegularMonth(2004, 14) = mk_(2005, 2) and
jc.getRegularMonth(2004, 24) = mk_(2005, 12) and
jc.getRegularMonth(2004, 25) = mk_(2006, 1) and
jc.getRegularMonth(2004, 0) = mk_(2003, 12) and
jc.getRegularMonth(2004, -1) = mk_(2003, 11) and
jc.getRegularMonth(2004, -10) = mk_(2003, 2) and
jc.getRegularMonth(2004, -11) = mk_(2003, 1) and
jc.getRegularMonth(2004, -12) = mk_(2002, 12) and
jc.getRegularMonth(2004, -13) = mk_(2002, 11)
; protected setUp: () ==> ()
setUp() == TestName := "CalendarT12:\tgetRegularMonth"; protected tearDown: () ==> ()
tearDown() == return; end CalendarT12
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.13Bemerkung:
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.