1
0

Kernel-Tests.deploy.js 142 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413
  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. messageSends: ["shouldnt:raise:", "clearInterval", "valueWithInterval:", "signal", "new"]}),
  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. messageSends: ["shouldnt:raise:", "clearTimeout", "valueWithTimeout:", "signal", "new"]}),
  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. messageSends: ["assert:", "includesSubString:", "compiledSource", "+"]}),
  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_(_st(array)._foo_((2)),(1));
  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. messageSends: ["asCompiledMethod:", "currySelf", "at:", "installMethod:forClass:category:", "new", "ensure:", "removeCompiledMethod:", "assert:equals:", "foo:"]}),
  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_(_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)})})),(3));
  74. return self}, function($ctx1) {$ctx1.fill(self,"testEnsure",{},smalltalk.BlockClosureTest)})},
  75. messageSends: ["assert:equals:", "ensure:"]}),
  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. messageSends: ["should:raise:", "ensure:", "signal", "new"]}),
  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. messageSends: ["timeout:", "valueWithTimeout:", "async:", "on:do:", "finished", "assert:", "signal", "deny:"]}),
  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. messageSends: ["assert:equals:", "numArgs"]}),
  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. messageSends: ["assert:", "on:do:", "signal", "new"]}),
  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. messageSends: ["assert:equals:", "value", "+", "value:", "value:value:", "*"]}),
  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. messageSends: ["assert:equals:", "valueWithPossibleArguments:", "+"]}),
  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. messageSends: ["whileFalse:", "+", ">", "assert:equals:", "whileFalse"]}),
  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. messageSends: ["whileTrue:", "+", "<", "assert:equals:", "whileTrue"]}),
  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. messageSends: ["deny:", "=", "assert:", "yourself"]}),
  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. messageSends: ["deny:", "==", "assert:", "yourself"]}),
  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,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16;
  275. $1=self;
  276. if(smalltalk.assert(true)){
  277. $2="alternative block";
  278. };
  279. _st($1)._assert_equals_($2,"alternative block");
  280. $3=self;
  281. if(! smalltalk.assert(true)){
  282. $4="alternative block";
  283. };
  284. _st($3)._assert_equals_($4,nil);
  285. $5=self;
  286. if(smalltalk.assert(false)){
  287. $6="alternative block";
  288. };
  289. _st($5)._assert_equals_($6,nil);
  290. $7=self;
  291. if(! smalltalk.assert(false)){
  292. $8="alternative block";
  293. };
  294. _st($7)._assert_equals_($8,"alternative block");
  295. $9=self;
  296. if(smalltalk.assert(false)){
  297. $10="alternative block";
  298. } else {
  299. $10="alternative block2";
  300. };
  301. _st($9)._assert_equals_($10,"alternative block2");
  302. $11=self;
  303. if(smalltalk.assert(false)){
  304. $12="alternative block2";
  305. } else {
  306. $12="alternative block";
  307. };
  308. _st($11)._assert_equals_($12,"alternative block");
  309. $13=self;
  310. if(smalltalk.assert(true)){
  311. $14="alternative block";
  312. } else {
  313. $14="alternative block2";
  314. };
  315. _st($13)._assert_equals_($14,"alternative block");
  316. $15=self;
  317. if(smalltalk.assert(true)){
  318. $16="alternative block2";
  319. } else {
  320. $16="alternative block";
  321. };
  322. _st($15)._assert_equals_($16,"alternative block2");
  323. return self}, function($ctx1) {$ctx1.fill(self,"testIfTrueIfFalse",{},smalltalk.BooleanTest)})},
  324. messageSends: ["assert:equals:", "ifTrue:", "ifFalse:", "ifTrue:ifFalse:", "ifFalse:ifTrue:"]}),
  325. smalltalk.BooleanTest);
  326. smalltalk.addMethod(
  327. "_testIfTrueIfFalseWithBoxing",
  328. smalltalk.method({
  329. selector: "testIfTrueIfFalseWithBoxing",
  330. fn: function (){
  331. var self=this;
  332. 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;
  333. $1=self;
  334. $3=_st(true)._yourself();
  335. if(smalltalk.assert($3)){
  336. $2="alternative block";
  337. };
  338. _st($1)._assert_equals_($2,"alternative block");
  339. $4=self;
  340. $6=_st(true)._yourself();
  341. if(! smalltalk.assert($6)){
  342. $5="alternative block";
  343. };
  344. _st($4)._assert_equals_($5,nil);
  345. $7=self;
  346. $9=_st(false)._yourself();
  347. if(smalltalk.assert($9)){
  348. $8="alternative block";
  349. };
  350. _st($7)._assert_equals_($8,nil);
  351. $10=self;
  352. $12=_st(false)._yourself();
  353. if(! smalltalk.assert($12)){
  354. $11="alternative block";
  355. };
  356. _st($10)._assert_equals_($11,"alternative block");
  357. $13=self;
  358. $15=_st(false)._yourself();
  359. if(smalltalk.assert($15)){
  360. $14="alternative block";
  361. } else {
  362. $14="alternative block2";
  363. };
  364. _st($13)._assert_equals_($14,"alternative block2");
  365. $16=self;
  366. $18=_st(false)._yourself();
  367. if(smalltalk.assert($18)){
  368. $17="alternative block2";
  369. } else {
  370. $17="alternative block";
  371. };
  372. _st($16)._assert_equals_($17,"alternative block");
  373. $19=self;
  374. $21=_st(true)._yourself();
  375. if(smalltalk.assert($21)){
  376. $20="alternative block";
  377. } else {
  378. $20="alternative block2";
  379. };
  380. _st($19)._assert_equals_($20,"alternative block");
  381. $22=self;
  382. $24=_st(true)._yourself();
  383. if(smalltalk.assert($24)){
  384. $23="alternative block2";
  385. } else {
  386. $23="alternative block";
  387. };
  388. _st($22)._assert_equals_($23,"alternative block2");
  389. return self}, function($ctx1) {$ctx1.fill(self,"testIfTrueIfFalseWithBoxing",{},smalltalk.BooleanTest)})},
  390. messageSends: ["assert:equals:", "ifTrue:", "yourself", "ifFalse:", "ifTrue:ifFalse:", "ifFalse:ifTrue:"]}),
  391. smalltalk.BooleanTest);
  392. smalltalk.addMethod(
  393. "_testLogic",
  394. smalltalk.method({
  395. selector: "testLogic",
  396. fn: function (){
  397. var self=this;
  398. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5,$6,$7,$8;
  399. $1=self;
  400. _st($1)._assert_(_st(true).__and(true));
  401. _st($1)._deny_(_st(true).__and(false));
  402. _st($1)._deny_(_st(false).__and(true));
  403. $2=_st($1)._deny_(_st(false).__and(false));
  404. $3=self;
  405. _st($3)._assert_(_st(true).__or(true));
  406. _st($3)._assert_(_st(true).__or(false));
  407. _st($3)._assert_(_st(false).__or(true));
  408. $4=_st($3)._deny_(_st(false).__or(false));
  409. $5=self;
  410. _st($5)._assert_(_st(true).__and(_st((1)).__gt((0))));
  411. _st($5)._deny_(_st(_st((1)).__gt((0))).__and(false));
  412. $6=_st($5)._deny_(_st(_st((1)).__gt((0))).__and(_st((1)).__gt((2))));
  413. $7=self;
  414. _st($7)._assert_(_st(false).__or(_st((1)).__gt((0))));
  415. _st($7)._assert_(_st(_st((1)).__gt((0))).__or(false));
  416. $8=_st($7)._assert_(_st(_st((1)).__gt((0))).__or(_st((1)).__gt((2))));
  417. return self}, function($ctx1) {$ctx1.fill(self,"testLogic",{},smalltalk.BooleanTest)})},
  418. messageSends: ["assert:", "&", "deny:", "|", ">"]}),
  419. smalltalk.BooleanTest);
  420. smalltalk.addMethod(
  421. "_testLogicKeywords",
  422. smalltalk.method({
  423. selector: "testLogicKeywords",
  424. fn: function (){
  425. var self=this;
  426. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5,$6,$7,$8;
  427. $1=self;
  428. _st($1)._assert_(_st(true)._and_((function(){
  429. return smalltalk.withContext(function($ctx2) { return true;
  430. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
  431. _st($1)._deny_(_st(true)._and_((function(){
  432. return smalltalk.withContext(function($ctx2) { return false;
  433. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
  434. _st($1)._deny_(_st(false)._and_((function(){
  435. return smalltalk.withContext(function($ctx2) { return true;
  436. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
  437. $2=_st($1)._deny_(_st(false)._and_((function(){
  438. return smalltalk.withContext(function($ctx2) { return false;
  439. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
  440. $3=self;
  441. _st($3)._assert_(_st(true)._or_((function(){
  442. return smalltalk.withContext(function($ctx2) { return true;
  443. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
  444. _st($3)._assert_(_st(true)._or_((function(){
  445. return smalltalk.withContext(function($ctx2) { return false;
  446. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
  447. _st($3)._assert_(_st(false)._or_((function(){
  448. return smalltalk.withContext(function($ctx2) { return true;
  449. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
  450. $4=_st($3)._deny_(_st(false)._or_((function(){
  451. return smalltalk.withContext(function($ctx2) { return false;
  452. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
  453. $5=self;
  454. _st($5)._assert_(_st(true)._and_((function(){
  455. return smalltalk.withContext(function($ctx2) { return _st((1)).__gt((0));
  456. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
  457. _st($5)._deny_(_st(_st((1)).__gt((0)))._and_((function(){
  458. return smalltalk.withContext(function($ctx2) { return false;
  459. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
  460. $6=_st($5)._deny_(_st(_st((1)).__gt((0)))._and_((function(){
  461. return smalltalk.withContext(function($ctx2) { return _st((1)).__gt((2));
  462. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
  463. $7=self;
  464. _st($7)._assert_(_st(false)._or_((function(){
  465. return smalltalk.withContext(function($ctx2) { return _st((1)).__gt((0));
  466. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
  467. _st($7)._assert_(_st(_st((1)).__gt((0)))._or_((function(){
  468. return smalltalk.withContext(function($ctx2) { return false;
  469. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
  470. $8=_st($7)._assert_(_st(_st((1)).__gt((0)))._or_((function(){
  471. return smalltalk.withContext(function($ctx2) { return _st((1)).__gt((2));
  472. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
  473. return self}, function($ctx1) {$ctx1.fill(self,"testLogicKeywords",{},smalltalk.BooleanTest)})},
  474. messageSends: ["assert:", "and:", "deny:", "or:", ">"]}),
  475. smalltalk.BooleanTest);
  476. smalltalk.addMethod(
  477. "_testNonBooleanError",
  478. smalltalk.method({
  479. selector: "testNonBooleanError",
  480. fn: function (){
  481. var self=this;
  482. return smalltalk.withContext(function($ctx1) { _st(self)._should_raise_((function(){
  483. return smalltalk.withContext(function($ctx2) { if(smalltalk.assert("")){
  484. } else {
  485. };
  486. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.NonBooleanReceiver || NonBooleanReceiver));
  487. return self}, function($ctx1) {$ctx1.fill(self,"testNonBooleanError",{},smalltalk.BooleanTest)})},
  488. messageSends: ["should:raise:", "ifTrue:ifFalse:"]}),
  489. smalltalk.BooleanTest);
  490. smalltalk.addClass('ClassBuilderTest', smalltalk.TestCase, ['builder', 'theClass'], 'Kernel-Tests');
  491. smalltalk.addMethod(
  492. "_setUp",
  493. smalltalk.method({
  494. selector: "setUp",
  495. fn: function (){
  496. var self=this;
  497. return smalltalk.withContext(function($ctx1) { self["@builder"]=_st((smalltalk.ClassBuilder || ClassBuilder))._new();
  498. return self}, function($ctx1) {$ctx1.fill(self,"setUp",{},smalltalk.ClassBuilderTest)})},
  499. messageSends: ["new"]}),
  500. smalltalk.ClassBuilderTest);
  501. smalltalk.addMethod(
  502. "_tearDown",
  503. smalltalk.method({
  504. selector: "tearDown",
  505. fn: function (){
  506. var self=this;
  507. return smalltalk.withContext(function($ctx1) { var $1;
  508. $1=self["@theClass"];
  509. if(($receiver = $1) == nil || $receiver == undefined){
  510. $1;
  511. } else {
  512. _st(_st((smalltalk.Smalltalk || Smalltalk))._current())._removeClass_(self["@theClass"]);
  513. self["@theClass"]=nil;
  514. self["@theClass"];
  515. };
  516. return self}, function($ctx1) {$ctx1.fill(self,"tearDown",{},smalltalk.ClassBuilderTest)})},
  517. messageSends: ["ifNotNil:", "removeClass:", "current"]}),
  518. smalltalk.ClassBuilderTest);
  519. smalltalk.addMethod(
  520. "_testClassCopy",
  521. smalltalk.method({
  522. selector: "testClassCopy",
  523. fn: function (){
  524. var self=this;
  525. return smalltalk.withContext(function($ctx1) { self["@theClass"]=_st(self["@builder"])._copyClass_named_((smalltalk.ObjectMock || ObjectMock),"ObjectMock2");
  526. _st(self)._assert_(_st(_st(self["@theClass"])._superclass()).__eq_eq(_st((smalltalk.ObjectMock || ObjectMock))._superclass()));
  527. _st(self)._assert_(_st(_st(self["@theClass"])._instanceVariableNames()).__eq_eq(_st((smalltalk.ObjectMock || ObjectMock))._instanceVariableNames()));
  528. _st(self)._assert_equals_(_st(self["@theClass"])._name(),"ObjectMock2");
  529. _st(self)._assert_(_st(_st(self["@theClass"])._package()).__eq_eq(_st((smalltalk.ObjectMock || ObjectMock))._package()));
  530. _st(self)._assert_equals_(_st(_st(self["@theClass"])._methodDictionary())._keys(),_st(_st((smalltalk.ObjectMock || ObjectMock))._methodDictionary())._keys());
  531. return self}, function($ctx1) {$ctx1.fill(self,"testClassCopy",{},smalltalk.ClassBuilderTest)})},
  532. messageSends: ["copyClass:named:", "assert:", "==", "superclass", "instanceVariableNames", "assert:equals:", "name", "package", "keys", "methodDictionary"]}),
  533. smalltalk.ClassBuilderTest);
  534. smalltalk.addMethod(
  535. "_testClassMigration",
  536. smalltalk.method({
  537. selector: "testClassMigration",
  538. fn: function (){
  539. var self=this;
  540. var instance,oldClass;
  541. return smalltalk.withContext(function($ctx1) { oldClass=_st(self["@builder"])._copyClass_named_((smalltalk.ObjectMock || ObjectMock),"ObjectMock2");
  542. instance=_st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._at_("ObjectMock2"))._new();
  543. _st((smalltalk.ObjectMock || ObjectMock))._subclass_instanceVariableNames_package_(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._at_("ObjectMock2"),"","Kernel-Tests");
  544. _st(self)._deny_(_st(oldClass).__eq_eq((smalltalk.ObjectMock2 || ObjectMock2)));
  545. _st(self)._assert_(_st(_st((smalltalk.ObjectMock2 || ObjectMock2))._superclass()).__eq_eq((smalltalk.ObjectMock || ObjectMock)));
  546. _st(self)._assert_(_st(_st((smalltalk.ObjectMock2 || ObjectMock2))._instanceVariableNames())._isEmpty());
  547. _st(self)._assert_equals_(_st((smalltalk.ObjectMock2 || ObjectMock2))._selectors(),_st(oldClass)._selectors());
  548. _st(self)._assert_equals_(_st((smalltalk.ObjectMock2 || ObjectMock2))._comment(),_st(oldClass)._comment());
  549. _st(self)._assert_equals_(_st(_st((smalltalk.ObjectMock2 || ObjectMock2))._package())._name(),"Kernel-Tests");
  550. _st(self)._deny_(_st(_st(instance)._class()).__eq_eq((smalltalk.ObjectMock2 || ObjectMock2)));
  551. _st(self)._assert_(_st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._at_(_st(_st(instance)._class())._name()))._isNil());
  552. _st(_st((smalltalk.Smalltalk || Smalltalk))._current())._removeClass_((smalltalk.ObjectMock2 || ObjectMock2));
  553. return self}, function($ctx1) {$ctx1.fill(self,"testClassMigration",{instance:instance,oldClass:oldClass},smalltalk.ClassBuilderTest)})},
  554. messageSends: ["copyClass:named:", "new", "at:", "current", "subclass:instanceVariableNames:package:", "deny:", "==", "assert:", "superclass", "isEmpty", "instanceVariableNames", "assert:equals:", "selectors", "comment", "name", "package", "class", "isNil", "removeClass:"]}),
  555. smalltalk.ClassBuilderTest);
  556. smalltalk.addMethod(
  557. "_testClassMigrationWithClassInstanceVariables",
  558. smalltalk.method({
  559. selector: "testClassMigrationWithClassInstanceVariables",
  560. fn: function (){
  561. var self=this;
  562. return smalltalk.withContext(function($ctx1) { _st(self["@builder"])._copyClass_named_((smalltalk.ObjectMock || ObjectMock),"ObjectMock2");
  563. _st(_st((smalltalk.ObjectMock2 || ObjectMock2))._class())._instanceVariableNames_("foo bar");
  564. _st((smalltalk.ObjectMock || ObjectMock))._subclass_instanceVariableNames_package_(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._at_("ObjectMock2"),"","Kernel-Tests");
  565. _st(self)._assert_equals_(_st(_st((smalltalk.ObjectMock2 || ObjectMock2))._class())._instanceVariableNames(),["foo", "bar"]);
  566. _st(_st((smalltalk.Smalltalk || Smalltalk))._current())._removeClass_((smalltalk.ObjectMock2 || ObjectMock2));
  567. return self}, function($ctx1) {$ctx1.fill(self,"testClassMigrationWithClassInstanceVariables",{},smalltalk.ClassBuilderTest)})},
  568. messageSends: ["copyClass:named:", "instanceVariableNames:", "class", "subclass:instanceVariableNames:package:", "at:", "current", "assert:equals:", "instanceVariableNames", "removeClass:"]}),
  569. smalltalk.ClassBuilderTest);
  570. smalltalk.addMethod(
  571. "_testClassMigrationWithSubclasses",
  572. smalltalk.method({
  573. selector: "testClassMigrationWithSubclasses",
  574. fn: function (){
  575. var self=this;
  576. return smalltalk.withContext(function($ctx1) { _st(self["@builder"])._copyClass_named_((smalltalk.ObjectMock || ObjectMock),"ObjectMock2");
  577. _st((smalltalk.ObjectMock2 || ObjectMock2))._subclass_instanceVariableNames_package_("ObjectMock3","","Kernel-Tests");
  578. _st((smalltalk.ObjectMock3 || ObjectMock3))._subclass_instanceVariableNames_package_("ObjectMock4","","Kernel-Tests");
  579. _st((smalltalk.ObjectMock || ObjectMock))._subclass_instanceVariableNames_package_(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._at_("ObjectMock2"),"","Kernel-Tests");
  580. _st(self)._assert_(_st(_st((smalltalk.ObjectMock || ObjectMock))._subclasses())._includes_((smalltalk.ObjectMock2 || ObjectMock2)));
  581. _st(self)._assert_(_st(_st((smalltalk.ObjectMock2 || ObjectMock2))._subclasses())._includes_((smalltalk.ObjectMock3 || ObjectMock3)));
  582. _st(self)._assert_(_st(_st((smalltalk.ObjectMock3 || ObjectMock3))._subclasses())._includes_((smalltalk.ObjectMock4 || ObjectMock4)));
  583. _st(_st((smalltalk.ObjectMock || ObjectMock))._allSubclasses())._do_((function(each){
  584. return smalltalk.withContext(function($ctx2) { return _st(_st((smalltalk.Smalltalk || Smalltalk))._current())._removeClass_(each);
  585. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  586. return self}, function($ctx1) {$ctx1.fill(self,"testClassMigrationWithSubclasses",{},smalltalk.ClassBuilderTest)})},
  587. messageSends: ["copyClass:named:", "subclass:instanceVariableNames:package:", "at:", "current", "assert:", "includes:", "subclasses", "do:", "removeClass:", "allSubclasses"]}),
  588. smalltalk.ClassBuilderTest);
  589. smalltalk.addMethod(
  590. "_testInstanceVariableNames",
  591. smalltalk.method({
  592. selector: "testInstanceVariableNames",
  593. fn: function (){
  594. var self=this;
  595. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(self["@builder"])._instanceVariableNamesFor_(" hello world "),["hello", "world"]);
  596. return self}, function($ctx1) {$ctx1.fill(self,"testInstanceVariableNames",{},smalltalk.ClassBuilderTest)})},
  597. messageSends: ["assert:equals:", "instanceVariableNamesFor:"]}),
  598. smalltalk.ClassBuilderTest);
  599. smalltalk.addClass('CollectionTest', smalltalk.TestCase, [], 'Kernel-Tests');
  600. smalltalk.addMethod(
  601. "_assertSameContents_as_",
  602. smalltalk.method({
  603. selector: "assertSameContents:as:",
  604. fn: function (aCollection,anotherCollection){
  605. var self=this;
  606. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(_st(aCollection)._size()).__eq(_st(anotherCollection)._size()));
  607. _st(aCollection)._do_((function(each){
  608. return smalltalk.withContext(function($ctx2) { return _st(self)._assert_(_st(_st(aCollection)._occurrencesOf_(each)).__eq(_st(anotherCollection)._occurrencesOf_(each)));
  609. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  610. return self}, function($ctx1) {$ctx1.fill(self,"assertSameContents:as:",{aCollection:aCollection,anotherCollection:anotherCollection},smalltalk.CollectionTest)})},
  611. messageSends: ["assert:", "=", "size", "do:", "occurrencesOf:"]}),
  612. smalltalk.CollectionTest);
  613. smalltalk.addMethod(
  614. "_collection",
  615. smalltalk.method({
  616. selector: "collection",
  617. fn: function (){
  618. var self=this;
  619. return smalltalk.withContext(function($ctx1) { var $1;
  620. $1=_st(_st(self)._collectionClass())._withAll_(_st(self)._defaultValues());
  621. return $1;
  622. }, function($ctx1) {$ctx1.fill(self,"collection",{},smalltalk.CollectionTest)})},
  623. messageSends: ["withAll:", "defaultValues", "collectionClass"]}),
  624. smalltalk.CollectionTest);
  625. smalltalk.addMethod(
  626. "_collectionClass",
  627. smalltalk.method({
  628. selector: "collectionClass",
  629. fn: function (){
  630. var self=this;
  631. return smalltalk.withContext(function($ctx1) { var $1;
  632. $1=_st(_st(self)._class())._collectionClass();
  633. return $1;
  634. }, function($ctx1) {$ctx1.fill(self,"collectionClass",{},smalltalk.CollectionTest)})},
  635. messageSends: ["collectionClass", "class"]}),
  636. smalltalk.CollectionTest);
  637. smalltalk.addMethod(
  638. "_collectionWithDuplicates",
  639. smalltalk.method({
  640. selector: "collectionWithDuplicates",
  641. fn: function (){
  642. var self=this;
  643. return smalltalk.withContext(function($ctx1) { var $1;
  644. $1=_st(_st(self)._collectionClass())._withAll_(["a", "b", "c", (1), (2), (1), "a"]);
  645. return $1;
  646. }, function($ctx1) {$ctx1.fill(self,"collectionWithDuplicates",{},smalltalk.CollectionTest)})},
  647. messageSends: ["withAll:", "collectionClass"]}),
  648. smalltalk.CollectionTest);
  649. smalltalk.addMethod(
  650. "_defaultValues",
  651. smalltalk.method({
  652. selector: "defaultValues",
  653. fn: function (){
  654. var self=this;
  655. return smalltalk.withContext(function($ctx1) { return [(1), (2), (3), (-4)];
  656. }, function($ctx1) {$ctx1.fill(self,"defaultValues",{},smalltalk.CollectionTest)})},
  657. messageSends: []}),
  658. smalltalk.CollectionTest);
  659. smalltalk.addMethod(
  660. "_isCollectionReadOnly",
  661. smalltalk.method({
  662. selector: "isCollectionReadOnly",
  663. fn: function (){
  664. var self=this;
  665. return smalltalk.withContext(function($ctx1) { return false;
  666. }, function($ctx1) {$ctx1.fill(self,"isCollectionReadOnly",{},smalltalk.CollectionTest)})},
  667. messageSends: []}),
  668. smalltalk.CollectionTest);
  669. smalltalk.addMethod(
  670. "_testAsArray",
  671. smalltalk.method({
  672. selector: "testAsArray",
  673. fn: function (){
  674. var self=this;
  675. return smalltalk.withContext(function($ctx1) { _st(self)._assertSameContents_as_(_st(self)._collection(),_st(_st(self)._collection())._asArray());
  676. return self}, function($ctx1) {$ctx1.fill(self,"testAsArray",{},smalltalk.CollectionTest)})},
  677. messageSends: ["assertSameContents:as:", "collection", "asArray"]}),
  678. smalltalk.CollectionTest);
  679. smalltalk.addMethod(
  680. "_testAsOrderedCollection",
  681. smalltalk.method({
  682. selector: "testAsOrderedCollection",
  683. fn: function (){
  684. var self=this;
  685. return smalltalk.withContext(function($ctx1) { _st(self)._assertSameContents_as_(_st(self)._collection(),_st(_st(self)._collection())._asOrderedCollection());
  686. return self}, function($ctx1) {$ctx1.fill(self,"testAsOrderedCollection",{},smalltalk.CollectionTest)})},
  687. messageSends: ["assertSameContents:as:", "collection", "asOrderedCollection"]}),
  688. smalltalk.CollectionTest);
  689. smalltalk.addMethod(
  690. "_testAsSet",
  691. smalltalk.method({
  692. selector: "testAsSet",
  693. fn: function (){
  694. var self=this;
  695. var c,set;
  696. return smalltalk.withContext(function($ctx1) { c=_st(self)._collectionWithDuplicates();
  697. set=_st(c)._asSet();
  698. _st(self)._assert_equals_(_st(set)._size(),(5));
  699. _st(c)._do_((function(each){
  700. return smalltalk.withContext(function($ctx2) { return _st(self)._assert_(_st(set)._includes_(each));
  701. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  702. return self}, function($ctx1) {$ctx1.fill(self,"testAsSet",{c:c,set:set},smalltalk.CollectionTest)})},
  703. messageSends: ["collectionWithDuplicates", "asSet", "assert:equals:", "size", "do:", "assert:", "includes:"]}),
  704. smalltalk.CollectionTest);
  705. smalltalk.addMethod(
  706. "_testCollect",
  707. smalltalk.method({
  708. selector: "testCollect",
  709. fn: function (){
  710. var self=this;
  711. var newCollection;
  712. return smalltalk.withContext(function($ctx1) { newCollection=[(1), (2), (3), (4)];
  713. _st(self)._assertSameContents_as_(_st(_st(self)._collection())._collect_((function(each){
  714. return smalltalk.withContext(function($ctx2) { return _st(each)._abs();
  715. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})),newCollection);
  716. return self}, function($ctx1) {$ctx1.fill(self,"testCollect",{newCollection:newCollection},smalltalk.CollectionTest)})},
  717. messageSends: ["assertSameContents:as:", "collect:", "abs", "collection"]}),
  718. smalltalk.CollectionTest);
  719. smalltalk.addMethod(
  720. "_testDetect",
  721. smalltalk.method({
  722. selector: "testDetect",
  723. fn: function (){
  724. var self=this;
  725. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(_st(self)._collection())._detect_((function(each){
  726. return smalltalk.withContext(function($ctx2) { return _st(each).__lt((0));
  727. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})),(-4));
  728. _st(self)._should_raise_((function(){
  729. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._collection())._detect_((function(each){
  730. return smalltalk.withContext(function($ctx3) { return _st(each).__eq((6));
  731. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  732. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
  733. return self}, function($ctx1) {$ctx1.fill(self,"testDetect",{},smalltalk.CollectionTest)})},
  734. messageSends: ["assert:equals:", "detect:", "<", "collection", "should:raise:", "="]}),
  735. smalltalk.CollectionTest);
  736. smalltalk.addMethod(
  737. "_testDo",
  738. smalltalk.method({
  739. selector: "testDo",
  740. fn: function (){
  741. var self=this;
  742. var newCollection;
  743. return smalltalk.withContext(function($ctx1) { newCollection=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
  744. _st(_st(self)._collection())._do_((function(each){
  745. return smalltalk.withContext(function($ctx2) { return _st(newCollection)._add_(each);
  746. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  747. _st(self)._assertSameContents_as_(_st(self)._collection(),newCollection);
  748. return self}, function($ctx1) {$ctx1.fill(self,"testDo",{newCollection:newCollection},smalltalk.CollectionTest)})},
  749. messageSends: ["new", "do:", "add:", "collection", "assertSameContents:as:"]}),
  750. smalltalk.CollectionTest);
  751. smalltalk.addMethod(
  752. "_testIsEmpty",
  753. smalltalk.method({
  754. selector: "testIsEmpty",
  755. fn: function (){
  756. var self=this;
  757. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(_st(_st(self)._collectionClass())._new())._isEmpty());
  758. _st(self)._deny_(_st(_st(self)._collection())._isEmpty());
  759. return self}, function($ctx1) {$ctx1.fill(self,"testIsEmpty",{},smalltalk.CollectionTest)})},
  760. messageSends: ["assert:", "isEmpty", "new", "collectionClass", "deny:", "collection"]}),
  761. smalltalk.CollectionTest);
  762. smalltalk.addMethod(
  763. "_testSelect",
  764. smalltalk.method({
  765. selector: "testSelect",
  766. fn: function (){
  767. var self=this;
  768. var newCollection;
  769. return smalltalk.withContext(function($ctx1) { newCollection=[(2), (-4)];
  770. _st(self)._assertSameContents_as_(_st(_st(self)._collection())._select_((function(each){
  771. return smalltalk.withContext(function($ctx2) { return _st(each)._even();
  772. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})),newCollection);
  773. return self}, function($ctx1) {$ctx1.fill(self,"testSelect",{newCollection:newCollection},smalltalk.CollectionTest)})},
  774. messageSends: ["assertSameContents:as:", "select:", "even", "collection"]}),
  775. smalltalk.CollectionTest);
  776. smalltalk.addMethod(
  777. "_testSize",
  778. smalltalk.method({
  779. selector: "testSize",
  780. fn: function (){
  781. var self=this;
  782. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(_st(_st(self)._collectionClass())._new())._size(),(0));
  783. _st(self)._assert_equals_(_st(_st(self)._collection())._size(),(4));
  784. return self}, function($ctx1) {$ctx1.fill(self,"testSize",{},smalltalk.CollectionTest)})},
  785. messageSends: ["assert:equals:", "size", "new", "collectionClass", "collection"]}),
  786. smalltalk.CollectionTest);
  787. smalltalk.addMethod(
  788. "_collectionClass",
  789. smalltalk.method({
  790. selector: "collectionClass",
  791. fn: function (){
  792. var self=this;
  793. return smalltalk.withContext(function($ctx1) { return nil;
  794. }, function($ctx1) {$ctx1.fill(self,"collectionClass",{},smalltalk.CollectionTest.klass)})},
  795. messageSends: []}),
  796. smalltalk.CollectionTest.klass);
  797. smalltalk.addMethod(
  798. "_isAbstract",
  799. smalltalk.method({
  800. selector: "isAbstract",
  801. fn: function (){
  802. var self=this;
  803. return smalltalk.withContext(function($ctx1) { var $1;
  804. $1=_st(_st(self)._collectionClass())._isNil();
  805. return $1;
  806. }, function($ctx1) {$ctx1.fill(self,"isAbstract",{},smalltalk.CollectionTest.klass)})},
  807. messageSends: ["isNil", "collectionClass"]}),
  808. smalltalk.CollectionTest.klass);
  809. smalltalk.addClass('IndexableCollectionTest', smalltalk.CollectionTest, [], 'Kernel-Tests');
  810. smalltalk.addMethod(
  811. "_testAt",
  812. smalltalk.method({
  813. selector: "testAt",
  814. fn: function (){
  815. var self=this;
  816. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(_st(self)._collection())._at_((4)),(-4));
  817. _st(self)._should_raise_((function(){
  818. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._collection())._at_((5));
  819. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
  820. return self}, function($ctx1) {$ctx1.fill(self,"testAt",{},smalltalk.IndexableCollectionTest)})},
  821. messageSends: ["assert:equals:", "at:", "collection", "should:raise:"]}),
  822. smalltalk.IndexableCollectionTest);
  823. smalltalk.addMethod(
  824. "_testAtIfAbsent",
  825. smalltalk.method({
  826. selector: "testAtIfAbsent",
  827. fn: function (){
  828. var self=this;
  829. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(_st(self)._collection())._at_ifAbsent_(_st(_st(_st(self)._collection())._size()).__plus((1)),(function(){
  830. return smalltalk.withContext(function($ctx2) { return "none";
  831. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"none");
  832. return self}, function($ctx1) {$ctx1.fill(self,"testAtIfAbsent",{},smalltalk.IndexableCollectionTest)})},
  833. messageSends: ["assert:equals:", "at:ifAbsent:", "+", "size", "collection"]}),
  834. smalltalk.IndexableCollectionTest);
  835. smalltalk.addMethod(
  836. "_testIndexOf",
  837. smalltalk.method({
  838. selector: "testIndexOf",
  839. fn: function (){
  840. var self=this;
  841. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(_st(self)._collection())._indexOf_((2)),(2));
  842. _st(self)._should_raise_((function(){
  843. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._collection())._indexOf_((999));
  844. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
  845. _st(self)._assert_equals_(_st(_st(self)._collection())._indexOf_ifAbsent_((999),(function(){
  846. return smalltalk.withContext(function($ctx2) { return "sentinel";
  847. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"sentinel");
  848. return self}, function($ctx1) {$ctx1.fill(self,"testIndexOf",{},smalltalk.IndexableCollectionTest)})},
  849. messageSends: ["assert:equals:", "indexOf:", "collection", "should:raise:", "indexOf:ifAbsent:"]}),
  850. smalltalk.IndexableCollectionTest);
  851. smalltalk.addMethod(
  852. "_testWithIndexDo",
  853. smalltalk.method({
  854. selector: "testWithIndexDo",
  855. fn: function (){
  856. var self=this;
  857. var collection;
  858. return smalltalk.withContext(function($ctx1) { collection=_st(self)._collection();
  859. _st(_st(self)._collection())._withIndexDo_((function(each,index){
  860. return smalltalk.withContext(function($ctx2) { return _st(self)._assert_equals_(_st(collection)._at_(index),each);
  861. }, function($ctx2) {$ctx2.fillBlock({each:each,index:index},$ctx1)})}));
  862. return self}, function($ctx1) {$ctx1.fill(self,"testWithIndexDo",{collection:collection},smalltalk.IndexableCollectionTest)})},
  863. messageSends: ["collection", "withIndexDo:", "assert:equals:", "at:"]}),
  864. smalltalk.IndexableCollectionTest);
  865. smalltalk.addClass('HashedCollectionTest', smalltalk.IndexableCollectionTest, [], 'Kernel-Tests');
  866. smalltalk.addMethod(
  867. "_collection",
  868. smalltalk.method({
  869. selector: "collection",
  870. fn: function (){
  871. var self=this;
  872. return smalltalk.withContext(function($ctx1) { var $1;
  873. $1=smalltalk.HashedCollection._fromPairs_([_st("b").__minus_gt((1)),_st("a").__minus_gt((2)),_st("c").__minus_gt((3)),_st("d").__minus_gt((-4))]);
  874. return $1;
  875. }, function($ctx1) {$ctx1.fill(self,"collection",{},smalltalk.HashedCollectionTest)})},
  876. messageSends: ["->"]}),
  877. smalltalk.HashedCollectionTest);
  878. smalltalk.addMethod(
  879. "_collectionWithDuplicates",
  880. smalltalk.method({
  881. selector: "collectionWithDuplicates",
  882. fn: function (){
  883. var self=this;
  884. return smalltalk.withContext(function($ctx1) { var $1;
  885. $1=smalltalk.HashedCollection._fromPairs_([_st("b").__minus_gt((1)),_st("a").__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))]);
  886. return $1;
  887. }, function($ctx1) {$ctx1.fill(self,"collectionWithDuplicates",{},smalltalk.HashedCollectionTest)})},
  888. messageSends: ["->"]}),
  889. smalltalk.HashedCollectionTest);
  890. smalltalk.addMethod(
  891. "_testAt",
  892. smalltalk.method({
  893. selector: "testAt",
  894. fn: function (){
  895. var self=this;
  896. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(_st(self)._collection())._at_("a"),(2));
  897. _st(self)._should_raise_((function(){
  898. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._collection())._at_((5));
  899. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
  900. return self}, function($ctx1) {$ctx1.fill(self,"testAt",{},smalltalk.HashedCollectionTest)})},
  901. messageSends: ["assert:equals:", "at:", "collection", "should:raise:"]}),
  902. smalltalk.HashedCollectionTest);
  903. smalltalk.addMethod(
  904. "_testIndexOf",
  905. smalltalk.method({
  906. selector: "testIndexOf",
  907. fn: function (){
  908. var self=this;
  909. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(_st(self)._collection())._indexOf_((2)),"a");
  910. _st(self)._should_raise_((function(){
  911. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._collection())._indexOf_((999));
  912. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
  913. _st(self)._assert_equals_(_st(_st(self)._collection())._indexOf_ifAbsent_((999),(function(){
  914. return smalltalk.withContext(function($ctx2) { return "sentinel";
  915. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"sentinel");
  916. return self}, function($ctx1) {$ctx1.fill(self,"testIndexOf",{},smalltalk.HashedCollectionTest)})},
  917. messageSends: ["assert:equals:", "indexOf:", "collection", "should:raise:", "indexOf:ifAbsent:"]}),
  918. smalltalk.HashedCollectionTest);
  919. smalltalk.addMethod(
  920. "_collectionClass",
  921. smalltalk.method({
  922. selector: "collectionClass",
  923. fn: function (){
  924. var self=this;
  925. return smalltalk.withContext(function($ctx1) { var $1;
  926. $1=(smalltalk.HashedCollection || HashedCollection);
  927. return $1;
  928. }, function($ctx1) {$ctx1.fill(self,"collectionClass",{},smalltalk.HashedCollectionTest.klass)})},
  929. messageSends: []}),
  930. smalltalk.HashedCollectionTest.klass);
  931. smalltalk.addClass('DictionaryTest', smalltalk.HashedCollectionTest, [], 'Kernel-Tests');
  932. smalltalk.addMethod(
  933. "_collection",
  934. smalltalk.method({
  935. selector: "collection",
  936. fn: function (){
  937. var self=this;
  938. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  939. $2=_st((smalltalk.Dictionary || Dictionary))._new();
  940. _st($2)._at_put_((1),(1));
  941. _st($2)._at_put_("a",(2));
  942. _st($2)._at_put_(true,(3));
  943. _st($2)._at_put_((4),(-4));
  944. $3=_st($2)._yourself();
  945. $1=$3;
  946. return $1;
  947. }, function($ctx1) {$ctx1.fill(self,"collection",{},smalltalk.DictionaryTest)})},
  948. messageSends: ["at:put:", "new", "yourself"]}),
  949. smalltalk.DictionaryTest);
  950. smalltalk.addMethod(
  951. "_collectionWithDuplicates",
  952. smalltalk.method({
  953. selector: "collectionWithDuplicates",
  954. fn: function (){
  955. var self=this;
  956. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  957. $2=_st((smalltalk.Dictionary || Dictionary))._new();
  958. _st($2)._at_put_((1),(1));
  959. _st($2)._at_put_("a",(2));
  960. _st($2)._at_put_(true,(3));
  961. _st($2)._at_put_((4),(-4));
  962. _st($2)._at_put_("b",(1));
  963. _st($2)._at_put_((3),(3));
  964. _st($2)._at_put_(false,(12));
  965. $3=_st($2)._yourself();
  966. $1=$3;
  967. return $1;
  968. }, function($ctx1) {$ctx1.fill(self,"collectionWithDuplicates",{},smalltalk.DictionaryTest)})},
  969. messageSends: ["at:put:", "new", "yourself"]}),
  970. smalltalk.DictionaryTest);
  971. smalltalk.addMethod(
  972. "_testAccessing",
  973. smalltalk.method({
  974. selector: "testAccessing",
  975. fn: function (){
  976. var self=this;
  977. var d;
  978. return smalltalk.withContext(function($ctx1) { d=_st((smalltalk.Dictionary || Dictionary))._new();
  979. _st(d)._at_put_("hello","world");
  980. _st(self)._assert_equals_(_st(d)._at_("hello"),"world");
  981. _st(self)._assert_equals_(_st(d)._at_ifAbsent_("hello",(function(){
  982. return smalltalk.withContext(function($ctx2) { return nil;
  983. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"world");
  984. _st(self)._deny_(_st(_st(d)._at_ifAbsent_("foo",(function(){
  985. return smalltalk.withContext(function($ctx2) { return nil;
  986. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))).__eq("world"));
  987. _st(self)._assert_(_st(d)._includesKey_("hello"));
  988. _st(self)._deny_(_st(d)._includesKey_("foo"));
  989. _st(d)._at_put_((1),(2));
  990. _st(self)._assert_equals_(_st(d)._at_((1)),(2));
  991. _st(d)._at_put_(_st((1)).__at((3)),(3));
  992. _st(self)._assert_equals_(_st(d)._at_(_st((1)).__at((3))),(3));
  993. _st(self)._assert_(_st(d)._includesKey_(_st((1)).__at((3))));
  994. _st(self)._deny_(_st(d)._includesKey_(_st((3)).__at((1))));
  995. return self}, function($ctx1) {$ctx1.fill(self,"testAccessing",{d:d},smalltalk.DictionaryTest)})},
  996. messageSends: ["new", "at:put:", "assert:equals:", "at:", "at:ifAbsent:", "deny:", "=", "assert:", "includesKey:", "@"]}),
  997. smalltalk.DictionaryTest);
  998. smalltalk.addMethod(
  999. "_testDynamicDictionaries",
  1000. smalltalk.method({
  1001. selector: "testDynamicDictionaries",
  1002. fn: function (){
  1003. var self=this;
  1004. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(smalltalk.HashedCollection._fromPairs_([_st("hello").__minus_gt((1))]))._asDictionary(),_st((smalltalk.Dictionary || Dictionary))._with_(_st("hello").__minus_gt((1))));
  1005. return self}, function($ctx1) {$ctx1.fill(self,"testDynamicDictionaries",{},smalltalk.DictionaryTest)})},
  1006. messageSends: ["assert:equals:", "asDictionary", "->", "with:"]}),
  1007. smalltalk.DictionaryTest);
  1008. smalltalk.addMethod(
  1009. "_testEquality",
  1010. smalltalk.method({
  1011. selector: "testEquality",
  1012. fn: function (){
  1013. var self=this;
  1014. var d1,d2;
  1015. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5,$6,$7,$8,$9,$10;
  1016. _st(self)._assert_(_st(_st((smalltalk.Dictionary || Dictionary))._new()).__eq(_st((smalltalk.Dictionary || Dictionary))._new()));
  1017. $1=_st((smalltalk.Dictionary || Dictionary))._new();
  1018. _st($1)._at_put_((1),(2));
  1019. $2=_st($1)._yourself();
  1020. d1=$2;
  1021. $3=_st((smalltalk.Dictionary || Dictionary))._new();
  1022. _st($3)._at_put_((1),(2));
  1023. $4=_st($3)._yourself();
  1024. d2=$4;
  1025. _st(self)._assert_(_st(d1).__eq(d2));
  1026. $5=_st((smalltalk.Dictionary || Dictionary))._new();
  1027. _st($5)._at_put_((1),(3));
  1028. $6=_st($5)._yourself();
  1029. d2=$6;
  1030. _st(self)._deny_(_st(d1).__eq(d2));
  1031. $7=_st((smalltalk.Dictionary || Dictionary))._new();
  1032. _st($7)._at_put_((2),(2));
  1033. $8=_st($7)._yourself();
  1034. d2=$8;
  1035. _st(self)._deny_(_st(d1).__eq(d2));
  1036. $9=_st((smalltalk.Dictionary || Dictionary))._new();
  1037. _st($9)._at_put_((1),(2));
  1038. _st($9)._at_put_((3),(4));
  1039. $10=_st($9)._yourself();
  1040. d2=$10;
  1041. _st(self)._deny_(_st(d1).__eq(d2));
  1042. return self}, function($ctx1) {$ctx1.fill(self,"testEquality",{d1:d1,d2:d2},smalltalk.DictionaryTest)})},
  1043. messageSends: ["assert:", "=", "new", "at:put:", "yourself", "deny:"]}),
  1044. smalltalk.DictionaryTest);
  1045. smalltalk.addMethod(
  1046. "_testIfAbsent",
  1047. smalltalk.method({
  1048. selector: "testIfAbsent",
  1049. fn: function (){
  1050. var self=this;
  1051. var d,visited;
  1052. return smalltalk.withContext(function($ctx1) { visited=false;
  1053. d=_st((smalltalk.Dictionary || Dictionary))._new();
  1054. _st(d)._at_ifAbsent_("hello",(function(){
  1055. return smalltalk.withContext(function($ctx2) { visited=true;
  1056. return visited;
  1057. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1058. _st(self)._assert_(visited);
  1059. return self}, function($ctx1) {$ctx1.fill(self,"testIfAbsent",{d:d,visited:visited},smalltalk.DictionaryTest)})},
  1060. messageSends: ["new", "at:ifAbsent:", "assert:"]}),
  1061. smalltalk.DictionaryTest);
  1062. smalltalk.addMethod(
  1063. "_testIfPresent",
  1064. smalltalk.method({
  1065. selector: "testIfPresent",
  1066. fn: function (){
  1067. var self=this;
  1068. var d,visited,absent;
  1069. return smalltalk.withContext(function($ctx1) { visited=false;
  1070. d=_st((smalltalk.Dictionary || Dictionary))._new();
  1071. _st(d)._at_put_("hello","world");
  1072. _st(d)._at_ifPresent_("hello",(function(value){
  1073. return smalltalk.withContext(function($ctx2) { visited=value;
  1074. return visited;
  1075. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}));
  1076. _st(self)._assert_equals_(visited,"world");
  1077. absent=_st(d)._at_ifPresent_("bye",(function(value){
  1078. return smalltalk.withContext(function($ctx2) { visited=value;
  1079. return visited;
  1080. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}));
  1081. _st(self)._assert_(_st(absent)._isNil());
  1082. return self}, function($ctx1) {$ctx1.fill(self,"testIfPresent",{d:d,visited:visited,absent:absent},smalltalk.DictionaryTest)})},
  1083. messageSends: ["new", "at:put:", "at:ifPresent:", "assert:equals:", "assert:", "isNil"]}),
  1084. smalltalk.DictionaryTest);
  1085. smalltalk.addMethod(
  1086. "_testIfPresentIfAbsent",
  1087. smalltalk.method({
  1088. selector: "testIfPresentIfAbsent",
  1089. fn: function (){
  1090. var self=this;
  1091. var d,visited;
  1092. return smalltalk.withContext(function($ctx1) { visited=false;
  1093. d=_st((smalltalk.Dictionary || Dictionary))._new();
  1094. _st(d)._at_put_("hello","world");
  1095. _st(d)._at_ifPresent_ifAbsent_("hello",(function(value){
  1096. return smalltalk.withContext(function($ctx2) { visited=value;
  1097. return visited;
  1098. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}),(function(){
  1099. return smalltalk.withContext(function($ctx2) { visited=true;
  1100. return visited;
  1101. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1102. _st(self)._assert_equals_(visited,"world");
  1103. _st(d)._at_ifPresent_ifAbsent_("buy",(function(value){
  1104. return smalltalk.withContext(function($ctx2) { visited=value;
  1105. return visited;
  1106. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}),(function(){
  1107. return smalltalk.withContext(function($ctx2) { visited=true;
  1108. return visited;
  1109. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1110. _st(self)._assert_(visited);
  1111. return self}, function($ctx1) {$ctx1.fill(self,"testIfPresentIfAbsent",{d:d,visited:visited},smalltalk.DictionaryTest)})},
  1112. messageSends: ["new", "at:put:", "at:ifPresent:ifAbsent:", "assert:equals:", "assert:"]}),
  1113. smalltalk.DictionaryTest);
  1114. smalltalk.addMethod(
  1115. "_testKeys",
  1116. smalltalk.method({
  1117. selector: "testKeys",
  1118. fn: function (){
  1119. var self=this;
  1120. var d;
  1121. return smalltalk.withContext(function($ctx1) { d=_st((smalltalk.Dictionary || Dictionary))._new();
  1122. _st(d)._at_put_((1),(2));
  1123. _st(d)._at_put_((2),(3));
  1124. _st(d)._at_put_((3),(4));
  1125. _st(self)._assert_equals_(_st(d)._keys(),[(1), (2), (3)]);
  1126. return self}, function($ctx1) {$ctx1.fill(self,"testKeys",{d:d},smalltalk.DictionaryTest)})},
  1127. messageSends: ["new", "at:put:", "assert:equals:", "keys"]}),
  1128. smalltalk.DictionaryTest);
  1129. smalltalk.addMethod(
  1130. "_testPointKey",
  1131. smalltalk.method({
  1132. selector: "testPointKey",
  1133. fn: function (){
  1134. var self=this;
  1135. var d;
  1136. return smalltalk.withContext(function($ctx1) { d=_st((smalltalk.Dictionary || Dictionary))._new();
  1137. _st(d)._at_put_(_st((1)).__at((1)),"foo");
  1138. _st(self)._assert_equals_(_st(d)._at_(_st((1)).__at((1))),"foo");
  1139. _st(d)._at_put_(_st((1)).__at((1)),"bar");
  1140. _st(self)._assert_equals_(_st(d)._at_(_st((1)).__at((1))),"bar");
  1141. _st(d)._removeKey_(_st((1)).__at((1)));
  1142. _st(self)._assert_equals_(_st(d)._at_ifAbsent_(_st((1)).__at((1)),(function(){
  1143. return smalltalk.withContext(function($ctx2) { return "baz";
  1144. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"baz");
  1145. _st(self)._deny_(_st(d)._includesKey_(_st((1)).__at((1))));
  1146. return self}, function($ctx1) {$ctx1.fill(self,"testPointKey",{d:d},smalltalk.DictionaryTest)})},
  1147. messageSends: ["new", "at:put:", "@", "assert:equals:", "at:", "removeKey:", "at:ifAbsent:", "deny:", "includesKey:"]}),
  1148. smalltalk.DictionaryTest);
  1149. smalltalk.addMethod(
  1150. "_testPrintString",
  1151. smalltalk.method({
  1152. selector: "testPrintString",
  1153. fn: function (){
  1154. var self=this;
  1155. return smalltalk.withContext(function($ctx1) { var $1,$2;
  1156. $1=_st((smalltalk.Dictionary || Dictionary))._new();
  1157. _st($1)._at_put_("firstname","James");
  1158. _st($1)._at_put_("lastname","Bond");
  1159. $2=_st($1)._printString();
  1160. _st(self)._assert_equals_($2,"a Dictionary ('firstname' -> 'James' , 'lastname' -> 'Bond')");
  1161. return self}, function($ctx1) {$ctx1.fill(self,"testPrintString",{},smalltalk.DictionaryTest)})},
  1162. messageSends: ["assert:equals:", "at:put:", "new", "printString"]}),
  1163. smalltalk.DictionaryTest);
  1164. smalltalk.addMethod(
  1165. "_testRemoveKey",
  1166. smalltalk.method({
  1167. selector: "testRemoveKey",
  1168. fn: function (){
  1169. var self=this;
  1170. var d,key;
  1171. return smalltalk.withContext(function($ctx1) { d=_st((smalltalk.Dictionary || Dictionary))._new();
  1172. _st(d)._at_put_((1),(2));
  1173. _st(d)._at_put_((2),(3));
  1174. _st(d)._at_put_((3),(4));
  1175. key=(2);
  1176. _st(self)._assert_equals_(_st(d)._keys(),[(1), (2), (3)]);
  1177. _st(d)._removeKey_(key);
  1178. _st(self)._assert_equals_(_st(d)._keys(),[(1), (3)]);
  1179. _st(self)._assert_equals_(_st(d)._values(),[(2), (4)]);
  1180. _st(self)._deny_(_st(d)._includesKey_((2)));
  1181. return self}, function($ctx1) {$ctx1.fill(self,"testRemoveKey",{d:d,key:key},smalltalk.DictionaryTest)})},
  1182. messageSends: ["new", "at:put:", "assert:equals:", "keys", "removeKey:", "values", "deny:", "includesKey:"]}),
  1183. smalltalk.DictionaryTest);
  1184. smalltalk.addMethod(
  1185. "_testRemoveKeyIfAbsent",
  1186. smalltalk.method({
  1187. selector: "testRemoveKeyIfAbsent",
  1188. fn: function (){
  1189. var self=this;
  1190. var d,key;
  1191. return smalltalk.withContext(function($ctx1) { d=_st((smalltalk.Dictionary || Dictionary))._new();
  1192. _st(d)._at_put_((1),(2));
  1193. _st(d)._at_put_((2),(3));
  1194. _st(d)._at_put_((3),(4));
  1195. key=(2);
  1196. _st(self)._assert_equals_(_st(d)._removeKey_(key),(3));
  1197. key=(3);
  1198. _st(self)._assert_equals_(_st(d)._removeKey_ifAbsent_(key,(function(){
  1199. return smalltalk.withContext(function($ctx2) { return (42);
  1200. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),(4));
  1201. key="why";
  1202. _st(self)._assert_equals_(_st(d)._removeKey_ifAbsent_(key,(function(){
  1203. return smalltalk.withContext(function($ctx2) { return (42);
  1204. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),(42));
  1205. return self}, function($ctx1) {$ctx1.fill(self,"testRemoveKeyIfAbsent",{d:d,key:key},smalltalk.DictionaryTest)})},
  1206. messageSends: ["new", "at:put:", "assert:equals:", "removeKey:", "removeKey:ifAbsent:"]}),
  1207. smalltalk.DictionaryTest);
  1208. smalltalk.addMethod(
  1209. "_testSize",
  1210. smalltalk.method({
  1211. selector: "testSize",
  1212. fn: function (){
  1213. var self=this;
  1214. var d;
  1215. return smalltalk.withContext(function($ctx1) { d=_st((smalltalk.Dictionary || Dictionary))._new();
  1216. _st(self)._assert_equals_(_st(d)._size(),(0));
  1217. _st(d)._at_put_((1),(2));
  1218. _st(self)._assert_equals_(_st(d)._size(),(1));
  1219. _st(d)._at_put_((2),(3));
  1220. _st(self)._assert_equals_(_st(d)._size(),(2));
  1221. return self}, function($ctx1) {$ctx1.fill(self,"testSize",{d:d},smalltalk.DictionaryTest)})},
  1222. messageSends: ["new", "assert:equals:", "size", "at:put:"]}),
  1223. smalltalk.DictionaryTest);
  1224. smalltalk.addMethod(
  1225. "_testValues",
  1226. smalltalk.method({
  1227. selector: "testValues",
  1228. fn: function (){
  1229. var self=this;
  1230. var d;
  1231. return smalltalk.withContext(function($ctx1) { d=_st((smalltalk.Dictionary || Dictionary))._new();
  1232. _st(d)._at_put_((1),(2));
  1233. _st(d)._at_put_((2),(3));
  1234. _st(d)._at_put_((3),(4));
  1235. _st(self)._assert_equals_(_st(d)._values(),[(2), (3), (4)]);
  1236. return self}, function($ctx1) {$ctx1.fill(self,"testValues",{d:d},smalltalk.DictionaryTest)})},
  1237. messageSends: ["new", "at:put:", "assert:equals:", "values"]}),
  1238. smalltalk.DictionaryTest);
  1239. smalltalk.addMethod(
  1240. "_collectionClass",
  1241. smalltalk.method({
  1242. selector: "collectionClass",
  1243. fn: function (){
  1244. var self=this;
  1245. return smalltalk.withContext(function($ctx1) { var $1;
  1246. $1=(smalltalk.Dictionary || Dictionary);
  1247. return $1;
  1248. }, function($ctx1) {$ctx1.fill(self,"collectionClass",{},smalltalk.DictionaryTest.klass)})},
  1249. messageSends: []}),
  1250. smalltalk.DictionaryTest.klass);
  1251. smalltalk.addClass('SequenceableCollectionTest', smalltalk.IndexableCollectionTest, [], 'Kernel-Tests');
  1252. smalltalk.addClass('ArrayTest', smalltalk.SequenceableCollectionTest, [], 'Kernel-Tests');
  1253. smalltalk.addMethod(
  1254. "_testAtIfAbsent",
  1255. smalltalk.method({
  1256. selector: "testAtIfAbsent",
  1257. fn: function (){
  1258. var self=this;
  1259. var array;
  1260. return smalltalk.withContext(function($ctx1) { array=["hello", "world"];
  1261. _st(self)._assert_equals_(_st(array)._at_((1)),"hello");
  1262. _st(self)._assert_equals_(_st(array)._at_((2)),"world");
  1263. _st(self)._assert_equals_(_st(array)._at_ifAbsent_((2),(function(){
  1264. return smalltalk.withContext(function($ctx2) { return "not found";
  1265. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"world");
  1266. _st(self)._assert_equals_(_st(array)._at_ifAbsent_((0),(function(){
  1267. return smalltalk.withContext(function($ctx2) { return "not found";
  1268. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"not found");
  1269. _st(self)._assert_equals_(_st(array)._at_ifAbsent_((-10),(function(){
  1270. return smalltalk.withContext(function($ctx2) { return "not found";
  1271. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"not found");
  1272. _st(self)._assert_equals_(_st(array)._at_ifAbsent_((3),(function(){
  1273. return smalltalk.withContext(function($ctx2) { return "not found";
  1274. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"not found");
  1275. return self}, function($ctx1) {$ctx1.fill(self,"testAtIfAbsent",{array:array},smalltalk.ArrayTest)})},
  1276. messageSends: ["assert:equals:", "at:", "at:ifAbsent:"]}),
  1277. smalltalk.ArrayTest);
  1278. smalltalk.addMethod(
  1279. "_testFirstN",
  1280. smalltalk.method({
  1281. selector: "testFirstN",
  1282. fn: function (){
  1283. var self=this;
  1284. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st([(1),(2),(3),(4),(5)])._first_((3)),[(1),(2),(3)]);
  1285. return self}, function($ctx1) {$ctx1.fill(self,"testFirstN",{},smalltalk.ArrayTest)})},
  1286. messageSends: ["assert:equals:", "first:"]}),
  1287. smalltalk.ArrayTest);
  1288. smalltalk.addMethod(
  1289. "_testIfEmpty",
  1290. smalltalk.method({
  1291. selector: "testIfEmpty",
  1292. fn: function (){
  1293. var self=this;
  1294. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st("")._ifEmpty_((function(){
  1295. return smalltalk.withContext(function($ctx2) { return "zork";
  1296. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"zork");
  1297. return self}, function($ctx1) {$ctx1.fill(self,"testIfEmpty",{},smalltalk.ArrayTest)})},
  1298. messageSends: ["assert:equals:", "ifEmpty:"]}),
  1299. smalltalk.ArrayTest);
  1300. smalltalk.addMethod(
  1301. "_testPrintString",
  1302. smalltalk.method({
  1303. selector: "testPrintString",
  1304. fn: function (){
  1305. var self=this;
  1306. var array;
  1307. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  1308. array=_st((smalltalk.Array || Array))._new();
  1309. _st(self)._assert_equals_(_st(array)._printString(),"an Array ()");
  1310. $1=array;
  1311. _st($1)._add_((1));
  1312. $2=_st($1)._add_((3));
  1313. _st(self)._assert_equals_(_st(array)._printString(),"an Array (1 3)");
  1314. _st(array)._add_("foo");
  1315. _st(self)._assert_equals_(_st(array)._printString(),"an Array (1 3 'foo')");
  1316. $3=array;
  1317. _st($3)._remove_((1));
  1318. $4=_st($3)._remove_((3));
  1319. _st(self)._assert_equals_(_st(array)._printString(),"an Array ('foo')");
  1320. _st(array)._addLast_((3));
  1321. _st(self)._assert_equals_(_st(array)._printString(),"an Array ('foo' 3)");
  1322. _st(array)._addLast_((3));
  1323. _st(self)._assert_equals_(_st(array)._printString(),"an Array ('foo' 3 3)");
  1324. return self}, function($ctx1) {$ctx1.fill(self,"testPrintString",{array:array},smalltalk.ArrayTest)})},
  1325. messageSends: ["new", "assert:equals:", "printString", "add:", "remove:", "addLast:"]}),
  1326. smalltalk.ArrayTest);
  1327. smalltalk.addMethod(
  1328. "_collectionClass",
  1329. smalltalk.method({
  1330. selector: "collectionClass",
  1331. fn: function (){
  1332. var self=this;
  1333. return smalltalk.withContext(function($ctx1) { var $1;
  1334. $1=(smalltalk.Array || Array);
  1335. return $1;
  1336. }, function($ctx1) {$ctx1.fill(self,"collectionClass",{},smalltalk.ArrayTest.klass)})},
  1337. messageSends: []}),
  1338. smalltalk.ArrayTest.klass);
  1339. smalltalk.addClass('StringTest', smalltalk.SequenceableCollectionTest, [], 'Kernel-Tests');
  1340. smalltalk.addMethod(
  1341. "_collection",
  1342. smalltalk.method({
  1343. selector: "collection",
  1344. fn: function (){
  1345. var self=this;
  1346. return smalltalk.withContext(function($ctx1) { return "hello";
  1347. }, function($ctx1) {$ctx1.fill(self,"collection",{},smalltalk.StringTest)})},
  1348. messageSends: []}),
  1349. smalltalk.StringTest);
  1350. smalltalk.addMethod(
  1351. "_collectionWithDuplicates",
  1352. smalltalk.method({
  1353. selector: "collectionWithDuplicates",
  1354. fn: function (){
  1355. var self=this;
  1356. return smalltalk.withContext(function($ctx1) { return "abbaerte";
  1357. }, function($ctx1) {$ctx1.fill(self,"collectionWithDuplicates",{},smalltalk.StringTest)})},
  1358. messageSends: []}),
  1359. smalltalk.StringTest);
  1360. smalltalk.addMethod(
  1361. "_testAddRemove",
  1362. smalltalk.method({
  1363. selector: "testAddRemove",
  1364. fn: function (){
  1365. var self=this;
  1366. return smalltalk.withContext(function($ctx1) { _st(self)._should_raise_((function(){
  1367. return smalltalk.withContext(function($ctx2) { return _st("hello")._add_("a");
  1368. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
  1369. _st(self)._should_raise_((function(){
  1370. return smalltalk.withContext(function($ctx2) { return _st("hello")._remove_("h");
  1371. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
  1372. return self}, function($ctx1) {$ctx1.fill(self,"testAddRemove",{},smalltalk.StringTest)})},
  1373. messageSends: ["should:raise:", "add:", "remove:"]}),
  1374. smalltalk.StringTest);
  1375. smalltalk.addMethod(
  1376. "_testAsArray",
  1377. smalltalk.method({
  1378. selector: "testAsArray",
  1379. fn: function (){
  1380. var self=this;
  1381. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st("hello")._asArray(),["h", "e", "l", "l", "o"]);
  1382. return self}, function($ctx1) {$ctx1.fill(self,"testAsArray",{},smalltalk.StringTest)})},
  1383. messageSends: ["assert:equals:", "asArray"]}),
  1384. smalltalk.StringTest);
  1385. smalltalk.addMethod(
  1386. "_testAt",
  1387. smalltalk.method({
  1388. selector: "testAt",
  1389. fn: function (){
  1390. var self=this;
  1391. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st("hello")._at_((1)),"h");
  1392. _st(self)._assert_equals_(_st("hello")._at_((5)),"o");
  1393. _st(self)._assert_equals_(_st("hello")._at_ifAbsent_((6),(function(){
  1394. return smalltalk.withContext(function($ctx2) { return nil;
  1395. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),nil);
  1396. return self}, function($ctx1) {$ctx1.fill(self,"testAt",{},smalltalk.StringTest)})},
  1397. messageSends: ["assert:equals:", "at:", "at:ifAbsent:"]}),
  1398. smalltalk.StringTest);
  1399. smalltalk.addMethod(
  1400. "_testAtPut",
  1401. smalltalk.method({
  1402. selector: "testAtPut",
  1403. fn: function (){
  1404. var self=this;
  1405. return smalltalk.withContext(function($ctx1) { _st(self)._should_raise_((function(){
  1406. return smalltalk.withContext(function($ctx2) { return _st("hello")._at_put_((1),"a");
  1407. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
  1408. return self}, function($ctx1) {$ctx1.fill(self,"testAtPut",{},smalltalk.StringTest)})},
  1409. messageSends: ["should:raise:", "at:put:"]}),
  1410. smalltalk.StringTest);
  1411. smalltalk.addMethod(
  1412. "_testCollect",
  1413. smalltalk.method({
  1414. selector: "testCollect",
  1415. fn: function (){
  1416. var self=this;
  1417. var newCollection;
  1418. return smalltalk.withContext(function($ctx1) { newCollection="hheelllloo";
  1419. _st(self)._assertSameContents_as_(_st(_st(self)._collection())._collect_((function(each){
  1420. return smalltalk.withContext(function($ctx2) { return _st(each).__comma(each);
  1421. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})),newCollection);
  1422. return self}, function($ctx1) {$ctx1.fill(self,"testCollect",{newCollection:newCollection},smalltalk.StringTest)})},
  1423. messageSends: ["assertSameContents:as:", "collect:", ",", "collection"]}),
  1424. smalltalk.StringTest);
  1425. smalltalk.addMethod(
  1426. "_testCopyWithoutAll",
  1427. smalltalk.method({
  1428. selector: "testCopyWithoutAll",
  1429. fn: function (){
  1430. var self=this;
  1431. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st("*hello* *world*")._copyWithoutAll_("*"),"hello world");
  1432. return self}, function($ctx1) {$ctx1.fill(self,"testCopyWithoutAll",{},smalltalk.StringTest)})},
  1433. messageSends: ["assert:equals:", "copyWithoutAll:"]}),
  1434. smalltalk.StringTest);
  1435. smalltalk.addMethod(
  1436. "_testDetect",
  1437. smalltalk.method({
  1438. selector: "testDetect",
  1439. fn: function (){
  1440. var self=this;
  1441. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(_st(self)._collection())._detect_((function(each){
  1442. return smalltalk.withContext(function($ctx2) { return _st(each).__eq("h");
  1443. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})),"h");
  1444. _st(self)._should_raise_((function(){
  1445. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._collection())._detect_((function(each){
  1446. return smalltalk.withContext(function($ctx3) { return _st(each).__eq((6));
  1447. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  1448. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
  1449. return self}, function($ctx1) {$ctx1.fill(self,"testDetect",{},smalltalk.StringTest)})},
  1450. messageSends: ["assert:equals:", "detect:", "=", "collection", "should:raise:"]}),
  1451. smalltalk.StringTest);
  1452. smalltalk.addMethod(
  1453. "_testEquality",
  1454. smalltalk.method({
  1455. selector: "testEquality",
  1456. fn: function (){
  1457. var self=this;
  1458. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_("hello","hello");
  1459. _st(self)._deny_(_st("hello").__eq("world"));
  1460. _st(self)._assert_equals_("hello",_st("hello")._yourself());
  1461. _st(self)._assert_equals_(_st("hello")._yourself(),"hello");
  1462. _st(self)._deny_(_st("").__eq((0)));
  1463. return self}, function($ctx1) {$ctx1.fill(self,"testEquality",{},smalltalk.StringTest)})},
  1464. messageSends: ["assert:equals:", "deny:", "=", "yourself"]}),
  1465. smalltalk.StringTest);
  1466. smalltalk.addMethod(
  1467. "_testIdentity",
  1468. smalltalk.method({
  1469. selector: "testIdentity",
  1470. fn: function (){
  1471. var self=this;
  1472. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st("hello").__eq_eq("hello"));
  1473. _st(self)._deny_(_st("hello").__eq_eq("world"));
  1474. _st(self)._assert_(_st("hello").__eq_eq(_st("hello")._yourself()));
  1475. _st(self)._assert_(_st(_st("hello")._yourself()).__eq_eq("hello"));
  1476. _st(self)._deny_(_st("").__eq_eq((0)));
  1477. return self}, function($ctx1) {$ctx1.fill(self,"testIdentity",{},smalltalk.StringTest)})},
  1478. messageSends: ["assert:", "==", "deny:", "yourself"]}),
  1479. smalltalk.StringTest);
  1480. smalltalk.addMethod(
  1481. "_testIncludesSubString",
  1482. smalltalk.method({
  1483. selector: "testIncludesSubString",
  1484. fn: function (){
  1485. var self=this;
  1486. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st("amber")._includesSubString_("ber"));
  1487. _st(self)._deny_(_st("amber")._includesSubString_("zork"));
  1488. return self}, function($ctx1) {$ctx1.fill(self,"testIncludesSubString",{},smalltalk.StringTest)})},
  1489. messageSends: ["assert:", "includesSubString:", "deny:"]}),
  1490. smalltalk.StringTest);
  1491. smalltalk.addMethod(
  1492. "_testIndexOf",
  1493. smalltalk.method({
  1494. selector: "testIndexOf",
  1495. fn: function (){
  1496. var self=this;
  1497. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(_st(self)._collection())._indexOf_("e"),(2));
  1498. _st(self)._should_raise_((function(){
  1499. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._collection())._indexOf_((999));
  1500. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
  1501. _st(self)._assert_equals_(_st(_st(self)._collection())._indexOf_ifAbsent_((999),(function(){
  1502. return smalltalk.withContext(function($ctx2) { return "sentinel";
  1503. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"sentinel");
  1504. return self}, function($ctx1) {$ctx1.fill(self,"testIndexOf",{},smalltalk.StringTest)})},
  1505. messageSends: ["assert:equals:", "indexOf:", "collection", "should:raise:", "indexOf:ifAbsent:"]}),
  1506. smalltalk.StringTest);
  1507. smalltalk.addMethod(
  1508. "_testJoin",
  1509. smalltalk.method({
  1510. selector: "testJoin",
  1511. fn: function (){
  1512. var self=this;
  1513. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(",")._join_(["hello", "world"]),"hello,world");
  1514. return self}, function($ctx1) {$ctx1.fill(self,"testJoin",{},smalltalk.StringTest)})},
  1515. messageSends: ["assert:equals:", "join:"]}),
  1516. smalltalk.StringTest);
  1517. smalltalk.addMethod(
  1518. "_testSelect",
  1519. smalltalk.method({
  1520. selector: "testSelect",
  1521. fn: function (){
  1522. var self=this;
  1523. var newCollection;
  1524. return smalltalk.withContext(function($ctx1) { newCollection="o";
  1525. _st(self)._assertSameContents_as_(_st(_st(self)._collection())._select_((function(each){
  1526. return smalltalk.withContext(function($ctx2) { return _st(each).__eq("o");
  1527. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})),newCollection);
  1528. return self}, function($ctx1) {$ctx1.fill(self,"testSelect",{newCollection:newCollection},smalltalk.StringTest)})},
  1529. messageSends: ["assertSameContents:as:", "select:", "=", "collection"]}),
  1530. smalltalk.StringTest);
  1531. smalltalk.addMethod(
  1532. "_testSize",
  1533. smalltalk.method({
  1534. selector: "testSize",
  1535. fn: function (){
  1536. var self=this;
  1537. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st("smalltalk")._size(),(9));
  1538. _st(self)._assert_equals_(_st("")._size(),(0));
  1539. return self}, function($ctx1) {$ctx1.fill(self,"testSize",{},smalltalk.StringTest)})},
  1540. messageSends: ["assert:equals:", "size"]}),
  1541. smalltalk.StringTest);
  1542. smalltalk.addMethod(
  1543. "_testStreamContents",
  1544. smalltalk.method({
  1545. selector: "testStreamContents",
  1546. fn: function (){
  1547. var self=this;
  1548. return smalltalk.withContext(function($ctx1) { var $1,$2;
  1549. _st(self)._assert_equals_(_st((smalltalk.String || String))._streamContents_((function(aStream){
  1550. return smalltalk.withContext(function($ctx2) { $1=aStream;
  1551. _st($1)._nextPutAll_("hello");
  1552. _st($1)._space();
  1553. $2=_st($1)._nextPutAll_("world");
  1554. return $2;
  1555. }, function($ctx2) {$ctx2.fillBlock({aStream:aStream},$ctx1)})})),"hello world");
  1556. return self}, function($ctx1) {$ctx1.fill(self,"testStreamContents",{},smalltalk.StringTest)})},
  1557. messageSends: ["assert:equals:", "streamContents:", "nextPutAll:", "space"]}),
  1558. smalltalk.StringTest);
  1559. smalltalk.addMethod(
  1560. "_collectionClass",
  1561. smalltalk.method({
  1562. selector: "collectionClass",
  1563. fn: function (){
  1564. var self=this;
  1565. return smalltalk.withContext(function($ctx1) { var $1;
  1566. $1=(smalltalk.String || String);
  1567. return $1;
  1568. }, function($ctx1) {$ctx1.fill(self,"collectionClass",{},smalltalk.StringTest.klass)})},
  1569. messageSends: []}),
  1570. smalltalk.StringTest.klass);
  1571. smalltalk.addClass('SymbolTest', smalltalk.SequenceableCollectionTest, [], 'Kernel-Tests');
  1572. smalltalk.addMethod(
  1573. "_collection",
  1574. smalltalk.method({
  1575. selector: "collection",
  1576. fn: function (){
  1577. var self=this;
  1578. return smalltalk.withContext(function($ctx1) { return smalltalk.symbolFor("hello");
  1579. }, function($ctx1) {$ctx1.fill(self,"collection",{},smalltalk.SymbolTest)})},
  1580. messageSends: []}),
  1581. smalltalk.SymbolTest);
  1582. smalltalk.addMethod(
  1583. "_collectionWithDuplicates",
  1584. smalltalk.method({
  1585. selector: "collectionWithDuplicates",
  1586. fn: function (){
  1587. var self=this;
  1588. return smalltalk.withContext(function($ctx1) { return smalltalk.symbolFor("phhaaarorra");
  1589. }, function($ctx1) {$ctx1.fill(self,"collectionWithDuplicates",{},smalltalk.SymbolTest)})},
  1590. messageSends: []}),
  1591. smalltalk.SymbolTest);
  1592. smalltalk.addMethod(
  1593. "_testAsString",
  1594. smalltalk.method({
  1595. selector: "testAsString",
  1596. fn: function (){
  1597. var self=this;
  1598. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(smalltalk.symbolFor("hello"))._asString(),"hello");
  1599. return self}, function($ctx1) {$ctx1.fill(self,"testAsString",{},smalltalk.SymbolTest)})},
  1600. messageSends: ["assert:equals:", "asString"]}),
  1601. smalltalk.SymbolTest);
  1602. smalltalk.addMethod(
  1603. "_testAsSymbol",
  1604. smalltalk.method({
  1605. selector: "testAsSymbol",
  1606. fn: function (){
  1607. var self=this;
  1608. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(smalltalk.symbolFor("hello")).__eq_eq(_st(smalltalk.symbolFor("hello"))._asSymbol()));
  1609. return self}, function($ctx1) {$ctx1.fill(self,"testAsSymbol",{},smalltalk.SymbolTest)})},
  1610. messageSends: ["assert:", "==", "asSymbol"]}),
  1611. smalltalk.SymbolTest);
  1612. smalltalk.addMethod(
  1613. "_testAt",
  1614. smalltalk.method({
  1615. selector: "testAt",
  1616. fn: function (){
  1617. var self=this;
  1618. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(smalltalk.symbolFor("hello"))._at_((1)),"h");
  1619. _st(self)._assert_equals_(_st(smalltalk.symbolFor("hello"))._at_((5)),"o");
  1620. _st(self)._assert_equals_(_st(smalltalk.symbolFor("hello"))._at_ifAbsent_((6),(function(){
  1621. return smalltalk.withContext(function($ctx2) { return nil;
  1622. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),nil);
  1623. return self}, function($ctx1) {$ctx1.fill(self,"testAt",{},smalltalk.SymbolTest)})},
  1624. messageSends: ["assert:equals:", "at:", "at:ifAbsent:"]}),
  1625. smalltalk.SymbolTest);
  1626. smalltalk.addMethod(
  1627. "_testAtPut",
  1628. smalltalk.method({
  1629. selector: "testAtPut",
  1630. fn: function (){
  1631. var self=this;
  1632. return smalltalk.withContext(function($ctx1) { _st(self)._should_raise_((function(){
  1633. return smalltalk.withContext(function($ctx2) { return _st("hello")._at_put_((1),"a");
  1634. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
  1635. return self}, function($ctx1) {$ctx1.fill(self,"testAtPut",{},smalltalk.SymbolTest)})},
  1636. messageSends: ["should:raise:", "at:put:"]}),
  1637. smalltalk.SymbolTest);
  1638. smalltalk.addMethod(
  1639. "_testCollect",
  1640. smalltalk.method({
  1641. selector: "testCollect",
  1642. fn: function (){
  1643. var self=this;
  1644. var newCollection;
  1645. return smalltalk.withContext(function($ctx1) { newCollection=smalltalk.symbolFor("hheelllloo");
  1646. _st(self)._assertSameContents_as_(_st(_st(self)._collection())._collect_((function(each){
  1647. return smalltalk.withContext(function($ctx2) { return _st(each).__comma(each);
  1648. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})),newCollection);
  1649. return self}, function($ctx1) {$ctx1.fill(self,"testCollect",{newCollection:newCollection},smalltalk.SymbolTest)})},
  1650. messageSends: ["assertSameContents:as:", "collect:", ",", "collection"]}),
  1651. smalltalk.SymbolTest);
  1652. smalltalk.addMethod(
  1653. "_testComparing",
  1654. smalltalk.method({
  1655. selector: "testComparing",
  1656. fn: function (){
  1657. var self=this;
  1658. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(smalltalk.symbolFor("ab")).__gt(smalltalk.symbolFor("aa")));
  1659. _st(self)._deny_(_st(smalltalk.symbolFor("ab")).__gt(smalltalk.symbolFor("ba")));
  1660. _st(self)._assert_(_st(smalltalk.symbolFor("ab")).__lt(smalltalk.symbolFor("ba")));
  1661. _st(self)._deny_(_st(smalltalk.symbolFor("bb")).__lt(smalltalk.symbolFor("ba")));
  1662. _st(self)._assert_(_st(smalltalk.symbolFor("ab")).__gt_eq(smalltalk.symbolFor("aa")));
  1663. _st(self)._deny_(_st(smalltalk.symbolFor("ab")).__gt_eq(smalltalk.symbolFor("ba")));
  1664. _st(self)._assert_(_st(smalltalk.symbolFor("ab")).__lt_eq(smalltalk.symbolFor("ba")));
  1665. _st(self)._deny_(_st(smalltalk.symbolFor("bb")).__lt_eq(smalltalk.symbolFor("ba")));
  1666. return self}, function($ctx1) {$ctx1.fill(self,"testComparing",{},smalltalk.SymbolTest)})},
  1667. messageSends: ["assert:", ">", "deny:", "<", ">=", "<="]}),
  1668. smalltalk.SymbolTest);
  1669. smalltalk.addMethod(
  1670. "_testCopying",
  1671. smalltalk.method({
  1672. selector: "testCopying",
  1673. fn: function (){
  1674. var self=this;
  1675. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(_st(smalltalk.symbolFor("hello"))._copy()).__eq_eq(smalltalk.symbolFor("hello")));
  1676. _st(self)._assert_(_st(_st(smalltalk.symbolFor("hello"))._deepCopy()).__eq_eq(smalltalk.symbolFor("hello")));
  1677. return self}, function($ctx1) {$ctx1.fill(self,"testCopying",{},smalltalk.SymbolTest)})},
  1678. messageSends: ["assert:", "==", "copy", "deepCopy"]}),
  1679. smalltalk.SymbolTest);
  1680. smalltalk.addMethod(
  1681. "_testDetect",
  1682. smalltalk.method({
  1683. selector: "testDetect",
  1684. fn: function (){
  1685. var self=this;
  1686. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(_st(self)._collection())._detect_((function(each){
  1687. return smalltalk.withContext(function($ctx2) { return _st(each).__eq("h");
  1688. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})),"h");
  1689. _st(self)._should_raise_((function(){
  1690. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._collection())._detect_((function(each){
  1691. return smalltalk.withContext(function($ctx3) { return _st(each).__eq("z");
  1692. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  1693. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
  1694. return self}, function($ctx1) {$ctx1.fill(self,"testDetect",{},smalltalk.SymbolTest)})},
  1695. messageSends: ["assert:equals:", "detect:", "=", "collection", "should:raise:"]}),
  1696. smalltalk.SymbolTest);
  1697. smalltalk.addMethod(
  1698. "_testEquality",
  1699. smalltalk.method({
  1700. selector: "testEquality",
  1701. fn: function (){
  1702. var self=this;
  1703. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(smalltalk.symbolFor("hello")).__eq(smalltalk.symbolFor("hello")));
  1704. _st(self)._deny_(_st(smalltalk.symbolFor("hello")).__eq(smalltalk.symbolFor("world")));
  1705. _st(self)._assert_(_st(smalltalk.symbolFor("hello")).__eq(_st(smalltalk.symbolFor("hello"))._yourself()));
  1706. _st(self)._assert_(_st(_st(smalltalk.symbolFor("hello"))._yourself()).__eq(smalltalk.symbolFor("hello")));
  1707. _st(self)._deny_(_st(smalltalk.symbolFor("hello")).__eq("hello"));
  1708. _st(self)._deny_(_st("hello").__eq(smalltalk.symbolFor("hello")));
  1709. return self}, function($ctx1) {$ctx1.fill(self,"testEquality",{},smalltalk.SymbolTest)})},
  1710. messageSends: ["assert:", "=", "deny:", "yourself"]}),
  1711. smalltalk.SymbolTest);
  1712. smalltalk.addMethod(
  1713. "_testIdentity",
  1714. smalltalk.method({
  1715. selector: "testIdentity",
  1716. fn: function (){
  1717. var self=this;
  1718. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(smalltalk.symbolFor("hello")).__eq_eq(smalltalk.symbolFor("hello")));
  1719. _st(self)._deny_(_st(smalltalk.symbolFor("hello")).__eq_eq(smalltalk.symbolFor("world")));
  1720. _st(self)._assert_(_st(smalltalk.symbolFor("hello")).__eq(_st(smalltalk.symbolFor("hello"))._yourself()));
  1721. _st(self)._assert_(_st(_st(smalltalk.symbolFor("hello"))._yourself()).__eq(_st(_st(smalltalk.symbolFor("hello"))._asString())._asSymbol()));
  1722. return self}, function($ctx1) {$ctx1.fill(self,"testIdentity",{},smalltalk.SymbolTest)})},
  1723. messageSends: ["assert:", "==", "deny:", "=", "yourself", "asSymbol", "asString"]}),
  1724. smalltalk.SymbolTest);
  1725. smalltalk.addMethod(
  1726. "_testIndexOf",
  1727. smalltalk.method({
  1728. selector: "testIndexOf",
  1729. fn: function (){
  1730. var self=this;
  1731. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(_st(self)._collection())._indexOf_("e"),(2));
  1732. _st(self)._should_raise_((function(){
  1733. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._collection())._indexOf_((999));
  1734. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
  1735. _st(self)._assert_equals_(_st(_st(self)._collection())._indexOf_ifAbsent_((999),(function(){
  1736. return smalltalk.withContext(function($ctx2) { return "sentinel";
  1737. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"sentinel");
  1738. return self}, function($ctx1) {$ctx1.fill(self,"testIndexOf",{},smalltalk.SymbolTest)})},
  1739. messageSends: ["assert:equals:", "indexOf:", "collection", "should:raise:", "indexOf:ifAbsent:"]}),
  1740. smalltalk.SymbolTest);
  1741. smalltalk.addMethod(
  1742. "_testIsEmpty",
  1743. smalltalk.method({
  1744. selector: "testIsEmpty",
  1745. fn: function (){
  1746. var self=this;
  1747. return smalltalk.withContext(function($ctx1) { _st(self)._deny_(_st(_st(self)._collection())._isEmpty());
  1748. _st(self)._assert_(_st(_st("")._asSymbol())._isEmpty());
  1749. return self}, function($ctx1) {$ctx1.fill(self,"testIsEmpty",{},smalltalk.SymbolTest)})},
  1750. messageSends: ["deny:", "isEmpty", "collection", "assert:", "asSymbol"]}),
  1751. smalltalk.SymbolTest);
  1752. smalltalk.addMethod(
  1753. "_testIsSymbolIsString",
  1754. smalltalk.method({
  1755. selector: "testIsSymbolIsString",
  1756. fn: function (){
  1757. var self=this;
  1758. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(smalltalk.symbolFor("hello"))._isSymbol());
  1759. _st(self)._deny_(_st("hello")._isSymbol());
  1760. _st(self)._deny_(_st(smalltalk.symbolFor("hello"))._isString());
  1761. _st(self)._assert_(_st("hello")._isString());
  1762. return self}, function($ctx1) {$ctx1.fill(self,"testIsSymbolIsString",{},smalltalk.SymbolTest)})},
  1763. messageSends: ["assert:", "isSymbol", "deny:", "isString"]}),
  1764. smalltalk.SymbolTest);
  1765. smalltalk.addMethod(
  1766. "_testSelect",
  1767. smalltalk.method({
  1768. selector: "testSelect",
  1769. fn: function (){
  1770. var self=this;
  1771. var newCollection;
  1772. return smalltalk.withContext(function($ctx1) { newCollection="o";
  1773. _st(self)._assertSameContents_as_(_st(_st(self)._collection())._select_((function(each){
  1774. return smalltalk.withContext(function($ctx2) { return _st(each).__eq("o");
  1775. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})),newCollection);
  1776. return self}, function($ctx1) {$ctx1.fill(self,"testSelect",{newCollection:newCollection},smalltalk.SymbolTest)})},
  1777. messageSends: ["assertSameContents:as:", "select:", "=", "collection"]}),
  1778. smalltalk.SymbolTest);
  1779. smalltalk.addMethod(
  1780. "_testSize",
  1781. smalltalk.method({
  1782. selector: "testSize",
  1783. fn: function (){
  1784. var self=this;
  1785. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(smalltalk.symbolFor("a"))._size(),(1));
  1786. _st(self)._assert_equals_(_st(smalltalk.symbolFor("aaaaa"))._size(),(5));
  1787. return self}, function($ctx1) {$ctx1.fill(self,"testSize",{},smalltalk.SymbolTest)})},
  1788. messageSends: ["assert:equals:", "size"]}),
  1789. smalltalk.SymbolTest);
  1790. smalltalk.addMethod(
  1791. "_collectionClass",
  1792. smalltalk.method({
  1793. selector: "collectionClass",
  1794. fn: function (){
  1795. var self=this;
  1796. return smalltalk.withContext(function($ctx1) { var $1;
  1797. $1=(smalltalk.Symbol || Symbol);
  1798. return $1;
  1799. }, function($ctx1) {$ctx1.fill(self,"collectionClass",{},smalltalk.SymbolTest.klass)})},
  1800. messageSends: []}),
  1801. smalltalk.SymbolTest.klass);
  1802. smalltalk.addClass('JSObjectProxyTest', smalltalk.TestCase, [], 'Kernel-Tests');
  1803. smalltalk.addMethod(
  1804. "_jsObject",
  1805. smalltalk.method({
  1806. selector: "jsObject",
  1807. fn: function (){
  1808. var self=this;
  1809. return smalltalk.withContext(function($ctx1) { return jsObject = {a: 1, b: function() {return 2;}, c: function(object) {return object;}, d: '', 'e': null, 'f': undefined};
  1810. return self}, function($ctx1) {$ctx1.fill(self,"jsObject",{},smalltalk.JSObjectProxyTest)})},
  1811. messageSends: []}),
  1812. smalltalk.JSObjectProxyTest);
  1813. smalltalk.addMethod(
  1814. "_testAtIfAbsent",
  1815. smalltalk.method({
  1816. selector: "testAtIfAbsent",
  1817. fn: function (){
  1818. var self=this;
  1819. var testObject;
  1820. return smalltalk.withContext(function($ctx1) { testObject=_st(self)._jsObject();
  1821. _st(self)._assert_equals_(_st(testObject)._at_ifAbsent_("abc",(function(){
  1822. return smalltalk.withContext(function($ctx2) { return "Property does not exist";
  1823. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"Property does not exist");
  1824. _st(self)._assert_equals_(_st(testObject)._at_ifAbsent_("e",(function(){
  1825. return smalltalk.withContext(function($ctx2) { return "Property does not exist";
  1826. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),nil);
  1827. _st(self)._assert_equals_(_st(testObject)._at_ifAbsent_("a",(function(){
  1828. return smalltalk.withContext(function($ctx2) { return "Property does not exist";
  1829. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),(1));
  1830. _st(self)._assert_equals_(_st(testObject)._at_ifAbsent_("f",(function(){
  1831. return smalltalk.withContext(function($ctx2) { return "Property does not exist";
  1832. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),nil);
  1833. return self}, function($ctx1) {$ctx1.fill(self,"testAtIfAbsent",{testObject:testObject},smalltalk.JSObjectProxyTest)})},
  1834. messageSends: ["jsObject", "assert:equals:", "at:ifAbsent:"]}),
  1835. smalltalk.JSObjectProxyTest);
  1836. smalltalk.addMethod(
  1837. "_testAtIfPresent",
  1838. smalltalk.method({
  1839. selector: "testAtIfPresent",
  1840. fn: function (){
  1841. var self=this;
  1842. var testObject;
  1843. return smalltalk.withContext(function($ctx1) { testObject=_st(self)._jsObject();
  1844. _st(self)._assert_equals_(_st(testObject)._at_ifPresent_("abc",(function(x){
  1845. return smalltalk.withContext(function($ctx2) { return _st("hello ").__comma(_st(x)._asString());
  1846. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})})),nil);
  1847. _st(self)._assert_equals_(_st(testObject)._at_ifPresent_("e",(function(x){
  1848. return smalltalk.withContext(function($ctx2) { return _st("hello ").__comma(_st(x)._asString());
  1849. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})})),"hello nil");
  1850. _st(self)._assert_equals_(_st(testObject)._at_ifPresent_("a",(function(x){
  1851. return smalltalk.withContext(function($ctx2) { return _st("hello ").__comma(_st(x)._asString());
  1852. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})})),"hello 1");
  1853. _st(self)._assert_equals_(_st(testObject)._at_ifPresent_("f",(function(x){
  1854. return smalltalk.withContext(function($ctx2) { return _st("hello ").__comma(_st(x)._asString());
  1855. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})})),"hello nil");
  1856. return self}, function($ctx1) {$ctx1.fill(self,"testAtIfPresent",{testObject:testObject},smalltalk.JSObjectProxyTest)})},
  1857. messageSends: ["jsObject", "assert:equals:", "at:ifPresent:", ",", "asString"]}),
  1858. smalltalk.JSObjectProxyTest);
  1859. smalltalk.addMethod(
  1860. "_testAtIfPresentIfAbsent",
  1861. smalltalk.method({
  1862. selector: "testAtIfPresentIfAbsent",
  1863. fn: function (){
  1864. var self=this;
  1865. var testObject;
  1866. return smalltalk.withContext(function($ctx1) { testObject=_st(self)._jsObject();
  1867. _st(self)._assert_equals_(_st(testObject)._at_ifPresent_ifAbsent_("abc",(function(x){
  1868. return smalltalk.withContext(function($ctx2) { return _st("hello ").__comma(_st(x)._asString());
  1869. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})}),(function(){
  1870. return smalltalk.withContext(function($ctx2) { return "not present";
  1871. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"not present");
  1872. _st(self)._assert_equals_(_st(testObject)._at_ifPresent_ifAbsent_("e",(function(x){
  1873. return smalltalk.withContext(function($ctx2) { return _st("hello ").__comma(_st(x)._asString());
  1874. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})}),(function(){
  1875. return smalltalk.withContext(function($ctx2) { return "not present";
  1876. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"hello nil");
  1877. _st(self)._assert_equals_(_st(testObject)._at_ifPresent_ifAbsent_("a",(function(x){
  1878. return smalltalk.withContext(function($ctx2) { return _st("hello ").__comma(_st(x)._asString());
  1879. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})}),(function(){
  1880. return smalltalk.withContext(function($ctx2) { return "not present";
  1881. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"hello 1");
  1882. _st(self)._assert_equals_(_st(testObject)._at_ifPresent_ifAbsent_("f",(function(x){
  1883. return smalltalk.withContext(function($ctx2) { return _st("hello ").__comma(_st(x)._asString());
  1884. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})}),(function(){
  1885. return smalltalk.withContext(function($ctx2) { return "not present";
  1886. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"hello nil");
  1887. return self}, function($ctx1) {$ctx1.fill(self,"testAtIfPresentIfAbsent",{testObject:testObject},smalltalk.JSObjectProxyTest)})},
  1888. messageSends: ["jsObject", "assert:equals:", "at:ifPresent:ifAbsent:", ",", "asString"]}),
  1889. smalltalk.JSObjectProxyTest);
  1890. smalltalk.addMethod(
  1891. "_testDNU",
  1892. smalltalk.method({
  1893. selector: "testDNU",
  1894. fn: function (){
  1895. var self=this;
  1896. return smalltalk.withContext(function($ctx1) { _st(self)._should_raise_((function(){
  1897. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._jsObject())._foo();
  1898. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1899. return self}, function($ctx1) {$ctx1.fill(self,"testDNU",{},smalltalk.JSObjectProxyTest)})},
  1900. messageSends: ["should:raise:", "foo", "jsObject"]}),
  1901. smalltalk.JSObjectProxyTest);
  1902. smalltalk.addMethod(
  1903. "_testMessageSend",
  1904. smalltalk.method({
  1905. selector: "testMessageSend",
  1906. fn: function (){
  1907. var self=this;
  1908. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(_st(self)._jsObject())._a(),(1));
  1909. _st(self)._assert_equals_(_st(_st(self)._jsObject())._b(),(2));
  1910. _st(self)._assert_equals_(_st(_st(self)._jsObject())._c_((3)),(3));
  1911. return self}, function($ctx1) {$ctx1.fill(self,"testMessageSend",{},smalltalk.JSObjectProxyTest)})},
  1912. messageSends: ["assert:equals:", "a", "jsObject", "b", "c:"]}),
  1913. smalltalk.JSObjectProxyTest);
  1914. smalltalk.addMethod(
  1915. "_testMethodWithArguments",
  1916. smalltalk.method({
  1917. selector: "testMethodWithArguments",
  1918. fn: function (){
  1919. var self=this;
  1920. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(_st(self)._jsObject())._c_((1)),(1));
  1921. return self}, function($ctx1) {$ctx1.fill(self,"testMethodWithArguments",{},smalltalk.JSObjectProxyTest)})},
  1922. messageSends: ["assert:equals:", "c:", "jsObject"]}),
  1923. smalltalk.JSObjectProxyTest);
  1924. smalltalk.addMethod(
  1925. "_testPrinting",
  1926. smalltalk.method({
  1927. selector: "testPrinting",
  1928. fn: function (){
  1929. var self=this;
  1930. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(_st(self)._jsObject())._printString(),"[object Object]");
  1931. return self}, function($ctx1) {$ctx1.fill(self,"testPrinting",{},smalltalk.JSObjectProxyTest)})},
  1932. messageSends: ["assert:equals:", "printString", "jsObject"]}),
  1933. smalltalk.JSObjectProxyTest);
  1934. smalltalk.addMethod(
  1935. "_testPropertyThatReturnsEmptyString",
  1936. smalltalk.method({
  1937. selector: "testPropertyThatReturnsEmptyString",
  1938. fn: function (){
  1939. var self=this;
  1940. var object;
  1941. return smalltalk.withContext(function($ctx1) { object=_st(self)._jsObject();
  1942. _st(self)._assert_equals_(_st(object)._d(),"");
  1943. _st(object)._d_("hello");
  1944. _st(self)._assert_equals_(_st(object)._d(),"hello");
  1945. return self}, function($ctx1) {$ctx1.fill(self,"testPropertyThatReturnsEmptyString",{object:object},smalltalk.JSObjectProxyTest)})},
  1946. messageSends: ["jsObject", "assert:equals:", "d", "d:"]}),
  1947. smalltalk.JSObjectProxyTest);
  1948. smalltalk.addMethod(
  1949. "_testPropertyThatReturnsUndefined",
  1950. smalltalk.method({
  1951. selector: "testPropertyThatReturnsUndefined",
  1952. fn: function (){
  1953. var self=this;
  1954. var object;
  1955. return smalltalk.withContext(function($ctx1) { object=_st(self)._jsObject();
  1956. _st(self)._shouldnt_raise_((function(){
  1957. return smalltalk.withContext(function($ctx2) { return _st(object)._e();
  1958. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1959. _st(self)._assert_(_st(_st(object)._e())._isNil());
  1960. return self}, function($ctx1) {$ctx1.fill(self,"testPropertyThatReturnsUndefined",{object:object},smalltalk.JSObjectProxyTest)})},
  1961. messageSends: ["jsObject", "shouldnt:raise:", "e", "assert:", "isNil"]}),
  1962. smalltalk.JSObjectProxyTest);
  1963. smalltalk.addMethod(
  1964. "_testValue",
  1965. smalltalk.method({
  1966. selector: "testValue",
  1967. fn: function (){
  1968. var self=this;
  1969. var testObject;
  1970. return smalltalk.withContext(function($ctx1) { testObject=_st(self)._jsObject();
  1971. _st(self)._assert_equals_(_st(_st(testObject)._value())._printString(),"[object Object]");
  1972. _st(testObject)._at_put_("value","aValue");
  1973. _st(self)._assert_equals_(_st(testObject)._value(),"aValue");
  1974. return self}, function($ctx1) {$ctx1.fill(self,"testValue",{testObject:testObject},smalltalk.JSObjectProxyTest)})},
  1975. messageSends: ["jsObject", "assert:equals:", "printString", "value", "at:put:"]}),
  1976. smalltalk.JSObjectProxyTest);
  1977. smalltalk.addMethod(
  1978. "_testYourself",
  1979. smalltalk.method({
  1980. selector: "testYourself",
  1981. fn: function (){
  1982. var self=this;
  1983. var object;
  1984. return smalltalk.withContext(function($ctx1) { var $1,$2;
  1985. $1=_st(self)._jsObject();
  1986. _st($1)._d_("test");
  1987. $2=_st($1)._yourself();
  1988. object=$2;
  1989. _st(self)._assert_equals_(_st(object)._d(),"test");
  1990. return self}, function($ctx1) {$ctx1.fill(self,"testYourself",{object:object},smalltalk.JSObjectProxyTest)})},
  1991. messageSends: ["d:", "jsObject", "yourself", "assert:equals:", "d"]}),
  1992. smalltalk.JSObjectProxyTest);
  1993. smalltalk.addClass('JavaScriptExceptionTest', smalltalk.TestCase, [], 'Kernel-Tests');
  1994. smalltalk.addMethod(
  1995. "_testCatchingException",
  1996. smalltalk.method({
  1997. selector: "testCatchingException",
  1998. fn: function (){
  1999. var self=this;
  2000. return smalltalk.withContext(function($ctx1) { _st((function(){
  2001. return smalltalk.withContext(function($ctx2) { return _st(self)._throwException();
  2002. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_((smalltalk.Error || Error),(function(error){
  2003. return smalltalk.withContext(function($ctx2) { return _st(self)._assert_(_st(_st(error)._exception()).__eq("test"));
  2004. }, function($ctx2) {$ctx2.fillBlock({error:error},$ctx1)})}));
  2005. return self}, function($ctx1) {$ctx1.fill(self,"testCatchingException",{},smalltalk.JavaScriptExceptionTest)})},
  2006. messageSends: ["on:do:", "assert:", "=", "exception", "throwException"]}),
  2007. smalltalk.JavaScriptExceptionTest);
  2008. smalltalk.addMethod(
  2009. "_testRaisingException",
  2010. smalltalk.method({
  2011. selector: "testRaisingException",
  2012. fn: function (){
  2013. var self=this;
  2014. return smalltalk.withContext(function($ctx1) { _st(self)._should_raise_((function(){
  2015. return smalltalk.withContext(function($ctx2) { return _st(self)._throwException();
  2016. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.JavaScriptException || JavaScriptException));
  2017. return self}, function($ctx1) {$ctx1.fill(self,"testRaisingException",{},smalltalk.JavaScriptExceptionTest)})},
  2018. messageSends: ["should:raise:", "throwException"]}),
  2019. smalltalk.JavaScriptExceptionTest);
  2020. smalltalk.addMethod(
  2021. "_throwException",
  2022. smalltalk.method({
  2023. selector: "throwException",
  2024. fn: function (){
  2025. var self=this;
  2026. return smalltalk.withContext(function($ctx1) { throw 'test';
  2027. return self}, function($ctx1) {$ctx1.fill(self,"throwException",{},smalltalk.JavaScriptExceptionTest)})},
  2028. messageSends: []}),
  2029. smalltalk.JavaScriptExceptionTest);
  2030. smalltalk.addClass('NumberTest', smalltalk.TestCase, [], 'Kernel-Tests');
  2031. smalltalk.addMethod(
  2032. "_testAbs",
  2033. smalltalk.method({
  2034. selector: "testAbs",
  2035. fn: function (){
  2036. var self=this;
  2037. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st((4))._abs(),(4));
  2038. _st(self)._assert_equals_(_st((-4))._abs(),(4));
  2039. return self}, function($ctx1) {$ctx1.fill(self,"testAbs",{},smalltalk.NumberTest)})},
  2040. messageSends: ["assert:equals:", "abs"]}),
  2041. smalltalk.NumberTest);
  2042. smalltalk.addMethod(
  2043. "_testArithmetic",
  2044. smalltalk.method({
  2045. selector: "testArithmetic",
  2046. fn: function (){
  2047. var self=this;
  2048. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st((1.5)).__plus((1)),(2.5));
  2049. _st(self)._assert_equals_(_st((2)).__minus((1)),(1));
  2050. _st(self)._assert_equals_(_st((-2)).__minus((1)),(-3));
  2051. _st(self)._assert_equals_(_st((12)).__slash((2)),(6));
  2052. _st(self)._assert_equals_(_st((3)).__star((4)),(12));
  2053. _st(self)._assert_equals_(_st(_st((1)).__plus((2))).__star((3)),(9));
  2054. _st(self)._assert_equals_(_st((1)).__plus(_st((2)).__star((3))),(7));
  2055. return self}, function($ctx1) {$ctx1.fill(self,"testArithmetic",{},smalltalk.NumberTest)})},
  2056. messageSends: ["assert:equals:", "+", "-", "/", "*"]}),
  2057. smalltalk.NumberTest);
  2058. smalltalk.addMethod(
  2059. "_testComparison",
  2060. smalltalk.method({
  2061. selector: "testComparison",
  2062. fn: function (){
  2063. var self=this;
  2064. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st((3)).__gt((2)));
  2065. _st(self)._assert_(_st((2)).__lt((3)));
  2066. _st(self)._deny_(_st((3)).__lt((2)));
  2067. _st(self)._deny_(_st((2)).__gt((3)));
  2068. _st(self)._assert_(_st((3)).__gt_eq((3)));
  2069. _st(self)._assert_(_st((3.1)).__gt_eq((3)));
  2070. _st(self)._assert_(_st((3)).__lt_eq((3)));
  2071. _st(self)._assert_(_st((3)).__lt_eq((3.1)));
  2072. return self}, function($ctx1) {$ctx1.fill(self,"testComparison",{},smalltalk.NumberTest)})},
  2073. messageSends: ["assert:", ">", "<", "deny:", ">=", "<="]}),
  2074. smalltalk.NumberTest);
  2075. smalltalk.addMethod(
  2076. "_testCopying",
  2077. smalltalk.method({
  2078. selector: "testCopying",
  2079. fn: function (){
  2080. var self=this;
  2081. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(_st((1))._copy()).__eq_eq((1)));
  2082. _st(self)._assert_(_st(_st((1))._deepCopy()).__eq_eq((1)));
  2083. return self}, function($ctx1) {$ctx1.fill(self,"testCopying",{},smalltalk.NumberTest)})},
  2084. messageSends: ["assert:", "==", "copy", "deepCopy"]}),
  2085. smalltalk.NumberTest);
  2086. smalltalk.addMethod(
  2087. "_testEquality",
  2088. smalltalk.method({
  2089. selector: "testEquality",
  2090. fn: function (){
  2091. var self=this;
  2092. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st((1)).__eq((1)));
  2093. _st(self)._assert_(_st((0)).__eq((0)));
  2094. _st(self)._deny_(_st((1)).__eq((0)));
  2095. _st(self)._assert_(_st(_st((1))._yourself()).__eq((1)));
  2096. _st(self)._assert_(_st((1)).__eq(_st((1))._yourself()));
  2097. _st(self)._assert_(_st(_st((1))._yourself()).__eq(_st((1))._yourself()));
  2098. _st(self)._deny_(_st((0)).__eq(false));
  2099. _st(self)._deny_(_st(false).__eq((0)));
  2100. _st(self)._deny_(_st("").__eq((0)));
  2101. _st(self)._deny_(_st((0)).__eq(""));
  2102. return self}, function($ctx1) {$ctx1.fill(self,"testEquality",{},smalltalk.NumberTest)})},
  2103. messageSends: ["assert:", "=", "deny:", "yourself"]}),
  2104. smalltalk.NumberTest);
  2105. smalltalk.addMethod(
  2106. "_testHexNumbers",
  2107. smalltalk.method({
  2108. selector: "testHexNumbers",
  2109. fn: function (){
  2110. var self=this;
  2111. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_((9),(9));
  2112. _st(self)._assert_equals_(_st((10))._truncated(),(10));
  2113. _st(self)._assert_equals_(_st((11))._truncated(),(11));
  2114. _st(self)._assert_equals_(_st((12))._truncated(),(12));
  2115. _st(self)._assert_equals_(_st((13))._truncated(),(13));
  2116. _st(self)._assert_equals_(_st((14))._truncated(),(14));
  2117. _st(self)._assert_equals_(_st((15))._truncated(),(15));
  2118. return self}, function($ctx1) {$ctx1.fill(self,"testHexNumbers",{},smalltalk.NumberTest)})},
  2119. messageSends: ["assert:equals:", "truncated"]}),
  2120. smalltalk.NumberTest);
  2121. smalltalk.addMethod(
  2122. "_testIdentity",
  2123. smalltalk.method({
  2124. selector: "testIdentity",
  2125. fn: function (){
  2126. var self=this;
  2127. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st((1)).__eq_eq((1)));
  2128. _st(self)._assert_(_st((0)).__eq_eq((0)));
  2129. _st(self)._deny_(_st((1)).__eq_eq((0)));
  2130. _st(self)._assert_(_st(_st((1))._yourself()).__eq_eq((1)));
  2131. _st(self)._assert_(_st((1)).__eq_eq(_st((1))._yourself()));
  2132. _st(self)._assert_(_st(_st((1))._yourself()).__eq_eq(_st((1))._yourself()));
  2133. _st(self)._deny_(_st((1)).__eq_eq((2)));
  2134. return self}, function($ctx1) {$ctx1.fill(self,"testIdentity",{},smalltalk.NumberTest)})},
  2135. messageSends: ["assert:", "==", "deny:", "yourself"]}),
  2136. smalltalk.NumberTest);
  2137. smalltalk.addMethod(
  2138. "_testInvalidHexNumbers",
  2139. smalltalk.method({
  2140. selector: "testInvalidHexNumbers",
  2141. fn: function (){
  2142. var self=this;
  2143. return smalltalk.withContext(function($ctx1) { _st(self)._should_raise_((function(){
  2144. return smalltalk.withContext(function($ctx2) { return _st((16))._rG();
  2145. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2146. _st(self)._should_raise_((function(){
  2147. return smalltalk.withContext(function($ctx2) { return _st((16))._rg();
  2148. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2149. _st(self)._should_raise_((function(){
  2150. return smalltalk.withContext(function($ctx2) { return _st((16))._rH();
  2151. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2152. _st(self)._should_raise_((function(){
  2153. return smalltalk.withContext(function($ctx2) { return _st((16))._rh();
  2154. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2155. _st(self)._should_raise_((function(){
  2156. return smalltalk.withContext(function($ctx2) { return _st((16))._rI();
  2157. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2158. _st(self)._should_raise_((function(){
  2159. return smalltalk.withContext(function($ctx2) { return _st((16))._ri();
  2160. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2161. _st(self)._should_raise_((function(){
  2162. return smalltalk.withContext(function($ctx2) { return _st((16))._rJ();
  2163. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2164. _st(self)._should_raise_((function(){
  2165. return smalltalk.withContext(function($ctx2) { return _st((16))._rj();
  2166. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2167. _st(self)._should_raise_((function(){
  2168. return smalltalk.withContext(function($ctx2) { return _st((16))._rK();
  2169. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2170. _st(self)._should_raise_((function(){
  2171. return smalltalk.withContext(function($ctx2) { return _st((16))._rk();
  2172. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2173. _st(self)._should_raise_((function(){
  2174. return smalltalk.withContext(function($ctx2) { return _st((16))._rL();
  2175. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2176. _st(self)._should_raise_((function(){
  2177. return smalltalk.withContext(function($ctx2) { return _st((16))._rl();
  2178. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2179. _st(self)._should_raise_((function(){
  2180. return smalltalk.withContext(function($ctx2) { return _st((16))._rM();
  2181. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2182. _st(self)._should_raise_((function(){
  2183. return smalltalk.withContext(function($ctx2) { return _st((16))._rm();
  2184. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2185. _st(self)._should_raise_((function(){
  2186. return smalltalk.withContext(function($ctx2) { return _st((16))._rN();
  2187. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2188. _st(self)._should_raise_((function(){
  2189. return smalltalk.withContext(function($ctx2) { return _st((16))._rn();
  2190. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2191. _st(self)._should_raise_((function(){
  2192. return smalltalk.withContext(function($ctx2) { return _st((16))._rO();
  2193. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2194. _st(self)._should_raise_((function(){
  2195. return smalltalk.withContext(function($ctx2) { return _st((16))._ro();
  2196. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2197. _st(self)._should_raise_((function(){
  2198. return smalltalk.withContext(function($ctx2) { return _st((16))._rP();
  2199. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2200. _st(self)._should_raise_((function(){
  2201. return smalltalk.withContext(function($ctx2) { return _st((16))._rp();
  2202. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2203. _st(self)._should_raise_((function(){
  2204. return smalltalk.withContext(function($ctx2) { return _st((16))._rQ();
  2205. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2206. _st(self)._should_raise_((function(){
  2207. return smalltalk.withContext(function($ctx2) { return _st((16))._rq();
  2208. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2209. _st(self)._should_raise_((function(){
  2210. return smalltalk.withContext(function($ctx2) { return _st((16))._rR();
  2211. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2212. _st(self)._should_raise_((function(){
  2213. return smalltalk.withContext(function($ctx2) { return _st((16))._rr();
  2214. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2215. _st(self)._should_raise_((function(){
  2216. return smalltalk.withContext(function($ctx2) { return _st((16))._rS();
  2217. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2218. _st(self)._should_raise_((function(){
  2219. return smalltalk.withContext(function($ctx2) { return _st((16))._rs();
  2220. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2221. _st(self)._should_raise_((function(){
  2222. return smalltalk.withContext(function($ctx2) { return _st((16))._rT();
  2223. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2224. _st(self)._should_raise_((function(){
  2225. return smalltalk.withContext(function($ctx2) { return _st((16))._rt();
  2226. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2227. _st(self)._should_raise_((function(){
  2228. return smalltalk.withContext(function($ctx2) { return _st((16))._rU();
  2229. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2230. _st(self)._should_raise_((function(){
  2231. return smalltalk.withContext(function($ctx2) { return _st((16))._ru();
  2232. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2233. _st(self)._should_raise_((function(){
  2234. return smalltalk.withContext(function($ctx2) { return _st((16))._rV();
  2235. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2236. _st(self)._should_raise_((function(){
  2237. return smalltalk.withContext(function($ctx2) { return _st((16))._rv();
  2238. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2239. _st(self)._should_raise_((function(){
  2240. return smalltalk.withContext(function($ctx2) { return _st((16))._rW();
  2241. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2242. _st(self)._should_raise_((function(){
  2243. return smalltalk.withContext(function($ctx2) { return _st((16))._rw();
  2244. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2245. _st(self)._should_raise_((function(){
  2246. return smalltalk.withContext(function($ctx2) { return _st((16))._rX();
  2247. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2248. _st(self)._should_raise_((function(){
  2249. return smalltalk.withContext(function($ctx2) { return _st((16))._rx();
  2250. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2251. _st(self)._should_raise_((function(){
  2252. return smalltalk.withContext(function($ctx2) { return _st((16))._rY();
  2253. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2254. _st(self)._should_raise_((function(){
  2255. return smalltalk.withContext(function($ctx2) { return _st((16))._ry();
  2256. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2257. _st(self)._should_raise_((function(){
  2258. return smalltalk.withContext(function($ctx2) { return _st((16))._rZ();
  2259. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2260. _st(self)._should_raise_((function(){
  2261. return smalltalk.withContext(function($ctx2) { return _st((16))._rz();
  2262. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2263. _st(self)._should_raise_((function(){
  2264. return smalltalk.withContext(function($ctx2) { return _st((11259375))._Z();
  2265. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2266. return self}, function($ctx1) {$ctx1.fill(self,"testInvalidHexNumbers",{},smalltalk.NumberTest)})},
  2267. messageSends: ["should:raise:", "rG", "rg", "rH", "rh", "rI", "ri", "rJ", "rj", "rK", "rk", "rL", "rl", "rM", "rm", "rN", "rn", "rO", "ro", "rP", "rp", "rQ", "rq", "rR", "rr", "rS", "rs", "rT", "rt", "rU", "ru", "rV", "rv", "rW", "rw", "rX", "rx", "rY", "ry", "rZ", "rz", "Z"]}),
  2268. smalltalk.NumberTest);
  2269. smalltalk.addMethod(
  2270. "_testMinMax",
  2271. smalltalk.method({
  2272. selector: "testMinMax",
  2273. fn: function (){
  2274. var self=this;
  2275. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st((2))._max_((5)),(5));
  2276. _st(self)._assert_equals_(_st((2))._min_((5)),(2));
  2277. return self}, function($ctx1) {$ctx1.fill(self,"testMinMax",{},smalltalk.NumberTest)})},
  2278. messageSends: ["assert:equals:", "max:", "min:"]}),
  2279. smalltalk.NumberTest);
  2280. smalltalk.addMethod(
  2281. "_testNegated",
  2282. smalltalk.method({
  2283. selector: "testNegated",
  2284. fn: function (){
  2285. var self=this;
  2286. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st((3))._negated(),(-3));
  2287. _st(self)._assert_equals_(_st((-3))._negated(),(3));
  2288. return self}, function($ctx1) {$ctx1.fill(self,"testNegated",{},smalltalk.NumberTest)})},
  2289. messageSends: ["assert:equals:", "negated"]}),
  2290. smalltalk.NumberTest);
  2291. smalltalk.addMethod(
  2292. "_testPrintShowingDecimalPlaces",
  2293. smalltalk.method({
  2294. selector: "testPrintShowingDecimalPlaces",
  2295. fn: function (){
  2296. var self=this;
  2297. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st((23))._printShowingDecimalPlaces_((2)),"23.00");
  2298. _st(self)._assert_equals_(_st((23.5698))._printShowingDecimalPlaces_((2)),"23.57");
  2299. _st(self)._assert_equals_(_st(_st((234.567))._negated())._printShowingDecimalPlaces_((5)),"-234.56700");
  2300. _st(self)._assert_equals_(_st((23.4567))._printShowingDecimalPlaces_((0)),"23");
  2301. _st(self)._assert_equals_(_st((23.5567))._printShowingDecimalPlaces_((0)),"24");
  2302. _st(self)._assert_equals_(_st(_st((23.4567))._negated())._printShowingDecimalPlaces_((0)),"-23");
  2303. _st(self)._assert_equals_(_st(_st((23.5567))._negated())._printShowingDecimalPlaces_((0)),"-24");
  2304. _st(self)._assert_equals_(_st((100000000))._printShowingDecimalPlaces_((1)),"100000000.0");
  2305. _st(self)._assert_equals_(_st((0.98))._printShowingDecimalPlaces_((5)),"0.98000");
  2306. _st(self)._assert_equals_(_st(_st((0.98))._negated())._printShowingDecimalPlaces_((2)),"-0.98");
  2307. _st(self)._assert_equals_(_st((2.567))._printShowingDecimalPlaces_((2)),"2.57");
  2308. _st(self)._assert_equals_(_st((-2.567))._printShowingDecimalPlaces_((2)),"-2.57");
  2309. _st(self)._assert_equals_(_st((0))._printShowingDecimalPlaces_((2)),"0.00");
  2310. return self}, function($ctx1) {$ctx1.fill(self,"testPrintShowingDecimalPlaces",{},smalltalk.NumberTest)})},
  2311. messageSends: ["assert:equals:", "printShowingDecimalPlaces:", "negated"]}),
  2312. smalltalk.NumberTest);
  2313. smalltalk.addMethod(
  2314. "_testRounded",
  2315. smalltalk.method({
  2316. selector: "testRounded",
  2317. fn: function (){
  2318. var self=this;
  2319. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st((3))._rounded(),(3));
  2320. _st(self)._assert_equals_(_st((3.212))._rounded(),(3));
  2321. _st(self)._assert_equals_(_st((3.51))._rounded(),(4));
  2322. return self}, function($ctx1) {$ctx1.fill(self,"testRounded",{},smalltalk.NumberTest)})},
  2323. messageSends: ["assert:equals:", "rounded"]}),
  2324. smalltalk.NumberTest);
  2325. smalltalk.addMethod(
  2326. "_testSqrt",
  2327. smalltalk.method({
  2328. selector: "testSqrt",
  2329. fn: function (){
  2330. var self=this;
  2331. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st((4))._sqrt(),(2));
  2332. _st(self)._assert_equals_(_st((16))._sqrt(),(4));
  2333. return self}, function($ctx1) {$ctx1.fill(self,"testSqrt",{},smalltalk.NumberTest)})},
  2334. messageSends: ["assert:equals:", "sqrt"]}),
  2335. smalltalk.NumberTest);
  2336. smalltalk.addMethod(
  2337. "_testSquared",
  2338. smalltalk.method({
  2339. selector: "testSquared",
  2340. fn: function (){
  2341. var self=this;
  2342. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st((4))._squared(),(16));
  2343. return self}, function($ctx1) {$ctx1.fill(self,"testSquared",{},smalltalk.NumberTest)})},
  2344. messageSends: ["assert:equals:", "squared"]}),
  2345. smalltalk.NumberTest);
  2346. smalltalk.addMethod(
  2347. "_testTimesRepeat",
  2348. smalltalk.method({
  2349. selector: "testTimesRepeat",
  2350. fn: function (){
  2351. var self=this;
  2352. var i;
  2353. return smalltalk.withContext(function($ctx1) { i=(0);
  2354. _st((0))._timesRepeat_((function(){
  2355. return smalltalk.withContext(function($ctx2) { i=_st(i).__plus((1));
  2356. return i;
  2357. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2358. _st(self)._assert_equals_(i,(0));
  2359. _st((5))._timesRepeat_((function(){
  2360. return smalltalk.withContext(function($ctx2) { i=_st(i).__plus((1));
  2361. return i;
  2362. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2363. _st(self)._assert_equals_(i,(5));
  2364. return self}, function($ctx1) {$ctx1.fill(self,"testTimesRepeat",{i:i},smalltalk.NumberTest)})},
  2365. messageSends: ["timesRepeat:", "+", "assert:equals:"]}),
  2366. smalltalk.NumberTest);
  2367. smalltalk.addMethod(
  2368. "_testTo",
  2369. smalltalk.method({
  2370. selector: "testTo",
  2371. fn: function (){
  2372. var self=this;
  2373. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st((1))._to_((5)),[(1), (2), (3), (4), (5)]);
  2374. return self}, function($ctx1) {$ctx1.fill(self,"testTo",{},smalltalk.NumberTest)})},
  2375. messageSends: ["assert:equals:", "to:"]}),
  2376. smalltalk.NumberTest);
  2377. smalltalk.addMethod(
  2378. "_testToBy",
  2379. smalltalk.method({
  2380. selector: "testToBy",
  2381. fn: function (){
  2382. var self=this;
  2383. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st((0))._to_by_((6),(2)),[(0), (2), (4), (6)]);
  2384. _st(self)._should_raise_((function(){
  2385. return smalltalk.withContext(function($ctx2) { return _st((1))._to_by_((4),(0));
  2386. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
  2387. return self}, function($ctx1) {$ctx1.fill(self,"testToBy",{},smalltalk.NumberTest)})},
  2388. messageSends: ["assert:equals:", "to:by:", "should:raise:"]}),
  2389. smalltalk.NumberTest);
  2390. smalltalk.addMethod(
  2391. "_testTruncated",
  2392. smalltalk.method({
  2393. selector: "testTruncated",
  2394. fn: function (){
  2395. var self=this;
  2396. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st((3))._truncated(),(3));
  2397. _st(self)._assert_equals_(_st((3.212))._truncated(),(3));
  2398. _st(self)._assert_equals_(_st((3.51))._truncated(),(3));
  2399. return self}, function($ctx1) {$ctx1.fill(self,"testTruncated",{},smalltalk.NumberTest)})},
  2400. messageSends: ["assert:equals:", "truncated"]}),
  2401. smalltalk.NumberTest);
  2402. smalltalk.addClass('ObjectMock', smalltalk.Object, ['foo', 'bar'], 'Kernel-Tests');
  2403. smalltalk.addMethod(
  2404. "_foo",
  2405. smalltalk.method({
  2406. selector: "foo",
  2407. fn: function (){
  2408. var self=this;
  2409. return smalltalk.withContext(function($ctx1) { var $1;
  2410. $1=self["@foo"];
  2411. return $1;
  2412. }, function($ctx1) {$ctx1.fill(self,"foo",{},smalltalk.ObjectMock)})},
  2413. messageSends: []}),
  2414. smalltalk.ObjectMock);
  2415. smalltalk.addMethod(
  2416. "_foo_",
  2417. smalltalk.method({
  2418. selector: "foo:",
  2419. fn: function (anObject){
  2420. var self=this;
  2421. return smalltalk.withContext(function($ctx1) { self["@foo"]=anObject;
  2422. return self}, function($ctx1) {$ctx1.fill(self,"foo:",{anObject:anObject},smalltalk.ObjectMock)})},
  2423. messageSends: []}),
  2424. smalltalk.ObjectMock);
  2425. smalltalk.addClass('ObjectTest', smalltalk.TestCase, [], 'Kernel-Tests');
  2426. smalltalk.addMethod(
  2427. "_notDefined",
  2428. smalltalk.method({
  2429. selector: "notDefined",
  2430. fn: function (){
  2431. var self=this;
  2432. return smalltalk.withContext(function($ctx1) { return undefined;;
  2433. return self}, function($ctx1) {$ctx1.fill(self,"notDefined",{},smalltalk.ObjectTest)})},
  2434. messageSends: []}),
  2435. smalltalk.ObjectTest);
  2436. smalltalk.addMethod(
  2437. "_testBasicAccess",
  2438. smalltalk.method({
  2439. selector: "testBasicAccess",
  2440. fn: function (){
  2441. var self=this;
  2442. var o;
  2443. return smalltalk.withContext(function($ctx1) { o=_st((smalltalk.Object || Object))._new();
  2444. _st(o)._basicAt_put_("a",(1));
  2445. _st(self)._assert_equals_(_st(o)._basicAt_("a"),(1));
  2446. _st(self)._assert_equals_(_st(o)._basicAt_("b"),nil);
  2447. return self}, function($ctx1) {$ctx1.fill(self,"testBasicAccess",{o:o},smalltalk.ObjectTest)})},
  2448. messageSends: ["new", "basicAt:put:", "assert:equals:", "basicAt:"]}),
  2449. smalltalk.ObjectTest);
  2450. smalltalk.addMethod(
  2451. "_testBasicPerform",
  2452. smalltalk.method({
  2453. selector: "testBasicPerform",
  2454. fn: function (){
  2455. var self=this;
  2456. var o;
  2457. return smalltalk.withContext(function($ctx1) { o=_st((smalltalk.Object || Object))._new();
  2458. _st(o)._basicAt_put_("func",(function(){
  2459. return smalltalk.withContext(function($ctx2) { return "hello";
  2460. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2461. _st(o)._basicAt_put_("func2",(function(a){
  2462. return smalltalk.withContext(function($ctx2) { return _st(a).__plus((1));
  2463. }, function($ctx2) {$ctx2.fillBlock({a:a},$ctx1)})}));
  2464. _st(self)._assert_equals_(_st(o)._basicPerform_("func"),"hello");
  2465. _st(self)._assert_equals_(_st(o)._basicPerform_withArguments_("func2",[(3)]),(4));
  2466. return self}, function($ctx1) {$ctx1.fill(self,"testBasicPerform",{o:o},smalltalk.ObjectTest)})},
  2467. messageSends: ["new", "basicAt:put:", "+", "assert:equals:", "basicPerform:", "basicPerform:withArguments:"]}),
  2468. smalltalk.ObjectTest);
  2469. smalltalk.addMethod(
  2470. "_testDNU",
  2471. smalltalk.method({
  2472. selector: "testDNU",
  2473. fn: function (){
  2474. var self=this;
  2475. return smalltalk.withContext(function($ctx1) { _st(self)._should_raise_((function(){
  2476. return smalltalk.withContext(function($ctx2) { return _st(_st((smalltalk.Object || Object))._new())._foo();
  2477. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2478. return self}, function($ctx1) {$ctx1.fill(self,"testDNU",{},smalltalk.ObjectTest)})},
  2479. messageSends: ["should:raise:", "foo", "new"]}),
  2480. smalltalk.ObjectTest);
  2481. smalltalk.addMethod(
  2482. "_testEquality",
  2483. smalltalk.method({
  2484. selector: "testEquality",
  2485. fn: function (){
  2486. var self=this;
  2487. var o;
  2488. return smalltalk.withContext(function($ctx1) { o=_st((smalltalk.Object || Object))._new();
  2489. _st(self)._deny_(_st(o).__eq(_st((smalltalk.Object || Object))._new()));
  2490. _st(self)._assert_(_st(o).__eq(o));
  2491. _st(self)._assert_(_st(_st(o)._yourself()).__eq(o));
  2492. _st(self)._assert_(_st(o).__eq(_st(o)._yourself()));
  2493. return self}, function($ctx1) {$ctx1.fill(self,"testEquality",{o:o},smalltalk.ObjectTest)})},
  2494. messageSends: ["new", "deny:", "=", "assert:", "yourself"]}),
  2495. smalltalk.ObjectTest);
  2496. smalltalk.addMethod(
  2497. "_testHalt",
  2498. smalltalk.method({
  2499. selector: "testHalt",
  2500. fn: function (){
  2501. var self=this;
  2502. return smalltalk.withContext(function($ctx1) { _st(self)._should_raise_((function(){
  2503. return smalltalk.withContext(function($ctx2) { return _st(_st((smalltalk.Object || Object))._new())._halt();
  2504. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
  2505. return self}, function($ctx1) {$ctx1.fill(self,"testHalt",{},smalltalk.ObjectTest)})},
  2506. messageSends: ["should:raise:", "halt", "new"]}),
  2507. smalltalk.ObjectTest);
  2508. smalltalk.addMethod(
  2509. "_testIdentity",
  2510. smalltalk.method({
  2511. selector: "testIdentity",
  2512. fn: function (){
  2513. var self=this;
  2514. var o;
  2515. return smalltalk.withContext(function($ctx1) { o=_st((smalltalk.Object || Object))._new();
  2516. _st(self)._deny_(_st(o).__eq_eq(_st((smalltalk.Object || Object))._new()));
  2517. _st(self)._assert_(_st(o).__eq_eq(o));
  2518. _st(self)._assert_(_st(_st(o)._yourself()).__eq_eq(o));
  2519. _st(self)._assert_(_st(o).__eq_eq(_st(o)._yourself()));
  2520. return self}, function($ctx1) {$ctx1.fill(self,"testIdentity",{o:o},smalltalk.ObjectTest)})},
  2521. messageSends: ["new", "deny:", "==", "assert:", "yourself"]}),
  2522. smalltalk.ObjectTest);
  2523. smalltalk.addMethod(
  2524. "_testIfNil",
  2525. smalltalk.method({
  2526. selector: "testIfNil",
  2527. fn: function (){
  2528. var self=this;
  2529. return smalltalk.withContext(function($ctx1) { var $1,$4,$3,$2,$5,$7,$6,$8,$10,$9;
  2530. _st(self)._deny_(_st(_st((smalltalk.Object || Object))._new())._isNil());
  2531. $1=self;
  2532. $4=_st((smalltalk.Object || Object))._new();
  2533. if(($receiver = $4) == nil || $receiver == undefined){
  2534. $3=true;
  2535. } else {
  2536. $3=$4;
  2537. };
  2538. $2=_st($3).__eq(true);
  2539. _st($1)._deny_($2);
  2540. $5=self;
  2541. $7=_st((smalltalk.Object || Object))._new();
  2542. if(($receiver = $7) == nil || $receiver == undefined){
  2543. $6=$7;
  2544. } else {
  2545. $6=true;
  2546. };
  2547. _st($5)._assert_equals_($6,true);
  2548. $8=self;
  2549. $10=_st((smalltalk.Object || Object))._new();
  2550. if(($receiver = $10) == nil || $receiver == undefined){
  2551. $9=false;
  2552. } else {
  2553. $9=true;
  2554. };
  2555. _st($8)._assert_equals_($9,true);
  2556. _st(self)._assert_equals_(_st(_st((smalltalk.Object || Object))._new())._ifNotNil_ifNil_((function(){
  2557. return smalltalk.withContext(function($ctx2) { return true;
  2558. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(function(){
  2559. return smalltalk.withContext(function($ctx2) { return false;
  2560. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),true);
  2561. return self}, function($ctx1) {$ctx1.fill(self,"testIfNil",{},smalltalk.ObjectTest)})},
  2562. messageSends: ["deny:", "isNil", "new", "=", "ifNil:", "assert:equals:", "ifNotNil:", "ifNil:ifNotNil:", "ifNotNil:ifNil:"]}),
  2563. smalltalk.ObjectTest);
  2564. smalltalk.addMethod(
  2565. "_testInstVars",
  2566. smalltalk.method({
  2567. selector: "testInstVars",
  2568. fn: function (){
  2569. var self=this;
  2570. var o;
  2571. return smalltalk.withContext(function($ctx1) { o=_st((smalltalk.ObjectMock || ObjectMock))._new();
  2572. _st(self)._assert_equals_(_st(o)._instVarAt_(smalltalk.symbolFor("foo")),nil);
  2573. _st(o)._instVarAt_put_(smalltalk.symbolFor("foo"),(1));
  2574. _st(self)._assert_equals_(_st(o)._instVarAt_(smalltalk.symbolFor("foo")),(1));
  2575. _st(self)._assert_equals_(_st(o)._instVarAt_("foo"),(1));
  2576. return self}, function($ctx1) {$ctx1.fill(self,"testInstVars",{o:o},smalltalk.ObjectTest)})},
  2577. messageSends: ["new", "assert:equals:", "instVarAt:", "instVarAt:put:"]}),
  2578. smalltalk.ObjectTest);
  2579. smalltalk.addMethod(
  2580. "_testNilUndefined",
  2581. smalltalk.method({
  2582. selector: "testNilUndefined",
  2583. fn: function (){
  2584. var self=this;
  2585. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(self)._notDefined(),nil);
  2586. return self}, function($ctx1) {$ctx1.fill(self,"testNilUndefined",{},smalltalk.ObjectTest)})},
  2587. messageSends: ["assert:equals:", "notDefined"]}),
  2588. smalltalk.ObjectTest);
  2589. smalltalk.addMethod(
  2590. "_testYourself",
  2591. smalltalk.method({
  2592. selector: "testYourself",
  2593. fn: function (){
  2594. var self=this;
  2595. var o;
  2596. return smalltalk.withContext(function($ctx1) { o=_st((smalltalk.ObjectMock || ObjectMock))._new();
  2597. _st(self)._assert_(_st(_st(o)._yourself()).__eq_eq(o));
  2598. return self}, function($ctx1) {$ctx1.fill(self,"testYourself",{o:o},smalltalk.ObjectTest)})},
  2599. messageSends: ["new", "assert:", "==", "yourself"]}),
  2600. smalltalk.ObjectTest);
  2601. smalltalk.addMethod(
  2602. "_testidentityHash",
  2603. smalltalk.method({
  2604. selector: "testidentityHash",
  2605. fn: function (){
  2606. var self=this;
  2607. var o1,o2;
  2608. return smalltalk.withContext(function($ctx1) { o1=_st((smalltalk.Object || Object))._new();
  2609. o2=_st((smalltalk.Object || Object))._new();
  2610. _st(self)._assert_(_st(_st(o1)._identityHash()).__eq_eq(_st(o1)._identityHash()));
  2611. _st(self)._deny_(_st(_st(o1)._identityHash()).__eq_eq(_st(o2)._identityHash()));
  2612. return self}, function($ctx1) {$ctx1.fill(self,"testidentityHash",{o1:o1,o2:o2},smalltalk.ObjectTest)})},
  2613. messageSends: ["new", "assert:", "==", "identityHash", "deny:"]}),
  2614. smalltalk.ObjectTest);
  2615. smalltalk.addClass('PackageTest', smalltalk.TestCase, ['zorkPackage', 'grulPackage', 'backUpCommitPathJs', 'backUpCommitPathSt'], 'Kernel-Tests');
  2616. smalltalk.addMethod(
  2617. "_setUp",
  2618. smalltalk.method({
  2619. selector: "setUp",
  2620. fn: function (){
  2621. var self=this;
  2622. return smalltalk.withContext(function($ctx1) { var $1,$2;
  2623. self["@backUpCommitPathJs"]=_st((smalltalk.Package || Package))._defaultCommitPathJs();
  2624. self["@backUpCommitPathSt"]=_st((smalltalk.Package || Package))._defaultCommitPathSt();
  2625. _st((smalltalk.Package || Package))._resetCommitPaths();
  2626. self["@zorkPackage"]=_st(_st((smalltalk.Package || Package))._new())._name_("Zork");
  2627. $1=_st((smalltalk.Package || Package))._new();
  2628. _st($1)._name_("Grul");
  2629. _st($1)._commitPathJs_("server/grul/js");
  2630. _st($1)._commitPathSt_("grul/st");
  2631. $2=_st($1)._yourself();
  2632. self["@grulPackage"]=$2;
  2633. return self}, function($ctx1) {$ctx1.fill(self,"setUp",{},smalltalk.PackageTest)})},
  2634. messageSends: ["defaultCommitPathJs", "defaultCommitPathSt", "resetCommitPaths", "name:", "new", "commitPathJs:", "commitPathSt:", "yourself"]}),
  2635. smalltalk.PackageTest);
  2636. smalltalk.addMethod(
  2637. "_tearDown",
  2638. smalltalk.method({
  2639. selector: "tearDown",
  2640. fn: function (){
  2641. var self=this;
  2642. return smalltalk.withContext(function($ctx1) { var $1,$2;
  2643. $1=(smalltalk.Package || Package);
  2644. _st($1)._defaultCommitPathJs_(self["@backUpCommitPathJs"]);
  2645. $2=_st($1)._defaultCommitPathSt_(self["@backUpCommitPathSt"]);
  2646. return self}, function($ctx1) {$ctx1.fill(self,"tearDown",{},smalltalk.PackageTest)})},
  2647. messageSends: ["defaultCommitPathJs:", "defaultCommitPathSt:"]}),
  2648. smalltalk.PackageTest);
  2649. smalltalk.addMethod(
  2650. "_testGrulCommitPathJsShouldBeServerGrulJs",
  2651. smalltalk.method({
  2652. selector: "testGrulCommitPathJsShouldBeServerGrulJs",
  2653. fn: function (){
  2654. var self=this;
  2655. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(self["@grulPackage"])._commitPathJs(),"server/grul/js");
  2656. return self}, function($ctx1) {$ctx1.fill(self,"testGrulCommitPathJsShouldBeServerGrulJs",{},smalltalk.PackageTest)})},
  2657. messageSends: ["assert:equals:", "commitPathJs"]}),
  2658. smalltalk.PackageTest);
  2659. smalltalk.addMethod(
  2660. "_testGrulCommitPathStShouldBeGrulSt",
  2661. smalltalk.method({
  2662. selector: "testGrulCommitPathStShouldBeGrulSt",
  2663. fn: function (){
  2664. var self=this;
  2665. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(self["@grulPackage"])._commitPathSt(),"grul/st");
  2666. return self}, function($ctx1) {$ctx1.fill(self,"testGrulCommitPathStShouldBeGrulSt",{},smalltalk.PackageTest)})},
  2667. messageSends: ["assert:equals:", "commitPathSt"]}),
  2668. smalltalk.PackageTest);
  2669. smalltalk.addMethod(
  2670. "_testZorkCommitPathJsShouldBeJs",
  2671. smalltalk.method({
  2672. selector: "testZorkCommitPathJsShouldBeJs",
  2673. fn: function (){
  2674. var self=this;
  2675. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(self["@zorkPackage"])._commitPathJs(),"js");
  2676. return self}, function($ctx1) {$ctx1.fill(self,"testZorkCommitPathJsShouldBeJs",{},smalltalk.PackageTest)})},
  2677. messageSends: ["assert:equals:", "commitPathJs"]}),
  2678. smalltalk.PackageTest);
  2679. smalltalk.addMethod(
  2680. "_testZorkCommitPathStShouldBeSt",
  2681. smalltalk.method({
  2682. selector: "testZorkCommitPathStShouldBeSt",
  2683. fn: function (){
  2684. var self=this;
  2685. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(self["@zorkPackage"])._commitPathSt(),"st");
  2686. return self}, function($ctx1) {$ctx1.fill(self,"testZorkCommitPathStShouldBeSt",{},smalltalk.PackageTest)})},
  2687. messageSends: ["assert:equals:", "commitPathSt"]}),
  2688. smalltalk.PackageTest);
  2689. smalltalk.addClass('PackageWithDefaultCommitPathChangedTest', smalltalk.PackageTest, [], 'Kernel-Tests');
  2690. smalltalk.addMethod(
  2691. "_setUp",
  2692. smalltalk.method({
  2693. selector: "setUp",
  2694. fn: function (){
  2695. var self=this;
  2696. return smalltalk.withContext(function($ctx1) { var $1,$2;
  2697. smalltalk.PackageTest.fn.prototype._setUp.apply(_st(self), []);
  2698. $1=(smalltalk.Package || Package);
  2699. _st($1)._defaultCommitPathJs_("javascripts/");
  2700. $2=_st($1)._defaultCommitPathSt_("smalltalk/");
  2701. return self}, function($ctx1) {$ctx1.fill(self,"setUp",{},smalltalk.PackageWithDefaultCommitPathChangedTest)})},
  2702. messageSends: ["setUp", "defaultCommitPathJs:", "defaultCommitPathSt:"]}),
  2703. smalltalk.PackageWithDefaultCommitPathChangedTest);
  2704. smalltalk.addMethod(
  2705. "_testGrulCommitPathJsShouldBeServerGrulJs",
  2706. smalltalk.method({
  2707. selector: "testGrulCommitPathJsShouldBeServerGrulJs",
  2708. fn: function (){
  2709. var self=this;
  2710. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(self["@grulPackage"])._commitPathJs(),"server/grul/js");
  2711. return self}, function($ctx1) {$ctx1.fill(self,"testGrulCommitPathJsShouldBeServerGrulJs",{},smalltalk.PackageWithDefaultCommitPathChangedTest)})},
  2712. messageSends: ["assert:equals:", "commitPathJs"]}),
  2713. smalltalk.PackageWithDefaultCommitPathChangedTest);
  2714. smalltalk.addMethod(
  2715. "_testGrulCommitPathStShouldBeGrulSt",
  2716. smalltalk.method({
  2717. selector: "testGrulCommitPathStShouldBeGrulSt",
  2718. fn: function (){
  2719. var self=this;
  2720. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(self["@grulPackage"])._commitPathSt(),"grul/st");
  2721. return self}, function($ctx1) {$ctx1.fill(self,"testGrulCommitPathStShouldBeGrulSt",{},smalltalk.PackageWithDefaultCommitPathChangedTest)})},
  2722. messageSends: ["assert:equals:", "commitPathSt"]}),
  2723. smalltalk.PackageWithDefaultCommitPathChangedTest);
  2724. smalltalk.addMethod(
  2725. "_testZorkCommitPathJsShouldBeJavascript",
  2726. smalltalk.method({
  2727. selector: "testZorkCommitPathJsShouldBeJavascript",
  2728. fn: function (){
  2729. var self=this;
  2730. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(self["@zorkPackage"])._commitPathJs(),"javascripts/");
  2731. return self}, function($ctx1) {$ctx1.fill(self,"testZorkCommitPathJsShouldBeJavascript",{},smalltalk.PackageWithDefaultCommitPathChangedTest)})},
  2732. messageSends: ["assert:equals:", "commitPathJs"]}),
  2733. smalltalk.PackageWithDefaultCommitPathChangedTest);
  2734. smalltalk.addMethod(
  2735. "_testZorkCommitPathStShouldBeSmalltalk",
  2736. smalltalk.method({
  2737. selector: "testZorkCommitPathStShouldBeSmalltalk",
  2738. fn: function (){
  2739. var self=this;
  2740. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(self["@zorkPackage"])._commitPathSt(),"smalltalk/");
  2741. return self}, function($ctx1) {$ctx1.fill(self,"testZorkCommitPathStShouldBeSmalltalk",{},smalltalk.PackageWithDefaultCommitPathChangedTest)})},
  2742. messageSends: ["assert:equals:", "commitPathSt"]}),
  2743. smalltalk.PackageWithDefaultCommitPathChangedTest);
  2744. smalltalk.addMethod(
  2745. "_shouldInheritSelectors",
  2746. smalltalk.method({
  2747. selector: "shouldInheritSelectors",
  2748. fn: function (){
  2749. var self=this;
  2750. return smalltalk.withContext(function($ctx1) { return false;
  2751. }, function($ctx1) {$ctx1.fill(self,"shouldInheritSelectors",{},smalltalk.PackageWithDefaultCommitPathChangedTest.klass)})},
  2752. messageSends: []}),
  2753. smalltalk.PackageWithDefaultCommitPathChangedTest.klass);
  2754. smalltalk.addClass('PointTest', smalltalk.TestCase, [], 'Kernel-Tests');
  2755. smalltalk.addMethod(
  2756. "_testAccessing",
  2757. smalltalk.method({
  2758. selector: "testAccessing",
  2759. fn: function (){
  2760. var self=this;
  2761. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(_st((smalltalk.Point || Point))._x_y_((3),(4)))._x(),(3));
  2762. _st(self)._assert_equals_(_st(_st((smalltalk.Point || Point))._x_y_((3),(4)))._y(),(4));
  2763. _st(self)._assert_equals_(_st(_st(_st((smalltalk.Point || Point))._new())._x_((3)))._x(),(3));
  2764. _st(self)._assert_equals_(_st(_st(_st((smalltalk.Point || Point))._new())._y_((4)))._y(),(4));
  2765. return self}, function($ctx1) {$ctx1.fill(self,"testAccessing",{},smalltalk.PointTest)})},
  2766. messageSends: ["assert:equals:", "x", "x:y:", "y", "x:", "new", "y:"]}),
  2767. smalltalk.PointTest);
  2768. smalltalk.addMethod(
  2769. "_testArithmetic",
  2770. smalltalk.method({
  2771. selector: "testArithmetic",
  2772. fn: function (){
  2773. var self=this;
  2774. 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)));
  2775. _st(self)._assert_equals_(_st(_st((3)).__at((4))).__plus(_st((3)).__at((4))),_st((smalltalk.Point || Point))._x_y_((6),(8)));
  2776. _st(self)._assert_equals_(_st(_st((3)).__at((4))).__minus(_st((3)).__at((4))),_st((smalltalk.Point || Point))._x_y_((0),(0)));
  2777. _st(self)._assert_equals_(_st(_st((6)).__at((8))).__slash(_st((3)).__at((4))),_st((smalltalk.Point || Point))._x_y_((2),(2)));
  2778. return self}, function($ctx1) {$ctx1.fill(self,"testArithmetic",{},smalltalk.PointTest)})},
  2779. messageSends: ["assert:equals:", "*", "@", "x:y:", "+", "-", "/"]}),
  2780. smalltalk.PointTest);
  2781. smalltalk.addMethod(
  2782. "_testAt",
  2783. smalltalk.method({
  2784. selector: "testAt",
  2785. fn: function (){
  2786. var self=this;
  2787. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st((3)).__at((4)),_st((smalltalk.Point || Point))._x_y_((3),(4)));
  2788. return self}, function($ctx1) {$ctx1.fill(self,"testAt",{},smalltalk.PointTest)})},
  2789. messageSends: ["assert:equals:", "@", "x:y:"]}),
  2790. smalltalk.PointTest);
  2791. smalltalk.addMethod(
  2792. "_testEgality",
  2793. smalltalk.method({
  2794. selector: "testEgality",
  2795. fn: function (){
  2796. var self=this;
  2797. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(_st((3)).__at((4))).__eq(_st((3)).__at((4))));
  2798. _st(self)._deny_(_st(_st((3)).__at((5))).__eq(_st((3)).__at((6))));
  2799. return self}, function($ctx1) {$ctx1.fill(self,"testEgality",{},smalltalk.PointTest)})},
  2800. messageSends: ["assert:", "=", "@", "deny:"]}),
  2801. smalltalk.PointTest);
  2802. smalltalk.addMethod(
  2803. "_testTranslateBy",
  2804. smalltalk.method({
  2805. selector: "testTranslateBy",
  2806. fn: function (){
  2807. var self=this;
  2808. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(_st((3)).__at((3)))._translateBy_(_st((0)).__at((1))),_st((3)).__at((4)));
  2809. _st(self)._assert_equals_(_st(_st((3)).__at((3)))._translateBy_(_st((0)).__at(_st((1))._negated())),_st((3)).__at((2)));
  2810. _st(self)._assert_equals_(_st(_st((3)).__at((3)))._translateBy_(_st((2)).__at((3))),_st((5)).__at((6)));
  2811. _st(self)._assert_equals_(_st(_st((3)).__at((3)))._translateBy_(_st(_st((3))._negated()).__at((0))),_st((0)).__at((3)));
  2812. return self}, function($ctx1) {$ctx1.fill(self,"testTranslateBy",{},smalltalk.PointTest)})},
  2813. messageSends: ["assert:equals:", "translateBy:", "@", "negated"]}),
  2814. smalltalk.PointTest);
  2815. smalltalk.addClass('RandomTest', smalltalk.TestCase, [], 'Kernel-Tests');
  2816. smalltalk.addMethod(
  2817. "_textNext",
  2818. smalltalk.method({
  2819. selector: "textNext",
  2820. fn: function (){
  2821. var self=this;
  2822. return smalltalk.withContext(function($ctx1) { _st((10000))._timesRepeat_((function(){
  2823. var current,next;
  2824. return smalltalk.withContext(function($ctx2) { next=_st(_st((smalltalk.Random || Random))._new())._next();
  2825. next;
  2826. _st(self)._assert_(_st(next).__gt_eq((0)));
  2827. _st(self)._assert_(_st(next).__lt((1)));
  2828. _st(self)._deny_(_st(current).__eq(next));
  2829. return _st(next).__eq(current);
  2830. }, function($ctx2) {$ctx2.fillBlock({current:current,next:next},$ctx1)})}));
  2831. return self}, function($ctx1) {$ctx1.fill(self,"textNext",{},smalltalk.RandomTest)})},
  2832. messageSends: ["timesRepeat:", "next", "new", "assert:", ">=", "<", "deny:", "="]}),
  2833. smalltalk.RandomTest);
  2834. smalltalk.addClass('SetTest', smalltalk.TestCase, [], 'Kernel-Tests');
  2835. smalltalk.addMethod(
  2836. "_testAddRemove",
  2837. smalltalk.method({
  2838. selector: "testAddRemove",
  2839. fn: function (){
  2840. var self=this;
  2841. var set;
  2842. return smalltalk.withContext(function($ctx1) { set=_st((smalltalk.Set || Set))._new();
  2843. _st(self)._assert_(_st(set)._isEmpty());
  2844. _st(set)._add_((3));
  2845. _st(self)._assert_(_st(set)._includes_((3)));
  2846. _st(set)._add_((5));
  2847. _st(self)._assert_(_st(set)._includes_((5)));
  2848. _st(set)._remove_((3));
  2849. _st(self)._deny_(_st(set)._includes_((3)));
  2850. return self}, function($ctx1) {$ctx1.fill(self,"testAddRemove",{set:set},smalltalk.SetTest)})},
  2851. messageSends: ["new", "assert:", "isEmpty", "add:", "includes:", "remove:", "deny:"]}),
  2852. smalltalk.SetTest);
  2853. smalltalk.addMethod(
  2854. "_testAt",
  2855. smalltalk.method({
  2856. selector: "testAt",
  2857. fn: function (){
  2858. var self=this;
  2859. return smalltalk.withContext(function($ctx1) { _st(self)._should_raise_((function(){
  2860. return smalltalk.withContext(function($ctx2) { return _st(_st((smalltalk.Set || Set))._new())._at_put_((1),(2));
  2861. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
  2862. return self}, function($ctx1) {$ctx1.fill(self,"testAt",{},smalltalk.SetTest)})},
  2863. messageSends: ["should:raise:", "at:put:", "new"]}),
  2864. smalltalk.SetTest);
  2865. smalltalk.addMethod(
  2866. "_testCollect",
  2867. smalltalk.method({
  2868. selector: "testCollect",
  2869. fn: function (){
  2870. var self=this;
  2871. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(_st([(5), (6), (8)])._asSet())._collect_((function(x){
  2872. return smalltalk.withContext(function($ctx2) { return _st(x).__backslash_backslash((3));
  2873. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})})),_st([(0), (2)])._asSet());
  2874. return self}, function($ctx1) {$ctx1.fill(self,"testCollect",{},smalltalk.SetTest)})},
  2875. messageSends: ["assert:equals:", "collect:", "\x5c\x5c", "asSet"]}),
  2876. smalltalk.SetTest);
  2877. smalltalk.addMethod(
  2878. "_testComparing",
  2879. smalltalk.method({
  2880. selector: "testComparing",
  2881. fn: function (){
  2882. var self=this;
  2883. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st([(0), (2)])._asSet(),_st([(0), (2)])._asSet());
  2884. _st(self)._assert_equals_(_st([(2), (0)])._asSet(),_st([(0), (2)])._asSet());
  2885. _st(self)._deny_(_st(_st([(0), (2), (3)])._asSet()).__eq(_st([(0), (2)])._asSet()));
  2886. _st(self)._deny_(_st(_st([(1), (2)])._asSet()).__eq(_st([(0), (2)])._asSet()));
  2887. return self}, function($ctx1) {$ctx1.fill(self,"testComparing",{},smalltalk.SetTest)})},
  2888. messageSends: ["assert:equals:", "asSet", "deny:", "="]}),
  2889. smalltalk.SetTest);
  2890. smalltalk.addMethod(
  2891. "_testPrintString",
  2892. smalltalk.method({
  2893. selector: "testPrintString",
  2894. fn: function (){
  2895. var self=this;
  2896. var set;
  2897. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  2898. set=_st((smalltalk.Set || Set))._new();
  2899. _st(self)._assert_equals_(_st(set)._printString(),"a Set ()");
  2900. $1=set;
  2901. _st($1)._add_((1));
  2902. $2=_st($1)._add_((3));
  2903. _st(self)._assert_equals_(_st(set)._printString(),"a Set (1 3)");
  2904. _st(set)._add_("foo");
  2905. _st(self)._assert_equals_(_st(set)._printString(),"a Set (1 3 'foo')");
  2906. $3=set;
  2907. _st($3)._remove_((1));
  2908. $4=_st($3)._remove_((3));
  2909. _st(self)._assert_equals_(_st(set)._printString(),"a Set ('foo')");
  2910. _st(set)._add_((3));
  2911. _st(self)._assert_equals_(_st(set)._printString(),"a Set ('foo' 3)");
  2912. _st(set)._add_((3));
  2913. _st(self)._assert_equals_(_st(set)._printString(),"a Set ('foo' 3)");
  2914. return self}, function($ctx1) {$ctx1.fill(self,"testPrintString",{set:set},smalltalk.SetTest)})},
  2915. messageSends: ["new", "assert:equals:", "printString", "add:", "remove:"]}),
  2916. smalltalk.SetTest);
  2917. smalltalk.addMethod(
  2918. "_testSize",
  2919. smalltalk.method({
  2920. selector: "testSize",
  2921. fn: function (){
  2922. var self=this;
  2923. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(_st((smalltalk.Set || Set))._new())._size(),(0));
  2924. _st(self)._assert_equals_(_st(_st((smalltalk.Set || Set))._withAll_([(1), (2), (3), (4)]))._size(),(4));
  2925. _st(self)._assert_equals_(_st(_st((smalltalk.Set || Set))._withAll_([(1), (1), (1), (1)]))._size(),(1));
  2926. return self}, function($ctx1) {$ctx1.fill(self,"testSize",{},smalltalk.SetTest)})},
  2927. messageSends: ["assert:equals:", "size", "new", "withAll:"]}),
  2928. smalltalk.SetTest);
  2929. smalltalk.addMethod(
  2930. "_testUnicity",
  2931. smalltalk.method({
  2932. selector: "testUnicity",
  2933. fn: function (){
  2934. var self=this;
  2935. var set;
  2936. return smalltalk.withContext(function($ctx1) { set=_st((smalltalk.Set || Set))._new();
  2937. _st(set)._add_((21));
  2938. _st(set)._add_("hello");
  2939. _st(set)._add_((21));
  2940. _st(self)._assert_equals_(_st(set)._size(),(2));
  2941. _st(set)._add_("hello");
  2942. _st(self)._assert_equals_(_st(set)._size(),(2));
  2943. _st(self)._assert_equals_(_st(set)._asArray(),[(21), "hello"]);
  2944. return self}, function($ctx1) {$ctx1.fill(self,"testUnicity",{set:set},smalltalk.SetTest)})},
  2945. messageSends: ["new", "add:", "assert:equals:", "size", "asArray"]}),
  2946. smalltalk.SetTest);
  2947. smalltalk.addClass('StreamTest', smalltalk.TestCase, [], 'Kernel-Tests');
  2948. smalltalk.addMethod(
  2949. "_collectionClass",
  2950. smalltalk.method({
  2951. selector: "collectionClass",
  2952. fn: function (){
  2953. var self=this;
  2954. return smalltalk.withContext(function($ctx1) { var $1;
  2955. $1=_st(_st(self)._class())._collectionClass();
  2956. return $1;
  2957. }, function($ctx1) {$ctx1.fill(self,"collectionClass",{},smalltalk.StreamTest)})},
  2958. messageSends: ["collectionClass", "class"]}),
  2959. smalltalk.StreamTest);
  2960. smalltalk.addMethod(
  2961. "_newCollection",
  2962. smalltalk.method({
  2963. selector: "newCollection",
  2964. fn: function (){
  2965. var self=this;
  2966. return smalltalk.withContext(function($ctx1) { var $1;
  2967. $1=_st(_st(self)._collectionClass())._new();
  2968. return $1;
  2969. }, function($ctx1) {$ctx1.fill(self,"newCollection",{},smalltalk.StreamTest)})},
  2970. messageSends: ["new", "collectionClass"]}),
  2971. smalltalk.StreamTest);
  2972. smalltalk.addMethod(
  2973. "_newStream",
  2974. smalltalk.method({
  2975. selector: "newStream",
  2976. fn: function (){
  2977. var self=this;
  2978. return smalltalk.withContext(function($ctx1) { var $1;
  2979. $1=_st(_st(_st(self)._collectionClass())._new())._stream();
  2980. return $1;
  2981. }, function($ctx1) {$ctx1.fill(self,"newStream",{},smalltalk.StreamTest)})},
  2982. messageSends: ["stream", "new", "collectionClass"]}),
  2983. smalltalk.StreamTest);
  2984. smalltalk.addMethod(
  2985. "_testAtEnd",
  2986. smalltalk.method({
  2987. selector: "testAtEnd",
  2988. fn: function (){
  2989. var self=this;
  2990. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"testAtEnd",{},smalltalk.StreamTest)})},
  2991. messageSends: []}),
  2992. smalltalk.StreamTest);
  2993. smalltalk.addMethod(
  2994. "_testAtStart",
  2995. smalltalk.method({
  2996. selector: "testAtStart",
  2997. fn: function (){
  2998. var self=this;
  2999. var stream;
  3000. return smalltalk.withContext(function($ctx1) { stream=_st(self)._newStream();
  3001. _st(stream)._nextPutAll_(_st(self)._newCollection());
  3002. return self}, function($ctx1) {$ctx1.fill(self,"testAtStart",{stream:stream},smalltalk.StreamTest)})},
  3003. messageSends: ["newStream", "nextPutAll:", "newCollection"]}),
  3004. smalltalk.StreamTest);
  3005. smalltalk.addMethod(
  3006. "_testContents",
  3007. smalltalk.method({
  3008. selector: "testContents",
  3009. fn: function (){
  3010. var self=this;
  3011. var stream;
  3012. return smalltalk.withContext(function($ctx1) { stream=_st(self)._newStream();
  3013. _st(stream)._nextPutAll_(_st(self)._newCollection());
  3014. return self}, function($ctx1) {$ctx1.fill(self,"testContents",{stream:stream},smalltalk.StreamTest)})},
  3015. messageSends: ["newStream", "nextPutAll:", "newCollection"]}),
  3016. smalltalk.StreamTest);
  3017. smalltalk.addMethod(
  3018. "_testPosition",
  3019. smalltalk.method({
  3020. selector: "testPosition",
  3021. fn: function (){
  3022. var self=this;
  3023. var stream;
  3024. return smalltalk.withContext(function($ctx1) { stream=_st(self)._newStream();
  3025. _st(stream)._nextPutAll_(_st(self)._newCollection());
  3026. return self}, function($ctx1) {$ctx1.fill(self,"testPosition",{stream:stream},smalltalk.StreamTest)})},
  3027. messageSends: ["newStream", "nextPutAll:", "newCollection"]}),
  3028. smalltalk.StreamTest);
  3029. smalltalk.addMethod(
  3030. "_testReading",
  3031. smalltalk.method({
  3032. selector: "testReading",
  3033. fn: function (){
  3034. var self=this;
  3035. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"testReading",{},smalltalk.StreamTest)})},
  3036. messageSends: []}),
  3037. smalltalk.StreamTest);
  3038. smalltalk.addMethod(
  3039. "_testStreamContents",
  3040. smalltalk.method({
  3041. selector: "testStreamContents",
  3042. fn: function (){
  3043. var self=this;
  3044. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"testStreamContents",{},smalltalk.StreamTest)})},
  3045. messageSends: []}),
  3046. smalltalk.StreamTest);
  3047. smalltalk.addMethod(
  3048. "_testWrite",
  3049. smalltalk.method({
  3050. selector: "testWrite",
  3051. fn: function (){
  3052. var self=this;
  3053. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"testWrite",{},smalltalk.StreamTest)})},
  3054. messageSends: []}),
  3055. smalltalk.StreamTest);
  3056. smalltalk.addMethod(
  3057. "_testWriting",
  3058. smalltalk.method({
  3059. selector: "testWriting",
  3060. fn: function (){
  3061. var self=this;
  3062. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"testWriting",{},smalltalk.StreamTest)})},
  3063. messageSends: []}),
  3064. smalltalk.StreamTest);
  3065. smalltalk.addMethod(
  3066. "_testisEmpty",
  3067. smalltalk.method({
  3068. selector: "testisEmpty",
  3069. fn: function (){
  3070. var self=this;
  3071. var stream;
  3072. return smalltalk.withContext(function($ctx1) { stream=_st(self)._newStream();
  3073. _st(stream)._nextPutAll_(_st(self)._newCollection());
  3074. return self}, function($ctx1) {$ctx1.fill(self,"testisEmpty",{stream:stream},smalltalk.StreamTest)})},
  3075. messageSends: ["newStream", "nextPutAll:", "newCollection"]}),
  3076. smalltalk.StreamTest);
  3077. smalltalk.addMethod(
  3078. "_collectionClass",
  3079. smalltalk.method({
  3080. selector: "collectionClass",
  3081. fn: function (){
  3082. var self=this;
  3083. return smalltalk.withContext(function($ctx1) { return nil;
  3084. }, function($ctx1) {$ctx1.fill(self,"collectionClass",{},smalltalk.StreamTest.klass)})},
  3085. messageSends: []}),
  3086. smalltalk.StreamTest.klass);
  3087. smalltalk.addMethod(
  3088. "_isAbstract",
  3089. smalltalk.method({
  3090. selector: "isAbstract",
  3091. fn: function (){
  3092. var self=this;
  3093. return smalltalk.withContext(function($ctx1) { var $1;
  3094. $1=_st(_st(self)._collectionClass())._isNil();
  3095. return $1;
  3096. }, function($ctx1) {$ctx1.fill(self,"isAbstract",{},smalltalk.StreamTest.klass)})},
  3097. messageSends: ["isNil", "collectionClass"]}),
  3098. smalltalk.StreamTest.klass);
  3099. smalltalk.addClass('UndefinedTest', smalltalk.TestCase, [], 'Kernel-Tests');
  3100. smalltalk.addMethod(
  3101. "_testCopying",
  3102. smalltalk.method({
  3103. selector: "testCopying",
  3104. fn: function (){
  3105. var self=this;
  3106. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(nil)._copy(),nil);
  3107. return self}, function($ctx1) {$ctx1.fill(self,"testCopying",{},smalltalk.UndefinedTest)})},
  3108. messageSends: ["assert:equals:", "copy"]}),
  3109. smalltalk.UndefinedTest);
  3110. smalltalk.addMethod(
  3111. "_testDeepCopy",
  3112. smalltalk.method({
  3113. selector: "testDeepCopy",
  3114. fn: function (){
  3115. var self=this;
  3116. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(_st(nil)._deepCopy()).__eq(nil));
  3117. return self}, function($ctx1) {$ctx1.fill(self,"testDeepCopy",{},smalltalk.UndefinedTest)})},
  3118. messageSends: ["assert:", "=", "deepCopy"]}),
  3119. smalltalk.UndefinedTest);
  3120. smalltalk.addMethod(
  3121. "_testIfNil",
  3122. smalltalk.method({
  3123. selector: "testIfNil",
  3124. fn: function (){
  3125. var self=this;
  3126. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$5,$4,$6,$7;
  3127. $1=self;
  3128. if(($receiver = nil) == nil || $receiver == undefined){
  3129. $2=true;
  3130. } else {
  3131. $2=nil;
  3132. };
  3133. _st($1)._assert_equals_($2,true);
  3134. $3=self;
  3135. if(($receiver = nil) == nil || $receiver == undefined){
  3136. $5=nil;
  3137. } else {
  3138. $5=true;
  3139. };
  3140. $4=_st($5).__eq(true);
  3141. _st($3)._deny_($4);
  3142. $6=self;
  3143. if(($receiver = nil) == nil || $receiver == undefined){
  3144. $7=true;
  3145. } else {
  3146. $7=false;
  3147. };
  3148. _st($6)._assert_equals_($7,true);
  3149. _st(self)._deny_(_st(_st(nil)._ifNotNil_ifNil_((function(){
  3150. return smalltalk.withContext(function($ctx2) { return true;
  3151. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(function(){
  3152. return smalltalk.withContext(function($ctx2) { return false;
  3153. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))).__eq(true));
  3154. return self}, function($ctx1) {$ctx1.fill(self,"testIfNil",{},smalltalk.UndefinedTest)})},
  3155. messageSends: ["assert:equals:", "ifNil:", "deny:", "=", "ifNotNil:", "ifNil:ifNotNil:", "ifNotNil:ifNil:"]}),
  3156. smalltalk.UndefinedTest);
  3157. smalltalk.addMethod(
  3158. "_testIsNil",
  3159. smalltalk.method({
  3160. selector: "testIsNil",
  3161. fn: function (){
  3162. var self=this;
  3163. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(nil)._isNil());
  3164. _st(self)._deny_(_st(nil)._notNil());
  3165. return self}, function($ctx1) {$ctx1.fill(self,"testIsNil",{},smalltalk.UndefinedTest)})},
  3166. messageSends: ["assert:", "isNil", "deny:", "notNil"]}),
  3167. smalltalk.UndefinedTest);