Kernel-Tests.deploy.js 78 KB

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