Kernel-Tests.deploy.js 111 KB

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