1
0

Kernel-Tests.deploy.js 65 KB

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