<i>tcltest - request to move -cleanup script execution until after -output compare</i>.
by
.
D 2014-06-19T03:32:09.558
J assignee nobody
J closer nobody
J cmimetype text/plain
J comment I've\sbeen\strying\sto\screate\sa\scustomMatch\sin\stcltest\sthat\sallows\sme\sto\sspecify\sthe\soutput\sresults\svia\sthe\s-output\sswitch\sthat\suses\sdata\sgenerated\sby\sthe\s-body\sportion\sof\sthe\stest.\r\n\r\nSo,\sthe\s-output\sswitch\sin\ssuch\sa\sscenario\swould\slook\ssomething\slike:\r\n\r\n-output\s{$myVariableDefinedIntheBodySection}\r\n\r\nand\sthe\scustomMatch\sis\sequally\sstraightforward\swith:\r\n\r\ntcltest::customMatch\sexactSubst\sexactSubst\r\nproc\sexactSubst\s{\sexpected\sactual\s}\s{\r\n\s\sset\sexpectedSubst\s"subst\s{$expected}"\r\n\s\sset\sexpectedSubst\s[uplevel\s1\s$expectedSubst]\r\n\s\sreturn\s[tcltest::CompareStrings\s$actual\s$expectedSubst\sexact]\r\n}\r\n\r\nso,\sI\sjust\smake\sthe\scustomMatch\sperform\sthe\srequired\svariable\ssubstitution\sin\sthe\s-output\svalue.\r\n\r\nTo\suse\sit\sI\suse\s-match\sexactSubst\sas\sexpected.\r\n\r\nAll\sis\swell\s*except*\sin\sthe\s-cleanup\ssection\sof\stest,\sI\snaturally\sunset\sthe\svariable\smyVariableDefinedIntheBodySection.\s\sThe\sodd\sthing\sis\sthat\stclTest::test\sruns\sthe\s-cleanup\sscript\s*before*\sit\sperforms\sthe\s-output,\s-errorOutput\scomparisons.\s\sThis,\sof\scourse,\sthwarts\smy\sattempt\sto\suse\sthe\svariable\sin\sthe\s-output\sswitch.\r\n\r\nThis\sexample\sis\sa\slittle\scontrived\sand\sin\smy\sreal\scase\sI\sreally\swant\sto\sdelete\sthe\svariable\sso\sit\sdoesn't\spollute\sthe\snext\stest\swhich\suses\sthe\ssame\svariable\s(in\sa\sslightly\sdifferent\sway).\r\n\r\nSo,\sthe\srequest\sis\sto\smove\sthe\sexecution\sof\s-cleanup\suntil\safter\sthe\soutput,\serrorOutput\sand\sresult\scomparisons\sin\stcltest::test.\s\sIt's\sa\sbit\sodd\sthat\sit's\sin\sits\scurrent\slocation\sin\sthe\scode\sso\sthat\smakes\sme\sthink\sthat\sit's\sintentional.\s\sSo\sI'm\scurious\sto\sknow\sif\sit\scan\sbe\sdone\ssafely.\r\n\r\nRegardless,\slove\stcltest\sand\sbeen\susing\sit\sfor\syears.\s\sThank\syou\sfor\syour\sefforts.\s\s:-)\r\n\r\nbest\sregards,\r\n\r\nMark
J foundin 2.3.6
J is_private 0
J login anonymous
J priority 5\sMedium
J private_contact d4456006aa793a9b5e98c8665afe28d8d71968fe
J resolution None
J severity Minor
J status Open
J submitter anonymous
J subsystem 34.\stcltest\sPackage
J title tcltest\s-\srequest\sto\smove\s-cleanup\sscript\sexecution\suntil\safter\s-output\scompare
J type Support
K 2f9df4c4faf342320cdc05066ef43bf0f4ca5b59
U anonymous
Z 9094e2d3c40eb76c718551c818e2ac78