Kernel-Tests.deploy.js 129 KB

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