Kernel-Tests.deploy.js 97 KB

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