Kernel-Tests.deploy.js 129 KB

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