Kernel-Tests.deploy.js 132 KB

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