1
0

Kernel-Tests.deploy.js 141 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655
  1. smalltalk.addPackage('Kernel-Tests');
  2. smalltalk.addClass('BlockClosureTest', smalltalk.TestCase, [], 'Kernel-Tests');
  3. smalltalk.addMethod(
  4. smalltalk.method({
  5. selector: "testCanClearInterval",
  6. fn: function (){
  7. var self=this;
  8. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  9. return smalltalk.withContext(function($ctx1) {
  10. _st(self)._shouldnt_raise_((function(){
  11. return smalltalk.withContext(function($ctx2) {
  12. return _st(_st((function(){
  13. return smalltalk.withContext(function($ctx3) {
  14. return _st(_st($Error())._new())._signal();
  15. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}))._valueWithInterval_((0)))._clearInterval();
  16. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$Error());
  17. return self}, function($ctx1) {$ctx1.fill(self,"testCanClearInterval",{},smalltalk.BlockClosureTest)})},
  18. messageSends: ["shouldnt:raise:", "clearInterval", "valueWithInterval:", "signal", "new"]}),
  19. smalltalk.BlockClosureTest);
  20. smalltalk.addMethod(
  21. smalltalk.method({
  22. selector: "testCanClearTimeout",
  23. fn: function (){
  24. var self=this;
  25. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  26. return smalltalk.withContext(function($ctx1) {
  27. _st(self)._shouldnt_raise_((function(){
  28. return smalltalk.withContext(function($ctx2) {
  29. return _st(_st((function(){
  30. return smalltalk.withContext(function($ctx3) {
  31. return _st(_st($Error())._new())._signal();
  32. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}))._valueWithTimeout_((0)))._clearTimeout();
  33. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$Error());
  34. return self}, function($ctx1) {$ctx1.fill(self,"testCanClearTimeout",{},smalltalk.BlockClosureTest)})},
  35. messageSends: ["shouldnt:raise:", "clearTimeout", "valueWithTimeout:", "signal", "new"]}),
  36. smalltalk.BlockClosureTest);
  37. smalltalk.addMethod(
  38. smalltalk.method({
  39. selector: "testCompiledSource",
  40. fn: function (){
  41. var self=this;
  42. return smalltalk.withContext(function($ctx1) {
  43. _st(self)._assert_(_st(_st((function(){
  44. return smalltalk.withContext(function($ctx2) {
  45. return _st((1)).__plus((1));
  46. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._compiledSource())._includesSubString_("function"));
  47. return self}, function($ctx1) {$ctx1.fill(self,"testCompiledSource",{},smalltalk.BlockClosureTest)})},
  48. messageSends: ["assert:", "includesSubString:", "compiledSource", "+"]}),
  49. smalltalk.BlockClosureTest);
  50. smalltalk.addMethod(
  51. smalltalk.method({
  52. selector: "testCurrySelf",
  53. fn: function (){
  54. var self=this;
  55. var curriedMethod,array;
  56. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  57. function $ClassBuilder(){return smalltalk.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  58. return smalltalk.withContext(function($ctx1) {
  59. curriedMethod=_st(_st((function(selfarg,x){
  60. return smalltalk.withContext(function($ctx2) {
  61. return _st(selfarg)._at_(x);
  62. }, function($ctx2) {$ctx2.fillBlock({selfarg:selfarg,x:x},$ctx1)})}))._currySelf())._asCompiledMethod_("foo:");
  63. array=[(3), (1), (4)];
  64. _st(_st($ClassBuilder())._new())._installMethod_forClass_category_(curriedMethod,$Array(),"**test helper");
  65. _st((function(){
  66. return smalltalk.withContext(function($ctx2) {
  67. return _st(self)._assert_equals_(_st(array)._foo_((2)),(1));
  68. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._ensure_((function(){
  69. return smalltalk.withContext(function($ctx2) {
  70. return _st($Array())._removeCompiledMethod_(curriedMethod);
  71. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  72. return self}, function($ctx1) {$ctx1.fill(self,"testCurrySelf",{curriedMethod:curriedMethod,array:array},smalltalk.BlockClosureTest)})},
  73. messageSends: ["asCompiledMethod:", "currySelf", "at:", "installMethod:forClass:category:", "new", "ensure:", "removeCompiledMethod:", "assert:equals:", "foo:"]}),
  74. smalltalk.BlockClosureTest);
  75. smalltalk.addMethod(
  76. smalltalk.method({
  77. selector: "testEnsure",
  78. fn: function (){
  79. var self=this;
  80. return smalltalk.withContext(function($ctx1) {
  81. _st(self)._assert_equals_(_st((function(){
  82. return smalltalk.withContext(function($ctx2) {
  83. return (3);
  84. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._ensure_((function(){
  85. return smalltalk.withContext(function($ctx2) {
  86. return (4);
  87. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),(3));
  88. return self}, function($ctx1) {$ctx1.fill(self,"testEnsure",{},smalltalk.BlockClosureTest)})},
  89. messageSends: ["assert:equals:", "ensure:"]}),
  90. smalltalk.BlockClosureTest);
  91. smalltalk.addMethod(
  92. smalltalk.method({
  93. selector: "testEnsureRaises",
  94. fn: function (){
  95. var self=this;
  96. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  97. return smalltalk.withContext(function($ctx1) {
  98. _st(self)._should_raise_((function(){
  99. return smalltalk.withContext(function($ctx2) {
  100. return _st((function(){
  101. return smalltalk.withContext(function($ctx3) {
  102. return _st(_st($Error())._new())._signal();
  103. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}))._ensure_((function(){
  104. return smalltalk.withContext(function($ctx3) {
  105. return true;
  106. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  107. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$Error());
  108. return self}, function($ctx1) {$ctx1.fill(self,"testEnsureRaises",{},smalltalk.BlockClosureTest)})},
  109. messageSends: ["should:raise:", "ensure:", "signal", "new"]}),
  110. smalltalk.BlockClosureTest);
  111. smalltalk.addMethod(
  112. smalltalk.method({
  113. selector: "testExceptionSemantics",
  114. fn: function (){
  115. var self=this;
  116. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  117. return smalltalk.withContext(function($ctx1) {
  118. _st(self)._timeout_((100));
  119. _st(_st(self)._async_((function(){
  120. return smalltalk.withContext(function($ctx2) {
  121. return _st((function(){
  122. return smalltalk.withContext(function($ctx3) {
  123. _st(self)._assert_(true);
  124. _st($Error())._signal();
  125. _st(self)._deny_(true);
  126. return _st(self)._finished();
  127. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}))._on_do_($Error(),(function(ex){
  128. return smalltalk.withContext(function($ctx3) {
  129. return _st(self)._finished();
  130. }, function($ctx3) {$ctx3.fillBlock({ex:ex},$ctx1)})}));
  131. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._valueWithTimeout_((0));
  132. return self}, function($ctx1) {$ctx1.fill(self,"testExceptionSemantics",{},smalltalk.BlockClosureTest)})},
  133. messageSends: ["timeout:", "valueWithTimeout:", "async:", "on:do:", "finished", "assert:", "signal", "deny:"]}),
  134. smalltalk.BlockClosureTest);
  135. smalltalk.addMethod(
  136. smalltalk.method({
  137. selector: "testNewWithValues",
  138. fn: function (){
  139. var self=this;
  140. return smalltalk.withContext(function($ctx1) {
  141. function theTestPrototype() {this.name = "theTestPrototype";}
  142. function theTestConstructor(arg1, arg2, arg3) {}
  143. theTestConstructor.prototype = new theTestPrototype;
  144. var theWrappedConstructor = _st(theTestConstructor);
  145. var theResult = theWrappedConstructor._newWithValues_([1, 2, 3]);
  146. self._assert_equals_(Object.getPrototypeOf(theResult).name, 'theTestPrototype');
  147. "newWithValues: cannot help if the argument list is wrong, and should warn that a mistake was made."
  148. function constructionShouldFail() {var anotherResult = theWrappedConstructor._newWithValues_('This is so wrong');}
  149. self._should_raise_(_st(constructionShouldFail), smalltalk.Error);;
  150. return self}, function($ctx1) {$ctx1.fill(self,"testNewWithValues",{},smalltalk.BlockClosureTest)})},
  151. messageSends: []}),
  152. smalltalk.BlockClosureTest);
  153. smalltalk.addMethod(
  154. smalltalk.method({
  155. selector: "testNumArgs",
  156. fn: function (){
  157. var self=this;
  158. return smalltalk.withContext(function($ctx1) {
  159. _st(self)._assert_equals_(_st((function(){
  160. return smalltalk.withContext(function($ctx2) {
  161. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._numArgs(),(0));
  162. _st(self)._assert_equals_(_st((function(a,b){
  163. return smalltalk.withContext(function($ctx2) {
  164. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})}))._numArgs(),(2));
  165. return self}, function($ctx1) {$ctx1.fill(self,"testNumArgs",{},smalltalk.BlockClosureTest)})},
  166. messageSends: ["assert:equals:", "numArgs"]}),
  167. smalltalk.BlockClosureTest);
  168. smalltalk.addMethod(
  169. smalltalk.method({
  170. selector: "testOnDo",
  171. fn: function (){
  172. var self=this;
  173. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  174. return smalltalk.withContext(function($ctx1) {
  175. _st(self)._assert_(_st((function(){
  176. return smalltalk.withContext(function($ctx2) {
  177. return _st(_st($Error())._new())._signal();
  178. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_($Error(),(function(ex){
  179. return smalltalk.withContext(function($ctx2) {
  180. return true;
  181. }, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1)})})));
  182. return self}, function($ctx1) {$ctx1.fill(self,"testOnDo",{},smalltalk.BlockClosureTest)})},
  183. messageSends: ["assert:", "on:do:", "signal", "new"]}),
  184. smalltalk.BlockClosureTest);
  185. smalltalk.addMethod(
  186. smalltalk.method({
  187. selector: "testValue",
  188. fn: function (){
  189. var self=this;
  190. return smalltalk.withContext(function($ctx1) {
  191. _st(self)._assert_equals_(_st((function(){
  192. return smalltalk.withContext(function($ctx2) {
  193. return _st((1)).__plus((1));
  194. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._value(),(2));
  195. _st(self)._assert_equals_(_st((function(x){
  196. return smalltalk.withContext(function($ctx2) {
  197. return _st(x).__plus((1));
  198. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})}))._value_((2)),(3));
  199. _st(self)._assert_equals_(_st((function(x,y){
  200. return smalltalk.withContext(function($ctx2) {
  201. return _st(x).__star(y);
  202. }, function($ctx2) {$ctx2.fillBlock({x:x,y:y},$ctx1)})}))._value_value_((2),(4)),(8));
  203. _st(self)._assert_equals_(_st((function(a,b,c){
  204. return smalltalk.withContext(function($ctx2) {
  205. return (1);
  206. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b,c:c},$ctx1)})}))._value(),(1));
  207. return self}, function($ctx1) {$ctx1.fill(self,"testValue",{},smalltalk.BlockClosureTest)})},
  208. messageSends: ["assert:equals:", "value", "+", "value:", "value:value:", "*"]}),
  209. smalltalk.BlockClosureTest);
  210. smalltalk.addMethod(
  211. smalltalk.method({
  212. selector: "testValueWithPossibleArguments",
  213. fn: function (){
  214. var self=this;
  215. return smalltalk.withContext(function($ctx1) {
  216. _st(self)._assert_equals_(_st((function(){
  217. return smalltalk.withContext(function($ctx2) {
  218. return (1);
  219. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._valueWithPossibleArguments_([(3), (4)]),(1));
  220. _st(self)._assert_equals_(_st((function(a){
  221. return smalltalk.withContext(function($ctx2) {
  222. return _st(a).__plus((4));
  223. }, function($ctx2) {$ctx2.fillBlock({a:a},$ctx1)})}))._valueWithPossibleArguments_([(3), (4)]),(7));
  224. _st(self)._assert_equals_(_st((function(a,b){
  225. return smalltalk.withContext(function($ctx2) {
  226. return _st(a).__plus(b);
  227. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})}))._valueWithPossibleArguments_([(3), (4), (5)]),(7));
  228. return self}, function($ctx1) {$ctx1.fill(self,"testValueWithPossibleArguments",{},smalltalk.BlockClosureTest)})},
  229. messageSends: ["assert:equals:", "valueWithPossibleArguments:", "+"]}),
  230. smalltalk.BlockClosureTest);
  231. smalltalk.addMethod(
  232. smalltalk.method({
  233. selector: "testWhileFalse",
  234. fn: function (){
  235. var self=this;
  236. var i;
  237. return smalltalk.withContext(function($ctx1) {
  238. i=(0);
  239. _st((function(){
  240. return smalltalk.withContext(function($ctx2) {
  241. return _st(i).__gt((5));
  242. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileFalse_((function(){
  243. return smalltalk.withContext(function($ctx2) {
  244. i=_st(i).__plus((1));
  245. return i;
  246. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  247. _st(self)._assert_equals_(i,(6));
  248. i=(0);
  249. _st((function(){
  250. return smalltalk.withContext(function($ctx2) {
  251. i=_st(i).__plus((1));
  252. i;
  253. return _st(i).__gt((5));
  254. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileFalse();
  255. _st(self)._assert_equals_(i,(6));
  256. return self}, function($ctx1) {$ctx1.fill(self,"testWhileFalse",{i:i},smalltalk.BlockClosureTest)})},
  257. messageSends: ["whileFalse:", "+", ">", "assert:equals:", "whileFalse"]}),
  258. smalltalk.BlockClosureTest);
  259. smalltalk.addMethod(
  260. smalltalk.method({
  261. selector: "testWhileTrue",
  262. fn: function (){
  263. var self=this;
  264. var i;
  265. return smalltalk.withContext(function($ctx1) {
  266. i=(0);
  267. _st((function(){
  268. return smalltalk.withContext(function($ctx2) {
  269. return _st(i).__lt((5));
  270. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
  271. return smalltalk.withContext(function($ctx2) {
  272. i=_st(i).__plus((1));
  273. return i;
  274. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  275. _st(self)._assert_equals_(i,(5));
  276. i=(0);
  277. _st((function(){
  278. return smalltalk.withContext(function($ctx2) {
  279. i=_st(i).__plus((1));
  280. i;
  281. return _st(i).__lt((5));
  282. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue();
  283. _st(self)._assert_equals_(i,(5));
  284. return self}, function($ctx1) {$ctx1.fill(self,"testWhileTrue",{i:i},smalltalk.BlockClosureTest)})},
  285. messageSends: ["whileTrue:", "+", "<", "assert:equals:", "whileTrue"]}),
  286. smalltalk.BlockClosureTest);
  287. smalltalk.addClass('BooleanTest', smalltalk.TestCase, [], 'Kernel-Tests');
  288. smalltalk.addMethod(
  289. smalltalk.method({
  290. selector: "testEquality",
  291. fn: function (){
  292. var self=this;
  293. return smalltalk.withContext(function($ctx1) {
  294. _st(self)._deny_(_st((0)).__eq(false));
  295. _st(self)._deny_(_st(false).__eq((0)));
  296. _st(self)._deny_(_st("").__eq(false));
  297. _st(self)._deny_(_st(false).__eq(""));
  298. _st(self)._assert_(_st(true).__eq(true));
  299. _st(self)._deny_(_st(false).__eq(true));
  300. _st(self)._deny_(_st(true).__eq(false));
  301. _st(self)._assert_(_st(false).__eq(false));
  302. _st(self)._assert_(_st(_st(true)._yourself()).__eq(true));
  303. _st(self)._assert_(_st(_st(true)._yourself()).__eq(_st(true)._yourself()));
  304. return self}, function($ctx1) {$ctx1.fill(self,"testEquality",{},smalltalk.BooleanTest)})},
  305. messageSends: ["deny:", "=", "assert:", "yourself"]}),
  306. smalltalk.BooleanTest);
  307. smalltalk.addMethod(
  308. smalltalk.method({
  309. selector: "testIdentity",
  310. fn: function (){
  311. var self=this;
  312. return smalltalk.withContext(function($ctx1) {
  313. _st(self)._deny_(_st((0)).__eq_eq(false));
  314. _st(self)._deny_(_st(false).__eq_eq((0)));
  315. _st(self)._deny_(_st("").__eq_eq(false));
  316. _st(self)._deny_(_st(false).__eq_eq(""));
  317. _st(self)._assert_(_st(true).__eq_eq(true));
  318. _st(self)._deny_(_st(false).__eq_eq(true));
  319. _st(self)._deny_(_st(true).__eq_eq(false));
  320. _st(self)._assert_(_st(false).__eq_eq(false));
  321. _st(self)._assert_(_st(_st(true)._yourself()).__eq_eq(true));
  322. _st(self)._assert_(_st(_st(true)._yourself()).__eq_eq(_st(true)._yourself()));
  323. return self}, function($ctx1) {$ctx1.fill(self,"testIdentity",{},smalltalk.BooleanTest)})},
  324. messageSends: ["deny:", "==", "assert:", "yourself"]}),
  325. smalltalk.BooleanTest);
  326. smalltalk.addMethod(
  327. smalltalk.method({
  328. selector: "testIfTrueIfFalse",
  329. fn: function (){
  330. var self=this;
  331. return smalltalk.withContext(function($ctx1) {
  332. var $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16;
  333. $1=self;
  334. if(smalltalk.assert(true)){
  335. $2="alternative block";
  336. };
  337. _st($1)._assert_equals_($2,"alternative block");
  338. $3=self;
  339. if(! smalltalk.assert(true)){
  340. $4="alternative block";
  341. };
  342. _st($3)._assert_equals_($4,nil);
  343. $5=self;
  344. if(smalltalk.assert(false)){
  345. $6="alternative block";
  346. };
  347. _st($5)._assert_equals_($6,nil);
  348. $7=self;
  349. if(! smalltalk.assert(false)){
  350. $8="alternative block";
  351. };
  352. _st($7)._assert_equals_($8,"alternative block");
  353. $9=self;
  354. if(smalltalk.assert(false)){
  355. $10="alternative block";
  356. } else {
  357. $10="alternative block2";
  358. };
  359. _st($9)._assert_equals_($10,"alternative block2");
  360. $11=self;
  361. if(smalltalk.assert(false)){
  362. $12="alternative block2";
  363. } else {
  364. $12="alternative block";
  365. };
  366. _st($11)._assert_equals_($12,"alternative block");
  367. $13=self;
  368. if(smalltalk.assert(true)){
  369. $14="alternative block";
  370. } else {
  371. $14="alternative block2";
  372. };
  373. _st($13)._assert_equals_($14,"alternative block");
  374. $15=self;
  375. if(smalltalk.assert(true)){
  376. $16="alternative block2";
  377. } else {
  378. $16="alternative block";
  379. };
  380. _st($15)._assert_equals_($16,"alternative block2");
  381. return self}, function($ctx1) {$ctx1.fill(self,"testIfTrueIfFalse",{},smalltalk.BooleanTest)})},
  382. messageSends: ["assert:equals:", "ifTrue:", "ifFalse:", "ifTrue:ifFalse:", "ifFalse:ifTrue:"]}),
  383. smalltalk.BooleanTest);
  384. smalltalk.addMethod(
  385. smalltalk.method({
  386. selector: "testIfTrueIfFalseWithBoxing",
  387. fn: function (){
  388. var self=this;
  389. return smalltalk.withContext(function($ctx1) {
  390. var $1,$3,$2,$4,$6,$5,$7,$9,$8,$10,$12,$11,$13,$15,$14,$16,$18,$17,$19,$21,$20,$22,$24,$23;
  391. $1=self;
  392. $3=_st(true)._yourself();
  393. if(smalltalk.assert($3)){
  394. $2="alternative block";
  395. };
  396. _st($1)._assert_equals_($2,"alternative block");
  397. $4=self;
  398. $6=_st(true)._yourself();
  399. if(! smalltalk.assert($6)){
  400. $5="alternative block";
  401. };
  402. _st($4)._assert_equals_($5,nil);
  403. $7=self;
  404. $9=_st(false)._yourself();
  405. if(smalltalk.assert($9)){
  406. $8="alternative block";
  407. };
  408. _st($7)._assert_equals_($8,nil);
  409. $10=self;
  410. $12=_st(false)._yourself();
  411. if(! smalltalk.assert($12)){
  412. $11="alternative block";
  413. };
  414. _st($10)._assert_equals_($11,"alternative block");
  415. $13=self;
  416. $15=_st(false)._yourself();
  417. if(smalltalk.assert($15)){
  418. $14="alternative block";
  419. } else {
  420. $14="alternative block2";
  421. };
  422. _st($13)._assert_equals_($14,"alternative block2");
  423. $16=self;
  424. $18=_st(false)._yourself();
  425. if(smalltalk.assert($18)){
  426. $17="alternative block2";
  427. } else {
  428. $17="alternative block";
  429. };
  430. _st($16)._assert_equals_($17,"alternative block");
  431. $19=self;
  432. $21=_st(true)._yourself();
  433. if(smalltalk.assert($21)){
  434. $20="alternative block";
  435. } else {
  436. $20="alternative block2";
  437. };
  438. _st($19)._assert_equals_($20,"alternative block");
  439. $22=self;
  440. $24=_st(true)._yourself();
  441. if(smalltalk.assert($24)){
  442. $23="alternative block2";
  443. } else {
  444. $23="alternative block";
  445. };
  446. _st($22)._assert_equals_($23,"alternative block2");
  447. return self}, function($ctx1) {$ctx1.fill(self,"testIfTrueIfFalseWithBoxing",{},smalltalk.BooleanTest)})},
  448. messageSends: ["assert:equals:", "ifTrue:", "yourself", "ifFalse:", "ifTrue:ifFalse:", "ifFalse:ifTrue:"]}),
  449. smalltalk.BooleanTest);
  450. smalltalk.addMethod(
  451. smalltalk.method({
  452. selector: "testLogic",
  453. fn: function (){
  454. var self=this;
  455. return smalltalk.withContext(function($ctx1) {
  456. var $1,$2,$3,$4,$5,$6,$7,$8;
  457. $1=self;
  458. _st($1)._assert_(_st(true).__and(true));
  459. _st($1)._deny_(_st(true).__and(false));
  460. _st($1)._deny_(_st(false).__and(true));
  461. $2=_st($1)._deny_(_st(false).__and(false));
  462. $3=self;
  463. _st($3)._assert_(_st(true).__or(true));
  464. _st($3)._assert_(_st(true).__or(false));
  465. _st($3)._assert_(_st(false).__or(true));
  466. $4=_st($3)._deny_(_st(false).__or(false));
  467. $5=self;
  468. _st($5)._assert_(_st(true).__and(_st((1)).__gt((0))));
  469. _st($5)._deny_(_st(_st((1)).__gt((0))).__and(false));
  470. $6=_st($5)._deny_(_st(_st((1)).__gt((0))).__and(_st((1)).__gt((2))));
  471. $7=self;
  472. _st($7)._assert_(_st(false).__or(_st((1)).__gt((0))));
  473. _st($7)._assert_(_st(_st((1)).__gt((0))).__or(false));
  474. $8=_st($7)._assert_(_st(_st((1)).__gt((0))).__or(_st((1)).__gt((2))));
  475. return self}, function($ctx1) {$ctx1.fill(self,"testLogic",{},smalltalk.BooleanTest)})},
  476. messageSends: ["assert:", "&", "deny:", "|", ">"]}),
  477. smalltalk.BooleanTest);
  478. smalltalk.addMethod(
  479. smalltalk.method({
  480. selector: "testLogicKeywords",
  481. fn: function (){
  482. var self=this;
  483. return smalltalk.withContext(function($ctx1) {
  484. var $1,$2,$3,$4,$5,$6,$7,$8;
  485. $1=self;
  486. _st($1)._assert_(_st(true)._and_((function(){
  487. return smalltalk.withContext(function($ctx2) {
  488. return true;
  489. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
  490. _st($1)._deny_(_st(true)._and_((function(){
  491. return smalltalk.withContext(function($ctx2) {
  492. return false;
  493. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
  494. _st($1)._deny_(_st(false)._and_((function(){
  495. return smalltalk.withContext(function($ctx2) {
  496. return true;
  497. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
  498. $2=_st($1)._deny_(_st(false)._and_((function(){
  499. return smalltalk.withContext(function($ctx2) {
  500. return false;
  501. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
  502. $3=self;
  503. _st($3)._assert_(_st(true)._or_((function(){
  504. return smalltalk.withContext(function($ctx2) {
  505. return true;
  506. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
  507. _st($3)._assert_(_st(true)._or_((function(){
  508. return smalltalk.withContext(function($ctx2) {
  509. return false;
  510. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
  511. _st($3)._assert_(_st(false)._or_((function(){
  512. return smalltalk.withContext(function($ctx2) {
  513. return true;
  514. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
  515. $4=_st($3)._deny_(_st(false)._or_((function(){
  516. return smalltalk.withContext(function($ctx2) {
  517. return false;
  518. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
  519. $5=self;
  520. _st($5)._assert_(_st(true)._and_((function(){
  521. return smalltalk.withContext(function($ctx2) {
  522. return _st((1)).__gt((0));
  523. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
  524. _st($5)._deny_(_st(_st((1)).__gt((0)))._and_((function(){
  525. return smalltalk.withContext(function($ctx2) {
  526. return false;
  527. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
  528. $6=_st($5)._deny_(_st(_st((1)).__gt((0)))._and_((function(){
  529. return smalltalk.withContext(function($ctx2) {
  530. return _st((1)).__gt((2));
  531. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
  532. $7=self;
  533. _st($7)._assert_(_st(false)._or_((function(){
  534. return smalltalk.withContext(function($ctx2) {
  535. return _st((1)).__gt((0));
  536. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
  537. _st($7)._assert_(_st(_st((1)).__gt((0)))._or_((function(){
  538. return smalltalk.withContext(function($ctx2) {
  539. return false;
  540. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
  541. $8=_st($7)._assert_(_st(_st((1)).__gt((0)))._or_((function(){
  542. return smalltalk.withContext(function($ctx2) {
  543. return _st((1)).__gt((2));
  544. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
  545. return self}, function($ctx1) {$ctx1.fill(self,"testLogicKeywords",{},smalltalk.BooleanTest)})},
  546. messageSends: ["assert:", "and:", "deny:", "or:", ">"]}),
  547. smalltalk.BooleanTest);
  548. smalltalk.addMethod(
  549. smalltalk.method({
  550. selector: "testNonBooleanError",
  551. fn: function (){
  552. var self=this;
  553. function $NonBooleanReceiver(){return smalltalk.NonBooleanReceiver||(typeof NonBooleanReceiver=="undefined"?nil:NonBooleanReceiver)}
  554. return smalltalk.withContext(function($ctx1) {
  555. _st(self)._should_raise_((function(){
  556. return smalltalk.withContext(function($ctx2) {
  557. if(smalltalk.assert("")){
  558. } else {
  559. };
  560. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$NonBooleanReceiver());
  561. return self}, function($ctx1) {$ctx1.fill(self,"testNonBooleanError",{},smalltalk.BooleanTest)})},
  562. messageSends: ["should:raise:", "ifTrue:ifFalse:"]}),
  563. smalltalk.BooleanTest);
  564. smalltalk.addClass('ClassBuilderTest', smalltalk.TestCase, ['builder', 'theClass'], 'Kernel-Tests');
  565. smalltalk.addMethod(
  566. smalltalk.method({
  567. selector: "setUp",
  568. fn: function (){
  569. var self=this;
  570. function $ClassBuilder(){return smalltalk.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  571. return smalltalk.withContext(function($ctx1) {
  572. self["@builder"]=_st($ClassBuilder())._new();
  573. return self}, function($ctx1) {$ctx1.fill(self,"setUp",{},smalltalk.ClassBuilderTest)})},
  574. messageSends: ["new"]}),
  575. smalltalk.ClassBuilderTest);
  576. smalltalk.addMethod(
  577. smalltalk.method({
  578. selector: "tearDown",
  579. fn: function (){
  580. var self=this;
  581. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  582. return smalltalk.withContext(function($ctx1) {
  583. var $1;
  584. $1=self["@theClass"];
  585. if(($receiver = $1) == nil || $receiver == undefined){
  586. $1;
  587. } else {
  588. _st(_st($Smalltalk())._current())._removeClass_(self["@theClass"]);
  589. self["@theClass"]=nil;
  590. self["@theClass"];
  591. };
  592. return self}, function($ctx1) {$ctx1.fill(self,"tearDown",{},smalltalk.ClassBuilderTest)})},
  593. messageSends: ["ifNotNil:", "removeClass:", "current"]}),
  594. smalltalk.ClassBuilderTest);
  595. smalltalk.addMethod(
  596. smalltalk.method({
  597. selector: "testClassCopy",
  598. fn: function (){
  599. var self=this;
  600. function $ObjectMock(){return smalltalk.ObjectMock||(typeof ObjectMock=="undefined"?nil:ObjectMock)}
  601. return smalltalk.withContext(function($ctx1) {
  602. self["@theClass"]=_st(self["@builder"])._copyClass_named_($ObjectMock(),"ObjectMock2");
  603. _st(self)._assert_(_st(_st(self["@theClass"])._superclass()).__eq_eq(_st($ObjectMock())._superclass()));
  604. _st(self)._assert_(_st(_st(self["@theClass"])._instanceVariableNames()).__eq_eq(_st($ObjectMock())._instanceVariableNames()));
  605. _st(self)._assert_equals_(_st(self["@theClass"])._name(),"ObjectMock2");
  606. _st(self)._assert_(_st(_st(self["@theClass"])._package()).__eq_eq(_st($ObjectMock())._package()));
  607. _st(self)._assert_equals_(_st(_st(self["@theClass"])._methodDictionary())._keys(),_st(_st($ObjectMock())._methodDictionary())._keys());
  608. return self}, function($ctx1) {$ctx1.fill(self,"testClassCopy",{},smalltalk.ClassBuilderTest)})},
  609. messageSends: ["copyClass:named:", "assert:", "==", "superclass", "instanceVariableNames", "assert:equals:", "name", "package", "keys", "methodDictionary"]}),
  610. smalltalk.ClassBuilderTest);
  611. smalltalk.addMethod(
  612. smalltalk.method({
  613. selector: "testClassMigration",
  614. fn: function (){
  615. var self=this;
  616. var instance,oldClass;
  617. function $ObjectMock(){return smalltalk.ObjectMock||(typeof ObjectMock=="undefined"?nil:ObjectMock)}
  618. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  619. function $ObjectMock2(){return smalltalk.ObjectMock2||(typeof ObjectMock2=="undefined"?nil:ObjectMock2)}
  620. return smalltalk.withContext(function($ctx1) {
  621. oldClass=_st(self["@builder"])._copyClass_named_($ObjectMock(),"ObjectMock2");
  622. instance=_st(_st(_st($Smalltalk())._current())._at_("ObjectMock2"))._new();
  623. _st($ObjectMock())._subclass_instanceVariableNames_package_(_st(_st($Smalltalk())._current())._at_("ObjectMock2"),"","Kernel-Tests");
  624. _st(self)._deny_(_st(oldClass).__eq_eq($ObjectMock2()));
  625. _st(self)._assert_(_st(_st($ObjectMock2())._superclass()).__eq_eq($ObjectMock()));
  626. _st(self)._assert_(_st(_st($ObjectMock2())._instanceVariableNames())._isEmpty());
  627. _st(self)._assert_equals_(_st($ObjectMock2())._selectors(),_st(oldClass)._selectors());
  628. _st(self)._assert_equals_(_st($ObjectMock2())._comment(),_st(oldClass)._comment());
  629. _st(self)._assert_equals_(_st(_st($ObjectMock2())._package())._name(),"Kernel-Tests");
  630. _st(self)._deny_(_st(_st(instance)._class()).__eq_eq($ObjectMock2()));
  631. _st(self)._assert_(_st(_st(_st($Smalltalk())._current())._at_(_st(_st(instance)._class())._name()))._isNil());
  632. _st(_st($Smalltalk())._current())._removeClass_($ObjectMock2());
  633. return self}, function($ctx1) {$ctx1.fill(self,"testClassMigration",{instance:instance,oldClass:oldClass},smalltalk.ClassBuilderTest)})},
  634. messageSends: ["copyClass:named:", "new", "at:", "current", "subclass:instanceVariableNames:package:", "deny:", "==", "assert:", "superclass", "isEmpty", "instanceVariableNames", "assert:equals:", "selectors", "comment", "name", "package", "class", "isNil", "removeClass:"]}),
  635. smalltalk.ClassBuilderTest);
  636. smalltalk.addMethod(
  637. smalltalk.method({
  638. selector: "testClassMigrationWithClassInstanceVariables",
  639. fn: function (){
  640. var self=this;
  641. function $ObjectMock(){return smalltalk.ObjectMock||(typeof ObjectMock=="undefined"?nil:ObjectMock)}
  642. function $ObjectMock2(){return smalltalk.ObjectMock2||(typeof ObjectMock2=="undefined"?nil:ObjectMock2)}
  643. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  644. return smalltalk.withContext(function($ctx1) {
  645. _st(self["@builder"])._copyClass_named_($ObjectMock(),"ObjectMock2");
  646. _st(_st($ObjectMock2())._class())._instanceVariableNames_("foo bar");
  647. _st($ObjectMock())._subclass_instanceVariableNames_package_(_st(_st($Smalltalk())._current())._at_("ObjectMock2"),"","Kernel-Tests");
  648. _st(self)._assert_equals_(_st(_st($ObjectMock2())._class())._instanceVariableNames(),["foo", "bar"]);
  649. _st(_st($Smalltalk())._current())._removeClass_($ObjectMock2());
  650. return self}, function($ctx1) {$ctx1.fill(self,"testClassMigrationWithClassInstanceVariables",{},smalltalk.ClassBuilderTest)})},
  651. messageSends: ["copyClass:named:", "instanceVariableNames:", "class", "subclass:instanceVariableNames:package:", "at:", "current", "assert:equals:", "instanceVariableNames", "removeClass:"]}),
  652. smalltalk.ClassBuilderTest);
  653. smalltalk.addMethod(
  654. smalltalk.method({
  655. selector: "testClassMigrationWithSubclasses",
  656. fn: function (){
  657. var self=this;
  658. function $ObjectMock(){return smalltalk.ObjectMock||(typeof ObjectMock=="undefined"?nil:ObjectMock)}
  659. function $ObjectMock2(){return smalltalk.ObjectMock2||(typeof ObjectMock2=="undefined"?nil:ObjectMock2)}
  660. function $ObjectMock3(){return smalltalk.ObjectMock3||(typeof ObjectMock3=="undefined"?nil:ObjectMock3)}
  661. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  662. function $ObjectMock4(){return smalltalk.ObjectMock4||(typeof ObjectMock4=="undefined"?nil:ObjectMock4)}
  663. return smalltalk.withContext(function($ctx1) {
  664. _st(self["@builder"])._copyClass_named_($ObjectMock(),"ObjectMock2");
  665. _st($ObjectMock2())._subclass_instanceVariableNames_package_("ObjectMock3","","Kernel-Tests");
  666. _st($ObjectMock3())._subclass_instanceVariableNames_package_("ObjectMock4","","Kernel-Tests");
  667. _st($ObjectMock())._subclass_instanceVariableNames_package_(_st(_st($Smalltalk())._current())._at_("ObjectMock2"),"","Kernel-Tests");
  668. _st(self)._assert_(_st(_st($ObjectMock())._subclasses())._includes_($ObjectMock2()));
  669. _st(self)._assert_(_st(_st($ObjectMock2())._subclasses())._includes_($ObjectMock3()));
  670. _st(self)._assert_(_st(_st($ObjectMock3())._subclasses())._includes_($ObjectMock4()));
  671. _st(_st($ObjectMock())._allSubclasses())._do_((function(each){
  672. return smalltalk.withContext(function($ctx2) {
  673. return _st(_st($Smalltalk())._current())._removeClass_(each);
  674. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  675. return self}, function($ctx1) {$ctx1.fill(self,"testClassMigrationWithSubclasses",{},smalltalk.ClassBuilderTest)})},
  676. messageSends: ["copyClass:named:", "subclass:instanceVariableNames:package:", "at:", "current", "assert:", "includes:", "subclasses", "do:", "removeClass:", "allSubclasses"]}),
  677. smalltalk.ClassBuilderTest);
  678. smalltalk.addMethod(
  679. smalltalk.method({
  680. selector: "testInstanceVariableNames",
  681. fn: function (){
  682. var self=this;
  683. return smalltalk.withContext(function($ctx1) {
  684. _st(self)._assert_equals_(_st(self["@builder"])._instanceVariableNamesFor_(" hello world "),["hello", "world"]);
  685. return self}, function($ctx1) {$ctx1.fill(self,"testInstanceVariableNames",{},smalltalk.ClassBuilderTest)})},
  686. messageSends: ["assert:equals:", "instanceVariableNamesFor:"]}),
  687. smalltalk.ClassBuilderTest);
  688. smalltalk.addClass('CollectionTest', smalltalk.TestCase, [], 'Kernel-Tests');
  689. smalltalk.addMethod(
  690. smalltalk.method({
  691. selector: "assertSameContents:as:",
  692. fn: function (aCollection,anotherCollection){
  693. var self=this;
  694. return smalltalk.withContext(function($ctx1) {
  695. _st(self)._assert_(_st(_st(aCollection)._size()).__eq(_st(anotherCollection)._size()));
  696. _st(aCollection)._do_((function(each){
  697. return smalltalk.withContext(function($ctx2) {
  698. return _st(self)._assert_(_st(_st(aCollection)._occurrencesOf_(each)).__eq(_st(anotherCollection)._occurrencesOf_(each)));
  699. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  700. return self}, function($ctx1) {$ctx1.fill(self,"assertSameContents:as:",{aCollection:aCollection,anotherCollection:anotherCollection},smalltalk.CollectionTest)})},
  701. messageSends: ["assert:", "=", "size", "do:", "occurrencesOf:"]}),
  702. smalltalk.CollectionTest);
  703. smalltalk.addMethod(
  704. smalltalk.method({
  705. selector: "collection",
  706. fn: function (){
  707. var self=this;
  708. return smalltalk.withContext(function($ctx1) {
  709. var $1;
  710. $1=_st(_st(self)._collectionClass())._withAll_(_st(self)._defaultValues());
  711. return $1;
  712. }, function($ctx1) {$ctx1.fill(self,"collection",{},smalltalk.CollectionTest)})},
  713. messageSends: ["withAll:", "defaultValues", "collectionClass"]}),
  714. smalltalk.CollectionTest);
  715. smalltalk.addMethod(
  716. smalltalk.method({
  717. selector: "collectionClass",
  718. fn: function (){
  719. var self=this;
  720. return smalltalk.withContext(function($ctx1) {
  721. var $1;
  722. $1=_st(_st(self)._class())._collectionClass();
  723. return $1;
  724. }, function($ctx1) {$ctx1.fill(self,"collectionClass",{},smalltalk.CollectionTest)})},
  725. messageSends: ["collectionClass", "class"]}),
  726. smalltalk.CollectionTest);
  727. smalltalk.addMethod(
  728. smalltalk.method({
  729. selector: "collectionWithDuplicates",
  730. fn: function (){
  731. var self=this;
  732. return smalltalk.withContext(function($ctx1) {
  733. var $1;
  734. $1=_st(_st(self)._collectionClass())._withAll_(["a", "b", "c", (1), (2), (1), "a"]);
  735. return $1;
  736. }, function($ctx1) {$ctx1.fill(self,"collectionWithDuplicates",{},smalltalk.CollectionTest)})},
  737. messageSends: ["withAll:", "collectionClass"]}),
  738. smalltalk.CollectionTest);
  739. smalltalk.addMethod(
  740. smalltalk.method({
  741. selector: "defaultValues",
  742. fn: function (){
  743. var self=this;
  744. return smalltalk.withContext(function($ctx1) {
  745. var $1;
  746. $1=[(1), (2), (3), (-4)];
  747. return $1;
  748. }, function($ctx1) {$ctx1.fill(self,"defaultValues",{},smalltalk.CollectionTest)})},
  749. messageSends: []}),
  750. smalltalk.CollectionTest);
  751. smalltalk.addMethod(
  752. smalltalk.method({
  753. selector: "isCollectionReadOnly",
  754. fn: function (){
  755. var self=this;
  756. return smalltalk.withContext(function($ctx1) {
  757. return false;
  758. }, function($ctx1) {$ctx1.fill(self,"isCollectionReadOnly",{},smalltalk.CollectionTest)})},
  759. messageSends: []}),
  760. smalltalk.CollectionTest);
  761. smalltalk.addMethod(
  762. smalltalk.method({
  763. selector: "testAsArray",
  764. fn: function (){
  765. var self=this;
  766. return smalltalk.withContext(function($ctx1) {
  767. _st(self)._assertSameContents_as_(_st(self)._collection(),_st(_st(self)._collection())._asArray());
  768. return self}, function($ctx1) {$ctx1.fill(self,"testAsArray",{},smalltalk.CollectionTest)})},
  769. messageSends: ["assertSameContents:as:", "collection", "asArray"]}),
  770. smalltalk.CollectionTest);
  771. smalltalk.addMethod(
  772. smalltalk.method({
  773. selector: "testAsOrderedCollection",
  774. fn: function (){
  775. var self=this;
  776. return smalltalk.withContext(function($ctx1) {
  777. _st(self)._assertSameContents_as_(_st(self)._collection(),_st(_st(self)._collection())._asOrderedCollection());
  778. return self}, function($ctx1) {$ctx1.fill(self,"testAsOrderedCollection",{},smalltalk.CollectionTest)})},
  779. messageSends: ["assertSameContents:as:", "collection", "asOrderedCollection"]}),
  780. smalltalk.CollectionTest);
  781. smalltalk.addMethod(
  782. smalltalk.method({
  783. selector: "testAsSet",
  784. fn: function (){
  785. var self=this;
  786. var c,set;
  787. return smalltalk.withContext(function($ctx1) {
  788. c=_st(self)._collectionWithDuplicates();
  789. set=_st(c)._asSet();
  790. _st(self)._assert_equals_(_st(set)._size(),(5));
  791. _st(c)._do_((function(each){
  792. return smalltalk.withContext(function($ctx2) {
  793. return _st(self)._assert_(_st(set)._includes_(each));
  794. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  795. return self}, function($ctx1) {$ctx1.fill(self,"testAsSet",{c:c,set:set},smalltalk.CollectionTest)})},
  796. messageSends: ["collectionWithDuplicates", "asSet", "assert:equals:", "size", "do:", "assert:", "includes:"]}),
  797. smalltalk.CollectionTest);
  798. smalltalk.addMethod(
  799. smalltalk.method({
  800. selector: "testCollect",
  801. fn: function (){
  802. var self=this;
  803. var newCollection;
  804. return smalltalk.withContext(function($ctx1) {
  805. newCollection=[(1), (2), (3), (4)];
  806. _st(self)._assertSameContents_as_(_st(_st(self)._collection())._collect_((function(each){
  807. return smalltalk.withContext(function($ctx2) {
  808. return _st(each)._abs();
  809. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})),newCollection);
  810. return self}, function($ctx1) {$ctx1.fill(self,"testCollect",{newCollection:newCollection},smalltalk.CollectionTest)})},
  811. messageSends: ["assertSameContents:as:", "collect:", "abs", "collection"]}),
  812. smalltalk.CollectionTest);
  813. smalltalk.addMethod(
  814. smalltalk.method({
  815. selector: "testDetect",
  816. fn: function (){
  817. var self=this;
  818. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  819. return smalltalk.withContext(function($ctx1) {
  820. _st(self)._assert_equals_(_st(_st(self)._collection())._detect_((function(each){
  821. return smalltalk.withContext(function($ctx2) {
  822. return _st(each).__lt((0));
  823. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})),(-4));
  824. _st(self)._should_raise_((function(){
  825. return smalltalk.withContext(function($ctx2) {
  826. return _st(_st(self)._collection())._detect_((function(each){
  827. return smalltalk.withContext(function($ctx3) {
  828. return _st(each).__eq((6));
  829. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  830. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$Error());
  831. return self}, function($ctx1) {$ctx1.fill(self,"testDetect",{},smalltalk.CollectionTest)})},
  832. messageSends: ["assert:equals:", "detect:", "<", "collection", "should:raise:", "="]}),
  833. smalltalk.CollectionTest);
  834. smalltalk.addMethod(
  835. smalltalk.method({
  836. selector: "testDo",
  837. fn: function (){
  838. var self=this;
  839. var newCollection;
  840. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  841. return smalltalk.withContext(function($ctx1) {
  842. newCollection=_st($OrderedCollection())._new();
  843. _st(_st(self)._collection())._do_((function(each){
  844. return smalltalk.withContext(function($ctx2) {
  845. return _st(newCollection)._add_(each);
  846. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  847. _st(self)._assertSameContents_as_(_st(self)._collection(),newCollection);
  848. return self}, function($ctx1) {$ctx1.fill(self,"testDo",{newCollection:newCollection},smalltalk.CollectionTest)})},
  849. messageSends: ["new", "do:", "add:", "collection", "assertSameContents:as:"]}),
  850. smalltalk.CollectionTest);
  851. smalltalk.addMethod(
  852. smalltalk.method({
  853. selector: "testIsEmpty",
  854. fn: function (){
  855. var self=this;
  856. return smalltalk.withContext(function($ctx1) {
  857. _st(self)._assert_(_st(_st(_st(self)._collectionClass())._new())._isEmpty());
  858. _st(self)._deny_(_st(_st(self)._collection())._isEmpty());
  859. return self}, function($ctx1) {$ctx1.fill(self,"testIsEmpty",{},smalltalk.CollectionTest)})},
  860. messageSends: ["assert:", "isEmpty", "new", "collectionClass", "deny:", "collection"]}),
  861. smalltalk.CollectionTest);
  862. smalltalk.addMethod(
  863. smalltalk.method({
  864. selector: "testSelect",
  865. fn: function (){
  866. var self=this;
  867. var newCollection;
  868. return smalltalk.withContext(function($ctx1) {
  869. newCollection=[(2), (-4)];
  870. _st(self)._assertSameContents_as_(_st(_st(self)._collection())._select_((function(each){
  871. return smalltalk.withContext(function($ctx2) {
  872. return _st(each)._even();
  873. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})),newCollection);
  874. return self}, function($ctx1) {$ctx1.fill(self,"testSelect",{newCollection:newCollection},smalltalk.CollectionTest)})},
  875. messageSends: ["assertSameContents:as:", "select:", "even", "collection"]}),
  876. smalltalk.CollectionTest);
  877. smalltalk.addMethod(
  878. smalltalk.method({
  879. selector: "testSize",
  880. fn: function (){
  881. var self=this;
  882. return smalltalk.withContext(function($ctx1) {
  883. _st(self)._assert_equals_(_st(_st(_st(self)._collectionClass())._new())._size(),(0));
  884. _st(self)._assert_equals_(_st(_st(self)._collection())._size(),(4));
  885. return self}, function($ctx1) {$ctx1.fill(self,"testSize",{},smalltalk.CollectionTest)})},
  886. messageSends: ["assert:equals:", "size", "new", "collectionClass", "collection"]}),
  887. smalltalk.CollectionTest);
  888. smalltalk.addMethod(
  889. smalltalk.method({
  890. selector: "collectionClass",
  891. fn: function (){
  892. var self=this;
  893. return smalltalk.withContext(function($ctx1) {
  894. return nil;
  895. }, function($ctx1) {$ctx1.fill(self,"collectionClass",{},smalltalk.CollectionTest.klass)})},
  896. messageSends: []}),
  897. smalltalk.CollectionTest.klass);
  898. smalltalk.addMethod(
  899. smalltalk.method({
  900. selector: "isAbstract",
  901. fn: function (){
  902. var self=this;
  903. return smalltalk.withContext(function($ctx1) {
  904. var $1;
  905. $1=_st(_st(self)._collectionClass())._isNil();
  906. return $1;
  907. }, function($ctx1) {$ctx1.fill(self,"isAbstract",{},smalltalk.CollectionTest.klass)})},
  908. messageSends: ["isNil", "collectionClass"]}),
  909. smalltalk.CollectionTest.klass);
  910. smalltalk.addClass('IndexableCollectionTest', smalltalk.CollectionTest, [], 'Kernel-Tests');
  911. smalltalk.addMethod(
  912. smalltalk.method({
  913. selector: "testAt",
  914. fn: function (){
  915. var self=this;
  916. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  917. return smalltalk.withContext(function($ctx1) {
  918. _st(self)._assert_equals_(_st(_st(self)._collection())._at_((4)),(-4));
  919. _st(self)._should_raise_((function(){
  920. return smalltalk.withContext(function($ctx2) {
  921. return _st(_st(self)._collection())._at_((5));
  922. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$Error());
  923. return self}, function($ctx1) {$ctx1.fill(self,"testAt",{},smalltalk.IndexableCollectionTest)})},
  924. messageSends: ["assert:equals:", "at:", "collection", "should:raise:"]}),
  925. smalltalk.IndexableCollectionTest);
  926. smalltalk.addMethod(
  927. smalltalk.method({
  928. selector: "testAtIfAbsent",
  929. fn: function (){
  930. var self=this;
  931. return smalltalk.withContext(function($ctx1) {
  932. _st(self)._assert_equals_(_st(_st(self)._collection())._at_ifAbsent_(_st(_st(_st(self)._collection())._size()).__plus((1)),(function(){
  933. return smalltalk.withContext(function($ctx2) {
  934. return "none";
  935. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"none");
  936. return self}, function($ctx1) {$ctx1.fill(self,"testAtIfAbsent",{},smalltalk.IndexableCollectionTest)})},
  937. messageSends: ["assert:equals:", "at:ifAbsent:", "+", "size", "collection"]}),
  938. smalltalk.IndexableCollectionTest);
  939. smalltalk.addMethod(
  940. smalltalk.method({
  941. selector: "testContains",
  942. fn: function (){
  943. var self=this;
  944. var collection;
  945. function $Object(){return smalltalk.Object||(typeof Object=="undefined"?nil:Object)}
  946. return smalltalk.withContext(function($ctx1) {
  947. collection=_st(self)._collection();
  948. _st(self)._assert_(_st(_st(self)._collection())._contains_((function(each){
  949. return smalltalk.withContext(function($ctx2) {
  950. return _st(each).__eq(_st(_st(self)._collection())._first());
  951. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})));
  952. _st(self)._deny_(_st(_st(self)._collection())._contains_((function(each){
  953. return smalltalk.withContext(function($ctx2) {
  954. return _st(each).__eq(_st($Object())._new());
  955. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})));
  956. return self}, function($ctx1) {$ctx1.fill(self,"testContains",{collection:collection},smalltalk.IndexableCollectionTest)})},
  957. messageSends: ["collection", "assert:", "contains:", "=", "first", "deny:", "new"]}),
  958. smalltalk.IndexableCollectionTest);
  959. smalltalk.addMethod(
  960. smalltalk.method({
  961. selector: "testIndexOf",
  962. fn: function (){
  963. var self=this;
  964. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  965. return smalltalk.withContext(function($ctx1) {
  966. _st(self)._assert_equals_(_st(_st(self)._collection())._indexOf_((2)),(2));
  967. _st(self)._should_raise_((function(){
  968. return smalltalk.withContext(function($ctx2) {
  969. return _st(_st(self)._collection())._indexOf_((999));
  970. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$Error());
  971. _st(self)._assert_equals_(_st(_st(self)._collection())._indexOf_ifAbsent_((999),(function(){
  972. return smalltalk.withContext(function($ctx2) {
  973. return "sentinel";
  974. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"sentinel");
  975. return self}, function($ctx1) {$ctx1.fill(self,"testIndexOf",{},smalltalk.IndexableCollectionTest)})},
  976. messageSends: ["assert:equals:", "indexOf:", "collection", "should:raise:", "indexOf:ifAbsent:"]}),
  977. smalltalk.IndexableCollectionTest);
  978. smalltalk.addMethod(
  979. smalltalk.method({
  980. selector: "testWithIndexDo",
  981. fn: function (){
  982. var self=this;
  983. var collection;
  984. return smalltalk.withContext(function($ctx1) {
  985. collection=_st(self)._collection();
  986. _st(_st(self)._collection())._withIndexDo_((function(each,index){
  987. return smalltalk.withContext(function($ctx2) {
  988. return _st(self)._assert_equals_(_st(collection)._at_(index),each);
  989. }, function($ctx2) {$ctx2.fillBlock({each:each,index:index},$ctx1)})}));
  990. return self}, function($ctx1) {$ctx1.fill(self,"testWithIndexDo",{collection:collection},smalltalk.IndexableCollectionTest)})},
  991. messageSends: ["collection", "withIndexDo:", "assert:equals:", "at:"]}),
  992. smalltalk.IndexableCollectionTest);
  993. smalltalk.addClass('HashedCollectionTest', smalltalk.IndexableCollectionTest, [], 'Kernel-Tests');
  994. smalltalk.addMethod(
  995. smalltalk.method({
  996. selector: "collection",
  997. fn: function (){
  998. var self=this;
  999. return smalltalk.withContext(function($ctx1) {
  1000. var $1;
  1001. $1=smalltalk.HashedCollection._fromPairs_([_st("b").__minus_gt((1)),_st("a").__minus_gt((2)),_st("c").__minus_gt((3)),_st("d").__minus_gt((-4))]);
  1002. return $1;
  1003. }, function($ctx1) {$ctx1.fill(self,"collection",{},smalltalk.HashedCollectionTest)})},
  1004. messageSends: ["->"]}),
  1005. smalltalk.HashedCollectionTest);
  1006. smalltalk.addMethod(
  1007. smalltalk.method({
  1008. selector: "collectionWithDuplicates",
  1009. fn: function (){
  1010. var self=this;
  1011. return smalltalk.withContext(function($ctx1) {
  1012. var $1;
  1013. $1=smalltalk.HashedCollection._fromPairs_([_st("b").__minus_gt((1)),_st("a").__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))]);
  1014. return $1;
  1015. }, function($ctx1) {$ctx1.fill(self,"collectionWithDuplicates",{},smalltalk.HashedCollectionTest)})},
  1016. messageSends: ["->"]}),
  1017. smalltalk.HashedCollectionTest);
  1018. smalltalk.addMethod(
  1019. smalltalk.method({
  1020. selector: "testAt",
  1021. fn: function (){
  1022. var self=this;
  1023. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  1024. return smalltalk.withContext(function($ctx1) {
  1025. _st(self)._assert_equals_(_st(_st(self)._collection())._at_("a"),(2));
  1026. _st(self)._should_raise_((function(){
  1027. return smalltalk.withContext(function($ctx2) {
  1028. return _st(_st(self)._collection())._at_((5));
  1029. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$Error());
  1030. return self}, function($ctx1) {$ctx1.fill(self,"testAt",{},smalltalk.HashedCollectionTest)})},
  1031. messageSends: ["assert:equals:", "at:", "collection", "should:raise:"]}),
  1032. smalltalk.HashedCollectionTest);
  1033. smalltalk.addMethod(
  1034. smalltalk.method({
  1035. selector: "testContains",
  1036. fn: function (){
  1037. var self=this;
  1038. var collection;
  1039. function $Object(){return smalltalk.Object||(typeof Object=="undefined"?nil:Object)}
  1040. return smalltalk.withContext(function($ctx1) {
  1041. collection=_st(self)._collection();
  1042. _st(self)._assert_(_st(_st(self)._collection())._contains_((function(each){
  1043. return smalltalk.withContext(function($ctx2) {
  1044. return _st(each).__eq(_st(_st(_st(self)._collection())._values())._first());
  1045. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})));
  1046. _st(self)._deny_(_st(_st(self)._collection())._contains_((function(each){
  1047. return smalltalk.withContext(function($ctx2) {
  1048. return _st(each).__eq(_st($Object())._new());
  1049. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})));
  1050. return self}, function($ctx1) {$ctx1.fill(self,"testContains",{collection:collection},smalltalk.HashedCollectionTest)})},
  1051. messageSends: ["collection", "assert:", "contains:", "=", "first", "values", "deny:", "new"]}),
  1052. smalltalk.HashedCollectionTest);
  1053. smalltalk.addMethod(
  1054. smalltalk.method({
  1055. selector: "testIndexOf",
  1056. fn: function (){
  1057. var self=this;
  1058. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  1059. return smalltalk.withContext(function($ctx1) {
  1060. _st(self)._assert_equals_(_st(_st(self)._collection())._indexOf_((2)),"a");
  1061. _st(self)._should_raise_((function(){
  1062. return smalltalk.withContext(function($ctx2) {
  1063. return _st(_st(self)._collection())._indexOf_((999));
  1064. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$Error());
  1065. _st(self)._assert_equals_(_st(_st(self)._collection())._indexOf_ifAbsent_((999),(function(){
  1066. return smalltalk.withContext(function($ctx2) {
  1067. return "sentinel";
  1068. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"sentinel");
  1069. return self}, function($ctx1) {$ctx1.fill(self,"testIndexOf",{},smalltalk.HashedCollectionTest)})},
  1070. messageSends: ["assert:equals:", "indexOf:", "collection", "should:raise:", "indexOf:ifAbsent:"]}),
  1071. smalltalk.HashedCollectionTest);
  1072. smalltalk.addMethod(
  1073. smalltalk.method({
  1074. selector: "collectionClass",
  1075. fn: function (){
  1076. var self=this;
  1077. function $HashedCollection(){return smalltalk.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
  1078. return smalltalk.withContext(function($ctx1) {
  1079. var $1;
  1080. $1=$HashedCollection();
  1081. return $1;
  1082. }, function($ctx1) {$ctx1.fill(self,"collectionClass",{},smalltalk.HashedCollectionTest.klass)})},
  1083. messageSends: []}),
  1084. smalltalk.HashedCollectionTest.klass);
  1085. smalltalk.addClass('DictionaryTest', smalltalk.HashedCollectionTest, [], 'Kernel-Tests');
  1086. smalltalk.addMethod(
  1087. smalltalk.method({
  1088. selector: "collection",
  1089. fn: function (){
  1090. var self=this;
  1091. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  1092. return smalltalk.withContext(function($ctx1) {
  1093. var $2,$3,$1;
  1094. $2=_st($Dictionary())._new();
  1095. _st($2)._at_put_((1),(1));
  1096. _st($2)._at_put_("a",(2));
  1097. _st($2)._at_put_(true,(3));
  1098. _st($2)._at_put_((4),(-4));
  1099. $3=_st($2)._yourself();
  1100. $1=$3;
  1101. return $1;
  1102. }, function($ctx1) {$ctx1.fill(self,"collection",{},smalltalk.DictionaryTest)})},
  1103. messageSends: ["at:put:", "new", "yourself"]}),
  1104. smalltalk.DictionaryTest);
  1105. smalltalk.addMethod(
  1106. smalltalk.method({
  1107. selector: "collectionWithDuplicates",
  1108. fn: function (){
  1109. var self=this;
  1110. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  1111. return smalltalk.withContext(function($ctx1) {
  1112. var $2,$3,$1;
  1113. $2=_st($Dictionary())._new();
  1114. _st($2)._at_put_((1),(1));
  1115. _st($2)._at_put_("a",(2));
  1116. _st($2)._at_put_(true,(3));
  1117. _st($2)._at_put_((4),(-4));
  1118. _st($2)._at_put_("b",(1));
  1119. _st($2)._at_put_((3),(3));
  1120. _st($2)._at_put_(false,(12));
  1121. $3=_st($2)._yourself();
  1122. $1=$3;
  1123. return $1;
  1124. }, function($ctx1) {$ctx1.fill(self,"collectionWithDuplicates",{},smalltalk.DictionaryTest)})},
  1125. messageSends: ["at:put:", "new", "yourself"]}),
  1126. smalltalk.DictionaryTest);
  1127. smalltalk.addMethod(
  1128. smalltalk.method({
  1129. selector: "testAccessing",
  1130. fn: function (){
  1131. var self=this;
  1132. var d;
  1133. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  1134. return smalltalk.withContext(function($ctx1) {
  1135. d=_st($Dictionary())._new();
  1136. _st(d)._at_put_("hello","world");
  1137. _st(self)._assert_equals_(_st(d)._at_("hello"),"world");
  1138. _st(self)._assert_equals_(_st(d)._at_ifAbsent_("hello",(function(){
  1139. return smalltalk.withContext(function($ctx2) {
  1140. return nil;
  1141. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"world");
  1142. _st(self)._deny_(_st(_st(d)._at_ifAbsent_("foo",(function(){
  1143. return smalltalk.withContext(function($ctx2) {
  1144. return nil;
  1145. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))).__eq("world"));
  1146. _st(self)._assert_(_st(d)._includesKey_("hello"));
  1147. _st(self)._deny_(_st(d)._includesKey_("foo"));
  1148. _st(d)._at_put_((1),(2));
  1149. _st(self)._assert_equals_(_st(d)._at_((1)),(2));
  1150. _st(d)._at_put_(_st((1)).__at((3)),(3));
  1151. _st(self)._assert_equals_(_st(d)._at_(_st((1)).__at((3))),(3));
  1152. _st(self)._assert_(_st(d)._includesKey_(_st((1)).__at((3))));
  1153. _st(self)._deny_(_st(d)._includesKey_(_st((3)).__at((1))));
  1154. return self}, function($ctx1) {$ctx1.fill(self,"testAccessing",{d:d},smalltalk.DictionaryTest)})},
  1155. messageSends: ["new", "at:put:", "assert:equals:", "at:", "at:ifAbsent:", "deny:", "=", "assert:", "includesKey:", "@"]}),
  1156. smalltalk.DictionaryTest);
  1157. smalltalk.addMethod(
  1158. smalltalk.method({
  1159. selector: "testDynamicDictionaries",
  1160. fn: function (){
  1161. var self=this;
  1162. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  1163. return smalltalk.withContext(function($ctx1) {
  1164. _st(self)._assert_equals_(_st(smalltalk.HashedCollection._fromPairs_([_st("hello").__minus_gt((1))]))._asDictionary(),_st($Dictionary())._with_(_st("hello").__minus_gt((1))));
  1165. return self}, function($ctx1) {$ctx1.fill(self,"testDynamicDictionaries",{},smalltalk.DictionaryTest)})},
  1166. messageSends: ["assert:equals:", "asDictionary", "->", "with:"]}),
  1167. smalltalk.DictionaryTest);
  1168. smalltalk.addMethod(
  1169. smalltalk.method({
  1170. selector: "testEquality",
  1171. fn: function (){
  1172. var self=this;
  1173. var d1,d2;
  1174. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  1175. return smalltalk.withContext(function($ctx1) {
  1176. var $1,$2,$3,$4,$5,$6,$7,$8,$9,$10;
  1177. _st(self)._assert_(_st(_st($Dictionary())._new()).__eq(_st($Dictionary())._new()));
  1178. $1=_st($Dictionary())._new();
  1179. _st($1)._at_put_((1),(2));
  1180. $2=_st($1)._yourself();
  1181. d1=$2;
  1182. $3=_st($Dictionary())._new();
  1183. _st($3)._at_put_((1),(2));
  1184. $4=_st($3)._yourself();
  1185. d2=$4;
  1186. _st(self)._assert_(_st(d1).__eq(d2));
  1187. $5=_st($Dictionary())._new();
  1188. _st($5)._at_put_((1),(3));
  1189. $6=_st($5)._yourself();
  1190. d2=$6;
  1191. _st(self)._deny_(_st(d1).__eq(d2));
  1192. $7=_st($Dictionary())._new();
  1193. _st($7)._at_put_((2),(2));
  1194. $8=_st($7)._yourself();
  1195. d2=$8;
  1196. _st(self)._deny_(_st(d1).__eq(d2));
  1197. $9=_st($Dictionary())._new();
  1198. _st($9)._at_put_((1),(2));
  1199. _st($9)._at_put_((3),(4));
  1200. $10=_st($9)._yourself();
  1201. d2=$10;
  1202. _st(self)._deny_(_st(d1).__eq(d2));
  1203. return self}, function($ctx1) {$ctx1.fill(self,"testEquality",{d1:d1,d2:d2},smalltalk.DictionaryTest)})},
  1204. messageSends: ["assert:", "=", "new", "at:put:", "yourself", "deny:"]}),
  1205. smalltalk.DictionaryTest);
  1206. smalltalk.addMethod(
  1207. smalltalk.method({
  1208. selector: "testIfAbsent",
  1209. fn: function (){
  1210. var self=this;
  1211. var d,visited;
  1212. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  1213. return smalltalk.withContext(function($ctx1) {
  1214. visited=false;
  1215. d=_st($Dictionary())._new();
  1216. _st(d)._at_ifAbsent_("hello",(function(){
  1217. return smalltalk.withContext(function($ctx2) {
  1218. visited=true;
  1219. return visited;
  1220. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1221. _st(self)._assert_(visited);
  1222. return self}, function($ctx1) {$ctx1.fill(self,"testIfAbsent",{d:d,visited:visited},smalltalk.DictionaryTest)})},
  1223. messageSends: ["new", "at:ifAbsent:", "assert:"]}),
  1224. smalltalk.DictionaryTest);
  1225. smalltalk.addMethod(
  1226. smalltalk.method({
  1227. selector: "testIfPresent",
  1228. fn: function (){
  1229. var self=this;
  1230. var d,visited,absent;
  1231. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  1232. return smalltalk.withContext(function($ctx1) {
  1233. visited=false;
  1234. d=_st($Dictionary())._new();
  1235. _st(d)._at_put_("hello","world");
  1236. _st(d)._at_ifPresent_("hello",(function(value){
  1237. return smalltalk.withContext(function($ctx2) {
  1238. visited=value;
  1239. return visited;
  1240. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}));
  1241. _st(self)._assert_equals_(visited,"world");
  1242. absent=_st(d)._at_ifPresent_("bye",(function(value){
  1243. return smalltalk.withContext(function($ctx2) {
  1244. visited=value;
  1245. return visited;
  1246. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}));
  1247. _st(self)._assert_(_st(absent)._isNil());
  1248. return self}, function($ctx1) {$ctx1.fill(self,"testIfPresent",{d:d,visited:visited,absent:absent},smalltalk.DictionaryTest)})},
  1249. messageSends: ["new", "at:put:", "at:ifPresent:", "assert:equals:", "assert:", "isNil"]}),
  1250. smalltalk.DictionaryTest);
  1251. smalltalk.addMethod(
  1252. smalltalk.method({
  1253. selector: "testIfPresentIfAbsent",
  1254. fn: function (){
  1255. var self=this;
  1256. var d,visited;
  1257. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  1258. return smalltalk.withContext(function($ctx1) {
  1259. visited=false;
  1260. d=_st($Dictionary())._new();
  1261. _st(d)._at_put_("hello","world");
  1262. _st(d)._at_ifPresent_ifAbsent_("hello",(function(value){
  1263. return smalltalk.withContext(function($ctx2) {
  1264. visited=value;
  1265. return visited;
  1266. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}),(function(){
  1267. return smalltalk.withContext(function($ctx2) {
  1268. visited=true;
  1269. return visited;
  1270. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1271. _st(self)._assert_equals_(visited,"world");
  1272. _st(d)._at_ifPresent_ifAbsent_("buy",(function(value){
  1273. return smalltalk.withContext(function($ctx2) {
  1274. visited=value;
  1275. return visited;
  1276. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}),(function(){
  1277. return smalltalk.withContext(function($ctx2) {
  1278. visited=true;
  1279. return visited;
  1280. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1281. _st(self)._assert_(visited);
  1282. return self}, function($ctx1) {$ctx1.fill(self,"testIfPresentIfAbsent",{d:d,visited:visited},smalltalk.DictionaryTest)})},
  1283. messageSends: ["new", "at:put:", "at:ifPresent:ifAbsent:", "assert:equals:", "assert:"]}),
  1284. smalltalk.DictionaryTest);
  1285. smalltalk.addMethod(
  1286. smalltalk.method({
  1287. selector: "testKeys",
  1288. fn: function (){
  1289. var self=this;
  1290. var d;
  1291. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  1292. return smalltalk.withContext(function($ctx1) {
  1293. d=_st($Dictionary())._new();
  1294. _st(d)._at_put_((1),(2));
  1295. _st(d)._at_put_((2),(3));
  1296. _st(d)._at_put_((3),(4));
  1297. _st(self)._assert_equals_(_st(d)._keys(),[(1), (2), (3)]);
  1298. return self}, function($ctx1) {$ctx1.fill(self,"testKeys",{d:d},smalltalk.DictionaryTest)})},
  1299. messageSends: ["new", "at:put:", "assert:equals:", "keys"]}),
  1300. smalltalk.DictionaryTest);
  1301. smalltalk.addMethod(
  1302. smalltalk.method({
  1303. selector: "testPointKey",
  1304. fn: function (){
  1305. var self=this;
  1306. var d;
  1307. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  1308. return smalltalk.withContext(function($ctx1) {
  1309. d=_st($Dictionary())._new();
  1310. _st(d)._at_put_(_st((1)).__at((1)),"foo");
  1311. _st(self)._assert_equals_(_st(d)._at_(_st((1)).__at((1))),"foo");
  1312. _st(d)._at_put_(_st((1)).__at((1)),"bar");
  1313. _st(self)._assert_equals_(_st(d)._at_(_st((1)).__at((1))),"bar");
  1314. _st(d)._removeKey_(_st((1)).__at((1)));
  1315. _st(self)._assert_equals_(_st(d)._at_ifAbsent_(_st((1)).__at((1)),(function(){
  1316. return smalltalk.withContext(function($ctx2) {
  1317. return "baz";
  1318. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"baz");
  1319. _st(self)._deny_(_st(d)._includesKey_(_st((1)).__at((1))));
  1320. return self}, function($ctx1) {$ctx1.fill(self,"testPointKey",{d:d},smalltalk.DictionaryTest)})},
  1321. messageSends: ["new", "at:put:", "@", "assert:equals:", "at:", "removeKey:", "at:ifAbsent:", "deny:", "includesKey:"]}),
  1322. smalltalk.DictionaryTest);
  1323. smalltalk.addMethod(
  1324. smalltalk.method({
  1325. selector: "testPrintString",
  1326. fn: function (){
  1327. var self=this;
  1328. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  1329. return smalltalk.withContext(function($ctx1) {
  1330. var $1,$2;
  1331. $1=_st($Dictionary())._new();
  1332. _st($1)._at_put_("firstname","James");
  1333. _st($1)._at_put_("lastname","Bond");
  1334. $2=_st($1)._printString();
  1335. _st(self)._assert_equals_($2,"a Dictionary ('firstname' -> 'James' , 'lastname' -> 'Bond')");
  1336. return self}, function($ctx1) {$ctx1.fill(self,"testPrintString",{},smalltalk.DictionaryTest)})},
  1337. messageSends: ["assert:equals:", "at:put:", "new", "printString"]}),
  1338. smalltalk.DictionaryTest);
  1339. smalltalk.addMethod(
  1340. smalltalk.method({
  1341. selector: "testRemoveKey",
  1342. fn: function (){
  1343. var self=this;
  1344. var d,key;
  1345. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  1346. return smalltalk.withContext(function($ctx1) {
  1347. d=_st($Dictionary())._new();
  1348. _st(d)._at_put_((1),(2));
  1349. _st(d)._at_put_((2),(3));
  1350. _st(d)._at_put_((3),(4));
  1351. key=(2);
  1352. _st(self)._assert_equals_(_st(d)._keys(),[(1), (2), (3)]);
  1353. _st(d)._removeKey_(key);
  1354. _st(self)._assert_equals_(_st(d)._keys(),[(1), (3)]);
  1355. _st(self)._assert_equals_(_st(d)._values(),[(2), (4)]);
  1356. _st(self)._deny_(_st(d)._includesKey_((2)));
  1357. return self}, function($ctx1) {$ctx1.fill(self,"testRemoveKey",{d:d,key:key},smalltalk.DictionaryTest)})},
  1358. messageSends: ["new", "at:put:", "assert:equals:", "keys", "removeKey:", "values", "deny:", "includesKey:"]}),
  1359. smalltalk.DictionaryTest);
  1360. smalltalk.addMethod(
  1361. smalltalk.method({
  1362. selector: "testRemoveKeyIfAbsent",
  1363. fn: function (){
  1364. var self=this;
  1365. var d,key;
  1366. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  1367. return smalltalk.withContext(function($ctx1) {
  1368. d=_st($Dictionary())._new();
  1369. _st(d)._at_put_((1),(2));
  1370. _st(d)._at_put_((2),(3));
  1371. _st(d)._at_put_((3),(4));
  1372. key=(2);
  1373. _st(self)._assert_equals_(_st(d)._removeKey_(key),(3));
  1374. key=(3);
  1375. _st(self)._assert_equals_(_st(d)._removeKey_ifAbsent_(key,(function(){
  1376. return smalltalk.withContext(function($ctx2) {
  1377. return (42);
  1378. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),(4));
  1379. key="why";
  1380. _st(self)._assert_equals_(_st(d)._removeKey_ifAbsent_(key,(function(){
  1381. return smalltalk.withContext(function($ctx2) {
  1382. return (42);
  1383. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),(42));
  1384. return self}, function($ctx1) {$ctx1.fill(self,"testRemoveKeyIfAbsent",{d:d,key:key},smalltalk.DictionaryTest)})},
  1385. messageSends: ["new", "at:put:", "assert:equals:", "removeKey:", "removeKey:ifAbsent:"]}),
  1386. smalltalk.DictionaryTest);
  1387. smalltalk.addMethod(
  1388. smalltalk.method({
  1389. selector: "testSize",
  1390. fn: function (){
  1391. var self=this;
  1392. var d;
  1393. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  1394. return smalltalk.withContext(function($ctx1) {
  1395. d=_st($Dictionary())._new();
  1396. _st(self)._assert_equals_(_st(d)._size(),(0));
  1397. _st(d)._at_put_((1),(2));
  1398. _st(self)._assert_equals_(_st(d)._size(),(1));
  1399. _st(d)._at_put_((2),(3));
  1400. _st(self)._assert_equals_(_st(d)._size(),(2));
  1401. return self}, function($ctx1) {$ctx1.fill(self,"testSize",{d:d},smalltalk.DictionaryTest)})},
  1402. messageSends: ["new", "assert:equals:", "size", "at:put:"]}),
  1403. smalltalk.DictionaryTest);
  1404. smalltalk.addMethod(
  1405. smalltalk.method({
  1406. selector: "testValues",
  1407. fn: function (){
  1408. var self=this;
  1409. var d;
  1410. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  1411. return smalltalk.withContext(function($ctx1) {
  1412. d=_st($Dictionary())._new();
  1413. _st(d)._at_put_((1),(2));
  1414. _st(d)._at_put_((2),(3));
  1415. _st(d)._at_put_((3),(4));
  1416. _st(self)._assert_equals_(_st(d)._values(),[(2), (3), (4)]);
  1417. return self}, function($ctx1) {$ctx1.fill(self,"testValues",{d:d},smalltalk.DictionaryTest)})},
  1418. messageSends: ["new", "at:put:", "assert:equals:", "values"]}),
  1419. smalltalk.DictionaryTest);
  1420. smalltalk.addMethod(
  1421. smalltalk.method({
  1422. selector: "collectionClass",
  1423. fn: function (){
  1424. var self=this;
  1425. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  1426. return smalltalk.withContext(function($ctx1) {
  1427. var $1;
  1428. $1=$Dictionary();
  1429. return $1;
  1430. }, function($ctx1) {$ctx1.fill(self,"collectionClass",{},smalltalk.DictionaryTest.klass)})},
  1431. messageSends: []}),
  1432. smalltalk.DictionaryTest.klass);
  1433. smalltalk.addClass('SequenceableCollectionTest', smalltalk.IndexableCollectionTest, [], 'Kernel-Tests');
  1434. smalltalk.addClass('ArrayTest', smalltalk.SequenceableCollectionTest, [], 'Kernel-Tests');
  1435. smalltalk.addMethod(
  1436. smalltalk.method({
  1437. selector: "testAtIfAbsent",
  1438. fn: function (){
  1439. var self=this;
  1440. var array;
  1441. return smalltalk.withContext(function($ctx1) {
  1442. array=["hello", "world"];
  1443. _st(self)._assert_equals_(_st(array)._at_((1)),"hello");
  1444. _st(self)._assert_equals_(_st(array)._at_((2)),"world");
  1445. _st(self)._assert_equals_(_st(array)._at_ifAbsent_((2),(function(){
  1446. return smalltalk.withContext(function($ctx2) {
  1447. return "not found";
  1448. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"world");
  1449. _st(self)._assert_equals_(_st(array)._at_ifAbsent_((0),(function(){
  1450. return smalltalk.withContext(function($ctx2) {
  1451. return "not found";
  1452. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"not found");
  1453. _st(self)._assert_equals_(_st(array)._at_ifAbsent_((-10),(function(){
  1454. return smalltalk.withContext(function($ctx2) {
  1455. return "not found";
  1456. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"not found");
  1457. _st(self)._assert_equals_(_st(array)._at_ifAbsent_((3),(function(){
  1458. return smalltalk.withContext(function($ctx2) {
  1459. return "not found";
  1460. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"not found");
  1461. return self}, function($ctx1) {$ctx1.fill(self,"testAtIfAbsent",{array:array},smalltalk.ArrayTest)})},
  1462. messageSends: ["assert:equals:", "at:", "at:ifAbsent:"]}),
  1463. smalltalk.ArrayTest);
  1464. smalltalk.addMethod(
  1465. smalltalk.method({
  1466. selector: "testFirstN",
  1467. fn: function (){
  1468. var self=this;
  1469. return smalltalk.withContext(function($ctx1) {
  1470. _st(self)._assert_equals_(_st([(1),(2),(3),(4),(5)])._first_((3)),[(1),(2),(3)]);
  1471. return self}, function($ctx1) {$ctx1.fill(self,"testFirstN",{},smalltalk.ArrayTest)})},
  1472. messageSends: ["assert:equals:", "first:"]}),
  1473. smalltalk.ArrayTest);
  1474. smalltalk.addMethod(
  1475. smalltalk.method({
  1476. selector: "testIfEmpty",
  1477. fn: function (){
  1478. var self=this;
  1479. return smalltalk.withContext(function($ctx1) {
  1480. _st(self)._assert_equals_(_st("")._ifEmpty_((function(){
  1481. return smalltalk.withContext(function($ctx2) {
  1482. return "zork";
  1483. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"zork");
  1484. return self}, function($ctx1) {$ctx1.fill(self,"testIfEmpty",{},smalltalk.ArrayTest)})},
  1485. messageSends: ["assert:equals:", "ifEmpty:"]}),
  1486. smalltalk.ArrayTest);
  1487. smalltalk.addMethod(
  1488. smalltalk.method({
  1489. selector: "testPrintString",
  1490. fn: function (){
  1491. var self=this;
  1492. var array;
  1493. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  1494. return smalltalk.withContext(function($ctx1) {
  1495. var $1,$2,$3,$4;
  1496. array=_st($Array())._new();
  1497. _st(self)._assert_equals_(_st(array)._printString(),"an Array ()");
  1498. $1=array;
  1499. _st($1)._add_((1));
  1500. $2=_st($1)._add_((3));
  1501. _st(self)._assert_equals_(_st(array)._printString(),"an Array (1 3)");
  1502. _st(array)._add_("foo");
  1503. _st(self)._assert_equals_(_st(array)._printString(),"an Array (1 3 'foo')");
  1504. $3=array;
  1505. _st($3)._remove_((1));
  1506. $4=_st($3)._remove_((3));
  1507. _st(self)._assert_equals_(_st(array)._printString(),"an Array ('foo')");
  1508. _st(array)._addLast_((3));
  1509. _st(self)._assert_equals_(_st(array)._printString(),"an Array ('foo' 3)");
  1510. _st(array)._addLast_((3));
  1511. _st(self)._assert_equals_(_st(array)._printString(),"an Array ('foo' 3 3)");
  1512. return self}, function($ctx1) {$ctx1.fill(self,"testPrintString",{array:array},smalltalk.ArrayTest)})},
  1513. messageSends: ["new", "assert:equals:", "printString", "add:", "remove:", "addLast:"]}),
  1514. smalltalk.ArrayTest);
  1515. smalltalk.addMethod(
  1516. smalltalk.method({
  1517. selector: "collectionClass",
  1518. fn: function (){
  1519. var self=this;
  1520. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  1521. return smalltalk.withContext(function($ctx1) {
  1522. var $1;
  1523. $1=$Array();
  1524. return $1;
  1525. }, function($ctx1) {$ctx1.fill(self,"collectionClass",{},smalltalk.ArrayTest.klass)})},
  1526. messageSends: []}),
  1527. smalltalk.ArrayTest.klass);
  1528. smalltalk.addClass('StringTest', smalltalk.SequenceableCollectionTest, [], 'Kernel-Tests');
  1529. smalltalk.addMethod(
  1530. smalltalk.method({
  1531. selector: "collection",
  1532. fn: function (){
  1533. var self=this;
  1534. return smalltalk.withContext(function($ctx1) {
  1535. return "hello";
  1536. }, function($ctx1) {$ctx1.fill(self,"collection",{},smalltalk.StringTest)})},
  1537. messageSends: []}),
  1538. smalltalk.StringTest);
  1539. smalltalk.addMethod(
  1540. smalltalk.method({
  1541. selector: "collectionWithDuplicates",
  1542. fn: function (){
  1543. var self=this;
  1544. return smalltalk.withContext(function($ctx1) {
  1545. return "abbaerte";
  1546. }, function($ctx1) {$ctx1.fill(self,"collectionWithDuplicates",{},smalltalk.StringTest)})},
  1547. messageSends: []}),
  1548. smalltalk.StringTest);
  1549. smalltalk.addMethod(
  1550. smalltalk.method({
  1551. selector: "testAddRemove",
  1552. fn: function (){
  1553. var self=this;
  1554. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  1555. return smalltalk.withContext(function($ctx1) {
  1556. _st(self)._should_raise_((function(){
  1557. return smalltalk.withContext(function($ctx2) {
  1558. return _st("hello")._add_("a");
  1559. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$Error());
  1560. _st(self)._should_raise_((function(){
  1561. return smalltalk.withContext(function($ctx2) {
  1562. return _st("hello")._remove_("h");
  1563. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$Error());
  1564. return self}, function($ctx1) {$ctx1.fill(self,"testAddRemove",{},smalltalk.StringTest)})},
  1565. messageSends: ["should:raise:", "add:", "remove:"]}),
  1566. smalltalk.StringTest);
  1567. smalltalk.addMethod(
  1568. smalltalk.method({
  1569. selector: "testAsArray",
  1570. fn: function (){
  1571. var self=this;
  1572. return smalltalk.withContext(function($ctx1) {
  1573. _st(self)._assert_equals_(_st("hello")._asArray(),["h", "e", "l", "l", "o"]);
  1574. return self}, function($ctx1) {$ctx1.fill(self,"testAsArray",{},smalltalk.StringTest)})},
  1575. messageSends: ["assert:equals:", "asArray"]}),
  1576. smalltalk.StringTest);
  1577. smalltalk.addMethod(
  1578. smalltalk.method({
  1579. selector: "testAt",
  1580. fn: function (){
  1581. var self=this;
  1582. return smalltalk.withContext(function($ctx1) {
  1583. _st(self)._assert_equals_(_st("hello")._at_((1)),"h");
  1584. _st(self)._assert_equals_(_st("hello")._at_((5)),"o");
  1585. _st(self)._assert_equals_(_st("hello")._at_ifAbsent_((6),(function(){
  1586. return smalltalk.withContext(function($ctx2) {
  1587. return nil;
  1588. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),nil);
  1589. return self}, function($ctx1) {$ctx1.fill(self,"testAt",{},smalltalk.StringTest)})},
  1590. messageSends: ["assert:equals:", "at:", "at:ifAbsent:"]}),
  1591. smalltalk.StringTest);
  1592. smalltalk.addMethod(
  1593. smalltalk.method({
  1594. selector: "testAtPut",
  1595. fn: function (){
  1596. var self=this;
  1597. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  1598. return smalltalk.withContext(function($ctx1) {
  1599. _st(self)._should_raise_((function(){
  1600. return smalltalk.withContext(function($ctx2) {
  1601. return _st("hello")._at_put_((1),"a");
  1602. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$Error());
  1603. return self}, function($ctx1) {$ctx1.fill(self,"testAtPut",{},smalltalk.StringTest)})},
  1604. messageSends: ["should:raise:", "at:put:"]}),
  1605. smalltalk.StringTest);
  1606. smalltalk.addMethod(
  1607. smalltalk.method({
  1608. selector: "testCollect",
  1609. fn: function (){
  1610. var self=this;
  1611. var newCollection;
  1612. return smalltalk.withContext(function($ctx1) {
  1613. newCollection="hheelllloo";
  1614. _st(self)._assertSameContents_as_(_st(_st(self)._collection())._collect_((function(each){
  1615. return smalltalk.withContext(function($ctx2) {
  1616. return _st(each).__comma(each);
  1617. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})),newCollection);
  1618. return self}, function($ctx1) {$ctx1.fill(self,"testCollect",{newCollection:newCollection},smalltalk.StringTest)})},
  1619. messageSends: ["assertSameContents:as:", "collect:", ",", "collection"]}),
  1620. smalltalk.StringTest);
  1621. smalltalk.addMethod(
  1622. smalltalk.method({
  1623. selector: "testCopyWithoutAll",
  1624. fn: function (){
  1625. var self=this;
  1626. return smalltalk.withContext(function($ctx1) {
  1627. _st(self)._assert_equals_(_st("*hello* *world*")._copyWithoutAll_("*"),"hello world");
  1628. return self}, function($ctx1) {$ctx1.fill(self,"testCopyWithoutAll",{},smalltalk.StringTest)})},
  1629. messageSends: ["assert:equals:", "copyWithoutAll:"]}),
  1630. smalltalk.StringTest);
  1631. smalltalk.addMethod(
  1632. smalltalk.method({
  1633. selector: "testDetect",
  1634. fn: function (){
  1635. var self=this;
  1636. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  1637. return smalltalk.withContext(function($ctx1) {
  1638. _st(self)._assert_equals_(_st(_st(self)._collection())._detect_((function(each){
  1639. return smalltalk.withContext(function($ctx2) {
  1640. return _st(each).__eq("h");
  1641. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})),"h");
  1642. _st(self)._should_raise_((function(){
  1643. return smalltalk.withContext(function($ctx2) {
  1644. return _st(_st(self)._collection())._detect_((function(each){
  1645. return smalltalk.withContext(function($ctx3) {
  1646. return _st(each).__eq((6));
  1647. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  1648. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$Error());
  1649. return self}, function($ctx1) {$ctx1.fill(self,"testDetect",{},smalltalk.StringTest)})},
  1650. messageSends: ["assert:equals:", "detect:", "=", "collection", "should:raise:"]}),
  1651. smalltalk.StringTest);
  1652. smalltalk.addMethod(
  1653. smalltalk.method({
  1654. selector: "testEquality",
  1655. fn: function (){
  1656. var self=this;
  1657. return smalltalk.withContext(function($ctx1) {
  1658. _st(self)._assert_equals_("hello","hello");
  1659. _st(self)._deny_(_st("hello").__eq("world"));
  1660. _st(self)._deny_(_st("hello").__eq(_st([])._at_ifAbsent_((1),(function(){
  1661. return smalltalk.withContext(function($ctx2) {
  1662. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))));
  1663. _st(self)._assert_equals_("hello",_st("hello")._yourself());
  1664. _st(self)._assert_equals_(_st("hello")._yourself(),"hello");
  1665. _st(self)._deny_(_st("").__eq((0)));
  1666. return self}, function($ctx1) {$ctx1.fill(self,"testEquality",{},smalltalk.StringTest)})},
  1667. messageSends: ["assert:equals:", "deny:", "=", "at:ifAbsent:", "yourself"]}),
  1668. smalltalk.StringTest);
  1669. smalltalk.addMethod(
  1670. smalltalk.method({
  1671. selector: "testIdentity",
  1672. fn: function (){
  1673. var self=this;
  1674. return smalltalk.withContext(function($ctx1) {
  1675. _st(self)._assert_(_st("hello").__eq_eq("hello"));
  1676. _st(self)._deny_(_st("hello").__eq_eq("world"));
  1677. _st(self)._assert_(_st("hello").__eq_eq(_st("hello")._yourself()));
  1678. _st(self)._assert_(_st(_st("hello")._yourself()).__eq_eq("hello"));
  1679. _st(self)._deny_(_st("").__eq_eq((0)));
  1680. return self}, function($ctx1) {$ctx1.fill(self,"testIdentity",{},smalltalk.StringTest)})},
  1681. messageSends: ["assert:", "==", "deny:", "yourself"]}),
  1682. smalltalk.StringTest);
  1683. smalltalk.addMethod(
  1684. smalltalk.method({
  1685. selector: "testIncludesSubString",
  1686. fn: function (){
  1687. var self=this;
  1688. return smalltalk.withContext(function($ctx1) {
  1689. _st(self)._assert_(_st("amber")._includesSubString_("ber"));
  1690. _st(self)._deny_(_st("amber")._includesSubString_("zork"));
  1691. return self}, function($ctx1) {$ctx1.fill(self,"testIncludesSubString",{},smalltalk.StringTest)})},
  1692. messageSends: ["assert:", "includesSubString:", "deny:"]}),
  1693. smalltalk.StringTest);
  1694. smalltalk.addMethod(
  1695. smalltalk.method({
  1696. selector: "testIndexOf",
  1697. fn: function (){
  1698. var self=this;
  1699. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  1700. return smalltalk.withContext(function($ctx1) {
  1701. _st(self)._assert_equals_(_st(_st(self)._collection())._indexOf_("e"),(2));
  1702. _st(self)._should_raise_((function(){
  1703. return smalltalk.withContext(function($ctx2) {
  1704. return _st(_st(self)._collection())._indexOf_((999));
  1705. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$Error());
  1706. _st(self)._assert_equals_(_st(_st(self)._collection())._indexOf_ifAbsent_((999),(function(){
  1707. return smalltalk.withContext(function($ctx2) {
  1708. return "sentinel";
  1709. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"sentinel");
  1710. return self}, function($ctx1) {$ctx1.fill(self,"testIndexOf",{},smalltalk.StringTest)})},
  1711. messageSends: ["assert:equals:", "indexOf:", "collection", "should:raise:", "indexOf:ifAbsent:"]}),
  1712. smalltalk.StringTest);
  1713. smalltalk.addMethod(
  1714. smalltalk.method({
  1715. selector: "testJoin",
  1716. fn: function (){
  1717. var self=this;
  1718. return smalltalk.withContext(function($ctx1) {
  1719. _st(self)._assert_equals_(_st(",")._join_(["hello", "world"]),"hello,world");
  1720. return self}, function($ctx1) {$ctx1.fill(self,"testJoin",{},smalltalk.StringTest)})},
  1721. messageSends: ["assert:equals:", "join:"]}),
  1722. smalltalk.StringTest);
  1723. smalltalk.addMethod(
  1724. smalltalk.method({
  1725. selector: "testSelect",
  1726. fn: function (){
  1727. var self=this;
  1728. var newCollection;
  1729. return smalltalk.withContext(function($ctx1) {
  1730. newCollection="o";
  1731. _st(self)._assertSameContents_as_(_st(_st(self)._collection())._select_((function(each){
  1732. return smalltalk.withContext(function($ctx2) {
  1733. return _st(each).__eq("o");
  1734. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})),newCollection);
  1735. return self}, function($ctx1) {$ctx1.fill(self,"testSelect",{newCollection:newCollection},smalltalk.StringTest)})},
  1736. messageSends: ["assertSameContents:as:", "select:", "=", "collection"]}),
  1737. smalltalk.StringTest);
  1738. smalltalk.addMethod(
  1739. smalltalk.method({
  1740. selector: "testSize",
  1741. fn: function (){
  1742. var self=this;
  1743. return smalltalk.withContext(function($ctx1) {
  1744. _st(self)._assert_equals_(_st("smalltalk")._size(),(9));
  1745. _st(self)._assert_equals_(_st("")._size(),(0));
  1746. return self}, function($ctx1) {$ctx1.fill(self,"testSize",{},smalltalk.StringTest)})},
  1747. messageSends: ["assert:equals:", "size"]}),
  1748. smalltalk.StringTest);
  1749. smalltalk.addMethod(
  1750. smalltalk.method({
  1751. selector: "testStreamContents",
  1752. fn: function (){
  1753. var self=this;
  1754. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  1755. return smalltalk.withContext(function($ctx1) {
  1756. var $1,$2;
  1757. _st(self)._assert_equals_(_st($String())._streamContents_((function(aStream){
  1758. return smalltalk.withContext(function($ctx2) {
  1759. $1=aStream;
  1760. _st($1)._nextPutAll_("hello");
  1761. _st($1)._space();
  1762. $2=_st($1)._nextPutAll_("world");
  1763. return $2;
  1764. }, function($ctx2) {$ctx2.fillBlock({aStream:aStream},$ctx1)})})),"hello world");
  1765. return self}, function($ctx1) {$ctx1.fill(self,"testStreamContents",{},smalltalk.StringTest)})},
  1766. messageSends: ["assert:equals:", "streamContents:", "nextPutAll:", "space"]}),
  1767. smalltalk.StringTest);
  1768. smalltalk.addMethod(
  1769. smalltalk.method({
  1770. selector: "collectionClass",
  1771. fn: function (){
  1772. var self=this;
  1773. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  1774. return smalltalk.withContext(function($ctx1) {
  1775. var $1;
  1776. $1=$String();
  1777. return $1;
  1778. }, function($ctx1) {$ctx1.fill(self,"collectionClass",{},smalltalk.StringTest.klass)})},
  1779. messageSends: []}),
  1780. smalltalk.StringTest.klass);
  1781. smalltalk.addClass('ConsoleTranscriptTest', smalltalk.TestCase, [], 'Kernel-Tests');
  1782. smalltalk.addMethod(
  1783. smalltalk.method({
  1784. selector: "testShow",
  1785. fn: function (){
  1786. var self=this;
  1787. var originalTranscript;
  1788. function $Transcript(){return smalltalk.Transcript||(typeof Transcript=="undefined"?nil:Transcript)}
  1789. function $ConsoleTranscript(){return smalltalk.ConsoleTranscript||(typeof ConsoleTranscript=="undefined"?nil:ConsoleTranscript)}
  1790. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  1791. return smalltalk.withContext(function($ctx1) {
  1792. originalTranscript=_st($Transcript())._current();
  1793. _st($Transcript())._register_(_st($ConsoleTranscript())._new());
  1794. _st(self)._shouldnt_raise_((function(){
  1795. return smalltalk.withContext(function($ctx2) {
  1796. return _st($Transcript())._show_("Hello console!");
  1797. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$Error());
  1798. _st(self)._shouldnt_raise_((function(){
  1799. return smalltalk.withContext(function($ctx2) {
  1800. return _st($Transcript())._show_(console);
  1801. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$Error());
  1802. _st($Transcript())._register_(originalTranscript);
  1803. return self}, function($ctx1) {$ctx1.fill(self,"testShow",{originalTranscript:originalTranscript},smalltalk.ConsoleTranscriptTest)})},
  1804. messageSends: ["current", "register:", "new", "shouldnt:raise:", "show:"]}),
  1805. smalltalk.ConsoleTranscriptTest);
  1806. smalltalk.addClass('JSObjectProxyTest', smalltalk.TestCase, [], 'Kernel-Tests');
  1807. smalltalk.addMethod(
  1808. smalltalk.method({
  1809. selector: "jsObject",
  1810. fn: function (){
  1811. var self=this;
  1812. return smalltalk.withContext(function($ctx1) {
  1813. return jsObject = {a: 1, b: function() {return 2;}, c: function(object) {return object;}, d: '', 'e': null, 'f': undefined};
  1814. return self}, function($ctx1) {$ctx1.fill(self,"jsObject",{},smalltalk.JSObjectProxyTest)})},
  1815. messageSends: []}),
  1816. smalltalk.JSObjectProxyTest);
  1817. smalltalk.addMethod(
  1818. smalltalk.method({
  1819. selector: "testAtIfAbsent",
  1820. fn: function (){
  1821. var self=this;
  1822. var testObject;
  1823. return smalltalk.withContext(function($ctx1) {
  1824. testObject=_st(self)._jsObject();
  1825. _st(self)._assert_equals_(_st(testObject)._at_ifAbsent_("abc",(function(){
  1826. return smalltalk.withContext(function($ctx2) {
  1827. return "Property does not exist";
  1828. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"Property does not exist");
  1829. _st(self)._assert_equals_(_st(testObject)._at_ifAbsent_("e",(function(){
  1830. return smalltalk.withContext(function($ctx2) {
  1831. return "Property does not exist";
  1832. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),nil);
  1833. _st(self)._assert_equals_(_st(testObject)._at_ifAbsent_("a",(function(){
  1834. return smalltalk.withContext(function($ctx2) {
  1835. return "Property does not exist";
  1836. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),(1));
  1837. _st(self)._assert_equals_(_st(testObject)._at_ifAbsent_("f",(function(){
  1838. return smalltalk.withContext(function($ctx2) {
  1839. return "Property does not exist";
  1840. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),nil);
  1841. return self}, function($ctx1) {$ctx1.fill(self,"testAtIfAbsent",{testObject:testObject},smalltalk.JSObjectProxyTest)})},
  1842. messageSends: ["jsObject", "assert:equals:", "at:ifAbsent:"]}),
  1843. smalltalk.JSObjectProxyTest);
  1844. smalltalk.addMethod(
  1845. smalltalk.method({
  1846. selector: "testAtIfPresent",
  1847. fn: function (){
  1848. var self=this;
  1849. var testObject;
  1850. return smalltalk.withContext(function($ctx1) {
  1851. testObject=_st(self)._jsObject();
  1852. _st(self)._assert_equals_(_st(testObject)._at_ifPresent_("abc",(function(x){
  1853. return smalltalk.withContext(function($ctx2) {
  1854. return _st("hello ").__comma(_st(x)._asString());
  1855. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})})),nil);
  1856. _st(self)._assert_equals_(_st(testObject)._at_ifPresent_("e",(function(x){
  1857. return smalltalk.withContext(function($ctx2) {
  1858. return _st("hello ").__comma(_st(x)._asString());
  1859. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})})),"hello nil");
  1860. _st(self)._assert_equals_(_st(testObject)._at_ifPresent_("a",(function(x){
  1861. return smalltalk.withContext(function($ctx2) {
  1862. return _st("hello ").__comma(_st(x)._asString());
  1863. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})})),"hello 1");
  1864. _st(self)._assert_equals_(_st(testObject)._at_ifPresent_("f",(function(x){
  1865. return smalltalk.withContext(function($ctx2) {
  1866. return _st("hello ").__comma(_st(x)._asString());
  1867. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})})),"hello nil");
  1868. return self}, function($ctx1) {$ctx1.fill(self,"testAtIfPresent",{testObject:testObject},smalltalk.JSObjectProxyTest)})},
  1869. messageSends: ["jsObject", "assert:equals:", "at:ifPresent:", ",", "asString"]}),
  1870. smalltalk.JSObjectProxyTest);
  1871. smalltalk.addMethod(
  1872. smalltalk.method({
  1873. selector: "testAtIfPresentIfAbsent",
  1874. fn: function (){
  1875. var self=this;
  1876. var testObject;
  1877. return smalltalk.withContext(function($ctx1) {
  1878. testObject=_st(self)._jsObject();
  1879. _st(self)._assert_equals_(_st(testObject)._at_ifPresent_ifAbsent_("abc",(function(x){
  1880. return smalltalk.withContext(function($ctx2) {
  1881. return _st("hello ").__comma(_st(x)._asString());
  1882. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})}),(function(){
  1883. return smalltalk.withContext(function($ctx2) {
  1884. return "not present";
  1885. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"not present");
  1886. _st(self)._assert_equals_(_st(testObject)._at_ifPresent_ifAbsent_("e",(function(x){
  1887. return smalltalk.withContext(function($ctx2) {
  1888. return _st("hello ").__comma(_st(x)._asString());
  1889. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})}),(function(){
  1890. return smalltalk.withContext(function($ctx2) {
  1891. return "not present";
  1892. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"hello nil");
  1893. _st(self)._assert_equals_(_st(testObject)._at_ifPresent_ifAbsent_("a",(function(x){
  1894. return smalltalk.withContext(function($ctx2) {
  1895. return _st("hello ").__comma(_st(x)._asString());
  1896. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})}),(function(){
  1897. return smalltalk.withContext(function($ctx2) {
  1898. return "not present";
  1899. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"hello 1");
  1900. _st(self)._assert_equals_(_st(testObject)._at_ifPresent_ifAbsent_("f",(function(x){
  1901. return smalltalk.withContext(function($ctx2) {
  1902. return _st("hello ").__comma(_st(x)._asString());
  1903. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})}),(function(){
  1904. return smalltalk.withContext(function($ctx2) {
  1905. return "not present";
  1906. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"hello nil");
  1907. return self}, function($ctx1) {$ctx1.fill(self,"testAtIfPresentIfAbsent",{testObject:testObject},smalltalk.JSObjectProxyTest)})},
  1908. messageSends: ["jsObject", "assert:equals:", "at:ifPresent:ifAbsent:", ",", "asString"]}),
  1909. smalltalk.JSObjectProxyTest);
  1910. smalltalk.addMethod(
  1911. smalltalk.method({
  1912. selector: "testDNU",
  1913. fn: function (){
  1914. var self=this;
  1915. function $MessageNotUnderstood(){return smalltalk.MessageNotUnderstood||(typeof MessageNotUnderstood=="undefined"?nil:MessageNotUnderstood)}
  1916. return smalltalk.withContext(function($ctx1) {
  1917. _st(self)._should_raise_((function(){
  1918. return smalltalk.withContext(function($ctx2) {
  1919. return _st(_st(self)._jsObject())._foo();
  1920. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  1921. return self}, function($ctx1) {$ctx1.fill(self,"testDNU",{},smalltalk.JSObjectProxyTest)})},
  1922. messageSends: ["should:raise:", "foo", "jsObject"]}),
  1923. smalltalk.JSObjectProxyTest);
  1924. smalltalk.addMethod(
  1925. smalltalk.method({
  1926. selector: "testMessageSend",
  1927. fn: function (){
  1928. var self=this;
  1929. return smalltalk.withContext(function($ctx1) {
  1930. _st(self)._assert_equals_(_st(_st(self)._jsObject())._a(),(1));
  1931. _st(self)._assert_equals_(_st(_st(self)._jsObject())._b(),(2));
  1932. _st(self)._assert_equals_(_st(_st(self)._jsObject())._c_((3)),(3));
  1933. return self}, function($ctx1) {$ctx1.fill(self,"testMessageSend",{},smalltalk.JSObjectProxyTest)})},
  1934. messageSends: ["assert:equals:", "a", "jsObject", "b", "c:"]}),
  1935. smalltalk.JSObjectProxyTest);
  1936. smalltalk.addMethod(
  1937. smalltalk.method({
  1938. selector: "testMethodWithArguments",
  1939. fn: function (){
  1940. var self=this;
  1941. return smalltalk.withContext(function($ctx1) {
  1942. _st(self)._assert_equals_(_st(_st(self)._jsObject())._c_((1)),(1));
  1943. return self}, function($ctx1) {$ctx1.fill(self,"testMethodWithArguments",{},smalltalk.JSObjectProxyTest)})},
  1944. messageSends: ["assert:equals:", "c:", "jsObject"]}),
  1945. smalltalk.JSObjectProxyTest);
  1946. smalltalk.addMethod(
  1947. smalltalk.method({
  1948. selector: "testPrinting",
  1949. fn: function (){
  1950. var self=this;
  1951. return smalltalk.withContext(function($ctx1) {
  1952. _st(self)._assert_equals_(_st(_st(self)._jsObject())._printString(),"[object Object]");
  1953. return self}, function($ctx1) {$ctx1.fill(self,"testPrinting",{},smalltalk.JSObjectProxyTest)})},
  1954. messageSends: ["assert:equals:", "printString", "jsObject"]}),
  1955. smalltalk.JSObjectProxyTest);
  1956. smalltalk.addMethod(
  1957. smalltalk.method({
  1958. selector: "testPropertyThatReturnsEmptyString",
  1959. fn: function (){
  1960. var self=this;
  1961. var object;
  1962. return smalltalk.withContext(function($ctx1) {
  1963. object=_st(self)._jsObject();
  1964. _st(self)._assert_equals_(_st(object)._d(),"");
  1965. _st(object)._d_("hello");
  1966. _st(self)._assert_equals_(_st(object)._d(),"hello");
  1967. return self}, function($ctx1) {$ctx1.fill(self,"testPropertyThatReturnsEmptyString",{object:object},smalltalk.JSObjectProxyTest)})},
  1968. messageSends: ["jsObject", "assert:equals:", "d", "d:"]}),
  1969. smalltalk.JSObjectProxyTest);
  1970. smalltalk.addMethod(
  1971. smalltalk.method({
  1972. selector: "testPropertyThatReturnsUndefined",
  1973. fn: function (){
  1974. var self=this;
  1975. var object;
  1976. function $MessageNotUnderstood(){return smalltalk.MessageNotUnderstood||(typeof MessageNotUnderstood=="undefined"?nil:MessageNotUnderstood)}
  1977. return smalltalk.withContext(function($ctx1) {
  1978. object=_st(self)._jsObject();
  1979. _st(self)._shouldnt_raise_((function(){
  1980. return smalltalk.withContext(function($ctx2) {
  1981. return _st(object)._e();
  1982. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  1983. _st(self)._assert_(_st(_st(object)._e())._isNil());
  1984. return self}, function($ctx1) {$ctx1.fill(self,"testPropertyThatReturnsUndefined",{object:object},smalltalk.JSObjectProxyTest)})},
  1985. messageSends: ["jsObject", "shouldnt:raise:", "e", "assert:", "isNil"]}),
  1986. smalltalk.JSObjectProxyTest);
  1987. smalltalk.addMethod(
  1988. smalltalk.method({
  1989. selector: "testValue",
  1990. fn: function (){
  1991. var self=this;
  1992. var testObject;
  1993. return smalltalk.withContext(function($ctx1) {
  1994. testObject=_st(self)._jsObject();
  1995. _st(self)._assert_equals_(_st(_st(testObject)._value())._printString(),"[object Object]");
  1996. _st(testObject)._at_put_("value","aValue");
  1997. _st(self)._assert_equals_(_st(testObject)._value(),"aValue");
  1998. return self}, function($ctx1) {$ctx1.fill(self,"testValue",{testObject:testObject},smalltalk.JSObjectProxyTest)})},
  1999. messageSends: ["jsObject", "assert:equals:", "printString", "value", "at:put:"]}),
  2000. smalltalk.JSObjectProxyTest);
  2001. smalltalk.addMethod(
  2002. smalltalk.method({
  2003. selector: "testYourself",
  2004. fn: function (){
  2005. var self=this;
  2006. var object;
  2007. return smalltalk.withContext(function($ctx1) {
  2008. var $1,$2;
  2009. $1=_st(self)._jsObject();
  2010. _st($1)._d_("test");
  2011. $2=_st($1)._yourself();
  2012. object=$2;
  2013. _st(self)._assert_equals_(_st(object)._d(),"test");
  2014. return self}, function($ctx1) {$ctx1.fill(self,"testYourself",{object:object},smalltalk.JSObjectProxyTest)})},
  2015. messageSends: ["d:", "jsObject", "yourself", "assert:equals:", "d"]}),
  2016. smalltalk.JSObjectProxyTest);
  2017. smalltalk.addClass('JavaScriptExceptionTest', smalltalk.TestCase, [], 'Kernel-Tests');
  2018. smalltalk.addMethod(
  2019. smalltalk.method({
  2020. selector: "testCatchingException",
  2021. fn: function (){
  2022. var self=this;
  2023. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  2024. return smalltalk.withContext(function($ctx1) {
  2025. _st((function(){
  2026. return smalltalk.withContext(function($ctx2) {
  2027. return _st(self)._throwException();
  2028. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_($Error(),(function(error){
  2029. return smalltalk.withContext(function($ctx2) {
  2030. return _st(self)._assert_(_st(_st(error)._exception()).__eq("test"));
  2031. }, function($ctx2) {$ctx2.fillBlock({error:error},$ctx1)})}));
  2032. return self}, function($ctx1) {$ctx1.fill(self,"testCatchingException",{},smalltalk.JavaScriptExceptionTest)})},
  2033. messageSends: ["on:do:", "assert:", "=", "exception", "throwException"]}),
  2034. smalltalk.JavaScriptExceptionTest);
  2035. smalltalk.addMethod(
  2036. smalltalk.method({
  2037. selector: "testRaisingException",
  2038. fn: function (){
  2039. var self=this;
  2040. function $JavaScriptException(){return smalltalk.JavaScriptException||(typeof JavaScriptException=="undefined"?nil:JavaScriptException)}
  2041. return smalltalk.withContext(function($ctx1) {
  2042. _st(self)._should_raise_((function(){
  2043. return smalltalk.withContext(function($ctx2) {
  2044. return _st(self)._throwException();
  2045. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$JavaScriptException());
  2046. return self}, function($ctx1) {$ctx1.fill(self,"testRaisingException",{},smalltalk.JavaScriptExceptionTest)})},
  2047. messageSends: ["should:raise:", "throwException"]}),
  2048. smalltalk.JavaScriptExceptionTest);
  2049. smalltalk.addMethod(
  2050. smalltalk.method({
  2051. selector: "throwException",
  2052. fn: function (){
  2053. var self=this;
  2054. return smalltalk.withContext(function($ctx1) {
  2055. throw 'test';
  2056. return self}, function($ctx1) {$ctx1.fill(self,"throwException",{},smalltalk.JavaScriptExceptionTest)})},
  2057. messageSends: []}),
  2058. smalltalk.JavaScriptExceptionTest);
  2059. smalltalk.addClass('MessageSendTest', smalltalk.TestCase, [], 'Kernel-Tests');
  2060. smalltalk.addMethod(
  2061. smalltalk.method({
  2062. selector: "testValue",
  2063. fn: function (){
  2064. var self=this;
  2065. var messageSend;
  2066. function $Object(){return smalltalk.Object||(typeof Object=="undefined"?nil:Object)}
  2067. function $MessageSend(){return smalltalk.MessageSend||(typeof MessageSend=="undefined"?nil:MessageSend)}
  2068. return smalltalk.withContext(function($ctx1) {
  2069. var $1,$2;
  2070. $1=_st($MessageSend())._new();
  2071. _st($1)._receiver_(_st($Object())._new());
  2072. _st($1)._selector_("asString");
  2073. $2=_st($1)._yourself();
  2074. messageSend=$2;
  2075. _st(self)._assert_equals_(_st(messageSend)._value(),"an Object");
  2076. return self}, function($ctx1) {$ctx1.fill(self,"testValue",{messageSend:messageSend},smalltalk.MessageSendTest)})},
  2077. messageSends: ["receiver:", "new", "selector:", "yourself", "assert:equals:", "value"]}),
  2078. smalltalk.MessageSendTest);
  2079. smalltalk.addMethod(
  2080. smalltalk.method({
  2081. selector: "testValueWithArguments",
  2082. fn: function (){
  2083. var self=this;
  2084. var messageSend;
  2085. function $MessageSend(){return smalltalk.MessageSend||(typeof MessageSend=="undefined"?nil:MessageSend)}
  2086. return smalltalk.withContext(function($ctx1) {
  2087. var $1,$2;
  2088. $1=_st($MessageSend())._new();
  2089. _st($1)._receiver_((2));
  2090. _st($1)._selector_("+");
  2091. $2=_st($1)._yourself();
  2092. messageSend=$2;
  2093. _st(self)._assert_equals_(_st(messageSend)._value_((3)),(5));
  2094. _st(self)._assert_equals_(_st(messageSend)._valueWithPossibleArguments_([(4)]),(6));
  2095. return self}, function($ctx1) {$ctx1.fill(self,"testValueWithArguments",{messageSend:messageSend},smalltalk.MessageSendTest)})},
  2096. messageSends: ["receiver:", "new", "selector:", "yourself", "assert:equals:", "value:", "valueWithPossibleArguments:"]}),
  2097. smalltalk.MessageSendTest);
  2098. smalltalk.addClass('NumberTest', smalltalk.TestCase, [], 'Kernel-Tests');
  2099. smalltalk.addMethod(
  2100. smalltalk.method({
  2101. selector: "testAbs",
  2102. fn: function (){
  2103. var self=this;
  2104. return smalltalk.withContext(function($ctx1) {
  2105. _st(self)._assert_equals_(_st((4))._abs(),(4));
  2106. _st(self)._assert_equals_(_st((-4))._abs(),(4));
  2107. return self}, function($ctx1) {$ctx1.fill(self,"testAbs",{},smalltalk.NumberTest)})},
  2108. messageSends: ["assert:equals:", "abs"]}),
  2109. smalltalk.NumberTest);
  2110. smalltalk.addMethod(
  2111. smalltalk.method({
  2112. selector: "testArithmetic",
  2113. fn: function (){
  2114. var self=this;
  2115. return smalltalk.withContext(function($ctx1) {
  2116. _st(self)._assert_equals_(_st((1.5)).__plus((1)),(2.5));
  2117. _st(self)._assert_equals_(_st((2)).__minus((1)),(1));
  2118. _st(self)._assert_equals_(_st((-2)).__minus((1)),(-3));
  2119. _st(self)._assert_equals_(_st((12)).__slash((2)),(6));
  2120. _st(self)._assert_equals_(_st((3)).__star((4)),(12));
  2121. _st(self)._assert_equals_(_st(_st((1)).__plus((2))).__star((3)),(9));
  2122. _st(self)._assert_equals_(_st((1)).__plus(_st((2)).__star((3))),(7));
  2123. return self}, function($ctx1) {$ctx1.fill(self,"testArithmetic",{},smalltalk.NumberTest)})},
  2124. messageSends: ["assert:equals:", "+", "-", "/", "*"]}),
  2125. smalltalk.NumberTest);
  2126. smalltalk.addMethod(
  2127. smalltalk.method({
  2128. selector: "testComparison",
  2129. fn: function (){
  2130. var self=this;
  2131. return smalltalk.withContext(function($ctx1) {
  2132. _st(self)._assert_(_st((3)).__gt((2)));
  2133. _st(self)._assert_(_st((2)).__lt((3)));
  2134. _st(self)._deny_(_st((3)).__lt((2)));
  2135. _st(self)._deny_(_st((2)).__gt((3)));
  2136. _st(self)._assert_(_st((3)).__gt_eq((3)));
  2137. _st(self)._assert_(_st((3.1)).__gt_eq((3)));
  2138. _st(self)._assert_(_st((3)).__lt_eq((3)));
  2139. _st(self)._assert_(_st((3)).__lt_eq((3.1)));
  2140. return self}, function($ctx1) {$ctx1.fill(self,"testComparison",{},smalltalk.NumberTest)})},
  2141. messageSends: ["assert:", ">", "<", "deny:", ">=", "<="]}),
  2142. smalltalk.NumberTest);
  2143. smalltalk.addMethod(
  2144. smalltalk.method({
  2145. selector: "testCopying",
  2146. fn: function (){
  2147. var self=this;
  2148. return smalltalk.withContext(function($ctx1) {
  2149. _st(self)._assert_(_st(_st((1))._copy()).__eq_eq((1)));
  2150. _st(self)._assert_(_st(_st((1))._deepCopy()).__eq_eq((1)));
  2151. return self}, function($ctx1) {$ctx1.fill(self,"testCopying",{},smalltalk.NumberTest)})},
  2152. messageSends: ["assert:", "==", "copy", "deepCopy"]}),
  2153. smalltalk.NumberTest);
  2154. smalltalk.addMethod(
  2155. smalltalk.method({
  2156. selector: "testEquality",
  2157. fn: function (){
  2158. var self=this;
  2159. return smalltalk.withContext(function($ctx1) {
  2160. _st(self)._assert_(_st((1)).__eq((1)));
  2161. _st(self)._assert_(_st((0)).__eq((0)));
  2162. _st(self)._deny_(_st((1)).__eq((0)));
  2163. _st(self)._assert_(_st(_st((1))._yourself()).__eq((1)));
  2164. _st(self)._assert_(_st((1)).__eq(_st((1))._yourself()));
  2165. _st(self)._assert_(_st(_st((1))._yourself()).__eq(_st((1))._yourself()));
  2166. _st(self)._deny_(_st((0)).__eq(false));
  2167. _st(self)._deny_(_st(false).__eq((0)));
  2168. _st(self)._deny_(_st("").__eq((0)));
  2169. _st(self)._deny_(_st((0)).__eq(""));
  2170. return self}, function($ctx1) {$ctx1.fill(self,"testEquality",{},smalltalk.NumberTest)})},
  2171. messageSends: ["assert:", "=", "deny:", "yourself"]}),
  2172. smalltalk.NumberTest);
  2173. smalltalk.addMethod(
  2174. smalltalk.method({
  2175. selector: "testHexNumbers",
  2176. fn: function (){
  2177. var self=this;
  2178. return smalltalk.withContext(function($ctx1) {
  2179. _st(self)._assert_equals_((9),(9));
  2180. _st(self)._assert_equals_(_st((10))._truncated(),(10));
  2181. _st(self)._assert_equals_(_st((11))._truncated(),(11));
  2182. _st(self)._assert_equals_(_st((12))._truncated(),(12));
  2183. _st(self)._assert_equals_(_st((13))._truncated(),(13));
  2184. _st(self)._assert_equals_(_st((14))._truncated(),(14));
  2185. _st(self)._assert_equals_(_st((15))._truncated(),(15));
  2186. return self}, function($ctx1) {$ctx1.fill(self,"testHexNumbers",{},smalltalk.NumberTest)})},
  2187. messageSends: ["assert:equals:", "truncated"]}),
  2188. smalltalk.NumberTest);
  2189. smalltalk.addMethod(
  2190. smalltalk.method({
  2191. selector: "testIdentity",
  2192. fn: function (){
  2193. var self=this;
  2194. return smalltalk.withContext(function($ctx1) {
  2195. _st(self)._assert_(_st((1)).__eq_eq((1)));
  2196. _st(self)._assert_(_st((0)).__eq_eq((0)));
  2197. _st(self)._deny_(_st((1)).__eq_eq((0)));
  2198. _st(self)._assert_(_st(_st((1))._yourself()).__eq_eq((1)));
  2199. _st(self)._assert_(_st((1)).__eq_eq(_st((1))._yourself()));
  2200. _st(self)._assert_(_st(_st((1))._yourself()).__eq_eq(_st((1))._yourself()));
  2201. _st(self)._deny_(_st((1)).__eq_eq((2)));
  2202. return self}, function($ctx1) {$ctx1.fill(self,"testIdentity",{},smalltalk.NumberTest)})},
  2203. messageSends: ["assert:", "==", "deny:", "yourself"]}),
  2204. smalltalk.NumberTest);
  2205. smalltalk.addMethod(
  2206. smalltalk.method({
  2207. selector: "testInvalidHexNumbers",
  2208. fn: function (){
  2209. var self=this;
  2210. function $MessageNotUnderstood(){return smalltalk.MessageNotUnderstood||(typeof MessageNotUnderstood=="undefined"?nil:MessageNotUnderstood)}
  2211. return smalltalk.withContext(function($ctx1) {
  2212. _st(self)._should_raise_((function(){
  2213. return smalltalk.withContext(function($ctx2) {
  2214. return _st((16))._rG();
  2215. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2216. _st(self)._should_raise_((function(){
  2217. return smalltalk.withContext(function($ctx2) {
  2218. return _st((16))._rg();
  2219. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2220. _st(self)._should_raise_((function(){
  2221. return smalltalk.withContext(function($ctx2) {
  2222. return _st((16))._rH();
  2223. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2224. _st(self)._should_raise_((function(){
  2225. return smalltalk.withContext(function($ctx2) {
  2226. return _st((16))._rh();
  2227. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2228. _st(self)._should_raise_((function(){
  2229. return smalltalk.withContext(function($ctx2) {
  2230. return _st((16))._rI();
  2231. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2232. _st(self)._should_raise_((function(){
  2233. return smalltalk.withContext(function($ctx2) {
  2234. return _st((16))._ri();
  2235. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2236. _st(self)._should_raise_((function(){
  2237. return smalltalk.withContext(function($ctx2) {
  2238. return _st((16))._rJ();
  2239. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2240. _st(self)._should_raise_((function(){
  2241. return smalltalk.withContext(function($ctx2) {
  2242. return _st((16))._rj();
  2243. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2244. _st(self)._should_raise_((function(){
  2245. return smalltalk.withContext(function($ctx2) {
  2246. return _st((16))._rK();
  2247. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2248. _st(self)._should_raise_((function(){
  2249. return smalltalk.withContext(function($ctx2) {
  2250. return _st((16))._rk();
  2251. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2252. _st(self)._should_raise_((function(){
  2253. return smalltalk.withContext(function($ctx2) {
  2254. return _st((16))._rL();
  2255. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2256. _st(self)._should_raise_((function(){
  2257. return smalltalk.withContext(function($ctx2) {
  2258. return _st((16))._rl();
  2259. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2260. _st(self)._should_raise_((function(){
  2261. return smalltalk.withContext(function($ctx2) {
  2262. return _st((16))._rM();
  2263. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2264. _st(self)._should_raise_((function(){
  2265. return smalltalk.withContext(function($ctx2) {
  2266. return _st((16))._rm();
  2267. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2268. _st(self)._should_raise_((function(){
  2269. return smalltalk.withContext(function($ctx2) {
  2270. return _st((16))._rN();
  2271. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2272. _st(self)._should_raise_((function(){
  2273. return smalltalk.withContext(function($ctx2) {
  2274. return _st((16))._rn();
  2275. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2276. _st(self)._should_raise_((function(){
  2277. return smalltalk.withContext(function($ctx2) {
  2278. return _st((16))._rO();
  2279. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2280. _st(self)._should_raise_((function(){
  2281. return smalltalk.withContext(function($ctx2) {
  2282. return _st((16))._ro();
  2283. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2284. _st(self)._should_raise_((function(){
  2285. return smalltalk.withContext(function($ctx2) {
  2286. return _st((16))._rP();
  2287. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2288. _st(self)._should_raise_((function(){
  2289. return smalltalk.withContext(function($ctx2) {
  2290. return _st((16))._rp();
  2291. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2292. _st(self)._should_raise_((function(){
  2293. return smalltalk.withContext(function($ctx2) {
  2294. return _st((16))._rQ();
  2295. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2296. _st(self)._should_raise_((function(){
  2297. return smalltalk.withContext(function($ctx2) {
  2298. return _st((16))._rq();
  2299. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2300. _st(self)._should_raise_((function(){
  2301. return smalltalk.withContext(function($ctx2) {
  2302. return _st((16))._rR();
  2303. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2304. _st(self)._should_raise_((function(){
  2305. return smalltalk.withContext(function($ctx2) {
  2306. return _st((16))._rr();
  2307. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2308. _st(self)._should_raise_((function(){
  2309. return smalltalk.withContext(function($ctx2) {
  2310. return _st((16))._rS();
  2311. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2312. _st(self)._should_raise_((function(){
  2313. return smalltalk.withContext(function($ctx2) {
  2314. return _st((16))._rs();
  2315. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2316. _st(self)._should_raise_((function(){
  2317. return smalltalk.withContext(function($ctx2) {
  2318. return _st((16))._rT();
  2319. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2320. _st(self)._should_raise_((function(){
  2321. return smalltalk.withContext(function($ctx2) {
  2322. return _st((16))._rt();
  2323. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2324. _st(self)._should_raise_((function(){
  2325. return smalltalk.withContext(function($ctx2) {
  2326. return _st((16))._rU();
  2327. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2328. _st(self)._should_raise_((function(){
  2329. return smalltalk.withContext(function($ctx2) {
  2330. return _st((16))._ru();
  2331. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2332. _st(self)._should_raise_((function(){
  2333. return smalltalk.withContext(function($ctx2) {
  2334. return _st((16))._rV();
  2335. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2336. _st(self)._should_raise_((function(){
  2337. return smalltalk.withContext(function($ctx2) {
  2338. return _st((16))._rv();
  2339. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2340. _st(self)._should_raise_((function(){
  2341. return smalltalk.withContext(function($ctx2) {
  2342. return _st((16))._rW();
  2343. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2344. _st(self)._should_raise_((function(){
  2345. return smalltalk.withContext(function($ctx2) {
  2346. return _st((16))._rw();
  2347. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2348. _st(self)._should_raise_((function(){
  2349. return smalltalk.withContext(function($ctx2) {
  2350. return _st((16))._rX();
  2351. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2352. _st(self)._should_raise_((function(){
  2353. return smalltalk.withContext(function($ctx2) {
  2354. return _st((16))._rx();
  2355. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2356. _st(self)._should_raise_((function(){
  2357. return smalltalk.withContext(function($ctx2) {
  2358. return _st((16))._rY();
  2359. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2360. _st(self)._should_raise_((function(){
  2361. return smalltalk.withContext(function($ctx2) {
  2362. return _st((16))._ry();
  2363. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2364. _st(self)._should_raise_((function(){
  2365. return smalltalk.withContext(function($ctx2) {
  2366. return _st((16))._rZ();
  2367. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2368. _st(self)._should_raise_((function(){
  2369. return smalltalk.withContext(function($ctx2) {
  2370. return _st((16))._rz();
  2371. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2372. _st(self)._should_raise_((function(){
  2373. return smalltalk.withContext(function($ctx2) {
  2374. return _st((11259375))._Z();
  2375. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2376. return self}, function($ctx1) {$ctx1.fill(self,"testInvalidHexNumbers",{},smalltalk.NumberTest)})},
  2377. messageSends: ["should:raise:", "rG", "rg", "rH", "rh", "rI", "ri", "rJ", "rj", "rK", "rk", "rL", "rl", "rM", "rm", "rN", "rn", "rO", "ro", "rP", "rp", "rQ", "rq", "rR", "rr", "rS", "rs", "rT", "rt", "rU", "ru", "rV", "rv", "rW", "rw", "rX", "rx", "rY", "ry", "rZ", "rz", "Z"]}),
  2378. smalltalk.NumberTest);
  2379. smalltalk.addMethod(
  2380. smalltalk.method({
  2381. selector: "testMinMax",
  2382. fn: function (){
  2383. var self=this;
  2384. return smalltalk.withContext(function($ctx1) {
  2385. _st(self)._assert_equals_(_st((2))._max_((5)),(5));
  2386. _st(self)._assert_equals_(_st((2))._min_((5)),(2));
  2387. return self}, function($ctx1) {$ctx1.fill(self,"testMinMax",{},smalltalk.NumberTest)})},
  2388. messageSends: ["assert:equals:", "max:", "min:"]}),
  2389. smalltalk.NumberTest);
  2390. smalltalk.addMethod(
  2391. smalltalk.method({
  2392. selector: "testNegated",
  2393. fn: function (){
  2394. var self=this;
  2395. return smalltalk.withContext(function($ctx1) {
  2396. _st(self)._assert_equals_(_st((3))._negated(),(-3));
  2397. _st(self)._assert_equals_(_st((-3))._negated(),(3));
  2398. return self}, function($ctx1) {$ctx1.fill(self,"testNegated",{},smalltalk.NumberTest)})},
  2399. messageSends: ["assert:equals:", "negated"]}),
  2400. smalltalk.NumberTest);
  2401. smalltalk.addMethod(
  2402. smalltalk.method({
  2403. selector: "testPrintShowingDecimalPlaces",
  2404. fn: function (){
  2405. var self=this;
  2406. return smalltalk.withContext(function($ctx1) {
  2407. _st(self)._assert_equals_(_st((23))._printShowingDecimalPlaces_((2)),"23.00");
  2408. _st(self)._assert_equals_(_st((23.5698))._printShowingDecimalPlaces_((2)),"23.57");
  2409. _st(self)._assert_equals_(_st(_st((234.567))._negated())._printShowingDecimalPlaces_((5)),"-234.56700");
  2410. _st(self)._assert_equals_(_st((23.4567))._printShowingDecimalPlaces_((0)),"23");
  2411. _st(self)._assert_equals_(_st((23.5567))._printShowingDecimalPlaces_((0)),"24");
  2412. _st(self)._assert_equals_(_st(_st((23.4567))._negated())._printShowingDecimalPlaces_((0)),"-23");
  2413. _st(self)._assert_equals_(_st(_st((23.5567))._negated())._printShowingDecimalPlaces_((0)),"-24");
  2414. _st(self)._assert_equals_(_st((100000000))._printShowingDecimalPlaces_((1)),"100000000.0");
  2415. _st(self)._assert_equals_(_st((0.98))._printShowingDecimalPlaces_((5)),"0.98000");
  2416. _st(self)._assert_equals_(_st(_st((0.98))._negated())._printShowingDecimalPlaces_((2)),"-0.98");
  2417. _st(self)._assert_equals_(_st((2.567))._printShowingDecimalPlaces_((2)),"2.57");
  2418. _st(self)._assert_equals_(_st((-2.567))._printShowingDecimalPlaces_((2)),"-2.57");
  2419. _st(self)._assert_equals_(_st((0))._printShowingDecimalPlaces_((2)),"0.00");
  2420. return self}, function($ctx1) {$ctx1.fill(self,"testPrintShowingDecimalPlaces",{},smalltalk.NumberTest)})},
  2421. messageSends: ["assert:equals:", "printShowingDecimalPlaces:", "negated"]}),
  2422. smalltalk.NumberTest);
  2423. smalltalk.addMethod(
  2424. smalltalk.method({
  2425. selector: "testRounded",
  2426. fn: function (){
  2427. var self=this;
  2428. return smalltalk.withContext(function($ctx1) {
  2429. _st(self)._assert_equals_(_st((3))._rounded(),(3));
  2430. _st(self)._assert_equals_(_st((3.212))._rounded(),(3));
  2431. _st(self)._assert_equals_(_st((3.51))._rounded(),(4));
  2432. return self}, function($ctx1) {$ctx1.fill(self,"testRounded",{},smalltalk.NumberTest)})},
  2433. messageSends: ["assert:equals:", "rounded"]}),
  2434. smalltalk.NumberTest);
  2435. smalltalk.addMethod(
  2436. smalltalk.method({
  2437. selector: "testSqrt",
  2438. fn: function (){
  2439. var self=this;
  2440. return smalltalk.withContext(function($ctx1) {
  2441. _st(self)._assert_equals_(_st((4))._sqrt(),(2));
  2442. _st(self)._assert_equals_(_st((16))._sqrt(),(4));
  2443. return self}, function($ctx1) {$ctx1.fill(self,"testSqrt",{},smalltalk.NumberTest)})},
  2444. messageSends: ["assert:equals:", "sqrt"]}),
  2445. smalltalk.NumberTest);
  2446. smalltalk.addMethod(
  2447. smalltalk.method({
  2448. selector: "testSquared",
  2449. fn: function (){
  2450. var self=this;
  2451. return smalltalk.withContext(function($ctx1) {
  2452. _st(self)._assert_equals_(_st((4))._squared(),(16));
  2453. return self}, function($ctx1) {$ctx1.fill(self,"testSquared",{},smalltalk.NumberTest)})},
  2454. messageSends: ["assert:equals:", "squared"]}),
  2455. smalltalk.NumberTest);
  2456. smalltalk.addMethod(
  2457. smalltalk.method({
  2458. selector: "testTimesRepeat",
  2459. fn: function (){
  2460. var self=this;
  2461. var i;
  2462. return smalltalk.withContext(function($ctx1) {
  2463. i=(0);
  2464. _st((0))._timesRepeat_((function(){
  2465. return smalltalk.withContext(function($ctx2) {
  2466. i=_st(i).__plus((1));
  2467. return i;
  2468. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2469. _st(self)._assert_equals_(i,(0));
  2470. _st((5))._timesRepeat_((function(){
  2471. return smalltalk.withContext(function($ctx2) {
  2472. i=_st(i).__plus((1));
  2473. return i;
  2474. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2475. _st(self)._assert_equals_(i,(5));
  2476. return self}, function($ctx1) {$ctx1.fill(self,"testTimesRepeat",{i:i},smalltalk.NumberTest)})},
  2477. messageSends: ["timesRepeat:", "+", "assert:equals:"]}),
  2478. smalltalk.NumberTest);
  2479. smalltalk.addMethod(
  2480. smalltalk.method({
  2481. selector: "testTo",
  2482. fn: function (){
  2483. var self=this;
  2484. return smalltalk.withContext(function($ctx1) {
  2485. _st(self)._assert_equals_(_st((1))._to_((5)),[(1), (2), (3), (4), (5)]);
  2486. return self}, function($ctx1) {$ctx1.fill(self,"testTo",{},smalltalk.NumberTest)})},
  2487. messageSends: ["assert:equals:", "to:"]}),
  2488. smalltalk.NumberTest);
  2489. smalltalk.addMethod(
  2490. smalltalk.method({
  2491. selector: "testToBy",
  2492. fn: function (){
  2493. var self=this;
  2494. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  2495. return smalltalk.withContext(function($ctx1) {
  2496. _st(self)._assert_equals_(_st((0))._to_by_((6),(2)),[(0), (2), (4), (6)]);
  2497. _st(self)._should_raise_((function(){
  2498. return smalltalk.withContext(function($ctx2) {
  2499. return _st((1))._to_by_((4),(0));
  2500. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$Error());
  2501. return self}, function($ctx1) {$ctx1.fill(self,"testToBy",{},smalltalk.NumberTest)})},
  2502. messageSends: ["assert:equals:", "to:by:", "should:raise:"]}),
  2503. smalltalk.NumberTest);
  2504. smalltalk.addMethod(
  2505. smalltalk.method({
  2506. selector: "testTruncated",
  2507. fn: function (){
  2508. var self=this;
  2509. return smalltalk.withContext(function($ctx1) {
  2510. _st(self)._assert_equals_(_st((3))._truncated(),(3));
  2511. _st(self)._assert_equals_(_st((3.212))._truncated(),(3));
  2512. _st(self)._assert_equals_(_st((3.51))._truncated(),(3));
  2513. return self}, function($ctx1) {$ctx1.fill(self,"testTruncated",{},smalltalk.NumberTest)})},
  2514. messageSends: ["assert:equals:", "truncated"]}),
  2515. smalltalk.NumberTest);
  2516. smalltalk.addClass('ObjectMock', smalltalk.Object, ['foo', 'bar'], 'Kernel-Tests');
  2517. smalltalk.addMethod(
  2518. smalltalk.method({
  2519. selector: "foo",
  2520. fn: function (){
  2521. var self=this;
  2522. return smalltalk.withContext(function($ctx1) {
  2523. var $1;
  2524. $1=self["@foo"];
  2525. return $1;
  2526. }, function($ctx1) {$ctx1.fill(self,"foo",{},smalltalk.ObjectMock)})},
  2527. messageSends: []}),
  2528. smalltalk.ObjectMock);
  2529. smalltalk.addMethod(
  2530. smalltalk.method({
  2531. selector: "foo:",
  2532. fn: function (anObject){
  2533. var self=this;
  2534. return smalltalk.withContext(function($ctx1) {
  2535. self["@foo"]=anObject;
  2536. return self}, function($ctx1) {$ctx1.fill(self,"foo:",{anObject:anObject},smalltalk.ObjectMock)})},
  2537. messageSends: []}),
  2538. smalltalk.ObjectMock);
  2539. smalltalk.addClass('ObjectTest', smalltalk.TestCase, [], 'Kernel-Tests');
  2540. smalltalk.addMethod(
  2541. smalltalk.method({
  2542. selector: "notDefined",
  2543. fn: function (){
  2544. var self=this;
  2545. return smalltalk.withContext(function($ctx1) {
  2546. return undefined;;
  2547. return self}, function($ctx1) {$ctx1.fill(self,"notDefined",{},smalltalk.ObjectTest)})},
  2548. messageSends: []}),
  2549. smalltalk.ObjectTest);
  2550. smalltalk.addMethod(
  2551. smalltalk.method({
  2552. selector: "testBasicAccess",
  2553. fn: function (){
  2554. var self=this;
  2555. var o;
  2556. function $Object(){return smalltalk.Object||(typeof Object=="undefined"?nil:Object)}
  2557. return smalltalk.withContext(function($ctx1) {
  2558. o=_st($Object())._new();
  2559. _st(o)._basicAt_put_("a",(1));
  2560. _st(self)._assert_equals_(_st(o)._basicAt_("a"),(1));
  2561. _st(self)._assert_equals_(_st(o)._basicAt_("b"),nil);
  2562. return self}, function($ctx1) {$ctx1.fill(self,"testBasicAccess",{o:o},smalltalk.ObjectTest)})},
  2563. messageSends: ["new", "basicAt:put:", "assert:equals:", "basicAt:"]}),
  2564. smalltalk.ObjectTest);
  2565. smalltalk.addMethod(
  2566. smalltalk.method({
  2567. selector: "testBasicPerform",
  2568. fn: function (){
  2569. var self=this;
  2570. var o;
  2571. function $Object(){return smalltalk.Object||(typeof Object=="undefined"?nil:Object)}
  2572. return smalltalk.withContext(function($ctx1) {
  2573. o=_st($Object())._new();
  2574. _st(o)._basicAt_put_("func",(function(){
  2575. return smalltalk.withContext(function($ctx2) {
  2576. return "hello";
  2577. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2578. _st(o)._basicAt_put_("func2",(function(a){
  2579. return smalltalk.withContext(function($ctx2) {
  2580. return _st(a).__plus((1));
  2581. }, function($ctx2) {$ctx2.fillBlock({a:a},$ctx1)})}));
  2582. _st(self)._assert_equals_(_st(o)._basicPerform_("func"),"hello");
  2583. _st(self)._assert_equals_(_st(o)._basicPerform_withArguments_("func2",[(3)]),(4));
  2584. return self}, function($ctx1) {$ctx1.fill(self,"testBasicPerform",{o:o},smalltalk.ObjectTest)})},
  2585. messageSends: ["new", "basicAt:put:", "+", "assert:equals:", "basicPerform:", "basicPerform:withArguments:"]}),
  2586. smalltalk.ObjectTest);
  2587. smalltalk.addMethod(
  2588. smalltalk.method({
  2589. selector: "testDNU",
  2590. fn: function (){
  2591. var self=this;
  2592. function $Object(){return smalltalk.Object||(typeof Object=="undefined"?nil:Object)}
  2593. function $MessageNotUnderstood(){return smalltalk.MessageNotUnderstood||(typeof MessageNotUnderstood=="undefined"?nil:MessageNotUnderstood)}
  2594. return smalltalk.withContext(function($ctx1) {
  2595. _st(self)._should_raise_((function(){
  2596. return smalltalk.withContext(function($ctx2) {
  2597. return _st(_st($Object())._new())._foo();
  2598. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2599. return self}, function($ctx1) {$ctx1.fill(self,"testDNU",{},smalltalk.ObjectTest)})},
  2600. messageSends: ["should:raise:", "foo", "new"]}),
  2601. smalltalk.ObjectTest);
  2602. smalltalk.addMethod(
  2603. smalltalk.method({
  2604. selector: "testEquality",
  2605. fn: function (){
  2606. var self=this;
  2607. var o;
  2608. function $Object(){return smalltalk.Object||(typeof Object=="undefined"?nil:Object)}
  2609. return smalltalk.withContext(function($ctx1) {
  2610. o=_st($Object())._new();
  2611. _st(self)._deny_(_st(o).__eq(_st($Object())._new()));
  2612. _st(self)._assert_(_st(o).__eq(o));
  2613. _st(self)._assert_(_st(_st(o)._yourself()).__eq(o));
  2614. _st(self)._assert_(_st(o).__eq(_st(o)._yourself()));
  2615. return self}, function($ctx1) {$ctx1.fill(self,"testEquality",{o:o},smalltalk.ObjectTest)})},
  2616. messageSends: ["new", "deny:", "=", "assert:", "yourself"]}),
  2617. smalltalk.ObjectTest);
  2618. smalltalk.addMethod(
  2619. smalltalk.method({
  2620. selector: "testHalt",
  2621. fn: function (){
  2622. var self=this;
  2623. function $Object(){return smalltalk.Object||(typeof Object=="undefined"?nil:Object)}
  2624. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  2625. return smalltalk.withContext(function($ctx1) {
  2626. _st(self)._should_raise_((function(){
  2627. return smalltalk.withContext(function($ctx2) {
  2628. return _st(_st($Object())._new())._halt();
  2629. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$Error());
  2630. return self}, function($ctx1) {$ctx1.fill(self,"testHalt",{},smalltalk.ObjectTest)})},
  2631. messageSends: ["should:raise:", "halt", "new"]}),
  2632. smalltalk.ObjectTest);
  2633. smalltalk.addMethod(
  2634. smalltalk.method({
  2635. selector: "testIdentity",
  2636. fn: function (){
  2637. var self=this;
  2638. var o;
  2639. function $Object(){return smalltalk.Object||(typeof Object=="undefined"?nil:Object)}
  2640. return smalltalk.withContext(function($ctx1) {
  2641. o=_st($Object())._new();
  2642. _st(self)._deny_(_st(o).__eq_eq(_st($Object())._new()));
  2643. _st(self)._assert_(_st(o).__eq_eq(o));
  2644. _st(self)._assert_(_st(_st(o)._yourself()).__eq_eq(o));
  2645. _st(self)._assert_(_st(o).__eq_eq(_st(o)._yourself()));
  2646. return self}, function($ctx1) {$ctx1.fill(self,"testIdentity",{o:o},smalltalk.ObjectTest)})},
  2647. messageSends: ["new", "deny:", "==", "assert:", "yourself"]}),
  2648. smalltalk.ObjectTest);
  2649. smalltalk.addMethod(
  2650. smalltalk.method({
  2651. selector: "testIfNil",
  2652. fn: function (){
  2653. var self=this;
  2654. function $Object(){return smalltalk.Object||(typeof Object=="undefined"?nil:Object)}
  2655. return smalltalk.withContext(function($ctx1) {
  2656. var $1,$4,$3,$2,$5,$7,$6,$8,$10,$9,$11,$13,$12;
  2657. _st(self)._deny_(_st(_st($Object())._new())._isNil());
  2658. $1=self;
  2659. $4=_st($Object())._new();
  2660. if(($receiver = $4) == nil || $receiver == undefined){
  2661. $3=true;
  2662. } else {
  2663. $3=$4;
  2664. };
  2665. $2=_st($3).__eq(true);
  2666. _st($1)._deny_($2);
  2667. $5=self;
  2668. $7=_st($Object())._new();
  2669. if(($receiver = $7) == nil || $receiver == undefined){
  2670. $6=$7;
  2671. } else {
  2672. $6=true;
  2673. };
  2674. _st($5)._assert_equals_($6,true);
  2675. $8=self;
  2676. $10=_st($Object())._new();
  2677. if(($receiver = $10) == nil || $receiver == undefined){
  2678. $9=false;
  2679. } else {
  2680. $9=true;
  2681. };
  2682. _st($8)._assert_equals_($9,true);
  2683. $11=self;
  2684. $13=_st($Object())._new();
  2685. if(($receiver = $13) == nil || $receiver == undefined){
  2686. $12=false;
  2687. } else {
  2688. $12=true;
  2689. };
  2690. _st($11)._assert_equals_($12,true);
  2691. return self}, function($ctx1) {$ctx1.fill(self,"testIfNil",{},smalltalk.ObjectTest)})},
  2692. messageSends: ["deny:", "isNil", "new", "=", "ifNil:", "assert:equals:", "ifNotNil:", "ifNil:ifNotNil:", "ifNotNil:ifNil:"]}),
  2693. smalltalk.ObjectTest);
  2694. smalltalk.addMethod(
  2695. smalltalk.method({
  2696. selector: "testInstVars",
  2697. fn: function (){
  2698. var self=this;
  2699. var o;
  2700. function $ObjectMock(){return smalltalk.ObjectMock||(typeof ObjectMock=="undefined"?nil:ObjectMock)}
  2701. return smalltalk.withContext(function($ctx1) {
  2702. o=_st($ObjectMock())._new();
  2703. _st(self)._assert_equals_(_st(o)._instVarAt_("foo"),nil);
  2704. _st(o)._instVarAt_put_("foo",(1));
  2705. _st(self)._assert_equals_(_st(o)._instVarAt_("foo"),(1));
  2706. _st(self)._assert_equals_(_st(o)._instVarAt_("foo"),(1));
  2707. return self}, function($ctx1) {$ctx1.fill(self,"testInstVars",{o:o},smalltalk.ObjectTest)})},
  2708. messageSends: ["new", "assert:equals:", "instVarAt:", "instVarAt:put:"]}),
  2709. smalltalk.ObjectTest);
  2710. smalltalk.addMethod(
  2711. smalltalk.method({
  2712. selector: "testNilUndefined",
  2713. fn: function (){
  2714. var self=this;
  2715. return smalltalk.withContext(function($ctx1) {
  2716. _st(self)._assert_equals_(_st(self)._notDefined(),nil);
  2717. return self}, function($ctx1) {$ctx1.fill(self,"testNilUndefined",{},smalltalk.ObjectTest)})},
  2718. messageSends: ["assert:equals:", "notDefined"]}),
  2719. smalltalk.ObjectTest);
  2720. smalltalk.addMethod(
  2721. smalltalk.method({
  2722. selector: "testYourself",
  2723. fn: function (){
  2724. var self=this;
  2725. var o;
  2726. function $ObjectMock(){return smalltalk.ObjectMock||(typeof ObjectMock=="undefined"?nil:ObjectMock)}
  2727. return smalltalk.withContext(function($ctx1) {
  2728. o=_st($ObjectMock())._new();
  2729. _st(self)._assert_(_st(_st(o)._yourself()).__eq_eq(o));
  2730. return self}, function($ctx1) {$ctx1.fill(self,"testYourself",{o:o},smalltalk.ObjectTest)})},
  2731. messageSends: ["new", "assert:", "==", "yourself"]}),
  2732. smalltalk.ObjectTest);
  2733. smalltalk.addMethod(
  2734. smalltalk.method({
  2735. selector: "testidentityHash",
  2736. fn: function (){
  2737. var self=this;
  2738. var o1,o2;
  2739. function $Object(){return smalltalk.Object||(typeof Object=="undefined"?nil:Object)}
  2740. return smalltalk.withContext(function($ctx1) {
  2741. o1=_st($Object())._new();
  2742. o2=_st($Object())._new();
  2743. _st(self)._assert_(_st(_st(o1)._identityHash()).__eq_eq(_st(o1)._identityHash()));
  2744. _st(self)._deny_(_st(_st(o1)._identityHash()).__eq_eq(_st(o2)._identityHash()));
  2745. return self}, function($ctx1) {$ctx1.fill(self,"testidentityHash",{o1:o1,o2:o2},smalltalk.ObjectTest)})},
  2746. messageSends: ["new", "assert:", "==", "identityHash", "deny:"]}),
  2747. smalltalk.ObjectTest);
  2748. smalltalk.addClass('PackageTest', smalltalk.TestCase, ['zorkPackage', 'grulPackage', 'backUpCommitPathJs', 'backUpCommitPathSt'], 'Kernel-Tests');
  2749. smalltalk.addMethod(
  2750. smalltalk.method({
  2751. selector: "setUp",
  2752. fn: function (){
  2753. var self=this;
  2754. function $Package(){return smalltalk.Package||(typeof Package=="undefined"?nil:Package)}
  2755. return smalltalk.withContext(function($ctx1) {
  2756. var $1,$2;
  2757. self["@backUpCommitPathJs"]=_st($Package())._defaultCommitPathJs();
  2758. self["@backUpCommitPathSt"]=_st($Package())._defaultCommitPathSt();
  2759. _st($Package())._resetCommitPaths();
  2760. self["@zorkPackage"]=_st(_st($Package())._new())._name_("Zork");
  2761. $1=_st($Package())._new();
  2762. _st($1)._name_("Grul");
  2763. _st($1)._commitPathJs_("server/grul/js");
  2764. _st($1)._commitPathSt_("grul/st");
  2765. $2=_st($1)._yourself();
  2766. self["@grulPackage"]=$2;
  2767. return self}, function($ctx1) {$ctx1.fill(self,"setUp",{},smalltalk.PackageTest)})},
  2768. messageSends: ["defaultCommitPathJs", "defaultCommitPathSt", "resetCommitPaths", "name:", "new", "commitPathJs:", "commitPathSt:", "yourself"]}),
  2769. smalltalk.PackageTest);
  2770. smalltalk.addMethod(
  2771. smalltalk.method({
  2772. selector: "tearDown",
  2773. fn: function (){
  2774. var self=this;
  2775. function $Package(){return smalltalk.Package||(typeof Package=="undefined"?nil:Package)}
  2776. return smalltalk.withContext(function($ctx1) {
  2777. var $1,$2;
  2778. $1=$Package();
  2779. _st($1)._defaultCommitPathJs_(self["@backUpCommitPathJs"]);
  2780. $2=_st($1)._defaultCommitPathSt_(self["@backUpCommitPathSt"]);
  2781. return self}, function($ctx1) {$ctx1.fill(self,"tearDown",{},smalltalk.PackageTest)})},
  2782. messageSends: ["defaultCommitPathJs:", "defaultCommitPathSt:"]}),
  2783. smalltalk.PackageTest);
  2784. smalltalk.addMethod(
  2785. smalltalk.method({
  2786. selector: "testGrulCommitPathJsShouldBeServerGrulJs",
  2787. fn: function (){
  2788. var self=this;
  2789. return smalltalk.withContext(function($ctx1) {
  2790. _st(self)._assert_equals_(_st(self["@grulPackage"])._commitPathJs(),"server/grul/js");
  2791. return self}, function($ctx1) {$ctx1.fill(self,"testGrulCommitPathJsShouldBeServerGrulJs",{},smalltalk.PackageTest)})},
  2792. messageSends: ["assert:equals:", "commitPathJs"]}),
  2793. smalltalk.PackageTest);
  2794. smalltalk.addMethod(
  2795. smalltalk.method({
  2796. selector: "testGrulCommitPathStShouldBeGrulSt",
  2797. fn: function (){
  2798. var self=this;
  2799. return smalltalk.withContext(function($ctx1) {
  2800. _st(self)._assert_equals_(_st(self["@grulPackage"])._commitPathSt(),"grul/st");
  2801. return self}, function($ctx1) {$ctx1.fill(self,"testGrulCommitPathStShouldBeGrulSt",{},smalltalk.PackageTest)})},
  2802. messageSends: ["assert:equals:", "commitPathSt"]}),
  2803. smalltalk.PackageTest);
  2804. smalltalk.addMethod(
  2805. smalltalk.method({
  2806. selector: "testZorkCommitPathJsShouldBeJs",
  2807. fn: function (){
  2808. var self=this;
  2809. return smalltalk.withContext(function($ctx1) {
  2810. _st(self)._assert_equals_(_st(self["@zorkPackage"])._commitPathJs(),"js");
  2811. return self}, function($ctx1) {$ctx1.fill(self,"testZorkCommitPathJsShouldBeJs",{},smalltalk.PackageTest)})},
  2812. messageSends: ["assert:equals:", "commitPathJs"]}),
  2813. smalltalk.PackageTest);
  2814. smalltalk.addMethod(
  2815. smalltalk.method({
  2816. selector: "testZorkCommitPathStShouldBeSt",
  2817. fn: function (){
  2818. var self=this;
  2819. return smalltalk.withContext(function($ctx1) {
  2820. _st(self)._assert_equals_(_st(self["@zorkPackage"])._commitPathSt(),"st");
  2821. return self}, function($ctx1) {$ctx1.fill(self,"testZorkCommitPathStShouldBeSt",{},smalltalk.PackageTest)})},
  2822. messageSends: ["assert:equals:", "commitPathSt"]}),
  2823. smalltalk.PackageTest);
  2824. smalltalk.addClass('PackageWithDefaultCommitPathChangedTest', smalltalk.PackageTest, [], 'Kernel-Tests');
  2825. smalltalk.addMethod(
  2826. smalltalk.method({
  2827. selector: "setUp",
  2828. fn: function (){
  2829. var self=this;
  2830. function $Package(){return smalltalk.Package||(typeof Package=="undefined"?nil:Package)}
  2831. return smalltalk.withContext(function($ctx1) {
  2832. var $1,$2;
  2833. smalltalk.PackageTest.fn.prototype._setUp.apply(_st(self), []);
  2834. $1=$Package();
  2835. _st($1)._defaultCommitPathJs_("javascripts/");
  2836. $2=_st($1)._defaultCommitPathSt_("smalltalk/");
  2837. return self}, function($ctx1) {$ctx1.fill(self,"setUp",{},smalltalk.PackageWithDefaultCommitPathChangedTest)})},
  2838. messageSends: ["setUp", "defaultCommitPathJs:", "defaultCommitPathSt:"]}),
  2839. smalltalk.PackageWithDefaultCommitPathChangedTest);
  2840. smalltalk.addMethod(
  2841. smalltalk.method({
  2842. selector: "testGrulCommitPathJsShouldBeServerGrulJs",
  2843. fn: function (){
  2844. var self=this;
  2845. return smalltalk.withContext(function($ctx1) {
  2846. _st(self)._assert_equals_(_st(self["@grulPackage"])._commitPathJs(),"server/grul/js");
  2847. return self}, function($ctx1) {$ctx1.fill(self,"testGrulCommitPathJsShouldBeServerGrulJs",{},smalltalk.PackageWithDefaultCommitPathChangedTest)})},
  2848. messageSends: ["assert:equals:", "commitPathJs"]}),
  2849. smalltalk.PackageWithDefaultCommitPathChangedTest);
  2850. smalltalk.addMethod(
  2851. smalltalk.method({
  2852. selector: "testGrulCommitPathStShouldBeGrulSt",
  2853. fn: function (){
  2854. var self=this;
  2855. return smalltalk.withContext(function($ctx1) {
  2856. _st(self)._assert_equals_(_st(self["@grulPackage"])._commitPathSt(),"grul/st");
  2857. return self}, function($ctx1) {$ctx1.fill(self,"testGrulCommitPathStShouldBeGrulSt",{},smalltalk.PackageWithDefaultCommitPathChangedTest)})},
  2858. messageSends: ["assert:equals:", "commitPathSt"]}),
  2859. smalltalk.PackageWithDefaultCommitPathChangedTest);
  2860. smalltalk.addMethod(
  2861. smalltalk.method({
  2862. selector: "testZorkCommitPathJsShouldBeJavascript",
  2863. fn: function (){
  2864. var self=this;
  2865. return smalltalk.withContext(function($ctx1) {
  2866. _st(self)._assert_equals_(_st(self["@zorkPackage"])._commitPathJs(),"javascripts/");
  2867. return self}, function($ctx1) {$ctx1.fill(self,"testZorkCommitPathJsShouldBeJavascript",{},smalltalk.PackageWithDefaultCommitPathChangedTest)})},
  2868. messageSends: ["assert:equals:", "commitPathJs"]}),
  2869. smalltalk.PackageWithDefaultCommitPathChangedTest);
  2870. smalltalk.addMethod(
  2871. smalltalk.method({
  2872. selector: "testZorkCommitPathStShouldBeSmalltalk",
  2873. fn: function (){
  2874. var self=this;
  2875. return smalltalk.withContext(function($ctx1) {
  2876. _st(self)._assert_equals_(_st(self["@zorkPackage"])._commitPathSt(),"smalltalk/");
  2877. return self}, function($ctx1) {$ctx1.fill(self,"testZorkCommitPathStShouldBeSmalltalk",{},smalltalk.PackageWithDefaultCommitPathChangedTest)})},
  2878. messageSends: ["assert:equals:", "commitPathSt"]}),
  2879. smalltalk.PackageWithDefaultCommitPathChangedTest);
  2880. smalltalk.addMethod(
  2881. smalltalk.method({
  2882. selector: "shouldInheritSelectors",
  2883. fn: function (){
  2884. var self=this;
  2885. return smalltalk.withContext(function($ctx1) {
  2886. return false;
  2887. }, function($ctx1) {$ctx1.fill(self,"shouldInheritSelectors",{},smalltalk.PackageWithDefaultCommitPathChangedTest.klass)})},
  2888. messageSends: []}),
  2889. smalltalk.PackageWithDefaultCommitPathChangedTest.klass);
  2890. smalltalk.addClass('PointTest', smalltalk.TestCase, [], 'Kernel-Tests');
  2891. smalltalk.addMethod(
  2892. smalltalk.method({
  2893. selector: "testAccessing",
  2894. fn: function (){
  2895. var self=this;
  2896. function $Point(){return smalltalk.Point||(typeof Point=="undefined"?nil:Point)}
  2897. return smalltalk.withContext(function($ctx1) {
  2898. _st(self)._assert_equals_(_st(_st($Point())._x_y_((3),(4)))._x(),(3));
  2899. _st(self)._assert_equals_(_st(_st($Point())._x_y_((3),(4)))._y(),(4));
  2900. _st(self)._assert_equals_(_st(_st(_st($Point())._new())._x_((3)))._x(),(3));
  2901. _st(self)._assert_equals_(_st(_st(_st($Point())._new())._y_((4)))._y(),(4));
  2902. return self}, function($ctx1) {$ctx1.fill(self,"testAccessing",{},smalltalk.PointTest)})},
  2903. messageSends: ["assert:equals:", "x", "x:y:", "y", "x:", "new", "y:"]}),
  2904. smalltalk.PointTest);
  2905. smalltalk.addMethod(
  2906. smalltalk.method({
  2907. selector: "testArithmetic",
  2908. fn: function (){
  2909. var self=this;
  2910. function $Point(){return smalltalk.Point||(typeof Point=="undefined"?nil:Point)}
  2911. return smalltalk.withContext(function($ctx1) {
  2912. _st(self)._assert_equals_(_st(_st((3)).__at((4))).__star(_st((3)).__at((4))),_st($Point())._x_y_((9),(16)));
  2913. _st(self)._assert_equals_(_st(_st((3)).__at((4))).__plus(_st((3)).__at((4))),_st($Point())._x_y_((6),(8)));
  2914. _st(self)._assert_equals_(_st(_st((3)).__at((4))).__minus(_st((3)).__at((4))),_st($Point())._x_y_((0),(0)));
  2915. _st(self)._assert_equals_(_st(_st((6)).__at((8))).__slash(_st((3)).__at((4))),_st($Point())._x_y_((2),(2)));
  2916. return self}, function($ctx1) {$ctx1.fill(self,"testArithmetic",{},smalltalk.PointTest)})},
  2917. messageSends: ["assert:equals:", "*", "@", "x:y:", "+", "-", "/"]}),
  2918. smalltalk.PointTest);
  2919. smalltalk.addMethod(
  2920. smalltalk.method({
  2921. selector: "testAt",
  2922. fn: function (){
  2923. var self=this;
  2924. function $Point(){return smalltalk.Point||(typeof Point=="undefined"?nil:Point)}
  2925. return smalltalk.withContext(function($ctx1) {
  2926. _st(self)._assert_equals_(_st((3)).__at((4)),_st($Point())._x_y_((3),(4)));
  2927. return self}, function($ctx1) {$ctx1.fill(self,"testAt",{},smalltalk.PointTest)})},
  2928. messageSends: ["assert:equals:", "@", "x:y:"]}),
  2929. smalltalk.PointTest);
  2930. smalltalk.addMethod(
  2931. smalltalk.method({
  2932. selector: "testEgality",
  2933. fn: function (){
  2934. var self=this;
  2935. return smalltalk.withContext(function($ctx1) {
  2936. _st(self)._assert_(_st(_st((3)).__at((4))).__eq(_st((3)).__at((4))));
  2937. _st(self)._deny_(_st(_st((3)).__at((5))).__eq(_st((3)).__at((6))));
  2938. return self}, function($ctx1) {$ctx1.fill(self,"testEgality",{},smalltalk.PointTest)})},
  2939. messageSends: ["assert:", "=", "@", "deny:"]}),
  2940. smalltalk.PointTest);
  2941. smalltalk.addMethod(
  2942. smalltalk.method({
  2943. selector: "testTranslateBy",
  2944. fn: function (){
  2945. var self=this;
  2946. return smalltalk.withContext(function($ctx1) {
  2947. _st(self)._assert_equals_(_st(_st((3)).__at((3)))._translateBy_(_st((0)).__at((1))),_st((3)).__at((4)));
  2948. _st(self)._assert_equals_(_st(_st((3)).__at((3)))._translateBy_(_st((0)).__at(_st((1))._negated())),_st((3)).__at((2)));
  2949. _st(self)._assert_equals_(_st(_st((3)).__at((3)))._translateBy_(_st((2)).__at((3))),_st((5)).__at((6)));
  2950. _st(self)._assert_equals_(_st(_st((3)).__at((3)))._translateBy_(_st(_st((3))._negated()).__at((0))),_st((0)).__at((3)));
  2951. return self}, function($ctx1) {$ctx1.fill(self,"testTranslateBy",{},smalltalk.PointTest)})},
  2952. messageSends: ["assert:equals:", "translateBy:", "@", "negated"]}),
  2953. smalltalk.PointTest);
  2954. smalltalk.addClass('RandomTest', smalltalk.TestCase, [], 'Kernel-Tests');
  2955. smalltalk.addMethod(
  2956. smalltalk.method({
  2957. selector: "textNext",
  2958. fn: function (){
  2959. var self=this;
  2960. function $Random(){return smalltalk.Random||(typeof Random=="undefined"?nil:Random)}
  2961. return smalltalk.withContext(function($ctx1) {
  2962. _st((10000))._timesRepeat_((function(){
  2963. var current,next;
  2964. return smalltalk.withContext(function($ctx2) {
  2965. next=_st(_st($Random())._new())._next();
  2966. next;
  2967. _st(self)._assert_(_st(next).__gt_eq((0)));
  2968. _st(self)._assert_(_st(next).__lt((1)));
  2969. _st(self)._deny_(_st(current).__eq(next));
  2970. return _st(next).__eq(current);
  2971. }, function($ctx2) {$ctx2.fillBlock({current:current,next:next},$ctx1)})}));
  2972. return self}, function($ctx1) {$ctx1.fill(self,"textNext",{},smalltalk.RandomTest)})},
  2973. messageSends: ["timesRepeat:", "next", "new", "assert:", ">=", "<", "deny:", "="]}),
  2974. smalltalk.RandomTest);
  2975. smalltalk.addClass('SetTest', smalltalk.TestCase, [], 'Kernel-Tests');
  2976. smalltalk.addMethod(
  2977. smalltalk.method({
  2978. selector: "testAddRemove",
  2979. fn: function (){
  2980. var self=this;
  2981. var set;
  2982. function $Set(){return smalltalk.Set||(typeof Set=="undefined"?nil:Set)}
  2983. return smalltalk.withContext(function($ctx1) {
  2984. set=_st($Set())._new();
  2985. _st(self)._assert_(_st(set)._isEmpty());
  2986. _st(set)._add_((3));
  2987. _st(self)._assert_(_st(set)._includes_((3)));
  2988. _st(set)._add_((5));
  2989. _st(self)._assert_(_st(set)._includes_((5)));
  2990. _st(set)._remove_((3));
  2991. _st(self)._deny_(_st(set)._includes_((3)));
  2992. return self}, function($ctx1) {$ctx1.fill(self,"testAddRemove",{set:set},smalltalk.SetTest)})},
  2993. messageSends: ["new", "assert:", "isEmpty", "add:", "includes:", "remove:", "deny:"]}),
  2994. smalltalk.SetTest);
  2995. smalltalk.addMethod(
  2996. smalltalk.method({
  2997. selector: "testAt",
  2998. fn: function (){
  2999. var self=this;
  3000. function $Set(){return smalltalk.Set||(typeof Set=="undefined"?nil:Set)}
  3001. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  3002. return smalltalk.withContext(function($ctx1) {
  3003. _st(self)._should_raise_((function(){
  3004. return smalltalk.withContext(function($ctx2) {
  3005. return _st(_st($Set())._new())._at_put_((1),(2));
  3006. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$Error());
  3007. return self}, function($ctx1) {$ctx1.fill(self,"testAt",{},smalltalk.SetTest)})},
  3008. messageSends: ["should:raise:", "at:put:", "new"]}),
  3009. smalltalk.SetTest);
  3010. smalltalk.addMethod(
  3011. smalltalk.method({
  3012. selector: "testCollect",
  3013. fn: function (){
  3014. var self=this;
  3015. return smalltalk.withContext(function($ctx1) {
  3016. _st(self)._assert_equals_(_st(_st([(5), (6), (8)])._asSet())._collect_((function(x){
  3017. return smalltalk.withContext(function($ctx2) {
  3018. return _st(x).__backslash_backslash((3));
  3019. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})})),_st([(0), (2)])._asSet());
  3020. return self}, function($ctx1) {$ctx1.fill(self,"testCollect",{},smalltalk.SetTest)})},
  3021. messageSends: ["assert:equals:", "collect:", "\x5c\x5c", "asSet"]}),
  3022. smalltalk.SetTest);
  3023. smalltalk.addMethod(
  3024. smalltalk.method({
  3025. selector: "testComparing",
  3026. fn: function (){
  3027. var self=this;
  3028. return smalltalk.withContext(function($ctx1) {
  3029. _st(self)._assert_equals_(_st([(0), (2)])._asSet(),_st([(0), (2)])._asSet());
  3030. _st(self)._assert_equals_(_st([(2), (0)])._asSet(),_st([(0), (2)])._asSet());
  3031. _st(self)._deny_(_st(_st([(0), (2), (3)])._asSet()).__eq(_st([(0), (2)])._asSet()));
  3032. _st(self)._deny_(_st(_st([(1), (2)])._asSet()).__eq(_st([(0), (2)])._asSet()));
  3033. return self}, function($ctx1) {$ctx1.fill(self,"testComparing",{},smalltalk.SetTest)})},
  3034. messageSends: ["assert:equals:", "asSet", "deny:", "="]}),
  3035. smalltalk.SetTest);
  3036. smalltalk.addMethod(
  3037. smalltalk.method({
  3038. selector: "testPrintString",
  3039. fn: function (){
  3040. var self=this;
  3041. var set;
  3042. function $Set(){return smalltalk.Set||(typeof Set=="undefined"?nil:Set)}
  3043. return smalltalk.withContext(function($ctx1) {
  3044. var $1,$2,$3,$4;
  3045. set=_st($Set())._new();
  3046. _st(self)._assert_equals_(_st(set)._printString(),"a Set ()");
  3047. $1=set;
  3048. _st($1)._add_((1));
  3049. $2=_st($1)._add_((3));
  3050. _st(self)._assert_equals_(_st(set)._printString(),"a Set (1 3)");
  3051. _st(set)._add_("foo");
  3052. _st(self)._assert_equals_(_st(set)._printString(),"a Set (1 3 'foo')");
  3053. $3=set;
  3054. _st($3)._remove_((1));
  3055. $4=_st($3)._remove_((3));
  3056. _st(self)._assert_equals_(_st(set)._printString(),"a Set ('foo')");
  3057. _st(set)._add_((3));
  3058. _st(self)._assert_equals_(_st(set)._printString(),"a Set ('foo' 3)");
  3059. _st(set)._add_((3));
  3060. _st(self)._assert_equals_(_st(set)._printString(),"a Set ('foo' 3)");
  3061. return self}, function($ctx1) {$ctx1.fill(self,"testPrintString",{set:set},smalltalk.SetTest)})},
  3062. messageSends: ["new", "assert:equals:", "printString", "add:", "remove:"]}),
  3063. smalltalk.SetTest);
  3064. smalltalk.addMethod(
  3065. smalltalk.method({
  3066. selector: "testSize",
  3067. fn: function (){
  3068. var self=this;
  3069. function $Set(){return smalltalk.Set||(typeof Set=="undefined"?nil:Set)}
  3070. return smalltalk.withContext(function($ctx1) {
  3071. _st(self)._assert_equals_(_st(_st($Set())._new())._size(),(0));
  3072. _st(self)._assert_equals_(_st(_st($Set())._withAll_([(1), (2), (3), (4)]))._size(),(4));
  3073. _st(self)._assert_equals_(_st(_st($Set())._withAll_([(1), (1), (1), (1)]))._size(),(1));
  3074. return self}, function($ctx1) {$ctx1.fill(self,"testSize",{},smalltalk.SetTest)})},
  3075. messageSends: ["assert:equals:", "size", "new", "withAll:"]}),
  3076. smalltalk.SetTest);
  3077. smalltalk.addMethod(
  3078. smalltalk.method({
  3079. selector: "testUnicity",
  3080. fn: function (){
  3081. var self=this;
  3082. var set;
  3083. function $Set(){return smalltalk.Set||(typeof Set=="undefined"?nil:Set)}
  3084. return smalltalk.withContext(function($ctx1) {
  3085. set=_st($Set())._new();
  3086. _st(set)._add_((21));
  3087. _st(set)._add_("hello");
  3088. _st(set)._add_((21));
  3089. _st(self)._assert_equals_(_st(set)._size(),(2));
  3090. _st(set)._add_("hello");
  3091. _st(self)._assert_equals_(_st(set)._size(),(2));
  3092. _st(self)._assert_equals_(_st(set)._asArray(),[(21), "hello"]);
  3093. return self}, function($ctx1) {$ctx1.fill(self,"testUnicity",{set:set},smalltalk.SetTest)})},
  3094. messageSends: ["new", "add:", "assert:equals:", "size", "asArray"]}),
  3095. smalltalk.SetTest);
  3096. smalltalk.addClass('StreamTest', smalltalk.TestCase, [], 'Kernel-Tests');
  3097. smalltalk.addMethod(
  3098. smalltalk.method({
  3099. selector: "collectionClass",
  3100. fn: function (){
  3101. var self=this;
  3102. return smalltalk.withContext(function($ctx1) {
  3103. var $1;
  3104. $1=_st(_st(self)._class())._collectionClass();
  3105. return $1;
  3106. }, function($ctx1) {$ctx1.fill(self,"collectionClass",{},smalltalk.StreamTest)})},
  3107. messageSends: ["collectionClass", "class"]}),
  3108. smalltalk.StreamTest);
  3109. smalltalk.addMethod(
  3110. smalltalk.method({
  3111. selector: "newCollection",
  3112. fn: function (){
  3113. var self=this;
  3114. return smalltalk.withContext(function($ctx1) {
  3115. var $1;
  3116. $1=_st(_st(self)._collectionClass())._new();
  3117. return $1;
  3118. }, function($ctx1) {$ctx1.fill(self,"newCollection",{},smalltalk.StreamTest)})},
  3119. messageSends: ["new", "collectionClass"]}),
  3120. smalltalk.StreamTest);
  3121. smalltalk.addMethod(
  3122. smalltalk.method({
  3123. selector: "newStream",
  3124. fn: function (){
  3125. var self=this;
  3126. return smalltalk.withContext(function($ctx1) {
  3127. var $1;
  3128. $1=_st(_st(_st(self)._collectionClass())._new())._stream();
  3129. return $1;
  3130. }, function($ctx1) {$ctx1.fill(self,"newStream",{},smalltalk.StreamTest)})},
  3131. messageSends: ["stream", "new", "collectionClass"]}),
  3132. smalltalk.StreamTest);
  3133. smalltalk.addMethod(
  3134. smalltalk.method({
  3135. selector: "testAtStartAtEnd",
  3136. fn: function (){
  3137. var self=this;
  3138. var stream;
  3139. return smalltalk.withContext(function($ctx1) {
  3140. stream=_st(self)._newStream();
  3141. _st(self)._assert_(_st(stream)._atStart());
  3142. _st(self)._assert_(_st(stream)._atEnd());
  3143. _st(stream)._nextPutAll_(_st(self)._newCollection());
  3144. _st(self)._assert_(_st(stream)._atEnd());
  3145. _st(self)._deny_(_st(stream)._atStart());
  3146. _st(stream)._position_((1));
  3147. _st(self)._deny_(_st(stream)._atEnd());
  3148. _st(self)._deny_(_st(stream)._atStart());
  3149. return self}, function($ctx1) {$ctx1.fill(self,"testAtStartAtEnd",{stream:stream},smalltalk.StreamTest)})},
  3150. messageSends: ["newStream", "assert:", "atStart", "atEnd", "nextPutAll:", "newCollection", "deny:", "position:"]}),
  3151. smalltalk.StreamTest);
  3152. smalltalk.addMethod(
  3153. smalltalk.method({
  3154. selector: "testContents",
  3155. fn: function (){
  3156. var self=this;
  3157. var stream;
  3158. return smalltalk.withContext(function($ctx1) {
  3159. stream=_st(self)._newStream();
  3160. _st(stream)._nextPutAll_(_st(self)._newCollection());
  3161. _st(self)._assert_equals_(_st(stream)._contents(),_st(self)._newCollection());
  3162. return self}, function($ctx1) {$ctx1.fill(self,"testContents",{stream:stream},smalltalk.StreamTest)})},
  3163. messageSends: ["newStream", "nextPutAll:", "newCollection", "assert:equals:", "contents"]}),
  3164. smalltalk.StreamTest);
  3165. smalltalk.addMethod(
  3166. smalltalk.method({
  3167. selector: "testIsEmpty",
  3168. fn: function (){
  3169. var self=this;
  3170. var stream;
  3171. return smalltalk.withContext(function($ctx1) {
  3172. stream=_st(self)._newStream();
  3173. _st(self)._assert_(_st(stream)._isEmpty());
  3174. _st(stream)._nextPutAll_(_st(self)._newCollection());
  3175. _st(self)._deny_(_st(stream)._isEmpty());
  3176. return self}, function($ctx1) {$ctx1.fill(self,"testIsEmpty",{stream:stream},smalltalk.StreamTest)})},
  3177. messageSends: ["newStream", "assert:", "isEmpty", "nextPutAll:", "newCollection", "deny:"]}),
  3178. smalltalk.StreamTest);
  3179. smalltalk.addMethod(
  3180. smalltalk.method({
  3181. selector: "testPosition",
  3182. fn: function (){
  3183. var self=this;
  3184. var collection,stream;
  3185. return smalltalk.withContext(function($ctx1) {
  3186. collection=_st(self)._newCollection();
  3187. stream=_st(self)._newStream();
  3188. _st(stream)._nextPutAll_(collection);
  3189. _st(self)._assert_equals_(_st(stream)._position(),_st(collection)._size());
  3190. _st(stream)._position_((0));
  3191. _st(self)._assert_equals_(_st(stream)._position(),(0));
  3192. _st(stream)._next();
  3193. _st(self)._assert_equals_(_st(stream)._position(),(1));
  3194. _st(stream)._next();
  3195. _st(self)._assert_equals_(_st(stream)._position(),(2));
  3196. return self}, function($ctx1) {$ctx1.fill(self,"testPosition",{collection:collection,stream:stream},smalltalk.StreamTest)})},
  3197. messageSends: ["newCollection", "newStream", "nextPutAll:", "assert:equals:", "position", "size", "position:", "next"]}),
  3198. smalltalk.StreamTest);
  3199. smalltalk.addMethod(
  3200. smalltalk.method({
  3201. selector: "testReading",
  3202. fn: function (){
  3203. var self=this;
  3204. var stream,collection;
  3205. return smalltalk.withContext(function($ctx1) {
  3206. var $1,$2;
  3207. collection=_st(self)._newCollection();
  3208. stream=_st(self)._newStream();
  3209. $1=stream;
  3210. _st($1)._nextPutAll_(collection);
  3211. $2=_st($1)._position_((0));
  3212. _st(collection)._do_((function(each){
  3213. return smalltalk.withContext(function($ctx2) {
  3214. return _st(self)._assert_equals_(_st(stream)._next(),each);
  3215. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  3216. _st(self)._assert_(_st(_st(stream)._next())._isNil());
  3217. return self}, function($ctx1) {$ctx1.fill(self,"testReading",{stream:stream,collection:collection},smalltalk.StreamTest)})},
  3218. messageSends: ["newCollection", "newStream", "nextPutAll:", "position:", "do:", "assert:equals:", "next", "assert:", "isNil"]}),
  3219. smalltalk.StreamTest);
  3220. smalltalk.addMethod(
  3221. smalltalk.method({
  3222. selector: "testStreamContents",
  3223. fn: function (){
  3224. var self=this;
  3225. return smalltalk.withContext(function($ctx1) {
  3226. return self}, function($ctx1) {$ctx1.fill(self,"testStreamContents",{},smalltalk.StreamTest)})},
  3227. messageSends: []}),
  3228. smalltalk.StreamTest);
  3229. smalltalk.addMethod(
  3230. smalltalk.method({
  3231. selector: "testWrite",
  3232. fn: function (){
  3233. var self=this;
  3234. var stream,collection;
  3235. return smalltalk.withContext(function($ctx1) {
  3236. collection=_st(self)._newCollection();
  3237. stream=_st(self)._newStream();
  3238. _st(collection)._do_((function(each){
  3239. return smalltalk.withContext(function($ctx2) {
  3240. return _st(stream).__lt_lt(each);
  3241. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  3242. _st(self)._assert_equals_(_st(stream)._contents(),collection);
  3243. return self}, function($ctx1) {$ctx1.fill(self,"testWrite",{stream:stream,collection:collection},smalltalk.StreamTest)})},
  3244. messageSends: ["newCollection", "newStream", "do:", "<<", "assert:equals:", "contents"]}),
  3245. smalltalk.StreamTest);
  3246. smalltalk.addMethod(
  3247. smalltalk.method({
  3248. selector: "testWriting",
  3249. fn: function (){
  3250. var self=this;
  3251. var stream,collection;
  3252. return smalltalk.withContext(function($ctx1) {
  3253. collection=_st(self)._newCollection();
  3254. stream=_st(self)._newStream();
  3255. _st(collection)._do_((function(each){
  3256. return smalltalk.withContext(function($ctx2) {
  3257. return _st(stream)._nextPut_(each);
  3258. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  3259. _st(self)._assert_equals_(_st(stream)._contents(),collection);
  3260. stream=_st(self)._newStream();
  3261. _st(stream)._nextPutAll_(collection);
  3262. _st(self)._assert_equals_(_st(stream)._contents(),collection);
  3263. return self}, function($ctx1) {$ctx1.fill(self,"testWriting",{stream:stream,collection:collection},smalltalk.StreamTest)})},
  3264. messageSends: ["newCollection", "newStream", "do:", "nextPut:", "assert:equals:", "contents", "nextPutAll:"]}),
  3265. smalltalk.StreamTest);
  3266. smalltalk.addMethod(
  3267. smalltalk.method({
  3268. selector: "collectionClass",
  3269. fn: function (){
  3270. var self=this;
  3271. return smalltalk.withContext(function($ctx1) {
  3272. return nil;
  3273. }, function($ctx1) {$ctx1.fill(self,"collectionClass",{},smalltalk.StreamTest.klass)})},
  3274. messageSends: []}),
  3275. smalltalk.StreamTest.klass);
  3276. smalltalk.addMethod(
  3277. smalltalk.method({
  3278. selector: "isAbstract",
  3279. fn: function (){
  3280. var self=this;
  3281. return smalltalk.withContext(function($ctx1) {
  3282. var $1;
  3283. $1=_st(_st(self)._collectionClass())._isNil();
  3284. return $1;
  3285. }, function($ctx1) {$ctx1.fill(self,"isAbstract",{},smalltalk.StreamTest.klass)})},
  3286. messageSends: ["isNil", "collectionClass"]}),
  3287. smalltalk.StreamTest.klass);
  3288. smalltalk.addClass('ArrayStreamTest', smalltalk.StreamTest, [], 'Kernel-Tests');
  3289. smalltalk.addMethod(
  3290. smalltalk.method({
  3291. selector: "newCollection",
  3292. fn: function (){
  3293. var self=this;
  3294. return smalltalk.withContext(function($ctx1) {
  3295. var $1;
  3296. $1=[true,(1),_st((3)).__at((4)),"foo"];
  3297. return $1;
  3298. }, function($ctx1) {$ctx1.fill(self,"newCollection",{},smalltalk.ArrayStreamTest)})},
  3299. messageSends: ["@"]}),
  3300. smalltalk.ArrayStreamTest);
  3301. smalltalk.addMethod(
  3302. smalltalk.method({
  3303. selector: "collectionClass",
  3304. fn: function (){
  3305. var self=this;
  3306. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  3307. return smalltalk.withContext(function($ctx1) {
  3308. var $1;
  3309. $1=$Array();
  3310. return $1;
  3311. }, function($ctx1) {$ctx1.fill(self,"collectionClass",{},smalltalk.ArrayStreamTest.klass)})},
  3312. messageSends: []}),
  3313. smalltalk.ArrayStreamTest.klass);
  3314. smalltalk.addClass('StringStreamTest', smalltalk.StreamTest, [], 'Kernel-Tests');
  3315. smalltalk.addMethod(
  3316. smalltalk.method({
  3317. selector: "newCollection",
  3318. fn: function (){
  3319. var self=this;
  3320. return smalltalk.withContext(function($ctx1) {
  3321. return "hello world";
  3322. }, function($ctx1) {$ctx1.fill(self,"newCollection",{},smalltalk.StringStreamTest)})},
  3323. messageSends: []}),
  3324. smalltalk.StringStreamTest);
  3325. smalltalk.addMethod(
  3326. smalltalk.method({
  3327. selector: "collectionClass",
  3328. fn: function (){
  3329. var self=this;
  3330. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  3331. return smalltalk.withContext(function($ctx1) {
  3332. var $1;
  3333. $1=$String();
  3334. return $1;
  3335. }, function($ctx1) {$ctx1.fill(self,"collectionClass",{},smalltalk.StringStreamTest.klass)})},
  3336. messageSends: []}),
  3337. smalltalk.StringStreamTest.klass);
  3338. smalltalk.addClass('UndefinedTest', smalltalk.TestCase, [], 'Kernel-Tests');
  3339. smalltalk.addMethod(
  3340. smalltalk.method({
  3341. selector: "testCopying",
  3342. fn: function (){
  3343. var self=this;
  3344. return smalltalk.withContext(function($ctx1) {
  3345. _st(self)._assert_equals_(_st(nil)._copy(),nil);
  3346. return self}, function($ctx1) {$ctx1.fill(self,"testCopying",{},smalltalk.UndefinedTest)})},
  3347. messageSends: ["assert:equals:", "copy"]}),
  3348. smalltalk.UndefinedTest);
  3349. smalltalk.addMethod(
  3350. smalltalk.method({
  3351. selector: "testDeepCopy",
  3352. fn: function (){
  3353. var self=this;
  3354. return smalltalk.withContext(function($ctx1) {
  3355. _st(self)._assert_(_st(_st(nil)._deepCopy()).__eq(nil));
  3356. return self}, function($ctx1) {$ctx1.fill(self,"testDeepCopy",{},smalltalk.UndefinedTest)})},
  3357. messageSends: ["assert:", "=", "deepCopy"]}),
  3358. smalltalk.UndefinedTest);
  3359. smalltalk.addMethod(
  3360. smalltalk.method({
  3361. selector: "testIfNil",
  3362. fn: function (){
  3363. var self=this;
  3364. return smalltalk.withContext(function($ctx1) {
  3365. var $1,$2,$3,$5,$4,$6,$7,$8,$10,$9;
  3366. $1=self;
  3367. if(($receiver = nil) == nil || $receiver == undefined){
  3368. $2=true;
  3369. } else {
  3370. $2=nil;
  3371. };
  3372. _st($1)._assert_equals_($2,true);
  3373. $3=self;
  3374. if(($receiver = nil) == nil || $receiver == undefined){
  3375. $5=nil;
  3376. } else {
  3377. $5=true;
  3378. };
  3379. $4=_st($5).__eq(true);
  3380. _st($3)._deny_($4);
  3381. $6=self;
  3382. if(($receiver = nil) == nil || $receiver == undefined){
  3383. $7=true;
  3384. } else {
  3385. $7=false;
  3386. };
  3387. _st($6)._assert_equals_($7,true);
  3388. $8=self;
  3389. if(($receiver = nil) == nil || $receiver == undefined){
  3390. $10=false;
  3391. } else {
  3392. $10=true;
  3393. };
  3394. $9=_st($10).__eq(true);
  3395. _st($8)._deny_($9);
  3396. return self}, function($ctx1) {$ctx1.fill(self,"testIfNil",{},smalltalk.UndefinedTest)})},
  3397. messageSends: ["assert:equals:", "ifNil:", "deny:", "=", "ifNotNil:", "ifNil:ifNotNil:", "ifNotNil:ifNil:"]}),
  3398. smalltalk.UndefinedTest);
  3399. smalltalk.addMethod(
  3400. smalltalk.method({
  3401. selector: "testIsNil",
  3402. fn: function (){
  3403. var self=this;
  3404. return smalltalk.withContext(function($ctx1) {
  3405. _st(self)._assert_(_st(nil)._isNil());
  3406. _st(self)._deny_(_st(nil)._notNil());
  3407. return self}, function($ctx1) {$ctx1.fill(self,"testIsNil",{},smalltalk.UndefinedTest)})},
  3408. messageSends: ["assert:", "isNil", "deny:", "notNil"]}),
  3409. smalltalk.UndefinedTest);