Kernel-Tests.deploy.js 62 KB

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