Kernel-Tests.deploy.js 71 KB

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