Kernel-Tests.deploy.js 129 KB

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