Kernel-Tests.deploy.js 139 KB

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