Kernel-Tests.deploy.js 97 KB

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