Kernel-Tests.deploy.js 135 KB

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