3bd2ea2003-03-30Marcus Comstedt dnl $Id: testsuite.in,v 1.5 2003/03/30 16:22:12 marcus Exp $
a2eeac2002-11-28Martin Nilsson  dnl NOTE: dnl *every* time the Calendar tests have failed, it's not the dnl Calendar module that had any errors. Please don't commit dnl your Pike until you've got Calendar to compile again. /Mirar test_true(Calendar.Day()) test_eq([[Calendar.Gregorian.Day(2500000)->month_day()]],31) test_eq([[Calendar.ISO.Day(2500000)->month_day()]],31) test_eq([[Calendar.Julian.Day(2500000)->month_day()]],17) test_eq([[(int)(Calendar.Stardate.Tick("julian",2500000)->tic())]],-190335) test_eq(Calendar.ISO.Week(2002,1)->day()->format_ymd(),"2001-12-31")
c7f6a22002-11-21Johan Sundström  test_eval_error(Calendar.ISO.set_timezone("Europe/Stockholm")
3bd2ea2003-03-30Marcus Comstedt  ->dwim_time("2000-03-26 02:01:17"))
c7f6a22002-11-21Johan Sundström 
3bd2ea2003-03-30Marcus Comstedt test_eq(Calendar.ISO_UTC.dwim_time("2000-03-26 02:01:17")->unix_time(), 954036077)
c7f6a22002-11-21Johan Sundström  test_do(Calendar.TimeRange t = Calendar.now()) dnl Some more or less odd timezones encountered by Xenofarm: test_do(Calendar.dwim_time("Tue Nov 19 07:04:03 MET 2002")) test_do(Calendar.dwim_time("Tue Nov 19 07:04:03 CST 2002")) test_do(Calendar.dwim_time("Tue Nov 19 07:04:03 CET 2002")) test_do(Calendar.dwim_time("Tue Nov 19 07:04:03 2002")) test_do(Calendar.dwim_time("Tue Nov 19 07:04:03 NFT 2002")) test_do(Calendar.dwim_time("Tue Nov 19 07:04:03 DFT 2002"))
9d27802002-11-23Johan Sundström  test_eq(arrayp(Calendar.TZnames.zonenames()), 1)
a2eeac2002-11-28Martin Nilsson  dnl FAQ tests test_eq( Calendar.dwim_day("1/2/3"), Calendar.Day(2003,1,2) ) test_eq( Calendar.dwim_day("1 aug 2001"), Calendar.Day(2001,8,1) ) test_false( Calendar.dwim_day("1 aug 2001")==Calendar.Day(2001,8,2) ) dnl Missing two dwim_time tests test_eq( Calendar.parse("%Y-%M-%D %h:%m","2040-11-08 2:46"), Calendar.Minute(2040,11,8,2,46) ) test_false( Calendar.parse("%Y w%W %e %h:%m %p %z","1913 w4 monday 2:14 pm CET")
8168ec2002-12-05Martin Nilsson  < Calendar.set_timezone("CET")->Minute(1913,1,20,14,14) )
a2eeac2002-11-28Martin Nilsson test_false( Calendar.parse("%Y w%W %e %h:%m %p %z","1913 w4 monday 2:14 pm CET")
8168ec2002-12-05Martin Nilsson  > Calendar.set_timezone("CET")->Minute(1913,1,20,14,14) )
a2eeac2002-11-28Martin Nilsson dnl The two objects above is not equal, which really is a bug.