Home Known Issues Latest Fixes Readme doc / Readme test / Readme Manual News Changelog Policies Roadmap Wishlist License
Gen
tests/Readme
01| HOW TO USE THIS DOCUMENT
02| INTRO
03| RUNNING TESTS
04| BUG REPORTING
05| CONTRIBUTING
06| CATALOG
07| CREDITS

—01| HOW TO USE THIS DOCUMENT

What is the point of these tests? What are they for? What do they accomplish?
See INTRO.

How can I find out what files should be in this directory and what they are for?
See CATALOG.

How do I run the tests myself?
See RUNNING TESTS.

What if I find problems with the tests?
See REPORTING ISSUES.

How can I contribute back tests?
See CONTRIBUTING.

—02| INTRO

Gen includes a moderate suite of tests which double as code samples. The purpose of the tests is not to be exhaustive and guarantee the code is perfect so much as establish a baseline of confidence in the library. The goal of the tests is to be able to say that if you find an error caused by the library code itself, you are doing something out-of-the-ordinary; all the typical ways things can go wrong, we should have checked.

Note that we do not test the core Tcl commands invoked by Gen commands. For instance, we do not include tests to check whether the Tcl regexp command works correctly or to check the input you pass in to ensure it is valid before passing it along to commands. For instance, suppose you were to enter this —

% set MyDict [ArrangeDict {one uno two dos three} {three two one}]

— here the dict is invalid. The ArrangeDict command does not check your input but rather the error "missing value to go with key" will be generated by the dict exists command, which you will see with puts $::errorInfo. We do not have any functionality in ArrangeDict that tries to ensure a call to dict exists will not generate an error and we also do not have any corresponding tests.

—03| RUNNING TESTS

To run all tests from the command line:
> tclsh86 all.tcl

To run all tests from the Tcl shell:
% source all.tct

To run tests for a given proc (for instance, AddTo) from the command line:
> tclsh86 addto.test

To run tests for a given proc (for instance, AddTo) from the tcl shell:
% source addto.test

To run the FTP tests, you will also need to do special set up. See test/README-test-ftp.txt or test/README-test-ftp.html for details.

—04| BUG REPORTING

If you find bugs in tests or missing tests, please let us know.

Visit the online feedback page and use the form to send a message.

Alternatively, send an email to:

and we will try to get back to you ASAP.

—05| CONTRIBUTING

Nothing formal has been set up for governing this project, yet.

If you like, you may change the test code yourself or write a new test and submit a patch to:

(for bug fixes)
-or-
(for tests you implemented)

A roadmap (scheduled changes) and wishlist (not yet scheduled) are available.

You may want to get involved by submitting wishlist items and/or offering to do work listed in the above two sites.

—06| CATALOG

all.tcl

Test suite.

README-test-ftp.html

About how to run FTP-related tests.

README-test-ftp.txt

About how to run FTP-related tests.

test-reload-package.tcl

For ReloadPackage tests.

test-reload-package.tcl.1

For ReloadPackage tests.

test-reload-package.tcl.2

For ReloadPackage tests.

test.db

Sample data, etc. for database-related tests.

addepilogue.test

Tests for the command AddEpilogue.

addprologue.test

Tests for the command AddPrologue.

addto.test

Tests for the command AddTo.

appendstring2file.test

Tests for the command AppendString2File.

arrangedict.test

Tests for the command ArrangeDict.

backupifexists.test

Tests for the command BackupIfExists.

changecasing.test

Tests for the command ChangeCasing.

chopleft.test

Tests for the command ChopLeft.

chopright.test

Tests for the command ChopRight.

coe.test

Tests for the command Coe.

commaseparatedstringtolist.test

Tests for the command CommaSeparatedStringToList.

copyeverythingindirectory.test

Tests for the command CopyEverythingInDirectory.

currentdayoftheweek.test

Tests for the command CurrentDayOfTheWeek.

currenttimeofday.test

Tests for the command CurrentTimeOfDay.

currenttimeofdayisabout.test

Tests for the command CurrentTimeOfDayIsAbout.

currenttimeofdayisafter.test

Tests for the command CurrentTimeOfDayIsAfter.

currenttimeofdayisatorafter.test

