Kernel-Tests.deploy.js 116 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047
  1. smalltalk.addPackage('Kernel-Tests', {});
  2. smalltalk.addClass('BlockClosureTest', smalltalk.TestCase, [], 'Kernel-Tests');
  3. smalltalk.addMethod(
  4. "_testCanClearInterval",
  5. smalltalk.method({
  6. selector: "testCanClearInterval",
  7. fn: function () {
  8. var self=this;
  9. return smalltalk.withContext(function($ctx1) { _st(self)._shouldnt_raise_((function(){
  10. return smalltalk.withContext(function($ctx2) { return _st(_st((function(){
  11. return smalltalk.withContext(function($ctx3) { return _st(_st((smalltalk.Error || Error))._new())._signal();
  12. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}))._valueWithInterval_((0)))._clearInterval();
  13. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
  14. return self}, function($ctx1) {$ctx1.fill(self,"testCanClearInterval",{}, smalltalk.BlockClosureTest)});}
  15. }),
  16. smalltalk.BlockClosureTest);
  17. smalltalk.addMethod(
  18. "_testCanClearTimeout",
  19. smalltalk.method({
  20. selector: "testCanClearTimeout",
  21. fn: function () {
  22. var self=this;
  23. return smalltalk.withContext(function($ctx1) { _st(self)._shouldnt_raise_((function(){
  24. return smalltalk.withContext(function($ctx2) { return _st(_st((function(){
  25. return smalltalk.withContext(function($ctx3) { return _st(_st((smalltalk.Error || Error))._new())._signal();
  26. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}))._valueWithTimeout_((0)))._clearTimeout();
  27. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
  28. return self}, function($ctx1) {$ctx1.fill(self,"testCanClearTimeout",{}, smalltalk.BlockClosureTest)});}
  29. }),
  30. smalltalk.BlockClosureTest);
  31. smalltalk.addMethod(
  32. "_testCompiledSource",
  33. smalltalk.method({
  34. selector: "testCompiledSource",
  35. fn: function () {
  36. var self=this;
  37. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(_st((function(){
  38. return smalltalk.withContext(function($ctx2) { return _st((1)).__plus((1));
  39. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._compiledSource())._includesSubString_("function"));
  40. return self}, function($ctx1) {$ctx1.fill(self,"testCompiledSource",{}, smalltalk.BlockClosureTest)});}
  41. }),
  42. smalltalk.BlockClosureTest);
  43. smalltalk.addMethod(
  44. "_testCurrySelf",
  45. smalltalk.method({
  46. selector: "testCurrySelf",
  47. fn: function () {
  48. var self=this;
  49. var curriedMethod,array;
  50. return smalltalk.withContext(function($ctx1) { curriedMethod=_st(_st((function(selfarg,x){
  51. return smalltalk.withContext(function($ctx2) { return _st(selfarg)._at_(x);
  52. }, function($ctx2) {$ctx2.fillBlock({selfarg:selfarg,x:x},$ctx1)})}))._currySelf())._asCompiledMethod_("foo:");
  53. array=[(3), (1), (4)];
  54. _st(_st((smalltalk.ClassBuilder || ClassBuilder))._new())._installMethod_forClass_category_(curriedMethod,(smalltalk.Array || Array),"**test helper");
  55. _st((function(){
  56. return smalltalk.withContext(function($ctx2) { return _st(self)._assert_equals_((1),_st(array)._foo_((2)));
  57. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._ensure_((function(){
  58. return smalltalk.withContext(function($ctx2) { return _st((smalltalk.Array || Array))._removeCompiledMethod_(curriedMethod);
  59. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  60. return self}, function($ctx1) {$ctx1.fill(self,"testCurrySelf",{curriedMethod:curriedMethod,array:array}, smalltalk.BlockClosureTest)});}
  61. }),
  62. smalltalk.BlockClosureTest);
  63. smalltalk.addMethod(
  64. "_testEnsure",
  65. smalltalk.method({
  66. selector: "testEnsure",
  67. fn: function () {
  68. var self=this;
  69. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_((3),_st((function(){
  70. return smalltalk.withContext(function($ctx2) { return (3);
  71. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._ensure_((function(){
  72. return smalltalk.withContext(function($ctx2) { return (4);
  73. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
  74. return self}, function($ctx1) {$ctx1.fill(self,"testEnsure",{}, smalltalk.BlockClosureTest)});}
  75. }),
  76. smalltalk.BlockClosureTest);
  77. smalltalk.addMethod(
  78. "_testEnsureRaises",
  79. smalltalk.method({
  80. selector: "testEnsureRaises",
  81. fn: function () {
  82. var self=this;
  83. return smalltalk.withContext(function($ctx1) { _st(self)._should_raise_((function(){
  84. return smalltalk.withContext(function($ctx2) { return _st((function(){
  85. return smalltalk.withContext(function($ctx3) { return _st(_st((smalltalk.Error || Error))._new())._signal();
  86. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}))._ensure_((function(){
  87. return smalltalk.withContext(function($ctx3) { return true;
  88. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  89. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
  90. return self}, function($ctx1) {$ctx1.fill(self,"testEnsureRaises",{}, smalltalk.BlockClosureTest)});}
  91. }),
  92. smalltalk.BlockClosureTest);
  93. smalltalk.addMethod(
  94. "_testExceptionSemantics",
  95. smalltalk.method({
  96. selector: "testExceptionSemantics",
  97. fn: function () {
  98. var self=this;
  99. return smalltalk.withContext(function($ctx1) { _st(self)._timeout_((100));
  100. _st(_st(self)._async_((function(){
  101. return smalltalk.withContext(function($ctx2) { return _st((function(){
  102. return smalltalk.withContext(function($ctx3) { _st(self)._assert_(true);
  103. _st((smalltalk.Error || Error))._signal();
  104. _st(self)._deny_(true);
  105. return _st(self)._finished();
  106. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}))._on_do_((smalltalk.Error || Error),(function(ex){
  107. return smalltalk.withContext(function($ctx3) { return _st(self)._finished();
  108. }, function($ctx3) {$ctx3.fillBlock({ex:ex},$ctx1)})}));
  109. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._valueWithTimeout_((0));
  110. return self}, function($ctx1) {$ctx1.fill(self,"testExceptionSemantics",{}, smalltalk.BlockClosureTest)});}
  111. }),
  112. smalltalk.BlockClosureTest);
  113. smalltalk.addMethod(
  114. "_testNumArgs",
  115. smalltalk.method({
  116. selector: "testNumArgs",
  117. fn: function () {
  118. var self=this;
  119. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st((function(){
  120. return smalltalk.withContext(function($ctx2) { }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._numArgs(),(0));
  121. _st(self)._assert_equals_(_st((function(a,b){
  122. return smalltalk.withContext(function($ctx2) { }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})}))._numArgs(),(2));
  123. return self}, function($ctx1) {$ctx1.fill(self,"testNumArgs",{}, smalltalk.BlockClosureTest)});}
  124. }),
  125. smalltalk.BlockClosureTest);
  126. smalltalk.addMethod(
  127. "_testOnDo",
  128. smalltalk.method({
  129. selector: "testOnDo",
  130. fn: function () {
  131. var self=this;
  132. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st((function(){
  133. return smalltalk.withContext(function($ctx2) { return _st(_st((smalltalk.Error || Error))._new())._signal();
  134. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_((smalltalk.Error || Error),(function(ex){
  135. return smalltalk.withContext(function($ctx2) { return true;
  136. }, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1)})})));
  137. return self}, function($ctx1) {$ctx1.fill(self,"testOnDo",{}, smalltalk.BlockClosureTest)});}
  138. }),
  139. smalltalk.BlockClosureTest);
  140. smalltalk.addMethod(
  141. "_testValue",
  142. smalltalk.method({
  143. selector: "testValue",
  144. fn: function () {
  145. var self=this;
  146. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st((function(){
  147. return smalltalk.withContext(function($ctx2) { return _st((1)).__plus((1));
  148. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._value(),(2));
  149. _st(self)._assert_equals_(_st((function(x){
  150. return smalltalk.withContext(function($ctx2) { return _st(x).__plus((1));
  151. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})}))._value_((2)),(3));
  152. _st(self)._assert_equals_(_st((function(x,y){
  153. return smalltalk.withContext(function($ctx2) { return _st(x).__star(y);
  154. }, function($ctx2) {$ctx2.fillBlock({x:x,y:y},$ctx1)})}))._value_value_((2),(4)),(8));
  155. _st(self)._assert_equals_(_st((function(a,b,c){
  156. return smalltalk.withContext(function($ctx2) { return (1);
  157. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b,c:c},$ctx1)})}))._value(),(1));
  158. return self}, function($ctx1) {$ctx1.fill(self,"testValue",{}, smalltalk.BlockClosureTest)});}
  159. }),
  160. smalltalk.BlockClosureTest);
  161. smalltalk.addMethod(
  162. "_testValueWithPossibleArguments",
  163. smalltalk.method({
  164. selector: "testValueWithPossibleArguments",
  165. fn: function () {
  166. var self=this;
  167. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st((function(){
  168. return smalltalk.withContext(function($ctx2) { return (1);
  169. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._valueWithPossibleArguments_([(3), (4)]),(1));
  170. _st(self)._assert_equals_(_st((function(a){
  171. return smalltalk.withContext(function($ctx2) { return _st(a).__plus((4));
  172. }, function($ctx2) {$ctx2.fillBlock({a:a},$ctx1)})}))._valueWithPossibleArguments_([(3), (4)]),(7));
  173. _st(self)._assert_equals_(_st((function(a,b){
  174. return smalltalk.withContext(function($ctx2) { return _st(a).__plus(b);
  175. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})}))._valueWithPossibleArguments_([(3), (4), (5)]),(7));
  176. return self}, function($ctx1) {$ctx1.fill(self,"testValueWithPossibleArguments",{}, smalltalk.BlockClosureTest)});}
  177. }),
  178. smalltalk.BlockClosureTest);
  179. smalltalk.addMethod(
  180. "_testWhileFalse",
  181. smalltalk.method({
  182. selector: "testWhileFalse",
  183. fn: function () {
  184. var self=this;
  185. var i;
  186. return smalltalk.withContext(function($ctx1) { i=(0);
  187. _st((function(){
  188. return smalltalk.withContext(function($ctx2) { return _st(i).__gt((5));
  189. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileFalse_((function(){
  190. return smalltalk.withContext(function($ctx2) { i=_st(i).__plus((1));
  191. return i;
  192. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  193. _st(self)._assert_equals_(i,(6));
  194. i=(0);
  195. _st((function(){
  196. return smalltalk.withContext(function($ctx2) { i=_st(i).__plus((1));
  197. i;
  198. return _st(i).__gt((5));
  199. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileFalse();
  200. _st(self)._assert_equals_(i,(6));
  201. return self}, function($ctx1) {$ctx1.fill(self,"testWhileFalse",{i:i}, smalltalk.BlockClosureTest)});}
  202. }),
  203. smalltalk.BlockClosureTest);
  204. smalltalk.addMethod(
  205. "_testWhileTrue",
  206. smalltalk.method({
  207. selector: "testWhileTrue",
  208. fn: function () {
  209. var self=this;
  210. var i;
  211. return smalltalk.withContext(function($ctx1) { i=(0);
  212. _st((function(){
  213. return smalltalk.withContext(function($ctx2) { return _st(i).__lt((5));
  214. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
  215. return smalltalk.withContext(function($ctx2) { i=_st(i).__plus((1));
  216. return i;
  217. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  218. _st(self)._assert_equals_(i,(5));
  219. i=(0);
  220. _st((function(){
  221. return smalltalk.withContext(function($ctx2) { i=_st(i).__plus((1));
  222. i;
  223. return _st(i).__lt((5));
  224. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue();
  225. _st(self)._assert_equals_(i,(5));
  226. return self}, function($ctx1) {$ctx1.fill(self,"testWhileTrue",{i:i}, smalltalk.BlockClosureTest)});}
  227. }),
  228. smalltalk.BlockClosureTest);
  229. smalltalk.addClass('BooleanTest', smalltalk.TestCase, [], 'Kernel-Tests');
  230. smalltalk.addMethod(
  231. "_testEquality",
  232. smalltalk.method({
  233. selector: "testEquality",
  234. fn: function () {
  235. var self=this;
  236. return smalltalk.withContext(function($ctx1) { _st(self)._deny_(_st((0)).__eq(false));
  237. _st(self)._deny_(_st(false).__eq((0)));
  238. _st(self)._deny_(_st("").__eq(false));
  239. _st(self)._deny_(_st(false).__eq(""));
  240. _st(self)._assert_(_st(true).__eq(true));
  241. _st(self)._deny_(_st(false).__eq(true));
  242. _st(self)._deny_(_st(true).__eq(false));
  243. _st(self)._assert_(_st(false).__eq(false));
  244. _st(self)._assert_(_st(_st(true)._yourself()).__eq(true));
  245. _st(self)._assert_(_st(_st(true)._yourself()).__eq(_st(true)._yourself()));
  246. return self}, function($ctx1) {$ctx1.fill(self,"testEquality",{}, smalltalk.BooleanTest)});}
  247. }),
  248. smalltalk.BooleanTest);
  249. smalltalk.addMethod(
  250. "_testIdentity",
  251. smalltalk.method({
  252. selector: "testIdentity",
  253. fn: function () {
  254. var self=this;
  255. return smalltalk.withContext(function($ctx1) { _st(self)._deny_(_st((0)).__eq_eq(false));
  256. _st(self)._deny_(_st(false).__eq_eq((0)));
  257. _st(self)._deny_(_st("").__eq_eq(false));
  258. _st(self)._deny_(_st(false).__eq_eq(""));
  259. _st(self)._assert_(_st(true).__eq_eq(true));
  260. _st(self)._deny_(_st(false).__eq_eq(true));
  261. _st(self)._deny_(_st(true).__eq_eq(false));
  262. _st(self)._assert_(_st(false).__eq_eq(false));
  263. _st(self)._assert_(_st(_st(true)._yourself()).__eq_eq(true));
  264. _st(self)._assert_(_st(_st(true)._yourself()).__eq_eq(_st(true)._yourself()));
  265. return self}, function($ctx1) {$ctx1.fill(self,"testIdentity",{}, smalltalk.BooleanTest)});}
  266. }),
  267. smalltalk.BooleanTest);
  268. smalltalk.addMethod(
  269. "_testIfTrueIfFalse",
  270. smalltalk.method({
  271. selector: "testIfTrueIfFalse",
  272. fn: function () {
  273. var self=this;
  274. return smalltalk.withContext(function($ctx1) { var $1,$3,$2,$4,$6,$5,$7,$9,$8,$10,$12,$11,$13,$15,$14,$16,$18,$17,$19,$21,$20,$22,$24,$23;
  275. $1=self;
  276. if(smalltalk.assert(true)){
  277. $3="alternative block";
  278. };
  279. $2=_st($3).__eq("alternative block");
  280. _st($1)._assert_($2);
  281. $4=self;
  282. if(! smalltalk.assert(true)){
  283. $6="alternative block";
  284. };
  285. $5=_st($6).__eq(nil);
  286. _st($4)._assert_($5);
  287. $7=self;
  288. if(smalltalk.assert(false)){
  289. $9="alternative block";
  290. };
  291. $8=_st($9).__eq(nil);
  292. _st($7)._assert_($8);
  293. $10=self;
  294. if(! smalltalk.assert(false)){
  295. $12="alternative block";
  296. };
  297. $11=_st($12).__eq("alternative block");
  298. _st($10)._assert_($11);
  299. $13=self;
  300. if(smalltalk.assert(false)){
  301. $15="alternative block";
  302. } else {
  303. $15="alternative block2";
  304. };
  305. $14=_st($15).__eq("alternative block2");
  306. _st($13)._assert_($14);
  307. $16=self;
  308. if(smalltalk.assert(false)){
  309. $18="alternative block2";
  310. } else {
  311. $18="alternative block";
  312. };
  313. $17=_st($18).__eq("alternative block");
  314. _st($16)._assert_($17);
  315. $19=self;
  316. if(smalltalk.assert(true)){
  317. $21="alternative block";
  318. } else {
  319. $21="alternative block2";
  320. };
  321. $20=_st($21).__eq("alternative block");
  322. _st($19)._assert_($20);
  323. $22=self;
  324. if(smalltalk.assert(true)){
  325. $24="alternative block2";
  326. } else {
  327. $24="alternative block";
  328. };
  329. $23=_st($24).__eq("alternative block2");
  330. _st($22)._assert_($23);
  331. return self}, function($ctx1) {$ctx1.fill(self,"testIfTrueIfFalse",{}, smalltalk.BooleanTest)});}
  332. }),
  333. smalltalk.BooleanTest);
  334. smalltalk.addMethod(
  335. "_testIfTrueIfFalseWithBoxing",
  336. smalltalk.method({
  337. selector: "testIfTrueIfFalseWithBoxing",
  338. fn: function () {
  339. var self=this;
  340. return smalltalk.withContext(function($ctx1) { var $1,$4,$3,$2,$5,$8,$7,$6,$9,$12,$11,$10,$13,$16,$15,$14,$17,$20,$19,$18,$21,$24,$23,$22,$25,$28,$27,$26,$29,$32,$31,$30;
  341. $1=self;
  342. $4=_st(true)._yourself();
  343. if(smalltalk.assert($4)){
  344. $3="alternative block";
  345. };
  346. $2=_st($3).__eq("alternative block");
  347. _st($1)._assert_($2);
  348. $5=self;
  349. $8=_st(true)._yourself();
  350. if(! smalltalk.assert($8)){
  351. $7="alternative block";
  352. };
  353. $6=_st($7).__eq(nil);
  354. _st($5)._assert_($6);
  355. $9=self;
  356. $12=_st(false)._yourself();
  357. if(smalltalk.assert($12)){
  358. $11="alternative block";
  359. };
  360. $10=_st($11).__eq(nil);
  361. _st($9)._assert_($10);
  362. $13=self;
  363. $16=_st(false)._yourself();
  364. if(! smalltalk.assert($16)){
  365. $15="alternative block";
  366. };
  367. $14=_st($15).__eq("alternative block");
  368. _st($13)._assert_($14);
  369. $17=self;
  370. $20=_st(false)._yourself();
  371. if(smalltalk.assert($20)){
  372. $19="alternative block";
  373. } else {
  374. $19="alternative block2";
  375. };
  376. $18=_st($19).__eq("alternative block2");
  377. _st($17)._assert_($18);
  378. $21=self;
  379. $24=_st(false)._yourself();
  380. if(smalltalk.assert($24)){
  381. $23="alternative block2";
  382. } else {
  383. $23="alternative block";
  384. };
  385. $22=_st($23).__eq("alternative block");
  386. _st($21)._assert_($22);
  387. $25=self;
  388. $28=_st(true)._yourself();
  389. if(smalltalk.assert($28)){
  390. $27="alternative block";
  391. } else {
  392. $27="alternative block2";
  393. };
  394. $26=_st($27).__eq("alternative block");
  395. _st($25)._assert_($26);
  396. $29=self;
  397. $32=_st(true)._yourself();
  398. if(smalltalk.assert($32)){
  399. $31="alternative block2";
  400. } else {
  401. $31="alternative block";
  402. };
  403. $30=_st($31).__eq("alternative block2");
  404. _st($29)._assert_($30);
  405. return self}, function($ctx1) {$ctx1.fill(self,"testIfTrueIfFalseWithBoxing",{}, smalltalk.BooleanTest)});}
  406. }),
  407. smalltalk.BooleanTest);
  408. smalltalk.addMethod(
  409. "_testLogic",
  410. smalltalk.method({
  411. selector: "testLogic",
  412. fn: function () {
  413. var self=this;
  414. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5,$6,$7,$8;
  415. $1=self;
  416. _st($1)._assert_(_st(true).__and(true));
  417. _st($1)._deny_(_st(true).__and(false));
  418. _st($1)._deny_(_st(false).__and(true));
  419. $2=_st($1)._deny_(_st(false).__and(false));
  420. $3=self;
  421. _st($3)._assert_(_st(true).__or(true));
  422. _st($3)._assert_(_st(true).__or(false));
  423. _st($3)._assert_(_st(false).__or(true));
  424. $4=_st($3)._deny_(_st(false).__or(false));
  425. $5=self;
  426. _st($5)._assert_(_st(true).__and(_st((1)).__gt((0))));
  427. _st($5)._deny_(_st(_st((1)).__gt((0))).__and(false));
  428. $6=_st($5)._deny_(_st(_st((1)).__gt((0))).__and(_st((1)).__gt((2))));
  429. $7=self;
  430. _st($7)._assert_(_st(false).__or(_st((1)).__gt((0))));
  431. _st($7)._assert_(_st(_st((1)).__gt((0))).__or(false));
  432. $8=_st($7)._assert_(_st(_st((1)).__gt((0))).__or(_st((1)).__gt((2))));
  433. return self}, function($ctx1) {$ctx1.fill(self,"testLogic",{}, smalltalk.BooleanTest)});}
  434. }),
  435. smalltalk.BooleanTest);
  436. smalltalk.addMethod(
  437. "_testLogicKeywords",
  438. smalltalk.method({
  439. selector: "testLogicKeywords",
  440. fn: function () {
  441. var self=this;
  442. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5,$6,$7,$8;
  443. $1=self;
  444. _st($1)._assert_(_st(true)._and_((function(){
  445. return smalltalk.withContext(function($ctx2) { return true;
  446. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
  447. _st($1)._deny_(_st(true)._and_((function(){
  448. return smalltalk.withContext(function($ctx2) { return false;
  449. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
  450. _st($1)._deny_(_st(false)._and_((function(){
  451. return smalltalk.withContext(function($ctx2) { return true;
  452. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
  453. $2=_st($1)._deny_(_st(false)._and_((function(){
  454. return smalltalk.withContext(function($ctx2) { return false;
  455. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
  456. $3=self;
  457. _st($3)._assert_(_st(true)._or_((function(){
  458. return smalltalk.withContext(function($ctx2) { return true;
  459. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
  460. _st($3)._assert_(_st(true)._or_((function(){
  461. return smalltalk.withContext(function($ctx2) { return false;
  462. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
  463. _st($3)._assert_(_st(false)._or_((function(){
  464. return smalltalk.withContext(function($ctx2) { return true;
  465. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
  466. $4=_st($3)._deny_(_st(false)._or_((function(){
  467. return smalltalk.withContext(function($ctx2) { return false;
  468. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
  469. $5=self;
  470. _st($5)._assert_(_st(true)._and_((function(){
  471. return smalltalk.withContext(function($ctx2) { return _st((1)).__gt((0));
  472. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
  473. _st($5)._deny_(_st(_st((1)).__gt((0)))._and_((function(){
  474. return smalltalk.withContext(function($ctx2) { return false;
  475. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
  476. $6=_st($5)._deny_(_st(_st((1)).__gt((0)))._and_((function(){
  477. return smalltalk.withContext(function($ctx2) { return _st((1)).__gt((2));
  478. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
  479. $7=self;
  480. _st($7)._assert_(_st(false)._or_((function(){
  481. return smalltalk.withContext(function($ctx2) { return _st((1)).__gt((0));
  482. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
  483. _st($7)._assert_(_st(_st((1)).__gt((0)))._or_((function(){
  484. return smalltalk.withContext(function($ctx2) { return false;
  485. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
  486. $8=_st($7)._assert_(_st(_st((1)).__gt((0)))._or_((function(){
  487. return smalltalk.withContext(function($ctx2) { return _st((1)).__gt((2));
  488. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
  489. return self}, function($ctx1) {$ctx1.fill(self,"testLogicKeywords",{}, smalltalk.BooleanTest)});}
  490. }),
  491. smalltalk.BooleanTest);
  492. smalltalk.addMethod(
  493. "_testNonBooleanError",
  494. smalltalk.method({
  495. selector: "testNonBooleanError",
  496. fn: function () {
  497. var self=this;
  498. return smalltalk.withContext(function($ctx1) { var $1,$2;
  499. $1=self;
  500. $2=(function(){
  501. return smalltalk.withContext(function($ctx2) { if(smalltalk.assert("")){
  502. } else {
  503. };
  504. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
  505. _st($1)._should_raise_($2,(smalltalk.NonBooleanReceiver || NonBooleanReceiver));
  506. return self}, function($ctx1) {$ctx1.fill(self,"testNonBooleanError",{}, smalltalk.BooleanTest)});}
  507. }),
  508. smalltalk.BooleanTest);
  509. smalltalk.addClass('ClassBuilderTest', smalltalk.TestCase, ['builder', 'theClass'], 'Kernel-Tests');
  510. smalltalk.addMethod(
  511. "_setUp",
  512. smalltalk.method({
  513. selector: "setUp",
  514. fn: function () {
  515. var self=this;
  516. return smalltalk.withContext(function($ctx1) { self["@builder"]=_st((smalltalk.ClassBuilder || ClassBuilder))._new();
  517. return self}, function($ctx1) {$ctx1.fill(self,"setUp",{}, smalltalk.ClassBuilderTest)});}
  518. }),
  519. smalltalk.ClassBuilderTest);
  520. smalltalk.addMethod(
  521. "_tearDown",
  522. smalltalk.method({
  523. selector: "tearDown",
  524. fn: function () {
  525. var self=this;
  526. return smalltalk.withContext(function($ctx1) { var $1;
  527. $1=self["@theClass"];
  528. if(($receiver = $1) == nil || $receiver == undefined){
  529. $1;
  530. } else {
  531. _st(_st((smalltalk.Smalltalk || Smalltalk))._current())._removeClass_(self["@theClass"]);
  532. self["@theClass"]=nil;
  533. self["@theClass"];
  534. };
  535. return self}, function($ctx1) {$ctx1.fill(self,"tearDown",{}, smalltalk.ClassBuilderTest)});}
  536. }),
  537. smalltalk.ClassBuilderTest);
  538. smalltalk.addMethod(
  539. "_testClassCopy",
  540. smalltalk.method({
  541. selector: "testClassCopy",
  542. fn: function () {
  543. var self=this;
  544. return smalltalk.withContext(function($ctx1) { self["@theClass"]=_st(self["@builder"])._copyClass_named_((smalltalk.ObjectMock || ObjectMock),"ObjectMock2");
  545. _st(self)._assert_(_st(_st(self["@theClass"])._superclass()).__eq_eq(_st((smalltalk.ObjectMock || ObjectMock))._superclass()));
  546. _st(self)._assert_(_st(_st(self["@theClass"])._instanceVariableNames()).__eq_eq(_st((smalltalk.ObjectMock || ObjectMock))._instanceVariableNames()));
  547. _st(self)._assert_equals_(_st(self["@theClass"])._name(),"ObjectMock2");
  548. _st(self)._assert_(_st(_st(self["@theClass"])._package()).__eq_eq(_st((smalltalk.ObjectMock || ObjectMock))._package()));
  549. _st(self)._assert_equals_(_st(_st(self["@theClass"])._methodDictionary())._keys(),_st(_st((smalltalk.ObjectMock || ObjectMock))._methodDictionary())._keys());
  550. return self}, function($ctx1) {$ctx1.fill(self,"testClassCopy",{}, smalltalk.ClassBuilderTest)});}
  551. }),
  552. smalltalk.ClassBuilderTest);
  553. smalltalk.addMethod(
  554. "_testClassMigration",
  555. smalltalk.method({
  556. selector: "testClassMigration",
  557. fn: function () {
  558. var self=this;
  559. var instance,oldClass;
  560. return smalltalk.withContext(function($ctx1) { oldClass=_st(self["@builder"])._copyClass_named_((smalltalk.ObjectMock || ObjectMock),"ObjectMock2");
  561. instance=_st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._at_("ObjectMock2"))._new();
  562. _st((smalltalk.ObjectMock || ObjectMock))._subclass_instanceVariableNames_package_(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._at_("ObjectMock2"),"","Kernel-Tests");
  563. _st(self)._deny_(_st(oldClass).__eq_eq((smalltalk.ObjectMock2 || ObjectMock2)));
  564. _st(self)._assert_(_st(_st((smalltalk.ObjectMock2 || ObjectMock2))._superclass()).__eq_eq((smalltalk.ObjectMock || ObjectMock)));
  565. _st(self)._assert_(_st(_st((smalltalk.ObjectMock2 || ObjectMock2))._instanceVariableNames())._isEmpty());
  566. _st(self)._assert_equals_(_st((smalltalk.ObjectMock2 || ObjectMock2))._selectors(),_st(oldClass)._selectors());
  567. _st(self)._assert_equals_(_st((smalltalk.ObjectMock2 || ObjectMock2))._comment(),_st(oldClass)._comment());
  568. _st(self)._assert_equals_(_st(_st((smalltalk.ObjectMock2 || ObjectMock2))._package())._name(),"Kernel-Tests");
  569. _st(self)._deny_(_st(_st(instance)._class()).__eq_eq((smalltalk.ObjectMock2 || ObjectMock2)));
  570. _st(self)._assert_equals_(_st(_st(instance)._class())._name(),"OldObjectMock2");
  571. _st(self)._assert_(_st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._at_("OldObjectMock2"))._isNil());
  572. _st(_st((smalltalk.Smalltalk || Smalltalk))._current())._removeClass_((smalltalk.ObjectMock2 || ObjectMock2));
  573. return self}, function($ctx1) {$ctx1.fill(self,"testClassMigration",{instance:instance,oldClass:oldClass}, smalltalk.ClassBuilderTest)});}
  574. }),
  575. smalltalk.ClassBuilderTest);
  576. smalltalk.addMethod(
  577. "_testClassMigrationWithClassInstanceVariables",
  578. smalltalk.method({
  579. selector: "testClassMigrationWithClassInstanceVariables",
  580. fn: function () {
  581. var self=this;
  582. return smalltalk.withContext(function($ctx1) { _st(self["@builder"])._copyClass_named_((smalltalk.ObjectMock || ObjectMock),"ObjectMock2");
  583. _st(_st((smalltalk.ObjectMock2 || ObjectMock2))._class())._instanceVariableNames_("foo bar");
  584. _st((smalltalk.ObjectMock || ObjectMock))._subclass_instanceVariableNames_package_(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._at_("ObjectMock2"),"","Kernel-Tests");
  585. _st(self)._assert_equals_(_st(_st((smalltalk.ObjectMock2 || ObjectMock2))._class())._instanceVariableNames(),["foo", "bar"]);
  586. _st(_st((smalltalk.Smalltalk || Smalltalk))._current())._removeClass_((smalltalk.ObjectMock2 || ObjectMock2));
  587. return self}, function($ctx1) {$ctx1.fill(self,"testClassMigrationWithClassInstanceVariables",{}, smalltalk.ClassBuilderTest)});}
  588. }),
  589. smalltalk.ClassBuilderTest);
  590. smalltalk.addMethod(
  591. "_testClassMigrationWithSubclasses",
  592. smalltalk.method({
  593. selector: "testClassMigrationWithSubclasses",
  594. fn: function () {
  595. var self=this;
  596. return smalltalk.withContext(function($ctx1) { _st(self["@builder"])._copyClass_named_((smalltalk.ObjectMock || ObjectMock),"ObjectMock2");
  597. _st((smalltalk.ObjectMock2 || ObjectMock2))._subclass_instanceVariableNames_package_("ObjectMock3","","Kernel-Tests");
  598. _st((smalltalk.ObjectMock3 || ObjectMock3))._subclass_instanceVariableNames_package_("ObjectMock4","","Kernel-Tests");
  599. _st((smalltalk.ObjectMock || ObjectMock))._subclass_instanceVariableNames_package_(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._at_("ObjectMock2"),"","Kernel-Tests");
  600. _st(self)._assert_(_st(_st((smalltalk.ObjectMock || ObjectMock))._subclasses())._includes_((smalltalk.ObjectMock2 || ObjectMock2)));
  601. _st(self)._assert_(_st(_st((smalltalk.ObjectMock2 || ObjectMock2))._subclasses())._includes_((smalltalk.ObjectMock3 || ObjectMock3)));
  602. _st(self)._assert_(_st(_st((smalltalk.ObjectMock3 || ObjectMock3))._subclasses())._includes_((smalltalk.ObjectMock4 || ObjectMock4)));
  603. _st(_st((smalltalk.ObjectMock || ObjectMock))._allSubclasses())._do_((function(each){
  604. return smalltalk.withContext(function($ctx2) { return _st(_st((smalltalk.Smalltalk || Smalltalk))._current())._removeClass_(each);
  605. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  606. return self}, function($ctx1) {$ctx1.fill(self,"testClassMigrationWithSubclasses",{}, smalltalk.ClassBuilderTest)});}
  607. }),
  608. smalltalk.ClassBuilderTest);
  609. smalltalk.addMethod(
  610. "_testInstanceVariableNames",
  611. smalltalk.method({
  612. selector: "testInstanceVariableNames",
  613. fn: function () {
  614. var self=this;
  615. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(self["@builder"])._instanceVariableNamesFor_(" hello world "),["hello", "world"]);
  616. return self}, function($ctx1) {$ctx1.fill(self,"testInstanceVariableNames",{}, smalltalk.ClassBuilderTest)});}
  617. }),
  618. smalltalk.ClassBuilderTest);
  619. smalltalk.addClass('CollectionTest', smalltalk.TestCase, [], 'Kernel-Tests');
  620. smalltalk.addMethod(
  621. "_assertSameContents_as_",
  622. smalltalk.method({
  623. selector: "assertSameContents:as:",
  624. fn: function (aCollection, anotherCollection) {
  625. var self=this;
  626. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(_st(aCollection)._size()).__eq(_st(anotherCollection)._size()));
  627. _st(aCollection)._do_((function(each){
  628. return smalltalk.withContext(function($ctx2) { return _st(self)._assert_(_st(_st(aCollection)._occurrencesOf_(each)).__eq(_st(anotherCollection)._occurrencesOf_(each)));
  629. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  630. return self}, function($ctx1) {$ctx1.fill(self,"assertSameContents:as:",{aCollection:aCollection,anotherCollection:anotherCollection}, smalltalk.CollectionTest)});}
  631. }),
  632. smalltalk.CollectionTest);
  633. smalltalk.addMethod(
  634. "_collection",
  635. smalltalk.method({
  636. selector: "collection",
  637. fn: function () {
  638. var self=this;
  639. return smalltalk.withContext(function($ctx1) { var $1;
  640. $1=_st(_st(self)._collectionClass())._withAll_(_st(self)._defaultValues());
  641. return $1;
  642. }, function($ctx1) {$ctx1.fill(self,"collection",{}, smalltalk.CollectionTest)});}
  643. }),
  644. smalltalk.CollectionTest);
  645. smalltalk.addMethod(
  646. "_collectionClass",
  647. smalltalk.method({
  648. selector: "collectionClass",
  649. fn: function () {
  650. var self=this;
  651. return smalltalk.withContext(function($ctx1) { var $1;
  652. $1=_st(_st(self)._class())._collectionClass();
  653. return $1;
  654. }, function($ctx1) {$ctx1.fill(self,"collectionClass",{}, smalltalk.CollectionTest)});}
  655. }),
  656. smalltalk.CollectionTest);
  657. smalltalk.addMethod(
  658. "_collectionWithDuplicates",
  659. smalltalk.method({
  660. selector: "collectionWithDuplicates",
  661. fn: function () {
  662. var self=this;
  663. return smalltalk.withContext(function($ctx1) { var $1;
  664. $1=_st(_st(self)._collectionClass())._withAll_(["a", "b", "c", (1), (2), (1), "a"]);
  665. return $1;
  666. }, function($ctx1) {$ctx1.fill(self,"collectionWithDuplicates",{}, smalltalk.CollectionTest)});}
  667. }),
  668. smalltalk.CollectionTest);
  669. smalltalk.addMethod(
  670. "_defaultValues",
  671. smalltalk.method({
  672. selector: "defaultValues",
  673. fn: function () {
  674. var self=this;
  675. return smalltalk.withContext(function($ctx1) { return [(1), (2), (3), (-4)];
  676. }, function($ctx1) {$ctx1.fill(self,"defaultValues",{}, smalltalk.CollectionTest)});}
  677. }),
  678. smalltalk.CollectionTest);
  679. smalltalk.addMethod(
  680. "_isCollectionReadOnly",
  681. smalltalk.method({
  682. selector: "isCollectionReadOnly",
  683. fn: function () {
  684. var self=this;
  685. return smalltalk.withContext(function($ctx1) { return false;
  686. }, function($ctx1) {$ctx1.fill(self,"isCollectionReadOnly",{}, smalltalk.CollectionTest)});}
  687. }),
  688. smalltalk.CollectionTest);
  689. smalltalk.addMethod(
  690. "_testAsArray",
  691. smalltalk.method({
  692. selector: "testAsArray",
  693. fn: function () {
  694. var self=this;
  695. return smalltalk.withContext(function($ctx1) { _st(self)._assertSameContents_as_(_st(self)._collection(),_st(_st(self)._collection())._asArray());
  696. return self}, function($ctx1) {$ctx1.fill(self,"testAsArray",{}, smalltalk.CollectionTest)});}
  697. }),
  698. smalltalk.CollectionTest);
  699. smalltalk.addMethod(
  700. "_testAsOrderedCollection",
  701. smalltalk.method({
  702. selector: "testAsOrderedCollection",
  703. fn: function () {
  704. var self=this;
  705. return smalltalk.withContext(function($ctx1) { _st(self)._assertSameContents_as_(_st(self)._collection(),_st(_st(self)._collection())._asOrderedCollection());
  706. return self}, function($ctx1) {$ctx1.fill(self,"testAsOrderedCollection",{}, smalltalk.CollectionTest)});}
  707. }),
  708. smalltalk.CollectionTest);
  709. smalltalk.addMethod(
  710. "_testAsSet",
  711. smalltalk.method({
  712. selector: "testAsSet",
  713. fn: function () {
  714. var self=this;
  715. var c,set;
  716. return smalltalk.withContext(function($ctx1) { c=_st(self)._collectionWithDuplicates();
  717. set=_st(c)._asSet();
  718. _st(self)._assert_(_st(_st(set)._size()).__eq((5)));
  719. _st(c)._do_((function(each){
  720. return smalltalk.withContext(function($ctx2) { return _st(self)._assert_(_st(set)._includes_(each));
  721. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  722. return self}, function($ctx1) {$ctx1.fill(self,"testAsSet",{c:c,set:set}, smalltalk.CollectionTest)});}
  723. }),
  724. smalltalk.CollectionTest);
  725. smalltalk.addMethod(
  726. "_testCollect",
  727. smalltalk.method({
  728. selector: "testCollect",
  729. fn: function () {
  730. var self=this;
  731. var newCollection;
  732. return smalltalk.withContext(function($ctx1) { newCollection=[(1), (2), (3), (4)];
  733. _st(self)._assertSameContents_as_(_st(_st(self)._collection())._collect_((function(each){
  734. return smalltalk.withContext(function($ctx2) { return _st(each)._abs();
  735. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})),newCollection);
  736. return self}, function($ctx1) {$ctx1.fill(self,"testCollect",{newCollection:newCollection}, smalltalk.CollectionTest)});}
  737. }),
  738. smalltalk.CollectionTest);
  739. smalltalk.addMethod(
  740. "_testDetect",
  741. smalltalk.method({
  742. selector: "testDetect",
  743. fn: function () {
  744. var self=this;
  745. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(_st(_st(self)._collection())._detect_((function(each){
  746. return smalltalk.withContext(function($ctx2) { return _st(each).__lt((0));
  747. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}))).__eq((-4)));
  748. _st(self)._should_raise_((function(){
  749. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._collection())._detect_((function(each){
  750. return smalltalk.withContext(function($ctx3) { return _st(each).__eq((6));
  751. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  752. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
  753. return self}, function($ctx1) {$ctx1.fill(self,"testDetect",{}, smalltalk.CollectionTest)});}
  754. }),
  755. smalltalk.CollectionTest);
  756. smalltalk.addMethod(
  757. "_testDo",
  758. smalltalk.method({
  759. selector: "testDo",
  760. fn: function () {
  761. var self=this;
  762. var newCollection;
  763. return smalltalk.withContext(function($ctx1) { newCollection=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
  764. _st(_st(self)._collection())._do_((function(each){
  765. return smalltalk.withContext(function($ctx2) { return _st(newCollection)._add_(each);
  766. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  767. _st(self)._assertSameContents_as_(_st(self)._collection(),newCollection);
  768. return self}, function($ctx1) {$ctx1.fill(self,"testDo",{newCollection:newCollection}, smalltalk.CollectionTest)});}
  769. }),
  770. smalltalk.CollectionTest);
  771. smalltalk.addMethod(
  772. "_testIsEmpty",
  773. smalltalk.method({
  774. selector: "testIsEmpty",
  775. fn: function () {
  776. var self=this;
  777. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(_st(_st(self)._collectionClass())._new())._isEmpty());
  778. _st(self)._deny_(_st(_st(self)._collection())._isEmpty());
  779. return self}, function($ctx1) {$ctx1.fill(self,"testIsEmpty",{}, smalltalk.CollectionTest)});}
  780. }),
  781. smalltalk.CollectionTest);
  782. smalltalk.addMethod(
  783. "_testSelect",
  784. smalltalk.method({
  785. selector: "testSelect",
  786. fn: function () {
  787. var self=this;
  788. var newCollection;
  789. return smalltalk.withContext(function($ctx1) { newCollection=[(2), (-4)];
  790. _st(self)._assertSameContents_as_(_st(_st(self)._collection())._select_((function(each){
  791. return smalltalk.withContext(function($ctx2) { return _st(each)._even();
  792. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})),newCollection);
  793. return self}, function($ctx1) {$ctx1.fill(self,"testSelect",{newCollection:newCollection}, smalltalk.CollectionTest)});}
  794. }),
  795. smalltalk.CollectionTest);
  796. smalltalk.addMethod(
  797. "_testSize",
  798. smalltalk.method({
  799. selector: "testSize",
  800. fn: function () {
  801. var self=this;
  802. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(_st(_st(_st(self)._collectionClass())._new())._size()).__eq((0)));
  803. _st(self)._assert_(_st(_st(_st(self)._collection())._size()).__eq((4)));
  804. return self}, function($ctx1) {$ctx1.fill(self,"testSize",{}, smalltalk.CollectionTest)});}
  805. }),
  806. smalltalk.CollectionTest);
  807. smalltalk.addMethod(
  808. "_collectionClass",
  809. smalltalk.method({
  810. selector: "collectionClass",
  811. fn: function () {
  812. var self=this;
  813. return smalltalk.withContext(function($ctx1) { return nil;
  814. }, function($ctx1) {$ctx1.fill(self,"collectionClass",{}, smalltalk.CollectionTest.klass)});}
  815. }),
  816. smalltalk.CollectionTest.klass);
  817. smalltalk.addMethod(
  818. "_isAbstract",
  819. smalltalk.method({
  820. selector: "isAbstract",
  821. fn: function () {
  822. var self=this;
  823. return smalltalk.withContext(function($ctx1) { var $1;
  824. $1=_st(_st(self)._collectionClass())._isNil();
  825. return $1;
  826. }, function($ctx1) {$ctx1.fill(self,"isAbstract",{}, smalltalk.CollectionTest.klass)});}
  827. }),
  828. smalltalk.CollectionTest.klass);
  829. smalltalk.addClass('HashedCollectionTest', smalltalk.CollectionTest, [], 'Kernel-Tests');
  830. smalltalk.addMethod(
  831. "_collection",
  832. smalltalk.method({
  833. selector: "collection",
  834. fn: function () {
  835. var self=this;
  836. return smalltalk.withContext(function($ctx1) { var $1;
  837. $1=smalltalk.HashedCollection._fromPairs_([_st("a").__minus_gt((1)),_st("b").__minus_gt((2)),_st("c").__minus_gt((3)),_st("d").__minus_gt((-4))]);
  838. return $1;
  839. }, function($ctx1) {$ctx1.fill(self,"collection",{}, smalltalk.HashedCollectionTest)});}
  840. }),
  841. smalltalk.HashedCollectionTest);
  842. smalltalk.addMethod(
  843. "_collectionWithDuplicates",
  844. smalltalk.method({
  845. selector: "collectionWithDuplicates",
  846. fn: function () {
  847. var self=this;
  848. return smalltalk.withContext(function($ctx1) { var $1;
  849. $1=smalltalk.HashedCollection._fromPairs_([_st("a").__minus_gt((1)),_st("b").__minus_gt((2)),_st("c").__minus_gt((3)),_st("d").__minus_gt((-4)),_st("e").__minus_gt((1)),_st("f").__minus_gt((2)),_st("g").__minus_gt((10))]);
  850. return $1;
  851. }, function($ctx1) {$ctx1.fill(self,"collectionWithDuplicates",{}, smalltalk.HashedCollectionTest)});}
  852. }),
  853. smalltalk.HashedCollectionTest);
  854. smalltalk.addMethod(
  855. "_collectionClass",
  856. smalltalk.method({
  857. selector: "collectionClass",
  858. fn: function () {
  859. var self=this;
  860. return smalltalk.withContext(function($ctx1) { var $1;
  861. $1=(smalltalk.HashedCollection || HashedCollection);
  862. return $1;
  863. }, function($ctx1) {$ctx1.fill(self,"collectionClass",{}, smalltalk.HashedCollectionTest.klass)});}
  864. }),
  865. smalltalk.HashedCollectionTest.klass);
  866. smalltalk.addClass('DictionaryTest', smalltalk.HashedCollectionTest, [], 'Kernel-Tests');
  867. smalltalk.addMethod(
  868. "_collection",
  869. smalltalk.method({
  870. selector: "collection",
  871. fn: function () {
  872. var self=this;
  873. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  874. $2=_st((smalltalk.Dictionary || Dictionary))._new();
  875. _st($2)._at_put_((1),(1));
  876. _st($2)._at_put_("a",(2));
  877. _st($2)._at_put_(true,(3));
  878. _st($2)._at_put_((4),(-4));
  879. $3=_st($2)._yourself();
  880. $1=$3;
  881. return $1;
  882. }, function($ctx1) {$ctx1.fill(self,"collection",{}, smalltalk.DictionaryTest)});}
  883. }),
  884. smalltalk.DictionaryTest);
  885. smalltalk.addMethod(
  886. "_collectionWithDuplicates",
  887. smalltalk.method({
  888. selector: "collectionWithDuplicates",
  889. fn: function () {
  890. var self=this;
  891. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  892. $2=_st((smalltalk.Dictionary || Dictionary))._new();
  893. _st($2)._at_put_((1),(1));
  894. _st($2)._at_put_("a",(2));
  895. _st($2)._at_put_(true,(3));
  896. _st($2)._at_put_((4),(-4));
  897. _st($2)._at_put_("b",(1));
  898. _st($2)._at_put_((3),(3));
  899. _st($2)._at_put_(false,(12));
  900. $3=_st($2)._yourself();
  901. $1=$3;
  902. return $1;
  903. }, function($ctx1) {$ctx1.fill(self,"collectionWithDuplicates",{}, smalltalk.DictionaryTest)});}
  904. }),
  905. smalltalk.DictionaryTest);
  906. smalltalk.addMethod(
  907. "_testAccessing",
  908. smalltalk.method({
  909. selector: "testAccessing",
  910. fn: function () {
  911. var self=this;
  912. var d;
  913. return smalltalk.withContext(function($ctx1) { d=_st((smalltalk.Dictionary || Dictionary))._new();
  914. _st(d)._at_put_("hello","world");
  915. _st(self)._assert_(_st(_st(d)._at_("hello")).__eq("world"));
  916. _st(self)._assert_(_st(_st(d)._at_ifAbsent_("hello",(function(){
  917. return smalltalk.withContext(function($ctx2) { return nil;
  918. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))).__eq("world"));
  919. _st(self)._deny_(_st(_st(d)._at_ifAbsent_("foo",(function(){
  920. return smalltalk.withContext(function($ctx2) { return nil;
  921. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))).__eq("world"));
  922. _st(d)._at_put_((1),(2));
  923. _st(self)._assert_(_st(_st(d)._at_((1))).__eq((2)));
  924. _st(d)._at_put_(_st((1)).__at((3)),(3));
  925. _st(self)._assert_(_st(_st(d)._at_(_st((1)).__at((3)))).__eq((3)));
  926. return self}, function($ctx1) {$ctx1.fill(self,"testAccessing",{d:d}, smalltalk.DictionaryTest)});}
  927. }),
  928. smalltalk.DictionaryTest);
  929. smalltalk.addMethod(
  930. "_testDynamicDictionaries",
  931. smalltalk.method({
  932. selector: "testDynamicDictionaries",
  933. fn: function () {
  934. var self=this;
  935. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(_st(smalltalk.HashedCollection._fromPairs_([_st("hello").__minus_gt((1))]))._asDictionary()).__eq(_st((smalltalk.Dictionary || Dictionary))._with_(_st("hello").__minus_gt((1)))));
  936. return self}, function($ctx1) {$ctx1.fill(self,"testDynamicDictionaries",{}, smalltalk.DictionaryTest)});}
  937. }),
  938. smalltalk.DictionaryTest);
  939. smalltalk.addMethod(
  940. "_testEquality",
  941. smalltalk.method({
  942. selector: "testEquality",
  943. fn: function () {
  944. var self=this;
  945. var d1,d2;
  946. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5,$6,$7,$8,$9,$10;
  947. _st(self)._assert_(_st(_st((smalltalk.Dictionary || Dictionary))._new()).__eq(_st((smalltalk.Dictionary || Dictionary))._new()));
  948. $1=_st((smalltalk.Dictionary || Dictionary))._new();
  949. _st($1)._at_put_((1),(2));
  950. $2=_st($1)._yourself();
  951. d1=$2;
  952. $3=_st((smalltalk.Dictionary || Dictionary))._new();
  953. _st($3)._at_put_((1),(2));
  954. $4=_st($3)._yourself();
  955. d2=$4;
  956. _st(self)._assert_(_st(d1).__eq(d2));
  957. $5=_st((smalltalk.Dictionary || Dictionary))._new();
  958. _st($5)._at_put_((1),(3));
  959. $6=_st($5)._yourself();
  960. d2=$6;
  961. _st(self)._deny_(_st(d1).__eq(d2));
  962. $7=_st((smalltalk.Dictionary || Dictionary))._new();
  963. _st($7)._at_put_((2),(2));
  964. $8=_st($7)._yourself();
  965. d2=$8;
  966. _st(self)._deny_(_st(d1).__eq(d2));
  967. $9=_st((smalltalk.Dictionary || Dictionary))._new();
  968. _st($9)._at_put_((1),(2));
  969. _st($9)._at_put_((3),(4));
  970. $10=_st($9)._yourself();
  971. d2=$10;
  972. _st(self)._deny_(_st(d1).__eq(d2));
  973. return self}, function($ctx1) {$ctx1.fill(self,"testEquality",{d1:d1,d2:d2}, smalltalk.DictionaryTest)});}
  974. }),
  975. smalltalk.DictionaryTest);
  976. smalltalk.addMethod(
  977. "_testIfAbsent",
  978. smalltalk.method({
  979. selector: "testIfAbsent",
  980. fn: function () {
  981. var self=this;
  982. var d,visited;
  983. return smalltalk.withContext(function($ctx1) { visited=false;
  984. d=_st((smalltalk.Dictionary || Dictionary))._new();
  985. _st(d)._at_ifAbsent_("hello",(function(){
  986. return smalltalk.withContext(function($ctx2) { visited=true;
  987. return visited;
  988. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  989. _st(self)._assert_(visited);
  990. return self}, function($ctx1) {$ctx1.fill(self,"testIfAbsent",{d:d,visited:visited}, smalltalk.DictionaryTest)});}
  991. }),
  992. smalltalk.DictionaryTest);
  993. smalltalk.addMethod(
  994. "_testIfPresent",
  995. smalltalk.method({
  996. selector: "testIfPresent",
  997. fn: function () {
  998. var self=this;
  999. var d,visited,absent;
  1000. return smalltalk.withContext(function($ctx1) { visited=false;
  1001. d=_st((smalltalk.Dictionary || Dictionary))._new();
  1002. _st(d)._at_put_("hello","world");
  1003. _st(d)._at_ifPresent_("hello",(function(value){
  1004. return smalltalk.withContext(function($ctx2) { visited=value;
  1005. return visited;
  1006. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}));
  1007. _st(self)._assert_(_st(visited).__eq("world"));
  1008. absent=_st(d)._at_ifPresent_("bye",(function(value){
  1009. return smalltalk.withContext(function($ctx2) { visited=value;
  1010. return visited;
  1011. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}));
  1012. _st(self)._assert_(_st(absent)._isNil());
  1013. return self}, function($ctx1) {$ctx1.fill(self,"testIfPresent",{d:d,visited:visited,absent:absent}, smalltalk.DictionaryTest)});}
  1014. }),
  1015. smalltalk.DictionaryTest);
  1016. smalltalk.addMethod(
  1017. "_testIfPresentIfAbsent",
  1018. smalltalk.method({
  1019. selector: "testIfPresentIfAbsent",
  1020. fn: function () {
  1021. var self=this;
  1022. var d,visited;
  1023. return smalltalk.withContext(function($ctx1) { visited=false;
  1024. d=_st((smalltalk.Dictionary || Dictionary))._new();
  1025. _st(d)._at_put_("hello","world");
  1026. _st(d)._at_ifPresent_ifAbsent_("hello",(function(value){
  1027. return smalltalk.withContext(function($ctx2) { visited=value;
  1028. return visited;
  1029. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}),(function(){
  1030. return smalltalk.withContext(function($ctx2) { visited=true;
  1031. return visited;
  1032. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1033. _st(self)._assert_(_st(visited).__eq("world"));
  1034. _st(d)._at_ifPresent_ifAbsent_("buy",(function(value){
  1035. return smalltalk.withContext(function($ctx2) { visited=value;
  1036. return visited;
  1037. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}),(function(){
  1038. return smalltalk.withContext(function($ctx2) { visited=true;
  1039. return visited;
  1040. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1041. _st(self)._assert_(visited);
  1042. return self}, function($ctx1) {$ctx1.fill(self,"testIfPresentIfAbsent",{d:d,visited:visited}, smalltalk.DictionaryTest)});}
  1043. }),
  1044. smalltalk.DictionaryTest);
  1045. smalltalk.addMethod(
  1046. "_testKeys",
  1047. smalltalk.method({
  1048. selector: "testKeys",
  1049. fn: function () {
  1050. var self=this;
  1051. var d;
  1052. return smalltalk.withContext(function($ctx1) { d=_st((smalltalk.Dictionary || Dictionary))._new();
  1053. _st(d)._at_put_((1),(2));
  1054. _st(d)._at_put_((2),(3));
  1055. _st(d)._at_put_((3),(4));
  1056. _st(self)._assert_(_st(_st(d)._keys()).__eq([(1), (2), (3)]));
  1057. return self}, function($ctx1) {$ctx1.fill(self,"testKeys",{d:d}, smalltalk.DictionaryTest)});}
  1058. }),
  1059. smalltalk.DictionaryTest);
  1060. smalltalk.addMethod(
  1061. "_testPrintString",
  1062. smalltalk.method({
  1063. selector: "testPrintString",
  1064. fn: function () {
  1065. var self=this;
  1066. return smalltalk.withContext(function($ctx1) { var $1,$2;
  1067. $1=_st((smalltalk.Dictionary || Dictionary))._new();
  1068. _st($1)._at_put_("firstname","James");
  1069. _st($1)._at_put_("lastname","Bond");
  1070. $2=_st($1)._printString();
  1071. _st(self)._assert_equals_("a Dictionary('firstname'->'James' , 'lastname'->'Bond')",$2);
  1072. return self}, function($ctx1) {$ctx1.fill(self,"testPrintString",{}, smalltalk.DictionaryTest)});}
  1073. }),
  1074. smalltalk.DictionaryTest);
  1075. smalltalk.addMethod(
  1076. "_testRemoveKey",
  1077. smalltalk.method({
  1078. selector: "testRemoveKey",
  1079. fn: function () {
  1080. var self=this;
  1081. var d,key;
  1082. return smalltalk.withContext(function($ctx1) { d=_st((smalltalk.Dictionary || Dictionary))._new();
  1083. _st(d)._at_put_((1),(2));
  1084. _st(d)._at_put_((2),(3));
  1085. _st(d)._at_put_((3),(4));
  1086. key=(2);
  1087. _st(self)._assert_(_st(_st(d)._keys()).__eq([(1), (2), (3)]));
  1088. _st(d)._removeKey_(key);
  1089. _st(self)._assert_(_st(_st(d)._keys()).__eq([(1), (3)]));
  1090. _st(self)._assert_(_st(_st(d)._values()).__eq([(2), (4)]));
  1091. _st(self)._deny_(_st(d)._includesKey_((2)));
  1092. return self}, function($ctx1) {$ctx1.fill(self,"testRemoveKey",{d:d,key:key}, smalltalk.DictionaryTest)});}
  1093. }),
  1094. smalltalk.DictionaryTest);
  1095. smalltalk.addMethod(
  1096. "_testRemoveKeyIfAbsent",
  1097. smalltalk.method({
  1098. selector: "testRemoveKeyIfAbsent",
  1099. fn: function () {
  1100. var self=this;
  1101. var d,key;
  1102. return smalltalk.withContext(function($ctx1) { d=_st((smalltalk.Dictionary || Dictionary))._new();
  1103. _st(d)._at_put_((1),(2));
  1104. _st(d)._at_put_((2),(3));
  1105. _st(d)._at_put_((3),(4));
  1106. key=(2);
  1107. _st(self)._assert_(_st(_st(d)._removeKey_(key)).__eq((3)));
  1108. key=(3);
  1109. _st(self)._assert_(_st(_st(d)._removeKey_ifAbsent_(key,(function(){
  1110. return smalltalk.withContext(function($ctx2) { return (42);
  1111. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))).__eq((4)));
  1112. key="why";
  1113. _st(self)._assert_(_st(_st(d)._removeKey_ifAbsent_(key,(function(){
  1114. return smalltalk.withContext(function($ctx2) { return (42);
  1115. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))).__eq((42)));
  1116. return self}, function($ctx1) {$ctx1.fill(self,"testRemoveKeyIfAbsent",{d:d,key:key}, smalltalk.DictionaryTest)});}
  1117. }),
  1118. smalltalk.DictionaryTest);
  1119. smalltalk.addMethod(
  1120. "_testSize",
  1121. smalltalk.method({
  1122. selector: "testSize",
  1123. fn: function () {
  1124. var self=this;
  1125. var d;
  1126. return smalltalk.withContext(function($ctx1) { d=_st((smalltalk.Dictionary || Dictionary))._new();
  1127. _st(self)._assert_(_st(_st(d)._size()).__eq((0)));
  1128. _st(d)._at_put_((1),(2));
  1129. _st(self)._assert_(_st(_st(d)._size()).__eq((1)));
  1130. _st(d)._at_put_((2),(3));
  1131. _st(self)._assert_(_st(_st(d)._size()).__eq((2)));
  1132. return self}, function($ctx1) {$ctx1.fill(self,"testSize",{d:d}, smalltalk.DictionaryTest)});}
  1133. }),
  1134. smalltalk.DictionaryTest);
  1135. smalltalk.addMethod(
  1136. "_testValues",
  1137. smalltalk.method({
  1138. selector: "testValues",
  1139. fn: function () {
  1140. var self=this;
  1141. var d;
  1142. return smalltalk.withContext(function($ctx1) { d=_st((smalltalk.Dictionary || Dictionary))._new();
  1143. _st(d)._at_put_((1),(2));
  1144. _st(d)._at_put_((2),(3));
  1145. _st(d)._at_put_((3),(4));
  1146. _st(self)._assert_(_st(_st(d)._values()).__eq([(2), (3), (4)]));
  1147. return self}, function($ctx1) {$ctx1.fill(self,"testValues",{d:d}, smalltalk.DictionaryTest)});}
  1148. }),
  1149. smalltalk.DictionaryTest);
  1150. smalltalk.addMethod(
  1151. "_collectionClass",
  1152. smalltalk.method({
  1153. selector: "collectionClass",
  1154. fn: function () {
  1155. var self=this;
  1156. return smalltalk.withContext(function($ctx1) { var $1;
  1157. $1=(smalltalk.Dictionary || Dictionary);
  1158. return $1;
  1159. }, function($ctx1) {$ctx1.fill(self,"collectionClass",{}, smalltalk.DictionaryTest.klass)});}
  1160. }),
  1161. smalltalk.DictionaryTest.klass);
  1162. smalltalk.addClass('SequenceableCollectionTest', smalltalk.CollectionTest, [], 'Kernel-Tests');
  1163. smalltalk.addMethod(
  1164. "_testAt",
  1165. smalltalk.method({
  1166. selector: "testAt",
  1167. fn: function () {
  1168. var self=this;
  1169. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(_st(_st(self)._collection())._at_((4))).__eq((-4)));
  1170. _st(self)._should_raise_((function(){
  1171. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._collection())._at_((5));
  1172. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
  1173. return self}, function($ctx1) {$ctx1.fill(self,"testAt",{}, smalltalk.SequenceableCollectionTest)});}
  1174. }),
  1175. smalltalk.SequenceableCollectionTest);
  1176. smalltalk.addMethod(
  1177. "_testAtIfAbsent",
  1178. smalltalk.method({
  1179. selector: "testAtIfAbsent",
  1180. fn: function () {
  1181. var self=this;
  1182. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(_st(_st(self)._collection())._at_ifAbsent_(_st(_st(_st(self)._collection())._size()).__plus((1)),(function(){
  1183. return smalltalk.withContext(function($ctx2) { return "none";
  1184. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))).__eq("none"));
  1185. return self}, function($ctx1) {$ctx1.fill(self,"testAtIfAbsent",{}, smalltalk.SequenceableCollectionTest)});}
  1186. }),
  1187. smalltalk.SequenceableCollectionTest);
  1188. smalltalk.addClass('ArrayTest', smalltalk.SequenceableCollectionTest, [], 'Kernel-Tests');
  1189. smalltalk.addMethod(
  1190. "_testAtIfAbsent",
  1191. smalltalk.method({
  1192. selector: "testAtIfAbsent",
  1193. fn: function () {
  1194. var self=this;
  1195. var array;
  1196. return smalltalk.withContext(function($ctx1) { array=["hello", "world"];
  1197. _st(self)._assert_equals_(_st(array)._at_((1)),"hello");
  1198. _st(self)._assert_equals_(_st(array)._at_((2)),"world");
  1199. _st(self)._assert_equals_(_st(array)._at_ifAbsent_((2),(function(){
  1200. return smalltalk.withContext(function($ctx2) { return "not found";
  1201. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"world");
  1202. _st(self)._assert_equals_(_st(array)._at_ifAbsent_((0),(function(){
  1203. return smalltalk.withContext(function($ctx2) { return "not found";
  1204. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"not found");
  1205. _st(self)._assert_equals_(_st(array)._at_ifAbsent_((-10),(function(){
  1206. return smalltalk.withContext(function($ctx2) { return "not found";
  1207. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"not found");
  1208. _st(self)._assert_equals_(_st(array)._at_ifAbsent_((3),(function(){
  1209. return smalltalk.withContext(function($ctx2) { return "not found";
  1210. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"not found");
  1211. return self}, function($ctx1) {$ctx1.fill(self,"testAtIfAbsent",{array:array}, smalltalk.ArrayTest)});}
  1212. }),
  1213. smalltalk.ArrayTest);
  1214. smalltalk.addMethod(
  1215. "_testFirstN",
  1216. smalltalk.method({
  1217. selector: "testFirstN",
  1218. fn: function () {
  1219. var self=this;
  1220. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_([(1),(2),(3)],_st([(1),(2),(3),(4),(5)])._first_((3)));
  1221. return self}, function($ctx1) {$ctx1.fill(self,"testFirstN",{}, smalltalk.ArrayTest)});}
  1222. }),
  1223. smalltalk.ArrayTest);
  1224. smalltalk.addMethod(
  1225. "_testIfEmpty",
  1226. smalltalk.method({
  1227. selector: "testIfEmpty",
  1228. fn: function () {
  1229. var self=this;
  1230. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_("zork",_st("")._ifEmpty_((function(){
  1231. return smalltalk.withContext(function($ctx2) { return "zork";
  1232. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
  1233. return self}, function($ctx1) {$ctx1.fill(self,"testIfEmpty",{}, smalltalk.ArrayTest)});}
  1234. }),
  1235. smalltalk.ArrayTest);
  1236. smalltalk.addMethod(
  1237. "_testPrintString",
  1238. smalltalk.method({
  1239. selector: "testPrintString",
  1240. fn: function () {
  1241. var self=this;
  1242. var array;
  1243. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  1244. array=_st((smalltalk.Array || Array))._new();
  1245. _st(self)._assert_equals_("a Array ()",_st(array)._printString());
  1246. $1=array;
  1247. _st($1)._add_((1));
  1248. $2=_st($1)._add_((3));
  1249. _st(self)._assert_equals_("a Array (1 3)",_st(array)._printString());
  1250. _st(array)._add_("foo");
  1251. _st(self)._assert_equals_("a Array (1 3 'foo')",_st(array)._printString());
  1252. $3=array;
  1253. _st($3)._remove_((1));
  1254. $4=_st($3)._remove_((3));
  1255. _st(self)._assert_equals_("a Array ('foo')",_st(array)._printString());
  1256. _st(array)._addLast_((3));
  1257. _st(self)._assert_equals_("a Array ('foo' 3)",_st(array)._printString());
  1258. _st(array)._addLast_((3));
  1259. _st(self)._assert_equals_("a Array ('foo' 3 3)",_st(array)._printString());
  1260. return self}, function($ctx1) {$ctx1.fill(self,"testPrintString",{array:array}, smalltalk.ArrayTest)});}
  1261. }),
  1262. smalltalk.ArrayTest);
  1263. smalltalk.addMethod(
  1264. "_collectionClass",
  1265. smalltalk.method({
  1266. selector: "collectionClass",
  1267. fn: function () {
  1268. var self=this;
  1269. return smalltalk.withContext(function($ctx1) { var $1;
  1270. $1=(smalltalk.Array || Array);
  1271. return $1;
  1272. }, function($ctx1) {$ctx1.fill(self,"collectionClass",{}, smalltalk.ArrayTest.klass)});}
  1273. }),
  1274. smalltalk.ArrayTest.klass);
  1275. smalltalk.addClass('StringTest', smalltalk.SequenceableCollectionTest, [], 'Kernel-Tests');
  1276. smalltalk.addMethod(
  1277. "_collection",
  1278. smalltalk.method({
  1279. selector: "collection",
  1280. fn: function () {
  1281. var self=this;
  1282. return smalltalk.withContext(function($ctx1) { return "hello";
  1283. }, function($ctx1) {$ctx1.fill(self,"collection",{}, smalltalk.StringTest)});}
  1284. }),
  1285. smalltalk.StringTest);
  1286. smalltalk.addMethod(
  1287. "_collectionWithDuplicates",
  1288. smalltalk.method({
  1289. selector: "collectionWithDuplicates",
  1290. fn: function () {
  1291. var self=this;
  1292. return smalltalk.withContext(function($ctx1) { return "abbaerte";
  1293. }, function($ctx1) {$ctx1.fill(self,"collectionWithDuplicates",{}, smalltalk.StringTest)});}
  1294. }),
  1295. smalltalk.StringTest);
  1296. smalltalk.addMethod(
  1297. "_testAddRemove",
  1298. smalltalk.method({
  1299. selector: "testAddRemove",
  1300. fn: function () {
  1301. var self=this;
  1302. return smalltalk.withContext(function($ctx1) { _st(self)._should_raise_((function(){
  1303. return smalltalk.withContext(function($ctx2) { return _st("hello")._add_("a");
  1304. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
  1305. _st(self)._should_raise_((function(){
  1306. return smalltalk.withContext(function($ctx2) { return _st("hello")._remove_("h");
  1307. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
  1308. return self}, function($ctx1) {$ctx1.fill(self,"testAddRemove",{}, smalltalk.StringTest)});}
  1309. }),
  1310. smalltalk.StringTest);
  1311. smalltalk.addMethod(
  1312. "_testAsArray",
  1313. smalltalk.method({
  1314. selector: "testAsArray",
  1315. fn: function () {
  1316. var self=this;
  1317. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(_st("hello")._asArray()).__eq(["h", "e", "l", "l", "o"]));
  1318. return self}, function($ctx1) {$ctx1.fill(self,"testAsArray",{}, smalltalk.StringTest)});}
  1319. }),
  1320. smalltalk.StringTest);
  1321. smalltalk.addMethod(
  1322. "_testAt",
  1323. smalltalk.method({
  1324. selector: "testAt",
  1325. fn: function () {
  1326. var self=this;
  1327. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(_st("hello")._at_((1))).__eq("h"));
  1328. _st(self)._assert_(_st(_st("hello")._at_((5))).__eq("o"));
  1329. _st(self)._assert_(_st(_st("hello")._at_ifAbsent_((6),(function(){
  1330. return smalltalk.withContext(function($ctx2) { return nil;
  1331. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))).__eq(nil));
  1332. return self}, function($ctx1) {$ctx1.fill(self,"testAt",{}, smalltalk.StringTest)});}
  1333. }),
  1334. smalltalk.StringTest);
  1335. smalltalk.addMethod(
  1336. "_testAtPut",
  1337. smalltalk.method({
  1338. selector: "testAtPut",
  1339. fn: function () {
  1340. var self=this;
  1341. return smalltalk.withContext(function($ctx1) { _st(self)._should_raise_((function(){
  1342. return smalltalk.withContext(function($ctx2) { return _st("hello")._at_put_((1),"a");
  1343. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
  1344. return self}, function($ctx1) {$ctx1.fill(self,"testAtPut",{}, smalltalk.StringTest)});}
  1345. }),
  1346. smalltalk.StringTest);
  1347. smalltalk.addMethod(
  1348. "_testCollect",
  1349. smalltalk.method({
  1350. selector: "testCollect",
  1351. fn: function () {
  1352. var self=this;
  1353. var newCollection;
  1354. return smalltalk.withContext(function($ctx1) { newCollection="hheelllloo";
  1355. _st(self)._assertSameContents_as_(_st(_st(self)._collection())._collect_((function(each){
  1356. return smalltalk.withContext(function($ctx2) { return _st(each).__comma(each);
  1357. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})),newCollection);
  1358. return self}, function($ctx1) {$ctx1.fill(self,"testCollect",{newCollection:newCollection}, smalltalk.StringTest)});}
  1359. }),
  1360. smalltalk.StringTest);
  1361. smalltalk.addMethod(
  1362. "_testCopyWithoutAll",
  1363. smalltalk.method({
  1364. selector: "testCopyWithoutAll",
  1365. fn: function () {
  1366. var self=this;
  1367. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_("hello world",_st("*hello* *world*")._copyWithoutAll_("*"));
  1368. return self}, function($ctx1) {$ctx1.fill(self,"testCopyWithoutAll",{}, smalltalk.StringTest)});}
  1369. }),
  1370. smalltalk.StringTest);
  1371. smalltalk.addMethod(
  1372. "_testDetect",
  1373. smalltalk.method({
  1374. selector: "testDetect",
  1375. fn: function () {
  1376. var self=this;
  1377. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(_st(_st(self)._collection())._detect_((function(each){
  1378. return smalltalk.withContext(function($ctx2) { return _st(each).__eq("h");
  1379. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}))).__eq("h"));
  1380. _st(self)._should_raise_((function(){
  1381. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._collection())._detect_((function(each){
  1382. return smalltalk.withContext(function($ctx3) { return _st(each).__eq((6));
  1383. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  1384. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
  1385. return self}, function($ctx1) {$ctx1.fill(self,"testDetect",{}, smalltalk.StringTest)});}
  1386. }),
  1387. smalltalk.StringTest);
  1388. smalltalk.addMethod(
  1389. "_testEquality",
  1390. smalltalk.method({
  1391. selector: "testEquality",
  1392. fn: function () {
  1393. var self=this;
  1394. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st("hello").__eq("hello"));
  1395. _st(self)._deny_(_st("hello").__eq("world"));
  1396. _st(self)._assert_(_st("hello").__eq(_st("hello")._yourself()));
  1397. _st(self)._assert_(_st(_st("hello")._yourself()).__eq("hello"));
  1398. _st(self)._deny_(_st("").__eq((0)));
  1399. return self}, function($ctx1) {$ctx1.fill(self,"testEquality",{}, smalltalk.StringTest)});}
  1400. }),
  1401. smalltalk.StringTest);
  1402. smalltalk.addMethod(
  1403. "_testIdentity",
  1404. smalltalk.method({
  1405. selector: "testIdentity",
  1406. fn: function () {
  1407. var self=this;
  1408. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st("hello").__eq_eq("hello"));
  1409. _st(self)._deny_(_st("hello").__eq_eq("world"));
  1410. _st(self)._assert_(_st("hello").__eq_eq(_st("hello")._yourself()));
  1411. _st(self)._assert_(_st(_st("hello")._yourself()).__eq_eq("hello"));
  1412. _st(self)._deny_(_st("").__eq_eq((0)));
  1413. return self}, function($ctx1) {$ctx1.fill(self,"testIdentity",{}, smalltalk.StringTest)});}
  1414. }),
  1415. smalltalk.StringTest);
  1416. smalltalk.addMethod(
  1417. "_testIncludesSubString",
  1418. smalltalk.method({
  1419. selector: "testIncludesSubString",
  1420. fn: function () {
  1421. var self=this;
  1422. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st("amber")._includesSubString_("ber"));
  1423. _st(self)._deny_(_st("amber")._includesSubString_("zork"));
  1424. return self}, function($ctx1) {$ctx1.fill(self,"testIncludesSubString",{}, smalltalk.StringTest)});}
  1425. }),
  1426. smalltalk.StringTest);
  1427. smalltalk.addMethod(
  1428. "_testJoin",
  1429. smalltalk.method({
  1430. selector: "testJoin",
  1431. fn: function () {
  1432. var self=this;
  1433. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_("hello,world",_st(",")._join_(["hello", "world"]));
  1434. return self}, function($ctx1) {$ctx1.fill(self,"testJoin",{}, smalltalk.StringTest)});}
  1435. }),
  1436. smalltalk.StringTest);
  1437. smalltalk.addMethod(
  1438. "_testSelect",
  1439. smalltalk.method({
  1440. selector: "testSelect",
  1441. fn: function () {
  1442. var self=this;
  1443. var newCollection;
  1444. return smalltalk.withContext(function($ctx1) { newCollection="o";
  1445. _st(self)._assertSameContents_as_(_st(_st(self)._collection())._select_((function(each){
  1446. return smalltalk.withContext(function($ctx2) { return _st(each).__eq("o");
  1447. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})),newCollection);
  1448. return self}, function($ctx1) {$ctx1.fill(self,"testSelect",{newCollection:newCollection}, smalltalk.StringTest)});}
  1449. }),
  1450. smalltalk.StringTest);
  1451. smalltalk.addMethod(
  1452. "_testSize",
  1453. smalltalk.method({
  1454. selector: "testSize",
  1455. fn: function () {
  1456. var self=this;
  1457. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st("smalltalk")._size(),(9));
  1458. _st(self)._assert_equals_(_st("")._size(),(0));
  1459. return self}, function($ctx1) {$ctx1.fill(self,"testSize",{}, smalltalk.StringTest)});}
  1460. }),
  1461. smalltalk.StringTest);
  1462. smalltalk.addMethod(
  1463. "_testStreamContents",
  1464. smalltalk.method({
  1465. selector: "testStreamContents",
  1466. fn: function () {
  1467. var self=this;
  1468. return smalltalk.withContext(function($ctx1) { var $1,$2;
  1469. _st(self)._assert_equals_("hello world",_st((smalltalk.String || String))._streamContents_((function(aStream){
  1470. return smalltalk.withContext(function($ctx2) { $1=aStream;
  1471. _st($1)._nextPutAll_("hello");
  1472. _st($1)._space();
  1473. $2=_st($1)._nextPutAll_("world");
  1474. return $2;
  1475. }, function($ctx2) {$ctx2.fillBlock({aStream:aStream},$ctx1)})})));
  1476. return self}, function($ctx1) {$ctx1.fill(self,"testStreamContents",{}, smalltalk.StringTest)});}
  1477. }),
  1478. smalltalk.StringTest);
  1479. smalltalk.addMethod(
  1480. "_collectionClass",
  1481. smalltalk.method({
  1482. selector: "collectionClass",
  1483. fn: function () {
  1484. var self=this;
  1485. return smalltalk.withContext(function($ctx1) { var $1;
  1486. $1=(smalltalk.String || String);
  1487. return $1;
  1488. }, function($ctx1) {$ctx1.fill(self,"collectionClass",{}, smalltalk.StringTest.klass)});}
  1489. }),
  1490. smalltalk.StringTest.klass);
  1491. smalltalk.addClass('SymbolTest', smalltalk.SequenceableCollectionTest, [], 'Kernel-Tests');
  1492. smalltalk.addMethod(
  1493. "_collection",
  1494. smalltalk.method({
  1495. selector: "collection",
  1496. fn: function () {
  1497. var self=this;
  1498. return smalltalk.withContext(function($ctx1) { return smalltalk.symbolFor("hello");
  1499. }, function($ctx1) {$ctx1.fill(self,"collection",{}, smalltalk.SymbolTest)});}
  1500. }),
  1501. smalltalk.SymbolTest);
  1502. smalltalk.addMethod(
  1503. "_collectionWithDuplicates",
  1504. smalltalk.method({
  1505. selector: "collectionWithDuplicates",
  1506. fn: function () {
  1507. var self=this;
  1508. return smalltalk.withContext(function($ctx1) { return smalltalk.symbolFor("phhaaarorra");
  1509. }, function($ctx1) {$ctx1.fill(self,"collectionWithDuplicates",{}, smalltalk.SymbolTest)});}
  1510. }),
  1511. smalltalk.SymbolTest);
  1512. smalltalk.addMethod(
  1513. "_testAsString",
  1514. smalltalk.method({
  1515. selector: "testAsString",
  1516. fn: function () {
  1517. var self=this;
  1518. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(smalltalk.symbolFor("hello"))._asString(),"hello");
  1519. return self}, function($ctx1) {$ctx1.fill(self,"testAsString",{}, smalltalk.SymbolTest)});}
  1520. }),
  1521. smalltalk.SymbolTest);
  1522. smalltalk.addMethod(
  1523. "_testAsSymbol",
  1524. smalltalk.method({
  1525. selector: "testAsSymbol",
  1526. fn: function () {
  1527. var self=this;
  1528. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(smalltalk.symbolFor("hello")).__eq_eq(_st(smalltalk.symbolFor("hello"))._asSymbol()));
  1529. return self}, function($ctx1) {$ctx1.fill(self,"testAsSymbol",{}, smalltalk.SymbolTest)});}
  1530. }),
  1531. smalltalk.SymbolTest);
  1532. smalltalk.addMethod(
  1533. "_testAt",
  1534. smalltalk.method({
  1535. selector: "testAt",
  1536. fn: function () {
  1537. var self=this;
  1538. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(_st(smalltalk.symbolFor("hello"))._at_((1))).__eq("h"));
  1539. _st(self)._assert_(_st(_st(smalltalk.symbolFor("hello"))._at_((5))).__eq("o"));
  1540. _st(self)._assert_(_st(_st(smalltalk.symbolFor("hello"))._at_ifAbsent_((6),(function(){
  1541. return smalltalk.withContext(function($ctx2) { return nil;
  1542. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))).__eq(nil));
  1543. return self}, function($ctx1) {$ctx1.fill(self,"testAt",{}, smalltalk.SymbolTest)});}
  1544. }),
  1545. smalltalk.SymbolTest);
  1546. smalltalk.addMethod(
  1547. "_testAtPut",
  1548. smalltalk.method({
  1549. selector: "testAtPut",
  1550. fn: function () {
  1551. var self=this;
  1552. return smalltalk.withContext(function($ctx1) { _st(self)._should_raise_((function(){
  1553. return smalltalk.withContext(function($ctx2) { return _st("hello")._at_put_((1),"a");
  1554. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
  1555. return self}, function($ctx1) {$ctx1.fill(self,"testAtPut",{}, smalltalk.SymbolTest)});}
  1556. }),
  1557. smalltalk.SymbolTest);
  1558. smalltalk.addMethod(
  1559. "_testCollect",
  1560. smalltalk.method({
  1561. selector: "testCollect",
  1562. fn: function () {
  1563. var self=this;
  1564. var newCollection;
  1565. return smalltalk.withContext(function($ctx1) { newCollection=smalltalk.symbolFor("hheelllloo");
  1566. _st(self)._assertSameContents_as_(_st(_st(self)._collection())._collect_((function(each){
  1567. return smalltalk.withContext(function($ctx2) { return _st(each).__comma(each);
  1568. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})),newCollection);
  1569. return self}, function($ctx1) {$ctx1.fill(self,"testCollect",{newCollection:newCollection}, smalltalk.SymbolTest)});}
  1570. }),
  1571. smalltalk.SymbolTest);
  1572. smalltalk.addMethod(
  1573. "_testComparing",
  1574. smalltalk.method({
  1575. selector: "testComparing",
  1576. fn: function () {
  1577. var self=this;
  1578. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(smalltalk.symbolFor("ab")).__gt(smalltalk.symbolFor("aa")));
  1579. _st(self)._deny_(_st(smalltalk.symbolFor("ab")).__gt(smalltalk.symbolFor("ba")));
  1580. _st(self)._assert_(_st(smalltalk.symbolFor("ab")).__lt(smalltalk.symbolFor("ba")));
  1581. _st(self)._deny_(_st(smalltalk.symbolFor("bb")).__lt(smalltalk.symbolFor("ba")));
  1582. _st(self)._assert_(_st(smalltalk.symbolFor("ab")).__gt_eq(smalltalk.symbolFor("aa")));
  1583. _st(self)._deny_(_st(smalltalk.symbolFor("ab")).__gt_eq(smalltalk.symbolFor("ba")));
  1584. _st(self)._assert_(_st(smalltalk.symbolFor("ab")).__lt_eq(smalltalk.symbolFor("ba")));
  1585. _st(self)._deny_(_st(smalltalk.symbolFor("bb")).__lt_eq(smalltalk.symbolFor("ba")));
  1586. return self}, function($ctx1) {$ctx1.fill(self,"testComparing",{}, smalltalk.SymbolTest)});}
  1587. }),
  1588. smalltalk.SymbolTest);
  1589. smalltalk.addMethod(
  1590. "_testCopying",
  1591. smalltalk.method({
  1592. selector: "testCopying",
  1593. fn: function () {
  1594. var self=this;
  1595. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(_st(smalltalk.symbolFor("hello"))._copy()).__eq_eq(smalltalk.symbolFor("hello")));
  1596. _st(self)._assert_(_st(_st(smalltalk.symbolFor("hello"))._deepCopy()).__eq_eq(smalltalk.symbolFor("hello")));
  1597. return self}, function($ctx1) {$ctx1.fill(self,"testCopying",{}, smalltalk.SymbolTest)});}
  1598. }),
  1599. smalltalk.SymbolTest);
  1600. smalltalk.addMethod(
  1601. "_testDetect",
  1602. smalltalk.method({
  1603. selector: "testDetect",
  1604. fn: function () {
  1605. var self=this;
  1606. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(_st(_st(self)._collection())._detect_((function(each){
  1607. return smalltalk.withContext(function($ctx2) { return _st(each).__eq("h");
  1608. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}))).__eq("h"));
  1609. _st(self)._should_raise_((function(){
  1610. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._collection())._detect_((function(each){
  1611. return smalltalk.withContext(function($ctx3) { return _st(each).__eq("z");
  1612. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  1613. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
  1614. return self}, function($ctx1) {$ctx1.fill(self,"testDetect",{}, smalltalk.SymbolTest)});}
  1615. }),
  1616. smalltalk.SymbolTest);
  1617. smalltalk.addMethod(
  1618. "_testEquality",
  1619. smalltalk.method({
  1620. selector: "testEquality",
  1621. fn: function () {
  1622. var self=this;
  1623. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(smalltalk.symbolFor("hello")).__eq(smalltalk.symbolFor("hello")));
  1624. _st(self)._deny_(_st(smalltalk.symbolFor("hello")).__eq(smalltalk.symbolFor("world")));
  1625. _st(self)._assert_(_st(smalltalk.symbolFor("hello")).__eq(_st(smalltalk.symbolFor("hello"))._yourself()));
  1626. _st(self)._assert_(_st(_st(smalltalk.symbolFor("hello"))._yourself()).__eq(smalltalk.symbolFor("hello")));
  1627. _st(self)._deny_(_st(smalltalk.symbolFor("hello")).__eq("hello"));
  1628. _st(self)._deny_(_st("hello").__eq(smalltalk.symbolFor("hello")));
  1629. return self}, function($ctx1) {$ctx1.fill(self,"testEquality",{}, smalltalk.SymbolTest)});}
  1630. }),
  1631. smalltalk.SymbolTest);
  1632. smalltalk.addMethod(
  1633. "_testIdentity",
  1634. smalltalk.method({
  1635. selector: "testIdentity",
  1636. fn: function () {
  1637. var self=this;
  1638. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(smalltalk.symbolFor("hello")).__eq_eq(smalltalk.symbolFor("hello")));
  1639. _st(self)._deny_(_st(smalltalk.symbolFor("hello")).__eq_eq(smalltalk.symbolFor("world")));
  1640. _st(self)._assert_(_st(smalltalk.symbolFor("hello")).__eq(_st(smalltalk.symbolFor("hello"))._yourself()));
  1641. _st(self)._assert_(_st(_st(smalltalk.symbolFor("hello"))._yourself()).__eq(_st(_st(smalltalk.symbolFor("hello"))._asString())._asSymbol()));
  1642. return self}, function($ctx1) {$ctx1.fill(self,"testIdentity",{}, smalltalk.SymbolTest)});}
  1643. }),
  1644. smalltalk.SymbolTest);
  1645. smalltalk.addMethod(
  1646. "_testIsEmpty",
  1647. smalltalk.method({
  1648. selector: "testIsEmpty",
  1649. fn: function () {
  1650. var self=this;
  1651. return smalltalk.withContext(function($ctx1) { _st(self)._deny_(_st(_st(self)._collection())._isEmpty());
  1652. _st(self)._assert_(_st(_st("")._asSymbol())._isEmpty());
  1653. return self}, function($ctx1) {$ctx1.fill(self,"testIsEmpty",{}, smalltalk.SymbolTest)});}
  1654. }),
  1655. smalltalk.SymbolTest);
  1656. smalltalk.addMethod(
  1657. "_testIsSymbolIsString",
  1658. smalltalk.method({
  1659. selector: "testIsSymbolIsString",
  1660. fn: function () {
  1661. var self=this;
  1662. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(smalltalk.symbolFor("hello"))._isSymbol());
  1663. _st(self)._deny_(_st("hello")._isSymbol());
  1664. _st(self)._deny_(_st(smalltalk.symbolFor("hello"))._isString());
  1665. _st(self)._assert_(_st("hello")._isString());
  1666. return self}, function($ctx1) {$ctx1.fill(self,"testIsSymbolIsString",{}, smalltalk.SymbolTest)});}
  1667. }),
  1668. smalltalk.SymbolTest);
  1669. smalltalk.addMethod(
  1670. "_testSelect",
  1671. smalltalk.method({
  1672. selector: "testSelect",
  1673. fn: function () {
  1674. var self=this;
  1675. var newCollection;
  1676. return smalltalk.withContext(function($ctx1) { newCollection="o";
  1677. _st(self)._assertSameContents_as_(_st(_st(self)._collection())._select_((function(each){
  1678. return smalltalk.withContext(function($ctx2) { return _st(each).__eq("o");
  1679. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})),newCollection);
  1680. return self}, function($ctx1) {$ctx1.fill(self,"testSelect",{newCollection:newCollection}, smalltalk.SymbolTest)});}
  1681. }),
  1682. smalltalk.SymbolTest);
  1683. smalltalk.addMethod(
  1684. "_testSize",
  1685. smalltalk.method({
  1686. selector: "testSize",
  1687. fn: function () {
  1688. var self=this;
  1689. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(smalltalk.symbolFor("a"))._size(),(1));
  1690. _st(self)._assert_equals_(_st(smalltalk.symbolFor("aaaaa"))._size(),(5));
  1691. return self}, function($ctx1) {$ctx1.fill(self,"testSize",{}, smalltalk.SymbolTest)});}
  1692. }),
  1693. smalltalk.SymbolTest);
  1694. smalltalk.addMethod(
  1695. "_collectionClass",
  1696. smalltalk.method({
  1697. selector: "collectionClass",
  1698. fn: function () {
  1699. var self=this;
  1700. return smalltalk.withContext(function($ctx1) { var $1;
  1701. $1=(smalltalk.Symbol || Symbol);
  1702. return $1;
  1703. }, function($ctx1) {$ctx1.fill(self,"collectionClass",{}, smalltalk.SymbolTest.klass)});}
  1704. }),
  1705. smalltalk.SymbolTest.klass);
  1706. smalltalk.addClass('JSObjectProxyTest', smalltalk.TestCase, [], 'Kernel-Tests');
  1707. smalltalk.addMethod(
  1708. "_jsObject",
  1709. smalltalk.method({
  1710. selector: "jsObject",
  1711. fn: function () {
  1712. var self=this;
  1713. return smalltalk.withContext(function($ctx1) { return jsObject = {a: 1, b: function() {return 2;}, c: function(object) {return object;}, d: '', 'e': null};
  1714. return self}, function($ctx1) {$ctx1.fill(self,"jsObject",{}, smalltalk.JSObjectProxyTest)});}
  1715. }),
  1716. smalltalk.JSObjectProxyTest);
  1717. smalltalk.addMethod(
  1718. "_testDNU",
  1719. smalltalk.method({
  1720. selector: "testDNU",
  1721. fn: function () {
  1722. var self=this;
  1723. return smalltalk.withContext(function($ctx1) { _st(self)._should_raise_((function(){
  1724. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._jsObject())._foo();
  1725. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1726. return self}, function($ctx1) {$ctx1.fill(self,"testDNU",{}, smalltalk.JSObjectProxyTest)});}
  1727. }),
  1728. smalltalk.JSObjectProxyTest);
  1729. smalltalk.addMethod(
  1730. "_testMessageSend",
  1731. smalltalk.method({
  1732. selector: "testMessageSend",
  1733. fn: function () {
  1734. var self=this;
  1735. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(_st(self)._jsObject())._a(),(1));
  1736. _st(self)._assert_equals_(_st(_st(self)._jsObject())._b(),(2));
  1737. _st(self)._assert_equals_(_st(_st(self)._jsObject())._c_((3)),(3));
  1738. return self}, function($ctx1) {$ctx1.fill(self,"testMessageSend",{}, smalltalk.JSObjectProxyTest)});}
  1739. }),
  1740. smalltalk.JSObjectProxyTest);
  1741. smalltalk.addMethod(
  1742. "_testMethodWithArguments",
  1743. smalltalk.method({
  1744. selector: "testMethodWithArguments",
  1745. fn: function () {
  1746. var self=this;
  1747. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(_st(self)._jsObject())._c_((1)),(1));
  1748. return self}, function($ctx1) {$ctx1.fill(self,"testMethodWithArguments",{}, smalltalk.JSObjectProxyTest)});}
  1749. }),
  1750. smalltalk.JSObjectProxyTest);
  1751. smalltalk.addMethod(
  1752. "_testPrinting",
  1753. smalltalk.method({
  1754. selector: "testPrinting",
  1755. fn: function () {
  1756. var self=this;
  1757. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(_st(_st(self)._jsObject())._printString()).__eq("[object Object]"));
  1758. return self}, function($ctx1) {$ctx1.fill(self,"testPrinting",{}, smalltalk.JSObjectProxyTest)});}
  1759. }),
  1760. smalltalk.JSObjectProxyTest);
  1761. smalltalk.addMethod(
  1762. "_testPropertyThatReturnsEmptyString",
  1763. smalltalk.method({
  1764. selector: "testPropertyThatReturnsEmptyString",
  1765. fn: function () {
  1766. var self=this;
  1767. var object;
  1768. return smalltalk.withContext(function($ctx1) { object=_st(self)._jsObject();
  1769. _st(self)._assert_equals_("",_st(object)._d());
  1770. _st(object)._d_("hello");
  1771. _st(self)._assert_equals_("hello",_st(object)._d());
  1772. return self}, function($ctx1) {$ctx1.fill(self,"testPropertyThatReturnsEmptyString",{object:object}, smalltalk.JSObjectProxyTest)});}
  1773. }),
  1774. smalltalk.JSObjectProxyTest);
  1775. smalltalk.addMethod(
  1776. "_testPropertyThatReturnsUndefined",
  1777. smalltalk.method({
  1778. selector: "testPropertyThatReturnsUndefined",
  1779. fn: function () {
  1780. var self=this;
  1781. var object;
  1782. return smalltalk.withContext(function($ctx1) { object=_st(self)._jsObject();
  1783. _st(self)._shouldnt_raise_((function(){
  1784. return smalltalk.withContext(function($ctx2) { return _st(object)._e();
  1785. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1786. _st(self)._assert_(_st(_st(object)._e())._isNil());
  1787. return self}, function($ctx1) {$ctx1.fill(self,"testPropertyThatReturnsUndefined",{object:object}, smalltalk.JSObjectProxyTest)});}
  1788. }),
  1789. smalltalk.JSObjectProxyTest);
  1790. smalltalk.addMethod(
  1791. "_testYourself",
  1792. smalltalk.method({
  1793. selector: "testYourself",
  1794. fn: function () {
  1795. var self=this;
  1796. var object;
  1797. return smalltalk.withContext(function($ctx1) { var $1,$2;
  1798. $1=_st(self)._jsObject();
  1799. _st($1)._d_("test");
  1800. $2=_st($1)._yourself();
  1801. object=$2;
  1802. _st(self)._assert_equals_(_st(object)._d(),"test");
  1803. return self}, function($ctx1) {$ctx1.fill(self,"testYourself",{object:object}, smalltalk.JSObjectProxyTest)});}
  1804. }),
  1805. smalltalk.JSObjectProxyTest);
  1806. smalltalk.addClass('JavaScriptExceptionTest', smalltalk.TestCase, [], 'Kernel-Tests');
  1807. smalltalk.addMethod(
  1808. "_testCatchingException",
  1809. smalltalk.method({
  1810. selector: "testCatchingException",
  1811. fn: function () {
  1812. var self=this;
  1813. return smalltalk.withContext(function($ctx1) { _st((function(){
  1814. return smalltalk.withContext(function($ctx2) { return _st(self)._throwException();
  1815. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_((smalltalk.Error || Error),(function(error){
  1816. return smalltalk.withContext(function($ctx2) { return _st(self)._assert_(_st(_st(error)._exception()).__eq("test"));
  1817. }, function($ctx2) {$ctx2.fillBlock({error:error},$ctx1)})}));
  1818. return self}, function($ctx1) {$ctx1.fill(self,"testCatchingException",{}, smalltalk.JavaScriptExceptionTest)});}
  1819. }),
  1820. smalltalk.JavaScriptExceptionTest);
  1821. smalltalk.addMethod(
  1822. "_testRaisingException",
  1823. smalltalk.method({
  1824. selector: "testRaisingException",
  1825. fn: function () {
  1826. var self=this;
  1827. return smalltalk.withContext(function($ctx1) { _st(self)._should_raise_((function(){
  1828. return smalltalk.withContext(function($ctx2) { return _st(self)._throwException();
  1829. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.JavaScriptException || JavaScriptException));
  1830. return self}, function($ctx1) {$ctx1.fill(self,"testRaisingException",{}, smalltalk.JavaScriptExceptionTest)});}
  1831. }),
  1832. smalltalk.JavaScriptExceptionTest);
  1833. smalltalk.addMethod(
  1834. "_throwException",
  1835. smalltalk.method({
  1836. selector: "throwException",
  1837. fn: function () {
  1838. var self=this;
  1839. return smalltalk.withContext(function($ctx1) { throw 'test';
  1840. return self}, function($ctx1) {$ctx1.fill(self,"throwException",{}, smalltalk.JavaScriptExceptionTest)});}
  1841. }),
  1842. smalltalk.JavaScriptExceptionTest);
  1843. smalltalk.addClass('NumberTest', smalltalk.TestCase, [], 'Kernel-Tests');
  1844. smalltalk.addMethod(
  1845. "_testAbs",
  1846. smalltalk.method({
  1847. selector: "testAbs",
  1848. fn: function () {
  1849. var self=this;
  1850. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(_st((4))._abs()).__eq((4)));
  1851. _st(self)._assert_(_st(_st((-4))._abs()).__eq((4)));
  1852. return self}, function($ctx1) {$ctx1.fill(self,"testAbs",{}, smalltalk.NumberTest)});}
  1853. }),
  1854. smalltalk.NumberTest);
  1855. smalltalk.addMethod(
  1856. "_testArithmetic",
  1857. smalltalk.method({
  1858. selector: "testArithmetic",
  1859. fn: function () {
  1860. var self=this;
  1861. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(_st((1.5)).__plus((1))).__eq((2.5)));
  1862. _st(self)._assert_(_st(_st((2)).__minus((1))).__eq((1)));
  1863. _st(self)._assert_(_st(_st((-2)).__minus((1))).__eq((-3)));
  1864. _st(self)._assert_(_st(_st((12)).__slash((2))).__eq((6)));
  1865. _st(self)._assert_(_st(_st((3)).__star((4))).__eq((12)));
  1866. _st(self)._assert_(_st(_st(_st((1)).__plus((2))).__star((3))).__eq((9)));
  1867. _st(self)._assert_(_st(_st((1)).__plus(_st((2)).__star((3)))).__eq((7)));
  1868. return self}, function($ctx1) {$ctx1.fill(self,"testArithmetic",{}, smalltalk.NumberTest)});}
  1869. }),
  1870. smalltalk.NumberTest);
  1871. smalltalk.addMethod(
  1872. "_testComparison",
  1873. smalltalk.method({
  1874. selector: "testComparison",
  1875. fn: function () {
  1876. var self=this;
  1877. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st((3)).__gt((2)));
  1878. _st(self)._assert_(_st((2)).__lt((3)));
  1879. _st(self)._deny_(_st((3)).__lt((2)));
  1880. _st(self)._deny_(_st((2)).__gt((3)));
  1881. _st(self)._assert_(_st((3)).__gt_eq((3)));
  1882. _st(self)._assert_(_st((3.1)).__gt_eq((3)));
  1883. _st(self)._assert_(_st((3)).__lt_eq((3)));
  1884. _st(self)._assert_(_st((3)).__lt_eq((3.1)));
  1885. return self}, function($ctx1) {$ctx1.fill(self,"testComparison",{}, smalltalk.NumberTest)});}
  1886. }),
  1887. smalltalk.NumberTest);
  1888. smalltalk.addMethod(
  1889. "_testCopying",
  1890. smalltalk.method({
  1891. selector: "testCopying",
  1892. fn: function () {
  1893. var self=this;
  1894. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(_st((1))._copy()).__eq_eq((1)));
  1895. _st(self)._assert_(_st(_st((1))._deepCopy()).__eq_eq((1)));
  1896. return self}, function($ctx1) {$ctx1.fill(self,"testCopying",{}, smalltalk.NumberTest)});}
  1897. }),
  1898. smalltalk.NumberTest);
  1899. smalltalk.addMethod(
  1900. "_testEquality",
  1901. smalltalk.method({
  1902. selector: "testEquality",
  1903. fn: function () {
  1904. var self=this;
  1905. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st((1)).__eq((1)));
  1906. _st(self)._assert_(_st((0)).__eq((0)));
  1907. _st(self)._deny_(_st((1)).__eq((0)));
  1908. _st(self)._assert_(_st(_st((1))._yourself()).__eq((1)));
  1909. _st(self)._assert_(_st((1)).__eq(_st((1))._yourself()));
  1910. _st(self)._assert_(_st(_st((1))._yourself()).__eq(_st((1))._yourself()));
  1911. _st(self)._deny_(_st((0)).__eq(false));
  1912. _st(self)._deny_(_st(false).__eq((0)));
  1913. _st(self)._deny_(_st("").__eq((0)));
  1914. _st(self)._deny_(_st((0)).__eq(""));
  1915. return self}, function($ctx1) {$ctx1.fill(self,"testEquality",{}, smalltalk.NumberTest)});}
  1916. }),
  1917. smalltalk.NumberTest);
  1918. smalltalk.addMethod(
  1919. "_testHexNumbers",
  1920. smalltalk.method({
  1921. selector: "testHexNumbers",
  1922. fn: function () {
  1923. var self=this;
  1924. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st((9)).__eq((9)));
  1925. _st(self)._assert_(_st(_st((10))._truncated()).__eq((10)));
  1926. _st(self)._assert_(_st(_st((11))._truncated()).__eq((11)));
  1927. _st(self)._assert_(_st(_st((12))._truncated()).__eq((12)));
  1928. _st(self)._assert_(_st(_st((13))._truncated()).__eq((13)));
  1929. _st(self)._assert_(_st(_st((14))._truncated()).__eq((14)));
  1930. _st(self)._assert_(_st(_st((15))._truncated()).__eq((15)));
  1931. return self}, function($ctx1) {$ctx1.fill(self,"testHexNumbers",{}, smalltalk.NumberTest)});}
  1932. }),
  1933. smalltalk.NumberTest);
  1934. smalltalk.addMethod(
  1935. "_testIdentity",
  1936. smalltalk.method({
  1937. selector: "testIdentity",
  1938. fn: function () {
  1939. var self=this;
  1940. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st((1)).__eq_eq((1)));
  1941. _st(self)._assert_(_st((0)).__eq_eq((0)));
  1942. _st(self)._deny_(_st((1)).__eq_eq((0)));
  1943. _st(self)._assert_(_st(_st((1))._yourself()).__eq_eq((1)));
  1944. _st(self)._assert_(_st((1)).__eq_eq(_st((1))._yourself()));
  1945. _st(self)._assert_(_st(_st((1))._yourself()).__eq_eq(_st((1))._yourself()));
  1946. _st(self)._deny_(_st((1)).__eq_eq((2)));
  1947. return self}, function($ctx1) {$ctx1.fill(self,"testIdentity",{}, smalltalk.NumberTest)});}
  1948. }),
  1949. smalltalk.NumberTest);
  1950. smalltalk.addMethod(
  1951. "_testInvalidHexNumbers",
  1952. smalltalk.method({
  1953. selector: "testInvalidHexNumbers",
  1954. fn: function () {
  1955. var self=this;
  1956. return smalltalk.withContext(function($ctx1) { _st(self)._should_raise_((function(){
  1957. return smalltalk.withContext(function($ctx2) { return _st((16))._rG();
  1958. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1959. _st(self)._should_raise_((function(){
  1960. return smalltalk.withContext(function($ctx2) { return _st((16))._rg();
  1961. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1962. _st(self)._should_raise_((function(){
  1963. return smalltalk.withContext(function($ctx2) { return _st((16))._rH();
  1964. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1965. _st(self)._should_raise_((function(){
  1966. return smalltalk.withContext(function($ctx2) { return _st((16))._rh();
  1967. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1968. _st(self)._should_raise_((function(){
  1969. return smalltalk.withContext(function($ctx2) { return _st((16))._rI();
  1970. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1971. _st(self)._should_raise_((function(){
  1972. return smalltalk.withContext(function($ctx2) { return _st((16))._ri();
  1973. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1974. _st(self)._should_raise_((function(){
  1975. return smalltalk.withContext(function($ctx2) { return _st((16))._rJ();
  1976. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1977. _st(self)._should_raise_((function(){
  1978. return smalltalk.withContext(function($ctx2) { return _st((16))._rj();
  1979. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1980. _st(self)._should_raise_((function(){
  1981. return smalltalk.withContext(function($ctx2) { return _st((16))._rK();
  1982. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1983. _st(self)._should_raise_((function(){
  1984. return smalltalk.withContext(function($ctx2) { return _st((16))._rk();
  1985. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1986. _st(self)._should_raise_((function(){
  1987. return smalltalk.withContext(function($ctx2) { return _st((16))._rL();
  1988. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1989. _st(self)._should_raise_((function(){
  1990. return smalltalk.withContext(function($ctx2) { return _st((16))._rl();
  1991. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1992. _st(self)._should_raise_((function(){
  1993. return smalltalk.withContext(function($ctx2) { return _st((16))._rM();
  1994. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1995. _st(self)._should_raise_((function(){
  1996. return smalltalk.withContext(function($ctx2) { return _st((16))._rm();
  1997. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1998. _st(self)._should_raise_((function(){
  1999. return smalltalk.withContext(function($ctx2) { return _st((16))._rN();
  2000. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2001. _st(self)._should_raise_((function(){
  2002. return smalltalk.withContext(function($ctx2) { return _st((16))._rn();
  2003. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2004. _st(self)._should_raise_((function(){
  2005. return smalltalk.withContext(function($ctx2) { return _st((16))._rO();
  2006. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2007. _st(self)._should_raise_((function(){
  2008. return smalltalk.withContext(function($ctx2) { return _st((16))._ro();
  2009. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2010. _st(self)._should_raise_((function(){
  2011. return smalltalk.withContext(function($ctx2) { return _st((16))._rP();
  2012. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2013. _st(self)._should_raise_((function(){
  2014. return smalltalk.withContext(function($ctx2) { return _st((16))._rp();
  2015. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2016. _st(self)._should_raise_((function(){
  2017. return smalltalk.withContext(function($ctx2) { return _st((16))._rQ();
  2018. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2019. _st(self)._should_raise_((function(){
  2020. return smalltalk.withContext(function($ctx2) { return _st((16))._rq();
  2021. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2022. _st(self)._should_raise_((function(){
  2023. return smalltalk.withContext(function($ctx2) { return _st((16))._rR();
  2024. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2025. _st(self)._should_raise_((function(){
  2026. return smalltalk.withContext(function($ctx2) { return _st((16))._rr();
  2027. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2028. _st(self)._should_raise_((function(){
  2029. return smalltalk.withContext(function($ctx2) { return _st((16))._rS();
  2030. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2031. _st(self)._should_raise_((function(){
  2032. return smalltalk.withContext(function($ctx2) { return _st((16))._rs();
  2033. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2034. _st(self)._should_raise_((function(){
  2035. return smalltalk.withContext(function($ctx2) { return _st((16))._rT();
  2036. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2037. _st(self)._should_raise_((function(){
  2038. return smalltalk.withContext(function($ctx2) { return _st((16))._rt();
  2039. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2040. _st(self)._should_raise_((function(){
  2041. return smalltalk.withContext(function($ctx2) { return _st((16))._rU();
  2042. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2043. _st(self)._should_raise_((function(){
  2044. return smalltalk.withContext(function($ctx2) { return _st((16))._ru();
  2045. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2046. _st(self)._should_raise_((function(){
  2047. return smalltalk.withContext(function($ctx2) { return _st((16))._rV();
  2048. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2049. _st(self)._should_raise_((function(){
  2050. return smalltalk.withContext(function($ctx2) { return _st((16))._rv();
  2051. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2052. _st(self)._should_raise_((function(){
  2053. return smalltalk.withContext(function($ctx2) { return _st((16))._rW();
  2054. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2055. _st(self)._should_raise_((function(){
  2056. return smalltalk.withContext(function($ctx2) { return _st((16))._rw();
  2057. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2058. _st(self)._should_raise_((function(){
  2059. return smalltalk.withContext(function($ctx2) { return _st((16))._rX();
  2060. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2061. _st(self)._should_raise_((function(){
  2062. return smalltalk.withContext(function($ctx2) { return _st((16))._rx();
  2063. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2064. _st(self)._should_raise_((function(){
  2065. return smalltalk.withContext(function($ctx2) { return _st((16))._rY();
  2066. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2067. _st(self)._should_raise_((function(){
  2068. return smalltalk.withContext(function($ctx2) { return _st((16))._ry();
  2069. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2070. _st(self)._should_raise_((function(){
  2071. return smalltalk.withContext(function($ctx2) { return _st((16))._rZ();
  2072. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2073. _st(self)._should_raise_((function(){
  2074. return smalltalk.withContext(function($ctx2) { return _st((16))._rz();
  2075. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2076. _st(self)._should_raise_((function(){
  2077. return smalltalk.withContext(function($ctx2) { return _st((11259375))._Z();
  2078. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2079. return self}, function($ctx1) {$ctx1.fill(self,"testInvalidHexNumbers",{}, smalltalk.NumberTest)});}
  2080. }),
  2081. smalltalk.NumberTest);
  2082. smalltalk.addMethod(
  2083. "_testMinMax",
  2084. smalltalk.method({
  2085. selector: "testMinMax",
  2086. fn: function () {
  2087. var self=this;
  2088. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st((2))._max_((5)),(5));
  2089. _st(self)._assert_equals_(_st((2))._min_((5)),(2));
  2090. return self}, function($ctx1) {$ctx1.fill(self,"testMinMax",{}, smalltalk.NumberTest)});}
  2091. }),
  2092. smalltalk.NumberTest);
  2093. smalltalk.addMethod(
  2094. "_testNegated",
  2095. smalltalk.method({
  2096. selector: "testNegated",
  2097. fn: function () {
  2098. var self=this;
  2099. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(_st((3))._negated()).__eq((-3)));
  2100. _st(self)._assert_(_st(_st((-3))._negated()).__eq((3)));
  2101. return self}, function($ctx1) {$ctx1.fill(self,"testNegated",{}, smalltalk.NumberTest)});}
  2102. }),
  2103. smalltalk.NumberTest);
  2104. smalltalk.addMethod(
  2105. "_testPrintShowingDecimalPlaces",
  2106. smalltalk.method({
  2107. selector: "testPrintShowingDecimalPlaces",
  2108. fn: function () {
  2109. var self=this;
  2110. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_("23.00",_st((23))._printShowingDecimalPlaces_((2)));
  2111. _st(self)._assert_equals_("23.57",_st((23.5698))._printShowingDecimalPlaces_((2)));
  2112. _st(self)._assert_equals_("-234.56700",_st(_st((234.567))._negated())._printShowingDecimalPlaces_((5)));
  2113. _st(self)._assert_equals_("23",_st((23.4567))._printShowingDecimalPlaces_((0)));
  2114. _st(self)._assert_equals_("24",_st((23.5567))._printShowingDecimalPlaces_((0)));
  2115. _st(self)._assert_equals_("-23",_st(_st((23.4567))._negated())._printShowingDecimalPlaces_((0)));
  2116. _st(self)._assert_equals_("-24",_st(_st((23.5567))._negated())._printShowingDecimalPlaces_((0)));
  2117. _st(self)._assert_equals_("100000000.0",_st((100000000))._printShowingDecimalPlaces_((1)));
  2118. _st(self)._assert_equals_("0.98000",_st((0.98))._printShowingDecimalPlaces_((5)));
  2119. _st(self)._assert_equals_("-0.98",_st(_st((0.98))._negated())._printShowingDecimalPlaces_((2)));
  2120. _st(self)._assert_equals_("2.57",_st((2.567))._printShowingDecimalPlaces_((2)));
  2121. _st(self)._assert_equals_("-2.57",_st((-2.567))._printShowingDecimalPlaces_((2)));
  2122. _st(self)._assert_equals_("0.00",_st((0))._printShowingDecimalPlaces_((2)));
  2123. return self}, function($ctx1) {$ctx1.fill(self,"testPrintShowingDecimalPlaces",{}, smalltalk.NumberTest)});}
  2124. }),
  2125. smalltalk.NumberTest);
  2126. smalltalk.addMethod(
  2127. "_testRounded",
  2128. smalltalk.method({
  2129. selector: "testRounded",
  2130. fn: function () {
  2131. var self=this;
  2132. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(_st((3))._rounded()).__eq((3)));
  2133. _st(self)._assert_(_st(_st((3.212))._rounded()).__eq((3)));
  2134. _st(self)._assert_(_st(_st((3.51))._rounded()).__eq((4)));
  2135. return self}, function($ctx1) {$ctx1.fill(self,"testRounded",{}, smalltalk.NumberTest)});}
  2136. }),
  2137. smalltalk.NumberTest);
  2138. smalltalk.addMethod(
  2139. "_testSqrt",
  2140. smalltalk.method({
  2141. selector: "testSqrt",
  2142. fn: function () {
  2143. var self=this;
  2144. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(_st((4))._sqrt()).__eq((2)));
  2145. _st(self)._assert_(_st(_st((16))._sqrt()).__eq((4)));
  2146. return self}, function($ctx1) {$ctx1.fill(self,"testSqrt",{}, smalltalk.NumberTest)});}
  2147. }),
  2148. smalltalk.NumberTest);
  2149. smalltalk.addMethod(
  2150. "_testSquared",
  2151. smalltalk.method({
  2152. selector: "testSquared",
  2153. fn: function () {
  2154. var self=this;
  2155. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(_st((4))._squared()).__eq((16)));
  2156. return self}, function($ctx1) {$ctx1.fill(self,"testSquared",{}, smalltalk.NumberTest)});}
  2157. }),
  2158. smalltalk.NumberTest);
  2159. smalltalk.addMethod(
  2160. "_testTimesRepeat",
  2161. smalltalk.method({
  2162. selector: "testTimesRepeat",
  2163. fn: function () {
  2164. var self=this;
  2165. var i;
  2166. return smalltalk.withContext(function($ctx1) { i=(0);
  2167. _st((0))._timesRepeat_((function(){
  2168. return smalltalk.withContext(function($ctx2) { i=_st(i).__plus((1));
  2169. return i;
  2170. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2171. _st(self)._assert_equals_(i,(0));
  2172. _st((5))._timesRepeat_((function(){
  2173. return smalltalk.withContext(function($ctx2) { i=_st(i).__plus((1));
  2174. return i;
  2175. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2176. _st(self)._assert_equals_(i,(5));
  2177. return self}, function($ctx1) {$ctx1.fill(self,"testTimesRepeat",{i:i}, smalltalk.NumberTest)});}
  2178. }),
  2179. smalltalk.NumberTest);
  2180. smalltalk.addMethod(
  2181. "_testTo",
  2182. smalltalk.method({
  2183. selector: "testTo",
  2184. fn: function () {
  2185. var self=this;
  2186. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st((1))._to_((5)),[(1), (2), (3), (4), (5)]);
  2187. return self}, function($ctx1) {$ctx1.fill(self,"testTo",{}, smalltalk.NumberTest)});}
  2188. }),
  2189. smalltalk.NumberTest);
  2190. smalltalk.addMethod(
  2191. "_testToBy",
  2192. smalltalk.method({
  2193. selector: "testToBy",
  2194. fn: function () {
  2195. var self=this;
  2196. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st((0))._to_by_((6),(2)),[(0), (2), (4), (6)]);
  2197. _st(self)._should_raise_((function(){
  2198. return smalltalk.withContext(function($ctx2) { return _st((1))._to_by_((4),(0));
  2199. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
  2200. return self}, function($ctx1) {$ctx1.fill(self,"testToBy",{}, smalltalk.NumberTest)});}
  2201. }),
  2202. smalltalk.NumberTest);
  2203. smalltalk.addMethod(
  2204. "_testTruncated",
  2205. smalltalk.method({
  2206. selector: "testTruncated",
  2207. fn: function () {
  2208. var self=this;
  2209. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(_st((3))._truncated()).__eq((3)));
  2210. _st(self)._assert_(_st(_st((3.212))._truncated()).__eq((3)));
  2211. _st(self)._assert_(_st(_st((3.51))._truncated()).__eq((3)));
  2212. return self}, function($ctx1) {$ctx1.fill(self,"testTruncated",{}, smalltalk.NumberTest)});}
  2213. }),
  2214. smalltalk.NumberTest);
  2215. smalltalk.addClass('ObjectMock', smalltalk.Object, ['foo', 'bar'], 'Kernel-Tests');
  2216. smalltalk.addMethod(
  2217. "_foo",
  2218. smalltalk.method({
  2219. selector: "foo",
  2220. fn: function () {
  2221. var self=this;
  2222. return smalltalk.withContext(function($ctx1) { var $1;
  2223. $1=self["@foo"];
  2224. return $1;
  2225. }, function($ctx1) {$ctx1.fill(self,"foo",{}, smalltalk.ObjectMock)});}
  2226. }),
  2227. smalltalk.ObjectMock);
  2228. smalltalk.addMethod(
  2229. "_foo_",
  2230. smalltalk.method({
  2231. selector: "foo:",
  2232. fn: function (anObject) {
  2233. var self=this;
  2234. return smalltalk.withContext(function($ctx1) { self["@foo"]=anObject;
  2235. return self}, function($ctx1) {$ctx1.fill(self,"foo:",{anObject:anObject}, smalltalk.ObjectMock)});}
  2236. }),
  2237. smalltalk.ObjectMock);
  2238. smalltalk.addClass('ObjectTest', smalltalk.TestCase, [], 'Kernel-Tests');
  2239. smalltalk.addMethod(
  2240. "_notDefined",
  2241. smalltalk.method({
  2242. selector: "notDefined",
  2243. fn: function () {
  2244. var self=this;
  2245. return smalltalk.withContext(function($ctx1) { return undefined;;
  2246. return self}, function($ctx1) {$ctx1.fill(self,"notDefined",{}, smalltalk.ObjectTest)});}
  2247. }),
  2248. smalltalk.ObjectTest);
  2249. smalltalk.addMethod(
  2250. "_testBasicAccess",
  2251. smalltalk.method({
  2252. selector: "testBasicAccess",
  2253. fn: function () {
  2254. var self=this;
  2255. var o;
  2256. return smalltalk.withContext(function($ctx1) { o=_st((smalltalk.Object || Object))._new();
  2257. _st(o)._basicAt_put_("a",(1));
  2258. _st(self)._assert_equals_(_st(o)._basicAt_("a"),(1));
  2259. _st(self)._assert_equals_(_st(o)._basicAt_("b"),nil);
  2260. return self}, function($ctx1) {$ctx1.fill(self,"testBasicAccess",{o:o}, smalltalk.ObjectTest)});}
  2261. }),
  2262. smalltalk.ObjectTest);
  2263. smalltalk.addMethod(
  2264. "_testBasicPerform",
  2265. smalltalk.method({
  2266. selector: "testBasicPerform",
  2267. fn: function () {
  2268. var self=this;
  2269. var o;
  2270. return smalltalk.withContext(function($ctx1) { o=_st((smalltalk.Object || Object))._new();
  2271. _st(o)._basicAt_put_("func",(function(){
  2272. return smalltalk.withContext(function($ctx2) { return "hello";
  2273. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2274. _st(o)._basicAt_put_("func2",(function(a){
  2275. return smalltalk.withContext(function($ctx2) { return _st(a).__plus((1));
  2276. }, function($ctx2) {$ctx2.fillBlock({a:a},$ctx1)})}));
  2277. _st(self)._assert_equals_(_st(o)._basicPerform_("func"),"hello");
  2278. _st(self)._assert_equals_(_st(o)._basicPerform_withArguments_("func2",[(3)]),(4));
  2279. return self}, function($ctx1) {$ctx1.fill(self,"testBasicPerform",{o:o}, smalltalk.ObjectTest)});}
  2280. }),
  2281. smalltalk.ObjectTest);
  2282. smalltalk.addMethod(
  2283. "_testDNU",
  2284. smalltalk.method({
  2285. selector: "testDNU",
  2286. fn: function () {
  2287. var self=this;
  2288. return smalltalk.withContext(function($ctx1) { _st(self)._should_raise_((function(){
  2289. return smalltalk.withContext(function($ctx2) { return _st(_st((smalltalk.Object || Object))._new())._foo();
  2290. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2291. return self}, function($ctx1) {$ctx1.fill(self,"testDNU",{}, smalltalk.ObjectTest)});}
  2292. }),
  2293. smalltalk.ObjectTest);
  2294. smalltalk.addMethod(
  2295. "_testEquality",
  2296. smalltalk.method({
  2297. selector: "testEquality",
  2298. fn: function () {
  2299. var self=this;
  2300. var o;
  2301. return smalltalk.withContext(function($ctx1) { o=_st((smalltalk.Object || Object))._new();
  2302. _st(self)._deny_(_st(o).__eq(_st((smalltalk.Object || Object))._new()));
  2303. _st(self)._assert_(_st(o).__eq(o));
  2304. _st(self)._assert_(_st(_st(o)._yourself()).__eq(o));
  2305. _st(self)._assert_(_st(o).__eq(_st(o)._yourself()));
  2306. return self}, function($ctx1) {$ctx1.fill(self,"testEquality",{o:o}, smalltalk.ObjectTest)});}
  2307. }),
  2308. smalltalk.ObjectTest);
  2309. smalltalk.addMethod(
  2310. "_testHalt",
  2311. smalltalk.method({
  2312. selector: "testHalt",
  2313. fn: function () {
  2314. var self=this;
  2315. return smalltalk.withContext(function($ctx1) { _st(self)._should_raise_((function(){
  2316. return smalltalk.withContext(function($ctx2) { return _st(_st((smalltalk.Object || Object))._new())._halt();
  2317. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
  2318. return self}, function($ctx1) {$ctx1.fill(self,"testHalt",{}, smalltalk.ObjectTest)});}
  2319. }),
  2320. smalltalk.ObjectTest);
  2321. smalltalk.addMethod(
  2322. "_testIdentity",
  2323. smalltalk.method({
  2324. selector: "testIdentity",
  2325. fn: function () {
  2326. var self=this;
  2327. var o;
  2328. return smalltalk.withContext(function($ctx1) { o=_st((smalltalk.Object || Object))._new();
  2329. _st(self)._deny_(_st(o).__eq_eq(_st((smalltalk.Object || Object))._new()));
  2330. _st(self)._assert_(_st(o).__eq_eq(o));
  2331. _st(self)._assert_(_st(_st(o)._yourself()).__eq_eq(o));
  2332. _st(self)._assert_(_st(o).__eq_eq(_st(o)._yourself()));
  2333. return self}, function($ctx1) {$ctx1.fill(self,"testIdentity",{o:o}, smalltalk.ObjectTest)});}
  2334. }),
  2335. smalltalk.ObjectTest);
  2336. smalltalk.addMethod(
  2337. "_testIfNil",
  2338. smalltalk.method({
  2339. selector: "testIfNil",
  2340. fn: function () {
  2341. var self=this;
  2342. return smalltalk.withContext(function($ctx1) { var $1,$4,$3,$2,$5,$8,$7,$6,$9,$12,$11,$10;
  2343. _st(self)._deny_(_st(_st((smalltalk.Object || Object))._new())._isNil());
  2344. $1=self;
  2345. $4=_st((smalltalk.Object || Object))._new();
  2346. if(($receiver = $4) == nil || $receiver == undefined){
  2347. $3=true;
  2348. } else {
  2349. $3=$4;
  2350. };
  2351. $2=_st($3).__eq(true);
  2352. _st($1)._deny_($2);
  2353. $5=self;
  2354. $8=_st((smalltalk.Object || Object))._new();
  2355. if(($receiver = $8) == nil || $receiver == undefined){
  2356. $7=$8;
  2357. } else {
  2358. $7=true;
  2359. };
  2360. $6=_st($7).__eq(true);
  2361. _st($5)._assert_($6);
  2362. $9=self;
  2363. $12=_st((smalltalk.Object || Object))._new();
  2364. if(($receiver = $12) == nil || $receiver == undefined){
  2365. $11=false;
  2366. } else {
  2367. $11=true;
  2368. };
  2369. $10=_st($11).__eq(true);
  2370. _st($9)._assert_($10);
  2371. _st(self)._assert_(_st(_st(_st((smalltalk.Object || Object))._new())._ifNotNil_ifNil_((function(){
  2372. return smalltalk.withContext(function($ctx2) { return true;
  2373. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(function(){
  2374. return smalltalk.withContext(function($ctx2) { return false;
  2375. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))).__eq(true));
  2376. return self}, function($ctx1) {$ctx1.fill(self,"testIfNil",{}, smalltalk.ObjectTest)});}
  2377. }),
  2378. smalltalk.ObjectTest);
  2379. smalltalk.addMethod(
  2380. "_testInstVars",
  2381. smalltalk.method({
  2382. selector: "testInstVars",
  2383. fn: function () {
  2384. var self=this;
  2385. var o;
  2386. return smalltalk.withContext(function($ctx1) { o=_st((smalltalk.ObjectMock || ObjectMock))._new();
  2387. _st(self)._assert_equals_(_st(o)._instVarAt_(smalltalk.symbolFor("foo")),nil);
  2388. _st(o)._instVarAt_put_(smalltalk.symbolFor("foo"),(1));
  2389. _st(self)._assert_equals_(_st(o)._instVarAt_(smalltalk.symbolFor("foo")),(1));
  2390. _st(self)._assert_equals_(_st(o)._instVarAt_("foo"),(1));
  2391. return self}, function($ctx1) {$ctx1.fill(self,"testInstVars",{o:o}, smalltalk.ObjectTest)});}
  2392. }),
  2393. smalltalk.ObjectTest);
  2394. smalltalk.addMethod(
  2395. "_testNilUndefined",
  2396. smalltalk.method({
  2397. selector: "testNilUndefined",
  2398. fn: function () {
  2399. var self=this;
  2400. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(nil).__eq(_st(self)._notDefined()));
  2401. return self}, function($ctx1) {$ctx1.fill(self,"testNilUndefined",{}, smalltalk.ObjectTest)});}
  2402. }),
  2403. smalltalk.ObjectTest);
  2404. smalltalk.addMethod(
  2405. "_testYourself",
  2406. smalltalk.method({
  2407. selector: "testYourself",
  2408. fn: function () {
  2409. var self=this;
  2410. var o;
  2411. return smalltalk.withContext(function($ctx1) { o=_st((smalltalk.ObjectMock || ObjectMock))._new();
  2412. _st(self)._assert_(_st(_st(o)._yourself()).__eq_eq(o));
  2413. return self}, function($ctx1) {$ctx1.fill(self,"testYourself",{o:o}, smalltalk.ObjectTest)});}
  2414. }),
  2415. smalltalk.ObjectTest);
  2416. smalltalk.addMethod(
  2417. "_testidentityHash",
  2418. smalltalk.method({
  2419. selector: "testidentityHash",
  2420. fn: function () {
  2421. var self=this;
  2422. var o1,o2;
  2423. return smalltalk.withContext(function($ctx1) { o1=_st((smalltalk.Object || Object))._new();
  2424. o2=_st((smalltalk.Object || Object))._new();
  2425. _st(self)._assert_(_st(_st(o1)._identityHash()).__eq_eq(_st(o1)._identityHash()));
  2426. _st(self)._deny_(_st(_st(o1)._identityHash()).__eq_eq(_st(o2)._identityHash()));
  2427. return self}, function($ctx1) {$ctx1.fill(self,"testidentityHash",{o1:o1,o2:o2}, smalltalk.ObjectTest)});}
  2428. }),
  2429. smalltalk.ObjectTest);
  2430. smalltalk.addClass('PackageTest', smalltalk.TestCase, ['zorkPackage', 'grulPackage', 'backUpCommitPathJs', 'backUpCommitPathSt'], 'Kernel-Tests');
  2431. smalltalk.addMethod(
  2432. "_setUp",
  2433. smalltalk.method({
  2434. selector: "setUp",
  2435. fn: function () {
  2436. var self=this;
  2437. return smalltalk.withContext(function($ctx1) { var $1,$2;
  2438. self["@backUpCommitPathJs"]=_st((smalltalk.Package || Package))._defaultCommitPathJs();
  2439. self["@backUpCommitPathSt"]=_st((smalltalk.Package || Package))._defaultCommitPathSt();
  2440. _st((smalltalk.Package || Package))._resetCommitPaths();
  2441. self["@zorkPackage"]=_st(_st((smalltalk.Package || Package))._new())._name_("Zork");
  2442. $1=_st((smalltalk.Package || Package))._new();
  2443. _st($1)._name_("Grul");
  2444. _st($1)._commitPathJs_("server/grul/js");
  2445. _st($1)._commitPathSt_("grul/st");
  2446. $2=_st($1)._yourself();
  2447. self["@grulPackage"]=$2;
  2448. return self}, function($ctx1) {$ctx1.fill(self,"setUp",{}, smalltalk.PackageTest)});}
  2449. }),
  2450. smalltalk.PackageTest);
  2451. smalltalk.addMethod(
  2452. "_tearDown",
  2453. smalltalk.method({
  2454. selector: "tearDown",
  2455. fn: function () {
  2456. var self=this;
  2457. return smalltalk.withContext(function($ctx1) { var $1,$2;
  2458. $1=(smalltalk.Package || Package);
  2459. _st($1)._defaultCommitPathJs_(self["@backUpCommitPathJs"]);
  2460. $2=_st($1)._defaultCommitPathSt_(self["@backUpCommitPathSt"]);
  2461. return self}, function($ctx1) {$ctx1.fill(self,"tearDown",{}, smalltalk.PackageTest)});}
  2462. }),
  2463. smalltalk.PackageTest);
  2464. smalltalk.addMethod(
  2465. "_testGrulCommitPathJsShouldBeServerGrulJs",
  2466. smalltalk.method({
  2467. selector: "testGrulCommitPathJsShouldBeServerGrulJs",
  2468. fn: function () {
  2469. var self=this;
  2470. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_("server/grul/js",_st(self["@grulPackage"])._commitPathJs());
  2471. return self}, function($ctx1) {$ctx1.fill(self,"testGrulCommitPathJsShouldBeServerGrulJs",{}, smalltalk.PackageTest)});}
  2472. }),
  2473. smalltalk.PackageTest);
  2474. smalltalk.addMethod(
  2475. "_testGrulCommitPathStShouldBeGrulSt",
  2476. smalltalk.method({
  2477. selector: "testGrulCommitPathStShouldBeGrulSt",
  2478. fn: function () {
  2479. var self=this;
  2480. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_("grul/st",_st(self["@grulPackage"])._commitPathSt());
  2481. return self}, function($ctx1) {$ctx1.fill(self,"testGrulCommitPathStShouldBeGrulSt",{}, smalltalk.PackageTest)});}
  2482. }),
  2483. smalltalk.PackageTest);
  2484. smalltalk.addMethod(
  2485. "_testZorkCommitPathJsShouldBeJs",
  2486. smalltalk.method({
  2487. selector: "testZorkCommitPathJsShouldBeJs",
  2488. fn: function () {
  2489. var self=this;
  2490. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_("js",_st(self["@zorkPackage"])._commitPathJs());
  2491. return self}, function($ctx1) {$ctx1.fill(self,"testZorkCommitPathJsShouldBeJs",{}, smalltalk.PackageTest)});}
  2492. }),
  2493. smalltalk.PackageTest);
  2494. smalltalk.addMethod(
  2495. "_testZorkCommitPathStShouldBeSt",
  2496. smalltalk.method({
  2497. selector: "testZorkCommitPathStShouldBeSt",
  2498. fn: function () {
  2499. var self=this;
  2500. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_("st",_st(self["@zorkPackage"])._commitPathSt());
  2501. return self}, function($ctx1) {$ctx1.fill(self,"testZorkCommitPathStShouldBeSt",{}, smalltalk.PackageTest)});}
  2502. }),
  2503. smalltalk.PackageTest);
  2504. smalltalk.addClass('PackageWithDefaultCommitPathChangedTest', smalltalk.PackageTest, [], 'Kernel-Tests');
  2505. smalltalk.addMethod(
  2506. "_setUp",
  2507. smalltalk.method({
  2508. selector: "setUp",
  2509. fn: function () {
  2510. var self=this;
  2511. return smalltalk.withContext(function($ctx1) { var $1,$2;
  2512. smalltalk.PackageTest.fn.prototype._setUp.apply(_st(self), []);
  2513. $1=(smalltalk.Package || Package);
  2514. _st($1)._defaultCommitPathJs_("javascripts/");
  2515. $2=_st($1)._defaultCommitPathSt_("smalltalk/");
  2516. return self}, function($ctx1) {$ctx1.fill(self,"setUp",{}, smalltalk.PackageWithDefaultCommitPathChangedTest)});}
  2517. }),
  2518. smalltalk.PackageWithDefaultCommitPathChangedTest);
  2519. smalltalk.addMethod(
  2520. "_testGrulCommitPathJsShouldBeServerGrulJs",
  2521. smalltalk.method({
  2522. selector: "testGrulCommitPathJsShouldBeServerGrulJs",
  2523. fn: function () {
  2524. var self=this;
  2525. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_("server/grul/js",_st(self["@grulPackage"])._commitPathJs());
  2526. return self}, function($ctx1) {$ctx1.fill(self,"testGrulCommitPathJsShouldBeServerGrulJs",{}, smalltalk.PackageWithDefaultCommitPathChangedTest)});}
  2527. }),
  2528. smalltalk.PackageWithDefaultCommitPathChangedTest);
  2529. smalltalk.addMethod(
  2530. "_testGrulCommitPathStShouldBeGrulSt",
  2531. smalltalk.method({
  2532. selector: "testGrulCommitPathStShouldBeGrulSt",
  2533. fn: function () {
  2534. var self=this;
  2535. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_("grul/st",_st(self["@grulPackage"])._commitPathSt());
  2536. return self}, function($ctx1) {$ctx1.fill(self,"testGrulCommitPathStShouldBeGrulSt",{}, smalltalk.PackageWithDefaultCommitPathChangedTest)});}
  2537. }),
  2538. smalltalk.PackageWithDefaultCommitPathChangedTest);
  2539. smalltalk.addMethod(
  2540. "_testZorkCommitPathJsShouldBeJavascript",
  2541. smalltalk.method({
  2542. selector: "testZorkCommitPathJsShouldBeJavascript",
  2543. fn: function () {
  2544. var self=this;
  2545. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_("javascripts/",_st(self["@zorkPackage"])._commitPathJs());
  2546. return self}, function($ctx1) {$ctx1.fill(self,"testZorkCommitPathJsShouldBeJavascript",{}, smalltalk.PackageWithDefaultCommitPathChangedTest)});}
  2547. }),
  2548. smalltalk.PackageWithDefaultCommitPathChangedTest);
  2549. smalltalk.addMethod(
  2550. "_testZorkCommitPathStShouldBeSmalltalk",
  2551. smalltalk.method({
  2552. selector: "testZorkCommitPathStShouldBeSmalltalk",
  2553. fn: function () {
  2554. var self=this;
  2555. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_("smalltalk/",_st(self["@zorkPackage"])._commitPathSt());
  2556. return self}, function($ctx1) {$ctx1.fill(self,"testZorkCommitPathStShouldBeSmalltalk",{}, smalltalk.PackageWithDefaultCommitPathChangedTest)});}
  2557. }),
  2558. smalltalk.PackageWithDefaultCommitPathChangedTest);
  2559. smalltalk.addMethod(
  2560. "_shouldInheritSelectors",
  2561. smalltalk.method({
  2562. selector: "shouldInheritSelectors",
  2563. fn: function () {
  2564. var self=this;
  2565. return smalltalk.withContext(function($ctx1) { return false;
  2566. }, function($ctx1) {$ctx1.fill(self,"shouldInheritSelectors",{}, smalltalk.PackageWithDefaultCommitPathChangedTest.klass)});}
  2567. }),
  2568. smalltalk.PackageWithDefaultCommitPathChangedTest.klass);
  2569. smalltalk.addClass('PointTest', smalltalk.TestCase, [], 'Kernel-Tests');
  2570. smalltalk.addMethod(
  2571. "_testAccessing",
  2572. smalltalk.method({
  2573. selector: "testAccessing",
  2574. fn: function () {
  2575. var self=this;
  2576. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(_st((smalltalk.Point || Point))._x_y_((3),(4)))._x(),(3));
  2577. _st(self)._assert_equals_(_st(_st((smalltalk.Point || Point))._x_y_((3),(4)))._y(),(4));
  2578. _st(self)._assert_equals_(_st(_st(_st((smalltalk.Point || Point))._new())._x_((3)))._x(),(3));
  2579. _st(self)._assert_equals_(_st(_st(_st((smalltalk.Point || Point))._new())._y_((4)))._y(),(4));
  2580. return self}, function($ctx1) {$ctx1.fill(self,"testAccessing",{}, smalltalk.PointTest)});}
  2581. }),
  2582. smalltalk.PointTest);
  2583. smalltalk.addMethod(
  2584. "_testArithmetic",
  2585. smalltalk.method({
  2586. selector: "testArithmetic",
  2587. fn: function () {
  2588. var self=this;
  2589. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(_st((3)).__at((4))).__star(_st((3)).__at((4))),_st((smalltalk.Point || Point))._x_y_((9),(16)));
  2590. _st(self)._assert_equals_(_st(_st((3)).__at((4))).__plus(_st((3)).__at((4))),_st((smalltalk.Point || Point))._x_y_((6),(8)));
  2591. _st(self)._assert_equals_(_st(_st((3)).__at((4))).__minus(_st((3)).__at((4))),_st((smalltalk.Point || Point))._x_y_((0),(0)));
  2592. _st(self)._assert_equals_(_st(_st((6)).__at((8))).__slash(_st((3)).__at((4))),_st((smalltalk.Point || Point))._x_y_((2),(2)));
  2593. return self}, function($ctx1) {$ctx1.fill(self,"testArithmetic",{}, smalltalk.PointTest)});}
  2594. }),
  2595. smalltalk.PointTest);
  2596. smalltalk.addMethod(
  2597. "_testAt",
  2598. smalltalk.method({
  2599. selector: "testAt",
  2600. fn: function () {
  2601. var self=this;
  2602. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st((3)).__at((4)),_st((smalltalk.Point || Point))._x_y_((3),(4)));
  2603. return self}, function($ctx1) {$ctx1.fill(self,"testAt",{}, smalltalk.PointTest)});}
  2604. }),
  2605. smalltalk.PointTest);
  2606. smalltalk.addMethod(
  2607. "_testEgality",
  2608. smalltalk.method({
  2609. selector: "testEgality",
  2610. fn: function () {
  2611. var self=this;
  2612. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(_st((3)).__at((4))).__eq(_st((3)).__at((4))));
  2613. _st(self)._deny_(_st(_st((3)).__at((5))).__eq(_st((3)).__at((6))));
  2614. return self}, function($ctx1) {$ctx1.fill(self,"testEgality",{}, smalltalk.PointTest)});}
  2615. }),
  2616. smalltalk.PointTest);
  2617. smalltalk.addMethod(
  2618. "_testTranslateBy",
  2619. smalltalk.method({
  2620. selector: "testTranslateBy",
  2621. fn: function () {
  2622. var self=this;
  2623. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st((3)).__at((4)),_st(_st((3)).__at((3)))._translateBy_(_st((0)).__at((1))));
  2624. _st(self)._assert_equals_(_st((3)).__at((2)),_st(_st((3)).__at((3)))._translateBy_(_st((0)).__at(_st((1))._negated())));
  2625. _st(self)._assert_equals_(_st((5)).__at((6)),_st(_st((3)).__at((3)))._translateBy_(_st((2)).__at((3))));
  2626. _st(self)._assert_equals_(_st((0)).__at((3)),_st(_st((3)).__at((3)))._translateBy_(_st(_st((3))._negated()).__at((0))));
  2627. return self}, function($ctx1) {$ctx1.fill(self,"testTranslateBy",{}, smalltalk.PointTest)});}
  2628. }),
  2629. smalltalk.PointTest);
  2630. smalltalk.addClass('RandomTest', smalltalk.TestCase, [], 'Kernel-Tests');
  2631. smalltalk.addMethod(
  2632. "_textNext",
  2633. smalltalk.method({
  2634. selector: "textNext",
  2635. fn: function () {
  2636. var self=this;
  2637. return smalltalk.withContext(function($ctx1) { _st((10000))._timesRepeat_((function(){
  2638. var current,next;
  2639. return smalltalk.withContext(function($ctx2) { next=_st(_st((smalltalk.Random || Random))._new())._next();
  2640. next;
  2641. _st(self)._assert_(_st(next).__gt_eq((0)));
  2642. _st(self)._assert_(_st(next).__lt((1)));
  2643. _st(self)._deny_(_st(current).__eq(next));
  2644. return _st(next).__eq(current);
  2645. }, function($ctx2) {$ctx2.fillBlock({current:current,next:next},$ctx1)})}));
  2646. return self}, function($ctx1) {$ctx1.fill(self,"textNext",{}, smalltalk.RandomTest)});}
  2647. }),
  2648. smalltalk.RandomTest);
  2649. smalltalk.addClass('SetTest', smalltalk.TestCase, [], 'Kernel-Tests');
  2650. smalltalk.addMethod(
  2651. "_testAddRemove",
  2652. smalltalk.method({
  2653. selector: "testAddRemove",
  2654. fn: function () {
  2655. var self=this;
  2656. var set;
  2657. return smalltalk.withContext(function($ctx1) { set=_st((smalltalk.Set || Set))._new();
  2658. _st(self)._assert_(_st(set)._isEmpty());
  2659. _st(set)._add_((3));
  2660. _st(self)._assert_(_st(set)._includes_((3)));
  2661. _st(set)._add_((5));
  2662. _st(self)._assert_(_st(set)._includes_((5)));
  2663. _st(set)._remove_((3));
  2664. _st(self)._deny_(_st(set)._includes_((3)));
  2665. return self}, function($ctx1) {$ctx1.fill(self,"testAddRemove",{set:set}, smalltalk.SetTest)});}
  2666. }),
  2667. smalltalk.SetTest);
  2668. smalltalk.addMethod(
  2669. "_testAt",
  2670. smalltalk.method({
  2671. selector: "testAt",
  2672. fn: function () {
  2673. var self=this;
  2674. return smalltalk.withContext(function($ctx1) { _st(self)._should_raise_((function(){
  2675. return smalltalk.withContext(function($ctx2) { return _st(_st((smalltalk.Set || Set))._new())._at_put_((1),(2));
  2676. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
  2677. return self}, function($ctx1) {$ctx1.fill(self,"testAt",{}, smalltalk.SetTest)});}
  2678. }),
  2679. smalltalk.SetTest);
  2680. smalltalk.addMethod(
  2681. "_testCollect",
  2682. smalltalk.method({
  2683. selector: "testCollect",
  2684. fn: function (){
  2685. var self=this;
  2686. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st([(0), (2)])._asSet(),_st(_st([(5), (6), (8)])._asSet())._collect_((function(x){
  2687. return smalltalk.withContext(function($ctx2) { return _st(x).__backslash_backslash((3));
  2688. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})})));
  2689. return self}, function($ctx1) {$ctx1.fill(self,"testCollect",{}, smalltalk.SetTest)})}
  2690. }),
  2691. smalltalk.SetTest);
  2692. smalltalk.addMethod(
  2693. "_testComparing",
  2694. smalltalk.method({
  2695. selector: "testComparing",
  2696. fn: function () {
  2697. var self=this;
  2698. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st([(0), (2)])._asSet(),_st([(0), (2)])._asSet());
  2699. _st(self)._assert_equals_(_st([(2), (0)])._asSet(),_st([(0), (2)])._asSet());
  2700. _st(self)._deny_(_st(_st([(0), (2), (3)])._asSet()).__eq(_st([(0), (2)])._asSet()));
  2701. _st(self)._deny_(_st(_st([(1), (2)])._asSet()).__eq(_st([(0), (2)])._asSet()));
  2702. return self}, function($ctx1) {$ctx1.fill(self,"testComparing",{}, smalltalk.SetTest)});}
  2703. }),
  2704. smalltalk.SetTest);
  2705. smalltalk.addMethod(
  2706. "_testPrintString",
  2707. smalltalk.method({
  2708. selector: "testPrintString",
  2709. fn: function () {
  2710. var self=this;
  2711. var set;
  2712. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  2713. set=_st((smalltalk.Set || Set))._new();
  2714. _st(self)._assert_equals_("a Set ()",_st(set)._printString());
  2715. $1=set;
  2716. _st($1)._add_((1));
  2717. $2=_st($1)._add_((3));
  2718. _st(self)._assert_equals_("a Set (1 3)",_st(set)._printString());
  2719. _st(set)._add_("foo");
  2720. _st(self)._assert_equals_("a Set (1 3 'foo')",_st(set)._printString());
  2721. $3=set;
  2722. _st($3)._remove_((1));
  2723. $4=_st($3)._remove_((3));
  2724. _st(self)._assert_equals_("a Set ('foo')",_st(set)._printString());
  2725. _st(set)._add_((3));
  2726. _st(self)._assert_equals_("a Set ('foo' 3)",_st(set)._printString());
  2727. _st(set)._add_((3));
  2728. _st(self)._assert_equals_("a Set ('foo' 3)",_st(set)._printString());
  2729. return self}, function($ctx1) {$ctx1.fill(self,"testPrintString",{set:set}, smalltalk.SetTest)});}
  2730. }),
  2731. smalltalk.SetTest);
  2732. smalltalk.addMethod(
  2733. "_testSize",
  2734. smalltalk.method({
  2735. selector: "testSize",
  2736. fn: function () {
  2737. var self=this;
  2738. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(_st((smalltalk.Set || Set))._new())._size(),(0));
  2739. _st(self)._assert_equals_(_st(_st((smalltalk.Set || Set))._withAll_([(1), (2), (3), (4)]))._size(),(4));
  2740. _st(self)._assert_equals_(_st(_st((smalltalk.Set || Set))._withAll_([(1), (1), (1), (1)]))._size(),(1));
  2741. return self}, function($ctx1) {$ctx1.fill(self,"testSize",{}, smalltalk.SetTest)});}
  2742. }),
  2743. smalltalk.SetTest);
  2744. smalltalk.addMethod(
  2745. "_testUnicity",
  2746. smalltalk.method({
  2747. selector: "testUnicity",
  2748. fn: function () {
  2749. var self=this;
  2750. var set;
  2751. return smalltalk.withContext(function($ctx1) { set=_st((smalltalk.Set || Set))._new();
  2752. _st(set)._add_((21));
  2753. _st(set)._add_("hello");
  2754. _st(set)._add_((21));
  2755. _st(self)._assert_(_st(_st(set)._size()).__eq((2)));
  2756. _st(set)._add_("hello");
  2757. _st(self)._assert_(_st(_st(set)._size()).__eq((2)));
  2758. _st(self)._assert_equals_(_st(set)._asArray(),[(21), "hello"]);
  2759. return self}, function($ctx1) {$ctx1.fill(self,"testUnicity",{set:set}, smalltalk.SetTest)});}
  2760. }),
  2761. smalltalk.SetTest);
  2762. smalltalk.addClass('UndefinedTest', smalltalk.TestCase, [], 'Kernel-Tests');
  2763. smalltalk.addMethod(
  2764. "_testCopying",
  2765. smalltalk.method({
  2766. selector: "testCopying",
  2767. fn: function () {
  2768. var self=this;
  2769. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(nil)._copy(),nil);
  2770. return self}, function($ctx1) {$ctx1.fill(self,"testCopying",{}, smalltalk.UndefinedTest)});}
  2771. }),
  2772. smalltalk.UndefinedTest);
  2773. smalltalk.addMethod(
  2774. "_testDeepCopy",
  2775. smalltalk.method({
  2776. selector: "testDeepCopy",
  2777. fn: function () {
  2778. var self=this;
  2779. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(_st(nil)._deepCopy()).__eq(nil));
  2780. return self}, function($ctx1) {$ctx1.fill(self,"testDeepCopy",{}, smalltalk.UndefinedTest)});}
  2781. }),
  2782. smalltalk.UndefinedTest);
  2783. smalltalk.addMethod(
  2784. "_testIfNil",
  2785. smalltalk.method({
  2786. selector: "testIfNil",
  2787. fn: function () {
  2788. var self=this;
  2789. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$5,$4,$6,$7;
  2790. $1=self;
  2791. if(($receiver = nil) == nil || $receiver == undefined){
  2792. $2=true;
  2793. } else {
  2794. $2=nil;
  2795. };
  2796. _st($1)._assert_equals_($2,true);
  2797. $3=self;
  2798. if(($receiver = nil) == nil || $receiver == undefined){
  2799. $5=nil;
  2800. } else {
  2801. $5=true;
  2802. };
  2803. $4=_st($5).__eq(true);
  2804. _st($3)._deny_($4);
  2805. $6=self;
  2806. if(($receiver = nil) == nil || $receiver == undefined){
  2807. $7=true;
  2808. } else {
  2809. $7=false;
  2810. };
  2811. _st($6)._assert_equals_($7,true);
  2812. _st(self)._deny_(_st(_st(nil)._ifNotNil_ifNil_((function(){
  2813. return smalltalk.withContext(function($ctx2) { return true;
  2814. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(function(){
  2815. return smalltalk.withContext(function($ctx2) { return false;
  2816. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))).__eq(true));
  2817. return self}, function($ctx1) {$ctx1.fill(self,"testIfNil",{}, smalltalk.UndefinedTest)});}
  2818. }),
  2819. smalltalk.UndefinedTest);
  2820. smalltalk.addMethod(
  2821. "_testIsNil",
  2822. smalltalk.method({
  2823. selector: "testIsNil",
  2824. fn: function () {
  2825. var self=this;
  2826. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(nil)._isNil());
  2827. _st(self)._deny_(_st(nil)._notNil());
  2828. return self}, function($ctx1) {$ctx1.fill(self,"testIsNil",{}, smalltalk.UndefinedTest)});}
  2829. }),
  2830. smalltalk.UndefinedTest);