Kernel-Tests.deploy.js 118 KB

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