Tests for the command CurrentTimeOfDayIsAtOrAfter.

currenttimeofdayisatorbefore.test

Tests for the command CurrentTimeOfDayIsAtOrBefore.

currenttimeofdayisbefore.test

Tests for the command CurrentTimeOfDayIsBefore.

currenttimeofdayisbetween.test

Tests for the command CurrentTimeOfDayIsBetween.

dateisafter.test

Tests for the command DateIsAfter.

dateisbefore.test

Tests for the command DateIsBefore.

dateisbetween.test

Tests for the command DateIsBetween.

dateison.test

Tests for the command DateIsOn.

dateisonorafter.test

Tests for the command DateIsOnOrAfter.

dateisonorbefore.test

Tests for the command DateIsOnOrBefore.

dateminus.test

Tests for the command DateMinus.

dateminusdays.test

Tests for the command DateMinusDays.

dateplus.test

Tests for the command DatePlus.

dateplusdays.test

Tests for the command DatePlusDays.

datetimeisafter.test

Tests for the command DatetimeIsAfter.

datetimeisat.test

Tests for the command DatetimeIsAt.

datetimeisatorafter.test

Tests for the command DatetimeIsAtOrAfter.

datetimeisatorbefore.test

Tests for the command DatetimeIsAtOrBefore.

datetimeisbefore.test

Tests for the command DatetimeIsBefore.

datetimeisbetween.test

Tests for the command DatetimeIsBetween.

datetimeminus.test

Tests for the command DatetimeMinus.

datetimeplus.test

Tests for the command DatetimePlus.

datetimequantity2seconds.test

Tests for the command DatetimeQuantity2Seconds.

dbaseregsub.test

Tests for the command DbaseRegsub.

decr.test

Tests for the command Decr.

decrdbglobal.test

Tests for the command DecrDbGlobal.

deleteeverythingindirectory.test

Tests for the command DeleteEverythingInDirectory.

dict2registrytree.test

Tests for the command Dict2RegistryTree.

diffhhmmss.test

Tests for the command DiffHhmmss.

divideby.test

Tests for the command DivideBy.

doublechop.test

Tests for the command DoubleChop.

endswith.test

Tests for the command EndsWith.

evallist.test

Tests for the command EvalList.

file2list.test

Tests for the command File2List.

file2string.test

Tests for the command File2String.

findandremove.test

Tests for the command FindAndRemove.

findnearestprecedingrecurrence.test

Tests for the command FindNearestPrecedingRecurrence.

findnearestsucceedingrecurrence.test

Tests for the command FindNearestSucceedingRecurrence.

firstof.test

Tests for the command FirstOf.

flip.test

Tests for the command Flip.

foreachrecord.test

Tests for the command ForeachRecord.

ftpcleanremotedirectory.test

Tests for the command FtpCleanRemoteDirectory.

ftpdownloaddirectory.test

Tests for the command FtpDownloadDirectory.

ftpdownloadfiles.test

Tests for the command FtpDownloadFiles.

ftpdownloadsite.test

Tests for the command FtpDownloadSite.

ftpmirrorlocaltoremote.test

Tests for the command FtpMirrorLocalToRemote.

ftpmirrorremotetolocal.test

Tests for the command FtpMirrorRemoteToLocal.

ftpuploaddirectory.test

Tests for the command FtpUploadDirectory.

ftpuploadfiles.test

Tests for the command FtpUploadFiles.

ftpuploadsite.test

Tests for the command FtpUploadSite.

ftpwhichislarger.test

Tests for the command FtpWhichIsLarger.

ftpwhichisnewer.test

Tests for the command FtpWhichIsNewer.

getdbglobal.test

Tests for the command GetDbGlobal.

getemailusingimap4.test

Tests for the command GetEmailUsingImap4.

getemailusingpop3.test

Tests for the command GetEmailUsingPop3.

hhmmss2seconds.test

Tests for the command Hhmmss2Seconds.

htmllisttreefromdict.test

Tests for the command HtmlListTreeFromDict.

htmlparagraphsfromdoublenewlinesstring.test

Tests for the command HtmlParagraphsFromDoubleNewlinesString.

includeexcludelistfilter.test

Tests for the command IncludeExcludeListFilter.

