Kernel-Tests.deploy.js 139 KB

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