SUnit.js 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059
  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: [smalltalk.nil]
  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.nil,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', 'div'], '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. self['@div']=(function($rec){smalltalk.send($rec, "_class_", ["progress_bar"]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(html, "_div", []));
  236. smalltalk.send(self, "_renderProgressBar", []);
  237. return self;},
  238. source: unescape('renderOn%3A%20html%20%0A%09div%20%3A%3D%20html%20div%20%0A%09%09class%3A%20%27progress_bar%27%3B%0A%09%09yourself.%0A%09self%20renderProgressBar'),
  239. messageSends: ["class:", "yourself", "div", "renderProgressBar"],
  240. referencedClasses: []
  241. }),
  242. smalltalk.ProgressBar);
  243. smalltalk.addMethod(
  244. '_updatePercent_',
  245. smalltalk.method({
  246. selector: 'updatePercent:',
  247. category: 'updating',
  248. fn: function (aNumber){
  249. var self=this;
  250. smalltalk.send(self, "_percent_", [aNumber]);
  251. smalltalk.send(self, "_renderProgressBar", []);
  252. return self;},
  253. source: unescape('updatePercent%3A%20aNumber%0A%09self%20percent%3A%20aNumber.%0A%09self%20renderProgressBar'),
  254. messageSends: ["percent:", "renderProgressBar"],
  255. referencedClasses: []
  256. }),
  257. smalltalk.ProgressBar);
  258. smalltalk.addMethod(
  259. '_renderProgressBar',
  260. smalltalk.method({
  261. selector: 'renderProgressBar',
  262. category: 'rendering',
  263. fn: function (){
  264. var self=this;
  265. smalltalk.send(self['@div'], "_contents_", [(function(html){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", []));})]);
  266. return self;},
  267. source: unescape('renderProgressBar%0A%09div%20contents%3A%20%5B%3Ahtml%20%7C%0A%09%09html%20div%20%0A%09%09%09class%3A%20%27progress%27%3B%0A%09%09%09style%3A%20%27width%3A%27%2C%20self%20percent%20asString%2C%20%27%25%27%5D'),
  268. messageSends: ["contents:", "class:", "style:", unescape("%2C"), "asString", "percent", "div"],
  269. referencedClasses: []
  270. }),
  271. smalltalk.ProgressBar);
  272. smalltalk.addClass('TestFailure', smalltalk.Error, [], 'SUnit');
  273. smalltalk.addClass('TestRunner', smalltalk.TabWidget, ['selectedCategories', 'categoriesList', 'selectedClasses', 'classesList', 'selectedMethods', 'progressBar', 'methodsList', 'result', 'statusDiv'], 'SUnit');
  274. smalltalk.addMethod(
  275. '_label',
  276. smalltalk.method({
  277. selector: 'label',
  278. category: 'accessing',
  279. fn: function (){
  280. var self=this;
  281. return unescape("%5BTest%20runner%5D");
  282. return self;},
  283. source: unescape('label%0A%20%20%20%20%5E%27%5BTest%20runner%5D%27'),
  284. messageSends: [],
  285. referencedClasses: []
  286. }),
  287. smalltalk.TestRunner);
  288. smalltalk.addMethod(
  289. '_categories',
  290. smalltalk.method({
  291. selector: 'categories',
  292. category: 'accessing',
  293. fn: function (){
  294. var self=this;
  295. var categories=nil;
  296. categories=smalltalk.send(smalltalk.Array, "_new", []);
  297. 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", [])]);})]);})]);
  298. return smalltalk.send(categories, "_sort", []);
  299. return self;},
  300. 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'),
  301. messageSends: ["new", "do:", "allClasses", "ifFalse:", "includes:", "category", "add:", "sort"],
  302. referencedClasses: [smalltalk.Array]
  303. }),
  304. smalltalk.TestRunner);
  305. smalltalk.addMethod(
  306. '_classes',
  307. smalltalk.method({
  308. selector: 'classes',
  309. category: 'accessing',
  310. fn: function (){
  311. var self=this;
  312. 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", [])]);})]);
  313. return self;},
  314. 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'),
  315. messageSends: ["sort:", "select:", "allClasses", "includes:", "selectedCategories", "category", unescape("%3E"), "name"],
  316. referencedClasses: []
  317. }),
  318. smalltalk.TestRunner);
  319. smalltalk.addMethod(
  320. '_selectedCategories',
  321. smalltalk.method({
  322. selector: 'selectedCategories',
  323. category: 'accessing',
  324. fn: function (){
  325. var self=this;
  326. return smalltalk.send(self['@selectedCategories'], "_ifNil_", [(function(){return self['@selectedCategories']=smalltalk.send(smalltalk.Array, "_new", []);})]);
  327. return self;},
  328. source: unescape('selectedCategories%0A%09%5EselectedCategories%20ifNil%3A%20%5BselectedCategories%20%3A%3D%20Array%20new%5D'),
  329. messageSends: ["ifNil:", "new"],
  330. referencedClasses: [smalltalk.Array]
  331. }),
  332. smalltalk.TestRunner);
  333. smalltalk.addMethod(
  334. '_allClasses',
  335. smalltalk.method({
  336. selector: 'allClasses',
  337. category: 'accessing',
  338. fn: function (){
  339. var self=this;
  340. return smalltalk.send(smalltalk.TestCase, "_allSubclasses", []);
  341. return self;},
  342. source: unescape('allClasses%0A%09%5ETestCase%20allSubclasses'),
  343. messageSends: ["allSubclasses"],
  344. referencedClasses: [smalltalk.TestCase]
  345. }),
  346. smalltalk.TestRunner);
  347. smalltalk.addMethod(
  348. '_selectedClasses',
  349. smalltalk.method({
  350. selector: 'selectedClasses',
  351. category: 'accessing',
  352. fn: function (){
  353. var self=this;
  354. return smalltalk.send(self['@selectedClasses'], "_ifNil_", [(function(){return self['@selectedClasses']=smalltalk.send(smalltalk.Array, "_new", []);})]);
  355. return self;},
  356. source: unescape('selectedClasses%0A%09%5EselectedClasses%20%20ifNil%3A%20%5BselectedClasses%20%3A%3D%20Array%20new%5D'),
  357. messageSends: ["ifNil:", "new"],
  358. referencedClasses: [smalltalk.Array]
  359. }),
  360. smalltalk.TestRunner);
  361. smalltalk.addMethod(
  362. '_progressBar',
  363. smalltalk.method({
  364. selector: 'progressBar',
  365. category: 'accessing',
  366. fn: function (){
  367. var self=this;
  368. return smalltalk.send(self['@progressBar'], "_ifNil_", [(function(){return self['@progressBar']=smalltalk.send(smalltalk.ProgressBar, "_new", []);})]);
  369. return self;},
  370. source: unescape('progressBar%0A%09%5EprogressBar%20ifNil%3A%20%5BprogressBar%20%3A%3D%20ProgressBar%20new%5D'),
  371. messageSends: ["ifNil:", "new"],
  372. referencedClasses: [smalltalk.ProgressBar]
  373. }),
  374. smalltalk.TestRunner);
  375. smalltalk.addMethod(
  376. '_selectedMethods',
  377. smalltalk.method({
  378. selector: 'selectedMethods',
  379. category: 'accessing',
  380. fn: function (){
  381. var self=this;
  382. 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"]);})]);})]);})]);
  383. return self;},
  384. 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'),
  385. messageSends: ["ifNil:", "collect:", "selectedClasses", "select:", "keys", "methodDictionary", "beginsWith:"],
  386. referencedClasses: []
  387. }),
  388. smalltalk.TestRunner);
  389. smalltalk.addMethod(
  390. '_statusInfo',
  391. smalltalk.method({
  392. selector: 'statusInfo',
  393. category: 'accessing',
  394. fn: function (){
  395. var self=this;
  396. 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", [])]);
  397. return self;},
  398. source: unescape('statusInfo%0A%09%5Eself%20printTotal%2C%20self%20printPasses%2C%20self%20printErrors%2C%20self%20printFailures'),
  399. messageSends: [unescape("%2C"), "printTotal", "printPasses", "printErrors", "printFailures"],
  400. referencedClasses: []
  401. }),
  402. smalltalk.TestRunner);
  403. smalltalk.addMethod(
  404. '_result',
  405. smalltalk.method({
  406. selector: 'result',
  407. category: 'accessing',
  408. fn: function (){
  409. var self=this;
  410. return self['@result'];
  411. return self;},
  412. source: unescape('result%0A%09%5Eresult'),
  413. messageSends: [],
  414. referencedClasses: []
  415. }),
  416. smalltalk.TestRunner);
  417. smalltalk.addMethod(
  418. '_failedMethods',
  419. smalltalk.method({
  420. selector: 'failedMethods',
  421. category: 'accessing',
  422. fn: function (){
  423. var self=this;
  424. 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", []));})]);
  425. return self;},
  426. 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'),
  427. messageSends: ["collect:", "failures", "result", "class:", "with:", "li"],
  428. referencedClasses: []
  429. }),
  430. smalltalk.TestRunner);
  431. smalltalk.addMethod(
  432. '_selectAllCategories',
  433. smalltalk.method({
  434. selector: 'selectAllCategories',
  435. category: 'actions',
  436. fn: function (){
  437. var self=this;
  438. 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]);})]);})]);
  439. (function($rec){smalltalk.send($rec, "_updateCategoriesList", []);return smalltalk.send($rec, "_updateClassesList", []);})(self);
  440. return self;},
  441. 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'),
  442. messageSends: ["do:", "categories", "ifFalse:", "includes:", "add:", "selectedCategories", "updateCategoriesList", "updateClassesList"],
  443. referencedClasses: []
  444. }),
  445. smalltalk.TestRunner);
  446. smalltalk.addMethod(
  447. '_toggleCategory_',
  448. smalltalk.method({
  449. selector: 'toggleCategory:',
  450. category: 'actions',
  451. fn: function (aCategory){
  452. var self=this;
  453. 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]);})]);
  454. (function($rec){smalltalk.send($rec, "_updateCategoriesList", []);return smalltalk.send($rec, "_updateClassesList", []);})(self);
  455. return self;},
  456. 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'),
  457. messageSends: ["ifFalse:ifTrue:", "isSelectedCategory:", "add:", "remove:", "updateCategoriesList", "updateClassesList"],
  458. referencedClasses: []
  459. }),
  460. smalltalk.TestRunner);
  461. smalltalk.addMethod(
  462. '_toggleClass_',
  463. smalltalk.method({
  464. selector: 'toggleClass:',
  465. category: 'actions',
  466. fn: function (aClass){
  467. var self=this;
  468. 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]);})]);
  469. smalltalk.send(self, "_updateClassesList", []);
  470. return self;},
  471. 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'),
  472. messageSends: ["ifFalse:ifTrue:", "isSelectedClass:", "add:", "remove:", "updateClassesList"],
  473. referencedClasses: []
  474. }),
  475. smalltalk.TestRunner);
  476. smalltalk.addMethod(
  477. '_selectAllClasses',
  478. smalltalk.method({
  479. selector: 'selectAllClasses',
  480. category: 'actions',
  481. fn: function (){
  482. var self=this;
  483. 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]);})]);})]);
  484. (function($rec){smalltalk.send($rec, "_updateCategoriesList", []);return smalltalk.send($rec, "_updateClassesList", []);})(self);
  485. return self;},
  486. 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'),
  487. messageSends: ["do:", "classes", "ifFalse:", "includes:", "add:", "selectedClasses", "updateCategoriesList", "updateClassesList"],
  488. referencedClasses: []
  489. }),
  490. smalltalk.TestRunner);
  491. smalltalk.addMethod(
  492. '_run_',
  493. smalltalk.method({
  494. selector: 'run:',
  495. category: 'actions',
  496. fn: function (aCollection){
  497. var self=this;
  498. self['@result']=smalltalk.send(smalltalk.TestResult, "_new", []);
  499. (function($rec){smalltalk.send($rec, "_updateStatusDiv", []);return smalltalk.send($rec, "_updateMethodsList", []);})(self);
  500. smalltalk.send(smalltalk.send(self, "_progressBar", []), "_updatePercent_", [(0)]);
  501. 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", [])]);})])]);
  502. 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)]);})]);
  503. return self;},
  504. 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.'),
  505. messageSends: ["new", "updateStatusDiv", "updateMethodsList", "updatePercent:", "progressBar", "total:", "inject:into:", unescape("+"), "size", "methods", "do:", "valueWithTimeout:", "runCaseFor:", unescape("*"), unescape("/"), "runs", "total"],
  506. referencedClasses: [smalltalk.nil]
  507. }),
  508. smalltalk.TestRunner);
  509. smalltalk.addMethod(
  510. '_initialize',
  511. smalltalk.method({
  512. selector: 'initialize',
  513. category: 'initialization',
  514. fn: function (){
  515. var self=this;
  516. smalltalk.send(self, "_initialize", [], smalltalk.TabWidget);
  517. self['@result']=smalltalk.send(smalltalk.TestResult, "_new", []);
  518. return self;},
  519. source: unescape('initialize%0A%09super%20initialize.%0A%09result%20%3A%3D%20TestResult%20new'),
  520. messageSends: ["initialize", "new"],
  521. referencedClasses: [smalltalk.nil]
  522. }),
  523. smalltalk.TestRunner);
  524. smalltalk.addMethod(
  525. '_printErrors',
  526. smalltalk.method({
  527. selector: 'printErrors',
  528. category: 'printing',
  529. fn: function (){
  530. var self=this;
  531. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_result", []), "_errors", []), "_size", []), "_asString", []), "__comma", [unescape("%20errors%2C%20")]);
  532. return self;},
  533. source: unescape('printErrors%0A%09%5Eself%20result%20errors%20size%20asString%20%2C%20%27%20errors%2C%20%27'),
  534. messageSends: [unescape("%2C"), "asString", "size", "errors", "result"],
  535. referencedClasses: []
  536. }),
  537. smalltalk.TestRunner);
  538. smalltalk.addMethod(
  539. '_printFailures',
  540. smalltalk.method({
  541. selector: 'printFailures',
  542. category: 'printing',
  543. fn: function (){
  544. var self=this;
  545. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_result", []), "_failures", []), "_size", []), "_asString", []), "__comma", [" failures"]);
  546. return self;},
  547. source: unescape('printFailures%0A%09%5Eself%20result%20failures%20size%20asString%2C%20%27%20failures%27'),
  548. messageSends: [unescape("%2C"), "asString", "size", "failures", "result"],
  549. referencedClasses: []
  550. }),
  551. smalltalk.TestRunner);
  552. smalltalk.addMethod(
  553. '_printPasses',
  554. smalltalk.method({
  555. selector: 'printPasses',
  556. category: 'printing',
  557. fn: function (){
  558. var self=this;
  559. 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")]);
  560. return self;},
  561. 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'),
  562. messageSends: [unescape("%2C"), "asString", unescape("-"), "total", "result", unescape("+"), "size", "errors", "failures"],
  563. referencedClasses: []
  564. }),
  565. smalltalk.TestRunner);
  566. smalltalk.addMethod(
  567. '_printTotal',
  568. smalltalk.method({
  569. selector: 'printTotal',
  570. category: 'printing',
  571. fn: function (){
  572. var self=this;
  573. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_result", []), "_total", []), "_asString", []), "__comma", [unescape("%20runs%2C%20")]);
  574. return self;},
  575. source: unescape('printTotal%0A%09%5Eself%20result%20total%20asString%2C%20%27%20runs%2C%20%27'),
  576. messageSends: [unescape("%2C"), "asString", "total", "result"],
  577. referencedClasses: []
  578. }),
  579. smalltalk.TestRunner);
  580. smalltalk.addMethod(
  581. '_renderBoxOn_',
  582. smalltalk.method({
  583. selector: 'renderBoxOn:',
  584. category: 'rendering',
  585. fn: function (html){
  586. var self=this;
  587. (function($rec){smalltalk.send($rec, "_renderCategoriesOn_", [html]);smalltalk.send($rec, "_renderClassesOn_", [html]);return smalltalk.send($rec, "_renderResultsOn_", [html]);})(self);
  588. return self;},
  589. 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'),
  590. messageSends: ["renderCategoriesOn:", "renderClassesOn:", "renderResultsOn:"],
  591. referencedClasses: []
  592. }),
  593. smalltalk.TestRunner);
  594. smalltalk.addMethod(
  595. '_renderButtonsOn_',
  596. smalltalk.method({
  597. selector: 'renderButtonsOn:',
  598. category: 'rendering',
  599. fn: function (html){
  600. var self=this;
  601. (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", []));
  602. return self;},
  603. 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'),
  604. messageSends: ["with:", "onClick:", "run:", "collect:", "selectedClasses", "new", "button"],
  605. referencedClasses: []
  606. }),
  607. smalltalk.TestRunner);
  608. smalltalk.addMethod(
  609. '_renderCategoriesOn_',
  610. smalltalk.method({
  611. selector: 'renderCategoriesOn:',
  612. category: 'rendering',
  613. fn: function (html){
  614. var self=this;
  615. self['@categoriesList']=smalltalk.send(smalltalk.send(html, "_ul", []), "_class_", ["jt_column sunit categories"]);
  616. smalltalk.send(self, "_updateCategoriesList", []);
  617. return self;},
  618. 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'),
  619. messageSends: ["class:", "ul", "updateCategoriesList"],
  620. referencedClasses: []
  621. }),
  622. smalltalk.TestRunner);
  623. smalltalk.addMethod(
  624. '_renderClassesOn_',
  625. smalltalk.method({
  626. selector: 'renderClassesOn:',
  627. category: 'rendering',
  628. fn: function (html){
  629. var self=this;
  630. self['@classesList']=smalltalk.send(smalltalk.send(html, "_ul", []), "_class_", ["jt_column sunit classes"]);
  631. smalltalk.send(self, "_updateClassesList", []);
  632. return self;},
  633. 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'),
  634. messageSends: ["class:", "ul", "updateClassesList"],
  635. referencedClasses: []
  636. }),
  637. smalltalk.TestRunner);
  638. smalltalk.addMethod(
  639. '_renderResultsOn_',
  640. smalltalk.method({
  641. selector: 'renderResultsOn:',
  642. category: 'rendering',
  643. fn: function (html){
  644. var self=this;
  645. self['@statusDiv']=smalltalk.send(html, "_div", []);
  646. smalltalk.send(html, "_with_", [smalltalk.send(self, "_progressBar", [])]);
  647. self['@methodsList']=smalltalk.send(smalltalk.send(html, "_ul", []), "_class_", ["jt_column sunit methods"]);
  648. smalltalk.send(self, "_updateMethodsList", []);
  649. smalltalk.send(self, "_updateStatusDiv", []);
  650. return self;},
  651. 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'),
  652. messageSends: ["div", "with:", "progressBar", "class:", "ul", "updateMethodsList", "updateStatusDiv"],
  653. referencedClasses: []
  654. }),
  655. smalltalk.TestRunner);
  656. smalltalk.addMethod(
  657. '_renderFailuresOn_',
  658. smalltalk.method({
  659. selector: 'renderFailuresOn:',
  660. category: 'rendering',
  661. fn: function (html){
  662. var self=this;
  663. 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", []));})]);
  664. return self;},
  665. 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'),
  666. messageSends: ["do:", "failures", "result", "class:", "with:", "li"],
  667. referencedClasses: []
  668. }),
  669. smalltalk.TestRunner);
  670. smalltalk.addMethod(
  671. '_renderErrorsOn_',
  672. smalltalk.method({
  673. selector: 'renderErrorsOn:',
  674. category: 'rendering',
  675. fn: function (html){
  676. var self=this;
  677. 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", []));})]);
  678. return self;},
  679. 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'),
  680. messageSends: ["do:", "errors", "result", "class:", "with:", "li"],
  681. referencedClasses: []
  682. }),
  683. smalltalk.TestRunner);
  684. smalltalk.addMethod(
  685. '_canBeClosed',
  686. smalltalk.method({
  687. selector: 'canBeClosed',
  688. category: 'testing',
  689. fn: function (){
  690. var self=this;
  691. return true;
  692. return self;},
  693. source: unescape('canBeClosed%0A%20%20%20%20%5Etrue'),
  694. messageSends: [],
  695. referencedClasses: []
  696. }),
  697. smalltalk.TestRunner);
  698. smalltalk.addMethod(
  699. '_isSelectedClass_',
  700. smalltalk.method({
  701. selector: 'isSelectedClass:',
  702. category: 'testing',
  703. fn: function (aClass){
  704. var self=this;
  705. return smalltalk.send(smalltalk.send(self, "_selectedClasses", []), "_includes_", [aClass]);
  706. return self;},
  707. source: unescape('isSelectedClass%3A%20aClass%0A%09%5E%28self%20selectedClasses%20includes%3A%20aClass%29'),
  708. messageSends: ["includes:", "selectedClasses"],
  709. referencedClasses: []
  710. }),
  711. smalltalk.TestRunner);
  712. smalltalk.addMethod(
  713. '_isSelectedCategory_',
  714. smalltalk.method({
  715. selector: 'isSelectedCategory:',
  716. category: 'testing',
  717. fn: function (aCategory){
  718. var self=this;
  719. return smalltalk.send(smalltalk.send(self, "_selectedCategories", []), "_includes_", [aCategory]);
  720. return self;},
  721. source: unescape('isSelectedCategory%3A%20aCategory%0A%09%5E%28self%20selectedCategories%20includes%3A%20aCategory%29'),
  722. messageSends: ["includes:", "selectedCategories"],
  723. referencedClasses: []
  724. }),
  725. smalltalk.TestRunner);
  726. smalltalk.addMethod(
  727. '_updateCategoriesList',
  728. smalltalk.method({
  729. selector: 'updateCategoriesList',
  730. category: 'updating',
  731. fn: function (){
  732. var self=this;
  733. 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;
  734. 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);})]);})]);
  735. return self;},
  736. 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'),
  737. messageSends: ["contents:", "class:", "with:", "onClick:", "selectAllCategories", "li", "do:", "categories", "ifTrue:", "includes:", "selectedCategories", "toggleCategory:"],
  738. referencedClasses: []
  739. }),
  740. smalltalk.TestRunner);
  741. smalltalk.addMethod(
  742. '_updateClassesList',
  743. smalltalk.method({
  744. selector: 'updateClassesList',
  745. category: 'updating',
  746. fn: function (){
  747. var self=this;
  748. 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;
  749. 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);})]);})]);
  750. return self;},
  751. 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'),
  752. messageSends: ["contents:", "ifFalse:", "isEmpty", "selectedCategories", "class:", "with:", "onClick:", "selectAllClasses", "li", "do:", "classes", "ifTrue:", "includes:", "selectedClasses", "name", "toggleClass:"],
  753. referencedClasses: []
  754. }),
  755. smalltalk.TestRunner);
  756. smalltalk.addMethod(
  757. '_updateMethodsList',
  758. smalltalk.method({
  759. selector: 'updateMethodsList',
  760. category: 'updating',
  761. fn: function (){
  762. var self=this;
  763. smalltalk.send(self['@methodsList'], "_contents_", [(function(html){smalltalk.send(self, "_renderFailuresOn_", [html]);return smalltalk.send(self, "_renderErrorsOn_", [html]);})]);
  764. return self;},
  765. 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'),
  766. messageSends: ["contents:", "renderFailuresOn:", "renderErrorsOn:"],
  767. referencedClasses: []
  768. }),
  769. smalltalk.TestRunner);
  770. smalltalk.addMethod(
  771. '_updateStatusDiv',
  772. smalltalk.method({
  773. selector: 'updateStatusDiv',
  774. category: 'updating',
  775. fn: function (){
  776. var self=this;
  777. smalltalk.send(self['@statusDiv'], "_class_", [smalltalk.send("sunit status ", "__comma", [smalltalk.send(self['@result'], "_status", [])])]);
  778. smalltalk.send(self['@statusDiv'], "_contents_", [(function(html){return smalltalk.send(smalltalk.send(html, "_span", []), "_with_", [smalltalk.send(self, "_statusInfo", [])]);})]);
  779. return self;},
  780. 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'),
  781. messageSends: ["class:", unescape("%2C"), "status", "contents:", "with:", "span", "statusInfo"],
  782. referencedClasses: []
  783. }),
  784. smalltalk.TestRunner);
  785. smalltalk.addClass('TestResult', smalltalk.Object, ['timestamp', 'runs', 'errors', 'failures', 'total'], 'SUnit');
  786. smalltalk.addMethod(
  787. '_timestamp',
  788. smalltalk.method({
  789. selector: 'timestamp',
  790. category: 'accessing',
  791. fn: function (){
  792. var self=this;
  793. return self['@timestamp'];
  794. return self;},
  795. source: unescape('timestamp%0A%09%5Etimestamp'),
  796. messageSends: [],
  797. referencedClasses: []
  798. }),
  799. smalltalk.TestResult);
  800. smalltalk.addMethod(
  801. '_errors',
  802. smalltalk.method({
  803. selector: 'errors',
  804. category: 'accessing',
  805. fn: function (){
  806. var self=this;
  807. return self['@errors'];
  808. return self;},
  809. source: unescape('errors%0A%09%5Eerrors'),
  810. messageSends: [],
  811. referencedClasses: []
  812. }),
  813. smalltalk.TestResult);
  814. smalltalk.addMethod(
  815. '_failures',
  816. smalltalk.method({
  817. selector: 'failures',
  818. category: 'accessing',
  819. fn: function (){
  820. var self=this;
  821. return self['@failures'];
  822. return self;},
  823. source: unescape('failures%0A%09%5Efailures'),
  824. messageSends: [],
  825. referencedClasses: []
  826. }),
  827. smalltalk.TestResult);
  828. smalltalk.addMethod(
  829. '_total',
  830. smalltalk.method({
  831. selector: 'total',
  832. category: 'accessing',
  833. fn: function (){
  834. var self=this;
  835. return self['@total'];
  836. return self;},
  837. source: unescape('total%0A%09%5Etotal'),
  838. messageSends: [],
  839. referencedClasses: []
  840. }),
  841. smalltalk.TestResult);
  842. smalltalk.addMethod(
  843. '_total_',
  844. smalltalk.method({
  845. selector: 'total:',
  846. category: 'accessing',
  847. fn: function (aNumber){
  848. var self=this;
  849. self['@total']=aNumber;
  850. return self;},
  851. source: unescape('total%3A%20aNumber%0A%09total%20%3A%3D%20aNumber'),
  852. messageSends: [],
  853. referencedClasses: []
  854. }),
  855. smalltalk.TestResult);
  856. smalltalk.addMethod(
  857. '_addError_',
  858. smalltalk.method({
  859. selector: 'addError:',
  860. category: 'accessing',
  861. fn: function (anError){
  862. var self=this;
  863. smalltalk.send(smalltalk.send(self, "_errors", []), "_add_", [anError]);
  864. return self;},
  865. source: unescape('addError%3A%20anError%0A%09self%20errors%20add%3A%20anError'),
  866. messageSends: ["add:", "errors"],
  867. referencedClasses: []
  868. }),
  869. smalltalk.TestResult);
  870. smalltalk.addMethod(
  871. '_addFailure_',
  872. smalltalk.method({
  873. selector: 'addFailure:',
  874. category: 'accessing',
  875. fn: function (aFailure){
  876. var self=this;
  877. smalltalk.send(smalltalk.send(self, "_failures", []), "_add_", [aFailure]);
  878. return self;},
  879. source: unescape('addFailure%3A%20aFailure%0A%09self%20failures%20add%3A%20aFailure'),
  880. messageSends: ["add:", "failures"],
  881. referencedClasses: []
  882. }),
  883. smalltalk.TestResult);
  884. smalltalk.addMethod(
  885. '_runs',
  886. smalltalk.method({
  887. selector: 'runs',
  888. category: 'accessing',
  889. fn: function (){
  890. var self=this;
  891. return self['@runs'];
  892. return self;},
  893. source: unescape('runs%0A%09%5Eruns'),
  894. messageSends: [],
  895. referencedClasses: []
  896. }),
  897. smalltalk.TestResult);
  898. smalltalk.addMethod(
  899. '_increaseRuns',
  900. smalltalk.method({
  901. selector: 'increaseRuns',
  902. category: 'accessing',
  903. fn: function (){
  904. var self=this;
  905. self['@runs']=smalltalk.send(self['@runs'], "__plus", [(1)]);
  906. return self;},
  907. source: unescape('increaseRuns%0A%09runs%20%3A%3D%20runs%20+%201'),
  908. messageSends: [unescape("+")],
  909. referencedClasses: []
  910. }),
  911. smalltalk.TestResult);
  912. smalltalk.addMethod(
  913. '_status',
  914. smalltalk.method({
  915. selector: 'status',
  916. category: 'accessing',
  917. fn: function (){
  918. var self=this;
  919. 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";})]);
  920. return self;},
  921. 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'),
  922. messageSends: ["ifTrue:ifFalse:", "isEmpty", "errors", "failures"],
  923. referencedClasses: []
  924. }),
  925. smalltalk.TestResult);
  926. smalltalk.addMethod(
  927. '_initialize',
  928. smalltalk.method({
  929. selector: 'initialize',
  930. category: 'initialization',
  931. fn: function (){
  932. var self=this;
  933. smalltalk.send(self, "_initialize", [], smalltalk.Object);
  934. self['@timestamp']=smalltalk.send(smalltalk.Date, "_now", []);
  935. self['@runs']=(0);
  936. self['@errors']=smalltalk.send(smalltalk.Array, "_new", []);
  937. self['@failures']=smalltalk.send(smalltalk.Array, "_new", []);
  938. self['@total']=(0);
  939. return self;},
  940. 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'),
  941. messageSends: ["initialize", "now", "new"],
  942. referencedClasses: [smalltalk.Date,smalltalk.Array]
  943. }),
  944. smalltalk.TestResult);
  945. smalltalk.addClass('ExampleTest2', 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.ExampleTest2);
  960. smalltalk.addClass('ExampleTest3', smalltalk.TestCase, [], 'SUnit');
  961. smalltalk.addMethod(
  962. '_testPasses',
  963. smalltalk.method({
  964. selector: 'testPasses',
  965. category: 'not yet classified',
  966. fn: function (){
  967. var self=this;
  968. smalltalk.send((100000), "_timesRepeat_", [(function(){return smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((1), "__plus", [(1)]), "__eq", [(2)])]);})]);
  969. return self;},
  970. source: unescape('testPasses%0A%09100000%20timesRepeat%3A%20%5Bself%20assert%3A%201%20+%201%20%3D%202%5D'),
  971. messageSends: ["timesRepeat:", "assert:", unescape("%3D"), unescape("+")],
  972. referencedClasses: []
  973. }),
  974. smalltalk.ExampleTest3);