2 ' This file is part of the LibreOffice project.
4 ' This Source Code Form is subject to the terms of the Mozilla Public
5 ' License, v. 2.0. If a copy of the MPL was not distributed with this
6 ' file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 Function doUnitTest
as Integer
10 dim aVector
as Variant
11 aVector
= Array( Date(), Time(), "Hello", -3.14)
16 ' CDateFromUnoDateTime
18 ' CDateFromIso CDateToIso
19 If ( CDateToIso( CDateFromIso("20161016") ) <> "20161016" ) Then
21 ' DATE DATEDIFF DATEADD
22 Else If ( DateDiff( "d", aVector(0), DateAdd("d", 1, aVector(0)) ) <> 1 ) Then
25 Else If ( DatePart( "d", aVector(0) ) <> Day( aVector(0) ) ) Then
27 ' DATESERIAL DATEVALUE
28 Else If ( DateSerial( 2016, 10, 16 ) <> DateValue("October 16, 2016") ) Then
32 Else If ( Hour(aVector(1)) <> Hour(aVector(1)) ) Then
35 Else If ( Minute(aVector(1)) <> Minute(aVector(1)) ) Then
38 Else If ( DatePart( "m", aVector(0) ) <> Month( aVector(0) ) ) Then
41 'Else If ( CDate( MonthName(10)&" 16, 2016" ) <> DateSerial(2016, 10, 16) ) Then
44 Else If ( Now() < aVector(0) + TimeValue(aVector(1)) ) Then
47 Else If ( Second(aVector(1)) <> Second(aVector(1)) ) Then
49 ' TIMER max value = 24*3600
50 Else If ( Timer() > 86400 ) Then
52 ' TIMESERIAL TIMEVALUE
53 Else If ( TimeSerial(13,54,48) <> TImeValue("13:54:48") ) Then
56 'Else If ( WeekdayName( Weekday(aVector(0) ) ) <> WeekDayName( DatePart( "w", aVector(0) ) ) ) Then
59 Else If ( DatePart( "yyyy", aVector(0) ) <> Year( aVector(0) ) ) Then