1
0

Kernel-Tests.deploy.js 74 KB

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