Kernel-Tests.deploy.js 97 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301
  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. smalltalk.send(self, "_shouldnt_raise_", [(function(){return smalltalk.send(smalltalk.send((function(){return smalltalk.send(smalltalk.send((smalltalk.Error || Error), "_new", []), "_signal", []);}), "_valueWithInterval_", [(0)]), "_clearInterval", []);}), (smalltalk.Error || Error)]);
  10. return self;}
  11. }),
  12. smalltalk.BlockClosureTest);
  13. smalltalk.addMethod(
  14. "_testCanClearTimeout",
  15. smalltalk.method({
  16. selector: "testCanClearTimeout",
  17. fn: function (){
  18. var self=this;
  19. smalltalk.send(self, "_shouldnt_raise_", [(function(){return smalltalk.send(smalltalk.send((function(){return smalltalk.send(smalltalk.send((smalltalk.Error || Error), "_new", []), "_signal", []);}), "_valueWithTimeout_", [(0)]), "_clearTimeout", []);}), (smalltalk.Error || Error)]);
  20. return self;}
  21. }),
  22. smalltalk.BlockClosureTest);
  23. smalltalk.addMethod(
  24. "_testCompiledSource",
  25. smalltalk.method({
  26. selector: "testCompiledSource",
  27. fn: function (){
  28. var self=this;
  29. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((function(){return (1) + (1);}), "_compiledSource", []), "_includesSubString_", ["function"])]);
  30. return self;}
  31. }),
  32. smalltalk.BlockClosureTest);
  33. smalltalk.addMethod(
  34. "_testEnsure",
  35. smalltalk.method({
  36. selector: "testEnsure",
  37. fn: function (){
  38. var self=this;
  39. smalltalk.send(self, "_assert_equals_", [(3), smalltalk.send((function(){return (3);}), "_ensure_", [(function(){return (4);})])]);
  40. return self;}
  41. }),
  42. smalltalk.BlockClosureTest);
  43. smalltalk.addMethod(
  44. "_testEnsureRaises",
  45. smalltalk.method({
  46. selector: "testEnsureRaises",
  47. fn: function (){
  48. var self=this;
  49. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send((function(){return smalltalk.send(smalltalk.send((smalltalk.Error || Error), "_new", []), "_signal", []);}), "_ensure_", [(function(){return true;})]);}), (smalltalk.Error || Error)]);
  50. return self;}
  51. }),
  52. smalltalk.BlockClosureTest);
  53. smalltalk.addMethod(
  54. "_testNumArgs",
  55. smalltalk.method({
  56. selector: "testNumArgs",
  57. fn: function (){
  58. var self=this;
  59. smalltalk.send(self, "_assert_equals_", [smalltalk.send((function(){return nil;}), "_numArgs", []), (0)]);
  60. smalltalk.send(self, "_assert_equals_", [smalltalk.send((function(a, b){return nil;}), "_numArgs", []), (2)]);
  61. return self;}
  62. }),
  63. smalltalk.BlockClosureTest);
  64. smalltalk.addMethod(
  65. "_testOnDo",
  66. smalltalk.method({
  67. selector: "testOnDo",
  68. fn: function (){
  69. var self=this;
  70. smalltalk.send(self, "_assert_", [smalltalk.send((function(){return smalltalk.send(smalltalk.send((smalltalk.Error || Error), "_new", []), "_signal", []);}), "_on_do_", [(smalltalk.Error || Error), (function(ex){return true;})])]);
  71. return self;}
  72. }),
  73. smalltalk.BlockClosureTest);
  74. smalltalk.addMethod(
  75. "_testValue",
  76. smalltalk.method({
  77. selector: "testValue",
  78. fn: function (){
  79. var self=this;
  80. smalltalk.send(self, "_assert_equals_", [smalltalk.send((function(){return (1) + (1);}), "_value", []), (2)]);
  81. smalltalk.send(self, "_assert_equals_", [smalltalk.send((function(x){return ((($receiver = x).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));}), "_value_", [(2)]), (3)]);
  82. smalltalk.send(self, "_assert_equals_", [smalltalk.send((function(x, y){return ((($receiver = x).klass === smalltalk.Number) ? $receiver *y : smalltalk.send($receiver, "__star", [y]));}), "_value_value_", [(2), (4)]), (8)]);
  83. smalltalk.send(self, "_assert_equals_", [smalltalk.send((function(a, b, c){return (1);}), "_value", []), (1)]);
  84. return self;}
  85. }),
  86. smalltalk.BlockClosureTest);
  87. smalltalk.addMethod(
  88. "_testValueWithPossibleArguments",
  89. smalltalk.method({
  90. selector: "testValueWithPossibleArguments",
  91. fn: function (){
  92. var self=this;
  93. smalltalk.send(self, "_assert_equals_", [smalltalk.send((function(){return (1);}), "_valueWithPossibleArguments_", [[(3), (4)]]), (1)]);
  94. smalltalk.send(self, "_assert_equals_", [smalltalk.send((function(a){return ((($receiver = a).klass === smalltalk.Number) ? $receiver +(4) : smalltalk.send($receiver, "__plus", [(4)]));}), "_valueWithPossibleArguments_", [[(3), (4)]]), (7)]);
  95. smalltalk.send(self, "_assert_equals_", [smalltalk.send((function(a, b){return ((($receiver = a).klass === smalltalk.Number) ? $receiver +b : smalltalk.send($receiver, "__plus", [b]));}), "_valueWithPossibleArguments_", [[(3), (4), (5)]]), (7)]);
  96. return self;}
  97. }),
  98. smalltalk.BlockClosureTest);
  99. smalltalk.addMethod(
  100. "_testWhileFalse",
  101. smalltalk.method({
  102. selector: "testWhileFalse",
  103. fn: function (){
  104. var self=this;
  105. var i=nil;
  106. (i=(0));
  107. (function(){while(!(function(){return ((($receiver = i).klass === smalltalk.Number) ? $receiver >(5) : smalltalk.send($receiver, "__gt", [(5)]));})()) {(function(){return (i=((($receiver = i).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));})()}})();
  108. smalltalk.send(self, "_assert_equals_", [i, (6)]);
  109. (i=(0));
  110. (function(){while(!(function(){(i=((($receiver = i).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));return ((($receiver = i).klass === smalltalk.Number) ? $receiver >(5) : smalltalk.send($receiver, "__gt", [(5)]));})()) {}})();
  111. smalltalk.send(self, "_assert_equals_", [i, (6)]);
  112. return self;}
  113. }),
  114. smalltalk.BlockClosureTest);
  115. smalltalk.addMethod(
  116. "_testWhileTrue",
  117. smalltalk.method({
  118. selector: "testWhileTrue",
  119. fn: function (){
  120. var self=this;
  121. var i=nil;
  122. (i=(0));
  123. (function(){while((function(){return ((($receiver = i).klass === smalltalk.Number) ? $receiver <(5) : smalltalk.send($receiver, "__lt", [(5)]));})()) {(function(){return (i=((($receiver = i).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));})()}})();
  124. smalltalk.send(self, "_assert_equals_", [i, (5)]);
  125. (i=(0));
  126. (function(){while((function(){(i=((($receiver = i).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));return ((($receiver = i).klass === smalltalk.Number) ? $receiver <(5) : smalltalk.send($receiver, "__lt", [(5)]));})()) {}})();
  127. smalltalk.send(self, "_assert_equals_", [i, (5)]);
  128. return self;}
  129. }),
  130. smalltalk.BlockClosureTest);
  131. smalltalk.addClass('BooleanTest', smalltalk.TestCase, [], 'Kernel-Tests');
  132. smalltalk.addMethod(
  133. "_testEquality",
  134. smalltalk.method({
  135. selector: "testEquality",
  136. fn: function (){
  137. var self=this;
  138. smalltalk.send(self, "_deny_", [smalltalk.send((0), "__eq", [false])]);
  139. smalltalk.send(self, "_deny_", [smalltalk.send(false, "__eq", [(0)])]);
  140. smalltalk.send(self, "_deny_", [smalltalk.send("", "__eq", [false])]);
  141. smalltalk.send(self, "_deny_", [smalltalk.send(false, "__eq", [""])]);
  142. smalltalk.send(self, "_assert_", [smalltalk.send(true, "__eq", [true])]);
  143. smalltalk.send(self, "_deny_", [smalltalk.send(false, "__eq", [true])]);
  144. smalltalk.send(self, "_deny_", [smalltalk.send(true, "__eq", [false])]);
  145. smalltalk.send(self, "_assert_", [smalltalk.send(false, "__eq", [false])]);
  146. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(true, "_yourself", []), "__eq", [true])]);
  147. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(true, "_yourself", []), "__eq", [smalltalk.send(true, "_yourself", [])])]);
  148. return self;}
  149. }),
  150. smalltalk.BooleanTest);
  151. smalltalk.addMethod(
  152. "_testIdentity",
  153. smalltalk.method({
  154. selector: "testIdentity",
  155. fn: function (){
  156. var self=this;
  157. smalltalk.send(self, "_deny_", [smalltalk.send((0), "__eq_eq", [false])]);
  158. smalltalk.send(self, "_deny_", [smalltalk.send(false, "__eq_eq", [(0)])]);
  159. smalltalk.send(self, "_deny_", [smalltalk.send("", "__eq_eq", [false])]);
  160. smalltalk.send(self, "_deny_", [smalltalk.send(false, "__eq_eq", [""])]);
  161. smalltalk.send(self, "_assert_", [smalltalk.send(true, "__eq_eq", [true])]);
  162. smalltalk.send(self, "_deny_", [smalltalk.send(false, "__eq_eq", [true])]);
  163. smalltalk.send(self, "_deny_", [smalltalk.send(true, "__eq_eq", [false])]);
  164. smalltalk.send(self, "_assert_", [smalltalk.send(false, "__eq_eq", [false])]);
  165. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(true, "_yourself", []), "__eq_eq", [true])]);
  166. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(true, "_yourself", []), "__eq_eq", [smalltalk.send(true, "_yourself", [])])]);
  167. return self;}
  168. }),
  169. smalltalk.BooleanTest);
  170. smalltalk.addMethod(
  171. "_testIfTrueIfFalse",
  172. smalltalk.method({
  173. selector: "testIfTrueIfFalse",
  174. fn: function (){
  175. var self=this;
  176. smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = true).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "alternative block";})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return "alternative block";})])), "__eq", ["alternative block"])]);
  177. smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = true).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return "alternative block";})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return "alternative block";})])), "__eq", [nil])]);
  178. smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = false).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "alternative block";})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return "alternative block";})])), "__eq", [nil])]);
  179. smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = false).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return "alternative block";})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return "alternative block";})])), "__eq", ["alternative block"])]);
  180. smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = false).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "alternative block";})() : (function(){return "alternative block2";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "alternative block";}), (function(){return "alternative block2";})])), "__eq", ["alternative block2"])]);
  181. smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = false).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return "alternative block";})() : (function(){return "alternative block2";})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){return "alternative block";}), (function(){return "alternative block2";})])), "__eq", ["alternative block"])]);
  182. smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = true).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "alternative block";})() : (function(){return "alternative block2";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "alternative block";}), (function(){return "alternative block2";})])), "__eq", ["alternative block"])]);
  183. smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = true).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return "alternative block";})() : (function(){return "alternative block2";})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){return "alternative block";}), (function(){return "alternative block2";})])), "__eq", ["alternative block2"])]);
  184. return self;}
  185. }),
  186. smalltalk.BooleanTest);
  187. smalltalk.addMethod(
  188. "_testIfTrueIfFalseWithBoxing",
  189. smalltalk.method({
  190. selector: "testIfTrueIfFalseWithBoxing",
  191. fn: function (){
  192. var self=this;
  193. smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = smalltalk.send(true, "_boxed", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "alternative block";})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return "alternative block";})])), "__eq", ["alternative block"])]);
  194. smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = smalltalk.send(true, "_boxed", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return "alternative block";})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return "alternative block";})])), "__eq", [nil])]);
  195. smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = smalltalk.send(false, "_boxed", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "alternative block";})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return "alternative block";})])), "__eq", [nil])]);
  196. smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = smalltalk.send(false, "_boxed", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return "alternative block";})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return "alternative block";})])), "__eq", ["alternative block"])]);
  197. smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = smalltalk.send(false, "_boxed", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "alternative block";})() : (function(){return "alternative block2";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "alternative block";}), (function(){return "alternative block2";})])), "__eq", ["alternative block2"])]);
  198. smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = smalltalk.send(false, "_boxed", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return "alternative block";})() : (function(){return "alternative block2";})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){return "alternative block";}), (function(){return "alternative block2";})])), "__eq", ["alternative block"])]);
  199. smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = smalltalk.send(true, "_boxed", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "alternative block";})() : (function(){return "alternative block2";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "alternative block";}), (function(){return "alternative block2";})])), "__eq", ["alternative block"])]);
  200. smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = smalltalk.send(true, "_boxed", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return "alternative block";})() : (function(){return "alternative block2";})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){return "alternative block";}), (function(){return "alternative block2";})])), "__eq", ["alternative block2"])]);
  201. return self;}
  202. }),
  203. smalltalk.BooleanTest);
  204. smalltalk.addMethod(
  205. "_testLogic",
  206. smalltalk.method({
  207. selector: "testLogic",
  208. fn: function (){
  209. var self=this;
  210. (function($rec){smalltalk.send($rec, "_assert_", [smalltalk.send(true, "_&", [true])]);smalltalk.send($rec, "_deny_", [smalltalk.send(true, "_&", [false])]);smalltalk.send($rec, "_deny_", [smalltalk.send(false, "_&", [true])]);return smalltalk.send($rec, "_deny_", [smalltalk.send(false, "_&", [false])]);})(self);
  211. (function($rec){smalltalk.send($rec, "_assert_", [smalltalk.send(true, "_|", [true])]);smalltalk.send($rec, "_assert_", [smalltalk.send(true, "_|", [false])]);smalltalk.send($rec, "_assert_", [smalltalk.send(false, "_|", [true])]);return smalltalk.send($rec, "_deny_", [smalltalk.send(false, "_|", [false])]);})(self);
  212. (function($rec){smalltalk.send($rec, "_assert_", [smalltalk.send(true, "_&", [(1) > (0)])]);smalltalk.send($rec, "_deny_", [smalltalk.send((1) > (0), "_&", [false])]);return smalltalk.send($rec, "_deny_", [smalltalk.send((1) > (0), "_&", [(1) > (2)])]);})(self);
  213. (function($rec){smalltalk.send($rec, "_assert_", [smalltalk.send(false, "_|", [(1) > (0)])]);smalltalk.send($rec, "_assert_", [smalltalk.send((1) > (0), "_|", [false])]);return smalltalk.send($rec, "_assert_", [smalltalk.send((1) > (0), "_|", [(1) > (2)])]);})(self);
  214. return self;}
  215. }),
  216. smalltalk.BooleanTest);
  217. smalltalk.addMethod(
  218. "_testLogicKeywords",
  219. smalltalk.method({
  220. selector: "testLogicKeywords",
  221. fn: function (){
  222. var self=this;
  223. (function($rec){smalltalk.send($rec, "_assert_", [smalltalk.send(true, "_and_", [(function(){return true;})])]);smalltalk.send($rec, "_deny_", [smalltalk.send(true, "_and_", [(function(){return false;})])]);smalltalk.send($rec, "_deny_", [smalltalk.send(false, "_and_", [(function(){return true;})])]);return smalltalk.send($rec, "_deny_", [smalltalk.send(false, "_and_", [(function(){return false;})])]);})(self);
  224. (function($rec){smalltalk.send($rec, "_assert_", [smalltalk.send(true, "_or_", [(function(){return true;})])]);smalltalk.send($rec, "_assert_", [smalltalk.send(true, "_or_", [(function(){return false;})])]);smalltalk.send($rec, "_assert_", [smalltalk.send(false, "_or_", [(function(){return true;})])]);return smalltalk.send($rec, "_deny_", [smalltalk.send(false, "_or_", [(function(){return false;})])]);})(self);
  225. (function($rec){smalltalk.send($rec, "_assert_", [smalltalk.send(true, "_and_", [(function(){return (1) > (0);})])]);smalltalk.send($rec, "_deny_", [smalltalk.send((1) > (0), "_and_", [(function(){return false;})])]);return smalltalk.send($rec, "_deny_", [smalltalk.send((1) > (0), "_and_", [(function(){return (1) > (2);})])]);})(self);
  226. (function($rec){smalltalk.send($rec, "_assert_", [smalltalk.send(false, "_or_", [(function(){return (1) > (0);})])]);smalltalk.send($rec, "_assert_", [smalltalk.send((1) > (0), "_or_", [(function(){return false;})])]);return smalltalk.send($rec, "_assert_", [smalltalk.send((1) > (0), "_or_", [(function(){return (1) > (2);})])]);})(self);
  227. return self;}
  228. }),
  229. smalltalk.BooleanTest);
  230. smalltalk.addMethod(
  231. "_testNonBooleanError",
  232. smalltalk.method({
  233. selector: "testNonBooleanError",
  234. fn: function (){
  235. var self=this;
  236. var nonBoolean=nil;
  237. (nonBoolean= '' );
  238. smalltalk.send(self, "_should_raise_", [(function(){return ((($receiver = nonBoolean).klass === smalltalk.Boolean) ? ($receiver ? (function(){return nil;})() : (function(){return nil;})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return nil;}), (function(){return nil;})]));}), (smalltalk.NonBooleanReceiver || NonBooleanReceiver)]);
  239. return self;}
  240. }),
  241. smalltalk.BooleanTest);
  242. smalltalk.addClass('ClassBuilderTest', smalltalk.TestCase, ['builder', 'theClass'], 'Kernel-Tests');
  243. smalltalk.addMethod(
  244. "_setUp",
  245. smalltalk.method({
  246. selector: "setUp",
  247. fn: function (){
  248. var self=this;
  249. (self['@builder']=smalltalk.send((smalltalk.ClassBuilder || ClassBuilder), "_new", []));
  250. return self;}
  251. }),
  252. smalltalk.ClassBuilderTest);
  253. smalltalk.addMethod(
  254. "_tearDown",
  255. smalltalk.method({
  256. selector: "tearDown",
  257. fn: function (){
  258. var self=this;
  259. (($receiver = self['@theClass']) != nil && $receiver != undefined) ? (function(){smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_removeClass_", [self['@theClass']]);return (self['@theClass']=nil);})() : nil;
  260. return self;}
  261. }),
  262. smalltalk.ClassBuilderTest);
  263. smalltalk.addMethod(
  264. "_testClassCopy",
  265. smalltalk.method({
  266. selector: "testClassCopy",
  267. fn: function (){
  268. var self=this;
  269. (self['@theClass']=smalltalk.send(self['@builder'], "_copyClass_named_", [(smalltalk.ObjectMock || ObjectMock), "ObjectMock2"]));
  270. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(self['@theClass'], "_superclass", []), "__eq_eq", [smalltalk.send((smalltalk.ObjectMock || ObjectMock), "_superclass", [])])]);
  271. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(self['@theClass'], "_instanceVariableNames", []), "__eq_eq", [smalltalk.send((smalltalk.ObjectMock || ObjectMock), "_instanceVariableNames", [])])]);
  272. smalltalk.send(self, "_assert_equals_", [smalltalk.send(self['@theClass'], "_name", []), "ObjectMock2"]);
  273. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(self['@theClass'], "_package", []), "__eq_eq", [smalltalk.send((smalltalk.ObjectMock || ObjectMock), "_package", [])])]);
  274. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send(self['@theClass'], "_methodDictionary", []), "_keys", []), smalltalk.send(smalltalk.send((smalltalk.ObjectMock || ObjectMock), "_methodDictionary", []), "_keys", [])]);
  275. return self;}
  276. }),
  277. smalltalk.ClassBuilderTest);
  278. smalltalk.addMethod(
  279. "_testInstanceVariableNames",
  280. smalltalk.method({
  281. selector: "testInstanceVariableNames",
  282. fn: function (){
  283. var self=this;
  284. smalltalk.send(self, "_assert_equals_", [smalltalk.send(self['@builder'], "_instanceVariableNamesFor_", [" hello world "]), ["hello", "world"]]);
  285. return self;}
  286. }),
  287. smalltalk.ClassBuilderTest);
  288. smalltalk.addClass('CollectionTest', smalltalk.TestCase, [], 'Kernel-Tests');
  289. smalltalk.addMethod(
  290. "_assertSameContents_as_",
  291. smalltalk.method({
  292. selector: "assertSameContents:as:",
  293. fn: function (aCollection, anotherCollection){
  294. var self=this;
  295. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(aCollection, "_size", []), "__eq", [smalltalk.send(anotherCollection, "_size", [])])]);
  296. smalltalk.send(aCollection, "_do_", [(function(each){return smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(aCollection, "_occurrencesOf_", [each]), "__eq", [smalltalk.send(anotherCollection, "_occurrencesOf_", [each])])]);})]);
  297. return self;}
  298. }),
  299. smalltalk.CollectionTest);
  300. smalltalk.addMethod(
  301. "_collection",
  302. smalltalk.method({
  303. selector: "collection",
  304. fn: function (){
  305. var self=this;
  306. return smalltalk.send(smalltalk.send(self, "_collectionClass", []), "_withAll_", [smalltalk.send(self, "_defaultValues", [])]);
  307. return self;}
  308. }),
  309. smalltalk.CollectionTest);
  310. smalltalk.addMethod(
  311. "_collectionClass",
  312. smalltalk.method({
  313. selector: "collectionClass",
  314. fn: function (){
  315. var self=this;
  316. return smalltalk.send(smalltalk.send(self, "_class", []), "_collectionClass", []);
  317. return self;}
  318. }),
  319. smalltalk.CollectionTest);
  320. smalltalk.addMethod(
  321. "_collectionWithDuplicates",
  322. smalltalk.method({
  323. selector: "collectionWithDuplicates",
  324. fn: function (){
  325. var self=this;
  326. return smalltalk.send(smalltalk.send(self, "_collectionClass", []), "_withAll_", [["a", "b", "c", (1), (2), (1), "a"]]);
  327. return self;}
  328. }),
  329. smalltalk.CollectionTest);
  330. smalltalk.addMethod(
  331. "_defaultValues",
  332. smalltalk.method({
  333. selector: "defaultValues",
  334. fn: function (){
  335. var self=this;
  336. return [(1), (2), (3), (-4)];
  337. return self;}
  338. }),
  339. smalltalk.CollectionTest);
  340. smalltalk.addMethod(
  341. "_isCollectionReadOnly",
  342. smalltalk.method({
  343. selector: "isCollectionReadOnly",
  344. fn: function (){
  345. var self=this;
  346. return false;
  347. return self;}
  348. }),
  349. smalltalk.CollectionTest);
  350. smalltalk.addMethod(
  351. "_testAsArray",
  352. smalltalk.method({
  353. selector: "testAsArray",
  354. fn: function (){
  355. var self=this;
  356. smalltalk.send(self, "_assertSameContents_as_", [smalltalk.send(self, "_collection", []), smalltalk.send(smalltalk.send(self, "_collection", []), "_asArray", [])]);
  357. return self;}
  358. }),
  359. smalltalk.CollectionTest);
  360. smalltalk.addMethod(
  361. "_testAsOrderedCollection",
  362. smalltalk.method({
  363. selector: "testAsOrderedCollection",
  364. fn: function (){
  365. var self=this;
  366. smalltalk.send(self, "_assertSameContents_as_", [smalltalk.send(self, "_collection", []), smalltalk.send(smalltalk.send(self, "_collection", []), "_asOrderedCollection", [])]);
  367. return self;}
  368. }),
  369. smalltalk.CollectionTest);
  370. smalltalk.addMethod(
  371. "_testAsSet",
  372. smalltalk.method({
  373. selector: "testAsSet",
  374. fn: function (){
  375. var self=this;
  376. var c=nil;
  377. var set=nil;
  378. (c=smalltalk.send(self, "_collectionWithDuplicates", []));
  379. (set=smalltalk.send(c, "_asSet", []));
  380. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(set, "_size", []), "__eq", [(5)])]);
  381. smalltalk.send(c, "_do_", [(function(each){return smalltalk.send(self, "_assert_", [smalltalk.send(set, "_includes_", [each])]);})]);
  382. return self;}
  383. }),
  384. smalltalk.CollectionTest);
  385. smalltalk.addMethod(
  386. "_testCollect",
  387. smalltalk.method({
  388. selector: "testCollect",
  389. fn: function (){
  390. var self=this;
  391. var newCollection=nil;
  392. (newCollection=[(1), (2), (3), (4)]);
  393. smalltalk.send(self, "_assertSameContents_as_", [smalltalk.send(smalltalk.send(self, "_collection", []), "_collect_", [(function(each){return smalltalk.send(each, "_abs", []);})]), newCollection]);
  394. return self;}
  395. }),
  396. smalltalk.CollectionTest);
  397. smalltalk.addMethod(
  398. "_testDetect",
  399. smalltalk.method({
  400. selector: "testDetect",
  401. fn: function (){
  402. var self=this;
  403. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_collection", []), "_detect_", [(function(each){return ((($receiver = each).klass === smalltalk.Number) ? $receiver <(0) : smalltalk.send($receiver, "__lt", [(0)]));})]), "__eq", [(-4)])]);
  404. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send(smalltalk.send(self, "_collection", []), "_detect_", [(function(each){return smalltalk.send(each, "__eq", [(6)]);})]);}), (smalltalk.Error || Error)]);
  405. return self;}
  406. }),
  407. smalltalk.CollectionTest);
  408. smalltalk.addMethod(
  409. "_testDo",
  410. smalltalk.method({
  411. selector: "testDo",
  412. fn: function (){
  413. var self=this;
  414. var newCollection=nil;
  415. (newCollection=smalltalk.send((smalltalk.OrderedCollection || OrderedCollection), "_new", []));
  416. smalltalk.send(smalltalk.send(self, "_collection", []), "_do_", [(function(each){return smalltalk.send(newCollection, "_add_", [each]);})]);
  417. smalltalk.send(self, "_assertSameContents_as_", [smalltalk.send(self, "_collection", []), newCollection]);
  418. return self;}
  419. }),
  420. smalltalk.CollectionTest);
  421. smalltalk.addMethod(
  422. "_testIsEmpty",
  423. smalltalk.method({
  424. selector: "testIsEmpty",
  425. fn: function (){
  426. var self=this;
  427. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_collectionClass", []), "_new", []), "_isEmpty", [])]);
  428. smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send(self, "_collection", []), "_isEmpty", [])]);
  429. return self;}
  430. }),
  431. smalltalk.CollectionTest);
  432. smalltalk.addMethod(
  433. "_testSelect",
  434. smalltalk.method({
  435. selector: "testSelect",
  436. fn: function (){
  437. var self=this;
  438. var newCollection=nil;
  439. (newCollection=[(2), (-4)]);
  440. smalltalk.send(self, "_assertSameContents_as_", [smalltalk.send(smalltalk.send(self, "_collection", []), "_select_", [(function(each){return smalltalk.send(each, "_even", []);})]), newCollection]);
  441. return self;}
  442. }),
  443. smalltalk.CollectionTest);
  444. smalltalk.addMethod(
  445. "_testSize",
  446. smalltalk.method({
  447. selector: "testSize",
  448. fn: function (){
  449. var self=this;
  450. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_collectionClass", []), "_new", []), "_size", []), "__eq", [(0)])]);
  451. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_collection", []), "_size", []), "__eq", [(4)])]);
  452. return self;}
  453. }),
  454. smalltalk.CollectionTest);
  455. smalltalk.addMethod(
  456. "_collectionClass",
  457. smalltalk.method({
  458. selector: "collectionClass",
  459. fn: function (){
  460. var self=this;
  461. return nil;
  462. return self;}
  463. }),
  464. smalltalk.CollectionTest.klass);
  465. smalltalk.addMethod(
  466. "_isAbstract",
  467. smalltalk.method({
  468. selector: "isAbstract",
  469. fn: function (){
  470. var self=this;
  471. return smalltalk.send(smalltalk.send(self, "_collectionClass", []), "_isNil", []);
  472. return self;}
  473. }),
  474. smalltalk.CollectionTest.klass);
  475. smalltalk.addClass('HashedCollectionTest', smalltalk.CollectionTest, [], 'Kernel-Tests');
  476. smalltalk.addMethod(
  477. "_collection",
  478. smalltalk.method({
  479. selector: "collection",
  480. fn: function (){
  481. var self=this;
  482. return smalltalk.HashedCollection._fromPairs_([smalltalk.send("a", "__minus_gt", [(1)]),smalltalk.send("b", "__minus_gt", [(2)]),smalltalk.send("c", "__minus_gt", [(3)]),smalltalk.send("d", "__minus_gt", [(-4)])]);
  483. return self;}
  484. }),
  485. smalltalk.HashedCollectionTest);
  486. smalltalk.addMethod(
  487. "_collectionWithDuplicates",
  488. smalltalk.method({
  489. selector: "collectionWithDuplicates",
  490. fn: function (){
  491. var self=this;
  492. return smalltalk.HashedCollection._fromPairs_([smalltalk.send("a", "__minus_gt", [(1)]),smalltalk.send("b", "__minus_gt", [(2)]),smalltalk.send("c", "__minus_gt", [(3)]),smalltalk.send("d", "__minus_gt", [(-4)]),smalltalk.send("e", "__minus_gt", [(1)]),smalltalk.send("f", "__minus_gt", [(2)]),smalltalk.send("g", "__minus_gt", [(10)])]);
  493. return self;}
  494. }),
  495. smalltalk.HashedCollectionTest);
  496. smalltalk.addMethod(
  497. "_collectionClass",
  498. smalltalk.method({
  499. selector: "collectionClass",
  500. fn: function (){
  501. var self=this;
  502. return (smalltalk.HashedCollection || HashedCollection);
  503. return self;}
  504. }),
  505. smalltalk.HashedCollectionTest.klass);
  506. smalltalk.addClass('DictionaryTest', smalltalk.HashedCollectionTest, [], 'Kernel-Tests');
  507. smalltalk.addMethod(
  508. "_collection",
  509. smalltalk.method({
  510. selector: "collection",
  511. fn: function (){
  512. var self=this;
  513. return (function($rec){smalltalk.send($rec, "_at_put_", [(1), (1)]);smalltalk.send($rec, "_at_put_", ["a", (2)]);smalltalk.send($rec, "_at_put_", [true, (3)]);smalltalk.send($rec, "_at_put_", [(4), (-4)]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
  514. return self;}
  515. }),
  516. smalltalk.DictionaryTest);
  517. smalltalk.addMethod(
  518. "_collectionWithDuplicates",
  519. smalltalk.method({
  520. selector: "collectionWithDuplicates",
  521. fn: function (){
  522. var self=this;
  523. return (function($rec){smalltalk.send($rec, "_at_put_", [(1), (1)]);smalltalk.send($rec, "_at_put_", ["a", (2)]);smalltalk.send($rec, "_at_put_", [true, (3)]);smalltalk.send($rec, "_at_put_", [(4), (-4)]);smalltalk.send($rec, "_at_put_", ["b", (1)]);smalltalk.send($rec, "_at_put_", [(3), (3)]);smalltalk.send($rec, "_at_put_", [false, (12)]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
  524. return self;}
  525. }),
  526. smalltalk.DictionaryTest);
  527. smalltalk.addMethod(
  528. "_testAccessing",
  529. smalltalk.method({
  530. selector: "testAccessing",
  531. fn: function (){
  532. var self=this;
  533. var d=nil;
  534. (d=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
  535. smalltalk.send(d, "_at_put_", ["hello", "world"]);
  536. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_at_", ["hello"]), "__eq", ["world"])]);
  537. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_at_ifAbsent_", ["hello", (function(){return nil;})]), "__eq", ["world"])]);
  538. smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send(d, "_at_ifAbsent_", ["foo", (function(){return nil;})]), "__eq", ["world"])]);
  539. smalltalk.send(d, "_at_put_", [(1), (2)]);
  540. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_at_", [(1)]), "__eq", [(2)])]);
  541. smalltalk.send(d, "_at_put_", [smalltalk.send((1), "__at", [(3)]), (3)]);
  542. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_at_", [smalltalk.send((1), "__at", [(3)])]), "__eq", [(3)])]);
  543. return self;}
  544. }),
  545. smalltalk.DictionaryTest);
  546. smalltalk.addMethod(
  547. "_testDynamicDictionaries",
  548. smalltalk.method({
  549. selector: "testDynamicDictionaries",
  550. fn: function (){
  551. var self=this;
  552. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.HashedCollection._fromPairs_([smalltalk.send("hello", "__minus_gt", [(1)])]), "_asDictionary", []), "__eq", [smalltalk.send((smalltalk.Dictionary || Dictionary), "_with_", [smalltalk.send("hello", "__minus_gt", [(1)])])])]);
  553. return self;}
  554. }),
  555. smalltalk.DictionaryTest);
  556. smalltalk.addMethod(
  557. "_testEquality",
  558. smalltalk.method({
  559. selector: "testEquality",
  560. fn: function (){
  561. var self=this;
  562. var d1=nil;
  563. var d2=nil;
  564. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []), "__eq", [smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", [])])]);
  565. (d1=(function($rec){smalltalk.send($rec, "_at_put_", [(1), (2)]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", [])));
  566. (d2=(function($rec){smalltalk.send($rec, "_at_put_", [(1), (2)]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", [])));
  567. smalltalk.send(self, "_assert_", [smalltalk.send(d1, "__eq", [d2])]);
  568. (d2=(function($rec){smalltalk.send($rec, "_at_put_", [(1), (3)]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", [])));
  569. smalltalk.send(self, "_deny_", [smalltalk.send(d1, "__eq", [d2])]);
  570. (d2=(function($rec){smalltalk.send($rec, "_at_put_", [(2), (2)]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", [])));
  571. smalltalk.send(self, "_deny_", [smalltalk.send(d1, "__eq", [d2])]);
  572. (d2=(function($rec){smalltalk.send($rec, "_at_put_", [(1), (2)]);smalltalk.send($rec, "_at_put_", [(3), (4)]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", [])));
  573. smalltalk.send(self, "_deny_", [smalltalk.send(d1, "__eq", [d2])]);
  574. return self;}
  575. }),
  576. smalltalk.DictionaryTest);
  577. smalltalk.addMethod(
  578. "_testIfAbsent",
  579. smalltalk.method({
  580. selector: "testIfAbsent",
  581. fn: function (){
  582. var self=this;
  583. var d=nil;
  584. var visited=nil;
  585. (visited=false);
  586. (d=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
  587. smalltalk.send(d, "_at_ifAbsent_", ["hello", (function(){return (visited=true);})]);
  588. smalltalk.send(self, "_assert_", [visited]);
  589. return self;}
  590. }),
  591. smalltalk.DictionaryTest);
  592. smalltalk.addMethod(
  593. "_testIfPresent",
  594. smalltalk.method({
  595. selector: "testIfPresent",
  596. fn: function (){
  597. var self=this;
  598. var d=nil;
  599. var visited=nil;
  600. var absent=nil;
  601. (visited=false);
  602. (d=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
  603. smalltalk.send(d, "_at_put_", ["hello", "world"]);
  604. smalltalk.send(d, "_at_ifPresent_", ["hello", (function(value){return (visited=value);})]);
  605. smalltalk.send(self, "_assert_", [smalltalk.send(visited, "__eq", ["world"])]);
  606. (absent=smalltalk.send(d, "_at_ifPresent_", ["bye", (function(value){return (visited=value);})]));
  607. smalltalk.send(self, "_assert_", [smalltalk.send(absent, "_isNil", [])]);
  608. return self;}
  609. }),
  610. smalltalk.DictionaryTest);
  611. smalltalk.addMethod(
  612. "_testIfPresentIfAbsent",
  613. smalltalk.method({
  614. selector: "testIfPresentIfAbsent",
  615. fn: function (){
  616. var self=this;
  617. var d=nil;
  618. var visited=nil;
  619. (visited=false);
  620. (d=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
  621. smalltalk.send(d, "_at_put_", ["hello", "world"]);
  622. smalltalk.send(d, "_at_ifPresent_ifAbsent_", ["hello", (function(value){return (visited=value);}), (function(){return (visited=true);})]);
  623. smalltalk.send(self, "_assert_", [smalltalk.send(visited, "__eq", ["world"])]);
  624. smalltalk.send(d, "_at_ifPresent_ifAbsent_", ["buy", (function(value){return (visited=value);}), (function(){return (visited=true);})]);
  625. smalltalk.send(self, "_assert_", [visited]);
  626. return self;}
  627. }),
  628. smalltalk.DictionaryTest);
  629. smalltalk.addMethod(
  630. "_testKeys",
  631. smalltalk.method({
  632. selector: "testKeys",
  633. fn: function (){
  634. var self=this;
  635. var d=nil;
  636. (d=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
  637. smalltalk.send(d, "_at_put_", [(1), (2)]);
  638. smalltalk.send(d, "_at_put_", [(2), (3)]);
  639. smalltalk.send(d, "_at_put_", [(3), (4)]);
  640. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_keys", []), "__eq", [[(1), (2), (3)]])]);
  641. return self;}
  642. }),
  643. smalltalk.DictionaryTest);
  644. smalltalk.addMethod(
  645. "_testPrintString",
  646. smalltalk.method({
  647. selector: "testPrintString",
  648. fn: function (){
  649. var self=this;
  650. smalltalk.send(self, "_assert_equals_", ["a Dictionary('firstname'->'James' , 'lastname'->'Bond')", (function($rec){smalltalk.send($rec, "_at_put_", ["firstname", "James"]);smalltalk.send($rec, "_at_put_", ["lastname", "Bond"]);return smalltalk.send($rec, "_printString", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []))]);
  651. return self;}
  652. }),
  653. smalltalk.DictionaryTest);
  654. smalltalk.addMethod(
  655. "_testRemoveKey",
  656. smalltalk.method({
  657. selector: "testRemoveKey",
  658. fn: function (){
  659. var self=this;
  660. var d=nil;
  661. var key=nil;
  662. (d=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
  663. smalltalk.send(d, "_at_put_", [(1), (2)]);
  664. smalltalk.send(d, "_at_put_", [(2), (3)]);
  665. smalltalk.send(d, "_at_put_", [(3), (4)]);
  666. (key=(2));
  667. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_keys", []), "__eq", [[(1), (2), (3)]])]);
  668. smalltalk.send(d, "_removeKey_", [key]);
  669. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_keys", []), "__eq", [[(1), (3)]])]);
  670. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_values", []), "__eq", [[(2), (4)]])]);
  671. smalltalk.send(self, "_deny_", [smalltalk.send(d, "_includesKey_", [(2)])]);
  672. return self;}
  673. }),
  674. smalltalk.DictionaryTest);
  675. smalltalk.addMethod(
  676. "_testRemoveKeyIfAbsent",
  677. smalltalk.method({
  678. selector: "testRemoveKeyIfAbsent",
  679. fn: function (){
  680. var self=this;
  681. var d=nil;
  682. var key=nil;
  683. (d=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
  684. smalltalk.send(d, "_at_put_", [(1), (2)]);
  685. smalltalk.send(d, "_at_put_", [(2), (3)]);
  686. smalltalk.send(d, "_at_put_", [(3), (4)]);
  687. (key=(2));
  688. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_removeKey_", [key]), "__eq", [(3)])]);
  689. (key=(3));
  690. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_removeKey_ifAbsent_", [key, (function(){return (42);})]), "__eq", [(4)])]);
  691. (key="why");
  692. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_removeKey_ifAbsent_", [key, (function(){return (42);})]), "__eq", [(42)])]);
  693. return self;}
  694. }),
  695. smalltalk.DictionaryTest);
  696. smalltalk.addMethod(
  697. "_testSize",
  698. smalltalk.method({
  699. selector: "testSize",
  700. fn: function (){
  701. var self=this;
  702. var d=nil;
  703. (d=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
  704. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_size", []), "__eq", [(0)])]);
  705. smalltalk.send(d, "_at_put_", [(1), (2)]);
  706. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_size", []), "__eq", [(1)])]);
  707. smalltalk.send(d, "_at_put_", [(2), (3)]);
  708. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_size", []), "__eq", [(2)])]);
  709. return self;}
  710. }),
  711. smalltalk.DictionaryTest);
  712. smalltalk.addMethod(
  713. "_testValues",
  714. smalltalk.method({
  715. selector: "testValues",
  716. fn: function (){
  717. var self=this;
  718. var d=nil;
  719. (d=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
  720. smalltalk.send(d, "_at_put_", [(1), (2)]);
  721. smalltalk.send(d, "_at_put_", [(2), (3)]);
  722. smalltalk.send(d, "_at_put_", [(3), (4)]);
  723. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_values", []), "__eq", [[(2), (3), (4)]])]);
  724. return self;}
  725. }),
  726. smalltalk.DictionaryTest);
  727. smalltalk.addMethod(
  728. "_collectionClass",
  729. smalltalk.method({
  730. selector: "collectionClass",
  731. fn: function (){
  732. var self=this;
  733. return (smalltalk.Dictionary || Dictionary);
  734. return self;}
  735. }),
  736. smalltalk.DictionaryTest.klass);
  737. smalltalk.addClass('SequenceableCollectionTest', smalltalk.CollectionTest, [], 'Kernel-Tests');
  738. smalltalk.addMethod(
  739. "_testAt",
  740. smalltalk.method({
  741. selector: "testAt",
  742. fn: function (){
  743. var self=this;
  744. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_collection", []), "_at_", [(4)]), "__eq", [(-4)])]);
  745. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send(smalltalk.send(self, "_collection", []), "_at_", [(5)]);}), (smalltalk.Error || Error)]);
  746. return self;}
  747. }),
  748. smalltalk.SequenceableCollectionTest);
  749. smalltalk.addMethod(
  750. "_testAtIfAbsent",
  751. smalltalk.method({
  752. selector: "testAtIfAbsent",
  753. fn: function (){
  754. var self=this;
  755. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_collection", []), "_at_ifAbsent_", [((($receiver = smalltalk.send(smalltalk.send(self, "_collection", []), "_size", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])), (function(){return "none";})]), "__eq", ["none"])]);
  756. return self;}
  757. }),
  758. smalltalk.SequenceableCollectionTest);
  759. smalltalk.addClass('ArrayTest', smalltalk.SequenceableCollectionTest, [], 'Kernel-Tests');
  760. smalltalk.addMethod(
  761. "_testAtIfAbsent",
  762. smalltalk.method({
  763. selector: "testAtIfAbsent",
  764. fn: function (){
  765. var self=this;
  766. var array=nil;
  767. (array=["hello", "world"]);
  768. smalltalk.send(self, "_assert_equals_", [smalltalk.send(array, "_at_", [(1)]), "hello"]);
  769. smalltalk.send(self, "_assert_equals_", [smalltalk.send(array, "_at_", [(2)]), "world"]);
  770. smalltalk.send(self, "_assert_equals_", [smalltalk.send(array, "_at_ifAbsent_", [(2), (function(){return "not found";})]), "world"]);
  771. smalltalk.send(self, "_assert_equals_", [smalltalk.send(array, "_at_ifAbsent_", [(0), (function(){return "not found";})]), "not found"]);
  772. smalltalk.send(self, "_assert_equals_", [smalltalk.send(array, "_at_ifAbsent_", [(-10), (function(){return "not found";})]), "not found"]);
  773. smalltalk.send(self, "_assert_equals_", [smalltalk.send(array, "_at_ifAbsent_", [(3), (function(){return "not found";})]), "not found"]);
  774. return self;}
  775. }),
  776. smalltalk.ArrayTest);
  777. smalltalk.addMethod(
  778. "_testFirstN",
  779. smalltalk.method({
  780. selector: "testFirstN",
  781. fn: function (){
  782. var self=this;
  783. smalltalk.send(self, "_assert_equals_", [[(1),(2),(3)], smalltalk.send([(1),(2),(3),(4),(5)], "_first_", [(3)])]);
  784. return self;}
  785. }),
  786. smalltalk.ArrayTest);
  787. smalltalk.addMethod(
  788. "_testIfEmpty",
  789. smalltalk.method({
  790. selector: "testIfEmpty",
  791. fn: function (){
  792. var self=this;
  793. smalltalk.send(self, "_assert_equals_", ["zork", smalltalk.send("", "_ifEmpty_", [(function(){return "zork";})])]);
  794. return self;}
  795. }),
  796. smalltalk.ArrayTest);
  797. smalltalk.addMethod(
  798. "_testPrintString",
  799. smalltalk.method({
  800. selector: "testPrintString",
  801. fn: function (){
  802. var self=this;
  803. var array=nil;
  804. (array=smalltalk.send((smalltalk.Array || Array), "_new", []));
  805. smalltalk.send(self, "_assert_equals_", ["a Array ()", smalltalk.send(array, "_printString", [])]);
  806. (function($rec){smalltalk.send($rec, "_add_", [(1)]);return smalltalk.send($rec, "_add_", [(3)]);})(array);
  807. smalltalk.send(self, "_assert_equals_", ["a Array (1 3)", smalltalk.send(array, "_printString", [])]);
  808. smalltalk.send(array, "_add_", ["foo"]);
  809. smalltalk.send(self, "_assert_equals_", ["a Array (1 3 'foo')", smalltalk.send(array, "_printString", [])]);
  810. (function($rec){smalltalk.send($rec, "_remove_", [(1)]);return smalltalk.send($rec, "_remove_", [(3)]);})(array);
  811. smalltalk.send(self, "_assert_equals_", ["a Array ('foo')", smalltalk.send(array, "_printString", [])]);
  812. smalltalk.send(array, "_addLast_", [(3)]);
  813. smalltalk.send(self, "_assert_equals_", ["a Array ('foo' 3)", smalltalk.send(array, "_printString", [])]);
  814. smalltalk.send(array, "_addLast_", [(3)]);
  815. smalltalk.send(self, "_assert_equals_", ["a Array ('foo' 3 3)", smalltalk.send(array, "_printString", [])]);
  816. return self;}
  817. }),
  818. smalltalk.ArrayTest);
  819. smalltalk.addMethod(
  820. "_collectionClass",
  821. smalltalk.method({
  822. selector: "collectionClass",
  823. fn: function (){
  824. var self=this;
  825. return (smalltalk.Array || Array);
  826. return self;}
  827. }),
  828. smalltalk.ArrayTest.klass);
  829. smalltalk.addClass('StringTest', smalltalk.SequenceableCollectionTest, [], 'Kernel-Tests');
  830. smalltalk.addMethod(
  831. "_collection",
  832. smalltalk.method({
  833. selector: "collection",
  834. fn: function (){
  835. var self=this;
  836. return "hello";
  837. return self;}
  838. }),
  839. smalltalk.StringTest);
  840. smalltalk.addMethod(
  841. "_collectionWithDuplicates",
  842. smalltalk.method({
  843. selector: "collectionWithDuplicates",
  844. fn: function (){
  845. var self=this;
  846. return "abbaerte";
  847. return self;}
  848. }),
  849. smalltalk.StringTest);
  850. smalltalk.addMethod(
  851. "_testAddRemove",
  852. smalltalk.method({
  853. selector: "testAddRemove",
  854. fn: function (){
  855. var self=this;
  856. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send("hello", "_add_", ["a"]);}), (smalltalk.Error || Error)]);
  857. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send("hello", "_remove_", ["h"]);}), (smalltalk.Error || Error)]);
  858. return self;}
  859. }),
  860. smalltalk.StringTest);
  861. smalltalk.addMethod(
  862. "_testAsArray",
  863. smalltalk.method({
  864. selector: "testAsArray",
  865. fn: function (){
  866. var self=this;
  867. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send("hello", "_asArray", []), "__eq", [["h", "e", "l", "l", "o"]])]);
  868. return self;}
  869. }),
  870. smalltalk.StringTest);
  871. smalltalk.addMethod(
  872. "_testAt",
  873. smalltalk.method({
  874. selector: "testAt",
  875. fn: function (){
  876. var self=this;
  877. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send("hello", "_at_", [(1)]), "__eq", ["h"])]);
  878. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send("hello", "_at_", [(5)]), "__eq", ["o"])]);
  879. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send("hello", "_at_ifAbsent_", [(6), (function(){return nil;})]), "__eq", [nil])]);
  880. return self;}
  881. }),
  882. smalltalk.StringTest);
  883. smalltalk.addMethod(
  884. "_testAtPut",
  885. smalltalk.method({
  886. selector: "testAtPut",
  887. fn: function (){
  888. var self=this;
  889. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send("hello", "_at_put_", [(1), "a"]);}), (smalltalk.Error || Error)]);
  890. return self;}
  891. }),
  892. smalltalk.StringTest);
  893. smalltalk.addMethod(
  894. "_testCollect",
  895. smalltalk.method({
  896. selector: "testCollect",
  897. fn: function (){
  898. var self=this;
  899. var newCollection=nil;
  900. (newCollection="hheelllloo");
  901. smalltalk.send(self, "_assertSameContents_as_", [smalltalk.send(smalltalk.send(self, "_collection", []), "_collect_", [(function(each){return smalltalk.send(each, "__comma", [each]);})]), newCollection]);
  902. return self;}
  903. }),
  904. smalltalk.StringTest);
  905. smalltalk.addMethod(
  906. "_testCopyWithoutAll",
  907. smalltalk.method({
  908. selector: "testCopyWithoutAll",
  909. fn: function (){
  910. var self=this;
  911. smalltalk.send(self, "_assert_equals_", ["hello world", smalltalk.send("*hello* *world*", "_copyWithoutAll_", ["*"])]);
  912. return self;}
  913. }),
  914. smalltalk.StringTest);
  915. smalltalk.addMethod(
  916. "_testDetect",
  917. smalltalk.method({
  918. selector: "testDetect",
  919. fn: function (){
  920. var self=this;
  921. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_collection", []), "_detect_", [(function(each){return smalltalk.send(each, "__eq", ["h"]);})]), "__eq", ["h"])]);
  922. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send(smalltalk.send(self, "_collection", []), "_detect_", [(function(each){return smalltalk.send(each, "__eq", [(6)]);})]);}), (smalltalk.Error || Error)]);
  923. return self;}
  924. }),
  925. smalltalk.StringTest);
  926. smalltalk.addMethod(
  927. "_testEquality",
  928. smalltalk.method({
  929. selector: "testEquality",
  930. fn: function (){
  931. var self=this;
  932. smalltalk.send(self, "_assert_", [smalltalk.send("hello", "__eq", ["hello"])]);
  933. smalltalk.send(self, "_deny_", [smalltalk.send("hello", "__eq", ["world"])]);
  934. smalltalk.send(self, "_assert_", [smalltalk.send("hello", "__eq", [smalltalk.send("hello", "_yourself", [])])]);
  935. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send("hello", "_yourself", []), "__eq", ["hello"])]);
  936. smalltalk.send(self, "_deny_", [smalltalk.send("", "__eq", [(0)])]);
  937. return self;}
  938. }),
  939. smalltalk.StringTest);
  940. smalltalk.addMethod(
  941. "_testIdentity",
  942. smalltalk.method({
  943. selector: "testIdentity",
  944. fn: function (){
  945. var self=this;
  946. smalltalk.send(self, "_assert_", [smalltalk.send("hello", "__eq_eq", ["hello"])]);
  947. smalltalk.send(self, "_deny_", [smalltalk.send("hello", "__eq_eq", ["world"])]);
  948. smalltalk.send(self, "_assert_", [smalltalk.send("hello", "__eq_eq", [smalltalk.send("hello", "_yourself", [])])]);
  949. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send("hello", "_yourself", []), "__eq_eq", ["hello"])]);
  950. smalltalk.send(self, "_deny_", [smalltalk.send("", "__eq_eq", [(0)])]);
  951. return self;}
  952. }),
  953. smalltalk.StringTest);
  954. smalltalk.addMethod(
  955. "_testIncludesSubString",
  956. smalltalk.method({
  957. selector: "testIncludesSubString",
  958. fn: function (){
  959. var self=this;
  960. smalltalk.send(self, "_assert_", [smalltalk.send("amber", "_includesSubString_", ["ber"])]);
  961. smalltalk.send(self, "_deny_", [smalltalk.send("amber", "_includesSubString_", ["zork"])]);
  962. return self;}
  963. }),
  964. smalltalk.StringTest);
  965. smalltalk.addMethod(
  966. "_testJoin",
  967. smalltalk.method({
  968. selector: "testJoin",
  969. fn: function (){
  970. var self=this;
  971. smalltalk.send(self, "_assert_equals_", ["hello,world", smalltalk.send(",", "_join_", [["hello", "world"]])]);
  972. return self;}
  973. }),
  974. smalltalk.StringTest);
  975. smalltalk.addMethod(
  976. "_testSelect",
  977. smalltalk.method({
  978. selector: "testSelect",
  979. fn: function (){
  980. var self=this;
  981. var newCollection=nil;
  982. (newCollection="o");
  983. smalltalk.send(self, "_assertSameContents_as_", [smalltalk.send(smalltalk.send(self, "_collection", []), "_select_", [(function(each){return smalltalk.send(each, "__eq", ["o"]);})]), newCollection]);
  984. return self;}
  985. }),
  986. smalltalk.StringTest);
  987. smalltalk.addMethod(
  988. "_testSize",
  989. smalltalk.method({
  990. selector: "testSize",
  991. fn: function (){
  992. var self=this;
  993. smalltalk.send(self, "_assert_equals_", [smalltalk.send("smalltalk", "_size", []), (9)]);
  994. smalltalk.send(self, "_assert_equals_", [smalltalk.send("", "_size", []), (0)]);
  995. return self;}
  996. }),
  997. smalltalk.StringTest);
  998. smalltalk.addMethod(
  999. "_testStreamContents",
  1000. smalltalk.method({
  1001. selector: "testStreamContents",
  1002. fn: function (){
  1003. var self=this;
  1004. smalltalk.send(self, "_assert_equals_", ["hello world", smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(aStream){return (function($rec){smalltalk.send($rec, "_nextPutAll_", ["hello"]);smalltalk.send($rec, "_space", []);return smalltalk.send($rec, "_nextPutAll_", ["world"]);})(aStream);})])]);
  1005. return self;}
  1006. }),
  1007. smalltalk.StringTest);
  1008. smalltalk.addMethod(
  1009. "_collectionClass",
  1010. smalltalk.method({
  1011. selector: "collectionClass",
  1012. fn: function (){
  1013. var self=this;
  1014. return (smalltalk.String || String);
  1015. return self;}
  1016. }),
  1017. smalltalk.StringTest.klass);
  1018. smalltalk.addClass('SymbolTest', smalltalk.SequenceableCollectionTest, [], 'Kernel-Tests');
  1019. smalltalk.addMethod(
  1020. "_collection",
  1021. smalltalk.method({
  1022. selector: "collection",
  1023. fn: function (){
  1024. var self=this;
  1025. return smalltalk.symbolFor("hello");
  1026. return self;}
  1027. }),
  1028. smalltalk.SymbolTest);
  1029. smalltalk.addMethod(
  1030. "_collectionWithDuplicates",
  1031. smalltalk.method({
  1032. selector: "collectionWithDuplicates",
  1033. fn: function (){
  1034. var self=this;
  1035. return smalltalk.symbolFor("phhaaarorra");
  1036. return self;}
  1037. }),
  1038. smalltalk.SymbolTest);
  1039. smalltalk.addMethod(
  1040. "_testAsString",
  1041. smalltalk.method({
  1042. selector: "testAsString",
  1043. fn: function (){
  1044. var self=this;
  1045. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.symbolFor("hello"), "_asString", []), "hello"]);
  1046. return self;}
  1047. }),
  1048. smalltalk.SymbolTest);
  1049. smalltalk.addMethod(
  1050. "_testAsSymbol",
  1051. smalltalk.method({
  1052. selector: "testAsSymbol",
  1053. fn: function (){
  1054. var self=this;
  1055. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq_eq", [smalltalk.send(smalltalk.symbolFor("hello"), "_asSymbol", [])])]);
  1056. return self;}
  1057. }),
  1058. smalltalk.SymbolTest);
  1059. smalltalk.addMethod(
  1060. "_testAt",
  1061. smalltalk.method({
  1062. selector: "testAt",
  1063. fn: function (){
  1064. var self=this;
  1065. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_at_", [(1)]), "__eq", ["h"])]);
  1066. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_at_", [(5)]), "__eq", ["o"])]);
  1067. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_at_ifAbsent_", [(6), (function(){return nil;})]), "__eq", [nil])]);
  1068. return self;}
  1069. }),
  1070. smalltalk.SymbolTest);
  1071. smalltalk.addMethod(
  1072. "_testAtPut",
  1073. smalltalk.method({
  1074. selector: "testAtPut",
  1075. fn: function (){
  1076. var self=this;
  1077. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send("hello", "_at_put_", [(1), "a"]);}), (smalltalk.Error || Error)]);
  1078. return self;}
  1079. }),
  1080. smalltalk.SymbolTest);
  1081. smalltalk.addMethod(
  1082. "_testCollect",
  1083. smalltalk.method({
  1084. selector: "testCollect",
  1085. fn: function (){
  1086. var self=this;
  1087. var newCollection=nil;
  1088. (newCollection=smalltalk.symbolFor("hheelllloo"));
  1089. smalltalk.send(self, "_assertSameContents_as_", [smalltalk.send(smalltalk.send(self, "_collection", []), "_collect_", [(function(each){return smalltalk.send(each, "__comma", [each]);})]), newCollection]);
  1090. return self;}
  1091. }),
  1092. smalltalk.SymbolTest);
  1093. smalltalk.addMethod(
  1094. "_testComparing",
  1095. smalltalk.method({
  1096. selector: "testComparing",
  1097. fn: function (){
  1098. var self=this;
  1099. smalltalk.send(self, "_assert_", [((($receiver = smalltalk.symbolFor("ab")).klass === smalltalk.Number) ? $receiver >smalltalk.symbolFor("aa") : smalltalk.send($receiver, "__gt", [smalltalk.symbolFor("aa")]))]);
  1100. smalltalk.send(self, "_deny_", [((($receiver = smalltalk.symbolFor("ab")).klass === smalltalk.Number) ? $receiver >smalltalk.symbolFor("ba") : smalltalk.send($receiver, "__gt", [smalltalk.symbolFor("ba")]))]);
  1101. smalltalk.send(self, "_assert_", [((($receiver = smalltalk.symbolFor("ab")).klass === smalltalk.Number) ? $receiver <smalltalk.symbolFor("ba") : smalltalk.send($receiver, "__lt", [smalltalk.symbolFor("ba")]))]);
  1102. smalltalk.send(self, "_deny_", [((($receiver = smalltalk.symbolFor("bb")).klass === smalltalk.Number) ? $receiver <smalltalk.symbolFor("ba") : smalltalk.send($receiver, "__lt", [smalltalk.symbolFor("ba")]))]);
  1103. smalltalk.send(self, "_assert_", [((($receiver = smalltalk.symbolFor("ab")).klass === smalltalk.Number) ? $receiver >=smalltalk.symbolFor("aa") : smalltalk.send($receiver, "__gt_eq", [smalltalk.symbolFor("aa")]))]);
  1104. smalltalk.send(self, "_deny_", [((($receiver = smalltalk.symbolFor("ab")).klass === smalltalk.Number) ? $receiver >=smalltalk.symbolFor("ba") : smalltalk.send($receiver, "__gt_eq", [smalltalk.symbolFor("ba")]))]);
  1105. smalltalk.send(self, "_assert_", [((($receiver = smalltalk.symbolFor("ab")).klass === smalltalk.Number) ? $receiver <=smalltalk.symbolFor("ba") : smalltalk.send($receiver, "__lt_eq", [smalltalk.symbolFor("ba")]))]);
  1106. smalltalk.send(self, "_deny_", [((($receiver = smalltalk.symbolFor("bb")).klass === smalltalk.Number) ? $receiver <=smalltalk.symbolFor("ba") : smalltalk.send($receiver, "__lt_eq", [smalltalk.symbolFor("ba")]))]);
  1107. return self;}
  1108. }),
  1109. smalltalk.SymbolTest);
  1110. smalltalk.addMethod(
  1111. "_testCopying",
  1112. smalltalk.method({
  1113. selector: "testCopying",
  1114. fn: function (){
  1115. var self=this;
  1116. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_copy", []), "__eq_eq", [smalltalk.symbolFor("hello")])]);
  1117. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_deepCopy", []), "__eq_eq", [smalltalk.symbolFor("hello")])]);
  1118. return self;}
  1119. }),
  1120. smalltalk.SymbolTest);
  1121. smalltalk.addMethod(
  1122. "_testDetect",
  1123. smalltalk.method({
  1124. selector: "testDetect",
  1125. fn: function (){
  1126. var self=this;
  1127. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_collection", []), "_detect_", [(function(each){return smalltalk.send(each, "__eq", ["h"]);})]), "__eq", ["h"])]);
  1128. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send(smalltalk.send(self, "_collection", []), "_detect_", [(function(each){return smalltalk.send(each, "__eq", ["z"]);})]);}), (smalltalk.Error || Error)]);
  1129. return self;}
  1130. }),
  1131. smalltalk.SymbolTest);
  1132. smalltalk.addMethod(
  1133. "_testEquality",
  1134. smalltalk.method({
  1135. selector: "testEquality",
  1136. fn: function (){
  1137. var self=this;
  1138. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq", [smalltalk.symbolFor("hello")])]);
  1139. smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq", [smalltalk.symbolFor("world")])]);
  1140. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq", [smalltalk.send(smalltalk.symbolFor("hello"), "_yourself", [])])]);
  1141. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_yourself", []), "__eq", [smalltalk.symbolFor("hello")])]);
  1142. smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq", ["hello"])]);
  1143. smalltalk.send(self, "_deny_", [smalltalk.send("hello", "__eq", [smalltalk.symbolFor("hello")])]);
  1144. return self;}
  1145. }),
  1146. smalltalk.SymbolTest);
  1147. smalltalk.addMethod(
  1148. "_testIdentity",
  1149. smalltalk.method({
  1150. selector: "testIdentity",
  1151. fn: function (){
  1152. var self=this;
  1153. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq_eq", [smalltalk.symbolFor("hello")])]);
  1154. smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq_eq", [smalltalk.symbolFor("world")])]);
  1155. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq", [smalltalk.send(smalltalk.symbolFor("hello"), "_yourself", [])])]);
  1156. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_yourself", []), "__eq", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_asString", []), "_asSymbol", [])])]);
  1157. return self;}
  1158. }),
  1159. smalltalk.SymbolTest);
  1160. smalltalk.addMethod(
  1161. "_testIsEmpty",
  1162. smalltalk.method({
  1163. selector: "testIsEmpty",
  1164. fn: function (){
  1165. var self=this;
  1166. smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send(self, "_collection", []), "_isEmpty", [])]);
  1167. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send("", "_asSymbol", []), "_isEmpty", [])]);
  1168. return self;}
  1169. }),
  1170. smalltalk.SymbolTest);
  1171. smalltalk.addMethod(
  1172. "_testIsSymbolIsString",
  1173. smalltalk.method({
  1174. selector: "testIsSymbolIsString",
  1175. fn: function (){
  1176. var self=this;
  1177. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.symbolFor("hello"), "_isSymbol", [])]);
  1178. smalltalk.send(self, "_deny_", [smalltalk.send("hello", "_isSymbol", [])]);
  1179. smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.symbolFor("hello"), "_isString", [])]);
  1180. smalltalk.send(self, "_assert_", [smalltalk.send("hello", "_isString", [])]);
  1181. return self;}
  1182. }),
  1183. smalltalk.SymbolTest);
  1184. smalltalk.addMethod(
  1185. "_testSelect",
  1186. smalltalk.method({
  1187. selector: "testSelect",
  1188. fn: function (){
  1189. var self=this;
  1190. var newCollection=nil;
  1191. (newCollection="o");
  1192. smalltalk.send(self, "_assertSameContents_as_", [smalltalk.send(smalltalk.send(self, "_collection", []), "_select_", [(function(each){return smalltalk.send(each, "__eq", ["o"]);})]), newCollection]);
  1193. return self;}
  1194. }),
  1195. smalltalk.SymbolTest);
  1196. smalltalk.addMethod(
  1197. "_testSize",
  1198. smalltalk.method({
  1199. selector: "testSize",
  1200. fn: function (){
  1201. var self=this;
  1202. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.symbolFor("a"), "_size", []), (1)]);
  1203. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.symbolFor("aaaaa"), "_size", []), (5)]);
  1204. return self;}
  1205. }),
  1206. smalltalk.SymbolTest);
  1207. smalltalk.addMethod(
  1208. "_collectionClass",
  1209. smalltalk.method({
  1210. selector: "collectionClass",
  1211. fn: function (){
  1212. var self=this;
  1213. return (smalltalk.Symbol || Symbol);
  1214. return self;}
  1215. }),
  1216. smalltalk.SymbolTest.klass);
  1217. smalltalk.addClass('JSObjectProxyTest', smalltalk.TestCase, [], 'Kernel-Tests');
  1218. smalltalk.addMethod(
  1219. "_jsObject",
  1220. smalltalk.method({
  1221. selector: "jsObject",
  1222. fn: function (){
  1223. var self=this;
  1224. return jsObject = {a: 1, b: function() {return 2;}, c: function(object) {return object;}, d: '', 'e': null};
  1225. return self;}
  1226. }),
  1227. smalltalk.JSObjectProxyTest);
  1228. smalltalk.addMethod(
  1229. "_testDNU",
  1230. smalltalk.method({
  1231. selector: "testDNU",
  1232. fn: function (){
  1233. var self=this;
  1234. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send(smalltalk.send(self, "_jsObject", []), "_foo", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  1235. return self;}
  1236. }),
  1237. smalltalk.JSObjectProxyTest);
  1238. smalltalk.addMethod(
  1239. "_testMessageSend",
  1240. smalltalk.method({
  1241. selector: "testMessageSend",
  1242. fn: function (){
  1243. var self=this;
  1244. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send(self, "_jsObject", []), "_a", []), (1)]);
  1245. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send(self, "_jsObject", []), "_b", []), (2)]);
  1246. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send(self, "_jsObject", []), "_c_", [(3)]), (3)]);
  1247. return self;}
  1248. }),
  1249. smalltalk.JSObjectProxyTest);
  1250. smalltalk.addMethod(
  1251. "_testMethodWithArguments",
  1252. smalltalk.method({
  1253. selector: "testMethodWithArguments",
  1254. fn: function (){
  1255. var self=this;
  1256. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send(self, "_jsObject", []), "_c_", [(1)]), (1)]);
  1257. return self;}
  1258. }),
  1259. smalltalk.JSObjectProxyTest);
  1260. smalltalk.addMethod(
  1261. "_testPrinting",
  1262. smalltalk.method({
  1263. selector: "testPrinting",
  1264. fn: function (){
  1265. var self=this;
  1266. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_jsObject", []), "_printString", []), "__eq", ["[object Object]"])]);
  1267. return self;}
  1268. }),
  1269. smalltalk.JSObjectProxyTest);
  1270. smalltalk.addMethod(
  1271. "_testPropertyThatReturnsEmptyString",
  1272. smalltalk.method({
  1273. selector: "testPropertyThatReturnsEmptyString",
  1274. fn: function (){
  1275. var self=this;
  1276. var object=nil;
  1277. (object=smalltalk.send(self, "_jsObject", []));
  1278. smalltalk.send(self, "_assert_equals_", ["", smalltalk.send(object, "_d", [])]);
  1279. smalltalk.send(object, "_d_", ["hello"]);
  1280. smalltalk.send(self, "_assert_equals_", ["hello", smalltalk.send(object, "_d", [])]);
  1281. return self;}
  1282. }),
  1283. smalltalk.JSObjectProxyTest);
  1284. smalltalk.addMethod(
  1285. "_testPropertyThatReturnsUndefined",
  1286. smalltalk.method({
  1287. selector: "testPropertyThatReturnsUndefined",
  1288. fn: function (){
  1289. var self=this;
  1290. var object=nil;
  1291. (object=smalltalk.send(self, "_jsObject", []));
  1292. smalltalk.send(self, "_shouldnt_raise_", [(function(){return smalltalk.send(object, "_e", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  1293. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(object, "_e", []), "_isNil", [])]);
  1294. return self;}
  1295. }),
  1296. smalltalk.JSObjectProxyTest);
  1297. smalltalk.addMethod(
  1298. "_testYourself",
  1299. smalltalk.method({
  1300. selector: "testYourself",
  1301. fn: function (){
  1302. var self=this;
  1303. var object=nil;
  1304. (object=(function($rec){smalltalk.send($rec, "_d_", ["test"]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_jsObject", [])));
  1305. smalltalk.send(self, "_assert_equals_", [smalltalk.send(object, "_d", []), "test"]);
  1306. return self;}
  1307. }),
  1308. smalltalk.JSObjectProxyTest);
  1309. smalltalk.addClass('NumberTest', smalltalk.TestCase, [], 'Kernel-Tests');
  1310. smalltalk.addMethod(
  1311. "_testAbs",
  1312. smalltalk.method({
  1313. selector: "testAbs",
  1314. fn: function (){
  1315. var self=this;
  1316. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((4), "_abs", []), "__eq", [(4)])]);
  1317. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((-4), "_abs", []), "__eq", [(4)])]);
  1318. return self;}
  1319. }),
  1320. smalltalk.NumberTest);
  1321. smalltalk.addMethod(
  1322. "_testArithmetic",
  1323. smalltalk.method({
  1324. selector: "testArithmetic",
  1325. fn: function (){
  1326. var self=this;
  1327. smalltalk.send(self, "_assert_", [smalltalk.send((1.5) + (1), "__eq", [(2.5)])]);
  1328. smalltalk.send(self, "_assert_", [smalltalk.send((2) - (1), "__eq", [(1)])]);
  1329. smalltalk.send(self, "_assert_", [smalltalk.send((-2) - (1), "__eq", [(-3)])]);
  1330. smalltalk.send(self, "_assert_", [smalltalk.send((12) / (2), "__eq", [(6)])]);
  1331. smalltalk.send(self, "_assert_", [smalltalk.send((3) * (4), "__eq", [(12)])]);
  1332. smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = (1) + (2)).klass === smalltalk.Number) ? $receiver *(3) : smalltalk.send($receiver, "__star", [(3)])), "__eq", [(9)])]);
  1333. smalltalk.send(self, "_assert_", [smalltalk.send((1) + (2) * (3), "__eq", [(7)])]);
  1334. return self;}
  1335. }),
  1336. smalltalk.NumberTest);
  1337. smalltalk.addMethod(
  1338. "_testComparison",
  1339. smalltalk.method({
  1340. selector: "testComparison",
  1341. fn: function (){
  1342. var self=this;
  1343. smalltalk.send(self, "_assert_", [(3) > (2)]);
  1344. smalltalk.send(self, "_assert_", [(2) < (3)]);
  1345. smalltalk.send(self, "_deny_", [(3) < (2)]);
  1346. smalltalk.send(self, "_deny_", [(2) > (3)]);
  1347. smalltalk.send(self, "_assert_", [(3) >= (3)]);
  1348. smalltalk.send(self, "_assert_", [(3.1) >= (3)]);
  1349. smalltalk.send(self, "_assert_", [(3) <= (3)]);
  1350. smalltalk.send(self, "_assert_", [(3) <= (3.1)]);
  1351. return self;}
  1352. }),
  1353. smalltalk.NumberTest);
  1354. smalltalk.addMethod(
  1355. "_testCopying",
  1356. smalltalk.method({
  1357. selector: "testCopying",
  1358. fn: function (){
  1359. var self=this;
  1360. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((1), "_copy", []), "__eq_eq", [(1)])]);
  1361. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((1), "_deepCopy", []), "__eq_eq", [(1)])]);
  1362. return self;}
  1363. }),
  1364. smalltalk.NumberTest);
  1365. smalltalk.addMethod(
  1366. "_testEquality",
  1367. smalltalk.method({
  1368. selector: "testEquality",
  1369. fn: function (){
  1370. var self=this;
  1371. smalltalk.send(self, "_assert_", [smalltalk.send((1), "__eq", [(1)])]);
  1372. smalltalk.send(self, "_assert_", [smalltalk.send((0), "__eq", [(0)])]);
  1373. smalltalk.send(self, "_deny_", [smalltalk.send((1), "__eq", [(0)])]);
  1374. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((1), "_yourself", []), "__eq", [(1)])]);
  1375. smalltalk.send(self, "_assert_", [smalltalk.send((1), "__eq", [smalltalk.send((1), "_yourself", [])])]);
  1376. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((1), "_yourself", []), "__eq", [smalltalk.send((1), "_yourself", [])])]);
  1377. smalltalk.send(self, "_deny_", [smalltalk.send((0), "__eq", [false])]);
  1378. smalltalk.send(self, "_deny_", [smalltalk.send(false, "__eq", [(0)])]);
  1379. smalltalk.send(self, "_deny_", [smalltalk.send("", "__eq", [(0)])]);
  1380. smalltalk.send(self, "_deny_", [smalltalk.send((0), "__eq", [""])]);
  1381. return self;}
  1382. }),
  1383. smalltalk.NumberTest);
  1384. smalltalk.addMethod(
  1385. "_testHexNumbers",
  1386. smalltalk.method({
  1387. selector: "testHexNumbers",
  1388. fn: function (){
  1389. var self=this;
  1390. smalltalk.send(self, "_assert_", [smalltalk.send((9), "__eq", [(9)])]);
  1391. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((10), "_truncated", []), "__eq", [(10)])]);
  1392. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((11), "_truncated", []), "__eq", [(11)])]);
  1393. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((12), "_truncated", []), "__eq", [(12)])]);
  1394. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((13), "_truncated", []), "__eq", [(13)])]);
  1395. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((14), "_truncated", []), "__eq", [(14)])]);
  1396. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((15), "_truncated", []), "__eq", [(15)])]);
  1397. return self;}
  1398. }),
  1399. smalltalk.NumberTest);
  1400. smalltalk.addMethod(
  1401. "_testIdentity",
  1402. smalltalk.method({
  1403. selector: "testIdentity",
  1404. fn: function (){
  1405. var self=this;
  1406. smalltalk.send(self, "_assert_", [smalltalk.send((1), "__eq_eq", [(1)])]);
  1407. smalltalk.send(self, "_assert_", [smalltalk.send((0), "__eq_eq", [(0)])]);
  1408. smalltalk.send(self, "_deny_", [smalltalk.send((1), "__eq_eq", [(0)])]);
  1409. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((1), "_yourself", []), "__eq_eq", [(1)])]);
  1410. smalltalk.send(self, "_assert_", [smalltalk.send((1), "__eq_eq", [smalltalk.send((1), "_yourself", [])])]);
  1411. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((1), "_yourself", []), "__eq_eq", [smalltalk.send((1), "_yourself", [])])]);
  1412. smalltalk.send(self, "_deny_", [smalltalk.send((1), "__eq_eq", [(2)])]);
  1413. return self;}
  1414. }),
  1415. smalltalk.NumberTest);
  1416. smalltalk.addMethod(
  1417. "_testInvalidHexNumbers",
  1418. smalltalk.method({
  1419. selector: "testInvalidHexNumbers",
  1420. fn: function (){
  1421. var self=this;
  1422. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send((16), "_rG", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  1423. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send((16), "_rg", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  1424. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send((16), "_rH", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  1425. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send((16), "_rh", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  1426. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send((16), "_rI", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  1427. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send((16), "_ri", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  1428. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send((16), "_rJ", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  1429. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send((16), "_rj", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  1430. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send((16), "_rK", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  1431. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send((16), "_rk", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  1432. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send((16), "_rL", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  1433. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send((16), "_rl", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  1434. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send((16), "_rM", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  1435. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send((16), "_rm", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  1436. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send((16), "_rN", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  1437. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send((16), "_rn", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  1438. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send((16), "_rO", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  1439. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send((16), "_ro", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  1440. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send((16), "_rP", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  1441. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send((16), "_rp", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  1442. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send((16), "_rQ", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  1443. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send((16), "_rq", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  1444. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send((16), "_rR", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  1445. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send((16), "_rr", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  1446. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send((16), "_rS", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  1447. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send((16), "_rs", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  1448. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send((16), "_rT", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  1449. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send((16), "_rt", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  1450. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send((16), "_rU", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  1451. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send((16), "_ru", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  1452. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send((16), "_rV", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  1453. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send((16), "_rv", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  1454. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send((16), "_rW", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  1455. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send((16), "_rw", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  1456. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send((16), "_rX", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  1457. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send((16), "_rx", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  1458. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send((16), "_rY", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  1459. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send((16), "_ry", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  1460. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send((16), "_rZ", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  1461. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send((16), "_rz", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  1462. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send((11259375), "_Z", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  1463. return self;}
  1464. }),
  1465. smalltalk.NumberTest);
  1466. smalltalk.addMethod(
  1467. "_testMinMax",
  1468. smalltalk.method({
  1469. selector: "testMinMax",
  1470. fn: function (){
  1471. var self=this;
  1472. smalltalk.send(self, "_assert_equals_", [smalltalk.send((2), "_max_", [(5)]), (5)]);
  1473. smalltalk.send(self, "_assert_equals_", [smalltalk.send((2), "_min_", [(5)]), (2)]);
  1474. return self;}
  1475. }),
  1476. smalltalk.NumberTest);
  1477. smalltalk.addMethod(
  1478. "_testNegated",
  1479. smalltalk.method({
  1480. selector: "testNegated",
  1481. fn: function (){
  1482. var self=this;
  1483. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3), "_negated", []), "__eq", [(-3)])]);
  1484. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((-3), "_negated", []), "__eq", [(3)])]);
  1485. return self;}
  1486. }),
  1487. smalltalk.NumberTest);
  1488. smalltalk.addMethod(
  1489. "_testPrintShowingDecimalPlaces",
  1490. smalltalk.method({
  1491. selector: "testPrintShowingDecimalPlaces",
  1492. fn: function (){
  1493. var self=this;
  1494. smalltalk.send(self, "_assert_equals_", ["23.00", smalltalk.send((23), "_printShowingDecimalPlaces_", [(2)])]);
  1495. smalltalk.send(self, "_assert_equals_", ["23.57", smalltalk.send((23.5698), "_printShowingDecimalPlaces_", [(2)])]);
  1496. smalltalk.send(self, "_assert_equals_", ["-234.56700", smalltalk.send(smalltalk.send((234.567), "_negated", []), "_printShowingDecimalPlaces_", [(5)])]);
  1497. smalltalk.send(self, "_assert_equals_", ["23", smalltalk.send((23.4567), "_printShowingDecimalPlaces_", [(0)])]);
  1498. smalltalk.send(self, "_assert_equals_", ["24", smalltalk.send((23.5567), "_printShowingDecimalPlaces_", [(0)])]);
  1499. smalltalk.send(self, "_assert_equals_", ["-23", smalltalk.send(smalltalk.send((23.4567), "_negated", []), "_printShowingDecimalPlaces_", [(0)])]);
  1500. smalltalk.send(self, "_assert_equals_", ["-24", smalltalk.send(smalltalk.send((23.5567), "_negated", []), "_printShowingDecimalPlaces_", [(0)])]);
  1501. smalltalk.send(self, "_assert_equals_", ["100000000.0", smalltalk.send((100000000), "_printShowingDecimalPlaces_", [(1)])]);
  1502. smalltalk.send(self, "_assert_equals_", ["0.98000", smalltalk.send((0.98), "_printShowingDecimalPlaces_", [(5)])]);
  1503. smalltalk.send(self, "_assert_equals_", ["-0.98", smalltalk.send(smalltalk.send((0.98), "_negated", []), "_printShowingDecimalPlaces_", [(2)])]);
  1504. smalltalk.send(self, "_assert_equals_", ["2.57", smalltalk.send((2.567), "_printShowingDecimalPlaces_", [(2)])]);
  1505. smalltalk.send(self, "_assert_equals_", ["-2.57", smalltalk.send((-2.567), "_printShowingDecimalPlaces_", [(2)])]);
  1506. smalltalk.send(self, "_assert_equals_", ["0.00", smalltalk.send((0), "_printShowingDecimalPlaces_", [(2)])]);
  1507. return self;}
  1508. }),
  1509. smalltalk.NumberTest);
  1510. smalltalk.addMethod(
  1511. "_testRounded",
  1512. smalltalk.method({
  1513. selector: "testRounded",
  1514. fn: function (){
  1515. var self=this;
  1516. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3), "_rounded", []), "__eq", [(3)])]);
  1517. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3.212), "_rounded", []), "__eq", [(3)])]);
  1518. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3.51), "_rounded", []), "__eq", [(4)])]);
  1519. return self;}
  1520. }),
  1521. smalltalk.NumberTest);
  1522. smalltalk.addMethod(
  1523. "_testSqrt",
  1524. smalltalk.method({
  1525. selector: "testSqrt",
  1526. fn: function (){
  1527. var self=this;
  1528. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((4), "_sqrt", []), "__eq", [(2)])]);
  1529. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((16), "_sqrt", []), "__eq", [(4)])]);
  1530. return self;}
  1531. }),
  1532. smalltalk.NumberTest);
  1533. smalltalk.addMethod(
  1534. "_testSquared",
  1535. smalltalk.method({
  1536. selector: "testSquared",
  1537. fn: function (){
  1538. var self=this;
  1539. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((4), "_squared", []), "__eq", [(16)])]);
  1540. return self;}
  1541. }),
  1542. smalltalk.NumberTest);
  1543. smalltalk.addMethod(
  1544. "_testTimesRepeat",
  1545. smalltalk.method({
  1546. selector: "testTimesRepeat",
  1547. fn: function (){
  1548. var self=this;
  1549. var i=nil;
  1550. (i=(0));
  1551. smalltalk.send((0), "_timesRepeat_", [(function(){return (i=((($receiver = i).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));})]);
  1552. smalltalk.send(self, "_assert_equals_", [i, (0)]);
  1553. smalltalk.send((5), "_timesRepeat_", [(function(){return (i=((($receiver = i).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));})]);
  1554. smalltalk.send(self, "_assert_equals_", [i, (5)]);
  1555. return self;}
  1556. }),
  1557. smalltalk.NumberTest);
  1558. smalltalk.addMethod(
  1559. "_testTo",
  1560. smalltalk.method({
  1561. selector: "testTo",
  1562. fn: function (){
  1563. var self=this;
  1564. smalltalk.send(self, "_assert_equals_", [smalltalk.send((1), "_to_", [(5)]), [(1), (2), (3), (4), (5)]]);
  1565. return self;}
  1566. }),
  1567. smalltalk.NumberTest);
  1568. smalltalk.addMethod(
  1569. "_testToBy",
  1570. smalltalk.method({
  1571. selector: "testToBy",
  1572. fn: function (){
  1573. var self=this;
  1574. smalltalk.send(self, "_assert_equals_", [smalltalk.send((0), "_to_by_", [(6), (2)]), [(0), (2), (4), (6)]]);
  1575. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send((1), "_to_by_", [(4), (0)]);}), (smalltalk.Error || Error)]);
  1576. return self;}
  1577. }),
  1578. smalltalk.NumberTest);
  1579. smalltalk.addMethod(
  1580. "_testTruncated",
  1581. smalltalk.method({
  1582. selector: "testTruncated",
  1583. fn: function (){
  1584. var self=this;
  1585. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3), "_truncated", []), "__eq", [(3)])]);
  1586. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3.212), "_truncated", []), "__eq", [(3)])]);
  1587. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3.51), "_truncated", []), "__eq", [(3)])]);
  1588. return self;}
  1589. }),
  1590. smalltalk.NumberTest);
  1591. smalltalk.addClass('ObjectMock', smalltalk.Object, ['foo', 'bar'], 'Kernel-Tests');
  1592. smalltalk.addMethod(
  1593. "_foo",
  1594. smalltalk.method({
  1595. selector: "foo",
  1596. fn: function (){
  1597. var self=this;
  1598. return self['@foo'];
  1599. return self;}
  1600. }),
  1601. smalltalk.ObjectMock);
  1602. smalltalk.addMethod(
  1603. "_foo_",
  1604. smalltalk.method({
  1605. selector: "foo:",
  1606. fn: function (anObject){
  1607. var self=this;
  1608. (self['@foo']=anObject);
  1609. return self;}
  1610. }),
  1611. smalltalk.ObjectMock);
  1612. smalltalk.addClass('ObjectTest', smalltalk.TestCase, [], 'Kernel-Tests');
  1613. smalltalk.addMethod(
  1614. "_testBasicAccess",
  1615. smalltalk.method({
  1616. selector: "testBasicAccess",
  1617. fn: function (){
  1618. var self=this;
  1619. var o=nil;
  1620. (o=smalltalk.send((smalltalk.Object || Object), "_new", []));
  1621. smalltalk.send(o, "_basicAt_put_", ["a", (1)]);
  1622. smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_basicAt_", ["a"]), (1)]);
  1623. smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_basicAt_", ["b"]), nil]);
  1624. return self;}
  1625. }),
  1626. smalltalk.ObjectTest);
  1627. smalltalk.addMethod(
  1628. "_testBasicPerform",
  1629. smalltalk.method({
  1630. selector: "testBasicPerform",
  1631. fn: function (){
  1632. var self=this;
  1633. var o=nil;
  1634. (o=smalltalk.send((smalltalk.Object || Object), "_new", []));
  1635. smalltalk.send(o, "_basicAt_put_", ["func", (function(){return "hello";})]);
  1636. smalltalk.send(o, "_basicAt_put_", ["func2", (function(a){return ((($receiver = a).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));})]);
  1637. smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_basicPerform_", ["func"]), "hello"]);
  1638. smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_basicPerform_withArguments_", ["func2", [(3)]]), (4)]);
  1639. return self;}
  1640. }),
  1641. smalltalk.ObjectTest);
  1642. smalltalk.addMethod(
  1643. "_testDNU",
  1644. smalltalk.method({
  1645. selector: "testDNU",
  1646. fn: function (){
  1647. var self=this;
  1648. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send(smalltalk.send((smalltalk.Object || Object), "_new", []), "_foo", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  1649. return self;}
  1650. }),
  1651. smalltalk.ObjectTest);
  1652. smalltalk.addMethod(
  1653. "_testEquality",
  1654. smalltalk.method({
  1655. selector: "testEquality",
  1656. fn: function (){
  1657. var self=this;
  1658. var o=nil;
  1659. (o=smalltalk.send((smalltalk.Object || Object), "_new", []));
  1660. smalltalk.send(self, "_deny_", [smalltalk.send(o, "__eq", [smalltalk.send((smalltalk.Object || Object), "_new", [])])]);
  1661. smalltalk.send(self, "_assert_", [smalltalk.send(o, "__eq", [o])]);
  1662. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(o, "_yourself", []), "__eq", [o])]);
  1663. smalltalk.send(self, "_assert_", [smalltalk.send(o, "__eq", [smalltalk.send(o, "_yourself", [])])]);
  1664. return self;}
  1665. }),
  1666. smalltalk.ObjectTest);
  1667. smalltalk.addMethod(
  1668. "_testHalt",
  1669. smalltalk.method({
  1670. selector: "testHalt",
  1671. fn: function (){
  1672. var self=this;
  1673. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send(smalltalk.send((smalltalk.Object || Object), "_new", []), "_halt", []);}), (smalltalk.Error || Error)]);
  1674. return self;}
  1675. }),
  1676. smalltalk.ObjectTest);
  1677. smalltalk.addMethod(
  1678. "_testIdentity",
  1679. smalltalk.method({
  1680. selector: "testIdentity",
  1681. fn: function (){
  1682. var self=this;
  1683. var o=nil;
  1684. (o=smalltalk.send((smalltalk.Object || Object), "_new", []));
  1685. smalltalk.send(self, "_deny_", [smalltalk.send(o, "__eq_eq", [smalltalk.send((smalltalk.Object || Object), "_new", [])])]);
  1686. smalltalk.send(self, "_assert_", [smalltalk.send(o, "__eq_eq", [o])]);
  1687. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(o, "_yourself", []), "__eq_eq", [o])]);
  1688. smalltalk.send(self, "_assert_", [smalltalk.send(o, "__eq_eq", [smalltalk.send(o, "_yourself", [])])]);
  1689. return self;}
  1690. }),
  1691. smalltalk.ObjectTest);
  1692. smalltalk.addMethod(
  1693. "_testIfNil",
  1694. smalltalk.method({
  1695. selector: "testIfNil",
  1696. fn: function (){
  1697. var self=this;
  1698. smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send((smalltalk.Object || Object), "_new", []), "_isNil", [])]);
  1699. smalltalk.send(self, "_deny_", [smalltalk.send((($receiver = smalltalk.send((smalltalk.Object || Object), "_new", [])) == nil || $receiver == undefined) ? (function(){return true;})() : $receiver, "__eq", [true])]);
  1700. smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = smalltalk.send((smalltalk.Object || Object), "_new", [])) != nil && $receiver != undefined) ? (function(){return true;})() : nil, "__eq", [true])]);
  1701. smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = smalltalk.send((smalltalk.Object || Object), "_new", [])) == nil || $receiver == undefined) ? (function(){return false;})() : (function(){return true;})(), "__eq", [true])]);
  1702. smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = smalltalk.send((smalltalk.Object || Object), "_new", [])) == nil || $receiver == undefined) ? (function(){return false;})() : (function(){return true;})(), "__eq", [true])]);
  1703. return self;}
  1704. }),
  1705. smalltalk.ObjectTest);
  1706. smalltalk.addMethod(
  1707. "_testInstVars",
  1708. smalltalk.method({
  1709. selector: "testInstVars",
  1710. fn: function (){
  1711. var self=this;
  1712. var o=nil;
  1713. (o=smalltalk.send((smalltalk.ObjectMock || ObjectMock), "_new", []));
  1714. smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_instVarAt_", [smalltalk.symbolFor("foo")]), nil]);
  1715. smalltalk.send(o, "_instVarAt_put_", [smalltalk.symbolFor("foo"), (1)]);
  1716. smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_instVarAt_", [smalltalk.symbolFor("foo")]), (1)]);
  1717. smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_instVarAt_", ["foo"]), (1)]);
  1718. return self;}
  1719. }),
  1720. smalltalk.ObjectTest);
  1721. smalltalk.addMethod(
  1722. "_testNilUndefined",
  1723. smalltalk.method({
  1724. selector: "testNilUndefined",
  1725. fn: function (){
  1726. var self=this;
  1727. var notDefined=nil;
  1728. notDefined = undefined;
  1729. smalltalk.send(self, "_assert_", [smalltalk.send(nil, "__eq", [notDefined])]);
  1730. return self;}
  1731. }),
  1732. smalltalk.ObjectTest);
  1733. smalltalk.addMethod(
  1734. "_testYourself",
  1735. smalltalk.method({
  1736. selector: "testYourself",
  1737. fn: function (){
  1738. var self=this;
  1739. var o=nil;
  1740. (o=smalltalk.send((smalltalk.ObjectMock || ObjectMock), "_new", []));
  1741. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(o, "_yourself", []), "__eq_eq", [o])]);
  1742. return self;}
  1743. }),
  1744. smalltalk.ObjectTest);
  1745. smalltalk.addMethod(
  1746. "_testidentityHash",
  1747. smalltalk.method({
  1748. selector: "testidentityHash",
  1749. fn: function (){
  1750. var self=this;
  1751. var o1=nil;
  1752. var o2=nil;
  1753. (o1=smalltalk.send((smalltalk.Object || Object), "_new", []));
  1754. (o2=smalltalk.send((smalltalk.Object || Object), "_new", []));
  1755. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(o1, "_identityHash", []), "__eq_eq", [smalltalk.send(o1, "_identityHash", [])])]);
  1756. smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send(o1, "_identityHash", []), "__eq_eq", [smalltalk.send(o2, "_identityHash", [])])]);
  1757. return self;}
  1758. }),
  1759. smalltalk.ObjectTest);
  1760. smalltalk.addClass('PackageTest', smalltalk.TestCase, ['zorkPackage', 'grulPackage', 'backUpCommitPathJs', 'backUpCommitPathSt'], 'Kernel-Tests');
  1761. smalltalk.addMethod(
  1762. "_setUp",
  1763. smalltalk.method({
  1764. selector: "setUp",
  1765. fn: function (){
  1766. var self=this;
  1767. (self['@backUpCommitPathJs']=smalltalk.send((smalltalk.Package || Package), "_defaultCommitPathJs", []));
  1768. (self['@backUpCommitPathSt']=smalltalk.send((smalltalk.Package || Package), "_defaultCommitPathSt", []));
  1769. smalltalk.send((smalltalk.Package || Package), "_resetCommitPaths", []);
  1770. (self['@zorkPackage']=smalltalk.send(smalltalk.send((smalltalk.Package || Package), "_new", []), "_name_", ["Zork"]));
  1771. (self['@grulPackage']=(function($rec){smalltalk.send($rec, "_name_", ["Grul"]);smalltalk.send($rec, "_commitPathJs_", ["server/grul/js"]);smalltalk.send($rec, "_commitPathSt_", ["grul/st"]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Package || Package), "_new", [])));
  1772. return self;}
  1773. }),
  1774. smalltalk.PackageTest);
  1775. smalltalk.addMethod(
  1776. "_tearDown",
  1777. smalltalk.method({
  1778. selector: "tearDown",
  1779. fn: function (){
  1780. var self=this;
  1781. (function($rec){smalltalk.send($rec, "_defaultCommitPathJs_", [self['@backUpCommitPathJs']]);return smalltalk.send($rec, "_defaultCommitPathSt_", [self['@backUpCommitPathSt']]);})((smalltalk.Package || Package));
  1782. return self;}
  1783. }),
  1784. smalltalk.PackageTest);
  1785. smalltalk.addMethod(
  1786. "_testGrulCommitPathJsShouldBeServerGrulJs",
  1787. smalltalk.method({
  1788. selector: "testGrulCommitPathJsShouldBeServerGrulJs",
  1789. fn: function (){
  1790. var self=this;
  1791. smalltalk.send(self, "_assert_equals_", ["server/grul/js", smalltalk.send(self['@grulPackage'], "_commitPathJs", [])]);
  1792. return self;}
  1793. }),
  1794. smalltalk.PackageTest);
  1795. smalltalk.addMethod(
  1796. "_testGrulCommitPathStShouldBeGrulSt",
  1797. smalltalk.method({
  1798. selector: "testGrulCommitPathStShouldBeGrulSt",
  1799. fn: function (){
  1800. var self=this;
  1801. smalltalk.send(self, "_assert_equals_", ["grul/st", smalltalk.send(self['@grulPackage'], "_commitPathSt", [])]);
  1802. return self;}
  1803. }),
  1804. smalltalk.PackageTest);
  1805. smalltalk.addMethod(
  1806. "_testZorkCommitPathJsShouldBeJs",
  1807. smalltalk.method({
  1808. selector: "testZorkCommitPathJsShouldBeJs",
  1809. fn: function (){
  1810. var self=this;
  1811. smalltalk.send(self, "_assert_equals_", ["js", smalltalk.send(self['@zorkPackage'], "_commitPathJs", [])]);
  1812. return self;}
  1813. }),
  1814. smalltalk.PackageTest);
  1815. smalltalk.addMethod(
  1816. "_testZorkCommitPathStShouldBeSt",
  1817. smalltalk.method({
  1818. selector: "testZorkCommitPathStShouldBeSt",
  1819. fn: function (){
  1820. var self=this;
  1821. smalltalk.send(self, "_assert_equals_", ["st", smalltalk.send(self['@zorkPackage'], "_commitPathSt", [])]);
  1822. return self;}
  1823. }),
  1824. smalltalk.PackageTest);
  1825. smalltalk.addClass('PackageWithDefaultCommitPathChangedTest', smalltalk.PackageTest, [], 'Kernel-Tests');
  1826. smalltalk.addMethod(
  1827. "_setUp",
  1828. smalltalk.method({
  1829. selector: "setUp",
  1830. fn: function (){
  1831. var self=this;
  1832. smalltalk.send((typeof super_ == 'undefined' ? nil : super_), "_setUp", []);
  1833. (function($rec){smalltalk.send($rec, "_defaultCommitPathJs_", ["javascripts/"]);return smalltalk.send($rec, "_defaultCommitPathSt_", ["smalltalk/"]);})((smalltalk.Package || Package));
  1834. return self;}
  1835. }),
  1836. smalltalk.PackageWithDefaultCommitPathChangedTest);
  1837. smalltalk.addMethod(
  1838. "_testGrulCommitPathJsShouldBeServerGrulJs",
  1839. smalltalk.method({
  1840. selector: "testGrulCommitPathJsShouldBeServerGrulJs",
  1841. fn: function (){
  1842. var self=this;
  1843. smalltalk.send(self, "_assert_equals_", ["server/grul/js", smalltalk.send(self['@grulPackage'], "_commitPathJs", [])]);
  1844. return self;}
  1845. }),
  1846. smalltalk.PackageWithDefaultCommitPathChangedTest);
  1847. smalltalk.addMethod(
  1848. "_testGrulCommitPathStShouldBeGrulSt",
  1849. smalltalk.method({
  1850. selector: "testGrulCommitPathStShouldBeGrulSt",
  1851. fn: function (){
  1852. var self=this;
  1853. smalltalk.send(self, "_assert_equals_", ["grul/st", smalltalk.send(self['@grulPackage'], "_commitPathSt", [])]);
  1854. return self;}
  1855. }),
  1856. smalltalk.PackageWithDefaultCommitPathChangedTest);
  1857. smalltalk.addMethod(
  1858. "_testZorkCommitPathJsShouldBeJavascript",
  1859. smalltalk.method({
  1860. selector: "testZorkCommitPathJsShouldBeJavascript",
  1861. fn: function (){
  1862. var self=this;
  1863. smalltalk.send(self, "_assert_equals_", ["javascripts/", smalltalk.send(self['@zorkPackage'], "_commitPathJs", [])]);
  1864. return self;}
  1865. }),
  1866. smalltalk.PackageWithDefaultCommitPathChangedTest);
  1867. smalltalk.addMethod(
  1868. "_testZorkCommitPathStShouldBeSmalltalk",
  1869. smalltalk.method({
  1870. selector: "testZorkCommitPathStShouldBeSmalltalk",
  1871. fn: function (){
  1872. var self=this;
  1873. smalltalk.send(self, "_assert_equals_", ["smalltalk/", smalltalk.send(self['@zorkPackage'], "_commitPathSt", [])]);
  1874. return self;}
  1875. }),
  1876. smalltalk.PackageWithDefaultCommitPathChangedTest);
  1877. smalltalk.addMethod(
  1878. "_shouldInheritSelectors",
  1879. smalltalk.method({
  1880. selector: "shouldInheritSelectors",
  1881. fn: function (){
  1882. var self=this;
  1883. return false;
  1884. return self;}
  1885. }),
  1886. smalltalk.PackageWithDefaultCommitPathChangedTest.klass);
  1887. smalltalk.addClass('PointTest', smalltalk.TestCase, [], 'Kernel-Tests');
  1888. smalltalk.addMethod(
  1889. "_testAccessing",
  1890. smalltalk.method({
  1891. selector: "testAccessing",
  1892. fn: function (){
  1893. var self=this;
  1894. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send((smalltalk.Point || Point), "_x_y_", [(3), (4)]), "_x", []), (3)]);
  1895. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send((smalltalk.Point || Point), "_x_y_", [(3), (4)]), "_y", []), (4)]);
  1896. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Point || Point), "_new", []), "_x_", [(3)]), "_x", []), (3)]);
  1897. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Point || Point), "_new", []), "_y_", [(4)]), "_y", []), (4)]);
  1898. return self;}
  1899. }),
  1900. smalltalk.PointTest);
  1901. smalltalk.addMethod(
  1902. "_testArithmetic",
  1903. smalltalk.method({
  1904. selector: "testArithmetic",
  1905. fn: function (){
  1906. var self=this;
  1907. smalltalk.send(self, "_assert_equals_", [((($receiver = smalltalk.send((3), "__at", [(4)])).klass === smalltalk.Number) ? $receiver *smalltalk.send((3), "__at", [(4)]) : smalltalk.send($receiver, "__star", [smalltalk.send((3), "__at", [(4)])])), smalltalk.send((smalltalk.Point || Point), "_x_y_", [(9), (16)])]);
  1908. smalltalk.send(self, "_assert_equals_", [((($receiver = smalltalk.send((3), "__at", [(4)])).klass === smalltalk.Number) ? $receiver +smalltalk.send((3), "__at", [(4)]) : smalltalk.send($receiver, "__plus", [smalltalk.send((3), "__at", [(4)])])), smalltalk.send((smalltalk.Point || Point), "_x_y_", [(6), (8)])]);
  1909. smalltalk.send(self, "_assert_equals_", [((($receiver = smalltalk.send((3), "__at", [(4)])).klass === smalltalk.Number) ? $receiver -smalltalk.send((3), "__at", [(4)]) : smalltalk.send($receiver, "__minus", [smalltalk.send((3), "__at", [(4)])])), smalltalk.send((smalltalk.Point || Point), "_x_y_", [(0), (0)])]);
  1910. smalltalk.send(self, "_assert_equals_", [((($receiver = smalltalk.send((6), "__at", [(8)])).klass === smalltalk.Number) ? $receiver /smalltalk.send((3), "__at", [(4)]) : smalltalk.send($receiver, "__slash", [smalltalk.send((3), "__at", [(4)])])), smalltalk.send((smalltalk.Point || Point), "_x_y_", [(2), (2)])]);
  1911. return self;}
  1912. }),
  1913. smalltalk.PointTest);
  1914. smalltalk.addMethod(
  1915. "_testAt",
  1916. smalltalk.method({
  1917. selector: "testAt",
  1918. fn: function (){
  1919. var self=this;
  1920. smalltalk.send(self, "_assert_equals_", [smalltalk.send((3), "__at", [(4)]), smalltalk.send((smalltalk.Point || Point), "_x_y_", [(3), (4)])]);
  1921. return self;}
  1922. }),
  1923. smalltalk.PointTest);
  1924. smalltalk.addMethod(
  1925. "_testEgality",
  1926. smalltalk.method({
  1927. selector: "testEgality",
  1928. fn: function (){
  1929. var self=this;
  1930. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3), "__at", [(4)]), "__eq", [smalltalk.send((3), "__at", [(4)])])]);
  1931. smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send((3), "__at", [(5)]), "__eq", [smalltalk.send((3), "__at", [(6)])])]);
  1932. return self;}
  1933. }),
  1934. smalltalk.PointTest);
  1935. smalltalk.addMethod(
  1936. "_testTranslateBy",
  1937. smalltalk.method({
  1938. selector: "testTranslateBy",
  1939. fn: function (){
  1940. var self=this;
  1941. smalltalk.send(self, "_assert_equals_", [smalltalk.send((3), "__at", [(4)]), smalltalk.send(smalltalk.send((3), "__at", [(3)]), "_translateBy_", [smalltalk.send((0), "__at", [(1)])])]);
  1942. smalltalk.send(self, "_assert_equals_", [smalltalk.send((3), "__at", [(2)]), smalltalk.send(smalltalk.send((3), "__at", [(3)]), "_translateBy_", [smalltalk.send((0), "__at", [smalltalk.send((1), "_negated", [])])])]);
  1943. smalltalk.send(self, "_assert_equals_", [smalltalk.send((5), "__at", [(6)]), smalltalk.send(smalltalk.send((3), "__at", [(3)]), "_translateBy_", [smalltalk.send((2), "__at", [(3)])])]);
  1944. smalltalk.send(self, "_assert_equals_", [smalltalk.send((0), "__at", [(3)]), smalltalk.send(smalltalk.send((3), "__at", [(3)]), "_translateBy_", [smalltalk.send(smalltalk.send((3), "_negated", []), "__at", [(0)])])]);
  1945. return self;}
  1946. }),
  1947. smalltalk.PointTest);
  1948. smalltalk.addClass('RandomTest', smalltalk.TestCase, [], 'Kernel-Tests');
  1949. smalltalk.addMethod(
  1950. "_textNext",
  1951. smalltalk.method({
  1952. selector: "textNext",
  1953. fn: function (){
  1954. var self=this;
  1955. smalltalk.send((10000), "_timesRepeat_", [(function(){var current=nil;
  1956. var next=nil;
  1957. (next=smalltalk.send(smalltalk.send((smalltalk.Random || Random), "_new", []), "_next", []));smalltalk.send(self, "_assert_", [((($receiver = next).klass === smalltalk.Number) ? $receiver >=(0) : smalltalk.send($receiver, "__gt_eq", [(0)]))]);smalltalk.send(self, "_assert_", [((($receiver = next).klass === smalltalk.Number) ? $receiver <(1) : smalltalk.send($receiver, "__lt", [(1)]))]);smalltalk.send(self, "_deny_", [smalltalk.send(current, "__eq", [next])]);return smalltalk.send(next, "__eq", [current]);})]);
  1958. return self;}
  1959. }),
  1960. smalltalk.RandomTest);
  1961. smalltalk.addClass('SetTest', smalltalk.TestCase, [], 'Kernel-Tests');
  1962. smalltalk.addMethod(
  1963. "_testAddRemove",
  1964. smalltalk.method({
  1965. selector: "testAddRemove",
  1966. fn: function (){
  1967. var self=this;
  1968. var set=nil;
  1969. (set=smalltalk.send((smalltalk.Set || Set), "_new", []));
  1970. smalltalk.send(self, "_assert_", [smalltalk.send(set, "_isEmpty", [])]);
  1971. smalltalk.send(set, "_add_", [(3)]);
  1972. smalltalk.send(self, "_assert_", [smalltalk.send(set, "_includes_", [(3)])]);
  1973. smalltalk.send(set, "_add_", [(5)]);
  1974. smalltalk.send(self, "_assert_", [smalltalk.send(set, "_includes_", [(5)])]);
  1975. smalltalk.send(set, "_remove_", [(3)]);
  1976. smalltalk.send(self, "_deny_", [smalltalk.send(set, "_includes_", [(3)])]);
  1977. return self;}
  1978. }),
  1979. smalltalk.SetTest);
  1980. smalltalk.addMethod(
  1981. "_testAt",
  1982. smalltalk.method({
  1983. selector: "testAt",
  1984. fn: function (){
  1985. var self=this;
  1986. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send(smalltalk.send((smalltalk.Set || Set), "_new", []), "_at_put_", [(1), (2)]);}), (smalltalk.Error || Error)]);
  1987. return self;}
  1988. }),
  1989. smalltalk.SetTest);
  1990. smalltalk.addMethod(
  1991. "_testPrintString",
  1992. smalltalk.method({
  1993. selector: "testPrintString",
  1994. fn: function (){
  1995. var self=this;
  1996. var set=nil;
  1997. (set=smalltalk.send((smalltalk.Set || Set), "_new", []));
  1998. smalltalk.send(self, "_assert_equals_", ["a Set ()", smalltalk.send(set, "_printString", [])]);
  1999. (function($rec){smalltalk.send($rec, "_add_", [(1)]);return smalltalk.send($rec, "_add_", [(3)]);})(set);
  2000. smalltalk.send(self, "_assert_equals_", ["a Set (1 3)", smalltalk.send(set, "_printString", [])]);
  2001. smalltalk.send(set, "_add_", ["foo"]);
  2002. smalltalk.send(self, "_assert_equals_", ["a Set (1 3 'foo')", smalltalk.send(set, "_printString", [])]);
  2003. (function($rec){smalltalk.send($rec, "_remove_", [(1)]);return smalltalk.send($rec, "_remove_", [(3)]);})(set);
  2004. smalltalk.send(self, "_assert_equals_", ["a Set ('foo')", smalltalk.send(set, "_printString", [])]);
  2005. smalltalk.send(set, "_add_", [(3)]);
  2006. smalltalk.send(self, "_assert_equals_", ["a Set ('foo' 3)", smalltalk.send(set, "_printString", [])]);
  2007. smalltalk.send(set, "_add_", [(3)]);
  2008. smalltalk.send(self, "_assert_equals_", ["a Set ('foo' 3)", smalltalk.send(set, "_printString", [])]);
  2009. return self;}
  2010. }),
  2011. smalltalk.SetTest);
  2012. smalltalk.addMethod(
  2013. "_testSize",
  2014. smalltalk.method({
  2015. selector: "testSize",
  2016. fn: function (){
  2017. var self=this;
  2018. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send((smalltalk.Set || Set), "_new", []), "_size", []), (0)]);
  2019. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send((smalltalk.Set || Set), "_withAll_", [[(1), (2), (3), (4)]]), "_size", []), (4)]);
  2020. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send((smalltalk.Set || Set), "_withAll_", [[(1), (1), (1), (1)]]), "_size", []), (1)]);
  2021. return self;}
  2022. }),
  2023. smalltalk.SetTest);
  2024. smalltalk.addMethod(
  2025. "_testUnicity",
  2026. smalltalk.method({
  2027. selector: "testUnicity",
  2028. fn: function (){
  2029. var self=this;
  2030. var set=nil;
  2031. (set=smalltalk.send((smalltalk.Set || Set), "_new", []));
  2032. smalltalk.send(set, "_add_", [(21)]);
  2033. smalltalk.send(set, "_add_", ["hello"]);
  2034. smalltalk.send(set, "_add_", [(21)]);
  2035. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(set, "_size", []), "__eq", [(2)])]);
  2036. smalltalk.send(set, "_add_", ["hello"]);
  2037. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(set, "_size", []), "__eq", [(2)])]);
  2038. smalltalk.send(self, "_assert_equals_", [smalltalk.send(set, "_asArray", []), [(21), "hello"]]);
  2039. return self;}
  2040. }),
  2041. smalltalk.SetTest);
  2042. smalltalk.addClass('UndefinedTest', smalltalk.TestCase, [], 'Kernel-Tests');
  2043. smalltalk.addMethod(
  2044. "_testCopying",
  2045. smalltalk.method({
  2046. selector: "testCopying",
  2047. fn: function (){
  2048. var self=this;
  2049. smalltalk.send(self, "_assert_equals_", [smalltalk.send(nil, "_copy", []), nil]);
  2050. return self;}
  2051. }),
  2052. smalltalk.UndefinedTest);
  2053. smalltalk.addMethod(
  2054. "_testDeepCopy",
  2055. smalltalk.method({
  2056. selector: "testDeepCopy",
  2057. fn: function (){
  2058. var self=this;
  2059. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(nil, "_deepCopy", []), "__eq", [nil])]);
  2060. return self;}
  2061. }),
  2062. smalltalk.UndefinedTest);
  2063. smalltalk.addMethod(
  2064. "_testIfNil",
  2065. smalltalk.method({
  2066. selector: "testIfNil",
  2067. fn: function (){
  2068. var self=this;
  2069. smalltalk.send(self, "_assert_equals_", [(($receiver = nil) == nil || $receiver == undefined) ? (function(){return true;})() : $receiver, true]);
  2070. smalltalk.send(self, "_deny_", [smalltalk.send((($receiver = nil) != nil && $receiver != undefined) ? (function(){return true;})() : nil, "__eq", [true])]);
  2071. smalltalk.send(self, "_assert_equals_", [(($receiver = nil) == nil || $receiver == undefined) ? (function(){return true;})() : (function(){return false;})(), true]);
  2072. smalltalk.send(self, "_deny_", [smalltalk.send((($receiver = nil) == nil || $receiver == undefined) ? (function(){return false;})() : (function(){return true;})(), "__eq", [true])]);
  2073. return self;}
  2074. }),
  2075. smalltalk.UndefinedTest);
  2076. smalltalk.addMethod(
  2077. "_testIsNil",
  2078. smalltalk.method({
  2079. selector: "testIsNil",
  2080. fn: function (){
  2081. var self=this;
  2082. smalltalk.send(self, "_assert_", [smalltalk.send(nil, "_isNil", [])]);
  2083. smalltalk.send(self, "_deny_", [smalltalk.send(nil, "_notNil", [])]);
  2084. return self;}
  2085. }),
  2086. smalltalk.UndefinedTest);
  2087. smalltalk.addMethod(
  2088. "_boxed",
  2089. smalltalk.method({
  2090. selector: "boxed",
  2091. fn: function (){
  2092. var self=this;
  2093. return self;
  2094. return self;}
  2095. }),
  2096. smalltalk.Boolean);