Kernel-Tests.deploy.js 133 KB

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