incrdbglobal.test

Tests for the command IncrDbGlobal.

isdate.test

Tests for the command IsDate.

isdatetime.test

Tests for the command IsDatetime.

isdatetimequantity.test

Tests for the command IsDatetimeQuantity.

isdict.test

Tests for the command IsDict.

isempty.test

Tests for the command IsEmpty.

ishhmmss.test

Tests for the command IsHhmmss.

ismatrix.test

Tests for the command IsMatrix.

isnegative.test

Tests for the command IsNegative.

isnonnegative.test

Tests for the command IsNonNegative.

isnonnumeric.test

Tests for the command IsNonNumeric.

isnonpositive.test

Tests for the command IsNonPositive.

isnonzero.test

Tests for the command IsNonZero.

isnumeric.test

Tests for the command IsNumeric.

ispositive.test

Tests for the command IsPositive.

istimeofday.test

Tests for the command IsTimeOfDay.

isvalidlistindex.test

Tests for the command IsValidListIndex.

iszero.test

Tests for the command IsZero.

lappendifnotalready.test

Tests for the command LappendIfNotAlready.

lastid.test

Tests for the command LastId.

lastmonth.test

Tests for the command LastMonth.

lastof.test

Tests for the command LastOf.

lastyear.test

Tests for the command LastYear.

limitlinelengthinfile.test

Tests for the command LimitLineLengthInFile.

linktclvariabletoregistryvalue.test

Tests for the command LinkTclVariableToRegistryValue.

linkvartodbglobal.test

Tests for the command LinkVarToDbGlobal.

list2file.test

Tests for the command List2File.

listendindex.test

Tests for the command ListEndIndex.

listremoveat.test

Tests for the command ListRemoveAt.

mash.test

Tests for the command Mash.

matrix2htmltable.test

Tests for the command Matrix2HtmlTable.

multiset.test

Tests for the command MultiSet.

multiplyby.test

Tests for the command MultiplyBy.

multiplyhhmmss.test

Tests for the command MultiplyHhmmss.

newlinesstringtoonehtmlparagraph.test

Tests for the command NewlinesStringToOneHtmlParagraph.

nextmonth.test

Tests for the command NextMonth.

nextyear.test

Tests for the command NextYear.

notempty.test

Tests for the command NotEmpty.

now.test

Tests for the command Now.

prepend.test

Tests for the command Prepend.

printdict.test

Tests for the command PrintDict.

printmatrix.test

Tests for the command PrintMatrix.

printvar.test

Tests for the command PrintVar.

printvars.test

Tests for the command PrintVars.

q1.test

Tests for the command Q1.

qq.test

Tests for the command QQ.

quasitablefromkeyvaluelist.test

Tests for the command QuasiTableFromKeyValueList.

raise.test

Tests for the command Raise.

registryexists.test

Tests for the command RegistryExists.

registryprint.test

Tests for the command RegistryPrint.

registrytree2dict.test

Tests for the command RegistryTree2Dict.

reloadpackage.test

Tests for the command ReloadPackage.

restoreifexists.test

Tests for the command RestoreIfExists.

restoreworkingdirectory.test

Tests for the command RestoreWorkingDirectory.

retzeroifempty.test

Tests for the command RetZeroIfEmpty.

run.test

Tests for the command Run.

runsqlcreatetable.test

Tests for the command RunSqlCreateTable.

runsqlenter.test

Tests for the command RunSqlEnter.

runsqlinsertifdoesnotexist.test

Tests for the command RunSqlInsertIfDoesNotExist.

saveworkingdirectory.test

Tests for the command SaveWorkingDirectory.

seconds2datetimequantity.test

Tests for the command Seconds2DatetimeQuantity.

seconds2hhmmss.test

Tests for the command Seconds2Hhmmss.

sendemail.test

Tests for the command SendEmail.

setdateformat.test

Tests for the command SetDateFormat.

setdatetimeformat.test

Tests for the command SetDatetimeFormat.

setdbglobal.test

Tests for the command SetDbGlobal.

settimeofdayformat.test

Tests for the command SetTimeOfDayFormat.

setzeroifempty.test

Tests for the command SetZeroIfEmpty.

showtable.test

