2
0

Kernel-Tests.js 102 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929
  1. smalltalk.addPackage('Kernel-Tests', {});
  2. smalltalk.addClass('StringTest', smalltalk.TestCase, [], 'Kernel-Tests');
  3. smalltalk.addMethod(
  4. unescape('_testJoin'),
  5. smalltalk.method({
  6. selector: unescape('testJoin'),
  7. category: 'tests',
  8. fn: function (){
  9. var self=this;
  10. smalltalk.send(self, "_assert_equals_", [unescape("hello%2Cworld"), smalltalk.send(unescape("%2C"), "_join_", [["hello", "world"]])]);
  11. return self;},
  12. args: [],
  13. source: unescape('testJoin%0A%09self%20assert%3A%20%27hello%2Cworld%27%20equals%3A%20%28%27%2C%27%20join%3A%20%23%28%27hello%27%20%27world%27%29%29'),
  14. messageSends: ["assert:equals:", "join:"],
  15. referencedClasses: []
  16. }),
  17. smalltalk.StringTest);
  18. smalltalk.addMethod(
  19. unescape('_testStreamContents'),
  20. smalltalk.method({
  21. selector: unescape('testStreamContents'),
  22. category: 'tests',
  23. fn: function (){
  24. var self=this;
  25. 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);})])]);
  26. return self;},
  27. args: [],
  28. source: unescape('testStreamContents%0A%09self%20%0A%09%09assert%3A%20%27hello%20world%27%20%0A%09%09equals%3A%20%28String%20streamContents%3A%20%5B%3AaStream%7C%20aStream%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09%09%09%09%09nextPutAll%3A%20%27hello%27%3B%20space%3B%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09%09%09%09%09nextPutAll%3A%20%27world%27%5D%29'),
  29. messageSends: ["assert:equals:", "streamContents:", "nextPutAll:", "space"],
  30. referencedClasses: ["String"]
  31. }),
  32. smalltalk.StringTest);
  33. smalltalk.addMethod(
  34. unescape('_testIncludesSubString'),
  35. smalltalk.method({
  36. selector: unescape('testIncludesSubString'),
  37. category: 'tests',
  38. fn: function (){
  39. var self=this;
  40. smalltalk.send(self, "_assert_", [smalltalk.send("amber", "_includesSubString_", ["ber"])]);
  41. smalltalk.send(self, "_deny_", [smalltalk.send("amber", "_includesSubString_", ["zork"])]);
  42. return self;},
  43. args: [],
  44. source: unescape('testIncludesSubString%0A%09self%20assert%3A%20%28%27amber%27%20includesSubString%3A%20%27ber%27%29.%0A%09self%20deny%3A%20%28%27amber%27%20includesSubString%3A%20%27zork%27%29.'),
  45. messageSends: ["assert:", "includesSubString:", "deny:"],
  46. referencedClasses: []
  47. }),
  48. smalltalk.StringTest);
  49. smalltalk.addMethod(
  50. unescape('_testEquality'),
  51. smalltalk.method({
  52. selector: unescape('testEquality'),
  53. category: 'tests',
  54. fn: function (){
  55. var self=this;
  56. smalltalk.send(self, "_assert_", [smalltalk.send("hello", "__eq", ["hello"])]);
  57. smalltalk.send(self, "_deny_", [smalltalk.send("hello", "__eq", ["world"])]);
  58. smalltalk.send(self, "_assert_", [smalltalk.send("hello", "__eq", [smalltalk.send("hello", "_yourself", [])])]);
  59. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send("hello", "_yourself", []), "__eq", ["hello"])]);
  60. smalltalk.send(self, "_deny_", [smalltalk.send("", "__eq", [(0)])]);
  61. return self;},
  62. args: [],
  63. source: unescape('testEquality%0A%09self%20assert%3A%20%27hello%27%20%3D%20%27hello%27.%0A%09self%20deny%3A%20%27hello%27%20%3D%20%27world%27.%0A%0A%09self%20assert%3A%20%27hello%27%20%20%3D%20%27hello%27%20yourself.%0A%09self%20assert%3A%20%27hello%27%20yourself%20%3D%20%27hello%27.%0A%0A%09%22test%20JS%20falsy%20value%22%0A%09self%20deny%3A%20%27%27%20%3D%200'),
  64. messageSends: ["assert:", unescape("%3D"), "deny:", "yourself"],
  65. referencedClasses: []
  66. }),
  67. smalltalk.StringTest);
  68. smalltalk.addMethod(
  69. unescape('_testCopyWithoutAll'),
  70. smalltalk.method({
  71. selector: unescape('testCopyWithoutAll'),
  72. category: 'tests',
  73. fn: function (){
  74. var self=this;
  75. smalltalk.send(self, "_assert_equals_", ["hello world", smalltalk.send(unescape("*hello*%20*world*"), "_copyWithoutAll_", [unescape("*")])]);
  76. return self;},
  77. args: [],
  78. source: unescape('testCopyWithoutAll%0A%09self%20%0A%09%09assert%3A%20%27hello%20world%27%20%0A%09%09equals%3A%20%28%27*hello*%20*world*%27%20copyWithoutAll%3A%20%27*%27%29'),
  79. messageSends: ["assert:equals:", "copyWithoutAll:"],
  80. referencedClasses: []
  81. }),
  82. smalltalk.StringTest);
  83. smalltalk.addMethod(
  84. unescape('_testAt'),
  85. smalltalk.method({
  86. selector: unescape('testAt'),
  87. category: 'tests',
  88. fn: function (){
  89. var self=this;
  90. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send("hello", "_at_", [(1)]), "__eq", ["h"])]);
  91. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send("hello", "_at_", [(5)]), "__eq", ["o"])]);
  92. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send("hello", "_at_ifAbsent_", [(6), (function(){return nil;})]), "__eq", [nil])]);
  93. return self;},
  94. args: [],
  95. source: unescape('testAt%0A%09self%20assert%3A%20%28%27hello%27%20at%3A%201%29%20%3D%20%27h%27.%0A%09self%20assert%3A%20%28%27hello%27%20at%3A%205%29%20%3D%20%27o%27.%0A%09self%20assert%3A%20%28%27hello%27%20at%3A%206%20ifAbsent%3A%20%5Bnil%5D%29%20%3D%20nil'),
  96. messageSends: ["assert:", unescape("%3D"), "at:", "at:ifAbsent:"],
  97. referencedClasses: []
  98. }),
  99. smalltalk.StringTest);
  100. smalltalk.addMethod(
  101. unescape('_testAtPut'),
  102. smalltalk.method({
  103. selector: unescape('testAtPut'),
  104. category: 'tests',
  105. fn: function (){
  106. var self=this;
  107. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send("hello", "_at_put_", [(1), "a"]);}), (smalltalk.Error || Error)]);
  108. return self;},
  109. args: [],
  110. source: unescape('testAtPut%0A%09%22String%20instances%20are%20read-only%22%0A%09self%20should%3A%20%5B%27hello%27%20at%3A%201%20put%3A%20%27a%27%5D%20raise%3A%20Error'),
  111. messageSends: ["should:raise:", "at:put:"],
  112. referencedClasses: ["Error"]
  113. }),
  114. smalltalk.StringTest);
  115. smalltalk.addMethod(
  116. unescape('_testSize'),
  117. smalltalk.method({
  118. selector: unescape('testSize'),
  119. category: 'tests',
  120. fn: function (){
  121. var self=this;
  122. smalltalk.send(self, "_assert_equals_", [smalltalk.send("smalltalk", "_size", []), (9)]);
  123. smalltalk.send(self, "_assert_equals_", [smalltalk.send("", "_size", []), (0)]);
  124. return self;},
  125. args: [],
  126. source: unescape('testSize%0A%09self%20assert%3A%20%27smalltalk%27%20size%20equals%3A%209.%0A%09self%20assert%3A%20%27%27%20size%20equals%3A%200'),
  127. messageSends: ["assert:equals:", "size"],
  128. referencedClasses: []
  129. }),
  130. smalltalk.StringTest);
  131. smalltalk.addMethod(
  132. unescape('_testAddRemove'),
  133. smalltalk.method({
  134. selector: unescape('testAddRemove'),
  135. category: 'tests',
  136. fn: function (){
  137. var self=this;
  138. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send("hello", "_add_", ["a"]);}), (smalltalk.Error || Error)]);
  139. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send("hello", "_remove_", ["h"]);}), (smalltalk.Error || Error)]);
  140. return self;},
  141. args: [],
  142. source: unescape('testAddRemove%0A%09self%20should%3A%20%5B%27hello%27%20add%3A%20%27a%27%5D%20raise%3A%20Error.%0A%09self%20should%3A%20%5B%27hello%27%20remove%3A%20%27h%27%5D%20raise%3A%20Error'),
  143. messageSends: ["should:raise:", "add:", "remove:"],
  144. referencedClasses: ["Error"]
  145. }),
  146. smalltalk.StringTest);
  147. smalltalk.addClass('DictionaryTest', smalltalk.TestCase, [], 'Kernel-Tests');
  148. smalltalk.addMethod(
  149. unescape('_testPrintString'),
  150. smalltalk.method({
  151. selector: unescape('testPrintString'),
  152. category: 'tests',
  153. fn: function (){
  154. var self=this;
  155. smalltalk.send(self, "_assert_equals_", [unescape("a%20Dictionary%28%27firstname%27%20-%3E%20%27James%27%20%2C%20%27lastname%27%20-%3E%20%27Bond%27%29"), (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", []))]);
  156. return self;},
  157. args: [],
  158. source: unescape('testPrintString%0A%09self%0A%09%09assert%3A%20%27a%20Dictionary%28%27%27firstname%27%27%20-%3E%20%27%27James%27%27%20%2C%20%27%27lastname%27%27%20-%3E%20%27%27Bond%27%27%29%27%20%0A%09%09equals%3A%20%28Dictionary%20new%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09at%3A%27firstname%27%20put%3A%20%27James%27%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09at%3A%27lastname%27%20put%3A%20%27Bond%27%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09printString%29'),
  159. messageSends: ["assert:equals:", "at:put:", "printString", "new"],
  160. referencedClasses: ["Dictionary"]
  161. }),
  162. smalltalk.DictionaryTest);
  163. smalltalk.addMethod(
  164. unescape('_testEquality'),
  165. smalltalk.method({
  166. selector: unescape('testEquality'),
  167. category: 'tests',
  168. fn: function (){
  169. var self=this;
  170. var d1=nil;
  171. var d2=nil;
  172. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []), "__eq", [smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", [])])]);
  173. (d1=(function($rec){smalltalk.send($rec, "_at_put_", [(1), (2)]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", [])));
  174. (d2=(function($rec){smalltalk.send($rec, "_at_put_", [(1), (2)]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", [])));
  175. smalltalk.send(self, "_assert_", [smalltalk.send(d1, "__eq", [d2])]);
  176. (d2=(function($rec){smalltalk.send($rec, "_at_put_", [(1), (3)]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", [])));
  177. smalltalk.send(self, "_deny_", [smalltalk.send(d1, "__eq", [d2])]);
  178. (d2=(function($rec){smalltalk.send($rec, "_at_put_", [(2), (2)]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", [])));
  179. smalltalk.send(self, "_deny_", [smalltalk.send(d1, "__eq", [d2])]);
  180. (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", [])));
  181. smalltalk.send(self, "_deny_", [smalltalk.send(d1, "__eq", [d2])]);
  182. return self;},
  183. args: [],
  184. source: unescape('testEquality%0A%09%7C%20d1%20d2%20%7C%0A%0A%09self%20assert%3A%20Dictionary%20new%20%3D%20Dictionary%20new.%0A%09%09%0A%09d1%20%3A%3D%20Dictionary%20new%20at%3A%201%20put%3A%202%3B%20yourself.%0A%09d2%20%3A%3D%20Dictionary%20new%20at%3A%201%20put%3A%202%3B%20yourself.%0A%09self%20assert%3A%20d1%20%3D%20d2.%0A%0A%09d2%20%3A%3D%20Dictionary%20new%20at%3A%201%20put%3A%203%3B%20yourself.%0A%09self%20deny%3A%20d1%20%3D%20d2.%0A%0A%09d2%20%3A%3D%20Dictionary%20new%20at%3A%202%20put%3A%202%3B%20yourself.%0A%09self%20deny%3A%20d1%20%3D%20d2.%0A%0A%09d2%20%3A%3D%20Dictionary%20new%20at%3A%201%20put%3A%202%3B%20at%3A%203%20put%3A%204%3B%20yourself.%0A%09self%20deny%3A%20d1%20%3D%20d2.'),
  185. messageSends: ["assert:", unescape("%3D"), "new", "at:put:", "yourself", "deny:"],
  186. referencedClasses: ["Dictionary"]
  187. }),
  188. smalltalk.DictionaryTest);
  189. smalltalk.addMethod(
  190. unescape('_testDynamicDictionaries'),
  191. smalltalk.method({
  192. selector: unescape('testDynamicDictionaries'),
  193. category: 'tests',
  194. fn: function (){
  195. var self=this;
  196. 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)])])])]);
  197. return self;},
  198. args: [],
  199. source: unescape('testDynamicDictionaries%0A%09self%20assert%3A%20%23%7B%27hello%27%20-%3E%201%7D%20asDictionary%20%3D%20%28Dictionary%20with%3A%20%27hello%27%20-%3E%201%29'),
  200. messageSends: ["assert:", unescape("%3D"), "asDictionary", unescape("-%3E"), "with:"],
  201. referencedClasses: ["Dictionary"]
  202. }),
  203. smalltalk.DictionaryTest);
  204. smalltalk.addMethod(
  205. unescape('_testAccessing'),
  206. smalltalk.method({
  207. selector: unescape('testAccessing'),
  208. category: 'tests',
  209. fn: function (){
  210. var self=this;
  211. var d=nil;
  212. (d=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
  213. smalltalk.send(d, "_at_put_", ["hello", "world"]);
  214. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_at_", ["hello"]), "__eq", ["world"])]);
  215. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_at_ifAbsent_", ["hello", (function(){return nil;})]), "__eq", ["world"])]);
  216. smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send(d, "_at_ifAbsent_", ["foo", (function(){return nil;})]), "__eq", ["world"])]);
  217. smalltalk.send(d, "_at_put_", [(1), (2)]);
  218. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_at_", [(1)]), "__eq", [(2)])]);
  219. smalltalk.send(d, "_at_put_", [smalltalk.send((1), "__at", [(3)]), (3)]);
  220. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_at_", [smalltalk.send((1), "__at", [(3)])]), "__eq", [(3)])]);
  221. return self;},
  222. args: [],
  223. source: unescape('testAccessing%0A%09%7C%20d%20%7C%0A%0A%09d%20%3A%3D%20Dictionary%20new.%0A%0A%09d%20at%3A%20%27hello%27%20put%3A%20%27world%27.%0A%09self%20assert%3A%20%28d%20at%3A%20%27hello%27%29%20%3D%20%27world%27.%0A%09self%20assert%3A%20%28d%20at%3A%20%27hello%27%20ifAbsent%3A%20%5Bnil%5D%29%20%3D%20%27world%27.%0A%09self%20deny%3A%20%28d%20at%3A%20%27foo%27%20ifAbsent%3A%20%5Bnil%5D%29%20%3D%20%27world%27.%0A%0A%09d%20at%3A%201%20put%3A%202.%0A%09self%20assert%3A%20%28d%20at%3A%201%29%20%3D%202.%0A%0A%09d%20at%3A%201@3%20put%3A%203.%0A%09self%20assert%3A%20%28d%20at%3A%201@3%29%20%3D%203'),
  224. messageSends: ["new", "at:put:", "assert:", unescape("%3D"), "at:", "at:ifAbsent:", "deny:", unescape("@")],
  225. referencedClasses: ["Dictionary"]
  226. }),
  227. smalltalk.DictionaryTest);
  228. smalltalk.addMethod(
  229. unescape('_testSize'),
  230. smalltalk.method({
  231. selector: unescape('testSize'),
  232. category: 'tests',
  233. fn: function (){
  234. var self=this;
  235. var d=nil;
  236. (d=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
  237. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_size", []), "__eq", [(0)])]);
  238. smalltalk.send(d, "_at_put_", [(1), (2)]);
  239. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_size", []), "__eq", [(1)])]);
  240. smalltalk.send(d, "_at_put_", [(2), (3)]);
  241. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_size", []), "__eq", [(2)])]);
  242. return self;},
  243. args: [],
  244. source: unescape('testSize%0A%09%7C%20d%20%7C%0A%0A%09d%20%3A%3D%20Dictionary%20new.%0A%09self%20assert%3A%20d%20size%20%3D%200.%0A%0A%09d%20at%3A%201%20put%3A%202.%0A%09self%20assert%3A%20d%20size%20%3D%201.%0A%0A%09d%20at%3A%202%20put%3A%203.%0A%09self%20assert%3A%20d%20size%20%3D%202.'),
  245. messageSends: ["new", "assert:", unescape("%3D"), "size", "at:put:"],
  246. referencedClasses: ["Dictionary"]
  247. }),
  248. smalltalk.DictionaryTest);
  249. smalltalk.addMethod(
  250. unescape('_testValues'),
  251. smalltalk.method({
  252. selector: unescape('testValues'),
  253. category: 'tests',
  254. fn: function (){
  255. var self=this;
  256. var d=nil;
  257. (d=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
  258. smalltalk.send(d, "_at_put_", [(1), (2)]);
  259. smalltalk.send(d, "_at_put_", [(2), (3)]);
  260. smalltalk.send(d, "_at_put_", [(3), (4)]);
  261. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_values", []), "__eq", [[(2), (3), (4)]])]);
  262. return self;},
  263. args: [],
  264. source: unescape('testValues%0A%09%7C%20d%20%7C%0A%0A%09d%20%3A%3D%20Dictionary%20new.%0A%09d%20at%3A%201%20put%3A%202.%0A%09d%20at%3A%202%20put%3A%203.%0A%09d%20at%3A%203%20put%3A%204.%0A%0A%09self%20assert%3A%20d%20values%20%3D%20%23%282%203%204%29'),
  265. messageSends: ["new", "at:put:", "assert:", unescape("%3D"), "values"],
  266. referencedClasses: ["Dictionary"]
  267. }),
  268. smalltalk.DictionaryTest);
  269. smalltalk.addMethod(
  270. unescape('_testKeys'),
  271. smalltalk.method({
  272. selector: unescape('testKeys'),
  273. category: 'tests',
  274. fn: function (){
  275. var self=this;
  276. var d=nil;
  277. (d=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
  278. smalltalk.send(d, "_at_put_", [(1), (2)]);
  279. smalltalk.send(d, "_at_put_", [(2), (3)]);
  280. smalltalk.send(d, "_at_put_", [(3), (4)]);
  281. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_keys", []), "__eq", [[(1), (2), (3)]])]);
  282. return self;},
  283. args: [],
  284. source: unescape('testKeys%0A%09%7C%20d%20%7C%0A%0A%09d%20%3A%3D%20Dictionary%20new.%0A%09d%20at%3A%201%20put%3A%202.%0A%09d%20at%3A%202%20put%3A%203.%0A%09d%20at%3A%203%20put%3A%204.%0A%0A%09self%20assert%3A%20d%20keys%20%3D%20%23%281%202%203%29'),
  285. messageSends: ["new", "at:put:", "assert:", unescape("%3D"), "keys"],
  286. referencedClasses: ["Dictionary"]
  287. }),
  288. smalltalk.DictionaryTest);
  289. smalltalk.addClass('BooleanTest', smalltalk.TestCase, [], 'Kernel-Tests');
  290. smalltalk.addMethod(
  291. unescape('_testLogic'),
  292. smalltalk.method({
  293. selector: unescape('testLogic'),
  294. category: 'tests',
  295. fn: function (){
  296. var self=this;
  297. (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);
  298. (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);
  299. (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);
  300. (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);
  301. return self;},
  302. args: [],
  303. source: unescape('testLogic%0A%20%0A%09%22Trivial%20logic%20table%22%0A%09self%20assert%3A%20%28true%20%26%20true%29%3B%20deny%3A%20%28true%20%26%20false%29%3B%20deny%3A%20%28false%20%26%20true%29%3B%20deny%3A%20%28false%20%26%20false%29.%0A%09self%20assert%3A%20%28true%20%7C%20true%29%3B%20assert%3A%20%28true%20%7C%20false%29%3B%20assert%3A%20%28false%20%7C%20true%29%3B%20deny%3A%20%28false%20%7C%20false%29.%0A%20%20%20%20%20%20%20%20%22Checking%20that%20expressions%20work%20fine%20too%22%0A%09self%20assert%3A%20%28true%20%26%20%281%20%3E%200%29%29%3B%20deny%3A%20%28%281%20%3E%200%29%20%26%20false%29%3B%20deny%3A%20%28%281%20%3E%200%29%20%26%20%281%20%3E%202%29%29.%0A%20%20%20%20%20%20%20%20self%20assert%3A%20%28false%20%7C%20%281%20%3E%200%29%29%3B%20assert%3A%20%28%281%20%3E%200%29%20%7C%20false%29%3B%20assert%3A%20%28%281%20%3E%200%29%20%7C%20%281%20%3E%202%29%29'),
  304. messageSends: ["assert:", unescape("%26"), "deny:", unescape("%7C"), unescape("%3E")],
  305. referencedClasses: []
  306. }),
  307. smalltalk.BooleanTest);
  308. smalltalk.addMethod(
  309. unescape('_testEquality'),
  310. smalltalk.method({
  311. selector: unescape('testEquality'),
  312. category: 'tests',
  313. fn: function (){
  314. var self=this;
  315. smalltalk.send(self, "_deny_", [smalltalk.send((0), "__eq", [false])]);
  316. smalltalk.send(self, "_deny_", [smalltalk.send(false, "__eq", [(0)])]);
  317. smalltalk.send(self, "_deny_", [smalltalk.send("", "__eq", [false])]);
  318. smalltalk.send(self, "_deny_", [smalltalk.send(false, "__eq", [""])]);
  319. smalltalk.send(self, "_assert_", [smalltalk.send(true, "__eq", [true])]);
  320. smalltalk.send(self, "_deny_", [smalltalk.send(false, "__eq", [true])]);
  321. smalltalk.send(self, "_deny_", [smalltalk.send(true, "__eq", [false])]);
  322. smalltalk.send(self, "_assert_", [smalltalk.send(false, "__eq", [false])]);
  323. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(true, "_yourself", []), "__eq", [true])]);
  324. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(true, "_yourself", []), "__eq", [smalltalk.send(true, "_yourself", [])])]);
  325. return self;},
  326. args: [],
  327. source: unescape('testEquality%0A%09%22We%27re%20on%20top%20of%20JS...just%20be%20sure%20to%20check%20the%20basics%21%22%0A%0A%09self%20deny%3A%200%20%3D%20false.%20%0A%09self%20deny%3A%20false%20%3D%200.%0A%09self%20deny%3A%20%27%27%20%3D%20false.%0A%09self%20deny%3A%20false%20%3D%20%27%27.%0A%0A%09self%20assert%3A%20true%20%3D%20true.%0A%09self%20deny%3A%20false%20%3D%20true.%0A%09self%20deny%3A%20true%20%3D%20false.%0A%09self%20assert%3A%20false%20%3D%20false.%0A%0A%09%22JS%20may%20do%20some%20type%20coercing%20after%20sending%20a%20message%22%0A%09self%20assert%3A%20true%20yourself%20%3D%20true.%0A%09self%20assert%3A%20true%20yourself%20%3D%20true%20yourself'),
  328. messageSends: ["deny:", unescape("%3D"), "assert:", "yourself"],
  329. referencedClasses: []
  330. }),
  331. smalltalk.BooleanTest);
  332. smalltalk.addMethod(
  333. unescape('_testLogicKeywords'),
  334. smalltalk.method({
  335. selector: unescape('testLogicKeywords'),
  336. category: 'tests',
  337. fn: function (){
  338. var self=this;
  339. (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);
  340. (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);
  341. (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);
  342. (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);
  343. return self;},
  344. args: [],
  345. source: unescape('testLogicKeywords%0A%20%0A%09%22Trivial%20logic%20table%22%0A%09self%20%0A%09%09assert%3A%20%28true%20and%3A%20%5B%20true%5D%29%3B%20%0A%09%09deny%3A%20%28true%20and%3A%20%5B%20false%20%5D%29%3B%20%0A%09%09deny%3A%20%28false%20and%3A%20%5B%20true%20%5D%29%3B%20%0A%09%09deny%3A%20%28false%20and%3A%20%5B%20false%20%5D%29.%0A%09self%20%0A%09%09assert%3A%20%28true%20or%3A%20%5B%20true%20%5D%29%3B%20%0A%09%09assert%3A%20%28true%20or%3A%20%5B%20false%20%5D%29%3B%20%0A%09%09assert%3A%20%28false%20or%3A%20%5B%20true%20%5D%29%3B%20%0A%09%09deny%3A%20%28false%20or%3A%20%5B%20false%20%5D%29.%0A%20%20%20%20%20%20%20%20%0A%09%22Checking%20that%20expressions%20work%20fine%20too%22%0A%09self%20%0A%09%09assert%3A%20%28true%20and%3A%20%5B%201%20%3E%200%20%5D%29%3B%20%0A%09%09deny%3A%20%28%281%20%3E%200%29%20and%3A%20%5B%20false%20%5D%29%3B%20%0A%09%09deny%3A%20%28%281%20%3E%200%29%20and%3A%20%5B%201%20%3E%202%20%5D%29.%0A%20%20%20%20%20%20%20%20self%20%0A%09%09assert%3A%20%28false%20or%3A%20%5B%201%20%3E%200%20%5D%29%3B%20%0A%09%09assert%3A%20%28%281%20%3E%200%29%20or%3A%20%5B%20false%20%5D%29%3B%20%0A%09%09assert%3A%20%28%281%20%3E%200%29%20or%3A%20%5B%201%20%3E%202%20%5D%29'),
  346. messageSends: ["assert:", "and:", "deny:", "or:", unescape("%3E")],
  347. referencedClasses: []
  348. }),
  349. smalltalk.BooleanTest);
  350. smalltalk.addMethod(
  351. unescape('_testIfTrueIfFalse'),
  352. smalltalk.method({
  353. selector: unescape('testIfTrueIfFalse'),
  354. category: 'tests',
  355. fn: function (){
  356. var self=this;
  357. 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"])]);
  358. 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])]);
  359. 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])]);
  360. 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"])]);
  361. 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"])]);
  362. 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"])]);
  363. 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"])]);
  364. 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"])]);
  365. return self;},
  366. args: [],
  367. source: unescape('testIfTrueIfFalse%0A%20%0A%09self%20assert%3A%20%28true%20ifTrue%3A%20%5B%27alternative%20block%27%5D%29%20%3D%20%27alternative%20block%27.%0A%09self%20assert%3A%20%28true%20ifFalse%3A%20%5B%27alternative%20block%27%5D%29%20%3D%20nil.%0A%0A%09self%20assert%3A%20%28false%20ifTrue%3A%20%5B%27alternative%20block%27%5D%29%20%3D%20nil.%0A%09self%20assert%3A%20%28false%20ifFalse%3A%20%5B%27alternative%20block%27%5D%29%20%3D%20%27alternative%20block%27.%0A%0A%09self%20assert%3A%20%28false%20ifTrue%3A%20%5B%27alternative%20block%27%5D%20ifFalse%3A%20%5B%27alternative%20block2%27%5D%29%20%3D%20%27alternative%20block2%27.%0A%09self%20assert%3A%20%28false%20ifFalse%3A%20%5B%27alternative%20block%27%5D%20ifTrue%3A%20%5B%27alternative%20block2%27%5D%29%20%3D%20%27alternative%20block%27.%0A%0A%09self%20assert%3A%20%28true%20ifTrue%3A%20%5B%27alternative%20block%27%5D%20ifFalse%3A%20%5B%27alternative%20block2%27%5D%29%20%3D%20%27alternative%20block%27.%0A%09self%20assert%3A%20%28true%20ifFalse%3A%20%5B%27alternative%20block%27%5D%20ifTrue%3A%20%5B%27alternative%20block2%27%5D%29%20%3D%20%27alternative%20block2%27.'),
  368. messageSends: ["assert:", unescape("%3D"), "ifTrue:", "ifFalse:", "ifTrue:ifFalse:", "ifFalse:ifTrue:"],
  369. referencedClasses: []
  370. }),
  371. smalltalk.BooleanTest);
  372. smalltalk.addClass('NumberTest', smalltalk.TestCase, [], 'Kernel-Tests');
  373. smalltalk.addMethod(
  374. unescape('_testPrintShowingDecimalPlaces'),
  375. smalltalk.method({
  376. selector: unescape('testPrintShowingDecimalPlaces'),
  377. category: 'tests',
  378. fn: function (){
  379. var self=this;
  380. smalltalk.send(self, "_assert_equals_", ["23.00", smalltalk.send((23), "_printShowingDecimalPlaces_", [(2)])]);
  381. smalltalk.send(self, "_assert_equals_", ["23.57", smalltalk.send((23.5698), "_printShowingDecimalPlaces_", [(2)])]);
  382. smalltalk.send(self, "_assert_equals_", [unescape("-234.56700"), smalltalk.send(smalltalk.send((234.567), "_negated", []), "_printShowingDecimalPlaces_", [(5)])]);
  383. smalltalk.send(self, "_assert_equals_", ["23", smalltalk.send((23.4567), "_printShowingDecimalPlaces_", [(0)])]);
  384. smalltalk.send(self, "_assert_equals_", ["24", smalltalk.send((23.5567), "_printShowingDecimalPlaces_", [(0)])]);
  385. smalltalk.send(self, "_assert_equals_", [unescape("-23"), smalltalk.send(smalltalk.send((23.4567), "_negated", []), "_printShowingDecimalPlaces_", [(0)])]);
  386. smalltalk.send(self, "_assert_equals_", [unescape("-24"), smalltalk.send(smalltalk.send((23.5567), "_negated", []), "_printShowingDecimalPlaces_", [(0)])]);
  387. smalltalk.send(self, "_assert_equals_", ["100000000.0", smalltalk.send((100000000), "_printShowingDecimalPlaces_", [(1)])]);
  388. smalltalk.send(self, "_assert_equals_", ["0.98000", smalltalk.send((0.98), "_printShowingDecimalPlaces_", [(5)])]);
  389. smalltalk.send(self, "_assert_equals_", [unescape("-0.98"), smalltalk.send(smalltalk.send((0.98), "_negated", []), "_printShowingDecimalPlaces_", [(2)])]);
  390. smalltalk.send(self, "_assert_equals_", ["2.57", smalltalk.send((2.567), "_printShowingDecimalPlaces_", [(2)])]);
  391. smalltalk.send(self, "_assert_equals_", [unescape("-2.57"), smalltalk.send((-2.567), "_printShowingDecimalPlaces_", [(2)])]);
  392. smalltalk.send(self, "_assert_equals_", ["0.00", smalltalk.send((0), "_printShowingDecimalPlaces_", [(2)])]);
  393. return self;},
  394. args: [],
  395. source: unescape('testPrintShowingDecimalPlaces%0A%09self%20assert%3A%20%2723.00%27%20equals%3A%20%2823%20printShowingDecimalPlaces%3A%202%29.%0A%09self%20assert%3A%20%2723.57%27%20equals%3A%20%2823.5698%20printShowingDecimalPlaces%3A%202%29.%0A%09self%20assert%3A%20%27-234.56700%27%20equals%3A%28%20234.567%20negated%20printShowingDecimalPlaces%3A%205%29.%0A%09self%20assert%3A%20%2723%27%20equals%3A%20%2823.4567%20printShowingDecimalPlaces%3A%200%29.%0A%09self%20assert%3A%20%2724%27%20equals%3A%20%2823.5567%20printShowingDecimalPlaces%3A%200%29.%0A%09self%20assert%3A%20%27-23%27%20equals%3A%20%2823.4567%20negated%20printShowingDecimalPlaces%3A%200%29.%0A%09self%20assert%3A%20%27-24%27%20equals%3A%20%2823.5567%20negated%20printShowingDecimalPlaces%3A%200%29.%0A%09self%20assert%3A%20%27100000000.0%27%20equals%3A%20%28100000000%20printShowingDecimalPlaces%3A%201%29.%0A%09self%20assert%3A%20%270.98000%27%20equals%3A%20%280.98%20printShowingDecimalPlaces%3A%205%29.%0A%09self%20assert%3A%20%27-0.98%27%20equals%3A%20%280.98%20negated%20printShowingDecimalPlaces%3A%202%29.%0A%09self%20assert%3A%20%272.57%27%20equals%3A%20%282.567%20printShowingDecimalPlaces%3A%202%29.%0A%09self%20assert%3A%20%27-2.57%27%20equals%3A%20%28-2.567%20printShowingDecimalPlaces%3A%202%29.%0A%09self%20assert%3A%20%270.00%27%20equals%3A%20%280%20printShowingDecimalPlaces%3A%202%29.'),
  396. messageSends: ["assert:equals:", "printShowingDecimalPlaces:", "negated"],
  397. referencedClasses: []
  398. }),
  399. smalltalk.NumberTest);
  400. smalltalk.addMethod(
  401. unescape('_testEquality'),
  402. smalltalk.method({
  403. selector: unescape('testEquality'),
  404. category: 'tests',
  405. fn: function (){
  406. var self=this;
  407. smalltalk.send(self, "_assert_", [smalltalk.send((1), "__eq", [(1)])]);
  408. smalltalk.send(self, "_assert_", [smalltalk.send((0), "__eq", [(0)])]);
  409. smalltalk.send(self, "_deny_", [smalltalk.send((1), "__eq", [(0)])]);
  410. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((1), "_yourself", []), "__eq", [(1)])]);
  411. smalltalk.send(self, "_assert_", [smalltalk.send((1), "__eq", [smalltalk.send((1), "_yourself", [])])]);
  412. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((1), "_yourself", []), "__eq", [smalltalk.send((1), "_yourself", [])])]);
  413. smalltalk.send(self, "_deny_", [smalltalk.send((0), "__eq", [false])]);
  414. smalltalk.send(self, "_deny_", [smalltalk.send(false, "__eq", [(0)])]);
  415. smalltalk.send(self, "_deny_", [smalltalk.send("", "__eq", [(0)])]);
  416. smalltalk.send(self, "_deny_", [smalltalk.send((0), "__eq", [""])]);
  417. return self;},
  418. args: [],
  419. source: unescape('testEquality%0A%09self%20assert%3A%201%20%3D%201.%0A%09self%20assert%3A%200%20%3D%200.%0A%09self%20deny%3A%201%20%3D%200.%0A%0A%09self%20assert%3A%201%20yourself%20%3D%201.%0A%09self%20assert%3A%201%20%3D%201%20yourself.%0A%09self%20assert%3A%201%20yourself%20%3D%201%20yourself.%0A%09%0A%09self%20deny%3A%200%20%3D%20false.%0A%09self%20deny%3A%20false%20%3D%200.%0A%09self%20deny%3A%20%27%27%20%3D%200.%0A%09self%20deny%3A%200%20%3D%20%27%27'),
  420. messageSends: ["assert:", unescape("%3D"), "deny:", "yourself"],
  421. referencedClasses: []
  422. }),
  423. smalltalk.NumberTest);
  424. smalltalk.addMethod(
  425. unescape('_testArithmetic'),
  426. smalltalk.method({
  427. selector: unescape('testArithmetic'),
  428. category: 'tests',
  429. fn: function (){
  430. var self=this;
  431. smalltalk.send(self, "_assert_", [smalltalk.send((1.5) + (1), "__eq", [(2.5)])]);
  432. smalltalk.send(self, "_assert_", [smalltalk.send((2) - (1), "__eq", [(1)])]);
  433. smalltalk.send(self, "_assert_", [smalltalk.send((-2) - (1), "__eq", [(-3)])]);
  434. smalltalk.send(self, "_assert_", [smalltalk.send((12) / (2), "__eq", [(6)])]);
  435. smalltalk.send(self, "_assert_", [smalltalk.send((3) * (4), "__eq", [(12)])]);
  436. smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = (1) + (2)).klass === smalltalk.Number) ? $receiver *(3) : smalltalk.send($receiver, "__star", [(3)])), "__eq", [(9)])]);
  437. smalltalk.send(self, "_assert_", [smalltalk.send((1) + (2) * (3), "__eq", [(7)])]);
  438. return self;},
  439. args: [],
  440. source: unescape('testArithmetic%0A%09%0A%09%22We%20rely%20on%20JS%20here%2C%20so%20we%20won%27t%20test%20complex%20behavior%2C%20just%20check%20if%20%0A%09message%20sends%20are%20corrects%22%0A%0A%09self%20assert%3A%201.5%20+%201%20%3D%202.5.%0A%09self%20assert%3A%202%20-%201%20%3D%201.%0A%09self%20assert%3A%20-2%20-%201%20%3D%20-3.%0A%09self%20assert%3A%2012%20/%202%20%3D%206.%0A%09self%20assert%3A%203%20*%204%20%3D%2012.%0A%0A%09%22Simple%20parenthesis%20and%20execution%20order%22%0A%0A%09self%20assert%3A%201%20+%202%20*%203%20%3D%209.%0A%09self%20assert%3A%201%20+%20%282%20*%203%29%20%3D%207'),
  441. messageSends: ["assert:", unescape("%3D"), unescape("+"), unescape("-"), unescape("/"), unescape("*")],
  442. referencedClasses: []
  443. }),
  444. smalltalk.NumberTest);
  445. smalltalk.addMethod(
  446. unescape('_testRounded'),
  447. smalltalk.method({
  448. selector: unescape('testRounded'),
  449. category: 'tests',
  450. fn: function (){
  451. var self=this;
  452. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3), "_rounded", []), "__eq", [(3)])]);
  453. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3.212), "_rounded", []), "__eq", [(3)])]);
  454. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3.51), "_rounded", []), "__eq", [(4)])]);
  455. return self;},
  456. args: [],
  457. source: unescape('testRounded%0A%09%0A%09self%20assert%3A%203%20rounded%20%3D%203.%0A%09self%20assert%3A%203.212%20rounded%20%3D%203.%0A%09self%20assert%3A%203.51%20rounded%20%3D%204'),
  458. messageSends: ["assert:", unescape("%3D"), "rounded"],
  459. referencedClasses: []
  460. }),
  461. smalltalk.NumberTest);
  462. smalltalk.addMethod(
  463. unescape('_testNegated'),
  464. smalltalk.method({
  465. selector: unescape('testNegated'),
  466. category: 'tests',
  467. fn: function (){
  468. var self=this;
  469. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3), "_negated", []), "__eq", [(-3)])]);
  470. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((-3), "_negated", []), "__eq", [(3)])]);
  471. return self;},
  472. args: [],
  473. source: unescape('testNegated%0A%09self%20assert%3A%203%20negated%20%3D%20-3.%0A%09self%20assert%3A%20-3%20negated%20%3D%203'),
  474. messageSends: ["assert:", unescape("%3D"), "negated"],
  475. referencedClasses: []
  476. }),
  477. smalltalk.NumberTest);
  478. smalltalk.addMethod(
  479. unescape('_testComparison'),
  480. smalltalk.method({
  481. selector: unescape('testComparison'),
  482. category: 'tests',
  483. fn: function (){
  484. var self=this;
  485. smalltalk.send(self, "_assert_", [(3) > (2)]);
  486. smalltalk.send(self, "_assert_", [(2) < (3)]);
  487. smalltalk.send(self, "_deny_", [(3) < (2)]);
  488. smalltalk.send(self, "_deny_", [(2) > (3)]);
  489. smalltalk.send(self, "_assert_", [(3) >= (3)]);
  490. smalltalk.send(self, "_assert_", [(3.1) >= (3)]);
  491. smalltalk.send(self, "_assert_", [(3) <= (3)]);
  492. smalltalk.send(self, "_assert_", [(3) <= (3.1)]);
  493. return self;},
  494. args: [],
  495. source: unescape('testComparison%0A%0A%09self%20assert%3A%203%20%3E%202.%0A%09self%20assert%3A%202%20%3C%203.%0A%09%0A%09self%20deny%3A%203%20%3C%202.%0A%09self%20deny%3A%202%20%3E%203.%0A%0A%09self%20assert%3A%203%20%3E%3D%203.%0A%09self%20assert%3A%203.1%20%3E%3D%203.%0A%09self%20assert%3A%203%20%3C%3D%203.%0A%09self%20assert%3A%203%20%3C%3D%203.1'),
  496. messageSends: ["assert:", unescape("%3E"), unescape("%3C"), "deny:", unescape("%3E%3D"), unescape("%3C%3D")],
  497. referencedClasses: []
  498. }),
  499. smalltalk.NumberTest);
  500. smalltalk.addMethod(
  501. unescape('_testTruncated'),
  502. smalltalk.method({
  503. selector: unescape('testTruncated'),
  504. category: 'tests',
  505. fn: function (){
  506. var self=this;
  507. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3), "_truncated", []), "__eq", [(3)])]);
  508. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3.212), "_truncated", []), "__eq", [(3)])]);
  509. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3.51), "_truncated", []), "__eq", [(3)])]);
  510. return self;},
  511. args: [],
  512. source: unescape('testTruncated%0A%09%0A%09self%20assert%3A%203%20truncated%20%3D%203.%0A%09self%20assert%3A%203.212%20truncated%20%3D%203.%0A%09self%20assert%3A%203.51%20truncated%20%3D%203'),
  513. messageSends: ["assert:", unescape("%3D"), "truncated"],
  514. referencedClasses: []
  515. }),
  516. smalltalk.NumberTest);
  517. smalltalk.addMethod(
  518. unescape('_testCopying'),
  519. smalltalk.method({
  520. selector: unescape('testCopying'),
  521. category: 'tests',
  522. fn: function (){
  523. var self=this;
  524. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((1), "_copy", []), "__eq_eq", [(1)])]);
  525. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((1), "_deepCopy", []), "__eq_eq", [(1)])]);
  526. return self;},
  527. args: [],
  528. source: unescape('testCopying%0A%09self%20assert%3A%201%20copy%20%3D%3D%201.%0A%09self%20assert%3A%201%20deepCopy%20%3D%3D%201'),
  529. messageSends: ["assert:", unescape("%3D%3D"), "copy", "deepCopy"],
  530. referencedClasses: []
  531. }),
  532. smalltalk.NumberTest);
  533. smalltalk.addMethod(
  534. unescape('_testMinMax'),
  535. smalltalk.method({
  536. selector: unescape('testMinMax'),
  537. category: 'tests',
  538. fn: function (){
  539. var self=this;
  540. smalltalk.send(self, "_assert_equals_", [smalltalk.send((2), "_max_", [(5)]), (5)]);
  541. smalltalk.send(self, "_assert_equals_", [smalltalk.send((2), "_min_", [(5)]), (2)]);
  542. return self;},
  543. args: [],
  544. source: unescape('testMinMax%0A%09%0A%09self%20assert%3A%20%282%20max%3A%205%29%20equals%3A%205.%0A%09self%20assert%3A%20%282%20min%3A%205%29%20equals%3A%202'),
  545. messageSends: ["assert:equals:", "max:", "min:"],
  546. referencedClasses: []
  547. }),
  548. smalltalk.NumberTest);
  549. smalltalk.addMethod(
  550. unescape('_testIdentity'),
  551. smalltalk.method({
  552. selector: unescape('testIdentity'),
  553. category: 'tests',
  554. fn: function (){
  555. var self=this;
  556. smalltalk.send(self, "_assert_", [smalltalk.send((1), "__eq_eq", [(1)])]);
  557. smalltalk.send(self, "_assert_", [smalltalk.send((0), "__eq_eq", [(0)])]);
  558. smalltalk.send(self, "_deny_", [smalltalk.send((1), "__eq_eq", [(0)])]);
  559. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((1), "_yourself", []), "__eq_eq", [(1)])]);
  560. smalltalk.send(self, "_assert_", [smalltalk.send((1), "__eq_eq", [smalltalk.send((1), "_yourself", [])])]);
  561. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((1), "_yourself", []), "__eq_eq", [smalltalk.send((1), "_yourself", [])])]);
  562. smalltalk.send(self, "_deny_", [smalltalk.send((1), "__eq_eq", [(2)])]);
  563. return self;},
  564. args: [],
  565. source: unescape('testIdentity%0A%09self%20assert%3A%201%20%3D%3D%201.%0A%09self%20assert%3A%200%20%3D%3D%200.%0A%09self%20deny%3A%201%20%3D%3D%200.%0A%0A%09self%20assert%3A%201%20yourself%20%3D%3D%201.%0A%09self%20assert%3A%201%20%3D%3D%201%20yourself.%0A%09self%20assert%3A%201%20yourself%20%3D%3D%201%20yourself.%0A%09%0A%09self%20deny%3A%201%20%3D%3D%202'),
  566. messageSends: ["assert:", unescape("%3D%3D"), "deny:", "yourself"],
  567. referencedClasses: []
  568. }),
  569. smalltalk.NumberTest);
  570. smalltalk.addMethod(
  571. unescape('_testSqrt'),
  572. smalltalk.method({
  573. selector: unescape('testSqrt'),
  574. category: 'tests',
  575. fn: function (){
  576. var self=this;
  577. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((4), "_sqrt", []), "__eq", [(2)])]);
  578. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((16), "_sqrt", []), "__eq", [(4)])]);
  579. return self;},
  580. args: [],
  581. source: unescape('testSqrt%0A%09%0A%09self%20assert%3A%204%20sqrt%20%3D%202.%0A%09self%20assert%3A%2016%20sqrt%20%3D%204'),
  582. messageSends: ["assert:", unescape("%3D"), "sqrt"],
  583. referencedClasses: []
  584. }),
  585. smalltalk.NumberTest);
  586. smalltalk.addMethod(
  587. unescape('_testSquared'),
  588. smalltalk.method({
  589. selector: unescape('testSquared'),
  590. category: 'tests',
  591. fn: function (){
  592. var self=this;
  593. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((4), "_squared", []), "__eq", [(16)])]);
  594. return self;},
  595. args: [],
  596. source: unescape('testSquared%0A%09%0A%09self%20assert%3A%204%20squared%20%3D%2016'),
  597. messageSends: ["assert:", unescape("%3D"), "squared"],
  598. referencedClasses: []
  599. }),
  600. smalltalk.NumberTest);
  601. smalltalk.addMethod(
  602. unescape('_testTimesRepeat'),
  603. smalltalk.method({
  604. selector: unescape('testTimesRepeat'),
  605. category: 'tests',
  606. fn: function (){
  607. var self=this;
  608. var i=nil;
  609. (i=(0));
  610. smalltalk.send((0), "_timesRepeat_", [(function(){return (i=((($receiver = i).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));})]);
  611. smalltalk.send(self, "_assert_equals_", [i, (0)]);
  612. smalltalk.send((5), "_timesRepeat_", [(function(){return (i=((($receiver = i).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));})]);
  613. smalltalk.send(self, "_assert_equals_", [i, (5)]);
  614. return self;},
  615. args: [],
  616. source: unescape('testTimesRepeat%0A%09%7C%20i%20%7C%0A%0A%09i%20%3A%3D%200.%0A%090%20timesRepeat%3A%20%5Bi%20%3A%3D%20i%20+%201%5D.%0A%09self%20assert%3A%20i%20equals%3A%200.%0A%0A%095%20timesRepeat%3A%20%5Bi%20%3A%3D%20i%20+%201%5D.%0A%09self%20assert%3A%20i%20equals%3A%205'),
  617. messageSends: ["timesRepeat:", unescape("+"), "assert:equals:"],
  618. referencedClasses: []
  619. }),
  620. smalltalk.NumberTest);
  621. smalltalk.addMethod(
  622. unescape('_testTo'),
  623. smalltalk.method({
  624. selector: unescape('testTo'),
  625. category: 'tests',
  626. fn: function (){
  627. var self=this;
  628. smalltalk.send(self, "_assert_equals_", [smalltalk.send((1), "_to_", [(5)]), [(1), (2), (3), (4), (5)]]);
  629. return self;},
  630. args: [],
  631. source: unescape('testTo%0A%09self%20assert%3A%20%281%20to%3A%205%29%20equals%3A%20%23%281%202%203%204%205%29'),
  632. messageSends: ["assert:equals:", "to:"],
  633. referencedClasses: []
  634. }),
  635. smalltalk.NumberTest);
  636. smalltalk.addMethod(
  637. unescape('_testToBy'),
  638. smalltalk.method({
  639. selector: unescape('testToBy'),
  640. category: 'tests',
  641. fn: function (){
  642. var self=this;
  643. smalltalk.send(self, "_assert_equals_", [smalltalk.send((0), "_to_by_", [(6), (2)]), [(0), (2), (4), (6)]]);
  644. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send((1), "_to_by_", [(4), (0)]);}), (smalltalk.Error || Error)]);
  645. return self;},
  646. args: [],
  647. source: unescape('testToBy%0A%09self%20assert%3A%20%280%20to%3A%206%20by%3A%202%29%20equals%3A%20%23%280%202%204%206%29.%0A%0A%09self%20should%3A%20%5B1%20to%3A%204%20by%3A%200%5D%20raise%3A%20Error'),
  648. messageSends: ["assert:equals:", "to:by:", "should:raise:"],
  649. referencedClasses: ["Error"]
  650. }),
  651. smalltalk.NumberTest);
  652. smalltalk.addClass('JSObjectProxyTest', smalltalk.TestCase, [], 'Kernel-Tests');
  653. smalltalk.addMethod(
  654. unescape('_jsObject'),
  655. smalltalk.method({
  656. selector: unescape('jsObject'),
  657. category: 'accessing',
  658. fn: function (){
  659. var self=this;
  660. return jsObject = {a: 1, b: function() {return 2;}, c: function(object) {return object;}};
  661. return self;},
  662. args: [],
  663. source: unescape('jsObject%0A%09%3Creturn%20jsObject%20%3D%20%7Ba%3A%201%2C%20b%3A%20function%28%29%20%7Breturn%202%3B%7D%2C%20c%3A%20function%28object%29%20%7Breturn%20object%3B%7D%7D%3E'),
  664. messageSends: [],
  665. referencedClasses: []
  666. }),
  667. smalltalk.JSObjectProxyTest);
  668. smalltalk.addMethod(
  669. unescape('_testMethodWithArguments'),
  670. smalltalk.method({
  671. selector: unescape('testMethodWithArguments'),
  672. category: 'tests',
  673. fn: function (){
  674. var self=this;
  675. smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_hasClass_", ["amber"])]);
  676. smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_addClass_", ["amber"]);
  677. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_hasClass_", ["amber"])]);
  678. smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_removeClass_", ["amber"]);
  679. smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_hasClass_", ["amber"])]);
  680. return self;},
  681. args: [],
  682. source: unescape('testMethodWithArguments%0A%09self%20deny%3A%20%28%27body%27%20asJQuery%20hasClass%3A%20%27amber%27%29.%0A%0A%09%27body%27%20asJQuery%20addClass%3A%20%27amber%27.%0A%09self%20assert%3A%20%28%27body%27%20asJQuery%20hasClass%3A%20%27amber%27%29.%0A%0A%09%27body%27%20asJQuery%20removeClass%3A%20%27amber%27.%0A%09self%20deny%3A%20%28%27body%27%20asJQuery%20hasClass%3A%20%27amber%27%29.'),
  683. messageSends: ["deny:", "hasClass:", "asJQuery", "addClass:", "assert:", "removeClass:"],
  684. referencedClasses: []
  685. }),
  686. smalltalk.JSObjectProxyTest);
  687. smalltalk.addMethod(
  688. unescape('_testYourself'),
  689. smalltalk.method({
  690. selector: unescape('testYourself'),
  691. category: 'tests',
  692. fn: function (){
  693. var self=this;
  694. var body=nil;
  695. (body=(function($rec){smalltalk.send($rec, "_addClass_", ["amber"]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send("body", "_asJQuery", [])));
  696. smalltalk.send(self, "_assert_", [smalltalk.send(body, "_hasClass_", ["amber"])]);
  697. smalltalk.send(body, "_removeClass_", ["amber"]);
  698. smalltalk.send(self, "_deny_", [smalltalk.send(body, "_hasClass_", ["amber"])]);
  699. return self;},
  700. args: [],
  701. source: unescape('testYourself%0A%09%7Cbody%7C%0A%09body%20%3A%3D%20%27body%27%20asJQuery%0A%09%09%09%09addClass%3A%20%27amber%27%3B%0A%09%09%09%09yourself.%0A%0A%09self%20assert%3A%20%28body%20hasClass%3A%20%27amber%27%29.%0A%0A%09body%20removeClass%3A%20%27amber%27.%0A%09self%20deny%3A%20%28body%20hasClass%3A%20%27amber%27%29.'),
  702. messageSends: ["addClass:", "yourself", "asJQuery", "assert:", "hasClass:", "removeClass:", "deny:"],
  703. referencedClasses: []
  704. }),
  705. smalltalk.JSObjectProxyTest);
  706. smalltalk.addMethod(
  707. unescape('_testPropertyThatReturnsEmptyString'),
  708. smalltalk.method({
  709. selector: unescape('testPropertyThatReturnsEmptyString'),
  710. category: 'tests',
  711. fn: function (){
  712. var self=this;
  713. document.location.hash = '';
  714. smalltalk.send(self, "_assert_equals_", ["", smalltalk.send(smalltalk.send((typeof document == 'undefined' ? nil : document), "_location", []), "_hash", [])]);
  715. smalltalk.send(smalltalk.send((typeof document == 'undefined' ? nil : document), "_location", []), "_hash_", ["test"]);
  716. smalltalk.send(self, "_assert_equals_", [unescape("%23test"), smalltalk.send(smalltalk.send((typeof document == 'undefined' ? nil : document), "_location", []), "_hash", [])]);
  717. return self;},
  718. args: [],
  719. source: unescape('testPropertyThatReturnsEmptyString%0A%09%3Cdocument.location.hash%20%3D%20%27%27%3E.%0A%09self%20assert%3A%20%27%27%20equals%3A%20document%20location%20hash.%0A%0A%09document%20location%20hash%3A%20%27test%27.%0A%09self%20assert%3A%20%27%23test%27%20equals%3A%20document%20location%20hash.'),
  720. messageSends: ["assert:equals:", "hash", "location", "hash:"],
  721. referencedClasses: []
  722. }),
  723. smalltalk.JSObjectProxyTest);
  724. smalltalk.addMethod(
  725. unescape('_testDNU'),
  726. smalltalk.method({
  727. selector: unescape('testDNU'),
  728. category: 'tests',
  729. fn: function (){
  730. var self=this;
  731. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send(smalltalk.send(self, "_jsObject", []), "_foo", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  732. return self;},
  733. args: [],
  734. source: unescape('testDNU%0A%09self%20should%3A%20%5Bself%20jsObject%20foo%5D%20raise%3A%20MessageNotUnderstood'),
  735. messageSends: ["should:raise:", "foo", "jsObject"],
  736. referencedClasses: ["MessageNotUnderstood"]
  737. }),
  738. smalltalk.JSObjectProxyTest);
  739. smalltalk.addMethod(
  740. unescape('_testMessageSend'),
  741. smalltalk.method({
  742. selector: unescape('testMessageSend'),
  743. category: 'tests',
  744. fn: function (){
  745. var self=this;
  746. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send(self, "_jsObject", []), "_a", []), (1)]);
  747. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send(self, "_jsObject", []), "_b", []), (2)]);
  748. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send(self, "_jsObject", []), "_c_", [(3)]), (3)]);
  749. return self;},
  750. args: [],
  751. source: unescape('testMessageSend%0A%0A%09self%20assert%3A%20self%20jsObject%20a%20equals%3A%201.%0A%09self%20assert%3A%20self%20jsObject%20b%20equals%3A%202.%0A%09self%20assert%3A%20%28self%20jsObject%20c%3A%203%29%20equals%3A%203'),
  752. messageSends: ["assert:equals:", "a", "jsObject", "b", "c:"],
  753. referencedClasses: []
  754. }),
  755. smalltalk.JSObjectProxyTest);
  756. smalltalk.addMethod(
  757. unescape('_testPrinting'),
  758. smalltalk.method({
  759. selector: unescape('testPrinting'),
  760. category: 'tests',
  761. fn: function (){
  762. var self=this;
  763. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_jsObject", []), "_printString", []), "__eq", [unescape("%5Bobject%20Object%5D")])]);
  764. return self;},
  765. args: [],
  766. source: unescape('testPrinting%0A%09self%20assert%3A%20self%20jsObject%20printString%20%3D%20%27%5Bobject%20Object%5D%27'),
  767. messageSends: ["assert:", unescape("%3D"), "printString", "jsObject"],
  768. referencedClasses: []
  769. }),
  770. smalltalk.JSObjectProxyTest);
  771. smalltalk.addClass('PackageTest', smalltalk.TestCase, ['zorkPackage', 'grulPackage', 'backUpCommitPathJs', 'backUpCommitPathSt'], 'Kernel-Tests');
  772. smalltalk.addMethod(
  773. unescape('_setUp'),
  774. smalltalk.method({
  775. selector: unescape('setUp'),
  776. category: 'running',
  777. fn: function (){
  778. var self=this;
  779. (self['@backUpCommitPathJs']=smalltalk.send((smalltalk.Package || Package), "_defaultCommitPathJs", []));
  780. (self['@backUpCommitPathSt']=smalltalk.send((smalltalk.Package || Package), "_defaultCommitPathSt", []));
  781. smalltalk.send((smalltalk.Package || Package), "_resetCommitPaths", []);
  782. (self['@zorkPackage']=smalltalk.send(smalltalk.send((smalltalk.Package || Package), "_new", []), "_name_", ["Zork"]));
  783. (self['@grulPackage']=(function($rec){smalltalk.send($rec, "_name_", ["Grul"]);smalltalk.send($rec, "_commitPathJs_", [unescape("server/grul/js")]);smalltalk.send($rec, "_commitPathSt_", [unescape("grul/st")]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Package || Package), "_new", [])));
  784. return self;},
  785. args: [],
  786. source: unescape('setUp%0A%09backUpCommitPathJs%20%3A%3D%20Package%20defaultCommitPathJs.%0A%09backUpCommitPathSt%20%3A%3D%20Package%20defaultCommitPathSt.%0A%0A%09Package%20resetCommitPaths.%0A%0A%09zorkPackage%20%3A%3D%20Package%20new%20name%3A%20%27Zork%27.%0A%09grulPackage%20%3A%3D%20Package%20new%20%0A%09%09%09%09%09name%3A%20%27Grul%27%3B%0A%09%09%09%09%09commitPathJs%3A%20%27server/grul/js%27%3B%0A%09%09%09%09%09commitPathSt%3A%20%27grul/st%27%3B%0A%09%09%09%09%09yourself'),
  787. messageSends: ["defaultCommitPathJs", "defaultCommitPathSt", "resetCommitPaths", "name:", "new", "commitPathJs:", "commitPathSt:", "yourself"],
  788. referencedClasses: ["Package"]
  789. }),
  790. smalltalk.PackageTest);
  791. smalltalk.addMethod(
  792. unescape('_tearDown'),
  793. smalltalk.method({
  794. selector: unescape('tearDown'),
  795. category: 'running',
  796. fn: function (){
  797. var self=this;
  798. (function($rec){smalltalk.send($rec, "_defaultCommitPathJs_", [self['@backUpCommitPathJs']]);return smalltalk.send($rec, "_defaultCommitPathSt_", [self['@backUpCommitPathSt']]);})((smalltalk.Package || Package));
  799. return self;},
  800. args: [],
  801. source: unescape('tearDown%0A%09%20Package%20%0A%09%09defaultCommitPathJs%3A%20backUpCommitPathJs%3B%0A%09%09defaultCommitPathSt%3A%20backUpCommitPathSt'),
  802. messageSends: ["defaultCommitPathJs:", "defaultCommitPathSt:"],
  803. referencedClasses: ["Package"]
  804. }),
  805. smalltalk.PackageTest);
  806. smalltalk.addMethod(
  807. unescape('_testGrulCommitPathStShouldBeGrulSt'),
  808. smalltalk.method({
  809. selector: unescape('testGrulCommitPathStShouldBeGrulSt'),
  810. category: 'tests',
  811. fn: function (){
  812. var self=this;
  813. smalltalk.send(self, "_assert_equals_", [unescape("grul/st"), smalltalk.send(self['@grulPackage'], "_commitPathSt", [])]);
  814. return self;},
  815. args: [],
  816. source: unescape('testGrulCommitPathStShouldBeGrulSt%0A%09self%20assert%3A%20%27grul/st%27%20equals%3A%20grulPackage%20commitPathSt'),
  817. messageSends: ["assert:equals:", "commitPathSt"],
  818. referencedClasses: []
  819. }),
  820. smalltalk.PackageTest);
  821. smalltalk.addMethod(
  822. unescape('_testZorkCommitPathStShouldBeSt'),
  823. smalltalk.method({
  824. selector: unescape('testZorkCommitPathStShouldBeSt'),
  825. category: 'tests',
  826. fn: function (){
  827. var self=this;
  828. smalltalk.send(self, "_assert_equals_", ["st", smalltalk.send(self['@zorkPackage'], "_commitPathSt", [])]);
  829. return self;},
  830. args: [],
  831. source: unescape('testZorkCommitPathStShouldBeSt%0A%09self%20assert%3A%20%27st%27%20equals%3A%20zorkPackage%20commitPathSt'),
  832. messageSends: ["assert:equals:", "commitPathSt"],
  833. referencedClasses: []
  834. }),
  835. smalltalk.PackageTest);
  836. smalltalk.addMethod(
  837. unescape('_testZorkCommitPathJsShouldBeJs'),
  838. smalltalk.method({
  839. selector: unescape('testZorkCommitPathJsShouldBeJs'),
  840. category: 'tests',
  841. fn: function (){
  842. var self=this;
  843. smalltalk.send(self, "_assert_equals_", ["js", smalltalk.send(self['@zorkPackage'], "_commitPathJs", [])]);
  844. return self;},
  845. args: [],
  846. source: unescape('testZorkCommitPathJsShouldBeJs%0A%09self%20assert%3A%20%27js%27%20equals%3A%20zorkPackage%20commitPathJs'),
  847. messageSends: ["assert:equals:", "commitPathJs"],
  848. referencedClasses: []
  849. }),
  850. smalltalk.PackageTest);
  851. smalltalk.addMethod(
  852. unescape('_testGrulCommitPathJsShouldBeServerGrulJs'),
  853. smalltalk.method({
  854. selector: unescape('testGrulCommitPathJsShouldBeServerGrulJs'),
  855. category: 'tests',
  856. fn: function (){
  857. var self=this;
  858. smalltalk.send(self, "_assert_equals_", [unescape("server/grul/js"), smalltalk.send(self['@grulPackage'], "_commitPathJs", [])]);
  859. return self;},
  860. args: [],
  861. source: unescape('testGrulCommitPathJsShouldBeServerGrulJs%0A%09self%20assert%3A%20%27server/grul/js%27%20equals%3A%20grulPackage%20commitPathJs'),
  862. messageSends: ["assert:equals:", "commitPathJs"],
  863. referencedClasses: []
  864. }),
  865. smalltalk.PackageTest);
  866. smalltalk.addClass('PackageWithDefaultCommitPathChangedTest', smalltalk.PackageTest, [], 'Kernel-Tests');
  867. smalltalk.addMethod(
  868. unescape('_setUp'),
  869. smalltalk.method({
  870. selector: unescape('setUp'),
  871. category: 'running',
  872. fn: function (){
  873. var self=this;
  874. smalltalk.send(self, "_setUp", [], smalltalk.PackageTest);
  875. (function($rec){smalltalk.send($rec, "_defaultCommitPathJs_", [unescape("javascripts/")]);return smalltalk.send($rec, "_defaultCommitPathSt_", [unescape("smalltalk/")]);})((smalltalk.Package || Package));
  876. return self;},
  877. args: [],
  878. source: unescape('setUp%0A%09super%20setUp.%0A%0A%09Package%0A%09%09defaultCommitPathJs%3A%20%27javascripts/%27%3B%0A%09%09defaultCommitPathSt%3A%20%27smalltalk/%27.'),
  879. messageSends: ["setUp", "defaultCommitPathJs:", "defaultCommitPathSt:"],
  880. referencedClasses: ["Package"]
  881. }),
  882. smalltalk.PackageWithDefaultCommitPathChangedTest);
  883. smalltalk.addMethod(
  884. unescape('_testGrulCommitPathJsShouldBeServerGrulJs'),
  885. smalltalk.method({
  886. selector: unescape('testGrulCommitPathJsShouldBeServerGrulJs'),
  887. category: 'tests',
  888. fn: function (){
  889. var self=this;
  890. smalltalk.send(self, "_assert_equals_", [unescape("server/grul/js"), smalltalk.send(self['@grulPackage'], "_commitPathJs", [])]);
  891. return self;},
  892. args: [],
  893. source: unescape('testGrulCommitPathJsShouldBeServerGrulJs%0A%09self%20assert%3A%20%27server/grul/js%27%20equals%3A%20grulPackage%20commitPathJs'),
  894. messageSends: ["assert:equals:", "commitPathJs"],
  895. referencedClasses: []
  896. }),
  897. smalltalk.PackageWithDefaultCommitPathChangedTest);
  898. smalltalk.addMethod(
  899. unescape('_testGrulCommitPathStShouldBeGrulSt'),
  900. smalltalk.method({
  901. selector: unescape('testGrulCommitPathStShouldBeGrulSt'),
  902. category: 'tests',
  903. fn: function (){
  904. var self=this;
  905. smalltalk.send(self, "_assert_equals_", [unescape("grul/st"), smalltalk.send(self['@grulPackage'], "_commitPathSt", [])]);
  906. return self;},
  907. args: [],
  908. source: unescape('testGrulCommitPathStShouldBeGrulSt%0A%09self%20assert%3A%20%27grul/st%27%20equals%3A%20grulPackage%20commitPathSt'),
  909. messageSends: ["assert:equals:", "commitPathSt"],
  910. referencedClasses: []
  911. }),
  912. smalltalk.PackageWithDefaultCommitPathChangedTest);
  913. smalltalk.addMethod(
  914. unescape('_testZorkCommitPathJsShouldBeJavascript'),
  915. smalltalk.method({
  916. selector: unescape('testZorkCommitPathJsShouldBeJavascript'),
  917. category: 'tests',
  918. fn: function (){
  919. var self=this;
  920. smalltalk.send(self, "_assert_equals_", [unescape("javascripts/"), smalltalk.send(self['@zorkPackage'], "_commitPathJs", [])]);
  921. return self;},
  922. args: [],
  923. source: unescape('testZorkCommitPathJsShouldBeJavascript%0A%09self%20assert%3A%20%27javascripts/%27%20equals%3A%20zorkPackage%20commitPathJs'),
  924. messageSends: ["assert:equals:", "commitPathJs"],
  925. referencedClasses: []
  926. }),
  927. smalltalk.PackageWithDefaultCommitPathChangedTest);
  928. smalltalk.addMethod(
  929. unescape('_testZorkCommitPathStShouldBeSmalltalk'),
  930. smalltalk.method({
  931. selector: unescape('testZorkCommitPathStShouldBeSmalltalk'),
  932. category: 'tests',
  933. fn: function (){
  934. var self=this;
  935. smalltalk.send(self, "_assert_equals_", [unescape("smalltalk/"), smalltalk.send(self['@zorkPackage'], "_commitPathSt", [])]);
  936. return self;},
  937. args: [],
  938. source: unescape('testZorkCommitPathStShouldBeSmalltalk%0A%09self%20assert%3A%20%27smalltalk/%27%20equals%3A%20zorkPackage%20commitPathSt'),
  939. messageSends: ["assert:equals:", "commitPathSt"],
  940. referencedClasses: []
  941. }),
  942. smalltalk.PackageWithDefaultCommitPathChangedTest);
  943. smalltalk.addMethod(
  944. unescape('_shouldInheritSelectors'),
  945. smalltalk.method({
  946. selector: unescape('shouldInheritSelectors'),
  947. category: 'accessing',
  948. fn: function (){
  949. var self=this;
  950. return false;
  951. return self;},
  952. args: [],
  953. source: unescape('shouldInheritSelectors%0A%09%5E%20false'),
  954. messageSends: [],
  955. referencedClasses: []
  956. }),
  957. smalltalk.PackageWithDefaultCommitPathChangedTest.klass);
  958. smalltalk.addClass('BlockClosureTest', smalltalk.TestCase, [], 'Kernel-Tests');
  959. smalltalk.addMethod(
  960. unescape('_testValue'),
  961. smalltalk.method({
  962. selector: unescape('testValue'),
  963. category: 'tests',
  964. fn: function (){
  965. var self=this;
  966. smalltalk.send(self, "_assert_equals_", [smalltalk.send((function(){return (1) + (1);}), "_value", []), (2)]);
  967. 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)]);
  968. 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)]);
  969. smalltalk.send(self, "_assert_equals_", [smalltalk.send((function(a, b, c){return (1);}), "_value", []), (1)]);
  970. return self;},
  971. args: [],
  972. source: unescape('testValue%0A%09self%20assert%3A%20%28%5B1+1%5D%20value%29%20equals%3A%202.%0A%09self%20assert%3A%20%28%5B%3Ax%20%7C%20x%20+1%5D%20value%3A%202%29%20equals%3A%203.%0A%09self%20assert%3A%20%28%5B%3Ax%20%3Ay%20%7C%20x*y%5D%20value%3A%202%20value%3A%204%29%20equals%3A%208.%20%0A%0A%09%22Arguments%20are%20optional%20in%20Amber.%20This%20isn%27t%20ANSI%20compliant.%22%0A%0A%09self%20assert%3A%20%28%5B%3Aa%20%3Ab%20%3Ac%20%7C%201%5D%20value%29%20equals%3A%201'),
  973. messageSends: ["assert:equals:", "value", unescape("+"), "value:", "value:value:", unescape("*")],
  974. referencedClasses: []
  975. }),
  976. smalltalk.BlockClosureTest);
  977. smalltalk.addMethod(
  978. unescape('_testOnDo'),
  979. smalltalk.method({
  980. selector: unescape('testOnDo'),
  981. category: 'tests',
  982. fn: function (){
  983. var self=this;
  984. 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;})])]);
  985. return self;},
  986. args: [],
  987. source: unescape('testOnDo%0A%09self%20assert%3A%20%28%5BError%20new%20signal%5D%20on%3A%20Error%20do%3A%20%5B%3Aex%20%7C%20true%5D%29'),
  988. messageSends: ["assert:", "on:do:", "signal", "new"],
  989. referencedClasses: ["Error"]
  990. }),
  991. smalltalk.BlockClosureTest);
  992. smalltalk.addMethod(
  993. unescape('_testEnsure'),
  994. smalltalk.method({
  995. selector: unescape('testEnsure'),
  996. category: 'tests',
  997. fn: function (){
  998. var self=this;
  999. smalltalk.send(self, "_assert_", [smalltalk.send((function(){return smalltalk.send((smalltalk.Error || Error), "_new", []);}), "_ensure_", [(function(){return true;})])]);
  1000. return self;},
  1001. args: [],
  1002. source: unescape('testEnsure%0A%09self%20assert%3A%20%28%5BError%20new%5D%20ensure%3A%20%5Btrue%5D%29'),
  1003. messageSends: ["assert:", "ensure:", "new"],
  1004. referencedClasses: ["Error"]
  1005. }),
  1006. smalltalk.BlockClosureTest);
  1007. smalltalk.addMethod(
  1008. unescape('_testNumArgs'),
  1009. smalltalk.method({
  1010. selector: unescape('testNumArgs'),
  1011. category: 'tests',
  1012. fn: function (){
  1013. var self=this;
  1014. smalltalk.send(self, "_assert_equals_", [smalltalk.send((function(){return nil;}), "_numArgs", []), (0)]);
  1015. smalltalk.send(self, "_assert_equals_", [smalltalk.send((function(a, b){return nil;}), "_numArgs", []), (2)]);
  1016. return self;},
  1017. args: [],
  1018. source: unescape('testNumArgs%0A%09self%20assert%3A%20%5B%5D%20numArgs%20equals%3A%200.%0A%09self%20assert%3A%20%5B%3Aa%20%3Ab%20%7C%20%5D%20numArgs%20equals%3A%202'),
  1019. messageSends: ["assert:equals:", "numArgs"],
  1020. referencedClasses: []
  1021. }),
  1022. smalltalk.BlockClosureTest);
  1023. smalltalk.addMethod(
  1024. unescape('_testValueWithPossibleArguments'),
  1025. smalltalk.method({
  1026. selector: unescape('testValueWithPossibleArguments'),
  1027. category: 'tests',
  1028. fn: function (){
  1029. var self=this;
  1030. smalltalk.send(self, "_assert_equals_", [smalltalk.send((function(){return (1);}), "_valueWithPossibleArguments_", [[(3), (4)]]), (1)]);
  1031. 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)]);
  1032. 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)]);
  1033. return self;},
  1034. args: [],
  1035. source: unescape('testValueWithPossibleArguments%0A%09self%20assert%3A%20%28%5B1%5D%20valueWithPossibleArguments%3A%20%23%283%204%29%29%20equals%3A%201.%0A%09self%20assert%3A%20%28%5B%3Aa%20%7C%20a%20+%204%5D%20valueWithPossibleArguments%3A%20%23%283%204%29%29%20equals%3A%207.%0A%09self%20assert%3A%20%28%5B%3Aa%20%3Ab%20%7C%20a%20+%20b%5D%20valueWithPossibleArguments%3A%20%23%283%204%205%29%29%20equals%3A%207.'),
  1036. messageSends: ["assert:equals:", "valueWithPossibleArguments:", unescape("+")],
  1037. referencedClasses: []
  1038. }),
  1039. smalltalk.BlockClosureTest);
  1040. smalltalk.addMethod(
  1041. unescape('_testWhileTrue'),
  1042. smalltalk.method({
  1043. selector: unescape('testWhileTrue'),
  1044. category: 'tests',
  1045. fn: function (){
  1046. var self=this;
  1047. var i=nil;
  1048. (i=(0));
  1049. (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)])));})()}})();
  1050. smalltalk.send(self, "_assert_equals_", [i, (5)]);
  1051. (i=(0));
  1052. (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)]));})()) {}})();
  1053. smalltalk.send(self, "_assert_equals_", [i, (5)]);
  1054. return self;},
  1055. args: [],
  1056. source: unescape('testWhileTrue%0A%09%7C%20i%20%7C%0A%09i%20%3A%3D%200.%0A%09%5Bi%20%3C%205%5D%20whileTrue%3A%20%5Bi%20%3A%3D%20i%20+%201%5D.%0A%09self%20assert%3A%20i%20equals%3A%205.%0A%0A%09i%20%3A%3D%200.%0A%09%5Bi%20%3A%3D%20i%20+%201.%20i%20%3C%205%5D%20whileTrue.%0A%09self%20assert%3A%20i%20equals%3A%205'),
  1057. messageSends: ["whileTrue:", unescape("%3C"), unescape("+"), "assert:equals:", "whileTrue"],
  1058. referencedClasses: []
  1059. }),
  1060. smalltalk.BlockClosureTest);
  1061. smalltalk.addMethod(
  1062. unescape('_testWhileFalse'),
  1063. smalltalk.method({
  1064. selector: unescape('testWhileFalse'),
  1065. category: 'tests',
  1066. fn: function (){
  1067. var self=this;
  1068. var i=nil;
  1069. (i=(0));
  1070. (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)])));})()}})();
  1071. smalltalk.send(self, "_assert_equals_", [i, (6)]);
  1072. (i=(0));
  1073. (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)]));})()) {}})();
  1074. smalltalk.send(self, "_assert_equals_", [i, (6)]);
  1075. return self;},
  1076. args: [],
  1077. source: unescape('testWhileFalse%0A%09%7C%20i%20%7C%0A%09i%20%3A%3D%200.%0A%09%5Bi%20%3E%205%5D%20whileFalse%3A%20%5Bi%20%3A%3D%20i%20+%201%5D.%0A%09self%20assert%3A%20i%20equals%3A%206.%0A%0A%09i%20%3A%3D%200.%0A%09%5Bi%20%3A%3D%20i%20+%201.%20i%20%3E%205%5D%20whileFalse.%0A%09self%20assert%3A%20i%20equals%3A%206'),
  1078. messageSends: ["whileFalse:", unescape("%3E"), unescape("+"), "assert:equals:", "whileFalse"],
  1079. referencedClasses: []
  1080. }),
  1081. smalltalk.BlockClosureTest);
  1082. smalltalk.addMethod(
  1083. unescape('_testCompiledSource'),
  1084. smalltalk.method({
  1085. selector: unescape('testCompiledSource'),
  1086. category: 'tests',
  1087. fn: function (){
  1088. var self=this;
  1089. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((function(){return (1) + (1);}), "_compiledSource", []), "_includesSubString_", ["function"])]);
  1090. return self;},
  1091. args: [],
  1092. source: unescape('testCompiledSource%0A%09self%20assert%3A%20%28%5B1+1%5D%20compiledSource%20includesSubString%3A%20%27function%27%29'),
  1093. messageSends: ["assert:", "includesSubString:", "compiledSource", unescape("+")],
  1094. referencedClasses: []
  1095. }),
  1096. smalltalk.BlockClosureTest);
  1097. smalltalk.addClass('ObjectTest', smalltalk.TestCase, [], 'Kernel-Tests');
  1098. smalltalk.addMethod(
  1099. unescape('_testEquality'),
  1100. smalltalk.method({
  1101. selector: unescape('testEquality'),
  1102. category: 'tests',
  1103. fn: function (){
  1104. var self=this;
  1105. var o=nil;
  1106. (o=smalltalk.send((smalltalk.Object || Object), "_new", []));
  1107. smalltalk.send(self, "_deny_", [smalltalk.send(o, "__eq", [smalltalk.send((smalltalk.Object || Object), "_new", [])])]);
  1108. smalltalk.send(self, "_assert_", [smalltalk.send(o, "__eq", [o])]);
  1109. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(o, "_yourself", []), "__eq", [o])]);
  1110. smalltalk.send(self, "_assert_", [smalltalk.send(o, "__eq", [smalltalk.send(o, "_yourself", [])])]);
  1111. return self;},
  1112. args: [],
  1113. source: unescape('testEquality%0A%09%7C%20o%20%7C%0A%09o%20%3A%3D%20Object%20new.%0A%09self%20deny%3A%20o%20%3D%20Object%20new.%0A%09self%20assert%3A%20o%20%3D%20o.%0A%09self%20assert%3A%20o%20yourself%20%3D%20o.%0A%09self%20assert%3A%20o%20%3D%20o%20yourself'),
  1114. messageSends: ["new", "deny:", unescape("%3D"), "assert:", "yourself"],
  1115. referencedClasses: ["Object"]
  1116. }),
  1117. smalltalk.ObjectTest);
  1118. smalltalk.addMethod(
  1119. unescape('_testIdentity'),
  1120. smalltalk.method({
  1121. selector: unescape('testIdentity'),
  1122. category: 'tests',
  1123. fn: function (){
  1124. var self=this;
  1125. var o=nil;
  1126. (o=smalltalk.send((smalltalk.Object || Object), "_new", []));
  1127. smalltalk.send(self, "_deny_", [smalltalk.send(o, "__eq_eq", [smalltalk.send((smalltalk.Object || Object), "_new", [])])]);
  1128. smalltalk.send(self, "_assert_", [smalltalk.send(o, "__eq_eq", [o])]);
  1129. return self;},
  1130. args: [],
  1131. source: unescape('testIdentity%0A%09%7C%20o%20%7C%0A%09o%20%3A%3D%20Object%20new.%0A%09self%20deny%3A%20o%20%3D%3D%20Object%20new.%0A%09self%20assert%3A%20o%20%3D%3D%20o'),
  1132. messageSends: ["new", "deny:", unescape("%3D%3D"), "assert:"],
  1133. referencedClasses: ["Object"]
  1134. }),
  1135. smalltalk.ObjectTest);
  1136. smalltalk.addMethod(
  1137. unescape('_testHalt'),
  1138. smalltalk.method({
  1139. selector: unescape('testHalt'),
  1140. category: 'tests',
  1141. fn: function (){
  1142. var self=this;
  1143. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send(smalltalk.send((smalltalk.Object || Object), "_new", []), "_halt", []);}), (smalltalk.Error || Error)]);
  1144. return self;},
  1145. args: [],
  1146. source: unescape('testHalt%0A%09self%20should%3A%20%5BObject%20new%20halt%5D%20raise%3A%20Error'),
  1147. messageSends: ["should:raise:", "halt", "new"],
  1148. referencedClasses: ["Object", "Error"]
  1149. }),
  1150. smalltalk.ObjectTest);
  1151. smalltalk.addMethod(
  1152. unescape('_testBasicAccess'),
  1153. smalltalk.method({
  1154. selector: unescape('testBasicAccess'),
  1155. category: 'tests',
  1156. fn: function (){
  1157. var self=this;
  1158. var o=nil;
  1159. (o=smalltalk.send((smalltalk.Object || Object), "_new", []));
  1160. smalltalk.send(o, "_basicAt_put_", ["a", (1)]);
  1161. smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_basicAt_", ["a"]), (1)]);
  1162. smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_basicAt_", ["b"]), nil]);
  1163. return self;},
  1164. args: [],
  1165. source: unescape('testBasicAccess%0A%09%7C%20o%20%7C%0A%09o%20%3A%3D%20Object%20new.%0A%09o%20basicAt%3A%20%27a%27%20put%3A%201.%0A%09self%20assert%3A%20%28o%20basicAt%3A%20%27a%27%29%20equals%3A%201.%0A%09self%20assert%3A%20%28o%20basicAt%3A%20%27b%27%29%20equals%3A%20nil'),
  1166. messageSends: ["new", "basicAt:put:", "assert:equals:", "basicAt:"],
  1167. referencedClasses: ["Object"]
  1168. }),
  1169. smalltalk.ObjectTest);
  1170. smalltalk.addMethod(
  1171. unescape('_testNilUndefined'),
  1172. smalltalk.method({
  1173. selector: unescape('testNilUndefined'),
  1174. category: 'tests',
  1175. fn: function (){
  1176. var self=this;
  1177. smalltalk.send(self, "_assert_", [smalltalk.send(nil, "__eq", [(typeof undefined == 'undefined' ? nil : undefined)])]);
  1178. return self;},
  1179. args: [],
  1180. source: unescape('testNilUndefined%0A%09%22nil%20in%20Smalltalk%20is%20the%20undefined%20object%20in%20JS%22%0A%0A%09self%20assert%3A%20nil%20%3D%20undefined'),
  1181. messageSends: ["assert:", unescape("%3D")],
  1182. referencedClasses: []
  1183. }),
  1184. smalltalk.ObjectTest);
  1185. smalltalk.addMethod(
  1186. unescape('_testidentityHash'),
  1187. smalltalk.method({
  1188. selector: unescape('testidentityHash'),
  1189. category: 'tests',
  1190. fn: function (){
  1191. var self=this;
  1192. var o1=nil;
  1193. var o2=nil;
  1194. (o1=smalltalk.send((smalltalk.Object || Object), "_new", []));
  1195. (o2=smalltalk.send((smalltalk.Object || Object), "_new", []));
  1196. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(o1, "_identityHash", []), "__eq_eq", [smalltalk.send(o1, "_identityHash", [])])]);
  1197. smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send(o1, "_identityHash", []), "__eq_eq", [smalltalk.send(o2, "_identityHash", [])])]);
  1198. return self;},
  1199. args: [],
  1200. source: unescape('testidentityHash%0A%09%7C%20o1%20o2%20%7C%0A%09%0A%09o1%20%3A%3D%20Object%20new.%0A%09o2%20%3A%3D%20Object%20new.%0A%0A%09self%20assert%3A%20o1%20identityHash%20%3D%3D%20o1%20identityHash.%0A%09self%20deny%3A%20o1%20identityHash%20%3D%3D%20o2%20identityHash'),
  1201. messageSends: ["new", "assert:", unescape("%3D%3D"), "identityHash", "deny:"],
  1202. referencedClasses: ["Object"]
  1203. }),
  1204. smalltalk.ObjectTest);
  1205. smalltalk.addMethod(
  1206. unescape('_testBasicPerform'),
  1207. smalltalk.method({
  1208. selector: unescape('testBasicPerform'),
  1209. category: 'tests',
  1210. fn: function (){
  1211. var self=this;
  1212. var o=nil;
  1213. (o=smalltalk.send((smalltalk.Object || Object), "_new", []));
  1214. smalltalk.send(o, "_basicAt_put_", ["func", (function(){return "hello";})]);
  1215. smalltalk.send(o, "_basicAt_put_", ["func2", (function(a){return ((($receiver = a).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));})]);
  1216. smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_basicPerform_", ["func"]), "hello"]);
  1217. smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_basicPerform_withArguments_", ["func2", [(3)]]), (4)]);
  1218. return self;},
  1219. args: [],
  1220. source: unescape('testBasicPerform%0A%09%7C%20o%20%7C%0A%09o%20%3A%3D%20Object%20new.%0A%09o%20basicAt%3A%20%27func%27%20put%3A%20%5B%27hello%27%5D.%09%0A%09o%20basicAt%3A%20%27func2%27%20put%3A%20%5B%3Aa%20%7C%20a%20+%201%5D.%0A%0A%09self%20assert%3A%20%28o%20basicPerform%3A%20%27func%27%29%09%20equals%3A%20%27hello%27.%0A%09self%20assert%3A%20%28o%20basicPerform%3A%20%27func2%27%20withArguments%3A%20%23%283%29%29%20equals%3A%204'),
  1221. messageSends: ["new", "basicAt:put:", unescape("+"), "assert:equals:", "basicPerform:", "basicPerform:withArguments:"],
  1222. referencedClasses: ["Object"]
  1223. }),
  1224. smalltalk.ObjectTest);
  1225. smalltalk.addMethod(
  1226. unescape('_testIfNil'),
  1227. smalltalk.method({
  1228. selector: unescape('testIfNil'),
  1229. category: 'tests',
  1230. fn: function (){
  1231. var self=this;
  1232. smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send((smalltalk.Object || Object), "_new", []), "_isNil", [])]);
  1233. smalltalk.send(self, "_deny_", [smalltalk.send((($receiver = smalltalk.send((smalltalk.Object || Object), "_new", [])) == nil || $receiver == undefined) ? (function(){return true;})() : $receiver, "__eq", [true])]);
  1234. smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = smalltalk.send((smalltalk.Object || Object), "_new", [])) != nil && $receiver != undefined) ? (function(){return true;})() : nil, "__eq", [true])]);
  1235. smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = smalltalk.send((smalltalk.Object || Object), "_new", [])) == nil || $receiver == undefined) ? (function(){return false;})() : (function(){return true;})(), "__eq", [true])]);
  1236. smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = smalltalk.send((smalltalk.Object || Object), "_new", [])) == nil || $receiver == undefined) ? (function(){return false;})() : (function(){return true;})(), "__eq", [true])]);
  1237. return self;},
  1238. args: [],
  1239. source: unescape('testIfNil%0A%09self%20deny%3A%20Object%20new%20isNil.%0A%09self%20deny%3A%20%28Object%20new%20ifNil%3A%20%5Btrue%5D%29%20%3D%20true.%0A%09self%20assert%3A%20%28Object%20new%20ifNotNil%3A%20%5Btrue%5D%29%20%3D%20true.%0A%0A%09self%20assert%3A%20%28Object%20new%20ifNil%3A%20%5Bfalse%5D%20ifNotNil%3A%20%5Btrue%5D%29%20%3D%20true.%0A%09self%20assert%3A%20%28Object%20new%20ifNotNil%3A%20%5Btrue%5D%20ifNil%3A%20%5Bfalse%5D%29%20%3D%20true'),
  1240. messageSends: ["deny:", "isNil", "new", unescape("%3D"), "ifNil:", "assert:", "ifNotNil:", "ifNil:ifNotNil:", "ifNotNil:ifNil:"],
  1241. referencedClasses: ["Object"]
  1242. }),
  1243. smalltalk.ObjectTest);
  1244. smalltalk.addMethod(
  1245. unescape('_testInstVars'),
  1246. smalltalk.method({
  1247. selector: unescape('testInstVars'),
  1248. category: 'tests',
  1249. fn: function (){
  1250. var self=this;
  1251. var o=nil;
  1252. (o=smalltalk.send((smalltalk.ObjectMock || ObjectMock), "_new", []));
  1253. smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_instVarAt_", [smalltalk.symbolFor("foo")]), nil]);
  1254. smalltalk.send(o, "_instVarAt_put_", [smalltalk.symbolFor("foo"), (1)]);
  1255. smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_instVarAt_", [smalltalk.symbolFor("foo")]), (1)]);
  1256. smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_instVarAt_", ["foo"]), (1)]);
  1257. return self;},
  1258. args: [],
  1259. source: unescape('testInstVars%0A%09%7C%20o%20%7C%0A%09o%20%3A%3D%20ObjectMock%20new.%0A%09self%20assert%3A%20%28o%20instVarAt%3A%20%23foo%29%20equals%3A%20nil.%0A%0A%09o%20instVarAt%3A%20%23foo%20put%3A%201.%0A%09self%20assert%3A%20%28o%20instVarAt%3A%20%23foo%29%20equals%3A%201.%0A%09self%20assert%3A%20%28o%20instVarAt%3A%20%27foo%27%29%20equals%3A%201'),
  1260. messageSends: ["new", "assert:equals:", "instVarAt:", "instVarAt:put:"],
  1261. referencedClasses: ["ObjectMock"]
  1262. }),
  1263. smalltalk.ObjectTest);
  1264. smalltalk.addMethod(
  1265. unescape('_testYourself'),
  1266. smalltalk.method({
  1267. selector: unescape('testYourself'),
  1268. category: 'tests',
  1269. fn: function (){
  1270. var self=this;
  1271. var o=nil;
  1272. (o=smalltalk.send((smalltalk.ObjectMock || ObjectMock), "_new", []));
  1273. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(o, "_yourself", []), "__eq_eq", [o])]);
  1274. return self;},
  1275. args: [],
  1276. source: unescape('testYourself%0A%09%7C%20o%20%7C%0A%09o%20%3A%3D%20ObjectMock%20new.%0A%09self%20assert%3A%20o%20yourself%20%3D%3D%20o'),
  1277. messageSends: ["new", "assert:", unescape("%3D%3D"), "yourself"],
  1278. referencedClasses: ["ObjectMock"]
  1279. }),
  1280. smalltalk.ObjectTest);
  1281. smalltalk.addMethod(
  1282. unescape('_testDNU'),
  1283. smalltalk.method({
  1284. selector: unescape('testDNU'),
  1285. category: 'tests',
  1286. fn: function (){
  1287. var self=this;
  1288. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send(smalltalk.send((smalltalk.Object || Object), "_new", []), "_foo", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  1289. return self;},
  1290. args: [],
  1291. source: unescape('testDNU%0A%09self%20should%3A%20%5BObject%20new%20foo%5D%20raise%3A%20MessageNotUnderstood'),
  1292. messageSends: ["should:raise:", "foo", "new"],
  1293. referencedClasses: ["Object", "MessageNotUnderstood"]
  1294. }),
  1295. smalltalk.ObjectTest);
  1296. smalltalk.addClass('SymbolTest', smalltalk.TestCase, [], 'Kernel-Tests');
  1297. smalltalk.addMethod(
  1298. unescape('_testEquality'),
  1299. smalltalk.method({
  1300. selector: unescape('testEquality'),
  1301. category: 'tests',
  1302. fn: function (){
  1303. var self=this;
  1304. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq", [smalltalk.symbolFor("hello")])]);
  1305. smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq", [smalltalk.symbolFor("world")])]);
  1306. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq", [smalltalk.send(smalltalk.symbolFor("hello"), "_yourself", [])])]);
  1307. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_yourself", []), "__eq", [smalltalk.symbolFor("hello")])]);
  1308. smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq", ["hello"])]);
  1309. smalltalk.send(self, "_deny_", [smalltalk.send("hello", "__eq", [smalltalk.symbolFor("hello")])]);
  1310. return self;},
  1311. args: [],
  1312. source: unescape('testEquality%0A%09self%20assert%3A%20%23hello%20%3D%20%23hello.%0A%09self%20deny%3A%20%23hello%20%3D%20%23world.%0A%0A%09self%20assert%3A%20%23hello%20%20%3D%20%23hello%20yourself.%0A%09self%20assert%3A%20%23hello%20yourself%20%3D%20%23hello.%0A%0A%09self%20deny%3A%20%23hello%20%20%3D%20%27hello%27.%0A%09self%20deny%3A%20%27hello%27%20%3D%20%23hello.'),
  1313. messageSends: ["assert:", unescape("%3D"), "deny:", "yourself"],
  1314. referencedClasses: []
  1315. }),
  1316. smalltalk.SymbolTest);
  1317. smalltalk.addMethod(
  1318. unescape('_testAt'),
  1319. smalltalk.method({
  1320. selector: unescape('testAt'),
  1321. category: 'tests',
  1322. fn: function (){
  1323. var self=this;
  1324. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_at_", [(1)]), "__eq", ["h"])]);
  1325. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_at_", [(5)]), "__eq", ["o"])]);
  1326. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_at_ifAbsent_", [(6), (function(){return nil;})]), "__eq", [nil])]);
  1327. return self;},
  1328. args: [],
  1329. source: unescape('testAt%0A%09self%20assert%3A%20%28%23hello%20at%3A%201%29%20%3D%20%27h%27.%0A%09self%20assert%3A%20%28%23hello%20at%3A%205%29%20%3D%20%27o%27.%0A%09self%20assert%3A%20%28%23hello%20at%3A%206%20ifAbsent%3A%20%5Bnil%5D%29%20%3D%20nil'),
  1330. messageSends: ["assert:", unescape("%3D"), "at:", "at:ifAbsent:"],
  1331. referencedClasses: []
  1332. }),
  1333. smalltalk.SymbolTest);
  1334. smalltalk.addMethod(
  1335. unescape('_testAtPut'),
  1336. smalltalk.method({
  1337. selector: unescape('testAtPut'),
  1338. category: 'tests',
  1339. fn: function (){
  1340. var self=this;
  1341. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send("hello", "_at_put_", [(1), "a"]);}), (smalltalk.Error || Error)]);
  1342. return self;},
  1343. args: [],
  1344. source: unescape('testAtPut%0A%09%22Symbol%20instances%20are%20read-only%22%0A%09self%20should%3A%20%5B%27hello%27%20at%3A%201%20put%3A%20%27a%27%5D%20raise%3A%20Error'),
  1345. messageSends: ["should:raise:", "at:put:"],
  1346. referencedClasses: ["Error"]
  1347. }),
  1348. smalltalk.SymbolTest);
  1349. smalltalk.addMethod(
  1350. unescape('_testIdentity'),
  1351. smalltalk.method({
  1352. selector: unescape('testIdentity'),
  1353. category: 'tests',
  1354. fn: function (){
  1355. var self=this;
  1356. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq_eq", [smalltalk.symbolFor("hello")])]);
  1357. smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq_eq", [smalltalk.symbolFor("world")])]);
  1358. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq", [smalltalk.send(smalltalk.symbolFor("hello"), "_yourself", [])])]);
  1359. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_yourself", []), "__eq", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_asString", []), "_asSymbol", [])])]);
  1360. return self;},
  1361. args: [],
  1362. source: unescape('testIdentity%0A%09self%20assert%3A%20%23hello%20%3D%3D%20%23hello.%0A%09self%20deny%3A%20%23hello%20%3D%3D%20%23world.%0A%0A%09self%20assert%3A%20%23hello%20%20%3D%20%23hello%20yourself.%0A%09self%20assert%3A%20%23hello%20yourself%20%3D%20%23hello%20asString%20asSymbol'),
  1363. messageSends: ["assert:", unescape("%3D%3D"), "deny:", unescape("%3D"), "yourself", "asSymbol", "asString"],
  1364. referencedClasses: []
  1365. }),
  1366. smalltalk.SymbolTest);
  1367. smalltalk.addMethod(
  1368. unescape('_testComparing'),
  1369. smalltalk.method({
  1370. selector: unescape('testComparing'),
  1371. category: 'tests',
  1372. fn: function (){
  1373. var self=this;
  1374. smalltalk.send(self, "_assert_", [((($receiver = smalltalk.symbolFor("ab")).klass === smalltalk.Number) ? $receiver >smalltalk.symbolFor("aa") : smalltalk.send($receiver, "__gt", [smalltalk.symbolFor("aa")]))]);
  1375. smalltalk.send(self, "_deny_", [((($receiver = smalltalk.symbolFor("ab")).klass === smalltalk.Number) ? $receiver >smalltalk.symbolFor("ba") : smalltalk.send($receiver, "__gt", [smalltalk.symbolFor("ba")]))]);
  1376. smalltalk.send(self, "_assert_", [((($receiver = smalltalk.symbolFor("ab")).klass === smalltalk.Number) ? $receiver <smalltalk.symbolFor("ba") : smalltalk.send($receiver, "__lt", [smalltalk.symbolFor("ba")]))]);
  1377. smalltalk.send(self, "_deny_", [((($receiver = smalltalk.symbolFor("bb")).klass === smalltalk.Number) ? $receiver <smalltalk.symbolFor("ba") : smalltalk.send($receiver, "__lt", [smalltalk.symbolFor("ba")]))]);
  1378. smalltalk.send(self, "_assert_", [((($receiver = smalltalk.symbolFor("ab")).klass === smalltalk.Number) ? $receiver >=smalltalk.symbolFor("aa") : smalltalk.send($receiver, "__gt_eq", [smalltalk.symbolFor("aa")]))]);
  1379. smalltalk.send(self, "_deny_", [((($receiver = smalltalk.symbolFor("ab")).klass === smalltalk.Number) ? $receiver >=smalltalk.symbolFor("ba") : smalltalk.send($receiver, "__gt_eq", [smalltalk.symbolFor("ba")]))]);
  1380. smalltalk.send(self, "_assert_", [((($receiver = smalltalk.symbolFor("ab")).klass === smalltalk.Number) ? $receiver <=smalltalk.symbolFor("ba") : smalltalk.send($receiver, "__lt_eq", [smalltalk.symbolFor("ba")]))]);
  1381. smalltalk.send(self, "_deny_", [((($receiver = smalltalk.symbolFor("bb")).klass === smalltalk.Number) ? $receiver <=smalltalk.symbolFor("ba") : smalltalk.send($receiver, "__lt_eq", [smalltalk.symbolFor("ba")]))]);
  1382. return self;},
  1383. args: [],
  1384. source: unescape('testComparing%0A%09self%20assert%3A%20%23ab%20%3E%20%23aa.%0A%09self%20deny%3A%20%23ab%20%3E%20%23ba.%0A%0A%09self%20assert%3A%20%23ab%20%3C%20%23ba.%0A%09self%20deny%3A%20%23bb%20%3C%20%23ba.%0A%0A%09self%20assert%3A%20%23ab%20%3E%3D%20%23aa.%0A%09self%20deny%3A%20%23ab%20%3E%3D%20%23ba.%0A%0A%09self%20assert%3A%20%23ab%20%3C%3D%20%23ba.%0A%09self%20deny%3A%20%23bb%20%3C%3D%20%23ba'),
  1385. messageSends: ["assert:", unescape("%3E"), "deny:", unescape("%3C"), unescape("%3E%3D"), unescape("%3C%3D")],
  1386. referencedClasses: []
  1387. }),
  1388. smalltalk.SymbolTest);
  1389. smalltalk.addMethod(
  1390. unescape('_testSize'),
  1391. smalltalk.method({
  1392. selector: unescape('testSize'),
  1393. category: 'tests',
  1394. fn: function (){
  1395. var self=this;
  1396. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.symbolFor("a"), "_size", []), (1)]);
  1397. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.symbolFor("aaaaa"), "_size", []), (5)]);
  1398. return self;},
  1399. args: [],
  1400. source: unescape('testSize%0A%09self%20assert%3A%20%23a%20size%20equals%3A%201.%0A%09self%20assert%3A%20%23aaaaa%20size%20equals%3A%205'),
  1401. messageSends: ["assert:equals:", "size"],
  1402. referencedClasses: []
  1403. }),
  1404. smalltalk.SymbolTest);
  1405. smalltalk.addMethod(
  1406. unescape('_testAsString'),
  1407. smalltalk.method({
  1408. selector: unescape('testAsString'),
  1409. category: 'tests',
  1410. fn: function (){
  1411. var self=this;
  1412. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.symbolFor("hello"), "_asString", []), "hello"]);
  1413. return self;},
  1414. args: [],
  1415. source: unescape('testAsString%0A%09self%20assert%3A%20%23hello%20asString%20equals%3A%20%27hello%27'),
  1416. messageSends: ["assert:equals:", "asString"],
  1417. referencedClasses: []
  1418. }),
  1419. smalltalk.SymbolTest);
  1420. smalltalk.addMethod(
  1421. unescape('_testAsSymbol'),
  1422. smalltalk.method({
  1423. selector: unescape('testAsSymbol'),
  1424. category: 'tests',
  1425. fn: function (){
  1426. var self=this;
  1427. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq_eq", [smalltalk.send(smalltalk.symbolFor("hello"), "_asSymbol", [])])]);
  1428. return self;},
  1429. args: [],
  1430. source: unescape('testAsSymbol%0A%09self%20assert%3A%20%23hello%20%3D%3D%20%23hello%20asSymbol'),
  1431. messageSends: ["assert:", unescape("%3D%3D"), "asSymbol"],
  1432. referencedClasses: []
  1433. }),
  1434. smalltalk.SymbolTest);
  1435. smalltalk.addMethod(
  1436. unescape('_testCopying'),
  1437. smalltalk.method({
  1438. selector: unescape('testCopying'),
  1439. category: 'tests',
  1440. fn: function (){
  1441. var self=this;
  1442. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_copy", []), "__eq_eq", [smalltalk.symbolFor("hello")])]);
  1443. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_deepCopy", []), "__eq_eq", [smalltalk.symbolFor("hello")])]);
  1444. return self;},
  1445. args: [],
  1446. source: unescape('testCopying%0A%09self%20assert%3A%20%23hello%20copy%20%3D%3D%20%23hello.%0A%09self%20assert%3A%20%23hello%20deepCopy%20%3D%3D%20%23hello'),
  1447. messageSends: ["assert:", unescape("%3D%3D"), "copy", "deepCopy"],
  1448. referencedClasses: []
  1449. }),
  1450. smalltalk.SymbolTest);
  1451. smalltalk.addMethod(
  1452. unescape('_testIsSymbolIsString'),
  1453. smalltalk.method({
  1454. selector: unescape('testIsSymbolIsString'),
  1455. category: 'tests',
  1456. fn: function (){
  1457. var self=this;
  1458. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.symbolFor("hello"), "_isSymbol", [])]);
  1459. smalltalk.send(self, "_deny_", [smalltalk.send("hello", "_isSymbol", [])]);
  1460. smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.symbolFor("hello"), "_isString", [])]);
  1461. smalltalk.send(self, "_assert_", [smalltalk.send("hello", "_isString", [])]);
  1462. return self;},
  1463. args: [],
  1464. source: unescape('testIsSymbolIsString%0A%09self%20assert%3A%20%23hello%20isSymbol.%0A%09self%20deny%3A%20%27hello%27%20isSymbol.%0A%09self%20deny%3A%20%23hello%20isString.%0A%09self%20assert%3A%20%27hello%27%20isString'),
  1465. messageSends: ["assert:", "isSymbol", "deny:", "isString"],
  1466. referencedClasses: []
  1467. }),
  1468. smalltalk.SymbolTest);
  1469. smalltalk.addClass('ObjectMock', smalltalk.Object, ['foo', 'bar'], 'Kernel-Tests');
  1470. smalltalk.addMethod(
  1471. unescape('_foo'),
  1472. smalltalk.method({
  1473. selector: unescape('foo'),
  1474. category: 'not yet classified',
  1475. fn: function (){
  1476. var self=this;
  1477. return self['@foo'];
  1478. return self;},
  1479. args: [],
  1480. source: unescape('foo%0A%09%5Efoo'),
  1481. messageSends: [],
  1482. referencedClasses: []
  1483. }),
  1484. smalltalk.ObjectMock);
  1485. smalltalk.addMethod(
  1486. unescape('_foo_'),
  1487. smalltalk.method({
  1488. selector: unescape('foo%3A'),
  1489. category: 'not yet classified',
  1490. fn: function (anObject){
  1491. var self=this;
  1492. (self['@foo']=anObject);
  1493. return self;},
  1494. args: ["anObject"],
  1495. source: unescape('foo%3A%20anObject%0A%09foo%20%3A%3D%20anObject'),
  1496. messageSends: [],
  1497. referencedClasses: []
  1498. }),
  1499. smalltalk.ObjectMock);
  1500. smalltalk.addClass('UndefinedTest', smalltalk.TestCase, [], 'Kernel-Tests');
  1501. smalltalk.addMethod(
  1502. unescape('_testIsNil'),
  1503. smalltalk.method({
  1504. selector: unescape('testIsNil'),
  1505. category: 'tests',
  1506. fn: function (){
  1507. var self=this;
  1508. smalltalk.send(self, "_assert_", [smalltalk.send(nil, "_isNil", [])]);
  1509. smalltalk.send(self, "_deny_", [smalltalk.send(nil, "_notNil", [])]);
  1510. return self;},
  1511. args: [],
  1512. source: unescape('testIsNil%0A%09self%20assert%3A%20nil%20isNil.%0A%09self%20deny%3A%20nil%20notNil.'),
  1513. messageSends: ["assert:", "isNil", "deny:", "notNil"],
  1514. referencedClasses: []
  1515. }),
  1516. smalltalk.UndefinedTest);
  1517. smalltalk.addMethod(
  1518. unescape('_testIfNil'),
  1519. smalltalk.method({
  1520. selector: unescape('testIfNil'),
  1521. category: 'tests',
  1522. fn: function (){
  1523. var self=this;
  1524. smalltalk.send(self, "_assert_equals_", [(($receiver = nil) == nil || $receiver == undefined) ? (function(){return true;})() : $receiver, true]);
  1525. smalltalk.send(self, "_deny_", [smalltalk.send((($receiver = nil) != nil && $receiver != undefined) ? (function(){return true;})() : nil, "__eq", [true])]);
  1526. smalltalk.send(self, "_assert_equals_", [(($receiver = nil) == nil || $receiver == undefined) ? (function(){return true;})() : (function(){return false;})(), true]);
  1527. smalltalk.send(self, "_deny_", [smalltalk.send((($receiver = nil) == nil || $receiver == undefined) ? (function(){return false;})() : (function(){return true;})(), "__eq", [true])]);
  1528. return self;},
  1529. args: [],
  1530. source: unescape('testIfNil%0A%09self%20assert%3A%20%28nil%20ifNil%3A%20%5Btrue%5D%29%20equals%3A%20true.%0A%09self%20deny%3A%20%28nil%20ifNotNil%3A%20%5Btrue%5D%29%20%3D%20true.%0A%09self%20assert%3A%20%28nil%20ifNil%3A%20%5Btrue%5D%20ifNotNil%3A%20%5Bfalse%5D%29%20equals%3A%20true.%0A%09self%20deny%3A%20%28nil%20ifNotNil%3A%20%5Btrue%5D%20ifNil%3A%20%5Bfalse%5D%29%20%3D%20true'),
  1531. messageSends: ["assert:equals:", "ifNil:", "deny:", unescape("%3D"), "ifNotNil:", "ifNil:ifNotNil:", "ifNotNil:ifNil:"],
  1532. referencedClasses: []
  1533. }),
  1534. smalltalk.UndefinedTest);
  1535. smalltalk.addMethod(
  1536. unescape('_testCopying'),
  1537. smalltalk.method({
  1538. selector: unescape('testCopying'),
  1539. category: 'tests',
  1540. fn: function (){
  1541. var self=this;
  1542. smalltalk.send(self, "_assert_equals_", [smalltalk.send(nil, "_copy", []), nil]);
  1543. return self;},
  1544. args: [],
  1545. source: unescape('testCopying%0A%09self%20assert%3A%20nil%20copy%20equals%3A%20nil'),
  1546. messageSends: ["assert:equals:", "copy"],
  1547. referencedClasses: []
  1548. }),
  1549. smalltalk.UndefinedTest);
  1550. smalltalk.addMethod(
  1551. unescape('_testDeepCopy'),
  1552. smalltalk.method({
  1553. selector: unescape('testDeepCopy'),
  1554. category: 'tests',
  1555. fn: function (){
  1556. var self=this;
  1557. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(nil, "_deepCopy", []), "__eq", [nil])]);
  1558. return self;},
  1559. args: [],
  1560. source: unescape('testDeepCopy%0A%09self%20assert%3A%20nil%20deepCopy%20%3D%20nil'),
  1561. messageSends: ["assert:", unescape("%3D"), "deepCopy"],
  1562. referencedClasses: []
  1563. }),
  1564. smalltalk.UndefinedTest);
  1565. smalltalk.addClass('PointTest', smalltalk.TestCase, [], 'Kernel-Tests');
  1566. smalltalk.addMethod(
  1567. unescape('_testAccessing'),
  1568. smalltalk.method({
  1569. selector: unescape('testAccessing'),
  1570. category: 'tests',
  1571. fn: function (){
  1572. var self=this;
  1573. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send((smalltalk.Point || Point), "_x_y_", [(3), (4)]), "_x", []), (3)]);
  1574. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send((smalltalk.Point || Point), "_x_y_", [(3), (4)]), "_y", []), (4)]);
  1575. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Point || Point), "_new", []), "_x_", [(3)]), "_x", []), (3)]);
  1576. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Point || Point), "_new", []), "_y_", [(4)]), "_y", []), (4)]);
  1577. return self;},
  1578. args: [],
  1579. source: unescape('testAccessing%0A%09self%20assert%3A%20%28Point%20x%3A%203%20y%3A%204%29%20x%20equals%3A%203.%0A%09self%20assert%3A%20%28Point%20x%3A%203%20y%3A%204%29%20y%20equals%3A%204.%0A%09self%20assert%3A%20%28Point%20new%20x%3A%203%29%20x%20equals%3A%203.%0A%09self%20assert%3A%20%28Point%20new%20y%3A%204%29%20y%20equals%3A%204'),
  1580. messageSends: ["assert:equals:", "x", "x:y:", "y", "x:", "new", "y:"],
  1581. referencedClasses: ["Point"]
  1582. }),
  1583. smalltalk.PointTest);
  1584. smalltalk.addMethod(
  1585. unescape('_testAt'),
  1586. smalltalk.method({
  1587. selector: unescape('testAt'),
  1588. category: 'tests',
  1589. fn: function (){
  1590. var self=this;
  1591. smalltalk.send(self, "_assert_equals_", [smalltalk.send((3), "__at", [(4)]), smalltalk.send((smalltalk.Point || Point), "_x_y_", [(3), (4)])]);
  1592. return self;},
  1593. args: [],
  1594. source: unescape('testAt%0A%09self%20assert%3A%203@4%20equals%3A%20%28Point%20x%3A%203%20y%3A%204%29'),
  1595. messageSends: ["assert:equals:", unescape("@"), "x:y:"],
  1596. referencedClasses: ["Point"]
  1597. }),
  1598. smalltalk.PointTest);
  1599. smalltalk.addMethod(
  1600. unescape('_testEgality'),
  1601. smalltalk.method({
  1602. selector: unescape('testEgality'),
  1603. category: 'tests',
  1604. fn: function (){
  1605. var self=this;
  1606. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3), "__at", [(4)]), "__eq", [smalltalk.send((3), "__at", [(4)])])]);
  1607. smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send((3), "__at", [(5)]), "__eq", [smalltalk.send((3), "__at", [(6)])])]);
  1608. return self;},
  1609. args: [],
  1610. source: unescape('testEgality%0A%09self%20assert%3A%203@4%20%3D%20%283@4%29.%0A%09self%20deny%3A%203@5%20%3D%20%283@6%29'),
  1611. messageSends: ["assert:", unescape("%3D"), unescape("@"), "deny:"],
  1612. referencedClasses: []
  1613. }),
  1614. smalltalk.PointTest);
  1615. smalltalk.addMethod(
  1616. unescape('_testArithmetic'),
  1617. smalltalk.method({
  1618. selector: unescape('testArithmetic'),
  1619. category: 'tests',
  1620. fn: function (){
  1621. var self=this;
  1622. 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)])]);
  1623. 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)])]);
  1624. 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)])]);
  1625. 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)])]);
  1626. return self;},
  1627. args: [],
  1628. source: unescape('testArithmetic%0A%09self%20assert%3A%203@4%20*%20%283@4%20%29%20equals%3A%20%28Point%20x%3A%209%20y%3A%2016%29.%0A%09self%20assert%3A%203@4%20+%20%283@4%20%29%20equals%3A%20%28Point%20x%3A%206%20y%3A%208%29.%0A%09self%20assert%3A%203@4%20-%20%283@4%20%29%20equals%3A%20%28Point%20x%3A%200%20y%3A%200%29.%0A%09self%20assert%3A%206@8%20/%20%283@4%20%29%20equals%3A%20%28Point%20x%3A%202%20y%3A%202%29'),
  1629. messageSends: ["assert:equals:", unescape("*"), unescape("@"), "x:y:", unescape("+"), unescape("-"), unescape("/")],
  1630. referencedClasses: ["Point"]
  1631. }),
  1632. smalltalk.PointTest);
  1633. smalltalk.addClass('RandomTest', smalltalk.TestCase, [], 'Kernel-Tests');
  1634. smalltalk.addMethod(
  1635. unescape('_textNext'),
  1636. smalltalk.method({
  1637. selector: unescape('textNext'),
  1638. category: 'tests',
  1639. fn: function (){
  1640. var self=this;
  1641. smalltalk.send((10000), "_timesRepeat_", [(function(){var current=nil;
  1642. var next=nil;
  1643. (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]);})]);
  1644. return self;},
  1645. args: [],
  1646. source: unescape('textNext%0A%0A%0910000%20timesRepeat%3A%20%5B%0A%09%09%09%7C%20current%20next%20%7C%20%0A%09%09%09next%20%3A%3D%20Random%20new%20next.%0A%09%09%09self%20assert%3A%20%28next%20%3E%3D%200%29.%0A%09%09%09self%20assert%3A%20%28next%20%3C%201%29.%0A%09%09%09self%20deny%3A%20current%20%3D%20next.%0A%09%09%09next%20%3D%20current%5D'),
  1647. messageSends: ["timesRepeat:", "next", "new", "assert:", unescape("%3E%3D"), unescape("%3C"), "deny:", unescape("%3D")],
  1648. referencedClasses: ["Random"]
  1649. }),
  1650. smalltalk.RandomTest);
  1651. smalltalk.addClass('ClassBuilderTest', smalltalk.TestCase, ['builder', 'theClass'], 'Kernel-Tests');
  1652. smalltalk.addMethod(
  1653. unescape('_setUp'),
  1654. smalltalk.method({
  1655. selector: unescape('setUp'),
  1656. category: 'running',
  1657. fn: function (){
  1658. var self=this;
  1659. (self['@builder']=smalltalk.send((smalltalk.ClassBuilder || ClassBuilder), "_new", []));
  1660. return self;},
  1661. args: [],
  1662. source: unescape('setUp%0A%09builder%20%3A%3D%20ClassBuilder%20new'),
  1663. messageSends: ["new"],
  1664. referencedClasses: ["ClassBuilder"]
  1665. }),
  1666. smalltalk.ClassBuilderTest);
  1667. smalltalk.addMethod(
  1668. unescape('_tearDown'),
  1669. smalltalk.method({
  1670. selector: unescape('tearDown'),
  1671. category: 'running',
  1672. fn: function (){
  1673. var self=this;
  1674. (($receiver = self['@theClass']) != nil && $receiver != undefined) ? (function(){smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_removeClass_", [self['@theClass']]);return (self['@theClass']=nil);})() : nil;
  1675. return self;},
  1676. args: [],
  1677. source: unescape('tearDown%0A%09theClass%20ifNotNil%3A%20%5BSmalltalk%20current%20removeClass%3A%20theClass.%20theClass%20%3A%3D%20nil%5D'),
  1678. messageSends: ["ifNotNil:", "removeClass:", "current"],
  1679. referencedClasses: ["Smalltalk"]
  1680. }),
  1681. smalltalk.ClassBuilderTest);
  1682. smalltalk.addMethod(
  1683. unescape('_testClassCopy'),
  1684. smalltalk.method({
  1685. selector: unescape('testClassCopy'),
  1686. category: 'running',
  1687. fn: function (){
  1688. var self=this;
  1689. (self['@theClass']=smalltalk.send(self['@builder'], "_copyClass_named_", [(smalltalk.ObjectMock || ObjectMock), "ObjectMock2"]));
  1690. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(self['@theClass'], "_superclass", []), "__eq_eq", [smalltalk.send((smalltalk.ObjectMock || ObjectMock), "_superclass", [])])]);
  1691. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(self['@theClass'], "_instanceVariableNames", []), "__eq_eq", [smalltalk.send((smalltalk.ObjectMock || ObjectMock), "_instanceVariableNames", [])])]);
  1692. smalltalk.send(self, "_assert_equals_", [smalltalk.send(self['@theClass'], "_name", []), "ObjectMock2"]);
  1693. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(self['@theClass'], "_package", []), "__eq_eq", [smalltalk.send((smalltalk.ObjectMock || ObjectMock), "_package", [])])]);
  1694. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send(self['@theClass'], "_methodDictionary", []), "_keys", []), smalltalk.send(smalltalk.send((smalltalk.ObjectMock || ObjectMock), "_methodDictionary", []), "_keys", [])]);
  1695. return self;},
  1696. args: [],
  1697. source: unescape('testClassCopy%0A%09theClass%20%3A%3D%20builder%20copyClass%3A%20ObjectMock%20named%3A%20%27ObjectMock2%27.%0A%09self%20assert%3A%20theClass%20superclass%20%3D%3D%20ObjectMock%20superclass.%0A%09self%20assert%3A%20theClass%20instanceVariableNames%20%3D%3D%20ObjectMock%20instanceVariableNames.%0A%09self%20assert%3A%20theClass%20name%20equals%3A%20%27ObjectMock2%27.%0A%09self%20assert%3A%20theClass%20package%20%3D%3D%20ObjectMock%20package.%0A%09self%20assert%3A%20theClass%20methodDictionary%20keys%20equals%3A%20ObjectMock%20methodDictionary%20keys'),
  1698. messageSends: ["copyClass:named:", "assert:", unescape("%3D%3D"), "superclass", "instanceVariableNames", "assert:equals:", "name", "package", "keys", "methodDictionary"],
  1699. referencedClasses: ["ObjectMock"]
  1700. }),
  1701. smalltalk.ClassBuilderTest);
  1702. smalltalk.addMethod(
  1703. unescape('_testInstanceVariableNames'),
  1704. smalltalk.method({
  1705. selector: unescape('testInstanceVariableNames'),
  1706. category: 'running',
  1707. fn: function (){
  1708. var self=this;
  1709. smalltalk.send(self, "_assert_equals_", [smalltalk.send(self['@builder'], "_instanceVariableNamesFor_", [" hello world "]), ["hello", "world"]]);
  1710. return self;},
  1711. args: [],
  1712. source: unescape('testInstanceVariableNames%0A%09self%20assert%3A%20%28builder%20instanceVariableNamesFor%3A%20%27%20%20hello%20%20%20world%20%20%20%27%29%20equals%3A%20%23%28%27hello%27%20%27world%27%29'),
  1713. messageSends: ["assert:equals:", "instanceVariableNamesFor:"],
  1714. referencedClasses: []
  1715. }),
  1716. smalltalk.ClassBuilderTest);
  1717. smalltalk.addClass('SetTest', smalltalk.TestCase, [], 'Kernel-Tests');
  1718. smalltalk.addMethod(
  1719. unescape('_testUnicity'),
  1720. smalltalk.method({
  1721. selector: unescape('testUnicity'),
  1722. category: 'tests',
  1723. fn: function (){
  1724. var self=this;
  1725. var set=nil;
  1726. (set=smalltalk.send((smalltalk.Set || Set), "_new", []));
  1727. smalltalk.send(set, "_add_", [(21)]);
  1728. smalltalk.send(set, "_add_", ["hello"]);
  1729. smalltalk.send(set, "_add_", [(21)]);
  1730. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(set, "_size", []), "__eq", [(2)])]);
  1731. smalltalk.send(set, "_add_", ["hello"]);
  1732. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(set, "_size", []), "__eq", [(2)])]);
  1733. smalltalk.send(self, "_assert_equals_", [smalltalk.send(set, "_asArray", []), [(21), "hello"]]);
  1734. return self;},
  1735. args: [],
  1736. source: unescape('testUnicity%0A%09%7C%20set%20%7C%0A%09set%20%3A%3D%20Set%20new.%0A%09set%20add%3A%2021.%0A%09set%20add%3A%20%27hello%27.%0A%0A%09set%20add%3A%2021.%0A%09self%20assert%3A%20set%20size%20%3D%202.%0A%09%0A%09set%20add%3A%20%27hello%27.%0A%09self%20assert%3A%20set%20size%20%3D%202.%0A%0A%09self%20assert%3A%20set%20asArray%20equals%3A%20%23%2821%20%27hello%27%29'),
  1737. messageSends: ["new", "add:", "assert:", unescape("%3D"), "size", "assert:equals:", "asArray"],
  1738. referencedClasses: ["Set"]
  1739. }),
  1740. smalltalk.SetTest);
  1741. smalltalk.addMethod(
  1742. unescape('_testAt'),
  1743. smalltalk.method({
  1744. selector: unescape('testAt'),
  1745. category: 'tests',
  1746. fn: function (){
  1747. var self=this;
  1748. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send(smalltalk.send((smalltalk.Set || Set), "_new", []), "_at_put_", [(1), (2)]);}), (smalltalk.Error || Error)]);
  1749. return self;},
  1750. args: [],
  1751. source: unescape('testAt%0A%09self%20should%3A%20%5BSet%20new%20at%3A%201%20put%3A%202%5D%20raise%3A%20Error'),
  1752. messageSends: ["should:raise:", "at:put:", "new"],
  1753. referencedClasses: ["Set", "Error"]
  1754. }),
  1755. smalltalk.SetTest);
  1756. smalltalk.addMethod(
  1757. unescape('_testAddRemove'),
  1758. smalltalk.method({
  1759. selector: unescape('testAddRemove'),
  1760. category: 'tests',
  1761. fn: function (){
  1762. var self=this;
  1763. var set=nil;
  1764. (set=smalltalk.send((smalltalk.Set || Set), "_new", []));
  1765. smalltalk.send(self, "_assert_", [smalltalk.send(set, "_isEmpty", [])]);
  1766. smalltalk.send(set, "_add_", [(3)]);
  1767. smalltalk.send(self, "_assert_", [smalltalk.send(set, "_includes_", [(3)])]);
  1768. smalltalk.send(set, "_add_", [(5)]);
  1769. smalltalk.send(self, "_assert_", [smalltalk.send(set, "_includes_", [(5)])]);
  1770. smalltalk.send(set, "_remove_", [(3)]);
  1771. smalltalk.send(self, "_deny_", [smalltalk.send(set, "_includes_", [(3)])]);
  1772. return self;},
  1773. args: [],
  1774. source: unescape('testAddRemove%0A%09%7C%20set%20%7C%0A%09set%20%3A%3D%20Set%20new.%0A%09%0A%09self%20assert%3A%20set%20isEmpty.%0A%0A%09set%20add%3A%203.%0A%09self%20assert%3A%20%28set%20includes%3A%203%29.%0A%0A%09set%20add%3A%205.%0A%09self%20assert%3A%20%28set%20includes%3A%205%29.%0A%0A%09set%20remove%3A%203.%0A%09self%20deny%3A%20%28set%20includes%3A%203%29'),
  1775. messageSends: ["new", "assert:", "isEmpty", "add:", "includes:", "remove:", "deny:"],
  1776. referencedClasses: ["Set"]
  1777. }),
  1778. smalltalk.SetTest);
  1779. smalltalk.addMethod(
  1780. unescape('_testSize'),
  1781. smalltalk.method({
  1782. selector: unescape('testSize'),
  1783. category: 'tests',
  1784. fn: function (){
  1785. var self=this;
  1786. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send((smalltalk.Set || Set), "_new", []), "_size", []), (0)]);
  1787. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send((smalltalk.Set || Set), "_withAll_", [[(1), (2), (3), (4)]]), "_size", []), (4)]);
  1788. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send((smalltalk.Set || Set), "_withAll_", [[(1), (1), (1), (1)]]), "_size", []), (1)]);
  1789. return self;},
  1790. args: [],
  1791. source: unescape('testSize%0A%09self%20assert%3A%20Set%20new%20size%20equals%3A%200.%0A%09self%20assert%3A%20%28Set%20withAll%3A%20%23%281%202%203%204%29%29%20size%20equals%3A%204.%0A%09self%20assert%3A%20%28Set%20withAll%3A%20%23%281%201%201%201%29%29%20size%20equals%3A%201'),
  1792. messageSends: ["assert:equals:", "size", "new", "withAll:"],
  1793. referencedClasses: ["Set"]
  1794. }),
  1795. smalltalk.SetTest);