Kernel-Tests.deploy.js 135 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254
  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('JSObjectProxyTest', smalltalk.TestCase, [], 'Kernel-Tests');
  1572. smalltalk.addMethod(
  1573. "_jsObject",
  1574. smalltalk.method({
  1575. selector: "jsObject",
  1576. fn: function (){
  1577. var self=this;
  1578. return smalltalk.withContext(function($ctx1) { return jsObject = {a: 1, b: function() {return 2;}, c: function(object) {return object;}, d: '', 'e': null, 'f': undefined};
  1579. return self}, function($ctx1) {$ctx1.fill(self,"jsObject",{},smalltalk.JSObjectProxyTest)})},
  1580. messageSends: []}),
  1581. smalltalk.JSObjectProxyTest);
  1582. smalltalk.addMethod(
  1583. "_testAtIfAbsent",
  1584. smalltalk.method({
  1585. selector: "testAtIfAbsent",
  1586. fn: function (){
  1587. var self=this;
  1588. var testObject;
  1589. return smalltalk.withContext(function($ctx1) { testObject=_st(self)._jsObject();
  1590. _st(self)._assert_equals_(_st(testObject)._at_ifAbsent_("abc",(function(){
  1591. return smalltalk.withContext(function($ctx2) { return "Property does not exist";
  1592. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"Property does not exist");
  1593. _st(self)._assert_equals_(_st(testObject)._at_ifAbsent_("e",(function(){
  1594. return smalltalk.withContext(function($ctx2) { return "Property does not exist";
  1595. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),nil);
  1596. _st(self)._assert_equals_(_st(testObject)._at_ifAbsent_("a",(function(){
  1597. return smalltalk.withContext(function($ctx2) { return "Property does not exist";
  1598. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),(1));
  1599. _st(self)._assert_equals_(_st(testObject)._at_ifAbsent_("f",(function(){
  1600. return smalltalk.withContext(function($ctx2) { return "Property does not exist";
  1601. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),nil);
  1602. return self}, function($ctx1) {$ctx1.fill(self,"testAtIfAbsent",{testObject:testObject},smalltalk.JSObjectProxyTest)})},
  1603. messageSends: ["jsObject", "assert:equals:", "at:ifAbsent:"]}),
  1604. smalltalk.JSObjectProxyTest);
  1605. smalltalk.addMethod(
  1606. "_testAtIfPresent",
  1607. smalltalk.method({
  1608. selector: "testAtIfPresent",
  1609. fn: function (){
  1610. var self=this;
  1611. var testObject;
  1612. return smalltalk.withContext(function($ctx1) { testObject=_st(self)._jsObject();
  1613. _st(self)._assert_equals_(_st(testObject)._at_ifPresent_("abc",(function(x){
  1614. return smalltalk.withContext(function($ctx2) { return _st("hello ").__comma(_st(x)._asString());
  1615. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})})),nil);
  1616. _st(self)._assert_equals_(_st(testObject)._at_ifPresent_("e",(function(x){
  1617. return smalltalk.withContext(function($ctx2) { return _st("hello ").__comma(_st(x)._asString());
  1618. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})})),"hello nil");
  1619. _st(self)._assert_equals_(_st(testObject)._at_ifPresent_("a",(function(x){
  1620. return smalltalk.withContext(function($ctx2) { return _st("hello ").__comma(_st(x)._asString());
  1621. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})})),"hello 1");
  1622. _st(self)._assert_equals_(_st(testObject)._at_ifPresent_("f",(function(x){
  1623. return smalltalk.withContext(function($ctx2) { return _st("hello ").__comma(_st(x)._asString());
  1624. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})})),"hello nil");
  1625. return self}, function($ctx1) {$ctx1.fill(self,"testAtIfPresent",{testObject:testObject},smalltalk.JSObjectProxyTest)})},
  1626. messageSends: ["jsObject", "assert:equals:", "at:ifPresent:", ",", "asString"]}),
  1627. smalltalk.JSObjectProxyTest);
  1628. smalltalk.addMethod(
  1629. "_testAtIfPresentIfAbsent",
  1630. smalltalk.method({
  1631. selector: "testAtIfPresentIfAbsent",
  1632. fn: function (){
  1633. var self=this;
  1634. var testObject;
  1635. return smalltalk.withContext(function($ctx1) { testObject=_st(self)._jsObject();
  1636. _st(self)._assert_equals_(_st(testObject)._at_ifPresent_ifAbsent_("abc",(function(x){
  1637. return smalltalk.withContext(function($ctx2) { return _st("hello ").__comma(_st(x)._asString());
  1638. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})}),(function(){
  1639. return smalltalk.withContext(function($ctx2) { return "not present";
  1640. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"not present");
  1641. _st(self)._assert_equals_(_st(testObject)._at_ifPresent_ifAbsent_("e",(function(x){
  1642. return smalltalk.withContext(function($ctx2) { return _st("hello ").__comma(_st(x)._asString());
  1643. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})}),(function(){
  1644. return smalltalk.withContext(function($ctx2) { return "not present";
  1645. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"hello nil");
  1646. _st(self)._assert_equals_(_st(testObject)._at_ifPresent_ifAbsent_("a",(function(x){
  1647. return smalltalk.withContext(function($ctx2) { return _st("hello ").__comma(_st(x)._asString());
  1648. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})}),(function(){
  1649. return smalltalk.withContext(function($ctx2) { return "not present";
  1650. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"hello 1");
  1651. _st(self)._assert_equals_(_st(testObject)._at_ifPresent_ifAbsent_("f",(function(x){
  1652. return smalltalk.withContext(function($ctx2) { return _st("hello ").__comma(_st(x)._asString());
  1653. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})}),(function(){
  1654. return smalltalk.withContext(function($ctx2) { return "not present";
  1655. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"hello nil");
  1656. return self}, function($ctx1) {$ctx1.fill(self,"testAtIfPresentIfAbsent",{testObject:testObject},smalltalk.JSObjectProxyTest)})},
  1657. messageSends: ["jsObject", "assert:equals:", "at:ifPresent:ifAbsent:", ",", "asString"]}),
  1658. smalltalk.JSObjectProxyTest);
  1659. smalltalk.addMethod(
  1660. "_testDNU",
  1661. smalltalk.method({
  1662. selector: "testDNU",
  1663. fn: function (){
  1664. var self=this;
  1665. return smalltalk.withContext(function($ctx1) { _st(self)._should_raise_((function(){
  1666. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._jsObject())._foo();
  1667. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1668. return self}, function($ctx1) {$ctx1.fill(self,"testDNU",{},smalltalk.JSObjectProxyTest)})},
  1669. messageSends: ["should:raise:", "foo", "jsObject"]}),
  1670. smalltalk.JSObjectProxyTest);
  1671. smalltalk.addMethod(
  1672. "_testMessageSend",
  1673. smalltalk.method({
  1674. selector: "testMessageSend",
  1675. fn: function (){
  1676. var self=this;
  1677. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(_st(self)._jsObject())._a(),(1));
  1678. _st(self)._assert_equals_(_st(_st(self)._jsObject())._b(),(2));
  1679. _st(self)._assert_equals_(_st(_st(self)._jsObject())._c_((3)),(3));
  1680. return self}, function($ctx1) {$ctx1.fill(self,"testMessageSend",{},smalltalk.JSObjectProxyTest)})},
  1681. messageSends: ["assert:equals:", "a", "jsObject", "b", "c:"]}),
  1682. smalltalk.JSObjectProxyTest);
  1683. smalltalk.addMethod(
  1684. "_testMethodWithArguments",
  1685. smalltalk.method({
  1686. selector: "testMethodWithArguments",
  1687. fn: function (){
  1688. var self=this;
  1689. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(_st(self)._jsObject())._c_((1)),(1));
  1690. return self}, function($ctx1) {$ctx1.fill(self,"testMethodWithArguments",{},smalltalk.JSObjectProxyTest)})},
  1691. messageSends: ["assert:equals:", "c:", "jsObject"]}),
  1692. smalltalk.JSObjectProxyTest);
  1693. smalltalk.addMethod(
  1694. "_testPrinting",
  1695. smalltalk.method({
  1696. selector: "testPrinting",
  1697. fn: function (){
  1698. var self=this;
  1699. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(_st(self)._jsObject())._printString(),"[object Object]");
  1700. return self}, function($ctx1) {$ctx1.fill(self,"testPrinting",{},smalltalk.JSObjectProxyTest)})},
  1701. messageSends: ["assert:equals:", "printString", "jsObject"]}),
  1702. smalltalk.JSObjectProxyTest);
  1703. smalltalk.addMethod(
  1704. "_testPropertyThatReturnsEmptyString",
  1705. smalltalk.method({
  1706. selector: "testPropertyThatReturnsEmptyString",
  1707. fn: function (){
  1708. var self=this;
  1709. var object;
  1710. return smalltalk.withContext(function($ctx1) { object=_st(self)._jsObject();
  1711. _st(self)._assert_equals_(_st(object)._d(),"");
  1712. _st(object)._d_("hello");
  1713. _st(self)._assert_equals_(_st(object)._d(),"hello");
  1714. return self}, function($ctx1) {$ctx1.fill(self,"testPropertyThatReturnsEmptyString",{object:object},smalltalk.JSObjectProxyTest)})},
  1715. messageSends: ["jsObject", "assert:equals:", "d", "d:"]}),
  1716. smalltalk.JSObjectProxyTest);
  1717. smalltalk.addMethod(
  1718. "_testPropertyThatReturnsUndefined",
  1719. smalltalk.method({
  1720. selector: "testPropertyThatReturnsUndefined",
  1721. fn: function (){
  1722. var self=this;
  1723. var object;
  1724. return smalltalk.withContext(function($ctx1) { object=_st(self)._jsObject();
  1725. _st(self)._shouldnt_raise_((function(){
  1726. return smalltalk.withContext(function($ctx2) { return _st(object)._e();
  1727. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1728. _st(self)._assert_(_st(_st(object)._e())._isNil());
  1729. return self}, function($ctx1) {$ctx1.fill(self,"testPropertyThatReturnsUndefined",{object:object},smalltalk.JSObjectProxyTest)})},
  1730. messageSends: ["jsObject", "shouldnt:raise:", "e", "assert:", "isNil"]}),
  1731. smalltalk.JSObjectProxyTest);
  1732. smalltalk.addMethod(
  1733. "_testValue",
  1734. smalltalk.method({
  1735. selector: "testValue",
  1736. fn: function (){
  1737. var self=this;
  1738. var testObject;
  1739. return smalltalk.withContext(function($ctx1) { testObject=_st(self)._jsObject();
  1740. _st(self)._assert_equals_(_st(_st(testObject)._value())._printString(),"[object Object]");
  1741. _st(testObject)._at_put_("value","aValue");
  1742. _st(self)._assert_equals_(_st(testObject)._value(),"aValue");
  1743. return self}, function($ctx1) {$ctx1.fill(self,"testValue",{testObject:testObject},smalltalk.JSObjectProxyTest)})},
  1744. messageSends: ["jsObject", "assert:equals:", "printString", "value", "at:put:"]}),
  1745. smalltalk.JSObjectProxyTest);
  1746. smalltalk.addMethod(
  1747. "_testYourself",
  1748. smalltalk.method({
  1749. selector: "testYourself",
  1750. fn: function (){
  1751. var self=this;
  1752. var object;
  1753. return smalltalk.withContext(function($ctx1) { var $1,$2;
  1754. $1=_st(self)._jsObject();
  1755. _st($1)._d_("test");
  1756. $2=_st($1)._yourself();
  1757. object=$2;
  1758. _st(self)._assert_equals_(_st(object)._d(),"test");
  1759. return self}, function($ctx1) {$ctx1.fill(self,"testYourself",{object:object},smalltalk.JSObjectProxyTest)})},
  1760. messageSends: ["d:", "jsObject", "yourself", "assert:equals:", "d"]}),
  1761. smalltalk.JSObjectProxyTest);
  1762. smalltalk.addClass('JavaScriptExceptionTest', smalltalk.TestCase, [], 'Kernel-Tests');
  1763. smalltalk.addMethod(
  1764. "_testCatchingException",
  1765. smalltalk.method({
  1766. selector: "testCatchingException",
  1767. fn: function (){
  1768. var self=this;
  1769. return smalltalk.withContext(function($ctx1) { _st((function(){
  1770. return smalltalk.withContext(function($ctx2) { return _st(self)._throwException();
  1771. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_((smalltalk.Error || Error),(function(error){
  1772. return smalltalk.withContext(function($ctx2) { return _st(self)._assert_(_st(_st(error)._exception()).__eq("test"));
  1773. }, function($ctx2) {$ctx2.fillBlock({error:error},$ctx1)})}));
  1774. return self}, function($ctx1) {$ctx1.fill(self,"testCatchingException",{},smalltalk.JavaScriptExceptionTest)})},
  1775. messageSends: ["on:do:", "assert:", "=", "exception", "throwException"]}),
  1776. smalltalk.JavaScriptExceptionTest);
  1777. smalltalk.addMethod(
  1778. "_testRaisingException",
  1779. smalltalk.method({
  1780. selector: "testRaisingException",
  1781. fn: function (){
  1782. var self=this;
  1783. return smalltalk.withContext(function($ctx1) { _st(self)._should_raise_((function(){
  1784. return smalltalk.withContext(function($ctx2) { return _st(self)._throwException();
  1785. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.JavaScriptException || JavaScriptException));
  1786. return self}, function($ctx1) {$ctx1.fill(self,"testRaisingException",{},smalltalk.JavaScriptExceptionTest)})},
  1787. messageSends: ["should:raise:", "throwException"]}),
  1788. smalltalk.JavaScriptExceptionTest);
  1789. smalltalk.addMethod(
  1790. "_throwException",
  1791. smalltalk.method({
  1792. selector: "throwException",
  1793. fn: function (){
  1794. var self=this;
  1795. return smalltalk.withContext(function($ctx1) { throw 'test';
  1796. return self}, function($ctx1) {$ctx1.fill(self,"throwException",{},smalltalk.JavaScriptExceptionTest)})},
  1797. messageSends: []}),
  1798. smalltalk.JavaScriptExceptionTest);
  1799. smalltalk.addClass('NumberTest', smalltalk.TestCase, [], 'Kernel-Tests');
  1800. smalltalk.addMethod(
  1801. "_testAbs",
  1802. smalltalk.method({
  1803. selector: "testAbs",
  1804. fn: function (){
  1805. var self=this;
  1806. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st((4))._abs(),(4));
  1807. _st(self)._assert_equals_(_st((-4))._abs(),(4));
  1808. return self}, function($ctx1) {$ctx1.fill(self,"testAbs",{},smalltalk.NumberTest)})},
  1809. messageSends: ["assert:equals:", "abs"]}),
  1810. smalltalk.NumberTest);
  1811. smalltalk.addMethod(
  1812. "_testArithmetic",
  1813. smalltalk.method({
  1814. selector: "testArithmetic",
  1815. fn: function (){
  1816. var self=this;
  1817. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st((1.5)).__plus((1)),(2.5));
  1818. _st(self)._assert_equals_(_st((2)).__minus((1)),(1));
  1819. _st(self)._assert_equals_(_st((-2)).__minus((1)),(-3));
  1820. _st(self)._assert_equals_(_st((12)).__slash((2)),(6));
  1821. _st(self)._assert_equals_(_st((3)).__star((4)),(12));
  1822. _st(self)._assert_equals_(_st(_st((1)).__plus((2))).__star((3)),(9));
  1823. _st(self)._assert_equals_(_st((1)).__plus(_st((2)).__star((3))),(7));
  1824. return self}, function($ctx1) {$ctx1.fill(self,"testArithmetic",{},smalltalk.NumberTest)})},
  1825. messageSends: ["assert:equals:", "+", "-", "/", "*"]}),
  1826. smalltalk.NumberTest);
  1827. smalltalk.addMethod(
  1828. "_testComparison",
  1829. smalltalk.method({
  1830. selector: "testComparison",
  1831. fn: function (){
  1832. var self=this;
  1833. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st((3)).__gt((2)));
  1834. _st(self)._assert_(_st((2)).__lt((3)));
  1835. _st(self)._deny_(_st((3)).__lt((2)));
  1836. _st(self)._deny_(_st((2)).__gt((3)));
  1837. _st(self)._assert_(_st((3)).__gt_eq((3)));
  1838. _st(self)._assert_(_st((3.1)).__gt_eq((3)));
  1839. _st(self)._assert_(_st((3)).__lt_eq((3)));
  1840. _st(self)._assert_(_st((3)).__lt_eq((3.1)));
  1841. return self}, function($ctx1) {$ctx1.fill(self,"testComparison",{},smalltalk.NumberTest)})},
  1842. messageSends: ["assert:", ">", "<", "deny:", ">=", "<="]}),
  1843. smalltalk.NumberTest);
  1844. smalltalk.addMethod(
  1845. "_testCopying",
  1846. smalltalk.method({
  1847. selector: "testCopying",
  1848. fn: function (){
  1849. var self=this;
  1850. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(_st((1))._copy()).__eq_eq((1)));
  1851. _st(self)._assert_(_st(_st((1))._deepCopy()).__eq_eq((1)));
  1852. return self}, function($ctx1) {$ctx1.fill(self,"testCopying",{},smalltalk.NumberTest)})},
  1853. messageSends: ["assert:", "==", "copy", "deepCopy"]}),
  1854. smalltalk.NumberTest);
  1855. smalltalk.addMethod(
  1856. "_testEquality",
  1857. smalltalk.method({
  1858. selector: "testEquality",
  1859. fn: function (){
  1860. var self=this;
  1861. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st((1)).__eq((1)));
  1862. _st(self)._assert_(_st((0)).__eq((0)));
  1863. _st(self)._deny_(_st((1)).__eq((0)));
  1864. _st(self)._assert_(_st(_st((1))._yourself()).__eq((1)));
  1865. _st(self)._assert_(_st((1)).__eq(_st((1))._yourself()));
  1866. _st(self)._assert_(_st(_st((1))._yourself()).__eq(_st((1))._yourself()));
  1867. _st(self)._deny_(_st((0)).__eq(false));
  1868. _st(self)._deny_(_st(false).__eq((0)));
  1869. _st(self)._deny_(_st("").__eq((0)));
  1870. _st(self)._deny_(_st((0)).__eq(""));
  1871. return self}, function($ctx1) {$ctx1.fill(self,"testEquality",{},smalltalk.NumberTest)})},
  1872. messageSends: ["assert:", "=", "deny:", "yourself"]}),
  1873. smalltalk.NumberTest);
  1874. smalltalk.addMethod(
  1875. "_testHexNumbers",
  1876. smalltalk.method({
  1877. selector: "testHexNumbers",
  1878. fn: function (){
  1879. var self=this;
  1880. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_((9),(9));
  1881. _st(self)._assert_equals_(_st((10))._truncated(),(10));
  1882. _st(self)._assert_equals_(_st((11))._truncated(),(11));
  1883. _st(self)._assert_equals_(_st((12))._truncated(),(12));
  1884. _st(self)._assert_equals_(_st((13))._truncated(),(13));
  1885. _st(self)._assert_equals_(_st((14))._truncated(),(14));
  1886. _st(self)._assert_equals_(_st((15))._truncated(),(15));
  1887. return self}, function($ctx1) {$ctx1.fill(self,"testHexNumbers",{},smalltalk.NumberTest)})},
  1888. messageSends: ["assert:equals:", "truncated"]}),
  1889. smalltalk.NumberTest);
  1890. smalltalk.addMethod(
  1891. "_testIdentity",
  1892. smalltalk.method({
  1893. selector: "testIdentity",
  1894. fn: function (){
  1895. var self=this;
  1896. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st((1)).__eq_eq((1)));
  1897. _st(self)._assert_(_st((0)).__eq_eq((0)));
  1898. _st(self)._deny_(_st((1)).__eq_eq((0)));
  1899. _st(self)._assert_(_st(_st((1))._yourself()).__eq_eq((1)));
  1900. _st(self)._assert_(_st((1)).__eq_eq(_st((1))._yourself()));
  1901. _st(self)._assert_(_st(_st((1))._yourself()).__eq_eq(_st((1))._yourself()));
  1902. _st(self)._deny_(_st((1)).__eq_eq((2)));
  1903. return self}, function($ctx1) {$ctx1.fill(self,"testIdentity",{},smalltalk.NumberTest)})},
  1904. messageSends: ["assert:", "==", "deny:", "yourself"]}),
  1905. smalltalk.NumberTest);
  1906. smalltalk.addMethod(
  1907. "_testInvalidHexNumbers",
  1908. smalltalk.method({
  1909. selector: "testInvalidHexNumbers",
  1910. fn: function (){
  1911. var self=this;
  1912. return smalltalk.withContext(function($ctx1) { _st(self)._should_raise_((function(){
  1913. return smalltalk.withContext(function($ctx2) { return _st((16))._rG();
  1914. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1915. _st(self)._should_raise_((function(){
  1916. return smalltalk.withContext(function($ctx2) { return _st((16))._rg();
  1917. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1918. _st(self)._should_raise_((function(){
  1919. return smalltalk.withContext(function($ctx2) { return _st((16))._rH();
  1920. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1921. _st(self)._should_raise_((function(){
  1922. return smalltalk.withContext(function($ctx2) { return _st((16))._rh();
  1923. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1924. _st(self)._should_raise_((function(){
  1925. return smalltalk.withContext(function($ctx2) { return _st((16))._rI();
  1926. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1927. _st(self)._should_raise_((function(){
  1928. return smalltalk.withContext(function($ctx2) { return _st((16))._ri();
  1929. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1930. _st(self)._should_raise_((function(){
  1931. return smalltalk.withContext(function($ctx2) { return _st((16))._rJ();
  1932. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1933. _st(self)._should_raise_((function(){
  1934. return smalltalk.withContext(function($ctx2) { return _st((16))._rj();
  1935. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1936. _st(self)._should_raise_((function(){
  1937. return smalltalk.withContext(function($ctx2) { return _st((16))._rK();
  1938. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1939. _st(self)._should_raise_((function(){
  1940. return smalltalk.withContext(function($ctx2) { return _st((16))._rk();
  1941. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1942. _st(self)._should_raise_((function(){
  1943. return smalltalk.withContext(function($ctx2) { return _st((16))._rL();
  1944. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1945. _st(self)._should_raise_((function(){
  1946. return smalltalk.withContext(function($ctx2) { return _st((16))._rl();
  1947. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1948. _st(self)._should_raise_((function(){
  1949. return smalltalk.withContext(function($ctx2) { return _st((16))._rM();
  1950. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1951. _st(self)._should_raise_((function(){
  1952. return smalltalk.withContext(function($ctx2) { return _st((16))._rm();
  1953. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1954. _st(self)._should_raise_((function(){
  1955. return smalltalk.withContext(function($ctx2) { return _st((16))._rN();
  1956. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1957. _st(self)._should_raise_((function(){
  1958. return smalltalk.withContext(function($ctx2) { return _st((16))._rn();
  1959. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1960. _st(self)._should_raise_((function(){
  1961. return smalltalk.withContext(function($ctx2) { return _st((16))._rO();
  1962. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1963. _st(self)._should_raise_((function(){
  1964. return smalltalk.withContext(function($ctx2) { return _st((16))._ro();
  1965. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1966. _st(self)._should_raise_((function(){
  1967. return smalltalk.withContext(function($ctx2) { return _st((16))._rP();
  1968. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1969. _st(self)._should_raise_((function(){
  1970. return smalltalk.withContext(function($ctx2) { return _st((16))._rp();
  1971. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1972. _st(self)._should_raise_((function(){
  1973. return smalltalk.withContext(function($ctx2) { return _st((16))._rQ();
  1974. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1975. _st(self)._should_raise_((function(){
  1976. return smalltalk.withContext(function($ctx2) { return _st((16))._rq();
  1977. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1978. _st(self)._should_raise_((function(){
  1979. return smalltalk.withContext(function($ctx2) { return _st((16))._rR();
  1980. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1981. _st(self)._should_raise_((function(){
  1982. return smalltalk.withContext(function($ctx2) { return _st((16))._rr();
  1983. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1984. _st(self)._should_raise_((function(){
  1985. return smalltalk.withContext(function($ctx2) { return _st((16))._rS();
  1986. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1987. _st(self)._should_raise_((function(){
  1988. return smalltalk.withContext(function($ctx2) { return _st((16))._rs();
  1989. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1990. _st(self)._should_raise_((function(){
  1991. return smalltalk.withContext(function($ctx2) { return _st((16))._rT();
  1992. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1993. _st(self)._should_raise_((function(){
  1994. return smalltalk.withContext(function($ctx2) { return _st((16))._rt();
  1995. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1996. _st(self)._should_raise_((function(){
  1997. return smalltalk.withContext(function($ctx2) { return _st((16))._rU();
  1998. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  1999. _st(self)._should_raise_((function(){
  2000. return smalltalk.withContext(function($ctx2) { return _st((16))._ru();
  2001. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2002. _st(self)._should_raise_((function(){
  2003. return smalltalk.withContext(function($ctx2) { return _st((16))._rV();
  2004. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2005. _st(self)._should_raise_((function(){
  2006. return smalltalk.withContext(function($ctx2) { return _st((16))._rv();
  2007. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2008. _st(self)._should_raise_((function(){
  2009. return smalltalk.withContext(function($ctx2) { return _st((16))._rW();
  2010. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2011. _st(self)._should_raise_((function(){
  2012. return smalltalk.withContext(function($ctx2) { return _st((16))._rw();
  2013. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2014. _st(self)._should_raise_((function(){
  2015. return smalltalk.withContext(function($ctx2) { return _st((16))._rX();
  2016. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2017. _st(self)._should_raise_((function(){
  2018. return smalltalk.withContext(function($ctx2) { return _st((16))._rx();
  2019. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2020. _st(self)._should_raise_((function(){
  2021. return smalltalk.withContext(function($ctx2) { return _st((16))._rY();
  2022. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2023. _st(self)._should_raise_((function(){
  2024. return smalltalk.withContext(function($ctx2) { return _st((16))._ry();
  2025. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2026. _st(self)._should_raise_((function(){
  2027. return smalltalk.withContext(function($ctx2) { return _st((16))._rZ();
  2028. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2029. _st(self)._should_raise_((function(){
  2030. return smalltalk.withContext(function($ctx2) { return _st((16))._rz();
  2031. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2032. _st(self)._should_raise_((function(){
  2033. return smalltalk.withContext(function($ctx2) { return _st((11259375))._Z();
  2034. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2035. return self}, function($ctx1) {$ctx1.fill(self,"testInvalidHexNumbers",{},smalltalk.NumberTest)})},
  2036. 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"]}),
  2037. smalltalk.NumberTest);
  2038. smalltalk.addMethod(
  2039. "_testMinMax",
  2040. smalltalk.method({
  2041. selector: "testMinMax",
  2042. fn: function (){
  2043. var self=this;
  2044. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st((2))._max_((5)),(5));
  2045. _st(self)._assert_equals_(_st((2))._min_((5)),(2));
  2046. return self}, function($ctx1) {$ctx1.fill(self,"testMinMax",{},smalltalk.NumberTest)})},
  2047. messageSends: ["assert:equals:", "max:", "min:"]}),
  2048. smalltalk.NumberTest);
  2049. smalltalk.addMethod(
  2050. "_testNegated",
  2051. smalltalk.method({
  2052. selector: "testNegated",
  2053. fn: function (){
  2054. var self=this;
  2055. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st((3))._negated(),(-3));
  2056. _st(self)._assert_equals_(_st((-3))._negated(),(3));
  2057. return self}, function($ctx1) {$ctx1.fill(self,"testNegated",{},smalltalk.NumberTest)})},
  2058. messageSends: ["assert:equals:", "negated"]}),
  2059. smalltalk.NumberTest);
  2060. smalltalk.addMethod(
  2061. "_testPrintShowingDecimalPlaces",
  2062. smalltalk.method({
  2063. selector: "testPrintShowingDecimalPlaces",
  2064. fn: function (){
  2065. var self=this;
  2066. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st((23))._printShowingDecimalPlaces_((2)),"23.00");
  2067. _st(self)._assert_equals_(_st((23.5698))._printShowingDecimalPlaces_((2)),"23.57");
  2068. _st(self)._assert_equals_(_st(_st((234.567))._negated())._printShowingDecimalPlaces_((5)),"-234.56700");
  2069. _st(self)._assert_equals_(_st((23.4567))._printShowingDecimalPlaces_((0)),"23");
  2070. _st(self)._assert_equals_(_st((23.5567))._printShowingDecimalPlaces_((0)),"24");
  2071. _st(self)._assert_equals_(_st(_st((23.4567))._negated())._printShowingDecimalPlaces_((0)),"-23");
  2072. _st(self)._assert_equals_(_st(_st((23.5567))._negated())._printShowingDecimalPlaces_((0)),"-24");
  2073. _st(self)._assert_equals_(_st((100000000))._printShowingDecimalPlaces_((1)),"100000000.0");
  2074. _st(self)._assert_equals_(_st((0.98))._printShowingDecimalPlaces_((5)),"0.98000");
  2075. _st(self)._assert_equals_(_st(_st((0.98))._negated())._printShowingDecimalPlaces_((2)),"-0.98");
  2076. _st(self)._assert_equals_(_st((2.567))._printShowingDecimalPlaces_((2)),"2.57");
  2077. _st(self)._assert_equals_(_st((-2.567))._printShowingDecimalPlaces_((2)),"-2.57");
  2078. _st(self)._assert_equals_(_st((0))._printShowingDecimalPlaces_((2)),"0.00");
  2079. return self}, function($ctx1) {$ctx1.fill(self,"testPrintShowingDecimalPlaces",{},smalltalk.NumberTest)})},
  2080. messageSends: ["assert:equals:", "printShowingDecimalPlaces:", "negated"]}),
  2081. smalltalk.NumberTest);
  2082. smalltalk.addMethod(
  2083. "_testRounded",
  2084. smalltalk.method({
  2085. selector: "testRounded",
  2086. fn: function (){
  2087. var self=this;
  2088. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st((3))._rounded(),(3));
  2089. _st(self)._assert_equals_(_st((3.212))._rounded(),(3));
  2090. _st(self)._assert_equals_(_st((3.51))._rounded(),(4));
  2091. return self}, function($ctx1) {$ctx1.fill(self,"testRounded",{},smalltalk.NumberTest)})},
  2092. messageSends: ["assert:equals:", "rounded"]}),
  2093. smalltalk.NumberTest);
  2094. smalltalk.addMethod(
  2095. "_testSqrt",
  2096. smalltalk.method({
  2097. selector: "testSqrt",
  2098. fn: function (){
  2099. var self=this;
  2100. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st((4))._sqrt(),(2));
  2101. _st(self)._assert_equals_(_st((16))._sqrt(),(4));
  2102. return self}, function($ctx1) {$ctx1.fill(self,"testSqrt",{},smalltalk.NumberTest)})},
  2103. messageSends: ["assert:equals:", "sqrt"]}),
  2104. smalltalk.NumberTest);
  2105. smalltalk.addMethod(
  2106. "_testSquared",
  2107. smalltalk.method({
  2108. selector: "testSquared",
  2109. fn: function (){
  2110. var self=this;
  2111. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st((4))._squared(),(16));
  2112. return self}, function($ctx1) {$ctx1.fill(self,"testSquared",{},smalltalk.NumberTest)})},
  2113. messageSends: ["assert:equals:", "squared"]}),
  2114. smalltalk.NumberTest);
  2115. smalltalk.addMethod(
  2116. "_testTimesRepeat",
  2117. smalltalk.method({
  2118. selector: "testTimesRepeat",
  2119. fn: function (){
  2120. var self=this;
  2121. var i;
  2122. return smalltalk.withContext(function($ctx1) { i=(0);
  2123. _st((0))._timesRepeat_((function(){
  2124. return smalltalk.withContext(function($ctx2) { i=_st(i).__plus((1));
  2125. return i;
  2126. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2127. _st(self)._assert_equals_(i,(0));
  2128. _st((5))._timesRepeat_((function(){
  2129. return smalltalk.withContext(function($ctx2) { i=_st(i).__plus((1));
  2130. return i;
  2131. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2132. _st(self)._assert_equals_(i,(5));
  2133. return self}, function($ctx1) {$ctx1.fill(self,"testTimesRepeat",{i:i},smalltalk.NumberTest)})},
  2134. messageSends: ["timesRepeat:", "+", "assert:equals:"]}),
  2135. smalltalk.NumberTest);
  2136. smalltalk.addMethod(
  2137. "_testTo",
  2138. smalltalk.method({
  2139. selector: "testTo",
  2140. fn: function (){
  2141. var self=this;
  2142. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st((1))._to_((5)),[(1), (2), (3), (4), (5)]);
  2143. return self}, function($ctx1) {$ctx1.fill(self,"testTo",{},smalltalk.NumberTest)})},
  2144. messageSends: ["assert:equals:", "to:"]}),
  2145. smalltalk.NumberTest);
  2146. smalltalk.addMethod(
  2147. "_testToBy",
  2148. smalltalk.method({
  2149. selector: "testToBy",
  2150. fn: function (){
  2151. var self=this;
  2152. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st((0))._to_by_((6),(2)),[(0), (2), (4), (6)]);
  2153. _st(self)._should_raise_((function(){
  2154. return smalltalk.withContext(function($ctx2) { return _st((1))._to_by_((4),(0));
  2155. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
  2156. return self}, function($ctx1) {$ctx1.fill(self,"testToBy",{},smalltalk.NumberTest)})},
  2157. messageSends: ["assert:equals:", "to:by:", "should:raise:"]}),
  2158. smalltalk.NumberTest);
  2159. smalltalk.addMethod(
  2160. "_testTruncated",
  2161. smalltalk.method({
  2162. selector: "testTruncated",
  2163. fn: function (){
  2164. var self=this;
  2165. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st((3))._truncated(),(3));
  2166. _st(self)._assert_equals_(_st((3.212))._truncated(),(3));
  2167. _st(self)._assert_equals_(_st((3.51))._truncated(),(3));
  2168. return self}, function($ctx1) {$ctx1.fill(self,"testTruncated",{},smalltalk.NumberTest)})},
  2169. messageSends: ["assert:equals:", "truncated"]}),
  2170. smalltalk.NumberTest);
  2171. smalltalk.addClass('ObjectMock', smalltalk.Object, ['foo', 'bar'], 'Kernel-Tests');
  2172. smalltalk.addMethod(
  2173. "_foo",
  2174. smalltalk.method({
  2175. selector: "foo",
  2176. fn: function (){
  2177. var self=this;
  2178. return smalltalk.withContext(function($ctx1) { var $1;
  2179. $1=self["@foo"];
  2180. return $1;
  2181. }, function($ctx1) {$ctx1.fill(self,"foo",{},smalltalk.ObjectMock)})},
  2182. messageSends: []}),
  2183. smalltalk.ObjectMock);
  2184. smalltalk.addMethod(
  2185. "_foo_",
  2186. smalltalk.method({
  2187. selector: "foo:",
  2188. fn: function (anObject){
  2189. var self=this;
  2190. return smalltalk.withContext(function($ctx1) { self["@foo"]=anObject;
  2191. return self}, function($ctx1) {$ctx1.fill(self,"foo:",{anObject:anObject},smalltalk.ObjectMock)})},
  2192. messageSends: []}),
  2193. smalltalk.ObjectMock);
  2194. smalltalk.addClass('ObjectTest', smalltalk.TestCase, [], 'Kernel-Tests');
  2195. smalltalk.addMethod(
  2196. "_notDefined",
  2197. smalltalk.method({
  2198. selector: "notDefined",
  2199. fn: function (){
  2200. var self=this;
  2201. return smalltalk.withContext(function($ctx1) { return undefined;;
  2202. return self}, function($ctx1) {$ctx1.fill(self,"notDefined",{},smalltalk.ObjectTest)})},
  2203. messageSends: []}),
  2204. smalltalk.ObjectTest);
  2205. smalltalk.addMethod(
  2206. "_testBasicAccess",
  2207. smalltalk.method({
  2208. selector: "testBasicAccess",
  2209. fn: function (){
  2210. var self=this;
  2211. var o;
  2212. return smalltalk.withContext(function($ctx1) { o=_st((smalltalk.Object || Object))._new();
  2213. _st(o)._basicAt_put_("a",(1));
  2214. _st(self)._assert_equals_(_st(o)._basicAt_("a"),(1));
  2215. _st(self)._assert_equals_(_st(o)._basicAt_("b"),nil);
  2216. return self}, function($ctx1) {$ctx1.fill(self,"testBasicAccess",{o:o},smalltalk.ObjectTest)})},
  2217. messageSends: ["new", "basicAt:put:", "assert:equals:", "basicAt:"]}),
  2218. smalltalk.ObjectTest);
  2219. smalltalk.addMethod(
  2220. "_testBasicPerform",
  2221. smalltalk.method({
  2222. selector: "testBasicPerform",
  2223. fn: function (){
  2224. var self=this;
  2225. var o;
  2226. return smalltalk.withContext(function($ctx1) { o=_st((smalltalk.Object || Object))._new();
  2227. _st(o)._basicAt_put_("func",(function(){
  2228. return smalltalk.withContext(function($ctx2) { return "hello";
  2229. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2230. _st(o)._basicAt_put_("func2",(function(a){
  2231. return smalltalk.withContext(function($ctx2) { return _st(a).__plus((1));
  2232. }, function($ctx2) {$ctx2.fillBlock({a:a},$ctx1)})}));
  2233. _st(self)._assert_equals_(_st(o)._basicPerform_("func"),"hello");
  2234. _st(self)._assert_equals_(_st(o)._basicPerform_withArguments_("func2",[(3)]),(4));
  2235. return self}, function($ctx1) {$ctx1.fill(self,"testBasicPerform",{o:o},smalltalk.ObjectTest)})},
  2236. messageSends: ["new", "basicAt:put:", "+", "assert:equals:", "basicPerform:", "basicPerform:withArguments:"]}),
  2237. smalltalk.ObjectTest);
  2238. smalltalk.addMethod(
  2239. "_testDNU",
  2240. smalltalk.method({
  2241. selector: "testDNU",
  2242. fn: function (){
  2243. var self=this;
  2244. return smalltalk.withContext(function($ctx1) { _st(self)._should_raise_((function(){
  2245. return smalltalk.withContext(function($ctx2) { return _st(_st((smalltalk.Object || Object))._new())._foo();
  2246. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
  2247. return self}, function($ctx1) {$ctx1.fill(self,"testDNU",{},smalltalk.ObjectTest)})},
  2248. messageSends: ["should:raise:", "foo", "new"]}),
  2249. smalltalk.ObjectTest);
  2250. smalltalk.addMethod(
  2251. "_testEquality",
  2252. smalltalk.method({
  2253. selector: "testEquality",
  2254. fn: function (){
  2255. var self=this;
  2256. var o;
  2257. return smalltalk.withContext(function($ctx1) { o=_st((smalltalk.Object || Object))._new();
  2258. _st(self)._deny_(_st(o).__eq(_st((smalltalk.Object || Object))._new()));
  2259. _st(self)._assert_(_st(o).__eq(o));
  2260. _st(self)._assert_(_st(_st(o)._yourself()).__eq(o));
  2261. _st(self)._assert_(_st(o).__eq(_st(o)._yourself()));
  2262. return self}, function($ctx1) {$ctx1.fill(self,"testEquality",{o:o},smalltalk.ObjectTest)})},
  2263. messageSends: ["new", "deny:", "=", "assert:", "yourself"]}),
  2264. smalltalk.ObjectTest);
  2265. smalltalk.addMethod(
  2266. "_testHalt",
  2267. smalltalk.method({
  2268. selector: "testHalt",
  2269. fn: function (){
  2270. var self=this;
  2271. return smalltalk.withContext(function($ctx1) { _st(self)._should_raise_((function(){
  2272. return smalltalk.withContext(function($ctx2) { return _st(_st((smalltalk.Object || Object))._new())._halt();
  2273. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
  2274. return self}, function($ctx1) {$ctx1.fill(self,"testHalt",{},smalltalk.ObjectTest)})},
  2275. messageSends: ["should:raise:", "halt", "new"]}),
  2276. smalltalk.ObjectTest);
  2277. smalltalk.addMethod(
  2278. "_testIdentity",
  2279. smalltalk.method({
  2280. selector: "testIdentity",
  2281. fn: function (){
  2282. var self=this;
  2283. var o;
  2284. return smalltalk.withContext(function($ctx1) { o=_st((smalltalk.Object || Object))._new();
  2285. _st(self)._deny_(_st(o).__eq_eq(_st((smalltalk.Object || Object))._new()));
  2286. _st(self)._assert_(_st(o).__eq_eq(o));
  2287. _st(self)._assert_(_st(_st(o)._yourself()).__eq_eq(o));
  2288. _st(self)._assert_(_st(o).__eq_eq(_st(o)._yourself()));
  2289. return self}, function($ctx1) {$ctx1.fill(self,"testIdentity",{o:o},smalltalk.ObjectTest)})},
  2290. messageSends: ["new", "deny:", "==", "assert:", "yourself"]}),
  2291. smalltalk.ObjectTest);
  2292. smalltalk.addMethod(
  2293. "_testIfNil",
  2294. smalltalk.method({
  2295. selector: "testIfNil",
  2296. fn: function (){
  2297. var self=this;
  2298. return smalltalk.withContext(function($ctx1) { var $1,$4,$3,$2,$5,$7,$6,$8,$10,$9;
  2299. _st(self)._deny_(_st(_st((smalltalk.Object || Object))._new())._isNil());
  2300. $1=self;
  2301. $4=_st((smalltalk.Object || Object))._new();
  2302. if(($receiver = $4) == nil || $receiver == undefined){
  2303. $3=true;
  2304. } else {
  2305. $3=$4;
  2306. };
  2307. $2=_st($3).__eq(true);
  2308. _st($1)._deny_($2);
  2309. $5=self;
  2310. $7=_st((smalltalk.Object || Object))._new();
  2311. if(($receiver = $7) == nil || $receiver == undefined){
  2312. $6=$7;
  2313. } else {
  2314. $6=true;
  2315. };
  2316. _st($5)._assert_equals_($6,true);
  2317. $8=self;
  2318. $10=_st((smalltalk.Object || Object))._new();
  2319. if(($receiver = $10) == nil || $receiver == undefined){
  2320. $9=false;
  2321. } else {
  2322. $9=true;
  2323. };
  2324. _st($8)._assert_equals_($9,true);
  2325. _st(self)._assert_equals_(_st(_st((smalltalk.Object || Object))._new())._ifNotNil_ifNil_((function(){
  2326. return smalltalk.withContext(function($ctx2) { return true;
  2327. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(function(){
  2328. return smalltalk.withContext(function($ctx2) { return false;
  2329. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),true);
  2330. return self}, function($ctx1) {$ctx1.fill(self,"testIfNil",{},smalltalk.ObjectTest)})},
  2331. messageSends: ["deny:", "isNil", "new", "=", "ifNil:", "assert:equals:", "ifNotNil:", "ifNil:ifNotNil:", "ifNotNil:ifNil:"]}),
  2332. smalltalk.ObjectTest);
  2333. smalltalk.addMethod(
  2334. "_testInstVars",
  2335. smalltalk.method({
  2336. selector: "testInstVars",
  2337. fn: function (){
  2338. var self=this;
  2339. var o;
  2340. return smalltalk.withContext(function($ctx1) { o=_st((smalltalk.ObjectMock || ObjectMock))._new();
  2341. _st(self)._assert_equals_(_st(o)._instVarAt_(smalltalk.symbolFor("foo")),nil);
  2342. _st(o)._instVarAt_put_(smalltalk.symbolFor("foo"),(1));
  2343. _st(self)._assert_equals_(_st(o)._instVarAt_(smalltalk.symbolFor("foo")),(1));
  2344. _st(self)._assert_equals_(_st(o)._instVarAt_("foo"),(1));
  2345. return self}, function($ctx1) {$ctx1.fill(self,"testInstVars",{o:o},smalltalk.ObjectTest)})},
  2346. messageSends: ["new", "assert:equals:", "instVarAt:", "instVarAt:put:"]}),
  2347. smalltalk.ObjectTest);
  2348. smalltalk.addMethod(
  2349. "_testNilUndefined",
  2350. smalltalk.method({
  2351. selector: "testNilUndefined",
  2352. fn: function (){
  2353. var self=this;
  2354. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(self)._notDefined(),nil);
  2355. return self}, function($ctx1) {$ctx1.fill(self,"testNilUndefined",{},smalltalk.ObjectTest)})},
  2356. messageSends: ["assert:equals:", "notDefined"]}),
  2357. smalltalk.ObjectTest);
  2358. smalltalk.addMethod(
  2359. "_testYourself",
  2360. smalltalk.method({
  2361. selector: "testYourself",
  2362. fn: function (){
  2363. var self=this;
  2364. var o;
  2365. return smalltalk.withContext(function($ctx1) { o=_st((smalltalk.ObjectMock || ObjectMock))._new();
  2366. _st(self)._assert_(_st(_st(o)._yourself()).__eq_eq(o));
  2367. return self}, function($ctx1) {$ctx1.fill(self,"testYourself",{o:o},smalltalk.ObjectTest)})},
  2368. messageSends: ["new", "assert:", "==", "yourself"]}),
  2369. smalltalk.ObjectTest);
  2370. smalltalk.addMethod(
  2371. "_testidentityHash",
  2372. smalltalk.method({
  2373. selector: "testidentityHash",
  2374. fn: function (){
  2375. var self=this;
  2376. var o1,o2;
  2377. return smalltalk.withContext(function($ctx1) { o1=_st((smalltalk.Object || Object))._new();
  2378. o2=_st((smalltalk.Object || Object))._new();
  2379. _st(self)._assert_(_st(_st(o1)._identityHash()).__eq_eq(_st(o1)._identityHash()));
  2380. _st(self)._deny_(_st(_st(o1)._identityHash()).__eq_eq(_st(o2)._identityHash()));
  2381. return self}, function($ctx1) {$ctx1.fill(self,"testidentityHash",{o1:o1,o2:o2},smalltalk.ObjectTest)})},
  2382. messageSends: ["new", "assert:", "==", "identityHash", "deny:"]}),
  2383. smalltalk.ObjectTest);
  2384. smalltalk.addClass('PackageTest', smalltalk.TestCase, ['zorkPackage', 'grulPackage', 'backUpCommitPathJs', 'backUpCommitPathSt'], 'Kernel-Tests');
  2385. smalltalk.addMethod(
  2386. "_setUp",
  2387. smalltalk.method({
  2388. selector: "setUp",
  2389. fn: function (){
  2390. var self=this;
  2391. return smalltalk.withContext(function($ctx1) { var $1,$2;
  2392. self["@backUpCommitPathJs"]=_st((smalltalk.Package || Package))._defaultCommitPathJs();
  2393. self["@backUpCommitPathSt"]=_st((smalltalk.Package || Package))._defaultCommitPathSt();
  2394. _st((smalltalk.Package || Package))._resetCommitPaths();
  2395. self["@zorkPackage"]=_st(_st((smalltalk.Package || Package))._new())._name_("Zork");
  2396. $1=_st((smalltalk.Package || Package))._new();
  2397. _st($1)._name_("Grul");
  2398. _st($1)._commitPathJs_("server/grul/js");
  2399. _st($1)._commitPathSt_("grul/st");
  2400. $2=_st($1)._yourself();
  2401. self["@grulPackage"]=$2;
  2402. return self}, function($ctx1) {$ctx1.fill(self,"setUp",{},smalltalk.PackageTest)})},
  2403. messageSends: ["defaultCommitPathJs", "defaultCommitPathSt", "resetCommitPaths", "name:", "new", "commitPathJs:", "commitPathSt:", "yourself"]}),
  2404. smalltalk.PackageTest);
  2405. smalltalk.addMethod(
  2406. "_tearDown",
  2407. smalltalk.method({
  2408. selector: "tearDown",
  2409. fn: function (){
  2410. var self=this;
  2411. return smalltalk.withContext(function($ctx1) { var $1,$2;
  2412. $1=(smalltalk.Package || Package);
  2413. _st($1)._defaultCommitPathJs_(self["@backUpCommitPathJs"]);
  2414. $2=_st($1)._defaultCommitPathSt_(self["@backUpCommitPathSt"]);
  2415. return self}, function($ctx1) {$ctx1.fill(self,"tearDown",{},smalltalk.PackageTest)})},
  2416. messageSends: ["defaultCommitPathJs:", "defaultCommitPathSt:"]}),
  2417. smalltalk.PackageTest);
  2418. smalltalk.addMethod(
  2419. "_testGrulCommitPathJsShouldBeServerGrulJs",
  2420. smalltalk.method({
  2421. selector: "testGrulCommitPathJsShouldBeServerGrulJs",
  2422. fn: function (){
  2423. var self=this;
  2424. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(self["@grulPackage"])._commitPathJs(),"server/grul/js");
  2425. return self}, function($ctx1) {$ctx1.fill(self,"testGrulCommitPathJsShouldBeServerGrulJs",{},smalltalk.PackageTest)})},
  2426. messageSends: ["assert:equals:", "commitPathJs"]}),
  2427. smalltalk.PackageTest);
  2428. smalltalk.addMethod(
  2429. "_testGrulCommitPathStShouldBeGrulSt",
  2430. smalltalk.method({
  2431. selector: "testGrulCommitPathStShouldBeGrulSt",
  2432. fn: function (){
  2433. var self=this;
  2434. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(self["@grulPackage"])._commitPathSt(),"grul/st");
  2435. return self}, function($ctx1) {$ctx1.fill(self,"testGrulCommitPathStShouldBeGrulSt",{},smalltalk.PackageTest)})},
  2436. messageSends: ["assert:equals:", "commitPathSt"]}),
  2437. smalltalk.PackageTest);
  2438. smalltalk.addMethod(
  2439. "_testZorkCommitPathJsShouldBeJs",
  2440. smalltalk.method({
  2441. selector: "testZorkCommitPathJsShouldBeJs",
  2442. fn: function (){
  2443. var self=this;
  2444. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(self["@zorkPackage"])._commitPathJs(),"js");
  2445. return self}, function($ctx1) {$ctx1.fill(self,"testZorkCommitPathJsShouldBeJs",{},smalltalk.PackageTest)})},
  2446. messageSends: ["assert:equals:", "commitPathJs"]}),
  2447. smalltalk.PackageTest);
  2448. smalltalk.addMethod(
  2449. "_testZorkCommitPathStShouldBeSt",
  2450. smalltalk.method({
  2451. selector: "testZorkCommitPathStShouldBeSt",
  2452. fn: function (){
  2453. var self=this;
  2454. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(self["@zorkPackage"])._commitPathSt(),"st");
  2455. return self}, function($ctx1) {$ctx1.fill(self,"testZorkCommitPathStShouldBeSt",{},smalltalk.PackageTest)})},
  2456. messageSends: ["assert:equals:", "commitPathSt"]}),
  2457. smalltalk.PackageTest);
  2458. smalltalk.addClass('PackageWithDefaultCommitPathChangedTest', smalltalk.PackageTest, [], 'Kernel-Tests');
  2459. smalltalk.addMethod(
  2460. "_setUp",
  2461. smalltalk.method({
  2462. selector: "setUp",
  2463. fn: function (){
  2464. var self=this;
  2465. return smalltalk.withContext(function($ctx1) { var $1,$2;
  2466. smalltalk.PackageTest.fn.prototype._setUp.apply(_st(self), []);
  2467. $1=(smalltalk.Package || Package);
  2468. _st($1)._defaultCommitPathJs_("javascripts/");
  2469. $2=_st($1)._defaultCommitPathSt_("smalltalk/");
  2470. return self}, function($ctx1) {$ctx1.fill(self,"setUp",{},smalltalk.PackageWithDefaultCommitPathChangedTest)})},
  2471. messageSends: ["setUp", "defaultCommitPathJs:", "defaultCommitPathSt:"]}),
  2472. smalltalk.PackageWithDefaultCommitPathChangedTest);
  2473. smalltalk.addMethod(
  2474. "_testGrulCommitPathJsShouldBeServerGrulJs",
  2475. smalltalk.method({
  2476. selector: "testGrulCommitPathJsShouldBeServerGrulJs",
  2477. fn: function (){
  2478. var self=this;
  2479. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(self["@grulPackage"])._commitPathJs(),"server/grul/js");
  2480. return self}, function($ctx1) {$ctx1.fill(self,"testGrulCommitPathJsShouldBeServerGrulJs",{},smalltalk.PackageWithDefaultCommitPathChangedTest)})},
  2481. messageSends: ["assert:equals:", "commitPathJs"]}),
  2482. smalltalk.PackageWithDefaultCommitPathChangedTest);
  2483. smalltalk.addMethod(
  2484. "_testGrulCommitPathStShouldBeGrulSt",
  2485. smalltalk.method({
  2486. selector: "testGrulCommitPathStShouldBeGrulSt",
  2487. fn: function (){
  2488. var self=this;
  2489. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(self["@grulPackage"])._commitPathSt(),"grul/st");
  2490. return self}, function($ctx1) {$ctx1.fill(self,"testGrulCommitPathStShouldBeGrulSt",{},smalltalk.PackageWithDefaultCommitPathChangedTest)})},
  2491. messageSends: ["assert:equals:", "commitPathSt"]}),
  2492. smalltalk.PackageWithDefaultCommitPathChangedTest);
  2493. smalltalk.addMethod(
  2494. "_testZorkCommitPathJsShouldBeJavascript",
  2495. smalltalk.method({
  2496. selector: "testZorkCommitPathJsShouldBeJavascript",
  2497. fn: function (){
  2498. var self=this;
  2499. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(self["@zorkPackage"])._commitPathJs(),"javascripts/");
  2500. return self}, function($ctx1) {$ctx1.fill(self,"testZorkCommitPathJsShouldBeJavascript",{},smalltalk.PackageWithDefaultCommitPathChangedTest)})},
  2501. messageSends: ["assert:equals:", "commitPathJs"]}),
  2502. smalltalk.PackageWithDefaultCommitPathChangedTest);
  2503. smalltalk.addMethod(
  2504. "_testZorkCommitPathStShouldBeSmalltalk",
  2505. smalltalk.method({
  2506. selector: "testZorkCommitPathStShouldBeSmalltalk",
  2507. fn: function (){
  2508. var self=this;
  2509. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(self["@zorkPackage"])._commitPathSt(),"smalltalk/");
  2510. return self}, function($ctx1) {$ctx1.fill(self,"testZorkCommitPathStShouldBeSmalltalk",{},smalltalk.PackageWithDefaultCommitPathChangedTest)})},
  2511. messageSends: ["assert:equals:", "commitPathSt"]}),
  2512. smalltalk.PackageWithDefaultCommitPathChangedTest);
  2513. smalltalk.addMethod(
  2514. "_shouldInheritSelectors",
  2515. smalltalk.method({
  2516. selector: "shouldInheritSelectors",
  2517. fn: function (){
  2518. var self=this;
  2519. return smalltalk.withContext(function($ctx1) { return false;
  2520. }, function($ctx1) {$ctx1.fill(self,"shouldInheritSelectors",{},smalltalk.PackageWithDefaultCommitPathChangedTest.klass)})},
  2521. messageSends: []}),
  2522. smalltalk.PackageWithDefaultCommitPathChangedTest.klass);
  2523. smalltalk.addClass('PointTest', smalltalk.TestCase, [], 'Kernel-Tests');
  2524. smalltalk.addMethod(
  2525. "_testAccessing",
  2526. smalltalk.method({
  2527. selector: "testAccessing",
  2528. fn: function (){
  2529. var self=this;
  2530. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(_st((smalltalk.Point || Point))._x_y_((3),(4)))._x(),(3));
  2531. _st(self)._assert_equals_(_st(_st((smalltalk.Point || Point))._x_y_((3),(4)))._y(),(4));
  2532. _st(self)._assert_equals_(_st(_st(_st((smalltalk.Point || Point))._new())._x_((3)))._x(),(3));
  2533. _st(self)._assert_equals_(_st(_st(_st((smalltalk.Point || Point))._new())._y_((4)))._y(),(4));
  2534. return self}, function($ctx1) {$ctx1.fill(self,"testAccessing",{},smalltalk.PointTest)})},
  2535. messageSends: ["assert:equals:", "x", "x:y:", "y", "x:", "new", "y:"]}),
  2536. smalltalk.PointTest);
  2537. smalltalk.addMethod(
  2538. "_testArithmetic",
  2539. smalltalk.method({
  2540. selector: "testArithmetic",
  2541. fn: function (){
  2542. var self=this;
  2543. 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)));
  2544. _st(self)._assert_equals_(_st(_st((3)).__at((4))).__plus(_st((3)).__at((4))),_st((smalltalk.Point || Point))._x_y_((6),(8)));
  2545. _st(self)._assert_equals_(_st(_st((3)).__at((4))).__minus(_st((3)).__at((4))),_st((smalltalk.Point || Point))._x_y_((0),(0)));
  2546. _st(self)._assert_equals_(_st(_st((6)).__at((8))).__slash(_st((3)).__at((4))),_st((smalltalk.Point || Point))._x_y_((2),(2)));
  2547. return self}, function($ctx1) {$ctx1.fill(self,"testArithmetic",{},smalltalk.PointTest)})},
  2548. messageSends: ["assert:equals:", "*", "@", "x:y:", "+", "-", "/"]}),
  2549. smalltalk.PointTest);
  2550. smalltalk.addMethod(
  2551. "_testAt",
  2552. smalltalk.method({
  2553. selector: "testAt",
  2554. fn: function (){
  2555. var self=this;
  2556. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st((3)).__at((4)),_st((smalltalk.Point || Point))._x_y_((3),(4)));
  2557. return self}, function($ctx1) {$ctx1.fill(self,"testAt",{},smalltalk.PointTest)})},
  2558. messageSends: ["assert:equals:", "@", "x:y:"]}),
  2559. smalltalk.PointTest);
  2560. smalltalk.addMethod(
  2561. "_testEgality",
  2562. smalltalk.method({
  2563. selector: "testEgality",
  2564. fn: function (){
  2565. var self=this;
  2566. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(_st((3)).__at((4))).__eq(_st((3)).__at((4))));
  2567. _st(self)._deny_(_st(_st((3)).__at((5))).__eq(_st((3)).__at((6))));
  2568. return self}, function($ctx1) {$ctx1.fill(self,"testEgality",{},smalltalk.PointTest)})},
  2569. messageSends: ["assert:", "=", "@", "deny:"]}),
  2570. smalltalk.PointTest);
  2571. smalltalk.addMethod(
  2572. "_testTranslateBy",
  2573. smalltalk.method({
  2574. selector: "testTranslateBy",
  2575. fn: function (){
  2576. var self=this;
  2577. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(_st((3)).__at((3)))._translateBy_(_st((0)).__at((1))),_st((3)).__at((4)));
  2578. _st(self)._assert_equals_(_st(_st((3)).__at((3)))._translateBy_(_st((0)).__at(_st((1))._negated())),_st((3)).__at((2)));
  2579. _st(self)._assert_equals_(_st(_st((3)).__at((3)))._translateBy_(_st((2)).__at((3))),_st((5)).__at((6)));
  2580. _st(self)._assert_equals_(_st(_st((3)).__at((3)))._translateBy_(_st(_st((3))._negated()).__at((0))),_st((0)).__at((3)));
  2581. return self}, function($ctx1) {$ctx1.fill(self,"testTranslateBy",{},smalltalk.PointTest)})},
  2582. messageSends: ["assert:equals:", "translateBy:", "@", "negated"]}),
  2583. smalltalk.PointTest);
  2584. smalltalk.addClass('RandomTest', smalltalk.TestCase, [], 'Kernel-Tests');
  2585. smalltalk.addMethod(
  2586. "_textNext",
  2587. smalltalk.method({
  2588. selector: "textNext",
  2589. fn: function (){
  2590. var self=this;
  2591. return smalltalk.withContext(function($ctx1) { _st((10000))._timesRepeat_((function(){
  2592. var current,next;
  2593. return smalltalk.withContext(function($ctx2) { next=_st(_st((smalltalk.Random || Random))._new())._next();
  2594. next;
  2595. _st(self)._assert_(_st(next).__gt_eq((0)));
  2596. _st(self)._assert_(_st(next).__lt((1)));
  2597. _st(self)._deny_(_st(current).__eq(next));
  2598. return _st(next).__eq(current);
  2599. }, function($ctx2) {$ctx2.fillBlock({current:current,next:next},$ctx1)})}));
  2600. return self}, function($ctx1) {$ctx1.fill(self,"textNext",{},smalltalk.RandomTest)})},
  2601. messageSends: ["timesRepeat:", "next", "new", "assert:", ">=", "<", "deny:", "="]}),
  2602. smalltalk.RandomTest);
  2603. smalltalk.addClass('SetTest', smalltalk.TestCase, [], 'Kernel-Tests');
  2604. smalltalk.addMethod(
  2605. "_testAddRemove",
  2606. smalltalk.method({
  2607. selector: "testAddRemove",
  2608. fn: function (){
  2609. var self=this;
  2610. var set;
  2611. return smalltalk.withContext(function($ctx1) { set=_st((smalltalk.Set || Set))._new();
  2612. _st(self)._assert_(_st(set)._isEmpty());
  2613. _st(set)._add_((3));
  2614. _st(self)._assert_(_st(set)._includes_((3)));
  2615. _st(set)._add_((5));
  2616. _st(self)._assert_(_st(set)._includes_((5)));
  2617. _st(set)._remove_((3));
  2618. _st(self)._deny_(_st(set)._includes_((3)));
  2619. return self}, function($ctx1) {$ctx1.fill(self,"testAddRemove",{set:set},smalltalk.SetTest)})},
  2620. messageSends: ["new", "assert:", "isEmpty", "add:", "includes:", "remove:", "deny:"]}),
  2621. smalltalk.SetTest);
  2622. smalltalk.addMethod(
  2623. "_testAt",
  2624. smalltalk.method({
  2625. selector: "testAt",
  2626. fn: function (){
  2627. var self=this;
  2628. return smalltalk.withContext(function($ctx1) { _st(self)._should_raise_((function(){
  2629. return smalltalk.withContext(function($ctx2) { return _st(_st((smalltalk.Set || Set))._new())._at_put_((1),(2));
  2630. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
  2631. return self}, function($ctx1) {$ctx1.fill(self,"testAt",{},smalltalk.SetTest)})},
  2632. messageSends: ["should:raise:", "at:put:", "new"]}),
  2633. smalltalk.SetTest);
  2634. smalltalk.addMethod(
  2635. "_testCollect",
  2636. smalltalk.method({
  2637. selector: "testCollect",
  2638. fn: function (){
  2639. var self=this;
  2640. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(_st([(5), (6), (8)])._asSet())._collect_((function(x){
  2641. return smalltalk.withContext(function($ctx2) { return _st(x).__backslash_backslash((3));
  2642. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})})),_st([(0), (2)])._asSet());
  2643. return self}, function($ctx1) {$ctx1.fill(self,"testCollect",{},smalltalk.SetTest)})},
  2644. messageSends: ["assert:equals:", "collect:", "\x5c\x5c", "asSet"]}),
  2645. smalltalk.SetTest);
  2646. smalltalk.addMethod(
  2647. "_testComparing",
  2648. smalltalk.method({
  2649. selector: "testComparing",
  2650. fn: function (){
  2651. var self=this;
  2652. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st([(0), (2)])._asSet(),_st([(0), (2)])._asSet());
  2653. _st(self)._assert_equals_(_st([(2), (0)])._asSet(),_st([(0), (2)])._asSet());
  2654. _st(self)._deny_(_st(_st([(0), (2), (3)])._asSet()).__eq(_st([(0), (2)])._asSet()));
  2655. _st(self)._deny_(_st(_st([(1), (2)])._asSet()).__eq(_st([(0), (2)])._asSet()));
  2656. return self}, function($ctx1) {$ctx1.fill(self,"testComparing",{},smalltalk.SetTest)})},
  2657. messageSends: ["assert:equals:", "asSet", "deny:", "="]}),
  2658. smalltalk.SetTest);
  2659. smalltalk.addMethod(
  2660. "_testPrintString",
  2661. smalltalk.method({
  2662. selector: "testPrintString",
  2663. fn: function (){
  2664. var self=this;
  2665. var set;
  2666. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  2667. set=_st((smalltalk.Set || Set))._new();
  2668. _st(self)._assert_equals_(_st(set)._printString(),"a Set ()");
  2669. $1=set;
  2670. _st($1)._add_((1));
  2671. $2=_st($1)._add_((3));
  2672. _st(self)._assert_equals_(_st(set)._printString(),"a Set (1 3)");
  2673. _st(set)._add_("foo");
  2674. _st(self)._assert_equals_(_st(set)._printString(),"a Set (1 3 'foo')");
  2675. $3=set;
  2676. _st($3)._remove_((1));
  2677. $4=_st($3)._remove_((3));
  2678. _st(self)._assert_equals_(_st(set)._printString(),"a Set ('foo')");
  2679. _st(set)._add_((3));
  2680. _st(self)._assert_equals_(_st(set)._printString(),"a Set ('foo' 3)");
  2681. _st(set)._add_((3));
  2682. _st(self)._assert_equals_(_st(set)._printString(),"a Set ('foo' 3)");
  2683. return self}, function($ctx1) {$ctx1.fill(self,"testPrintString",{set:set},smalltalk.SetTest)})},
  2684. messageSends: ["new", "assert:equals:", "printString", "add:", "remove:"]}),
  2685. smalltalk.SetTest);
  2686. smalltalk.addMethod(
  2687. "_testSize",
  2688. smalltalk.method({
  2689. selector: "testSize",
  2690. fn: function (){
  2691. var self=this;
  2692. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(_st((smalltalk.Set || Set))._new())._size(),(0));
  2693. _st(self)._assert_equals_(_st(_st((smalltalk.Set || Set))._withAll_([(1), (2), (3), (4)]))._size(),(4));
  2694. _st(self)._assert_equals_(_st(_st((smalltalk.Set || Set))._withAll_([(1), (1), (1), (1)]))._size(),(1));
  2695. return self}, function($ctx1) {$ctx1.fill(self,"testSize",{},smalltalk.SetTest)})},
  2696. messageSends: ["assert:equals:", "size", "new", "withAll:"]}),
  2697. smalltalk.SetTest);
  2698. smalltalk.addMethod(
  2699. "_testUnicity",
  2700. smalltalk.method({
  2701. selector: "testUnicity",
  2702. fn: function (){
  2703. var self=this;
  2704. var set;
  2705. return smalltalk.withContext(function($ctx1) { set=_st((smalltalk.Set || Set))._new();
  2706. _st(set)._add_((21));
  2707. _st(set)._add_("hello");
  2708. _st(set)._add_((21));
  2709. _st(self)._assert_equals_(_st(set)._size(),(2));
  2710. _st(set)._add_("hello");
  2711. _st(self)._assert_equals_(_st(set)._size(),(2));
  2712. _st(self)._assert_equals_(_st(set)._asArray(),[(21), "hello"]);
  2713. return self}, function($ctx1) {$ctx1.fill(self,"testUnicity",{set:set},smalltalk.SetTest)})},
  2714. messageSends: ["new", "add:", "assert:equals:", "size", "asArray"]}),
  2715. smalltalk.SetTest);
  2716. smalltalk.addClass('StreamTest', smalltalk.TestCase, [], 'Kernel-Tests');
  2717. smalltalk.addMethod(
  2718. "_collectionClass",
  2719. smalltalk.method({
  2720. selector: "collectionClass",
  2721. fn: function (){
  2722. var self=this;
  2723. return smalltalk.withContext(function($ctx1) { var $1;
  2724. $1=_st(_st(self)._class())._collectionClass();
  2725. return $1;
  2726. }, function($ctx1) {$ctx1.fill(self,"collectionClass",{},smalltalk.StreamTest)})},
  2727. messageSends: ["collectionClass", "class"]}),
  2728. smalltalk.StreamTest);
  2729. smalltalk.addMethod(
  2730. "_newCollection",
  2731. smalltalk.method({
  2732. selector: "newCollection",
  2733. fn: function (){
  2734. var self=this;
  2735. return smalltalk.withContext(function($ctx1) { var $1;
  2736. $1=_st(_st(self)._collectionClass())._new();
  2737. return $1;
  2738. }, function($ctx1) {$ctx1.fill(self,"newCollection",{},smalltalk.StreamTest)})},
  2739. messageSends: ["new", "collectionClass"]}),
  2740. smalltalk.StreamTest);
  2741. smalltalk.addMethod(
  2742. "_newStream",
  2743. smalltalk.method({
  2744. selector: "newStream",
  2745. fn: function (){
  2746. var self=this;
  2747. return smalltalk.withContext(function($ctx1) { var $1;
  2748. $1=_st(_st(_st(self)._collectionClass())._new())._stream();
  2749. return $1;
  2750. }, function($ctx1) {$ctx1.fill(self,"newStream",{},smalltalk.StreamTest)})},
  2751. messageSends: ["stream", "new", "collectionClass"]}),
  2752. smalltalk.StreamTest);
  2753. smalltalk.addMethod(
  2754. "_testAtStartAtEnd",
  2755. smalltalk.method({
  2756. selector: "testAtStartAtEnd",
  2757. fn: function (){
  2758. var self=this;
  2759. var stream;
  2760. return smalltalk.withContext(function($ctx1) { stream=_st(self)._newStream();
  2761. _st(self)._assert_(_st(stream)._atStart());
  2762. _st(self)._assert_(_st(stream)._atEnd());
  2763. _st(stream)._nextPutAll_(_st(self)._newCollection());
  2764. _st(self)._assert_(_st(stream)._atEnd());
  2765. _st(self)._deny_(_st(stream)._atStart());
  2766. _st(stream)._position_((1));
  2767. _st(self)._deny_(_st(stream)._atEnd());
  2768. _st(self)._deny_(_st(stream)._atStart());
  2769. return self}, function($ctx1) {$ctx1.fill(self,"testAtStartAtEnd",{stream:stream},smalltalk.StreamTest)})},
  2770. messageSends: ["newStream", "assert:", "atStart", "atEnd", "nextPutAll:", "newCollection", "deny:", "position:"]}),
  2771. smalltalk.StreamTest);
  2772. smalltalk.addMethod(
  2773. "_testContents",
  2774. smalltalk.method({
  2775. selector: "testContents",
  2776. fn: function (){
  2777. var self=this;
  2778. var stream;
  2779. return smalltalk.withContext(function($ctx1) { stream=_st(self)._newStream();
  2780. _st(stream)._nextPutAll_(_st(self)._newCollection());
  2781. _st(self)._assert_equals_(_st(stream)._contents(),_st(self)._newCollection());
  2782. return self}, function($ctx1) {$ctx1.fill(self,"testContents",{stream:stream},smalltalk.StreamTest)})},
  2783. messageSends: ["newStream", "nextPutAll:", "newCollection", "assert:equals:", "contents"]}),
  2784. smalltalk.StreamTest);
  2785. smalltalk.addMethod(
  2786. "_testIsEmpty",
  2787. smalltalk.method({
  2788. selector: "testIsEmpty",
  2789. fn: function (){
  2790. var self=this;
  2791. var stream;
  2792. return smalltalk.withContext(function($ctx1) { stream=_st(self)._newStream();
  2793. _st(self)._assert_(_st(stream)._isEmpty());
  2794. _st(stream)._nextPutAll_(_st(self)._newCollection());
  2795. _st(self)._deny_(_st(stream)._isEmpty());
  2796. return self}, function($ctx1) {$ctx1.fill(self,"testIsEmpty",{stream:stream},smalltalk.StreamTest)})},
  2797. messageSends: ["newStream", "assert:", "isEmpty", "nextPutAll:", "newCollection", "deny:"]}),
  2798. smalltalk.StreamTest);
  2799. smalltalk.addMethod(
  2800. "_testPosition",
  2801. smalltalk.method({
  2802. selector: "testPosition",
  2803. fn: function (){
  2804. var self=this;
  2805. var collection,stream;
  2806. return smalltalk.withContext(function($ctx1) { collection=_st(self)._newCollection();
  2807. stream=_st(self)._newStream();
  2808. _st(stream)._nextPutAll_(collection);
  2809. _st(self)._assert_equals_(_st(stream)._position(),_st(collection)._size());
  2810. _st(stream)._position_((0));
  2811. _st(self)._assert_equals_(_st(stream)._position(),(0));
  2812. _st(stream)._next();
  2813. _st(self)._assert_equals_(_st(stream)._position(),(1));
  2814. _st(stream)._next();
  2815. _st(self)._assert_equals_(_st(stream)._position(),(2));
  2816. return self}, function($ctx1) {$ctx1.fill(self,"testPosition",{collection:collection,stream:stream},smalltalk.StreamTest)})},
  2817. messageSends: ["newCollection", "newStream", "nextPutAll:", "assert:equals:", "position", "size", "position:", "next"]}),
  2818. smalltalk.StreamTest);
  2819. smalltalk.addMethod(
  2820. "_testReading",
  2821. smalltalk.method({
  2822. selector: "testReading",
  2823. fn: function (){
  2824. var self=this;
  2825. var stream,collection;
  2826. return smalltalk.withContext(function($ctx1) { var $1,$2;
  2827. collection=_st(self)._newCollection();
  2828. stream=_st(self)._newStream();
  2829. $1=stream;
  2830. _st($1)._nextPutAll_(collection);
  2831. $2=_st($1)._position_((0));
  2832. _st(collection)._do_((function(each){
  2833. return smalltalk.withContext(function($ctx2) { return _st(self)._assert_equals_(_st(stream)._next(),each);
  2834. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  2835. _st(self)._assert_(_st(_st(stream)._next())._isNil());
  2836. return self}, function($ctx1) {$ctx1.fill(self,"testReading",{stream:stream,collection:collection},smalltalk.StreamTest)})},
  2837. messageSends: ["newCollection", "newStream", "nextPutAll:", "position:", "do:", "assert:equals:", "next", "assert:", "isNil"]}),
  2838. smalltalk.StreamTest);
  2839. smalltalk.addMethod(
  2840. "_testStreamContents",
  2841. smalltalk.method({
  2842. selector: "testStreamContents",
  2843. fn: function (){
  2844. var self=this;
  2845. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"testStreamContents",{},smalltalk.StreamTest)})},
  2846. messageSends: []}),
  2847. smalltalk.StreamTest);
  2848. smalltalk.addMethod(
  2849. "_testWrite",
  2850. smalltalk.method({
  2851. selector: "testWrite",
  2852. fn: function (){
  2853. var self=this;
  2854. var stream,collection;
  2855. return smalltalk.withContext(function($ctx1) { collection=_st(self)._newCollection();
  2856. stream=_st(self)._newStream();
  2857. _st(collection)._do_((function(each){
  2858. return smalltalk.withContext(function($ctx2) { return _st(stream).__lt_lt(each);
  2859. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  2860. _st(self)._assert_equals_(_st(stream)._contents(),collection);
  2861. return self}, function($ctx1) {$ctx1.fill(self,"testWrite",{stream:stream,collection:collection},smalltalk.StreamTest)})},
  2862. messageSends: ["newCollection", "newStream", "do:", "<<", "assert:equals:", "contents"]}),
  2863. smalltalk.StreamTest);
  2864. smalltalk.addMethod(
  2865. "_testWriting",
  2866. smalltalk.method({
  2867. selector: "testWriting",
  2868. fn: function (){
  2869. var self=this;
  2870. var stream,collection;
  2871. return smalltalk.withContext(function($ctx1) { collection=_st(self)._newCollection();
  2872. stream=_st(self)._newStream();
  2873. _st(collection)._do_((function(each){
  2874. return smalltalk.withContext(function($ctx2) { return _st(stream)._nextPut_(each);
  2875. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  2876. _st(self)._assert_equals_(_st(stream)._contents(),collection);
  2877. stream=_st(self)._newStream();
  2878. _st(stream)._nextPutAll_(collection);
  2879. _st(self)._assert_equals_(_st(stream)._contents(),collection);
  2880. return self}, function($ctx1) {$ctx1.fill(self,"testWriting",{stream:stream,collection:collection},smalltalk.StreamTest)})},
  2881. messageSends: ["newCollection", "newStream", "do:", "nextPut:", "assert:equals:", "contents", "nextPutAll:"]}),
  2882. smalltalk.StreamTest);
  2883. smalltalk.addMethod(
  2884. "_collectionClass",
  2885. smalltalk.method({
  2886. selector: "collectionClass",
  2887. fn: function (){
  2888. var self=this;
  2889. return smalltalk.withContext(function($ctx1) { return nil;
  2890. }, function($ctx1) {$ctx1.fill(self,"collectionClass",{},smalltalk.StreamTest.klass)})},
  2891. messageSends: []}),
  2892. smalltalk.StreamTest.klass);
  2893. smalltalk.addMethod(
  2894. "_isAbstract",
  2895. smalltalk.method({
  2896. selector: "isAbstract",
  2897. fn: function (){
  2898. var self=this;
  2899. return smalltalk.withContext(function($ctx1) { var $1;
  2900. $1=_st(_st(self)._collectionClass())._isNil();
  2901. return $1;
  2902. }, function($ctx1) {$ctx1.fill(self,"isAbstract",{},smalltalk.StreamTest.klass)})},
  2903. messageSends: ["isNil", "collectionClass"]}),
  2904. smalltalk.StreamTest.klass);
  2905. smalltalk.addClass('ArrayStreamTest', smalltalk.StreamTest, [], 'Kernel-Tests');
  2906. smalltalk.addMethod(
  2907. "_newCollection",
  2908. smalltalk.method({
  2909. selector: "newCollection",
  2910. fn: function (){
  2911. var self=this;
  2912. return smalltalk.withContext(function($ctx1) { var $1;
  2913. $1=[true,(1),_st((3)).__at((4)),"foo"];
  2914. return $1;
  2915. }, function($ctx1) {$ctx1.fill(self,"newCollection",{},smalltalk.ArrayStreamTest)})},
  2916. messageSends: ["@"]}),
  2917. smalltalk.ArrayStreamTest);
  2918. smalltalk.addMethod(
  2919. "_collectionClass",
  2920. smalltalk.method({
  2921. selector: "collectionClass",
  2922. fn: function (){
  2923. var self=this;
  2924. return smalltalk.withContext(function($ctx1) { var $1;
  2925. $1=(smalltalk.Array || Array);
  2926. return $1;
  2927. }, function($ctx1) {$ctx1.fill(self,"collectionClass",{},smalltalk.ArrayStreamTest.klass)})},
  2928. messageSends: []}),
  2929. smalltalk.ArrayStreamTest.klass);
  2930. smalltalk.addClass('StringStreamTest', smalltalk.StreamTest, [], 'Kernel-Tests');
  2931. smalltalk.addMethod(
  2932. "_newCollection",
  2933. smalltalk.method({
  2934. selector: "newCollection",
  2935. fn: function (){
  2936. var self=this;
  2937. return smalltalk.withContext(function($ctx1) { return "hello world";
  2938. }, function($ctx1) {$ctx1.fill(self,"newCollection",{},smalltalk.StringStreamTest)})},
  2939. messageSends: []}),
  2940. smalltalk.StringStreamTest);
  2941. smalltalk.addMethod(
  2942. "_collectionClass",
  2943. smalltalk.method({
  2944. selector: "collectionClass",
  2945. fn: function (){
  2946. var self=this;
  2947. return smalltalk.withContext(function($ctx1) { var $1;
  2948. $1=(smalltalk.String || String);
  2949. return $1;
  2950. }, function($ctx1) {$ctx1.fill(self,"collectionClass",{},smalltalk.StringStreamTest.klass)})},
  2951. messageSends: []}),
  2952. smalltalk.StringStreamTest.klass);
  2953. smalltalk.addClass('UndefinedTest', smalltalk.TestCase, [], 'Kernel-Tests');
  2954. smalltalk.addMethod(
  2955. "_testCopying",
  2956. smalltalk.method({
  2957. selector: "testCopying",
  2958. fn: function (){
  2959. var self=this;
  2960. return smalltalk.withContext(function($ctx1) { _st(self)._assert_equals_(_st(nil)._copy(),nil);
  2961. return self}, function($ctx1) {$ctx1.fill(self,"testCopying",{},smalltalk.UndefinedTest)})},
  2962. messageSends: ["assert:equals:", "copy"]}),
  2963. smalltalk.UndefinedTest);
  2964. smalltalk.addMethod(
  2965. "_testDeepCopy",
  2966. smalltalk.method({
  2967. selector: "testDeepCopy",
  2968. fn: function (){
  2969. var self=this;
  2970. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(_st(nil)._deepCopy()).__eq(nil));
  2971. return self}, function($ctx1) {$ctx1.fill(self,"testDeepCopy",{},smalltalk.UndefinedTest)})},
  2972. messageSends: ["assert:", "=", "deepCopy"]}),
  2973. smalltalk.UndefinedTest);
  2974. smalltalk.addMethod(
  2975. "_testIfNil",
  2976. smalltalk.method({
  2977. selector: "testIfNil",
  2978. fn: function (){
  2979. var self=this;
  2980. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$5,$4,$6,$7;
  2981. $1=self;
  2982. if(($receiver = nil) == nil || $receiver == undefined){
  2983. $2=true;
  2984. } else {
  2985. $2=nil;
  2986. };
  2987. _st($1)._assert_equals_($2,true);
  2988. $3=self;
  2989. if(($receiver = nil) == nil || $receiver == undefined){
  2990. $5=nil;
  2991. } else {
  2992. $5=true;
  2993. };
  2994. $4=_st($5).__eq(true);
  2995. _st($3)._deny_($4);
  2996. $6=self;
  2997. if(($receiver = nil) == nil || $receiver == undefined){
  2998. $7=true;
  2999. } else {
  3000. $7=false;
  3001. };
  3002. _st($6)._assert_equals_($7,true);
  3003. _st(self)._deny_(_st(_st(nil)._ifNotNil_ifNil_((function(){
  3004. return smalltalk.withContext(function($ctx2) { return true;
  3005. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(function(){
  3006. return smalltalk.withContext(function($ctx2) { return false;
  3007. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))).__eq(true));
  3008. return self}, function($ctx1) {$ctx1.fill(self,"testIfNil",{},smalltalk.UndefinedTest)})},
  3009. messageSends: ["assert:equals:", "ifNil:", "deny:", "=", "ifNotNil:", "ifNil:ifNotNil:", "ifNotNil:ifNil:"]}),
  3010. smalltalk.UndefinedTest);
  3011. smalltalk.addMethod(
  3012. "_testIsNil",
  3013. smalltalk.method({
  3014. selector: "testIsNil",
  3015. fn: function (){
  3016. var self=this;
  3017. return smalltalk.withContext(function($ctx1) { _st(self)._assert_(_st(nil)._isNil());
  3018. _st(self)._deny_(_st(nil)._notNil());
  3019. return self}, function($ctx1) {$ctx1.fill(self,"testIsNil",{},smalltalk.UndefinedTest)})},
  3020. messageSends: ["assert:", "isNil", "deny:", "notNil"]}),
  3021. smalltalk.UndefinedTest);