SUnit.js 43 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043
  1. smalltalk.addClass('TestCase', smalltalk.Object, ['testedClass'], 'SUnit');
  2. smalltalk.addMethod(
  3. '_testedClass',
  4. smalltalk.method({
  5. selector: 'testedClass',
  6. category: 'accessing',
  7. fn: function (){
  8. var self=this;
  9. return self['@testedClass'];
  10. return self;},
  11. source: unescape('testedClass%0A%09%5EtestedClass'),
  12. messageSends: [],
  13. referencedClasses: []
  14. }),
  15. smalltalk.TestCase);
  16. smalltalk.addMethod(
  17. '_testedClass_',
  18. smalltalk.method({
  19. selector: 'testedClass:',
  20. category: 'accessing',
  21. fn: function (aClass){
  22. var self=this;
  23. self['@testedClass']=aClass;
  24. return self;},
  25. source: unescape('testedClass%3A%20aClass%0A%09testedClass%20%3A%3D%20aClass'),
  26. messageSends: [],
  27. referencedClasses: []
  28. }),
  29. smalltalk.TestCase);
  30. smalltalk.addMethod(
  31. '_cleanUpInstanceVariables',
  32. smalltalk.method({
  33. selector: 'cleanUpInstanceVariables',
  34. category: 'private',
  35. fn: function (){
  36. var self=this;
  37. smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "_instanceVariableNames", []), "_do_", [(function(name){return smalltalk.send(smalltalk.send(name, "__eq", ["testSelector"]), "_ifFalse_", [(function(){return smalltalk.send(self, "_instVarAt_put_", [name, nil]);})]);})]);
  38. return self;},
  39. source: unescape('cleanUpInstanceVariables%0A%09self%20class%20instanceVariableNames%20do%3A%20%5B%20%3Aname%20%7C%0A%09%09name%20%3D%20%27testSelector%27%20ifFalse%3A%20%5B%0A%09%09%09self%20instVarAt%3A%20name%20put%3A%20nil%20%5D%5D'),
  40. messageSends: ["do:", "instanceVariableNames", "class", "ifFalse:", unescape("%3D"), "instVarAt:put:"],
  41. referencedClasses: []
  42. }),
  43. smalltalk.TestCase);
  44. smalltalk.addMethod(
  45. '_signalFailure_',
  46. smalltalk.method({
  47. selector: 'signalFailure:',
  48. category: 'private',
  49. fn: function (aString){
  50. var self=this;
  51. (function($rec){smalltalk.send($rec, "_messageText_", [aString]);return smalltalk.send($rec, "_signal", []);})(smalltalk.send(smalltalk.TestFailure, "_new", []));
  52. return self;},
  53. source: unescape('signalFailure%3A%20aString%0A%09TestFailure%20new%0A%09%09messageText%3A%20aString%3B%0A%09%09signal'),
  54. messageSends: ["messageText:", "signal", "new"],
  55. referencedClasses: []
  56. }),
  57. smalltalk.TestCase);
  58. smalltalk.addMethod(
  59. '_setUp',
  60. smalltalk.method({
  61. selector: 'setUp',
  62. category: 'running',
  63. fn: function (){
  64. var self=this;
  65. return self;},
  66. source: unescape('setUp'),
  67. messageSends: [],
  68. referencedClasses: []
  69. }),
  70. smalltalk.TestCase);
  71. smalltalk.addMethod(
  72. '_tearDown',
  73. smalltalk.method({
  74. selector: 'tearDown',
  75. category: 'running',
  76. fn: function (){
  77. var self=this;
  78. return self;},
  79. source: unescape('tearDown'),
  80. messageSends: [],
  81. referencedClasses: []
  82. }),
  83. smalltalk.TestCase);
  84. smalltalk.addMethod(
  85. '_methods',
  86. smalltalk.method({
  87. selector: 'methods',
  88. category: 'running',
  89. fn: function (){
  90. var self=this;
  91. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "_methodDictionary", []), "_keys", []), "_select_", [(function(each){return smalltalk.send(each, "_match_", [unescape("%5Etest")]);})]);
  92. return self;},
  93. source: unescape('methods%0A%09%5Eself%20class%20methodDictionary%20keys%20select%3A%20%5B%3Aeach%20%7C%20each%20match%3A%20%27%5Etest%27%5D'),
  94. messageSends: ["select:", "keys", "methodDictionary", "class", "match:"],
  95. referencedClasses: []
  96. }),
  97. smalltalk.TestCase);
  98. smalltalk.addMethod(
  99. '_runCaseFor_',
  100. smalltalk.method({
  101. selector: 'runCaseFor:',
  102. category: 'running',
  103. fn: function (aTestResult){
  104. var self=this;
  105. smalltalk.send((function(){smalltalk.send(self, "_setUp", []);return smalltalk.send(self, "_performTestFor_", [aTestResult]);}), "_on_do_", [smalltalk.Error, (function(ex){smalltalk.send(self, "_tearDown", []);smalltalk.send(self, "_cleanUpInstanceVariables", []);return smalltalk.send(ex, "_signal", []);})]);
  106. smalltalk.send(self, "_tearDown", []);
  107. smalltalk.send(self, "_cleanUpInstanceVariables", []);
  108. return self;},
  109. source: unescape('runCaseFor%3A%20aTestResult%0A%09%5Bself%20setUp.%0A%09self%20performTestFor%3A%20aTestResult%5D%0A%09%09on%3A%20Error%0A%09%09do%3A%20%5B%3Aex%20%7C%0A%09%09%09self%20tearDown.%0A%09%09%09self%20cleanUpInstanceVariables.%0A%09%09%09ex%20signal%5D.%0A%09self%20tearDown.%0A%09self%20cleanUpInstanceVariables'),
  110. messageSends: ["on:do:", "setUp", "performTestFor:", "tearDown", "cleanUpInstanceVariables", "signal"],
  111. referencedClasses: [smalltalk.Error]
  112. }),
  113. smalltalk.TestCase);
  114. smalltalk.addMethod(
  115. '_performTestFor_',
  116. smalltalk.method({
  117. selector: 'performTestFor:',
  118. category: 'running',
  119. fn: function (aResult){
  120. var self=this;
  121. smalltalk.send(smalltalk.send(self, "_methods", []), "_do_", [(function(each){smalltalk.send((function(){return smalltalk.send((function(){return smalltalk.send(self, "_perform_", [each]);}), "_on_do_", [smalltalk.TestFailure, (function(ex){return smalltalk.send(aResult, "_addFailure_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "_name", []), "__comma", [unescape("%3E%3E")]), "__comma", [each])]);})]);}), "_on_do_", [smalltalk.Error, (function(ex){return smalltalk.send(aResult, "_addError_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "_name", []), "__comma", [unescape("%3E%3E")]), "__comma", [each])]);})]);return smalltalk.send(aResult, "_increaseRuns", []);})]);
  122. return self;},
  123. source: unescape('performTestFor%3A%20aResult%0A%09self%20methods%20do%3A%20%5B%3Aeach%20%7C%20%0A%09%09%5B%5Bself%20perform%3A%20each%5D%0A%09%09%09on%3A%20TestFailure%20do%3A%20%5B%3Aex%20%7C%20aResult%20addFailure%3A%20self%20class%20name%2C%20%27%3E%3E%27%2C%20each%5D%5D%0A%09%09%09on%3A%20Error%20do%3A%20%5B%3Aex%20%7C%20aResult%20addError%3A%20self%20class%20name%2C%20%27%3E%3E%27%2C%20each%5D.%0A%09%09aResult%20increaseRuns%5D'),
  124. messageSends: ["do:", "methods", "on:do:", "perform:", "addFailure:", unescape("%2C"), "name", "class", "addError:", "increaseRuns"],
  125. referencedClasses: [smalltalk.Error]
  126. }),
  127. smalltalk.TestCase);
  128. smalltalk.addMethod(
  129. '_assert_',
  130. smalltalk.method({
  131. selector: 'assert:',
  132. category: 'testing',
  133. fn: function (aBoolean){
  134. var self=this;
  135. smalltalk.send(aBoolean, "_ifFalse_", [(function(){return smalltalk.send(self, "_signalFailure_", ["Assertion failed"]);})]);
  136. return self;},
  137. source: unescape('assert%3A%20aBoolean%0A%09aBoolean%20ifFalse%3A%20%5Bself%20signalFailure%3A%20%27Assertion%20failed%27%5D'),
  138. messageSends: ["ifFalse:", "signalFailure:"],
  139. referencedClasses: []
  140. }),
  141. smalltalk.TestCase);
  142. smalltalk.addMethod(
  143. '_deny_',
  144. smalltalk.method({
  145. selector: 'deny:',
  146. category: 'testing',
  147. fn: function (aBoolean){
  148. var self=this;
  149. smalltalk.send(self, "_assert_", [smalltalk.send(aBoolean, "_not", [])]);
  150. return self;},
  151. source: unescape('deny%3A%20aBoolean%0A%09self%20assert%3A%20aBoolean%20not'),
  152. messageSends: ["assert:", "not"],
  153. referencedClasses: []
  154. }),
  155. smalltalk.TestCase);
  156. smalltalk.addClass('ExampleTest', smalltalk.TestCase, ['test'], 'SUnit');
  157. smalltalk.addMethod(
  158. '_testFailure',
  159. smalltalk.method({
  160. selector: 'testFailure',
  161. category: 'not yet classified',
  162. fn: function (){
  163. var self=this;
  164. smalltalk.send(self, "_deny_", [true]);
  165. return self;},
  166. source: unescape('testFailure%0A%09self%20deny%3A%20true'),
  167. messageSends: ["deny:"],
  168. referencedClasses: []
  169. }),
  170. smalltalk.ExampleTest);
  171. smalltalk.addMethod(
  172. '_testPasses',
  173. smalltalk.method({
  174. selector: 'testPasses',
  175. category: 'not yet classified',
  176. fn: function (){
  177. var self=this;
  178. smalltalk.send((100000), "_timesRepeat_", [(function(){return smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((1), "__plus", [(1)]), "__eq", [(2)])]);})]);
  179. return self;},
  180. source: unescape('testPasses%0A%09100000%20timesRepeat%3A%20%5Bself%20assert%3A%201%20+%201%20%3D%202%5D'),
  181. messageSends: ["timesRepeat:", "assert:", unescape("%3D"), unescape("+")],
  182. referencedClasses: []
  183. }),
  184. smalltalk.ExampleTest);
  185. smalltalk.addMethod(
  186. '_testError',
  187. smalltalk.method({
  188. selector: 'testError',
  189. category: 'not yet classified',
  190. fn: function (){
  191. var self=this;
  192. smalltalk.send(self, "_assert_", [smalltalk.send((1), "_foo", [])]);
  193. return self;},
  194. source: unescape('testError%0A%09self%20assert%3A%201%20foo'),
  195. messageSends: ["assert:", "foo"],
  196. referencedClasses: []
  197. }),
  198. smalltalk.ExampleTest);
  199. smalltalk.addClass('ProgressBar', smalltalk.TabWidget, ['percent', 'progressDiv'], 'SUnit');
  200. smalltalk.addMethod(
  201. '_percent',
  202. smalltalk.method({
  203. selector: 'percent',
  204. category: 'accessing',
  205. fn: function (){
  206. var self=this;
  207. return smalltalk.send(self['@percent'], "_ifNil_", [(function(){return (0);})]);
  208. return self;},
  209. source: unescape('percent%0A%09%5Epercent%20ifNil%3A%20%5B0%5D'),
  210. messageSends: ["ifNil:"],
  211. referencedClasses: []
  212. }),
  213. smalltalk.ProgressBar);
  214. smalltalk.addMethod(
  215. '_percent_',
  216. smalltalk.method({
  217. selector: 'percent:',
  218. category: 'accessing',
  219. fn: function (aNumber){
  220. var self=this;
  221. self['@percent']=aNumber;
  222. return self;},
  223. source: unescape('percent%3A%20aNumber%0A%09percent%20%3A%3D%20aNumber'),
  224. messageSends: [],
  225. referencedClasses: []
  226. }),
  227. smalltalk.ProgressBar);
  228. smalltalk.addMethod(
  229. '_renderOn_',
  230. smalltalk.method({
  231. selector: 'renderOn:',
  232. category: 'rendering',
  233. fn: function (html){
  234. var self=this;
  235. (function($rec){smalltalk.send($rec, "_class_", ["progress_bar"]);return smalltalk.send($rec, "_with_", [(function(){return (function($rec){smalltalk.send($rec, "_class_", ["progress"]);return smalltalk.send($rec, "_style_", [smalltalk.send(smalltalk.send("width:", "__comma", [smalltalk.send(smalltalk.send(self, "_percent", []), "_asString", [])]), "__comma", [unescape("%25")])]);})(smalltalk.send(html, "_div", []));})]);})(smalltalk.send(html, "_div", []));
  236. return self;},
  237. source: unescape('renderOn%3A%20html%20%0A%09html%20div%20%0A%09%09class%3A%20%27progress_bar%27%3B%0A%09%09with%3A%20%5B%0A%09%09%09html%20div%20%0A%09%09%09%09class%3A%20%27progress%27%3B%0A%09%09%09%09style%3A%20%27width%3A%27%2C%20self%20percent%20asString%2C%20%27%25%27%5D'),
  238. messageSends: ["class:", "with:", "style:", unescape("%2C"), "asString", "percent", "div"],
  239. referencedClasses: []
  240. }),
  241. smalltalk.ProgressBar);
  242. smalltalk.addMethod(
  243. '_updatePercent_',
  244. smalltalk.method({
  245. selector: 'updatePercent:',
  246. category: 'updating',
  247. fn: function (aNumber){
  248. var self=this;
  249. smalltalk.send(self, "_percent_", [aNumber]);
  250. smalltalk.send(self, "_update", []);
  251. return self;},
  252. source: unescape('updatePercent%3A%20aNumber%0A%09self%20percent%3A%20aNumber.%0A%09self%20update'),
  253. messageSends: ["percent:", "update"],
  254. referencedClasses: []
  255. }),
  256. smalltalk.ProgressBar);
  257. smalltalk.addClass('TestFailure', smalltalk.Error, [], 'SUnit');
  258. smalltalk.addClass('TestRunner', smalltalk.TabWidget, ['selectedCategories', 'categoriesList', 'selectedClasses', 'classesList', 'selectedMethods', 'progressBar', 'methodsList', 'result', 'statusDiv'], 'SUnit');
  259. smalltalk.addMethod(
  260. '_label',
  261. smalltalk.method({
  262. selector: 'label',
  263. category: 'accessing',
  264. fn: function (){
  265. var self=this;
  266. return unescape("%5BTest%20runner%5D");
  267. return self;},
  268. source: unescape('label%0A%20%20%20%20%5E%27%5BTest%20runner%5D%27'),
  269. messageSends: [],
  270. referencedClasses: []
  271. }),
  272. smalltalk.TestRunner);
  273. smalltalk.addMethod(
  274. '_categories',
  275. smalltalk.method({
  276. selector: 'categories',
  277. category: 'accessing',
  278. fn: function (){
  279. var self=this;
  280. var categories=nil;
  281. categories=smalltalk.send(smalltalk.Array, "_new", []);
  282. smalltalk.send(smalltalk.send(self, "_allClasses", []), "_do_", [(function(each){return smalltalk.send(smalltalk.send(categories, "_includes_", [smalltalk.send(each, "_category", [])]), "_ifFalse_", [(function(){return smalltalk.send(categories, "_add_", [smalltalk.send(each, "_category", [])]);})]);})]);
  283. return smalltalk.send(categories, "_sort", []);
  284. return self;},
  285. source: unescape('categories%0A%20%20%20%20%7C%20categories%20%7C%0A%20%20%20%20categories%20%3A%3D%20Array%20new.%0A%20%20%20%20self%20allClasses%20do%3A%20%5B%3Aeach%20%7C%0A%09%28categories%20includes%3A%20each%20category%29%20ifFalse%3A%20%5B%0A%09%20%20%20%20categories%20add%3A%20each%20category%5D%5D.%0A%20%20%20%20%5Ecategories%20sort'),
  286. messageSends: ["new", "do:", "allClasses", "ifFalse:", "includes:", "category", "add:", "sort"],
  287. referencedClasses: [smalltalk.Array]
  288. }),
  289. smalltalk.TestRunner);
  290. smalltalk.addMethod(
  291. '_classes',
  292. smalltalk.method({
  293. selector: 'classes',
  294. category: 'accessing',
  295. fn: function (){
  296. var self=this;
  297. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_allClasses", []), "_select_", [(function(each){return smalltalk.send(smalltalk.send(self, "_selectedCategories", []), "_includes_", [smalltalk.send(each, "_category", [])]);})]), "_sort_", [(function(a, b){return smalltalk.send(smalltalk.send(a, "_name", []), "__gt", [smalltalk.send(b, "_name", [])]);})]);
  298. return self;},
  299. source: unescape('classes%0A%20%20%20%20%5E%28self%20allClasses%20%0A%09select%3A%20%5B%3Aeach%20%7C%20self%20selectedCategories%20includes%3A%20each%20category%5D%29%0A%09sort%3A%20%5B%3Aa%20%3Ab%20%7C%20a%20name%20%3E%20b%20name%5D'),
  300. messageSends: ["sort:", "select:", "allClasses", "includes:", "selectedCategories", "category", unescape("%3E"), "name"],
  301. referencedClasses: []
  302. }),
  303. smalltalk.TestRunner);
  304. smalltalk.addMethod(
  305. '_selectedCategories',
  306. smalltalk.method({
  307. selector: 'selectedCategories',
  308. category: 'accessing',
  309. fn: function (){
  310. var self=this;
  311. return smalltalk.send(self['@selectedCategories'], "_ifNil_", [(function(){return self['@selectedCategories']=smalltalk.send(smalltalk.Array, "_new", []);})]);
  312. return self;},
  313. source: unescape('selectedCategories%0A%09%5EselectedCategories%20ifNil%3A%20%5BselectedCategories%20%3A%3D%20Array%20new%5D'),
  314. messageSends: ["ifNil:", "new"],
  315. referencedClasses: [smalltalk.Array]
  316. }),
  317. smalltalk.TestRunner);
  318. smalltalk.addMethod(
  319. '_allClasses',
  320. smalltalk.method({
  321. selector: 'allClasses',
  322. category: 'accessing',
  323. fn: function (){
  324. var self=this;
  325. return smalltalk.send(smalltalk.TestCase, "_allSubclasses", []);
  326. return self;},
  327. source: unescape('allClasses%0A%09%5ETestCase%20allSubclasses'),
  328. messageSends: ["allSubclasses"],
  329. referencedClasses: [smalltalk.TestCase]
  330. }),
  331. smalltalk.TestRunner);
  332. smalltalk.addMethod(
  333. '_selectedClasses',
  334. smalltalk.method({
  335. selector: 'selectedClasses',
  336. category: 'accessing',
  337. fn: function (){
  338. var self=this;
  339. return smalltalk.send(self['@selectedClasses'], "_ifNil_", [(function(){return self['@selectedClasses']=smalltalk.send(smalltalk.Array, "_new", []);})]);
  340. return self;},
  341. source: unescape('selectedClasses%0A%09%5EselectedClasses%20%20ifNil%3A%20%5BselectedClasses%20%3A%3D%20Array%20new%5D'),
  342. messageSends: ["ifNil:", "new"],
  343. referencedClasses: [smalltalk.Array]
  344. }),
  345. smalltalk.TestRunner);
  346. smalltalk.addMethod(
  347. '_progressBar',
  348. smalltalk.method({
  349. selector: 'progressBar',
  350. category: 'accessing',
  351. fn: function (){
  352. var self=this;
  353. return smalltalk.send(self['@progressBar'], "_ifNil_", [(function(){return self['@progressBar']=smalltalk.send(smalltalk.ProgressBar, "_new", []);})]);
  354. return self;},
  355. source: unescape('progressBar%0A%09%5EprogressBar%20ifNil%3A%20%5BprogressBar%20%3A%3D%20ProgressBar%20new%5D'),
  356. messageSends: ["ifNil:", "new"],
  357. referencedClasses: [smalltalk.ProgressBar]
  358. }),
  359. smalltalk.TestRunner);
  360. smalltalk.addMethod(
  361. '_selectedMethods',
  362. smalltalk.method({
  363. selector: 'selectedMethods',
  364. category: 'accessing',
  365. fn: function (){
  366. var self=this;
  367. return smalltalk.send(self['@selectedMethods'], "_ifNil_", [(function(){return smalltalk.send(smalltalk.send(self, "_selectedClasses", []), "_collect_", [(function(each){return smalltalk.send(smalltalk.send(smalltalk.send(each, "_methodDictionary", []), "_keys", []), "_select_", [(function(key){return smalltalk.send(key, "_beginsWith_", ["test"]);})]);})]);})]);
  368. return self;},
  369. source: unescape('selectedMethods%0A%09%5EselectedMethods%20ifNil%3A%20%5Bself%20selectedClasses%20collect%3A%20%5B%3Aeach%20%7C%0A%09%09each%20methodDictionary%20keys%20select%3A%20%5B%3Akey%20%7C%20%20key%20beginsWith%3A%20%27test%27%20%5D%5D%5D'),
  370. messageSends: ["ifNil:", "collect:", "selectedClasses", "select:", "keys", "methodDictionary", "beginsWith:"],
  371. referencedClasses: []
  372. }),
  373. smalltalk.TestRunner);
  374. smalltalk.addMethod(
  375. '_statusInfo',
  376. smalltalk.method({
  377. selector: 'statusInfo',
  378. category: 'accessing',
  379. fn: function (){
  380. var self=this;
  381. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_printTotal", []), "__comma", [smalltalk.send(self, "_printPasses", [])]), "__comma", [smalltalk.send(self, "_printErrors", [])]), "__comma", [smalltalk.send(self, "_printFailures", [])]);
  382. return self;},
  383. source: unescape('statusInfo%0A%09%5Eself%20printTotal%2C%20self%20printPasses%2C%20self%20printErrors%2C%20self%20printFailures'),
  384. messageSends: [unescape("%2C"), "printTotal", "printPasses", "printErrors", "printFailures"],
  385. referencedClasses: []
  386. }),
  387. smalltalk.TestRunner);
  388. smalltalk.addMethod(
  389. '_result',
  390. smalltalk.method({
  391. selector: 'result',
  392. category: 'accessing',
  393. fn: function (){
  394. var self=this;
  395. return self['@result'];
  396. return self;},
  397. source: unescape('result%0A%09%5Eresult'),
  398. messageSends: [],
  399. referencedClasses: []
  400. }),
  401. smalltalk.TestRunner);
  402. smalltalk.addMethod(
  403. '_failedMethods',
  404. smalltalk.method({
  405. selector: 'failedMethods',
  406. category: 'accessing',
  407. fn: function (){
  408. var self=this;
  409. smalltalk.send(smalltalk.send(smalltalk.send(self, "_result", []), "_failures", []), "_collect_", [(function(each){return (function($rec){smalltalk.send($rec, "_class_", ["failures"]);return smalltalk.send($rec, "_with_", [each]);})(smalltalk.send(html, "_li", []));})]);
  410. return self;},
  411. source: unescape('failedMethods%0A%09self%20result%20failures%20collect%3A%20%5B%3Aeach%20%7C%0A%09%09html%20li%20%0A%09%09%09class%3A%20%27failures%27%3B%0A%09%09%09with%3A%20each%5D'),
  412. messageSends: ["collect:", "failures", "result", "class:", "with:", "li"],
  413. referencedClasses: []
  414. }),
  415. smalltalk.TestRunner);
  416. smalltalk.addMethod(
  417. '_selectAllCategories',
  418. smalltalk.method({
  419. selector: 'selectAllCategories',
  420. category: 'actions',
  421. fn: function (){
  422. var self=this;
  423. smalltalk.send(smalltalk.send(self, "_categories", []), "_do_", [(function(each){return smalltalk.send(smalltalk.send(self['@selectedCategories'], "_includes_", [each]), "_ifFalse_", [(function(){return smalltalk.send(smalltalk.send(self, "_selectedCategories", []), "_add_", [each]);})]);})]);
  424. (function($rec){smalltalk.send($rec, "_updateCategoriesList", []);return smalltalk.send($rec, "_updateClassesList", []);})(self);
  425. return self;},
  426. source: unescape('selectAllCategories%0A%09self%20categories%20do%3A%20%5B%3Aeach%20%7C%20%0A%09%09%28selectedCategories%20includes%3A%20each%29%20ifFalse%3A%20%5B%0A%09%09%09self%20selectedCategories%20add%3A%20each%5D%5D.%0A%09self%20%0A%09%20%20%20%20updateCategoriesList%3B%0A%09%20%20%20%20updateClassesList'),
  427. messageSends: ["do:", "categories", "ifFalse:", "includes:", "add:", "selectedCategories", "updateCategoriesList", "updateClassesList"],
  428. referencedClasses: []
  429. }),
  430. smalltalk.TestRunner);
  431. smalltalk.addMethod(
  432. '_toggleCategory_',
  433. smalltalk.method({
  434. selector: 'toggleCategory:',
  435. category: 'actions',
  436. fn: function (aCategory){
  437. var self=this;
  438. smalltalk.send(smalltalk.send(self, "_isSelectedCategory_", [aCategory]), "_ifFalse_ifTrue_", [(function(){return smalltalk.send(self['@selectedCategories'], "_add_", [aCategory]);}), (function(){return smalltalk.send(self['@selectedCategories'], "_remove_", [aCategory]);})]);
  439. (function($rec){smalltalk.send($rec, "_updateCategoriesList", []);return smalltalk.send($rec, "_updateClassesList", []);})(self);
  440. return self;},
  441. source: unescape('toggleCategory%3A%20aCategory%0A%09%28self%20isSelectedCategory%3A%20aCategory%29%20%0A%09%09ifFalse%3A%20%5BselectedCategories%20add%3A%20aCategory%5D%0A%09%09ifTrue%3A%20%5BselectedCategories%20remove%3A%20aCategory%5D.%0A%09self%20%0A%09%20%20%20%20updateCategoriesList%3B%0A%09%20%20%20%20updateClassesList'),
  442. messageSends: ["ifFalse:ifTrue:", "isSelectedCategory:", "add:", "remove:", "updateCategoriesList", "updateClassesList"],
  443. referencedClasses: []
  444. }),
  445. smalltalk.TestRunner);
  446. smalltalk.addMethod(
  447. '_toggleClass_',
  448. smalltalk.method({
  449. selector: 'toggleClass:',
  450. category: 'actions',
  451. fn: function (aClass){
  452. var self=this;
  453. smalltalk.send(smalltalk.send(self, "_isSelectedClass_", [aClass]), "_ifFalse_ifTrue_", [(function(){return smalltalk.send(self['@selectedClasses'], "_add_", [aClass]);}), (function(){return smalltalk.send(self['@selectedClasses'], "_remove_", [aClass]);})]);
  454. smalltalk.send(self, "_updateClassesList", []);
  455. return self;},
  456. source: unescape('toggleClass%3A%20aClass%0A%09%28self%20isSelectedClass%3A%20aClass%29%20%0A%09%09ifFalse%3A%20%5BselectedClasses%20add%3A%20aClass%5D%0A%09%09ifTrue%3A%20%5BselectedClasses%20remove%3A%20aClass%5D.%0A%09self%20%0A%09%20%20%20%20updateClassesList'),
  457. messageSends: ["ifFalse:ifTrue:", "isSelectedClass:", "add:", "remove:", "updateClassesList"],
  458. referencedClasses: []
  459. }),
  460. smalltalk.TestRunner);
  461. smalltalk.addMethod(
  462. '_selectAllClasses',
  463. smalltalk.method({
  464. selector: 'selectAllClasses',
  465. category: 'actions',
  466. fn: function (){
  467. var self=this;
  468. smalltalk.send(smalltalk.send(self, "_classes", []), "_do_", [(function(each){return smalltalk.send(smalltalk.send(self['@selectedClasses'], "_includes_", [each]), "_ifFalse_", [(function(){return smalltalk.send(smalltalk.send(self, "_selectedClasses", []), "_add_", [each]);})]);})]);
  469. (function($rec){smalltalk.send($rec, "_updateCategoriesList", []);return smalltalk.send($rec, "_updateClassesList", []);})(self);
  470. return self;},
  471. source: unescape('selectAllClasses%0A%09self%20classes%20do%3A%20%5B%3Aeach%20%7C%20%0A%09%09%28selectedClasses%20includes%3A%20each%29%20ifFalse%3A%20%5B%0A%09%09%09self%20selectedClasses%20add%3A%20each%5D%5D.%0A%09self%20%0A%09%20%20%20%20updateCategoriesList%3B%0A%09%20%20%20%20updateClassesList'),
  472. messageSends: ["do:", "classes", "ifFalse:", "includes:", "add:", "selectedClasses", "updateCategoriesList", "updateClassesList"],
  473. referencedClasses: []
  474. }),
  475. smalltalk.TestRunner);
  476. smalltalk.addMethod(
  477. '_run_',
  478. smalltalk.method({
  479. selector: 'run:',
  480. category: 'actions',
  481. fn: function (aCollection){
  482. var self=this;
  483. self['@result']=smalltalk.send(smalltalk.TestResult, "_new", []);
  484. (function($rec){smalltalk.send($rec, "_updateStatusDiv", []);return smalltalk.send($rec, "_updateMethodsList", []);})(self);
  485. smalltalk.send(smalltalk.send(self, "_progressBar", []), "_updatePercent_", [(0)]);
  486. smalltalk.send(self['@result'], "_total_", [smalltalk.send(aCollection, "_inject_into_", [(0), (function(acc, each){return smalltalk.send(acc, "__plus", [smalltalk.send(smalltalk.send(each, "_methods", []), "_size", [])]);})])]);
  487. smalltalk.send(aCollection, "_do_", [(function(each){return smalltalk.send((function(){smalltalk.send(each, "_runCaseFor_", [self['@result']]);smalltalk.send(smalltalk.send(self, "_progressBar", []), "_updatePercent_", [smalltalk.send(smalltalk.send(smalltalk.send(self['@result'], "_runs", []), "__slash", [smalltalk.send(self['@result'], "_total", [])]), "__star", [(100)])]);smalltalk.send(self, "_updateStatusDiv", []);return smalltalk.send(self, "_updateMethodsList", []);}), "_valueWithTimeout_", [(100)]);})]);
  488. return self;},
  489. source: unescape('run%3A%20aCollection%0A%09result%20%3A%3D%20TestResult%20new.%0A%09self%20%0A%09%09updateStatusDiv%3B%0A%09%09updateMethodsList.%0A%09self%20progressBar%20updatePercent%3A%200.%0A%09result%20total%3A%20%28aCollection%20inject%3A%200%20into%3A%20%5B%3Aacc%20%3Aeach%20%7C%20acc%20+%20each%20methods%20size%5D%29.%0A%09aCollection%20do%3A%20%5B%3Aeach%20%7C%20%0A%09%09%5Beach%20runCaseFor%3A%20result.%0A%09%09self%20progressBar%20updatePercent%3A%20result%20runs%20/%20result%20total%20*%20100.%0A%09%09self%20updateStatusDiv.%0A%09%09self%20updateMethodsList%5D%20valueWithTimeout%3A%20100%5D.'),
  490. messageSends: ["new", "updateStatusDiv", "updateMethodsList", "updatePercent:", "progressBar", "total:", "inject:into:", unescape("+"), "size", "methods", "do:", "valueWithTimeout:", "runCaseFor:", unescape("*"), unescape("/"), "runs", "total"],
  491. referencedClasses: []
  492. }),
  493. smalltalk.TestRunner);
  494. smalltalk.addMethod(
  495. '_initialize',
  496. smalltalk.method({
  497. selector: 'initialize',
  498. category: 'initialization',
  499. fn: function (){
  500. var self=this;
  501. smalltalk.send(self, "_initialize", [], smalltalk.TabWidget);
  502. self['@result']=smalltalk.send(smalltalk.TestResult, "_new", []);
  503. return self;},
  504. source: unescape('initialize%0A%09super%20initialize.%0A%09result%20%3A%3D%20TestResult%20new'),
  505. messageSends: ["initialize", "new"],
  506. referencedClasses: []
  507. }),
  508. smalltalk.TestRunner);
  509. smalltalk.addMethod(
  510. '_printErrors',
  511. smalltalk.method({
  512. selector: 'printErrors',
  513. category: 'printing',
  514. fn: function (){
  515. var self=this;
  516. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_result", []), "_errors", []), "_size", []), "_asString", []), "__comma", [unescape("%20errors%2C%20")]);
  517. return self;},
  518. source: unescape('printErrors%0A%09%5Eself%20result%20errors%20size%20asString%20%2C%20%27%20errors%2C%20%27'),
  519. messageSends: [unescape("%2C"), "asString", "size", "errors", "result"],
  520. referencedClasses: []
  521. }),
  522. smalltalk.TestRunner);
  523. smalltalk.addMethod(
  524. '_printFailures',
  525. smalltalk.method({
  526. selector: 'printFailures',
  527. category: 'printing',
  528. fn: function (){
  529. var self=this;
  530. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_result", []), "_failures", []), "_size", []), "_asString", []), "__comma", [" failures"]);
  531. return self;},
  532. source: unescape('printFailures%0A%09%5Eself%20result%20failures%20size%20asString%2C%20%27%20failures%27'),
  533. messageSends: [unescape("%2C"), "asString", "size", "failures", "result"],
  534. referencedClasses: []
  535. }),
  536. smalltalk.TestRunner);
  537. smalltalk.addMethod(
  538. '_printPasses',
  539. smalltalk.method({
  540. selector: 'printPasses',
  541. category: 'printing',
  542. fn: function (){
  543. var self=this;
  544. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_result", []), "_total", []), "__minus", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_result", []), "_errors", []), "_size", []), "__plus", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_result", []), "_failures", []), "_size", [])])]), "_asString", []), "__comma", [unescape("%20passes%2C%20")]);
  545. return self;},
  546. source: unescape('printPasses%0A%09%5E%28%28%28self%20result%20total%29%20-%20%28self%20result%20errors%20size%20+%20%28self%20result%20failures%20size%29%29%29%20asString%29%20%2C%20%27%20passes%2C%20%27'),
  547. messageSends: [unescape("%2C"), "asString", unescape("-"), "total", "result", unescape("+"), "size", "errors", "failures"],
  548. referencedClasses: []
  549. }),
  550. smalltalk.TestRunner);
  551. smalltalk.addMethod(
  552. '_printTotal',
  553. smalltalk.method({
  554. selector: 'printTotal',
  555. category: 'printing',
  556. fn: function (){
  557. var self=this;
  558. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_result", []), "_total", []), "_asString", []), "__comma", [unescape("%20runs%2C%20")]);
  559. return self;},
  560. source: unescape('printTotal%0A%09%5Eself%20result%20total%20asString%2C%20%27%20runs%2C%20%27'),
  561. messageSends: [unescape("%2C"), "asString", "total", "result"],
  562. referencedClasses: []
  563. }),
  564. smalltalk.TestRunner);
  565. smalltalk.addMethod(
  566. '_renderBoxOn_',
  567. smalltalk.method({
  568. selector: 'renderBoxOn:',
  569. category: 'rendering',
  570. fn: function (html){
  571. var self=this;
  572. (function($rec){smalltalk.send($rec, "_renderCategoriesOn_", [html]);smalltalk.send($rec, "_renderClassesOn_", [html]);return smalltalk.send($rec, "_renderResultsOn_", [html]);})(self);
  573. return self;},
  574. source: unescape('renderBoxOn%3A%20html%0A%20%20%20%20self%20%0A%09renderCategoriesOn%3A%20html%3B%0A%09renderClassesOn%3A%20html%3B%0A%09renderResultsOn%3A%20html'),
  575. messageSends: ["renderCategoriesOn:", "renderClassesOn:", "renderResultsOn:"],
  576. referencedClasses: []
  577. }),
  578. smalltalk.TestRunner);
  579. smalltalk.addMethod(
  580. '_renderButtonsOn_',
  581. smalltalk.method({
  582. selector: 'renderButtonsOn:',
  583. category: 'rendering',
  584. fn: function (html){
  585. var self=this;
  586. (function($rec){smalltalk.send($rec, "_with_", ["Run selected"]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_run_", [smalltalk.send(smalltalk.send(self, "_selectedClasses", []), "_collect_", [(function(each){return smalltalk.send(each, "_new", []);})])]);})]);})(smalltalk.send(html, "_button", []));
  587. return self;},
  588. source: unescape('renderButtonsOn%3A%20html%0A%20%20%20%20html%20button%0A%09with%3A%20%27Run%20selected%27%3B%0A%09onClick%3A%20%5Bself%20run%3A%20%28self%20selectedClasses%20collect%3A%20%5B%3Aeach%20%7C%20each%20new%5D%29%5D'),
  589. messageSends: ["with:", "onClick:", "run:", "collect:", "selectedClasses", "new", "button"],
  590. referencedClasses: []
  591. }),
  592. smalltalk.TestRunner);
  593. smalltalk.addMethod(
  594. '_renderCategoriesOn_',
  595. smalltalk.method({
  596. selector: 'renderCategoriesOn:',
  597. category: 'rendering',
  598. fn: function (html){
  599. var self=this;
  600. self['@categoriesList']=smalltalk.send(smalltalk.send(html, "_ul", []), "_class_", ["jt_column sunit categories"]);
  601. smalltalk.send(self, "_updateCategoriesList", []);
  602. return self;},
  603. source: unescape('renderCategoriesOn%3A%20html%0A%20%20%20%20%09categoriesList%20%3A%3D%20html%20ul%20class%3A%20%27jt_column%20sunit%20categories%27.%0A%09self%20updateCategoriesList'),
  604. messageSends: ["class:", "ul", "updateCategoriesList"],
  605. referencedClasses: []
  606. }),
  607. smalltalk.TestRunner);
  608. smalltalk.addMethod(
  609. '_renderClassesOn_',
  610. smalltalk.method({
  611. selector: 'renderClassesOn:',
  612. category: 'rendering',
  613. fn: function (html){
  614. var self=this;
  615. self['@classesList']=smalltalk.send(smalltalk.send(html, "_ul", []), "_class_", ["jt_column sunit classes"]);
  616. smalltalk.send(self, "_updateClassesList", []);
  617. return self;},
  618. source: unescape('renderClassesOn%3A%20html%0A%20%20%20%20%09classesList%20%3A%3D%20html%20ul%20class%3A%20%27jt_column%20sunit%20classes%27.%0A%09self%20updateClassesList'),
  619. messageSends: ["class:", "ul", "updateClassesList"],
  620. referencedClasses: []
  621. }),
  622. smalltalk.TestRunner);
  623. smalltalk.addMethod(
  624. '_renderResultsOn_',
  625. smalltalk.method({
  626. selector: 'renderResultsOn:',
  627. category: 'rendering',
  628. fn: function (html){
  629. var self=this;
  630. self['@statusDiv']=smalltalk.send(html, "_div", []);
  631. smalltalk.send(html, "_with_", [smalltalk.send(self, "_progressBar", [])]);
  632. self['@methodsList']=smalltalk.send(smalltalk.send(html, "_ul", []), "_class_", ["jt_column sunit methods"]);
  633. smalltalk.send(self, "_updateMethodsList", []);
  634. smalltalk.send(self, "_updateStatusDiv", []);
  635. return self;},
  636. source: unescape('renderResultsOn%3A%20html%0A%20%20%20%20%09statusDiv%20%3A%3D%20html%20div.%0A%09html%20with%3A%20self%20progressBar.%0A%20%20%20%09methodsList%20%3A%3D%20html%20ul%20class%3A%20%27jt_column%20sunit%20methods%27.%0A%09self%20updateMethodsList.%0A%09self%20updateStatusDiv'),
  637. messageSends: ["div", "with:", "progressBar", "class:", "ul", "updateMethodsList", "updateStatusDiv"],
  638. referencedClasses: []
  639. }),
  640. smalltalk.TestRunner);
  641. smalltalk.addMethod(
  642. '_renderFailuresOn_',
  643. smalltalk.method({
  644. selector: 'renderFailuresOn:',
  645. category: 'rendering',
  646. fn: function (html){
  647. var self=this;
  648. smalltalk.send(smalltalk.send(smalltalk.send(self, "_result", []), "_failures", []), "_do_", [(function(each){return (function($rec){smalltalk.send($rec, "_class_", ["failures"]);return smalltalk.send($rec, "_with_", [each]);})(smalltalk.send(html, "_li", []));})]);
  649. return self;},
  650. source: unescape('renderFailuresOn%3A%20html%0A%09self%20result%20failures%20do%3A%20%5B%3Aeach%20%7C%0A%09%09html%20li%20%0A%09%09%09class%3A%20%27failures%27%3B%0A%09%09%09with%3A%20each%5D'),
  651. messageSends: ["do:", "failures", "result", "class:", "with:", "li"],
  652. referencedClasses: []
  653. }),
  654. smalltalk.TestRunner);
  655. smalltalk.addMethod(
  656. '_renderErrorsOn_',
  657. smalltalk.method({
  658. selector: 'renderErrorsOn:',
  659. category: 'rendering',
  660. fn: function (html){
  661. var self=this;
  662. smalltalk.send(smalltalk.send(smalltalk.send(self, "_result", []), "_errors", []), "_do_", [(function(each){return (function($rec){smalltalk.send($rec, "_class_", ["errors"]);return smalltalk.send($rec, "_with_", [each]);})(smalltalk.send(html, "_li", []));})]);
  663. return self;},
  664. source: unescape('renderErrorsOn%3A%20html%0A%09self%20result%20errors%20do%3A%20%5B%3Aeach%20%7C%0A%09%09html%20li%20%0A%09%09%09class%3A%20%27errors%27%3B%0A%09%09%09with%3A%20each%5D'),
  665. messageSends: ["do:", "errors", "result", "class:", "with:", "li"],
  666. referencedClasses: []
  667. }),
  668. smalltalk.TestRunner);
  669. smalltalk.addMethod(
  670. '_canBeClosed',
  671. smalltalk.method({
  672. selector: 'canBeClosed',
  673. category: 'testing',
  674. fn: function (){
  675. var self=this;
  676. return true;
  677. return self;},
  678. source: unescape('canBeClosed%0A%20%20%20%20%5Etrue'),
  679. messageSends: [],
  680. referencedClasses: []
  681. }),
  682. smalltalk.TestRunner);
  683. smalltalk.addMethod(
  684. '_isSelectedClass_',
  685. smalltalk.method({
  686. selector: 'isSelectedClass:',
  687. category: 'testing',
  688. fn: function (aClass){
  689. var self=this;
  690. return smalltalk.send(smalltalk.send(self, "_selectedClasses", []), "_includes_", [aClass]);
  691. return self;},
  692. source: unescape('isSelectedClass%3A%20aClass%0A%09%5E%28self%20selectedClasses%20includes%3A%20aClass%29'),
  693. messageSends: ["includes:", "selectedClasses"],
  694. referencedClasses: []
  695. }),
  696. smalltalk.TestRunner);
  697. smalltalk.addMethod(
  698. '_isSelectedCategory_',
  699. smalltalk.method({
  700. selector: 'isSelectedCategory:',
  701. category: 'testing',
  702. fn: function (aCategory){
  703. var self=this;
  704. return smalltalk.send(smalltalk.send(self, "_selectedCategories", []), "_includes_", [aCategory]);
  705. return self;},
  706. source: unescape('isSelectedCategory%3A%20aCategory%0A%09%5E%28self%20selectedCategories%20includes%3A%20aCategory%29'),
  707. messageSends: ["includes:", "selectedCategories"],
  708. referencedClasses: []
  709. }),
  710. smalltalk.TestRunner);
  711. smalltalk.addMethod(
  712. '_updateCategoriesList',
  713. smalltalk.method({
  714. selector: 'updateCategoriesList',
  715. category: 'updating',
  716. fn: function (){
  717. var self=this;
  718. smalltalk.send(self['@categoriesList'], "_contents_", [(function(html){(function($rec){smalltalk.send($rec, "_class_", ["all"]);smalltalk.send($rec, "_with_", ["All"]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_selectAllCategories", []);})]);})(smalltalk.send(html, "_li", []));return smalltalk.send(smalltalk.send(self, "_categories", []), "_do_", [(function(each){var li=nil;
  719. li=smalltalk.send(html, "_li", []);smalltalk.send(smalltalk.send(smalltalk.send(self, "_selectedCategories", []), "_includes_", [each]), "_ifTrue_", [(function(){return smalltalk.send(li, "_class_", ["selected"]);})]);return (function($rec){smalltalk.send($rec, "_with_", [each]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_toggleCategory_", [each]);})]);})(li);})]);})]);
  720. return self;},
  721. source: unescape('updateCategoriesList%0A%20%20%20%20categoriesList%20contents%3A%20%5B%3Ahtml%20%7C%0A%09%20%20%20%20html%20li%20%0A%09%09class%3A%20%27all%27%3B%0A%09%09with%3A%20%27All%27%3B%0A%09%09onClick%3A%20%5Bself%20selectAllCategories%5D.%0A%09self%20categories%20do%3A%20%5B%3Aeach%20%7C%7C%20li%20%7C%0A%09%20%20%20%20li%20%3A%3D%20html%20li.%0A%09%20%20%20%20%28self%20selectedCategories%20includes%3A%20each%29%20ifTrue%3A%20%5B%0A%09%09li%20class%3A%20%27selected%27%5D.%0A%09%20%20%20%20li%0A%09%09with%3A%20each%3B%0A%09%09onClick%3A%20%5Bself%20toggleCategory%3A%20each%5D%5D%5D'),
  722. messageSends: ["contents:", "class:", "with:", "onClick:", "selectAllCategories", "li", "do:", "categories", "ifTrue:", "includes:", "selectedCategories", "toggleCategory:"],
  723. referencedClasses: []
  724. }),
  725. smalltalk.TestRunner);
  726. smalltalk.addMethod(
  727. '_updateClassesList',
  728. smalltalk.method({
  729. selector: 'updateClassesList',
  730. category: 'updating',
  731. fn: function (){
  732. var self=this;
  733. smalltalk.send(self['@classesList'], "_contents_", [(function(html){smalltalk.send(smalltalk.send(smalltalk.send(self, "_selectedCategories", []), "_isEmpty", []), "_ifFalse_", [(function(){return (function($rec){smalltalk.send($rec, "_class_", ["all"]);smalltalk.send($rec, "_with_", ["All"]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_selectAllClasses", []);})]);})(smalltalk.send(html, "_li", []));})]);return smalltalk.send(smalltalk.send(self, "_classes", []), "_do_", [(function(each){var li=nil;
  734. li=smalltalk.send(html, "_li", []);smalltalk.send(smalltalk.send(smalltalk.send(self, "_selectedClasses", []), "_includes_", [each]), "_ifTrue_", [(function(){return smalltalk.send(li, "_class_", ["selected"]);})]);return (function($rec){smalltalk.send($rec, "_with_", [smalltalk.send(each, "_name", [])]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_toggleClass_", [each]);})]);})(li);})]);})]);
  735. return self;},
  736. source: unescape('updateClassesList%0A%20%20%20%20classesList%20contents%3A%20%5B%3Ahtml%20%7C%0A%09%28self%20selectedCategories%20isEmpty%29%20ifFalse%3A%20%5B%0A%09%09html%20li%0A%09%09%09class%3A%20%27all%27%3B%0A%09%09%09with%3A%20%27All%27%3B%0A%09%09%09onClick%3A%20%5Bself%20selectAllClasses%5D%5D.%0A%09self%20classes%20do%3A%20%5B%3Aeach%20%7C%7C%20li%20%7C%0A%09%09li%20%3A%3D%20html%20li.%0A%09%09%28self%20selectedClasses%20includes%3A%20each%29%20ifTrue%3A%20%5B%0A%09%09%09li%20class%3A%20%27selected%27%5D.%0A%09%09li%0A%09%09%09with%3A%20each%20name%3B%0A%09%09%09onClick%3A%20%5Bself%20toggleClass%3A%20each%5D%5D%5D'),
  737. messageSends: ["contents:", "ifFalse:", "isEmpty", "selectedCategories", "class:", "with:", "onClick:", "selectAllClasses", "li", "do:", "classes", "ifTrue:", "includes:", "selectedClasses", "name", "toggleClass:"],
  738. referencedClasses: []
  739. }),
  740. smalltalk.TestRunner);
  741. smalltalk.addMethod(
  742. '_updateMethodsList',
  743. smalltalk.method({
  744. selector: 'updateMethodsList',
  745. category: 'updating',
  746. fn: function (){
  747. var self=this;
  748. smalltalk.send(self['@methodsList'], "_contents_", [(function(html){smalltalk.send(self, "_renderFailuresOn_", [html]);return smalltalk.send(self, "_renderErrorsOn_", [html]);})]);
  749. return self;},
  750. source: unescape('updateMethodsList%0A%09methodsList%20contents%3A%20%5B%3Ahtml%20%7C%0A%09%09self%20renderFailuresOn%3A%20html.%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20self%20renderErrorsOn%3A%20html%5D'),
  751. messageSends: ["contents:", "renderFailuresOn:", "renderErrorsOn:"],
  752. referencedClasses: []
  753. }),
  754. smalltalk.TestRunner);
  755. smalltalk.addMethod(
  756. '_updateStatusDiv',
  757. smalltalk.method({
  758. selector: 'updateStatusDiv',
  759. category: 'updating',
  760. fn: function (){
  761. var self=this;
  762. smalltalk.send(self['@statusDiv'], "_class_", [smalltalk.send("sunit status ", "__comma", [smalltalk.send(self['@result'], "_status", [])])]);
  763. smalltalk.send(self['@statusDiv'], "_contents_", [(function(html){return smalltalk.send(smalltalk.send(html, "_span", []), "_with_", [smalltalk.send(self, "_statusInfo", [])]);})]);
  764. return self;},
  765. source: unescape('updateStatusDiv%0A%09statusDiv%20class%3A%20%27sunit%20status%20%27%2C%20result%20status.%0A%09statusDiv%20contents%3A%20%5B%3Ahtml%20%7C%0A%09%09html%20span%20with%3A%20self%20statusInfo%5D'),
  766. messageSends: ["class:", unescape("%2C"), "status", "contents:", "with:", "span", "statusInfo"],
  767. referencedClasses: []
  768. }),
  769. smalltalk.TestRunner);
  770. smalltalk.addClass('TestResult', smalltalk.Object, ['timestamp', 'runs', 'errors', 'failures', 'total'], 'SUnit');
  771. smalltalk.addMethod(
  772. '_timestamp',
  773. smalltalk.method({
  774. selector: 'timestamp',
  775. category: 'accessing',
  776. fn: function (){
  777. var self=this;
  778. return self['@timestamp'];
  779. return self;},
  780. source: unescape('timestamp%0A%09%5Etimestamp'),
  781. messageSends: [],
  782. referencedClasses: []
  783. }),
  784. smalltalk.TestResult);
  785. smalltalk.addMethod(
  786. '_errors',
  787. smalltalk.method({
  788. selector: 'errors',
  789. category: 'accessing',
  790. fn: function (){
  791. var self=this;
  792. return self['@errors'];
  793. return self;},
  794. source: unescape('errors%0A%09%5Eerrors'),
  795. messageSends: [],
  796. referencedClasses: []
  797. }),
  798. smalltalk.TestResult);
  799. smalltalk.addMethod(
  800. '_failures',
  801. smalltalk.method({
  802. selector: 'failures',
  803. category: 'accessing',
  804. fn: function (){
  805. var self=this;
  806. return self['@failures'];
  807. return self;},
  808. source: unescape('failures%0A%09%5Efailures'),
  809. messageSends: [],
  810. referencedClasses: []
  811. }),
  812. smalltalk.TestResult);
  813. smalltalk.addMethod(
  814. '_total',
  815. smalltalk.method({
  816. selector: 'total',
  817. category: 'accessing',
  818. fn: function (){
  819. var self=this;
  820. return self['@total'];
  821. return self;},
  822. source: unescape('total%0A%09%5Etotal'),
  823. messageSends: [],
  824. referencedClasses: []
  825. }),
  826. smalltalk.TestResult);
  827. smalltalk.addMethod(
  828. '_total_',
  829. smalltalk.method({
  830. selector: 'total:',
  831. category: 'accessing',
  832. fn: function (aNumber){
  833. var self=this;
  834. self['@total']=aNumber;
  835. return self;},
  836. source: unescape('total%3A%20aNumber%0A%09total%20%3A%3D%20aNumber'),
  837. messageSends: [],
  838. referencedClasses: []
  839. }),
  840. smalltalk.TestResult);
  841. smalltalk.addMethod(
  842. '_addError_',
  843. smalltalk.method({
  844. selector: 'addError:',
  845. category: 'accessing',
  846. fn: function (anError){
  847. var self=this;
  848. smalltalk.send(smalltalk.send(self, "_errors", []), "_add_", [anError]);
  849. return self;},
  850. source: unescape('addError%3A%20anError%0A%09self%20errors%20add%3A%20anError'),
  851. messageSends: ["add:", "errors"],
  852. referencedClasses: []
  853. }),
  854. smalltalk.TestResult);
  855. smalltalk.addMethod(
  856. '_addFailure_',
  857. smalltalk.method({
  858. selector: 'addFailure:',
  859. category: 'accessing',
  860. fn: function (aFailure){
  861. var self=this;
  862. smalltalk.send(smalltalk.send(self, "_failures", []), "_add_", [aFailure]);
  863. return self;},
  864. source: unescape('addFailure%3A%20aFailure%0A%09self%20failures%20add%3A%20aFailure'),
  865. messageSends: ["add:", "failures"],
  866. referencedClasses: []
  867. }),
  868. smalltalk.TestResult);
  869. smalltalk.addMethod(
  870. '_runs',
  871. smalltalk.method({
  872. selector: 'runs',
  873. category: 'accessing',
  874. fn: function (){
  875. var self=this;
  876. return self['@runs'];
  877. return self;},
  878. source: unescape('runs%0A%09%5Eruns'),
  879. messageSends: [],
  880. referencedClasses: []
  881. }),
  882. smalltalk.TestResult);
  883. smalltalk.addMethod(
  884. '_increaseRuns',
  885. smalltalk.method({
  886. selector: 'increaseRuns',
  887. category: 'accessing',
  888. fn: function (){
  889. var self=this;
  890. self['@runs']=smalltalk.send(self['@runs'], "__plus", [(1)]);
  891. return self;},
  892. source: unescape('increaseRuns%0A%09runs%20%3A%3D%20runs%20+%201'),
  893. messageSends: [unescape("+")],
  894. referencedClasses: []
  895. }),
  896. smalltalk.TestResult);
  897. smalltalk.addMethod(
  898. '_status',
  899. smalltalk.method({
  900. selector: 'status',
  901. category: 'accessing',
  902. fn: function (){
  903. var self=this;
  904. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_errors", []), "_isEmpty", []), "_ifTrue_ifFalse_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(self, "_failures", []), "_isEmpty", []), "_ifTrue_ifFalse_", [(function(){return "success";}), (function(){return "failure";})]);}), (function(){return "error";})]);
  905. return self;},
  906. source: unescape('status%0A%09%5Eself%20errors%20isEmpty%20%0A%09%09ifTrue%3A%20%5B%0A%09%09%09self%20failures%20isEmpty%20%0A%09%09%09%09ifTrue%3A%20%5B%27success%27%5D%0A%09%09%09%09ifFalse%3A%20%5B%27failure%27%5D%5D%0A%09%09ifFalse%3A%20%5B%27error%27%5D'),
  907. messageSends: ["ifTrue:ifFalse:", "isEmpty", "errors", "failures"],
  908. referencedClasses: []
  909. }),
  910. smalltalk.TestResult);
  911. smalltalk.addMethod(
  912. '_initialize',
  913. smalltalk.method({
  914. selector: 'initialize',
  915. category: 'initialization',
  916. fn: function (){
  917. var self=this;
  918. smalltalk.send(self, "_initialize", [], smalltalk.Object);
  919. self['@timestamp']=smalltalk.send(smalltalk.Date, "_now", []);
  920. self['@runs']=(0);
  921. self['@errors']=smalltalk.send(smalltalk.Array, "_new", []);
  922. self['@failures']=smalltalk.send(smalltalk.Array, "_new", []);
  923. self['@total']=(0);
  924. return self;},
  925. source: unescape('initialize%0A%09super%20initialize.%0A%09timestamp%20%3A%3D%20Date%20now.%0A%09runs%20%3A%3D%200.%0A%09errors%20%3A%3D%20Array%20new.%0A%09failures%20%3A%3D%20Array%20new.%0A%09total%20%3A%3D%200'),
  926. messageSends: ["initialize", "now", "new"],
  927. referencedClasses: [smalltalk.Date,smalltalk.Array]
  928. }),
  929. smalltalk.TestResult);
  930. smalltalk.addClass('ExampleTest2', smalltalk.TestCase, [], 'SUnit');
  931. smalltalk.addMethod(
  932. '_testPasses',
  933. smalltalk.method({
  934. selector: 'testPasses',
  935. category: 'not yet classified',
  936. fn: function (){
  937. var self=this;
  938. smalltalk.send((100000), "_timesRepeat_", [(function(){return smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((1), "__plus", [(1)]), "__eq", [(2)])]);})]);
  939. return self;},
  940. source: unescape('testPasses%0A%09100000%20timesRepeat%3A%20%5Bself%20assert%3A%201%20+%201%20%3D%202%5D'),
  941. messageSends: ["timesRepeat:", "assert:", unescape("%3D"), unescape("+")],
  942. referencedClasses: []
  943. }),
  944. smalltalk.ExampleTest2);
  945. smalltalk.addClass('ExampleTest3', smalltalk.TestCase, [], 'SUnit');
  946. smalltalk.addMethod(
  947. '_testPasses',
  948. smalltalk.method({
  949. selector: 'testPasses',
  950. category: 'not yet classified',
  951. fn: function (){
  952. var self=this;
  953. smalltalk.send((100000), "_timesRepeat_", [(function(){return smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((1), "__plus", [(1)]), "__eq", [(2)])]);})]);
  954. return self;},
  955. source: unescape('testPasses%0A%09100000%20timesRepeat%3A%20%5Bself%20assert%3A%201%20+%201%20%3D%202%5D'),
  956. messageSends: ["timesRepeat:", "assert:", unescape("%3D"), unescape("+")],
  957. referencedClasses: []
  958. }),
  959. smalltalk.ExampleTest3);