+ contrib/sddsqlt3/tests/test.prg
- contrib/sddsqlt3/tests/test1.prg
* renamed
* contrib/hbtest/core.prg
* minor cleanup
* utils/hbmk2/hbmk2.prg
* formatting
* tests/rto_get.prg
* tests/rto_tb.prg
* utils/hbtest/hbtest.prg
% use a more efficient hb_stod() implementation
for non-Harbour branches
(taken from tests/transfrm.prg by Przemek)
* contrib/sddsqlt3/tests/test.prg
* contrib/gtwvg/gtwgud.c
* contrib/gtwvg/gtwvgd.c
* contrib/gtwvg/tests/demowvg.prg
* contrib/gtwvg/tests/demowvg1.prg
* contrib/hbct/tests/dates4.prg
* contrib/hbct/tests/datetime.prg
* contrib/hbfbird/readme.txt
* contrib/hbgt/ascposgt.c
* contrib/hbgt/atdiff.c
* contrib/hbgt/bitflags.c
* contrib/hbgt/chareven.c
* contrib/hbgt/charmixg.c
* contrib/hbgt/charodd.c
* contrib/hbgt/chrcount.c
* contrib/hbgt/chrfirst.c
* contrib/hbgt/chrtotal.c
* contrib/hbgt/strcount.c
* contrib/hbgt/strcspn.c
* contrib/hbgt/strdiffg.c
* contrib/hbgt/strexpan.c
* contrib/hbgt/strleft.c
* contrib/hbgt/strpbrk.c
* contrib/hbgt/strright.c
* contrib/hbhttpd/tests/eshop.prg
* contrib/hbmisc/doc/en/dates2.txt
* contrib/hbmisc/tests/strfmt.prg
* contrib/hbmysql/readme.txt
* contrib/hbmysql/tests/dbf2mysq.prg
* contrib/hbmysql/tests/test.prg
* contrib/hbmzip/tests/myunzip.prg
* contrib/hbnetio/tests/netiot02.prg
* contrib/hbnetio/utils/hbnetio/netiocon.prg
* contrib/hbnetio/utils/hbnetio/netiosrv.prg
* contrib/hbnf/doc/en/acctadj.txt
* contrib/hbnf/doc/en/woy.txt
* contrib/hbnf/tests/calendar.prg
* contrib/hbnf/tests/datecnfg.prg
* contrib/hbnf/tests/menu1.prg
* contrib/hbnf/tests/savearr.prg
* contrib/hbnf/tests/setdate.prg
* contrib/hbnf/tests/woy.prg
* contrib/hbpgsql/tests/dbf2pg.prg
* contrib/hbtip/mail.prg
* contrib/hbtip/popcli.prg
* contrib/hbwin/tests/dlg.prg
* contrib/hbziparc/tests/zipa.prg
* contrib/rddads/ads1.c
* contrib/sddoci/tests/test1.prg
* contrib/sddodbc/tests/test1.prg
* contrib/sddodbc/tests/test2.prg
* contrib/xhb/decode.prg
* contrib/xhb/dumpvar.prg
* contrib/xhb/xhbmemo.prg
* contrib/xhb/xhbtedit.prg
* ChangeLog.txt
* doc/en/string.txt
* doc/gtapi.txt
* doc/pragma.txt
* doc/xhb-diff.txt
* extras/dbu/dbu52.dif
* extras/dbu/dbu53.dif
* extras/gtwvw/docs/whatsnew.txt
* extras/gtwvw/gtwvwd.c
* extras/gtwvw/tests/ebtest7.prg
* extras/gtwvw/tests/wvwtest9.prg
* extras/gtwvw/wvwcheck.c
* extras/gtwvw/wvwdraw.c
* extras/gtwvw/wvwedit.c
* extras/gtwvw/wvwfuncs.c
* extras/gtwvw/wvwmenu.c
* extras/gtwvw/wvwpush.c
* extras/gtwvw/wvwstbar.c
* extras/gtwvw/wvwtbar.c
* extras/guestbk/cgi.prg
* extras/hbxlsxml/tests/example.prg
* extras/httpsrv/uhttpd.prg
* extras/rddado/tests/access1.prg
* extras/rddado/tests/access2.prg
* include/hbclass.ch
* src/common/hbdate.c
* src/debug/dbgtarr.prg
* src/debug/dbgthsh.prg
* src/rdd/dbfcdx/dbfcdx1.c
* src/rdd/usrrdd/rdds/arrayrdd.prg
* src/rtl/filesys.c
* src/rtl/gtos2/gtos2.c
* src/rtl/gtwvt/gtwvt.c
* src/rtl/net.c
* src/rtl/teditor.prg
* src/vm/thread.c
* tests/adir.prg
* tests/ddate.prg
* tests/directry.prg
* tests/extend1.prg
* tests/newrdd.prg
* tests/rto_get.prg
* tests/rto_tb.prg
* tests/say.prg
* tests/speedtst.prg
* tests/tb1.prg
* tests/usrrdd/exarr.prg
* tests/vmasort.prg
* utils/hbmk2/hbmk2.prg
* utils/hbtest/hbtest.prg
* utils/hbtest/rt_date.prg
* utils/hbtest/rt_str.prg
* utils/hbtest/rt_stra.prg
* utils/hbtest/rt_trans.prg
* website/faq/harbour.html
* website/faq/harbour63.html
* website/faq/index.html
* website/robots.txt
+ switched whole Harbour sources, comments, app logic,
regression tests, output, to use the ISO date format:
https://en.wikipedia.org/wiki/ISO_8601
in Harbour
Set( _SET_DATEFORMAT, "yyyy-mm-dd" )
Use that exclusively in new commits
; hbtest retested on Clipper 5.2e
; no more 'SET DATE [TO] ANSI' and 'SET CENTURY ON'
; there are a few exceptions, mainly in test code
and where compatibility required it.
* utils/hbtest/rt_trans.prg
+ added 4 extra tests that behave differently
when using 'yyyy-mm-dd' format instead of
'yyyy.mm.dd'
198 lines
9.1 KiB
Plaintext
198 lines
9.1 KiB
Plaintext
/*
|
|
* $Id$
|
|
*/
|
|
|
|
/*
|
|
* Harbour Project source code:
|
|
* Regression tests for the runtime library (date)
|
|
*
|
|
* Copyright 1999-2001 Viktor Szakats (harbour syenar.net)
|
|
* www - http://harbour-project.org
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2, or (at your option)
|
|
* any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this software; see the file COPYING.txt. If not, write to
|
|
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
|
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
|
*
|
|
* As a special exception, the Harbour Project gives permission for
|
|
* additional uses of the text contained in its release of Harbour.
|
|
*
|
|
* The exception is that, if you link the Harbour libraries with other
|
|
* files to produce an executable, this does not by itself cause the
|
|
* resulting executable to be covered by the GNU General Public License.
|
|
* Your use of that executable is in no way restricted on account of
|
|
* linking the Harbour library code into it.
|
|
*
|
|
* This exception does not however invalidate any other reasons why
|
|
* the executable file might be covered by the GNU General Public License.
|
|
*
|
|
* This exception applies only to the code released by the Harbour
|
|
* Project under the name Harbour. If you copy code from other
|
|
* Harbour Project or Free Software Foundation releases into a copy of
|
|
* Harbour, as the General Public License permits, the exception does
|
|
* not apply to the code that you add in this way. To avoid misleading
|
|
* anyone as to the status of such modified files, you must delete
|
|
* this exception notice from them.
|
|
*
|
|
* If you write modifications of your own for Harbour, it is your choice
|
|
* whether to permit this exception to apply to your modifications.
|
|
* If you do not wish that, delete this exception notice.
|
|
*
|
|
*/
|
|
|
|
#include "rt_main.ch"
|
|
|
|
/* Don't change the position of this #include. */
|
|
#include "rt_vars.ch"
|
|
|
|
PROCEDURE Main_DATE()
|
|
LOCAL cDate := "1999-11-25"
|
|
|
|
/* Year() */
|
|
|
|
HBTEST Year(NIL) IS "E 1 BASE 1112 Argument error (YEAR) OS:0 #:0 A:1:U:NIL F:S"
|
|
HBTEST Year(100) IS "E 1 BASE 1112 Argument error (YEAR) OS:0 #:0 A:1:N:100 F:S"
|
|
#ifdef __HARBOUR__
|
|
HBTEST Year(@sdDate) IS 1984 /* Bug in CA-Cl*pper, it returns: "E 1 BASE 1112 Argument error (YEAR) OS:0 #:0 A:1:U:19840325 F:S" */
|
|
#endif
|
|
HBTEST Year(sdDate) IS 1984
|
|
HBTEST Year(sdDateE) IS 0
|
|
HBTEST Str(Year(hb_SToD("19990905"))) IS " 1999"
|
|
|
|
/* Month() */
|
|
|
|
HBTEST Month(NIL) IS "E 1 BASE 1113 Argument error (MONTH) OS:0 #:0 A:1:U:NIL F:S"
|
|
HBTEST Month(100) IS "E 1 BASE 1113 Argument error (MONTH) OS:0 #:0 A:1:N:100 F:S"
|
|
#ifdef __HARBOUR__
|
|
HBTEST Month(@sdDate) IS 3 /* Bug in CA-Cl*pper, it returns: "E 1 BASE 1113 Argument error (MONTH) OS:0 #:0 A:1:U:19840325 F:S" */
|
|
#endif
|
|
HBTEST Month(sdDate) IS 3
|
|
HBTEST Month(sdDateE) IS 0
|
|
HBTEST Str(Month(hb_SToD("19990905"))) IS " 9"
|
|
|
|
/* Day() */
|
|
|
|
HBTEST Day(NIL) IS "E 1 BASE 1114 Argument error (DAY) OS:0 #:0 A:1:U:NIL F:S"
|
|
HBTEST Day(100) IS "E 1 BASE 1114 Argument error (DAY) OS:0 #:0 A:1:N:100 F:S"
|
|
#ifdef __HARBOUR__
|
|
HBTEST Day(@sdDate) IS 25 /* Bug in CA-Cl*pper, it returns: "E 1 BASE 1114 Argument error (DAY) OS:0 #:0 A:1:U:19840325 F:S" */
|
|
#endif
|
|
HBTEST Day(sdDate) IS 25
|
|
HBTEST Day(sdDateE) IS 0
|
|
HBTEST Str(Day(hb_SToD("19990905"))) IS " 5"
|
|
|
|
/* Time() */
|
|
|
|
HBTEST Len(Time()) IS 8
|
|
|
|
/* DoW() */
|
|
|
|
HBTEST DoW(NIL) IS "E 1 BASE 1115 Argument error (DOW) OS:0 #:0 A:1:U:NIL F:S"
|
|
HBTEST DoW(100) IS "E 1 BASE 1115 Argument error (DOW) OS:0 #:0 A:1:N:100 F:S"
|
|
#ifdef __HARBOUR__
|
|
HBTEST DoW(@sdDate) IS 1 /* Bug in CA-Cl*pper, it returns: "E 1 BASE 1115 Argument error (DOW) OS:0 #:0 A:1:U:19840325 F:S" */
|
|
#endif
|
|
HBTEST DoW(sdDate) IS 1
|
|
HBTEST DoW(sdDateE) IS 0
|
|
HBTEST DoW(hb_SToD("20000222")) IS 3
|
|
HBTEST DoW(hb_SToD("20000223")) IS 4
|
|
HBTEST DoW(hb_SToD("20000224")) IS 5
|
|
HBTEST DoW(hb_SToD("20000225")) IS 6
|
|
HBTEST DoW(hb_SToD("20000226")) IS 7
|
|
HBTEST DoW(hb_SToD("20000227")) IS 1
|
|
HBTEST DoW(hb_SToD("20000228")) IS 2
|
|
HBTEST DoW(hb_SToD("20000229")) IS 3
|
|
HBTEST DoW(hb_SToD("20000230")) IS 0
|
|
HBTEST DoW(hb_SToD("20000231")) IS 0
|
|
HBTEST DoW(hb_SToD("20000301")) IS 4
|
|
|
|
/* CMonth() */
|
|
|
|
HBTEST CMonth(NIL) IS "E 1 BASE 1116 Argument error (CMONTH) OS:0 #:0 A:1:U:NIL F:S"
|
|
HBTEST CMonth(100) IS "E 1 BASE 1116 Argument error (CMONTH) OS:0 #:0 A:1:N:100 F:S"
|
|
#ifdef __HARBOUR__
|
|
HBTEST CMonth(@sdDate) IS "March" /* Bug in CA-Cl*pper, it returns: "E 1 BASE 1116 Argument error (CMONTH) OS:0 #:0 A:1:U:19840325 F:S" */
|
|
#endif
|
|
HBTEST CMonth(sdDate) IS "March"
|
|
HBTEST CMonth(sdDateE) IS ""
|
|
HBTEST CMonth(hb_SToD("19990101")) IS "January"
|
|
HBTEST CMonth(hb_SToD("19990201")) IS "February"
|
|
HBTEST CMonth(hb_SToD("19990301")) IS "March"
|
|
HBTEST CMonth(hb_SToD("19990401")) IS "April"
|
|
HBTEST CMonth(hb_SToD("19990501")) IS "May"
|
|
HBTEST CMonth(hb_SToD("19990601")) IS "June"
|
|
HBTEST CMonth(hb_SToD("19990701")) IS "July"
|
|
HBTEST CMonth(hb_SToD("19990801")) IS "August"
|
|
HBTEST CMonth(hb_SToD("19990901")) IS "September"
|
|
HBTEST CMonth(hb_SToD("19991001")) IS "October"
|
|
HBTEST CMonth(hb_SToD("19991101")) IS "November"
|
|
HBTEST CMonth(hb_SToD("19991201")) IS "December"
|
|
|
|
/* CDoW() */
|
|
|
|
HBTEST CDoW(NIL) IS "E 1 BASE 1117 Argument error (CDOW) OS:0 #:0 A:1:U:NIL F:S"
|
|
HBTEST CDoW(100) IS "E 1 BASE 1117 Argument error (CDOW) OS:0 #:0 A:1:N:100 F:S"
|
|
#ifdef __HARBOUR__
|
|
HBTEST CDoW(@sdDate) IS "Sunday" /* Bug in CA-Cl*pper, it returns: "E 1 BASE 1117 Argument error (CDOW) OS:0 #:0 A:1:U:19840325 F:S" */
|
|
#endif
|
|
HBTEST CDoW(sdDate) IS "Sunday"
|
|
HBTEST CDoW(sdDateE) IS ""
|
|
HBTEST CDoW(hb_SToD("20000222")) IS "Tuesday"
|
|
HBTEST CDoW(hb_SToD("20000223")) IS "Wednesday"
|
|
HBTEST CDoW(hb_SToD("20000224")) IS "Thursday"
|
|
HBTEST CDoW(hb_SToD("20000225")) IS "Friday"
|
|
HBTEST CDoW(hb_SToD("20000226")) IS "Saturday"
|
|
HBTEST CDoW(hb_SToD("20000227")) IS "Sunday"
|
|
HBTEST CDoW(hb_SToD("20000228")) IS "Monday"
|
|
HBTEST CDoW(hb_SToD("20000229")) IS "Tuesday"
|
|
HBTEST CDoW(hb_SToD("20000230")) IS ""
|
|
HBTEST CDoW(hb_SToD("20000231")) IS ""
|
|
HBTEST CDoW(hb_SToD("20000301")) IS "Wednesday"
|
|
|
|
/* DToC() */
|
|
|
|
HBTEST DToC(NIL) IS "E 1 BASE 1118 Argument error (DTOC) OS:0 #:0 A:1:U:NIL F:S"
|
|
HBTEST DToC(100) IS "E 1 BASE 1118 Argument error (DTOC) OS:0 #:0 A:1:N:100 F:S"
|
|
HBTEST DToC("") IS "E 1 BASE 1118 Argument error (DTOC) OS:0 #:0 A:1:C: F:S"
|
|
#ifdef __HARBOUR__
|
|
HBTEST DToC(@sdDate) IS "1984-03-25" /* Bug in CA-Cl*pper, it returns: "E 1 BASE 1118 Argument error (DTOC) OS:0 #:0 A:1:U:19840325 F:S" */
|
|
#endif
|
|
HBTEST DToC(sdDate) IS "1984-03-25"
|
|
HBTEST DToC(sdDateE) IS " - - "
|
|
|
|
/* CToD() */
|
|
|
|
HBTEST CToD(NIL) IS "E 1 BASE 1119 Argument error (CTOD) OS:0 #:0 A:1:U:NIL F:S"
|
|
HBTEST CToD(100) IS "E 1 BASE 1119 Argument error (CTOD) OS:0 #:0 A:1:N:100 F:S"
|
|
HBTEST CToD("") IS hb_SToD(" ")
|
|
#ifdef __HARBOUR__
|
|
HBTEST CToD(@cDate) IS hb_SToD("19991125") /* Bug in CA-Cl*pper, it returns: "E 1 BASE 1119 Argument error (CTOD) OS:0 #:0 A:1:U:1999-11-25 F:S" */
|
|
#endif
|
|
HBTEST CToD(cDate) IS hb_SToD("19991125")
|
|
HBTEST CToD("1999-11-25/10") IS hb_SToD("19991125")
|
|
|
|
/* DToS() */
|
|
|
|
HBTEST DToS(NIL) IS "E 1 BASE 1120 Argument error (DTOS) OS:0 #:0 A:1:U:NIL F:S"
|
|
HBTEST DToS(100) IS "E 1 BASE 1120 Argument error (DTOS) OS:0 #:0 A:1:N:100 F:S"
|
|
#ifdef __HARBOUR__
|
|
HBTEST DToS(@sdDate) IS "19840325" /* Bug in CA-Cl*pper, it returns: "E 1 BASE 1120 Argument error (DTOS) OS:0 #:0 A:1:U:19840325 F:S" */
|
|
#endif
|
|
HBTEST DToS(sdDate) IS "19840325"
|
|
HBTEST DToS(sdDateE) IS " "
|
|
|
|
RETURN
|
|
|
|
/* Don't change the position of this #include. */
|
|
#include "rt_init.ch"
|