Kernel-Tests.deploy.js 108 KB

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