Kernel-Tests.deploy.js 113 KB

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