1
0

Kernel-Tests.deploy.js 78 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533
  1. smalltalk.addPackage('Kernel-Tests', {});
  2. smalltalk.addClass('BlockClosureTest', smalltalk.TestCase, [], 'Kernel-Tests');
  3. smalltalk.addMethod(
  4. "_testCompiledSource",
  5. smalltalk.method({
  6. selector: "testCompiledSource",
  7. fn: function (){
  8. var self=this;
  9. return smalltalk.withContext(function($ctx) { _st(self)._assert_(_st(_st((function(){
  10. return _st((1)).__plus((1));
  11. }))._compiledSource())._includesSubString_("function"));
  12. return self}, self, "testCompiledSource", [], smalltalk.BlockClosureTest)}
  13. }),
  14. smalltalk.BlockClosureTest);
  15. smalltalk.addMethod(
  16. "_testEnsure",
  17. smalltalk.method({
  18. selector: "testEnsure",
  19. fn: function (){
  20. var self=this;
  21. return smalltalk.withContext(function($ctx) { _st(self)._assert_(_st((function(){
  22. return _st((smalltalk.Error || Error))._new();
  23. }))._ensure_((function(){
  24. return true;
  25. })));
  26. return self}, self, "testEnsure", [], smalltalk.BlockClosureTest)}
  27. }),
  28. smalltalk.BlockClosureTest);
  29. smalltalk.addMethod(
  30. "_testNumArgs",
  31. smalltalk.method({
  32. selector: "testNumArgs",
  33. fn: function (){
  34. var self=this;
  35. return smalltalk.withContext(function($ctx) { _st(self)._assert_equals_(_st((function(){
  36. }))._numArgs(),(0));
  37. _st(self)._assert_equals_(_st((function(a,b){
  38. }))._numArgs(),(2));
  39. return self}, self, "testNumArgs", [], smalltalk.BlockClosureTest)}
  40. }),
  41. smalltalk.BlockClosureTest);
  42. smalltalk.addMethod(
  43. "_testOnDo",
  44. smalltalk.method({
  45. selector: "testOnDo",
  46. fn: function (){
  47. var self=this;
  48. return smalltalk.withContext(function($ctx) { _st(self)._assert_(_st((function(){
  49. return _st(_st((smalltalk.Error || Error))._new())._signal();
  50. }))._on_do_((smalltalk.Error || Error),(function(ex){
  51. return true;
  52. })));
  53. return self}, self, "testOnDo", [], smalltalk.BlockClosureTest)}
  54. }),
  55. smalltalk.BlockClosureTest);
  56. smalltalk.addMethod(
  57. "_testValue",
  58. smalltalk.method({
  59. selector: "testValue",
  60. fn: function (){
  61. var self=this;
  62. return smalltalk.withContext(function($ctx) { _st(self)._assert_equals_(_st((function(){
  63. return _st((1)).__plus((1));
  64. }))._value(),(2));
  65. _st(self)._assert_equals_(_st((function(x){
  66. return _st(x).__plus((1));
  67. }))._value_((2)),(3));
  68. _st(self)._assert_equals_(_st((function(x,y){
  69. return _st(x).__star(y);
  70. }))._value_value_((2),(4)),(8));
  71. _st(self)._assert_equals_(_st((function(a,b,c){
  72. return (1);
  73. }))._value(),(1));
  74. return self}, self, "testValue", [], smalltalk.BlockClosureTest)}
  75. }),
  76. smalltalk.BlockClosureTest);
  77. smalltalk.addMethod(
  78. "_testValueWithPossibleArguments",
  79. smalltalk.method({
  80. selector: "testValueWithPossibleArguments",
  81. fn: function (){
  82. var self=this;
  83. return smalltalk.withContext(function($ctx) { _st(self)._assert_equals_(_st((function(){
  84. return (1);
  85. }))._valueWithPossibleArguments_([(3), (4)]),(1));
  86. _st(self)._assert_equals_(_st((function(a){
  87. return _st(a).__plus((4));
  88. }))._valueWithPossibleArguments_([(3), (4)]),(7));
  89. _st(self)._assert_equals_(_st((function(a,b){
  90. return _st(a).__plus(b);
  91. }))._valueWithPossibleArguments_([(3), (4), (5)]),(7));
  92. return self}, self, "testValueWithPossibleArguments", [], smalltalk.BlockClosureTest)}
  93. }),
  94. smalltalk.BlockClosureTest);
  95. smalltalk.addMethod(
  96. "_testWhileFalse",
  97. smalltalk.method({
  98. selector: "testWhileFalse",
  99. fn: function (){
  100. var self=this;
  101. return smalltalk.withContext(function($ctx) { var i;
  102. i=(0);
  103. _st((function(){
  104. return _st(i).__gt((5));
  105. }))._whileFalse_((function(){
  106. i=_st(i).__plus((1));
  107. return i;
  108. }));
  109. _st(self)._assert_equals_(i,(6));
  110. i=(0);
  111. _st((function(){
  112. i=_st(i).__plus((1));
  113. i;
  114. return _st(i).__gt((5));
  115. }))._whileFalse();
  116. _st(self)._assert_equals_(i,(6));
  117. return self}, self, "testWhileFalse", [], smalltalk.BlockClosureTest)}
  118. }),
  119. smalltalk.BlockClosureTest);
  120. smalltalk.addMethod(
  121. "_testWhileTrue",
  122. smalltalk.method({
  123. selector: "testWhileTrue",
  124. fn: function (){
  125. var self=this;
  126. return smalltalk.withContext(function($ctx) { var i;
  127. i=(0);
  128. _st((function(){
  129. return _st(i).__lt((5));
  130. }))._whileTrue_((function(){
  131. i=_st(i).__plus((1));
  132. return i;
  133. }));
  134. _st(self)._assert_equals_(i,(5));
  135. i=(0);
  136. _st((function(){
  137. i=_st(i).__plus((1));
  138. i;
  139. return _st(i).__lt((5));
  140. }))._whileTrue();
  141. _st(self)._assert_equals_(i,(5));
  142. return self}, self, "testWhileTrue", [], smalltalk.BlockClosureTest)}
  143. }),
  144. smalltalk.BlockClosureTest);
  145. smalltalk.addClass('BooleanTest', smalltalk.TestCase, [], 'Kernel-Tests');
  146. smalltalk.addMethod(
  147. "_testEquality",
  148. smalltalk.method({
  149. selector: "testEquality",
  150. fn: function (){
  151. var self=this;
  152. return smalltalk.withContext(function($ctx) { _st(self)._deny_(_st((0)).__eq(false));
  153. _st(self)._deny_(_st(false).__eq((0)));
  154. _st(self)._deny_(_st("").__eq(false));
  155. _st(self)._deny_(_st(false).__eq(""));
  156. _st(self)._assert_(_st(true).__eq(true));
  157. _st(self)._deny_(_st(false).__eq(true));
  158. _st(self)._deny_(_st(true).__eq(false));
  159. _st(self)._assert_(_st(false).__eq(false));
  160. _st(self)._assert_(_st(_st(true)._yourself()).__eq(true));
  161. _st(self)._assert_(_st(_st(true)._yourself()).__eq(_st(true)._yourself()));
  162. return self}, self, "testEquality", [], smalltalk.BooleanTest)}
  163. }),
  164. smalltalk.BooleanTest);
  165. smalltalk.addMethod(
  166. "_testIdentity",
  167. smalltalk.method({
  168. selector: "testIdentity",
  169. fn: function (){
  170. var self=this;
  171. return smalltalk.withContext(function($ctx) { _st(self)._deny_(_st((0)).__eq_eq(false));
  172. _st(self)._deny_(_st(false).__eq_eq((0)));
  173. _st(self)._deny_(_st("").__eq_eq(false));
  174. _st(self)._deny_(_st(false).__eq_eq(""));
  175. _st(self)._assert_(_st(true).__eq_eq(true));
  176. _st(self)._deny_(_st(false).__eq_eq(true));
  177. _st(self)._deny_(_st(true).__eq_eq(false));
  178. _st(self)._assert_(_st(false).__eq_eq(false));
  179. _st(self)._assert_(_st(_st(true)._yourself()).__eq_eq(true));
  180. _st(self)._assert_(_st(_st(true)._yourself()).__eq_eq(_st(true)._yourself()));
  181. return self}, self, "testIdentity", [], smalltalk.BooleanTest)}
  182. }),
  183. smalltalk.BooleanTest);
  184. smalltalk.addMethod(
  185. "_testIfTrueIfFalse",
  186. smalltalk.method({
  187. selector: "testIfTrueIfFalse",
  188. fn: function (){
  189. var self=this;
  190. return smalltalk.withContext(function($ctx) { var $1,$2,$3,$4,$5,$6,$7,$8;
  191. if(smalltalk.assert(true)){
  192. $1="alternative block";
  193. };
  194. _st(self)._assert_(_st($1).__eq("alternative block"));
  195. if(! smalltalk.assert(true)){
  196. $2="alternative block";
  197. };
  198. _st(self)._assert_(_st($2).__eq(nil));
  199. if(smalltalk.assert(false)){
  200. $3="alternative block";
  201. };
  202. _st(self)._assert_(_st($3).__eq(nil));
  203. if(! smalltalk.assert(false)){
  204. $4="alternative block";
  205. };
  206. _st(self)._assert_(_st($4).__eq("alternative block"));
  207. if(smalltalk.assert(false)){
  208. $5="alternative block";
  209. } else {
  210. $5="alternative block2";
  211. };
  212. _st(self)._assert_(_st($5).__eq("alternative block2"));
  213. if(smalltalk.assert(false)){
  214. $6="alternative block2";
  215. } else {
  216. $6="alternative block";
  217. };
  218. _st(self)._assert_(_st($6).__eq("alternative block"));
  219. if(smalltalk.assert(true)){
  220. $7="alternative block";
  221. } else {
  222. $7="alternative block2";
  223. };
  224. _st(self)._assert_(_st($7).__eq("alternative block"));
  225. if(smalltalk.assert(true)){
  226. $8="alternative block2";
  227. } else {
  228. $8="alternative block";
  229. };
  230. _st(self)._assert_(_st($8).__eq("alternative block2"));
  231. return self}, self, "testIfTrueIfFalse", [], smalltalk.BooleanTest)}
  232. }),
  233. smalltalk.BooleanTest);
  234. smalltalk.addMethod(
  235. "_testLogic",
  236. smalltalk.method({
  237. selector: "testLogic",
  238. fn: function (){
  239. var self=this;
  240. return smalltalk.withContext(function($ctx) { var $1,$2,$3,$4;
  241. _st(self)._assert_(_st(true).__and(true));
  242. _st(self)._deny_(_st(true).__and(false));
  243. _st(self)._deny_(_st(false).__and(true));
  244. $1=_st(self)._deny_(_st(false).__and(false));
  245. _st(self)._assert_(_st(true).__or(true));
  246. _st(self)._assert_(_st(true).__or(false));
  247. _st(self)._assert_(_st(false).__or(true));
  248. $2=_st(self)._deny_(_st(false).__or(false));
  249. _st(self)._assert_(_st(true).__and(_st((1)).__gt((0))));
  250. _st(self)._deny_(_st(_st((1)).__gt((0))).__and(false));
  251. $3=_st(self)._deny_(_st(_st((1)).__gt((0))).__and(_st((1)).__gt((2))));
  252. _st(self)._assert_(_st(false).__or(_st((1)).__gt((0))));
  253. _st(self)._assert_(_st(_st((1)).__gt((0))).__or(false));
  254. $4=_st(self)._assert_(_st(_st((1)).__gt((0))).__or(_st((1)).__gt((2))));
  255. return self}, self, "testLogic", [], smalltalk.BooleanTest)}
  256. }),
  257. smalltalk.BooleanTest);
  258. smalltalk.addMethod(
  259. "_testLogicKeywords",
  260. smalltalk.method({
  261. selector: "testLogicKeywords",
  262. fn: function (){
  263. var self=this;
  264. return smalltalk.withContext(function($ctx) { var $1,$2,$3,$4;
  265. _st(self)._assert_(_st(true)._and_((function(){
  266. return true;
  267. })));
  268. _st(self)._deny_(_st(true)._and_((function(){
  269. return false;
  270. })));
  271. _st(self)._deny_(_st(false)._and_((function(){
  272. return true;
  273. })));
  274. $1=_st(self)._deny_(_st(false)._and_((function(){
  275. return false;
  276. })));
  277. _st(self)._assert_(_st(true)._or_((function(){
  278. return true;
  279. })));
  280. _st(self)._assert_(_st(true)._or_((function(){
  281. return false;
  282. })));
  283. _st(self)._assert_(_st(false)._or_((function(){
  284. return true;
  285. })));
  286. $2=_st(self)._deny_(_st(false)._or_((function(){
  287. return false;
  288. })));
  289. _st(self)._assert_(_st(true)._and_((function(){
  290. return _st((1)).__gt((0));
  291. })));
  292. _st(self)._deny_(_st(_st((1)).__gt((0)))._and_((function(){
  293. return false;
  294. })));
  295. $3=_st(self)._deny_(_st(_st((1)).__gt((0)))._and_((function(){
  296. return _st((1)).__gt((2));
  297. })));
  298. _st(self)._assert_(_st(false)._or_((function(){
  299. return _st((1)).__gt((0));
  300. })));
  301. _st(self)._assert_(_st(_st((1)).__gt((0)))._or_((function(){
  302. return false;
  303. })));
  304. $4=_st(self)._assert_(_st(_st((1)).__gt((0)))._or_((function(){
  305. return _st((1)).__gt((2));
  306. })));
  307. return self}, self, "testLogicKeywords", [], smalltalk.BooleanTest)}
  308. }),
  309. smalltalk.BooleanTest);
  310. smalltalk.addMethod(
  311. "_testNonBooleanError",
  312. smalltalk.method({
  313. selector: "testNonBooleanError",
  314. fn: function (){
  315. var self=this;
  316. return smalltalk.withContext(function($ctx) { _st(self)._should_raise_((function(){
  317. if(smalltalk.assert("")){
  318. } else {
  319. };
  320. }),(smalltalk.NonBooleanReceiver || NonBooleanReceiver));
  321. return self}, self, "testNonBooleanError", [], smalltalk.BooleanTest)}
  322. }),
  323. smalltalk.BooleanTest);
  324. smalltalk.addClass('ClassBuilderTest', smalltalk.TestCase, ['builder', 'theClass'], 'Kernel-Tests');
  325. smalltalk.addMethod(
  326. "_setUp",
  327. smalltalk.method({
  328. selector: "setUp",
  329. fn: function (){
  330. var self=this;
  331. return smalltalk.withContext(function($ctx) { self["@builder"]=_st((smalltalk.ClassBuilder || ClassBuilder))._new();
  332. return self}, self, "setUp", [], smalltalk.ClassBuilderTest)}
  333. }),
  334. smalltalk.ClassBuilderTest);
  335. smalltalk.addMethod(
  336. "_tearDown",
  337. smalltalk.method({
  338. selector: "tearDown",
  339. fn: function (){
  340. var self=this;
  341. return smalltalk.withContext(function($ctx) { if(($receiver = self["@theClass"]) == nil || $receiver == undefined){
  342. self["@theClass"];
  343. } else {
  344. _st(_st((smalltalk.Smalltalk || Smalltalk))._current())._removeClass_(self["@theClass"]);
  345. self["@theClass"]=nil;
  346. self["@theClass"];
  347. };
  348. return self}, self, "tearDown", [], smalltalk.ClassBuilderTest)}
  349. }),
  350. smalltalk.ClassBuilderTest);
  351. smalltalk.addMethod(
  352. "_testClassCopy",
  353. smalltalk.method({
  354. selector: "testClassCopy",
  355. fn: function (){
  356. var self=this;
  357. return smalltalk.withContext(function($ctx) { self["@theClass"]=_st(self["@builder"])._copyClass_named_((smalltalk.ObjectMock || ObjectMock),"ObjectMock2");
  358. _st(self)._assert_(_st(_st(self["@theClass"])._superclass()).__eq_eq(_st((smalltalk.ObjectMock || ObjectMock))._superclass()));
  359. _st(self)._assert_(_st(_st(self["@theClass"])._instanceVariableNames()).__eq_eq(_st((smalltalk.ObjectMock || ObjectMock))._instanceVariableNames()));
  360. _st(self)._assert_equals_(_st(self["@theClass"])._name(),"ObjectMock2");
  361. _st(self)._assert_(_st(_st(self["@theClass"])._package()).__eq_eq(_st((smalltalk.ObjectMock || ObjectMock))._package()));
  362. _st(self)._assert_equals_(_st(_st(self["@theClass"])._methodDictionary())._keys(),_st(_st((smalltalk.ObjectMock || ObjectMock))._methodDictionary())._keys());
  363. return self}, self, "testClassCopy", [], smalltalk.ClassBuilderTest)}
  364. }),
  365. smalltalk.ClassBuilderTest);
  366. smalltalk.addMethod(
  367. "_testInstanceVariableNames",
  368. smalltalk.method({
  369. selector: "testInstanceVariableNames",
  370. fn: function (){
  371. var self=this;
  372. return smalltalk.withContext(function($ctx) { _st(self)._assert_equals_(_st(self["@builder"])._instanceVariableNamesFor_(" hello world "),["hello", "world"]);
  373. return self}, self, "testInstanceVariableNames", [], smalltalk.ClassBuilderTest)}
  374. }),
  375. smalltalk.ClassBuilderTest);
  376. smalltalk.addClass('CollectionTest', smalltalk.TestCase, [], 'Kernel-Tests');
  377. smalltalk.addMethod(
  378. "_assertSameContents_as_",
  379. smalltalk.method({
  380. selector: "assertSameContents:as:",
  381. fn: function (aCollection,anotherCollection){
  382. var self=this;
  383. return smalltalk.withContext(function($ctx) { _st(self)._assert_(_st(_st(aCollection)._size()).__eq(_st(anotherCollection)._size()));
  384. _st(aCollection)._do_((function(each){
  385. return _st(self)._assert_(_st(_st(aCollection)._occurrencesOf_(each)).__eq(_st(anotherCollection)._occurrencesOf_(each)));
  386. }));
  387. return self}, self, "assertSameContents:as:", [aCollection,anotherCollection], smalltalk.CollectionTest)}
  388. }),
  389. smalltalk.CollectionTest);
  390. smalltalk.addMethod(
  391. "_collection",
  392. smalltalk.method({
  393. selector: "collection",
  394. fn: function (){
  395. var self=this;
  396. return smalltalk.withContext(function($ctx) { var $1;
  397. $1=_st(_st(self)._collectionClass())._withAll_(_st(self)._defaultValues());
  398. return $1;
  399. }, self, "collection", [], smalltalk.CollectionTest)}
  400. }),
  401. smalltalk.CollectionTest);
  402. smalltalk.addMethod(
  403. "_collectionClass",
  404. smalltalk.method({
  405. selector: "collectionClass",
  406. fn: function (){
  407. var self=this;
  408. return smalltalk.withContext(function($ctx) { var $1;
  409. $1=_st(_st(self)._class())._collectionClass();
  410. return $1;
  411. }, self, "collectionClass", [], smalltalk.CollectionTest)}
  412. }),
  413. smalltalk.CollectionTest);
  414. smalltalk.addMethod(
  415. "_collectionWithDuplicates",
  416. smalltalk.method({
  417. selector: "collectionWithDuplicates",
  418. fn: function (){
  419. var self=this;
  420. return smalltalk.withContext(function($ctx) { var $1;
  421. $1=_st(_st(self)._collectionClass())._withAll_(["a", "b", "c", (1), (2), (1), "a"]);
  422. return $1;
  423. }, self, "collectionWithDuplicates", [], smalltalk.CollectionTest)}
  424. }),
  425. smalltalk.CollectionTest);
  426. smalltalk.addMethod(
  427. "_defaultValues",
  428. smalltalk.method({
  429. selector: "defaultValues",
  430. fn: function (){
  431. var self=this;
  432. return smalltalk.withContext(function($ctx) { return [(1), (2), (3), (-4)];
  433. }, self, "defaultValues", [], smalltalk.CollectionTest)}
  434. }),
  435. smalltalk.CollectionTest);
  436. smalltalk.addMethod(
  437. "_isCollectionReadOnly",
  438. smalltalk.method({
  439. selector: "isCollectionReadOnly",
  440. fn: function (){
  441. var self=this;
  442. return smalltalk.withContext(function($ctx) { return false;
  443. }, self, "isCollectionReadOnly", [], smalltalk.CollectionTest)}
  444. }),
  445. smalltalk.CollectionTest);
  446. smalltalk.addMethod(
  447. "_testAsArray",
  448. smalltalk.method({
  449. selector: "testAsArray",
  450. fn: function (){
  451. var self=this;
  452. return smalltalk.withContext(function($ctx) { _st(self)._assertSameContents_as_(_st(self)._collection(),_st(_st(self)._collection())._asArray());
  453. return self}, self, "testAsArray", [], smalltalk.CollectionTest)}
  454. }),
  455. smalltalk.CollectionTest);
  456. smalltalk.addMethod(
  457. "_testAsOrderedCollection",
  458. smalltalk.method({
  459. selector: "testAsOrderedCollection",
  460. fn: function (){
  461. var self=this;
  462. return smalltalk.withContext(function($ctx) { _st(self)._assertSameContents_as_(_st(self)._collection(),_st(_st(self)._collection())._asOrderedCollection());
  463. return self}, self, "testAsOrderedCollection", [], smalltalk.CollectionTest)}
  464. }),
  465. smalltalk.CollectionTest);
  466. smalltalk.addMethod(
  467. "_testAsSet",
  468. smalltalk.method({
  469. selector: "testAsSet",
  470. fn: function (){
  471. var self=this;
  472. return smalltalk.withContext(function($ctx) { var c;
  473. var set;
  474. c=_st(self)._collectionWithDuplicates();
  475. set=_st(c)._asSet();
  476. _st(self)._assert_(_st(_st(set)._size()).__eq((5)));
  477. _st(c)._do_((function(each){
  478. return _st(self)._assert_(_st(set)._includes_(each));
  479. }));
  480. return self}, self, "testAsSet", [], smalltalk.CollectionTest)}
  481. }),
  482. smalltalk.CollectionTest);
  483. smalltalk.addMethod(
  484. "_testCollect",
  485. smalltalk.method({
  486. selector: "testCollect",
  487. fn: function (){
  488. var self=this;
  489. return smalltalk.withContext(function($ctx) { var newCollection;
  490. newCollection=[(1), (2), (3), (4)];
  491. _st(self)._assertSameContents_as_(_st(_st(self)._collection())._collect_((function(each){
  492. return _st(each)._abs();
  493. })),newCollection);
  494. return self}, self, "testCollect", [], smalltalk.CollectionTest)}
  495. }),
  496. smalltalk.CollectionTest);
  497. smalltalk.addMethod(
  498. "_testDetect",
  499. smalltalk.method({
  500. selector: "testDetect",
  501. fn: function (){
  502. var self=this;
  503. return smalltalk.withContext(function($ctx) { _st(self)._assert_(_st(_st(_st(self)._collection())._detect_((function(each){
  504. return _st(each).__lt((0));
  505. }))).__eq((-4)));
  506. _st(self)._should_raise_((function(){
  507. return _st(_st(self)._collection())._detect_((function(each){
  508. return _st(each).__eq((6));
  509. }));
  510. }),(smalltalk.Error || Error));
  511. return self}, self, "testDetect", [], smalltalk.CollectionTest)}
  512. }),
  513. smalltalk.CollectionTest);
  514. smalltalk.addMethod(
  515. "_testDo",
  516. smalltalk.method({
  517. selector: "testDo",
  518. fn: function (){
  519. var self=this;
  520. return smalltalk.withContext(function($ctx) { var newCollection;
  521. newCollection=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
  522. _st(_st(self)._collection())._do_((function(each){
  523. return _st(newCollection)._add_(each);
  524. }));
  525. _st(self)._assertSameContents_as_(_st(self)._collection(),newCollection);
  526. return self}, self, "testDo", [], smalltalk.CollectionTest)}
  527. }),
  528. smalltalk.CollectionTest);
  529. smalltalk.addMethod(
  530. "_testIsEmpty",
  531. smalltalk.method({
  532. selector: "testIsEmpty",
  533. fn: function (){
  534. var self=this;
  535. return smalltalk.withContext(function($ctx) { _st(self)._assert_(_st(_st(_st(self)._collectionClass())._new())._isEmpty());
  536. _st(self)._deny_(_st(_st(self)._collection())._isEmpty());
  537. return self}, self, "testIsEmpty", [], smalltalk.CollectionTest)}
  538. }),
  539. smalltalk.CollectionTest);
  540. smalltalk.addMethod(
  541. "_testSelect",
  542. smalltalk.method({
  543. selector: "testSelect",
  544. fn: function (){
  545. var self=this;
  546. return smalltalk.withContext(function($ctx) { var newCollection;
  547. newCollection=[(2), (-4)];
  548. _st(self)._assertSameContents_as_(_st(_st(self)._collection())._select_((function(each){
  549. return _st(each)._even();
  550. })),newCollection);
  551. return self}, self, "testSelect", [], smalltalk.CollectionTest)}
  552. }),
  553. smalltalk.CollectionTest);
  554. smalltalk.addMethod(
  555. "_testSize",
  556. smalltalk.method({
  557. selector: "testSize",
  558. fn: function (){
  559. var self=this;
  560. return smalltalk.withContext(function($ctx) { _st(self)._assert_(_st(_st(_st(_st(self)._collectionClass())._new())._size()).__eq((0)));
  561. _st(self)._assert_(_st(_st(_st(self)._collection())._size()).__eq((4)));
  562. return self}, self, "testSize", [], smalltalk.CollectionTest)}
  563. }),
  564. smalltalk.CollectionTest);
  565. smalltalk.addMethod(
  566. "_collectionClass",
  567. smalltalk.method({
  568. selector: "collectionClass",
  569. fn: function (){
  570. var self=this;
  571. return smalltalk.withContext(function($ctx) { return nil;
  572. }, self, "collectionClass", [], smalltalk.CollectionTest.klass)}
  573. }),
  574. smalltalk.CollectionTest.klass);
  575. smalltalk.addMethod(
  576. "_isAbstract",
  577. smalltalk.method({
  578. selector: "isAbstract",
  579. fn: function (){
  580. var self=this;
  581. return smalltalk.withContext(function($ctx) { var $1;
  582. $1=_st(_st(self)._collectionClass())._isNil();
  583. return $1;
  584. }, self, "isAbstract", [], smalltalk.CollectionTest.klass)}
  585. }),
  586. smalltalk.CollectionTest.klass);
  587. smalltalk.addClass('HashedCollectionTest', smalltalk.CollectionTest, [], 'Kernel-Tests');
  588. smalltalk.addMethod(
  589. "_collection",
  590. smalltalk.method({
  591. selector: "collection",
  592. fn: function (){
  593. var self=this;
  594. return smalltalk.withContext(function($ctx) { var $1;
  595. $1=smalltalk.HashedCollection._fromPairs_([_st("a").__minus_gt((1)),_st("b").__minus_gt((2)),_st("c").__minus_gt((3)),_st("d").__minus_gt((-4))]);
  596. return $1;
  597. }, self, "collection", [], smalltalk.HashedCollectionTest)}
  598. }),
  599. smalltalk.HashedCollectionTest);
  600. smalltalk.addMethod(
  601. "_collectionWithDuplicates",
  602. smalltalk.method({
  603. selector: "collectionWithDuplicates",
  604. fn: function (){
  605. var self=this;
  606. return smalltalk.withContext(function($ctx) { var $1;
  607. $1=smalltalk.HashedCollection._fromPairs_([_st("a").__minus_gt((1)),_st("b").__minus_gt((2)),_st("c").__minus_gt((3)),_st("d").__minus_gt((-4)),_st("e").__minus_gt((1)),_st("f").__minus_gt((2)),_st("g").__minus_gt((10))]);
  608. return $1;
  609. }, self, "collectionWithDuplicates", [], smalltalk.HashedCollectionTest)}
  610. }),
  611. smalltalk.HashedCollectionTest);
  612. smalltalk.addMethod(
  613. "_collectionClass",
  614. smalltalk.method({
  615. selector: "collectionClass",
  616. fn: function (){
  617. var self=this;
  618. return smalltalk.withContext(function($ctx) { return (smalltalk.HashedCollection || HashedCollection);
  619. }, self, "collectionClass", [], smalltalk.HashedCollectionTest.klass)}
  620. }),
  621. smalltalk.HashedCollectionTest.klass);
  622. smalltalk.addClass('DictionaryTest', smalltalk.HashedCollectionTest, [], 'Kernel-Tests');
  623. smalltalk.addMethod(
  624. "_collection",
  625. smalltalk.method({
  626. selector: "collection",
  627. fn: function (){
  628. var self=this;
  629. return smalltalk.withContext(function($ctx) { var $2,$3,$1;
  630. $2=_st((smalltalk.Dictionary || Dictionary))._new();
  631. _st($2)._at_put_((1),(1));
  632. _st($2)._at_put_("a",(2));
  633. _st($2)._at_put_(true,(3));
  634. _st($2)._at_put_((4),(-4));
  635. $3=_st($2)._yourself();
  636. $1=$3;
  637. return $1;
  638. }, self, "collection", [], smalltalk.DictionaryTest)}
  639. }),
  640. smalltalk.DictionaryTest);
  641. smalltalk.addMethod(
  642. "_collectionWithDuplicates",
  643. smalltalk.method({
  644. selector: "collectionWithDuplicates",
  645. fn: function (){
  646. var self=this;
  647. return smalltalk.withContext(function($ctx) { var $2,$3,$1;
  648. $2=_st((smalltalk.Dictionary || Dictionary))._new();
  649. _st($2)._at_put_((1),(1));
  650. _st($2)._at_put_("a",(2));
  651. _st($2)._at_put_(true,(3));
  652. _st($2)._at_put_((4),(-4));
  653. _st($2)._at_put_("b",(1));
  654. _st($2)._at_put_((3),(3));
  655. _st($2)._at_put_(false,(12));
  656. $3=_st($2)._yourself();
  657. $1=$3;
  658. return $1;
  659. }, self, "collectionWithDuplicates", [], smalltalk.DictionaryTest)}
  660. }),
  661. smalltalk.DictionaryTest);
  662. smalltalk.addMethod(
  663. "_testAccessing",
  664. smalltalk.method({
  665. selector: "testAccessing",
  666. fn: function (){
  667. var self=this;
  668. return smalltalk.withContext(function($ctx) { var d;
  669. d=_st((smalltalk.Dictionary || Dictionary))._new();
  670. _st(d)._at_put_("hello","world");
  671. _st(self)._assert_(_st(_st(d)._at_("hello")).__eq("world"));
  672. _st(self)._assert_(_st(_st(d)._at_ifAbsent_("hello",(function(){
  673. return nil;
  674. }))).__eq("world"));
  675. _st(self)._deny_(_st(_st(d)._at_ifAbsent_("foo",(function(){
  676. return nil;
  677. }))).__eq("world"));
  678. _st(d)._at_put_((1),(2));
  679. _st(self)._assert_(_st(_st(d)._at_((1))).__eq((2)));
  680. _st(d)._at_put_(_st((1)).__at((3)),(3));
  681. _st(self)._assert_(_st(_st(d)._at_(_st((1)).__at((3)))).__eq((3)));
  682. return self}, self, "testAccessing", [], smalltalk.DictionaryTest)}
  683. }),
  684. smalltalk.DictionaryTest);
  685. smalltalk.addMethod(
  686. "_testDynamicDictionaries",
  687. smalltalk.method({
  688. selector: "testDynamicDictionaries",
  689. fn: function (){
  690. var self=this;
  691. return smalltalk.withContext(function($ctx) { _st(self)._assert_(_st(_st(smalltalk.HashedCollection._fromPairs_([_st("hello").__minus_gt((1))]))._asDictionary()).__eq(_st((smalltalk.Dictionary || Dictionary))._with_(_st("hello").__minus_gt((1)))));
  692. return self}, self, "testDynamicDictionaries", [], smalltalk.DictionaryTest)}
  693. }),
  694. smalltalk.DictionaryTest);
  695. smalltalk.addMethod(
  696. "_testEquality",
  697. smalltalk.method({
  698. selector: "testEquality",
  699. fn: function (){
  700. var self=this;
  701. return smalltalk.withContext(function($ctx) { var $1,$2,$3,$4,$5,$6,$7,$8,$9,$10;
  702. var d1;
  703. var d2;
  704. _st(self)._assert_(_st(_st((smalltalk.Dictionary || Dictionary))._new()).__eq(_st((smalltalk.Dictionary || Dictionary))._new()));
  705. $1=_st((smalltalk.Dictionary || Dictionary))._new();
  706. _st($1)._at_put_((1),(2));
  707. $2=_st($1)._yourself();
  708. d1=$2;
  709. $3=_st((smalltalk.Dictionary || Dictionary))._new();
  710. _st($3)._at_put_((1),(2));
  711. $4=_st($3)._yourself();
  712. d2=$4;
  713. _st(self)._assert_(_st(d1).__eq(d2));
  714. $5=_st((smalltalk.Dictionary || Dictionary))._new();
  715. _st($5)._at_put_((1),(3));
  716. $6=_st($5)._yourself();
  717. d2=$6;
  718. _st(self)._deny_(_st(d1).__eq(d2));
  719. $7=_st((smalltalk.Dictionary || Dictionary))._new();
  720. _st($7)._at_put_((2),(2));
  721. $8=_st($7)._yourself();
  722. d2=$8;
  723. _st(self)._deny_(_st(d1).__eq(d2));
  724. $9=_st((smalltalk.Dictionary || Dictionary))._new();
  725. _st($9)._at_put_((1),(2));
  726. _st($9)._at_put_((3),(4));
  727. $10=_st($9)._yourself();
  728. d2=$10;
  729. _st(self)._deny_(_st(d1).__eq(d2));
  730. return self}, self, "testEquality", [], smalltalk.DictionaryTest)}
  731. }),
  732. smalltalk.DictionaryTest);
  733. smalltalk.addMethod(
  734. "_testIfAbsent",
  735. smalltalk.method({
  736. selector: "testIfAbsent",
  737. fn: function (){
  738. var self=this;
  739. return smalltalk.withContext(function($ctx) { var d;
  740. var visited;
  741. visited=false;
  742. d=_st((smalltalk.Dictionary || Dictionary))._new();
  743. _st(d)._at_ifAbsent_("hello",(function(){
  744. visited=true;
  745. return visited;
  746. }));
  747. _st(self)._assert_(visited);
  748. return self}, self, "testIfAbsent", [], smalltalk.DictionaryTest)}
  749. }),
  750. smalltalk.DictionaryTest);
  751. smalltalk.addMethod(
  752. "_testIfPresent",
  753. smalltalk.method({
  754. selector: "testIfPresent",
  755. fn: function (){
  756. var self=this;
  757. return smalltalk.withContext(function($ctx) { var d;
  758. var visited;
  759. var absent;
  760. visited=false;
  761. d=_st((smalltalk.Dictionary || Dictionary))._new();
  762. _st(d)._at_put_("hello","world");
  763. _st(d)._at_ifPresent_("hello",(function(value){
  764. visited=value;
  765. return visited;
  766. }));
  767. _st(self)._assert_(_st(visited).__eq("world"));
  768. absent=_st(d)._at_ifPresent_("bye",(function(value){
  769. visited=value;
  770. return visited;
  771. }));
  772. _st(self)._assert_(_st(absent)._isNil());
  773. return self}, self, "testIfPresent", [], smalltalk.DictionaryTest)}
  774. }),
  775. smalltalk.DictionaryTest);
  776. smalltalk.addMethod(
  777. "_testIfPresentIfAbsent",
  778. smalltalk.method({
  779. selector: "testIfPresentIfAbsent",
  780. fn: function (){
  781. var self=this;
  782. return smalltalk.withContext(function($ctx) { var d;
  783. var visited;
  784. visited=false;
  785. d=_st((smalltalk.Dictionary || Dictionary))._new();
  786. _st(d)._at_put_("hello","world");
  787. _st(d)._at_ifPresent_ifAbsent_("hello",(function(value){
  788. visited=value;
  789. return visited;
  790. }),(function(){
  791. visited=true;
  792. return visited;
  793. }));
  794. _st(self)._assert_(_st(visited).__eq("world"));
  795. _st(d)._at_ifPresent_ifAbsent_("buy",(function(value){
  796. visited=value;
  797. return visited;
  798. }),(function(){
  799. visited=true;
  800. return visited;
  801. }));
  802. _st(self)._assert_(visited);
  803. return self}, self, "testIfPresentIfAbsent", [], smalltalk.DictionaryTest)}
  804. }),
  805. smalltalk.DictionaryTest);
  806. smalltalk.addMethod(
  807. "_testKeys",
  808. smalltalk.method({
  809. selector: "testKeys",
  810. fn: function (){
  811. var self=this;
  812. return smalltalk.withContext(function($ctx) { var d;
  813. d=_st((smalltalk.Dictionary || Dictionary))._new();
  814. _st(d)._at_put_((1),(2));
  815. _st(d)._at_put_((2),(3));
  816. _st(d)._at_put_((3),(4));
  817. _st(self)._assert_(_st(_st(d)._keys()).__eq([(1), (2), (3)]));
  818. return self}, self, "testKeys", [], smalltalk.DictionaryTest)}
  819. }),
  820. smalltalk.DictionaryTest);
  821. smalltalk.addMethod(
  822. "_testPrintString",
  823. smalltalk.method({
  824. selector: "testPrintString",
  825. fn: function (){
  826. var self=this;
  827. return smalltalk.withContext(function($ctx) { var $1,$2;
  828. $1=_st((smalltalk.Dictionary || Dictionary))._new();
  829. _st($1)._at_put_("firstname","James");
  830. _st($1)._at_put_("lastname","Bond");
  831. $2=_st($1)._printString();
  832. _st(self)._assert_equals_("a Dictionary('firstname'->'James' , 'lastname'->'Bond')",$2);
  833. return self}, self, "testPrintString", [], smalltalk.DictionaryTest)}
  834. }),
  835. smalltalk.DictionaryTest);
  836. smalltalk.addMethod(
  837. "_testRemoveKey",
  838. smalltalk.method({
  839. selector: "testRemoveKey",
  840. fn: function (){
  841. var self=this;
  842. return smalltalk.withContext(function($ctx) { var d;
  843. var key;
  844. d=_st((smalltalk.Dictionary || Dictionary))._new();
  845. _st(d)._at_put_((1),(2));
  846. _st(d)._at_put_((2),(3));
  847. _st(d)._at_put_((3),(4));
  848. key=(2);
  849. _st(self)._assert_(_st(_st(d)._keys()).__eq([(1), (2), (3)]));
  850. _st(d)._removeKey_(key);
  851. _st(self)._assert_(_st(_st(d)._keys()).__eq([(1), (3)]));
  852. _st(self)._assert_(_st(_st(d)._values()).__eq([(2), (4)]));
  853. _st(self)._deny_(_st(d)._includesKey_((2)));
  854. return self}, self, "testRemoveKey", [], smalltalk.DictionaryTest)}
  855. }),
  856. smalltalk.DictionaryTest);
  857. smalltalk.addMethod(
  858. "_testRemoveKeyIfAbsent",
  859. smalltalk.method({
  860. selector: "testRemoveKeyIfAbsent",
  861. fn: function (){
  862. var self=this;
  863. return smalltalk.withContext(function($ctx) { var d;
  864. var key;
  865. d=_st((smalltalk.Dictionary || Dictionary))._new();
  866. _st(d)._at_put_((1),(2));
  867. _st(d)._at_put_((2),(3));
  868. _st(d)._at_put_((3),(4));
  869. key=(2);
  870. _st(self)._assert_(_st(_st(d)._removeKey_(key)).__eq((3)));
  871. key=(3);
  872. _st(self)._assert_(_st(_st(d)._removeKey_ifAbsent_(key,(function(){
  873. return (42);
  874. }))).__eq((4)));
  875. key="why";
  876. _st(self)._assert_(_st(_st(d)._removeKey_ifAbsent_(key,(function(){
  877. return (42);
  878. }))).__eq((42)));
  879. return self}, self, "testRemoveKeyIfAbsent", [], smalltalk.DictionaryTest)}
  880. }),
  881. smalltalk.DictionaryTest);
  882. smalltalk.addMethod(
  883. "_testSize",
  884. smalltalk.method({
  885. selector: "testSize",
  886. fn: function (){
  887. var self=this;
  888. return smalltalk.withContext(function($ctx) { var d;
  889. d=_st((smalltalk.Dictionary || Dictionary))._new();
  890. _st(self)._assert_(_st(_st(d)._size()).__eq((0)));
  891. _st(d)._at_put_((1),(2));
  892. _st(self)._assert_(_st(_st(d)._size()).__eq((1)));
  893. _st(d)._at_put_((2),(3));
  894. _st(self)._assert_(_st(_st(d)._size()).__eq((2)));
  895. return self}, self, "testSize", [], smalltalk.DictionaryTest)}
  896. }),
  897. smalltalk.DictionaryTest);
  898. smalltalk.addMethod(
  899. "_testValues",
  900. smalltalk.method({
  901. selector: "testValues",
  902. fn: function (){
  903. var self=this;
  904. return smalltalk.withContext(function($ctx) { var d;
  905. d=_st((smalltalk.Dictionary || Dictionary))._new();
  906. _st(d)._at_put_((1),(2));
  907. _st(d)._at_put_((2),(3));
  908. _st(d)._at_put_((3),(4));
  909. _st(self)._assert_(_st(_st(d)._values()).__eq([(2), (3), (4)]));
  910. return self}, self, "testValues", [], smalltalk.DictionaryTest)}
  911. }),
  912. smalltalk.DictionaryTest);
  913. smalltalk.addMethod(
  914. "_collectionClass",
  915. smalltalk.method({
  916. selector: "collectionClass",
  917. fn: function (){
  918. var self=this;
  919. return smalltalk.withContext(function($ctx) { return (smalltalk.Dictionary || Dictionary);
  920. }, self, "collectionClass", [], smalltalk.DictionaryTest.klass)}
  921. }),
  922. smalltalk.DictionaryTest.klass);
  923. smalltalk.addClass('SequenceableCollectionTest', smalltalk.CollectionTest, [], 'Kernel-Tests');
  924. smalltalk.addMethod(
  925. "_testAt",
  926. smalltalk.method({
  927. selector: "testAt",
  928. fn: function (){
  929. var self=this;
  930. return smalltalk.withContext(function($ctx) { _st(self)._assert_(_st(_st(_st(self)._collection())._at_((4))).__eq((-4)));
  931. _st(self)._should_raise_((function(){
  932. return _st(_st(self)._collection())._at_((5));
  933. }),(smalltalk.Error || Error));
  934. return self}, self, "testAt", [], smalltalk.SequenceableCollectionTest)}
  935. }),
  936. smalltalk.SequenceableCollectionTest);
  937. smalltalk.addMethod(
  938. "_testAtIfAbsent",
  939. smalltalk.method({
  940. selector: "testAtIfAbsent",
  941. fn: function (){
  942. var self=this;
  943. return smalltalk.withContext(function($ctx) { _st(self)._assert_(_st(_st(_st(self)._collection())._at_ifAbsent_(_st(_st(_st(self)._collection())._size()).__plus((1)),(function(){
  944. return "none";
  945. }))).__eq("none"));
  946. return self}, self, "testAtIfAbsent", [], smalltalk.SequenceableCollectionTest)}
  947. }),
  948. smalltalk.SequenceableCollectionTest);
  949. smalltalk.addClass('ArrayTest', smalltalk.SequenceableCollectionTest, [], 'Kernel-Tests');
  950. smalltalk.addMethod(
  951. "_testAtIfAbsent",
  952. smalltalk.method({
  953. selector: "testAtIfAbsent",
  954. fn: function (){
  955. var self=this;
  956. return smalltalk.withContext(function($ctx) { var array;
  957. array=["hello", "world"];
  958. _st(self)._assert_equals_(_st(array)._at_((1)),"hello");
  959. _st(self)._assert_equals_(_st(array)._at_((2)),"world");
  960. _st(self)._assert_equals_(_st(array)._at_ifAbsent_((2),(function(){
  961. return "not found";
  962. })),"world");
  963. _st(self)._assert_equals_(_st(array)._at_ifAbsent_((0),(function(){
  964. return "not found";
  965. })),"not found");
  966. _st(self)._assert_equals_(_st(array)._at_ifAbsent_((-10),(function(){
  967. return "not found";
  968. })),"not found");
  969. _st(self)._assert_equals_(_st(array)._at_ifAbsent_((3),(function(){
  970. return "not found";
  971. })),"not found");
  972. return self}, self, "testAtIfAbsent", [], smalltalk.ArrayTest)}
  973. }),
  974. smalltalk.ArrayTest);
  975. smalltalk.addMethod(
  976. "_testFirstN",
  977. smalltalk.method({
  978. selector: "testFirstN",
  979. fn: function (){
  980. var self=this;
  981. return smalltalk.withContext(function($ctx) { _st(self)._assert_equals_([(1),(2),(3)],_st([(1),(2),(3),(4),(5)])._first_((3)));
  982. return self}, self, "testFirstN", [], smalltalk.ArrayTest)}
  983. }),
  984. smalltalk.ArrayTest);
  985. smalltalk.addMethod(
  986. "_testIfEmpty",
  987. smalltalk.method({
  988. selector: "testIfEmpty",
  989. fn: function (){
  990. var self=this;
  991. return smalltalk.withContext(function($ctx) { _st(self)._assert_equals_("zork",_st("")._ifEmpty_((function(){
  992. return "zork";
  993. })));
  994. return self}, self, "testIfEmpty", [], smalltalk.ArrayTest)}
  995. }),
  996. smalltalk.ArrayTest);
  997. smalltalk.addMethod(
  998. "_testPrintString",
  999. smalltalk.method({
  1000. selector: "testPrintString",
  1001. fn: function (){
  1002. var self=this;
  1003. return smalltalk.withContext(function($ctx) { var $1,$2;
  1004. var array;
  1005. array=_st((smalltalk.Array || Array))._new();
  1006. _st(self)._assert_equals_("a Array ()",_st(array)._printString());
  1007. _st(array)._add_((1));
  1008. $1=_st(array)._add_((3));
  1009. _st(self)._assert_equals_("a Array (1 3)",_st(array)._printString());
  1010. _st(array)._add_("foo");
  1011. _st(self)._assert_equals_("a Array (1 3 'foo')",_st(array)._printString());
  1012. _st(array)._remove_((1));
  1013. $2=_st(array)._remove_((3));
  1014. _st(self)._assert_equals_("a Array ('foo')",_st(array)._printString());
  1015. _st(array)._addLast_((3));
  1016. _st(self)._assert_equals_("a Array ('foo' 3)",_st(array)._printString());
  1017. _st(array)._addLast_((3));
  1018. _st(self)._assert_equals_("a Array ('foo' 3 3)",_st(array)._printString());
  1019. return self}, self, "testPrintString", [], smalltalk.ArrayTest)}
  1020. }),
  1021. smalltalk.ArrayTest);
  1022. smalltalk.addMethod(
  1023. "_collectionClass",
  1024. smalltalk.method({
  1025. selector: "collectionClass",
  1026. fn: function (){
  1027. var self=this;
  1028. return smalltalk.withContext(function($ctx) { return (smalltalk.Array || Array);
  1029. }, self, "collectionClass", [], smalltalk.ArrayTest.klass)}
  1030. }),
  1031. smalltalk.ArrayTest.klass);
  1032. smalltalk.addClass('StringTest', smalltalk.SequenceableCollectionTest, [], 'Kernel-Tests');
  1033. smalltalk.addMethod(
  1034. "_collection",
  1035. smalltalk.method({
  1036. selector: "collection",
  1037. fn: function (){
  1038. var self=this;
  1039. return smalltalk.withContext(function($ctx) { return "hello";
  1040. }, self, "collection", [], smalltalk.StringTest)}
  1041. }),
  1042. smalltalk.StringTest);
  1043. smalltalk.addMethod(
  1044. "_collectionWithDuplicates",
  1045. smalltalk.method({
  1046. selector: "collectionWithDuplicates",
  1047. fn: function (){
  1048. var self=this;
  1049. return smalltalk.withContext(function($ctx) { return "abbaerte";
  1050. }, self, "collectionWithDuplicates", [], smalltalk.StringTest)}
  1051. }),
  1052. smalltalk.StringTest);
  1053. smalltalk.addMethod(
  1054. "_testAddRemove",
  1055. smalltalk.method({
  1056. selector: "testAddRemove",
  1057. fn: function (){
  1058. var self=this;
  1059. return smalltalk.withContext(function($ctx) { _st(self)._should_raise_((function(){
  1060. return _st("hello")._add_("a");
  1061. }),(smalltalk.Error || Error));
  1062. _st(self)._should_raise_((function(){
  1063. return _st("hello")._remove_("h");
  1064. }),(smalltalk.Error || Error));
  1065. return self}, self, "testAddRemove", [], smalltalk.StringTest)}
  1066. }),
  1067. smalltalk.StringTest);
  1068. smalltalk.addMethod(
  1069. "_testAsArray",
  1070. smalltalk.method({
  1071. selector: "testAsArray",
  1072. fn: function (){
  1073. var self=this;
  1074. return smalltalk.withContext(function($ctx) { _st(self)._assert_(_st(_st("hello")._asArray()).__eq(["h", "e", "l", "l", "o"]));
  1075. return self}, self, "testAsArray", [], smalltalk.StringTest)}
  1076. }),
  1077. smalltalk.StringTest);
  1078. smalltalk.addMethod(
  1079. "_testAt",
  1080. smalltalk.method({
  1081. selector: "testAt",
  1082. fn: function (){
  1083. var self=this;
  1084. return smalltalk.withContext(function($ctx) { _st(self)._assert_(_st(_st("hello")._at_((1))).__eq("h"));
  1085. _st(self)._assert_(_st(_st("hello")._at_((5))).__eq("o"));
  1086. _st(self)._assert_(_st(_st("hello")._at_ifAbsent_((6),(function(){
  1087. return nil;
  1088. }))).__eq(nil));
  1089. return self}, self, "testAt", [], smalltalk.StringTest)}
  1090. }),
  1091. smalltalk.StringTest);
  1092. smalltalk.addMethod(
  1093. "_testAtPut",
  1094. smalltalk.method({
  1095. selector: "testAtPut",
  1096. fn: function (){
  1097. var self=this;
  1098. return smalltalk.withContext(function($ctx) { _st(self)._should_raise_((function(){
  1099. return _st("hello")._at_put_((1),"a");
  1100. }),(smalltalk.Error || Error));
  1101. return self}, self, "testAtPut", [], smalltalk.StringTest)}
  1102. }),
  1103. smalltalk.StringTest);
  1104. smalltalk.addMethod(
  1105. "_testCollect",
  1106. smalltalk.method({
  1107. selector: "testCollect",
  1108. fn: function (){
  1109. var self=this;
  1110. return smalltalk.withContext(function($ctx) { var newCollection;
  1111. newCollection="hheelllloo";
  1112. _st(self)._assertSameContents_as_(_st(_st(self)._collection())._collect_((function(each){
  1113. return _st(each).__comma(each);
  1114. })),newCollection);
  1115. return self}, self, "testCollect", [], smalltalk.StringTest)}
  1116. }),
  1117. smalltalk.StringTest);
  1118. smalltalk.addMethod(
  1119. "_testCopyWithoutAll",
  1120. smalltalk.method({
  1121. selector: "testCopyWithoutAll",
  1122. fn: function (){
  1123. var self=this;
  1124. return smalltalk.withContext(function($ctx) { _st(self)._assert_equals_("hello world",_st("*hello* *world*")._copyWithoutAll_("*"));
  1125. return self}, self, "testCopyWithoutAll", [], smalltalk.StringTest)}
  1126. }),
  1127. smalltalk.StringTest);
  1128. smalltalk.addMethod(
  1129. "_testDetect",
  1130. smalltalk.method({
  1131. selector: "testDetect",
  1132. fn: function (){
  1133. var self=this;
  1134. return smalltalk.withContext(function($ctx) { _st(self)._assert_(_st(_st(_st(self)._collection())._detect_((function(each){
  1135. return _st(each).__eq("h");
  1136. }))).__eq("h"));
  1137. _st(self)._should_raise_((function(){
  1138. return _st(_st(self)._collection())._detect_((function(each){
  1139. return _st(each).__eq((6));
  1140. }));
  1141. }),(smalltalk.Error || Error));
  1142. return self}, self, "testDetect", [], smalltalk.StringTest)}
  1143. }),
  1144. smalltalk.StringTest);
  1145. smalltalk.addMethod(
  1146. "_testEquality",
  1147. smalltalk.method({
  1148. selector: "testEquality",
  1149. fn: function (){
  1150. var self=this;
  1151. return smalltalk.withContext(function($ctx) { _st(self)._assert_(_st("hello").__eq("hello"));
  1152. _st(self)._deny_(_st("hello").__eq("world"));
  1153. _st(self)._assert_(_st("hello").__eq(_st("hello")._yourself()));
  1154. _st(self)._assert_(_st(_st("hello")._yourself()).__eq("hello"));
  1155. _st(self)._deny_(_st("").__eq((0)));
  1156. return self}, self, "testEquality", [], smalltalk.StringTest)}
  1157. }),
  1158. smalltalk.StringTest);
  1159. smalltalk.addMethod(
  1160. "_testIdentity",
  1161. smalltalk.method({
  1162. selector: "testIdentity",
  1163. fn: function (){
  1164. var self=this;
  1165. return smalltalk.withContext(function($ctx) { _st(self)._assert_(_st("hello").__eq_eq("hello"));
  1166. _st(self)._deny_(_st("hello").__eq_eq("world"));
  1167. _st(self)._assert_(_st("hello").__eq_eq(_st("hello")._yourself()));
  1168. _st(self)._assert_(_st(_st("hello")._yourself()).__eq_eq("hello"));
  1169. _st(self)._deny_(_st("").__eq_eq((0)));
  1170. return self}, self, "testIdentity", [], smalltalk.StringTest)}
  1171. }),
  1172. smalltalk.StringTest);
  1173. smalltalk.addMethod(
  1174. "_testIncludesSubString",
  1175. smalltalk.method({
  1176. selector: "testIncludesSubString",
  1177. fn: function (){
  1178. var self=this;
  1179. return smalltalk.withContext(function($ctx) { _st(self)._assert_(_st("amber")._includesSubString_("ber"));
  1180. _st(self)._deny_(_st("amber")._includesSubString_("zork"));
  1181. return self}, self, "testIncludesSubString", [], smalltalk.StringTest)}
  1182. }),
  1183. smalltalk.StringTest);
  1184. smalltalk.addMethod(
  1185. "_testJoin",
  1186. smalltalk.method({
  1187. selector: "testJoin",
  1188. fn: function (){
  1189. var self=this;
  1190. return smalltalk.withContext(function($ctx) { _st(self)._assert_equals_("hello,world",_st(",")._join_(["hello", "world"]));
  1191. return self}, self, "testJoin", [], smalltalk.StringTest)}
  1192. }),
  1193. smalltalk.StringTest);
  1194. smalltalk.addMethod(
  1195. "_testSelect",
  1196. smalltalk.method({
  1197. selector: "testSelect",
  1198. fn: function (){
  1199. var self=this;
  1200. return smalltalk.withContext(function($ctx) { var newCollection;
  1201. newCollection="o";
  1202. _st(self)._assertSameContents_as_(_st(_st(self)._collection())._select_((function(each){
  1203. return _st(each).__eq("o");
  1204. })),newCollection);
  1205. return self}, self, "testSelect", [], smalltalk.StringTest)}
  1206. }),
  1207. smalltalk.StringTest);
  1208. smalltalk.addMethod(
  1209. "_testSize",
  1210. smalltalk.method({
  1211. selector: "testSize",
  1212. fn: function (){
  1213. var self=this;
  1214. return smalltalk.withContext(function($ctx) { _st(self)._assert_equals_(_st("smalltalk")._size(),(9));
  1215. _st(self)._assert_equals_(_st("")._size(),(0));
  1216. return self}, self, "testSize", [], smalltalk.StringTest)}
  1217. }),
  1218. smalltalk.StringTest);
  1219. smalltalk.addMethod(
  1220. "_testStreamContents",
  1221. smalltalk.method({
  1222. selector: "testStreamContents",
  1223. fn: function (){
  1224. var self=this;
  1225. return smalltalk.withContext(function($ctx) { var $1;
  1226. _st(self)._assert_equals_("hello world",_st((smalltalk.String || String))._streamContents_((function(aStream){
  1227. _st(aStream)._nextPutAll_("hello");
  1228. _st(aStream)._space();
  1229. $1=_st(aStream)._nextPutAll_("world");
  1230. return $1;
  1231. })));
  1232. return self}, self, "testStreamContents", [], smalltalk.StringTest)}
  1233. }),
  1234. smalltalk.StringTest);
  1235. smalltalk.addMethod(
  1236. "_collectionClass",
  1237. smalltalk.method({
  1238. selector: "collectionClass",
  1239. fn: function (){
  1240. var self=this;
  1241. return smalltalk.withContext(function($ctx) { return (smalltalk.String || String);
  1242. }, self, "collectionClass", [], smalltalk.StringTest.klass)}
  1243. }),
  1244. smalltalk.StringTest.klass);
  1245. smalltalk.addClass('SymbolTest', smalltalk.SequenceableCollectionTest, [], 'Kernel-Tests');
  1246. smalltalk.addMethod(
  1247. "_collection",
  1248. smalltalk.method({
  1249. selector: "collection",
  1250. fn: function (){
  1251. var self=this;
  1252. return smalltalk.withContext(function($ctx) { return smalltalk.symbolFor("hello");
  1253. }, self, "collection", [], smalltalk.SymbolTest)}
  1254. }),
  1255. smalltalk.SymbolTest);
  1256. smalltalk.addMethod(
  1257. "_collectionWithDuplicates",
  1258. smalltalk.method({
  1259. selector: "collectionWithDuplicates",
  1260. fn: function (){
  1261. var self=this;
  1262. return smalltalk.withContext(function($ctx) { return smalltalk.symbolFor("phhaaarorra");
  1263. }, self, "collectionWithDuplicates", [], smalltalk.SymbolTest)}
  1264. }),
  1265. smalltalk.SymbolTest);
  1266. smalltalk.addMethod(
  1267. "_testAsString",
  1268. smalltalk.method({
  1269. selector: "testAsString",
  1270. fn: function (){
  1271. var self=this;
  1272. return smalltalk.withContext(function($ctx) { _st(self)._assert_equals_(_st(smalltalk.symbolFor("hello"))._asString(),"hello");
  1273. return self}, self, "testAsString", [], smalltalk.SymbolTest)}
  1274. }),
  1275. smalltalk.SymbolTest);
  1276. smalltalk.addMethod(
  1277. "_testAsSymbol",
  1278. smalltalk.method({
  1279. selector: "testAsSymbol",
  1280. fn: function (){
  1281. var self=this;
  1282. return smalltalk.withContext(function($ctx) { _st(self)._assert_(_st(smalltalk.symbolFor("hello")).__eq_eq(_st(smalltalk.symbolFor("hello"))._asSymbol()));
  1283. return self}, self, "testAsSymbol", [], smalltalk.SymbolTest)}
  1284. }),
  1285. smalltalk.SymbolTest);
  1286. smalltalk.addMethod(
  1287. "_testAt",
  1288. smalltalk.method({
  1289. selector: "testAt",
  1290. fn: function (){
  1291. var self=this;
  1292. return smalltalk.withContext(function($ctx) { _st(self)._assert_(_st(_st(smalltalk.symbolFor("hello"))._at_((1))).__eq("h"));
  1293. _st(self)._assert_(_st(_st(smalltalk.symbolFor("hello"))._at_((5))).__eq("o"));
  1294. _st(self)._assert_(_st(_st(smalltalk.symbolFor("hello"))._at_ifAbsent_((6),(function(){
  1295. return nil;
  1296. }))).__eq(nil));
  1297. return self}, self, "testAt", [], smalltalk.SymbolTest)}
  1298. }),
  1299. smalltalk.SymbolTest);
  1300. smalltalk.addMethod(
  1301. "_testAtPut",
  1302. smalltalk.method({
  1303. selector: "testAtPut",
  1304. fn: function (){
  1305. var self=this;
  1306. return smalltalk.withContext(function($ctx) { _st(self)._should_raise_((function(){
  1307. return _st("hello")._at_put_((1),"a");
  1308. }),(smalltalk.Error || Error));
  1309. return self}, self, "testAtPut", [], smalltalk.SymbolTest)}
  1310. }),
  1311. smalltalk.SymbolTest);
  1312. smalltalk.addMethod(
  1313. "_testCollect",
  1314. smalltalk.method({
  1315. selector: "testCollect",
  1316. fn: function (){
  1317. var self=this;
  1318. return smalltalk.withContext(function($ctx) { var newCollection;
  1319. newCollection=smalltalk.symbolFor("hheelllloo");
  1320. _st(self)._assertSameContents_as_(_st(_st(self)._collection())._collect_((function(each){
  1321. return _st(each).__comma(each);
  1322. })),newCollection);
  1323. return self}, self, "testCollect", [], smalltalk.SymbolTest)}
  1324. }),
  1325. smalltalk.SymbolTest);
  1326. smalltalk.addMethod(
  1327. "_testComparing",
  1328. smalltalk.method({
  1329. selector: "testComparing",
  1330. fn: function (){
  1331. var self=this;
  1332. return smalltalk.withContext(function($ctx) { _st(self)._assert_(_st(smalltalk.symbolFor("ab")).__gt(smalltalk.symbolFor("aa")));
  1333. _st(self)._deny_(_st(smalltalk.symbolFor("ab")).__gt(smalltalk.symbolFor("ba")));
  1334. _st(self)._assert_(_st(smalltalk.symbolFor("ab")).__lt(smalltalk.symbolFor("ba")));
  1335. _st(self)._deny_(_st(smalltalk.symbolFor("bb")).__lt(smalltalk.symbolFor("ba")));
  1336. _st(self)._assert_(_st(smalltalk.symbolFor("ab")).__gt_eq(smalltalk.symbolFor("aa")));
  1337. _st(self)._deny_(_st(smalltalk.symbolFor("ab")).__gt_eq(smalltalk.symbolFor("ba")));
  1338. _st(self)._assert_(_st(smalltalk.symbolFor("ab")).__lt_eq(smalltalk.symbolFor("ba")));
  1339. _st(self)._deny_(_st(smalltalk.symbolFor("bb")).__lt_eq(smalltalk.symbolFor("ba")));
  1340. return self}, self, "testComparing", [], smalltalk.SymbolTest)}
  1341. }),
  1342. smalltalk.SymbolTest);
  1343. smalltalk.addMethod(
  1344. "_testCopying",
  1345. smalltalk.method({
  1346. selector: "testCopying",
  1347. fn: function (){
  1348. var self=this;
  1349. return smalltalk.withContext(function($ctx) { _st(self)._assert_(_st(_st(smalltalk.symbolFor("hello"))._copy()).__eq_eq(smalltalk.symbolFor("hello")));
  1350. _st(self)._assert_(_st(_st(smalltalk.symbolFor("hello"))._deepCopy()).__eq_eq(smalltalk.symbolFor("hello")));
  1351. return self}, self, "testCopying", [], smalltalk.SymbolTest)}
  1352. }),
  1353. smalltalk.SymbolTest);
  1354. smalltalk.addMethod(
  1355. "_testDetect",
  1356. smalltalk.method({
  1357. selector: "testDetect",
  1358. fn: function (){
  1359. var self=this;
  1360. return smalltalk.withContext(function($ctx) { _st(self)._assert_(_st(_st(_st(self)._collection())._detect_((function(each){
  1361. return _st(each).__eq("h");
  1362. }))).__eq("h"));
  1363. _st(self)._should_raise_((function(){
  1364. return _st(_st(self)._collection())._detect_((function(each){
  1365. return _st(each).__eq("z");
  1366. }));
  1367. }),(smalltalk.Error || Error));
  1368. return self}, self, "testDetect", [], smalltalk.SymbolTest)}
  1369. }),
  1370. smalltalk.SymbolTest);
  1371. smalltalk.addMethod(
  1372. "_testEquality",
  1373. smalltalk.method({
  1374. selector: "testEquality",
  1375. fn: function (){
  1376. var self=this;
  1377. return smalltalk.withContext(function($ctx) { _st(self)._assert_(_st(smalltalk.symbolFor("hello")).__eq(smalltalk.symbolFor("hello")));
  1378. _st(self)._deny_(_st(smalltalk.symbolFor("hello")).__eq(smalltalk.symbolFor("world")));
  1379. _st(self)._assert_(_st(smalltalk.symbolFor("hello")).__eq(_st(smalltalk.symbolFor("hello"))._yourself()));
  1380. _st(self)._assert_(_st(_st(smalltalk.symbolFor("hello"))._yourself()).__eq(smalltalk.symbolFor("hello")));
  1381. _st(self)._deny_(_st(smalltalk.symbolFor("hello")).__eq("hello"));
  1382. _st(self)._deny_(_st("hello").__eq(smalltalk.symbolFor("hello")));
  1383. return self}, self, "testEquality", [], smalltalk.SymbolTest)}
  1384. }),
  1385. smalltalk.SymbolTest);
  1386. smalltalk.addMethod(
  1387. "_testIdentity",
  1388. smalltalk.method({
  1389. selector: "testIdentity",
  1390. fn: function (){
  1391. var self=this;
  1392. return smalltalk.withContext(function($ctx) { _st(self)._assert_(_st(smalltalk.symbolFor("hello")).__eq_eq(smalltalk.symbolFor("hello")));
  1393. _st(self)._deny_(_st(smalltalk.symbolFor("hello")).__eq_eq(smalltalk.symbolFor("world")));
  1394. _st(self)._assert_(_st(smalltalk.symbolFor("hello")).__eq(_st(smalltalk.symbolFor("hello"))._yourself()));
  1395. _st(self)._assert_(_st(_st(smalltalk.symbolFor("hello"))._yourself()).__eq(_st(_st(smalltalk.symbolFor("hello"))._asString())._asSymbol()));
  1396. return self}, self, "testIdentity", [], smalltalk.SymbolTest)}
  1397. }),
  1398. smalltalk.SymbolTest);
  1399. smalltalk.addMethod(
  1400. "_testIsEmpty",
  1401. smalltalk.method({
  1402. selector: "testIsEmpty",
  1403. fn: function (){
  1404. var self=this;
  1405. return smalltalk.withContext(function($ctx) { _st(self)._deny_(_st(_st(self)._collection())._isEmpty());
  1406. _st(self)._assert_(_st(_st("")._asSymbol())._isEmpty());
  1407. return self}, self, "testIsEmpty", [], smalltalk.SymbolTest)}
  1408. }),
  1409. smalltalk.SymbolTest);
  1410. smalltalk.addMethod(
  1411. "_testIsSymbolIsString",
  1412. smalltalk.method({
  1413. selector: "testIsSymbolIsString",
  1414. fn: function (){
  1415. var self=this;
  1416. return smalltalk.withContext(function($ctx) { _st(self)._assert_(_st(smalltalk.symbolFor("hello"))._isSymbol());
  1417. _st(self)._deny_(_st("hello")._isSymbol());
  1418. _st(self)._deny_(_st(smalltalk.symbolFor("hello"))._isString());
  1419. _st(self)._assert_(_st("hello")._isString());
  1420. return self}, self, "testIsSymbolIsString", [], smalltalk.SymbolTest)}
  1421. }),
  1422. smalltalk.SymbolTest);
  1423. smalltalk.addMethod(
  1424. "_testSelect",
  1425. smalltalk.method({
  1426. selector: "testSelect",
  1427. fn: function (){
  1428. var self=this;
  1429. return smalltalk.withContext(function($ctx) { var newCollection;
  1430. newCollection="o";
  1431. _st(self)._assertSameContents_as_(_st(_st(self)._collection())._select_((function(each){
  1432. return _st(each).__eq("o");
  1433. })),newCollection);
  1434. return self}, self, "testSelect", [], smalltalk.SymbolTest)}
  1435. }),
  1436. smalltalk.SymbolTest);
  1437. smalltalk.addMethod(
  1438. "_testSize",
  1439. smalltalk.method({
  1440. selector: "testSize",
  1441. fn: function (){
  1442. var self=this;
  1443. return smalltalk.withContext(function($ctx) { _st(self)._assert_equals_(_st(smalltalk.symbolFor("a"))._size(),(1));
  1444. _st(self)._assert_equals_(_st(smalltalk.symbolFor("aaaaa"))._size(),(5));
  1445. return self}, self, "testSize", [], smalltalk.SymbolTest)}
  1446. }),
  1447. smalltalk.SymbolTest);
  1448. smalltalk.addMethod(
  1449. "_collectionClass",
  1450. smalltalk.method({
  1451. selector: "collectionClass",
  1452. fn: function (){
  1453. var self=this;
  1454. return smalltalk.withContext(function($ctx) { return (smalltalk.Symbol || Symbol);
  1455. }, self, "collectionClass", [], smalltalk.SymbolTest.klass)}
  1456. }),
  1457. smalltalk.SymbolTest.klass);
  1458. smalltalk.addClass('JSObjectProxyTest', smalltalk.TestCase, [], 'Kernel-Tests');
  1459. smalltalk.addMethod(
  1460. "_jsObject",
  1461. smalltalk.method({
  1462. selector: "jsObject",
  1463. fn: function (){
  1464. var self=this;
  1465. return smalltalk.withContext(function($ctx) { return jsObject = {a: 1, b: function() {return 2;}, c: function(object) {return object;}, d: ''};
  1466. ;
  1467. return self}, self, "jsObject", [], smalltalk.JSObjectProxyTest)}
  1468. }),
  1469. smalltalk.JSObjectProxyTest);
  1470. smalltalk.addMethod(
  1471. "_testDNU",
  1472. smalltalk.method({
  1473. selector: "testDNU",
  1474. fn: function (){
  1475. var self=this;
  1476. return smalltalk.withContext(function($ctx) { _st(self)._should_raise_((function(){
  1477. return _st(_st(self)._jsObject())._foo();
  1478. }),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1479. return self}, self, "testDNU", [], smalltalk.JSObjectProxyTest)}
  1480. }),
  1481. smalltalk.JSObjectProxyTest);
  1482. smalltalk.addMethod(
  1483. "_testMessageSend",
  1484. smalltalk.method({
  1485. selector: "testMessageSend",
  1486. fn: function (){
  1487. var self=this;
  1488. return smalltalk.withContext(function($ctx) { _st(self)._assert_equals_(_st(_st(self)._jsObject())._a(),(1));
  1489. _st(self)._assert_equals_(_st(_st(self)._jsObject())._b(),(2));
  1490. _st(self)._assert_equals_(_st(_st(self)._jsObject())._c_((3)),(3));
  1491. return self}, self, "testMessageSend", [], smalltalk.JSObjectProxyTest)}
  1492. }),
  1493. smalltalk.JSObjectProxyTest);
  1494. smalltalk.addMethod(
  1495. "_testMethodWithArguments",
  1496. smalltalk.method({
  1497. selector: "testMethodWithArguments",
  1498. fn: function (){
  1499. var self=this;
  1500. return smalltalk.withContext(function($ctx) { _st(self)._assert_equals_(_st(_st(self)._jsObject())._c_((1)),(1));
  1501. return self}, self, "testMethodWithArguments", [], smalltalk.JSObjectProxyTest)}
  1502. }),
  1503. smalltalk.JSObjectProxyTest);
  1504. smalltalk.addMethod(
  1505. "_testPrinting",
  1506. smalltalk.method({
  1507. selector: "testPrinting",
  1508. fn: function (){
  1509. var self=this;
  1510. return smalltalk.withContext(function($ctx) { _st(self)._assert_(_st(_st(_st(self)._jsObject())._printString()).__eq("[object Object]"));
  1511. return self}, self, "testPrinting", [], smalltalk.JSObjectProxyTest)}
  1512. }),
  1513. smalltalk.JSObjectProxyTest);
  1514. smalltalk.addMethod(
  1515. "_testPropertyThatReturnsEmptyString",
  1516. smalltalk.method({
  1517. selector: "testPropertyThatReturnsEmptyString",
  1518. fn: function (){
  1519. var self=this;
  1520. return smalltalk.withContext(function($ctx) { var object;
  1521. object=_st(self)._jsObject();
  1522. _st(self)._assert_equals_("",_st(object)._d());
  1523. _st(object)._d_("hello");
  1524. _st(self)._assert_equals_("hello",_st(object)._d());
  1525. return self}, self, "testPropertyThatReturnsEmptyString", [], smalltalk.JSObjectProxyTest)}
  1526. }),
  1527. smalltalk.JSObjectProxyTest);
  1528. smalltalk.addMethod(
  1529. "_testYourself",
  1530. smalltalk.method({
  1531. selector: "testYourself",
  1532. fn: function (){
  1533. var self=this;
  1534. return smalltalk.withContext(function($ctx) { var $1,$2;
  1535. var object;
  1536. $1=_st(self)._jsObject();
  1537. _st($1)._d_("test");
  1538. $2=_st($1)._yourself();
  1539. object=$2;
  1540. _st(self)._assert_equals_(_st(object)._d(),"test");
  1541. return self}, self, "testYourself", [], smalltalk.JSObjectProxyTest)}
  1542. }),
  1543. smalltalk.JSObjectProxyTest);
  1544. smalltalk.addClass('NumberTest', smalltalk.TestCase, [], 'Kernel-Tests');
  1545. smalltalk.addMethod(
  1546. "_testAbs",
  1547. smalltalk.method({
  1548. selector: "testAbs",
  1549. fn: function (){
  1550. var self=this;
  1551. return smalltalk.withContext(function($ctx) { _st(self)._assert_(_st(_st((4))._abs()).__eq((4)));
  1552. _st(self)._assert_(_st(_st((-4))._abs()).__eq((4)));
  1553. return self}, self, "testAbs", [], smalltalk.NumberTest)}
  1554. }),
  1555. smalltalk.NumberTest);
  1556. smalltalk.addMethod(
  1557. "_testArithmetic",
  1558. smalltalk.method({
  1559. selector: "testArithmetic",
  1560. fn: function (){
  1561. var self=this;
  1562. return smalltalk.withContext(function($ctx) { _st(self)._assert_(_st(_st((1.5)).__plus((1))).__eq((2.5)));
  1563. _st(self)._assert_(_st(_st((2)).__minus((1))).__eq((1)));
  1564. _st(self)._assert_(_st(_st((-2)).__minus((1))).__eq((-3)));
  1565. _st(self)._assert_(_st(_st((12)).__slash((2))).__eq((6)));
  1566. _st(self)._assert_(_st(_st((3)).__star((4))).__eq((12)));
  1567. _st(self)._assert_(_st(_st(_st((1)).__plus((2))).__star((3))).__eq((9)));
  1568. _st(self)._assert_(_st(_st((1)).__plus(_st((2)).__star((3)))).__eq((7)));
  1569. return self}, self, "testArithmetic", [], smalltalk.NumberTest)}
  1570. }),
  1571. smalltalk.NumberTest);
  1572. smalltalk.addMethod(
  1573. "_testComparison",
  1574. smalltalk.method({
  1575. selector: "testComparison",
  1576. fn: function (){
  1577. var self=this;
  1578. return smalltalk.withContext(function($ctx) { _st(self)._assert_(_st((3)).__gt((2)));
  1579. _st(self)._assert_(_st((2)).__lt((3)));
  1580. _st(self)._deny_(_st((3)).__lt((2)));
  1581. _st(self)._deny_(_st((2)).__gt((3)));
  1582. _st(self)._assert_(_st((3)).__gt_eq((3)));
  1583. _st(self)._assert_(_st((3.1)).__gt_eq((3)));
  1584. _st(self)._assert_(_st((3)).__lt_eq((3)));
  1585. _st(self)._assert_(_st((3)).__lt_eq((3.1)));
  1586. return self}, self, "testComparison", [], smalltalk.NumberTest)}
  1587. }),
  1588. smalltalk.NumberTest);
  1589. smalltalk.addMethod(
  1590. "_testCopying",
  1591. smalltalk.method({
  1592. selector: "testCopying",
  1593. fn: function (){
  1594. var self=this;
  1595. return smalltalk.withContext(function($ctx) { _st(self)._assert_(_st(_st((1))._copy()).__eq_eq((1)));
  1596. _st(self)._assert_(_st(_st((1))._deepCopy()).__eq_eq((1)));
  1597. return self}, self, "testCopying", [], smalltalk.NumberTest)}
  1598. }),
  1599. smalltalk.NumberTest);
  1600. smalltalk.addMethod(
  1601. "_testEquality",
  1602. smalltalk.method({
  1603. selector: "testEquality",
  1604. fn: function (){
  1605. var self=this;
  1606. return smalltalk.withContext(function($ctx) { _st(self)._assert_(_st((1)).__eq((1)));
  1607. _st(self)._assert_(_st((0)).__eq((0)));
  1608. _st(self)._deny_(_st((1)).__eq((0)));
  1609. _st(self)._assert_(_st(_st((1))._yourself()).__eq((1)));
  1610. _st(self)._assert_(_st((1)).__eq(_st((1))._yourself()));
  1611. _st(self)._assert_(_st(_st((1))._yourself()).__eq(_st((1))._yourself()));
  1612. _st(self)._deny_(_st((0)).__eq(false));
  1613. _st(self)._deny_(_st(false).__eq((0)));
  1614. _st(self)._deny_(_st("").__eq((0)));
  1615. _st(self)._deny_(_st((0)).__eq(""));
  1616. return self}, self, "testEquality", [], smalltalk.NumberTest)}
  1617. }),
  1618. smalltalk.NumberTest);
  1619. smalltalk.addMethod(
  1620. "_testIdentity",
  1621. smalltalk.method({
  1622. selector: "testIdentity",
  1623. fn: function (){
  1624. var self=this;
  1625. return smalltalk.withContext(function($ctx) { _st(self)._assert_(_st((1)).__eq_eq((1)));
  1626. _st(self)._assert_(_st((0)).__eq_eq((0)));
  1627. _st(self)._deny_(_st((1)).__eq_eq((0)));
  1628. _st(self)._assert_(_st(_st((1))._yourself()).__eq_eq((1)));
  1629. _st(self)._assert_(_st((1)).__eq_eq(_st((1))._yourself()));
  1630. _st(self)._assert_(_st(_st((1))._yourself()).__eq_eq(_st((1))._yourself()));
  1631. _st(self)._deny_(_st((1)).__eq_eq((2)));
  1632. return self}, self, "testIdentity", [], smalltalk.NumberTest)}
  1633. }),
  1634. smalltalk.NumberTest);
  1635. smalltalk.addMethod(
  1636. "_testMinMax",
  1637. smalltalk.method({
  1638. selector: "testMinMax",
  1639. fn: function (){
  1640. var self=this;
  1641. return smalltalk.withContext(function($ctx) { _st(self)._assert_equals_(_st((2))._max_((5)),(5));
  1642. _st(self)._assert_equals_(_st((2))._min_((5)),(2));
  1643. return self}, self, "testMinMax", [], smalltalk.NumberTest)}
  1644. }),
  1645. smalltalk.NumberTest);
  1646. smalltalk.addMethod(
  1647. "_testNegated",
  1648. smalltalk.method({
  1649. selector: "testNegated",
  1650. fn: function (){
  1651. var self=this;
  1652. return smalltalk.withContext(function($ctx) { _st(self)._assert_(_st(_st((3))._negated()).__eq((-3)));
  1653. _st(self)._assert_(_st(_st((-3))._negated()).__eq((3)));
  1654. return self}, self, "testNegated", [], smalltalk.NumberTest)}
  1655. }),
  1656. smalltalk.NumberTest);
  1657. smalltalk.addMethod(
  1658. "_testPrintShowingDecimalPlaces",
  1659. smalltalk.method({
  1660. selector: "testPrintShowingDecimalPlaces",
  1661. fn: function (){
  1662. var self=this;
  1663. return smalltalk.withContext(function($ctx) { _st(self)._assert_equals_("23.00",_st((23))._printShowingDecimalPlaces_((2)));
  1664. _st(self)._assert_equals_("23.57",_st((23.5698))._printShowingDecimalPlaces_((2)));
  1665. _st(self)._assert_equals_("-234.56700",_st(_st((234.567))._negated())._printShowingDecimalPlaces_((5)));
  1666. _st(self)._assert_equals_("23",_st((23.4567))._printShowingDecimalPlaces_((0)));
  1667. _st(self)._assert_equals_("24",_st((23.5567))._printShowingDecimalPlaces_((0)));
  1668. _st(self)._assert_equals_("-23",_st(_st((23.4567))._negated())._printShowingDecimalPlaces_((0)));
  1669. _st(self)._assert_equals_("-24",_st(_st((23.5567))._negated())._printShowingDecimalPlaces_((0)));
  1670. _st(self)._assert_equals_("100000000.0",_st((100000000))._printShowingDecimalPlaces_((1)));
  1671. _st(self)._assert_equals_("0.98000",_st((0.98))._printShowingDecimalPlaces_((5)));
  1672. _st(self)._assert_equals_("-0.98",_st(_st((0.98))._negated())._printShowingDecimalPlaces_((2)));
  1673. _st(self)._assert_equals_("2.57",_st((2.567))._printShowingDecimalPlaces_((2)));
  1674. _st(self)._assert_equals_("-2.57",_st((-2.567))._printShowingDecimalPlaces_((2)));
  1675. _st(self)._assert_equals_("0.00",_st((0))._printShowingDecimalPlaces_((2)));
  1676. return self}, self, "testPrintShowingDecimalPlaces", [], smalltalk.NumberTest)}
  1677. }),
  1678. smalltalk.NumberTest);
  1679. smalltalk.addMethod(
  1680. "_testRounded",
  1681. smalltalk.method({
  1682. selector: "testRounded",
  1683. fn: function (){
  1684. var self=this;
  1685. return smalltalk.withContext(function($ctx) { _st(self)._assert_(_st(_st((3))._rounded()).__eq((3)));
  1686. _st(self)._assert_(_st(_st((3.212))._rounded()).__eq((3)));
  1687. _st(self)._assert_(_st(_st((3.51))._rounded()).__eq((4)));
  1688. return self}, self, "testRounded", [], smalltalk.NumberTest)}
  1689. }),
  1690. smalltalk.NumberTest);
  1691. smalltalk.addMethod(
  1692. "_testSqrt",
  1693. smalltalk.method({
  1694. selector: "testSqrt",
  1695. fn: function (){
  1696. var self=this;
  1697. return smalltalk.withContext(function($ctx) { _st(self)._assert_(_st(_st((4))._sqrt()).__eq((2)));
  1698. _st(self)._assert_(_st(_st((16))._sqrt()).__eq((4)));
  1699. return self}, self, "testSqrt", [], smalltalk.NumberTest)}
  1700. }),
  1701. smalltalk.NumberTest);
  1702. smalltalk.addMethod(
  1703. "_testSquared",
  1704. smalltalk.method({
  1705. selector: "testSquared",
  1706. fn: function (){
  1707. var self=this;
  1708. return smalltalk.withContext(function($ctx) { _st(self)._assert_(_st(_st((4))._squared()).__eq((16)));
  1709. return self}, self, "testSquared", [], smalltalk.NumberTest)}
  1710. }),
  1711. smalltalk.NumberTest);
  1712. smalltalk.addMethod(
  1713. "_testTimesRepeat",
  1714. smalltalk.method({
  1715. selector: "testTimesRepeat",
  1716. fn: function (){
  1717. var self=this;
  1718. return smalltalk.withContext(function($ctx) { var i;
  1719. i=(0);
  1720. _st((0))._timesRepeat_((function(){
  1721. i=_st(i).__plus((1));
  1722. return i;
  1723. }));
  1724. _st(self)._assert_equals_(i,(0));
  1725. _st((5))._timesRepeat_((function(){
  1726. i=_st(i).__plus((1));
  1727. return i;
  1728. }));
  1729. _st(self)._assert_equals_(i,(5));
  1730. return self}, self, "testTimesRepeat", [], smalltalk.NumberTest)}
  1731. }),
  1732. smalltalk.NumberTest);
  1733. smalltalk.addMethod(
  1734. "_testTo",
  1735. smalltalk.method({
  1736. selector: "testTo",
  1737. fn: function (){
  1738. var self=this;
  1739. return smalltalk.withContext(function($ctx) { _st(self)._assert_equals_(_st((1))._to_((5)),[(1), (2), (3), (4), (5)]);
  1740. return self}, self, "testTo", [], smalltalk.NumberTest)}
  1741. }),
  1742. smalltalk.NumberTest);
  1743. smalltalk.addMethod(
  1744. "_testToBy",
  1745. smalltalk.method({
  1746. selector: "testToBy",
  1747. fn: function (){
  1748. var self=this;
  1749. return smalltalk.withContext(function($ctx) { _st(self)._assert_equals_(_st((0))._to_by_((6),(2)),[(0), (2), (4), (6)]);
  1750. _st(self)._should_raise_((function(){
  1751. return _st((1))._to_by_((4),(0));
  1752. }),(smalltalk.Error || Error));
  1753. return self}, self, "testToBy", [], smalltalk.NumberTest)}
  1754. }),
  1755. smalltalk.NumberTest);
  1756. smalltalk.addMethod(
  1757. "_testTruncated",
  1758. smalltalk.method({
  1759. selector: "testTruncated",
  1760. fn: function (){
  1761. var self=this;
  1762. return smalltalk.withContext(function($ctx) { _st(self)._assert_(_st(_st((3))._truncated()).__eq((3)));
  1763. _st(self)._assert_(_st(_st((3.212))._truncated()).__eq((3)));
  1764. _st(self)._assert_(_st(_st((3.51))._truncated()).__eq((3)));
  1765. return self}, self, "testTruncated", [], smalltalk.NumberTest)}
  1766. }),
  1767. smalltalk.NumberTest);
  1768. smalltalk.addClass('ObjectMock', smalltalk.Object, ['foo', 'bar'], 'Kernel-Tests');
  1769. smalltalk.addMethod(
  1770. "_foo",
  1771. smalltalk.method({
  1772. selector: "foo",
  1773. fn: function (){
  1774. var self=this;
  1775. return smalltalk.withContext(function($ctx) { return self["@foo"];
  1776. }, self, "foo", [], smalltalk.ObjectMock)}
  1777. }),
  1778. smalltalk.ObjectMock);
  1779. smalltalk.addMethod(
  1780. "_foo_",
  1781. smalltalk.method({
  1782. selector: "foo:",
  1783. fn: function (anObject){
  1784. var self=this;
  1785. return smalltalk.withContext(function($ctx) { self["@foo"]=anObject;
  1786. return self}, self, "foo:", [anObject], smalltalk.ObjectMock)}
  1787. }),
  1788. smalltalk.ObjectMock);
  1789. smalltalk.addClass('ObjectTest', smalltalk.TestCase, [], 'Kernel-Tests');
  1790. smalltalk.addMethod(
  1791. "_testBasicAccess",
  1792. smalltalk.method({
  1793. selector: "testBasicAccess",
  1794. fn: function (){
  1795. var self=this;
  1796. return smalltalk.withContext(function($ctx) { var o;
  1797. o=_st((smalltalk.Object || Object))._new();
  1798. _st(o)._basicAt_put_("a",(1));
  1799. _st(self)._assert_equals_(_st(o)._basicAt_("a"),(1));
  1800. _st(self)._assert_equals_(_st(o)._basicAt_("b"),nil);
  1801. return self}, self, "testBasicAccess", [], smalltalk.ObjectTest)}
  1802. }),
  1803. smalltalk.ObjectTest);
  1804. smalltalk.addMethod(
  1805. "_testBasicPerform",
  1806. smalltalk.method({
  1807. selector: "testBasicPerform",
  1808. fn: function (){
  1809. var self=this;
  1810. return smalltalk.withContext(function($ctx) { var o;
  1811. o=_st((smalltalk.Object || Object))._new();
  1812. _st(o)._basicAt_put_("func",(function(){
  1813. return "hello";
  1814. }));
  1815. _st(o)._basicAt_put_("func2",(function(a){
  1816. return _st(a).__plus((1));
  1817. }));
  1818. _st(self)._assert_equals_(_st(o)._basicPerform_("func"),"hello");
  1819. _st(self)._assert_equals_(_st(o)._basicPerform_withArguments_("func2",[(3)]),(4));
  1820. return self}, self, "testBasicPerform", [], smalltalk.ObjectTest)}
  1821. }),
  1822. smalltalk.ObjectTest);
  1823. smalltalk.addMethod(
  1824. "_testDNU",
  1825. smalltalk.method({
  1826. selector: "testDNU",
  1827. fn: function (){
  1828. var self=this;
  1829. return smalltalk.withContext(function($ctx) { _st(self)._should_raise_((function(){
  1830. return _st(_st((smalltalk.Object || Object))._new())._foo();
  1831. }),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1832. return self}, self, "testDNU", [], smalltalk.ObjectTest)}
  1833. }),
  1834. smalltalk.ObjectTest);
  1835. smalltalk.addMethod(
  1836. "_testEquality",
  1837. smalltalk.method({
  1838. selector: "testEquality",
  1839. fn: function (){
  1840. var self=this;
  1841. return smalltalk.withContext(function($ctx) { var o;
  1842. o=_st((smalltalk.Object || Object))._new();
  1843. _st(self)._deny_(_st(o).__eq(_st((smalltalk.Object || Object))._new()));
  1844. _st(self)._assert_(_st(o).__eq(o));
  1845. _st(self)._assert_(_st(_st(o)._yourself()).__eq(o));
  1846. _st(self)._assert_(_st(o).__eq(_st(o)._yourself()));
  1847. return self}, self, "testEquality", [], smalltalk.ObjectTest)}
  1848. }),
  1849. smalltalk.ObjectTest);
  1850. smalltalk.addMethod(
  1851. "_testHalt",
  1852. smalltalk.method({
  1853. selector: "testHalt",
  1854. fn: function (){
  1855. var self=this;
  1856. return smalltalk.withContext(function($ctx) { _st(self)._should_raise_((function(){
  1857. return _st(_st((smalltalk.Object || Object))._new())._halt();
  1858. }),(smalltalk.Error || Error));
  1859. return self}, self, "testHalt", [], smalltalk.ObjectTest)}
  1860. }),
  1861. smalltalk.ObjectTest);
  1862. smalltalk.addMethod(
  1863. "_testIdentity",
  1864. smalltalk.method({
  1865. selector: "testIdentity",
  1866. fn: function (){
  1867. var self=this;
  1868. return smalltalk.withContext(function($ctx) { var o;
  1869. o=_st((smalltalk.Object || Object))._new();
  1870. _st(self)._deny_(_st(o).__eq_eq(_st((smalltalk.Object || Object))._new()));
  1871. _st(self)._assert_(_st(o).__eq_eq(o));
  1872. _st(self)._assert_(_st(_st(o)._yourself()).__eq_eq(o));
  1873. _st(self)._assert_(_st(o).__eq_eq(_st(o)._yourself()));
  1874. return self}, self, "testIdentity", [], smalltalk.ObjectTest)}
  1875. }),
  1876. smalltalk.ObjectTest);
  1877. smalltalk.addMethod(
  1878. "_testIfNil",
  1879. smalltalk.method({
  1880. selector: "testIfNil",
  1881. fn: function (){
  1882. var self=this;
  1883. return smalltalk.withContext(function($ctx) { var $2,$1,$4,$3,$6,$5;
  1884. _st(self)._deny_(_st(_st((smalltalk.Object || Object))._new())._isNil());
  1885. $2=_st((smalltalk.Object || Object))._new();
  1886. if(($receiver = $2) == nil || $receiver == undefined){
  1887. $1=true;
  1888. } else {
  1889. $1=$2;
  1890. };
  1891. _st(self)._deny_(_st($1).__eq(true));
  1892. $4=_st((smalltalk.Object || Object))._new();
  1893. if(($receiver = $4) == nil || $receiver == undefined){
  1894. $3=$4;
  1895. } else {
  1896. $3=true;
  1897. };
  1898. _st(self)._assert_(_st($3).__eq(true));
  1899. $6=_st((smalltalk.Object || Object))._new();
  1900. if(($receiver = $6) == nil || $receiver == undefined){
  1901. $5=false;
  1902. } else {
  1903. $5=true;
  1904. };
  1905. _st(self)._assert_(_st($5).__eq(true));
  1906. _st(self)._assert_(_st(_st(_st((smalltalk.Object || Object))._new())._ifNotNil_ifNil_((function(){
  1907. return true;
  1908. }),(function(){
  1909. return false;
  1910. }))).__eq(true));
  1911. return self}, self, "testIfNil", [], smalltalk.ObjectTest)}
  1912. }),
  1913. smalltalk.ObjectTest);
  1914. smalltalk.addMethod(
  1915. "_testInstVars",
  1916. smalltalk.method({
  1917. selector: "testInstVars",
  1918. fn: function (){
  1919. var self=this;
  1920. return smalltalk.withContext(function($ctx) { var o;
  1921. o=_st((smalltalk.ObjectMock || ObjectMock))._new();
  1922. _st(self)._assert_equals_(_st(o)._instVarAt_(smalltalk.symbolFor("foo")),nil);
  1923. _st(o)._instVarAt_put_(smalltalk.symbolFor("foo"),(1));
  1924. _st(self)._assert_equals_(_st(o)._instVarAt_(smalltalk.symbolFor("foo")),(1));
  1925. _st(self)._assert_equals_(_st(o)._instVarAt_("foo"),(1));
  1926. return self}, self, "testInstVars", [], smalltalk.ObjectTest)}
  1927. }),
  1928. smalltalk.ObjectTest);
  1929. smalltalk.addMethod(
  1930. "_testNilUndefined",
  1931. smalltalk.method({
  1932. selector: "testNilUndefined",
  1933. fn: function (){
  1934. var self=this;
  1935. return smalltalk.withContext(function($ctx) { var notDefined;
  1936. notDefined=_st(window)._at_("__this_is_undefined");
  1937. _st(self)._assert_(_st(nil).__eq(notDefined));
  1938. return self}, self, "testNilUndefined", [], smalltalk.ObjectTest)}
  1939. }),
  1940. smalltalk.ObjectTest);
  1941. smalltalk.addMethod(
  1942. "_testYourself",
  1943. smalltalk.method({
  1944. selector: "testYourself",
  1945. fn: function (){
  1946. var self=this;
  1947. return smalltalk.withContext(function($ctx) { var o;
  1948. o=_st((smalltalk.ObjectMock || ObjectMock))._new();
  1949. _st(self)._assert_(_st(_st(o)._yourself()).__eq_eq(o));
  1950. return self}, self, "testYourself", [], smalltalk.ObjectTest)}
  1951. }),
  1952. smalltalk.ObjectTest);
  1953. smalltalk.addMethod(
  1954. "_testidentityHash",
  1955. smalltalk.method({
  1956. selector: "testidentityHash",
  1957. fn: function (){
  1958. var self=this;
  1959. return smalltalk.withContext(function($ctx) { var o1;
  1960. var o2;
  1961. o1=_st((smalltalk.Object || Object))._new();
  1962. o2=_st((smalltalk.Object || Object))._new();
  1963. _st(self)._assert_(_st(_st(o1)._identityHash()).__eq_eq(_st(o1)._identityHash()));
  1964. _st(self)._deny_(_st(_st(o1)._identityHash()).__eq_eq(_st(o2)._identityHash()));
  1965. return self}, self, "testidentityHash", [], smalltalk.ObjectTest)}
  1966. }),
  1967. smalltalk.ObjectTest);
  1968. smalltalk.addClass('PackageTest', smalltalk.TestCase, ['zorkPackage', 'grulPackage', 'backUpCommitPathJs', 'backUpCommitPathSt'], 'Kernel-Tests');
  1969. smalltalk.addMethod(
  1970. "_setUp",
  1971. smalltalk.method({
  1972. selector: "setUp",
  1973. fn: function (){
  1974. var self=this;
  1975. return smalltalk.withContext(function($ctx) { var $1,$2;
  1976. self["@backUpCommitPathJs"]=_st((smalltalk.Package || Package))._defaultCommitPathJs();
  1977. self["@backUpCommitPathSt"]=_st((smalltalk.Package || Package))._defaultCommitPathSt();
  1978. _st((smalltalk.Package || Package))._resetCommitPaths();
  1979. self["@zorkPackage"]=_st(_st((smalltalk.Package || Package))._new())._name_("Zork");
  1980. $1=_st((smalltalk.Package || Package))._new();
  1981. _st($1)._name_("Grul");
  1982. _st($1)._commitPathJs_("server/grul/js");
  1983. _st($1)._commitPathSt_("grul/st");
  1984. $2=_st($1)._yourself();
  1985. self["@grulPackage"]=$2;
  1986. return self}, self, "setUp", [], smalltalk.PackageTest)}
  1987. }),
  1988. smalltalk.PackageTest);
  1989. smalltalk.addMethod(
  1990. "_tearDown",
  1991. smalltalk.method({
  1992. selector: "tearDown",
  1993. fn: function (){
  1994. var self=this;
  1995. return smalltalk.withContext(function($ctx) { var $1;
  1996. _st((smalltalk.Package || Package))._defaultCommitPathJs_(self["@backUpCommitPathJs"]);
  1997. $1=_st((smalltalk.Package || Package))._defaultCommitPathSt_(self["@backUpCommitPathSt"]);
  1998. return self}, self, "tearDown", [], smalltalk.PackageTest)}
  1999. }),
  2000. smalltalk.PackageTest);
  2001. smalltalk.addMethod(
  2002. "_testGrulCommitPathJsShouldBeServerGrulJs",
  2003. smalltalk.method({
  2004. selector: "testGrulCommitPathJsShouldBeServerGrulJs",
  2005. fn: function (){
  2006. var self=this;
  2007. return smalltalk.withContext(function($ctx) { _st(self)._assert_equals_("server/grul/js",_st(self["@grulPackage"])._commitPathJs());
  2008. return self}, self, "testGrulCommitPathJsShouldBeServerGrulJs", [], smalltalk.PackageTest)}
  2009. }),
  2010. smalltalk.PackageTest);
  2011. smalltalk.addMethod(
  2012. "_testGrulCommitPathStShouldBeGrulSt",
  2013. smalltalk.method({
  2014. selector: "testGrulCommitPathStShouldBeGrulSt",
  2015. fn: function (){
  2016. var self=this;
  2017. return smalltalk.withContext(function($ctx) { _st(self)._assert_equals_("grul/st",_st(self["@grulPackage"])._commitPathSt());
  2018. return self}, self, "testGrulCommitPathStShouldBeGrulSt", [], smalltalk.PackageTest)}
  2019. }),
  2020. smalltalk.PackageTest);
  2021. smalltalk.addMethod(
  2022. "_testZorkCommitPathJsShouldBeJs",
  2023. smalltalk.method({
  2024. selector: "testZorkCommitPathJsShouldBeJs",
  2025. fn: function (){
  2026. var self=this;
  2027. return smalltalk.withContext(function($ctx) { _st(self)._assert_equals_("js",_st(self["@zorkPackage"])._commitPathJs());
  2028. return self}, self, "testZorkCommitPathJsShouldBeJs", [], smalltalk.PackageTest)}
  2029. }),
  2030. smalltalk.PackageTest);
  2031. smalltalk.addMethod(
  2032. "_testZorkCommitPathStShouldBeSt",
  2033. smalltalk.method({
  2034. selector: "testZorkCommitPathStShouldBeSt",
  2035. fn: function (){
  2036. var self=this;
  2037. return smalltalk.withContext(function($ctx) { _st(self)._assert_equals_("st",_st(self["@zorkPackage"])._commitPathSt());
  2038. return self}, self, "testZorkCommitPathStShouldBeSt", [], smalltalk.PackageTest)}
  2039. }),
  2040. smalltalk.PackageTest);
  2041. smalltalk.addClass('PackageWithDefaultCommitPathChangedTest', smalltalk.PackageTest, [], 'Kernel-Tests');
  2042. smalltalk.addMethod(
  2043. "_setUp",
  2044. smalltalk.method({
  2045. selector: "setUp",
  2046. fn: function (){
  2047. var self=this;
  2048. return smalltalk.withContext(function($ctx) { var $1;
  2049. smalltalk.PackageTest.fn.prototype._setUp.apply(_st(self), []);
  2050. _st((smalltalk.Package || Package))._defaultCommitPathJs_("javascripts/");
  2051. $1=_st((smalltalk.Package || Package))._defaultCommitPathSt_("smalltalk/");
  2052. return self}, self, "setUp", [], smalltalk.PackageWithDefaultCommitPathChangedTest)}
  2053. }),
  2054. smalltalk.PackageWithDefaultCommitPathChangedTest);
  2055. smalltalk.addMethod(
  2056. "_testGrulCommitPathJsShouldBeServerGrulJs",
  2057. smalltalk.method({
  2058. selector: "testGrulCommitPathJsShouldBeServerGrulJs",
  2059. fn: function (){
  2060. var self=this;
  2061. return smalltalk.withContext(function($ctx) { _st(self)._assert_equals_("server/grul/js",_st(self["@grulPackage"])._commitPathJs());
  2062. return self}, self, "testGrulCommitPathJsShouldBeServerGrulJs", [], smalltalk.PackageWithDefaultCommitPathChangedTest)}
  2063. }),
  2064. smalltalk.PackageWithDefaultCommitPathChangedTest);
  2065. smalltalk.addMethod(
  2066. "_testGrulCommitPathStShouldBeGrulSt",
  2067. smalltalk.method({
  2068. selector: "testGrulCommitPathStShouldBeGrulSt",
  2069. fn: function (){
  2070. var self=this;
  2071. return smalltalk.withContext(function($ctx) { _st(self)._assert_equals_("grul/st",_st(self["@grulPackage"])._commitPathSt());
  2072. return self}, self, "testGrulCommitPathStShouldBeGrulSt", [], smalltalk.PackageWithDefaultCommitPathChangedTest)}
  2073. }),
  2074. smalltalk.PackageWithDefaultCommitPathChangedTest);
  2075. smalltalk.addMethod(
  2076. "_testZorkCommitPathJsShouldBeJavascript",
  2077. smalltalk.method({
  2078. selector: "testZorkCommitPathJsShouldBeJavascript",
  2079. fn: function (){
  2080. var self=this;
  2081. return smalltalk.withContext(function($ctx) { _st(self)._assert_equals_("javascripts/",_st(self["@zorkPackage"])._commitPathJs());
  2082. return self}, self, "testZorkCommitPathJsShouldBeJavascript", [], smalltalk.PackageWithDefaultCommitPathChangedTest)}
  2083. }),
  2084. smalltalk.PackageWithDefaultCommitPathChangedTest);
  2085. smalltalk.addMethod(
  2086. "_testZorkCommitPathStShouldBeSmalltalk",
  2087. smalltalk.method({
  2088. selector: "testZorkCommitPathStShouldBeSmalltalk",
  2089. fn: function (){
  2090. var self=this;
  2091. return smalltalk.withContext(function($ctx) { _st(self)._assert_equals_("smalltalk/",_st(self["@zorkPackage"])._commitPathSt());
  2092. return self}, self, "testZorkCommitPathStShouldBeSmalltalk", [], smalltalk.PackageWithDefaultCommitPathChangedTest)}
  2093. }),
  2094. smalltalk.PackageWithDefaultCommitPathChangedTest);
  2095. smalltalk.addMethod(
  2096. "_shouldInheritSelectors",
  2097. smalltalk.method({
  2098. selector: "shouldInheritSelectors",
  2099. fn: function (){
  2100. var self=this;
  2101. return smalltalk.withContext(function($ctx) { return false;
  2102. }, self, "shouldInheritSelectors", [], smalltalk.PackageWithDefaultCommitPathChangedTest.klass)}
  2103. }),
  2104. smalltalk.PackageWithDefaultCommitPathChangedTest.klass);
  2105. smalltalk.addClass('PointTest', smalltalk.TestCase, [], 'Kernel-Tests');
  2106. smalltalk.addMethod(
  2107. "_testAccessing",
  2108. smalltalk.method({
  2109. selector: "testAccessing",
  2110. fn: function (){
  2111. var self=this;
  2112. return smalltalk.withContext(function($ctx) { _st(self)._assert_equals_(_st(_st((smalltalk.Point || Point))._x_y_((3),(4)))._x(),(3));
  2113. _st(self)._assert_equals_(_st(_st((smalltalk.Point || Point))._x_y_((3),(4)))._y(),(4));
  2114. _st(self)._assert_equals_(_st(_st(_st((smalltalk.Point || Point))._new())._x_((3)))._x(),(3));
  2115. _st(self)._assert_equals_(_st(_st(_st((smalltalk.Point || Point))._new())._y_((4)))._y(),(4));
  2116. return self}, self, "testAccessing", [], smalltalk.PointTest)}
  2117. }),
  2118. smalltalk.PointTest);
  2119. smalltalk.addMethod(
  2120. "_testArithmetic",
  2121. smalltalk.method({
  2122. selector: "testArithmetic",
  2123. fn: function (){
  2124. var self=this;
  2125. return smalltalk.withContext(function($ctx) { _st(self)._assert_equals_(_st(_st((3)).__at((4))).__star(_st((3)).__at((4))),_st((smalltalk.Point || Point))._x_y_((9),(16)));
  2126. _st(self)._assert_equals_(_st(_st((3)).__at((4))).__plus(_st((3)).__at((4))),_st((smalltalk.Point || Point))._x_y_((6),(8)));
  2127. _st(self)._assert_equals_(_st(_st((3)).__at((4))).__minus(_st((3)).__at((4))),_st((smalltalk.Point || Point))._x_y_((0),(0)));
  2128. _st(self)._assert_equals_(_st(_st((6)).__at((8))).__slash(_st((3)).__at((4))),_st((smalltalk.Point || Point))._x_y_((2),(2)));
  2129. return self}, self, "testArithmetic", [], smalltalk.PointTest)}
  2130. }),
  2131. smalltalk.PointTest);
  2132. smalltalk.addMethod(
  2133. "_testAt",
  2134. smalltalk.method({
  2135. selector: "testAt",
  2136. fn: function (){
  2137. var self=this;
  2138. return smalltalk.withContext(function($ctx) { _st(self)._assert_equals_(_st((3)).__at((4)),_st((smalltalk.Point || Point))._x_y_((3),(4)));
  2139. return self}, self, "testAt", [], smalltalk.PointTest)}
  2140. }),
  2141. smalltalk.PointTest);
  2142. smalltalk.addMethod(
  2143. "_testEgality",
  2144. smalltalk.method({
  2145. selector: "testEgality",
  2146. fn: function (){
  2147. var self=this;
  2148. return smalltalk.withContext(function($ctx) { _st(self)._assert_(_st(_st((3)).__at((4))).__eq(_st((3)).__at((4))));
  2149. _st(self)._deny_(_st(_st((3)).__at((5))).__eq(_st((3)).__at((6))));
  2150. return self}, self, "testEgality", [], smalltalk.PointTest)}
  2151. }),
  2152. smalltalk.PointTest);
  2153. smalltalk.addMethod(
  2154. "_testTranslateBy",
  2155. smalltalk.method({
  2156. selector: "testTranslateBy",
  2157. fn: function (){
  2158. var self=this;
  2159. return smalltalk.withContext(function($ctx) { _st(self)._assert_equals_(_st((3)).__at((4)),_st(_st((3)).__at((3)))._translateBy_(_st((0)).__at((1))));
  2160. _st(self)._assert_equals_(_st((3)).__at((2)),_st(_st((3)).__at((3)))._translateBy_(_st((0)).__at(_st((1))._negated())));
  2161. _st(self)._assert_equals_(_st((5)).__at((6)),_st(_st((3)).__at((3)))._translateBy_(_st((2)).__at((3))));
  2162. _st(self)._assert_equals_(_st((0)).__at((3)),_st(_st((3)).__at((3)))._translateBy_(_st(_st((3))._negated()).__at((0))));
  2163. return self}, self, "testTranslateBy", [], smalltalk.PointTest)}
  2164. }),
  2165. smalltalk.PointTest);
  2166. smalltalk.addClass('RandomTest', smalltalk.TestCase, [], 'Kernel-Tests');
  2167. smalltalk.addMethod(
  2168. "_textNext",
  2169. smalltalk.method({
  2170. selector: "textNext",
  2171. fn: function (){
  2172. var self=this;
  2173. return smalltalk.withContext(function($ctx) { _st((10000))._timesRepeat_((function(){
  2174. var current;
  2175. var next;
  2176. next=_st(_st((smalltalk.Random || Random))._new())._next();
  2177. next;
  2178. _st(self)._assert_(_st(next).__gt_eq((0)));
  2179. _st(self)._assert_(_st(next).__lt((1)));
  2180. _st(self)._deny_(_st(current).__eq(next));
  2181. return _st(next).__eq(current);
  2182. }));
  2183. return self}, self, "textNext", [], smalltalk.RandomTest)}
  2184. }),
  2185. smalltalk.RandomTest);
  2186. smalltalk.addClass('SetTest', smalltalk.TestCase, [], 'Kernel-Tests');
  2187. smalltalk.addMethod(
  2188. "_testAddRemove",
  2189. smalltalk.method({
  2190. selector: "testAddRemove",
  2191. fn: function (){
  2192. var self=this;
  2193. return smalltalk.withContext(function($ctx) { var set;
  2194. set=_st((smalltalk.Set || Set))._new();
  2195. _st(self)._assert_(_st(set)._isEmpty());
  2196. _st(set)._add_((3));
  2197. _st(self)._assert_(_st(set)._includes_((3)));
  2198. _st(set)._add_((5));
  2199. _st(self)._assert_(_st(set)._includes_((5)));
  2200. _st(set)._remove_((3));
  2201. _st(self)._deny_(_st(set)._includes_((3)));
  2202. return self}, self, "testAddRemove", [], smalltalk.SetTest)}
  2203. }),
  2204. smalltalk.SetTest);
  2205. smalltalk.addMethod(
  2206. "_testAt",
  2207. smalltalk.method({
  2208. selector: "testAt",
  2209. fn: function (){
  2210. var self=this;
  2211. return smalltalk.withContext(function($ctx) { _st(self)._should_raise_((function(){
  2212. return _st(_st((smalltalk.Set || Set))._new())._at_put_((1),(2));
  2213. }),(smalltalk.Error || Error));
  2214. return self}, self, "testAt", [], smalltalk.SetTest)}
  2215. }),
  2216. smalltalk.SetTest);
  2217. smalltalk.addMethod(
  2218. "_testPrintString",
  2219. smalltalk.method({
  2220. selector: "testPrintString",
  2221. fn: function (){
  2222. var self=this;
  2223. return smalltalk.withContext(function($ctx) { var $1,$2;
  2224. var set;
  2225. set=_st((smalltalk.Set || Set))._new();
  2226. _st(self)._assert_equals_("a Set ()",_st(set)._printString());
  2227. _st(set)._add_((1));
  2228. $1=_st(set)._add_((3));
  2229. _st(self)._assert_equals_("a Set (1 3)",_st(set)._printString());
  2230. _st(set)._add_("foo");
  2231. _st(self)._assert_equals_("a Set (1 3 'foo')",_st(set)._printString());
  2232. _st(set)._remove_((1));
  2233. $2=_st(set)._remove_((3));
  2234. _st(self)._assert_equals_("a Set ('foo')",_st(set)._printString());
  2235. _st(set)._add_((3));
  2236. _st(self)._assert_equals_("a Set ('foo' 3)",_st(set)._printString());
  2237. _st(set)._add_((3));
  2238. _st(self)._assert_equals_("a Set ('foo' 3)",_st(set)._printString());
  2239. return self}, self, "testPrintString", [], smalltalk.SetTest)}
  2240. }),
  2241. smalltalk.SetTest);
  2242. smalltalk.addMethod(
  2243. "_testSize",
  2244. smalltalk.method({
  2245. selector: "testSize",
  2246. fn: function (){
  2247. var self=this;
  2248. return smalltalk.withContext(function($ctx) { _st(self)._assert_equals_(_st(_st((smalltalk.Set || Set))._new())._size(),(0));
  2249. _st(self)._assert_equals_(_st(_st((smalltalk.Set || Set))._withAll_([(1), (2), (3), (4)]))._size(),(4));
  2250. _st(self)._assert_equals_(_st(_st((smalltalk.Set || Set))._withAll_([(1), (1), (1), (1)]))._size(),(1));
  2251. return self}, self, "testSize", [], smalltalk.SetTest)}
  2252. }),
  2253. smalltalk.SetTest);
  2254. smalltalk.addMethod(
  2255. "_testUnicity",
  2256. smalltalk.method({
  2257. selector: "testUnicity",
  2258. fn: function (){
  2259. var self=this;
  2260. return smalltalk.withContext(function($ctx) { var set;
  2261. set=_st((smalltalk.Set || Set))._new();
  2262. _st(set)._add_((21));
  2263. _st(set)._add_("hello");
  2264. _st(set)._add_((21));
  2265. _st(self)._assert_(_st(_st(set)._size()).__eq((2)));
  2266. _st(set)._add_("hello");
  2267. _st(self)._assert_(_st(_st(set)._size()).__eq((2)));
  2268. _st(self)._assert_equals_(_st(set)._asArray(),[(21), "hello"]);
  2269. return self}, self, "testUnicity", [], smalltalk.SetTest)}
  2270. }),
  2271. smalltalk.SetTest);
  2272. smalltalk.addClass('UndefinedTest', smalltalk.TestCase, [], 'Kernel-Tests');
  2273. smalltalk.addMethod(
  2274. "_testCopying",
  2275. smalltalk.method({
  2276. selector: "testCopying",
  2277. fn: function (){
  2278. var self=this;
  2279. return smalltalk.withContext(function($ctx) { _st(self)._assert_equals_(_st(nil)._copy(),nil);
  2280. return self}, self, "testCopying", [], smalltalk.UndefinedTest)}
  2281. }),
  2282. smalltalk.UndefinedTest);
  2283. smalltalk.addMethod(
  2284. "_testDeepCopy",
  2285. smalltalk.method({
  2286. selector: "testDeepCopy",
  2287. fn: function (){
  2288. var self=this;
  2289. return smalltalk.withContext(function($ctx) { _st(self)._assert_(_st(_st(nil)._deepCopy()).__eq(nil));
  2290. return self}, self, "testDeepCopy", [], smalltalk.UndefinedTest)}
  2291. }),
  2292. smalltalk.UndefinedTest);
  2293. smalltalk.addMethod(
  2294. "_testIfNil",
  2295. smalltalk.method({
  2296. selector: "testIfNil",
  2297. fn: function (){
  2298. var self=this;
  2299. return smalltalk.withContext(function($ctx) { var $1,$2,$3;
  2300. if(($receiver = nil) == nil || $receiver == undefined){
  2301. $1=true;
  2302. } else {
  2303. $1=nil;
  2304. };
  2305. _st(self)._assert_equals_($1,true);
  2306. if(($receiver = nil) == nil || $receiver == undefined){
  2307. $2=nil;
  2308. } else {
  2309. $2=true;
  2310. };
  2311. _st(self)._deny_(_st($2).__eq(true));
  2312. if(($receiver = nil) == nil || $receiver == undefined){
  2313. $3=true;
  2314. } else {
  2315. $3=false;
  2316. };
  2317. _st(self)._assert_equals_($3,true);
  2318. _st(self)._deny_(_st(_st(nil)._ifNotNil_ifNil_((function(){
  2319. return true;
  2320. }),(function(){
  2321. return false;
  2322. }))).__eq(true));
  2323. return self}, self, "testIfNil", [], smalltalk.UndefinedTest)}
  2324. }),
  2325. smalltalk.UndefinedTest);
  2326. smalltalk.addMethod(
  2327. "_testIsNil",
  2328. smalltalk.method({
  2329. selector: "testIsNil",
  2330. fn: function (){
  2331. var self=this;
  2332. return smalltalk.withContext(function($ctx) { _st(self)._assert_(_st(nil)._isNil());
  2333. _st(self)._deny_(_st(nil)._notNil());
  2334. return self}, self, "testIsNil", [], smalltalk.UndefinedTest)}
  2335. }),
  2336. smalltalk.UndefinedTest);