Error processing request

Parameters

CONTENT_LENGTH0
REQUEST_METHODGET
REQUEST_URI/revision/tcltest?V=67
QUERY_STRINGV=67
CONTENT_TYPE
DOCUMENT_URI/revision/tcltest
DOCUMENT_ROOT/var/www/nikit/nikit/nginx/../docroot
SCGI1
SERVER_PROTOCOLHTTP/1.1
HTTPSon
REMOTE_ADDR172.70.126.93
REMOTE_PORT36766
SERVER_PORT4443
SERVER_NAMEwiki.tcl-lang.org
HTTP_HOSTwiki.tcl-lang.org
HTTP_CONNECTIONKeep-Alive
HTTP_ACCEPT_ENCODINGgzip, br
HTTP_X_FORWARDED_FOR3.149.233.72
HTTP_CF_RAY87e422d5881c2b0b-ORD
HTTP_X_FORWARDED_PROTOhttps
HTTP_CF_VISITOR{"scheme":"https"}
HTTP_ACCEPT*/*
HTTP_USER_AGENTMozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; [email protected])
HTTP_CF_CONNECTING_IP3.149.233.72
HTTP_CDN_LOOPcloudflare
HTTP_CF_IPCOUNTRYUS

Body


Error

Unknow state transition: LINE -> END

-code

1

-level

0

-errorstack

INNER {returnImm {Unknow state transition: LINE -> END} {}} CALL {my render_wikit tcltest '''\[http://www.tcl.tk/man/tcl/TclCmd/tcltest.htm%|%tcltest\]''',\ a\ \[Tcl\ Commands%|%package\]\ distributed\ with\ Tcl,\ provides\ a\ framework\ for\ writing\ and\nexecuting\ program\ tests.\ \n\n\n\n**\ See\ Also\ **\n\n\ \ \ \[A\ look\ at\ the\ Tcl\ test\ suite\ with\ gcov\]:\ \ \ \n\n\ \ \ \[ycl%|%ycl\ test\ cleanup1\]:\ \ \ Used\ as\ `-cleanup\ \[cleanup1\]`\ in\ a\ test,\ returns\ the\ current\ namespace\ to\ the\ state\ it\ was\ in\ before\ the\ test\ was\ run.\ \ Useful\ to\ ensure\ that\ tests\ don't\ inadvertently\ affect\ each\ other.\n\n\n\n\ \ \ \[New\ Test\ Package\]:\ \ \ \n\n\ \ \ \[tcltap\]:\ \ \ a\ simple\ alternative\ for\ the\ small\ test\n\n\ \ \ \[TTXN\]:\ \ \ TclTest\ eXtended\ Notation\n\n\ \ \ \[Caius\]:\ \ \ Functional\ testing\ framework\ based\ on\ \[ITcl\],\ \[Expect\]\ and\ \[Selenium\].\n\n\n\n**\ Testimonials\ **\n\n\[VI\]\ :\ 2003-10-02.\ \ We\ at\ http://www.comit.com\ use\ Tcl\ (and\ Tk)\ extensively.\nWe\ use\ Tcl\ for\ hardware\ testing\ in\ simulation\ (think\ multimillion-gate,\nmultifunction\ asic\ verification).\ \ One\ of\ the\ major\ factors\ in\ our\ initial\ndecision\ to\ use\ Tcl\ and\ our\ continuing\ to\ use\ tcl\ is\ tcltest.\ \ \ We\ use\ most\ntcltest\ features\ including\ constraints\ and\ are\ very\ pleased\ with\ the\ easy\nconfiguration\ of\ tests\ and\ the\ reporting.\ \ I\ do\ have\ gripes,\ but\ relatively\nminor,\ and\ since\ it\ is\ pure\ Tcl,\ we\ can\ change\ it\ anyways..\n\n\n\n**\ Documentation\ **\n\n\ \ \ \[http://www.tcl.tk/man/tcl/TclCmd/tcltest.htm%|%official\ reference\]:\ \ \ \n\n\ \ \ \[https://wuhrr.wordpress.com/2011/03/28/getting-started-with-tcltest/%|%Getting\ Started\ with\ tcltest\],\ \[Hai\ Vu\],\ 2011-03-28:\ \ \ \n\n\ \ \ \[https://wuhrr.wordpress.com/2011/03/29/tcltest-part-2-multi-module-test-suite/%|%tcltest\ Part\ 2:\ \ Multi-Module\ Test\ Suite\],\ \[Hai\ Vu\],\ 2011-03-29:\ \ \ \n\n\ \ \ \[http://web.archive.org/web/20080617153002/www.tclscripting.com/articles/apr06/article1.html%|%Getting\ started\ with\ tcltest%|%\],\ \[Bryan\ Oakley\],\ 2006:\ \ \ \n\n\n\n**\ Examples\ **\n\n\ \ \ \[http://core.tcl.tk/tcl/dir?ci=trunk&name=tests%|%Tcl\ interpreter\ tests\]:\ \ \ \ '''tcltest'''\ is\ used\ to\ test\ Tcl\ itself,\ and\ those\ tests\ \ make\ great\ examples.\n\n\ \ \ \[How\ to\ write\ tcltest\ result\ values\]:\ \ \ \n\n\ \ \ \[Your\ first\ tcltests\]:\ \ \ \ \n\n\ \ \ \[tcllib\]:\ \ \ \[AK\]:\ Most\ modules\ in\ tcllib\ come\ with\ .test\ files\ using\ tcltest\ for\ regression\ testing.\n\n\n\n**\ Description\ **\n\nVersion\ 2,\ distributed\ with\ Tcl\ from\ version\ 8.4,\ \ is\ much\ more\ flexible\ in\ the\nkind\ of\ matching\ it\ permits.\ \ See\ \[tcltest\ customMatch\]\ for\ some\ examples.\n\ \ \ \ntcltest\ can\ also\ be\ used\ to\ create\ a\ customized\ test\ harness\ for\ an\nextension.\n\nScripts\ for\ `test`\ options\ like\ `-setup`,\ `-body`,\ and\ `-cleanup`\ are\ evaluated\nin\ the\ caller's\ scope.\ \ `\[return\]`\ exits\ the\ body.\ \ The\ last\ line\ of\ a\ test\ is\noften\ `\[return\]`\ or\ `\[set\]`.\ \ In\ this\ way,\ `test`\ is\ a\ control\ struccture\noften\ `\[return\]`\ or\ `\[set\]`.\ \ In\ this\ way,\ `\[test\]`\ is\ a\ control\ struccture\n`test`\ is\ that\ `-constraints`\ makes\ execution\ of\ the\ test\ conditional.\n\nCustomizing\ the\ output\ format\ of\ cleanupTests\ is\ not\ very\ feasible\ at\ this\ntime,\ as\ it\ is\ used\ as\ a\ programmatic\ interface\ for\ sub-processes\ in\ \[runAllTests\].\n\n\n\n**\ Running\ tcltest\ **\n\n\n***\ testing\ existing\ Tcl\ interpreter\ ***\n\nTo\ run\ the\ Tcl\ source\ code\ test\ suite\ against\ another\ installed\ Tcl\ interpreter:\n\n======none\ntclsh\ all.tcl\n======\n\n\n***\ accessing\ extra\ Tcltest\ extension\ commands\ ***\n\nSome\ commands\ specific\ for\ testing\ internals\ are\ in\ the\ `Tcltest`\ package\ (note:\ not\ `tcltest`),\ which\ is\ not\ built\ by\ default.\n`Tcltest`\ is\ not\ (yet?)\ available\ as\ an\ extension,\ so\ it\ needs\ to\ be\ built\ into\ a\ special\ `tcltest`\ executable\ with:\n\n======none\n\$\ make\ runtest\n\$\ ./tcltest\n%\ package\ require\ Tcltest\n8.6.2\n%\ llength\ \[info\ commands\ test*\]\n85\n======\n\nThese\ commands\ include\ `testparser`,\ mentioned\ elsewhere\ on\ the\ wiki\ (though\ \[tclparser\]\ provides\ an\ alternative\ as\ a\ loadable\ extension).\n\n\n***\ Run\ a\ Tcl\ test\ in\ verbose\ mode\ ***\n***\ Run\ a\ Tcl\ teset\ in\ verbose\ mode\ ***\nA\ wonderful\ addition\ to\ this\ page\ would\ be\ instructions\ on\ how\ to\ run\none\ particular\ test,\ using\ verbose\ mode,\ for\ the\ purpose\ of\ reporting\ntest\ suite\ failures\ to\ a\ package\ developer.\n\n\[DGP\]\ answers:\n\n======none\nmake\ TESTFLAGS='-verbose\ tpse\ -file\ safe.test'\ test\n======\n\n\n**\ complex\ results\ **\n\n\[RHS\]:\ One\ way\ to\ handle\ tests\ that\ the\ `-result`\ option\ can't\ handle\ is\ to\ do\ something\ like:\n\n======\ntest\ mytest-1.1\ \{\n\ \ \ \ Calling\ my\ proc\ should\ always\ return\ a\ list\ of\ at\ least\ length\ 3\n\}\ -body\ \{\n\ \ \ \ set\ result\ \[myProc\ a\ b\ c\ d\ e\]\n\ \ \ \ #\ -result\ can't\ handle\ \{>=\ llength\ 3\},\ so\ we\ test\ it\ here\n\ \ \ \ expr\ \{\ \[llength\ \$result\]\ >=\ 3\ \}\n\}\ -result\ \{1\}\n======\n\nIe,\ perform\ the\ test\ for\ passing\ inside\ the\ actual\ test\ body,\ and\ have\ the\ ''-result''\ be\ 1/0\ if\ that\ test\ passed/failed.\n\n----\n\n\[customMatch\]\ can\ also\ be\ used\ to\ the\ same\ effect:\ Define\ a\ script\ that\ compares\ an\ actual\ result\ with\ a\ target\ result.\ \ Then\ use\ \[customMatch\]\ to\ \"register\"\ that\ script\ for\ the\ `-match`\ option.\ \ The\ script\ should\ return\ a\ boolean\ option\ indicating\ match\ or\ no\ match.\n\n----\n\n\[PYK\]\ 2015-04-09:\ \ One\ strategy\ for\ some\ complex\ tests\ is\ to\ set\ `-result`\ to\nthe\ \[empty\ string\],\ and\ then\ in\ the\ body\ of\ the\ test\ to\ add\ an\ error\ message\ to\nthe\ result\ if\ some\ expectation\ isn't\ met.\ \ This\ has\ the\ advantage\ of\ providing\nimmediately-visible\ feedback\ about\ what\ the\ problem\ might\ be.\n\n----\n\n\[\[tcltest\ is\ a\ truly\ great\ and\ wonderful\ thing.\ \ We\ should\ make\ a\ point\ of\ explaining\ its\ virtues\ and\ uses.\]\n\n<<discussion>>\n\n\n\[\[A\ Pythoneer\ has\ written\ an\ article--which\n\[CL\]\ can\ locate\ if\ helpful--illustrating\ use\ of\ PyUnit\ with\ Roman\ numeral\ conversion.\nIn\ the\ absence\ of\ any\ other\ inspiration,\nmaybe\ someone\ wants\ to\ steal\ that\ example\ ...\]\]\ \n\n\[RS\],\ off\ page\ topic:\ See\ also\ \[Roman\ numbers\]\ for\ Tcl\ routines.\n\n----\n\n\[davidw\]\ 2003-10-03:\ I\ am\ doing\ some\ work\ to\ improve\ tcltest,\ specifically\ to\ give\ it\ an\ API\ so\ that\ you\ can\ programmatically\ fetch\ information\ about\ the\ test\ results.\ \ I\ would\ love\ to\ hear\ what\ sorts\ of\ features\ you\ would\ find\ useful\ -\ feel\ free\ to\ drop\ me\ email.\n\n----\n\n\[disneylogic\]:\ It\ would\ be\ useful\ to\ have\ a\ callback\ option,\ prefixed\nby\ \"-command\"\ perhaps,\ which\ appeals\ to\ an\ expression\ or\ proc\ to\ \ndetermine\ the\ correctness\ of\ a\ test.\ \ In\ lieu\ of\ demanding\ a\ real\ value\nto\ compare\ or\ abusing\ return\ codes,\ this\ would\ adjust\ 'tcltest'\ to\ perform\nmore\ like\ SUnit\ \[http://sourceforge.net/projects/sunit/\]\ in\ the\ Beck\ testing\ framework\ \[http://www.xprogramming.com/testfram.htm\].\n\nI\ encountered\ this\ when\ I\ was\ trying\ to\ write\ a\ routine\ to\ do\ sampling\ without\ replacement\ and\ could\ not\ specify\ a\ specific\ result\ to\ use\ to\ compare.\n\nIf\ there\ is\ already\ some\ way\ of\ doing\ this,\ please,\ please\ specify\ it\ here!\ \ I\ waded\ through\ the\ man\ page\ for\ a\ bit\ and\ couldn't\ find\ anything,\ particularly\ in\ the\ usage\ of\ 'test'\ section.\n\n\[DGP\]:\ Can\ you\ provide\ an\ example\ of\ what\ a\ test\nwould\ look\ like\ if\ there\ was\ a\ ''-command''\ option\nfor\ `test`\ ?\ \ Assume\ the\ reader\ knows\ nothing\ about\nfor\ \[test\]\ ?\ \ Assume\ the\ reader\ knows\ nothing\ about\n\n----\n\n\[LV\]:\ I\ have\ a\ programming\ ''itch''\ and\ am\ wondering\ if\ tcltest\ will\ help\ me\ scratch\ this\ itch.\n\nProblem:\ set\ up\ regression\ testing\ of\ a\ client/server\ command\ line\ and\ stdout/return\ code\ related\ pair\ of\ applications.\n\nCurrently,\ I'd\ love\ to\ find\ some\ help,\ tutorials,\ examples,\ etc.\ of\ how\ others\ are\ successfully\ doing\ this\ sort\ of\ thing\ with\ the\ result\ being\ test\ cases\ that\ are\ nearly\ trivial\ to\ read\ and\ write.\ I'd\ like\ to\ '''not'''\ have\ to\ teach\ people\ all\ of\ tcl\ before\ they\ can\ write\ new\ test\ cases.\ \ Ideally,\ having\ a\ half\ dozen\ or\ so\ examples\ should\ provide\ enough\ context\ to\ write\ additional\ code.\ \n\nI'd\ also\ like\ suggestions\ for\ '''best\ practices'''\ relating\ to\ this\ sort\ of\ use\ of\ tcltest.\n\nThanks!\n\n----\n\n\[fermulator\]:\ If\ a\ particular\ test\ spews\ out\ a\ bunch\ of\ debug\ information\ (i.e.\ 'test\ debug\ mode'),\ is\ there\ a\ way\ to\ redirect\ stdout,\ for\ a\ specific\ test,\ to\ /dev/null?\ \ I\ can't\ seem\ to\ find\ a\ way\ to\ hide\ stdout.\ \ It's\ basically:\n\n\n======\ntest\ print_debug_true\ \{\ntest\ print_debug_true\ \\\n\{\n\ \ \ \ work\ as\ expected\ (no\ errors\ are\ caught).\n\}\ -setup\ \{\n\}\ \\\n-setup\ \\\n\{\n\ \ \ \ \$myObj\ setDebug\ true\n\}\ -body\ \{\n\}\ \\\n-body\ \\\n\{\n\ \ \ \ #\ If\ it\ fails,\ error\ out,\ else\ return\ PASS.\n\ \ \ \ if\ \{\ \[catch\ \{\$myObj\ doStuff\}\ err\]\ \}\ \{\n\ \ \ \ if\ \{\ \[catch\ \{\$myObj\ doStuff\}\ err\]\ \}\ \\\n\ \ \ \ \{\n\ \ \ \ \}\n\ \ \ \ return\ PASS\n\}\ -result\ \{PASS\}\n\}\ \\\n-result\ \{PASS\}\n\nWhen\ I\ run\ the\ above\ test,\ stdout\ on\ the\ test\ output\ gets\ spammed\ with\ a\ whack\ of\ debug\ information,\ and\ it\ \"skews\"\ the\ high\ level\ view\ of\ which\ tests\ are\ running,\ passing,\ failing,\ etc.\n\n\n<<discussion>>\n\n<<categories>>\ Testing\ |\ Package\ |\ Command\ |\ Tcl\ |\ \ Arts\ and\ crafts\ of\ Tcl-Tk\ programming\n<<categories>>\ Testing\ |\ Package\ |\ Command\ |\ Tcl\ |\ \ Tcl\ syntax\ help\ |\ Arts\ and\ crafts\ of\ Tcl-Tk\ programming regexp2} CALL {my render tcltest '''\[http://www.tcl.tk/man/tcl/TclCmd/tcltest.htm%|%tcltest\]''',\ a\ \[Tcl\ Commands%|%package\]\ distributed\ with\ Tcl,\ provides\ a\ framework\ for\ writing\ and\nexecuting\ program\ tests.\ \n\n\n\n**\ See\ Also\ **\n\n\ \ \ \[A\ look\ at\ the\ Tcl\ test\ suite\ with\ gcov\]:\ \ \ \n\n\ \ \ \[ycl%|%ycl\ test\ cleanup1\]:\ \ \ Used\ as\ `-cleanup\ \[cleanup1\]`\ in\ a\ test,\ returns\ the\ current\ namespace\ to\ the\ state\ it\ was\ in\ before\ the\ test\ was\ run.\ \ Useful\ to\ ensure\ that\ tests\ don't\ inadvertently\ affect\ each\ other.\n\n\n\n\ \ \ \[New\ Test\ Package\]:\ \ \ \n\n\ \ \ \[tcltap\]:\ \ \ a\ simple\ alternative\ for\ the\ small\ test\n\n\ \ \ \[TTXN\]:\ \ \ TclTest\ eXtended\ Notation\n\n\ \ \ \[Caius\]:\ \ \ Functional\ testing\ framework\ based\ on\ \[ITcl\],\ \[Expect\]\ and\ \[Selenium\].\n\n\n\n**\ Testimonials\ **\n\n\[VI\]\ :\ 2003-10-02.\ \ We\ at\ http://www.comit.com\ use\ Tcl\ (and\ Tk)\ extensively.\nWe\ use\ Tcl\ for\ hardware\ testing\ in\ simulation\ (think\ multimillion-gate,\nmultifunction\ asic\ verification).\ \ One\ of\ the\ major\ factors\ in\ our\ initial\ndecision\ to\ use\ Tcl\ and\ our\ continuing\ to\ use\ tcl\ is\ tcltest.\ \ \ We\ use\ most\ntcltest\ features\ including\ constraints\ and\ are\ very\ pleased\ with\ the\ easy\nconfiguration\ of\ tests\ and\ the\ reporting.\ \ I\ do\ have\ gripes,\ but\ relatively\nminor,\ and\ since\ it\ is\ pure\ Tcl,\ we\ can\ change\ it\ anyways..\n\n\n\n**\ Documentation\ **\n\n\ \ \ \[http://www.tcl.tk/man/tcl/TclCmd/tcltest.htm%|%official\ reference\]:\ \ \ \n\n\ \ \ \[https://wuhrr.wordpress.com/2011/03/28/getting-started-with-tcltest/%|%Getting\ Started\ with\ tcltest\],\ \[Hai\ Vu\],\ 2011-03-28:\ \ \ \n\n\ \ \ \[https://wuhrr.wordpress.com/2011/03/29/tcltest-part-2-multi-module-test-suite/%|%tcltest\ Part\ 2:\ \ Multi-Module\ Test\ Suite\],\ \[Hai\ Vu\],\ 2011-03-29:\ \ \ \n\n\ \ \ \[http://web.archive.org/web/20080617153002/www.tclscripting.com/articles/apr06/article1.html%|%Getting\ started\ with\ tcltest%|%\],\ \[Bryan\ Oakley\],\ 2006:\ \ \ \n\n\n\n**\ Examples\ **\n\n\ \ \ \[http://core.tcl.tk/tcl/dir?ci=trunk&name=tests%|%Tcl\ interpreter\ tests\]:\ \ \ \ '''tcltest'''\ is\ used\ to\ test\ Tcl\ itself,\ and\ those\ tests\ \ make\ great\ examples.\n\n\ \ \ \[How\ to\ write\ tcltest\ result\ values\]:\ \ \ \n\n\ \ \ \[Your\ first\ tcltests\]:\ \ \ \ \n\n\ \ \ \[tcllib\]:\ \ \ \[AK\]:\ Most\ modules\ in\ tcllib\ come\ with\ .test\ files\ using\ tcltest\ for\ regression\ testing.\n\n\n\n**\ Description\ **\n\nVersion\ 2,\ distributed\ with\ Tcl\ from\ version\ 8.4,\ \ is\ much\ more\ flexible\ in\ the\nkind\ of\ matching\ it\ permits.\ \ See\ \[tcltest\ customMatch\]\ for\ some\ examples.\n\ \ \ \ntcltest\ can\ also\ be\ used\ to\ create\ a\ customized\ test\ harness\ for\ an\nextension.\n\nScripts\ for\ `test`\ options\ like\ `-setup`,\ `-body`,\ and\ `-cleanup`\ are\ evaluated\nin\ the\ caller's\ scope.\ \ `\[return\]`\ exits\ the\ body.\ \ The\ last\ line\ of\ a\ test\ is\noften\ `\[return\]`\ or\ `\[set\]`.\ \ In\ this\ way,\ `test`\ is\ a\ control\ struccture\noften\ `\[return\]`\ or\ `\[set\]`.\ \ In\ this\ way,\ `\[test\]`\ is\ a\ control\ struccture\n`test`\ is\ that\ `-constraints`\ makes\ execution\ of\ the\ test\ conditional.\n\nCustomizing\ the\ output\ format\ of\ cleanupTests\ is\ not\ very\ feasible\ at\ this\ntime,\ as\ it\ is\ used\ as\ a\ programmatic\ interface\ for\ sub-processes\ in\ \[runAllTests\].\n\n\n\n**\ Running\ tcltest\ **\n\n\n***\ testing\ existing\ Tcl\ interpreter\ ***\n\nTo\ run\ the\ Tcl\ source\ code\ test\ suite\ against\ another\ installed\ Tcl\ interpreter:\n\n======none\ntclsh\ all.tcl\n======\n\n\n***\ accessing\ extra\ Tcltest\ extension\ commands\ ***\n\nSome\ commands\ specific\ for\ testing\ internals\ are\ in\ the\ `Tcltest`\ package\ (note:\ not\ `tcltest`),\ which\ is\ not\ built\ by\ default.\n`Tcltest`\ is\ not\ (yet?)\ available\ as\ an\ extension,\ so\ it\ needs\ to\ be\ built\ into\ a\ special\ `tcltest`\ executable\ with:\n\n======none\n\$\ make\ runtest\n\$\ ./tcltest\n%\ package\ require\ Tcltest\n8.6.2\n%\ llength\ \[info\ commands\ test*\]\n85\n======\n\nThese\ commands\ include\ `testparser`,\ mentioned\ elsewhere\ on\ the\ wiki\ (though\ \[tclparser\]\ provides\ an\ alternative\ as\ a\ loadable\ extension).\n\n\n***\ Run\ a\ Tcl\ test\ in\ verbose\ mode\ ***\n***\ Run\ a\ Tcl\ teset\ in\ verbose\ mode\ ***\nA\ wonderful\ addition\ to\ this\ page\ would\ be\ instructions\ on\ how\ to\ run\none\ particular\ test,\ using\ verbose\ mode,\ for\ the\ purpose\ of\ reporting\ntest\ suite\ failures\ to\ a\ package\ developer.\n\n\[DGP\]\ answers:\n\n======none\nmake\ TESTFLAGS='-verbose\ tpse\ -file\ safe.test'\ test\n======\n\n\n**\ complex\ results\ **\n\n\[RHS\]:\ One\ way\ to\ handle\ tests\ that\ the\ `-result`\ option\ can't\ handle\ is\ to\ do\ something\ like:\n\n======\ntest\ mytest-1.1\ \{\n\ \ \ \ Calling\ my\ proc\ should\ always\ return\ a\ list\ of\ at\ least\ length\ 3\n\}\ -body\ \{\n\ \ \ \ set\ result\ \[myProc\ a\ b\ c\ d\ e\]\n\ \ \ \ #\ -result\ can't\ handle\ \{>=\ llength\ 3\},\ so\ we\ test\ it\ here\n\ \ \ \ expr\ \{\ \[llength\ \$result\]\ >=\ 3\ \}\n\}\ -result\ \{1\}\n======\n\nIe,\ perform\ the\ test\ for\ passing\ inside\ the\ actual\ test\ body,\ and\ have\ the\ ''-result''\ be\ 1/0\ if\ that\ test\ passed/failed.\n\n----\n\n\[customMatch\]\ can\ also\ be\ used\ to\ the\ same\ effect:\ Define\ a\ script\ that\ compares\ an\ actual\ result\ with\ a\ target\ result.\ \ Then\ use\ \[customMatch\]\ to\ \"register\"\ that\ script\ for\ the\ `-match`\ option.\ \ The\ script\ should\ return\ a\ boolean\ option\ indicating\ match\ or\ no\ match.\n\n----\n\n\[PYK\]\ 2015-04-09:\ \ One\ strategy\ for\ some\ complex\ tests\ is\ to\ set\ `-result`\ to\nthe\ \[empty\ string\],\ and\ then\ in\ the\ body\ of\ the\ test\ to\ add\ an\ error\ message\ to\nthe\ result\ if\ some\ expectation\ isn't\ met.\ \ This\ has\ the\ advantage\ of\ providing\nimmediately-visible\ feedback\ about\ what\ the\ problem\ might\ be.\n\n----\n\n\[\[tcltest\ is\ a\ truly\ great\ and\ wonderful\ thing.\ \ We\ should\ make\ a\ point\ of\ explaining\ its\ virtues\ and\ uses.\]\n\n<<discussion>>\n\n\n\[\[A\ Pythoneer\ has\ written\ an\ article--which\n\[CL\]\ can\ locate\ if\ helpful--illustrating\ use\ of\ PyUnit\ with\ Roman\ numeral\ conversion.\nIn\ the\ absence\ of\ any\ other\ inspiration,\nmaybe\ someone\ wants\ to\ steal\ that\ example\ ...\]\]\ \n\n\[RS\],\ off\ page\ topic:\ See\ also\ \[Roman\ numbers\]\ for\ Tcl\ routines.\n\n----\n\n\[davidw\]\ 2003-10-03:\ I\ am\ doing\ some\ work\ to\ improve\ tcltest,\ specifically\ to\ give\ it\ an\ API\ so\ that\ you\ can\ programmatically\ fetch\ information\ about\ the\ test\ results.\ \ I\ would\ love\ to\ hear\ what\ sorts\ of\ features\ you\ would\ find\ useful\ -\ feel\ free\ to\ drop\ me\ email.\n\n----\n\n\[disneylogic\]:\ It\ would\ be\ useful\ to\ have\ a\ callback\ option,\ prefixed\nby\ \"-command\"\ perhaps,\ which\ appeals\ to\ an\ expression\ or\ proc\ to\ \ndetermine\ the\ correctness\ of\ a\ test.\ \ In\ lieu\ of\ demanding\ a\ real\ value\nto\ compare\ or\ abusing\ return\ codes,\ this\ would\ adjust\ 'tcltest'\ to\ perform\nmore\ like\ SUnit\ \[http://sourceforge.net/projects/sunit/\]\ in\ the\ Beck\ testing\ framework\ \[http://www.xprogramming.com/testfram.htm\].\n\nI\ encountered\ this\ when\ I\ was\ trying\ to\ write\ a\ routine\ to\ do\ sampling\ without\ replacement\ and\ could\ not\ specify\ a\ specific\ result\ to\ use\ to\ compare.\n\nIf\ there\ is\ already\ some\ way\ of\ doing\ this,\ please,\ please\ specify\ it\ here!\ \ I\ waded\ through\ the\ man\ page\ for\ a\ bit\ and\ couldn't\ find\ anything,\ particularly\ in\ the\ usage\ of\ 'test'\ section.\n\n\[DGP\]:\ Can\ you\ provide\ an\ example\ of\ what\ a\ test\nwould\ look\ like\ if\ there\ was\ a\ ''-command''\ option\nfor\ `test`\ ?\ \ Assume\ the\ reader\ knows\ nothing\ about\nfor\ \[test\]\ ?\ \ Assume\ the\ reader\ knows\ nothing\ about\n\n----\n\n\[LV\]:\ I\ have\ a\ programming\ ''itch''\ and\ am\ wondering\ if\ tcltest\ will\ help\ me\ scratch\ this\ itch.\n\nProblem:\ set\ up\ regression\ testing\ of\ a\ client/server\ command\ line\ and\ stdout/return\ code\ related\ pair\ of\ applications.\n\nCurrently,\ I'd\ love\ to\ find\ some\ help,\ tutorials,\ examples,\ etc.\ of\ how\ others\ are\ successfully\ doing\ this\ sort\ of\ thing\ with\ the\ result\ being\ test\ cases\ that\ are\ nearly\ trivial\ to\ read\ and\ write.\ I'd\ like\ to\ '''not'''\ have\ to\ teach\ people\ all\ of\ tcl\ before\ they\ can\ write\ new\ test\ cases.\ \ Ideally,\ having\ a\ half\ dozen\ or\ so\ examples\ should\ provide\ enough\ context\ to\ write\ additional\ code.\ \n\nI'd\ also\ like\ suggestions\ for\ '''best\ practices'''\ relating\ to\ this\ sort\ of\ use\ of\ tcltest.\n\nThanks!\n\n----\n\n\[fermulator\]:\ If\ a\ particular\ test\ spews\ out\ a\ bunch\ of\ debug\ information\ (i.e.\ 'test\ debug\ mode'),\ is\ there\ a\ way\ to\ redirect\ stdout,\ for\ a\ specific\ test,\ to\ /dev/null?\ \ I\ can't\ seem\ to\ find\ a\ way\ to\ hide\ stdout.\ \ It's\ basically:\n\n\n======\ntest\ print_debug_true\ \{\ntest\ print_debug_true\ \\\n\{\n\ \ \ \ work\ as\ expected\ (no\ errors\ are\ caught).\n\}\ -setup\ \{\n\}\ \\\n-setup\ \\\n\{\n\ \ \ \ \$myObj\ setDebug\ true\n\}\ -body\ \{\n\}\ \\\n-body\ \\\n\{\n\ \ \ \ #\ If\ it\ fails,\ error\ out,\ else\ return\ PASS.\n\ \ \ \ if\ \{\ \[catch\ \{\$myObj\ doStuff\}\ err\]\ \}\ \{\n\ \ \ \ if\ \{\ \[catch\ \{\$myObj\ doStuff\}\ err\]\ \}\ \\\n\ \ \ \ \{\n\ \ \ \ \}\n\ \ \ \ return\ PASS\n\}\ -result\ \{PASS\}\n\}\ \\\n-result\ \{PASS\}\n\nWhen\ I\ run\ the\ above\ test,\ stdout\ on\ the\ test\ output\ gets\ spammed\ with\ a\ whack\ of\ debug\ information,\ and\ it\ \"skews\"\ the\ high\ level\ view\ of\ which\ tests\ are\ running,\ passing,\ failing,\ etc.\n\n\n<<discussion>>\n\n<<categories>>\ Testing\ |\ Package\ |\ Command\ |\ Tcl\ |\ \ Arts\ and\ crafts\ of\ Tcl-Tk\ programming\n<<categories>>\ Testing\ |\ Package\ |\ Command\ |\ Tcl\ |\ \ Tcl\ syntax\ help\ |\ Arts\ and\ crafts\ of\ Tcl-Tk\ programming} CALL {my revision tcltest} CALL {::oo::Obj5239858 process revision/tcltest} CALL {::oo::Obj5239856 process}

-errorcode

NONE

-errorinfo

Unknow state transition: LINE -> END
    while executing
"error $msg"
    (class "::Wiki" method "render_wikit" line 6)
    invoked from within
"my render_$default_markup $N $C $mkup_rendering_engine"
    (class "::Wiki" method "render" line 8)
    invoked from within
"my render $name $C"
    (class "::Wiki" method "revision" line 31)
    invoked from within
"my revision $page"
    (class "::Wiki" method "process" line 56)
    invoked from within
"$server process [string trim $uri /]"

-errorline

4