Branch: Tag:

2003-12-31

2003-12-31 00:02:12 by Martin Nilsson <mani@lysator.liu.se>

Improved dwim_time tests

Rev: lib/modules/Calendar.pmod/testsuite.in:1.10

1: - dnl $Id: testsuite.in,v 1.9 2003/08/18 14:24:49 mast Exp $ + dnl $Id: testsuite.in,v 1.10 2003/12/31 00:02:12 nilsson Exp $      dnl NOTE:   dnl *every* time the Calendar tests have failed, it's not the
25:   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")) + test_do(Calendar.ISO.set_timezone("CET")) + define(test_dwim,[[ +  test_eq(Calendar.ISO.dwim_time($1)->format_time(),"2002-11-19 07:04:03") +  test_eq(Calendar.ISO.dwim_time($1)->tzname(),$2) + ]]) + test_dwim("Tue Nov 19 07:04:03 MET 2002","MET") + test_dwim("Tue Nov 19 07:04:03 CST 2002","CST") + test_dwim("Tue Nov 19 07:04:03 CET 2002","CET") + test_dwim("Tue Nov 19 07:04:03 2002","CET") + test_dwim("Tue Nov 19 07:04:03 NFT 2002","NFT") + dnl test_dwim("Tue Nov 19 07:04:03 DFT 2002","DFT") + test_dwim("Tue Nov 19 07:04:03 MET DST 2002","MET") + test_dwim("Tue Nov 19 07:04:03 METDST 2002","MET")      test_eq(arrayp(Calendar.TZnames.zonenames()), 1)