Kernel-Tests.deploy.js 68 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614
  1. smalltalk.addPackage('Kernel-Tests', {});
  2. smalltalk.addClass('ArrayTest', smalltalk.TestCase, [], 'Kernel-Tests');
  3. smalltalk.addMethod(
  4. "_testAtIfAbsent",
  5. smalltalk.method({
  6. selector: "testAtIfAbsent",
  7. fn: function (){
  8. var self=this;
  9. var array=nil;
  10. (array=["hello", "world"]);
  11. smalltalk.send(self, "_assert_equals_", [smalltalk.send(array, "_at_", [(1)]), "hello"]);
  12. smalltalk.send(self, "_assert_equals_", [smalltalk.send(array, "_at_", [(2)]), "world"]);
  13. smalltalk.send(self, "_assert_equals_", [smalltalk.send(array, "_at_ifAbsent_", [(2), (function(){return "not found";})]), "world"]);
  14. smalltalk.send(self, "_assert_equals_", [smalltalk.send(array, "_at_ifAbsent_", [(0), (function(){return "not found";})]), "not found"]);
  15. smalltalk.send(self, "_assert_equals_", [smalltalk.send(array, "_at_ifAbsent_", [(-10), (function(){return "not found";})]), "not found"]);
  16. smalltalk.send(self, "_assert_equals_", [smalltalk.send(array, "_at_ifAbsent_", [(3), (function(){return "not found";})]), "not found"]);
  17. return self;}
  18. }),
  19. smalltalk.ArrayTest);
  20. smalltalk.addMethod(
  21. "_testFirstN",
  22. smalltalk.method({
  23. selector: "testFirstN",
  24. fn: function (){
  25. var self=this;
  26. smalltalk.send(self, "_assert_equals_", [[(1),(2),(3)], smalltalk.send([(1),(2),(3),(4),(5)], "_first_", [(3)])]);
  27. return self;}
  28. }),
  29. smalltalk.ArrayTest);
  30. smalltalk.addMethod(
  31. "_testIfEmpty",
  32. smalltalk.method({
  33. selector: "testIfEmpty",
  34. fn: function (){
  35. var self=this;
  36. smalltalk.send(self, "_assert_equals_", ["zork", smalltalk.send("", "_ifEmpty_", [(function(){return "zork";})])]);
  37. return self;}
  38. }),
  39. smalltalk.ArrayTest);
  40. smalltalk.addMethod(
  41. "_testPrintString",
  42. smalltalk.method({
  43. selector: "testPrintString",
  44. fn: function (){
  45. var self=this;
  46. var array=nil;
  47. (array=smalltalk.send((smalltalk.Array || Array), "_new", []));
  48. smalltalk.send(self, "_assert_equals_", ["a Array ()", smalltalk.send(array, "_printString", [])]);
  49. (function($rec){smalltalk.send($rec, "_add_", [(1)]);return smalltalk.send($rec, "_add_", [(3)]);})(array);
  50. smalltalk.send(self, "_assert_equals_", ["a Array (1 3)", smalltalk.send(array, "_printString", [])]);
  51. smalltalk.send(array, "_add_", ["foo"]);
  52. smalltalk.send(self, "_assert_equals_", ["a Array (1 3 'foo')", smalltalk.send(array, "_printString", [])]);
  53. (function($rec){smalltalk.send($rec, "_remove_", [(1)]);return smalltalk.send($rec, "_remove_", [(3)]);})(array);
  54. smalltalk.send(self, "_assert_equals_", ["a Array ('foo')", smalltalk.send(array, "_printString", [])]);
  55. smalltalk.send(array, "_addLast_", [(3)]);
  56. smalltalk.send(self, "_assert_equals_", ["a Array ('foo' 3)", smalltalk.send(array, "_printString", [])]);
  57. smalltalk.send(array, "_addLast_", [(3)]);
  58. smalltalk.send(self, "_assert_equals_", ["a Array ('foo' 3 3)", smalltalk.send(array, "_printString", [])]);
  59. return self;}
  60. }),
  61. smalltalk.ArrayTest);
  62. smalltalk.addClass('BlockClosureTest', smalltalk.TestCase, [], 'Kernel-Tests');
  63. smalltalk.addMethod(
  64. "_testCompiledSource",
  65. smalltalk.method({
  66. selector: "testCompiledSource",
  67. fn: function (){
  68. var self=this;
  69. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((function(){return (1) + (1);}), "_compiledSource", []), "_includesSubString_", ["function"])]);
  70. return self;}
  71. }),
  72. smalltalk.BlockClosureTest);
  73. smalltalk.addMethod(
  74. "_testEnsure",
  75. smalltalk.method({
  76. selector: "testEnsure",
  77. fn: function (){
  78. var self=this;
  79. smalltalk.send(self, "_assert_", [smalltalk.send((function(){return smalltalk.send((smalltalk.Error || Error), "_new", []);}), "_ensure_", [(function(){return true;})])]);
  80. return self;}
  81. }),
  82. smalltalk.BlockClosureTest);
  83. smalltalk.addMethod(
  84. "_testNumArgs",
  85. smalltalk.method({
  86. selector: "testNumArgs",
  87. fn: function (){
  88. var self=this;
  89. smalltalk.send(self, "_assert_equals_", [smalltalk.send((function(){return nil;}), "_numArgs", []), (0)]);
  90. smalltalk.send(self, "_assert_equals_", [smalltalk.send((function(a, b){return nil;}), "_numArgs", []), (2)]);
  91. return self;}
  92. }),
  93. smalltalk.BlockClosureTest);
  94. smalltalk.addMethod(
  95. "_testOnDo",
  96. smalltalk.method({
  97. selector: "testOnDo",
  98. fn: function (){
  99. var self=this;
  100. 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;})])]);
  101. return self;}
  102. }),
  103. smalltalk.BlockClosureTest);
  104. smalltalk.addMethod(
  105. "_testValue",
  106. smalltalk.method({
  107. selector: "testValue",
  108. fn: function (){
  109. var self=this;
  110. smalltalk.send(self, "_assert_equals_", [smalltalk.send((function(){return (1) + (1);}), "_value", []), (2)]);
  111. 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)]);
  112. 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)]);
  113. smalltalk.send(self, "_assert_equals_", [smalltalk.send((function(a, b, c){return (1);}), "_value", []), (1)]);
  114. return self;}
  115. }),
  116. smalltalk.BlockClosureTest);
  117. smalltalk.addMethod(
  118. "_testValueWithPossibleArguments",
  119. smalltalk.method({
  120. selector: "testValueWithPossibleArguments",
  121. fn: function (){
  122. var self=this;
  123. smalltalk.send(self, "_assert_equals_", [smalltalk.send((function(){return (1);}), "_valueWithPossibleArguments_", [[(3), (4)]]), (1)]);
  124. 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)]);
  125. 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)]);
  126. return self;}
  127. }),
  128. smalltalk.BlockClosureTest);
  129. smalltalk.addMethod(
  130. "_testWhileFalse",
  131. smalltalk.method({
  132. selector: "testWhileFalse",
  133. fn: function (){
  134. var self=this;
  135. var i=nil;
  136. (i=(0));
  137. (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)])));})()}})();
  138. smalltalk.send(self, "_assert_equals_", [i, (6)]);
  139. (i=(0));
  140. (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)]));})()) {}})();
  141. smalltalk.send(self, "_assert_equals_", [i, (6)]);
  142. return self;}
  143. }),
  144. smalltalk.BlockClosureTest);
  145. smalltalk.addMethod(
  146. "_testWhileTrue",
  147. smalltalk.method({
  148. selector: "testWhileTrue",
  149. fn: function (){
  150. var self=this;
  151. var i=nil;
  152. (i=(0));
  153. (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)])));})()}})();
  154. smalltalk.send(self, "_assert_equals_", [i, (5)]);
  155. (i=(0));
  156. (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)]));})()) {}})();
  157. smalltalk.send(self, "_assert_equals_", [i, (5)]);
  158. return self;}
  159. }),
  160. smalltalk.BlockClosureTest);
  161. smalltalk.addClass('BooleanTest', smalltalk.TestCase, [], 'Kernel-Tests');
  162. smalltalk.addMethod(
  163. "_testEquality",
  164. smalltalk.method({
  165. selector: "testEquality",
  166. fn: function (){
  167. var self=this;
  168. smalltalk.send(self, "_deny_", [smalltalk.send((0), "__eq", [false])]);
  169. smalltalk.send(self, "_deny_", [smalltalk.send(false, "__eq", [(0)])]);
  170. smalltalk.send(self, "_deny_", [smalltalk.send("", "__eq", [false])]);
  171. smalltalk.send(self, "_deny_", [smalltalk.send(false, "__eq", [""])]);
  172. smalltalk.send(self, "_assert_", [smalltalk.send(true, "__eq", [true])]);
  173. smalltalk.send(self, "_deny_", [smalltalk.send(false, "__eq", [true])]);
  174. smalltalk.send(self, "_deny_", [smalltalk.send(true, "__eq", [false])]);
  175. smalltalk.send(self, "_assert_", [smalltalk.send(false, "__eq", [false])]);
  176. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(true, "_yourself", []), "__eq", [true])]);
  177. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(true, "_yourself", []), "__eq", [smalltalk.send(true, "_yourself", [])])]);
  178. return self;}
  179. }),
  180. smalltalk.BooleanTest);
  181. smalltalk.addMethod(
  182. "_testIdentity",
  183. smalltalk.method({
  184. selector: "testIdentity",
  185. fn: function (){
  186. var self=this;
  187. smalltalk.send(self, "_deny_", [smalltalk.send((0), "__eq_eq", [false])]);
  188. smalltalk.send(self, "_deny_", [smalltalk.send(false, "__eq_eq", [(0)])]);
  189. smalltalk.send(self, "_deny_", [smalltalk.send("", "__eq_eq", [false])]);
  190. smalltalk.send(self, "_deny_", [smalltalk.send(false, "__eq_eq", [""])]);
  191. smalltalk.send(self, "_assert_", [smalltalk.send(true, "__eq_eq", [true])]);
  192. smalltalk.send(self, "_deny_", [smalltalk.send(false, "__eq_eq", [true])]);
  193. smalltalk.send(self, "_deny_", [smalltalk.send(true, "__eq_eq", [false])]);
  194. smalltalk.send(self, "_assert_", [smalltalk.send(false, "__eq_eq", [false])]);
  195. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(true, "_yourself", []), "__eq_eq", [true])]);
  196. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(true, "_yourself", []), "__eq_eq", [smalltalk.send(true, "_yourself", [])])]);
  197. return self;}
  198. }),
  199. smalltalk.BooleanTest);
  200. smalltalk.addMethod(
  201. "_testIfTrueIfFalse",
  202. smalltalk.method({
  203. selector: "testIfTrueIfFalse",
  204. fn: function (){
  205. var self=this;
  206. 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"])]);
  207. 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])]);
  208. 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])]);
  209. 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"])]);
  210. 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"])]);
  211. 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"])]);
  212. 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"])]);
  213. 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"])]);
  214. return self;}
  215. }),
  216. smalltalk.BooleanTest);
  217. smalltalk.addMethod(
  218. "_testLogic",
  219. smalltalk.method({
  220. selector: "testLogic",
  221. fn: function (){
  222. var self=this;
  223. (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);
  224. (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);
  225. (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);
  226. (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);
  227. return self;}
  228. }),
  229. smalltalk.BooleanTest);
  230. smalltalk.addMethod(
  231. "_testLogicKeywords",
  232. smalltalk.method({
  233. selector: "testLogicKeywords",
  234. fn: function (){
  235. var self=this;
  236. (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);
  237. (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);
  238. (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);
  239. (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);
  240. return self;}
  241. }),
  242. smalltalk.BooleanTest);
  243. smalltalk.addClass('ClassBuilderTest', smalltalk.TestCase, ['builder', 'theClass'], 'Kernel-Tests');
  244. smalltalk.addMethod(
  245. "_setUp",
  246. smalltalk.method({
  247. selector: "setUp",
  248. fn: function (){
  249. var self=this;
  250. (self['@builder']=smalltalk.send((smalltalk.ClassBuilder || ClassBuilder), "_new", []));
  251. return self;}
  252. }),
  253. smalltalk.ClassBuilderTest);
  254. smalltalk.addMethod(
  255. "_tearDown",
  256. smalltalk.method({
  257. selector: "tearDown",
  258. fn: function (){
  259. var self=this;
  260. (($receiver = self['@theClass']) != nil && $receiver != undefined) ? (function(){smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_removeClass_", [self['@theClass']]);return (self['@theClass']=nil);})() : nil;
  261. return self;}
  262. }),
  263. smalltalk.ClassBuilderTest);
  264. smalltalk.addMethod(
  265. "_testClassCopy",
  266. smalltalk.method({
  267. selector: "testClassCopy",
  268. fn: function (){
  269. var self=this;
  270. (self['@theClass']=smalltalk.send(self['@builder'], "_copyClass_named_", [(smalltalk.ObjectMock || ObjectMock), "ObjectMock2"]));
  271. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(self['@theClass'], "_superclass", []), "__eq_eq", [smalltalk.send((smalltalk.ObjectMock || ObjectMock), "_superclass", [])])]);
  272. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(self['@theClass'], "_instanceVariableNames", []), "__eq_eq", [smalltalk.send((smalltalk.ObjectMock || ObjectMock), "_instanceVariableNames", [])])]);
  273. smalltalk.send(self, "_assert_equals_", [smalltalk.send(self['@theClass'], "_name", []), "ObjectMock2"]);
  274. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(self['@theClass'], "_package", []), "__eq_eq", [smalltalk.send((smalltalk.ObjectMock || ObjectMock), "_package", [])])]);
  275. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send(self['@theClass'], "_methodDictionary", []), "_keys", []), smalltalk.send(smalltalk.send((smalltalk.ObjectMock || ObjectMock), "_methodDictionary", []), "_keys", [])]);
  276. return self;}
  277. }),
  278. smalltalk.ClassBuilderTest);
  279. smalltalk.addMethod(
  280. "_testInstanceVariableNames",
  281. smalltalk.method({
  282. selector: "testInstanceVariableNames",
  283. fn: function (){
  284. var self=this;
  285. smalltalk.send(self, "_assert_equals_", [smalltalk.send(self['@builder'], "_instanceVariableNamesFor_", [" hello world "]), ["hello", "world"]]);
  286. return self;}
  287. }),
  288. smalltalk.ClassBuilderTest);
  289. smalltalk.addClass('DictionaryTest', smalltalk.TestCase, [], 'Kernel-Tests');
  290. smalltalk.addMethod(
  291. "_testAccessing",
  292. smalltalk.method({
  293. selector: "testAccessing",
  294. fn: function (){
  295. var self=this;
  296. var d=nil;
  297. (d=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
  298. smalltalk.send(d, "_at_put_", ["hello", "world"]);
  299. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_at_", ["hello"]), "__eq", ["world"])]);
  300. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_at_ifAbsent_", ["hello", (function(){return nil;})]), "__eq", ["world"])]);
  301. smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send(d, "_at_ifAbsent_", ["foo", (function(){return nil;})]), "__eq", ["world"])]);
  302. smalltalk.send(d, "_at_put_", [(1), (2)]);
  303. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_at_", [(1)]), "__eq", [(2)])]);
  304. smalltalk.send(d, "_at_put_", [smalltalk.send((1), "__at", [(3)]), (3)]);
  305. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_at_", [smalltalk.send((1), "__at", [(3)])]), "__eq", [(3)])]);
  306. return self;}
  307. }),
  308. smalltalk.DictionaryTest);
  309. smalltalk.addMethod(
  310. "_testDynamicDictionaries",
  311. smalltalk.method({
  312. selector: "testDynamicDictionaries",
  313. fn: function (){
  314. var self=this;
  315. 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)])])])]);
  316. return self;}
  317. }),
  318. smalltalk.DictionaryTest);
  319. smalltalk.addMethod(
  320. "_testEquality",
  321. smalltalk.method({
  322. selector: "testEquality",
  323. fn: function (){
  324. var self=this;
  325. var d1=nil;
  326. var d2=nil;
  327. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []), "__eq", [smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", [])])]);
  328. (d1=(function($rec){smalltalk.send($rec, "_at_put_", [(1), (2)]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", [])));
  329. (d2=(function($rec){smalltalk.send($rec, "_at_put_", [(1), (2)]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", [])));
  330. smalltalk.send(self, "_assert_", [smalltalk.send(d1, "__eq", [d2])]);
  331. (d2=(function($rec){smalltalk.send($rec, "_at_put_", [(1), (3)]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", [])));
  332. smalltalk.send(self, "_deny_", [smalltalk.send(d1, "__eq", [d2])]);
  333. (d2=(function($rec){smalltalk.send($rec, "_at_put_", [(2), (2)]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", [])));
  334. smalltalk.send(self, "_deny_", [smalltalk.send(d1, "__eq", [d2])]);
  335. (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", [])));
  336. smalltalk.send(self, "_deny_", [smalltalk.send(d1, "__eq", [d2])]);
  337. return self;}
  338. }),
  339. smalltalk.DictionaryTest);
  340. smalltalk.addMethod(
  341. "_testKeys",
  342. smalltalk.method({
  343. selector: "testKeys",
  344. fn: function (){
  345. var self=this;
  346. var d=nil;
  347. (d=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
  348. smalltalk.send(d, "_at_put_", [(1), (2)]);
  349. smalltalk.send(d, "_at_put_", [(2), (3)]);
  350. smalltalk.send(d, "_at_put_", [(3), (4)]);
  351. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_keys", []), "__eq", [[(1), (2), (3)]])]);
  352. return self;}
  353. }),
  354. smalltalk.DictionaryTest);
  355. smalltalk.addMethod(
  356. "_testPrintString",
  357. smalltalk.method({
  358. selector: "testPrintString",
  359. fn: function (){
  360. var self=this;
  361. 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", []))]);
  362. return self;}
  363. }),
  364. smalltalk.DictionaryTest);
  365. smalltalk.addMethod(
  366. "_testRemoveKey",
  367. smalltalk.method({
  368. selector: "testRemoveKey",
  369. fn: function (){
  370. var self=this;
  371. var d=nil;
  372. var key=nil;
  373. (d=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
  374. smalltalk.send(d, "_at_put_", [(1), (2)]);
  375. smalltalk.send(d, "_at_put_", [(2), (3)]);
  376. smalltalk.send(d, "_at_put_", [(3), (4)]);
  377. (key=(2));
  378. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_keys", []), "__eq", [[(1), (2), (3)]])]);
  379. smalltalk.send(d, "_removeKey_", [key]);
  380. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_keys", []), "__eq", [[(1), (3)]])]);
  381. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_values", []), "__eq", [[(2), (4)]])]);
  382. smalltalk.send(self, "_deny_", [smalltalk.send(d, "_includesKey_", [(2)])]);
  383. return self;}
  384. }),
  385. smalltalk.DictionaryTest);
  386. smalltalk.addMethod(
  387. "_testRemoveKeyIfAbsent",
  388. smalltalk.method({
  389. selector: "testRemoveKeyIfAbsent",
  390. fn: function (){
  391. var self=this;
  392. var d=nil;
  393. var key=nil;
  394. (d=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
  395. smalltalk.send(d, "_at_put_", [(1), (2)]);
  396. smalltalk.send(d, "_at_put_", [(2), (3)]);
  397. smalltalk.send(d, "_at_put_", [(3), (4)]);
  398. (key=(2));
  399. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_removeKey_", [key]), "__eq", [(3)])]);
  400. (key=(3));
  401. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_removeKey_ifAbsent_", [key, (function(){return (42);})]), "__eq", [(4)])]);
  402. (key="why");
  403. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_removeKey_ifAbsent_", [key, (function(){return (42);})]), "__eq", [(42)])]);
  404. return self;}
  405. }),
  406. smalltalk.DictionaryTest);
  407. smalltalk.addMethod(
  408. "_testSize",
  409. smalltalk.method({
  410. selector: "testSize",
  411. fn: function (){
  412. var self=this;
  413. var d=nil;
  414. (d=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
  415. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_size", []), "__eq", [(0)])]);
  416. smalltalk.send(d, "_at_put_", [(1), (2)]);
  417. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_size", []), "__eq", [(1)])]);
  418. smalltalk.send(d, "_at_put_", [(2), (3)]);
  419. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_size", []), "__eq", [(2)])]);
  420. return self;}
  421. }),
  422. smalltalk.DictionaryTest);
  423. smalltalk.addMethod(
  424. "_testValues",
  425. smalltalk.method({
  426. selector: "testValues",
  427. fn: function (){
  428. var self=this;
  429. var d=nil;
  430. (d=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
  431. smalltalk.send(d, "_at_put_", [(1), (2)]);
  432. smalltalk.send(d, "_at_put_", [(2), (3)]);
  433. smalltalk.send(d, "_at_put_", [(3), (4)]);
  434. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_values", []), "__eq", [[(2), (3), (4)]])]);
  435. return self;}
  436. }),
  437. smalltalk.DictionaryTest);
  438. smalltalk.addClass('JSObjectProxyTest', smalltalk.TestCase, [], 'Kernel-Tests');
  439. smalltalk.addMethod(
  440. "_jsObject",
  441. smalltalk.method({
  442. selector: "jsObject",
  443. fn: function (){
  444. var self=this;
  445. return jsObject = {a: 1, b: function() {return 2;}, c: function(object) {return object;}};
  446. return self;}
  447. }),
  448. smalltalk.JSObjectProxyTest);
  449. smalltalk.addMethod(
  450. "_testDNU",
  451. smalltalk.method({
  452. selector: "testDNU",
  453. fn: function (){
  454. var self=this;
  455. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send(smalltalk.send(self, "_jsObject", []), "_foo", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  456. return self;}
  457. }),
  458. smalltalk.JSObjectProxyTest);
  459. smalltalk.addMethod(
  460. "_testMessageSend",
  461. smalltalk.method({
  462. selector: "testMessageSend",
  463. fn: function (){
  464. var self=this;
  465. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send(self, "_jsObject", []), "_a", []), (1)]);
  466. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send(self, "_jsObject", []), "_b", []), (2)]);
  467. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send(self, "_jsObject", []), "_c_", [(3)]), (3)]);
  468. return self;}
  469. }),
  470. smalltalk.JSObjectProxyTest);
  471. smalltalk.addMethod(
  472. "_testMethodWithArguments",
  473. smalltalk.method({
  474. selector: "testMethodWithArguments",
  475. fn: function (){
  476. var self=this;
  477. smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_hasClass_", ["amber"])]);
  478. smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_addClass_", ["amber"]);
  479. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_hasClass_", ["amber"])]);
  480. smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_removeClass_", ["amber"]);
  481. smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_hasClass_", ["amber"])]);
  482. return self;}
  483. }),
  484. smalltalk.JSObjectProxyTest);
  485. smalltalk.addMethod(
  486. "_testPrinting",
  487. smalltalk.method({
  488. selector: "testPrinting",
  489. fn: function (){
  490. var self=this;
  491. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_jsObject", []), "_printString", []), "__eq", ["[object Object]"])]);
  492. return self;}
  493. }),
  494. smalltalk.JSObjectProxyTest);
  495. smalltalk.addMethod(
  496. "_testPropertyThatReturnsEmptyString",
  497. smalltalk.method({
  498. selector: "testPropertyThatReturnsEmptyString",
  499. fn: function (){
  500. var self=this;
  501. document.location.hash = '';
  502. smalltalk.send(self, "_assert_equals_", ["", smalltalk.send(smalltalk.send((typeof document == 'undefined' ? nil : document), "_location", []), "_hash", [])]);
  503. smalltalk.send(smalltalk.send((typeof document == 'undefined' ? nil : document), "_location", []), "_hash_", ["test"]);
  504. smalltalk.send(self, "_assert_equals_", ["#test", smalltalk.send(smalltalk.send((typeof document == 'undefined' ? nil : document), "_location", []), "_hash", [])]);
  505. return self;}
  506. }),
  507. smalltalk.JSObjectProxyTest);
  508. smalltalk.addMethod(
  509. "_testYourself",
  510. smalltalk.method({
  511. selector: "testYourself",
  512. fn: function (){
  513. var self=this;
  514. var body=nil;
  515. (body=(function($rec){smalltalk.send($rec, "_addClass_", ["amber"]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send("body", "_asJQuery", [])));
  516. smalltalk.send(self, "_assert_", [smalltalk.send(body, "_hasClass_", ["amber"])]);
  517. smalltalk.send(body, "_removeClass_", ["amber"]);
  518. smalltalk.send(self, "_deny_", [smalltalk.send(body, "_hasClass_", ["amber"])]);
  519. return self;}
  520. }),
  521. smalltalk.JSObjectProxyTest);
  522. smalltalk.addClass('NumberTest', smalltalk.TestCase, [], 'Kernel-Tests');
  523. smalltalk.addMethod(
  524. "_testArithmetic",
  525. smalltalk.method({
  526. selector: "testArithmetic",
  527. fn: function (){
  528. var self=this;
  529. smalltalk.send(self, "_assert_", [smalltalk.send((1.5) + (1), "__eq", [(2.5)])]);
  530. smalltalk.send(self, "_assert_", [smalltalk.send((2) - (1), "__eq", [(1)])]);
  531. smalltalk.send(self, "_assert_", [smalltalk.send((-2) - (1), "__eq", [(-3)])]);
  532. smalltalk.send(self, "_assert_", [smalltalk.send((12) / (2), "__eq", [(6)])]);
  533. smalltalk.send(self, "_assert_", [smalltalk.send((3) * (4), "__eq", [(12)])]);
  534. smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = (1) + (2)).klass === smalltalk.Number) ? $receiver *(3) : smalltalk.send($receiver, "__star", [(3)])), "__eq", [(9)])]);
  535. smalltalk.send(self, "_assert_", [smalltalk.send((1) + (2) * (3), "__eq", [(7)])]);
  536. return self;}
  537. }),
  538. smalltalk.NumberTest);
  539. smalltalk.addMethod(
  540. "_testComparison",
  541. smalltalk.method({
  542. selector: "testComparison",
  543. fn: function (){
  544. var self=this;
  545. smalltalk.send(self, "_assert_", [(3) > (2)]);
  546. smalltalk.send(self, "_assert_", [(2) < (3)]);
  547. smalltalk.send(self, "_deny_", [(3) < (2)]);
  548. smalltalk.send(self, "_deny_", [(2) > (3)]);
  549. smalltalk.send(self, "_assert_", [(3) >= (3)]);
  550. smalltalk.send(self, "_assert_", [(3.1) >= (3)]);
  551. smalltalk.send(self, "_assert_", [(3) <= (3)]);
  552. smalltalk.send(self, "_assert_", [(3) <= (3.1)]);
  553. return self;}
  554. }),
  555. smalltalk.NumberTest);
  556. smalltalk.addMethod(
  557. "_testCopying",
  558. smalltalk.method({
  559. selector: "testCopying",
  560. fn: function (){
  561. var self=this;
  562. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((1), "_copy", []), "__eq_eq", [(1)])]);
  563. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((1), "_deepCopy", []), "__eq_eq", [(1)])]);
  564. return self;}
  565. }),
  566. smalltalk.NumberTest);
  567. smalltalk.addMethod(
  568. "_testEquality",
  569. smalltalk.method({
  570. selector: "testEquality",
  571. fn: function (){
  572. var self=this;
  573. smalltalk.send(self, "_assert_", [smalltalk.send((1), "__eq", [(1)])]);
  574. smalltalk.send(self, "_assert_", [smalltalk.send((0), "__eq", [(0)])]);
  575. smalltalk.send(self, "_deny_", [smalltalk.send((1), "__eq", [(0)])]);
  576. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((1), "_yourself", []), "__eq", [(1)])]);
  577. smalltalk.send(self, "_assert_", [smalltalk.send((1), "__eq", [smalltalk.send((1), "_yourself", [])])]);
  578. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((1), "_yourself", []), "__eq", [smalltalk.send((1), "_yourself", [])])]);
  579. smalltalk.send(self, "_deny_", [smalltalk.send((0), "__eq", [false])]);
  580. smalltalk.send(self, "_deny_", [smalltalk.send(false, "__eq", [(0)])]);
  581. smalltalk.send(self, "_deny_", [smalltalk.send("", "__eq", [(0)])]);
  582. smalltalk.send(self, "_deny_", [smalltalk.send((0), "__eq", [""])]);
  583. return self;}
  584. }),
  585. smalltalk.NumberTest);
  586. smalltalk.addMethod(
  587. "_testIdentity",
  588. smalltalk.method({
  589. selector: "testIdentity",
  590. fn: function (){
  591. var self=this;
  592. smalltalk.send(self, "_assert_", [smalltalk.send((1), "__eq_eq", [(1)])]);
  593. smalltalk.send(self, "_assert_", [smalltalk.send((0), "__eq_eq", [(0)])]);
  594. smalltalk.send(self, "_deny_", [smalltalk.send((1), "__eq_eq", [(0)])]);
  595. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((1), "_yourself", []), "__eq_eq", [(1)])]);
  596. smalltalk.send(self, "_assert_", [smalltalk.send((1), "__eq_eq", [smalltalk.send((1), "_yourself", [])])]);
  597. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((1), "_yourself", []), "__eq_eq", [smalltalk.send((1), "_yourself", [])])]);
  598. smalltalk.send(self, "_deny_", [smalltalk.send((1), "__eq_eq", [(2)])]);
  599. return self;}
  600. }),
  601. smalltalk.NumberTest);
  602. smalltalk.addMethod(
  603. "_testMinMax",
  604. smalltalk.method({
  605. selector: "testMinMax",
  606. fn: function (){
  607. var self=this;
  608. smalltalk.send(self, "_assert_equals_", [smalltalk.send((2), "_max_", [(5)]), (5)]);
  609. smalltalk.send(self, "_assert_equals_", [smalltalk.send((2), "_min_", [(5)]), (2)]);
  610. return self;}
  611. }),
  612. smalltalk.NumberTest);
  613. smalltalk.addMethod(
  614. "_testNegated",
  615. smalltalk.method({
  616. selector: "testNegated",
  617. fn: function (){
  618. var self=this;
  619. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3), "_negated", []), "__eq", [(-3)])]);
  620. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((-3), "_negated", []), "__eq", [(3)])]);
  621. return self;}
  622. }),
  623. smalltalk.NumberTest);
  624. smalltalk.addMethod(
  625. "_testPrintShowingDecimalPlaces",
  626. smalltalk.method({
  627. selector: "testPrintShowingDecimalPlaces",
  628. fn: function (){
  629. var self=this;
  630. smalltalk.send(self, "_assert_equals_", ["23.00", smalltalk.send((23), "_printShowingDecimalPlaces_", [(2)])]);
  631. smalltalk.send(self, "_assert_equals_", ["23.57", smalltalk.send((23.5698), "_printShowingDecimalPlaces_", [(2)])]);
  632. smalltalk.send(self, "_assert_equals_", ["-234.56700", smalltalk.send(smalltalk.send((234.567), "_negated", []), "_printShowingDecimalPlaces_", [(5)])]);
  633. smalltalk.send(self, "_assert_equals_", ["23", smalltalk.send((23.4567), "_printShowingDecimalPlaces_", [(0)])]);
  634. smalltalk.send(self, "_assert_equals_", ["24", smalltalk.send((23.5567), "_printShowingDecimalPlaces_", [(0)])]);
  635. smalltalk.send(self, "_assert_equals_", ["-23", smalltalk.send(smalltalk.send((23.4567), "_negated", []), "_printShowingDecimalPlaces_", [(0)])]);
  636. smalltalk.send(self, "_assert_equals_", ["-24", smalltalk.send(smalltalk.send((23.5567), "_negated", []), "_printShowingDecimalPlaces_", [(0)])]);
  637. smalltalk.send(self, "_assert_equals_", ["100000000.0", smalltalk.send((100000000), "_printShowingDecimalPlaces_", [(1)])]);
  638. smalltalk.send(self, "_assert_equals_", ["0.98000", smalltalk.send((0.98), "_printShowingDecimalPlaces_", [(5)])]);
  639. smalltalk.send(self, "_assert_equals_", ["-0.98", smalltalk.send(smalltalk.send((0.98), "_negated", []), "_printShowingDecimalPlaces_", [(2)])]);
  640. smalltalk.send(self, "_assert_equals_", ["2.57", smalltalk.send((2.567), "_printShowingDecimalPlaces_", [(2)])]);
  641. smalltalk.send(self, "_assert_equals_", ["-2.57", smalltalk.send((-2.567), "_printShowingDecimalPlaces_", [(2)])]);
  642. smalltalk.send(self, "_assert_equals_", ["0.00", smalltalk.send((0), "_printShowingDecimalPlaces_", [(2)])]);
  643. return self;}
  644. }),
  645. smalltalk.NumberTest);
  646. smalltalk.addMethod(
  647. "_testRounded",
  648. smalltalk.method({
  649. selector: "testRounded",
  650. fn: function (){
  651. var self=this;
  652. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3), "_rounded", []), "__eq", [(3)])]);
  653. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3.212), "_rounded", []), "__eq", [(3)])]);
  654. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3.51), "_rounded", []), "__eq", [(4)])]);
  655. return self;}
  656. }),
  657. smalltalk.NumberTest);
  658. smalltalk.addMethod(
  659. "_testSqrt",
  660. smalltalk.method({
  661. selector: "testSqrt",
  662. fn: function (){
  663. var self=this;
  664. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((4), "_sqrt", []), "__eq", [(2)])]);
  665. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((16), "_sqrt", []), "__eq", [(4)])]);
  666. return self;}
  667. }),
  668. smalltalk.NumberTest);
  669. smalltalk.addMethod(
  670. "_testSquared",
  671. smalltalk.method({
  672. selector: "testSquared",
  673. fn: function (){
  674. var self=this;
  675. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((4), "_squared", []), "__eq", [(16)])]);
  676. return self;}
  677. }),
  678. smalltalk.NumberTest);
  679. smalltalk.addMethod(
  680. "_testTimesRepeat",
  681. smalltalk.method({
  682. selector: "testTimesRepeat",
  683. fn: function (){
  684. var self=this;
  685. var i=nil;
  686. (i=(0));
  687. smalltalk.send((0), "_timesRepeat_", [(function(){return (i=((($receiver = i).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));})]);
  688. smalltalk.send(self, "_assert_equals_", [i, (0)]);
  689. smalltalk.send((5), "_timesRepeat_", [(function(){return (i=((($receiver = i).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));})]);
  690. smalltalk.send(self, "_assert_equals_", [i, (5)]);
  691. return self;}
  692. }),
  693. smalltalk.NumberTest);
  694. smalltalk.addMethod(
  695. "_testTo",
  696. smalltalk.method({
  697. selector: "testTo",
  698. fn: function (){
  699. var self=this;
  700. smalltalk.send(self, "_assert_equals_", [smalltalk.send((1), "_to_", [(5)]), [(1), (2), (3), (4), (5)]]);
  701. return self;}
  702. }),
  703. smalltalk.NumberTest);
  704. smalltalk.addMethod(
  705. "_testToBy",
  706. smalltalk.method({
  707. selector: "testToBy",
  708. fn: function (){
  709. var self=this;
  710. smalltalk.send(self, "_assert_equals_", [smalltalk.send((0), "_to_by_", [(6), (2)]), [(0), (2), (4), (6)]]);
  711. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send((1), "_to_by_", [(4), (0)]);}), (smalltalk.Error || Error)]);
  712. return self;}
  713. }),
  714. smalltalk.NumberTest);
  715. smalltalk.addMethod(
  716. "_testTruncated",
  717. smalltalk.method({
  718. selector: "testTruncated",
  719. fn: function (){
  720. var self=this;
  721. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3), "_truncated", []), "__eq", [(3)])]);
  722. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3.212), "_truncated", []), "__eq", [(3)])]);
  723. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3.51), "_truncated", []), "__eq", [(3)])]);
  724. return self;}
  725. }),
  726. smalltalk.NumberTest);
  727. smalltalk.addClass('ObjectMock', smalltalk.Object, ['foo', 'bar'], 'Kernel-Tests');
  728. smalltalk.addMethod(
  729. "_foo",
  730. smalltalk.method({
  731. selector: "foo",
  732. fn: function (){
  733. var self=this;
  734. return self['@foo'];
  735. return self;}
  736. }),
  737. smalltalk.ObjectMock);
  738. smalltalk.addMethod(
  739. "_foo_",
  740. smalltalk.method({
  741. selector: "foo:",
  742. fn: function (anObject){
  743. var self=this;
  744. (self['@foo']=anObject);
  745. return self;}
  746. }),
  747. smalltalk.ObjectMock);
  748. smalltalk.addClass('ObjectTest', smalltalk.TestCase, [], 'Kernel-Tests');
  749. smalltalk.addMethod(
  750. "_testBasicAccess",
  751. smalltalk.method({
  752. selector: "testBasicAccess",
  753. fn: function (){
  754. var self=this;
  755. var o=nil;
  756. (o=smalltalk.send((smalltalk.Object || Object), "_new", []));
  757. smalltalk.send(o, "_basicAt_put_", ["a", (1)]);
  758. smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_basicAt_", ["a"]), (1)]);
  759. smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_basicAt_", ["b"]), nil]);
  760. return self;}
  761. }),
  762. smalltalk.ObjectTest);
  763. smalltalk.addMethod(
  764. "_testBasicPerform",
  765. smalltalk.method({
  766. selector: "testBasicPerform",
  767. fn: function (){
  768. var self=this;
  769. var o=nil;
  770. (o=smalltalk.send((smalltalk.Object || Object), "_new", []));
  771. smalltalk.send(o, "_basicAt_put_", ["func", (function(){return "hello";})]);
  772. smalltalk.send(o, "_basicAt_put_", ["func2", (function(a){return ((($receiver = a).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));})]);
  773. smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_basicPerform_", ["func"]), "hello"]);
  774. smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_basicPerform_withArguments_", ["func2", [(3)]]), (4)]);
  775. return self;}
  776. }),
  777. smalltalk.ObjectTest);
  778. smalltalk.addMethod(
  779. "_testDNU",
  780. smalltalk.method({
  781. selector: "testDNU",
  782. fn: function (){
  783. var self=this;
  784. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send(smalltalk.send((smalltalk.Object || Object), "_new", []), "_foo", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  785. return self;}
  786. }),
  787. smalltalk.ObjectTest);
  788. smalltalk.addMethod(
  789. "_testEquality",
  790. smalltalk.method({
  791. selector: "testEquality",
  792. fn: function (){
  793. var self=this;
  794. var o=nil;
  795. (o=smalltalk.send((smalltalk.Object || Object), "_new", []));
  796. smalltalk.send(self, "_deny_", [smalltalk.send(o, "__eq", [smalltalk.send((smalltalk.Object || Object), "_new", [])])]);
  797. smalltalk.send(self, "_assert_", [smalltalk.send(o, "__eq", [o])]);
  798. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(o, "_yourself", []), "__eq", [o])]);
  799. smalltalk.send(self, "_assert_", [smalltalk.send(o, "__eq", [smalltalk.send(o, "_yourself", [])])]);
  800. return self;}
  801. }),
  802. smalltalk.ObjectTest);
  803. smalltalk.addMethod(
  804. "_testHalt",
  805. smalltalk.method({
  806. selector: "testHalt",
  807. fn: function (){
  808. var self=this;
  809. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send(smalltalk.send((smalltalk.Object || Object), "_new", []), "_halt", []);}), (smalltalk.Error || Error)]);
  810. return self;}
  811. }),
  812. smalltalk.ObjectTest);
  813. smalltalk.addMethod(
  814. "_testIdentity",
  815. smalltalk.method({
  816. selector: "testIdentity",
  817. fn: function (){
  818. var self=this;
  819. var o=nil;
  820. (o=smalltalk.send((smalltalk.Object || Object), "_new", []));
  821. smalltalk.send(self, "_deny_", [smalltalk.send(o, "__eq_eq", [smalltalk.send((smalltalk.Object || Object), "_new", [])])]);
  822. smalltalk.send(self, "_assert_", [smalltalk.send(o, "__eq_eq", [o])]);
  823. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(o, "_yourself", []), "__eq_eq", [o])]);
  824. smalltalk.send(self, "_assert_", [smalltalk.send(o, "__eq_eq", [smalltalk.send(o, "_yourself", [])])]);
  825. return self;}
  826. }),
  827. smalltalk.ObjectTest);
  828. smalltalk.addMethod(
  829. "_testIfNil",
  830. smalltalk.method({
  831. selector: "testIfNil",
  832. fn: function (){
  833. var self=this;
  834. smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send((smalltalk.Object || Object), "_new", []), "_isNil", [])]);
  835. smalltalk.send(self, "_deny_", [smalltalk.send((($receiver = smalltalk.send((smalltalk.Object || Object), "_new", [])) == nil || $receiver == undefined) ? (function(){return true;})() : $receiver, "__eq", [true])]);
  836. smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = smalltalk.send((smalltalk.Object || Object), "_new", [])) != nil && $receiver != undefined) ? (function(){return true;})() : nil, "__eq", [true])]);
  837. smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = smalltalk.send((smalltalk.Object || Object), "_new", [])) == nil || $receiver == undefined) ? (function(){return false;})() : (function(){return true;})(), "__eq", [true])]);
  838. smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = smalltalk.send((smalltalk.Object || Object), "_new", [])) == nil || $receiver == undefined) ? (function(){return false;})() : (function(){return true;})(), "__eq", [true])]);
  839. return self;}
  840. }),
  841. smalltalk.ObjectTest);
  842. smalltalk.addMethod(
  843. "_testInstVars",
  844. smalltalk.method({
  845. selector: "testInstVars",
  846. fn: function (){
  847. var self=this;
  848. var o=nil;
  849. (o=smalltalk.send((smalltalk.ObjectMock || ObjectMock), "_new", []));
  850. smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_instVarAt_", [smalltalk.symbolFor("foo")]), nil]);
  851. smalltalk.send(o, "_instVarAt_put_", [smalltalk.symbolFor("foo"), (1)]);
  852. smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_instVarAt_", [smalltalk.symbolFor("foo")]), (1)]);
  853. smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_instVarAt_", ["foo"]), (1)]);
  854. return self;}
  855. }),
  856. smalltalk.ObjectTest);
  857. smalltalk.addMethod(
  858. "_testNilUndefined",
  859. smalltalk.method({
  860. selector: "testNilUndefined",
  861. fn: function (){
  862. var self=this;
  863. smalltalk.send(self, "_assert_", [smalltalk.send(nil, "__eq", [(typeof undefined == 'undefined' ? nil : undefined)])]);
  864. return self;}
  865. }),
  866. smalltalk.ObjectTest);
  867. smalltalk.addMethod(
  868. "_testYourself",
  869. smalltalk.method({
  870. selector: "testYourself",
  871. fn: function (){
  872. var self=this;
  873. var o=nil;
  874. (o=smalltalk.send((smalltalk.ObjectMock || ObjectMock), "_new", []));
  875. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(o, "_yourself", []), "__eq_eq", [o])]);
  876. return self;}
  877. }),
  878. smalltalk.ObjectTest);
  879. smalltalk.addMethod(
  880. "_testidentityHash",
  881. smalltalk.method({
  882. selector: "testidentityHash",
  883. fn: function (){
  884. var self=this;
  885. var o1=nil;
  886. var o2=nil;
  887. (o1=smalltalk.send((smalltalk.Object || Object), "_new", []));
  888. (o2=smalltalk.send((smalltalk.Object || Object), "_new", []));
  889. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(o1, "_identityHash", []), "__eq_eq", [smalltalk.send(o1, "_identityHash", [])])]);
  890. smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send(o1, "_identityHash", []), "__eq_eq", [smalltalk.send(o2, "_identityHash", [])])]);
  891. return self;}
  892. }),
  893. smalltalk.ObjectTest);
  894. smalltalk.addClass('PackageTest', smalltalk.TestCase, ['zorkPackage', 'grulPackage', 'backUpCommitPathJs', 'backUpCommitPathSt'], 'Kernel-Tests');
  895. smalltalk.addMethod(
  896. "_setUp",
  897. smalltalk.method({
  898. selector: "setUp",
  899. fn: function (){
  900. var self=this;
  901. (self['@backUpCommitPathJs']=smalltalk.send((smalltalk.Package || Package), "_defaultCommitPathJs", []));
  902. (self['@backUpCommitPathSt']=smalltalk.send((smalltalk.Package || Package), "_defaultCommitPathSt", []));
  903. smalltalk.send((smalltalk.Package || Package), "_resetCommitPaths", []);
  904. (self['@zorkPackage']=smalltalk.send(smalltalk.send((smalltalk.Package || Package), "_new", []), "_name_", ["Zork"]));
  905. (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", [])));
  906. return self;}
  907. }),
  908. smalltalk.PackageTest);
  909. smalltalk.addMethod(
  910. "_tearDown",
  911. smalltalk.method({
  912. selector: "tearDown",
  913. fn: function (){
  914. var self=this;
  915. (function($rec){smalltalk.send($rec, "_defaultCommitPathJs_", [self['@backUpCommitPathJs']]);return smalltalk.send($rec, "_defaultCommitPathSt_", [self['@backUpCommitPathSt']]);})((smalltalk.Package || Package));
  916. return self;}
  917. }),
  918. smalltalk.PackageTest);
  919. smalltalk.addMethod(
  920. "_testGrulCommitPathJsShouldBeServerGrulJs",
  921. smalltalk.method({
  922. selector: "testGrulCommitPathJsShouldBeServerGrulJs",
  923. fn: function (){
  924. var self=this;
  925. smalltalk.send(self, "_assert_equals_", ["server/grul/js", smalltalk.send(self['@grulPackage'], "_commitPathJs", [])]);
  926. return self;}
  927. }),
  928. smalltalk.PackageTest);
  929. smalltalk.addMethod(
  930. "_testGrulCommitPathStShouldBeGrulSt",
  931. smalltalk.method({
  932. selector: "testGrulCommitPathStShouldBeGrulSt",
  933. fn: function (){
  934. var self=this;
  935. smalltalk.send(self, "_assert_equals_", ["grul/st", smalltalk.send(self['@grulPackage'], "_commitPathSt", [])]);
  936. return self;}
  937. }),
  938. smalltalk.PackageTest);
  939. smalltalk.addMethod(
  940. "_testZorkCommitPathJsShouldBeJs",
  941. smalltalk.method({
  942. selector: "testZorkCommitPathJsShouldBeJs",
  943. fn: function (){
  944. var self=this;
  945. smalltalk.send(self, "_assert_equals_", ["js", smalltalk.send(self['@zorkPackage'], "_commitPathJs", [])]);
  946. return self;}
  947. }),
  948. smalltalk.PackageTest);
  949. smalltalk.addMethod(
  950. "_testZorkCommitPathStShouldBeSt",
  951. smalltalk.method({
  952. selector: "testZorkCommitPathStShouldBeSt",
  953. fn: function (){
  954. var self=this;
  955. smalltalk.send(self, "_assert_equals_", ["st", smalltalk.send(self['@zorkPackage'], "_commitPathSt", [])]);
  956. return self;}
  957. }),
  958. smalltalk.PackageTest);
  959. smalltalk.addClass('PackageWithDefaultCommitPathChangedTest', smalltalk.PackageTest, [], 'Kernel-Tests');
  960. smalltalk.addMethod(
  961. "_setUp",
  962. smalltalk.method({
  963. selector: "setUp",
  964. fn: function (){
  965. var self=this;
  966. smalltalk.send(self, "_setUp", [], smalltalk.PackageWithDefaultCommitPathChangedTest.superclass || nil);
  967. (function($rec){smalltalk.send($rec, "_defaultCommitPathJs_", ["javascripts/"]);return smalltalk.send($rec, "_defaultCommitPathSt_", ["smalltalk/"]);})((smalltalk.Package || Package));
  968. return self;}
  969. }),
  970. smalltalk.PackageWithDefaultCommitPathChangedTest);
  971. smalltalk.addMethod(
  972. "_testGrulCommitPathJsShouldBeServerGrulJs",
  973. smalltalk.method({
  974. selector: "testGrulCommitPathJsShouldBeServerGrulJs",
  975. fn: function (){
  976. var self=this;
  977. smalltalk.send(self, "_assert_equals_", ["server/grul/js", smalltalk.send(self['@grulPackage'], "_commitPathJs", [])]);
  978. return self;}
  979. }),
  980. smalltalk.PackageWithDefaultCommitPathChangedTest);
  981. smalltalk.addMethod(
  982. "_testGrulCommitPathStShouldBeGrulSt",
  983. smalltalk.method({
  984. selector: "testGrulCommitPathStShouldBeGrulSt",
  985. fn: function (){
  986. var self=this;
  987. smalltalk.send(self, "_assert_equals_", ["grul/st", smalltalk.send(self['@grulPackage'], "_commitPathSt", [])]);
  988. return self;}
  989. }),
  990. smalltalk.PackageWithDefaultCommitPathChangedTest);
  991. smalltalk.addMethod(
  992. "_testZorkCommitPathJsShouldBeJavascript",
  993. smalltalk.method({
  994. selector: "testZorkCommitPathJsShouldBeJavascript",
  995. fn: function (){
  996. var self=this;
  997. smalltalk.send(self, "_assert_equals_", ["javascripts/", smalltalk.send(self['@zorkPackage'], "_commitPathJs", [])]);
  998. return self;}
  999. }),
  1000. smalltalk.PackageWithDefaultCommitPathChangedTest);
  1001. smalltalk.addMethod(
  1002. "_testZorkCommitPathStShouldBeSmalltalk",
  1003. smalltalk.method({
  1004. selector: "testZorkCommitPathStShouldBeSmalltalk",
  1005. fn: function (){
  1006. var self=this;
  1007. smalltalk.send(self, "_assert_equals_", ["smalltalk/", smalltalk.send(self['@zorkPackage'], "_commitPathSt", [])]);
  1008. return self;}
  1009. }),
  1010. smalltalk.PackageWithDefaultCommitPathChangedTest);
  1011. smalltalk.addMethod(
  1012. "_shouldInheritSelectors",
  1013. smalltalk.method({
  1014. selector: "shouldInheritSelectors",
  1015. fn: function (){
  1016. var self=this;
  1017. return false;
  1018. return self;}
  1019. }),
  1020. smalltalk.PackageWithDefaultCommitPathChangedTest.klass);
  1021. smalltalk.addClass('PointTest', smalltalk.TestCase, [], 'Kernel-Tests');
  1022. smalltalk.addMethod(
  1023. "_testAccessing",
  1024. smalltalk.method({
  1025. selector: "testAccessing",
  1026. fn: function (){
  1027. var self=this;
  1028. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send((smalltalk.Point || Point), "_x_y_", [(3), (4)]), "_x", []), (3)]);
  1029. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send((smalltalk.Point || Point), "_x_y_", [(3), (4)]), "_y", []), (4)]);
  1030. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Point || Point), "_new", []), "_x_", [(3)]), "_x", []), (3)]);
  1031. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Point || Point), "_new", []), "_y_", [(4)]), "_y", []), (4)]);
  1032. return self;}
  1033. }),
  1034. smalltalk.PointTest);
  1035. smalltalk.addMethod(
  1036. "_testArithmetic",
  1037. smalltalk.method({
  1038. selector: "testArithmetic",
  1039. fn: function (){
  1040. var self=this;
  1041. 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)])]);
  1042. 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)])]);
  1043. 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)])]);
  1044. 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)])]);
  1045. return self;}
  1046. }),
  1047. smalltalk.PointTest);
  1048. smalltalk.addMethod(
  1049. "_testAt",
  1050. smalltalk.method({
  1051. selector: "testAt",
  1052. fn: function (){
  1053. var self=this;
  1054. smalltalk.send(self, "_assert_equals_", [smalltalk.send((3), "__at", [(4)]), smalltalk.send((smalltalk.Point || Point), "_x_y_", [(3), (4)])]);
  1055. return self;}
  1056. }),
  1057. smalltalk.PointTest);
  1058. smalltalk.addMethod(
  1059. "_testEgality",
  1060. smalltalk.method({
  1061. selector: "testEgality",
  1062. fn: function (){
  1063. var self=this;
  1064. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3), "__at", [(4)]), "__eq", [smalltalk.send((3), "__at", [(4)])])]);
  1065. smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send((3), "__at", [(5)]), "__eq", [smalltalk.send((3), "__at", [(6)])])]);
  1066. return self;}
  1067. }),
  1068. smalltalk.PointTest);
  1069. smalltalk.addMethod(
  1070. "_testTranslateBy",
  1071. smalltalk.method({
  1072. selector: "testTranslateBy",
  1073. fn: function (){
  1074. var self=this;
  1075. smalltalk.send(self, "_assert_equals_", [smalltalk.send((3), "__at", [(4)]), smalltalk.send(smalltalk.send((3), "__at", [(3)]), "_translateBy_", [smalltalk.send((0), "__at", [(1)])])]);
  1076. 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", [])])])]);
  1077. smalltalk.send(self, "_assert_equals_", [smalltalk.send((5), "__at", [(6)]), smalltalk.send(smalltalk.send((3), "__at", [(3)]), "_translateBy_", [smalltalk.send((2), "__at", [(3)])])]);
  1078. 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)])])]);
  1079. return self;}
  1080. }),
  1081. smalltalk.PointTest);
  1082. smalltalk.addClass('RandomTest', smalltalk.TestCase, [], 'Kernel-Tests');
  1083. smalltalk.addMethod(
  1084. "_textNext",
  1085. smalltalk.method({
  1086. selector: "textNext",
  1087. fn: function (){
  1088. var self=this;
  1089. smalltalk.send((10000), "_timesRepeat_", [(function(){var current=nil;
  1090. var next=nil;
  1091. (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]);})]);
  1092. return self;}
  1093. }),
  1094. smalltalk.RandomTest);
  1095. smalltalk.addClass('SetTest', smalltalk.TestCase, [], 'Kernel-Tests');
  1096. smalltalk.addMethod(
  1097. "_testAddRemove",
  1098. smalltalk.method({
  1099. selector: "testAddRemove",
  1100. fn: function (){
  1101. var self=this;
  1102. var set=nil;
  1103. (set=smalltalk.send((smalltalk.Set || Set), "_new", []));
  1104. smalltalk.send(self, "_assert_", [smalltalk.send(set, "_isEmpty", [])]);
  1105. smalltalk.send(set, "_add_", [(3)]);
  1106. smalltalk.send(self, "_assert_", [smalltalk.send(set, "_includes_", [(3)])]);
  1107. smalltalk.send(set, "_add_", [(5)]);
  1108. smalltalk.send(self, "_assert_", [smalltalk.send(set, "_includes_", [(5)])]);
  1109. smalltalk.send(set, "_remove_", [(3)]);
  1110. smalltalk.send(self, "_deny_", [smalltalk.send(set, "_includes_", [(3)])]);
  1111. return self;}
  1112. }),
  1113. smalltalk.SetTest);
  1114. smalltalk.addMethod(
  1115. "_testAt",
  1116. smalltalk.method({
  1117. selector: "testAt",
  1118. fn: function (){
  1119. var self=this;
  1120. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send(smalltalk.send((smalltalk.Set || Set), "_new", []), "_at_put_", [(1), (2)]);}), (smalltalk.Error || Error)]);
  1121. return self;}
  1122. }),
  1123. smalltalk.SetTest);
  1124. smalltalk.addMethod(
  1125. "_testPrintString",
  1126. smalltalk.method({
  1127. selector: "testPrintString",
  1128. fn: function (){
  1129. var self=this;
  1130. var set=nil;
  1131. (set=smalltalk.send((smalltalk.Set || Set), "_new", []));
  1132. smalltalk.send(self, "_assert_equals_", ["a Set ()", smalltalk.send(set, "_printString", [])]);
  1133. (function($rec){smalltalk.send($rec, "_add_", [(1)]);return smalltalk.send($rec, "_add_", [(3)]);})(set);
  1134. smalltalk.send(self, "_assert_equals_", ["a Set (1 3)", smalltalk.send(set, "_printString", [])]);
  1135. smalltalk.send(set, "_add_", ["foo"]);
  1136. smalltalk.send(self, "_assert_equals_", ["a Set (1 3 'foo')", smalltalk.send(set, "_printString", [])]);
  1137. (function($rec){smalltalk.send($rec, "_remove_", [(1)]);return smalltalk.send($rec, "_remove_", [(3)]);})(set);
  1138. smalltalk.send(self, "_assert_equals_", ["a Set ('foo')", smalltalk.send(set, "_printString", [])]);
  1139. smalltalk.send(set, "_add_", [(3)]);
  1140. smalltalk.send(self, "_assert_equals_", ["a Set ('foo' 3)", smalltalk.send(set, "_printString", [])]);
  1141. smalltalk.send(set, "_add_", [(3)]);
  1142. smalltalk.send(self, "_assert_equals_", ["a Set ('foo' 3)", smalltalk.send(set, "_printString", [])]);
  1143. return self;}
  1144. }),
  1145. smalltalk.SetTest);
  1146. smalltalk.addMethod(
  1147. "_testSize",
  1148. smalltalk.method({
  1149. selector: "testSize",
  1150. fn: function (){
  1151. var self=this;
  1152. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send((smalltalk.Set || Set), "_new", []), "_size", []), (0)]);
  1153. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send((smalltalk.Set || Set), "_withAll_", [[(1), (2), (3), (4)]]), "_size", []), (4)]);
  1154. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send((smalltalk.Set || Set), "_withAll_", [[(1), (1), (1), (1)]]), "_size", []), (1)]);
  1155. return self;}
  1156. }),
  1157. smalltalk.SetTest);
  1158. smalltalk.addMethod(
  1159. "_testUnicity",
  1160. smalltalk.method({
  1161. selector: "testUnicity",
  1162. fn: function (){
  1163. var self=this;
  1164. var set=nil;
  1165. (set=smalltalk.send((smalltalk.Set || Set), "_new", []));
  1166. smalltalk.send(set, "_add_", [(21)]);
  1167. smalltalk.send(set, "_add_", ["hello"]);
  1168. smalltalk.send(set, "_add_", [(21)]);
  1169. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(set, "_size", []), "__eq", [(2)])]);
  1170. smalltalk.send(set, "_add_", ["hello"]);
  1171. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(set, "_size", []), "__eq", [(2)])]);
  1172. smalltalk.send(self, "_assert_equals_", [smalltalk.send(set, "_asArray", []), [(21), "hello"]]);
  1173. return self;}
  1174. }),
  1175. smalltalk.SetTest);
  1176. smalltalk.addClass('StringTest', smalltalk.TestCase, [], 'Kernel-Tests');
  1177. smalltalk.addMethod(
  1178. "_testAddRemove",
  1179. smalltalk.method({
  1180. selector: "testAddRemove",
  1181. fn: function (){
  1182. var self=this;
  1183. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send("hello", "_add_", ["a"]);}), (smalltalk.Error || Error)]);
  1184. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send("hello", "_remove_", ["h"]);}), (smalltalk.Error || Error)]);
  1185. return self;}
  1186. }),
  1187. smalltalk.StringTest);
  1188. smalltalk.addMethod(
  1189. "_testAsArray",
  1190. smalltalk.method({
  1191. selector: "testAsArray",
  1192. fn: function (){
  1193. var self=this;
  1194. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send("hello", "_asArray", []), "__eq", [["h", "e", "l", "l", "o"]])]);
  1195. return self;}
  1196. }),
  1197. smalltalk.StringTest);
  1198. smalltalk.addMethod(
  1199. "_testAt",
  1200. smalltalk.method({
  1201. selector: "testAt",
  1202. fn: function (){
  1203. var self=this;
  1204. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send("hello", "_at_", [(1)]), "__eq", ["h"])]);
  1205. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send("hello", "_at_", [(5)]), "__eq", ["o"])]);
  1206. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send("hello", "_at_ifAbsent_", [(6), (function(){return nil;})]), "__eq", [nil])]);
  1207. return self;}
  1208. }),
  1209. smalltalk.StringTest);
  1210. smalltalk.addMethod(
  1211. "_testAtPut",
  1212. smalltalk.method({
  1213. selector: "testAtPut",
  1214. fn: function (){
  1215. var self=this;
  1216. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send("hello", "_at_put_", [(1), "a"]);}), (smalltalk.Error || Error)]);
  1217. return self;}
  1218. }),
  1219. smalltalk.StringTest);
  1220. smalltalk.addMethod(
  1221. "_testCopyWithoutAll",
  1222. smalltalk.method({
  1223. selector: "testCopyWithoutAll",
  1224. fn: function (){
  1225. var self=this;
  1226. smalltalk.send(self, "_assert_equals_", ["hello world", smalltalk.send("*hello* *world*", "_copyWithoutAll_", ["*"])]);
  1227. return self;}
  1228. }),
  1229. smalltalk.StringTest);
  1230. smalltalk.addMethod(
  1231. "_testEquality",
  1232. smalltalk.method({
  1233. selector: "testEquality",
  1234. fn: function (){
  1235. var self=this;
  1236. smalltalk.send(self, "_assert_", [smalltalk.send("hello", "__eq", ["hello"])]);
  1237. smalltalk.send(self, "_deny_", [smalltalk.send("hello", "__eq", ["world"])]);
  1238. smalltalk.send(self, "_assert_", [smalltalk.send("hello", "__eq", [smalltalk.send("hello", "_yourself", [])])]);
  1239. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send("hello", "_yourself", []), "__eq", ["hello"])]);
  1240. smalltalk.send(self, "_deny_", [smalltalk.send("", "__eq", [(0)])]);
  1241. return self;}
  1242. }),
  1243. smalltalk.StringTest);
  1244. smalltalk.addMethod(
  1245. "_testIdentity",
  1246. smalltalk.method({
  1247. selector: "testIdentity",
  1248. fn: function (){
  1249. var self=this;
  1250. smalltalk.send(self, "_assert_", [smalltalk.send("hello", "__eq_eq", ["hello"])]);
  1251. smalltalk.send(self, "_deny_", [smalltalk.send("hello", "__eq_eq", ["world"])]);
  1252. smalltalk.send(self, "_assert_", [smalltalk.send("hello", "__eq_eq", [smalltalk.send("hello", "_yourself", [])])]);
  1253. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send("hello", "_yourself", []), "__eq_eq", ["hello"])]);
  1254. smalltalk.send(self, "_deny_", [smalltalk.send("", "__eq_eq", [(0)])]);
  1255. return self;}
  1256. }),
  1257. smalltalk.StringTest);
  1258. smalltalk.addMethod(
  1259. "_testIncludesSubString",
  1260. smalltalk.method({
  1261. selector: "testIncludesSubString",
  1262. fn: function (){
  1263. var self=this;
  1264. smalltalk.send(self, "_assert_", [smalltalk.send("amber", "_includesSubString_", ["ber"])]);
  1265. smalltalk.send(self, "_deny_", [smalltalk.send("amber", "_includesSubString_", ["zork"])]);
  1266. return self;}
  1267. }),
  1268. smalltalk.StringTest);
  1269. smalltalk.addMethod(
  1270. "_testJoin",
  1271. smalltalk.method({
  1272. selector: "testJoin",
  1273. fn: function (){
  1274. var self=this;
  1275. smalltalk.send(self, "_assert_equals_", ["hello,world", smalltalk.send(",", "_join_", [["hello", "world"]])]);
  1276. return self;}
  1277. }),
  1278. smalltalk.StringTest);
  1279. smalltalk.addMethod(
  1280. "_testSize",
  1281. smalltalk.method({
  1282. selector: "testSize",
  1283. fn: function (){
  1284. var self=this;
  1285. smalltalk.send(self, "_assert_equals_", [smalltalk.send("smalltalk", "_size", []), (9)]);
  1286. smalltalk.send(self, "_assert_equals_", [smalltalk.send("", "_size", []), (0)]);
  1287. return self;}
  1288. }),
  1289. smalltalk.StringTest);
  1290. smalltalk.addMethod(
  1291. "_testStreamContents",
  1292. smalltalk.method({
  1293. selector: "testStreamContents",
  1294. fn: function (){
  1295. var self=this;
  1296. 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);})])]);
  1297. return self;}
  1298. }),
  1299. smalltalk.StringTest);
  1300. smalltalk.addClass('SymbolTest', smalltalk.TestCase, [], 'Kernel-Tests');
  1301. smalltalk.addMethod(
  1302. "_testAsString",
  1303. smalltalk.method({
  1304. selector: "testAsString",
  1305. fn: function (){
  1306. var self=this;
  1307. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.symbolFor("hello"), "_asString", []), "hello"]);
  1308. return self;}
  1309. }),
  1310. smalltalk.SymbolTest);
  1311. smalltalk.addMethod(
  1312. "_testAsSymbol",
  1313. smalltalk.method({
  1314. selector: "testAsSymbol",
  1315. fn: function (){
  1316. var self=this;
  1317. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq_eq", [smalltalk.send(smalltalk.symbolFor("hello"), "_asSymbol", [])])]);
  1318. return self;}
  1319. }),
  1320. smalltalk.SymbolTest);
  1321. smalltalk.addMethod(
  1322. "_testAt",
  1323. smalltalk.method({
  1324. selector: "testAt",
  1325. fn: function (){
  1326. var self=this;
  1327. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_at_", [(1)]), "__eq", ["h"])]);
  1328. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_at_", [(5)]), "__eq", ["o"])]);
  1329. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_at_ifAbsent_", [(6), (function(){return nil;})]), "__eq", [nil])]);
  1330. return self;}
  1331. }),
  1332. smalltalk.SymbolTest);
  1333. smalltalk.addMethod(
  1334. "_testAtPut",
  1335. smalltalk.method({
  1336. selector: "testAtPut",
  1337. fn: function (){
  1338. var self=this;
  1339. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send("hello", "_at_put_", [(1), "a"]);}), (smalltalk.Error || Error)]);
  1340. return self;}
  1341. }),
  1342. smalltalk.SymbolTest);
  1343. smalltalk.addMethod(
  1344. "_testComparing",
  1345. smalltalk.method({
  1346. selector: "testComparing",
  1347. fn: function (){
  1348. var self=this;
  1349. smalltalk.send(self, "_assert_", [((($receiver = smalltalk.symbolFor("ab")).klass === smalltalk.Number) ? $receiver >smalltalk.symbolFor("aa") : smalltalk.send($receiver, "__gt", [smalltalk.symbolFor("aa")]))]);
  1350. smalltalk.send(self, "_deny_", [((($receiver = smalltalk.symbolFor("ab")).klass === smalltalk.Number) ? $receiver >smalltalk.symbolFor("ba") : smalltalk.send($receiver, "__gt", [smalltalk.symbolFor("ba")]))]);
  1351. smalltalk.send(self, "_assert_", [((($receiver = smalltalk.symbolFor("ab")).klass === smalltalk.Number) ? $receiver <smalltalk.symbolFor("ba") : smalltalk.send($receiver, "__lt", [smalltalk.symbolFor("ba")]))]);
  1352. smalltalk.send(self, "_deny_", [((($receiver = smalltalk.symbolFor("bb")).klass === smalltalk.Number) ? $receiver <smalltalk.symbolFor("ba") : smalltalk.send($receiver, "__lt", [smalltalk.symbolFor("ba")]))]);
  1353. smalltalk.send(self, "_assert_", [((($receiver = smalltalk.symbolFor("ab")).klass === smalltalk.Number) ? $receiver >=smalltalk.symbolFor("aa") : smalltalk.send($receiver, "__gt_eq", [smalltalk.symbolFor("aa")]))]);
  1354. smalltalk.send(self, "_deny_", [((($receiver = smalltalk.symbolFor("ab")).klass === smalltalk.Number) ? $receiver >=smalltalk.symbolFor("ba") : smalltalk.send($receiver, "__gt_eq", [smalltalk.symbolFor("ba")]))]);
  1355. smalltalk.send(self, "_assert_", [((($receiver = smalltalk.symbolFor("ab")).klass === smalltalk.Number) ? $receiver <=smalltalk.symbolFor("ba") : smalltalk.send($receiver, "__lt_eq", [smalltalk.symbolFor("ba")]))]);
  1356. smalltalk.send(self, "_deny_", [((($receiver = smalltalk.symbolFor("bb")).klass === smalltalk.Number) ? $receiver <=smalltalk.symbolFor("ba") : smalltalk.send($receiver, "__lt_eq", [smalltalk.symbolFor("ba")]))]);
  1357. return self;}
  1358. }),
  1359. smalltalk.SymbolTest);
  1360. smalltalk.addMethod(
  1361. "_testCopying",
  1362. smalltalk.method({
  1363. selector: "testCopying",
  1364. fn: function (){
  1365. var self=this;
  1366. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_copy", []), "__eq_eq", [smalltalk.symbolFor("hello")])]);
  1367. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_deepCopy", []), "__eq_eq", [smalltalk.symbolFor("hello")])]);
  1368. return self;}
  1369. }),
  1370. smalltalk.SymbolTest);
  1371. smalltalk.addMethod(
  1372. "_testEquality",
  1373. smalltalk.method({
  1374. selector: "testEquality",
  1375. fn: function (){
  1376. var self=this;
  1377. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq", [smalltalk.symbolFor("hello")])]);
  1378. smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq", [smalltalk.symbolFor("world")])]);
  1379. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq", [smalltalk.send(smalltalk.symbolFor("hello"), "_yourself", [])])]);
  1380. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_yourself", []), "__eq", [smalltalk.symbolFor("hello")])]);
  1381. smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq", ["hello"])]);
  1382. smalltalk.send(self, "_deny_", [smalltalk.send("hello", "__eq", [smalltalk.symbolFor("hello")])]);
  1383. return self;}
  1384. }),
  1385. smalltalk.SymbolTest);
  1386. smalltalk.addMethod(
  1387. "_testIdentity",
  1388. smalltalk.method({
  1389. selector: "testIdentity",
  1390. fn: function (){
  1391. var self=this;
  1392. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq_eq", [smalltalk.symbolFor("hello")])]);
  1393. smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq_eq", [smalltalk.symbolFor("world")])]);
  1394. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq", [smalltalk.send(smalltalk.symbolFor("hello"), "_yourself", [])])]);
  1395. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_yourself", []), "__eq", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_asString", []), "_asSymbol", [])])]);
  1396. return self;}
  1397. }),
  1398. smalltalk.SymbolTest);
  1399. smalltalk.addMethod(
  1400. "_testIsSymbolIsString",
  1401. smalltalk.method({
  1402. selector: "testIsSymbolIsString",
  1403. fn: function (){
  1404. var self=this;
  1405. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.symbolFor("hello"), "_isSymbol", [])]);
  1406. smalltalk.send(self, "_deny_", [smalltalk.send("hello", "_isSymbol", [])]);
  1407. smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.symbolFor("hello"), "_isString", [])]);
  1408. smalltalk.send(self, "_assert_", [smalltalk.send("hello", "_isString", [])]);
  1409. return self;}
  1410. }),
  1411. smalltalk.SymbolTest);
  1412. smalltalk.addMethod(
  1413. "_testSize",
  1414. smalltalk.method({
  1415. selector: "testSize",
  1416. fn: function (){
  1417. var self=this;
  1418. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.symbolFor("a"), "_size", []), (1)]);
  1419. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.symbolFor("aaaaa"), "_size", []), (5)]);
  1420. return self;}
  1421. }),
  1422. smalltalk.SymbolTest);
  1423. smalltalk.addClass('UndefinedTest', smalltalk.TestCase, [], 'Kernel-Tests');
  1424. smalltalk.addMethod(
  1425. "_testCopying",
  1426. smalltalk.method({
  1427. selector: "testCopying",
  1428. fn: function (){
  1429. var self=this;
  1430. smalltalk.send(self, "_assert_equals_", [smalltalk.send(nil, "_copy", []), nil]);
  1431. return self;}
  1432. }),
  1433. smalltalk.UndefinedTest);
  1434. smalltalk.addMethod(
  1435. "_testDeepCopy",
  1436. smalltalk.method({
  1437. selector: "testDeepCopy",
  1438. fn: function (){
  1439. var self=this;
  1440. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(nil, "_deepCopy", []), "__eq", [nil])]);
  1441. return self;}
  1442. }),
  1443. smalltalk.UndefinedTest);
  1444. smalltalk.addMethod(
  1445. "_testIfNil",
  1446. smalltalk.method({
  1447. selector: "testIfNil",
  1448. fn: function (){
  1449. var self=this;
  1450. smalltalk.send(self, "_assert_equals_", [(($receiver = nil) == nil || $receiver == undefined) ? (function(){return true;})() : $receiver, true]);
  1451. smalltalk.send(self, "_deny_", [smalltalk.send((($receiver = nil) != nil && $receiver != undefined) ? (function(){return true;})() : nil, "__eq", [true])]);
  1452. smalltalk.send(self, "_assert_equals_", [(($receiver = nil) == nil || $receiver == undefined) ? (function(){return true;})() : (function(){return false;})(), true]);
  1453. smalltalk.send(self, "_deny_", [smalltalk.send((($receiver = nil) == nil || $receiver == undefined) ? (function(){return false;})() : (function(){return true;})(), "__eq", [true])]);
  1454. return self;}
  1455. }),
  1456. smalltalk.UndefinedTest);
  1457. smalltalk.addMethod(
  1458. "_testIsNil",
  1459. smalltalk.method({
  1460. selector: "testIsNil",
  1461. fn: function (){
  1462. var self=this;
  1463. smalltalk.send(self, "_assert_", [smalltalk.send(nil, "_isNil", [])]);
  1464. smalltalk.send(self, "_deny_", [smalltalk.send(nil, "_notNil", [])]);
  1465. return self;}
  1466. }),
  1467. smalltalk.UndefinedTest);