Kernel-Tests.deploy.js 116 KB

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