2
0

SUnit.js 45 KB

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