1
0

Kernel-Tests.deploy.js 85 KB

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