Kernel-Tests.deploy.js 146 KB

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