1
0

Kernel-Tests.js 109 KB

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