Tests for the command ShowTable.

sliceleft.test

Tests for the command SliceLeft.

sliceright.test

Tests for the command SliceRight.

splitandtrim.test

Tests for the command SplitAndTrim.

splitntimes.test

Tests for the command SplitNTimes.

splitstringbycharactercount.test

Tests for the command SplitStringByCharacterCount.

sqlcountstatement.test

Tests for the command SqlCountStatement.

sqlinsertstatement.test

Tests for the command SqlInsertStatement.

sqlrecordexists.test

Tests for the command SqlRecordExists.

sqlselectstatement.test

Tests for the command SqlSelectStatement.

sqlsetclause.test

Tests for the command SqlSetClause.

sqlupdatestatement.test

Tests for the command SqlUpdateStatement.

sqlwhereclause.test

Tests for the command SqlWhereClause.

sqlitecolumnnameandtypelist.test

Tests for the command SqliteColumnNameAndTypeList.

sqlitecolumnnamelist.test

Tests for the command SqliteColumnNameList.

sqlitecolumntype.test

Tests for the command SqliteColumnType.

sqlitecopytable.test

Tests for the command SqliteCopyTable.

sqliterenamecolumn.test

Tests for the command SqliteRenameColumn.

sqlitetableexists.test

Tests for the command SqliteTableExists.

startsandendswith.test

Tests for the command StartsAndEndsWith.

startswith.test

Tests for the command StartsWith.

string2file.test

Tests for the command String2File.

stringcontains.test

Tests for the command StringContains.

stringinsert.test

Tests for the command StringInsert.

stringmatchesany.test

Tests for the command StringMatchesAny.

stringmid.test

Tests for the command StringMid.

striphtmltags.test

Tests for the command StripHtmlTags.

subtractfrom.test

Tests for the command SubtractFrom.

sumhhmmss.test

Tests for the command SumHhmmss.

surroundeach.test

Tests for the command SurroundEach.

swap.test

Tests for the command Swap.

ter.test

Tests for the command Ter.

thismonth.test

Tests for the command ThisMonth.

thisyear.test

Tests for the command ThisYear.

timebetweendates.test

Tests for the command TimeBetweenDates.

timebetweendatetimes.test

Tests for the command TimeBetweenDatetimes.

timebetweentimesofday.test

Tests for the command TimeBetweenTimesOfDay.

timeleftuntiltargetdate.test

Tests for the command TimeLeftUntilTargetDate.

timeleftuntiltargetdatetime.test

Tests for the command TimeLeftUntilTargetDatetime.

timeleftuntiltargettimeofday.test

Tests for the command TimeLeftUntilTargetTimeOfDay.

timeofdayisabout.test

Tests for the command TimeOfDayIsAbout.

timeofdayisafter.test

Tests for the command TimeOfDayIsAfter.

timeofdayisat.test

Tests for the command TimeOfDayIsAt.

timeofdayisatorafter.test

Tests for the command TimeOfDayIsAtOrAfter.

timeofdayisatorbefore.test

Tests for the command TimeOfDayIsAtOrBefore.

timeofdayisbefore.test

Tests for the command TimeOfDayIsBefore.

timeofdayisbetween.test

Tests for the command TimeOfDayIsBetween.

tobackslashes.test

Tests for the command ToBackslashes.

todoublebackslashes.test

Tests for the command ToDoubleBackslashes.

toforwardslashes.test

Tests for the command ToForwardSlashes.

today.test

Tests for the command Today.

tomorrow.test

Tests for the command Tomorrow.

unlinktclvariablefromregistryvalue.test

Tests for the command UnlinkTclVariableFromRegistryValue.

unlinkvarfromdbglobal.test

Tests for the command UnlinkVarFromDbGlobal.

unsetdbglobal.test

Tests for the command UnsetDbGlobal.

upvarexistingordie.test

Tests for the command UpvarExistingOrDie.

upvarx.test

Tests for the command UpvarX.

varexistsincaller.test

Tests for the command VarExistsInCaller.

yesterday.test

Tests for the command Yesterday.

—07| OTHER

Nothing else to note at this time.

—08| CREDITS

Testing was done using the tcltest package.

Information posted at wiki.tcl.tk was helpful.