1
0

Kernel-Tests.deploy.js 135 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517
  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)._assert_equals_("hello",_st("hello")._yourself());
  1603. _st(self)._assert_equals_(_st("hello")._yourself(),"hello");
  1604. _st(self)._deny_(_st("").__eq((0)));
  1605. return self}, function($ctx1) {$ctx1.fill(self,"testEquality",{},smalltalk.StringTest)})},
  1606. messageSends: ["assert:equals:", "deny:", "=", "yourself"]}),
  1607. smalltalk.StringTest);
  1608. smalltalk.addMethod(
  1609. smalltalk.method({
  1610. selector: "testIdentity",
  1611. fn: function (){
  1612. var self=this;
  1613. return smalltalk.withContext(function($ctx1) {
  1614. _st(self)._assert_(_st("hello").__eq_eq("hello"));
  1615. _st(self)._deny_(_st("hello").__eq_eq("world"));
  1616. _st(self)._assert_(_st("hello").__eq_eq(_st("hello")._yourself()));
  1617. _st(self)._assert_(_st(_st("hello")._yourself()).__eq_eq("hello"));
  1618. _st(self)._deny_(_st("").__eq_eq((0)));
  1619. return self}, function($ctx1) {$ctx1.fill(self,"testIdentity",{},smalltalk.StringTest)})},
  1620. messageSends: ["assert:", "==", "deny:", "yourself"]}),
  1621. smalltalk.StringTest);
  1622. smalltalk.addMethod(
  1623. smalltalk.method({
  1624. selector: "testIncludesSubString",
  1625. fn: function (){
  1626. var self=this;
  1627. return smalltalk.withContext(function($ctx1) {
  1628. _st(self)._assert_(_st("amber")._includesSubString_("ber"));
  1629. _st(self)._deny_(_st("amber")._includesSubString_("zork"));
  1630. return self}, function($ctx1) {$ctx1.fill(self,"testIncludesSubString",{},smalltalk.StringTest)})},
  1631. messageSends: ["assert:", "includesSubString:", "deny:"]}),
  1632. smalltalk.StringTest);
  1633. smalltalk.addMethod(
  1634. smalltalk.method({
  1635. selector: "testIndexOf",
  1636. fn: function (){
  1637. var self=this;
  1638. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  1639. return smalltalk.withContext(function($ctx1) {
  1640. _st(self)._assert_equals_(_st(_st(self)._collection())._indexOf_("e"),(2));
  1641. _st(self)._should_raise_((function(){
  1642. return smalltalk.withContext(function($ctx2) {
  1643. return _st(_st(self)._collection())._indexOf_((999));
  1644. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$Error());
  1645. _st(self)._assert_equals_(_st(_st(self)._collection())._indexOf_ifAbsent_((999),(function(){
  1646. return smalltalk.withContext(function($ctx2) {
  1647. return "sentinel";
  1648. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"sentinel");
  1649. return self}, function($ctx1) {$ctx1.fill(self,"testIndexOf",{},smalltalk.StringTest)})},
  1650. messageSends: ["assert:equals:", "indexOf:", "collection", "should:raise:", "indexOf:ifAbsent:"]}),
  1651. smalltalk.StringTest);
  1652. smalltalk.addMethod(
  1653. smalltalk.method({
  1654. selector: "testJoin",
  1655. fn: function (){
  1656. var self=this;
  1657. return smalltalk.withContext(function($ctx1) {
  1658. _st(self)._assert_equals_(_st(",")._join_(["hello", "world"]),"hello,world");
  1659. return self}, function($ctx1) {$ctx1.fill(self,"testJoin",{},smalltalk.StringTest)})},
  1660. messageSends: ["assert:equals:", "join:"]}),
  1661. smalltalk.StringTest);
  1662. smalltalk.addMethod(
  1663. smalltalk.method({
  1664. selector: "testSelect",
  1665. fn: function (){
  1666. var self=this;
  1667. var newCollection;
  1668. return smalltalk.withContext(function($ctx1) {
  1669. newCollection="o";
  1670. _st(self)._assertSameContents_as_(_st(_st(self)._collection())._select_((function(each){
  1671. return smalltalk.withContext(function($ctx2) {
  1672. return _st(each).__eq("o");
  1673. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})),newCollection);
  1674. return self}, function($ctx1) {$ctx1.fill(self,"testSelect",{newCollection:newCollection},smalltalk.StringTest)})},
  1675. messageSends: ["assertSameContents:as:", "select:", "=", "collection"]}),
  1676. smalltalk.StringTest);
  1677. smalltalk.addMethod(
  1678. smalltalk.method({
  1679. selector: "testSize",
  1680. fn: function (){
  1681. var self=this;
  1682. return smalltalk.withContext(function($ctx1) {
  1683. _st(self)._assert_equals_(_st("smalltalk")._size(),(9));
  1684. _st(self)._assert_equals_(_st("")._size(),(0));
  1685. return self}, function($ctx1) {$ctx1.fill(self,"testSize",{},smalltalk.StringTest)})},
  1686. messageSends: ["assert:equals:", "size"]}),
  1687. smalltalk.StringTest);
  1688. smalltalk.addMethod(
  1689. smalltalk.method({
  1690. selector: "testStreamContents",
  1691. fn: function (){
  1692. var self=this;
  1693. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  1694. return smalltalk.withContext(function($ctx1) {
  1695. var $1,$2;
  1696. _st(self)._assert_equals_(_st($String())._streamContents_((function(aStream){
  1697. return smalltalk.withContext(function($ctx2) {
  1698. $1=aStream;
  1699. _st($1)._nextPutAll_("hello");
  1700. _st($1)._space();
  1701. $2=_st($1)._nextPutAll_("world");
  1702. return $2;
  1703. }, function($ctx2) {$ctx2.fillBlock({aStream:aStream},$ctx1)})})),"hello world");
  1704. return self}, function($ctx1) {$ctx1.fill(self,"testStreamContents",{},smalltalk.StringTest)})},
  1705. messageSends: ["assert:equals:", "streamContents:", "nextPutAll:", "space"]}),
  1706. smalltalk.StringTest);
  1707. smalltalk.addMethod(
  1708. smalltalk.method({
  1709. selector: "collectionClass",
  1710. fn: function (){
  1711. var self=this;
  1712. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  1713. return smalltalk.withContext(function($ctx1) {
  1714. var $1;
  1715. $1=$String();
  1716. return $1;
  1717. }, function($ctx1) {$ctx1.fill(self,"collectionClass",{},smalltalk.StringTest.klass)})},
  1718. messageSends: []}),
  1719. smalltalk.StringTest.klass);
  1720. smalltalk.addClass('JSObjectProxyTest', smalltalk.TestCase, [], 'Kernel-Tests');
  1721. smalltalk.addMethod(
  1722. smalltalk.method({
  1723. selector: "jsObject",
  1724. fn: function (){
  1725. var self=this;
  1726. return smalltalk.withContext(function($ctx1) {
  1727. return jsObject = {a: 1, b: function() {return 2;}, c: function(object) {return object;}, d: '', 'e': null, 'f': undefined};
  1728. return self}, function($ctx1) {$ctx1.fill(self,"jsObject",{},smalltalk.JSObjectProxyTest)})},
  1729. messageSends: []}),
  1730. smalltalk.JSObjectProxyTest);
  1731. smalltalk.addMethod(
  1732. smalltalk.method({
  1733. selector: "testAtIfAbsent",
  1734. fn: function (){
  1735. var self=this;
  1736. var testObject;
  1737. return smalltalk.withContext(function($ctx1) {
  1738. testObject=_st(self)._jsObject();
  1739. _st(self)._assert_equals_(_st(testObject)._at_ifAbsent_("abc",(function(){
  1740. return smalltalk.withContext(function($ctx2) {
  1741. return "Property does not exist";
  1742. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"Property does not exist");
  1743. _st(self)._assert_equals_(_st(testObject)._at_ifAbsent_("e",(function(){
  1744. return smalltalk.withContext(function($ctx2) {
  1745. return "Property does not exist";
  1746. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),nil);
  1747. _st(self)._assert_equals_(_st(testObject)._at_ifAbsent_("a",(function(){
  1748. return smalltalk.withContext(function($ctx2) {
  1749. return "Property does not exist";
  1750. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),(1));
  1751. _st(self)._assert_equals_(_st(testObject)._at_ifAbsent_("f",(function(){
  1752. return smalltalk.withContext(function($ctx2) {
  1753. return "Property does not exist";
  1754. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),nil);
  1755. return self}, function($ctx1) {$ctx1.fill(self,"testAtIfAbsent",{testObject:testObject},smalltalk.JSObjectProxyTest)})},
  1756. messageSends: ["jsObject", "assert:equals:", "at:ifAbsent:"]}),
  1757. smalltalk.JSObjectProxyTest);
  1758. smalltalk.addMethod(
  1759. smalltalk.method({
  1760. selector: "testAtIfPresent",
  1761. fn: function (){
  1762. var self=this;
  1763. var testObject;
  1764. return smalltalk.withContext(function($ctx1) {
  1765. testObject=_st(self)._jsObject();
  1766. _st(self)._assert_equals_(_st(testObject)._at_ifPresent_("abc",(function(x){
  1767. return smalltalk.withContext(function($ctx2) {
  1768. return _st("hello ").__comma(_st(x)._asString());
  1769. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})})),nil);
  1770. _st(self)._assert_equals_(_st(testObject)._at_ifPresent_("e",(function(x){
  1771. return smalltalk.withContext(function($ctx2) {
  1772. return _st("hello ").__comma(_st(x)._asString());
  1773. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})})),"hello nil");
  1774. _st(self)._assert_equals_(_st(testObject)._at_ifPresent_("a",(function(x){
  1775. return smalltalk.withContext(function($ctx2) {
  1776. return _st("hello ").__comma(_st(x)._asString());
  1777. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})})),"hello 1");
  1778. _st(self)._assert_equals_(_st(testObject)._at_ifPresent_("f",(function(x){
  1779. return smalltalk.withContext(function($ctx2) {
  1780. return _st("hello ").__comma(_st(x)._asString());
  1781. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})})),"hello nil");
  1782. return self}, function($ctx1) {$ctx1.fill(self,"testAtIfPresent",{testObject:testObject},smalltalk.JSObjectProxyTest)})},
  1783. messageSends: ["jsObject", "assert:equals:", "at:ifPresent:", ",", "asString"]}),
  1784. smalltalk.JSObjectProxyTest);
  1785. smalltalk.addMethod(
  1786. smalltalk.method({
  1787. selector: "testAtIfPresentIfAbsent",
  1788. fn: function (){
  1789. var self=this;
  1790. var testObject;
  1791. return smalltalk.withContext(function($ctx1) {
  1792. testObject=_st(self)._jsObject();
  1793. _st(self)._assert_equals_(_st(testObject)._at_ifPresent_ifAbsent_("abc",(function(x){
  1794. return smalltalk.withContext(function($ctx2) {
  1795. return _st("hello ").__comma(_st(x)._asString());
  1796. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})}),(function(){
  1797. return smalltalk.withContext(function($ctx2) {
  1798. return "not present";
  1799. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"not present");
  1800. _st(self)._assert_equals_(_st(testObject)._at_ifPresent_ifAbsent_("e",(function(x){
  1801. return smalltalk.withContext(function($ctx2) {
  1802. return _st("hello ").__comma(_st(x)._asString());
  1803. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})}),(function(){
  1804. return smalltalk.withContext(function($ctx2) {
  1805. return "not present";
  1806. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"hello nil");
  1807. _st(self)._assert_equals_(_st(testObject)._at_ifPresent_ifAbsent_("a",(function(x){
  1808. return smalltalk.withContext(function($ctx2) {
  1809. return _st("hello ").__comma(_st(x)._asString());
  1810. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})}),(function(){
  1811. return smalltalk.withContext(function($ctx2) {
  1812. return "not present";
  1813. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"hello 1");
  1814. _st(self)._assert_equals_(_st(testObject)._at_ifPresent_ifAbsent_("f",(function(x){
  1815. return smalltalk.withContext(function($ctx2) {
  1816. return _st("hello ").__comma(_st(x)._asString());
  1817. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})}),(function(){
  1818. return smalltalk.withContext(function($ctx2) {
  1819. return "not present";
  1820. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"hello nil");
  1821. return self}, function($ctx1) {$ctx1.fill(self,"testAtIfPresentIfAbsent",{testObject:testObject},smalltalk.JSObjectProxyTest)})},
  1822. messageSends: ["jsObject", "assert:equals:", "at:ifPresent:ifAbsent:", ",", "asString"]}),
  1823. smalltalk.JSObjectProxyTest);
  1824. smalltalk.addMethod(
  1825. smalltalk.method({
  1826. selector: "testDNU",
  1827. fn: function (){
  1828. var self=this;
  1829. function $MessageNotUnderstood(){return smalltalk.MessageNotUnderstood||(typeof MessageNotUnderstood=="undefined"?nil:MessageNotUnderstood)}
  1830. return smalltalk.withContext(function($ctx1) {
  1831. _st(self)._should_raise_((function(){
  1832. return smalltalk.withContext(function($ctx2) {
  1833. return _st(_st(self)._jsObject())._foo();
  1834. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  1835. return self}, function($ctx1) {$ctx1.fill(self,"testDNU",{},smalltalk.JSObjectProxyTest)})},
  1836. messageSends: ["should:raise:", "foo", "jsObject"]}),
  1837. smalltalk.JSObjectProxyTest);
  1838. smalltalk.addMethod(
  1839. smalltalk.method({
  1840. selector: "testMessageSend",
  1841. fn: function (){
  1842. var self=this;
  1843. return smalltalk.withContext(function($ctx1) {
  1844. _st(self)._assert_equals_(_st(_st(self)._jsObject())._a(),(1));
  1845. _st(self)._assert_equals_(_st(_st(self)._jsObject())._b(),(2));
  1846. _st(self)._assert_equals_(_st(_st(self)._jsObject())._c_((3)),(3));
  1847. return self}, function($ctx1) {$ctx1.fill(self,"testMessageSend",{},smalltalk.JSObjectProxyTest)})},
  1848. messageSends: ["assert:equals:", "a", "jsObject", "b", "c:"]}),
  1849. smalltalk.JSObjectProxyTest);
  1850. smalltalk.addMethod(
  1851. smalltalk.method({
  1852. selector: "testMethodWithArguments",
  1853. fn: function (){
  1854. var self=this;
  1855. return smalltalk.withContext(function($ctx1) {
  1856. _st(self)._assert_equals_(_st(_st(self)._jsObject())._c_((1)),(1));
  1857. return self}, function($ctx1) {$ctx1.fill(self,"testMethodWithArguments",{},smalltalk.JSObjectProxyTest)})},
  1858. messageSends: ["assert:equals:", "c:", "jsObject"]}),
  1859. smalltalk.JSObjectProxyTest);
  1860. smalltalk.addMethod(
  1861. smalltalk.method({
  1862. selector: "testPrinting",
  1863. fn: function (){
  1864. var self=this;
  1865. return smalltalk.withContext(function($ctx1) {
  1866. _st(self)._assert_equals_(_st(_st(self)._jsObject())._printString(),"[object Object]");
  1867. return self}, function($ctx1) {$ctx1.fill(self,"testPrinting",{},smalltalk.JSObjectProxyTest)})},
  1868. messageSends: ["assert:equals:", "printString", "jsObject"]}),
  1869. smalltalk.JSObjectProxyTest);
  1870. smalltalk.addMethod(
  1871. smalltalk.method({
  1872. selector: "testPropertyThatReturnsEmptyString",
  1873. fn: function (){
  1874. var self=this;
  1875. var object;
  1876. return smalltalk.withContext(function($ctx1) {
  1877. object=_st(self)._jsObject();
  1878. _st(self)._assert_equals_(_st(object)._d(),"");
  1879. _st(object)._d_("hello");
  1880. _st(self)._assert_equals_(_st(object)._d(),"hello");
  1881. return self}, function($ctx1) {$ctx1.fill(self,"testPropertyThatReturnsEmptyString",{object:object},smalltalk.JSObjectProxyTest)})},
  1882. messageSends: ["jsObject", "assert:equals:", "d", "d:"]}),
  1883. smalltalk.JSObjectProxyTest);
  1884. smalltalk.addMethod(
  1885. smalltalk.method({
  1886. selector: "testPropertyThatReturnsUndefined",
  1887. fn: function (){
  1888. var self=this;
  1889. var object;
  1890. function $MessageNotUnderstood(){return smalltalk.MessageNotUnderstood||(typeof MessageNotUnderstood=="undefined"?nil:MessageNotUnderstood)}
  1891. return smalltalk.withContext(function($ctx1) {
  1892. object=_st(self)._jsObject();
  1893. _st(self)._shouldnt_raise_((function(){
  1894. return smalltalk.withContext(function($ctx2) {
  1895. return _st(object)._e();
  1896. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  1897. _st(self)._assert_(_st(_st(object)._e())._isNil());
  1898. return self}, function($ctx1) {$ctx1.fill(self,"testPropertyThatReturnsUndefined",{object:object},smalltalk.JSObjectProxyTest)})},
  1899. messageSends: ["jsObject", "shouldnt:raise:", "e", "assert:", "isNil"]}),
  1900. smalltalk.JSObjectProxyTest);
  1901. smalltalk.addMethod(
  1902. smalltalk.method({
  1903. selector: "testValue",
  1904. fn: function (){
  1905. var self=this;
  1906. var testObject;
  1907. return smalltalk.withContext(function($ctx1) {
  1908. testObject=_st(self)._jsObject();
  1909. _st(self)._assert_equals_(_st(_st(testObject)._value())._printString(),"[object Object]");
  1910. _st(testObject)._at_put_("value","aValue");
  1911. _st(self)._assert_equals_(_st(testObject)._value(),"aValue");
  1912. return self}, function($ctx1) {$ctx1.fill(self,"testValue",{testObject:testObject},smalltalk.JSObjectProxyTest)})},
  1913. messageSends: ["jsObject", "assert:equals:", "printString", "value", "at:put:"]}),
  1914. smalltalk.JSObjectProxyTest);
  1915. smalltalk.addMethod(
  1916. smalltalk.method({
  1917. selector: "testYourself",
  1918. fn: function (){
  1919. var self=this;
  1920. var object;
  1921. return smalltalk.withContext(function($ctx1) {
  1922. var $1,$2;
  1923. $1=_st(self)._jsObject();
  1924. _st($1)._d_("test");
  1925. $2=_st($1)._yourself();
  1926. object=$2;
  1927. _st(self)._assert_equals_(_st(object)._d(),"test");
  1928. return self}, function($ctx1) {$ctx1.fill(self,"testYourself",{object:object},smalltalk.JSObjectProxyTest)})},
  1929. messageSends: ["d:", "jsObject", "yourself", "assert:equals:", "d"]}),
  1930. smalltalk.JSObjectProxyTest);
  1931. smalltalk.addClass('JavaScriptExceptionTest', smalltalk.TestCase, [], 'Kernel-Tests');
  1932. smalltalk.addMethod(
  1933. smalltalk.method({
  1934. selector: "testCatchingException",
  1935. fn: function (){
  1936. var self=this;
  1937. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  1938. return smalltalk.withContext(function($ctx1) {
  1939. _st((function(){
  1940. return smalltalk.withContext(function($ctx2) {
  1941. return _st(self)._throwException();
  1942. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_($Error(),(function(error){
  1943. return smalltalk.withContext(function($ctx2) {
  1944. return _st(self)._assert_(_st(_st(error)._exception()).__eq("test"));
  1945. }, function($ctx2) {$ctx2.fillBlock({error:error},$ctx1)})}));
  1946. return self}, function($ctx1) {$ctx1.fill(self,"testCatchingException",{},smalltalk.JavaScriptExceptionTest)})},
  1947. messageSends: ["on:do:", "assert:", "=", "exception", "throwException"]}),
  1948. smalltalk.JavaScriptExceptionTest);
  1949. smalltalk.addMethod(
  1950. smalltalk.method({
  1951. selector: "testRaisingException",
  1952. fn: function (){
  1953. var self=this;
  1954. function $JavaScriptException(){return smalltalk.JavaScriptException||(typeof JavaScriptException=="undefined"?nil:JavaScriptException)}
  1955. return smalltalk.withContext(function($ctx1) {
  1956. _st(self)._should_raise_((function(){
  1957. return smalltalk.withContext(function($ctx2) {
  1958. return _st(self)._throwException();
  1959. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$JavaScriptException());
  1960. return self}, function($ctx1) {$ctx1.fill(self,"testRaisingException",{},smalltalk.JavaScriptExceptionTest)})},
  1961. messageSends: ["should:raise:", "throwException"]}),
  1962. smalltalk.JavaScriptExceptionTest);
  1963. smalltalk.addMethod(
  1964. smalltalk.method({
  1965. selector: "throwException",
  1966. fn: function (){
  1967. var self=this;
  1968. return smalltalk.withContext(function($ctx1) {
  1969. throw 'test';
  1970. return self}, function($ctx1) {$ctx1.fill(self,"throwException",{},smalltalk.JavaScriptExceptionTest)})},
  1971. messageSends: []}),
  1972. smalltalk.JavaScriptExceptionTest);
  1973. smalltalk.addClass('NumberTest', smalltalk.TestCase, [], 'Kernel-Tests');
  1974. smalltalk.addMethod(
  1975. smalltalk.method({
  1976. selector: "testAbs",
  1977. fn: function (){
  1978. var self=this;
  1979. return smalltalk.withContext(function($ctx1) {
  1980. _st(self)._assert_equals_(_st((4))._abs(),(4));
  1981. _st(self)._assert_equals_(_st((-4))._abs(),(4));
  1982. return self}, function($ctx1) {$ctx1.fill(self,"testAbs",{},smalltalk.NumberTest)})},
  1983. messageSends: ["assert:equals:", "abs"]}),
  1984. smalltalk.NumberTest);
  1985. smalltalk.addMethod(
  1986. smalltalk.method({
  1987. selector: "testArithmetic",
  1988. fn: function (){
  1989. var self=this;
  1990. return smalltalk.withContext(function($ctx1) {
  1991. _st(self)._assert_equals_(_st((1.5)).__plus((1)),(2.5));
  1992. _st(self)._assert_equals_(_st((2)).__minus((1)),(1));
  1993. _st(self)._assert_equals_(_st((-2)).__minus((1)),(-3));
  1994. _st(self)._assert_equals_(_st((12)).__slash((2)),(6));
  1995. _st(self)._assert_equals_(_st((3)).__star((4)),(12));
  1996. _st(self)._assert_equals_(_st(_st((1)).__plus((2))).__star((3)),(9));
  1997. _st(self)._assert_equals_(_st((1)).__plus(_st((2)).__star((3))),(7));
  1998. return self}, function($ctx1) {$ctx1.fill(self,"testArithmetic",{},smalltalk.NumberTest)})},
  1999. messageSends: ["assert:equals:", "+", "-", "/", "*"]}),
  2000. smalltalk.NumberTest);
  2001. smalltalk.addMethod(
  2002. smalltalk.method({
  2003. selector: "testComparison",
  2004. fn: function (){
  2005. var self=this;
  2006. return smalltalk.withContext(function($ctx1) {
  2007. _st(self)._assert_(_st((3)).__gt((2)));
  2008. _st(self)._assert_(_st((2)).__lt((3)));
  2009. _st(self)._deny_(_st((3)).__lt((2)));
  2010. _st(self)._deny_(_st((2)).__gt((3)));
  2011. _st(self)._assert_(_st((3)).__gt_eq((3)));
  2012. _st(self)._assert_(_st((3.1)).__gt_eq((3)));
  2013. _st(self)._assert_(_st((3)).__lt_eq((3)));
  2014. _st(self)._assert_(_st((3)).__lt_eq((3.1)));
  2015. return self}, function($ctx1) {$ctx1.fill(self,"testComparison",{},smalltalk.NumberTest)})},
  2016. messageSends: ["assert:", ">", "<", "deny:", ">=", "<="]}),
  2017. smalltalk.NumberTest);
  2018. smalltalk.addMethod(
  2019. smalltalk.method({
  2020. selector: "testCopying",
  2021. fn: function (){
  2022. var self=this;
  2023. return smalltalk.withContext(function($ctx1) {
  2024. _st(self)._assert_(_st(_st((1))._copy()).__eq_eq((1)));
  2025. _st(self)._assert_(_st(_st((1))._deepCopy()).__eq_eq((1)));
  2026. return self}, function($ctx1) {$ctx1.fill(self,"testCopying",{},smalltalk.NumberTest)})},
  2027. messageSends: ["assert:", "==", "copy", "deepCopy"]}),
  2028. smalltalk.NumberTest);
  2029. smalltalk.addMethod(
  2030. smalltalk.method({
  2031. selector: "testEquality",
  2032. fn: function (){
  2033. var self=this;
  2034. return smalltalk.withContext(function($ctx1) {
  2035. _st(self)._assert_(_st((1)).__eq((1)));
  2036. _st(self)._assert_(_st((0)).__eq((0)));
  2037. _st(self)._deny_(_st((1)).__eq((0)));
  2038. _st(self)._assert_(_st(_st((1))._yourself()).__eq((1)));
  2039. _st(self)._assert_(_st((1)).__eq(_st((1))._yourself()));
  2040. _st(self)._assert_(_st(_st((1))._yourself()).__eq(_st((1))._yourself()));
  2041. _st(self)._deny_(_st((0)).__eq(false));
  2042. _st(self)._deny_(_st(false).__eq((0)));
  2043. _st(self)._deny_(_st("").__eq((0)));
  2044. _st(self)._deny_(_st((0)).__eq(""));
  2045. return self}, function($ctx1) {$ctx1.fill(self,"testEquality",{},smalltalk.NumberTest)})},
  2046. messageSends: ["assert:", "=", "deny:", "yourself"]}),
  2047. smalltalk.NumberTest);
  2048. smalltalk.addMethod(
  2049. smalltalk.method({
  2050. selector: "testHexNumbers",
  2051. fn: function (){
  2052. var self=this;
  2053. return smalltalk.withContext(function($ctx1) {
  2054. _st(self)._assert_equals_((9),(9));
  2055. _st(self)._assert_equals_(_st((10))._truncated(),(10));
  2056. _st(self)._assert_equals_(_st((11))._truncated(),(11));
  2057. _st(self)._assert_equals_(_st((12))._truncated(),(12));
  2058. _st(self)._assert_equals_(_st((13))._truncated(),(13));
  2059. _st(self)._assert_equals_(_st((14))._truncated(),(14));
  2060. _st(self)._assert_equals_(_st((15))._truncated(),(15));
  2061. return self}, function($ctx1) {$ctx1.fill(self,"testHexNumbers",{},smalltalk.NumberTest)})},
  2062. messageSends: ["assert:equals:", "truncated"]}),
  2063. smalltalk.NumberTest);
  2064. smalltalk.addMethod(
  2065. smalltalk.method({
  2066. selector: "testIdentity",
  2067. fn: function (){
  2068. var self=this;
  2069. return smalltalk.withContext(function($ctx1) {
  2070. _st(self)._assert_(_st((1)).__eq_eq((1)));
  2071. _st(self)._assert_(_st((0)).__eq_eq((0)));
  2072. _st(self)._deny_(_st((1)).__eq_eq((0)));
  2073. _st(self)._assert_(_st(_st((1))._yourself()).__eq_eq((1)));
  2074. _st(self)._assert_(_st((1)).__eq_eq(_st((1))._yourself()));
  2075. _st(self)._assert_(_st(_st((1))._yourself()).__eq_eq(_st((1))._yourself()));
  2076. _st(self)._deny_(_st((1)).__eq_eq((2)));
  2077. return self}, function($ctx1) {$ctx1.fill(self,"testIdentity",{},smalltalk.NumberTest)})},
  2078. messageSends: ["assert:", "==", "deny:", "yourself"]}),
  2079. smalltalk.NumberTest);
  2080. smalltalk.addMethod(
  2081. smalltalk.method({
  2082. selector: "testInvalidHexNumbers",
  2083. fn: function (){
  2084. var self=this;
  2085. function $MessageNotUnderstood(){return smalltalk.MessageNotUnderstood||(typeof MessageNotUnderstood=="undefined"?nil:MessageNotUnderstood)}
  2086. return smalltalk.withContext(function($ctx1) {
  2087. _st(self)._should_raise_((function(){
  2088. return smalltalk.withContext(function($ctx2) {
  2089. return _st((16))._rG();
  2090. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2091. _st(self)._should_raise_((function(){
  2092. return smalltalk.withContext(function($ctx2) {
  2093. return _st((16))._rg();
  2094. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2095. _st(self)._should_raise_((function(){
  2096. return smalltalk.withContext(function($ctx2) {
  2097. return _st((16))._rH();
  2098. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2099. _st(self)._should_raise_((function(){
  2100. return smalltalk.withContext(function($ctx2) {
  2101. return _st((16))._rh();
  2102. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2103. _st(self)._should_raise_((function(){
  2104. return smalltalk.withContext(function($ctx2) {
  2105. return _st((16))._rI();
  2106. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2107. _st(self)._should_raise_((function(){
  2108. return smalltalk.withContext(function($ctx2) {
  2109. return _st((16))._ri();
  2110. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2111. _st(self)._should_raise_((function(){
  2112. return smalltalk.withContext(function($ctx2) {
  2113. return _st((16))._rJ();
  2114. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2115. _st(self)._should_raise_((function(){
  2116. return smalltalk.withContext(function($ctx2) {
  2117. return _st((16))._rj();
  2118. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2119. _st(self)._should_raise_((function(){
  2120. return smalltalk.withContext(function($ctx2) {
  2121. return _st((16))._rK();
  2122. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2123. _st(self)._should_raise_((function(){
  2124. return smalltalk.withContext(function($ctx2) {
  2125. return _st((16))._rk();
  2126. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2127. _st(self)._should_raise_((function(){
  2128. return smalltalk.withContext(function($ctx2) {
  2129. return _st((16))._rL();
  2130. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2131. _st(self)._should_raise_((function(){
  2132. return smalltalk.withContext(function($ctx2) {
  2133. return _st((16))._rl();
  2134. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2135. _st(self)._should_raise_((function(){
  2136. return smalltalk.withContext(function($ctx2) {
  2137. return _st((16))._rM();
  2138. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2139. _st(self)._should_raise_((function(){
  2140. return smalltalk.withContext(function($ctx2) {
  2141. return _st((16))._rm();
  2142. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2143. _st(self)._should_raise_((function(){
  2144. return smalltalk.withContext(function($ctx2) {
  2145. return _st((16))._rN();
  2146. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2147. _st(self)._should_raise_((function(){
  2148. return smalltalk.withContext(function($ctx2) {
  2149. return _st((16))._rn();
  2150. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2151. _st(self)._should_raise_((function(){
  2152. return smalltalk.withContext(function($ctx2) {
  2153. return _st((16))._rO();
  2154. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2155. _st(self)._should_raise_((function(){
  2156. return smalltalk.withContext(function($ctx2) {
  2157. return _st((16))._ro();
  2158. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2159. _st(self)._should_raise_((function(){
  2160. return smalltalk.withContext(function($ctx2) {
  2161. return _st((16))._rP();
  2162. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2163. _st(self)._should_raise_((function(){
  2164. return smalltalk.withContext(function($ctx2) {
  2165. return _st((16))._rp();
  2166. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2167. _st(self)._should_raise_((function(){
  2168. return smalltalk.withContext(function($ctx2) {
  2169. return _st((16))._rQ();
  2170. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2171. _st(self)._should_raise_((function(){
  2172. return smalltalk.withContext(function($ctx2) {
  2173. return _st((16))._rq();
  2174. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2175. _st(self)._should_raise_((function(){
  2176. return smalltalk.withContext(function($ctx2) {
  2177. return _st((16))._rR();
  2178. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2179. _st(self)._should_raise_((function(){
  2180. return smalltalk.withContext(function($ctx2) {
  2181. return _st((16))._rr();
  2182. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2183. _st(self)._should_raise_((function(){
  2184. return smalltalk.withContext(function($ctx2) {
  2185. return _st((16))._rS();
  2186. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2187. _st(self)._should_raise_((function(){
  2188. return smalltalk.withContext(function($ctx2) {
  2189. return _st((16))._rs();
  2190. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2191. _st(self)._should_raise_((function(){
  2192. return smalltalk.withContext(function($ctx2) {
  2193. return _st((16))._rT();
  2194. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2195. _st(self)._should_raise_((function(){
  2196. return smalltalk.withContext(function($ctx2) {
  2197. return _st((16))._rt();
  2198. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2199. _st(self)._should_raise_((function(){
  2200. return smalltalk.withContext(function($ctx2) {
  2201. return _st((16))._rU();
  2202. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2203. _st(self)._should_raise_((function(){
  2204. return smalltalk.withContext(function($ctx2) {
  2205. return _st((16))._ru();
  2206. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2207. _st(self)._should_raise_((function(){
  2208. return smalltalk.withContext(function($ctx2) {
  2209. return _st((16))._rV();
  2210. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2211. _st(self)._should_raise_((function(){
  2212. return smalltalk.withContext(function($ctx2) {
  2213. return _st((16))._rv();
  2214. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2215. _st(self)._should_raise_((function(){
  2216. return smalltalk.withContext(function($ctx2) {
  2217. return _st((16))._rW();
  2218. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2219. _st(self)._should_raise_((function(){
  2220. return smalltalk.withContext(function($ctx2) {
  2221. return _st((16))._rw();
  2222. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2223. _st(self)._should_raise_((function(){
  2224. return smalltalk.withContext(function($ctx2) {
  2225. return _st((16))._rX();
  2226. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2227. _st(self)._should_raise_((function(){
  2228. return smalltalk.withContext(function($ctx2) {
  2229. return _st((16))._rx();
  2230. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2231. _st(self)._should_raise_((function(){
  2232. return smalltalk.withContext(function($ctx2) {
  2233. return _st((16))._rY();
  2234. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2235. _st(self)._should_raise_((function(){
  2236. return smalltalk.withContext(function($ctx2) {
  2237. return _st((16))._ry();
  2238. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2239. _st(self)._should_raise_((function(){
  2240. return smalltalk.withContext(function($ctx2) {
  2241. return _st((16))._rZ();
  2242. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2243. _st(self)._should_raise_((function(){
  2244. return smalltalk.withContext(function($ctx2) {
  2245. return _st((16))._rz();
  2246. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2247. _st(self)._should_raise_((function(){
  2248. return smalltalk.withContext(function($ctx2) {
  2249. return _st((11259375))._Z();
  2250. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2251. return self}, function($ctx1) {$ctx1.fill(self,"testInvalidHexNumbers",{},smalltalk.NumberTest)})},
  2252. 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"]}),
  2253. smalltalk.NumberTest);
  2254. smalltalk.addMethod(
  2255. smalltalk.method({
  2256. selector: "testMinMax",
  2257. fn: function (){
  2258. var self=this;
  2259. return smalltalk.withContext(function($ctx1) {
  2260. _st(self)._assert_equals_(_st((2))._max_((5)),(5));
  2261. _st(self)._assert_equals_(_st((2))._min_((5)),(2));
  2262. return self}, function($ctx1) {$ctx1.fill(self,"testMinMax",{},smalltalk.NumberTest)})},
  2263. messageSends: ["assert:equals:", "max:", "min:"]}),
  2264. smalltalk.NumberTest);
  2265. smalltalk.addMethod(
  2266. smalltalk.method({
  2267. selector: "testNegated",
  2268. fn: function (){
  2269. var self=this;
  2270. return smalltalk.withContext(function($ctx1) {
  2271. _st(self)._assert_equals_(_st((3))._negated(),(-3));
  2272. _st(self)._assert_equals_(_st((-3))._negated(),(3));
  2273. return self}, function($ctx1) {$ctx1.fill(self,"testNegated",{},smalltalk.NumberTest)})},
  2274. messageSends: ["assert:equals:", "negated"]}),
  2275. smalltalk.NumberTest);
  2276. smalltalk.addMethod(
  2277. smalltalk.method({
  2278. selector: "testPrintShowingDecimalPlaces",
  2279. fn: function (){
  2280. var self=this;
  2281. return smalltalk.withContext(function($ctx1) {
  2282. _st(self)._assert_equals_(_st((23))._printShowingDecimalPlaces_((2)),"23.00");
  2283. _st(self)._assert_equals_(_st((23.5698))._printShowingDecimalPlaces_((2)),"23.57");
  2284. _st(self)._assert_equals_(_st(_st((234.567))._negated())._printShowingDecimalPlaces_((5)),"-234.56700");
  2285. _st(self)._assert_equals_(_st((23.4567))._printShowingDecimalPlaces_((0)),"23");
  2286. _st(self)._assert_equals_(_st((23.5567))._printShowingDecimalPlaces_((0)),"24");
  2287. _st(self)._assert_equals_(_st(_st((23.4567))._negated())._printShowingDecimalPlaces_((0)),"-23");
  2288. _st(self)._assert_equals_(_st(_st((23.5567))._negated())._printShowingDecimalPlaces_((0)),"-24");
  2289. _st(self)._assert_equals_(_st((100000000))._printShowingDecimalPlaces_((1)),"100000000.0");
  2290. _st(self)._assert_equals_(_st((0.98))._printShowingDecimalPlaces_((5)),"0.98000");
  2291. _st(self)._assert_equals_(_st(_st((0.98))._negated())._printShowingDecimalPlaces_((2)),"-0.98");
  2292. _st(self)._assert_equals_(_st((2.567))._printShowingDecimalPlaces_((2)),"2.57");
  2293. _st(self)._assert_equals_(_st((-2.567))._printShowingDecimalPlaces_((2)),"-2.57");
  2294. _st(self)._assert_equals_(_st((0))._printShowingDecimalPlaces_((2)),"0.00");
  2295. return self}, function($ctx1) {$ctx1.fill(self,"testPrintShowingDecimalPlaces",{},smalltalk.NumberTest)})},
  2296. messageSends: ["assert:equals:", "printShowingDecimalPlaces:", "negated"]}),
  2297. smalltalk.NumberTest);
  2298. smalltalk.addMethod(
  2299. smalltalk.method({
  2300. selector: "testRounded",
  2301. fn: function (){
  2302. var self=this;
  2303. return smalltalk.withContext(function($ctx1) {
  2304. _st(self)._assert_equals_(_st((3))._rounded(),(3));
  2305. _st(self)._assert_equals_(_st((3.212))._rounded(),(3));
  2306. _st(self)._assert_equals_(_st((3.51))._rounded(),(4));
  2307. return self}, function($ctx1) {$ctx1.fill(self,"testRounded",{},smalltalk.NumberTest)})},
  2308. messageSends: ["assert:equals:", "rounded"]}),
  2309. smalltalk.NumberTest);
  2310. smalltalk.addMethod(
  2311. smalltalk.method({
  2312. selector: "testSqrt",
  2313. fn: function (){
  2314. var self=this;
  2315. return smalltalk.withContext(function($ctx1) {
  2316. _st(self)._assert_equals_(_st((4))._sqrt(),(2));
  2317. _st(self)._assert_equals_(_st((16))._sqrt(),(4));
  2318. return self}, function($ctx1) {$ctx1.fill(self,"testSqrt",{},smalltalk.NumberTest)})},
  2319. messageSends: ["assert:equals:", "sqrt"]}),
  2320. smalltalk.NumberTest);
  2321. smalltalk.addMethod(
  2322. smalltalk.method({
  2323. selector: "testSquared",
  2324. fn: function (){
  2325. var self=this;
  2326. return smalltalk.withContext(function($ctx1) {
  2327. _st(self)._assert_equals_(_st((4))._squared(),(16));
  2328. return self}, function($ctx1) {$ctx1.fill(self,"testSquared",{},smalltalk.NumberTest)})},
  2329. messageSends: ["assert:equals:", "squared"]}),
  2330. smalltalk.NumberTest);
  2331. smalltalk.addMethod(
  2332. smalltalk.method({
  2333. selector: "testTimesRepeat",
  2334. fn: function (){
  2335. var self=this;
  2336. var i;
  2337. return smalltalk.withContext(function($ctx1) {
  2338. i=(0);
  2339. _st((0))._timesRepeat_((function(){
  2340. return smalltalk.withContext(function($ctx2) {
  2341. i=_st(i).__plus((1));
  2342. return i;
  2343. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2344. _st(self)._assert_equals_(i,(0));
  2345. _st((5))._timesRepeat_((function(){
  2346. return smalltalk.withContext(function($ctx2) {
  2347. i=_st(i).__plus((1));
  2348. return i;
  2349. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2350. _st(self)._assert_equals_(i,(5));
  2351. return self}, function($ctx1) {$ctx1.fill(self,"testTimesRepeat",{i:i},smalltalk.NumberTest)})},
  2352. messageSends: ["timesRepeat:", "+", "assert:equals:"]}),
  2353. smalltalk.NumberTest);
  2354. smalltalk.addMethod(
  2355. smalltalk.method({
  2356. selector: "testTo",
  2357. fn: function (){
  2358. var self=this;
  2359. return smalltalk.withContext(function($ctx1) {
  2360. _st(self)._assert_equals_(_st((1))._to_((5)),[(1), (2), (3), (4), (5)]);
  2361. return self}, function($ctx1) {$ctx1.fill(self,"testTo",{},smalltalk.NumberTest)})},
  2362. messageSends: ["assert:equals:", "to:"]}),
  2363. smalltalk.NumberTest);
  2364. smalltalk.addMethod(
  2365. smalltalk.method({
  2366. selector: "testToBy",
  2367. fn: function (){
  2368. var self=this;
  2369. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  2370. return smalltalk.withContext(function($ctx1) {
  2371. _st(self)._assert_equals_(_st((0))._to_by_((6),(2)),[(0), (2), (4), (6)]);
  2372. _st(self)._should_raise_((function(){
  2373. return smalltalk.withContext(function($ctx2) {
  2374. return _st((1))._to_by_((4),(0));
  2375. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$Error());
  2376. return self}, function($ctx1) {$ctx1.fill(self,"testToBy",{},smalltalk.NumberTest)})},
  2377. messageSends: ["assert:equals:", "to:by:", "should:raise:"]}),
  2378. smalltalk.NumberTest);
  2379. smalltalk.addMethod(
  2380. smalltalk.method({
  2381. selector: "testTruncated",
  2382. fn: function (){
  2383. var self=this;
  2384. return smalltalk.withContext(function($ctx1) {
  2385. _st(self)._assert_equals_(_st((3))._truncated(),(3));
  2386. _st(self)._assert_equals_(_st((3.212))._truncated(),(3));
  2387. _st(self)._assert_equals_(_st((3.51))._truncated(),(3));
  2388. return self}, function($ctx1) {$ctx1.fill(self,"testTruncated",{},smalltalk.NumberTest)})},
  2389. messageSends: ["assert:equals:", "truncated"]}),
  2390. smalltalk.NumberTest);
  2391. smalltalk.addClass('ObjectMock', smalltalk.Object, ['foo', 'bar'], 'Kernel-Tests');
  2392. smalltalk.addMethod(
  2393. smalltalk.method({
  2394. selector: "foo",
  2395. fn: function (){
  2396. var self=this;
  2397. return smalltalk.withContext(function($ctx1) {
  2398. var $1;
  2399. $1=self["@foo"];
  2400. return $1;
  2401. }, function($ctx1) {$ctx1.fill(self,"foo",{},smalltalk.ObjectMock)})},
  2402. messageSends: []}),
  2403. smalltalk.ObjectMock);
  2404. smalltalk.addMethod(
  2405. smalltalk.method({
  2406. selector: "foo:",
  2407. fn: function (anObject){
  2408. var self=this;
  2409. return smalltalk.withContext(function($ctx1) {
  2410. self["@foo"]=anObject;
  2411. return self}, function($ctx1) {$ctx1.fill(self,"foo:",{anObject:anObject},smalltalk.ObjectMock)})},
  2412. messageSends: []}),
  2413. smalltalk.ObjectMock);
  2414. smalltalk.addClass('ObjectTest', smalltalk.TestCase, [], 'Kernel-Tests');
  2415. smalltalk.addMethod(
  2416. smalltalk.method({
  2417. selector: "notDefined",
  2418. fn: function (){
  2419. var self=this;
  2420. return smalltalk.withContext(function($ctx1) {
  2421. return undefined;;
  2422. return self}, function($ctx1) {$ctx1.fill(self,"notDefined",{},smalltalk.ObjectTest)})},
  2423. messageSends: []}),
  2424. smalltalk.ObjectTest);
  2425. smalltalk.addMethod(
  2426. smalltalk.method({
  2427. selector: "testBasicAccess",
  2428. fn: function (){
  2429. var self=this;
  2430. var o;
  2431. function $Object(){return smalltalk.Object||(typeof Object=="undefined"?nil:Object)}
  2432. return smalltalk.withContext(function($ctx1) {
  2433. o=_st($Object())._new();
  2434. _st(o)._basicAt_put_("a",(1));
  2435. _st(self)._assert_equals_(_st(o)._basicAt_("a"),(1));
  2436. _st(self)._assert_equals_(_st(o)._basicAt_("b"),nil);
  2437. return self}, function($ctx1) {$ctx1.fill(self,"testBasicAccess",{o:o},smalltalk.ObjectTest)})},
  2438. messageSends: ["new", "basicAt:put:", "assert:equals:", "basicAt:"]}),
  2439. smalltalk.ObjectTest);
  2440. smalltalk.addMethod(
  2441. smalltalk.method({
  2442. selector: "testBasicPerform",
  2443. fn: function (){
  2444. var self=this;
  2445. var o;
  2446. function $Object(){return smalltalk.Object||(typeof Object=="undefined"?nil:Object)}
  2447. return smalltalk.withContext(function($ctx1) {
  2448. o=_st($Object())._new();
  2449. _st(o)._basicAt_put_("func",(function(){
  2450. return smalltalk.withContext(function($ctx2) {
  2451. return "hello";
  2452. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2453. _st(o)._basicAt_put_("func2",(function(a){
  2454. return smalltalk.withContext(function($ctx2) {
  2455. return _st(a).__plus((1));
  2456. }, function($ctx2) {$ctx2.fillBlock({a:a},$ctx1)})}));
  2457. _st(self)._assert_equals_(_st(o)._basicPerform_("func"),"hello");
  2458. _st(self)._assert_equals_(_st(o)._basicPerform_withArguments_("func2",[(3)]),(4));
  2459. return self}, function($ctx1) {$ctx1.fill(self,"testBasicPerform",{o:o},smalltalk.ObjectTest)})},
  2460. messageSends: ["new", "basicAt:put:", "+", "assert:equals:", "basicPerform:", "basicPerform:withArguments:"]}),
  2461. smalltalk.ObjectTest);
  2462. smalltalk.addMethod(
  2463. smalltalk.method({
  2464. selector: "testDNU",
  2465. fn: function (){
  2466. var self=this;
  2467. function $Object(){return smalltalk.Object||(typeof Object=="undefined"?nil:Object)}
  2468. function $MessageNotUnderstood(){return smalltalk.MessageNotUnderstood||(typeof MessageNotUnderstood=="undefined"?nil:MessageNotUnderstood)}
  2469. return smalltalk.withContext(function($ctx1) {
  2470. _st(self)._should_raise_((function(){
  2471. return smalltalk.withContext(function($ctx2) {
  2472. return _st(_st($Object())._new())._foo();
  2473. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$MessageNotUnderstood());
  2474. return self}, function($ctx1) {$ctx1.fill(self,"testDNU",{},smalltalk.ObjectTest)})},
  2475. messageSends: ["should:raise:", "foo", "new"]}),
  2476. smalltalk.ObjectTest);
  2477. smalltalk.addMethod(
  2478. smalltalk.method({
  2479. selector: "testEquality",
  2480. fn: function (){
  2481. var self=this;
  2482. var o;
  2483. function $Object(){return smalltalk.Object||(typeof Object=="undefined"?nil:Object)}
  2484. return smalltalk.withContext(function($ctx1) {
  2485. o=_st($Object())._new();
  2486. _st(self)._deny_(_st(o).__eq(_st($Object())._new()));
  2487. _st(self)._assert_(_st(o).__eq(o));
  2488. _st(self)._assert_(_st(_st(o)._yourself()).__eq(o));
  2489. _st(self)._assert_(_st(o).__eq(_st(o)._yourself()));
  2490. return self}, function($ctx1) {$ctx1.fill(self,"testEquality",{o:o},smalltalk.ObjectTest)})},
  2491. messageSends: ["new", "deny:", "=", "assert:", "yourself"]}),
  2492. smalltalk.ObjectTest);
  2493. smalltalk.addMethod(
  2494. smalltalk.method({
  2495. selector: "testHalt",
  2496. fn: function (){
  2497. var self=this;
  2498. function $Object(){return smalltalk.Object||(typeof Object=="undefined"?nil:Object)}
  2499. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  2500. return smalltalk.withContext(function($ctx1) {
  2501. _st(self)._should_raise_((function(){
  2502. return smalltalk.withContext(function($ctx2) {
  2503. return _st(_st($Object())._new())._halt();
  2504. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$Error());
  2505. return self}, function($ctx1) {$ctx1.fill(self,"testHalt",{},smalltalk.ObjectTest)})},
  2506. messageSends: ["should:raise:", "halt", "new"]}),
  2507. smalltalk.ObjectTest);
  2508. smalltalk.addMethod(
  2509. smalltalk.method({
  2510. selector: "testIdentity",
  2511. fn: function (){
  2512. var self=this;
  2513. var o;
  2514. function $Object(){return smalltalk.Object||(typeof Object=="undefined"?nil:Object)}
  2515. return smalltalk.withContext(function($ctx1) {
  2516. o=_st($Object())._new();
  2517. _st(self)._deny_(_st(o).__eq_eq(_st($Object())._new()));
  2518. _st(self)._assert_(_st(o).__eq_eq(o));
  2519. _st(self)._assert_(_st(_st(o)._yourself()).__eq_eq(o));
  2520. _st(self)._assert_(_st(o).__eq_eq(_st(o)._yourself()));
  2521. return self}, function($ctx1) {$ctx1.fill(self,"testIdentity",{o:o},smalltalk.ObjectTest)})},
  2522. messageSends: ["new", "deny:", "==", "assert:", "yourself"]}),
  2523. smalltalk.ObjectTest);
  2524. smalltalk.addMethod(
  2525. smalltalk.method({
  2526. selector: "testIfNil",
  2527. fn: function (){
  2528. var self=this;
  2529. function $Object(){return smalltalk.Object||(typeof Object=="undefined"?nil:Object)}
  2530. return smalltalk.withContext(function($ctx1) {
  2531. var $1,$4,$3,$2,$5,$7,$6,$8,$10,$9,$11,$13,$12;
  2532. _st(self)._deny_(_st(_st($Object())._new())._isNil());
  2533. $1=self;
  2534. $4=_st($Object())._new();
  2535. if(($receiver = $4) == nil || $receiver == undefined){
  2536. $3=true;
  2537. } else {
  2538. $3=$4;
  2539. };
  2540. $2=_st($3).__eq(true);
  2541. _st($1)._deny_($2);
  2542. $5=self;
  2543. $7=_st($Object())._new();
  2544. if(($receiver = $7) == nil || $receiver == undefined){
  2545. $6=$7;
  2546. } else {
  2547. $6=true;
  2548. };
  2549. _st($5)._assert_equals_($6,true);
  2550. $8=self;
  2551. $10=_st($Object())._new();
  2552. if(($receiver = $10) == nil || $receiver == undefined){
  2553. $9=false;
  2554. } else {
  2555. $9=true;
  2556. };
  2557. _st($8)._assert_equals_($9,true);
  2558. $11=self;
  2559. $13=_st($Object())._new();
  2560. if(($receiver = $13) == nil || $receiver == undefined){
  2561. $12=false;
  2562. } else {
  2563. $12=true;
  2564. };
  2565. _st($11)._assert_equals_($12,true);
  2566. return self}, function($ctx1) {$ctx1.fill(self,"testIfNil",{},smalltalk.ObjectTest)})},
  2567. messageSends: ["deny:", "isNil", "new", "=", "ifNil:", "assert:equals:", "ifNotNil:", "ifNil:ifNotNil:", "ifNotNil:ifNil:"]}),
  2568. smalltalk.ObjectTest);
  2569. smalltalk.addMethod(
  2570. smalltalk.method({
  2571. selector: "testInstVars",
  2572. fn: function (){
  2573. var self=this;
  2574. var o;
  2575. function $ObjectMock(){return smalltalk.ObjectMock||(typeof ObjectMock=="undefined"?nil:ObjectMock)}
  2576. return smalltalk.withContext(function($ctx1) {
  2577. o=_st($ObjectMock())._new();
  2578. _st(self)._assert_equals_(_st(o)._instVarAt_("foo"),nil);
  2579. _st(o)._instVarAt_put_("foo",(1));
  2580. _st(self)._assert_equals_(_st(o)._instVarAt_("foo"),(1));
  2581. _st(self)._assert_equals_(_st(o)._instVarAt_("foo"),(1));
  2582. return self}, function($ctx1) {$ctx1.fill(self,"testInstVars",{o:o},smalltalk.ObjectTest)})},
  2583. messageSends: ["new", "assert:equals:", "instVarAt:", "instVarAt:put:"]}),
  2584. smalltalk.ObjectTest);
  2585. smalltalk.addMethod(
  2586. smalltalk.method({
  2587. selector: "testNilUndefined",
  2588. fn: function (){
  2589. var self=this;
  2590. return smalltalk.withContext(function($ctx1) {
  2591. _st(self)._assert_equals_(_st(self)._notDefined(),nil);
  2592. return self}, function($ctx1) {$ctx1.fill(self,"testNilUndefined",{},smalltalk.ObjectTest)})},
  2593. messageSends: ["assert:equals:", "notDefined"]}),
  2594. smalltalk.ObjectTest);
  2595. smalltalk.addMethod(
  2596. smalltalk.method({
  2597. selector: "testYourself",
  2598. fn: function (){
  2599. var self=this;
  2600. var o;
  2601. function $ObjectMock(){return smalltalk.ObjectMock||(typeof ObjectMock=="undefined"?nil:ObjectMock)}
  2602. return smalltalk.withContext(function($ctx1) {
  2603. o=_st($ObjectMock())._new();
  2604. _st(self)._assert_(_st(_st(o)._yourself()).__eq_eq(o));
  2605. return self}, function($ctx1) {$ctx1.fill(self,"testYourself",{o:o},smalltalk.ObjectTest)})},
  2606. messageSends: ["new", "assert:", "==", "yourself"]}),
  2607. smalltalk.ObjectTest);
  2608. smalltalk.addMethod(
  2609. smalltalk.method({
  2610. selector: "testidentityHash",
  2611. fn: function (){
  2612. var self=this;
  2613. var o1,o2;
  2614. function $Object(){return smalltalk.Object||(typeof Object=="undefined"?nil:Object)}
  2615. return smalltalk.withContext(function($ctx1) {
  2616. o1=_st($Object())._new();
  2617. o2=_st($Object())._new();
  2618. _st(self)._assert_(_st(_st(o1)._identityHash()).__eq_eq(_st(o1)._identityHash()));
  2619. _st(self)._deny_(_st(_st(o1)._identityHash()).__eq_eq(_st(o2)._identityHash()));
  2620. return self}, function($ctx1) {$ctx1.fill(self,"testidentityHash",{o1:o1,o2:o2},smalltalk.ObjectTest)})},
  2621. messageSends: ["new", "assert:", "==", "identityHash", "deny:"]}),
  2622. smalltalk.ObjectTest);
  2623. smalltalk.addClass('PackageTest', smalltalk.TestCase, ['zorkPackage', 'grulPackage', 'backUpCommitPathJs', 'backUpCommitPathSt'], 'Kernel-Tests');
  2624. smalltalk.addMethod(
  2625. smalltalk.method({
  2626. selector: "setUp",
  2627. fn: function (){
  2628. var self=this;
  2629. function $Package(){return smalltalk.Package||(typeof Package=="undefined"?nil:Package)}
  2630. return smalltalk.withContext(function($ctx1) {
  2631. var $1,$2;
  2632. self["@backUpCommitPathJs"]=_st($Package())._defaultCommitPathJs();
  2633. self["@backUpCommitPathSt"]=_st($Package())._defaultCommitPathSt();
  2634. _st($Package())._resetCommitPaths();
  2635. self["@zorkPackage"]=_st(_st($Package())._new())._name_("Zork");
  2636. $1=_st($Package())._new();
  2637. _st($1)._name_("Grul");
  2638. _st($1)._commitPathJs_("server/grul/js");
  2639. _st($1)._commitPathSt_("grul/st");
  2640. $2=_st($1)._yourself();
  2641. self["@grulPackage"]=$2;
  2642. return self}, function($ctx1) {$ctx1.fill(self,"setUp",{},smalltalk.PackageTest)})},
  2643. messageSends: ["defaultCommitPathJs", "defaultCommitPathSt", "resetCommitPaths", "name:", "new", "commitPathJs:", "commitPathSt:", "yourself"]}),
  2644. smalltalk.PackageTest);
  2645. smalltalk.addMethod(
  2646. smalltalk.method({
  2647. selector: "tearDown",
  2648. fn: function (){
  2649. var self=this;
  2650. function $Package(){return smalltalk.Package||(typeof Package=="undefined"?nil:Package)}
  2651. return smalltalk.withContext(function($ctx1) {
  2652. var $1,$2;
  2653. $1=$Package();
  2654. _st($1)._defaultCommitPathJs_(self["@backUpCommitPathJs"]);
  2655. $2=_st($1)._defaultCommitPathSt_(self["@backUpCommitPathSt"]);
  2656. return self}, function($ctx1) {$ctx1.fill(self,"tearDown",{},smalltalk.PackageTest)})},
  2657. messageSends: ["defaultCommitPathJs:", "defaultCommitPathSt:"]}),
  2658. smalltalk.PackageTest);
  2659. smalltalk.addMethod(
  2660. smalltalk.method({
  2661. selector: "testGrulCommitPathJsShouldBeServerGrulJs",
  2662. fn: function (){
  2663. var self=this;
  2664. return smalltalk.withContext(function($ctx1) {
  2665. _st(self)._assert_equals_(_st(self["@grulPackage"])._commitPathJs(),"server/grul/js");
  2666. return self}, function($ctx1) {$ctx1.fill(self,"testGrulCommitPathJsShouldBeServerGrulJs",{},smalltalk.PackageTest)})},
  2667. messageSends: ["assert:equals:", "commitPathJs"]}),
  2668. smalltalk.PackageTest);
  2669. smalltalk.addMethod(
  2670. smalltalk.method({
  2671. selector: "testGrulCommitPathStShouldBeGrulSt",
  2672. fn: function (){
  2673. var self=this;
  2674. return smalltalk.withContext(function($ctx1) {
  2675. _st(self)._assert_equals_(_st(self["@grulPackage"])._commitPathSt(),"grul/st");
  2676. return self}, function($ctx1) {$ctx1.fill(self,"testGrulCommitPathStShouldBeGrulSt",{},smalltalk.PackageTest)})},
  2677. messageSends: ["assert:equals:", "commitPathSt"]}),
  2678. smalltalk.PackageTest);
  2679. smalltalk.addMethod(
  2680. smalltalk.method({
  2681. selector: "testZorkCommitPathJsShouldBeJs",
  2682. fn: function (){
  2683. var self=this;
  2684. return smalltalk.withContext(function($ctx1) {
  2685. _st(self)._assert_equals_(_st(self["@zorkPackage"])._commitPathJs(),"js");
  2686. return self}, function($ctx1) {$ctx1.fill(self,"testZorkCommitPathJsShouldBeJs",{},smalltalk.PackageTest)})},
  2687. messageSends: ["assert:equals:", "commitPathJs"]}),
  2688. smalltalk.PackageTest);
  2689. smalltalk.addMethod(
  2690. smalltalk.method({
  2691. selector: "testZorkCommitPathStShouldBeSt",
  2692. fn: function (){
  2693. var self=this;
  2694. return smalltalk.withContext(function($ctx1) {
  2695. _st(self)._assert_equals_(_st(self["@zorkPackage"])._commitPathSt(),"st");
  2696. return self}, function($ctx1) {$ctx1.fill(self,"testZorkCommitPathStShouldBeSt",{},smalltalk.PackageTest)})},
  2697. messageSends: ["assert:equals:", "commitPathSt"]}),
  2698. smalltalk.PackageTest);
  2699. smalltalk.addClass('PackageWithDefaultCommitPathChangedTest', smalltalk.PackageTest, [], 'Kernel-Tests');
  2700. smalltalk.addMethod(
  2701. smalltalk.method({
  2702. selector: "setUp",
  2703. fn: function (){
  2704. var self=this;
  2705. function $Package(){return smalltalk.Package||(typeof Package=="undefined"?nil:Package)}
  2706. return smalltalk.withContext(function($ctx1) {
  2707. var $1,$2;
  2708. smalltalk.PackageTest.fn.prototype._setUp.apply(_st(self), []);
  2709. $1=$Package();
  2710. _st($1)._defaultCommitPathJs_("javascripts/");
  2711. $2=_st($1)._defaultCommitPathSt_("smalltalk/");
  2712. return self}, function($ctx1) {$ctx1.fill(self,"setUp",{},smalltalk.PackageWithDefaultCommitPathChangedTest)})},
  2713. messageSends: ["setUp", "defaultCommitPathJs:", "defaultCommitPathSt:"]}),
  2714. smalltalk.PackageWithDefaultCommitPathChangedTest);
  2715. smalltalk.addMethod(
  2716. smalltalk.method({
  2717. selector: "testGrulCommitPathJsShouldBeServerGrulJs",
  2718. fn: function (){
  2719. var self=this;
  2720. return smalltalk.withContext(function($ctx1) {
  2721. _st(self)._assert_equals_(_st(self["@grulPackage"])._commitPathJs(),"server/grul/js");
  2722. return self}, function($ctx1) {$ctx1.fill(self,"testGrulCommitPathJsShouldBeServerGrulJs",{},smalltalk.PackageWithDefaultCommitPathChangedTest)})},
  2723. messageSends: ["assert:equals:", "commitPathJs"]}),
  2724. smalltalk.PackageWithDefaultCommitPathChangedTest);
  2725. smalltalk.addMethod(
  2726. smalltalk.method({
  2727. selector: "testGrulCommitPathStShouldBeGrulSt",
  2728. fn: function (){
  2729. var self=this;
  2730. return smalltalk.withContext(function($ctx1) {
  2731. _st(self)._assert_equals_(_st(self["@grulPackage"])._commitPathSt(),"grul/st");
  2732. return self}, function($ctx1) {$ctx1.fill(self,"testGrulCommitPathStShouldBeGrulSt",{},smalltalk.PackageWithDefaultCommitPathChangedTest)})},
  2733. messageSends: ["assert:equals:", "commitPathSt"]}),
  2734. smalltalk.PackageWithDefaultCommitPathChangedTest);
  2735. smalltalk.addMethod(
  2736. smalltalk.method({
  2737. selector: "testZorkCommitPathJsShouldBeJavascript",
  2738. fn: function (){
  2739. var self=this;
  2740. return smalltalk.withContext(function($ctx1) {
  2741. _st(self)._assert_equals_(_st(self["@zorkPackage"])._commitPathJs(),"javascripts/");
  2742. return self}, function($ctx1) {$ctx1.fill(self,"testZorkCommitPathJsShouldBeJavascript",{},smalltalk.PackageWithDefaultCommitPathChangedTest)})},
  2743. messageSends: ["assert:equals:", "commitPathJs"]}),
  2744. smalltalk.PackageWithDefaultCommitPathChangedTest);
  2745. smalltalk.addMethod(
  2746. smalltalk.method({
  2747. selector: "testZorkCommitPathStShouldBeSmalltalk",
  2748. fn: function (){
  2749. var self=this;
  2750. return smalltalk.withContext(function($ctx1) {
  2751. _st(self)._assert_equals_(_st(self["@zorkPackage"])._commitPathSt(),"smalltalk/");
  2752. return self}, function($ctx1) {$ctx1.fill(self,"testZorkCommitPathStShouldBeSmalltalk",{},smalltalk.PackageWithDefaultCommitPathChangedTest)})},
  2753. messageSends: ["assert:equals:", "commitPathSt"]}),
  2754. smalltalk.PackageWithDefaultCommitPathChangedTest);
  2755. smalltalk.addMethod(
  2756. smalltalk.method({
  2757. selector: "shouldInheritSelectors",
  2758. fn: function (){
  2759. var self=this;
  2760. return smalltalk.withContext(function($ctx1) {
  2761. return false;
  2762. }, function($ctx1) {$ctx1.fill(self,"shouldInheritSelectors",{},smalltalk.PackageWithDefaultCommitPathChangedTest.klass)})},
  2763. messageSends: []}),
  2764. smalltalk.PackageWithDefaultCommitPathChangedTest.klass);
  2765. smalltalk.addClass('PointTest', smalltalk.TestCase, [], 'Kernel-Tests');
  2766. smalltalk.addMethod(
  2767. smalltalk.method({
  2768. selector: "testAccessing",
  2769. fn: function (){
  2770. var self=this;
  2771. function $Point(){return smalltalk.Point||(typeof Point=="undefined"?nil:Point)}
  2772. return smalltalk.withContext(function($ctx1) {
  2773. _st(self)._assert_equals_(_st(_st($Point())._x_y_((3),(4)))._x(),(3));
  2774. _st(self)._assert_equals_(_st(_st($Point())._x_y_((3),(4)))._y(),(4));
  2775. _st(self)._assert_equals_(_st(_st(_st($Point())._new())._x_((3)))._x(),(3));
  2776. _st(self)._assert_equals_(_st(_st(_st($Point())._new())._y_((4)))._y(),(4));
  2777. return self}, function($ctx1) {$ctx1.fill(self,"testAccessing",{},smalltalk.PointTest)})},
  2778. messageSends: ["assert:equals:", "x", "x:y:", "y", "x:", "new", "y:"]}),
  2779. smalltalk.PointTest);
  2780. smalltalk.addMethod(
  2781. smalltalk.method({
  2782. selector: "testArithmetic",
  2783. fn: function (){
  2784. var self=this;
  2785. function $Point(){return smalltalk.Point||(typeof Point=="undefined"?nil:Point)}
  2786. return smalltalk.withContext(function($ctx1) {
  2787. _st(self)._assert_equals_(_st(_st((3)).__at((4))).__star(_st((3)).__at((4))),_st($Point())._x_y_((9),(16)));
  2788. _st(self)._assert_equals_(_st(_st((3)).__at((4))).__plus(_st((3)).__at((4))),_st($Point())._x_y_((6),(8)));
  2789. _st(self)._assert_equals_(_st(_st((3)).__at((4))).__minus(_st((3)).__at((4))),_st($Point())._x_y_((0),(0)));
  2790. _st(self)._assert_equals_(_st(_st((6)).__at((8))).__slash(_st((3)).__at((4))),_st($Point())._x_y_((2),(2)));
  2791. return self}, function($ctx1) {$ctx1.fill(self,"testArithmetic",{},smalltalk.PointTest)})},
  2792. messageSends: ["assert:equals:", "*", "@", "x:y:", "+", "-", "/"]}),
  2793. smalltalk.PointTest);
  2794. smalltalk.addMethod(
  2795. smalltalk.method({
  2796. selector: "testAt",
  2797. fn: function (){
  2798. var self=this;
  2799. function $Point(){return smalltalk.Point||(typeof Point=="undefined"?nil:Point)}
  2800. return smalltalk.withContext(function($ctx1) {
  2801. _st(self)._assert_equals_(_st((3)).__at((4)),_st($Point())._x_y_((3),(4)));
  2802. return self}, function($ctx1) {$ctx1.fill(self,"testAt",{},smalltalk.PointTest)})},
  2803. messageSends: ["assert:equals:", "@", "x:y:"]}),
  2804. smalltalk.PointTest);
  2805. smalltalk.addMethod(
  2806. smalltalk.method({
  2807. selector: "testEgality",
  2808. fn: function (){
  2809. var self=this;
  2810. return smalltalk.withContext(function($ctx1) {
  2811. _st(self)._assert_(_st(_st((3)).__at((4))).__eq(_st((3)).__at((4))));
  2812. _st(self)._deny_(_st(_st((3)).__at((5))).__eq(_st((3)).__at((6))));
  2813. return self}, function($ctx1) {$ctx1.fill(self,"testEgality",{},smalltalk.PointTest)})},
  2814. messageSends: ["assert:", "=", "@", "deny:"]}),
  2815. smalltalk.PointTest);
  2816. smalltalk.addMethod(
  2817. smalltalk.method({
  2818. selector: "testTranslateBy",
  2819. fn: function (){
  2820. var self=this;
  2821. return smalltalk.withContext(function($ctx1) {
  2822. _st(self)._assert_equals_(_st(_st((3)).__at((3)))._translateBy_(_st((0)).__at((1))),_st((3)).__at((4)));
  2823. _st(self)._assert_equals_(_st(_st((3)).__at((3)))._translateBy_(_st((0)).__at(_st((1))._negated())),_st((3)).__at((2)));
  2824. _st(self)._assert_equals_(_st(_st((3)).__at((3)))._translateBy_(_st((2)).__at((3))),_st((5)).__at((6)));
  2825. _st(self)._assert_equals_(_st(_st((3)).__at((3)))._translateBy_(_st(_st((3))._negated()).__at((0))),_st((0)).__at((3)));
  2826. return self}, function($ctx1) {$ctx1.fill(self,"testTranslateBy",{},smalltalk.PointTest)})},
  2827. messageSends: ["assert:equals:", "translateBy:", "@", "negated"]}),
  2828. smalltalk.PointTest);
  2829. smalltalk.addClass('RandomTest', smalltalk.TestCase, [], 'Kernel-Tests');
  2830. smalltalk.addMethod(
  2831. smalltalk.method({
  2832. selector: "textNext",
  2833. fn: function (){
  2834. var self=this;
  2835. function $Random(){return smalltalk.Random||(typeof Random=="undefined"?nil:Random)}
  2836. return smalltalk.withContext(function($ctx1) {
  2837. _st((10000))._timesRepeat_((function(){
  2838. var current,next;
  2839. return smalltalk.withContext(function($ctx2) {
  2840. next=_st(_st($Random())._new())._next();
  2841. next;
  2842. _st(self)._assert_(_st(next).__gt_eq((0)));
  2843. _st(self)._assert_(_st(next).__lt((1)));
  2844. _st(self)._deny_(_st(current).__eq(next));
  2845. return _st(next).__eq(current);
  2846. }, function($ctx2) {$ctx2.fillBlock({current:current,next:next},$ctx1)})}));
  2847. return self}, function($ctx1) {$ctx1.fill(self,"textNext",{},smalltalk.RandomTest)})},
  2848. messageSends: ["timesRepeat:", "next", "new", "assert:", ">=", "<", "deny:", "="]}),
  2849. smalltalk.RandomTest);
  2850. smalltalk.addClass('SetTest', smalltalk.TestCase, [], 'Kernel-Tests');
  2851. smalltalk.addMethod(
  2852. smalltalk.method({
  2853. selector: "testAddRemove",
  2854. fn: function (){
  2855. var self=this;
  2856. var set;
  2857. function $Set(){return smalltalk.Set||(typeof Set=="undefined"?nil:Set)}
  2858. return smalltalk.withContext(function($ctx1) {
  2859. set=_st($Set())._new();
  2860. _st(self)._assert_(_st(set)._isEmpty());
  2861. _st(set)._add_((3));
  2862. _st(self)._assert_(_st(set)._includes_((3)));
  2863. _st(set)._add_((5));
  2864. _st(self)._assert_(_st(set)._includes_((5)));
  2865. _st(set)._remove_((3));
  2866. _st(self)._deny_(_st(set)._includes_((3)));
  2867. return self}, function($ctx1) {$ctx1.fill(self,"testAddRemove",{set:set},smalltalk.SetTest)})},
  2868. messageSends: ["new", "assert:", "isEmpty", "add:", "includes:", "remove:", "deny:"]}),
  2869. smalltalk.SetTest);
  2870. smalltalk.addMethod(
  2871. smalltalk.method({
  2872. selector: "testAt",
  2873. fn: function (){
  2874. var self=this;
  2875. function $Set(){return smalltalk.Set||(typeof Set=="undefined"?nil:Set)}
  2876. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  2877. return smalltalk.withContext(function($ctx1) {
  2878. _st(self)._should_raise_((function(){
  2879. return smalltalk.withContext(function($ctx2) {
  2880. return _st(_st($Set())._new())._at_put_((1),(2));
  2881. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$Error());
  2882. return self}, function($ctx1) {$ctx1.fill(self,"testAt",{},smalltalk.SetTest)})},
  2883. messageSends: ["should:raise:", "at:put:", "new"]}),
  2884. smalltalk.SetTest);
  2885. smalltalk.addMethod(
  2886. smalltalk.method({
  2887. selector: "testCollect",
  2888. fn: function (){
  2889. var self=this;
  2890. return smalltalk.withContext(function($ctx1) {
  2891. _st(self)._assert_equals_(_st(_st([(5), (6), (8)])._asSet())._collect_((function(x){
  2892. return smalltalk.withContext(function($ctx2) {
  2893. return _st(x).__backslash_backslash((3));
  2894. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})})),_st([(0), (2)])._asSet());
  2895. return self}, function($ctx1) {$ctx1.fill(self,"testCollect",{},smalltalk.SetTest)})},
  2896. messageSends: ["assert:equals:", "collect:", "\x5c\x5c", "asSet"]}),
  2897. smalltalk.SetTest);
  2898. smalltalk.addMethod(
  2899. smalltalk.method({
  2900. selector: "testComparing",
  2901. fn: function (){
  2902. var self=this;
  2903. return smalltalk.withContext(function($ctx1) {
  2904. _st(self)._assert_equals_(_st([(0), (2)])._asSet(),_st([(0), (2)])._asSet());
  2905. _st(self)._assert_equals_(_st([(2), (0)])._asSet(),_st([(0), (2)])._asSet());
  2906. _st(self)._deny_(_st(_st([(0), (2), (3)])._asSet()).__eq(_st([(0), (2)])._asSet()));
  2907. _st(self)._deny_(_st(_st([(1), (2)])._asSet()).__eq(_st([(0), (2)])._asSet()));
  2908. return self}, function($ctx1) {$ctx1.fill(self,"testComparing",{},smalltalk.SetTest)})},
  2909. messageSends: ["assert:equals:", "asSet", "deny:", "="]}),
  2910. smalltalk.SetTest);
  2911. smalltalk.addMethod(
  2912. smalltalk.method({
  2913. selector: "testPrintString",
  2914. fn: function (){
  2915. var self=this;
  2916. var set;
  2917. function $Set(){return smalltalk.Set||(typeof Set=="undefined"?nil:Set)}
  2918. return smalltalk.withContext(function($ctx1) {
  2919. var $1,$2,$3,$4;
  2920. set=_st($Set())._new();
  2921. _st(self)._assert_equals_(_st(set)._printString(),"a Set ()");
  2922. $1=set;
  2923. _st($1)._add_((1));
  2924. $2=_st($1)._add_((3));
  2925. _st(self)._assert_equals_(_st(set)._printString(),"a Set (1 3)");
  2926. _st(set)._add_("foo");
  2927. _st(self)._assert_equals_(_st(set)._printString(),"a Set (1 3 'foo')");
  2928. $3=set;
  2929. _st($3)._remove_((1));
  2930. $4=_st($3)._remove_((3));
  2931. _st(self)._assert_equals_(_st(set)._printString(),"a Set ('foo')");
  2932. _st(set)._add_((3));
  2933. _st(self)._assert_equals_(_st(set)._printString(),"a Set ('foo' 3)");
  2934. _st(set)._add_((3));
  2935. _st(self)._assert_equals_(_st(set)._printString(),"a Set ('foo' 3)");
  2936. return self}, function($ctx1) {$ctx1.fill(self,"testPrintString",{set:set},smalltalk.SetTest)})},
  2937. messageSends: ["new", "assert:equals:", "printString", "add:", "remove:"]}),
  2938. smalltalk.SetTest);
  2939. smalltalk.addMethod(
  2940. smalltalk.method({
  2941. selector: "testSize",
  2942. fn: function (){
  2943. var self=this;
  2944. function $Set(){return smalltalk.Set||(typeof Set=="undefined"?nil:Set)}
  2945. return smalltalk.withContext(function($ctx1) {
  2946. _st(self)._assert_equals_(_st(_st($Set())._new())._size(),(0));
  2947. _st(self)._assert_equals_(_st(_st($Set())._withAll_([(1), (2), (3), (4)]))._size(),(4));
  2948. _st(self)._assert_equals_(_st(_st($Set())._withAll_([(1), (1), (1), (1)]))._size(),(1));
  2949. return self}, function($ctx1) {$ctx1.fill(self,"testSize",{},smalltalk.SetTest)})},
  2950. messageSends: ["assert:equals:", "size", "new", "withAll:"]}),
  2951. smalltalk.SetTest);
  2952. smalltalk.addMethod(
  2953. smalltalk.method({
  2954. selector: "testUnicity",
  2955. fn: function (){
  2956. var self=this;
  2957. var set;
  2958. function $Set(){return smalltalk.Set||(typeof Set=="undefined"?nil:Set)}
  2959. return smalltalk.withContext(function($ctx1) {
  2960. set=_st($Set())._new();
  2961. _st(set)._add_((21));
  2962. _st(set)._add_("hello");
  2963. _st(set)._add_((21));
  2964. _st(self)._assert_equals_(_st(set)._size(),(2));
  2965. _st(set)._add_("hello");
  2966. _st(self)._assert_equals_(_st(set)._size(),(2));
  2967. _st(self)._assert_equals_(_st(set)._asArray(),[(21), "hello"]);
  2968. return self}, function($ctx1) {$ctx1.fill(self,"testUnicity",{set:set},smalltalk.SetTest)})},
  2969. messageSends: ["new", "add:", "assert:equals:", "size", "asArray"]}),
  2970. smalltalk.SetTest);
  2971. smalltalk.addClass('StreamTest', smalltalk.TestCase, [], 'Kernel-Tests');
  2972. smalltalk.addMethod(
  2973. smalltalk.method({
  2974. selector: "collectionClass",
  2975. fn: function (){
  2976. var self=this;
  2977. return smalltalk.withContext(function($ctx1) {
  2978. var $1;
  2979. $1=_st(_st(self)._class())._collectionClass();
  2980. return $1;
  2981. }, function($ctx1) {$ctx1.fill(self,"collectionClass",{},smalltalk.StreamTest)})},
  2982. messageSends: ["collectionClass", "class"]}),
  2983. smalltalk.StreamTest);
  2984. smalltalk.addMethod(
  2985. smalltalk.method({
  2986. selector: "newCollection",
  2987. fn: function (){
  2988. var self=this;
  2989. return smalltalk.withContext(function($ctx1) {
  2990. var $1;
  2991. $1=_st(_st(self)._collectionClass())._new();
  2992. return $1;
  2993. }, function($ctx1) {$ctx1.fill(self,"newCollection",{},smalltalk.StreamTest)})},
  2994. messageSends: ["new", "collectionClass"]}),
  2995. smalltalk.StreamTest);
  2996. smalltalk.addMethod(
  2997. smalltalk.method({
  2998. selector: "newStream",
  2999. fn: function (){
  3000. var self=this;
  3001. return smalltalk.withContext(function($ctx1) {
  3002. var $1;
  3003. $1=_st(_st(_st(self)._collectionClass())._new())._stream();
  3004. return $1;
  3005. }, function($ctx1) {$ctx1.fill(self,"newStream",{},smalltalk.StreamTest)})},
  3006. messageSends: ["stream", "new", "collectionClass"]}),
  3007. smalltalk.StreamTest);
  3008. smalltalk.addMethod(
  3009. smalltalk.method({
  3010. selector: "testAtStartAtEnd",
  3011. fn: function (){
  3012. var self=this;
  3013. var stream;
  3014. return smalltalk.withContext(function($ctx1) {
  3015. stream=_st(self)._newStream();
  3016. _st(self)._assert_(_st(stream)._atStart());
  3017. _st(self)._assert_(_st(stream)._atEnd());
  3018. _st(stream)._nextPutAll_(_st(self)._newCollection());
  3019. _st(self)._assert_(_st(stream)._atEnd());
  3020. _st(self)._deny_(_st(stream)._atStart());
  3021. _st(stream)._position_((1));
  3022. _st(self)._deny_(_st(stream)._atEnd());
  3023. _st(self)._deny_(_st(stream)._atStart());
  3024. return self}, function($ctx1) {$ctx1.fill(self,"testAtStartAtEnd",{stream:stream},smalltalk.StreamTest)})},
  3025. messageSends: ["newStream", "assert:", "atStart", "atEnd", "nextPutAll:", "newCollection", "deny:", "position:"]}),
  3026. smalltalk.StreamTest);
  3027. smalltalk.addMethod(
  3028. smalltalk.method({
  3029. selector: "testContents",
  3030. fn: function (){
  3031. var self=this;
  3032. var stream;
  3033. return smalltalk.withContext(function($ctx1) {
  3034. stream=_st(self)._newStream();
  3035. _st(stream)._nextPutAll_(_st(self)._newCollection());
  3036. _st(self)._assert_equals_(_st(stream)._contents(),_st(self)._newCollection());
  3037. return self}, function($ctx1) {$ctx1.fill(self,"testContents",{stream:stream},smalltalk.StreamTest)})},
  3038. messageSends: ["newStream", "nextPutAll:", "newCollection", "assert:equals:", "contents"]}),
  3039. smalltalk.StreamTest);
  3040. smalltalk.addMethod(
  3041. smalltalk.method({
  3042. selector: "testIsEmpty",
  3043. fn: function (){
  3044. var self=this;
  3045. var stream;
  3046. return smalltalk.withContext(function($ctx1) {
  3047. stream=_st(self)._newStream();
  3048. _st(self)._assert_(_st(stream)._isEmpty());
  3049. _st(stream)._nextPutAll_(_st(self)._newCollection());
  3050. _st(self)._deny_(_st(stream)._isEmpty());
  3051. return self}, function($ctx1) {$ctx1.fill(self,"testIsEmpty",{stream:stream},smalltalk.StreamTest)})},
  3052. messageSends: ["newStream", "assert:", "isEmpty", "nextPutAll:", "newCollection", "deny:"]}),
  3053. smalltalk.StreamTest);
  3054. smalltalk.addMethod(
  3055. smalltalk.method({
  3056. selector: "testPosition",
  3057. fn: function (){
  3058. var self=this;
  3059. var collection,stream;
  3060. return smalltalk.withContext(function($ctx1) {
  3061. collection=_st(self)._newCollection();
  3062. stream=_st(self)._newStream();
  3063. _st(stream)._nextPutAll_(collection);
  3064. _st(self)._assert_equals_(_st(stream)._position(),_st(collection)._size());
  3065. _st(stream)._position_((0));
  3066. _st(self)._assert_equals_(_st(stream)._position(),(0));
  3067. _st(stream)._next();
  3068. _st(self)._assert_equals_(_st(stream)._position(),(1));
  3069. _st(stream)._next();
  3070. _st(self)._assert_equals_(_st(stream)._position(),(2));
  3071. return self}, function($ctx1) {$ctx1.fill(self,"testPosition",{collection:collection,stream:stream},smalltalk.StreamTest)})},
  3072. messageSends: ["newCollection", "newStream", "nextPutAll:", "assert:equals:", "position", "size", "position:", "next"]}),
  3073. smalltalk.StreamTest);
  3074. smalltalk.addMethod(
  3075. smalltalk.method({
  3076. selector: "testReading",
  3077. fn: function (){
  3078. var self=this;
  3079. var stream,collection;
  3080. return smalltalk.withContext(function($ctx1) {
  3081. var $1,$2;
  3082. collection=_st(self)._newCollection();
  3083. stream=_st(self)._newStream();
  3084. $1=stream;
  3085. _st($1)._nextPutAll_(collection);
  3086. $2=_st($1)._position_((0));
  3087. _st(collection)._do_((function(each){
  3088. return smalltalk.withContext(function($ctx2) {
  3089. return _st(self)._assert_equals_(_st(stream)._next(),each);
  3090. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  3091. _st(self)._assert_(_st(_st(stream)._next())._isNil());
  3092. return self}, function($ctx1) {$ctx1.fill(self,"testReading",{stream:stream,collection:collection},smalltalk.StreamTest)})},
  3093. messageSends: ["newCollection", "newStream", "nextPutAll:", "position:", "do:", "assert:equals:", "next", "assert:", "isNil"]}),
  3094. smalltalk.StreamTest);
  3095. smalltalk.addMethod(
  3096. smalltalk.method({
  3097. selector: "testStreamContents",
  3098. fn: function (){
  3099. var self=this;
  3100. return smalltalk.withContext(function($ctx1) {
  3101. return self}, function($ctx1) {$ctx1.fill(self,"testStreamContents",{},smalltalk.StreamTest)})},
  3102. messageSends: []}),
  3103. smalltalk.StreamTest);
  3104. smalltalk.addMethod(
  3105. smalltalk.method({
  3106. selector: "testWrite",
  3107. fn: function (){
  3108. var self=this;
  3109. var stream,collection;
  3110. return smalltalk.withContext(function($ctx1) {
  3111. collection=_st(self)._newCollection();
  3112. stream=_st(self)._newStream();
  3113. _st(collection)._do_((function(each){
  3114. return smalltalk.withContext(function($ctx2) {
  3115. return _st(stream).__lt_lt(each);
  3116. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  3117. _st(self)._assert_equals_(_st(stream)._contents(),collection);
  3118. return self}, function($ctx1) {$ctx1.fill(self,"testWrite",{stream:stream,collection:collection},smalltalk.StreamTest)})},
  3119. messageSends: ["newCollection", "newStream", "do:", "<<", "assert:equals:", "contents"]}),
  3120. smalltalk.StreamTest);
  3121. smalltalk.addMethod(
  3122. smalltalk.method({
  3123. selector: "testWriting",
  3124. fn: function (){
  3125. var self=this;
  3126. var stream,collection;
  3127. return smalltalk.withContext(function($ctx1) {
  3128. collection=_st(self)._newCollection();
  3129. stream=_st(self)._newStream();
  3130. _st(collection)._do_((function(each){
  3131. return smalltalk.withContext(function($ctx2) {
  3132. return _st(stream)._nextPut_(each);
  3133. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  3134. _st(self)._assert_equals_(_st(stream)._contents(),collection);
  3135. stream=_st(self)._newStream();
  3136. _st(stream)._nextPutAll_(collection);
  3137. _st(self)._assert_equals_(_st(stream)._contents(),collection);
  3138. return self}, function($ctx1) {$ctx1.fill(self,"testWriting",{stream:stream,collection:collection},smalltalk.StreamTest)})},
  3139. messageSends: ["newCollection", "newStream", "do:", "nextPut:", "assert:equals:", "contents", "nextPutAll:"]}),
  3140. smalltalk.StreamTest);
  3141. smalltalk.addMethod(
  3142. smalltalk.method({
  3143. selector: "collectionClass",
  3144. fn: function (){
  3145. var self=this;
  3146. return smalltalk.withContext(function($ctx1) {
  3147. return nil;
  3148. }, function($ctx1) {$ctx1.fill(self,"collectionClass",{},smalltalk.StreamTest.klass)})},
  3149. messageSends: []}),
  3150. smalltalk.StreamTest.klass);
  3151. smalltalk.addMethod(
  3152. smalltalk.method({
  3153. selector: "isAbstract",
  3154. fn: function (){
  3155. var self=this;
  3156. return smalltalk.withContext(function($ctx1) {
  3157. var $1;
  3158. $1=_st(_st(self)._collectionClass())._isNil();
  3159. return $1;
  3160. }, function($ctx1) {$ctx1.fill(self,"isAbstract",{},smalltalk.StreamTest.klass)})},
  3161. messageSends: ["isNil", "collectionClass"]}),
  3162. smalltalk.StreamTest.klass);
  3163. smalltalk.addClass('ArrayStreamTest', smalltalk.StreamTest, [], 'Kernel-Tests');
  3164. smalltalk.addMethod(
  3165. smalltalk.method({
  3166. selector: "newCollection",
  3167. fn: function (){
  3168. var self=this;
  3169. return smalltalk.withContext(function($ctx1) {
  3170. var $1;
  3171. $1=[true,(1),_st((3)).__at((4)),"foo"];
  3172. return $1;
  3173. }, function($ctx1) {$ctx1.fill(self,"newCollection",{},smalltalk.ArrayStreamTest)})},
  3174. messageSends: ["@"]}),
  3175. smalltalk.ArrayStreamTest);
  3176. smalltalk.addMethod(
  3177. smalltalk.method({
  3178. selector: "collectionClass",
  3179. fn: function (){
  3180. var self=this;
  3181. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  3182. return smalltalk.withContext(function($ctx1) {
  3183. var $1;
  3184. $1=$Array();
  3185. return $1;
  3186. }, function($ctx1) {$ctx1.fill(self,"collectionClass",{},smalltalk.ArrayStreamTest.klass)})},
  3187. messageSends: []}),
  3188. smalltalk.ArrayStreamTest.klass);
  3189. smalltalk.addClass('StringStreamTest', smalltalk.StreamTest, [], 'Kernel-Tests');
  3190. smalltalk.addMethod(
  3191. smalltalk.method({
  3192. selector: "newCollection",
  3193. fn: function (){
  3194. var self=this;
  3195. return smalltalk.withContext(function($ctx1) {
  3196. return "hello world";
  3197. }, function($ctx1) {$ctx1.fill(self,"newCollection",{},smalltalk.StringStreamTest)})},
  3198. messageSends: []}),
  3199. smalltalk.StringStreamTest);
  3200. smalltalk.addMethod(
  3201. smalltalk.method({
  3202. selector: "collectionClass",
  3203. fn: function (){
  3204. var self=this;
  3205. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  3206. return smalltalk.withContext(function($ctx1) {
  3207. var $1;
  3208. $1=$String();
  3209. return $1;
  3210. }, function($ctx1) {$ctx1.fill(self,"collectionClass",{},smalltalk.StringStreamTest.klass)})},
  3211. messageSends: []}),
  3212. smalltalk.StringStreamTest.klass);
  3213. smalltalk.addClass('UndefinedTest', smalltalk.TestCase, [], 'Kernel-Tests');
  3214. smalltalk.addMethod(
  3215. smalltalk.method({
  3216. selector: "testCopying",
  3217. fn: function (){
  3218. var self=this;
  3219. return smalltalk.withContext(function($ctx1) {
  3220. _st(self)._assert_equals_(_st(nil)._copy(),nil);
  3221. return self}, function($ctx1) {$ctx1.fill(self,"testCopying",{},smalltalk.UndefinedTest)})},
  3222. messageSends: ["assert:equals:", "copy"]}),
  3223. smalltalk.UndefinedTest);
  3224. smalltalk.addMethod(
  3225. smalltalk.method({
  3226. selector: "testDeepCopy",
  3227. fn: function (){
  3228. var self=this;
  3229. return smalltalk.withContext(function($ctx1) {
  3230. _st(self)._assert_(_st(_st(nil)._deepCopy()).__eq(nil));
  3231. return self}, function($ctx1) {$ctx1.fill(self,"testDeepCopy",{},smalltalk.UndefinedTest)})},
  3232. messageSends: ["assert:", "=", "deepCopy"]}),
  3233. smalltalk.UndefinedTest);
  3234. smalltalk.addMethod(
  3235. smalltalk.method({
  3236. selector: "testIfNil",
  3237. fn: function (){
  3238. var self=this;
  3239. return smalltalk.withContext(function($ctx1) {
  3240. var $1,$2,$3,$5,$4,$6,$7,$8,$10,$9;
  3241. $1=self;
  3242. if(($receiver = nil) == nil || $receiver == undefined){
  3243. $2=true;
  3244. } else {
  3245. $2=nil;
  3246. };
  3247. _st($1)._assert_equals_($2,true);
  3248. $3=self;
  3249. if(($receiver = nil) == nil || $receiver == undefined){
  3250. $5=nil;
  3251. } else {
  3252. $5=true;
  3253. };
  3254. $4=_st($5).__eq(true);
  3255. _st($3)._deny_($4);
  3256. $6=self;
  3257. if(($receiver = nil) == nil || $receiver == undefined){
  3258. $7=true;
  3259. } else {
  3260. $7=false;
  3261. };
  3262. _st($6)._assert_equals_($7,true);
  3263. $8=self;
  3264. if(($receiver = nil) == nil || $receiver == undefined){
  3265. $10=false;
  3266. } else {
  3267. $10=true;
  3268. };
  3269. $9=_st($10).__eq(true);
  3270. _st($8)._deny_($9);
  3271. return self}, function($ctx1) {$ctx1.fill(self,"testIfNil",{},smalltalk.UndefinedTest)})},
  3272. messageSends: ["assert:equals:", "ifNil:", "deny:", "=", "ifNotNil:", "ifNil:ifNotNil:", "ifNotNil:ifNil:"]}),
  3273. smalltalk.UndefinedTest);
  3274. smalltalk.addMethod(
  3275. smalltalk.method({
  3276. selector: "testIsNil",
  3277. fn: function (){
  3278. var self=this;
  3279. return smalltalk.withContext(function($ctx1) {
  3280. _st(self)._assert_(_st(nil)._isNil());
  3281. _st(self)._deny_(_st(nil)._notNil());
  3282. return self}, function($ctx1) {$ctx1.fill(self,"testIsNil",{},smalltalk.UndefinedTest)})},
  3283. messageSends: ["assert:", "isNil", "deny:", "notNil"]}),
  3284. smalltalk.UndefinedTest);