Kernel-Tests.deploy.js 107 KB

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