2
0

Kernel-Tests.deploy.js 137 KB

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