Kernel-Tests.js 550 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633
  1. define(["amber/boot", "amber_core/Kernel-Objects", "amber_core/SUnit"], function($boot){"use strict";
  2. if(!$boot.nilAsReceiver)$boot.nilAsReceiver=$boot.nil;
  3. if(!("nilAsValue" in $boot))$boot.nilAsValue=$boot.nilAsReceiver;
  4. var $core=$boot.api,nil=$boot.nilAsValue,$nil=$boot.nilAsReceiver,$recv=$boot.asReceiver,$globals=$boot.globals;
  5. if(!$boot.nilAsClass)$boot.nilAsClass=$boot.dnu;
  6. $core.addPackage("Kernel-Tests");
  7. $core.packages["Kernel-Tests"].innerEval = function (expr) { return eval(expr); };
  8. $core.packages["Kernel-Tests"].transport = {"type":"amd","amdNamespace":"amber_core"};
  9. $core.addClass("AnnouncementSubscriptionTest", $globals.TestCase, [], "Kernel-Tests");
  10. $core.addMethod(
  11. $core.method({
  12. selector: "testAddExtensionMethod",
  13. protocol: "tests",
  14. fn: function (){
  15. var self=this,$self=this;
  16. var method,dirty;
  17. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  18. return $core.withContext(function($ctx1) {
  19. //>>excludeEnd("ctx");
  20. var $2,$1,$4,$3,$5,$8,$7,$6,$9,$10;
  21. $2=$self._class();
  22. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  23. $ctx1.sendIdx["class"]=1;
  24. //>>excludeEnd("ctx");
  25. $1=$recv($2)._package();
  26. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  27. $ctx1.sendIdx["package"]=1;
  28. //>>excludeEnd("ctx");
  29. dirty=$recv($1)._isDirty();
  30. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  31. $ctx1.sendIdx["isDirty"]=1;
  32. //>>excludeEnd("ctx");
  33. $4=$self._class();
  34. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  35. $ctx1.sendIdx["class"]=2;
  36. //>>excludeEnd("ctx");
  37. $3=$recv($4)._package();
  38. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  39. $ctx1.sendIdx["package"]=2;
  40. //>>excludeEnd("ctx");
  41. $recv($3)._beClean();
  42. $5=$self._class();
  43. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  44. $ctx1.sendIdx["class"]=3;
  45. //>>excludeEnd("ctx");
  46. method=$recv($5)._compile_protocol_("doNothing","**not-a-package");
  47. $8=$self._class();
  48. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  49. $ctx1.sendIdx["class"]=4;
  50. //>>excludeEnd("ctx");
  51. $7=$recv($8)._package();
  52. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  53. $ctx1.sendIdx["package"]=3;
  54. //>>excludeEnd("ctx");
  55. $6=$recv($7)._isDirty();
  56. $self._deny_($6);
  57. $9=$self._class();
  58. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  59. $ctx1.sendIdx["class"]=5;
  60. //>>excludeEnd("ctx");
  61. $recv($9)._removeCompiledMethod_(method);
  62. $10=dirty;
  63. if($core.assert($10)){
  64. $recv($recv($self._class())._package())._beDirty();
  65. }
  66. return self;
  67. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  68. }, function($ctx1) {$ctx1.fill(self,"testAddExtensionMethod",{method:method,dirty:dirty},$globals.AnnouncementSubscriptionTest)});
  69. //>>excludeEnd("ctx");
  70. },
  71. //>>excludeStart("ide", pragmas.excludeIdeData);
  72. args: [],
  73. source: "testAddExtensionMethod\x0a\x09| method dirty |\x0a\x09dirty := self class package isDirty.\x0a\x09self class package beClean.\x0a\x09method := self class compile: 'doNothing' protocol: '**not-a-package'.\x0a\x09self deny: self class package isDirty.\x0a\x09\x0a\x09self class removeCompiledMethod: method.\x0a\x09dirty ifTrue: [ self class package beDirty ]",
  74. referencedClasses: [],
  75. //>>excludeEnd("ide");
  76. messageSends: ["isDirty", "package", "class", "beClean", "compile:protocol:", "deny:", "removeCompiledMethod:", "ifTrue:", "beDirty"]
  77. }),
  78. $globals.AnnouncementSubscriptionTest);
  79. $core.addMethod(
  80. $core.method({
  81. selector: "testHandlesAnnouncement",
  82. protocol: "tests",
  83. fn: function (){
  84. var self=this,$self=this;
  85. var subscription,announcementClass1,announcementClass2,classBuilder;
  86. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  87. return $core.withContext(function($ctx1) {
  88. //>>excludeEnd("ctx");
  89. var $1,$2;
  90. classBuilder=$recv($globals.ClassBuilder)._new();
  91. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  92. $ctx1.sendIdx["new"]=1;
  93. //>>excludeEnd("ctx");
  94. announcementClass1=$recv(classBuilder)._basicAddSubclassOf_named_instanceVariableNames_package_($globals.SystemAnnouncement,"TestAnnouncement1",[],"Kernel-Tests");
  95. subscription=$recv($recv($globals.AnnouncementSubscription)._new())._announcementClass_($globals.SystemAnnouncement);
  96. $1=$recv(subscription)._handlesAnnouncement_($globals.SystemAnnouncement);
  97. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  98. $ctx1.sendIdx["handlesAnnouncement:"]=1;
  99. //>>excludeEnd("ctx");
  100. $self._assert_equals_($1,true);
  101. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  102. $ctx1.sendIdx["assert:equals:"]=1;
  103. //>>excludeEnd("ctx");
  104. $2=$recv(subscription)._handlesAnnouncement_(announcementClass1);
  105. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  106. $ctx1.sendIdx["handlesAnnouncement:"]=2;
  107. //>>excludeEnd("ctx");
  108. $self._assert_equals_($2,true);
  109. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  110. $ctx1.sendIdx["assert:equals:"]=2;
  111. //>>excludeEnd("ctx");
  112. $self._assert_equals_($recv(subscription)._handlesAnnouncement_($globals.Object),false);
  113. $recv(classBuilder)._basicRemoveClass_(announcementClass1);
  114. return self;
  115. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  116. }, function($ctx1) {$ctx1.fill(self,"testHandlesAnnouncement",{subscription:subscription,announcementClass1:announcementClass1,announcementClass2:announcementClass2,classBuilder:classBuilder},$globals.AnnouncementSubscriptionTest)});
  117. //>>excludeEnd("ctx");
  118. },
  119. //>>excludeStart("ide", pragmas.excludeIdeData);
  120. args: [],
  121. source: "testHandlesAnnouncement\x0a\x09| subscription announcementClass1 announcementClass2 classBuilder |\x0a\x09\x0a\x09classBuilder := ClassBuilder new.\x0a\x09announcementClass1 := classBuilder basicAddSubclassOf: SystemAnnouncement named: 'TestAnnouncement1' instanceVariableNames: #() package: 'Kernel-Tests'.\x0a\x09\x0a\x09subscription := AnnouncementSubscription new announcementClass: SystemAnnouncement.\x0a\x09\x22Test whether the same class triggers the announcement\x22\x0a\x09self assert: (subscription handlesAnnouncement: SystemAnnouncement) equals: true.\x0a\x09\x22Test whether a subclass triggers the announcement\x22\x0a\x09self assert: (subscription handlesAnnouncement: announcementClass1) equals: true.\x0a\x09\x22Test whether an unrelated class does not trigger the announcement\x22\x0a\x09self assert: (subscription handlesAnnouncement: Object) equals: false.\x0a\x09\x0a\x09classBuilder basicRemoveClass: announcementClass1.",
  122. referencedClasses: ["ClassBuilder", "SystemAnnouncement", "AnnouncementSubscription", "Object"],
  123. //>>excludeEnd("ide");
  124. messageSends: ["new", "basicAddSubclassOf:named:instanceVariableNames:package:", "announcementClass:", "assert:equals:", "handlesAnnouncement:", "basicRemoveClass:"]
  125. }),
  126. $globals.AnnouncementSubscriptionTest);
  127. $core.addClass("AnnouncerTest", $globals.TestCase, [], "Kernel-Tests");
  128. $core.addMethod(
  129. $core.method({
  130. selector: "testOnDo",
  131. protocol: "tests",
  132. fn: function (){
  133. var self=this,$self=this;
  134. var counter,announcer;
  135. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  136. return $core.withContext(function($ctx1) {
  137. //>>excludeEnd("ctx");
  138. var $1,$2;
  139. counter=(0);
  140. announcer=$recv($globals.Announcer)._new();
  141. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  142. $ctx1.sendIdx["new"]=1;
  143. //>>excludeEnd("ctx");
  144. $recv(announcer)._on_do_($globals.SystemAnnouncement,(function(){
  145. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  146. return $core.withContext(function($ctx2) {
  147. //>>excludeEnd("ctx");
  148. counter=$recv(counter).__plus((1));
  149. return counter;
  150. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  151. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  152. //>>excludeEnd("ctx");
  153. }));
  154. $1=announcer;
  155. $2=$recv($globals.SystemAnnouncement)._new();
  156. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  157. $ctx1.sendIdx["new"]=2;
  158. //>>excludeEnd("ctx");
  159. $recv($1)._announce_($2);
  160. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  161. $ctx1.sendIdx["announce:"]=1;
  162. //>>excludeEnd("ctx");
  163. $self._assert_equals_(counter,(1));
  164. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  165. $ctx1.sendIdx["assert:equals:"]=1;
  166. //>>excludeEnd("ctx");
  167. $recv(announcer)._announce_($recv($globals.SystemAnnouncement)._new());
  168. $self._assert_equals_(counter,(2));
  169. return self;
  170. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  171. }, function($ctx1) {$ctx1.fill(self,"testOnDo",{counter:counter,announcer:announcer},$globals.AnnouncerTest)});
  172. //>>excludeEnd("ctx");
  173. },
  174. //>>excludeStart("ide", pragmas.excludeIdeData);
  175. args: [],
  176. source: "testOnDo\x0a\x09| counter announcer |\x0a\x09\x0a\x09counter := 0.\x0a\x09announcer := Announcer new.\x0a\x09announcer on: SystemAnnouncement do: [ counter := counter + 1 ].\x0a\x0a\x09announcer announce: (SystemAnnouncement new).\x0a\x09self assert: counter equals: 1.\x0a\x0a\x09announcer announce: (SystemAnnouncement new).\x0a\x09self assert: counter equals: 2.",
  177. referencedClasses: ["Announcer", "SystemAnnouncement"],
  178. //>>excludeEnd("ide");
  179. messageSends: ["new", "on:do:", "+", "announce:", "assert:equals:"]
  180. }),
  181. $globals.AnnouncerTest);
  182. $core.addMethod(
  183. $core.method({
  184. selector: "testOnDoFor",
  185. protocol: "tests",
  186. fn: function (){
  187. var self=this,$self=this;
  188. var counter,announcer;
  189. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  190. return $core.withContext(function($ctx1) {
  191. //>>excludeEnd("ctx");
  192. var $1,$2,$3,$4;
  193. counter=(0);
  194. announcer=$recv($globals.Announcer)._new();
  195. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  196. $ctx1.sendIdx["new"]=1;
  197. //>>excludeEnd("ctx");
  198. $recv(announcer)._on_do_for_($globals.SystemAnnouncement,(function(){
  199. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  200. return $core.withContext(function($ctx2) {
  201. //>>excludeEnd("ctx");
  202. counter=$recv(counter).__plus((1));
  203. return counter;
  204. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  205. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  206. //>>excludeEnd("ctx");
  207. }),self);
  208. $1=announcer;
  209. $2=$recv($globals.SystemAnnouncement)._new();
  210. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  211. $ctx1.sendIdx["new"]=2;
  212. //>>excludeEnd("ctx");
  213. $recv($1)._announce_($2);
  214. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  215. $ctx1.sendIdx["announce:"]=1;
  216. //>>excludeEnd("ctx");
  217. $self._assert_equals_(counter,(1));
  218. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  219. $ctx1.sendIdx["assert:equals:"]=1;
  220. //>>excludeEnd("ctx");
  221. $3=announcer;
  222. $4=$recv($globals.SystemAnnouncement)._new();
  223. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  224. $ctx1.sendIdx["new"]=3;
  225. //>>excludeEnd("ctx");
  226. $recv($3)._announce_($4);
  227. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  228. $ctx1.sendIdx["announce:"]=2;
  229. //>>excludeEnd("ctx");
  230. $self._assert_equals_(counter,(2));
  231. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  232. $ctx1.sendIdx["assert:equals:"]=2;
  233. //>>excludeEnd("ctx");
  234. $recv(announcer)._unsubscribe_(self);
  235. $recv(announcer)._announce_($recv($globals.SystemAnnouncement)._new());
  236. $self._assert_equals_(counter,(2));
  237. return self;
  238. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  239. }, function($ctx1) {$ctx1.fill(self,"testOnDoFor",{counter:counter,announcer:announcer},$globals.AnnouncerTest)});
  240. //>>excludeEnd("ctx");
  241. },
  242. //>>excludeStart("ide", pragmas.excludeIdeData);
  243. args: [],
  244. source: "testOnDoFor\x0a\x09| counter announcer |\x0a\x09\x0a\x09counter := 0.\x0a\x09announcer := Announcer new.\x0a\x09announcer on: SystemAnnouncement do: [ counter := counter + 1 ] for: self.\x0a\x0a\x09announcer announce: (SystemAnnouncement new).\x0a\x09self assert: counter equals: 1.\x0a\x0a\x09announcer announce: (SystemAnnouncement new).\x0a\x09self assert: counter equals: 2.\x0a\x09\x0a\x09announcer unsubscribe: self.\x0a\x09\x0a\x09announcer announce: (SystemAnnouncement new).\x0a\x09self assert: counter equals: 2.",
  245. referencedClasses: ["Announcer", "SystemAnnouncement"],
  246. //>>excludeEnd("ide");
  247. messageSends: ["new", "on:do:for:", "+", "announce:", "assert:equals:", "unsubscribe:"]
  248. }),
  249. $globals.AnnouncerTest);
  250. $core.addMethod(
  251. $core.method({
  252. selector: "testOnDoOnce",
  253. protocol: "tests",
  254. fn: function (){
  255. var self=this,$self=this;
  256. var counter,announcer;
  257. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  258. return $core.withContext(function($ctx1) {
  259. //>>excludeEnd("ctx");
  260. var $1,$2;
  261. counter=(0);
  262. announcer=$recv($globals.Announcer)._new();
  263. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  264. $ctx1.sendIdx["new"]=1;
  265. //>>excludeEnd("ctx");
  266. $recv(announcer)._on_doOnce_($globals.SystemAnnouncement,(function(){
  267. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  268. return $core.withContext(function($ctx2) {
  269. //>>excludeEnd("ctx");
  270. counter=$recv(counter).__plus((1));
  271. return counter;
  272. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  273. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  274. //>>excludeEnd("ctx");
  275. }));
  276. $1=announcer;
  277. $2=$recv($globals.SystemAnnouncement)._new();
  278. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  279. $ctx1.sendIdx["new"]=2;
  280. //>>excludeEnd("ctx");
  281. $recv($1)._announce_($2);
  282. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  283. $ctx1.sendIdx["announce:"]=1;
  284. //>>excludeEnd("ctx");
  285. $self._assert_equals_(counter,(1));
  286. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  287. $ctx1.sendIdx["assert:equals:"]=1;
  288. //>>excludeEnd("ctx");
  289. $recv(announcer)._announce_($recv($globals.SystemAnnouncement)._new());
  290. $self._assert_equals_(counter,(1));
  291. return self;
  292. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  293. }, function($ctx1) {$ctx1.fill(self,"testOnDoOnce",{counter:counter,announcer:announcer},$globals.AnnouncerTest)});
  294. //>>excludeEnd("ctx");
  295. },
  296. //>>excludeStart("ide", pragmas.excludeIdeData);
  297. args: [],
  298. source: "testOnDoOnce\x0a\x09| counter announcer |\x0a\x09\x0a\x09counter := 0.\x0a\x09announcer := Announcer new.\x0a\x09announcer on: SystemAnnouncement doOnce: [ counter := counter + 1 ].\x0a\x0a\x09announcer announce: (SystemAnnouncement new).\x0a\x09self assert: counter equals: 1.\x0a\x0a\x09announcer announce: (SystemAnnouncement new).\x0a\x09self assert: counter equals: 1.",
  299. referencedClasses: ["Announcer", "SystemAnnouncement"],
  300. //>>excludeEnd("ide");
  301. messageSends: ["new", "on:doOnce:", "+", "announce:", "assert:equals:"]
  302. }),
  303. $globals.AnnouncerTest);
  304. $core.addClass("BlockClosureTest", $globals.TestCase, [], "Kernel-Tests");
  305. $core.addMethod(
  306. $core.method({
  307. selector: "localReturnOnDoCatch",
  308. protocol: "fixture",
  309. fn: function (){
  310. var self=this,$self=this;
  311. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  312. return $core.withContext(function($ctx1) {
  313. //>>excludeEnd("ctx");
  314. var $early={};
  315. try {
  316. $recv((function(){
  317. throw $early=[(2)];
  318. }))._on_do_($globals.Error,(function(){
  319. }));
  320. return (3);
  321. }
  322. catch(e) {if(e===$early)return e[0]; throw e}
  323. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  324. }, function($ctx1) {$ctx1.fill(self,"localReturnOnDoCatch",{},$globals.BlockClosureTest)});
  325. //>>excludeEnd("ctx");
  326. },
  327. //>>excludeStart("ide", pragmas.excludeIdeData);
  328. args: [],
  329. source: "localReturnOnDoCatch\x0a [ ^ 2 ] on: Error do: [].\x0a ^ 3",
  330. referencedClasses: ["Error"],
  331. //>>excludeEnd("ide");
  332. messageSends: ["on:do:"]
  333. }),
  334. $globals.BlockClosureTest);
  335. $core.addMethod(
  336. $core.method({
  337. selector: "localReturnOnDoMiss",
  338. protocol: "fixture",
  339. fn: function (){
  340. var self=this,$self=this;
  341. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  342. return $core.withContext(function($ctx1) {
  343. //>>excludeEnd("ctx");
  344. var $early={};
  345. try {
  346. $recv((function(){
  347. throw $early=[(2)];
  348. }))._on_do_($globals.Class,(function(){
  349. }));
  350. return (3);
  351. }
  352. catch(e) {if(e===$early)return e[0]; throw e}
  353. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  354. }, function($ctx1) {$ctx1.fill(self,"localReturnOnDoMiss",{},$globals.BlockClosureTest)});
  355. //>>excludeEnd("ctx");
  356. },
  357. //>>excludeStart("ide", pragmas.excludeIdeData);
  358. args: [],
  359. source: "localReturnOnDoMiss\x0a [ ^ 2 ] on: Class do: [].\x0a ^ 3",
  360. referencedClasses: ["Class"],
  361. //>>excludeEnd("ide");
  362. messageSends: ["on:do:"]
  363. }),
  364. $globals.BlockClosureTest);
  365. $core.addMethod(
  366. $core.method({
  367. selector: "testCanClearInterval",
  368. protocol: "tests",
  369. fn: function (){
  370. var self=this,$self=this;
  371. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  372. return $core.withContext(function($ctx1) {
  373. //>>excludeEnd("ctx");
  374. $self._shouldnt_raise_((function(){
  375. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  376. return $core.withContext(function($ctx2) {
  377. //>>excludeEnd("ctx");
  378. return $recv($recv((function(){
  379. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  380. return $core.withContext(function($ctx3) {
  381. //>>excludeEnd("ctx");
  382. return $recv($recv($globals.Error)._new())._signal();
  383. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  384. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  385. //>>excludeEnd("ctx");
  386. }))._valueWithInterval_((0)))._clearInterval();
  387. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  388. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  389. //>>excludeEnd("ctx");
  390. }),$globals.Error);
  391. return self;
  392. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  393. }, function($ctx1) {$ctx1.fill(self,"testCanClearInterval",{},$globals.BlockClosureTest)});
  394. //>>excludeEnd("ctx");
  395. },
  396. //>>excludeStart("ide", pragmas.excludeIdeData);
  397. args: [],
  398. source: "testCanClearInterval\x0a\x09self shouldnt: [ ([ Error new signal ] valueWithInterval: 0) clearInterval ] raise: Error",
  399. referencedClasses: ["Error"],
  400. //>>excludeEnd("ide");
  401. messageSends: ["shouldnt:raise:", "clearInterval", "valueWithInterval:", "signal", "new"]
  402. }),
  403. $globals.BlockClosureTest);
  404. $core.addMethod(
  405. $core.method({
  406. selector: "testCanClearTimeout",
  407. protocol: "tests",
  408. fn: function (){
  409. var self=this,$self=this;
  410. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  411. return $core.withContext(function($ctx1) {
  412. //>>excludeEnd("ctx");
  413. $self._shouldnt_raise_((function(){
  414. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  415. return $core.withContext(function($ctx2) {
  416. //>>excludeEnd("ctx");
  417. return $recv($recv((function(){
  418. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  419. return $core.withContext(function($ctx3) {
  420. //>>excludeEnd("ctx");
  421. return $recv($recv($globals.Error)._new())._signal();
  422. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  423. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  424. //>>excludeEnd("ctx");
  425. }))._valueWithTimeout_((0)))._clearTimeout();
  426. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  427. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  428. //>>excludeEnd("ctx");
  429. }),$globals.Error);
  430. return self;
  431. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  432. }, function($ctx1) {$ctx1.fill(self,"testCanClearTimeout",{},$globals.BlockClosureTest)});
  433. //>>excludeEnd("ctx");
  434. },
  435. //>>excludeStart("ide", pragmas.excludeIdeData);
  436. args: [],
  437. source: "testCanClearTimeout\x0a\x09self shouldnt: [ ([ Error new signal ] valueWithTimeout: 0) clearTimeout ] raise: Error",
  438. referencedClasses: ["Error"],
  439. //>>excludeEnd("ide");
  440. messageSends: ["shouldnt:raise:", "clearTimeout", "valueWithTimeout:", "signal", "new"]
  441. }),
  442. $globals.BlockClosureTest);
  443. $core.addMethod(
  444. $core.method({
  445. selector: "testCompiledSource",
  446. protocol: "tests",
  447. fn: function (){
  448. var self=this,$self=this;
  449. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  450. return $core.withContext(function($ctx1) {
  451. //>>excludeEnd("ctx");
  452. $self._assert_($recv($recv((function(){
  453. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  454. return $core.withContext(function($ctx2) {
  455. //>>excludeEnd("ctx");
  456. return (1).__plus((1));
  457. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  458. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  459. //>>excludeEnd("ctx");
  460. }))._compiledSource())._includesSubString_("function"));
  461. return self;
  462. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  463. }, function($ctx1) {$ctx1.fill(self,"testCompiledSource",{},$globals.BlockClosureTest)});
  464. //>>excludeEnd("ctx");
  465. },
  466. //>>excludeStart("ide", pragmas.excludeIdeData);
  467. args: [],
  468. source: "testCompiledSource\x0a\x09self assert: ([ 1+1 ] compiledSource includesSubString: 'function')",
  469. referencedClasses: [],
  470. //>>excludeEnd("ide");
  471. messageSends: ["assert:", "includesSubString:", "compiledSource", "+"]
  472. }),
  473. $globals.BlockClosureTest);
  474. $core.addMethod(
  475. $core.method({
  476. selector: "testCurrySelf",
  477. protocol: "tests",
  478. fn: function (){
  479. var self=this,$self=this;
  480. var curriedMethod,array;
  481. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  482. return $core.withContext(function($ctx1) {
  483. //>>excludeEnd("ctx");
  484. curriedMethod=$recv($recv((function(selfarg,x){
  485. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  486. return $core.withContext(function($ctx2) {
  487. //>>excludeEnd("ctx");
  488. return $recv(selfarg)._at_(x);
  489. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  490. }, function($ctx2) {$ctx2.fillBlock({selfarg:selfarg,x:x},$ctx1,1)});
  491. //>>excludeEnd("ctx");
  492. }))._currySelf())._asCompiledMethod_("foo:");
  493. array=[(3), (1), (4)];
  494. $recv($recv($globals.ClassBuilder)._new())._installMethod_forClass_protocol_(curriedMethod,$globals.Array,"**test helper");
  495. $recv((function(){
  496. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  497. return $core.withContext(function($ctx2) {
  498. //>>excludeEnd("ctx");
  499. return $self._assert_equals_($recv(array)._foo_((2)),(1));
  500. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  501. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  502. //>>excludeEnd("ctx");
  503. }))._ensure_((function(){
  504. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  505. return $core.withContext(function($ctx2) {
  506. //>>excludeEnd("ctx");
  507. return $recv($globals.Array)._removeCompiledMethod_(curriedMethod);
  508. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  509. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  510. //>>excludeEnd("ctx");
  511. }));
  512. return self;
  513. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  514. }, function($ctx1) {$ctx1.fill(self,"testCurrySelf",{curriedMethod:curriedMethod,array:array},$globals.BlockClosureTest)});
  515. //>>excludeEnd("ctx");
  516. },
  517. //>>excludeStart("ide", pragmas.excludeIdeData);
  518. args: [],
  519. source: "testCurrySelf\x0a\x09| curriedMethod array |\x0a\x09curriedMethod := [ :selfarg :x | selfarg at: x ] currySelf asCompiledMethod: 'foo:'.\x0a\x09array := #(3 1 4).\x0a\x09ClassBuilder new installMethod: curriedMethod forClass: Array protocol: '**test helper'.\x0a\x09[ self assert: (array foo: 2) equals: 1 ]\x0a\x09ensure: [ Array removeCompiledMethod: curriedMethod ]",
  520. referencedClasses: ["ClassBuilder", "Array"],
  521. //>>excludeEnd("ide");
  522. messageSends: ["asCompiledMethod:", "currySelf", "at:", "installMethod:forClass:protocol:", "new", "ensure:", "assert:equals:", "foo:", "removeCompiledMethod:"]
  523. }),
  524. $globals.BlockClosureTest);
  525. $core.addMethod(
  526. $core.method({
  527. selector: "testEnsure",
  528. protocol: "tests",
  529. fn: function (){
  530. var self=this,$self=this;
  531. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  532. return $core.withContext(function($ctx1) {
  533. //>>excludeEnd("ctx");
  534. $self._assert_equals_($recv((function(){
  535. return (3);
  536. }))._ensure_((function(){
  537. return (4);
  538. })),(3));
  539. return self;
  540. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  541. }, function($ctx1) {$ctx1.fill(self,"testEnsure",{},$globals.BlockClosureTest)});
  542. //>>excludeEnd("ctx");
  543. },
  544. //>>excludeStart("ide", pragmas.excludeIdeData);
  545. args: [],
  546. source: "testEnsure\x0a\x09self assert: ([ 3 ] ensure: [ 4 ]) equals: 3",
  547. referencedClasses: [],
  548. //>>excludeEnd("ide");
  549. messageSends: ["assert:equals:", "ensure:"]
  550. }),
  551. $globals.BlockClosureTest);
  552. $core.addMethod(
  553. $core.method({
  554. selector: "testEnsureRaises",
  555. protocol: "tests",
  556. fn: function (){
  557. var self=this,$self=this;
  558. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  559. return $core.withContext(function($ctx1) {
  560. //>>excludeEnd("ctx");
  561. $self._should_raise_((function(){
  562. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  563. return $core.withContext(function($ctx2) {
  564. //>>excludeEnd("ctx");
  565. return $recv((function(){
  566. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  567. return $core.withContext(function($ctx3) {
  568. //>>excludeEnd("ctx");
  569. return $recv($recv($globals.Error)._new())._signal();
  570. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  571. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  572. //>>excludeEnd("ctx");
  573. }))._ensure_((function(){
  574. return true;
  575. }));
  576. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  577. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  578. //>>excludeEnd("ctx");
  579. }),$globals.Error);
  580. return self;
  581. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  582. }, function($ctx1) {$ctx1.fill(self,"testEnsureRaises",{},$globals.BlockClosureTest)});
  583. //>>excludeEnd("ctx");
  584. },
  585. //>>excludeStart("ide", pragmas.excludeIdeData);
  586. args: [],
  587. source: "testEnsureRaises\x0a\x09self should: [ [Error new signal ] ensure: [ true ]] raise: Error",
  588. referencedClasses: ["Error"],
  589. //>>excludeEnd("ide");
  590. messageSends: ["should:raise:", "ensure:", "signal", "new"]
  591. }),
  592. $globals.BlockClosureTest);
  593. $core.addMethod(
  594. $core.method({
  595. selector: "testExceptionSemantics",
  596. protocol: "tests",
  597. fn: function (){
  598. var self=this,$self=this;
  599. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  600. return $core.withContext(function($ctx1) {
  601. //>>excludeEnd("ctx");
  602. $self._timeout_((100));
  603. $recv($self._async_((function(){
  604. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  605. return $core.withContext(function($ctx2) {
  606. //>>excludeEnd("ctx");
  607. return $recv((function(){
  608. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  609. return $core.withContext(function($ctx3) {
  610. //>>excludeEnd("ctx");
  611. $self._assert_(true);
  612. $recv($globals.Error)._signal();
  613. $self._deny_(true);
  614. return $self._finished();
  615. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  616. $ctx3.sendIdx["finished"]=1;
  617. //>>excludeEnd("ctx");
  618. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  619. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  620. //>>excludeEnd("ctx");
  621. }))._on_do_($globals.Error,(function(ex){
  622. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  623. return $core.withContext(function($ctx3) {
  624. //>>excludeEnd("ctx");
  625. return $self._finished();
  626. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  627. }, function($ctx3) {$ctx3.fillBlock({ex:ex},$ctx2,3)});
  628. //>>excludeEnd("ctx");
  629. }));
  630. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  631. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  632. //>>excludeEnd("ctx");
  633. })))._valueWithTimeout_((0));
  634. return self;
  635. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  636. }, function($ctx1) {$ctx1.fill(self,"testExceptionSemantics",{},$globals.BlockClosureTest)});
  637. //>>excludeEnd("ctx");
  638. },
  639. //>>excludeStart("ide", pragmas.excludeIdeData);
  640. args: [],
  641. source: "testExceptionSemantics\x0a\x09\x22See https://lolg.it/amber/amber/issues/314\x22\x0a\x09self timeout: 100.\x0a\x09\x0a\x09(self async: [\x0a\x09\x09[\x0a\x09\x09\x09self assert: true.\x0a\x09\x09\x09Error signal.\x0a\x09\x09\x09\x22The following should *not* be run\x22\x0a\x09\x09\x09self deny: true.\x0a\x09\x09\x09self finished.\x0a\x09\x09] on: Error do: [ :ex | self finished ]\x0a\x09]) valueWithTimeout: 0",
  642. referencedClasses: ["Error"],
  643. //>>excludeEnd("ide");
  644. messageSends: ["timeout:", "valueWithTimeout:", "async:", "on:do:", "assert:", "signal", "deny:", "finished"]
  645. }),
  646. $globals.BlockClosureTest);
  647. $core.addMethod(
  648. $core.method({
  649. selector: "testLocalReturnOnDoCatch",
  650. protocol: "tests",
  651. fn: function (){
  652. var self=this,$self=this;
  653. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  654. return $core.withContext(function($ctx1) {
  655. //>>excludeEnd("ctx");
  656. $self._assert_equals_($self._localReturnOnDoCatch(),(2));
  657. return self;
  658. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  659. }, function($ctx1) {$ctx1.fill(self,"testLocalReturnOnDoCatch",{},$globals.BlockClosureTest)});
  660. //>>excludeEnd("ctx");
  661. },
  662. //>>excludeStart("ide", pragmas.excludeIdeData);
  663. args: [],
  664. source: "testLocalReturnOnDoCatch\x0a\x09self assert: self localReturnOnDoCatch equals: 2",
  665. referencedClasses: [],
  666. //>>excludeEnd("ide");
  667. messageSends: ["assert:equals:", "localReturnOnDoCatch"]
  668. }),
  669. $globals.BlockClosureTest);
  670. $core.addMethod(
  671. $core.method({
  672. selector: "testLocalReturnOnDoMiss",
  673. protocol: "tests",
  674. fn: function (){
  675. var self=this,$self=this;
  676. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  677. return $core.withContext(function($ctx1) {
  678. //>>excludeEnd("ctx");
  679. $self._assert_equals_($self._localReturnOnDoMiss(),(2));
  680. return self;
  681. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  682. }, function($ctx1) {$ctx1.fill(self,"testLocalReturnOnDoMiss",{},$globals.BlockClosureTest)});
  683. //>>excludeEnd("ctx");
  684. },
  685. //>>excludeStart("ide", pragmas.excludeIdeData);
  686. args: [],
  687. source: "testLocalReturnOnDoMiss\x0a\x09self assert: self localReturnOnDoMiss equals: 2",
  688. referencedClasses: [],
  689. //>>excludeEnd("ide");
  690. messageSends: ["assert:equals:", "localReturnOnDoMiss"]
  691. }),
  692. $globals.BlockClosureTest);
  693. $core.addMethod(
  694. $core.method({
  695. selector: "testNewWithValues",
  696. protocol: "tests",
  697. fn: function (){
  698. var self=this,$self=this;
  699. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  700. return $core.withContext(function($ctx1) {
  701. //>>excludeEnd("ctx");
  702. function TestConstructor(arg1, arg2, arg3) {}
  703. TestConstructor.prototype.name = "theTestPrototype";
  704. var wrappedConstructor = $recv(TestConstructor);
  705. var result = wrappedConstructor._newWithValues_([1, 2, 3]);
  706. $self._assert_(result instanceof TestConstructor);
  707. $self._assert_equals_(result.name, "theTestPrototype");
  708. /* newWithValues: cannot help if the argument list is wrong, and should warn that a mistake was made. */
  709. $self._should_raise_(function () {wrappedConstructor._newWithValues_("single argument");}, $globals.Error);;
  710. return self;
  711. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  712. }, function($ctx1) {$ctx1.fill(self,"testNewWithValues",{},$globals.BlockClosureTest)});
  713. //>>excludeEnd("ctx");
  714. },
  715. //>>excludeStart("ide", pragmas.excludeIdeData);
  716. args: [],
  717. source: "testNewWithValues\x0a<inlineJS: '\x0a\x09function TestConstructor(arg1, arg2, arg3) {}\x0a\x09TestConstructor.prototype.name = \x22theTestPrototype\x22;\x0a\x0a\x09var wrappedConstructor = $recv(TestConstructor);\x0a\x09var result = wrappedConstructor._newWithValues_([1, 2, 3]);\x0a\x09$self._assert_(result instanceof TestConstructor);\x0a\x09$self._assert_equals_(result.name, \x22theTestPrototype\x22);\x0a\x0a\x09/* newWithValues: cannot help if the argument list is wrong, and should warn that a mistake was made. */\x0a\x09$self._should_raise_(function () {wrappedConstructor._newWithValues_(\x22single argument\x22);}, $globals.Error);\x0a'>",
  718. referencedClasses: [],
  719. //>>excludeEnd("ide");
  720. messageSends: []
  721. }),
  722. $globals.BlockClosureTest);
  723. $core.addMethod(
  724. $core.method({
  725. selector: "testNumArgs",
  726. protocol: "tests",
  727. fn: function (){
  728. var self=this,$self=this;
  729. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  730. return $core.withContext(function($ctx1) {
  731. //>>excludeEnd("ctx");
  732. var $1;
  733. $1=$recv((function(){
  734. }))._numArgs();
  735. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  736. $ctx1.sendIdx["numArgs"]=1;
  737. //>>excludeEnd("ctx");
  738. $self._assert_equals_($1,(0));
  739. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  740. $ctx1.sendIdx["assert:equals:"]=1;
  741. //>>excludeEnd("ctx");
  742. $self._assert_equals_($recv((function(a,b){
  743. }))._numArgs(),(2));
  744. return self;
  745. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  746. }, function($ctx1) {$ctx1.fill(self,"testNumArgs",{},$globals.BlockClosureTest)});
  747. //>>excludeEnd("ctx");
  748. },
  749. //>>excludeStart("ide", pragmas.excludeIdeData);
  750. args: [],
  751. source: "testNumArgs\x0a\x09self assert: [] numArgs equals: 0.\x0a\x09self assert: [ :a :b | ] numArgs equals: 2",
  752. referencedClasses: [],
  753. //>>excludeEnd("ide");
  754. messageSends: ["assert:equals:", "numArgs"]
  755. }),
  756. $globals.BlockClosureTest);
  757. $core.addMethod(
  758. $core.method({
  759. selector: "testOnDo",
  760. protocol: "tests",
  761. fn: function (){
  762. var self=this,$self=this;
  763. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  764. return $core.withContext(function($ctx1) {
  765. //>>excludeEnd("ctx");
  766. $self._assert_($recv((function(){
  767. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  768. return $core.withContext(function($ctx2) {
  769. //>>excludeEnd("ctx");
  770. return $recv($recv($globals.Error)._new())._signal();
  771. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  772. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  773. //>>excludeEnd("ctx");
  774. }))._on_do_($globals.Error,(function(ex){
  775. return true;
  776. })));
  777. return self;
  778. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  779. }, function($ctx1) {$ctx1.fill(self,"testOnDo",{},$globals.BlockClosureTest)});
  780. //>>excludeEnd("ctx");
  781. },
  782. //>>excludeStart("ide", pragmas.excludeIdeData);
  783. args: [],
  784. source: "testOnDo\x0a\x09self assert: ([ Error new signal ] on: Error do: [ :ex | true ])",
  785. referencedClasses: ["Error"],
  786. //>>excludeEnd("ide");
  787. messageSends: ["assert:", "on:do:", "signal", "new"]
  788. }),
  789. $globals.BlockClosureTest);
  790. $core.addMethod(
  791. $core.method({
  792. selector: "testValue",
  793. protocol: "tests",
  794. fn: function (){
  795. var self=this,$self=this;
  796. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  797. return $core.withContext(function($ctx1) {
  798. //>>excludeEnd("ctx");
  799. var $1;
  800. $1=$recv((function(){
  801. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  802. return $core.withContext(function($ctx2) {
  803. //>>excludeEnd("ctx");
  804. return (1).__plus((1));
  805. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  806. $ctx2.sendIdx["+"]=1;
  807. //>>excludeEnd("ctx");
  808. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  809. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  810. //>>excludeEnd("ctx");
  811. }))._value();
  812. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  813. $ctx1.sendIdx["value"]=1;
  814. //>>excludeEnd("ctx");
  815. $self._assert_equals_($1,(2));
  816. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  817. $ctx1.sendIdx["assert:equals:"]=1;
  818. //>>excludeEnd("ctx");
  819. $self._assert_equals_($recv((function(x){
  820. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  821. return $core.withContext(function($ctx2) {
  822. //>>excludeEnd("ctx");
  823. return $recv(x).__plus((1));
  824. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  825. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,2)});
  826. //>>excludeEnd("ctx");
  827. }))._value_((2)),(3));
  828. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  829. $ctx1.sendIdx["assert:equals:"]=2;
  830. //>>excludeEnd("ctx");
  831. $self._assert_equals_($recv((function(x,y){
  832. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  833. return $core.withContext(function($ctx2) {
  834. //>>excludeEnd("ctx");
  835. return $recv(x).__star(y);
  836. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  837. }, function($ctx2) {$ctx2.fillBlock({x:x,y:y},$ctx1,3)});
  838. //>>excludeEnd("ctx");
  839. }))._value_value_((2),(4)),(8));
  840. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  841. $ctx1.sendIdx["assert:equals:"]=3;
  842. //>>excludeEnd("ctx");
  843. $self._assert_equals_($recv((function(a,b,c){
  844. return (1);
  845. }))._value(),(1));
  846. return self;
  847. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  848. }, function($ctx1) {$ctx1.fill(self,"testValue",{},$globals.BlockClosureTest)});
  849. //>>excludeEnd("ctx");
  850. },
  851. //>>excludeStart("ide", pragmas.excludeIdeData);
  852. args: [],
  853. source: "testValue\x0a\x09self assert: ([ 1+1 ] value) equals: 2.\x0a\x09self assert: ([ :x | x +1 ] value: 2) equals: 3.\x0a\x09self assert: ([ :x :y | x*y ] value: 2 value: 4) equals: 8.\x0a\x0a\x09\x22Arguments are optional in Amber. This isn't ANSI compliant.\x22\x0a\x0a\x09self assert: ([ :a :b :c | 1 ] value) equals: 1",
  854. referencedClasses: [],
  855. //>>excludeEnd("ide");
  856. messageSends: ["assert:equals:", "value", "+", "value:", "value:value:", "*"]
  857. }),
  858. $globals.BlockClosureTest);
  859. $core.addMethod(
  860. $core.method({
  861. selector: "testValueWithPossibleArguments",
  862. protocol: "tests",
  863. fn: function (){
  864. var self=this,$self=this;
  865. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  866. return $core.withContext(function($ctx1) {
  867. //>>excludeEnd("ctx");
  868. var $1,$2;
  869. $1=$recv((function(){
  870. return (1);
  871. }))._valueWithPossibleArguments_([(3), (4)]);
  872. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  873. $ctx1.sendIdx["valueWithPossibleArguments:"]=1;
  874. //>>excludeEnd("ctx");
  875. $self._assert_equals_($1,(1));
  876. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  877. $ctx1.sendIdx["assert:equals:"]=1;
  878. //>>excludeEnd("ctx");
  879. $2=$recv((function(a){
  880. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  881. return $core.withContext(function($ctx2) {
  882. //>>excludeEnd("ctx");
  883. return $recv(a).__plus((4));
  884. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  885. $ctx2.sendIdx["+"]=1;
  886. //>>excludeEnd("ctx");
  887. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  888. }, function($ctx2) {$ctx2.fillBlock({a:a},$ctx1,2)});
  889. //>>excludeEnd("ctx");
  890. }))._valueWithPossibleArguments_([(3), (4)]);
  891. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  892. $ctx1.sendIdx["valueWithPossibleArguments:"]=2;
  893. //>>excludeEnd("ctx");
  894. $self._assert_equals_($2,(7));
  895. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  896. $ctx1.sendIdx["assert:equals:"]=2;
  897. //>>excludeEnd("ctx");
  898. $self._assert_equals_($recv((function(a,b){
  899. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  900. return $core.withContext(function($ctx2) {
  901. //>>excludeEnd("ctx");
  902. return $recv(a).__plus(b);
  903. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  904. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1,3)});
  905. //>>excludeEnd("ctx");
  906. }))._valueWithPossibleArguments_([(3), (4), (5)]),(7));
  907. return self;
  908. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  909. }, function($ctx1) {$ctx1.fill(self,"testValueWithPossibleArguments",{},$globals.BlockClosureTest)});
  910. //>>excludeEnd("ctx");
  911. },
  912. //>>excludeStart("ide", pragmas.excludeIdeData);
  913. args: [],
  914. source: "testValueWithPossibleArguments\x0a\x09self assert: ([ 1 ] valueWithPossibleArguments: #(3 4)) equals: 1.\x0a\x09self assert: ([ :a | a + 4 ] valueWithPossibleArguments: #(3 4)) equals: 7.\x0a\x09self assert: ([ :a :b | a + b ] valueWithPossibleArguments: #(3 4 5)) equals: 7.",
  915. referencedClasses: [],
  916. //>>excludeEnd("ide");
  917. messageSends: ["assert:equals:", "valueWithPossibleArguments:", "+"]
  918. }),
  919. $globals.BlockClosureTest);
  920. $core.addMethod(
  921. $core.method({
  922. selector: "testWhileFalse",
  923. protocol: "tests",
  924. fn: function (){
  925. var self=this,$self=this;
  926. var i;
  927. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  928. return $core.withContext(function($ctx1) {
  929. //>>excludeEnd("ctx");
  930. i=(0);
  931. $recv((function(){
  932. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  933. return $core.withContext(function($ctx2) {
  934. //>>excludeEnd("ctx");
  935. return $recv(i).__gt((5));
  936. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  937. $ctx2.sendIdx[">"]=1;
  938. //>>excludeEnd("ctx");
  939. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  940. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  941. //>>excludeEnd("ctx");
  942. }))._whileFalse_((function(){
  943. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  944. return $core.withContext(function($ctx2) {
  945. //>>excludeEnd("ctx");
  946. i=$recv(i).__plus((1));
  947. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  948. $ctx2.sendIdx["+"]=1;
  949. //>>excludeEnd("ctx");
  950. return i;
  951. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  952. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  953. //>>excludeEnd("ctx");
  954. }));
  955. $self._assert_equals_(i,(6));
  956. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  957. $ctx1.sendIdx["assert:equals:"]=1;
  958. //>>excludeEnd("ctx");
  959. i=(0);
  960. $recv((function(){
  961. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  962. return $core.withContext(function($ctx2) {
  963. //>>excludeEnd("ctx");
  964. i=$recv(i).__plus((1));
  965. i;
  966. return $recv(i).__gt((5));
  967. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  968. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  969. //>>excludeEnd("ctx");
  970. }))._whileFalse();
  971. $self._assert_equals_(i,(6));
  972. return self;
  973. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  974. }, function($ctx1) {$ctx1.fill(self,"testWhileFalse",{i:i},$globals.BlockClosureTest)});
  975. //>>excludeEnd("ctx");
  976. },
  977. //>>excludeStart("ide", pragmas.excludeIdeData);
  978. args: [],
  979. source: "testWhileFalse\x0a\x09| i |\x0a\x09i := 0.\x0a\x09[ i > 5 ] whileFalse: [ i := i + 1 ].\x0a\x09self assert: i equals: 6.\x0a\x0a\x09i := 0.\x0a\x09[ i := i + 1. i > 5 ] whileFalse.\x0a\x09self assert: i equals: 6",
  980. referencedClasses: [],
  981. //>>excludeEnd("ide");
  982. messageSends: ["whileFalse:", ">", "+", "assert:equals:", "whileFalse"]
  983. }),
  984. $globals.BlockClosureTest);
  985. $core.addMethod(
  986. $core.method({
  987. selector: "testWhileTrue",
  988. protocol: "tests",
  989. fn: function (){
  990. var self=this,$self=this;
  991. var i;
  992. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  993. return $core.withContext(function($ctx1) {
  994. //>>excludeEnd("ctx");
  995. i=(0);
  996. $recv((function(){
  997. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  998. return $core.withContext(function($ctx2) {
  999. //>>excludeEnd("ctx");
  1000. return $recv(i).__lt((5));
  1001. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1002. $ctx2.sendIdx["<"]=1;
  1003. //>>excludeEnd("ctx");
  1004. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1005. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  1006. //>>excludeEnd("ctx");
  1007. }))._whileTrue_((function(){
  1008. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1009. return $core.withContext(function($ctx2) {
  1010. //>>excludeEnd("ctx");
  1011. i=$recv(i).__plus((1));
  1012. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1013. $ctx2.sendIdx["+"]=1;
  1014. //>>excludeEnd("ctx");
  1015. return i;
  1016. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1017. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  1018. //>>excludeEnd("ctx");
  1019. }));
  1020. $self._assert_equals_(i,(5));
  1021. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1022. $ctx1.sendIdx["assert:equals:"]=1;
  1023. //>>excludeEnd("ctx");
  1024. i=(0);
  1025. $recv((function(){
  1026. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1027. return $core.withContext(function($ctx2) {
  1028. //>>excludeEnd("ctx");
  1029. i=$recv(i).__plus((1));
  1030. i;
  1031. return $recv(i).__lt((5));
  1032. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1033. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  1034. //>>excludeEnd("ctx");
  1035. }))._whileTrue();
  1036. $self._assert_equals_(i,(5));
  1037. return self;
  1038. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1039. }, function($ctx1) {$ctx1.fill(self,"testWhileTrue",{i:i},$globals.BlockClosureTest)});
  1040. //>>excludeEnd("ctx");
  1041. },
  1042. //>>excludeStart("ide", pragmas.excludeIdeData);
  1043. args: [],
  1044. source: "testWhileTrue\x0a\x09| i |\x0a\x09i := 0.\x0a\x09[ i < 5 ] whileTrue: [ i := i + 1 ].\x0a\x09self assert: i equals: 5.\x0a\x0a\x09i := 0.\x0a\x09[ i := i + 1. i < 5 ] whileTrue.\x0a\x09self assert: i equals: 5",
  1045. referencedClasses: [],
  1046. //>>excludeEnd("ide");
  1047. messageSends: ["whileTrue:", "<", "+", "assert:equals:", "whileTrue"]
  1048. }),
  1049. $globals.BlockClosureTest);
  1050. $core.addClass("BooleanTest", $globals.TestCase, [], "Kernel-Tests");
  1051. $core.addMethod(
  1052. $core.method({
  1053. selector: "testEquality",
  1054. protocol: "tests",
  1055. fn: function (){
  1056. var self=this,$self=this;
  1057. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1058. return $core.withContext(function($ctx1) {
  1059. //>>excludeEnd("ctx");
  1060. var $1,$2,$3,$4,$5,$6,$7,$8,$10,$9,$12,$11;
  1061. $1=(0).__eq(false);
  1062. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1063. $ctx1.sendIdx["="]=1;
  1064. //>>excludeEnd("ctx");
  1065. $self._deny_($1);
  1066. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1067. $ctx1.sendIdx["deny:"]=1;
  1068. //>>excludeEnd("ctx");
  1069. $2=false.__eq((0));
  1070. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1071. $ctx1.sendIdx["="]=2;
  1072. //>>excludeEnd("ctx");
  1073. $self._deny_($2);
  1074. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1075. $ctx1.sendIdx["deny:"]=2;
  1076. //>>excludeEnd("ctx");
  1077. $3="".__eq(false);
  1078. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1079. $ctx1.sendIdx["="]=3;
  1080. //>>excludeEnd("ctx");
  1081. $self._deny_($3);
  1082. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1083. $ctx1.sendIdx["deny:"]=3;
  1084. //>>excludeEnd("ctx");
  1085. $4=false.__eq("");
  1086. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1087. $ctx1.sendIdx["="]=4;
  1088. //>>excludeEnd("ctx");
  1089. $self._deny_($4);
  1090. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1091. $ctx1.sendIdx["deny:"]=4;
  1092. //>>excludeEnd("ctx");
  1093. $5=true.__eq(true);
  1094. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1095. $ctx1.sendIdx["="]=5;
  1096. //>>excludeEnd("ctx");
  1097. $self._assert_($5);
  1098. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1099. $ctx1.sendIdx["assert:"]=1;
  1100. //>>excludeEnd("ctx");
  1101. $6=false.__eq(true);
  1102. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1103. $ctx1.sendIdx["="]=6;
  1104. //>>excludeEnd("ctx");
  1105. $self._deny_($6);
  1106. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1107. $ctx1.sendIdx["deny:"]=5;
  1108. //>>excludeEnd("ctx");
  1109. $7=true.__eq(false);
  1110. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1111. $ctx1.sendIdx["="]=7;
  1112. //>>excludeEnd("ctx");
  1113. $self._deny_($7);
  1114. $8=false.__eq(false);
  1115. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1116. $ctx1.sendIdx["="]=8;
  1117. //>>excludeEnd("ctx");
  1118. $self._assert_($8);
  1119. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1120. $ctx1.sendIdx["assert:"]=2;
  1121. //>>excludeEnd("ctx");
  1122. $10=true._yourself();
  1123. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1124. $ctx1.sendIdx["yourself"]=1;
  1125. //>>excludeEnd("ctx");
  1126. $9=$recv($10).__eq(true);
  1127. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1128. $ctx1.sendIdx["="]=9;
  1129. //>>excludeEnd("ctx");
  1130. $self._assert_($9);
  1131. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1132. $ctx1.sendIdx["assert:"]=3;
  1133. //>>excludeEnd("ctx");
  1134. $12=true._yourself();
  1135. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1136. $ctx1.sendIdx["yourself"]=2;
  1137. //>>excludeEnd("ctx");
  1138. $11=$recv($12).__eq(true._yourself());
  1139. $self._assert_($11);
  1140. return self;
  1141. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1142. }, function($ctx1) {$ctx1.fill(self,"testEquality",{},$globals.BooleanTest)});
  1143. //>>excludeEnd("ctx");
  1144. },
  1145. //>>excludeStart("ide", pragmas.excludeIdeData);
  1146. args: [],
  1147. source: "testEquality\x0a\x09\x22We're on top of JS...just be sure to check the basics!\x22\x0a\x0a\x09self deny: 0 = false.\x0a\x09self deny: false = 0.\x0a\x09self deny: '' = false.\x0a\x09self deny: false = ''.\x0a\x0a\x09self assert: (true = true).\x0a\x09self deny: false = true.\x0a\x09self deny: true = false.\x0a\x09self assert: (false = false).\x0a\x0a\x09\x22JS may do some type coercing after sending a message\x22\x0a\x09self assert: (true yourself = true).\x0a\x09self assert: (true yourself = true yourself)",
  1148. referencedClasses: [],
  1149. //>>excludeEnd("ide");
  1150. messageSends: ["deny:", "=", "assert:", "yourself"]
  1151. }),
  1152. $globals.BooleanTest);
  1153. $core.addMethod(
  1154. $core.method({
  1155. selector: "testIdentity",
  1156. protocol: "tests",
  1157. fn: function (){
  1158. var self=this,$self=this;
  1159. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1160. return $core.withContext(function($ctx1) {
  1161. //>>excludeEnd("ctx");
  1162. var $1,$2,$3,$4,$5,$6,$7,$8,$10,$9,$12,$11;
  1163. $1=(0).__eq_eq(false);
  1164. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1165. $ctx1.sendIdx["=="]=1;
  1166. //>>excludeEnd("ctx");
  1167. $self._deny_($1);
  1168. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1169. $ctx1.sendIdx["deny:"]=1;
  1170. //>>excludeEnd("ctx");
  1171. $2=false.__eq_eq((0));
  1172. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1173. $ctx1.sendIdx["=="]=2;
  1174. //>>excludeEnd("ctx");
  1175. $self._deny_($2);
  1176. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1177. $ctx1.sendIdx["deny:"]=2;
  1178. //>>excludeEnd("ctx");
  1179. $3="".__eq_eq(false);
  1180. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1181. $ctx1.sendIdx["=="]=3;
  1182. //>>excludeEnd("ctx");
  1183. $self._deny_($3);
  1184. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1185. $ctx1.sendIdx["deny:"]=3;
  1186. //>>excludeEnd("ctx");
  1187. $4=false.__eq_eq("");
  1188. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1189. $ctx1.sendIdx["=="]=4;
  1190. //>>excludeEnd("ctx");
  1191. $self._deny_($4);
  1192. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1193. $ctx1.sendIdx["deny:"]=4;
  1194. //>>excludeEnd("ctx");
  1195. $5=true.__eq_eq(true);
  1196. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1197. $ctx1.sendIdx["=="]=5;
  1198. //>>excludeEnd("ctx");
  1199. $self._assert_($5);
  1200. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1201. $ctx1.sendIdx["assert:"]=1;
  1202. //>>excludeEnd("ctx");
  1203. $6=false.__eq_eq(true);
  1204. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1205. $ctx1.sendIdx["=="]=6;
  1206. //>>excludeEnd("ctx");
  1207. $self._deny_($6);
  1208. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1209. $ctx1.sendIdx["deny:"]=5;
  1210. //>>excludeEnd("ctx");
  1211. $7=true.__eq_eq(false);
  1212. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1213. $ctx1.sendIdx["=="]=7;
  1214. //>>excludeEnd("ctx");
  1215. $self._deny_($7);
  1216. $8=false.__eq_eq(false);
  1217. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1218. $ctx1.sendIdx["=="]=8;
  1219. //>>excludeEnd("ctx");
  1220. $self._assert_($8);
  1221. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1222. $ctx1.sendIdx["assert:"]=2;
  1223. //>>excludeEnd("ctx");
  1224. $10=true._yourself();
  1225. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1226. $ctx1.sendIdx["yourself"]=1;
  1227. //>>excludeEnd("ctx");
  1228. $9=$recv($10).__eq_eq(true);
  1229. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1230. $ctx1.sendIdx["=="]=9;
  1231. //>>excludeEnd("ctx");
  1232. $self._assert_($9);
  1233. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1234. $ctx1.sendIdx["assert:"]=3;
  1235. //>>excludeEnd("ctx");
  1236. $12=true._yourself();
  1237. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1238. $ctx1.sendIdx["yourself"]=2;
  1239. //>>excludeEnd("ctx");
  1240. $11=$recv($12).__eq_eq(true._yourself());
  1241. $self._assert_($11);
  1242. return self;
  1243. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1244. }, function($ctx1) {$ctx1.fill(self,"testIdentity",{},$globals.BooleanTest)});
  1245. //>>excludeEnd("ctx");
  1246. },
  1247. //>>excludeStart("ide", pragmas.excludeIdeData);
  1248. args: [],
  1249. source: "testIdentity\x0a\x09\x22We're on top of JS...just be sure to check the basics!\x22\x0a\x0a\x09self deny: 0 == false.\x0a\x09self deny: false == 0.\x0a\x09self deny: '' == false.\x0a\x09self deny: false == ''.\x0a\x0a\x09self assert: true == true.\x0a\x09self deny: false == true.\x0a\x09self deny: true == false.\x0a\x09self assert: false == false.\x0a\x0a\x09\x22JS may do some type coercing after sending a message\x22\x0a\x09self assert: true yourself == true.\x0a\x09self assert: true yourself == true yourself",
  1250. referencedClasses: [],
  1251. //>>excludeEnd("ide");
  1252. messageSends: ["deny:", "==", "assert:", "yourself"]
  1253. }),
  1254. $globals.BooleanTest);
  1255. $core.addMethod(
  1256. $core.method({
  1257. selector: "testIfTrueIfFalse",
  1258. protocol: "tests",
  1259. fn: function (){
  1260. var self=this,$self=this;
  1261. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1262. return $core.withContext(function($ctx1) {
  1263. //>>excludeEnd("ctx");
  1264. var $1,$2,$3,$4,$5,$6,$7,$8;
  1265. if($core.assert(true)){
  1266. $1="alternative block";
  1267. }
  1268. $self._assert_equals_($1,"alternative block");
  1269. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1270. $ctx1.sendIdx["assert:equals:"]=1;
  1271. //>>excludeEnd("ctx");
  1272. if(!$core.assert(true)){
  1273. $2="alternative block";
  1274. }
  1275. $self._assert_equals_($2,nil);
  1276. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1277. $ctx1.sendIdx["assert:equals:"]=2;
  1278. //>>excludeEnd("ctx");
  1279. if($core.assert(false)){
  1280. $3="alternative block";
  1281. }
  1282. $self._assert_equals_($3,nil);
  1283. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1284. $ctx1.sendIdx["assert:equals:"]=3;
  1285. //>>excludeEnd("ctx");
  1286. if(!$core.assert(false)){
  1287. $4="alternative block";
  1288. }
  1289. $self._assert_equals_($4,"alternative block");
  1290. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1291. $ctx1.sendIdx["assert:equals:"]=4;
  1292. //>>excludeEnd("ctx");
  1293. if($core.assert(false)){
  1294. $5="alternative block";
  1295. } else {
  1296. $5="alternative block2";
  1297. }
  1298. $self._assert_equals_($5,"alternative block2");
  1299. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1300. $ctx1.sendIdx["assert:equals:"]=5;
  1301. //>>excludeEnd("ctx");
  1302. if($core.assert(false)){
  1303. $6="alternative block2";
  1304. } else {
  1305. $6="alternative block";
  1306. }
  1307. $self._assert_equals_($6,"alternative block");
  1308. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1309. $ctx1.sendIdx["assert:equals:"]=6;
  1310. //>>excludeEnd("ctx");
  1311. if($core.assert(true)){
  1312. $7="alternative block";
  1313. } else {
  1314. $7="alternative block2";
  1315. }
  1316. $self._assert_equals_($7,"alternative block");
  1317. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1318. $ctx1.sendIdx["assert:equals:"]=7;
  1319. //>>excludeEnd("ctx");
  1320. if($core.assert(true)){
  1321. $8="alternative block2";
  1322. } else {
  1323. $8="alternative block";
  1324. }
  1325. $self._assert_equals_($8,"alternative block2");
  1326. return self;
  1327. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1328. }, function($ctx1) {$ctx1.fill(self,"testIfTrueIfFalse",{},$globals.BooleanTest)});
  1329. //>>excludeEnd("ctx");
  1330. },
  1331. //>>excludeStart("ide", pragmas.excludeIdeData);
  1332. args: [],
  1333. source: "testIfTrueIfFalse\x0a\x0a\x09self assert: (true ifTrue: [ 'alternative block' ]) equals: 'alternative block'.\x0a\x09self assert: (true ifFalse: [ 'alternative block' ]) equals: nil.\x0a\x0a\x09self assert: (false ifTrue: [ 'alternative block' ]) equals: nil.\x0a\x09self assert: (false ifFalse: [ 'alternative block' ]) equals: 'alternative block'.\x0a\x0a\x09self assert: (false ifTrue: [ 'alternative block' ] ifFalse: [ 'alternative block2' ]) equals: 'alternative block2'.\x0a\x09self assert: (false ifFalse: [ 'alternative block' ] ifTrue: [ 'alternative block2' ]) equals: 'alternative block'.\x0a\x0a\x09self assert: (true ifTrue: [ 'alternative block' ] ifFalse: [ 'alternative block2' ]) equals: 'alternative block'.\x0a\x09self assert: (true ifFalse: [ 'alternative block' ] ifTrue: [ 'alternative block2' ]) equals: 'alternative block2'.",
  1334. referencedClasses: [],
  1335. //>>excludeEnd("ide");
  1336. messageSends: ["assert:equals:", "ifTrue:", "ifFalse:", "ifTrue:ifFalse:", "ifFalse:ifTrue:"]
  1337. }),
  1338. $globals.BooleanTest);
  1339. $core.addMethod(
  1340. $core.method({
  1341. selector: "testIfTrueIfFalseWithBoxing",
  1342. protocol: "tests",
  1343. fn: function (){
  1344. var self=this,$self=this;
  1345. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1346. return $core.withContext(function($ctx1) {
  1347. //>>excludeEnd("ctx");
  1348. var $2,$1,$4,$3,$6,$5,$8,$7,$10,$9,$12,$11,$14,$13,$16,$15;
  1349. $2=true._yourself();
  1350. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1351. $ctx1.sendIdx["yourself"]=1;
  1352. //>>excludeEnd("ctx");
  1353. if($core.assert($2)){
  1354. $1="alternative block";
  1355. }
  1356. $self._assert_equals_($1,"alternative block");
  1357. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1358. $ctx1.sendIdx["assert:equals:"]=1;
  1359. //>>excludeEnd("ctx");
  1360. $4=true._yourself();
  1361. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1362. $ctx1.sendIdx["yourself"]=2;
  1363. //>>excludeEnd("ctx");
  1364. if(!$core.assert($4)){
  1365. $3="alternative block";
  1366. }
  1367. $self._assert_equals_($3,nil);
  1368. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1369. $ctx1.sendIdx["assert:equals:"]=2;
  1370. //>>excludeEnd("ctx");
  1371. $6=false._yourself();
  1372. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1373. $ctx1.sendIdx["yourself"]=3;
  1374. //>>excludeEnd("ctx");
  1375. if($core.assert($6)){
  1376. $5="alternative block";
  1377. }
  1378. $self._assert_equals_($5,nil);
  1379. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1380. $ctx1.sendIdx["assert:equals:"]=3;
  1381. //>>excludeEnd("ctx");
  1382. $8=false._yourself();
  1383. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1384. $ctx1.sendIdx["yourself"]=4;
  1385. //>>excludeEnd("ctx");
  1386. if(!$core.assert($8)){
  1387. $7="alternative block";
  1388. }
  1389. $self._assert_equals_($7,"alternative block");
  1390. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1391. $ctx1.sendIdx["assert:equals:"]=4;
  1392. //>>excludeEnd("ctx");
  1393. $10=false._yourself();
  1394. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1395. $ctx1.sendIdx["yourself"]=5;
  1396. //>>excludeEnd("ctx");
  1397. if($core.assert($10)){
  1398. $9="alternative block";
  1399. } else {
  1400. $9="alternative block2";
  1401. }
  1402. $self._assert_equals_($9,"alternative block2");
  1403. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1404. $ctx1.sendIdx["assert:equals:"]=5;
  1405. //>>excludeEnd("ctx");
  1406. $12=false._yourself();
  1407. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1408. $ctx1.sendIdx["yourself"]=6;
  1409. //>>excludeEnd("ctx");
  1410. if($core.assert($12)){
  1411. $11="alternative block2";
  1412. } else {
  1413. $11="alternative block";
  1414. }
  1415. $self._assert_equals_($11,"alternative block");
  1416. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1417. $ctx1.sendIdx["assert:equals:"]=6;
  1418. //>>excludeEnd("ctx");
  1419. $14=true._yourself();
  1420. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1421. $ctx1.sendIdx["yourself"]=7;
  1422. //>>excludeEnd("ctx");
  1423. if($core.assert($14)){
  1424. $13="alternative block";
  1425. } else {
  1426. $13="alternative block2";
  1427. }
  1428. $self._assert_equals_($13,"alternative block");
  1429. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1430. $ctx1.sendIdx["assert:equals:"]=7;
  1431. //>>excludeEnd("ctx");
  1432. $16=true._yourself();
  1433. if($core.assert($16)){
  1434. $15="alternative block2";
  1435. } else {
  1436. $15="alternative block";
  1437. }
  1438. $self._assert_equals_($15,"alternative block2");
  1439. return self;
  1440. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1441. }, function($ctx1) {$ctx1.fill(self,"testIfTrueIfFalseWithBoxing",{},$globals.BooleanTest)});
  1442. //>>excludeEnd("ctx");
  1443. },
  1444. //>>excludeStart("ide", pragmas.excludeIdeData);
  1445. args: [],
  1446. source: "testIfTrueIfFalseWithBoxing\x0a\x0a\x09self assert: (true yourself ifTrue: [ 'alternative block' ]) equals: 'alternative block'.\x0a\x09self assert: (true yourself ifFalse: [ 'alternative block' ]) equals: nil.\x0a\x0a\x09self assert: (false yourself ifTrue: [ 'alternative block' ]) equals: nil.\x0a\x09self assert: (false yourself ifFalse: [ 'alternative block' ]) equals: 'alternative block'.\x0a\x0a\x09self assert: (false yourself ifTrue: [ 'alternative block' ] ifFalse: [ 'alternative block2' ]) equals: 'alternative block2'.\x0a\x09self assert: (false yourself ifFalse: [ 'alternative block' ] ifTrue: [ 'alternative block2' ]) equals: 'alternative block'.\x0a\x0a\x09self assert: (true yourself ifTrue: [ 'alternative block' ] ifFalse: [ 'alternative block2' ]) equals: 'alternative block'.\x0a\x09self assert: (true yourself ifFalse: [ 'alternative block' ] ifTrue: [ 'alternative block2' ]) equals: 'alternative block2'.",
  1447. referencedClasses: [],
  1448. //>>excludeEnd("ide");
  1449. messageSends: ["assert:equals:", "ifTrue:", "yourself", "ifFalse:", "ifTrue:ifFalse:", "ifFalse:ifTrue:"]
  1450. }),
  1451. $globals.BooleanTest);
  1452. $core.addMethod(
  1453. $core.method({
  1454. selector: "testLogic",
  1455. protocol: "tests",
  1456. fn: function (){
  1457. var self=this,$self=this;
  1458. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1459. return $core.withContext(function($ctx1) {
  1460. //>>excludeEnd("ctx");
  1461. var $1,$2,$3,$5,$4,$6,$7,$8,$10,$9,$12,$11,$14,$13,$16,$17,$15,$19,$18,$21,$20,$23,$22;
  1462. $1=true.__and(true);
  1463. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1464. $ctx1.sendIdx["&"]=1;
  1465. //>>excludeEnd("ctx");
  1466. $self._assert_($1);
  1467. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1468. $ctx1.sendIdx["assert:"]=1;
  1469. //>>excludeEnd("ctx");
  1470. $2=true.__and(false);
  1471. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1472. $ctx1.sendIdx["&"]=2;
  1473. //>>excludeEnd("ctx");
  1474. $self._deny_($2);
  1475. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1476. $ctx1.sendIdx["deny:"]=1;
  1477. //>>excludeEnd("ctx");
  1478. $3=false.__and(true);
  1479. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1480. $ctx1.sendIdx["&"]=3;
  1481. //>>excludeEnd("ctx");
  1482. $self._deny_($3);
  1483. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1484. $ctx1.sendIdx["deny:"]=2;
  1485. //>>excludeEnd("ctx");
  1486. $5=false.__and(false);
  1487. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1488. $ctx1.sendIdx["&"]=4;
  1489. //>>excludeEnd("ctx");
  1490. $4=$self._deny_($5);
  1491. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1492. $ctx1.sendIdx["deny:"]=3;
  1493. //>>excludeEnd("ctx");
  1494. $6=true.__or(true);
  1495. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1496. $ctx1.sendIdx["|"]=1;
  1497. //>>excludeEnd("ctx");
  1498. $self._assert_($6);
  1499. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1500. $ctx1.sendIdx["assert:"]=2;
  1501. //>>excludeEnd("ctx");
  1502. $7=true.__or(false);
  1503. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1504. $ctx1.sendIdx["|"]=2;
  1505. //>>excludeEnd("ctx");
  1506. $self._assert_($7);
  1507. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1508. $ctx1.sendIdx["assert:"]=3;
  1509. //>>excludeEnd("ctx");
  1510. $8=false.__or(true);
  1511. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1512. $ctx1.sendIdx["|"]=3;
  1513. //>>excludeEnd("ctx");
  1514. $self._assert_($8);
  1515. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1516. $ctx1.sendIdx["assert:"]=4;
  1517. //>>excludeEnd("ctx");
  1518. $10=false.__or(false);
  1519. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1520. $ctx1.sendIdx["|"]=4;
  1521. //>>excludeEnd("ctx");
  1522. $9=$self._deny_($10);
  1523. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1524. $ctx1.sendIdx["deny:"]=4;
  1525. //>>excludeEnd("ctx");
  1526. $12=(1).__gt((0));
  1527. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1528. $ctx1.sendIdx[">"]=1;
  1529. //>>excludeEnd("ctx");
  1530. $11=true.__and($12);
  1531. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1532. $ctx1.sendIdx["&"]=5;
  1533. //>>excludeEnd("ctx");
  1534. $self._assert_($11);
  1535. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1536. $ctx1.sendIdx["assert:"]=5;
  1537. //>>excludeEnd("ctx");
  1538. $14=(1).__gt((0));
  1539. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1540. $ctx1.sendIdx[">"]=2;
  1541. //>>excludeEnd("ctx");
  1542. $13=$recv($14).__and(false);
  1543. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1544. $ctx1.sendIdx["&"]=6;
  1545. //>>excludeEnd("ctx");
  1546. $self._deny_($13);
  1547. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1548. $ctx1.sendIdx["deny:"]=5;
  1549. //>>excludeEnd("ctx");
  1550. $16=(1).__gt((0));
  1551. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1552. $ctx1.sendIdx[">"]=3;
  1553. //>>excludeEnd("ctx");
  1554. $17=(1).__gt((2));
  1555. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1556. $ctx1.sendIdx[">"]=4;
  1557. //>>excludeEnd("ctx");
  1558. $15=$recv($16).__and($17);
  1559. $self._deny_($15);
  1560. $19=(1).__gt((0));
  1561. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1562. $ctx1.sendIdx[">"]=5;
  1563. //>>excludeEnd("ctx");
  1564. $18=false.__or($19);
  1565. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1566. $ctx1.sendIdx["|"]=5;
  1567. //>>excludeEnd("ctx");
  1568. $self._assert_($18);
  1569. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1570. $ctx1.sendIdx["assert:"]=6;
  1571. //>>excludeEnd("ctx");
  1572. $21=(1).__gt((0));
  1573. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1574. $ctx1.sendIdx[">"]=6;
  1575. //>>excludeEnd("ctx");
  1576. $20=$recv($21).__or(false);
  1577. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1578. $ctx1.sendIdx["|"]=6;
  1579. //>>excludeEnd("ctx");
  1580. $self._assert_($20);
  1581. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1582. $ctx1.sendIdx["assert:"]=7;
  1583. //>>excludeEnd("ctx");
  1584. $23=(1).__gt((0));
  1585. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1586. $ctx1.sendIdx[">"]=7;
  1587. //>>excludeEnd("ctx");
  1588. $22=$recv($23).__or((1).__gt((2)));
  1589. $self._assert_($22);
  1590. return self;
  1591. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1592. }, function($ctx1) {$ctx1.fill(self,"testLogic",{},$globals.BooleanTest)});
  1593. //>>excludeEnd("ctx");
  1594. },
  1595. //>>excludeStart("ide", pragmas.excludeIdeData);
  1596. args: [],
  1597. source: "testLogic\x0a\x09\x22Trivial logic table\x22\x0a\x09self assert: (true & true);\x0a\x09\x09deny: (true & false);\x0a\x09\x09deny: (false & true);\x0a\x09\x09deny: (false & false).\x0a\x09self assert: (true | true);\x0a\x09\x09assert: (true | false);\x0a\x09\x09assert: (false | true);\x0a\x09\x09deny: (false | false).\x0a\x09\x22Checking that expressions work fine too\x22\x0a\x09self assert: (true & (1 > 0));\x0a\x09\x09deny: ((1 > 0) & false);\x0a\x09\x09deny: ((1 > 0) & (1 > 2)).\x0a\x09self assert: (false | (1 > 0));\x0a\x09\x09assert: ((1 > 0) | false);\x0a\x09\x09assert: ((1 > 0) | (1 > 2))",
  1598. referencedClasses: [],
  1599. //>>excludeEnd("ide");
  1600. messageSends: ["assert:", "&", "deny:", "|", ">"]
  1601. }),
  1602. $globals.BooleanTest);
  1603. $core.addMethod(
  1604. $core.method({
  1605. selector: "testLogicKeywords",
  1606. protocol: "tests",
  1607. fn: function (){
  1608. var self=this,$self=this;
  1609. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1610. return $core.withContext(function($ctx1) {
  1611. //>>excludeEnd("ctx");
  1612. var $1,$2,$3,$5,$4,$6,$7,$8,$10,$9,$11,$13,$12,$15,$14,$16,$18,$17,$20,$19;
  1613. $1=true._and_((function(){
  1614. return true;
  1615. }));
  1616. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1617. $ctx1.sendIdx["and:"]=1;
  1618. //>>excludeEnd("ctx");
  1619. $self._assert_($1);
  1620. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1621. $ctx1.sendIdx["assert:"]=1;
  1622. //>>excludeEnd("ctx");
  1623. $2=true._and_((function(){
  1624. return false;
  1625. }));
  1626. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1627. $ctx1.sendIdx["and:"]=2;
  1628. //>>excludeEnd("ctx");
  1629. $self._deny_($2);
  1630. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1631. $ctx1.sendIdx["deny:"]=1;
  1632. //>>excludeEnd("ctx");
  1633. $3=false._and_((function(){
  1634. return true;
  1635. }));
  1636. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1637. $ctx1.sendIdx["and:"]=3;
  1638. //>>excludeEnd("ctx");
  1639. $self._deny_($3);
  1640. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1641. $ctx1.sendIdx["deny:"]=2;
  1642. //>>excludeEnd("ctx");
  1643. $5=false._and_((function(){
  1644. return false;
  1645. }));
  1646. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1647. $ctx1.sendIdx["and:"]=4;
  1648. //>>excludeEnd("ctx");
  1649. $4=$self._deny_($5);
  1650. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1651. $ctx1.sendIdx["deny:"]=3;
  1652. //>>excludeEnd("ctx");
  1653. $6=true._or_((function(){
  1654. return true;
  1655. }));
  1656. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1657. $ctx1.sendIdx["or:"]=1;
  1658. //>>excludeEnd("ctx");
  1659. $self._assert_($6);
  1660. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1661. $ctx1.sendIdx["assert:"]=2;
  1662. //>>excludeEnd("ctx");
  1663. $7=true._or_((function(){
  1664. return false;
  1665. }));
  1666. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1667. $ctx1.sendIdx["or:"]=2;
  1668. //>>excludeEnd("ctx");
  1669. $self._assert_($7);
  1670. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1671. $ctx1.sendIdx["assert:"]=3;
  1672. //>>excludeEnd("ctx");
  1673. $8=false._or_((function(){
  1674. return true;
  1675. }));
  1676. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1677. $ctx1.sendIdx["or:"]=3;
  1678. //>>excludeEnd("ctx");
  1679. $self._assert_($8);
  1680. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1681. $ctx1.sendIdx["assert:"]=4;
  1682. //>>excludeEnd("ctx");
  1683. $10=false._or_((function(){
  1684. return false;
  1685. }));
  1686. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1687. $ctx1.sendIdx["or:"]=4;
  1688. //>>excludeEnd("ctx");
  1689. $9=$self._deny_($10);
  1690. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1691. $ctx1.sendIdx["deny:"]=4;
  1692. //>>excludeEnd("ctx");
  1693. $11=true._and_((function(){
  1694. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1695. return $core.withContext(function($ctx2) {
  1696. //>>excludeEnd("ctx");
  1697. return (1).__gt((0));
  1698. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1699. $ctx2.sendIdx[">"]=1;
  1700. //>>excludeEnd("ctx");
  1701. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1702. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,9)});
  1703. //>>excludeEnd("ctx");
  1704. }));
  1705. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1706. $ctx1.sendIdx["and:"]=5;
  1707. //>>excludeEnd("ctx");
  1708. $self._assert_($11);
  1709. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1710. $ctx1.sendIdx["assert:"]=5;
  1711. //>>excludeEnd("ctx");
  1712. $13=(1).__gt((0));
  1713. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1714. $ctx1.sendIdx[">"]=2;
  1715. //>>excludeEnd("ctx");
  1716. $12=$recv($13)._and_((function(){
  1717. return false;
  1718. }));
  1719. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1720. $ctx1.sendIdx["and:"]=6;
  1721. //>>excludeEnd("ctx");
  1722. $self._deny_($12);
  1723. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1724. $ctx1.sendIdx["deny:"]=5;
  1725. //>>excludeEnd("ctx");
  1726. $15=(1).__gt((0));
  1727. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1728. $ctx1.sendIdx[">"]=3;
  1729. //>>excludeEnd("ctx");
  1730. $14=$recv($15)._and_((function(){
  1731. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1732. return $core.withContext(function($ctx2) {
  1733. //>>excludeEnd("ctx");
  1734. return (1).__gt((2));
  1735. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1736. $ctx2.sendIdx[">"]=4;
  1737. //>>excludeEnd("ctx");
  1738. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1739. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,11)});
  1740. //>>excludeEnd("ctx");
  1741. }));
  1742. $self._deny_($14);
  1743. $16=false._or_((function(){
  1744. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1745. return $core.withContext(function($ctx2) {
  1746. //>>excludeEnd("ctx");
  1747. return (1).__gt((0));
  1748. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1749. $ctx2.sendIdx[">"]=5;
  1750. //>>excludeEnd("ctx");
  1751. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1752. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,12)});
  1753. //>>excludeEnd("ctx");
  1754. }));
  1755. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1756. $ctx1.sendIdx["or:"]=5;
  1757. //>>excludeEnd("ctx");
  1758. $self._assert_($16);
  1759. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1760. $ctx1.sendIdx["assert:"]=6;
  1761. //>>excludeEnd("ctx");
  1762. $18=(1).__gt((0));
  1763. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1764. $ctx1.sendIdx[">"]=6;
  1765. //>>excludeEnd("ctx");
  1766. $17=$recv($18)._or_((function(){
  1767. return false;
  1768. }));
  1769. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1770. $ctx1.sendIdx["or:"]=6;
  1771. //>>excludeEnd("ctx");
  1772. $self._assert_($17);
  1773. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1774. $ctx1.sendIdx["assert:"]=7;
  1775. //>>excludeEnd("ctx");
  1776. $20=(1).__gt((0));
  1777. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1778. $ctx1.sendIdx[">"]=7;
  1779. //>>excludeEnd("ctx");
  1780. $19=$recv($20)._or_((function(){
  1781. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1782. return $core.withContext(function($ctx2) {
  1783. //>>excludeEnd("ctx");
  1784. return (1).__gt((2));
  1785. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1786. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,14)});
  1787. //>>excludeEnd("ctx");
  1788. }));
  1789. $self._assert_($19);
  1790. return self;
  1791. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1792. }, function($ctx1) {$ctx1.fill(self,"testLogicKeywords",{},$globals.BooleanTest)});
  1793. //>>excludeEnd("ctx");
  1794. },
  1795. //>>excludeStart("ide", pragmas.excludeIdeData);
  1796. args: [],
  1797. source: "testLogicKeywords\x0a\x09\x22Trivial logic table\x22\x0a\x09self\x0a\x09\x09assert: (true and: [ true ]);\x0a\x09\x09deny: (true and: [ false ]);\x0a\x09\x09deny: (false and: [ true ]);\x0a\x09\x09deny: (false and: [ false ]).\x0a\x09self\x0a\x09\x09assert: (true or: [ true ]);\x0a\x09\x09assert: (true or: [ false ]);\x0a\x09\x09assert: (false or: [ true ]);\x0a\x09\x09deny: (false or: [ false ]).\x0a\x09\x09\x0a\x09\x22Checking that expressions work fine too\x22\x0a\x09self\x0a\x09\x09assert: (true and: [ 1 > 0 ]);\x0a\x09\x09deny: ((1 > 0) and: [ false ]);\x0a\x09\x09deny: ((1 > 0) and: [ 1 > 2 ]).\x0a\x09self\x0a\x09\x09assert: (false or: [ 1 > 0 ]);\x0a\x09\x09assert: ((1 > 0) or: [ false ]);\x0a\x09\x09assert: ((1 > 0) or: [ 1 > 2 ])",
  1798. referencedClasses: [],
  1799. //>>excludeEnd("ide");
  1800. messageSends: ["assert:", "and:", "deny:", "or:", ">"]
  1801. }),
  1802. $globals.BooleanTest);
  1803. $core.addMethod(
  1804. $core.method({
  1805. selector: "testNonBooleanError",
  1806. protocol: "tests",
  1807. fn: function (){
  1808. var self=this,$self=this;
  1809. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1810. return $core.withContext(function($ctx1) {
  1811. //>>excludeEnd("ctx");
  1812. $self._should_raise_((function(){
  1813. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1814. return $core.withContext(function($ctx2) {
  1815. //>>excludeEnd("ctx");
  1816. if($core.assert("")){
  1817. } else {
  1818. }
  1819. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1820. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  1821. //>>excludeEnd("ctx");
  1822. }),$globals.NonBooleanReceiver);
  1823. return self;
  1824. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1825. }, function($ctx1) {$ctx1.fill(self,"testNonBooleanError",{},$globals.BooleanTest)});
  1826. //>>excludeEnd("ctx");
  1827. },
  1828. //>>excludeStart("ide", pragmas.excludeIdeData);
  1829. args: [],
  1830. source: "testNonBooleanError\x0a\x09self should: [ '' ifTrue: [] ifFalse: [] ] raise: NonBooleanReceiver",
  1831. referencedClasses: ["NonBooleanReceiver"],
  1832. //>>excludeEnd("ide");
  1833. messageSends: ["should:raise:", "ifTrue:ifFalse:"]
  1834. }),
  1835. $globals.BooleanTest);
  1836. $core.addClass("ClassBuilderTest", $globals.TestCase, ["builder", "theClass"], "Kernel-Tests");
  1837. $core.addMethod(
  1838. $core.method({
  1839. selector: "setUp",
  1840. protocol: "running",
  1841. fn: function (){
  1842. var self=this,$self=this;
  1843. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1844. return $core.withContext(function($ctx1) {
  1845. //>>excludeEnd("ctx");
  1846. $self["@builder"]=$recv($globals.ClassBuilder)._new();
  1847. return self;
  1848. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1849. }, function($ctx1) {$ctx1.fill(self,"setUp",{},$globals.ClassBuilderTest)});
  1850. //>>excludeEnd("ctx");
  1851. },
  1852. //>>excludeStart("ide", pragmas.excludeIdeData);
  1853. args: [],
  1854. source: "setUp\x0a\x09builder := ClassBuilder new",
  1855. referencedClasses: ["ClassBuilder"],
  1856. //>>excludeEnd("ide");
  1857. messageSends: ["new"]
  1858. }),
  1859. $globals.ClassBuilderTest);
  1860. $core.addMethod(
  1861. $core.method({
  1862. selector: "tearDown",
  1863. protocol: "running",
  1864. fn: function (){
  1865. var self=this,$self=this;
  1866. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1867. return $core.withContext(function($ctx1) {
  1868. //>>excludeEnd("ctx");
  1869. var $1,$receiver;
  1870. $1=$self["@theClass"];
  1871. if(($receiver = $1) == null || $receiver.a$nil){
  1872. $1;
  1873. } else {
  1874. $recv($globals.Smalltalk)._removeClass_($self["@theClass"]);
  1875. $self._deny_($recv($recv($recv($self["@theClass"])._package())._classes())._includes_($self["@theClass"]));
  1876. $self["@theClass"]=nil;
  1877. $self["@theClass"];
  1878. }
  1879. return self;
  1880. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1881. }, function($ctx1) {$ctx1.fill(self,"tearDown",{},$globals.ClassBuilderTest)});
  1882. //>>excludeEnd("ctx");
  1883. },
  1884. //>>excludeStart("ide", pragmas.excludeIdeData);
  1885. args: [],
  1886. source: "tearDown\x0a\x09theClass ifNotNil: [\x0a\x09\x09Smalltalk removeClass: theClass.\x0a\x09\x09self deny: (theClass package classes includes: theClass).\x0a\x09\x09theClass := nil ]",
  1887. referencedClasses: ["Smalltalk"],
  1888. //>>excludeEnd("ide");
  1889. messageSends: ["ifNotNil:", "removeClass:", "deny:", "includes:", "classes", "package"]
  1890. }),
  1891. $globals.ClassBuilderTest);
  1892. $core.addMethod(
  1893. $core.method({
  1894. selector: "testAddTrait",
  1895. protocol: "tests",
  1896. fn: function (){
  1897. var self=this,$self=this;
  1898. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1899. return $core.withContext(function($ctx1) {
  1900. //>>excludeEnd("ctx");
  1901. var $3,$2,$1,$4;
  1902. $self["@theClass"]=$recv($self["@builder"])._addTraitNamed_package_("ObjectMock2","Kernel-Tests");
  1903. $self._assert_equals_($recv($self["@theClass"])._name(),"ObjectMock2");
  1904. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1905. $ctx1.sendIdx["assert:equals:"]=1;
  1906. //>>excludeEnd("ctx");
  1907. $3=$recv($self["@theClass"])._package();
  1908. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1909. $ctx1.sendIdx["package"]=1;
  1910. //>>excludeEnd("ctx");
  1911. $2=$recv($3)._classes();
  1912. $1=$recv($2)._occurrencesOf_($self["@theClass"]);
  1913. $self._assert_equals_($1,(1));
  1914. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1915. $ctx1.sendIdx["assert:equals:"]=2;
  1916. //>>excludeEnd("ctx");
  1917. $4=$recv($self["@theClass"])._package();
  1918. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1919. $ctx1.sendIdx["package"]=2;
  1920. //>>excludeEnd("ctx");
  1921. $self._assert_equals_($4,$recv($globals.ObjectMock)._package());
  1922. return self;
  1923. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1924. }, function($ctx1) {$ctx1.fill(self,"testAddTrait",{},$globals.ClassBuilderTest)});
  1925. //>>excludeEnd("ctx");
  1926. },
  1927. //>>excludeStart("ide", pragmas.excludeIdeData);
  1928. args: [],
  1929. source: "testAddTrait\x0a\x09theClass := builder addTraitNamed: 'ObjectMock2' package: 'Kernel-Tests'.\x0a\x09self assert: theClass name equals: 'ObjectMock2'.\x0a\x09self assert: (theClass package classes occurrencesOf: theClass) equals: 1.\x0a\x09self assert: theClass package equals: ObjectMock package",
  1930. referencedClasses: ["ObjectMock"],
  1931. //>>excludeEnd("ide");
  1932. messageSends: ["addTraitNamed:package:", "assert:equals:", "name", "occurrencesOf:", "classes", "package"]
  1933. }),
  1934. $globals.ClassBuilderTest);
  1935. $core.addMethod(
  1936. $core.method({
  1937. selector: "testClassCopy",
  1938. protocol: "tests",
  1939. fn: function (){
  1940. var self=this,$self=this;
  1941. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1942. return $core.withContext(function($ctx1) {
  1943. //>>excludeEnd("ctx");
  1944. var $2,$1,$4,$3,$6,$7,$5,$9,$8;
  1945. $self["@theClass"]=$recv($self["@builder"])._copyClass_named_($globals.ObjectMock,"ObjectMock2");
  1946. $2=$recv($self["@theClass"])._superclass();
  1947. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1948. $ctx1.sendIdx["superclass"]=1;
  1949. //>>excludeEnd("ctx");
  1950. $1=$recv($2).__eq_eq($recv($globals.ObjectMock)._superclass());
  1951. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1952. $ctx1.sendIdx["=="]=1;
  1953. //>>excludeEnd("ctx");
  1954. $self._assert_($1);
  1955. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1956. $ctx1.sendIdx["assert:"]=1;
  1957. //>>excludeEnd("ctx");
  1958. $4=$recv($self["@theClass"])._instanceVariableNames();
  1959. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1960. $ctx1.sendIdx["instanceVariableNames"]=1;
  1961. //>>excludeEnd("ctx");
  1962. $3=$recv($4).__eq_eq($recv($globals.ObjectMock)._instanceVariableNames());
  1963. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1964. $ctx1.sendIdx["=="]=2;
  1965. //>>excludeEnd("ctx");
  1966. $self._assert_($3);
  1967. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1968. $ctx1.sendIdx["assert:"]=2;
  1969. //>>excludeEnd("ctx");
  1970. $self._assert_equals_($recv($self["@theClass"])._name(),"ObjectMock2");
  1971. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1972. $ctx1.sendIdx["assert:equals:"]=1;
  1973. //>>excludeEnd("ctx");
  1974. $6=$recv($self["@theClass"])._package();
  1975. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1976. $ctx1.sendIdx["package"]=1;
  1977. //>>excludeEnd("ctx");
  1978. $7=$recv($globals.ObjectMock)._package();
  1979. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1980. $ctx1.sendIdx["package"]=2;
  1981. //>>excludeEnd("ctx");
  1982. $5=$recv($6).__eq_eq($7);
  1983. $self._assert_($5);
  1984. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1985. $ctx1.sendIdx["assert:"]=3;
  1986. //>>excludeEnd("ctx");
  1987. $self._assert_($recv($recv($recv($self["@theClass"])._package())._classes())._includes_($self["@theClass"]));
  1988. $9=$recv($self["@theClass"])._methodDictionary();
  1989. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1990. $ctx1.sendIdx["methodDictionary"]=1;
  1991. //>>excludeEnd("ctx");
  1992. $8=$recv($9)._keys();
  1993. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1994. $ctx1.sendIdx["keys"]=1;
  1995. //>>excludeEnd("ctx");
  1996. $self._assert_equals_($8,$recv($recv($globals.ObjectMock)._methodDictionary())._keys());
  1997. return self;
  1998. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1999. }, function($ctx1) {$ctx1.fill(self,"testClassCopy",{},$globals.ClassBuilderTest)});
  2000. //>>excludeEnd("ctx");
  2001. },
  2002. //>>excludeStart("ide", pragmas.excludeIdeData);
  2003. args: [],
  2004. source: "testClassCopy\x0a\x09theClass := builder copyClass: ObjectMock named: 'ObjectMock2'.\x0a\x09self assert: theClass superclass == ObjectMock superclass.\x0a\x09self assert: theClass instanceVariableNames == ObjectMock instanceVariableNames.\x0a\x09self assert: theClass name equals: 'ObjectMock2'.\x0a\x09self assert: theClass package == ObjectMock package.\x0a\x09self assert: (theClass package classes includes: theClass).\x0a\x09self assert: theClass methodDictionary keys equals: ObjectMock methodDictionary keys",
  2005. referencedClasses: ["ObjectMock"],
  2006. //>>excludeEnd("ide");
  2007. messageSends: ["copyClass:named:", "assert:", "==", "superclass", "instanceVariableNames", "assert:equals:", "name", "package", "includes:", "classes", "keys", "methodDictionary"]
  2008. }),
  2009. $globals.ClassBuilderTest);
  2010. $core.addMethod(
  2011. $core.method({
  2012. selector: "testClassMigration",
  2013. protocol: "tests",
  2014. fn: function (){
  2015. var self=this,$self=this;
  2016. var instance,oldClass;
  2017. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2018. return $core.withContext(function($ctx1) {
  2019. //>>excludeEnd("ctx");
  2020. var $2,$1,$4,$3,$5,$6,$7,$8,$10,$9,$12,$11;
  2021. oldClass=$recv($self["@builder"])._copyClass_named_($globals.ObjectMock,"ObjectMock2");
  2022. $2=$recv($globals.Smalltalk)._globals();
  2023. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2024. $ctx1.sendIdx["globals"]=1;
  2025. //>>excludeEnd("ctx");
  2026. $1=$recv($2)._at_("ObjectMock2");
  2027. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2028. $ctx1.sendIdx["at:"]=1;
  2029. //>>excludeEnd("ctx");
  2030. instance=$recv($1)._new();
  2031. $4=$recv($globals.Smalltalk)._globals();
  2032. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2033. $ctx1.sendIdx["globals"]=2;
  2034. //>>excludeEnd("ctx");
  2035. $3=$recv($4)._at_("ObjectMock2");
  2036. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2037. $ctx1.sendIdx["at:"]=2;
  2038. //>>excludeEnd("ctx");
  2039. $recv($globals.ObjectMock)._subclass_instanceVariableNames_package_($3,"","Kernel-Tests");
  2040. $5=$recv(oldClass).__eq_eq($globals.ObjectMock2);
  2041. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2042. $ctx1.sendIdx["=="]=1;
  2043. //>>excludeEnd("ctx");
  2044. $self._deny_($5);
  2045. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2046. $ctx1.sendIdx["deny:"]=1;
  2047. //>>excludeEnd("ctx");
  2048. $6=$recv($recv($globals.ObjectMock2)._superclass()).__eq_eq($globals.ObjectMock);
  2049. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2050. $ctx1.sendIdx["=="]=2;
  2051. //>>excludeEnd("ctx");
  2052. $self._assert_($6);
  2053. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2054. $ctx1.sendIdx["assert:"]=1;
  2055. //>>excludeEnd("ctx");
  2056. $self._assert_($recv($recv($globals.ObjectMock2)._instanceVariableNames())._isEmpty());
  2057. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2058. $ctx1.sendIdx["assert:"]=2;
  2059. //>>excludeEnd("ctx");
  2060. $7=$recv($globals.ObjectMock2)._selectors();
  2061. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2062. $ctx1.sendIdx["selectors"]=1;
  2063. //>>excludeEnd("ctx");
  2064. $self._assert_equals_($7,$recv(oldClass)._selectors());
  2065. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2066. $ctx1.sendIdx["assert:equals:"]=1;
  2067. //>>excludeEnd("ctx");
  2068. $8=$recv($globals.ObjectMock2)._comment();
  2069. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2070. $ctx1.sendIdx["comment"]=1;
  2071. //>>excludeEnd("ctx");
  2072. $self._assert_equals_($8,$recv(oldClass)._comment());
  2073. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2074. $ctx1.sendIdx["assert:equals:"]=2;
  2075. //>>excludeEnd("ctx");
  2076. $10=$recv($globals.ObjectMock2)._package();
  2077. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2078. $ctx1.sendIdx["package"]=1;
  2079. //>>excludeEnd("ctx");
  2080. $9=$recv($10)._name();
  2081. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2082. $ctx1.sendIdx["name"]=1;
  2083. //>>excludeEnd("ctx");
  2084. $self._assert_equals_($9,"Kernel-Tests");
  2085. $self._assert_($recv($recv($recv($globals.ObjectMock2)._package())._classes())._includes_($globals.ObjectMock2));
  2086. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2087. $ctx1.sendIdx["assert:"]=3;
  2088. //>>excludeEnd("ctx");
  2089. $12=$recv(instance)._class();
  2090. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2091. $ctx1.sendIdx["class"]=1;
  2092. //>>excludeEnd("ctx");
  2093. $11=$recv($12).__eq_eq($globals.ObjectMock2);
  2094. $self._deny_($11);
  2095. $self._assert_($recv($recv($recv($globals.Smalltalk)._globals())._at_($recv($recv(instance)._class())._name()))._isNil());
  2096. $recv($globals.Smalltalk)._removeClass_($globals.ObjectMock2);
  2097. return self;
  2098. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2099. }, function($ctx1) {$ctx1.fill(self,"testClassMigration",{instance:instance,oldClass:oldClass},$globals.ClassBuilderTest)});
  2100. //>>excludeEnd("ctx");
  2101. },
  2102. //>>excludeStart("ide", pragmas.excludeIdeData);
  2103. args: [],
  2104. source: "testClassMigration\x0a\x09| instance oldClass |\x0a\x09\x0a\x09oldClass := builder copyClass: ObjectMock named: 'ObjectMock2'.\x0a\x09instance := (Smalltalk globals at: 'ObjectMock2') new.\x0a\x09\x0a\x09\x22Change the superclass of ObjectMock2\x22\x0a\x09ObjectMock subclass: (Smalltalk globals at: 'ObjectMock2')\x0a\x09\x09instanceVariableNames: ''\x0a\x09\x09package: 'Kernel-Tests'.\x0a\x09\x0a\x09self deny: oldClass == ObjectMock2.\x0a\x09\x0a\x09self assert: ObjectMock2 superclass == ObjectMock.\x0a\x09self assert: ObjectMock2 instanceVariableNames isEmpty.\x0a\x09self assert: ObjectMock2 selectors equals: oldClass selectors.\x0a\x09self assert: ObjectMock2 comment equals: oldClass comment.\x0a\x09self assert: ObjectMock2 package name equals: 'Kernel-Tests'.\x0a\x09self assert: (ObjectMock2 package classes includes: ObjectMock2).\x0a\x09\x0a\x09self deny: instance class == ObjectMock2.\x0a\x09\x22Commeting this out. Tests implementation detail.\x22\x0a\x09\x22self assert: instance class name equals: 'OldObjectMock2'.\x22\x0a\x09\x0a\x09self assert: (Smalltalk globals at: instance class name) isNil.\x0a\x09\x0a\x09Smalltalk removeClass: ObjectMock2",
  2105. referencedClasses: ["ObjectMock", "Smalltalk", "ObjectMock2"],
  2106. //>>excludeEnd("ide");
  2107. messageSends: ["copyClass:named:", "new", "at:", "globals", "subclass:instanceVariableNames:package:", "deny:", "==", "assert:", "superclass", "isEmpty", "instanceVariableNames", "assert:equals:", "selectors", "comment", "name", "package", "includes:", "classes", "class", "isNil", "removeClass:"]
  2108. }),
  2109. $globals.ClassBuilderTest);
  2110. $core.addMethod(
  2111. $core.method({
  2112. selector: "testClassMigrationWithClassInstanceVariables",
  2113. protocol: "tests",
  2114. fn: function (){
  2115. var self=this,$self=this;
  2116. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2117. return $core.withContext(function($ctx1) {
  2118. //>>excludeEnd("ctx");
  2119. var $1;
  2120. $recv($self["@builder"])._copyClass_named_($globals.ObjectMock,"ObjectMock2");
  2121. $1=$recv($globals.ObjectMock2)._class();
  2122. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2123. $ctx1.sendIdx["class"]=1;
  2124. //>>excludeEnd("ctx");
  2125. $recv($1)._instanceVariableNames_("foo bar");
  2126. $recv($globals.ObjectMock)._subclass_instanceVariableNames_package_($recv($recv($globals.Smalltalk)._globals())._at_("ObjectMock2"),"","Kernel-Tests");
  2127. $self._assert_equals_($recv($recv($globals.ObjectMock2)._class())._instanceVariableNames(),["foo", "bar"]);
  2128. $recv($globals.Smalltalk)._removeClass_($globals.ObjectMock2);
  2129. return self;
  2130. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2131. }, function($ctx1) {$ctx1.fill(self,"testClassMigrationWithClassInstanceVariables",{},$globals.ClassBuilderTest)});
  2132. //>>excludeEnd("ctx");
  2133. },
  2134. //>>excludeStart("ide", pragmas.excludeIdeData);
  2135. args: [],
  2136. source: "testClassMigrationWithClassInstanceVariables\x0a\x09\x0a\x09builder copyClass: ObjectMock named: 'ObjectMock2'.\x0a\x09ObjectMock2 class instanceVariableNames: 'foo bar'.\x0a\x09\x0a\x09\x22Change the superclass of ObjectMock2\x22\x0a\x09ObjectMock subclass: (Smalltalk globals at: 'ObjectMock2')\x0a\x09\x09instanceVariableNames: ''\x0a\x09\x09package: 'Kernel-Tests'.\x0a\x09\x0a\x09self assert: ObjectMock2 class instanceVariableNames equals: #('foo' 'bar').\x0a\x09\x0a\x09Smalltalk removeClass: ObjectMock2",
  2137. referencedClasses: ["ObjectMock", "ObjectMock2", "Smalltalk"],
  2138. //>>excludeEnd("ide");
  2139. messageSends: ["copyClass:named:", "instanceVariableNames:", "class", "subclass:instanceVariableNames:package:", "at:", "globals", "assert:equals:", "instanceVariableNames", "removeClass:"]
  2140. }),
  2141. $globals.ClassBuilderTest);
  2142. $core.addMethod(
  2143. $core.method({
  2144. selector: "testClassMigrationWithSubclasses",
  2145. protocol: "tests",
  2146. fn: function (){
  2147. var self=this,$self=this;
  2148. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2149. return $core.withContext(function($ctx1) {
  2150. //>>excludeEnd("ctx");
  2151. var $2,$1,$4,$3;
  2152. $recv($self["@builder"])._copyClass_named_($globals.ObjectMock,"ObjectMock2");
  2153. $recv($globals.ObjectMock2)._subclass_instanceVariableNames_package_("ObjectMock3","","Kernel-Tests");
  2154. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2155. $ctx1.sendIdx["subclass:instanceVariableNames:package:"]=1;
  2156. //>>excludeEnd("ctx");
  2157. $recv($globals.ObjectMock3)._subclass_instanceVariableNames_package_("ObjectMock4","","Kernel-Tests");
  2158. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2159. $ctx1.sendIdx["subclass:instanceVariableNames:package:"]=2;
  2160. //>>excludeEnd("ctx");
  2161. $recv($globals.ObjectMock)._subclass_instanceVariableNames_package_($recv($recv($globals.Smalltalk)._globals())._at_("ObjectMock2"),"","Kernel-Tests");
  2162. $2=$recv($globals.ObjectMock)._subclasses();
  2163. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2164. $ctx1.sendIdx["subclasses"]=1;
  2165. //>>excludeEnd("ctx");
  2166. $1=$recv($2)._includes_($globals.ObjectMock2);
  2167. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2168. $ctx1.sendIdx["includes:"]=1;
  2169. //>>excludeEnd("ctx");
  2170. $self._assert_($1);
  2171. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2172. $ctx1.sendIdx["assert:"]=1;
  2173. //>>excludeEnd("ctx");
  2174. $4=$recv($globals.ObjectMock2)._subclasses();
  2175. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2176. $ctx1.sendIdx["subclasses"]=2;
  2177. //>>excludeEnd("ctx");
  2178. $3=$recv($4)._includes_($globals.ObjectMock3);
  2179. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2180. $ctx1.sendIdx["includes:"]=2;
  2181. //>>excludeEnd("ctx");
  2182. $self._assert_($3);
  2183. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2184. $ctx1.sendIdx["assert:"]=2;
  2185. //>>excludeEnd("ctx");
  2186. $self._assert_($recv($recv($globals.ObjectMock3)._subclasses())._includes_($globals.ObjectMock4));
  2187. $recv($recv($globals.ObjectMock)._allSubclasses())._reverseDo_((function(each){
  2188. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2189. return $core.withContext(function($ctx2) {
  2190. //>>excludeEnd("ctx");
  2191. return $recv($globals.Smalltalk)._removeClass_(each);
  2192. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2193. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2194. //>>excludeEnd("ctx");
  2195. }));
  2196. return self;
  2197. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2198. }, function($ctx1) {$ctx1.fill(self,"testClassMigrationWithSubclasses",{},$globals.ClassBuilderTest)});
  2199. //>>excludeEnd("ctx");
  2200. },
  2201. //>>excludeStart("ide", pragmas.excludeIdeData);
  2202. args: [],
  2203. source: "testClassMigrationWithSubclasses\x0a\x09\x0a\x09builder copyClass: ObjectMock named: 'ObjectMock2'.\x0a\x09ObjectMock2 subclass: 'ObjectMock3' instanceVariableNames: '' package: 'Kernel-Tests'.\x0a\x09ObjectMock3 subclass: 'ObjectMock4' instanceVariableNames: '' package: 'Kernel-Tests'.\x0a\x09\x0a\x09\x22Change the superclass of ObjectMock2\x22\x0a\x09ObjectMock subclass: (Smalltalk globals at: 'ObjectMock2')\x0a\x09\x09instanceVariableNames: ''\x0a\x09\x09package: 'Kernel-Tests'.\x0a\x09\x0a\x09self assert: (ObjectMock subclasses includes: ObjectMock2).\x0a\x09self assert: (ObjectMock2 subclasses includes: ObjectMock3).\x0a\x09self assert: (ObjectMock3 subclasses includes: ObjectMock4).\x0a\x09\x0a\x09ObjectMock allSubclasses reverseDo: [ :each | Smalltalk removeClass: each ]",
  2204. referencedClasses: ["ObjectMock", "ObjectMock2", "ObjectMock3", "Smalltalk", "ObjectMock4"],
  2205. //>>excludeEnd("ide");
  2206. messageSends: ["copyClass:named:", "subclass:instanceVariableNames:package:", "at:", "globals", "assert:", "includes:", "subclasses", "reverseDo:", "allSubclasses", "removeClass:"]
  2207. }),
  2208. $globals.ClassBuilderTest);
  2209. $core.addMethod(
  2210. $core.method({
  2211. selector: "testInstanceVariableNames",
  2212. protocol: "tests",
  2213. fn: function (){
  2214. var self=this,$self=this;
  2215. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2216. return $core.withContext(function($ctx1) {
  2217. //>>excludeEnd("ctx");
  2218. $self._assert_equals_($recv($self["@builder"])._instanceVariableNamesFor_(" hello world "),["hello", "world"]);
  2219. return self;
  2220. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2221. }, function($ctx1) {$ctx1.fill(self,"testInstanceVariableNames",{},$globals.ClassBuilderTest)});
  2222. //>>excludeEnd("ctx");
  2223. },
  2224. //>>excludeStart("ide", pragmas.excludeIdeData);
  2225. args: [],
  2226. source: "testInstanceVariableNames\x0a\x09self assert: (builder instanceVariableNamesFor: ' hello world ') equals: #('hello' 'world')",
  2227. referencedClasses: [],
  2228. //>>excludeEnd("ide");
  2229. messageSends: ["assert:equals:", "instanceVariableNamesFor:"]
  2230. }),
  2231. $globals.ClassBuilderTest);
  2232. $core.addMethod(
  2233. $core.method({
  2234. selector: "testSubclass",
  2235. protocol: "tests",
  2236. fn: function (){
  2237. var self=this,$self=this;
  2238. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2239. return $core.withContext(function($ctx1) {
  2240. //>>excludeEnd("ctx");
  2241. var $3,$2,$1,$4;
  2242. $self["@theClass"]=$recv($self["@builder"])._addSubclassOf_named_instanceVariableNames_package_($globals.ObjectMock,"ObjectMock2","foo bar","Kernel-Tests");
  2243. $self._assert_equals_($recv($self["@theClass"])._superclass(),$globals.ObjectMock);
  2244. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2245. $ctx1.sendIdx["assert:equals:"]=1;
  2246. //>>excludeEnd("ctx");
  2247. $self._assert_equals_($recv($self["@theClass"])._instanceVariableNames(),"foo bar");
  2248. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2249. $ctx1.sendIdx["assert:equals:"]=2;
  2250. //>>excludeEnd("ctx");
  2251. $self._assert_equals_($recv($self["@theClass"])._name(),"ObjectMock2");
  2252. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2253. $ctx1.sendIdx["assert:equals:"]=3;
  2254. //>>excludeEnd("ctx");
  2255. $3=$recv($self["@theClass"])._package();
  2256. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2257. $ctx1.sendIdx["package"]=1;
  2258. //>>excludeEnd("ctx");
  2259. $2=$recv($3)._classes();
  2260. $1=$recv($2)._occurrencesOf_($self["@theClass"]);
  2261. $self._assert_equals_($1,(1));
  2262. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2263. $ctx1.sendIdx["assert:equals:"]=4;
  2264. //>>excludeEnd("ctx");
  2265. $4=$recv($self["@theClass"])._package();
  2266. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2267. $ctx1.sendIdx["package"]=2;
  2268. //>>excludeEnd("ctx");
  2269. $self._assert_equals_($4,$recv($globals.ObjectMock)._package());
  2270. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2271. $ctx1.sendIdx["assert:equals:"]=5;
  2272. //>>excludeEnd("ctx");
  2273. $self._assert_equals_($recv($recv($recv($self["@theClass"])._methodDictionary())._keys())._size(),(0));
  2274. return self;
  2275. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2276. }, function($ctx1) {$ctx1.fill(self,"testSubclass",{},$globals.ClassBuilderTest)});
  2277. //>>excludeEnd("ctx");
  2278. },
  2279. //>>excludeStart("ide", pragmas.excludeIdeData);
  2280. args: [],
  2281. source: "testSubclass\x0a\x09theClass := builder addSubclassOf: ObjectMock named: 'ObjectMock2' instanceVariableNames: 'foo bar' package: 'Kernel-Tests'.\x0a\x09self assert: theClass superclass equals: ObjectMock.\x0a\x09self assert: theClass instanceVariableNames equals: 'foo bar'.\x0a\x09self assert: theClass name equals: 'ObjectMock2'.\x0a\x09self assert: (theClass package classes occurrencesOf: theClass) equals: 1.\x0a\x09self assert: theClass package equals: ObjectMock package.\x0a\x09self assert: theClass methodDictionary keys size equals: 0",
  2282. referencedClasses: ["ObjectMock"],
  2283. //>>excludeEnd("ide");
  2284. messageSends: ["addSubclassOf:named:instanceVariableNames:package:", "assert:equals:", "superclass", "instanceVariableNames", "name", "occurrencesOf:", "classes", "package", "size", "keys", "methodDictionary"]
  2285. }),
  2286. $globals.ClassBuilderTest);
  2287. $core.addClass("ClassTest", $globals.TestCase, ["builder", "theClass"], "Kernel-Tests");
  2288. $core.addMethod(
  2289. $core.method({
  2290. selector: "jsConstructor",
  2291. protocol: "running",
  2292. fn: function (){
  2293. var self=this,$self=this;
  2294. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2295. return $core.withContext(function($ctx1) {
  2296. //>>excludeEnd("ctx");
  2297. function Foo(){}
  2298. Foo.prototype.valueOf = function () {return 4;};
  2299. return Foo;
  2300. ;
  2301. return self;
  2302. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2303. }, function($ctx1) {$ctx1.fill(self,"jsConstructor",{},$globals.ClassTest)});
  2304. //>>excludeEnd("ctx");
  2305. },
  2306. //>>excludeStart("ide", pragmas.excludeIdeData);
  2307. args: [],
  2308. source: "jsConstructor\x0a\x09<inlineJS: '\x0a\x09\x09function Foo(){}\x0a\x09\x09Foo.prototype.valueOf = function () {return 4;};\x0a\x09\x09return Foo;\x0a\x09'>",
  2309. referencedClasses: [],
  2310. //>>excludeEnd("ide");
  2311. messageSends: []
  2312. }),
  2313. $globals.ClassTest);
  2314. $core.addMethod(
  2315. $core.method({
  2316. selector: "setUp",
  2317. protocol: "running",
  2318. fn: function (){
  2319. var self=this,$self=this;
  2320. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2321. return $core.withContext(function($ctx1) {
  2322. //>>excludeEnd("ctx");
  2323. $self["@builder"]=$recv($globals.ClassBuilder)._new();
  2324. return self;
  2325. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2326. }, function($ctx1) {$ctx1.fill(self,"setUp",{},$globals.ClassTest)});
  2327. //>>excludeEnd("ctx");
  2328. },
  2329. //>>excludeStart("ide", pragmas.excludeIdeData);
  2330. args: [],
  2331. source: "setUp\x0a\x09builder := ClassBuilder new",
  2332. referencedClasses: ["ClassBuilder"],
  2333. //>>excludeEnd("ide");
  2334. messageSends: ["new"]
  2335. }),
  2336. $globals.ClassTest);
  2337. $core.addMethod(
  2338. $core.method({
  2339. selector: "tearDown",
  2340. protocol: "running",
  2341. fn: function (){
  2342. var self=this,$self=this;
  2343. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2344. return $core.withContext(function($ctx1) {
  2345. //>>excludeEnd("ctx");
  2346. var $1,$receiver;
  2347. $1=$self["@theClass"];
  2348. if(($receiver = $1) == null || $receiver.a$nil){
  2349. $1;
  2350. } else {
  2351. $recv($recv($self["@theClass"])._allSubclasses())._reverseDo_((function(each){
  2352. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2353. return $core.withContext(function($ctx2) {
  2354. //>>excludeEnd("ctx");
  2355. return $recv($globals.Smalltalk)._removeClass_(each);
  2356. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2357. $ctx2.sendIdx["removeClass:"]=1;
  2358. //>>excludeEnd("ctx");
  2359. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2360. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
  2361. //>>excludeEnd("ctx");
  2362. }));
  2363. $recv($globals.Smalltalk)._removeClass_($self["@theClass"]);
  2364. $self["@theClass"]=nil;
  2365. $self["@theClass"];
  2366. }
  2367. return self;
  2368. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2369. }, function($ctx1) {$ctx1.fill(self,"tearDown",{},$globals.ClassTest)});
  2370. //>>excludeEnd("ctx");
  2371. },
  2372. //>>excludeStart("ide", pragmas.excludeIdeData);
  2373. args: [],
  2374. source: "tearDown\x0a\x09theClass ifNotNil: [\x0a\x09\x09theClass allSubclasses reverseDo: [ :each | Smalltalk removeClass: each ].\x0a\x09\x09Smalltalk removeClass: theClass.\x0a\x09\x09theClass := nil ]",
  2375. referencedClasses: ["Smalltalk"],
  2376. //>>excludeEnd("ide");
  2377. messageSends: ["ifNotNil:", "reverseDo:", "allSubclasses", "removeClass:"]
  2378. }),
  2379. $globals.ClassTest);
  2380. $core.addMethod(
  2381. $core.method({
  2382. selector: "testAllSubclasses",
  2383. protocol: "tests",
  2384. fn: function (){
  2385. var self=this,$self=this;
  2386. var subclasses,index;
  2387. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2388. return $core.withContext(function($ctx1) {
  2389. //>>excludeEnd("ctx");
  2390. subclasses=$recv($globals.Object)._subclasses();
  2391. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2392. $ctx1.sendIdx["subclasses"]=1;
  2393. //>>excludeEnd("ctx");
  2394. index=(1);
  2395. $recv((function(){
  2396. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2397. return $core.withContext(function($ctx2) {
  2398. //>>excludeEnd("ctx");
  2399. return $recv(index).__gt($recv(subclasses)._size());
  2400. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2401. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  2402. //>>excludeEnd("ctx");
  2403. }))._whileFalse_((function(){
  2404. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2405. return $core.withContext(function($ctx2) {
  2406. //>>excludeEnd("ctx");
  2407. $recv(subclasses)._addAll_($recv($recv(subclasses)._at_(index))._subclasses());
  2408. index=$recv(index).__plus((1));
  2409. return index;
  2410. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2411. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  2412. //>>excludeEnd("ctx");
  2413. }));
  2414. $self._assert_equals_($recv($globals.Object)._allSubclasses(),subclasses);
  2415. return self;
  2416. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2417. }, function($ctx1) {$ctx1.fill(self,"testAllSubclasses",{subclasses:subclasses,index:index},$globals.ClassTest)});
  2418. //>>excludeEnd("ctx");
  2419. },
  2420. //>>excludeStart("ide", pragmas.excludeIdeData);
  2421. args: [],
  2422. source: "testAllSubclasses\x0a\x09| subclasses index |\x0a\x0a\x09subclasses := Object subclasses.\x0a\x09index := 1.\x0a\x09[ index > subclasses size ]\x0a\x09\x09whileFalse: [ subclasses addAll: (subclasses at: index) subclasses.\x0a\x09\x09\x09index := index + 1 ].\x0a\x0a\x09self assert: Object allSubclasses equals: subclasses",
  2423. referencedClasses: ["Object"],
  2424. //>>excludeEnd("ide");
  2425. messageSends: ["subclasses", "whileFalse:", ">", "size", "addAll:", "at:", "+", "assert:equals:", "allSubclasses"]
  2426. }),
  2427. $globals.ClassTest);
  2428. $core.addMethod(
  2429. $core.method({
  2430. selector: "testMetaclassSubclasses",
  2431. protocol: "tests",
  2432. fn: function (){
  2433. var self=this,$self=this;
  2434. var subclasses;
  2435. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2436. return $core.withContext(function($ctx1) {
  2437. //>>excludeEnd("ctx");
  2438. var $4,$3,$2,$1;
  2439. $4=$recv($globals.Object)._class();
  2440. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2441. $ctx1.sendIdx["class"]=1;
  2442. //>>excludeEnd("ctx");
  2443. $3=$recv($4)._instanceClass();
  2444. $2=$recv($3)._subclasses();
  2445. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2446. $ctx1.sendIdx["subclasses"]=1;
  2447. //>>excludeEnd("ctx");
  2448. $1=$recv($2)._select_((function(each){
  2449. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2450. return $core.withContext(function($ctx2) {
  2451. //>>excludeEnd("ctx");
  2452. return $recv($recv(each)._isMetaclass())._not();
  2453. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2454. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2455. //>>excludeEnd("ctx");
  2456. }));
  2457. subclasses=$recv($1)._collect_((function(each){
  2458. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2459. return $core.withContext(function($ctx2) {
  2460. //>>excludeEnd("ctx");
  2461. return $recv(each)._theMetaClass();
  2462. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2463. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
  2464. //>>excludeEnd("ctx");
  2465. }));
  2466. $self._assert_equals_($recv($recv($globals.Object)._class())._subclasses(),subclasses);
  2467. return self;
  2468. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2469. }, function($ctx1) {$ctx1.fill(self,"testMetaclassSubclasses",{subclasses:subclasses},$globals.ClassTest)});
  2470. //>>excludeEnd("ctx");
  2471. },
  2472. //>>excludeStart("ide", pragmas.excludeIdeData);
  2473. args: [],
  2474. source: "testMetaclassSubclasses\x0a\x09| subclasses |\x0a\x0a\x09subclasses := (Object class instanceClass subclasses \x0a\x09\x09select: [ :each | each isMetaclass not ])\x0a\x09\x09collect: [ :each | each theMetaClass ].\x0a\x0a\x09self assert: Object class subclasses equals: subclasses",
  2475. referencedClasses: ["Object"],
  2476. //>>excludeEnd("ide");
  2477. messageSends: ["collect:", "select:", "subclasses", "instanceClass", "class", "not", "isMetaclass", "theMetaClass", "assert:equals:"]
  2478. }),
  2479. $globals.ClassTest);
  2480. $core.addMethod(
  2481. $core.method({
  2482. selector: "testSetJavaScriptConstructor",
  2483. protocol: "tests",
  2484. fn: function (){
  2485. var self=this,$self=this;
  2486. var instance;
  2487. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2488. return $core.withContext(function($ctx1) {
  2489. //>>excludeEnd("ctx");
  2490. var $2,$1,$4,$3,$6,$5,$8,$7;
  2491. $self["@theClass"]=$recv($self["@builder"])._copyClass_named_($globals.ObjectMock,"ObjectMock2");
  2492. $recv($self["@theClass"])._javascriptConstructor_($self._jsConstructor());
  2493. $2=$recv($self["@theClass"])._superclass();
  2494. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2495. $ctx1.sendIdx["superclass"]=1;
  2496. //>>excludeEnd("ctx");
  2497. $1=$recv($2).__eq_eq($recv($globals.ObjectMock)._superclass());
  2498. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2499. $ctx1.sendIdx["=="]=1;
  2500. //>>excludeEnd("ctx");
  2501. $self._assert_($1);
  2502. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2503. $ctx1.sendIdx["assert:"]=1;
  2504. //>>excludeEnd("ctx");
  2505. $4=$recv($self["@theClass"])._instanceVariableNames();
  2506. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2507. $ctx1.sendIdx["instanceVariableNames"]=1;
  2508. //>>excludeEnd("ctx");
  2509. $3=$recv($4).__eq_eq($recv($globals.ObjectMock)._instanceVariableNames());
  2510. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2511. $ctx1.sendIdx["=="]=2;
  2512. //>>excludeEnd("ctx");
  2513. $self._assert_($3);
  2514. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2515. $ctx1.sendIdx["assert:"]=2;
  2516. //>>excludeEnd("ctx");
  2517. $self._assert_equals_($recv($self["@theClass"])._name(),"ObjectMock2");
  2518. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2519. $ctx1.sendIdx["assert:equals:"]=1;
  2520. //>>excludeEnd("ctx");
  2521. $6=$recv($self["@theClass"])._package();
  2522. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2523. $ctx1.sendIdx["package"]=1;
  2524. //>>excludeEnd("ctx");
  2525. $5=$recv($6).__eq_eq($recv($globals.ObjectMock)._package());
  2526. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2527. $ctx1.sendIdx["=="]=3;
  2528. //>>excludeEnd("ctx");
  2529. $self._assert_($5);
  2530. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2531. $ctx1.sendIdx["assert:"]=3;
  2532. //>>excludeEnd("ctx");
  2533. $8=$recv($self["@theClass"])._methodDictionary();
  2534. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2535. $ctx1.sendIdx["methodDictionary"]=1;
  2536. //>>excludeEnd("ctx");
  2537. $7=$recv($8)._keys();
  2538. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2539. $ctx1.sendIdx["keys"]=1;
  2540. //>>excludeEnd("ctx");
  2541. $self._assert_equals_($7,$recv($recv($globals.ObjectMock)._methodDictionary())._keys());
  2542. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2543. $ctx1.sendIdx["assert:equals:"]=2;
  2544. //>>excludeEnd("ctx");
  2545. instance=$recv($self["@theClass"])._new();
  2546. $self._assert_($recv($recv(instance)._class()).__eq_eq($self["@theClass"]));
  2547. $self._assert_equals_($recv(instance)._value(),(4));
  2548. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2549. $ctx1.sendIdx["assert:equals:"]=3;
  2550. //>>excludeEnd("ctx");
  2551. $self._shouldnt_raise_((function(){
  2552. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2553. return $core.withContext(function($ctx2) {
  2554. //>>excludeEnd("ctx");
  2555. return $recv(instance)._foo_((9));
  2556. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2557. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  2558. //>>excludeEnd("ctx");
  2559. }),$globals.Error);
  2560. $self._assert_equals_($recv(instance)._foo(),(9));
  2561. return self;
  2562. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2563. }, function($ctx1) {$ctx1.fill(self,"testSetJavaScriptConstructor",{instance:instance},$globals.ClassTest)});
  2564. //>>excludeEnd("ctx");
  2565. },
  2566. //>>excludeStart("ide", pragmas.excludeIdeData);
  2567. args: [],
  2568. source: "testSetJavaScriptConstructor\x0a\x09| instance |\x0a\x09theClass := builder copyClass: ObjectMock named: 'ObjectMock2'.\x0a\x09theClass javascriptConstructor: self jsConstructor.\x0a\x09\x22part took from copy class test\x22\x0a\x09self assert: theClass superclass == ObjectMock superclass.\x0a\x09self assert: theClass instanceVariableNames == ObjectMock instanceVariableNames.\x0a\x09self assert: theClass name equals: 'ObjectMock2'.\x0a\x09self assert: theClass package == ObjectMock package.\x0a\x09self assert: theClass methodDictionary keys equals: ObjectMock methodDictionary keys.\x0a\x09\x22testing specific to late-coupled detached root class\x22\x0a\x09instance := theClass new.\x0a\x09self assert: instance class == theClass.\x0a\x09self assert: instance value equals: 4.\x0a\x09self shouldnt: [ instance foo: 9 ] raise: Error.\x0a\x09self assert: instance foo equals: 9",
  2569. referencedClasses: ["ObjectMock", "Error"],
  2570. //>>excludeEnd("ide");
  2571. messageSends: ["copyClass:named:", "javascriptConstructor:", "jsConstructor", "assert:", "==", "superclass", "instanceVariableNames", "assert:equals:", "name", "package", "keys", "methodDictionary", "new", "class", "value", "shouldnt:raise:", "foo:", "foo"]
  2572. }),
  2573. $globals.ClassTest);
  2574. $core.addMethod(
  2575. $core.method({
  2576. selector: "testTrickySetJavaScriptConstructor",
  2577. protocol: "tests",
  2578. fn: function (){
  2579. var self=this,$self=this;
  2580. var instance;
  2581. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2582. return $core.withContext(function($ctx1) {
  2583. //>>excludeEnd("ctx");
  2584. var $2,$1,$4,$3,$6,$5,$8,$7;
  2585. $self["@theClass"]=$recv($self["@builder"])._copyClass_named_($globals.ObjectMock,"ObjectMock2");
  2586. $recv($self["@theClass"])._javascriptConstructor_($self._trickyJsConstructor());
  2587. $2=$recv($self["@theClass"])._superclass();
  2588. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2589. $ctx1.sendIdx["superclass"]=1;
  2590. //>>excludeEnd("ctx");
  2591. $1=$recv($2).__eq_eq($recv($globals.ObjectMock)._superclass());
  2592. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2593. $ctx1.sendIdx["=="]=1;
  2594. //>>excludeEnd("ctx");
  2595. $self._assert_($1);
  2596. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2597. $ctx1.sendIdx["assert:"]=1;
  2598. //>>excludeEnd("ctx");
  2599. $4=$recv($self["@theClass"])._instanceVariableNames();
  2600. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2601. $ctx1.sendIdx["instanceVariableNames"]=1;
  2602. //>>excludeEnd("ctx");
  2603. $3=$recv($4).__eq_eq($recv($globals.ObjectMock)._instanceVariableNames());
  2604. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2605. $ctx1.sendIdx["=="]=2;
  2606. //>>excludeEnd("ctx");
  2607. $self._assert_($3);
  2608. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2609. $ctx1.sendIdx["assert:"]=2;
  2610. //>>excludeEnd("ctx");
  2611. $self._assert_equals_($recv($self["@theClass"])._name(),"ObjectMock2");
  2612. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2613. $ctx1.sendIdx["assert:equals:"]=1;
  2614. //>>excludeEnd("ctx");
  2615. $6=$recv($self["@theClass"])._package();
  2616. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2617. $ctx1.sendIdx["package"]=1;
  2618. //>>excludeEnd("ctx");
  2619. $5=$recv($6).__eq_eq($recv($globals.ObjectMock)._package());
  2620. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2621. $ctx1.sendIdx["=="]=3;
  2622. //>>excludeEnd("ctx");
  2623. $self._assert_($5);
  2624. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2625. $ctx1.sendIdx["assert:"]=3;
  2626. //>>excludeEnd("ctx");
  2627. $8=$recv($self["@theClass"])._methodDictionary();
  2628. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2629. $ctx1.sendIdx["methodDictionary"]=1;
  2630. //>>excludeEnd("ctx");
  2631. $7=$recv($8)._keys();
  2632. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2633. $ctx1.sendIdx["keys"]=1;
  2634. //>>excludeEnd("ctx");
  2635. $self._assert_equals_($7,$recv($recv($globals.ObjectMock)._methodDictionary())._keys());
  2636. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2637. $ctx1.sendIdx["assert:equals:"]=2;
  2638. //>>excludeEnd("ctx");
  2639. instance=$recv($self["@theClass"])._new();
  2640. $self._assert_($recv($recv(instance)._class()).__eq_eq($self["@theClass"]));
  2641. $self._assert_equals_($recv(instance)._value(),(4));
  2642. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2643. $ctx1.sendIdx["assert:equals:"]=3;
  2644. //>>excludeEnd("ctx");
  2645. $self._shouldnt_raise_((function(){
  2646. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2647. return $core.withContext(function($ctx2) {
  2648. //>>excludeEnd("ctx");
  2649. return $recv(instance)._foo_((9));
  2650. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2651. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  2652. //>>excludeEnd("ctx");
  2653. }),$globals.Error);
  2654. $self._assert_equals_($recv(instance)._foo(),(9));
  2655. return self;
  2656. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2657. }, function($ctx1) {$ctx1.fill(self,"testTrickySetJavaScriptConstructor",{instance:instance},$globals.ClassTest)});
  2658. //>>excludeEnd("ctx");
  2659. },
  2660. //>>excludeStart("ide", pragmas.excludeIdeData);
  2661. args: [],
  2662. source: "testTrickySetJavaScriptConstructor\x0a\x09| instance |\x0a\x09theClass := builder copyClass: ObjectMock named: 'ObjectMock2'.\x0a\x09theClass javascriptConstructor: self trickyJsConstructor.\x0a\x09\x22part took from copy class test\x22\x0a\x09self assert: theClass superclass == ObjectMock superclass.\x0a\x09self assert: theClass instanceVariableNames == ObjectMock instanceVariableNames.\x0a\x09self assert: theClass name equals: 'ObjectMock2'.\x0a\x09self assert: theClass package == ObjectMock package.\x0a\x09self assert: theClass methodDictionary keys equals: ObjectMock methodDictionary keys.\x0a\x09\x22testing specific to late-coupled detached root class\x22\x0a\x09instance := theClass new.\x0a\x09self assert: instance class == theClass.\x0a\x09self assert: instance value equals: 4.\x0a\x09self shouldnt: [ instance foo: 9 ] raise: Error.\x0a\x09self assert: instance foo equals: 9",
  2663. referencedClasses: ["ObjectMock", "Error"],
  2664. //>>excludeEnd("ide");
  2665. messageSends: ["copyClass:named:", "javascriptConstructor:", "trickyJsConstructor", "assert:", "==", "superclass", "instanceVariableNames", "assert:equals:", "name", "package", "keys", "methodDictionary", "new", "class", "value", "shouldnt:raise:", "foo:", "foo"]
  2666. }),
  2667. $globals.ClassTest);
  2668. $core.addMethod(
  2669. $core.method({
  2670. selector: "trickyJsConstructor",
  2671. protocol: "running",
  2672. fn: function (){
  2673. var self=this,$self=this;
  2674. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2675. return $core.withContext(function($ctx1) {
  2676. //>>excludeEnd("ctx");
  2677. function Foo(){}
  2678. Foo.prototype.valueOf = function () {return 4;};
  2679. Foo.prototype._foo = function () {return "bar";};
  2680. return Foo;
  2681. ;
  2682. return self;
  2683. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2684. }, function($ctx1) {$ctx1.fill(self,"trickyJsConstructor",{},$globals.ClassTest)});
  2685. //>>excludeEnd("ctx");
  2686. },
  2687. //>>excludeStart("ide", pragmas.excludeIdeData);
  2688. args: [],
  2689. source: "trickyJsConstructor\x0a\x09<inlineJS: '\x0a\x09\x09function Foo(){}\x0a\x09\x09Foo.prototype.valueOf = function () {return 4;};\x0a\x09\x09Foo.prototype._foo = function () {return \x22bar\x22;};\x0a\x09\x09return Foo;\x0a\x09'>",
  2690. referencedClasses: [],
  2691. //>>excludeEnd("ide");
  2692. messageSends: []
  2693. }),
  2694. $globals.ClassTest);
  2695. $core.addClass("CollectionTest", $globals.TestCase, ["sampleBlock"], "Kernel-Tests");
  2696. $core.addMethod(
  2697. $core.method({
  2698. selector: "assertSameContents:as:",
  2699. protocol: "convenience",
  2700. fn: function (aCollection,anotherCollection){
  2701. var self=this,$self=this;
  2702. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2703. return $core.withContext(function($ctx1) {
  2704. //>>excludeEnd("ctx");
  2705. var $2,$1,$4,$3;
  2706. $2=$recv(aCollection)._size();
  2707. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2708. $ctx1.sendIdx["size"]=1;
  2709. //>>excludeEnd("ctx");
  2710. $1=$recv($2).__eq($recv(anotherCollection)._size());
  2711. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2712. $ctx1.sendIdx["="]=1;
  2713. //>>excludeEnd("ctx");
  2714. $self._assert_($1);
  2715. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2716. $ctx1.sendIdx["assert:"]=1;
  2717. //>>excludeEnd("ctx");
  2718. $recv(aCollection)._do_((function(each){
  2719. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2720. return $core.withContext(function($ctx2) {
  2721. //>>excludeEnd("ctx");
  2722. $4=$recv(aCollection)._occurrencesOf_(each);
  2723. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2724. $ctx2.sendIdx["occurrencesOf:"]=1;
  2725. //>>excludeEnd("ctx");
  2726. $3=$recv($4).__eq($recv(anotherCollection)._occurrencesOf_(each));
  2727. return $self._assert_($3);
  2728. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2729. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2730. //>>excludeEnd("ctx");
  2731. }));
  2732. return self;
  2733. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2734. }, function($ctx1) {$ctx1.fill(self,"assertSameContents:as:",{aCollection:aCollection,anotherCollection:anotherCollection},$globals.CollectionTest)});
  2735. //>>excludeEnd("ctx");
  2736. },
  2737. //>>excludeStart("ide", pragmas.excludeIdeData);
  2738. args: ["aCollection", "anotherCollection"],
  2739. source: "assertSameContents: aCollection as: anotherCollection\x0a\x09self assert: (aCollection size = anotherCollection size).\x0a\x09aCollection do: [ :each |\x0a\x09\x09self assert: ((aCollection occurrencesOf: each) = (anotherCollection occurrencesOf: each)) ]",
  2740. referencedClasses: [],
  2741. //>>excludeEnd("ide");
  2742. messageSends: ["assert:", "=", "size", "do:", "occurrencesOf:"]
  2743. }),
  2744. $globals.CollectionTest);
  2745. $core.addMethod(
  2746. $core.method({
  2747. selector: "collection",
  2748. protocol: "fixture",
  2749. fn: function (){
  2750. var self=this,$self=this;
  2751. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2752. return $core.withContext(function($ctx1) {
  2753. //>>excludeEnd("ctx");
  2754. $self._subclassResponsibility();
  2755. return self;
  2756. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2757. }, function($ctx1) {$ctx1.fill(self,"collection",{},$globals.CollectionTest)});
  2758. //>>excludeEnd("ctx");
  2759. },
  2760. //>>excludeStart("ide", pragmas.excludeIdeData);
  2761. args: [],
  2762. source: "collection\x0a\x09\x22Answers pre-filled collection of type tested.\x22\x0a\x0a\x09self subclassResponsibility",
  2763. referencedClasses: [],
  2764. //>>excludeEnd("ide");
  2765. messageSends: ["subclassResponsibility"]
  2766. }),
  2767. $globals.CollectionTest);
  2768. $core.addMethod(
  2769. $core.method({
  2770. selector: "collectionClass",
  2771. protocol: "fixture",
  2772. fn: function (){
  2773. var self=this,$self=this;
  2774. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2775. return $core.withContext(function($ctx1) {
  2776. //>>excludeEnd("ctx");
  2777. return $recv($self._class())._collectionClass();
  2778. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2779. }, function($ctx1) {$ctx1.fill(self,"collectionClass",{},$globals.CollectionTest)});
  2780. //>>excludeEnd("ctx");
  2781. },
  2782. //>>excludeStart("ide", pragmas.excludeIdeData);
  2783. args: [],
  2784. source: "collectionClass\x0a\x09\x22Answers class of collection type tested\x22\x0a\x0a\x09^ self class collectionClass",
  2785. referencedClasses: [],
  2786. //>>excludeEnd("ide");
  2787. messageSends: ["collectionClass", "class"]
  2788. }),
  2789. $globals.CollectionTest);
  2790. $core.addMethod(
  2791. $core.method({
  2792. selector: "collectionOfPrintStrings",
  2793. protocol: "fixture",
  2794. fn: function (){
  2795. var self=this,$self=this;
  2796. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2797. return $core.withContext(function($ctx1) {
  2798. //>>excludeEnd("ctx");
  2799. $self._subclassResponsibility();
  2800. return self;
  2801. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2802. }, function($ctx1) {$ctx1.fill(self,"collectionOfPrintStrings",{},$globals.CollectionTest)});
  2803. //>>excludeEnd("ctx");
  2804. },
  2805. //>>excludeStart("ide", pragmas.excludeIdeData);
  2806. args: [],
  2807. source: "collectionOfPrintStrings\x0a\x09\x22Answers self collection but with values\x0a\x09changed to their printStrings\x22\x0a\x0a\x09self subclassResponsibility",
  2808. referencedClasses: [],
  2809. //>>excludeEnd("ide");
  2810. messageSends: ["subclassResponsibility"]
  2811. }),
  2812. $globals.CollectionTest);
  2813. $core.addMethod(
  2814. $core.method({
  2815. selector: "collectionSize",
  2816. protocol: "fixture",
  2817. fn: function (){
  2818. var self=this,$self=this;
  2819. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2820. return $core.withContext(function($ctx1) {
  2821. //>>excludeEnd("ctx");
  2822. $self._subclassResponsibility();
  2823. return self;
  2824. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2825. }, function($ctx1) {$ctx1.fill(self,"collectionSize",{},$globals.CollectionTest)});
  2826. //>>excludeEnd("ctx");
  2827. },
  2828. //>>excludeStart("ide", pragmas.excludeIdeData);
  2829. args: [],
  2830. source: "collectionSize\x0a\x09\x22Answers size of self collection.\x22\x0a\x0a\x09self subclassResponsibility",
  2831. referencedClasses: [],
  2832. //>>excludeEnd("ide");
  2833. messageSends: ["subclassResponsibility"]
  2834. }),
  2835. $globals.CollectionTest);
  2836. $core.addMethod(
  2837. $core.method({
  2838. selector: "collectionWithDuplicates",
  2839. protocol: "fixture",
  2840. fn: function (){
  2841. var self=this,$self=this;
  2842. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2843. return $core.withContext(function($ctx1) {
  2844. //>>excludeEnd("ctx");
  2845. $self._subclassResponsibility();
  2846. return self;
  2847. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2848. }, function($ctx1) {$ctx1.fill(self,"collectionWithDuplicates",{},$globals.CollectionTest)});
  2849. //>>excludeEnd("ctx");
  2850. },
  2851. //>>excludeStart("ide", pragmas.excludeIdeData);
  2852. args: [],
  2853. source: "collectionWithDuplicates\x0a\x09\x22Answers pre-filled collection of type tested,\x0a\x09with exactly five distinct elements,\x0a\x09some of them appearing multiple times, if possible.\x22\x0a\x0a\x09self subclassResponsibility",
  2854. referencedClasses: [],
  2855. //>>excludeEnd("ide");
  2856. messageSends: ["subclassResponsibility"]
  2857. }),
  2858. $globals.CollectionTest);
  2859. $core.addMethod(
  2860. $core.method({
  2861. selector: "collectionWithNewValue",
  2862. protocol: "fixture",
  2863. fn: function (){
  2864. var self=this,$self=this;
  2865. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2866. return $core.withContext(function($ctx1) {
  2867. //>>excludeEnd("ctx");
  2868. $self._subclassResponsibility();
  2869. return self;
  2870. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2871. }, function($ctx1) {$ctx1.fill(self,"collectionWithNewValue",{},$globals.CollectionTest)});
  2872. //>>excludeEnd("ctx");
  2873. },
  2874. //>>excludeStart("ide", pragmas.excludeIdeData);
  2875. args: [],
  2876. source: "collectionWithNewValue\x0a\x09\x22Answers a collection which shows how\x0a\x09self collection would look after adding\x0a\x09self sampleNewValue\x22\x0a\x09\x0a\x09self subclassResponsibility",
  2877. referencedClasses: [],
  2878. //>>excludeEnd("ide");
  2879. messageSends: ["subclassResponsibility"]
  2880. }),
  2881. $globals.CollectionTest);
  2882. $core.addMethod(
  2883. $core.method({
  2884. selector: "initialize",
  2885. protocol: "initialization",
  2886. fn: function (){
  2887. var self=this,$self=this;
  2888. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2889. return $core.withContext(function($ctx1) {
  2890. //>>excludeEnd("ctx");
  2891. (
  2892. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2893. $ctx1.supercall = true,
  2894. //>>excludeEnd("ctx");
  2895. ($globals.CollectionTest.superclass||$boot.nilAsClass).fn.prototype._initialize.apply($self, []));
  2896. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2897. $ctx1.supercall = false;
  2898. //>>excludeEnd("ctx");;
  2899. $self["@sampleBlock"]=(function(){
  2900. });
  2901. return self;
  2902. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2903. }, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.CollectionTest)});
  2904. //>>excludeEnd("ctx");
  2905. },
  2906. //>>excludeStart("ide", pragmas.excludeIdeData);
  2907. args: [],
  2908. source: "initialize\x0a\x09super initialize.\x0a\x0a\x09sampleBlock := []",
  2909. referencedClasses: [],
  2910. //>>excludeEnd("ide");
  2911. messageSends: ["initialize"]
  2912. }),
  2913. $globals.CollectionTest);
  2914. $core.addMethod(
  2915. $core.method({
  2916. selector: "isCollectionReadOnly",
  2917. protocol: "testing",
  2918. fn: function (){
  2919. var self=this,$self=this;
  2920. return false;
  2921. },
  2922. //>>excludeStart("ide", pragmas.excludeIdeData);
  2923. args: [],
  2924. source: "isCollectionReadOnly\x0a\x09^ false",
  2925. referencedClasses: [],
  2926. //>>excludeEnd("ide");
  2927. messageSends: []
  2928. }),
  2929. $globals.CollectionTest);
  2930. $core.addMethod(
  2931. $core.method({
  2932. selector: "sampleNewValue",
  2933. protocol: "fixture",
  2934. fn: function (){
  2935. var self=this,$self=this;
  2936. return "N";
  2937. },
  2938. //>>excludeStart("ide", pragmas.excludeIdeData);
  2939. args: [],
  2940. source: "sampleNewValue\x0a\x09\x22Answers a value that is not yet there\x0a\x09and can be put into a tested collection\x22\x0a\x09\x0a\x09^ 'N'",
  2941. referencedClasses: [],
  2942. //>>excludeEnd("ide");
  2943. messageSends: []
  2944. }),
  2945. $globals.CollectionTest);
  2946. $core.addMethod(
  2947. $core.method({
  2948. selector: "sampleNewValueAsCollection",
  2949. protocol: "fixture",
  2950. fn: function (){
  2951. var self=this,$self=this;
  2952. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2953. return $core.withContext(function($ctx1) {
  2954. //>>excludeEnd("ctx");
  2955. return $recv($self._collectionClass())._with_($self._sampleNewValue());
  2956. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2957. }, function($ctx1) {$ctx1.fill(self,"sampleNewValueAsCollection",{},$globals.CollectionTest)});
  2958. //>>excludeEnd("ctx");
  2959. },
  2960. //>>excludeStart("ide", pragmas.excludeIdeData);
  2961. args: [],
  2962. source: "sampleNewValueAsCollection\x0a\x09\x22Answers self sampleNewValue\x0a\x09wrapped in single element collection\x0a\x09of tested type\x22\x0a\x09\x0a\x09^ self collectionClass with: self sampleNewValue",
  2963. referencedClasses: [],
  2964. //>>excludeEnd("ide");
  2965. messageSends: ["with:", "collectionClass", "sampleNewValue"]
  2966. }),
  2967. $globals.CollectionTest);
  2968. $core.addMethod(
  2969. $core.method({
  2970. selector: "testAddAll",
  2971. protocol: "tests",
  2972. fn: function (){
  2973. var self=this,$self=this;
  2974. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2975. return $core.withContext(function($ctx1) {
  2976. //>>excludeEnd("ctx");
  2977. var $2,$4,$3,$5,$1,$6,$9,$8,$10,$11,$7,$12,$15,$14,$17,$16,$18,$13,$20,$21,$22,$19,$23,$25,$24;
  2978. $2=$self._collection();
  2979. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2980. $ctx1.sendIdx["collection"]=1;
  2981. //>>excludeEnd("ctx");
  2982. $4=$self._collectionClass();
  2983. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2984. $ctx1.sendIdx["collectionClass"]=1;
  2985. //>>excludeEnd("ctx");
  2986. $3=$recv($4)._new();
  2987. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2988. $ctx1.sendIdx["new"]=1;
  2989. //>>excludeEnd("ctx");
  2990. $recv($2)._addAll_($3);
  2991. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2992. $ctx1.sendIdx["addAll:"]=1;
  2993. //>>excludeEnd("ctx");
  2994. $5=$recv($2)._yourself();
  2995. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2996. $ctx1.sendIdx["yourself"]=1;
  2997. //>>excludeEnd("ctx");
  2998. $1=$5;
  2999. $6=$self._collection();
  3000. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3001. $ctx1.sendIdx["collection"]=2;
  3002. //>>excludeEnd("ctx");
  3003. $self._assert_equals_($1,$6);
  3004. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3005. $ctx1.sendIdx["assert:equals:"]=1;
  3006. //>>excludeEnd("ctx");
  3007. $9=$self._collectionClass();
  3008. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3009. $ctx1.sendIdx["collectionClass"]=2;
  3010. //>>excludeEnd("ctx");
  3011. $8=$recv($9)._new();
  3012. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3013. $ctx1.sendIdx["new"]=2;
  3014. //>>excludeEnd("ctx");
  3015. $10=$self._collection();
  3016. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3017. $ctx1.sendIdx["collection"]=3;
  3018. //>>excludeEnd("ctx");
  3019. $recv($8)._addAll_($10);
  3020. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3021. $ctx1.sendIdx["addAll:"]=2;
  3022. //>>excludeEnd("ctx");
  3023. $11=$recv($8)._yourself();
  3024. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3025. $ctx1.sendIdx["yourself"]=2;
  3026. //>>excludeEnd("ctx");
  3027. $7=$11;
  3028. $12=$self._collection();
  3029. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3030. $ctx1.sendIdx["collection"]=4;
  3031. //>>excludeEnd("ctx");
  3032. $self._assert_equals_($7,$12);
  3033. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3034. $ctx1.sendIdx["assert:equals:"]=2;
  3035. //>>excludeEnd("ctx");
  3036. $15=$self._collectionClass();
  3037. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3038. $ctx1.sendIdx["collectionClass"]=3;
  3039. //>>excludeEnd("ctx");
  3040. $14=$recv($15)._new();
  3041. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3042. $ctx1.sendIdx["new"]=3;
  3043. //>>excludeEnd("ctx");
  3044. $17=$self._collectionClass();
  3045. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3046. $ctx1.sendIdx["collectionClass"]=4;
  3047. //>>excludeEnd("ctx");
  3048. $16=$recv($17)._new();
  3049. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3050. $ctx1.sendIdx["new"]=4;
  3051. //>>excludeEnd("ctx");
  3052. $recv($14)._addAll_($16);
  3053. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3054. $ctx1.sendIdx["addAll:"]=3;
  3055. //>>excludeEnd("ctx");
  3056. $18=$recv($14)._yourself();
  3057. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3058. $ctx1.sendIdx["yourself"]=3;
  3059. //>>excludeEnd("ctx");
  3060. $13=$18;
  3061. $self._assert_equals_($13,$recv($self._collectionClass())._new());
  3062. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3063. $ctx1.sendIdx["assert:equals:"]=3;
  3064. //>>excludeEnd("ctx");
  3065. $20=$self._collection();
  3066. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3067. $ctx1.sendIdx["collection"]=5;
  3068. //>>excludeEnd("ctx");
  3069. $21=$self._sampleNewValueAsCollection();
  3070. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3071. $ctx1.sendIdx["sampleNewValueAsCollection"]=1;
  3072. //>>excludeEnd("ctx");
  3073. $recv($20)._addAll_($21);
  3074. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3075. $ctx1.sendIdx["addAll:"]=4;
  3076. //>>excludeEnd("ctx");
  3077. $22=$recv($20)._yourself();
  3078. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3079. $ctx1.sendIdx["yourself"]=4;
  3080. //>>excludeEnd("ctx");
  3081. $19=$22;
  3082. $23=$self._collectionWithNewValue();
  3083. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3084. $ctx1.sendIdx["collectionWithNewValue"]=1;
  3085. //>>excludeEnd("ctx");
  3086. $self._assert_equals_($19,$23);
  3087. $25=$self._sampleNewValueAsCollection();
  3088. $recv($25)._addAll_($self._collection());
  3089. $24=$recv($25)._yourself();
  3090. $self._assertSameContents_as_($24,$self._collectionWithNewValue());
  3091. return self;
  3092. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3093. }, function($ctx1) {$ctx1.fill(self,"testAddAll",{},$globals.CollectionTest)});
  3094. //>>excludeEnd("ctx");
  3095. },
  3096. //>>excludeStart("ide", pragmas.excludeIdeData);
  3097. args: [],
  3098. source: "testAddAll\x0a\x09self assert: (self collection addAll: self collectionClass new; yourself) equals: self collection.\x0a\x09self assert: (self collectionClass new addAll: self collection; yourself) equals: self collection.\x0a\x09self assert: (self collectionClass new addAll: self collectionClass new; yourself) equals: self collectionClass new.\x0a\x09self assert: (self collection addAll: self sampleNewValueAsCollection; yourself) equals: self collectionWithNewValue.\x0a\x09self assertSameContents: (self sampleNewValueAsCollection addAll: self collection; yourself) as: self collectionWithNewValue",
  3099. referencedClasses: [],
  3100. //>>excludeEnd("ide");
  3101. messageSends: ["assert:equals:", "addAll:", "collection", "new", "collectionClass", "yourself", "sampleNewValueAsCollection", "collectionWithNewValue", "assertSameContents:as:"]
  3102. }),
  3103. $globals.CollectionTest);
  3104. $core.addMethod(
  3105. $core.method({
  3106. selector: "testAllSatisfy",
  3107. protocol: "tests",
  3108. fn: function (){
  3109. var self=this,$self=this;
  3110. var collection,anyOne;
  3111. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3112. return $core.withContext(function($ctx1) {
  3113. //>>excludeEnd("ctx");
  3114. var $1;
  3115. collection=$self._collection();
  3116. anyOne=$recv(collection)._anyOne();
  3117. $1=$recv(collection)._allSatisfy_((function(each){
  3118. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3119. return $core.withContext(function($ctx2) {
  3120. //>>excludeEnd("ctx");
  3121. return $recv(collection)._includes_(each);
  3122. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3123. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  3124. //>>excludeEnd("ctx");
  3125. }));
  3126. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3127. $ctx1.sendIdx["allSatisfy:"]=1;
  3128. //>>excludeEnd("ctx");
  3129. $self._assert_($1);
  3130. $self._deny_($recv(collection)._allSatisfy_((function(each){
  3131. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3132. return $core.withContext(function($ctx2) {
  3133. //>>excludeEnd("ctx");
  3134. return $recv(each).__tild_eq(anyOne);
  3135. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3136. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
  3137. //>>excludeEnd("ctx");
  3138. })));
  3139. return self;
  3140. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3141. }, function($ctx1) {$ctx1.fill(self,"testAllSatisfy",{collection:collection,anyOne:anyOne},$globals.CollectionTest)});
  3142. //>>excludeEnd("ctx");
  3143. },
  3144. //>>excludeStart("ide", pragmas.excludeIdeData);
  3145. args: [],
  3146. source: "testAllSatisfy\x0a\x09| collection anyOne |\x0a\x09collection := self collection.\x0a\x09anyOne := collection anyOne.\x0a\x09self assert: (collection allSatisfy: [ :each | collection includes: each ]).\x0a\x09self deny: (collection allSatisfy: [ :each | each ~= anyOne ])",
  3147. referencedClasses: [],
  3148. //>>excludeEnd("ide");
  3149. messageSends: ["collection", "anyOne", "assert:", "allSatisfy:", "includes:", "deny:", "~="]
  3150. }),
  3151. $globals.CollectionTest);
  3152. $core.addMethod(
  3153. $core.method({
  3154. selector: "testAnyOne",
  3155. protocol: "tests",
  3156. fn: function (){
  3157. var self=this,$self=this;
  3158. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3159. return $core.withContext(function($ctx1) {
  3160. //>>excludeEnd("ctx");
  3161. var $2,$1;
  3162. $self._should_raise_((function(){
  3163. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3164. return $core.withContext(function($ctx2) {
  3165. //>>excludeEnd("ctx");
  3166. return $recv($recv($self._collectionClass())._new())._anyOne();
  3167. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3168. $ctx2.sendIdx["anyOne"]=1;
  3169. //>>excludeEnd("ctx");
  3170. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3171. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  3172. //>>excludeEnd("ctx");
  3173. }),$globals.Error);
  3174. $2=$self._collection();
  3175. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3176. $ctx1.sendIdx["collection"]=1;
  3177. //>>excludeEnd("ctx");
  3178. $1=$recv($2)._includes_($recv($self._collection())._anyOne());
  3179. $self._assert_($1);
  3180. return self;
  3181. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3182. }, function($ctx1) {$ctx1.fill(self,"testAnyOne",{},$globals.CollectionTest)});
  3183. //>>excludeEnd("ctx");
  3184. },
  3185. //>>excludeStart("ide", pragmas.excludeIdeData);
  3186. args: [],
  3187. source: "testAnyOne\x0a\x09self should: [ self collectionClass new anyOne ] raise: Error.\x0a\x09self assert: (self collection includes: self collection anyOne)",
  3188. referencedClasses: ["Error"],
  3189. //>>excludeEnd("ide");
  3190. messageSends: ["should:raise:", "anyOne", "new", "collectionClass", "assert:", "includes:", "collection"]
  3191. }),
  3192. $globals.CollectionTest);
  3193. $core.addMethod(
  3194. $core.method({
  3195. selector: "testAnySatisfy",
  3196. protocol: "tests",
  3197. fn: function (){
  3198. var self=this,$self=this;
  3199. var anyOne;
  3200. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3201. return $core.withContext(function($ctx1) {
  3202. //>>excludeEnd("ctx");
  3203. var $1,$3,$2;
  3204. $1=$self._collection();
  3205. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3206. $ctx1.sendIdx["collection"]=1;
  3207. //>>excludeEnd("ctx");
  3208. anyOne=$recv($1)._anyOne();
  3209. $3=$self._collection();
  3210. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3211. $ctx1.sendIdx["collection"]=2;
  3212. //>>excludeEnd("ctx");
  3213. $2=$recv($3)._anySatisfy_((function(each){
  3214. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3215. return $core.withContext(function($ctx2) {
  3216. //>>excludeEnd("ctx");
  3217. return $recv(each).__eq(anyOne);
  3218. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3219. $ctx2.sendIdx["="]=1;
  3220. //>>excludeEnd("ctx");
  3221. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3222. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  3223. //>>excludeEnd("ctx");
  3224. }));
  3225. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3226. $ctx1.sendIdx["anySatisfy:"]=1;
  3227. //>>excludeEnd("ctx");
  3228. $self._assert_($2);
  3229. $self._deny_($recv($self._collection())._anySatisfy_((function(each){
  3230. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3231. return $core.withContext(function($ctx2) {
  3232. //>>excludeEnd("ctx");
  3233. return $recv(each).__eq($recv($globals.Object)._new());
  3234. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3235. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
  3236. //>>excludeEnd("ctx");
  3237. })));
  3238. return self;
  3239. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3240. }, function($ctx1) {$ctx1.fill(self,"testAnySatisfy",{anyOne:anyOne},$globals.CollectionTest)});
  3241. //>>excludeEnd("ctx");
  3242. },
  3243. //>>excludeStart("ide", pragmas.excludeIdeData);
  3244. args: [],
  3245. source: "testAnySatisfy\x0a\x09| anyOne |\x0a\x09anyOne := self collection anyOne.\x0a\x09self assert: (self collection anySatisfy: [ :each | each = anyOne ]).\x0a\x09self deny: (self collection anySatisfy: [ :each | each = Object new ])",
  3246. referencedClasses: ["Object"],
  3247. //>>excludeEnd("ide");
  3248. messageSends: ["anyOne", "collection", "assert:", "anySatisfy:", "=", "deny:", "new"]
  3249. }),
  3250. $globals.CollectionTest);
  3251. $core.addMethod(
  3252. $core.method({
  3253. selector: "testAsArray",
  3254. protocol: "tests",
  3255. fn: function (){
  3256. var self=this,$self=this;
  3257. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3258. return $core.withContext(function($ctx1) {
  3259. //>>excludeEnd("ctx");
  3260. var $1;
  3261. $1=$self._collection();
  3262. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3263. $ctx1.sendIdx["collection"]=1;
  3264. //>>excludeEnd("ctx");
  3265. $self._assertSameContents_as_($1,$recv($self._collection())._asArray());
  3266. return self;
  3267. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3268. }, function($ctx1) {$ctx1.fill(self,"testAsArray",{},$globals.CollectionTest)});
  3269. //>>excludeEnd("ctx");
  3270. },
  3271. //>>excludeStart("ide", pragmas.excludeIdeData);
  3272. args: [],
  3273. source: "testAsArray\x0a\x09self\x0a\x09\x09assertSameContents: self collection\x0a\x09\x09as: self collection asArray",
  3274. referencedClasses: [],
  3275. //>>excludeEnd("ide");
  3276. messageSends: ["assertSameContents:as:", "collection", "asArray"]
  3277. }),
  3278. $globals.CollectionTest);
  3279. $core.addMethod(
  3280. $core.method({
  3281. selector: "testAsOrderedCollection",
  3282. protocol: "tests",
  3283. fn: function (){
  3284. var self=this,$self=this;
  3285. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3286. return $core.withContext(function($ctx1) {
  3287. //>>excludeEnd("ctx");
  3288. var $1;
  3289. $1=$self._collection();
  3290. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3291. $ctx1.sendIdx["collection"]=1;
  3292. //>>excludeEnd("ctx");
  3293. $self._assertSameContents_as_($1,$recv($self._collection())._asOrderedCollection());
  3294. return self;
  3295. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3296. }, function($ctx1) {$ctx1.fill(self,"testAsOrderedCollection",{},$globals.CollectionTest)});
  3297. //>>excludeEnd("ctx");
  3298. },
  3299. //>>excludeStart("ide", pragmas.excludeIdeData);
  3300. args: [],
  3301. source: "testAsOrderedCollection\x0a\x09self\x0a\x09\x09assertSameContents: self collection\x0a\x09\x09as: self collection asOrderedCollection",
  3302. referencedClasses: [],
  3303. //>>excludeEnd("ide");
  3304. messageSends: ["assertSameContents:as:", "collection", "asOrderedCollection"]
  3305. }),
  3306. $globals.CollectionTest);
  3307. $core.addMethod(
  3308. $core.method({
  3309. selector: "testAsSet",
  3310. protocol: "tests",
  3311. fn: function (){
  3312. var self=this,$self=this;
  3313. var c,set;
  3314. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3315. return $core.withContext(function($ctx1) {
  3316. //>>excludeEnd("ctx");
  3317. c=$self._collectionWithDuplicates();
  3318. set=$recv(c)._asSet();
  3319. $self._assert_equals_($recv(set)._size(),(6));
  3320. $recv(c)._do_((function(each){
  3321. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3322. return $core.withContext(function($ctx2) {
  3323. //>>excludeEnd("ctx");
  3324. return $self._assert_($recv(set)._includes_(each));
  3325. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3326. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  3327. //>>excludeEnd("ctx");
  3328. }));
  3329. return self;
  3330. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3331. }, function($ctx1) {$ctx1.fill(self,"testAsSet",{c:c,set:set},$globals.CollectionTest)});
  3332. //>>excludeEnd("ctx");
  3333. },
  3334. //>>excludeStart("ide", pragmas.excludeIdeData);
  3335. args: [],
  3336. source: "testAsSet\x0a\x09| c set |\x0a\x09c := self collectionWithDuplicates.\x0a\x09set := c asSet.\x0a\x09self assert: set size equals: 6.\x0a\x09c do: [ :each |\x0a\x09\x09self assert: (set includes: each) ]",
  3337. referencedClasses: [],
  3338. //>>excludeEnd("ide");
  3339. messageSends: ["collectionWithDuplicates", "asSet", "assert:equals:", "size", "do:", "assert:", "includes:"]
  3340. }),
  3341. $globals.CollectionTest);
  3342. $core.addMethod(
  3343. $core.method({
  3344. selector: "testCollect",
  3345. protocol: "tests",
  3346. fn: function (){
  3347. var self=this,$self=this;
  3348. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3349. return $core.withContext(function($ctx1) {
  3350. //>>excludeEnd("ctx");
  3351. var $2,$1,$3,$5,$4,$8,$7,$6,$11,$10,$9;
  3352. $2=$self._collection();
  3353. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3354. $ctx1.sendIdx["collection"]=1;
  3355. //>>excludeEnd("ctx");
  3356. $1=$recv($2)._collect_((function(each){
  3357. return each;
  3358. }));
  3359. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3360. $ctx1.sendIdx["collect:"]=1;
  3361. //>>excludeEnd("ctx");
  3362. $3=$self._collection();
  3363. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3364. $ctx1.sendIdx["collection"]=2;
  3365. //>>excludeEnd("ctx");
  3366. $self._assert_equals_($1,$3);
  3367. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3368. $ctx1.sendIdx["assert:equals:"]=1;
  3369. //>>excludeEnd("ctx");
  3370. $5=$self._collectionWithNewValue();
  3371. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3372. $ctx1.sendIdx["collectionWithNewValue"]=1;
  3373. //>>excludeEnd("ctx");
  3374. $4=$recv($5)._collect_((function(each){
  3375. return each;
  3376. }));
  3377. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3378. $ctx1.sendIdx["collect:"]=2;
  3379. //>>excludeEnd("ctx");
  3380. $self._assert_equals_($4,$self._collectionWithNewValue());
  3381. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3382. $ctx1.sendIdx["assert:equals:"]=2;
  3383. //>>excludeEnd("ctx");
  3384. $8=$self._collectionClass();
  3385. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3386. $ctx1.sendIdx["collectionClass"]=1;
  3387. //>>excludeEnd("ctx");
  3388. $7=$recv($8)._new();
  3389. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3390. $ctx1.sendIdx["new"]=1;
  3391. //>>excludeEnd("ctx");
  3392. $6=$recv($7)._collect_((function(each){
  3393. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3394. return $core.withContext(function($ctx2) {
  3395. //>>excludeEnd("ctx");
  3396. return $recv(each)._printString();
  3397. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3398. $ctx2.sendIdx["printString"]=1;
  3399. //>>excludeEnd("ctx");
  3400. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3401. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,3)});
  3402. //>>excludeEnd("ctx");
  3403. }));
  3404. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3405. $ctx1.sendIdx["collect:"]=3;
  3406. //>>excludeEnd("ctx");
  3407. $self._assert_equals_($6,$recv($self._collectionClass())._new());
  3408. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3409. $ctx1.sendIdx["assert:equals:"]=3;
  3410. //>>excludeEnd("ctx");
  3411. $11=$self._collection();
  3412. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3413. $ctx1.sendIdx["collection"]=3;
  3414. //>>excludeEnd("ctx");
  3415. $10=$recv($11)._collect_((function(){
  3416. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3417. return $core.withContext(function($ctx2) {
  3418. //>>excludeEnd("ctx");
  3419. return $self._sampleNewValue();
  3420. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3421. $ctx2.sendIdx["sampleNewValue"]=1;
  3422. //>>excludeEnd("ctx");
  3423. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3424. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,4)});
  3425. //>>excludeEnd("ctx");
  3426. }));
  3427. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3428. $ctx1.sendIdx["collect:"]=4;
  3429. //>>excludeEnd("ctx");
  3430. $9=$recv($10)._detect_((function(){
  3431. return true;
  3432. }));
  3433. $self._assert_equals_($9,$self._sampleNewValue());
  3434. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3435. $ctx1.sendIdx["assert:equals:"]=4;
  3436. //>>excludeEnd("ctx");
  3437. $self._assert_equals_($recv($self._collection())._collect_((function(each){
  3438. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3439. return $core.withContext(function($ctx2) {
  3440. //>>excludeEnd("ctx");
  3441. return $recv(each)._printString();
  3442. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3443. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,6)});
  3444. //>>excludeEnd("ctx");
  3445. })),$self._collectionOfPrintStrings());
  3446. return self;
  3447. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3448. }, function($ctx1) {$ctx1.fill(self,"testCollect",{},$globals.CollectionTest)});
  3449. //>>excludeEnd("ctx");
  3450. },
  3451. //>>excludeStart("ide", pragmas.excludeIdeData);
  3452. args: [],
  3453. source: "testCollect\x0a\x09self assert: (self collection collect: [ :each | each ]) equals: self collection.\x0a\x09self assert: (self collectionWithNewValue collect: [ :each | each ]) equals: self collectionWithNewValue.\x0a\x09self assert: (self collectionClass new collect: [ :each | each printString ]) equals: self collectionClass new.\x0a\x09self assert: ((self collection collect: [ self sampleNewValue ]) detect: [ true ]) equals: self sampleNewValue.\x0a\x09self assert: (self collection collect: [ :each | each printString ]) equals: self collectionOfPrintStrings",
  3454. referencedClasses: [],
  3455. //>>excludeEnd("ide");
  3456. messageSends: ["assert:equals:", "collect:", "collection", "collectionWithNewValue", "new", "collectionClass", "printString", "detect:", "sampleNewValue", "collectionOfPrintStrings"]
  3457. }),
  3458. $globals.CollectionTest);
  3459. $core.addMethod(
  3460. $core.method({
  3461. selector: "testComma",
  3462. protocol: "tests",
  3463. fn: function (){
  3464. var self=this,$self=this;
  3465. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3466. return $core.withContext(function($ctx1) {
  3467. //>>excludeEnd("ctx");
  3468. var $2,$4,$3,$1,$5,$8,$7,$9,$6,$10,$13,$12,$15,$14,$11,$17,$18,$16,$19;
  3469. $2=$self._collection();
  3470. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3471. $ctx1.sendIdx["collection"]=1;
  3472. //>>excludeEnd("ctx");
  3473. $4=$self._collectionClass();
  3474. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3475. $ctx1.sendIdx["collectionClass"]=1;
  3476. //>>excludeEnd("ctx");
  3477. $3=$recv($4)._new();
  3478. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3479. $ctx1.sendIdx["new"]=1;
  3480. //>>excludeEnd("ctx");
  3481. $1=$recv($2).__comma($3);
  3482. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3483. $ctx1.sendIdx[","]=1;
  3484. //>>excludeEnd("ctx");
  3485. $5=$self._collection();
  3486. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3487. $ctx1.sendIdx["collection"]=2;
  3488. //>>excludeEnd("ctx");
  3489. $self._assert_equals_($1,$5);
  3490. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3491. $ctx1.sendIdx["assert:equals:"]=1;
  3492. //>>excludeEnd("ctx");
  3493. $8=$self._collectionClass();
  3494. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3495. $ctx1.sendIdx["collectionClass"]=2;
  3496. //>>excludeEnd("ctx");
  3497. $7=$recv($8)._new();
  3498. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3499. $ctx1.sendIdx["new"]=2;
  3500. //>>excludeEnd("ctx");
  3501. $9=$self._collection();
  3502. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3503. $ctx1.sendIdx["collection"]=3;
  3504. //>>excludeEnd("ctx");
  3505. $6=$recv($7).__comma($9);
  3506. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3507. $ctx1.sendIdx[","]=2;
  3508. //>>excludeEnd("ctx");
  3509. $10=$self._collection();
  3510. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3511. $ctx1.sendIdx["collection"]=4;
  3512. //>>excludeEnd("ctx");
  3513. $self._assert_equals_($6,$10);
  3514. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3515. $ctx1.sendIdx["assert:equals:"]=2;
  3516. //>>excludeEnd("ctx");
  3517. $13=$self._collectionClass();
  3518. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3519. $ctx1.sendIdx["collectionClass"]=3;
  3520. //>>excludeEnd("ctx");
  3521. $12=$recv($13)._new();
  3522. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3523. $ctx1.sendIdx["new"]=3;
  3524. //>>excludeEnd("ctx");
  3525. $15=$self._collectionClass();
  3526. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3527. $ctx1.sendIdx["collectionClass"]=4;
  3528. //>>excludeEnd("ctx");
  3529. $14=$recv($15)._new();
  3530. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3531. $ctx1.sendIdx["new"]=4;
  3532. //>>excludeEnd("ctx");
  3533. $11=$recv($12).__comma($14);
  3534. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3535. $ctx1.sendIdx[","]=3;
  3536. //>>excludeEnd("ctx");
  3537. $self._assert_equals_($11,$recv($self._collectionClass())._new());
  3538. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3539. $ctx1.sendIdx["assert:equals:"]=3;
  3540. //>>excludeEnd("ctx");
  3541. $17=$self._collection();
  3542. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3543. $ctx1.sendIdx["collection"]=5;
  3544. //>>excludeEnd("ctx");
  3545. $18=$self._sampleNewValueAsCollection();
  3546. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3547. $ctx1.sendIdx["sampleNewValueAsCollection"]=1;
  3548. //>>excludeEnd("ctx");
  3549. $16=$recv($17).__comma($18);
  3550. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3551. $ctx1.sendIdx[","]=4;
  3552. //>>excludeEnd("ctx");
  3553. $19=$self._collectionWithNewValue();
  3554. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3555. $ctx1.sendIdx["collectionWithNewValue"]=1;
  3556. //>>excludeEnd("ctx");
  3557. $self._assert_equals_($16,$19);
  3558. $self._assertSameContents_as_($recv($self._sampleNewValueAsCollection()).__comma($self._collection()),$self._collectionWithNewValue());
  3559. return self;
  3560. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3561. }, function($ctx1) {$ctx1.fill(self,"testComma",{},$globals.CollectionTest)});
  3562. //>>excludeEnd("ctx");
  3563. },
  3564. //>>excludeStart("ide", pragmas.excludeIdeData);
  3565. args: [],
  3566. source: "testComma\x0a\x09self assert: self collection, self collectionClass new equals: self collection.\x0a\x09self assert: self collectionClass new, self collection equals: self collection.\x0a\x09self assert: self collectionClass new, self collectionClass new equals: self collectionClass new.\x0a\x09self assert: self collection, self sampleNewValueAsCollection equals: self collectionWithNewValue.\x0a\x09self assertSameContents: self sampleNewValueAsCollection, self collection as: self collectionWithNewValue",
  3567. referencedClasses: [],
  3568. //>>excludeEnd("ide");
  3569. messageSends: ["assert:equals:", ",", "collection", "new", "collectionClass", "sampleNewValueAsCollection", "collectionWithNewValue", "assertSameContents:as:"]
  3570. }),
  3571. $globals.CollectionTest);
  3572. $core.addMethod(
  3573. $core.method({
  3574. selector: "testCopy",
  3575. protocol: "tests",
  3576. fn: function (){
  3577. var self=this,$self=this;
  3578. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3579. return $core.withContext(function($ctx1) {
  3580. //>>excludeEnd("ctx");
  3581. var $3,$2,$1,$5,$4,$7,$6,$8,$10,$9,$11,$15,$14,$13,$16,$12,$19,$18,$17;
  3582. $3=$self._collectionClass();
  3583. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3584. $ctx1.sendIdx["collectionClass"]=1;
  3585. //>>excludeEnd("ctx");
  3586. $2=$recv($3)._new();
  3587. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3588. $ctx1.sendIdx["new"]=1;
  3589. //>>excludeEnd("ctx");
  3590. $1=$recv($2)._copy();
  3591. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3592. $ctx1.sendIdx["copy"]=1;
  3593. //>>excludeEnd("ctx");
  3594. $5=$self._collectionClass();
  3595. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3596. $ctx1.sendIdx["collectionClass"]=2;
  3597. //>>excludeEnd("ctx");
  3598. $4=$recv($5)._new();
  3599. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3600. $ctx1.sendIdx["new"]=2;
  3601. //>>excludeEnd("ctx");
  3602. $self._assert_equals_($1,$4);
  3603. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3604. $ctx1.sendIdx["assert:equals:"]=1;
  3605. //>>excludeEnd("ctx");
  3606. $7=$self._collection();
  3607. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3608. $ctx1.sendIdx["collection"]=1;
  3609. //>>excludeEnd("ctx");
  3610. $6=$recv($7)._copy();
  3611. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3612. $ctx1.sendIdx["copy"]=2;
  3613. //>>excludeEnd("ctx");
  3614. $8=$self._collection();
  3615. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3616. $ctx1.sendIdx["collection"]=2;
  3617. //>>excludeEnd("ctx");
  3618. $self._assert_equals_($6,$8);
  3619. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3620. $ctx1.sendIdx["assert:equals:"]=2;
  3621. //>>excludeEnd("ctx");
  3622. $10=$self._collectionWithNewValue();
  3623. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3624. $ctx1.sendIdx["collectionWithNewValue"]=1;
  3625. //>>excludeEnd("ctx");
  3626. $9=$recv($10)._copy();
  3627. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3628. $ctx1.sendIdx["copy"]=3;
  3629. //>>excludeEnd("ctx");
  3630. $11=$self._collectionWithNewValue();
  3631. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3632. $ctx1.sendIdx["collectionWithNewValue"]=2;
  3633. //>>excludeEnd("ctx");
  3634. $self._assert_equals_($9,$11);
  3635. $15=$self._collectionClass();
  3636. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3637. $ctx1.sendIdx["collectionClass"]=3;
  3638. //>>excludeEnd("ctx");
  3639. $14=$recv($15)._new();
  3640. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3641. $ctx1.sendIdx["new"]=3;
  3642. //>>excludeEnd("ctx");
  3643. $13=$recv($14)._copy();
  3644. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3645. $ctx1.sendIdx["copy"]=4;
  3646. //>>excludeEnd("ctx");
  3647. $16=$self._collection();
  3648. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3649. $ctx1.sendIdx["collection"]=3;
  3650. //>>excludeEnd("ctx");
  3651. $12=$recv($13).__eq($16);
  3652. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3653. $ctx1.sendIdx["="]=1;
  3654. //>>excludeEnd("ctx");
  3655. $self._deny_($12);
  3656. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3657. $ctx1.sendIdx["deny:"]=1;
  3658. //>>excludeEnd("ctx");
  3659. $19=$self._collection();
  3660. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3661. $ctx1.sendIdx["collection"]=4;
  3662. //>>excludeEnd("ctx");
  3663. $18=$recv($19)._copy();
  3664. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3665. $ctx1.sendIdx["copy"]=5;
  3666. //>>excludeEnd("ctx");
  3667. $17=$recv($18).__eq($recv($self._collectionClass())._new());
  3668. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3669. $ctx1.sendIdx["="]=2;
  3670. //>>excludeEnd("ctx");
  3671. $self._deny_($17);
  3672. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3673. $ctx1.sendIdx["deny:"]=2;
  3674. //>>excludeEnd("ctx");
  3675. $self._deny_($recv($recv($self._collection())._copy()).__eq($self._collectionWithNewValue()));
  3676. return self;
  3677. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3678. }, function($ctx1) {$ctx1.fill(self,"testCopy",{},$globals.CollectionTest)});
  3679. //>>excludeEnd("ctx");
  3680. },
  3681. //>>excludeStart("ide", pragmas.excludeIdeData);
  3682. args: [],
  3683. source: "testCopy\x0a\x09self assert: self collectionClass new copy equals: self collectionClass new.\x0a\x09self assert: self collection copy equals: self collection.\x0a\x09self assert: self collectionWithNewValue copy equals: self collectionWithNewValue.\x0a\x09\x0a\x09self deny: self collectionClass new copy = self collection.\x0a\x09self deny: self collection copy = self collectionClass new.\x0a\x09self deny: self collection copy = self collectionWithNewValue",
  3684. referencedClasses: [],
  3685. //>>excludeEnd("ide");
  3686. messageSends: ["assert:equals:", "copy", "new", "collectionClass", "collection", "collectionWithNewValue", "deny:", "="]
  3687. }),
  3688. $globals.CollectionTest);
  3689. $core.addMethod(
  3690. $core.method({
  3691. selector: "testCopySeparates",
  3692. protocol: "tests",
  3693. fn: function (){
  3694. var self=this,$self=this;
  3695. var original,copy;
  3696. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3697. return $core.withContext(function($ctx1) {
  3698. //>>excludeEnd("ctx");
  3699. original=$self._collection();
  3700. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3701. $ctx1.sendIdx["collection"]=1;
  3702. //>>excludeEnd("ctx");
  3703. copy=$recv(original)._copy();
  3704. $recv(copy)._addAll_($self._sampleNewValueAsCollection());
  3705. $self._assert_($recv(original).__eq($self._collection()));
  3706. return self;
  3707. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3708. }, function($ctx1) {$ctx1.fill(self,"testCopySeparates",{original:original,copy:copy},$globals.CollectionTest)});
  3709. //>>excludeEnd("ctx");
  3710. },
  3711. //>>excludeStart("ide", pragmas.excludeIdeData);
  3712. args: [],
  3713. source: "testCopySeparates\x0a\x09| original copy |\x0a\x09original := self collection.\x0a\x09copy := original copy.\x0a\x09copy addAll: self sampleNewValueAsCollection.\x0a\x09self assert: original = self collection",
  3714. referencedClasses: [],
  3715. //>>excludeEnd("ide");
  3716. messageSends: ["collection", "copy", "addAll:", "sampleNewValueAsCollection", "assert:", "="]
  3717. }),
  3718. $globals.CollectionTest);
  3719. $core.addMethod(
  3720. $core.method({
  3721. selector: "testDetect",
  3722. protocol: "tests",
  3723. fn: function (){
  3724. var self=this,$self=this;
  3725. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3726. return $core.withContext(function($ctx1) {
  3727. //>>excludeEnd("ctx");
  3728. var $1,$2,$3,$4,$6,$5,$7;
  3729. $self._shouldnt_raise_((function(){
  3730. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3731. return $core.withContext(function($ctx2) {
  3732. //>>excludeEnd("ctx");
  3733. $1=$self._collection();
  3734. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3735. $ctx2.sendIdx["collection"]=1;
  3736. //>>excludeEnd("ctx");
  3737. return $recv($1)._detect_((function(){
  3738. return true;
  3739. }));
  3740. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3741. $ctx2.sendIdx["detect:"]=1;
  3742. //>>excludeEnd("ctx");
  3743. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3744. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  3745. //>>excludeEnd("ctx");
  3746. }),$globals.Error);
  3747. $self._should_raise_((function(){
  3748. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3749. return $core.withContext(function($ctx2) {
  3750. //>>excludeEnd("ctx");
  3751. $2=$self._collection();
  3752. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3753. $ctx2.sendIdx["collection"]=2;
  3754. //>>excludeEnd("ctx");
  3755. return $recv($2)._detect_((function(){
  3756. return false;
  3757. }));
  3758. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3759. $ctx2.sendIdx["detect:"]=2;
  3760. //>>excludeEnd("ctx");
  3761. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3762. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  3763. //>>excludeEnd("ctx");
  3764. }),$globals.Error);
  3765. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3766. $ctx1.sendIdx["should:raise:"]=1;
  3767. //>>excludeEnd("ctx");
  3768. $3=$recv($self._sampleNewValueAsCollection())._detect_((function(){
  3769. return true;
  3770. }));
  3771. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3772. $ctx1.sendIdx["detect:"]=3;
  3773. //>>excludeEnd("ctx");
  3774. $4=$self._sampleNewValue();
  3775. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3776. $ctx1.sendIdx["sampleNewValue"]=1;
  3777. //>>excludeEnd("ctx");
  3778. $self._assert_equals_($3,$4);
  3779. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3780. $ctx1.sendIdx["assert:equals:"]=1;
  3781. //>>excludeEnd("ctx");
  3782. $5=$recv($self._collectionWithNewValue())._detect_((function(each){
  3783. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3784. return $core.withContext(function($ctx2) {
  3785. //>>excludeEnd("ctx");
  3786. $6=$self._sampleNewValue();
  3787. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3788. $ctx2.sendIdx["sampleNewValue"]=2;
  3789. //>>excludeEnd("ctx");
  3790. return $recv(each).__eq($6);
  3791. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3792. $ctx2.sendIdx["="]=1;
  3793. //>>excludeEnd("ctx");
  3794. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3795. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,6)});
  3796. //>>excludeEnd("ctx");
  3797. }));
  3798. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3799. $ctx1.sendIdx["detect:"]=4;
  3800. //>>excludeEnd("ctx");
  3801. $7=$self._sampleNewValue();
  3802. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3803. $ctx1.sendIdx["sampleNewValue"]=3;
  3804. //>>excludeEnd("ctx");
  3805. $self._assert_equals_($5,$7);
  3806. $self._should_raise_((function(){
  3807. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3808. return $core.withContext(function($ctx2) {
  3809. //>>excludeEnd("ctx");
  3810. return $recv($self._collection())._detect_((function(each){
  3811. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3812. return $core.withContext(function($ctx3) {
  3813. //>>excludeEnd("ctx");
  3814. return $recv(each).__eq($self._sampleNewValue());
  3815. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3816. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,8)});
  3817. //>>excludeEnd("ctx");
  3818. }));
  3819. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3820. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,7)});
  3821. //>>excludeEnd("ctx");
  3822. }),$globals.Error);
  3823. return self;
  3824. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3825. }, function($ctx1) {$ctx1.fill(self,"testDetect",{},$globals.CollectionTest)});
  3826. //>>excludeEnd("ctx");
  3827. },
  3828. //>>excludeStart("ide", pragmas.excludeIdeData);
  3829. args: [],
  3830. source: "testDetect\x0a\x09self\x0a\x09\x09shouldnt: [ self collection detect: [ true ] ]\x0a\x09\x09raise: Error.\x0a\x09self\x0a\x09\x09should: [ self collection detect: [ false ] ]\x0a\x09\x09raise: Error.\x0a\x09self assert: (self sampleNewValueAsCollection detect: [ true ]) equals: self sampleNewValue.\x0a\x09self assert: (self collectionWithNewValue detect: [ :each | each = self sampleNewValue ]) equals: self sampleNewValue.\x0a\x09self\x0a\x09\x09should: [ self collection detect: [ :each | each = self sampleNewValue ] ]\x0a\x09\x09raise: Error",
  3831. referencedClasses: ["Error"],
  3832. //>>excludeEnd("ide");
  3833. messageSends: ["shouldnt:raise:", "detect:", "collection", "should:raise:", "assert:equals:", "sampleNewValueAsCollection", "sampleNewValue", "collectionWithNewValue", "="]
  3834. }),
  3835. $globals.CollectionTest);
  3836. $core.addMethod(
  3837. $core.method({
  3838. selector: "testDetectIfNone",
  3839. protocol: "tests",
  3840. fn: function (){
  3841. var self=this,$self=this;
  3842. var sentinel;
  3843. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3844. return $core.withContext(function($ctx1) {
  3845. //>>excludeEnd("ctx");
  3846. var $3,$2,$1,$5,$4,$6,$7,$9,$8,$10;
  3847. sentinel=$recv($globals.Object)._new();
  3848. $3=$self._collection();
  3849. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3850. $ctx1.sendIdx["collection"]=1;
  3851. //>>excludeEnd("ctx");
  3852. $2=$recv($3)._detect_ifNone_((function(){
  3853. return true;
  3854. }),(function(){
  3855. return sentinel;
  3856. }));
  3857. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3858. $ctx1.sendIdx["detect:ifNone:"]=1;
  3859. //>>excludeEnd("ctx");
  3860. $1=$recv($2).__tild_eq(sentinel);
  3861. $self._assert_($1);
  3862. $5=$self._collection();
  3863. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3864. $ctx1.sendIdx["collection"]=2;
  3865. //>>excludeEnd("ctx");
  3866. $4=$recv($5)._detect_ifNone_((function(){
  3867. return false;
  3868. }),(function(){
  3869. return sentinel;
  3870. }));
  3871. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3872. $ctx1.sendIdx["detect:ifNone:"]=2;
  3873. //>>excludeEnd("ctx");
  3874. $self._assert_equals_($4,sentinel);
  3875. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3876. $ctx1.sendIdx["assert:equals:"]=1;
  3877. //>>excludeEnd("ctx");
  3878. $6=$recv($self._sampleNewValueAsCollection())._detect_ifNone_((function(){
  3879. return true;
  3880. }),(function(){
  3881. return sentinel;
  3882. }));
  3883. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3884. $ctx1.sendIdx["detect:ifNone:"]=3;
  3885. //>>excludeEnd("ctx");
  3886. $7=$self._sampleNewValue();
  3887. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3888. $ctx1.sendIdx["sampleNewValue"]=1;
  3889. //>>excludeEnd("ctx");
  3890. $self._assert_equals_($6,$7);
  3891. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3892. $ctx1.sendIdx["assert:equals:"]=2;
  3893. //>>excludeEnd("ctx");
  3894. $8=$recv($self._collectionWithNewValue())._detect_ifNone_((function(each){
  3895. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3896. return $core.withContext(function($ctx2) {
  3897. //>>excludeEnd("ctx");
  3898. $9=$self._sampleNewValue();
  3899. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3900. $ctx2.sendIdx["sampleNewValue"]=2;
  3901. //>>excludeEnd("ctx");
  3902. return $recv(each).__eq($9);
  3903. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3904. $ctx2.sendIdx["="]=1;
  3905. //>>excludeEnd("ctx");
  3906. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3907. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,7)});
  3908. //>>excludeEnd("ctx");
  3909. }),(function(){
  3910. return sentinel;
  3911. }));
  3912. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3913. $ctx1.sendIdx["detect:ifNone:"]=4;
  3914. //>>excludeEnd("ctx");
  3915. $10=$self._sampleNewValue();
  3916. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3917. $ctx1.sendIdx["sampleNewValue"]=3;
  3918. //>>excludeEnd("ctx");
  3919. $self._assert_equals_($8,$10);
  3920. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3921. $ctx1.sendIdx["assert:equals:"]=3;
  3922. //>>excludeEnd("ctx");
  3923. $self._assert_equals_($recv($self._collection())._detect_ifNone_((function(each){
  3924. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3925. return $core.withContext(function($ctx2) {
  3926. //>>excludeEnd("ctx");
  3927. return $recv(each).__eq($self._sampleNewValue());
  3928. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3929. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,9)});
  3930. //>>excludeEnd("ctx");
  3931. }),(function(){
  3932. return sentinel;
  3933. })),sentinel);
  3934. return self;
  3935. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3936. }, function($ctx1) {$ctx1.fill(self,"testDetectIfNone",{sentinel:sentinel},$globals.CollectionTest)});
  3937. //>>excludeEnd("ctx");
  3938. },
  3939. //>>excludeStart("ide", pragmas.excludeIdeData);
  3940. args: [],
  3941. source: "testDetectIfNone\x0a\x09| sentinel |\x0a\x09sentinel := Object new.\x0a\x09self assert: (self collection detect: [ true ] ifNone: [ sentinel ]) ~= sentinel.\x0a\x09self assert: (self collection detect: [ false ] ifNone: [ sentinel ]) equals: sentinel.\x0a\x09self assert: (self sampleNewValueAsCollection detect: [ true ] ifNone: [ sentinel ]) equals: self sampleNewValue.\x0a\x09self assert: (self collectionWithNewValue detect: [ :each | each = self sampleNewValue ] ifNone: [ sentinel ]) equals: self sampleNewValue.\x0a\x09self assert: (self collection detect: [ :each | each = self sampleNewValue ] ifNone: [ sentinel ]) equals: sentinel",
  3942. referencedClasses: ["Object"],
  3943. //>>excludeEnd("ide");
  3944. messageSends: ["new", "assert:", "~=", "detect:ifNone:", "collection", "assert:equals:", "sampleNewValueAsCollection", "sampleNewValue", "collectionWithNewValue", "="]
  3945. }),
  3946. $globals.CollectionTest);
  3947. $core.addMethod(
  3948. $core.method({
  3949. selector: "testDo",
  3950. protocol: "tests",
  3951. fn: function (){
  3952. var self=this,$self=this;
  3953. var newCollection;
  3954. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3955. return $core.withContext(function($ctx1) {
  3956. //>>excludeEnd("ctx");
  3957. var $1,$2;
  3958. newCollection=$recv($globals.OrderedCollection)._new();
  3959. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3960. $ctx1.sendIdx["new"]=1;
  3961. //>>excludeEnd("ctx");
  3962. $1=$self._collection();
  3963. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3964. $ctx1.sendIdx["collection"]=1;
  3965. //>>excludeEnd("ctx");
  3966. $recv($1)._do_((function(each){
  3967. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3968. return $core.withContext(function($ctx2) {
  3969. //>>excludeEnd("ctx");
  3970. return $recv(newCollection)._add_(each);
  3971. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3972. $ctx2.sendIdx["add:"]=1;
  3973. //>>excludeEnd("ctx");
  3974. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3975. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  3976. //>>excludeEnd("ctx");
  3977. }));
  3978. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3979. $ctx1.sendIdx["do:"]=1;
  3980. //>>excludeEnd("ctx");
  3981. $self._assertSameContents_as_($self._collection(),newCollection);
  3982. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3983. $ctx1.sendIdx["assertSameContents:as:"]=1;
  3984. //>>excludeEnd("ctx");
  3985. newCollection=$recv($globals.OrderedCollection)._new();
  3986. $2=$self._collectionWithDuplicates();
  3987. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3988. $ctx1.sendIdx["collectionWithDuplicates"]=1;
  3989. //>>excludeEnd("ctx");
  3990. $recv($2)._do_((function(each){
  3991. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3992. return $core.withContext(function($ctx2) {
  3993. //>>excludeEnd("ctx");
  3994. return $recv(newCollection)._add_(each);
  3995. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3996. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
  3997. //>>excludeEnd("ctx");
  3998. }));
  3999. $self._assertSameContents_as_($self._collectionWithDuplicates(),newCollection);
  4000. return self;
  4001. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4002. }, function($ctx1) {$ctx1.fill(self,"testDo",{newCollection:newCollection},$globals.CollectionTest)});
  4003. //>>excludeEnd("ctx");
  4004. },
  4005. //>>excludeStart("ide", pragmas.excludeIdeData);
  4006. args: [],
  4007. source: "testDo\x0a\x09| newCollection |\x0a\x09newCollection := OrderedCollection new.\x0a\x09self collection do: [ :each |\x0a\x09\x09newCollection add: each ].\x0a\x09self\x0a\x09\x09assertSameContents: self collection\x0a\x09\x09as: newCollection.\x0a\x09newCollection := OrderedCollection new.\x0a\x09self collectionWithDuplicates do: [ :each |\x0a\x09\x09newCollection add: each ].\x0a\x09self\x0a\x09\x09assertSameContents: self collectionWithDuplicates\x0a\x09\x09as: newCollection",
  4008. referencedClasses: ["OrderedCollection"],
  4009. //>>excludeEnd("ide");
  4010. messageSends: ["new", "do:", "collection", "add:", "assertSameContents:as:", "collectionWithDuplicates"]
  4011. }),
  4012. $globals.CollectionTest);
  4013. $core.addMethod(
  4014. $core.method({
  4015. selector: "testEquality",
  4016. protocol: "tests",
  4017. fn: function (){
  4018. var self=this,$self=this;
  4019. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4020. return $core.withContext(function($ctx1) {
  4021. //>>excludeEnd("ctx");
  4022. var $2,$1,$4,$3,$5,$6,$7,$8,$11,$10,$12,$9,$14,$13;
  4023. $2=$self._collectionClass();
  4024. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4025. $ctx1.sendIdx["collectionClass"]=1;
  4026. //>>excludeEnd("ctx");
  4027. $1=$recv($2)._new();
  4028. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4029. $ctx1.sendIdx["new"]=1;
  4030. //>>excludeEnd("ctx");
  4031. $4=$self._collectionClass();
  4032. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4033. $ctx1.sendIdx["collectionClass"]=2;
  4034. //>>excludeEnd("ctx");
  4035. $3=$recv($4)._new();
  4036. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4037. $ctx1.sendIdx["new"]=2;
  4038. //>>excludeEnd("ctx");
  4039. $self._assert_equals_($1,$3);
  4040. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4041. $ctx1.sendIdx["assert:equals:"]=1;
  4042. //>>excludeEnd("ctx");
  4043. $5=$self._collection();
  4044. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4045. $ctx1.sendIdx["collection"]=1;
  4046. //>>excludeEnd("ctx");
  4047. $6=$self._collection();
  4048. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4049. $ctx1.sendIdx["collection"]=2;
  4050. //>>excludeEnd("ctx");
  4051. $self._assert_equals_($5,$6);
  4052. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4053. $ctx1.sendIdx["assert:equals:"]=2;
  4054. //>>excludeEnd("ctx");
  4055. $7=$self._collectionWithNewValue();
  4056. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4057. $ctx1.sendIdx["collectionWithNewValue"]=1;
  4058. //>>excludeEnd("ctx");
  4059. $8=$self._collectionWithNewValue();
  4060. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4061. $ctx1.sendIdx["collectionWithNewValue"]=2;
  4062. //>>excludeEnd("ctx");
  4063. $self._assert_equals_($7,$8);
  4064. $11=$self._collectionClass();
  4065. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4066. $ctx1.sendIdx["collectionClass"]=3;
  4067. //>>excludeEnd("ctx");
  4068. $10=$recv($11)._new();
  4069. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4070. $ctx1.sendIdx["new"]=3;
  4071. //>>excludeEnd("ctx");
  4072. $12=$self._collection();
  4073. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4074. $ctx1.sendIdx["collection"]=3;
  4075. //>>excludeEnd("ctx");
  4076. $9=$recv($10).__eq($12);
  4077. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4078. $ctx1.sendIdx["="]=1;
  4079. //>>excludeEnd("ctx");
  4080. $self._deny_($9);
  4081. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4082. $ctx1.sendIdx["deny:"]=1;
  4083. //>>excludeEnd("ctx");
  4084. $14=$self._collection();
  4085. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4086. $ctx1.sendIdx["collection"]=4;
  4087. //>>excludeEnd("ctx");
  4088. $13=$recv($14).__eq($recv($self._collectionClass())._new());
  4089. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4090. $ctx1.sendIdx["="]=2;
  4091. //>>excludeEnd("ctx");
  4092. $self._deny_($13);
  4093. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4094. $ctx1.sendIdx["deny:"]=2;
  4095. //>>excludeEnd("ctx");
  4096. $self._deny_($recv($self._collection()).__eq($self._collectionWithNewValue()));
  4097. return self;
  4098. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4099. }, function($ctx1) {$ctx1.fill(self,"testEquality",{},$globals.CollectionTest)});
  4100. //>>excludeEnd("ctx");
  4101. },
  4102. //>>excludeStart("ide", pragmas.excludeIdeData);
  4103. args: [],
  4104. source: "testEquality\x0a\x09self assert: self collectionClass new equals: self collectionClass new.\x0a\x09self assert: self collection equals: self collection.\x0a\x09self assert: self collectionWithNewValue equals: self collectionWithNewValue.\x0a\x09\x0a\x09self deny: self collectionClass new = self collection.\x0a\x09self deny: self collection = self collectionClass new.\x0a\x09self deny: self collection = self collectionWithNewValue",
  4105. referencedClasses: [],
  4106. //>>excludeEnd("ide");
  4107. messageSends: ["assert:equals:", "new", "collectionClass", "collection", "collectionWithNewValue", "deny:", "="]
  4108. }),
  4109. $globals.CollectionTest);
  4110. $core.addMethod(
  4111. $core.method({
  4112. selector: "testIfEmptyFamily",
  4113. protocol: "tests",
  4114. fn: function (){
  4115. var self=this,$self=this;
  4116. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4117. return $core.withContext(function($ctx1) {
  4118. //>>excludeEnd("ctx");
  4119. var $3,$2,$1,$5,$4,$6,$9,$8,$7,$11,$10,$13,$12,$15,$14,$16,$19,$18,$17,$21,$20,$23,$22,$24,$25,$27,$26,$29,$28;
  4120. $3=$self._collectionClass();
  4121. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4122. $ctx1.sendIdx["collectionClass"]=1;
  4123. //>>excludeEnd("ctx");
  4124. $2=$recv($3)._new();
  4125. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4126. $ctx1.sendIdx["new"]=1;
  4127. //>>excludeEnd("ctx");
  4128. $1=$recv($2)._ifEmpty_((function(){
  4129. return (42);
  4130. }));
  4131. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4132. $ctx1.sendIdx["ifEmpty:"]=1;
  4133. //>>excludeEnd("ctx");
  4134. $self._assert_equals_($1,(42));
  4135. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4136. $ctx1.sendIdx["assert:equals:"]=1;
  4137. //>>excludeEnd("ctx");
  4138. $5=$self._collection();
  4139. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4140. $ctx1.sendIdx["collection"]=1;
  4141. //>>excludeEnd("ctx");
  4142. $4=$recv($5)._ifEmpty_((function(){
  4143. return (42);
  4144. }));
  4145. $6=$self._collection();
  4146. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4147. $ctx1.sendIdx["collection"]=2;
  4148. //>>excludeEnd("ctx");
  4149. $self._assert_equals_($4,$6);
  4150. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4151. $ctx1.sendIdx["assert:equals:"]=2;
  4152. //>>excludeEnd("ctx");
  4153. $9=$self._collectionClass();
  4154. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4155. $ctx1.sendIdx["collectionClass"]=2;
  4156. //>>excludeEnd("ctx");
  4157. $8=$recv($9)._new();
  4158. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4159. $ctx1.sendIdx["new"]=2;
  4160. //>>excludeEnd("ctx");
  4161. $7=$recv($8)._ifNotEmpty_((function(){
  4162. return (42);
  4163. }));
  4164. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4165. $ctx1.sendIdx["ifNotEmpty:"]=1;
  4166. //>>excludeEnd("ctx");
  4167. $11=$self._collectionClass();
  4168. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4169. $ctx1.sendIdx["collectionClass"]=3;
  4170. //>>excludeEnd("ctx");
  4171. $10=$recv($11)._new();
  4172. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4173. $ctx1.sendIdx["new"]=3;
  4174. //>>excludeEnd("ctx");
  4175. $self._assert_equals_($7,$10);
  4176. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4177. $ctx1.sendIdx["assert:equals:"]=3;
  4178. //>>excludeEnd("ctx");
  4179. $13=$self._collection();
  4180. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4181. $ctx1.sendIdx["collection"]=3;
  4182. //>>excludeEnd("ctx");
  4183. $12=$recv($13)._ifNotEmpty_((function(){
  4184. return (42);
  4185. }));
  4186. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4187. $ctx1.sendIdx["ifNotEmpty:"]=2;
  4188. //>>excludeEnd("ctx");
  4189. $self._assert_equals_($12,(42));
  4190. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4191. $ctx1.sendIdx["assert:equals:"]=4;
  4192. //>>excludeEnd("ctx");
  4193. $15=$self._collection();
  4194. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4195. $ctx1.sendIdx["collection"]=4;
  4196. //>>excludeEnd("ctx");
  4197. $14=$recv($15)._ifNotEmpty_((function(col){
  4198. return col;
  4199. }));
  4200. $16=$self._collection();
  4201. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4202. $ctx1.sendIdx["collection"]=5;
  4203. //>>excludeEnd("ctx");
  4204. $self._assert_equals_($14,$16);
  4205. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4206. $ctx1.sendIdx["assert:equals:"]=5;
  4207. //>>excludeEnd("ctx");
  4208. $19=$self._collectionClass();
  4209. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4210. $ctx1.sendIdx["collectionClass"]=4;
  4211. //>>excludeEnd("ctx");
  4212. $18=$recv($19)._new();
  4213. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4214. $ctx1.sendIdx["new"]=4;
  4215. //>>excludeEnd("ctx");
  4216. $17=$recv($18)._ifEmpty_ifNotEmpty_((function(){
  4217. return (42);
  4218. }),(function(){
  4219. return (999);
  4220. }));
  4221. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4222. $ctx1.sendIdx["ifEmpty:ifNotEmpty:"]=1;
  4223. //>>excludeEnd("ctx");
  4224. $self._assert_equals_($17,(42));
  4225. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4226. $ctx1.sendIdx["assert:equals:"]=6;
  4227. //>>excludeEnd("ctx");
  4228. $21=$self._collection();
  4229. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4230. $ctx1.sendIdx["collection"]=6;
  4231. //>>excludeEnd("ctx");
  4232. $20=$recv($21)._ifEmpty_ifNotEmpty_((function(){
  4233. return (42);
  4234. }),(function(){
  4235. return (999);
  4236. }));
  4237. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4238. $ctx1.sendIdx["ifEmpty:ifNotEmpty:"]=2;
  4239. //>>excludeEnd("ctx");
  4240. $self._assert_equals_($20,(999));
  4241. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4242. $ctx1.sendIdx["assert:equals:"]=7;
  4243. //>>excludeEnd("ctx");
  4244. $23=$self._collection();
  4245. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4246. $ctx1.sendIdx["collection"]=7;
  4247. //>>excludeEnd("ctx");
  4248. $22=$recv($23)._ifEmpty_ifNotEmpty_((function(){
  4249. return (42);
  4250. }),(function(col){
  4251. return col;
  4252. }));
  4253. $24=$self._collection();
  4254. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4255. $ctx1.sendIdx["collection"]=8;
  4256. //>>excludeEnd("ctx");
  4257. $self._assert_equals_($22,$24);
  4258. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4259. $ctx1.sendIdx["assert:equals:"]=8;
  4260. //>>excludeEnd("ctx");
  4261. $25=$recv($recv($self._collectionClass())._new())._ifNotEmpty_ifEmpty_((function(){
  4262. return (42);
  4263. }),(function(){
  4264. return (999);
  4265. }));
  4266. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4267. $ctx1.sendIdx["ifNotEmpty:ifEmpty:"]=1;
  4268. //>>excludeEnd("ctx");
  4269. $self._assert_equals_($25,(999));
  4270. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4271. $ctx1.sendIdx["assert:equals:"]=9;
  4272. //>>excludeEnd("ctx");
  4273. $27=$self._collection();
  4274. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4275. $ctx1.sendIdx["collection"]=9;
  4276. //>>excludeEnd("ctx");
  4277. $26=$recv($27)._ifNotEmpty_ifEmpty_((function(){
  4278. return (42);
  4279. }),(function(){
  4280. return (999);
  4281. }));
  4282. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4283. $ctx1.sendIdx["ifNotEmpty:ifEmpty:"]=2;
  4284. //>>excludeEnd("ctx");
  4285. $self._assert_equals_($26,(42));
  4286. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4287. $ctx1.sendIdx["assert:equals:"]=10;
  4288. //>>excludeEnd("ctx");
  4289. $29=$self._collection();
  4290. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4291. $ctx1.sendIdx["collection"]=10;
  4292. //>>excludeEnd("ctx");
  4293. $28=$recv($29)._ifNotEmpty_ifEmpty_((function(col){
  4294. return col;
  4295. }),(function(){
  4296. return (999);
  4297. }));
  4298. $self._assert_equals_($28,$self._collection());
  4299. return self;
  4300. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4301. }, function($ctx1) {$ctx1.fill(self,"testIfEmptyFamily",{},$globals.CollectionTest)});
  4302. //>>excludeEnd("ctx");
  4303. },
  4304. //>>excludeStart("ide", pragmas.excludeIdeData);
  4305. args: [],
  4306. source: "testIfEmptyFamily\x0a\x09self assert: (self collectionClass new ifEmpty: [ 42 ]) equals: 42.\x0a\x09self assert: (self collection ifEmpty: [ 42 ]) equals: self collection.\x0a\x0a\x09self assert: (self collectionClass new ifNotEmpty: [ 42 ]) equals: self collectionClass new.\x0a\x09self assert: (self collection ifNotEmpty: [ 42 ]) equals: 42.\x0a\x09self assert: (self collection ifNotEmpty: [ :col | col ]) equals: self collection.\x0a\x09\x0a\x09self assert: (self collectionClass new ifEmpty: [ 42 ] ifNotEmpty: [ 999 ]) equals: 42.\x0a\x09self assert: (self collection ifEmpty: [ 42 ] ifNotEmpty: [ 999 ]) equals: 999.\x0a\x09self assert: (self collection ifEmpty: [ 42 ] ifNotEmpty: [ :col | col ]) equals: self collection.\x0a\x0a\x09self assert: (self collectionClass new ifNotEmpty: [ 42 ] ifEmpty: [ 999 ]) equals: 999.\x0a\x09self assert: (self collection ifNotEmpty: [ 42 ] ifEmpty: [ 999 ]) equals: 42.\x0a\x09self assert: (self collection ifNotEmpty: [ :col | col ] ifEmpty: [ 999 ]) equals: self collection.",
  4307. referencedClasses: [],
  4308. //>>excludeEnd("ide");
  4309. messageSends: ["assert:equals:", "ifEmpty:", "new", "collectionClass", "collection", "ifNotEmpty:", "ifEmpty:ifNotEmpty:", "ifNotEmpty:ifEmpty:"]
  4310. }),
  4311. $globals.CollectionTest);
  4312. $core.addMethod(
  4313. $core.method({
  4314. selector: "testIsEmpty",
  4315. protocol: "tests",
  4316. fn: function (){
  4317. var self=this,$self=this;
  4318. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4319. return $core.withContext(function($ctx1) {
  4320. //>>excludeEnd("ctx");
  4321. var $1;
  4322. $1=$recv($recv($self._collectionClass())._new())._isEmpty();
  4323. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4324. $ctx1.sendIdx["isEmpty"]=1;
  4325. //>>excludeEnd("ctx");
  4326. $self._assert_($1);
  4327. $self._deny_($recv($self._collection())._isEmpty());
  4328. return self;
  4329. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4330. }, function($ctx1) {$ctx1.fill(self,"testIsEmpty",{},$globals.CollectionTest)});
  4331. //>>excludeEnd("ctx");
  4332. },
  4333. //>>excludeStart("ide", pragmas.excludeIdeData);
  4334. args: [],
  4335. source: "testIsEmpty\x0a\x09self assert: self collectionClass new isEmpty.\x0a\x09self deny: self collection isEmpty",
  4336. referencedClasses: [],
  4337. //>>excludeEnd("ide");
  4338. messageSends: ["assert:", "isEmpty", "new", "collectionClass", "deny:", "collection"]
  4339. }),
  4340. $globals.CollectionTest);
  4341. $core.addMethod(
  4342. $core.method({
  4343. selector: "testNoneSatisfy",
  4344. protocol: "tests",
  4345. fn: function (){
  4346. var self=this,$self=this;
  4347. var anyOne;
  4348. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4349. return $core.withContext(function($ctx1) {
  4350. //>>excludeEnd("ctx");
  4351. var $1,$3,$2;
  4352. $1=$self._collection();
  4353. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4354. $ctx1.sendIdx["collection"]=1;
  4355. //>>excludeEnd("ctx");
  4356. anyOne=$recv($1)._anyOne();
  4357. $3=$self._collection();
  4358. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4359. $ctx1.sendIdx["collection"]=2;
  4360. //>>excludeEnd("ctx");
  4361. $2=$recv($3)._noneSatisfy_((function(each){
  4362. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4363. return $core.withContext(function($ctx2) {
  4364. //>>excludeEnd("ctx");
  4365. return $recv(each).__eq(anyOne);
  4366. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4367. $ctx2.sendIdx["="]=1;
  4368. //>>excludeEnd("ctx");
  4369. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4370. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  4371. //>>excludeEnd("ctx");
  4372. }));
  4373. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4374. $ctx1.sendIdx["noneSatisfy:"]=1;
  4375. //>>excludeEnd("ctx");
  4376. $self._deny_($2);
  4377. $self._assert_($recv($self._collection())._noneSatisfy_((function(each){
  4378. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4379. return $core.withContext(function($ctx2) {
  4380. //>>excludeEnd("ctx");
  4381. return $recv(each).__eq($recv($globals.Object)._new());
  4382. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4383. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
  4384. //>>excludeEnd("ctx");
  4385. })));
  4386. return self;
  4387. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4388. }, function($ctx1) {$ctx1.fill(self,"testNoneSatisfy",{anyOne:anyOne},$globals.CollectionTest)});
  4389. //>>excludeEnd("ctx");
  4390. },
  4391. //>>excludeStart("ide", pragmas.excludeIdeData);
  4392. args: [],
  4393. source: "testNoneSatisfy\x0a\x09| anyOne |\x0a\x09anyOne := self collection anyOne.\x0a\x09self deny: (self collection noneSatisfy: [ :each | each = anyOne ]).\x0a\x09self assert: (self collection noneSatisfy: [ :each | each = Object new ])",
  4394. referencedClasses: ["Object"],
  4395. //>>excludeEnd("ide");
  4396. messageSends: ["anyOne", "collection", "deny:", "noneSatisfy:", "=", "assert:", "new"]
  4397. }),
  4398. $globals.CollectionTest);
  4399. $core.addMethod(
  4400. $core.method({
  4401. selector: "testRemoveAll",
  4402. protocol: "tests",
  4403. fn: function (){
  4404. var self=this,$self=this;
  4405. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4406. return $core.withContext(function($ctx1) {
  4407. //>>excludeEnd("ctx");
  4408. var $2,$1;
  4409. $2=$self._collection();
  4410. $recv($2)._removeAll();
  4411. $1=$recv($2)._yourself();
  4412. $self._assert_equals_($1,$recv($self._collectionClass())._new());
  4413. return self;
  4414. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4415. }, function($ctx1) {$ctx1.fill(self,"testRemoveAll",{},$globals.CollectionTest)});
  4416. //>>excludeEnd("ctx");
  4417. },
  4418. //>>excludeStart("ide", pragmas.excludeIdeData);
  4419. args: [],
  4420. source: "testRemoveAll\x0a\x09self assert: (self collection removeAll; yourself) equals: self collectionClass new",
  4421. referencedClasses: [],
  4422. //>>excludeEnd("ide");
  4423. messageSends: ["assert:equals:", "removeAll", "collection", "yourself", "new", "collectionClass"]
  4424. }),
  4425. $globals.CollectionTest);
  4426. $core.addMethod(
  4427. $core.method({
  4428. selector: "testSelect",
  4429. protocol: "tests",
  4430. fn: function (){
  4431. var self=this,$self=this;
  4432. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4433. return $core.withContext(function($ctx1) {
  4434. //>>excludeEnd("ctx");
  4435. var $2,$1,$4,$3,$6,$5,$7,$9,$10,$8,$12,$13,$11,$14,$16,$17,$15;
  4436. $2=$self._collection();
  4437. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4438. $ctx1.sendIdx["collection"]=1;
  4439. //>>excludeEnd("ctx");
  4440. $1=$recv($2)._select_((function(){
  4441. return false;
  4442. }));
  4443. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4444. $ctx1.sendIdx["select:"]=1;
  4445. //>>excludeEnd("ctx");
  4446. $4=$self._collectionClass();
  4447. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4448. $ctx1.sendIdx["collectionClass"]=1;
  4449. //>>excludeEnd("ctx");
  4450. $3=$recv($4)._new();
  4451. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4452. $ctx1.sendIdx["new"]=1;
  4453. //>>excludeEnd("ctx");
  4454. $self._assert_equals_($1,$3);
  4455. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4456. $ctx1.sendIdx["assert:equals:"]=1;
  4457. //>>excludeEnd("ctx");
  4458. $6=$self._collection();
  4459. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4460. $ctx1.sendIdx["collection"]=2;
  4461. //>>excludeEnd("ctx");
  4462. $5=$recv($6)._select_((function(){
  4463. return true;
  4464. }));
  4465. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4466. $ctx1.sendIdx["select:"]=2;
  4467. //>>excludeEnd("ctx");
  4468. $7=$self._collection();
  4469. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4470. $ctx1.sendIdx["collection"]=3;
  4471. //>>excludeEnd("ctx");
  4472. $self._assert_equals_($5,$7);
  4473. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4474. $ctx1.sendIdx["assert:equals:"]=2;
  4475. //>>excludeEnd("ctx");
  4476. $9=$self._collectionWithNewValue();
  4477. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4478. $ctx1.sendIdx["collectionWithNewValue"]=1;
  4479. //>>excludeEnd("ctx");
  4480. $8=$recv($9)._select_((function(each){
  4481. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4482. return $core.withContext(function($ctx2) {
  4483. //>>excludeEnd("ctx");
  4484. $10=$self._sampleNewValue();
  4485. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4486. $ctx2.sendIdx["sampleNewValue"]=1;
  4487. //>>excludeEnd("ctx");
  4488. return $recv(each).__eq($10);
  4489. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4490. $ctx2.sendIdx["="]=1;
  4491. //>>excludeEnd("ctx");
  4492. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4493. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,3)});
  4494. //>>excludeEnd("ctx");
  4495. }));
  4496. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4497. $ctx1.sendIdx["select:"]=3;
  4498. //>>excludeEnd("ctx");
  4499. $self._assert_equals_($8,$self._sampleNewValueAsCollection());
  4500. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4501. $ctx1.sendIdx["assert:equals:"]=3;
  4502. //>>excludeEnd("ctx");
  4503. $12=$self._collectionWithNewValue();
  4504. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4505. $ctx1.sendIdx["collectionWithNewValue"]=2;
  4506. //>>excludeEnd("ctx");
  4507. $11=$recv($12)._select_((function(each){
  4508. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4509. return $core.withContext(function($ctx2) {
  4510. //>>excludeEnd("ctx");
  4511. $13=$self._sampleNewValue();
  4512. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4513. $ctx2.sendIdx["sampleNewValue"]=2;
  4514. //>>excludeEnd("ctx");
  4515. return $recv(each).__tild_eq($13);
  4516. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4517. $ctx2.sendIdx["~="]=1;
  4518. //>>excludeEnd("ctx");
  4519. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4520. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,4)});
  4521. //>>excludeEnd("ctx");
  4522. }));
  4523. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4524. $ctx1.sendIdx["select:"]=4;
  4525. //>>excludeEnd("ctx");
  4526. $14=$self._collection();
  4527. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4528. $ctx1.sendIdx["collection"]=4;
  4529. //>>excludeEnd("ctx");
  4530. $self._assert_equals_($11,$14);
  4531. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4532. $ctx1.sendIdx["assert:equals:"]=4;
  4533. //>>excludeEnd("ctx");
  4534. $16=$self._collection();
  4535. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4536. $ctx1.sendIdx["collection"]=5;
  4537. //>>excludeEnd("ctx");
  4538. $15=$recv($16)._select_((function(each){
  4539. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4540. return $core.withContext(function($ctx2) {
  4541. //>>excludeEnd("ctx");
  4542. $17=$self._sampleNewValue();
  4543. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4544. $ctx2.sendIdx["sampleNewValue"]=3;
  4545. //>>excludeEnd("ctx");
  4546. return $recv(each).__eq($17);
  4547. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4548. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,5)});
  4549. //>>excludeEnd("ctx");
  4550. }));
  4551. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4552. $ctx1.sendIdx["select:"]=5;
  4553. //>>excludeEnd("ctx");
  4554. $self._assert_equals_($15,$recv($self._collectionClass())._new());
  4555. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4556. $ctx1.sendIdx["assert:equals:"]=5;
  4557. //>>excludeEnd("ctx");
  4558. $self._assert_equals_($recv($self._collectionWithNewValue())._select_((function(each){
  4559. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4560. return $core.withContext(function($ctx2) {
  4561. //>>excludeEnd("ctx");
  4562. return $recv(each).__tild_eq($self._sampleNewValue());
  4563. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4564. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,6)});
  4565. //>>excludeEnd("ctx");
  4566. })),$self._collection());
  4567. return self;
  4568. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4569. }, function($ctx1) {$ctx1.fill(self,"testSelect",{},$globals.CollectionTest)});
  4570. //>>excludeEnd("ctx");
  4571. },
  4572. //>>excludeStart("ide", pragmas.excludeIdeData);
  4573. args: [],
  4574. source: "testSelect\x0a\x09self assert: (self collection select: [ false ]) equals: self collectionClass new.\x0a\x09self assert: (self collection select: [ true ]) equals: self collection.\x0a\x09self assert: (self collectionWithNewValue select: [ :each | each = self sampleNewValue ]) equals: self sampleNewValueAsCollection.\x0a\x09self assert: (self collectionWithNewValue select: [ :each | each ~= self sampleNewValue ]) equals: self collection.\x0a\x09self assert: (self collection select: [ :each | each = self sampleNewValue ]) equals: self collectionClass new.\x0a\x09self assert: (self collectionWithNewValue select: [ :each | each ~= self sampleNewValue ]) equals: self collection",
  4575. referencedClasses: [],
  4576. //>>excludeEnd("ide");
  4577. messageSends: ["assert:equals:", "select:", "collection", "new", "collectionClass", "collectionWithNewValue", "=", "sampleNewValue", "sampleNewValueAsCollection", "~="]
  4578. }),
  4579. $globals.CollectionTest);
  4580. $core.addMethod(
  4581. $core.method({
  4582. selector: "testSelectThenCollect",
  4583. protocol: "tests",
  4584. fn: function (){
  4585. var self=this,$self=this;
  4586. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4587. return $core.withContext(function($ctx1) {
  4588. //>>excludeEnd("ctx");
  4589. var $2,$1,$4,$3,$6,$5,$7,$9,$8;
  4590. $2=$self._collection();
  4591. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4592. $ctx1.sendIdx["collection"]=1;
  4593. //>>excludeEnd("ctx");
  4594. $1=$recv($2)._select_thenCollect_((function(){
  4595. return false;
  4596. }),"isString");
  4597. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4598. $ctx1.sendIdx["select:thenCollect:"]=1;
  4599. //>>excludeEnd("ctx");
  4600. $4=$self._collectionClass();
  4601. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4602. $ctx1.sendIdx["collectionClass"]=1;
  4603. //>>excludeEnd("ctx");
  4604. $3=$recv($4)._new();
  4605. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4606. $ctx1.sendIdx["new"]=1;
  4607. //>>excludeEnd("ctx");
  4608. $self._assert_equals_($1,$3);
  4609. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4610. $ctx1.sendIdx["assert:equals:"]=1;
  4611. //>>excludeEnd("ctx");
  4612. $6=$self._collection();
  4613. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4614. $ctx1.sendIdx["collection"]=2;
  4615. //>>excludeEnd("ctx");
  4616. $5=$recv($6)._select_thenCollect_((function(){
  4617. return true;
  4618. }),(function(x){
  4619. return x;
  4620. }));
  4621. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4622. $ctx1.sendIdx["select:thenCollect:"]=2;
  4623. //>>excludeEnd("ctx");
  4624. $7=$self._collection();
  4625. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4626. $ctx1.sendIdx["collection"]=3;
  4627. //>>excludeEnd("ctx");
  4628. $self._assert_equals_($5,$7);
  4629. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4630. $ctx1.sendIdx["assert:equals:"]=2;
  4631. //>>excludeEnd("ctx");
  4632. $8=$recv($self._collection())._select_thenCollect_((function(each){
  4633. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4634. return $core.withContext(function($ctx2) {
  4635. //>>excludeEnd("ctx");
  4636. $9=$self._sampleNewValue();
  4637. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4638. $ctx2.sendIdx["sampleNewValue"]=1;
  4639. //>>excludeEnd("ctx");
  4640. return $recv(each).__eq($9);
  4641. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4642. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,4)});
  4643. //>>excludeEnd("ctx");
  4644. }),(function(x){
  4645. return x;
  4646. }));
  4647. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4648. $ctx1.sendIdx["select:thenCollect:"]=3;
  4649. //>>excludeEnd("ctx");
  4650. $self._assert_equals_($8,$recv($self._collectionClass())._new());
  4651. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4652. $ctx1.sendIdx["assert:equals:"]=3;
  4653. //>>excludeEnd("ctx");
  4654. $self._assert_equals_($recv($self._collectionWithNewValue())._select_thenCollect_((function(each){
  4655. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4656. return $core.withContext(function($ctx2) {
  4657. //>>excludeEnd("ctx");
  4658. return $recv(each).__tild_eq($self._sampleNewValue());
  4659. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4660. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,6)});
  4661. //>>excludeEnd("ctx");
  4662. }),"printString"),$self._collectionOfPrintStrings());
  4663. return self;
  4664. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4665. }, function($ctx1) {$ctx1.fill(self,"testSelectThenCollect",{},$globals.CollectionTest)});
  4666. //>>excludeEnd("ctx");
  4667. },
  4668. //>>excludeStart("ide", pragmas.excludeIdeData);
  4669. args: [],
  4670. source: "testSelectThenCollect\x0a\x09self assert: (self collection select: [ false ] thenCollect: #isString) equals: self collectionClass new.\x0a\x09self assert: (self collection select: [ true ] thenCollect: [:x|x]) equals: self collection.\x0a\x09self assert: (self collection select: [ :each | each = self sampleNewValue ] thenCollect: [:x|x]) equals: self collectionClass new.\x0a\x09self assert: (self collectionWithNewValue select: [ :each | each ~= self sampleNewValue ] thenCollect: #printString) equals: self collectionOfPrintStrings",
  4671. referencedClasses: [],
  4672. //>>excludeEnd("ide");
  4673. messageSends: ["assert:equals:", "select:thenCollect:", "collection", "new", "collectionClass", "=", "sampleNewValue", "collectionWithNewValue", "~=", "collectionOfPrintStrings"]
  4674. }),
  4675. $globals.CollectionTest);
  4676. $core.addMethod(
  4677. $core.method({
  4678. selector: "testSingle",
  4679. protocol: "tests",
  4680. fn: function (){
  4681. var self=this,$self=this;
  4682. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4683. return $core.withContext(function($ctx1) {
  4684. //>>excludeEnd("ctx");
  4685. $self._should_raise_((function(){
  4686. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4687. return $core.withContext(function($ctx2) {
  4688. //>>excludeEnd("ctx");
  4689. return $recv($recv($self._collectionClass())._new())._single();
  4690. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4691. $ctx2.sendIdx["single"]=1;
  4692. //>>excludeEnd("ctx");
  4693. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4694. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  4695. //>>excludeEnd("ctx");
  4696. }),$globals.Error);
  4697. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4698. $ctx1.sendIdx["should:raise:"]=1;
  4699. //>>excludeEnd("ctx");
  4700. $self._should_raise_((function(){
  4701. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4702. return $core.withContext(function($ctx2) {
  4703. //>>excludeEnd("ctx");
  4704. return $recv($self._collection())._single();
  4705. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4706. $ctx2.sendIdx["single"]=2;
  4707. //>>excludeEnd("ctx");
  4708. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4709. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  4710. //>>excludeEnd("ctx");
  4711. }),$globals.Error);
  4712. $self._assert_equals_($recv($self._sampleNewValueAsCollection())._single(),$self._sampleNewValue());
  4713. return self;
  4714. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4715. }, function($ctx1) {$ctx1.fill(self,"testSingle",{},$globals.CollectionTest)});
  4716. //>>excludeEnd("ctx");
  4717. },
  4718. //>>excludeStart("ide", pragmas.excludeIdeData);
  4719. args: [],
  4720. source: "testSingle\x0a\x09self should: [ self collectionClass new single ] raise: Error.\x0a\x09self should: [ self collection single ] raise: Error.\x0a\x09self assert: self sampleNewValueAsCollection single equals: self sampleNewValue",
  4721. referencedClasses: ["Error"],
  4722. //>>excludeEnd("ide");
  4723. messageSends: ["should:raise:", "single", "new", "collectionClass", "collection", "assert:equals:", "sampleNewValueAsCollection", "sampleNewValue"]
  4724. }),
  4725. $globals.CollectionTest);
  4726. $core.addMethod(
  4727. $core.method({
  4728. selector: "testSize",
  4729. protocol: "tests",
  4730. fn: function (){
  4731. var self=this,$self=this;
  4732. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4733. return $core.withContext(function($ctx1) {
  4734. //>>excludeEnd("ctx");
  4735. var $1,$2;
  4736. $1=$recv($recv($self._collectionClass())._new())._size();
  4737. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4738. $ctx1.sendIdx["size"]=1;
  4739. //>>excludeEnd("ctx");
  4740. $self._assert_equals_($1,(0));
  4741. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4742. $ctx1.sendIdx["assert:equals:"]=1;
  4743. //>>excludeEnd("ctx");
  4744. $2=$recv($self._sampleNewValueAsCollection())._size();
  4745. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4746. $ctx1.sendIdx["size"]=2;
  4747. //>>excludeEnd("ctx");
  4748. $self._assert_equals_($2,(1));
  4749. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4750. $ctx1.sendIdx["assert:equals:"]=2;
  4751. //>>excludeEnd("ctx");
  4752. $self._assert_equals_($recv($self._collection())._size(),$self._collectionSize());
  4753. return self;
  4754. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4755. }, function($ctx1) {$ctx1.fill(self,"testSize",{},$globals.CollectionTest)});
  4756. //>>excludeEnd("ctx");
  4757. },
  4758. //>>excludeStart("ide", pragmas.excludeIdeData);
  4759. args: [],
  4760. source: "testSize\x0a\x09self assert: self collectionClass new size equals: 0.\x0a\x09self assert: self sampleNewValueAsCollection size equals: 1.\x0a\x09self assert: self collection size equals: self collectionSize",
  4761. referencedClasses: [],
  4762. //>>excludeEnd("ide");
  4763. messageSends: ["assert:equals:", "size", "new", "collectionClass", "sampleNewValueAsCollection", "collection", "collectionSize"]
  4764. }),
  4765. $globals.CollectionTest);
  4766. $core.addMethod(
  4767. $core.method({
  4768. selector: "collectionClass",
  4769. protocol: "fixture",
  4770. fn: function (){
  4771. var self=this,$self=this;
  4772. return nil;
  4773. },
  4774. //>>excludeStart("ide", pragmas.excludeIdeData);
  4775. args: [],
  4776. source: "collectionClass\x0a\x09\x22Answers class of collection type tested,\x0a\x09or nil if test is abstract\x22\x0a\x0a\x09^ nil",
  4777. referencedClasses: [],
  4778. //>>excludeEnd("ide");
  4779. messageSends: []
  4780. }),
  4781. $globals.CollectionTest.a$cls);
  4782. $core.addMethod(
  4783. $core.method({
  4784. selector: "isAbstract",
  4785. protocol: "testing",
  4786. fn: function (){
  4787. var self=this,$self=this;
  4788. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4789. return $core.withContext(function($ctx1) {
  4790. //>>excludeEnd("ctx");
  4791. return $recv($self._collectionClass())._isNil();
  4792. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4793. }, function($ctx1) {$ctx1.fill(self,"isAbstract",{},$globals.CollectionTest.a$cls)});
  4794. //>>excludeEnd("ctx");
  4795. },
  4796. //>>excludeStart("ide", pragmas.excludeIdeData);
  4797. args: [],
  4798. source: "isAbstract\x0a\x09^ self collectionClass isNil",
  4799. referencedClasses: [],
  4800. //>>excludeEnd("ide");
  4801. messageSends: ["isNil", "collectionClass"]
  4802. }),
  4803. $globals.CollectionTest.a$cls);
  4804. $core.addClass("IndexableCollectionTest", $globals.CollectionTest, [], "Kernel-Tests");
  4805. $core.addMethod(
  4806. $core.method({
  4807. selector: "collectionWithNewValue",
  4808. protocol: "fixture",
  4809. fn: function (){
  4810. var self=this,$self=this;
  4811. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4812. return $core.withContext(function($ctx1) {
  4813. //>>excludeEnd("ctx");
  4814. $self._subclassResponsibility();
  4815. return self;
  4816. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4817. }, function($ctx1) {$ctx1.fill(self,"collectionWithNewValue",{},$globals.IndexableCollectionTest)});
  4818. //>>excludeEnd("ctx");
  4819. },
  4820. //>>excludeStart("ide", pragmas.excludeIdeData);
  4821. args: [],
  4822. source: "collectionWithNewValue\x0a\x09\x22Answers a collection which shows how\x0a\x09self collection would look after adding\x0a\x09self sampleNewValue at self sampleNewIndex\x22\x0a\x09\x0a\x09self subclassResponsibility",
  4823. referencedClasses: [],
  4824. //>>excludeEnd("ide");
  4825. messageSends: ["subclassResponsibility"]
  4826. }),
  4827. $globals.IndexableCollectionTest);
  4828. $core.addMethod(
  4829. $core.method({
  4830. selector: "sampleNewIndex",
  4831. protocol: "fixture",
  4832. fn: function (){
  4833. var self=this,$self=this;
  4834. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4835. return $core.withContext(function($ctx1) {
  4836. //>>excludeEnd("ctx");
  4837. $self._subclassResponsibility();
  4838. return self;
  4839. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4840. }, function($ctx1) {$ctx1.fill(self,"sampleNewIndex",{},$globals.IndexableCollectionTest)});
  4841. //>>excludeEnd("ctx");
  4842. },
  4843. //>>excludeStart("ide", pragmas.excludeIdeData);
  4844. args: [],
  4845. source: "sampleNewIndex\x0a\x09\x22Answers a value that can be used as index in at:put: or at:ifAbsentPut:\x22\x0a\x09\x0a\x09self subclassResponsibility",
  4846. referencedClasses: [],
  4847. //>>excludeEnd("ide");
  4848. messageSends: ["subclassResponsibility"]
  4849. }),
  4850. $globals.IndexableCollectionTest);
  4851. $core.addMethod(
  4852. $core.method({
  4853. selector: "sampleNonIndexesDo:",
  4854. protocol: "fixture",
  4855. fn: function (aBlock){
  4856. var self=this,$self=this;
  4857. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4858. return $core.withContext(function($ctx1) {
  4859. //>>excludeEnd("ctx");
  4860. $self._subclassResponsibility();
  4861. return self;
  4862. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4863. }, function($ctx1) {$ctx1.fill(self,"sampleNonIndexesDo:",{aBlock:aBlock},$globals.IndexableCollectionTest)});
  4864. //>>excludeEnd("ctx");
  4865. },
  4866. //>>excludeStart("ide", pragmas.excludeIdeData);
  4867. args: ["aBlock"],
  4868. source: "sampleNonIndexesDo: aBlock\x0a\x09\x22Executes block a few times,\x0a\x09each time passing value that is known\x0a\x09not to be an index, as the first parameter\x22\x0a\x09\x0a\x09self subclassResponsibility",
  4869. referencedClasses: [],
  4870. //>>excludeEnd("ide");
  4871. messageSends: ["subclassResponsibility"]
  4872. }),
  4873. $globals.IndexableCollectionTest);
  4874. $core.addMethod(
  4875. $core.method({
  4876. selector: "samplesDo:",
  4877. protocol: "fixture",
  4878. fn: function (aBlock){
  4879. var self=this,$self=this;
  4880. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4881. return $core.withContext(function($ctx1) {
  4882. //>>excludeEnd("ctx");
  4883. $self._subclassResponsibility();
  4884. return self;
  4885. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4886. }, function($ctx1) {$ctx1.fill(self,"samplesDo:",{aBlock:aBlock},$globals.IndexableCollectionTest)});
  4887. //>>excludeEnd("ctx");
  4888. },
  4889. //>>excludeStart("ide", pragmas.excludeIdeData);
  4890. args: ["aBlock"],
  4891. source: "samplesDo: aBlock\x0a\x09\x22Executes block a few times,\x0a\x09each time passing known index and value stored\x0a\x09under that index as the parameters\x22\x0a\x09\x0a\x09self subclassResponsibility",
  4892. referencedClasses: [],
  4893. //>>excludeEnd("ide");
  4894. messageSends: ["subclassResponsibility"]
  4895. }),
  4896. $globals.IndexableCollectionTest);
  4897. $core.addMethod(
  4898. $core.method({
  4899. selector: "testAt",
  4900. protocol: "tests",
  4901. fn: function (){
  4902. var self=this,$self=this;
  4903. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4904. return $core.withContext(function($ctx1) {
  4905. //>>excludeEnd("ctx");
  4906. var $1;
  4907. $self._nonIndexesDo_((function(each){
  4908. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4909. return $core.withContext(function($ctx2) {
  4910. //>>excludeEnd("ctx");
  4911. return $self._should_raise_((function(){
  4912. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4913. return $core.withContext(function($ctx3) {
  4914. //>>excludeEnd("ctx");
  4915. $1=$self._collection();
  4916. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4917. $ctx3.sendIdx["collection"]=1;
  4918. //>>excludeEnd("ctx");
  4919. return $recv($1)._at_(each);
  4920. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4921. $ctx3.sendIdx["at:"]=1;
  4922. //>>excludeEnd("ctx");
  4923. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4924. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  4925. //>>excludeEnd("ctx");
  4926. }),$globals.Error);
  4927. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4928. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  4929. //>>excludeEnd("ctx");
  4930. }));
  4931. $self._samplesDo_((function(index,value){
  4932. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4933. return $core.withContext(function($ctx2) {
  4934. //>>excludeEnd("ctx");
  4935. return $self._assert_equals_($recv($self._collection())._at_(index),value);
  4936. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4937. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,3)});
  4938. //>>excludeEnd("ctx");
  4939. }));
  4940. return self;
  4941. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4942. }, function($ctx1) {$ctx1.fill(self,"testAt",{},$globals.IndexableCollectionTest)});
  4943. //>>excludeEnd("ctx");
  4944. },
  4945. //>>excludeStart("ide", pragmas.excludeIdeData);
  4946. args: [],
  4947. source: "testAt\x0a\x09self nonIndexesDo: [ :each |\x0a\x09\x09self should: [ self collection at: each ] raise: Error ].\x0a\x09self samplesDo: [ :index :value |\x0a\x09\x09self assert: (self collection at: index) equals: value ]",
  4948. referencedClasses: ["Error"],
  4949. //>>excludeEnd("ide");
  4950. messageSends: ["nonIndexesDo:", "should:raise:", "at:", "collection", "samplesDo:", "assert:equals:"]
  4951. }),
  4952. $globals.IndexableCollectionTest);
  4953. $core.addMethod(
  4954. $core.method({
  4955. selector: "testAtIfAbsent",
  4956. protocol: "tests",
  4957. fn: function (){
  4958. var self=this,$self=this;
  4959. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4960. return $core.withContext(function($ctx1) {
  4961. //>>excludeEnd("ctx");
  4962. var $2,$1,$3;
  4963. $self._nonIndexesDo_((function(each){
  4964. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4965. return $core.withContext(function($ctx2) {
  4966. //>>excludeEnd("ctx");
  4967. $2=$self._collection();
  4968. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4969. $ctx2.sendIdx["collection"]=1;
  4970. //>>excludeEnd("ctx");
  4971. $1=$recv($2)._at_ifAbsent_(each,(function(){
  4972. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4973. return $core.withContext(function($ctx3) {
  4974. //>>excludeEnd("ctx");
  4975. return $self._sampleNewValue();
  4976. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4977. $ctx3.sendIdx["sampleNewValue"]=1;
  4978. //>>excludeEnd("ctx");
  4979. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4980. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  4981. //>>excludeEnd("ctx");
  4982. }));
  4983. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4984. $ctx2.sendIdx["at:ifAbsent:"]=1;
  4985. //>>excludeEnd("ctx");
  4986. $3=$self._sampleNewValue();
  4987. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4988. $ctx2.sendIdx["sampleNewValue"]=2;
  4989. //>>excludeEnd("ctx");
  4990. return $self._assert_equals_($1,$3);
  4991. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4992. $ctx2.sendIdx["assert:equals:"]=1;
  4993. //>>excludeEnd("ctx");
  4994. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4995. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  4996. //>>excludeEnd("ctx");
  4997. }));
  4998. $self._samplesDo_((function(index,value){
  4999. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5000. return $core.withContext(function($ctx2) {
  5001. //>>excludeEnd("ctx");
  5002. return $self._assert_equals_($recv($self._collection())._at_ifAbsent_(index,(function(){
  5003. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5004. return $core.withContext(function($ctx3) {
  5005. //>>excludeEnd("ctx");
  5006. return $self._sampleNewValue();
  5007. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5008. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,4)});
  5009. //>>excludeEnd("ctx");
  5010. })),value);
  5011. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5012. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,3)});
  5013. //>>excludeEnd("ctx");
  5014. }));
  5015. return self;
  5016. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5017. }, function($ctx1) {$ctx1.fill(self,"testAtIfAbsent",{},$globals.IndexableCollectionTest)});
  5018. //>>excludeEnd("ctx");
  5019. },
  5020. //>>excludeStart("ide", pragmas.excludeIdeData);
  5021. args: [],
  5022. source: "testAtIfAbsent\x0a\x09self nonIndexesDo: [ :each |\x0a\x09\x09self assert: (self collection at: each ifAbsent: [ self sampleNewValue ]) equals: self sampleNewValue ].\x0a\x09self samplesDo: [ :index :value |\x0a\x09\x09self assert: (self collection at: index ifAbsent: [ self sampleNewValue ]) equals: value ].",
  5023. referencedClasses: [],
  5024. //>>excludeEnd("ide");
  5025. messageSends: ["nonIndexesDo:", "assert:equals:", "at:ifAbsent:", "collection", "sampleNewValue", "samplesDo:"]
  5026. }),
  5027. $globals.IndexableCollectionTest);
  5028. $core.addMethod(
  5029. $core.method({
  5030. selector: "testAtIfAbsentPut",
  5031. protocol: "tests",
  5032. fn: function (){
  5033. var self=this,$self=this;
  5034. var newCollection;
  5035. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5036. return $core.withContext(function($ctx1) {
  5037. //>>excludeEnd("ctx");
  5038. var $1;
  5039. newCollection=$self._collection();
  5040. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5041. $ctx1.sendIdx["collection"]=1;
  5042. //>>excludeEnd("ctx");
  5043. $self._samplesDo_((function(index,value){
  5044. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5045. return $core.withContext(function($ctx2) {
  5046. //>>excludeEnd("ctx");
  5047. $1=$recv(newCollection)._at_ifAbsentPut_(index,(function(){
  5048. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5049. return $core.withContext(function($ctx3) {
  5050. //>>excludeEnd("ctx");
  5051. return $self._sampleNewValue();
  5052. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5053. $ctx3.sendIdx["sampleNewValue"]=1;
  5054. //>>excludeEnd("ctx");
  5055. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5056. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  5057. //>>excludeEnd("ctx");
  5058. }));
  5059. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5060. $ctx2.sendIdx["at:ifAbsentPut:"]=1;
  5061. //>>excludeEnd("ctx");
  5062. return $self._assert_equals_($1,value);
  5063. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5064. $ctx2.sendIdx["assert:equals:"]=1;
  5065. //>>excludeEnd("ctx");
  5066. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5067. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,1)});
  5068. //>>excludeEnd("ctx");
  5069. }));
  5070. $self._assert_equals_(newCollection,$self._collection());
  5071. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5072. $ctx1.sendIdx["assert:equals:"]=2;
  5073. //>>excludeEnd("ctx");
  5074. $self._assert_equals_($recv(newCollection)._at_ifAbsentPut_($self._sampleNewIndex(),(function(){
  5075. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5076. return $core.withContext(function($ctx2) {
  5077. //>>excludeEnd("ctx");
  5078. return $self._sampleNewValue();
  5079. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5080. $ctx2.sendIdx["sampleNewValue"]=2;
  5081. //>>excludeEnd("ctx");
  5082. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5083. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  5084. //>>excludeEnd("ctx");
  5085. })),$self._sampleNewValue());
  5086. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5087. $ctx1.sendIdx["assert:equals:"]=3;
  5088. //>>excludeEnd("ctx");
  5089. $self._assert_equals_(newCollection,$self._collectionWithNewValue());
  5090. return self;
  5091. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5092. }, function($ctx1) {$ctx1.fill(self,"testAtIfAbsentPut",{newCollection:newCollection},$globals.IndexableCollectionTest)});
  5093. //>>excludeEnd("ctx");
  5094. },
  5095. //>>excludeStart("ide", pragmas.excludeIdeData);
  5096. args: [],
  5097. source: "testAtIfAbsentPut\x0a\x09| newCollection |\x0a\x09newCollection := self collection.\x0a\x09self samplesDo: [ :index :value |\x0a\x09\x09self assert: (newCollection at: index ifAbsentPut: [ self sampleNewValue ]) equals: value ].\x0a\x09self assert: newCollection equals: self collection.\x0a\x09self assert: (newCollection at: self sampleNewIndex ifAbsentPut: [ self sampleNewValue ]) equals: self sampleNewValue.\x0a\x09self assert: newCollection equals: self collectionWithNewValue",
  5098. referencedClasses: [],
  5099. //>>excludeEnd("ide");
  5100. messageSends: ["collection", "samplesDo:", "assert:equals:", "at:ifAbsentPut:", "sampleNewValue", "sampleNewIndex", "collectionWithNewValue"]
  5101. }),
  5102. $globals.IndexableCollectionTest);
  5103. $core.addMethod(
  5104. $core.method({
  5105. selector: "testAtIfPresent",
  5106. protocol: "tests",
  5107. fn: function (){
  5108. var self=this,$self=this;
  5109. var visited,sentinel;
  5110. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5111. return $core.withContext(function($ctx1) {
  5112. //>>excludeEnd("ctx");
  5113. var $2,$1,$4,$3;
  5114. sentinel=$recv($globals.Object)._new();
  5115. $self._nonIndexesDo_((function(each){
  5116. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5117. return $core.withContext(function($ctx2) {
  5118. //>>excludeEnd("ctx");
  5119. visited=nil;
  5120. visited;
  5121. $2=$self._collection();
  5122. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5123. $ctx2.sendIdx["collection"]=1;
  5124. //>>excludeEnd("ctx");
  5125. $1=$recv($2)._at_ifPresent_(each,(function(value1){
  5126. visited=value1;
  5127. visited;
  5128. return sentinel;
  5129. }));
  5130. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5131. $ctx2.sendIdx["at:ifPresent:"]=1;
  5132. //>>excludeEnd("ctx");
  5133. $self._assert_equals_($1,nil);
  5134. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5135. $ctx2.sendIdx["assert:equals:"]=1;
  5136. //>>excludeEnd("ctx");
  5137. return $self._assert_($recv(visited)._isNil());
  5138. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5139. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  5140. //>>excludeEnd("ctx");
  5141. }));
  5142. $self._samplesDo_((function(index,value){
  5143. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5144. return $core.withContext(function($ctx2) {
  5145. //>>excludeEnd("ctx");
  5146. visited=nil;
  5147. visited;
  5148. $4=$self._collection();
  5149. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5150. $ctx2.sendIdx["collection"]=2;
  5151. //>>excludeEnd("ctx");
  5152. $3=$recv($4)._at_ifPresent_(index,(function(value2){
  5153. visited=value2;
  5154. visited;
  5155. return sentinel;
  5156. }));
  5157. $self._assert_equals_($3,sentinel);
  5158. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5159. $ctx2.sendIdx["assert:equals:"]=2;
  5160. //>>excludeEnd("ctx");
  5161. return $self._assert_equals_(visited,$recv($self._collection())._at_(index));
  5162. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5163. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,3)});
  5164. //>>excludeEnd("ctx");
  5165. }));
  5166. return self;
  5167. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5168. }, function($ctx1) {$ctx1.fill(self,"testAtIfPresent",{visited:visited,sentinel:sentinel},$globals.IndexableCollectionTest)});
  5169. //>>excludeEnd("ctx");
  5170. },
  5171. //>>excludeStart("ide", pragmas.excludeIdeData);
  5172. args: [],
  5173. source: "testAtIfPresent\x0a\x09| visited sentinel |\x0a\x09sentinel := Object new.\x0a\x09self nonIndexesDo: [ :each |\x0a\x09\x09visited := nil.\x0a\x09\x09self assert: (self collection at: each ifPresent: [ :value1 | visited := value1. sentinel ]) equals: nil.\x0a\x09\x09self assert: visited isNil ].\x0a\x09self samplesDo: [ :index :value |\x0a\x09\x09visited := nil.\x0a\x09\x09self assert: (self collection at: index ifPresent: [ :value2 | visited := value2. sentinel ]) equals: sentinel.\x0a\x09\x09self assert: visited equals: (self collection at: index) ]",
  5174. referencedClasses: ["Object"],
  5175. //>>excludeEnd("ide");
  5176. messageSends: ["new", "nonIndexesDo:", "assert:equals:", "at:ifPresent:", "collection", "assert:", "isNil", "samplesDo:", "at:"]
  5177. }),
  5178. $globals.IndexableCollectionTest);
  5179. $core.addMethod(
  5180. $core.method({
  5181. selector: "testAtIfPresentIfAbsent",
  5182. protocol: "tests",
  5183. fn: function (){
  5184. var self=this,$self=this;
  5185. var visited,sentinel;
  5186. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5187. return $core.withContext(function($ctx1) {
  5188. //>>excludeEnd("ctx");
  5189. var $2,$1,$3,$5,$4;
  5190. sentinel=$recv($globals.Object)._new();
  5191. $self._nonIndexesDo_((function(each){
  5192. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5193. return $core.withContext(function($ctx2) {
  5194. //>>excludeEnd("ctx");
  5195. visited=nil;
  5196. visited;
  5197. $2=$self._collection();
  5198. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5199. $ctx2.sendIdx["collection"]=1;
  5200. //>>excludeEnd("ctx");
  5201. $1=$recv($2)._at_ifPresent_ifAbsent_(each,(function(value1){
  5202. visited=value1;
  5203. visited;
  5204. return sentinel;
  5205. }),(function(){
  5206. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5207. return $core.withContext(function($ctx3) {
  5208. //>>excludeEnd("ctx");
  5209. return $self._sampleNewValue();
  5210. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5211. $ctx3.sendIdx["sampleNewValue"]=1;
  5212. //>>excludeEnd("ctx");
  5213. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5214. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)});
  5215. //>>excludeEnd("ctx");
  5216. }));
  5217. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5218. $ctx2.sendIdx["at:ifPresent:ifAbsent:"]=1;
  5219. //>>excludeEnd("ctx");
  5220. $3=$self._sampleNewValue();
  5221. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5222. $ctx2.sendIdx["sampleNewValue"]=2;
  5223. //>>excludeEnd("ctx");
  5224. $self._assert_equals_($1,$3);
  5225. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5226. $ctx2.sendIdx["assert:equals:"]=1;
  5227. //>>excludeEnd("ctx");
  5228. return $self._assert_($recv(visited)._isNil());
  5229. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5230. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  5231. //>>excludeEnd("ctx");
  5232. }));
  5233. $self._samplesDo_((function(index,value){
  5234. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5235. return $core.withContext(function($ctx2) {
  5236. //>>excludeEnd("ctx");
  5237. visited=nil;
  5238. visited;
  5239. $5=$self._collection();
  5240. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5241. $ctx2.sendIdx["collection"]=2;
  5242. //>>excludeEnd("ctx");
  5243. $4=$recv($5)._at_ifPresent_ifAbsent_(index,(function(value2){
  5244. visited=value2;
  5245. visited;
  5246. return sentinel;
  5247. }),(function(){
  5248. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5249. return $core.withContext(function($ctx3) {
  5250. //>>excludeEnd("ctx");
  5251. return $self._sampleNewValue();
  5252. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5253. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,6)});
  5254. //>>excludeEnd("ctx");
  5255. }));
  5256. $self._assert_equals_($4,sentinel);
  5257. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5258. $ctx2.sendIdx["assert:equals:"]=2;
  5259. //>>excludeEnd("ctx");
  5260. return $self._assert_equals_(visited,$recv($self._collection())._at_(index));
  5261. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5262. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,4)});
  5263. //>>excludeEnd("ctx");
  5264. }));
  5265. return self;
  5266. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5267. }, function($ctx1) {$ctx1.fill(self,"testAtIfPresentIfAbsent",{visited:visited,sentinel:sentinel},$globals.IndexableCollectionTest)});
  5268. //>>excludeEnd("ctx");
  5269. },
  5270. //>>excludeStart("ide", pragmas.excludeIdeData);
  5271. args: [],
  5272. source: "testAtIfPresentIfAbsent\x0a\x09| visited sentinel |\x0a\x09sentinel := Object new.\x0a\x09self nonIndexesDo: [ :each |\x0a\x09\x09visited := nil.\x0a\x09\x09self assert: (self collection at: each ifPresent: [ :value1 | visited := value1. sentinel ] ifAbsent: [ self sampleNewValue ] ) equals: self sampleNewValue.\x0a\x09\x09self assert: visited isNil ].\x0a\x09self samplesDo: [ :index :value |\x0a\x09\x09visited := nil.\x0a\x09\x09self assert: (self collection at: index ifPresent: [ :value2 | visited := value2. sentinel ] ifAbsent: [ self sampleNewValue ]) equals: sentinel.\x0a\x09\x09self assert: visited equals: (self collection at: index) ]",
  5273. referencedClasses: ["Object"],
  5274. //>>excludeEnd("ide");
  5275. messageSends: ["new", "nonIndexesDo:", "assert:equals:", "at:ifPresent:ifAbsent:", "collection", "sampleNewValue", "assert:", "isNil", "samplesDo:", "at:"]
  5276. }),
  5277. $globals.IndexableCollectionTest);
  5278. $core.addMethod(
  5279. $core.method({
  5280. selector: "testAtPut",
  5281. protocol: "tests",
  5282. fn: function (){
  5283. var self=this,$self=this;
  5284. var newCollection;
  5285. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5286. return $core.withContext(function($ctx1) {
  5287. //>>excludeEnd("ctx");
  5288. newCollection=$self._collection();
  5289. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5290. $ctx1.sendIdx["collection"]=1;
  5291. //>>excludeEnd("ctx");
  5292. $self._samplesDo_((function(index,value){
  5293. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5294. return $core.withContext(function($ctx2) {
  5295. //>>excludeEnd("ctx");
  5296. return $recv(newCollection)._at_put_(index,value);
  5297. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5298. $ctx2.sendIdx["at:put:"]=1;
  5299. //>>excludeEnd("ctx");
  5300. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5301. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,1)});
  5302. //>>excludeEnd("ctx");
  5303. }));
  5304. $self._assert_equals_(newCollection,$self._collection());
  5305. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5306. $ctx1.sendIdx["assert:equals:"]=1;
  5307. //>>excludeEnd("ctx");
  5308. $recv(newCollection)._at_put_($self._sampleNewIndex(),$self._sampleNewValue());
  5309. $self._assert_equals_(newCollection,$self._collectionWithNewValue());
  5310. return self;
  5311. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5312. }, function($ctx1) {$ctx1.fill(self,"testAtPut",{newCollection:newCollection},$globals.IndexableCollectionTest)});
  5313. //>>excludeEnd("ctx");
  5314. },
  5315. //>>excludeStart("ide", pragmas.excludeIdeData);
  5316. args: [],
  5317. source: "testAtPut\x0a\x09| newCollection |\x0a\x09newCollection := self collection.\x0a\x09self samplesDo: [ :index :value |\x0a\x09\x09newCollection at: index put: value ].\x0a\x09self assert: newCollection equals: self collection.\x0a\x09newCollection at: self sampleNewIndex put: self sampleNewValue.\x0a\x09self assert: newCollection equals: self collectionWithNewValue",
  5318. referencedClasses: [],
  5319. //>>excludeEnd("ide");
  5320. messageSends: ["collection", "samplesDo:", "at:put:", "assert:equals:", "sampleNewIndex", "sampleNewValue", "collectionWithNewValue"]
  5321. }),
  5322. $globals.IndexableCollectionTest);
  5323. $core.addMethod(
  5324. $core.method({
  5325. selector: "testIndexOf",
  5326. protocol: "tests",
  5327. fn: function (){
  5328. var self=this,$self=this;
  5329. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5330. return $core.withContext(function($ctx1) {
  5331. //>>excludeEnd("ctx");
  5332. var $1;
  5333. $self._should_raise_((function(){
  5334. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5335. return $core.withContext(function($ctx2) {
  5336. //>>excludeEnd("ctx");
  5337. $1=$self._collection();
  5338. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5339. $ctx2.sendIdx["collection"]=1;
  5340. //>>excludeEnd("ctx");
  5341. return $recv($1)._indexOf_($self._sampleNewValue());
  5342. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5343. $ctx2.sendIdx["indexOf:"]=1;
  5344. //>>excludeEnd("ctx");
  5345. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5346. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  5347. //>>excludeEnd("ctx");
  5348. }),$globals.Error);
  5349. $self._samplesDo_((function(index,value){
  5350. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5351. return $core.withContext(function($ctx2) {
  5352. //>>excludeEnd("ctx");
  5353. return $self._assert_equals_($recv($self._collection())._indexOf_(value),index);
  5354. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5355. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,2)});
  5356. //>>excludeEnd("ctx");
  5357. }));
  5358. return self;
  5359. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5360. }, function($ctx1) {$ctx1.fill(self,"testIndexOf",{},$globals.IndexableCollectionTest)});
  5361. //>>excludeEnd("ctx");
  5362. },
  5363. //>>excludeStart("ide", pragmas.excludeIdeData);
  5364. args: [],
  5365. source: "testIndexOf\x0a\x09self should: [ self collection indexOf: self sampleNewValue ] raise: Error.\x0a\x09self samplesDo: [ :index :value |\x0a\x09\x09self assert: (self collection indexOf: value) equals: index ]",
  5366. referencedClasses: ["Error"],
  5367. //>>excludeEnd("ide");
  5368. messageSends: ["should:raise:", "indexOf:", "collection", "sampleNewValue", "samplesDo:", "assert:equals:"]
  5369. }),
  5370. $globals.IndexableCollectionTest);
  5371. $core.addMethod(
  5372. $core.method({
  5373. selector: "testIndexOfWithNull",
  5374. protocol: "tests",
  5375. fn: function (){
  5376. var self=this,$self=this;
  5377. var jsNull;
  5378. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5379. return $core.withContext(function($ctx1) {
  5380. //>>excludeEnd("ctx");
  5381. var $2,$1;
  5382. jsNull=$recv($globals.JSON)._parse_("null");
  5383. $self._samplesDo_((function(index,value){
  5384. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5385. return $core.withContext(function($ctx2) {
  5386. //>>excludeEnd("ctx");
  5387. $2=$self._collection();
  5388. $recv($2)._at_put_(index,jsNull);
  5389. $1=$recv($2)._indexOf_(jsNull);
  5390. return $self._assert_equals_($1,index);
  5391. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5392. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,1)});
  5393. //>>excludeEnd("ctx");
  5394. }));
  5395. return self;
  5396. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5397. }, function($ctx1) {$ctx1.fill(self,"testIndexOfWithNull",{jsNull:jsNull},$globals.IndexableCollectionTest)});
  5398. //>>excludeEnd("ctx");
  5399. },
  5400. //>>excludeStart("ide", pragmas.excludeIdeData);
  5401. args: [],
  5402. source: "testIndexOfWithNull\x0a\x09| jsNull |\x0a\x09jsNull := JSON parse: 'null'.\x0a\x09self samplesDo: [ :index :value |\x0a\x09\x09self assert: (self collection at: index put: jsNull; indexOf: jsNull) equals: index ]",
  5403. referencedClasses: ["JSON"],
  5404. //>>excludeEnd("ide");
  5405. messageSends: ["parse:", "samplesDo:", "assert:equals:", "at:put:", "collection", "indexOf:"]
  5406. }),
  5407. $globals.IndexableCollectionTest);
  5408. $core.addMethod(
  5409. $core.method({
  5410. selector: "testWithIndexDo",
  5411. protocol: "tests",
  5412. fn: function (){
  5413. var self=this,$self=this;
  5414. var collection;
  5415. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5416. return $core.withContext(function($ctx1) {
  5417. //>>excludeEnd("ctx");
  5418. collection=$self._collection();
  5419. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5420. $ctx1.sendIdx["collection"]=1;
  5421. //>>excludeEnd("ctx");
  5422. $recv($self._collection())._withIndexDo_((function(each,index){
  5423. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5424. return $core.withContext(function($ctx2) {
  5425. //>>excludeEnd("ctx");
  5426. return $self._assert_equals_($recv(collection)._at_(index),each);
  5427. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5428. }, function($ctx2) {$ctx2.fillBlock({each:each,index:index},$ctx1,1)});
  5429. //>>excludeEnd("ctx");
  5430. }));
  5431. return self;
  5432. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5433. }, function($ctx1) {$ctx1.fill(self,"testWithIndexDo",{collection:collection},$globals.IndexableCollectionTest)});
  5434. //>>excludeEnd("ctx");
  5435. },
  5436. //>>excludeStart("ide", pragmas.excludeIdeData);
  5437. args: [],
  5438. source: "testWithIndexDo\x0a\x09| collection |\x0a\x09collection := self collection.\x0a\x09\x0a\x09self collection withIndexDo: [ :each :index |\x0a\x09\x09self assert: (collection at: index) equals: each ]",
  5439. referencedClasses: [],
  5440. //>>excludeEnd("ide");
  5441. messageSends: ["collection", "withIndexDo:", "assert:equals:", "at:"]
  5442. }),
  5443. $globals.IndexableCollectionTest);
  5444. $core.addClass("AssociativeCollectionTest", $globals.IndexableCollectionTest, [], "Kernel-Tests");
  5445. $core.addMethod(
  5446. $core.method({
  5447. selector: "collectionKeys",
  5448. protocol: "fixture",
  5449. fn: function (){
  5450. var self=this,$self=this;
  5451. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5452. return $core.withContext(function($ctx1) {
  5453. //>>excludeEnd("ctx");
  5454. $self._subclassResponsibility();
  5455. return self;
  5456. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5457. }, function($ctx1) {$ctx1.fill(self,"collectionKeys",{},$globals.AssociativeCollectionTest)});
  5458. //>>excludeEnd("ctx");
  5459. },
  5460. //>>excludeStart("ide", pragmas.excludeIdeData);
  5461. args: [],
  5462. source: "collectionKeys\x0a\x09self subclassResponsibility",
  5463. referencedClasses: [],
  5464. //>>excludeEnd("ide");
  5465. messageSends: ["subclassResponsibility"]
  5466. }),
  5467. $globals.AssociativeCollectionTest);
  5468. $core.addMethod(
  5469. $core.method({
  5470. selector: "collectionValues",
  5471. protocol: "fixture",
  5472. fn: function (){
  5473. var self=this,$self=this;
  5474. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5475. return $core.withContext(function($ctx1) {
  5476. //>>excludeEnd("ctx");
  5477. $self._subclassResponsibility();
  5478. return self;
  5479. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5480. }, function($ctx1) {$ctx1.fill(self,"collectionValues",{},$globals.AssociativeCollectionTest)});
  5481. //>>excludeEnd("ctx");
  5482. },
  5483. //>>excludeStart("ide", pragmas.excludeIdeData);
  5484. args: [],
  5485. source: "collectionValues\x0a\x09self subclassResponsibility",
  5486. referencedClasses: [],
  5487. //>>excludeEnd("ide");
  5488. messageSends: ["subclassResponsibility"]
  5489. }),
  5490. $globals.AssociativeCollectionTest);
  5491. $core.addMethod(
  5492. $core.method({
  5493. selector: "nonIndexesDo:",
  5494. protocol: "fixture",
  5495. fn: function (aBlock){
  5496. var self=this,$self=this;
  5497. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5498. return $core.withContext(function($ctx1) {
  5499. //>>excludeEnd("ctx");
  5500. $recv(aBlock)._value_((5));
  5501. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5502. $ctx1.sendIdx["value:"]=1;
  5503. //>>excludeEnd("ctx");
  5504. $recv(aBlock)._value_((function(){
  5505. }));
  5506. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5507. $ctx1.sendIdx["value:"]=2;
  5508. //>>excludeEnd("ctx");
  5509. $recv(aBlock)._value_($recv($globals.Object)._new());
  5510. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5511. $ctx1.sendIdx["value:"]=3;
  5512. //>>excludeEnd("ctx");
  5513. $recv(aBlock)._value_("z");
  5514. return self;
  5515. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5516. }, function($ctx1) {$ctx1.fill(self,"nonIndexesDo:",{aBlock:aBlock},$globals.AssociativeCollectionTest)});
  5517. //>>excludeEnd("ctx");
  5518. },
  5519. //>>excludeStart("ide", pragmas.excludeIdeData);
  5520. args: ["aBlock"],
  5521. source: "nonIndexesDo: aBlock\x0a\x09aBlock value: 5.\x0a\x09aBlock value: [].\x0a\x09aBlock value: Object new.\x0a\x09aBlock value: 'z'",
  5522. referencedClasses: ["Object"],
  5523. //>>excludeEnd("ide");
  5524. messageSends: ["value:", "new"]
  5525. }),
  5526. $globals.AssociativeCollectionTest);
  5527. $core.addMethod(
  5528. $core.method({
  5529. selector: "sampleNewIndex",
  5530. protocol: "fixture",
  5531. fn: function (){
  5532. var self=this,$self=this;
  5533. return "new";
  5534. },
  5535. //>>excludeStart("ide", pragmas.excludeIdeData);
  5536. args: [],
  5537. source: "sampleNewIndex\x0a\x09^ 'new'",
  5538. referencedClasses: [],
  5539. //>>excludeEnd("ide");
  5540. messageSends: []
  5541. }),
  5542. $globals.AssociativeCollectionTest);
  5543. $core.addMethod(
  5544. $core.method({
  5545. selector: "samplesDo:",
  5546. protocol: "fixture",
  5547. fn: function (aBlock){
  5548. var self=this,$self=this;
  5549. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5550. return $core.withContext(function($ctx1) {
  5551. //>>excludeEnd("ctx");
  5552. $recv(aBlock)._value_value_("a",(2));
  5553. return self;
  5554. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5555. }, function($ctx1) {$ctx1.fill(self,"samplesDo:",{aBlock:aBlock},$globals.AssociativeCollectionTest)});
  5556. //>>excludeEnd("ctx");
  5557. },
  5558. //>>excludeStart("ide", pragmas.excludeIdeData);
  5559. args: ["aBlock"],
  5560. source: "samplesDo: aBlock\x0a\x09aBlock value: 'a' value: 2",
  5561. referencedClasses: [],
  5562. //>>excludeEnd("ide");
  5563. messageSends: ["value:value:"]
  5564. }),
  5565. $globals.AssociativeCollectionTest);
  5566. $core.addMethod(
  5567. $core.method({
  5568. selector: "testAddAll",
  5569. protocol: "tests",
  5570. fn: function (){
  5571. var self=this,$self=this;
  5572. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5573. return $core.withContext(function($ctx1) {
  5574. //>>excludeEnd("ctx");
  5575. var $2,$3,$4,$1,$5,$7,$8,$9,$6,$10,$12,$11;
  5576. (
  5577. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5578. $ctx1.supercall = true,
  5579. //>>excludeEnd("ctx");
  5580. ($globals.AssociativeCollectionTest.superclass||$boot.nilAsClass).fn.prototype._testAddAll.apply($self, []));
  5581. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5582. $ctx1.supercall = false;
  5583. //>>excludeEnd("ctx");;
  5584. $2=$self._collection();
  5585. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5586. $ctx1.sendIdx["collection"]=1;
  5587. //>>excludeEnd("ctx");
  5588. $3=$self._collection();
  5589. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5590. $ctx1.sendIdx["collection"]=2;
  5591. //>>excludeEnd("ctx");
  5592. $recv($2)._addAll_($3);
  5593. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5594. $ctx1.sendIdx["addAll:"]=1;
  5595. //>>excludeEnd("ctx");
  5596. $4=$recv($2)._yourself();
  5597. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5598. $ctx1.sendIdx["yourself"]=1;
  5599. //>>excludeEnd("ctx");
  5600. $1=$4;
  5601. $5=$self._collection();
  5602. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5603. $ctx1.sendIdx["collection"]=3;
  5604. //>>excludeEnd("ctx");
  5605. $self._assert_equals_($1,$5);
  5606. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5607. $ctx1.sendIdx["assert:equals:"]=1;
  5608. //>>excludeEnd("ctx");
  5609. $7=$self._collection();
  5610. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5611. $ctx1.sendIdx["collection"]=4;
  5612. //>>excludeEnd("ctx");
  5613. $8=$self._collectionWithNewValue();
  5614. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5615. $ctx1.sendIdx["collectionWithNewValue"]=1;
  5616. //>>excludeEnd("ctx");
  5617. $recv($7)._addAll_($8);
  5618. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5619. $ctx1.sendIdx["addAll:"]=2;
  5620. //>>excludeEnd("ctx");
  5621. $9=$recv($7)._yourself();
  5622. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5623. $ctx1.sendIdx["yourself"]=2;
  5624. //>>excludeEnd("ctx");
  5625. $6=$9;
  5626. $10=$self._collectionWithNewValue();
  5627. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5628. $ctx1.sendIdx["collectionWithNewValue"]=2;
  5629. //>>excludeEnd("ctx");
  5630. $self._assert_equals_($6,$10);
  5631. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5632. $ctx1.sendIdx["assert:equals:"]=2;
  5633. //>>excludeEnd("ctx");
  5634. $12=$self._collectionWithNewValue();
  5635. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5636. $ctx1.sendIdx["collectionWithNewValue"]=3;
  5637. //>>excludeEnd("ctx");
  5638. $recv($12)._addAll_($self._collection());
  5639. $11=$recv($12)._yourself();
  5640. $self._assert_equals_($11,$self._collectionWithNewValue());
  5641. return self;
  5642. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5643. }, function($ctx1) {$ctx1.fill(self,"testAddAll",{},$globals.AssociativeCollectionTest)});
  5644. //>>excludeEnd("ctx");
  5645. },
  5646. //>>excludeStart("ide", pragmas.excludeIdeData);
  5647. args: [],
  5648. source: "testAddAll\x0a\x09super testAddAll.\x0a\x09self assert: (self collection addAll: self collection; yourself) equals: self collection.\x0a\x09self assert: (self collection addAll: self collectionWithNewValue; yourself) equals: self collectionWithNewValue.\x0a\x09self assert: (self collectionWithNewValue addAll: self collection; yourself) equals: self collectionWithNewValue",
  5649. referencedClasses: [],
  5650. //>>excludeEnd("ide");
  5651. messageSends: ["testAddAll", "assert:equals:", "addAll:", "collection", "yourself", "collectionWithNewValue"]
  5652. }),
  5653. $globals.AssociativeCollectionTest);
  5654. $core.addMethod(
  5655. $core.method({
  5656. selector: "testAsDictionary",
  5657. protocol: "tests",
  5658. fn: function (){
  5659. var self=this,$self=this;
  5660. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5661. return $core.withContext(function($ctx1) {
  5662. //>>excludeEnd("ctx");
  5663. $self._assert_($recv($recv($recv($self._collectionClass())._new())._asDictionary())._isMemberOf_($globals.Dictionary));
  5664. return self;
  5665. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5666. }, function($ctx1) {$ctx1.fill(self,"testAsDictionary",{},$globals.AssociativeCollectionTest)});
  5667. //>>excludeEnd("ctx");
  5668. },
  5669. //>>excludeStart("ide", pragmas.excludeIdeData);
  5670. args: [],
  5671. source: "testAsDictionary\x0aself assert: ( self collectionClass new asDictionary isMemberOf: Dictionary ).",
  5672. referencedClasses: ["Dictionary"],
  5673. //>>excludeEnd("ide");
  5674. messageSends: ["assert:", "isMemberOf:", "asDictionary", "new", "collectionClass"]
  5675. }),
  5676. $globals.AssociativeCollectionTest);
  5677. $core.addMethod(
  5678. $core.method({
  5679. selector: "testAsHashedCollection",
  5680. protocol: "tests",
  5681. fn: function (){
  5682. var self=this,$self=this;
  5683. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5684. return $core.withContext(function($ctx1) {
  5685. //>>excludeEnd("ctx");
  5686. $self._assert_($recv($recv($recv($self._collectionClass())._new())._asHashedCollection())._isMemberOf_($globals.HashedCollection));
  5687. return self;
  5688. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5689. }, function($ctx1) {$ctx1.fill(self,"testAsHashedCollection",{},$globals.AssociativeCollectionTest)});
  5690. //>>excludeEnd("ctx");
  5691. },
  5692. //>>excludeStart("ide", pragmas.excludeIdeData);
  5693. args: [],
  5694. source: "testAsHashedCollection\x0aself assert: ( self collectionClass new asHashedCollection isMemberOf: HashedCollection ).",
  5695. referencedClasses: ["HashedCollection"],
  5696. //>>excludeEnd("ide");
  5697. messageSends: ["assert:", "isMemberOf:", "asHashedCollection", "new", "collectionClass"]
  5698. }),
  5699. $globals.AssociativeCollectionTest);
  5700. $core.addMethod(
  5701. $core.method({
  5702. selector: "testComma",
  5703. protocol: "tests",
  5704. fn: function (){
  5705. var self=this,$self=this;
  5706. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5707. return $core.withContext(function($ctx1) {
  5708. //>>excludeEnd("ctx");
  5709. var $2,$3,$1,$4,$6,$7,$5,$8,$10,$9;
  5710. (
  5711. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5712. $ctx1.supercall = true,
  5713. //>>excludeEnd("ctx");
  5714. ($globals.AssociativeCollectionTest.superclass||$boot.nilAsClass).fn.prototype._testComma.apply($self, []));
  5715. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5716. $ctx1.supercall = false;
  5717. //>>excludeEnd("ctx");;
  5718. $2=$self._collection();
  5719. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5720. $ctx1.sendIdx["collection"]=1;
  5721. //>>excludeEnd("ctx");
  5722. $3=$self._collection();
  5723. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5724. $ctx1.sendIdx["collection"]=2;
  5725. //>>excludeEnd("ctx");
  5726. $1=$recv($2).__comma($3);
  5727. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5728. $ctx1.sendIdx[","]=1;
  5729. //>>excludeEnd("ctx");
  5730. $4=$self._collection();
  5731. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5732. $ctx1.sendIdx["collection"]=3;
  5733. //>>excludeEnd("ctx");
  5734. $self._assert_equals_($1,$4);
  5735. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5736. $ctx1.sendIdx["assert:equals:"]=1;
  5737. //>>excludeEnd("ctx");
  5738. $6=$self._collection();
  5739. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5740. $ctx1.sendIdx["collection"]=4;
  5741. //>>excludeEnd("ctx");
  5742. $7=$self._collectionWithNewValue();
  5743. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5744. $ctx1.sendIdx["collectionWithNewValue"]=1;
  5745. //>>excludeEnd("ctx");
  5746. $5=$recv($6).__comma($7);
  5747. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5748. $ctx1.sendIdx[","]=2;
  5749. //>>excludeEnd("ctx");
  5750. $8=$self._collectionWithNewValue();
  5751. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5752. $ctx1.sendIdx["collectionWithNewValue"]=2;
  5753. //>>excludeEnd("ctx");
  5754. $self._assert_equals_($5,$8);
  5755. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5756. $ctx1.sendIdx["assert:equals:"]=2;
  5757. //>>excludeEnd("ctx");
  5758. $10=$self._collectionWithNewValue();
  5759. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5760. $ctx1.sendIdx["collectionWithNewValue"]=3;
  5761. //>>excludeEnd("ctx");
  5762. $9=$recv($10).__comma($self._collection());
  5763. $self._assert_equals_($9,$self._collectionWithNewValue());
  5764. return self;
  5765. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5766. }, function($ctx1) {$ctx1.fill(self,"testComma",{},$globals.AssociativeCollectionTest)});
  5767. //>>excludeEnd("ctx");
  5768. },
  5769. //>>excludeStart("ide", pragmas.excludeIdeData);
  5770. args: [],
  5771. source: "testComma\x0a\x09super testComma.\x0a\x09self assert: self collection, self collection equals: self collection.\x0a\x09self assert: self collection, self collectionWithNewValue equals: self collectionWithNewValue.\x0a\x09self assert: self collectionWithNewValue, self collection equals: self collectionWithNewValue",
  5772. referencedClasses: [],
  5773. //>>excludeEnd("ide");
  5774. messageSends: ["testComma", "assert:equals:", ",", "collection", "collectionWithNewValue"]
  5775. }),
  5776. $globals.AssociativeCollectionTest);
  5777. $core.addMethod(
  5778. $core.method({
  5779. selector: "testFrom",
  5780. protocol: "tests",
  5781. fn: function (){
  5782. var self=this,$self=this;
  5783. var associations;
  5784. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5785. return $core.withContext(function($ctx1) {
  5786. //>>excludeEnd("ctx");
  5787. var $1;
  5788. $1="a".__minus_gt((1));
  5789. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5790. $ctx1.sendIdx["->"]=1;
  5791. //>>excludeEnd("ctx");
  5792. associations=[$1,"b".__minus_gt((2))];
  5793. $self._assertSameContents_as_($recv($recv($self._class())._collectionClass())._from_(associations),$globals.HashedCollection._newFromPairs_(["a",(1),"b",(2)]));
  5794. return self;
  5795. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5796. }, function($ctx1) {$ctx1.fill(self,"testFrom",{associations:associations},$globals.AssociativeCollectionTest)});
  5797. //>>excludeEnd("ctx");
  5798. },
  5799. //>>excludeStart("ide", pragmas.excludeIdeData);
  5800. args: [],
  5801. source: "testFrom\x0a\x22Accept a collection of associations.\x22\x0a| associations |\x0aassociations := { 'a' -> 1. 'b' -> 2 }.\x0aself assertSameContents: ( self class collectionClass from: associations ) as: #{ 'a' -> 1. 'b' -> 2 }.",
  5802. referencedClasses: [],
  5803. //>>excludeEnd("ide");
  5804. messageSends: ["->", "assertSameContents:as:", "from:", "collectionClass", "class"]
  5805. }),
  5806. $globals.AssociativeCollectionTest);
  5807. $core.addMethod(
  5808. $core.method({
  5809. selector: "testKeys",
  5810. protocol: "tests",
  5811. fn: function (){
  5812. var self=this,$self=this;
  5813. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5814. return $core.withContext(function($ctx1) {
  5815. //>>excludeEnd("ctx");
  5816. var $2,$1,$3,$4;
  5817. $2=$recv($recv($self._collectionClass())._new())._keys();
  5818. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5819. $ctx1.sendIdx["keys"]=1;
  5820. //>>excludeEnd("ctx");
  5821. $1=$recv($2)._isEmpty();
  5822. $self._assert_($1);
  5823. $3=$recv($self._collection())._keys();
  5824. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5825. $ctx1.sendIdx["keys"]=2;
  5826. //>>excludeEnd("ctx");
  5827. $4=$self._collectionKeys();
  5828. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5829. $ctx1.sendIdx["collectionKeys"]=1;
  5830. //>>excludeEnd("ctx");
  5831. $self._assertSameContents_as_($3,$4);
  5832. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5833. $ctx1.sendIdx["assertSameContents:as:"]=1;
  5834. //>>excludeEnd("ctx");
  5835. $self._assertSameContents_as_($recv($self._collectionWithNewValue())._keys(),$recv($self._collectionKeys()).__comma([$self._sampleNewIndex()]));
  5836. return self;
  5837. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5838. }, function($ctx1) {$ctx1.fill(self,"testKeys",{},$globals.AssociativeCollectionTest)});
  5839. //>>excludeEnd("ctx");
  5840. },
  5841. //>>excludeStart("ide", pragmas.excludeIdeData);
  5842. args: [],
  5843. source: "testKeys\x0a\x09self assert:self collectionClass new keys isEmpty.\x0a\x09self assertSameContents:self collection keys as: self collectionKeys.\x0a\x09self assertSameContents:self collectionWithNewValue keys as: self collectionKeys, { self sampleNewIndex }",
  5844. referencedClasses: [],
  5845. //>>excludeEnd("ide");
  5846. messageSends: ["assert:", "isEmpty", "keys", "new", "collectionClass", "assertSameContents:as:", "collection", "collectionKeys", "collectionWithNewValue", ",", "sampleNewIndex"]
  5847. }),
  5848. $globals.AssociativeCollectionTest);
  5849. $core.addMethod(
  5850. $core.method({
  5851. selector: "testNewFromPairs",
  5852. protocol: "tests",
  5853. fn: function (){
  5854. var self=this,$self=this;
  5855. var flattenedAssociations;
  5856. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5857. return $core.withContext(function($ctx1) {
  5858. //>>excludeEnd("ctx");
  5859. flattenedAssociations=["a",(1),"b",(2)];
  5860. $self._assertSameContents_as_($recv($recv($self._class())._collectionClass())._newFromPairs_(flattenedAssociations),$globals.HashedCollection._newFromPairs_(["a",(1),"b",(2)]));
  5861. return self;
  5862. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5863. }, function($ctx1) {$ctx1.fill(self,"testNewFromPairs",{flattenedAssociations:flattenedAssociations},$globals.AssociativeCollectionTest)});
  5864. //>>excludeEnd("ctx");
  5865. },
  5866. //>>excludeStart("ide", pragmas.excludeIdeData);
  5867. args: [],
  5868. source: "testNewFromPairs\x0a\x22Accept an array in which all odd indexes are keys and evens are values.\x22\x0a| flattenedAssociations |\x0aflattenedAssociations := { 'a'. 1. 'b'. 2 }.\x0aself assertSameContents: ( self class collectionClass newFromPairs: flattenedAssociations ) as: #{ 'a' -> 1. 'b' -> 2 }.",
  5869. referencedClasses: [],
  5870. //>>excludeEnd("ide");
  5871. messageSends: ["assertSameContents:as:", "newFromPairs:", "collectionClass", "class"]
  5872. }),
  5873. $globals.AssociativeCollectionTest);
  5874. $core.addMethod(
  5875. $core.method({
  5876. selector: "testPrintString",
  5877. protocol: "tests",
  5878. fn: function (){
  5879. var self=this,$self=this;
  5880. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5881. return $core.withContext(function($ctx1) {
  5882. //>>excludeEnd("ctx");
  5883. var $3,$2,$1,$4;
  5884. $3=$self._collectionClass();
  5885. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5886. $ctx1.sendIdx["collectionClass"]=1;
  5887. //>>excludeEnd("ctx");
  5888. $2=$recv($3)._new();
  5889. $recv($2)._at_put_("firstname","James");
  5890. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5891. $ctx1.sendIdx["at:put:"]=1;
  5892. //>>excludeEnd("ctx");
  5893. $recv($2)._at_put_("lastname","Bond");
  5894. $1=$recv($2)._printString();
  5895. $4=$recv("a ".__comma($recv($self._collectionClass())._name())).__comma(" ('firstname' -> 'James' , 'lastname' -> 'Bond')");
  5896. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5897. $ctx1.sendIdx[","]=1;
  5898. //>>excludeEnd("ctx");
  5899. $self._assert_equals_($1,$4);
  5900. return self;
  5901. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5902. }, function($ctx1) {$ctx1.fill(self,"testPrintString",{},$globals.AssociativeCollectionTest)});
  5903. //>>excludeEnd("ctx");
  5904. },
  5905. //>>excludeStart("ide", pragmas.excludeIdeData);
  5906. args: [],
  5907. source: "testPrintString\x0a\x09self\x0a\x09\x09assert: (self collectionClass new\x0a\x09\x09\x09\x09\x09\x09\x09at:'firstname' put: 'James';\x0a\x09\x09\x09\x09\x09\x09\x09at:'lastname' put: 'Bond';\x0a\x09\x09\x09\x09\x09\x09\x09printString)\x0a\x09\x09equals: 'a ', self collectionClass name, ' (''firstname'' -> ''James'' , ''lastname'' -> ''Bond'')'",
  5908. referencedClasses: [],
  5909. //>>excludeEnd("ide");
  5910. messageSends: ["assert:equals:", "at:put:", "new", "collectionClass", "printString", ",", "name"]
  5911. }),
  5912. $globals.AssociativeCollectionTest);
  5913. $core.addMethod(
  5914. $core.method({
  5915. selector: "testRemoveKey",
  5916. protocol: "tests",
  5917. fn: function (){
  5918. var self=this,$self=this;
  5919. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5920. return $core.withContext(function($ctx1) {
  5921. //>>excludeEnd("ctx");
  5922. var $1,$2,$3,$5,$6,$4,$8,$7;
  5923. $self._nonIndexesDo_((function(each){
  5924. var collection;
  5925. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5926. return $core.withContext(function($ctx2) {
  5927. //>>excludeEnd("ctx");
  5928. collection=$self._collection();
  5929. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5930. $ctx2.sendIdx["collection"]=1;
  5931. //>>excludeEnd("ctx");
  5932. collection;
  5933. $self._should_raise_((function(){
  5934. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5935. return $core.withContext(function($ctx3) {
  5936. //>>excludeEnd("ctx");
  5937. return $recv(collection)._removeKey_(each);
  5938. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5939. $ctx3.sendIdx["removeKey:"]=1;
  5940. //>>excludeEnd("ctx");
  5941. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5942. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  5943. //>>excludeEnd("ctx");
  5944. }),$globals.Error);
  5945. $1=collection;
  5946. $2=$self._collection();
  5947. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5948. $ctx2.sendIdx["collection"]=2;
  5949. //>>excludeEnd("ctx");
  5950. return $self._assert_equals_($1,$2);
  5951. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5952. $ctx2.sendIdx["assert:equals:"]=1;
  5953. //>>excludeEnd("ctx");
  5954. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5955. }, function($ctx2) {$ctx2.fillBlock({each:each,collection:collection},$ctx1,1)});
  5956. //>>excludeEnd("ctx");
  5957. }));
  5958. $self._samplesDo_((function(index,value){
  5959. var collection;
  5960. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5961. return $core.withContext(function($ctx2) {
  5962. //>>excludeEnd("ctx");
  5963. collection=$self._collection();
  5964. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5965. $ctx2.sendIdx["collection"]=3;
  5966. //>>excludeEnd("ctx");
  5967. collection;
  5968. $3=$recv(collection)._removeKey_(index);
  5969. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5970. $ctx2.sendIdx["removeKey:"]=2;
  5971. //>>excludeEnd("ctx");
  5972. $self._assert_equals_($3,value);
  5973. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5974. $ctx2.sendIdx["assert:equals:"]=2;
  5975. //>>excludeEnd("ctx");
  5976. $5=collection;
  5977. $6=$self._collection();
  5978. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5979. $ctx2.sendIdx["collection"]=4;
  5980. //>>excludeEnd("ctx");
  5981. $4=$recv($5).__eq($6);
  5982. return $self._deny_($4);
  5983. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5984. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value,collection:collection},$ctx1,3)});
  5985. //>>excludeEnd("ctx");
  5986. }));
  5987. $8=$self._collectionWithNewValue();
  5988. $recv($8)._removeKey_($self._sampleNewIndex());
  5989. $7=$recv($8)._yourself();
  5990. $self._assert_equals_($7,$self._collection());
  5991. return self;
  5992. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5993. }, function($ctx1) {$ctx1.fill(self,"testRemoveKey",{},$globals.AssociativeCollectionTest)});
  5994. //>>excludeEnd("ctx");
  5995. },
  5996. //>>excludeStart("ide", pragmas.excludeIdeData);
  5997. args: [],
  5998. source: "testRemoveKey\x0a\x09self nonIndexesDo: [ :each |\x0a\x09\x09| collection |\x0a\x09\x09collection := self collection.\x0a\x09\x09self should: [ collection removeKey: each ] raise: Error.\x0a\x09\x09self assert: collection equals: self collection ].\x0a\x09self samplesDo: [ :index :value |\x0a\x09\x09| collection |\x0a\x09\x09collection := self collection.\x0a\x09\x09self assert: (collection removeKey: index) equals: value.\x0a\x09\x09self deny: collection = self collection ].\x0a\x09self\x0a\x09\x09assert: (self collectionWithNewValue removeKey: self sampleNewIndex; yourself)\x0a\x09\x09equals: self collection",
  5999. referencedClasses: ["Error"],
  6000. //>>excludeEnd("ide");
  6001. messageSends: ["nonIndexesDo:", "collection", "should:raise:", "removeKey:", "assert:equals:", "samplesDo:", "deny:", "=", "collectionWithNewValue", "sampleNewIndex", "yourself"]
  6002. }),
  6003. $globals.AssociativeCollectionTest);
  6004. $core.addMethod(
  6005. $core.method({
  6006. selector: "testRemoveKeyIfAbsent",
  6007. protocol: "tests",
  6008. fn: function (){
  6009. var self=this,$self=this;
  6010. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6011. return $core.withContext(function($ctx1) {
  6012. //>>excludeEnd("ctx");
  6013. var $1,$2,$3,$4,$5,$7,$8,$6,$10,$9;
  6014. $self._nonIndexesDo_((function(each){
  6015. var collection;
  6016. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6017. return $core.withContext(function($ctx2) {
  6018. //>>excludeEnd("ctx");
  6019. collection=$self._collection();
  6020. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6021. $ctx2.sendIdx["collection"]=1;
  6022. //>>excludeEnd("ctx");
  6023. collection;
  6024. $1=$recv(collection)._removeKey_ifAbsent_(each,(function(){
  6025. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6026. return $core.withContext(function($ctx3) {
  6027. //>>excludeEnd("ctx");
  6028. return $self._sampleNewValue();
  6029. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6030. $ctx3.sendIdx["sampleNewValue"]=1;
  6031. //>>excludeEnd("ctx");
  6032. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6033. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  6034. //>>excludeEnd("ctx");
  6035. }));
  6036. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6037. $ctx2.sendIdx["removeKey:ifAbsent:"]=1;
  6038. //>>excludeEnd("ctx");
  6039. $2=$self._sampleNewValue();
  6040. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6041. $ctx2.sendIdx["sampleNewValue"]=2;
  6042. //>>excludeEnd("ctx");
  6043. $self._assert_equals_($1,$2);
  6044. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6045. $ctx2.sendIdx["assert:equals:"]=1;
  6046. //>>excludeEnd("ctx");
  6047. $3=collection;
  6048. $4=$self._collection();
  6049. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6050. $ctx2.sendIdx["collection"]=2;
  6051. //>>excludeEnd("ctx");
  6052. return $self._assert_equals_($3,$4);
  6053. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6054. $ctx2.sendIdx["assert:equals:"]=2;
  6055. //>>excludeEnd("ctx");
  6056. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6057. }, function($ctx2) {$ctx2.fillBlock({each:each,collection:collection},$ctx1,1)});
  6058. //>>excludeEnd("ctx");
  6059. }));
  6060. $self._samplesDo_((function(index,value){
  6061. var collection;
  6062. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6063. return $core.withContext(function($ctx2) {
  6064. //>>excludeEnd("ctx");
  6065. collection=$self._collection();
  6066. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6067. $ctx2.sendIdx["collection"]=3;
  6068. //>>excludeEnd("ctx");
  6069. collection;
  6070. $5=$recv(collection)._removeKey_ifAbsent_(index,(function(){
  6071. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6072. return $core.withContext(function($ctx3) {
  6073. //>>excludeEnd("ctx");
  6074. return $self._sampleNewValue();
  6075. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6076. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,4)});
  6077. //>>excludeEnd("ctx");
  6078. }));
  6079. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6080. $ctx2.sendIdx["removeKey:ifAbsent:"]=2;
  6081. //>>excludeEnd("ctx");
  6082. $self._assert_equals_($5,value);
  6083. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6084. $ctx2.sendIdx["assert:equals:"]=3;
  6085. //>>excludeEnd("ctx");
  6086. $7=collection;
  6087. $8=$self._collection();
  6088. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6089. $ctx2.sendIdx["collection"]=4;
  6090. //>>excludeEnd("ctx");
  6091. $6=$recv($7).__eq($8);
  6092. return $self._deny_($6);
  6093. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6094. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value,collection:collection},$ctx1,3)});
  6095. //>>excludeEnd("ctx");
  6096. }));
  6097. $10=$self._collectionWithNewValue();
  6098. $recv($10)._removeKey_ifAbsent_($self._sampleNewIndex(),(function(){
  6099. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6100. return $core.withContext(function($ctx2) {
  6101. //>>excludeEnd("ctx");
  6102. return $self._assert_(false);
  6103. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6104. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,5)});
  6105. //>>excludeEnd("ctx");
  6106. }));
  6107. $9=$recv($10)._yourself();
  6108. $self._assert_equals_($9,$self._collection());
  6109. return self;
  6110. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6111. }, function($ctx1) {$ctx1.fill(self,"testRemoveKeyIfAbsent",{},$globals.AssociativeCollectionTest)});
  6112. //>>excludeEnd("ctx");
  6113. },
  6114. //>>excludeStart("ide", pragmas.excludeIdeData);
  6115. args: [],
  6116. source: "testRemoveKeyIfAbsent\x0a\x09self nonIndexesDo: [ :each |\x0a\x09\x09| collection |\x0a\x09\x09collection := self collection.\x0a\x09\x09self assert: (collection removeKey: each ifAbsent: [ self sampleNewValue ]) equals: self sampleNewValue.\x0a\x09\x09self assert: collection equals: self collection ].\x0a\x09self samplesDo: [ :index :value |\x0a\x09\x09| collection |\x0a\x09\x09collection := self collection.\x0a\x09\x09self assert: (collection removeKey: index ifAbsent: [ self sampleNewValue ]) equals: value.\x0a\x09\x09self deny: collection = self collection ].\x0a\x09self\x0a\x09\x09assert: (self collectionWithNewValue removeKey: self sampleNewIndex ifAbsent: [ self assert: false ]; yourself)\x0a\x09\x09equals: self collection",
  6117. referencedClasses: [],
  6118. //>>excludeEnd("ide");
  6119. messageSends: ["nonIndexesDo:", "collection", "assert:equals:", "removeKey:ifAbsent:", "sampleNewValue", "samplesDo:", "deny:", "=", "collectionWithNewValue", "sampleNewIndex", "assert:", "yourself"]
  6120. }),
  6121. $globals.AssociativeCollectionTest);
  6122. $core.addMethod(
  6123. $core.method({
  6124. selector: "testValues",
  6125. protocol: "tests",
  6126. fn: function (){
  6127. var self=this,$self=this;
  6128. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6129. return $core.withContext(function($ctx1) {
  6130. //>>excludeEnd("ctx");
  6131. var $2,$1,$3,$4;
  6132. $2=$recv($recv($self._collectionClass())._new())._values();
  6133. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6134. $ctx1.sendIdx["values"]=1;
  6135. //>>excludeEnd("ctx");
  6136. $1=$recv($2)._isEmpty();
  6137. $self._assert_($1);
  6138. $3=$recv($self._collection())._values();
  6139. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6140. $ctx1.sendIdx["values"]=2;
  6141. //>>excludeEnd("ctx");
  6142. $4=$self._collectionValues();
  6143. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6144. $ctx1.sendIdx["collectionValues"]=1;
  6145. //>>excludeEnd("ctx");
  6146. $self._assertSameContents_as_($3,$4);
  6147. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6148. $ctx1.sendIdx["assertSameContents:as:"]=1;
  6149. //>>excludeEnd("ctx");
  6150. $self._assertSameContents_as_($recv($self._collectionWithNewValue())._values(),$recv($self._collectionValues()).__comma([$self._sampleNewValue()]));
  6151. return self;
  6152. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6153. }, function($ctx1) {$ctx1.fill(self,"testValues",{},$globals.AssociativeCollectionTest)});
  6154. //>>excludeEnd("ctx");
  6155. },
  6156. //>>excludeStart("ide", pragmas.excludeIdeData);
  6157. args: [],
  6158. source: "testValues\x0a\x09self assert:self collectionClass new values isEmpty.\x0a\x09self assertSameContents:self collection values as: self collectionValues.\x0a\x09self assertSameContents:self collectionWithNewValue values as: self collectionValues, { self sampleNewValue }",
  6159. referencedClasses: [],
  6160. //>>excludeEnd("ide");
  6161. messageSends: ["assert:", "isEmpty", "values", "new", "collectionClass", "assertSameContents:as:", "collection", "collectionValues", "collectionWithNewValue", ",", "sampleNewValue"]
  6162. }),
  6163. $globals.AssociativeCollectionTest);
  6164. $core.addClass("DictionaryTest", $globals.AssociativeCollectionTest, [], "Kernel-Tests");
  6165. $core.addMethod(
  6166. $core.method({
  6167. selector: "collection",
  6168. protocol: "fixture",
  6169. fn: function (){
  6170. var self=this,$self=this;
  6171. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6172. return $core.withContext(function($ctx1) {
  6173. //>>excludeEnd("ctx");
  6174. var $1;
  6175. $1=$recv($globals.Dictionary)._new();
  6176. $recv($1)._at_put_((1),(1));
  6177. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6178. $ctx1.sendIdx["at:put:"]=1;
  6179. //>>excludeEnd("ctx");
  6180. $recv($1)._at_put_("a",(2));
  6181. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6182. $ctx1.sendIdx["at:put:"]=2;
  6183. //>>excludeEnd("ctx");
  6184. $recv($1)._at_put_(true,(3));
  6185. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6186. $ctx1.sendIdx["at:put:"]=3;
  6187. //>>excludeEnd("ctx");
  6188. $recv($1)._at_put_((1).__at((3)),(-4));
  6189. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6190. $ctx1.sendIdx["at:put:"]=4;
  6191. //>>excludeEnd("ctx");
  6192. $recv($1)._at_put_($self["@sampleBlock"],(9));
  6193. return $recv($1)._yourself();
  6194. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6195. }, function($ctx1) {$ctx1.fill(self,"collection",{},$globals.DictionaryTest)});
  6196. //>>excludeEnd("ctx");
  6197. },
  6198. //>>excludeStart("ide", pragmas.excludeIdeData);
  6199. args: [],
  6200. source: "collection\x0a\x09^ Dictionary new\x0a\x09\x09at: 1 put: 1;\x0a\x09\x09at: 'a' put: 2;\x0a\x09\x09at: true put: 3;\x0a\x09\x09at: 1@3 put: -4;\x0a\x09\x09at: sampleBlock put: 9;\x0a\x09\x09yourself",
  6201. referencedClasses: ["Dictionary"],
  6202. //>>excludeEnd("ide");
  6203. messageSends: ["at:put:", "new", "@", "yourself"]
  6204. }),
  6205. $globals.DictionaryTest);
  6206. $core.addMethod(
  6207. $core.method({
  6208. selector: "collectionKeys",
  6209. protocol: "fixture",
  6210. fn: function (){
  6211. var self=this,$self=this;
  6212. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6213. return $core.withContext(function($ctx1) {
  6214. //>>excludeEnd("ctx");
  6215. return [(1),"a",true,(1).__at((3)),$self["@sampleBlock"]];
  6216. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6217. }, function($ctx1) {$ctx1.fill(self,"collectionKeys",{},$globals.DictionaryTest)});
  6218. //>>excludeEnd("ctx");
  6219. },
  6220. //>>excludeStart("ide", pragmas.excludeIdeData);
  6221. args: [],
  6222. source: "collectionKeys\x0a\x09^ {1. 'a'. true. 1@3. sampleBlock}",
  6223. referencedClasses: [],
  6224. //>>excludeEnd("ide");
  6225. messageSends: ["@"]
  6226. }),
  6227. $globals.DictionaryTest);
  6228. $core.addMethod(
  6229. $core.method({
  6230. selector: "collectionOfPrintStrings",
  6231. protocol: "fixture",
  6232. fn: function (){
  6233. var self=this,$self=this;
  6234. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6235. return $core.withContext(function($ctx1) {
  6236. //>>excludeEnd("ctx");
  6237. var $1;
  6238. $1=$recv($globals.Dictionary)._new();
  6239. $recv($1)._at_put_((1),"1");
  6240. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6241. $ctx1.sendIdx["at:put:"]=1;
  6242. //>>excludeEnd("ctx");
  6243. $recv($1)._at_put_("a","2");
  6244. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6245. $ctx1.sendIdx["at:put:"]=2;
  6246. //>>excludeEnd("ctx");
  6247. $recv($1)._at_put_(true,"3");
  6248. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6249. $ctx1.sendIdx["at:put:"]=3;
  6250. //>>excludeEnd("ctx");
  6251. $recv($1)._at_put_((1).__at((3)),"-4");
  6252. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6253. $ctx1.sendIdx["at:put:"]=4;
  6254. //>>excludeEnd("ctx");
  6255. $recv($1)._at_put_($self["@sampleBlock"],"9");
  6256. return $recv($1)._yourself();
  6257. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6258. }, function($ctx1) {$ctx1.fill(self,"collectionOfPrintStrings",{},$globals.DictionaryTest)});
  6259. //>>excludeEnd("ctx");
  6260. },
  6261. //>>excludeStart("ide", pragmas.excludeIdeData);
  6262. args: [],
  6263. source: "collectionOfPrintStrings\x0a\x09^ Dictionary new\x0a\x09\x09at: 1 put: '1';\x0a\x09\x09at: 'a' put: '2';\x0a\x09\x09at: true put: '3';\x0a\x09\x09at: 1@3 put: '-4';\x0a\x09\x09at: sampleBlock put: '9';\x0a\x09\x09yourself",
  6264. referencedClasses: ["Dictionary"],
  6265. //>>excludeEnd("ide");
  6266. messageSends: ["at:put:", "new", "@", "yourself"]
  6267. }),
  6268. $globals.DictionaryTest);
  6269. $core.addMethod(
  6270. $core.method({
  6271. selector: "collectionSize",
  6272. protocol: "fixture",
  6273. fn: function (){
  6274. var self=this,$self=this;
  6275. return (5);
  6276. },
  6277. //>>excludeStart("ide", pragmas.excludeIdeData);
  6278. args: [],
  6279. source: "collectionSize\x0a\x09^ 5",
  6280. referencedClasses: [],
  6281. //>>excludeEnd("ide");
  6282. messageSends: []
  6283. }),
  6284. $globals.DictionaryTest);
  6285. $core.addMethod(
  6286. $core.method({
  6287. selector: "collectionValues",
  6288. protocol: "fixture",
  6289. fn: function (){
  6290. var self=this,$self=this;
  6291. return [(1),(2),(3),(-4),(9)];
  6292. },
  6293. //>>excludeStart("ide", pragmas.excludeIdeData);
  6294. args: [],
  6295. source: "collectionValues\x0a\x09^ {1. 2. 3. -4. 9}",
  6296. referencedClasses: [],
  6297. //>>excludeEnd("ide");
  6298. messageSends: []
  6299. }),
  6300. $globals.DictionaryTest);
  6301. $core.addMethod(
  6302. $core.method({
  6303. selector: "collectionWithDuplicates",
  6304. protocol: "fixture",
  6305. fn: function (){
  6306. var self=this,$self=this;
  6307. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6308. return $core.withContext(function($ctx1) {
  6309. //>>excludeEnd("ctx");
  6310. var $1;
  6311. $1=$recv($globals.Dictionary)._new();
  6312. $recv($1)._at_put_((1),(1));
  6313. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6314. $ctx1.sendIdx["at:put:"]=1;
  6315. //>>excludeEnd("ctx");
  6316. $recv($1)._at_put_("a",(2));
  6317. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6318. $ctx1.sendIdx["at:put:"]=2;
  6319. //>>excludeEnd("ctx");
  6320. $recv($1)._at_put_(true,(3));
  6321. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6322. $ctx1.sendIdx["at:put:"]=3;
  6323. //>>excludeEnd("ctx");
  6324. $recv($1)._at_put_((4),(-4));
  6325. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6326. $ctx1.sendIdx["at:put:"]=4;
  6327. //>>excludeEnd("ctx");
  6328. $recv($1)._at_put_($self["@sampleBlock"],(9));
  6329. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6330. $ctx1.sendIdx["at:put:"]=5;
  6331. //>>excludeEnd("ctx");
  6332. $recv($1)._at_put_("b",(1));
  6333. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6334. $ctx1.sendIdx["at:put:"]=6;
  6335. //>>excludeEnd("ctx");
  6336. $recv($1)._at_put_((3),(3));
  6337. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6338. $ctx1.sendIdx["at:put:"]=7;
  6339. //>>excludeEnd("ctx");
  6340. $recv($1)._at_put_(false,(12));
  6341. return $recv($1)._yourself();
  6342. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6343. }, function($ctx1) {$ctx1.fill(self,"collectionWithDuplicates",{},$globals.DictionaryTest)});
  6344. //>>excludeEnd("ctx");
  6345. },
  6346. //>>excludeStart("ide", pragmas.excludeIdeData);
  6347. args: [],
  6348. source: "collectionWithDuplicates\x0a\x09^ Dictionary new\x0a\x09\x09at: 1 put: 1;\x0a\x09\x09at: 'a' put: 2;\x0a\x09\x09at: true put: 3;\x0a\x09\x09at: 4 put: -4;\x0a\x09\x09at: sampleBlock put: 9;\x0a\x09\x09at: 'b' put: 1;\x0a\x09\x09at: 3 put: 3;\x0a\x09\x09at: false put: 12;\x0a\x09\x09yourself",
  6349. referencedClasses: ["Dictionary"],
  6350. //>>excludeEnd("ide");
  6351. messageSends: ["at:put:", "new", "yourself"]
  6352. }),
  6353. $globals.DictionaryTest);
  6354. $core.addMethod(
  6355. $core.method({
  6356. selector: "collectionWithNewValue",
  6357. protocol: "fixture",
  6358. fn: function (){
  6359. var self=this,$self=this;
  6360. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6361. return $core.withContext(function($ctx1) {
  6362. //>>excludeEnd("ctx");
  6363. var $1;
  6364. $1=$recv($globals.Dictionary)._new();
  6365. $recv($1)._at_put_((1),(1));
  6366. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6367. $ctx1.sendIdx["at:put:"]=1;
  6368. //>>excludeEnd("ctx");
  6369. $recv($1)._at_put_("a",(2));
  6370. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6371. $ctx1.sendIdx["at:put:"]=2;
  6372. //>>excludeEnd("ctx");
  6373. $recv($1)._at_put_(true,(3));
  6374. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6375. $ctx1.sendIdx["at:put:"]=3;
  6376. //>>excludeEnd("ctx");
  6377. $recv($1)._at_put_((1).__at((3)),(-4));
  6378. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6379. $ctx1.sendIdx["at:put:"]=4;
  6380. //>>excludeEnd("ctx");
  6381. $recv($1)._at_put_($self["@sampleBlock"],(9));
  6382. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6383. $ctx1.sendIdx["at:put:"]=5;
  6384. //>>excludeEnd("ctx");
  6385. $recv($1)._at_put_("new","N");
  6386. return $recv($1)._yourself();
  6387. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6388. }, function($ctx1) {$ctx1.fill(self,"collectionWithNewValue",{},$globals.DictionaryTest)});
  6389. //>>excludeEnd("ctx");
  6390. },
  6391. //>>excludeStart("ide", pragmas.excludeIdeData);
  6392. args: [],
  6393. source: "collectionWithNewValue\x0a\x09^ Dictionary new\x0a\x09\x09at: 1 put: 1;\x0a\x09\x09at: 'a' put: 2;\x0a\x09\x09at: true put: 3;\x0a\x09\x09at: 1@3 put: -4;\x0a\x09\x09at: sampleBlock put: 9;\x0a\x09\x09at: 'new' put: 'N';\x0a\x09\x09yourself",
  6394. referencedClasses: ["Dictionary"],
  6395. //>>excludeEnd("ide");
  6396. messageSends: ["at:put:", "new", "@", "yourself"]
  6397. }),
  6398. $globals.DictionaryTest);
  6399. $core.addMethod(
  6400. $core.method({
  6401. selector: "sampleNewValueAsCollection",
  6402. protocol: "fixture",
  6403. fn: function (){
  6404. var self=this,$self=this;
  6405. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6406. return $core.withContext(function($ctx1) {
  6407. //>>excludeEnd("ctx");
  6408. var $1;
  6409. $1=$recv($globals.Dictionary)._new();
  6410. $recv($1)._at_put_("new","N");
  6411. return $recv($1)._yourself();
  6412. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6413. }, function($ctx1) {$ctx1.fill(self,"sampleNewValueAsCollection",{},$globals.DictionaryTest)});
  6414. //>>excludeEnd("ctx");
  6415. },
  6416. //>>excludeStart("ide", pragmas.excludeIdeData);
  6417. args: [],
  6418. source: "sampleNewValueAsCollection\x0a\x09^ Dictionary new\x0a\x09\x09at: 'new' put: 'N';\x0a\x09\x09yourself",
  6419. referencedClasses: ["Dictionary"],
  6420. //>>excludeEnd("ide");
  6421. messageSends: ["at:put:", "new", "yourself"]
  6422. }),
  6423. $globals.DictionaryTest);
  6424. $core.addMethod(
  6425. $core.method({
  6426. selector: "samplesDo:",
  6427. protocol: "fixture",
  6428. fn: function (aBlock){
  6429. var self=this,$self=this;
  6430. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6431. return $core.withContext(function($ctx1) {
  6432. //>>excludeEnd("ctx");
  6433. (
  6434. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6435. $ctx1.supercall = true,
  6436. //>>excludeEnd("ctx");
  6437. ($globals.DictionaryTest.superclass||$boot.nilAsClass).fn.prototype._samplesDo_.apply($self, [aBlock]));
  6438. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6439. $ctx1.supercall = false;
  6440. //>>excludeEnd("ctx");;
  6441. $recv(aBlock)._value_value_(true,(3));
  6442. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6443. $ctx1.sendIdx["value:value:"]=1;
  6444. //>>excludeEnd("ctx");
  6445. $recv(aBlock)._value_value_((1).__at((3)),(-4));
  6446. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6447. $ctx1.sendIdx["value:value:"]=2;
  6448. //>>excludeEnd("ctx");
  6449. $recv(aBlock)._value_value_($self["@sampleBlock"],(9));
  6450. return self;
  6451. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6452. }, function($ctx1) {$ctx1.fill(self,"samplesDo:",{aBlock:aBlock},$globals.DictionaryTest)});
  6453. //>>excludeEnd("ctx");
  6454. },
  6455. //>>excludeStart("ide", pragmas.excludeIdeData);
  6456. args: ["aBlock"],
  6457. source: "samplesDo: aBlock\x0a\x09super samplesDo: aBlock.\x0a\x09aBlock value: true value: 3.\x0a\x09aBlock value: 1@3 value: -4.\x0a\x09aBlock value: sampleBlock value: 9",
  6458. referencedClasses: [],
  6459. //>>excludeEnd("ide");
  6460. messageSends: ["samplesDo:", "value:value:", "@"]
  6461. }),
  6462. $globals.DictionaryTest);
  6463. $core.addMethod(
  6464. $core.method({
  6465. selector: "testAccessing",
  6466. protocol: "tests",
  6467. fn: function (){
  6468. var self=this,$self=this;
  6469. var d;
  6470. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6471. return $core.withContext(function($ctx1) {
  6472. //>>excludeEnd("ctx");
  6473. var $1,$2,$3,$4,$5,$6,$7,$9,$10,$8,$12,$13,$11;
  6474. d=$recv($globals.Dictionary)._new();
  6475. $recv(d)._at_put_("hello","world");
  6476. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6477. $ctx1.sendIdx["at:put:"]=1;
  6478. //>>excludeEnd("ctx");
  6479. $1=$recv(d)._at_("hello");
  6480. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6481. $ctx1.sendIdx["at:"]=1;
  6482. //>>excludeEnd("ctx");
  6483. $self._assert_equals_($1,"world");
  6484. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6485. $ctx1.sendIdx["assert:equals:"]=1;
  6486. //>>excludeEnd("ctx");
  6487. $2=$recv(d)._at_ifAbsent_("hello",(function(){
  6488. return nil;
  6489. }));
  6490. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6491. $ctx1.sendIdx["at:ifAbsent:"]=1;
  6492. //>>excludeEnd("ctx");
  6493. $self._assert_equals_($2,"world");
  6494. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6495. $ctx1.sendIdx["assert:equals:"]=2;
  6496. //>>excludeEnd("ctx");
  6497. $self._deny_($recv($recv(d)._at_ifAbsent_("foo",(function(){
  6498. return nil;
  6499. }))).__eq("world"));
  6500. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6501. $ctx1.sendIdx["deny:"]=1;
  6502. //>>excludeEnd("ctx");
  6503. $3=$recv(d)._includesKey_("hello");
  6504. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6505. $ctx1.sendIdx["includesKey:"]=1;
  6506. //>>excludeEnd("ctx");
  6507. $self._assert_($3);
  6508. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6509. $ctx1.sendIdx["assert:"]=1;
  6510. //>>excludeEnd("ctx");
  6511. $4=$recv(d)._includesKey_("foo");
  6512. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6513. $ctx1.sendIdx["includesKey:"]=2;
  6514. //>>excludeEnd("ctx");
  6515. $self._deny_($4);
  6516. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6517. $ctx1.sendIdx["deny:"]=2;
  6518. //>>excludeEnd("ctx");
  6519. $recv(d)._at_put_((1),(2));
  6520. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6521. $ctx1.sendIdx["at:put:"]=2;
  6522. //>>excludeEnd("ctx");
  6523. $5=$recv(d)._at_((1));
  6524. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6525. $ctx1.sendIdx["at:"]=2;
  6526. //>>excludeEnd("ctx");
  6527. $self._assert_equals_($5,(2));
  6528. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6529. $ctx1.sendIdx["assert:equals:"]=3;
  6530. //>>excludeEnd("ctx");
  6531. $6=d;
  6532. $7=(1).__at((3));
  6533. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6534. $ctx1.sendIdx["@"]=1;
  6535. //>>excludeEnd("ctx");
  6536. $recv($6)._at_put_($7,(3));
  6537. $9=d;
  6538. $10=(1).__at((3));
  6539. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6540. $ctx1.sendIdx["@"]=2;
  6541. //>>excludeEnd("ctx");
  6542. $8=$recv($9)._at_($10);
  6543. $self._assert_equals_($8,(3));
  6544. $12=d;
  6545. $13=(1).__at((3));
  6546. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6547. $ctx1.sendIdx["@"]=3;
  6548. //>>excludeEnd("ctx");
  6549. $11=$recv($12)._includesKey_($13);
  6550. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6551. $ctx1.sendIdx["includesKey:"]=3;
  6552. //>>excludeEnd("ctx");
  6553. $self._assert_($11);
  6554. $self._deny_($recv(d)._includesKey_((3).__at((1))));
  6555. return self;
  6556. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6557. }, function($ctx1) {$ctx1.fill(self,"testAccessing",{d:d},$globals.DictionaryTest)});
  6558. //>>excludeEnd("ctx");
  6559. },
  6560. //>>excludeStart("ide", pragmas.excludeIdeData);
  6561. args: [],
  6562. source: "testAccessing\x0a\x09| d |\x0a\x0a\x09d := Dictionary new.\x0a\x0a\x09d at: 'hello' put: 'world'.\x0a\x09self assert: (d at: 'hello') equals: 'world'.\x0a\x09self assert: (d at: 'hello' ifAbsent: [ nil ]) equals: 'world'.\x0a\x09self deny: (d at: 'foo' ifAbsent: [ nil ]) = 'world'.\x0a\x0a\x09self assert: (d includesKey: 'hello').\x0a\x09self deny: (d includesKey: 'foo').\x0a\x0a\x09d at: 1 put: 2.\x0a\x09self assert: (d at: 1) equals: 2.\x0a\x0a\x09d at: 1@3 put: 3.\x0a\x09self assert: (d at: 1@3) equals: 3.\x0a\x0a\x09self assert: (d includesKey: 1@3).\x0a\x09self deny: (d includesKey: 3@1)",
  6563. referencedClasses: ["Dictionary"],
  6564. //>>excludeEnd("ide");
  6565. messageSends: ["new", "at:put:", "assert:equals:", "at:", "at:ifAbsent:", "deny:", "=", "assert:", "includesKey:", "@"]
  6566. }),
  6567. $globals.DictionaryTest);
  6568. $core.addMethod(
  6569. $core.method({
  6570. selector: "testDynamicDictionaries",
  6571. protocol: "tests",
  6572. fn: function (){
  6573. var self=this,$self=this;
  6574. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6575. return $core.withContext(function($ctx1) {
  6576. //>>excludeEnd("ctx");
  6577. $self._assert_equals_($recv($globals.HashedCollection._newFromPairs_(["hello",(1)]))._asDictionary(),$recv($globals.Dictionary)._with_("hello".__minus_gt((1))));
  6578. return self;
  6579. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6580. }, function($ctx1) {$ctx1.fill(self,"testDynamicDictionaries",{},$globals.DictionaryTest)});
  6581. //>>excludeEnd("ctx");
  6582. },
  6583. //>>excludeStart("ide", pragmas.excludeIdeData);
  6584. args: [],
  6585. source: "testDynamicDictionaries\x0a\x09self assert: #{'hello' -> 1} asDictionary equals: (Dictionary with: 'hello' -> 1)",
  6586. referencedClasses: ["Dictionary"],
  6587. //>>excludeEnd("ide");
  6588. messageSends: ["assert:equals:", "asDictionary", "with:", "->"]
  6589. }),
  6590. $globals.DictionaryTest);
  6591. $core.addMethod(
  6592. $core.method({
  6593. selector: "collectionClass",
  6594. protocol: "fixture",
  6595. fn: function (){
  6596. var self=this,$self=this;
  6597. return $globals.Dictionary;
  6598. },
  6599. //>>excludeStart("ide", pragmas.excludeIdeData);
  6600. args: [],
  6601. source: "collectionClass\x0a\x09^ Dictionary",
  6602. referencedClasses: ["Dictionary"],
  6603. //>>excludeEnd("ide");
  6604. messageSends: []
  6605. }),
  6606. $globals.DictionaryTest.a$cls);
  6607. $core.addClass("HashedCollectionTest", $globals.AssociativeCollectionTest, [], "Kernel-Tests");
  6608. $core.addMethod(
  6609. $core.method({
  6610. selector: "collection",
  6611. protocol: "fixture",
  6612. fn: function (){
  6613. var self=this,$self=this;
  6614. return $globals.HashedCollection._newFromPairs_(["b",(1),"a",(2),"c",(3),"d",(-4)]);
  6615. },
  6616. //>>excludeStart("ide", pragmas.excludeIdeData);
  6617. args: [],
  6618. source: "collection\x0a\x09^ #{ 'b' -> 1. 'a' -> 2. 'c' -> 3. 'd' -> -4 }",
  6619. referencedClasses: [],
  6620. //>>excludeEnd("ide");
  6621. messageSends: []
  6622. }),
  6623. $globals.HashedCollectionTest);
  6624. $core.addMethod(
  6625. $core.method({
  6626. selector: "collectionKeys",
  6627. protocol: "fixture",
  6628. fn: function (){
  6629. var self=this,$self=this;
  6630. return ["b","a","c","d"];
  6631. },
  6632. //>>excludeStart("ide", pragmas.excludeIdeData);
  6633. args: [],
  6634. source: "collectionKeys\x0a\x09^ { 'b'. 'a'. 'c'. 'd' }",
  6635. referencedClasses: [],
  6636. //>>excludeEnd("ide");
  6637. messageSends: []
  6638. }),
  6639. $globals.HashedCollectionTest);
  6640. $core.addMethod(
  6641. $core.method({
  6642. selector: "collectionOfPrintStrings",
  6643. protocol: "fixture",
  6644. fn: function (){
  6645. var self=this,$self=this;
  6646. return $globals.HashedCollection._newFromPairs_(["b","1","a","2","c","3","d","-4"]);
  6647. },
  6648. //>>excludeStart("ide", pragmas.excludeIdeData);
  6649. args: [],
  6650. source: "collectionOfPrintStrings\x0a\x09^ #{ 'b' -> '1'. 'a' -> '2'. 'c' -> '3'. 'd' -> '-4' }",
  6651. referencedClasses: [],
  6652. //>>excludeEnd("ide");
  6653. messageSends: []
  6654. }),
  6655. $globals.HashedCollectionTest);
  6656. $core.addMethod(
  6657. $core.method({
  6658. selector: "collectionSize",
  6659. protocol: "fixture",
  6660. fn: function (){
  6661. var self=this,$self=this;
  6662. return (4);
  6663. },
  6664. //>>excludeStart("ide", pragmas.excludeIdeData);
  6665. args: [],
  6666. source: "collectionSize\x0a\x09^ 4",
  6667. referencedClasses: [],
  6668. //>>excludeEnd("ide");
  6669. messageSends: []
  6670. }),
  6671. $globals.HashedCollectionTest);
  6672. $core.addMethod(
  6673. $core.method({
  6674. selector: "collectionValues",
  6675. protocol: "fixture",
  6676. fn: function (){
  6677. var self=this,$self=this;
  6678. return [(1),(2),(3),(-4)];
  6679. },
  6680. //>>excludeStart("ide", pragmas.excludeIdeData);
  6681. args: [],
  6682. source: "collectionValues\x0a\x09^ { 1. 2. 3. -4 }",
  6683. referencedClasses: [],
  6684. //>>excludeEnd("ide");
  6685. messageSends: []
  6686. }),
  6687. $globals.HashedCollectionTest);
  6688. $core.addMethod(
  6689. $core.method({
  6690. selector: "collectionWithDuplicates",
  6691. protocol: "fixture",
  6692. fn: function (){
  6693. var self=this,$self=this;
  6694. return $globals.HashedCollection._newFromPairs_(["b",(1),"a",(2),"c",(3),"d",(-4),"e",(1),"f",(2),"g",(10),"h",(0)]);
  6695. },
  6696. //>>excludeStart("ide", pragmas.excludeIdeData);
  6697. args: [],
  6698. source: "collectionWithDuplicates\x0a\x09^ #{ 'b' -> 1. 'a' -> 2. 'c' -> 3. 'd' -> -4. 'e' -> 1. 'f' -> 2. 'g' -> 10. 'h' -> 0 }",
  6699. referencedClasses: [],
  6700. //>>excludeEnd("ide");
  6701. messageSends: []
  6702. }),
  6703. $globals.HashedCollectionTest);
  6704. $core.addMethod(
  6705. $core.method({
  6706. selector: "collectionWithNewValue",
  6707. protocol: "fixture",
  6708. fn: function (){
  6709. var self=this,$self=this;
  6710. return $globals.HashedCollection._newFromPairs_(["b",(1),"a",(2),"c",(3),"d",(-4),"new","N"]);
  6711. },
  6712. //>>excludeStart("ide", pragmas.excludeIdeData);
  6713. args: [],
  6714. source: "collectionWithNewValue\x0a\x09^ #{ 'b' -> 1. 'a' -> 2. 'c' -> 3. 'd' -> -4. 'new' -> 'N' }",
  6715. referencedClasses: [],
  6716. //>>excludeEnd("ide");
  6717. messageSends: []
  6718. }),
  6719. $globals.HashedCollectionTest);
  6720. $core.addMethod(
  6721. $core.method({
  6722. selector: "sampleNewValueAsCollection",
  6723. protocol: "fixture",
  6724. fn: function (){
  6725. var self=this,$self=this;
  6726. return $globals.HashedCollection._newFromPairs_(["new","N"]);
  6727. },
  6728. //>>excludeStart("ide", pragmas.excludeIdeData);
  6729. args: [],
  6730. source: "sampleNewValueAsCollection\x0a\x09^ #{ 'new' -> 'N' }",
  6731. referencedClasses: [],
  6732. //>>excludeEnd("ide");
  6733. messageSends: []
  6734. }),
  6735. $globals.HashedCollectionTest);
  6736. $core.addMethod(
  6737. $core.method({
  6738. selector: "testDynamicDictionaries",
  6739. protocol: "tests",
  6740. fn: function (){
  6741. var self=this,$self=this;
  6742. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6743. return $core.withContext(function($ctx1) {
  6744. //>>excludeEnd("ctx");
  6745. $self._assert_equals_($recv($globals.HashedCollection._newFromPairs_(["hello",(1)]))._asHashedCollection(),$recv($globals.HashedCollection)._with_("hello".__minus_gt((1))));
  6746. return self;
  6747. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6748. }, function($ctx1) {$ctx1.fill(self,"testDynamicDictionaries",{},$globals.HashedCollectionTest)});
  6749. //>>excludeEnd("ctx");
  6750. },
  6751. //>>excludeStart("ide", pragmas.excludeIdeData);
  6752. args: [],
  6753. source: "testDynamicDictionaries\x0a\x09self assert: #{'hello' -> 1} asHashedCollection equals: (HashedCollection with: 'hello' -> 1)",
  6754. referencedClasses: ["HashedCollection"],
  6755. //>>excludeEnd("ide");
  6756. messageSends: ["assert:equals:", "asHashedCollection", "with:", "->"]
  6757. }),
  6758. $globals.HashedCollectionTest);
  6759. $core.addMethod(
  6760. $core.method({
  6761. selector: "collectionClass",
  6762. protocol: "fixture",
  6763. fn: function (){
  6764. var self=this,$self=this;
  6765. return $globals.HashedCollection;
  6766. },
  6767. //>>excludeStart("ide", pragmas.excludeIdeData);
  6768. args: [],
  6769. source: "collectionClass\x0a\x09^ HashedCollection",
  6770. referencedClasses: ["HashedCollection"],
  6771. //>>excludeEnd("ide");
  6772. messageSends: []
  6773. }),
  6774. $globals.HashedCollectionTest.a$cls);
  6775. $core.addClass("SequenceableCollectionTest", $globals.IndexableCollectionTest, [], "Kernel-Tests");
  6776. $core.addMethod(
  6777. $core.method({
  6778. selector: "collectionFirst",
  6779. protocol: "fixture",
  6780. fn: function (){
  6781. var self=this,$self=this;
  6782. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6783. return $core.withContext(function($ctx1) {
  6784. //>>excludeEnd("ctx");
  6785. $self._subclassResponsibility();
  6786. return self;
  6787. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6788. }, function($ctx1) {$ctx1.fill(self,"collectionFirst",{},$globals.SequenceableCollectionTest)});
  6789. //>>excludeEnd("ctx");
  6790. },
  6791. //>>excludeStart("ide", pragmas.excludeIdeData);
  6792. args: [],
  6793. source: "collectionFirst\x0a\x09self subclassResponsibility",
  6794. referencedClasses: [],
  6795. //>>excludeEnd("ide");
  6796. messageSends: ["subclassResponsibility"]
  6797. }),
  6798. $globals.SequenceableCollectionTest);
  6799. $core.addMethod(
  6800. $core.method({
  6801. selector: "collectionFirstTwo",
  6802. protocol: "fixture",
  6803. fn: function (){
  6804. var self=this,$self=this;
  6805. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6806. return $core.withContext(function($ctx1) {
  6807. //>>excludeEnd("ctx");
  6808. $self._subclassResponsibility();
  6809. return self;
  6810. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6811. }, function($ctx1) {$ctx1.fill(self,"collectionFirstTwo",{},$globals.SequenceableCollectionTest)});
  6812. //>>excludeEnd("ctx");
  6813. },
  6814. //>>excludeStart("ide", pragmas.excludeIdeData);
  6815. args: [],
  6816. source: "collectionFirstTwo\x0a\x09self subclassResponsibility",
  6817. referencedClasses: [],
  6818. //>>excludeEnd("ide");
  6819. messageSends: ["subclassResponsibility"]
  6820. }),
  6821. $globals.SequenceableCollectionTest);
  6822. $core.addMethod(
  6823. $core.method({
  6824. selector: "collectionLast",
  6825. protocol: "fixture",
  6826. fn: function (){
  6827. var self=this,$self=this;
  6828. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6829. return $core.withContext(function($ctx1) {
  6830. //>>excludeEnd("ctx");
  6831. $self._subclassResponsibility();
  6832. return self;
  6833. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6834. }, function($ctx1) {$ctx1.fill(self,"collectionLast",{},$globals.SequenceableCollectionTest)});
  6835. //>>excludeEnd("ctx");
  6836. },
  6837. //>>excludeStart("ide", pragmas.excludeIdeData);
  6838. args: [],
  6839. source: "collectionLast\x0a\x09self subclassResponsibility",
  6840. referencedClasses: [],
  6841. //>>excludeEnd("ide");
  6842. messageSends: ["subclassResponsibility"]
  6843. }),
  6844. $globals.SequenceableCollectionTest);
  6845. $core.addMethod(
  6846. $core.method({
  6847. selector: "collectionLastTwo",
  6848. protocol: "fixture",
  6849. fn: function (){
  6850. var self=this,$self=this;
  6851. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6852. return $core.withContext(function($ctx1) {
  6853. //>>excludeEnd("ctx");
  6854. $self._subclassResponsibility();
  6855. return self;
  6856. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6857. }, function($ctx1) {$ctx1.fill(self,"collectionLastTwo",{},$globals.SequenceableCollectionTest)});
  6858. //>>excludeEnd("ctx");
  6859. },
  6860. //>>excludeStart("ide", pragmas.excludeIdeData);
  6861. args: [],
  6862. source: "collectionLastTwo\x0a\x09self subclassResponsibility",
  6863. referencedClasses: [],
  6864. //>>excludeEnd("ide");
  6865. messageSends: ["subclassResponsibility"]
  6866. }),
  6867. $globals.SequenceableCollectionTest);
  6868. $core.addMethod(
  6869. $core.method({
  6870. selector: "nonIndexesDo:",
  6871. protocol: "fixture",
  6872. fn: function (aBlock){
  6873. var self=this,$self=this;
  6874. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6875. return $core.withContext(function($ctx1) {
  6876. //>>excludeEnd("ctx");
  6877. $recv(aBlock)._value_((0));
  6878. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6879. $ctx1.sendIdx["value:"]=1;
  6880. //>>excludeEnd("ctx");
  6881. $recv(aBlock)._value_($recv($self._collectionSize()).__plus((1)));
  6882. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6883. $ctx1.sendIdx["value:"]=2;
  6884. //>>excludeEnd("ctx");
  6885. $recv(aBlock)._value_("z");
  6886. return self;
  6887. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6888. }, function($ctx1) {$ctx1.fill(self,"nonIndexesDo:",{aBlock:aBlock},$globals.SequenceableCollectionTest)});
  6889. //>>excludeEnd("ctx");
  6890. },
  6891. //>>excludeStart("ide", pragmas.excludeIdeData);
  6892. args: ["aBlock"],
  6893. source: "nonIndexesDo: aBlock\x0a\x09aBlock value: 0.\x0a\x09aBlock value: self collectionSize + 1.\x0a\x09aBlock value: 'z'",
  6894. referencedClasses: [],
  6895. //>>excludeEnd("ide");
  6896. messageSends: ["value:", "+", "collectionSize"]
  6897. }),
  6898. $globals.SequenceableCollectionTest);
  6899. $core.addMethod(
  6900. $core.method({
  6901. selector: "samplesDo:",
  6902. protocol: "fixture",
  6903. fn: function (aBlock){
  6904. var self=this,$self=this;
  6905. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6906. return $core.withContext(function($ctx1) {
  6907. //>>excludeEnd("ctx");
  6908. $recv(aBlock)._value_value_((1),$self._collectionFirst());
  6909. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6910. $ctx1.sendIdx["value:value:"]=1;
  6911. //>>excludeEnd("ctx");
  6912. $recv(aBlock)._value_value_($self._collectionSize(),$self._collectionLast());
  6913. return self;
  6914. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6915. }, function($ctx1) {$ctx1.fill(self,"samplesDo:",{aBlock:aBlock},$globals.SequenceableCollectionTest)});
  6916. //>>excludeEnd("ctx");
  6917. },
  6918. //>>excludeStart("ide", pragmas.excludeIdeData);
  6919. args: ["aBlock"],
  6920. source: "samplesDo: aBlock\x0a\x09aBlock value: 1 value: self collectionFirst.\x0a\x09aBlock value: self collectionSize value: self collectionLast",
  6921. referencedClasses: [],
  6922. //>>excludeEnd("ide");
  6923. messageSends: ["value:value:", "collectionFirst", "collectionSize", "collectionLast"]
  6924. }),
  6925. $globals.SequenceableCollectionTest);
  6926. $core.addMethod(
  6927. $core.method({
  6928. selector: "testBeginsWith",
  6929. protocol: "tests",
  6930. fn: function (){
  6931. var self=this,$self=this;
  6932. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6933. return $core.withContext(function($ctx1) {
  6934. //>>excludeEnd("ctx");
  6935. var $2,$1,$4,$5,$3,$7,$6;
  6936. $2=$self._collection();
  6937. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6938. $ctx1.sendIdx["collection"]=1;
  6939. //>>excludeEnd("ctx");
  6940. $1=$recv($2)._beginsWith_($recv($self._collectionClass())._new());
  6941. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6942. $ctx1.sendIdx["beginsWith:"]=1;
  6943. //>>excludeEnd("ctx");
  6944. $self._assert_($1);
  6945. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6946. $ctx1.sendIdx["assert:"]=1;
  6947. //>>excludeEnd("ctx");
  6948. $4=$self._collection();
  6949. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6950. $ctx1.sendIdx["collection"]=2;
  6951. //>>excludeEnd("ctx");
  6952. $5=$self._collection();
  6953. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6954. $ctx1.sendIdx["collection"]=3;
  6955. //>>excludeEnd("ctx");
  6956. $3=$recv($4)._beginsWith_($5);
  6957. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6958. $ctx1.sendIdx["beginsWith:"]=2;
  6959. //>>excludeEnd("ctx");
  6960. $self._assert_($3);
  6961. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6962. $ctx1.sendIdx["assert:"]=2;
  6963. //>>excludeEnd("ctx");
  6964. $7=$self._collection();
  6965. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6966. $ctx1.sendIdx["collection"]=4;
  6967. //>>excludeEnd("ctx");
  6968. $6=$recv($7)._beginsWith_($self._collectionFirstTwo());
  6969. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6970. $ctx1.sendIdx["beginsWith:"]=3;
  6971. //>>excludeEnd("ctx");
  6972. $self._assert_($6);
  6973. $self._deny_($recv($self._collection())._beginsWith_($self._collectionLastTwo()));
  6974. return self;
  6975. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6976. }, function($ctx1) {$ctx1.fill(self,"testBeginsWith",{},$globals.SequenceableCollectionTest)});
  6977. //>>excludeEnd("ctx");
  6978. },
  6979. //>>excludeStart("ide", pragmas.excludeIdeData);
  6980. args: [],
  6981. source: "testBeginsWith\x0a\x09self assert: (self collection beginsWith: self collectionClass new).\x0a\x09self assert: (self collection beginsWith: self collection).\x0a\x09self assert: (self collection beginsWith: self collectionFirstTwo).\x0a\x09self deny: (self collection beginsWith: self collectionLastTwo)",
  6982. referencedClasses: [],
  6983. //>>excludeEnd("ide");
  6984. messageSends: ["assert:", "beginsWith:", "collection", "new", "collectionClass", "collectionFirstTwo", "deny:", "collectionLastTwo"]
  6985. }),
  6986. $globals.SequenceableCollectionTest);
  6987. $core.addMethod(
  6988. $core.method({
  6989. selector: "testEndsWith",
  6990. protocol: "tests",
  6991. fn: function (){
  6992. var self=this,$self=this;
  6993. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6994. return $core.withContext(function($ctx1) {
  6995. //>>excludeEnd("ctx");
  6996. var $2,$1,$4,$5,$3,$7,$6;
  6997. $2=$self._collection();
  6998. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6999. $ctx1.sendIdx["collection"]=1;
  7000. //>>excludeEnd("ctx");
  7001. $1=$recv($2)._endsWith_($recv($self._collectionClass())._new());
  7002. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7003. $ctx1.sendIdx["endsWith:"]=1;
  7004. //>>excludeEnd("ctx");
  7005. $self._assert_($1);
  7006. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7007. $ctx1.sendIdx["assert:"]=1;
  7008. //>>excludeEnd("ctx");
  7009. $4=$self._collection();
  7010. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7011. $ctx1.sendIdx["collection"]=2;
  7012. //>>excludeEnd("ctx");
  7013. $5=$self._collection();
  7014. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7015. $ctx1.sendIdx["collection"]=3;
  7016. //>>excludeEnd("ctx");
  7017. $3=$recv($4)._endsWith_($5);
  7018. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7019. $ctx1.sendIdx["endsWith:"]=2;
  7020. //>>excludeEnd("ctx");
  7021. $self._assert_($3);
  7022. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7023. $ctx1.sendIdx["assert:"]=2;
  7024. //>>excludeEnd("ctx");
  7025. $7=$self._collection();
  7026. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7027. $ctx1.sendIdx["collection"]=4;
  7028. //>>excludeEnd("ctx");
  7029. $6=$recv($7)._endsWith_($self._collectionLastTwo());
  7030. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7031. $ctx1.sendIdx["endsWith:"]=3;
  7032. //>>excludeEnd("ctx");
  7033. $self._assert_($6);
  7034. $self._deny_($recv($self._collection())._endsWith_($self._collectionFirstTwo()));
  7035. return self;
  7036. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7037. }, function($ctx1) {$ctx1.fill(self,"testEndsWith",{},$globals.SequenceableCollectionTest)});
  7038. //>>excludeEnd("ctx");
  7039. },
  7040. //>>excludeStart("ide", pragmas.excludeIdeData);
  7041. args: [],
  7042. source: "testEndsWith\x0a\x09self assert: (self collection endsWith: self collectionClass new).\x0a\x09self assert: (self collection endsWith: self collection).\x0a\x09self assert: (self collection endsWith: self collectionLastTwo).\x0a\x09self deny: (self collection endsWith: self collectionFirstTwo)",
  7043. referencedClasses: [],
  7044. //>>excludeEnd("ide");
  7045. messageSends: ["assert:", "endsWith:", "collection", "new", "collectionClass", "collectionLastTwo", "deny:", "collectionFirstTwo"]
  7046. }),
  7047. $globals.SequenceableCollectionTest);
  7048. $core.addMethod(
  7049. $core.method({
  7050. selector: "testFirst",
  7051. protocol: "tests",
  7052. fn: function (){
  7053. var self=this,$self=this;
  7054. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7055. return $core.withContext(function($ctx1) {
  7056. //>>excludeEnd("ctx");
  7057. $self._assert_equals_($recv($self._collection())._first(),$self._collectionFirst());
  7058. return self;
  7059. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7060. }, function($ctx1) {$ctx1.fill(self,"testFirst",{},$globals.SequenceableCollectionTest)});
  7061. //>>excludeEnd("ctx");
  7062. },
  7063. //>>excludeStart("ide", pragmas.excludeIdeData);
  7064. args: [],
  7065. source: "testFirst\x0a\x09self assert: self collection first equals: self collectionFirst",
  7066. referencedClasses: [],
  7067. //>>excludeEnd("ide");
  7068. messageSends: ["assert:equals:", "first", "collection", "collectionFirst"]
  7069. }),
  7070. $globals.SequenceableCollectionTest);
  7071. $core.addMethod(
  7072. $core.method({
  7073. selector: "testFirstN",
  7074. protocol: "tests",
  7075. fn: function (){
  7076. var self=this,$self=this;
  7077. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7078. return $core.withContext(function($ctx1) {
  7079. //>>excludeEnd("ctx");
  7080. var $2,$1,$4,$3,$6,$5,$7;
  7081. $2=$self._collection();
  7082. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7083. $ctx1.sendIdx["collection"]=1;
  7084. //>>excludeEnd("ctx");
  7085. $1=$recv($2)._first_((2));
  7086. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7087. $ctx1.sendIdx["first:"]=1;
  7088. //>>excludeEnd("ctx");
  7089. $self._assert_equals_($1,$self._collectionFirstTwo());
  7090. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7091. $ctx1.sendIdx["assert:equals:"]=1;
  7092. //>>excludeEnd("ctx");
  7093. $4=$self._collection();
  7094. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7095. $ctx1.sendIdx["collection"]=2;
  7096. //>>excludeEnd("ctx");
  7097. $3=$recv($4)._first_((0));
  7098. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7099. $ctx1.sendIdx["first:"]=2;
  7100. //>>excludeEnd("ctx");
  7101. $self._assert_equals_($3,$recv($self._collectionClass())._new());
  7102. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7103. $ctx1.sendIdx["assert:equals:"]=2;
  7104. //>>excludeEnd("ctx");
  7105. $6=$self._collection();
  7106. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7107. $ctx1.sendIdx["collection"]=3;
  7108. //>>excludeEnd("ctx");
  7109. $5=$recv($6)._first_($self._collectionSize());
  7110. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7111. $ctx1.sendIdx["first:"]=3;
  7112. //>>excludeEnd("ctx");
  7113. $7=$self._collection();
  7114. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7115. $ctx1.sendIdx["collection"]=4;
  7116. //>>excludeEnd("ctx");
  7117. $self._assert_equals_($5,$7);
  7118. $self._should_raise_((function(){
  7119. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7120. return $core.withContext(function($ctx2) {
  7121. //>>excludeEnd("ctx");
  7122. return $recv($self._collection())._first_((33));
  7123. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7124. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  7125. //>>excludeEnd("ctx");
  7126. }),$globals.Error);
  7127. return self;
  7128. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7129. }, function($ctx1) {$ctx1.fill(self,"testFirstN",{},$globals.SequenceableCollectionTest)});
  7130. //>>excludeEnd("ctx");
  7131. },
  7132. //>>excludeStart("ide", pragmas.excludeIdeData);
  7133. args: [],
  7134. source: "testFirstN\x0a\x09self \x0a\x09\x09assert: (self collection first: 2)\x0a\x09\x09equals: self collectionFirstTwo.\x0a\x09\x09\x0a\x09self\x0a\x09\x09assert: (self collection first: 0)\x0a\x09\x09equals: self collectionClass new.\x0a\x09\x09\x0a\x09self\x0a\x09\x09assert: (self collection first: self collectionSize)\x0a\x09\x09equals: self collection.\x0a\x09\x09\x0a\x09self should: [ self collection first: 33 ] raise: Error",
  7135. referencedClasses: ["Error"],
  7136. //>>excludeEnd("ide");
  7137. messageSends: ["assert:equals:", "first:", "collection", "collectionFirstTwo", "new", "collectionClass", "collectionSize", "should:raise:"]
  7138. }),
  7139. $globals.SequenceableCollectionTest);
  7140. $core.addMethod(
  7141. $core.method({
  7142. selector: "testFourth",
  7143. protocol: "tests",
  7144. fn: function (){
  7145. var self=this,$self=this;
  7146. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7147. return $core.withContext(function($ctx1) {
  7148. //>>excludeEnd("ctx");
  7149. var $2,$1;
  7150. $2=$self._collection();
  7151. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7152. $ctx1.sendIdx["collection"]=1;
  7153. //>>excludeEnd("ctx");
  7154. $1=$recv($2)._fourth();
  7155. $self._assert_equals_($1,$recv($self._collection())._at_((4)));
  7156. return self;
  7157. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7158. }, function($ctx1) {$ctx1.fill(self,"testFourth",{},$globals.SequenceableCollectionTest)});
  7159. //>>excludeEnd("ctx");
  7160. },
  7161. //>>excludeStart("ide", pragmas.excludeIdeData);
  7162. args: [],
  7163. source: "testFourth\x0a\x09self assert: (self collection fourth) equals: (self collection at: 4)",
  7164. referencedClasses: [],
  7165. //>>excludeEnd("ide");
  7166. messageSends: ["assert:equals:", "fourth", "collection", "at:"]
  7167. }),
  7168. $globals.SequenceableCollectionTest);
  7169. $core.addMethod(
  7170. $core.method({
  7171. selector: "testIndexOfStartingAt",
  7172. protocol: "tests",
  7173. fn: function (){
  7174. var self=this,$self=this;
  7175. var jsNull;
  7176. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7177. return $core.withContext(function($ctx1) {
  7178. //>>excludeEnd("ctx");
  7179. var $2,$1,$4,$3;
  7180. jsNull=$recv($globals.JSON)._parse_("null");
  7181. $self._samplesDo_((function(index,value){
  7182. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7183. return $core.withContext(function($ctx2) {
  7184. //>>excludeEnd("ctx");
  7185. $2=$self._collection();
  7186. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7187. $ctx2.sendIdx["collection"]=1;
  7188. //>>excludeEnd("ctx");
  7189. $1=$recv($2)._indexOf_startingAt_(value,(1));
  7190. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7191. $ctx2.sendIdx["indexOf:startingAt:"]=1;
  7192. //>>excludeEnd("ctx");
  7193. $self._assert_equals_($1,index);
  7194. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7195. $ctx2.sendIdx["assert:equals:"]=1;
  7196. //>>excludeEnd("ctx");
  7197. $4=$self._collection();
  7198. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7199. $ctx2.sendIdx["collection"]=2;
  7200. //>>excludeEnd("ctx");
  7201. $3=$recv($4)._indexOf_startingAt_(value,index);
  7202. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7203. $ctx2.sendIdx["indexOf:startingAt:"]=2;
  7204. //>>excludeEnd("ctx");
  7205. $self._assert_equals_($3,index);
  7206. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7207. $ctx2.sendIdx["assert:equals:"]=2;
  7208. //>>excludeEnd("ctx");
  7209. return $self._assert_equals_($recv($self._collection())._indexOf_startingAt_(value,$recv(index).__plus((1))),(0));
  7210. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7211. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,1)});
  7212. //>>excludeEnd("ctx");
  7213. }));
  7214. return self;
  7215. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7216. }, function($ctx1) {$ctx1.fill(self,"testIndexOfStartingAt",{jsNull:jsNull},$globals.SequenceableCollectionTest)});
  7217. //>>excludeEnd("ctx");
  7218. },
  7219. //>>excludeStart("ide", pragmas.excludeIdeData);
  7220. args: [],
  7221. source: "testIndexOfStartingAt\x0a\x09| jsNull |\x0a\x09jsNull := JSON parse: 'null'.\x0a\x09self samplesDo: [ :index :value |\x0a\x09\x09self assert: (self collection indexOf: value startingAt: 1) equals: index.\x0a\x09\x09self assert: (self collection indexOf: value startingAt: index) equals: index.\x0a\x09\x09self assert: (self collection indexOf: value startingAt: index+1) equals: 0 ]",
  7222. referencedClasses: ["JSON"],
  7223. //>>excludeEnd("ide");
  7224. messageSends: ["parse:", "samplesDo:", "assert:equals:", "indexOf:startingAt:", "collection", "+"]
  7225. }),
  7226. $globals.SequenceableCollectionTest);
  7227. $core.addMethod(
  7228. $core.method({
  7229. selector: "testIndexOfStartingAtWithNull",
  7230. protocol: "tests",
  7231. fn: function (){
  7232. var self=this,$self=this;
  7233. var jsNull;
  7234. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7235. return $core.withContext(function($ctx1) {
  7236. //>>excludeEnd("ctx");
  7237. var $1,$2;
  7238. jsNull=$recv($globals.JSON)._parse_("null");
  7239. $self._samplesDo_((function(index,value){
  7240. var collection;
  7241. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7242. return $core.withContext(function($ctx2) {
  7243. //>>excludeEnd("ctx");
  7244. collection=$self._collection();
  7245. collection;
  7246. $recv(collection)._at_put_(index,jsNull);
  7247. $1=$recv(collection)._indexOf_startingAt_(jsNull,(1));
  7248. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7249. $ctx2.sendIdx["indexOf:startingAt:"]=1;
  7250. //>>excludeEnd("ctx");
  7251. $self._assert_equals_($1,index);
  7252. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7253. $ctx2.sendIdx["assert:equals:"]=1;
  7254. //>>excludeEnd("ctx");
  7255. $2=$recv(collection)._indexOf_startingAt_(jsNull,index);
  7256. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7257. $ctx2.sendIdx["indexOf:startingAt:"]=2;
  7258. //>>excludeEnd("ctx");
  7259. $self._assert_equals_($2,index);
  7260. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7261. $ctx2.sendIdx["assert:equals:"]=2;
  7262. //>>excludeEnd("ctx");
  7263. return $self._assert_equals_($recv(collection)._indexOf_startingAt_(jsNull,$recv(index).__plus((1))),(0));
  7264. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7265. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value,collection:collection},$ctx1,1)});
  7266. //>>excludeEnd("ctx");
  7267. }));
  7268. return self;
  7269. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7270. }, function($ctx1) {$ctx1.fill(self,"testIndexOfStartingAtWithNull",{jsNull:jsNull},$globals.SequenceableCollectionTest)});
  7271. //>>excludeEnd("ctx");
  7272. },
  7273. //>>excludeStart("ide", pragmas.excludeIdeData);
  7274. args: [],
  7275. source: "testIndexOfStartingAtWithNull\x0a\x09| jsNull |\x0a\x09jsNull := JSON parse: 'null'.\x0a\x09self samplesDo: [ :index :value | | collection |\x0a\x09\x09collection := self collection.\x0a\x09\x09collection at: index put: jsNull.\x0a\x09\x09self assert: (collection indexOf: jsNull startingAt: 1) equals: index.\x0a\x09\x09self assert: (collection indexOf: jsNull startingAt: index) equals: index.\x0a\x09\x09self assert: (collection indexOf: jsNull startingAt: index+1) equals: 0 ]",
  7276. referencedClasses: ["JSON"],
  7277. //>>excludeEnd("ide");
  7278. messageSends: ["parse:", "samplesDo:", "collection", "at:put:", "assert:equals:", "indexOf:startingAt:", "+"]
  7279. }),
  7280. $globals.SequenceableCollectionTest);
  7281. $core.addMethod(
  7282. $core.method({
  7283. selector: "testLast",
  7284. protocol: "tests",
  7285. fn: function (){
  7286. var self=this,$self=this;
  7287. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7288. return $core.withContext(function($ctx1) {
  7289. //>>excludeEnd("ctx");
  7290. $self._assert_equals_($recv($self._collection())._last(),$self._collectionLast());
  7291. return self;
  7292. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7293. }, function($ctx1) {$ctx1.fill(self,"testLast",{},$globals.SequenceableCollectionTest)});
  7294. //>>excludeEnd("ctx");
  7295. },
  7296. //>>excludeStart("ide", pragmas.excludeIdeData);
  7297. args: [],
  7298. source: "testLast\x0a\x09self assert: self collection last equals: self collectionLast",
  7299. referencedClasses: [],
  7300. //>>excludeEnd("ide");
  7301. messageSends: ["assert:equals:", "last", "collection", "collectionLast"]
  7302. }),
  7303. $globals.SequenceableCollectionTest);
  7304. $core.addMethod(
  7305. $core.method({
  7306. selector: "testLastN",
  7307. protocol: "tests",
  7308. fn: function (){
  7309. var self=this,$self=this;
  7310. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7311. return $core.withContext(function($ctx1) {
  7312. //>>excludeEnd("ctx");
  7313. var $2,$1,$4,$3,$6,$5,$7;
  7314. $2=$self._collection();
  7315. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7316. $ctx1.sendIdx["collection"]=1;
  7317. //>>excludeEnd("ctx");
  7318. $1=$recv($2)._last_((2));
  7319. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7320. $ctx1.sendIdx["last:"]=1;
  7321. //>>excludeEnd("ctx");
  7322. $self._assert_equals_($1,$self._collectionLastTwo());
  7323. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7324. $ctx1.sendIdx["assert:equals:"]=1;
  7325. //>>excludeEnd("ctx");
  7326. $4=$self._collection();
  7327. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7328. $ctx1.sendIdx["collection"]=2;
  7329. //>>excludeEnd("ctx");
  7330. $3=$recv($4)._last_((0));
  7331. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7332. $ctx1.sendIdx["last:"]=2;
  7333. //>>excludeEnd("ctx");
  7334. $self._assert_equals_($3,$recv($self._collectionClass())._new());
  7335. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7336. $ctx1.sendIdx["assert:equals:"]=2;
  7337. //>>excludeEnd("ctx");
  7338. $6=$self._collection();
  7339. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7340. $ctx1.sendIdx["collection"]=3;
  7341. //>>excludeEnd("ctx");
  7342. $5=$recv($6)._last_($self._collectionSize());
  7343. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7344. $ctx1.sendIdx["last:"]=3;
  7345. //>>excludeEnd("ctx");
  7346. $7=$self._collection();
  7347. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7348. $ctx1.sendIdx["collection"]=4;
  7349. //>>excludeEnd("ctx");
  7350. $self._assert_equals_($5,$7);
  7351. $self._should_raise_((function(){
  7352. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7353. return $core.withContext(function($ctx2) {
  7354. //>>excludeEnd("ctx");
  7355. return $recv($self._collection())._last_((33));
  7356. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7357. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  7358. //>>excludeEnd("ctx");
  7359. }),$globals.Error);
  7360. return self;
  7361. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7362. }, function($ctx1) {$ctx1.fill(self,"testLastN",{},$globals.SequenceableCollectionTest)});
  7363. //>>excludeEnd("ctx");
  7364. },
  7365. //>>excludeStart("ide", pragmas.excludeIdeData);
  7366. args: [],
  7367. source: "testLastN\x0a\x09self \x0a\x09\x09assert: (self collection last: 2) \x0a\x09\x09equals: self collectionLastTwo.\x0a\x09\x09\x0a\x09self\x0a\x09\x09assert: (self collection last: 0)\x0a\x09\x09equals: self collectionClass new.\x0a\x0a\x09self\x0a\x09\x09assert: (self collection last: self collectionSize)\x0a\x09\x09equals: self collection.\x0a\x0a\x09self should: [ self collection last: 33 ] raise: Error",
  7368. referencedClasses: ["Error"],
  7369. //>>excludeEnd("ide");
  7370. messageSends: ["assert:equals:", "last:", "collection", "collectionLastTwo", "new", "collectionClass", "collectionSize", "should:raise:"]
  7371. }),
  7372. $globals.SequenceableCollectionTest);
  7373. $core.addMethod(
  7374. $core.method({
  7375. selector: "testSecond",
  7376. protocol: "tests",
  7377. fn: function (){
  7378. var self=this,$self=this;
  7379. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7380. return $core.withContext(function($ctx1) {
  7381. //>>excludeEnd("ctx");
  7382. var $2,$1;
  7383. $2=$self._collection();
  7384. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7385. $ctx1.sendIdx["collection"]=1;
  7386. //>>excludeEnd("ctx");
  7387. $1=$recv($2)._second();
  7388. $self._assert_equals_($1,$recv($self._collection())._at_((2)));
  7389. return self;
  7390. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7391. }, function($ctx1) {$ctx1.fill(self,"testSecond",{},$globals.SequenceableCollectionTest)});
  7392. //>>excludeEnd("ctx");
  7393. },
  7394. //>>excludeStart("ide", pragmas.excludeIdeData);
  7395. args: [],
  7396. source: "testSecond\x0a\x09self assert: (self collection second) equals: (self collection at: 2)",
  7397. referencedClasses: [],
  7398. //>>excludeEnd("ide");
  7399. messageSends: ["assert:equals:", "second", "collection", "at:"]
  7400. }),
  7401. $globals.SequenceableCollectionTest);
  7402. $core.addMethod(
  7403. $core.method({
  7404. selector: "testThird",
  7405. protocol: "tests",
  7406. fn: function (){
  7407. var self=this,$self=this;
  7408. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7409. return $core.withContext(function($ctx1) {
  7410. //>>excludeEnd("ctx");
  7411. var $2,$1;
  7412. $2=$self._collection();
  7413. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7414. $ctx1.sendIdx["collection"]=1;
  7415. //>>excludeEnd("ctx");
  7416. $1=$recv($2)._third();
  7417. $self._assert_equals_($1,$recv($self._collection())._at_((3)));
  7418. return self;
  7419. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7420. }, function($ctx1) {$ctx1.fill(self,"testThird",{},$globals.SequenceableCollectionTest)});
  7421. //>>excludeEnd("ctx");
  7422. },
  7423. //>>excludeStart("ide", pragmas.excludeIdeData);
  7424. args: [],
  7425. source: "testThird\x0a\x09self assert: (self collection third) equals: (self collection at: 3)",
  7426. referencedClasses: [],
  7427. //>>excludeEnd("ide");
  7428. messageSends: ["assert:equals:", "third", "collection", "at:"]
  7429. }),
  7430. $globals.SequenceableCollectionTest);
  7431. $core.addClass("ArrayTest", $globals.SequenceableCollectionTest, [], "Kernel-Tests");
  7432. $core.addMethod(
  7433. $core.method({
  7434. selector: "collection",
  7435. protocol: "fixture",
  7436. fn: function (){
  7437. var self=this,$self=this;
  7438. return [(1), (2), (3), (-4)];
  7439. },
  7440. //>>excludeStart("ide", pragmas.excludeIdeData);
  7441. args: [],
  7442. source: "collection\x0a\x09^ #(1 2 3 -4)",
  7443. referencedClasses: [],
  7444. //>>excludeEnd("ide");
  7445. messageSends: []
  7446. }),
  7447. $globals.ArrayTest);
  7448. $core.addMethod(
  7449. $core.method({
  7450. selector: "collectionFirst",
  7451. protocol: "fixture",
  7452. fn: function (){
  7453. var self=this,$self=this;
  7454. return (1);
  7455. },
  7456. //>>excludeStart("ide", pragmas.excludeIdeData);
  7457. args: [],
  7458. source: "collectionFirst\x0a\x09^ 1",
  7459. referencedClasses: [],
  7460. //>>excludeEnd("ide");
  7461. messageSends: []
  7462. }),
  7463. $globals.ArrayTest);
  7464. $core.addMethod(
  7465. $core.method({
  7466. selector: "collectionFirstTwo",
  7467. protocol: "fixture",
  7468. fn: function (){
  7469. var self=this,$self=this;
  7470. return [(1), (2)];
  7471. },
  7472. //>>excludeStart("ide", pragmas.excludeIdeData);
  7473. args: [],
  7474. source: "collectionFirstTwo\x0a\x09^ #(1 2)",
  7475. referencedClasses: [],
  7476. //>>excludeEnd("ide");
  7477. messageSends: []
  7478. }),
  7479. $globals.ArrayTest);
  7480. $core.addMethod(
  7481. $core.method({
  7482. selector: "collectionLast",
  7483. protocol: "fixture",
  7484. fn: function (){
  7485. var self=this,$self=this;
  7486. return (-4);
  7487. },
  7488. //>>excludeStart("ide", pragmas.excludeIdeData);
  7489. args: [],
  7490. source: "collectionLast\x0a\x09^ -4",
  7491. referencedClasses: [],
  7492. //>>excludeEnd("ide");
  7493. messageSends: []
  7494. }),
  7495. $globals.ArrayTest);
  7496. $core.addMethod(
  7497. $core.method({
  7498. selector: "collectionLastTwo",
  7499. protocol: "fixture",
  7500. fn: function (){
  7501. var self=this,$self=this;
  7502. return [(3), (-4)];
  7503. },
  7504. //>>excludeStart("ide", pragmas.excludeIdeData);
  7505. args: [],
  7506. source: "collectionLastTwo\x0a\x09^ #(3 -4)",
  7507. referencedClasses: [],
  7508. //>>excludeEnd("ide");
  7509. messageSends: []
  7510. }),
  7511. $globals.ArrayTest);
  7512. $core.addMethod(
  7513. $core.method({
  7514. selector: "collectionOfPrintStrings",
  7515. protocol: "fixture",
  7516. fn: function (){
  7517. var self=this,$self=this;
  7518. return ["1", "2", "3", "-4"];
  7519. },
  7520. //>>excludeStart("ide", pragmas.excludeIdeData);
  7521. args: [],
  7522. source: "collectionOfPrintStrings\x0a\x09^ #('1' '2' '3' '-4')",
  7523. referencedClasses: [],
  7524. //>>excludeEnd("ide");
  7525. messageSends: []
  7526. }),
  7527. $globals.ArrayTest);
  7528. $core.addMethod(
  7529. $core.method({
  7530. selector: "collectionSize",
  7531. protocol: "fixture",
  7532. fn: function (){
  7533. var self=this,$self=this;
  7534. return (4);
  7535. },
  7536. //>>excludeStart("ide", pragmas.excludeIdeData);
  7537. args: [],
  7538. source: "collectionSize\x0a\x09^ 4",
  7539. referencedClasses: [],
  7540. //>>excludeEnd("ide");
  7541. messageSends: []
  7542. }),
  7543. $globals.ArrayTest);
  7544. $core.addMethod(
  7545. $core.method({
  7546. selector: "collectionWithDuplicates",
  7547. protocol: "fixture",
  7548. fn: function (){
  7549. var self=this,$self=this;
  7550. return ["a", "b", "c", (1), (2), (1), "a", []];
  7551. },
  7552. //>>excludeStart("ide", pragmas.excludeIdeData);
  7553. args: [],
  7554. source: "collectionWithDuplicates\x0a\x09^ #('a' 'b' 'c' 1 2 1 'a' ())",
  7555. referencedClasses: [],
  7556. //>>excludeEnd("ide");
  7557. messageSends: []
  7558. }),
  7559. $globals.ArrayTest);
  7560. $core.addMethod(
  7561. $core.method({
  7562. selector: "collectionWithNewValue",
  7563. protocol: "fixture",
  7564. fn: function (){
  7565. var self=this,$self=this;
  7566. return [(1), (2), (3), (-4), "N"];
  7567. },
  7568. //>>excludeStart("ide", pragmas.excludeIdeData);
  7569. args: [],
  7570. source: "collectionWithNewValue\x0a\x09^ #(1 2 3 -4 'N')",
  7571. referencedClasses: [],
  7572. //>>excludeEnd("ide");
  7573. messageSends: []
  7574. }),
  7575. $globals.ArrayTest);
  7576. $core.addMethod(
  7577. $core.method({
  7578. selector: "sampleNewIndex",
  7579. protocol: "fixture",
  7580. fn: function (){
  7581. var self=this,$self=this;
  7582. return (5);
  7583. },
  7584. //>>excludeStart("ide", pragmas.excludeIdeData);
  7585. args: [],
  7586. source: "sampleNewIndex\x0a\x09^ 5",
  7587. referencedClasses: [],
  7588. //>>excludeEnd("ide");
  7589. messageSends: []
  7590. }),
  7591. $globals.ArrayTest);
  7592. $core.addMethod(
  7593. $core.method({
  7594. selector: "samplesDo:",
  7595. protocol: "fixture",
  7596. fn: function (aBlock){
  7597. var self=this,$self=this;
  7598. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7599. return $core.withContext(function($ctx1) {
  7600. //>>excludeEnd("ctx");
  7601. (
  7602. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7603. $ctx1.supercall = true,
  7604. //>>excludeEnd("ctx");
  7605. ($globals.ArrayTest.superclass||$boot.nilAsClass).fn.prototype._samplesDo_.apply($self, [aBlock]));
  7606. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7607. $ctx1.supercall = false;
  7608. //>>excludeEnd("ctx");;
  7609. $recv(aBlock)._value_value_((3),(3));
  7610. return self;
  7611. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7612. }, function($ctx1) {$ctx1.fill(self,"samplesDo:",{aBlock:aBlock},$globals.ArrayTest)});
  7613. //>>excludeEnd("ctx");
  7614. },
  7615. //>>excludeStart("ide", pragmas.excludeIdeData);
  7616. args: ["aBlock"],
  7617. source: "samplesDo: aBlock\x0a\x09super samplesDo: aBlock.\x0a\x09aBlock value: 3 value: 3.",
  7618. referencedClasses: [],
  7619. //>>excludeEnd("ide");
  7620. messageSends: ["samplesDo:", "value:value:"]
  7621. }),
  7622. $globals.ArrayTest);
  7623. $core.addMethod(
  7624. $core.method({
  7625. selector: "testAdd",
  7626. protocol: "tests",
  7627. fn: function (){
  7628. var self=this,$self=this;
  7629. var array;
  7630. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7631. return $core.withContext(function($ctx1) {
  7632. //>>excludeEnd("ctx");
  7633. array=$self._collection();
  7634. $recv(array)._add_((6));
  7635. $self._assert_equals_($recv(array)._last(),(6));
  7636. return self;
  7637. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7638. }, function($ctx1) {$ctx1.fill(self,"testAdd",{array:array},$globals.ArrayTest)});
  7639. //>>excludeEnd("ctx");
  7640. },
  7641. //>>excludeStart("ide", pragmas.excludeIdeData);
  7642. args: [],
  7643. source: "testAdd \x0a\x09| array | \x0a\x09array := self collection. \x0a\x09array add: 6.\x0a\x09\x0a\x09self assert: array last equals: 6",
  7644. referencedClasses: [],
  7645. //>>excludeEnd("ide");
  7646. messageSends: ["collection", "add:", "assert:equals:", "last"]
  7647. }),
  7648. $globals.ArrayTest);
  7649. $core.addMethod(
  7650. $core.method({
  7651. selector: "testAddFirst",
  7652. protocol: "tests",
  7653. fn: function (){
  7654. var self=this,$self=this;
  7655. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7656. return $core.withContext(function($ctx1) {
  7657. //>>excludeEnd("ctx");
  7658. var $3,$2,$1;
  7659. $3=$self._collection();
  7660. $recv($3)._addFirst_((0));
  7661. $2=$recv($3)._yourself();
  7662. $1=$recv($2)._first();
  7663. $self._assert_equals_($1,(0));
  7664. return self;
  7665. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7666. }, function($ctx1) {$ctx1.fill(self,"testAddFirst",{},$globals.ArrayTest)});
  7667. //>>excludeEnd("ctx");
  7668. },
  7669. //>>excludeStart("ide", pragmas.excludeIdeData);
  7670. args: [],
  7671. source: "testAddFirst\x0a\x09self assert: (self collection addFirst: 0; yourself) first equals: 0",
  7672. referencedClasses: [],
  7673. //>>excludeEnd("ide");
  7674. messageSends: ["assert:equals:", "first", "addFirst:", "collection", "yourself"]
  7675. }),
  7676. $globals.ArrayTest);
  7677. $core.addMethod(
  7678. $core.method({
  7679. selector: "testPrintString",
  7680. protocol: "tests",
  7681. fn: function (){
  7682. var self=this,$self=this;
  7683. var array;
  7684. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7685. return $core.withContext(function($ctx1) {
  7686. //>>excludeEnd("ctx");
  7687. var $1,$2,$3,$4,$5,$6,$7,$8;
  7688. array=$recv($globals.Array)._new();
  7689. $1=$recv(array)._printString();
  7690. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7691. $ctx1.sendIdx["printString"]=1;
  7692. //>>excludeEnd("ctx");
  7693. $self._assert_equals_($1,"an Array ()");
  7694. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7695. $ctx1.sendIdx["assert:equals:"]=1;
  7696. //>>excludeEnd("ctx");
  7697. $2=array;
  7698. $recv($2)._add_((1));
  7699. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7700. $ctx1.sendIdx["add:"]=1;
  7701. //>>excludeEnd("ctx");
  7702. $3=$recv($2)._add_((3));
  7703. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7704. $ctx1.sendIdx["add:"]=2;
  7705. //>>excludeEnd("ctx");
  7706. $4=$recv(array)._printString();
  7707. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7708. $ctx1.sendIdx["printString"]=2;
  7709. //>>excludeEnd("ctx");
  7710. $self._assert_equals_($4,"an Array (1 3)");
  7711. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7712. $ctx1.sendIdx["assert:equals:"]=2;
  7713. //>>excludeEnd("ctx");
  7714. $recv(array)._add_("foo");
  7715. $5=$recv(array)._printString();
  7716. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7717. $ctx1.sendIdx["printString"]=3;
  7718. //>>excludeEnd("ctx");
  7719. $self._assert_equals_($5,"an Array (1 3 'foo')");
  7720. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7721. $ctx1.sendIdx["assert:equals:"]=3;
  7722. //>>excludeEnd("ctx");
  7723. $6=array;
  7724. $recv($6)._remove_((1));
  7725. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7726. $ctx1.sendIdx["remove:"]=1;
  7727. //>>excludeEnd("ctx");
  7728. $recv($6)._remove_((3));
  7729. $7=$recv(array)._printString();
  7730. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7731. $ctx1.sendIdx["printString"]=4;
  7732. //>>excludeEnd("ctx");
  7733. $self._assert_equals_($7,"an Array ('foo')");
  7734. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7735. $ctx1.sendIdx["assert:equals:"]=4;
  7736. //>>excludeEnd("ctx");
  7737. $recv(array)._addLast_((3));
  7738. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7739. $ctx1.sendIdx["addLast:"]=1;
  7740. //>>excludeEnd("ctx");
  7741. $8=$recv(array)._printString();
  7742. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7743. $ctx1.sendIdx["printString"]=5;
  7744. //>>excludeEnd("ctx");
  7745. $self._assert_equals_($8,"an Array ('foo' 3)");
  7746. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7747. $ctx1.sendIdx["assert:equals:"]=5;
  7748. //>>excludeEnd("ctx");
  7749. $recv(array)._addLast_((3));
  7750. $self._assert_equals_($recv(array)._printString(),"an Array ('foo' 3 3)");
  7751. return self;
  7752. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7753. }, function($ctx1) {$ctx1.fill(self,"testPrintString",{array:array},$globals.ArrayTest)});
  7754. //>>excludeEnd("ctx");
  7755. },
  7756. //>>excludeStart("ide", pragmas.excludeIdeData);
  7757. args: [],
  7758. source: "testPrintString\x0a\x09| array |\x0a\x09array := Array new.\x0a\x09self assert: array printString equals: 'an Array ()'.\x0a\x09array add: 1; add: 3.\x0a\x09self assert: array printString equals: 'an Array (1 3)'.\x0a\x09array add: 'foo'.\x0a\x09self assert: array printString equals: 'an Array (1 3 ''foo'')'.\x0a\x09array remove: 1; remove: 3.\x0a\x09self assert: array printString equals: 'an Array (''foo'')'.\x0a\x09array addLast: 3.\x0a\x09self assert: array printString equals: 'an Array (''foo'' 3)'.\x0a\x09array addLast: 3.\x0a\x09self assert: array printString equals: 'an Array (''foo'' 3 3)'.",
  7759. referencedClasses: ["Array"],
  7760. //>>excludeEnd("ide");
  7761. messageSends: ["new", "assert:equals:", "printString", "add:", "remove:", "addLast:"]
  7762. }),
  7763. $globals.ArrayTest);
  7764. $core.addMethod(
  7765. $core.method({
  7766. selector: "testRemove",
  7767. protocol: "tests",
  7768. fn: function (){
  7769. var self=this,$self=this;
  7770. var array;
  7771. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7772. return $core.withContext(function($ctx1) {
  7773. //>>excludeEnd("ctx");
  7774. array=[(1), (2), (3), (4), (5)];
  7775. $recv(array)._remove_((3));
  7776. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7777. $ctx1.sendIdx["remove:"]=1;
  7778. //>>excludeEnd("ctx");
  7779. $self._assert_equals_(array,[(1), (2), (4), (5)]);
  7780. $self._should_raise_((function(){
  7781. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7782. return $core.withContext(function($ctx2) {
  7783. //>>excludeEnd("ctx");
  7784. return $recv(array)._remove_((3));
  7785. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7786. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  7787. //>>excludeEnd("ctx");
  7788. }),$globals.Error);
  7789. return self;
  7790. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7791. }, function($ctx1) {$ctx1.fill(self,"testRemove",{array:array},$globals.ArrayTest)});
  7792. //>>excludeEnd("ctx");
  7793. },
  7794. //>>excludeStart("ide", pragmas.excludeIdeData);
  7795. args: [],
  7796. source: "testRemove \x0a\x09| array |\x0a\x09array := #(1 2 3 4 5). \x0a\x09array remove: 3.\x0a\x0a\x09self assert: array equals: #(1 2 4 5).\x0a\x09self should: [ array remove: 3 ] raise: Error",
  7797. referencedClasses: ["Error"],
  7798. //>>excludeEnd("ide");
  7799. messageSends: ["remove:", "assert:equals:", "should:raise:"]
  7800. }),
  7801. $globals.ArrayTest);
  7802. $core.addMethod(
  7803. $core.method({
  7804. selector: "testRemoveFromTo",
  7805. protocol: "tests",
  7806. fn: function (){
  7807. var self=this,$self=this;
  7808. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7809. return $core.withContext(function($ctx1) {
  7810. //>>excludeEnd("ctx");
  7811. var $1,$2;
  7812. $1=[(1), (2), (3), (4)]._removeFrom_to_((1),(3));
  7813. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7814. $ctx1.sendIdx["removeFrom:to:"]=1;
  7815. //>>excludeEnd("ctx");
  7816. $self._assert_equals_($1,[(4)]);
  7817. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7818. $ctx1.sendIdx["assert:equals:"]=1;
  7819. //>>excludeEnd("ctx");
  7820. $2=[(1), (2), (3), (4)]._removeFrom_to_((2),(3));
  7821. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7822. $ctx1.sendIdx["removeFrom:to:"]=2;
  7823. //>>excludeEnd("ctx");
  7824. $self._assert_equals_($2,[(1), (4)]);
  7825. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7826. $ctx1.sendIdx["assert:equals:"]=2;
  7827. //>>excludeEnd("ctx");
  7828. $self._assert_equals_([(1), (2), (3), (4)]._removeFrom_to_((2),(4)),[(1)]);
  7829. return self;
  7830. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7831. }, function($ctx1) {$ctx1.fill(self,"testRemoveFromTo",{},$globals.ArrayTest)});
  7832. //>>excludeEnd("ctx");
  7833. },
  7834. //>>excludeStart("ide", pragmas.excludeIdeData);
  7835. args: [],
  7836. source: "testRemoveFromTo\x0a\x09\x0a\x09self assert: (#(1 2 3 4) removeFrom: 1 to: 3) equals: #(4).\x0a\x09self assert: (#(1 2 3 4) removeFrom: 2 to: 3) equals: #(1 4).\x0a\x09self assert: (#(1 2 3 4) removeFrom: 2 to: 4) equals: #(1)",
  7837. referencedClasses: [],
  7838. //>>excludeEnd("ide");
  7839. messageSends: ["assert:equals:", "removeFrom:to:"]
  7840. }),
  7841. $globals.ArrayTest);
  7842. $core.addMethod(
  7843. $core.method({
  7844. selector: "testRemoveIndex",
  7845. protocol: "tests",
  7846. fn: function (){
  7847. var self=this,$self=this;
  7848. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7849. return $core.withContext(function($ctx1) {
  7850. //>>excludeEnd("ctx");
  7851. var $1,$2;
  7852. $1=[(1), (2), (3), (4)]._removeIndex_((2));
  7853. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7854. $ctx1.sendIdx["removeIndex:"]=1;
  7855. //>>excludeEnd("ctx");
  7856. $self._assert_equals_($1,[(1), (3), (4)]);
  7857. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7858. $ctx1.sendIdx["assert:equals:"]=1;
  7859. //>>excludeEnd("ctx");
  7860. $2=[(1), (2), (3), (4)]._removeIndex_((1));
  7861. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7862. $ctx1.sendIdx["removeIndex:"]=2;
  7863. //>>excludeEnd("ctx");
  7864. $self._assert_equals_($2,[(2), (3), (4)]);
  7865. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7866. $ctx1.sendIdx["assert:equals:"]=2;
  7867. //>>excludeEnd("ctx");
  7868. $self._assert_equals_(["hello"]._removeIndex_((1)),[]);
  7869. return self;
  7870. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7871. }, function($ctx1) {$ctx1.fill(self,"testRemoveIndex",{},$globals.ArrayTest)});
  7872. //>>excludeEnd("ctx");
  7873. },
  7874. //>>excludeStart("ide", pragmas.excludeIdeData);
  7875. args: [],
  7876. source: "testRemoveIndex\x0a\x09\x0a\x09self assert: (#(1 2 3 4) removeIndex: 2) equals: #(1 3 4).\x0a\x09self assert: (#(1 2 3 4) removeIndex: 1) equals: #(2 3 4).\x0a\x09self assert: (#('hello') removeIndex: 1) equals: #()",
  7877. referencedClasses: [],
  7878. //>>excludeEnd("ide");
  7879. messageSends: ["assert:equals:", "removeIndex:"]
  7880. }),
  7881. $globals.ArrayTest);
  7882. $core.addMethod(
  7883. $core.method({
  7884. selector: "testRemoveLast",
  7885. protocol: "tests",
  7886. fn: function (){
  7887. var self=this,$self=this;
  7888. var array;
  7889. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7890. return $core.withContext(function($ctx1) {
  7891. //>>excludeEnd("ctx");
  7892. array=[(1), (2)];
  7893. $recv(array)._removeLast();
  7894. $self._assert_equals_($recv(array)._last(),(1));
  7895. return self;
  7896. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7897. }, function($ctx1) {$ctx1.fill(self,"testRemoveLast",{array:array},$globals.ArrayTest)});
  7898. //>>excludeEnd("ctx");
  7899. },
  7900. //>>excludeStart("ide", pragmas.excludeIdeData);
  7901. args: [],
  7902. source: "testRemoveLast \x0a\x09| array |\x0a\x09array := #(1 2). \x0a\x09array removeLast.\x0a\x09\x0a\x09self assert: array last equals: 1",
  7903. referencedClasses: [],
  7904. //>>excludeEnd("ide");
  7905. messageSends: ["removeLast", "assert:equals:", "last"]
  7906. }),
  7907. $globals.ArrayTest);
  7908. $core.addMethod(
  7909. $core.method({
  7910. selector: "testReversed",
  7911. protocol: "tests",
  7912. fn: function (){
  7913. var self=this,$self=this;
  7914. var array;
  7915. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7916. return $core.withContext(function($ctx1) {
  7917. //>>excludeEnd("ctx");
  7918. array=[(5), (4), (3), (2), (1)];
  7919. $self._assert_equals_($recv(array)._reversed(),[(1), (2), (3), (4), (5)]);
  7920. return self;
  7921. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7922. }, function($ctx1) {$ctx1.fill(self,"testReversed",{array:array},$globals.ArrayTest)});
  7923. //>>excludeEnd("ctx");
  7924. },
  7925. //>>excludeStart("ide", pragmas.excludeIdeData);
  7926. args: [],
  7927. source: "testReversed\x0a\x09|array|\x0a\x09array := #(5 4 3 2 1). \x0a\x09self assert: (array reversed) equals: #(1 2 3 4 5)",
  7928. referencedClasses: [],
  7929. //>>excludeEnd("ide");
  7930. messageSends: ["assert:equals:", "reversed"]
  7931. }),
  7932. $globals.ArrayTest);
  7933. $core.addMethod(
  7934. $core.method({
  7935. selector: "testSort",
  7936. protocol: "tests",
  7937. fn: function (){
  7938. var self=this,$self=this;
  7939. var array;
  7940. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7941. return $core.withContext(function($ctx1) {
  7942. //>>excludeEnd("ctx");
  7943. array=[(10), (1), (5)];
  7944. $recv(array)._sort();
  7945. $self._assert_equals_(array,[(1), (5), (10)]);
  7946. return self;
  7947. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7948. }, function($ctx1) {$ctx1.fill(self,"testSort",{array:array},$globals.ArrayTest)});
  7949. //>>excludeEnd("ctx");
  7950. },
  7951. //>>excludeStart("ide", pragmas.excludeIdeData);
  7952. args: [],
  7953. source: "testSort\x0a\x09| array |\x0a\x09array := #(10 1 5). \x0a\x09array sort.\x0a\x09self assert: array equals: #(1 5 10)",
  7954. referencedClasses: [],
  7955. //>>excludeEnd("ide");
  7956. messageSends: ["sort", "assert:equals:"]
  7957. }),
  7958. $globals.ArrayTest);
  7959. $core.addMethod(
  7960. $core.method({
  7961. selector: "collectionClass",
  7962. protocol: "fixture",
  7963. fn: function (){
  7964. var self=this,$self=this;
  7965. return $globals.Array;
  7966. },
  7967. //>>excludeStart("ide", pragmas.excludeIdeData);
  7968. args: [],
  7969. source: "collectionClass\x0a\x09^ Array",
  7970. referencedClasses: ["Array"],
  7971. //>>excludeEnd("ide");
  7972. messageSends: []
  7973. }),
  7974. $globals.ArrayTest.a$cls);
  7975. $core.addClass("StringTest", $globals.SequenceableCollectionTest, [], "Kernel-Tests");
  7976. $core.addMethod(
  7977. $core.method({
  7978. selector: "collection",
  7979. protocol: "fixture",
  7980. fn: function (){
  7981. var self=this,$self=this;
  7982. return "helLo";
  7983. },
  7984. //>>excludeStart("ide", pragmas.excludeIdeData);
  7985. args: [],
  7986. source: "collection\x0a\x09^ 'helLo'",
  7987. referencedClasses: [],
  7988. //>>excludeEnd("ide");
  7989. messageSends: []
  7990. }),
  7991. $globals.StringTest);
  7992. $core.addMethod(
  7993. $core.method({
  7994. selector: "collectionFirst",
  7995. protocol: "fixture",
  7996. fn: function (){
  7997. var self=this,$self=this;
  7998. return "h";
  7999. },
  8000. //>>excludeStart("ide", pragmas.excludeIdeData);
  8001. args: [],
  8002. source: "collectionFirst\x0a\x09^ 'h'",
  8003. referencedClasses: [],
  8004. //>>excludeEnd("ide");
  8005. messageSends: []
  8006. }),
  8007. $globals.StringTest);
  8008. $core.addMethod(
  8009. $core.method({
  8010. selector: "collectionFirstTwo",
  8011. protocol: "fixture",
  8012. fn: function (){
  8013. var self=this,$self=this;
  8014. return "he";
  8015. },
  8016. //>>excludeStart("ide", pragmas.excludeIdeData);
  8017. args: [],
  8018. source: "collectionFirstTwo\x0a\x09^ 'he'",
  8019. referencedClasses: [],
  8020. //>>excludeEnd("ide");
  8021. messageSends: []
  8022. }),
  8023. $globals.StringTest);
  8024. $core.addMethod(
  8025. $core.method({
  8026. selector: "collectionLast",
  8027. protocol: "fixture",
  8028. fn: function (){
  8029. var self=this,$self=this;
  8030. return "o";
  8031. },
  8032. //>>excludeStart("ide", pragmas.excludeIdeData);
  8033. args: [],
  8034. source: "collectionLast\x0a\x09^ 'o'",
  8035. referencedClasses: [],
  8036. //>>excludeEnd("ide");
  8037. messageSends: []
  8038. }),
  8039. $globals.StringTest);
  8040. $core.addMethod(
  8041. $core.method({
  8042. selector: "collectionLastTwo",
  8043. protocol: "fixture",
  8044. fn: function (){
  8045. var self=this,$self=this;
  8046. return "Lo";
  8047. },
  8048. //>>excludeStart("ide", pragmas.excludeIdeData);
  8049. args: [],
  8050. source: "collectionLastTwo\x0a\x09^ 'Lo'",
  8051. referencedClasses: [],
  8052. //>>excludeEnd("ide");
  8053. messageSends: []
  8054. }),
  8055. $globals.StringTest);
  8056. $core.addMethod(
  8057. $core.method({
  8058. selector: "collectionOfPrintStrings",
  8059. protocol: "fixture",
  8060. fn: function (){
  8061. var self=this,$self=this;
  8062. return "'h''e''l''L''o'";
  8063. },
  8064. //>>excludeStart("ide", pragmas.excludeIdeData);
  8065. args: [],
  8066. source: "collectionOfPrintStrings\x0a\x09^ '''h''''e''''l''''L''''o'''",
  8067. referencedClasses: [],
  8068. //>>excludeEnd("ide");
  8069. messageSends: []
  8070. }),
  8071. $globals.StringTest);
  8072. $core.addMethod(
  8073. $core.method({
  8074. selector: "collectionSize",
  8075. protocol: "fixture",
  8076. fn: function (){
  8077. var self=this,$self=this;
  8078. return (5);
  8079. },
  8080. //>>excludeStart("ide", pragmas.excludeIdeData);
  8081. args: [],
  8082. source: "collectionSize\x0a\x09^ 5",
  8083. referencedClasses: [],
  8084. //>>excludeEnd("ide");
  8085. messageSends: []
  8086. }),
  8087. $globals.StringTest);
  8088. $core.addMethod(
  8089. $core.method({
  8090. selector: "collectionWithDuplicates",
  8091. protocol: "fixture",
  8092. fn: function (){
  8093. var self=this,$self=this;
  8094. return "abbaerten";
  8095. },
  8096. //>>excludeStart("ide", pragmas.excludeIdeData);
  8097. args: [],
  8098. source: "collectionWithDuplicates\x0a\x09^ 'abbaerten'",
  8099. referencedClasses: [],
  8100. //>>excludeEnd("ide");
  8101. messageSends: []
  8102. }),
  8103. $globals.StringTest);
  8104. $core.addMethod(
  8105. $core.method({
  8106. selector: "collectionWithNewValue",
  8107. protocol: "fixture",
  8108. fn: function (){
  8109. var self=this,$self=this;
  8110. return "helLoN";
  8111. },
  8112. //>>excludeStart("ide", pragmas.excludeIdeData);
  8113. args: [],
  8114. source: "collectionWithNewValue\x0a\x09^ 'helLoN'",
  8115. referencedClasses: [],
  8116. //>>excludeEnd("ide");
  8117. messageSends: []
  8118. }),
  8119. $globals.StringTest);
  8120. $core.addMethod(
  8121. $core.method({
  8122. selector: "sampleNewValueAsCollection",
  8123. protocol: "fixture",
  8124. fn: function (){
  8125. var self=this,$self=this;
  8126. return "N";
  8127. },
  8128. //>>excludeStart("ide", pragmas.excludeIdeData);
  8129. args: [],
  8130. source: "sampleNewValueAsCollection\x0a\x09^ 'N'",
  8131. referencedClasses: [],
  8132. //>>excludeEnd("ide");
  8133. messageSends: []
  8134. }),
  8135. $globals.StringTest);
  8136. $core.addMethod(
  8137. $core.method({
  8138. selector: "samplesDo:",
  8139. protocol: "fixture",
  8140. fn: function (aBlock){
  8141. var self=this,$self=this;
  8142. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8143. return $core.withContext(function($ctx1) {
  8144. //>>excludeEnd("ctx");
  8145. (
  8146. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8147. $ctx1.supercall = true,
  8148. //>>excludeEnd("ctx");
  8149. ($globals.StringTest.superclass||$boot.nilAsClass).fn.prototype._samplesDo_.apply($self, [aBlock]));
  8150. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8151. $ctx1.supercall = false;
  8152. //>>excludeEnd("ctx");;
  8153. $recv(aBlock)._value_value_((3),"l");
  8154. return self;
  8155. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8156. }, function($ctx1) {$ctx1.fill(self,"samplesDo:",{aBlock:aBlock},$globals.StringTest)});
  8157. //>>excludeEnd("ctx");
  8158. },
  8159. //>>excludeStart("ide", pragmas.excludeIdeData);
  8160. args: ["aBlock"],
  8161. source: "samplesDo: aBlock\x0a\x09super samplesDo: aBlock.\x0a\x09aBlock value: 3 value: 'l'",
  8162. referencedClasses: [],
  8163. //>>excludeEnd("ide");
  8164. messageSends: ["samplesDo:", "value:value:"]
  8165. }),
  8166. $globals.StringTest);
  8167. $core.addMethod(
  8168. $core.method({
  8169. selector: "testAddAll",
  8170. protocol: "tests",
  8171. fn: function (){
  8172. var self=this,$self=this;
  8173. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8174. return $core.withContext(function($ctx1) {
  8175. //>>excludeEnd("ctx");
  8176. var $1;
  8177. $self._should_raise_((function(){
  8178. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8179. return $core.withContext(function($ctx2) {
  8180. //>>excludeEnd("ctx");
  8181. $1=$self._collection();
  8182. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8183. $ctx2.sendIdx["collection"]=1;
  8184. //>>excludeEnd("ctx");
  8185. return $recv($1)._addAll_($self._collection());
  8186. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8187. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  8188. //>>excludeEnd("ctx");
  8189. }),$globals.Error);
  8190. return self;
  8191. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8192. }, function($ctx1) {$ctx1.fill(self,"testAddAll",{},$globals.StringTest)});
  8193. //>>excludeEnd("ctx");
  8194. },
  8195. //>>excludeStart("ide", pragmas.excludeIdeData);
  8196. args: [],
  8197. source: "testAddAll\x0a\x09\x22String instances are read-only\x22\x0a\x09self should: [ self collection addAll: self collection ] raise: Error",
  8198. referencedClasses: ["Error"],
  8199. //>>excludeEnd("ide");
  8200. messageSends: ["should:raise:", "addAll:", "collection"]
  8201. }),
  8202. $globals.StringTest);
  8203. $core.addMethod(
  8204. $core.method({
  8205. selector: "testAddRemove",
  8206. protocol: "tests",
  8207. fn: function (){
  8208. var self=this,$self=this;
  8209. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8210. return $core.withContext(function($ctx1) {
  8211. //>>excludeEnd("ctx");
  8212. $self._should_raise_((function(){
  8213. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8214. return $core.withContext(function($ctx2) {
  8215. //>>excludeEnd("ctx");
  8216. return "hello"._add_("a");
  8217. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8218. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  8219. //>>excludeEnd("ctx");
  8220. }),$globals.Error);
  8221. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8222. $ctx1.sendIdx["should:raise:"]=1;
  8223. //>>excludeEnd("ctx");
  8224. $self._should_raise_((function(){
  8225. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8226. return $core.withContext(function($ctx2) {
  8227. //>>excludeEnd("ctx");
  8228. return "hello"._remove_("h");
  8229. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8230. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  8231. //>>excludeEnd("ctx");
  8232. }),$globals.Error);
  8233. return self;
  8234. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8235. }, function($ctx1) {$ctx1.fill(self,"testAddRemove",{},$globals.StringTest)});
  8236. //>>excludeEnd("ctx");
  8237. },
  8238. //>>excludeStart("ide", pragmas.excludeIdeData);
  8239. args: [],
  8240. source: "testAddRemove\x0a\x09self should: [ 'hello' add: 'a' ] raise: Error.\x0a\x09self should: [ 'hello' remove: 'h' ] raise: Error",
  8241. referencedClasses: ["Error"],
  8242. //>>excludeEnd("ide");
  8243. messageSends: ["should:raise:", "add:", "remove:"]
  8244. }),
  8245. $globals.StringTest);
  8246. $core.addMethod(
  8247. $core.method({
  8248. selector: "testAsArray",
  8249. protocol: "tests",
  8250. fn: function (){
  8251. var self=this,$self=this;
  8252. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8253. return $core.withContext(function($ctx1) {
  8254. //>>excludeEnd("ctx");
  8255. $self._assert_equals_("hello"._asArray(),["h", "e", "l", "l", "o"]);
  8256. return self;
  8257. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8258. }, function($ctx1) {$ctx1.fill(self,"testAsArray",{},$globals.StringTest)});
  8259. //>>excludeEnd("ctx");
  8260. },
  8261. //>>excludeStart("ide", pragmas.excludeIdeData);
  8262. args: [],
  8263. source: "testAsArray\x0a\x09self assert: 'hello' asArray equals: #('h' 'e' 'l' 'l' 'o').",
  8264. referencedClasses: [],
  8265. //>>excludeEnd("ide");
  8266. messageSends: ["assert:equals:", "asArray"]
  8267. }),
  8268. $globals.StringTest);
  8269. $core.addMethod(
  8270. $core.method({
  8271. selector: "testAsLowerCase",
  8272. protocol: "tests",
  8273. fn: function (){
  8274. var self=this,$self=this;
  8275. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8276. return $core.withContext(function($ctx1) {
  8277. //>>excludeEnd("ctx");
  8278. $self._assert_equals_("JACKIE"._asLowercase(),"jackie");
  8279. return self;
  8280. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8281. }, function($ctx1) {$ctx1.fill(self,"testAsLowerCase",{},$globals.StringTest)});
  8282. //>>excludeEnd("ctx");
  8283. },
  8284. //>>excludeStart("ide", pragmas.excludeIdeData);
  8285. args: [],
  8286. source: "testAsLowerCase\x0a\x09self assert: 'JACKIE' asLowercase equals: 'jackie'.",
  8287. referencedClasses: [],
  8288. //>>excludeEnd("ide");
  8289. messageSends: ["assert:equals:", "asLowercase"]
  8290. }),
  8291. $globals.StringTest);
  8292. $core.addMethod(
  8293. $core.method({
  8294. selector: "testAsNumber",
  8295. protocol: "tests",
  8296. fn: function (){
  8297. var self=this,$self=this;
  8298. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8299. return $core.withContext(function($ctx1) {
  8300. //>>excludeEnd("ctx");
  8301. var $1,$2;
  8302. $1="3"._asNumber();
  8303. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8304. $ctx1.sendIdx["asNumber"]=1;
  8305. //>>excludeEnd("ctx");
  8306. $self._assert_equals_($1,(3));
  8307. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8308. $ctx1.sendIdx["assert:equals:"]=1;
  8309. //>>excludeEnd("ctx");
  8310. $2="-3"._asNumber();
  8311. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8312. $ctx1.sendIdx["asNumber"]=2;
  8313. //>>excludeEnd("ctx");
  8314. $self._assert_equals_($2,(-3));
  8315. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8316. $ctx1.sendIdx["assert:equals:"]=2;
  8317. //>>excludeEnd("ctx");
  8318. $self._assert_equals_("-1.5"._asNumber(),(-1.5));
  8319. return self;
  8320. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8321. }, function($ctx1) {$ctx1.fill(self,"testAsNumber",{},$globals.StringTest)});
  8322. //>>excludeEnd("ctx");
  8323. },
  8324. //>>excludeStart("ide", pragmas.excludeIdeData);
  8325. args: [],
  8326. source: "testAsNumber\x0a\x09self assert: '3' asNumber equals: 3.\x0a\x09self assert: '-3' asNumber equals: -3.\x0a\x09self assert: '-1.5' asNumber equals: -1.5.",
  8327. referencedClasses: [],
  8328. //>>excludeEnd("ide");
  8329. messageSends: ["assert:equals:", "asNumber"]
  8330. }),
  8331. $globals.StringTest);
  8332. $core.addMethod(
  8333. $core.method({
  8334. selector: "testAsUpperCase",
  8335. protocol: "tests",
  8336. fn: function (){
  8337. var self=this,$self=this;
  8338. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8339. return $core.withContext(function($ctx1) {
  8340. //>>excludeEnd("ctx");
  8341. $self._assert_equals_("jackie"._asUppercase(),"JACKIE");
  8342. return self;
  8343. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8344. }, function($ctx1) {$ctx1.fill(self,"testAsUpperCase",{},$globals.StringTest)});
  8345. //>>excludeEnd("ctx");
  8346. },
  8347. //>>excludeStart("ide", pragmas.excludeIdeData);
  8348. args: [],
  8349. source: "testAsUpperCase\x0a\x09self assert: 'jackie' asUppercase equals: 'JACKIE'.",
  8350. referencedClasses: [],
  8351. //>>excludeEnd("ide");
  8352. messageSends: ["assert:equals:", "asUppercase"]
  8353. }),
  8354. $globals.StringTest);
  8355. $core.addMethod(
  8356. $core.method({
  8357. selector: "testAsciiValue",
  8358. protocol: "tests",
  8359. fn: function (){
  8360. var self=this,$self=this;
  8361. var characterA,characterU;
  8362. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8363. return $core.withContext(function($ctx1) {
  8364. //>>excludeEnd("ctx");
  8365. var $1;
  8366. characterA="A";
  8367. characterU="U";
  8368. $1=$recv(characterA)._asciiValue();
  8369. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8370. $ctx1.sendIdx["asciiValue"]=1;
  8371. //>>excludeEnd("ctx");
  8372. $self._assert_equals_($1,(65));
  8373. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8374. $ctx1.sendIdx["assert:equals:"]=1;
  8375. //>>excludeEnd("ctx");
  8376. $self._assert_equals_($recv(characterU)._asciiValue(),(85));
  8377. return self;
  8378. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8379. }, function($ctx1) {$ctx1.fill(self,"testAsciiValue",{characterA:characterA,characterU:characterU},$globals.StringTest)});
  8380. //>>excludeEnd("ctx");
  8381. },
  8382. //>>excludeStart("ide", pragmas.excludeIdeData);
  8383. args: [],
  8384. source: "testAsciiValue\x0a | characterA characterU |\x0a characterA := 'A'.\x0a characterU := 'U'.\x0a self assert: (characterA asciiValue) equals:65.\x0a self assert: (characterU asciiValue) equals:85",
  8385. referencedClasses: [],
  8386. //>>excludeEnd("ide");
  8387. messageSends: ["assert:equals:", "asciiValue"]
  8388. }),
  8389. $globals.StringTest);
  8390. $core.addMethod(
  8391. $core.method({
  8392. selector: "testAtIfAbsentPut",
  8393. protocol: "tests",
  8394. fn: function (){
  8395. var self=this,$self=this;
  8396. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8397. return $core.withContext(function($ctx1) {
  8398. //>>excludeEnd("ctx");
  8399. $self._should_raise_((function(){
  8400. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8401. return $core.withContext(function($ctx2) {
  8402. //>>excludeEnd("ctx");
  8403. return "hello"._at_ifAbsentPut_((6),(function(){
  8404. return "a";
  8405. }));
  8406. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8407. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  8408. //>>excludeEnd("ctx");
  8409. }),$globals.Error);
  8410. return self;
  8411. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8412. }, function($ctx1) {$ctx1.fill(self,"testAtIfAbsentPut",{},$globals.StringTest)});
  8413. //>>excludeEnd("ctx");
  8414. },
  8415. //>>excludeStart("ide", pragmas.excludeIdeData);
  8416. args: [],
  8417. source: "testAtIfAbsentPut\x0a\x09\x22String instances are read-only\x22\x0a\x09self should: [ 'hello' at: 6 ifAbsentPut: [ 'a' ] ] raise: Error",
  8418. referencedClasses: ["Error"],
  8419. //>>excludeEnd("ide");
  8420. messageSends: ["should:raise:", "at:ifAbsentPut:"]
  8421. }),
  8422. $globals.StringTest);
  8423. $core.addMethod(
  8424. $core.method({
  8425. selector: "testAtPut",
  8426. protocol: "tests",
  8427. fn: function (){
  8428. var self=this,$self=this;
  8429. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8430. return $core.withContext(function($ctx1) {
  8431. //>>excludeEnd("ctx");
  8432. $self._should_raise_((function(){
  8433. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8434. return $core.withContext(function($ctx2) {
  8435. //>>excludeEnd("ctx");
  8436. return "hello"._at_put_((1),"a");
  8437. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8438. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  8439. //>>excludeEnd("ctx");
  8440. }),$globals.Error);
  8441. return self;
  8442. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8443. }, function($ctx1) {$ctx1.fill(self,"testAtPut",{},$globals.StringTest)});
  8444. //>>excludeEnd("ctx");
  8445. },
  8446. //>>excludeStart("ide", pragmas.excludeIdeData);
  8447. args: [],
  8448. source: "testAtPut\x0a\x09\x22String instances are read-only\x22\x0a\x09self should: [ 'hello' at: 1 put: 'a' ] raise: Error",
  8449. referencedClasses: ["Error"],
  8450. //>>excludeEnd("ide");
  8451. messageSends: ["should:raise:", "at:put:"]
  8452. }),
  8453. $globals.StringTest);
  8454. $core.addMethod(
  8455. $core.method({
  8456. selector: "testCapitalized",
  8457. protocol: "tests",
  8458. fn: function (){
  8459. var self=this,$self=this;
  8460. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8461. return $core.withContext(function($ctx1) {
  8462. //>>excludeEnd("ctx");
  8463. var $1,$2,$3;
  8464. $1="test"._capitalized();
  8465. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8466. $ctx1.sendIdx["capitalized"]=1;
  8467. //>>excludeEnd("ctx");
  8468. $self._assert_equals_($1,"Test");
  8469. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8470. $ctx1.sendIdx["assert:equals:"]=1;
  8471. //>>excludeEnd("ctx");
  8472. $2="Test"._capitalized();
  8473. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8474. $ctx1.sendIdx["capitalized"]=2;
  8475. //>>excludeEnd("ctx");
  8476. $self._assert_equals_($2,"Test");
  8477. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8478. $ctx1.sendIdx["assert:equals:"]=2;
  8479. //>>excludeEnd("ctx");
  8480. $self._assert_equals_(""._capitalized(),"");
  8481. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8482. $ctx1.sendIdx["assert:equals:"]=3;
  8483. //>>excludeEnd("ctx");
  8484. $3="Test"._isCapitalized();
  8485. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8486. $ctx1.sendIdx["isCapitalized"]=1;
  8487. //>>excludeEnd("ctx");
  8488. $self._assert_equals_($3,true);
  8489. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8490. $ctx1.sendIdx["assert:equals:"]=4;
  8491. //>>excludeEnd("ctx");
  8492. $self._assert_equals_("test"._isCapitalized(),false);
  8493. return self;
  8494. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8495. }, function($ctx1) {$ctx1.fill(self,"testCapitalized",{},$globals.StringTest)});
  8496. //>>excludeEnd("ctx");
  8497. },
  8498. //>>excludeStart("ide", pragmas.excludeIdeData);
  8499. args: [],
  8500. source: "testCapitalized\x0a\x09self assert: 'test' capitalized equals: 'Test'.\x0a\x09self assert: 'Test' capitalized equals: 'Test'.\x0a\x09self assert: '' capitalized equals: ''.\x0a\x09self assert: 'Test' isCapitalized equals: true.\x0a\x09self assert: 'test' isCapitalized equals: false.",
  8501. referencedClasses: [],
  8502. //>>excludeEnd("ide");
  8503. messageSends: ["assert:equals:", "capitalized", "isCapitalized"]
  8504. }),
  8505. $globals.StringTest);
  8506. $core.addMethod(
  8507. $core.method({
  8508. selector: "testCharCodeAt",
  8509. protocol: "tests",
  8510. fn: function (){
  8511. var self=this,$self=this;
  8512. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8513. return $core.withContext(function($ctx1) {
  8514. //>>excludeEnd("ctx");
  8515. var $1,$2,$3,$4,$5;
  8516. $1="jackie"._charCodeAt_((1));
  8517. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8518. $ctx1.sendIdx["charCodeAt:"]=1;
  8519. //>>excludeEnd("ctx");
  8520. $self._assert_equals_($1,(106));
  8521. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8522. $ctx1.sendIdx["assert:equals:"]=1;
  8523. //>>excludeEnd("ctx");
  8524. $2="jackie"._charCodeAt_((2));
  8525. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8526. $ctx1.sendIdx["charCodeAt:"]=2;
  8527. //>>excludeEnd("ctx");
  8528. $self._assert_equals_($2,(97));
  8529. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8530. $ctx1.sendIdx["assert:equals:"]=2;
  8531. //>>excludeEnd("ctx");
  8532. $3="jackie"._charCodeAt_((3));
  8533. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8534. $ctx1.sendIdx["charCodeAt:"]=3;
  8535. //>>excludeEnd("ctx");
  8536. $self._assert_equals_($3,(99));
  8537. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8538. $ctx1.sendIdx["assert:equals:"]=3;
  8539. //>>excludeEnd("ctx");
  8540. $4="jackie"._charCodeAt_((4));
  8541. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8542. $ctx1.sendIdx["charCodeAt:"]=4;
  8543. //>>excludeEnd("ctx");
  8544. $self._assert_equals_($4,(107));
  8545. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8546. $ctx1.sendIdx["assert:equals:"]=4;
  8547. //>>excludeEnd("ctx");
  8548. $5="jackie"._charCodeAt_((5));
  8549. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8550. $ctx1.sendIdx["charCodeAt:"]=5;
  8551. //>>excludeEnd("ctx");
  8552. $self._assert_equals_($5,(105));
  8553. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8554. $ctx1.sendIdx["assert:equals:"]=5;
  8555. //>>excludeEnd("ctx");
  8556. $self._assert_equals_("jackie"._charCodeAt_((6)),(101));
  8557. return self;
  8558. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8559. }, function($ctx1) {$ctx1.fill(self,"testCharCodeAt",{},$globals.StringTest)});
  8560. //>>excludeEnd("ctx");
  8561. },
  8562. //>>excludeStart("ide", pragmas.excludeIdeData);
  8563. args: [],
  8564. source: "testCharCodeAt\x0a\x09self assert: ('jackie' charCodeAt:1) equals: 106.\x0a\x09self assert: ('jackie' charCodeAt:2) equals: 97.\x0a\x09self assert: ('jackie' charCodeAt:3) equals: 99.\x0a\x09self assert: ('jackie' charCodeAt:4) equals: 107.\x0a\x09self assert: ('jackie' charCodeAt:5) equals: 105.\x0a\x09self assert: ('jackie' charCodeAt:6) equals: 101",
  8565. referencedClasses: [],
  8566. //>>excludeEnd("ide");
  8567. messageSends: ["assert:equals:", "charCodeAt:"]
  8568. }),
  8569. $globals.StringTest);
  8570. $core.addMethod(
  8571. $core.method({
  8572. selector: "testCopyFromTo",
  8573. protocol: "tests",
  8574. fn: function (){
  8575. var self=this,$self=this;
  8576. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8577. return $core.withContext(function($ctx1) {
  8578. //>>excludeEnd("ctx");
  8579. var $1;
  8580. $1="jackie"._copyFrom_to_((1),(3));
  8581. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8582. $ctx1.sendIdx["copyFrom:to:"]=1;
  8583. //>>excludeEnd("ctx");
  8584. $self._assert_equals_($1,"jac");
  8585. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8586. $ctx1.sendIdx["assert:equals:"]=1;
  8587. //>>excludeEnd("ctx");
  8588. $self._assert_equals_("jackie"._copyFrom_to_((4),(6)),"kie");
  8589. return self;
  8590. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8591. }, function($ctx1) {$ctx1.fill(self,"testCopyFromTo",{},$globals.StringTest)});
  8592. //>>excludeEnd("ctx");
  8593. },
  8594. //>>excludeStart("ide", pragmas.excludeIdeData);
  8595. args: [],
  8596. source: "testCopyFromTo\x0a\x09self assert: ('jackie' copyFrom: 1 to: 3) equals: 'jac'.\x0a\x09self assert: ('jackie' copyFrom: 4 to: 6) equals: 'kie'.",
  8597. referencedClasses: [],
  8598. //>>excludeEnd("ide");
  8599. messageSends: ["assert:equals:", "copyFrom:to:"]
  8600. }),
  8601. $globals.StringTest);
  8602. $core.addMethod(
  8603. $core.method({
  8604. selector: "testCopySeparates",
  8605. protocol: "tests",
  8606. fn: function (){
  8607. var self=this,$self=this;
  8608. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8609. return $core.withContext(function($ctx1) {
  8610. //>>excludeEnd("ctx");
  8611. var $3,$2,$1;
  8612. $3=$self._collection();
  8613. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8614. $ctx1.sendIdx["collection"]=1;
  8615. //>>excludeEnd("ctx");
  8616. $2=$recv($3)._copy();
  8617. $1=$recv($2).__eq_eq($self._collection());
  8618. $self._assert_($1);
  8619. return self;
  8620. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8621. }, function($ctx1) {$ctx1.fill(self,"testCopySeparates",{},$globals.StringTest)});
  8622. //>>excludeEnd("ctx");
  8623. },
  8624. //>>excludeStart("ide", pragmas.excludeIdeData);
  8625. args: [],
  8626. source: "testCopySeparates\x0a\x09\x22String instances are immutable\x22\x0a\x09self assert: self collection copy == self collection",
  8627. referencedClasses: [],
  8628. //>>excludeEnd("ide");
  8629. messageSends: ["assert:", "==", "copy", "collection"]
  8630. }),
  8631. $globals.StringTest);
  8632. $core.addMethod(
  8633. $core.method({
  8634. selector: "testCopyWithoutAll",
  8635. protocol: "tests",
  8636. fn: function (){
  8637. var self=this,$self=this;
  8638. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8639. return $core.withContext(function($ctx1) {
  8640. //>>excludeEnd("ctx");
  8641. $self._assert_equals_("*hello* *world*"._copyWithoutAll_("*"),"hello world");
  8642. return self;
  8643. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8644. }, function($ctx1) {$ctx1.fill(self,"testCopyWithoutAll",{},$globals.StringTest)});
  8645. //>>excludeEnd("ctx");
  8646. },
  8647. //>>excludeStart("ide", pragmas.excludeIdeData);
  8648. args: [],
  8649. source: "testCopyWithoutAll\x0a\x09self\x0a\x09\x09assert: ('*hello* *world*' copyWithoutAll: '*')\x0a\x09\x09equals: 'hello world'",
  8650. referencedClasses: [],
  8651. //>>excludeEnd("ide");
  8652. messageSends: ["assert:equals:", "copyWithoutAll:"]
  8653. }),
  8654. $globals.StringTest);
  8655. $core.addMethod(
  8656. $core.method({
  8657. selector: "testEquality",
  8658. protocol: "tests",
  8659. fn: function (){
  8660. var self=this,$self=this;
  8661. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8662. return $core.withContext(function($ctx1) {
  8663. //>>excludeEnd("ctx");
  8664. var $1,$2,$3;
  8665. $self._assert_equals_("hello","hello");
  8666. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8667. $ctx1.sendIdx["assert:equals:"]=1;
  8668. //>>excludeEnd("ctx");
  8669. $1="hello".__eq("world");
  8670. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8671. $ctx1.sendIdx["="]=1;
  8672. //>>excludeEnd("ctx");
  8673. $self._deny_($1);
  8674. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8675. $ctx1.sendIdx["deny:"]=1;
  8676. //>>excludeEnd("ctx");
  8677. $2="hello".__eq([]._at_ifAbsent_((1),(function(){
  8678. })));
  8679. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8680. $ctx1.sendIdx["="]=2;
  8681. //>>excludeEnd("ctx");
  8682. $self._deny_($2);
  8683. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8684. $ctx1.sendIdx["deny:"]=2;
  8685. //>>excludeEnd("ctx");
  8686. $3="hello"._yourself();
  8687. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8688. $ctx1.sendIdx["yourself"]=1;
  8689. //>>excludeEnd("ctx");
  8690. $self._assert_equals_("hello",$3);
  8691. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8692. $ctx1.sendIdx["assert:equals:"]=2;
  8693. //>>excludeEnd("ctx");
  8694. $self._assert_equals_("hello"._yourself(),"hello");
  8695. $self._deny_("".__eq((0)));
  8696. return self;
  8697. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8698. }, function($ctx1) {$ctx1.fill(self,"testEquality",{},$globals.StringTest)});
  8699. //>>excludeEnd("ctx");
  8700. },
  8701. //>>excludeStart("ide", pragmas.excludeIdeData);
  8702. args: [],
  8703. source: "testEquality\x0a\x09self assert: 'hello' equals: 'hello'.\x0a\x09self deny: 'hello' = 'world'.\x0a\x09\x0a\x09\x22Test for issue 459\x22\x0a\x09self deny: 'hello' = (#() at: 1 ifAbsent: [ ]).\x0a\x0a\x09self assert: 'hello' equals: 'hello' yourself.\x0a\x09self assert: 'hello' yourself equals: 'hello'.\x0a\x0a\x09\x22test JS falsy value\x22\x0a\x09self deny: '' = 0",
  8704. referencedClasses: [],
  8705. //>>excludeEnd("ide");
  8706. messageSends: ["assert:equals:", "deny:", "=", "at:ifAbsent:", "yourself"]
  8707. }),
  8708. $globals.StringTest);
  8709. $core.addMethod(
  8710. $core.method({
  8711. selector: "testIdentity",
  8712. protocol: "tests",
  8713. fn: function (){
  8714. var self=this,$self=this;
  8715. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8716. return $core.withContext(function($ctx1) {
  8717. //>>excludeEnd("ctx");
  8718. var $1,$2,$4,$3,$5;
  8719. $1="hello".__eq_eq("hello");
  8720. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8721. $ctx1.sendIdx["=="]=1;
  8722. //>>excludeEnd("ctx");
  8723. $self._assert_($1);
  8724. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8725. $ctx1.sendIdx["assert:"]=1;
  8726. //>>excludeEnd("ctx");
  8727. $2="hello".__eq_eq("world");
  8728. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8729. $ctx1.sendIdx["=="]=2;
  8730. //>>excludeEnd("ctx");
  8731. $self._deny_($2);
  8732. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8733. $ctx1.sendIdx["deny:"]=1;
  8734. //>>excludeEnd("ctx");
  8735. $4="hello"._yourself();
  8736. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8737. $ctx1.sendIdx["yourself"]=1;
  8738. //>>excludeEnd("ctx");
  8739. $3="hello".__eq_eq($4);
  8740. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8741. $ctx1.sendIdx["=="]=3;
  8742. //>>excludeEnd("ctx");
  8743. $self._assert_($3);
  8744. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8745. $ctx1.sendIdx["assert:"]=2;
  8746. //>>excludeEnd("ctx");
  8747. $5=$recv("hello"._yourself()).__eq_eq("hello");
  8748. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8749. $ctx1.sendIdx["=="]=4;
  8750. //>>excludeEnd("ctx");
  8751. $self._assert_($5);
  8752. $self._deny_("".__eq_eq((0)));
  8753. return self;
  8754. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8755. }, function($ctx1) {$ctx1.fill(self,"testIdentity",{},$globals.StringTest)});
  8756. //>>excludeEnd("ctx");
  8757. },
  8758. //>>excludeStart("ide", pragmas.excludeIdeData);
  8759. args: [],
  8760. source: "testIdentity\x0a\x09self assert: 'hello' == 'hello'.\x0a\x09self deny: 'hello' == 'world'.\x0a\x0a\x09self assert: 'hello' == 'hello' yourself.\x0a\x09self assert: 'hello' yourself == 'hello'.\x0a\x0a\x09\x22test JS falsy value\x22\x0a\x09self deny: '' == 0",
  8761. referencedClasses: [],
  8762. //>>excludeEnd("ide");
  8763. messageSends: ["assert:", "==", "deny:", "yourself"]
  8764. }),
  8765. $globals.StringTest);
  8766. $core.addMethod(
  8767. $core.method({
  8768. selector: "testIncludesSubString",
  8769. protocol: "tests",
  8770. fn: function (){
  8771. var self=this,$self=this;
  8772. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8773. return $core.withContext(function($ctx1) {
  8774. //>>excludeEnd("ctx");
  8775. var $1;
  8776. $1="amber"._includesSubString_("ber");
  8777. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8778. $ctx1.sendIdx["includesSubString:"]=1;
  8779. //>>excludeEnd("ctx");
  8780. $self._assert_($1);
  8781. $self._deny_("amber"._includesSubString_("zork"));
  8782. return self;
  8783. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8784. }, function($ctx1) {$ctx1.fill(self,"testIncludesSubString",{},$globals.StringTest)});
  8785. //>>excludeEnd("ctx");
  8786. },
  8787. //>>excludeStart("ide", pragmas.excludeIdeData);
  8788. args: [],
  8789. source: "testIncludesSubString\x0a\x09self assert: ('amber' includesSubString: 'ber').\x0a\x09self deny: ('amber' includesSubString: 'zork').",
  8790. referencedClasses: [],
  8791. //>>excludeEnd("ide");
  8792. messageSends: ["assert:", "includesSubString:", "deny:"]
  8793. }),
  8794. $globals.StringTest);
  8795. $core.addMethod(
  8796. $core.method({
  8797. selector: "testIndexOfStartingAtWithNull",
  8798. protocol: "tests",
  8799. fn: function (){
  8800. var self=this,$self=this;
  8801. return self;
  8802. },
  8803. //>>excludeStart("ide", pragmas.excludeIdeData);
  8804. args: [],
  8805. source: "testIndexOfStartingAtWithNull\x0a\x09\x22String cannot hold JS null\x22",
  8806. referencedClasses: [],
  8807. //>>excludeEnd("ide");
  8808. messageSends: []
  8809. }),
  8810. $globals.StringTest);
  8811. $core.addMethod(
  8812. $core.method({
  8813. selector: "testIndexOfWithNull",
  8814. protocol: "tests",
  8815. fn: function (){
  8816. var self=this,$self=this;
  8817. return self;
  8818. },
  8819. //>>excludeStart("ide", pragmas.excludeIdeData);
  8820. args: [],
  8821. source: "testIndexOfWithNull\x0a\x09\x22String cannot hold JS null\x22",
  8822. referencedClasses: [],
  8823. //>>excludeEnd("ide");
  8824. messageSends: []
  8825. }),
  8826. $globals.StringTest);
  8827. $core.addMethod(
  8828. $core.method({
  8829. selector: "testIsVowel",
  8830. protocol: "tests",
  8831. fn: function (){
  8832. var self=this,$self=this;
  8833. var vowel,consonant;
  8834. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8835. return $core.withContext(function($ctx1) {
  8836. //>>excludeEnd("ctx");
  8837. var $1;
  8838. vowel="u";
  8839. consonant="z";
  8840. $1=$recv(vowel)._isVowel();
  8841. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8842. $ctx1.sendIdx["isVowel"]=1;
  8843. //>>excludeEnd("ctx");
  8844. $self._assert_equals_($1,true);
  8845. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8846. $ctx1.sendIdx["assert:equals:"]=1;
  8847. //>>excludeEnd("ctx");
  8848. $self._assert_equals_($recv(consonant)._isVowel(),false);
  8849. return self;
  8850. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8851. }, function($ctx1) {$ctx1.fill(self,"testIsVowel",{vowel:vowel,consonant:consonant},$globals.StringTest)});
  8852. //>>excludeEnd("ctx");
  8853. },
  8854. //>>excludeStart("ide", pragmas.excludeIdeData);
  8855. args: [],
  8856. source: "testIsVowel\x0a |vowel consonant|\x0a vowel := 'u'.\x0a consonant := 'z'.\x0a self assert: vowel isVowel equals: true.\x0a self assert: consonant isVowel equals: false",
  8857. referencedClasses: [],
  8858. //>>excludeEnd("ide");
  8859. messageSends: ["assert:equals:", "isVowel"]
  8860. }),
  8861. $globals.StringTest);
  8862. $core.addMethod(
  8863. $core.method({
  8864. selector: "testJoin",
  8865. protocol: "tests",
  8866. fn: function (){
  8867. var self=this,$self=this;
  8868. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8869. return $core.withContext(function($ctx1) {
  8870. //>>excludeEnd("ctx");
  8871. $self._assert_equals_(","._join_(["hello", "world"]),"hello,world");
  8872. return self;
  8873. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8874. }, function($ctx1) {$ctx1.fill(self,"testJoin",{},$globals.StringTest)});
  8875. //>>excludeEnd("ctx");
  8876. },
  8877. //>>excludeStart("ide", pragmas.excludeIdeData);
  8878. args: [],
  8879. source: "testJoin\x0a\x09self assert: (',' join: #('hello' 'world')) equals: 'hello,world'",
  8880. referencedClasses: [],
  8881. //>>excludeEnd("ide");
  8882. messageSends: ["assert:equals:", "join:"]
  8883. }),
  8884. $globals.StringTest);
  8885. $core.addMethod(
  8886. $core.method({
  8887. selector: "testRemoveAll",
  8888. protocol: "tests",
  8889. fn: function (){
  8890. var self=this,$self=this;
  8891. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8892. return $core.withContext(function($ctx1) {
  8893. //>>excludeEnd("ctx");
  8894. $self._should_raise_((function(){
  8895. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8896. return $core.withContext(function($ctx2) {
  8897. //>>excludeEnd("ctx");
  8898. return $recv($self._collection())._removeAll();
  8899. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8900. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  8901. //>>excludeEnd("ctx");
  8902. }),$globals.Error);
  8903. return self;
  8904. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8905. }, function($ctx1) {$ctx1.fill(self,"testRemoveAll",{},$globals.StringTest)});
  8906. //>>excludeEnd("ctx");
  8907. },
  8908. //>>excludeStart("ide", pragmas.excludeIdeData);
  8909. args: [],
  8910. source: "testRemoveAll\x0a\x09self should: [ self collection removeAll ] raise: Error",
  8911. referencedClasses: ["Error"],
  8912. //>>excludeEnd("ide");
  8913. messageSends: ["should:raise:", "removeAll", "collection"]
  8914. }),
  8915. $globals.StringTest);
  8916. $core.addMethod(
  8917. $core.method({
  8918. selector: "testReversed",
  8919. protocol: "tests",
  8920. fn: function (){
  8921. var self=this,$self=this;
  8922. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8923. return $core.withContext(function($ctx1) {
  8924. //>>excludeEnd("ctx");
  8925. $self._assert_equals_("jackiechan"._reversed(),"nahceikcaj");
  8926. return self;
  8927. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8928. }, function($ctx1) {$ctx1.fill(self,"testReversed",{},$globals.StringTest)});
  8929. //>>excludeEnd("ctx");
  8930. },
  8931. //>>excludeStart("ide", pragmas.excludeIdeData);
  8932. args: [],
  8933. source: "testReversed\x0a\x09self assert: 'jackiechan' reversed equals: 'nahceikcaj'.",
  8934. referencedClasses: [],
  8935. //>>excludeEnd("ide");
  8936. messageSends: ["assert:equals:", "reversed"]
  8937. }),
  8938. $globals.StringTest);
  8939. $core.addMethod(
  8940. $core.method({
  8941. selector: "testStreamContents",
  8942. protocol: "tests",
  8943. fn: function (){
  8944. var self=this,$self=this;
  8945. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8946. return $core.withContext(function($ctx1) {
  8947. //>>excludeEnd("ctx");
  8948. $self._assert_equals_($recv($globals.String)._streamContents_((function(aStream){
  8949. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8950. return $core.withContext(function($ctx2) {
  8951. //>>excludeEnd("ctx");
  8952. $recv(aStream)._nextPutAll_("hello");
  8953. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8954. $ctx2.sendIdx["nextPutAll:"]=1;
  8955. //>>excludeEnd("ctx");
  8956. $recv(aStream)._space();
  8957. return $recv(aStream)._nextPutAll_("world");
  8958. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8959. }, function($ctx2) {$ctx2.fillBlock({aStream:aStream},$ctx1,1)});
  8960. //>>excludeEnd("ctx");
  8961. })),"hello world");
  8962. return self;
  8963. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8964. }, function($ctx1) {$ctx1.fill(self,"testStreamContents",{},$globals.StringTest)});
  8965. //>>excludeEnd("ctx");
  8966. },
  8967. //>>excludeStart("ide", pragmas.excludeIdeData);
  8968. args: [],
  8969. source: "testStreamContents\x0a\x09self\x0a\x09\x09assert: (String streamContents: [ :aStream |\x0a\x09\x09\x09aStream\x0a\x09\x09\x09\x09nextPutAll: 'hello'; space;\x0a\x09\x09\x09\x09nextPutAll: 'world' ])\x0a\x09\x09equals: 'hello world'",
  8970. referencedClasses: ["String"],
  8971. //>>excludeEnd("ide");
  8972. messageSends: ["assert:equals:", "streamContents:", "nextPutAll:", "space"]
  8973. }),
  8974. $globals.StringTest);
  8975. $core.addMethod(
  8976. $core.method({
  8977. selector: "testSubStrings",
  8978. protocol: "tests",
  8979. fn: function (){
  8980. var self=this,$self=this;
  8981. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8982. return $core.withContext(function($ctx1) {
  8983. //>>excludeEnd("ctx");
  8984. $self._assert_equals_("jackiechan"._subStrings_("ie"),["jack", "chan"]);
  8985. return self;
  8986. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8987. }, function($ctx1) {$ctx1.fill(self,"testSubStrings",{},$globals.StringTest)});
  8988. //>>excludeEnd("ctx");
  8989. },
  8990. //>>excludeStart("ide", pragmas.excludeIdeData);
  8991. args: [],
  8992. source: "testSubStrings\x0a\x09self assert: ('jackiechan' subStrings: 'ie') equals: #( 'jack' 'chan' ).",
  8993. referencedClasses: [],
  8994. //>>excludeEnd("ide");
  8995. messageSends: ["assert:equals:", "subStrings:"]
  8996. }),
  8997. $globals.StringTest);
  8998. $core.addMethod(
  8999. $core.method({
  9000. selector: "testTrim",
  9001. protocol: "tests",
  9002. fn: function (){
  9003. var self=this,$self=this;
  9004. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9005. return $core.withContext(function($ctx1) {
  9006. //>>excludeEnd("ctx");
  9007. $self._assert_equals_(" jackie"._trimLeft(),"jackie");
  9008. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9009. $ctx1.sendIdx["assert:equals:"]=1;
  9010. //>>excludeEnd("ctx");
  9011. $self._assert_equals_("jackie "._trimRight(),"jackie");
  9012. return self;
  9013. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9014. }, function($ctx1) {$ctx1.fill(self,"testTrim",{},$globals.StringTest)});
  9015. //>>excludeEnd("ctx");
  9016. },
  9017. //>>excludeStart("ide", pragmas.excludeIdeData);
  9018. args: [],
  9019. source: "testTrim\x0a\x09self assert: ' jackie' trimLeft equals: 'jackie'.\x0a\x09self assert: 'jackie ' trimRight equals: 'jackie'.",
  9020. referencedClasses: [],
  9021. //>>excludeEnd("ide");
  9022. messageSends: ["assert:equals:", "trimLeft", "trimRight"]
  9023. }),
  9024. $globals.StringTest);
  9025. $core.addMethod(
  9026. $core.method({
  9027. selector: "testValue",
  9028. protocol: "tests",
  9029. fn: function (){
  9030. var self=this,$self=this;
  9031. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9032. return $core.withContext(function($ctx1) {
  9033. //>>excludeEnd("ctx");
  9034. $self._assert_equals_("asString"._value_((1)),"1");
  9035. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9036. $ctx1.sendIdx["assert:equals:"]=1;
  9037. //>>excludeEnd("ctx");
  9038. $self._assert_equals_([(1), (2), (3)]._collect_("asString"),["1", "2", "3"]);
  9039. return self;
  9040. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9041. }, function($ctx1) {$ctx1.fill(self,"testValue",{},$globals.StringTest)});
  9042. //>>excludeEnd("ctx");
  9043. },
  9044. //>>excludeStart("ide", pragmas.excludeIdeData);
  9045. args: [],
  9046. source: "testValue\x0a\x0a\x09self assert: (#asString value: 1) equals: '1'.\x0a\x0a\x09\x22Which (since String and BlockClosure are now polymorphic) enables the nice idiom...\x22\x0a\x09self assert: (#(1 2 3) collect: #asString) equals: #('1' '2' '3')",
  9047. referencedClasses: [],
  9048. //>>excludeEnd("ide");
  9049. messageSends: ["assert:equals:", "value:", "collect:"]
  9050. }),
  9051. $globals.StringTest);
  9052. $core.addMethod(
  9053. $core.method({
  9054. selector: "collectionClass",
  9055. protocol: "fixture",
  9056. fn: function (){
  9057. var self=this,$self=this;
  9058. return $globals.String;
  9059. },
  9060. //>>excludeStart("ide", pragmas.excludeIdeData);
  9061. args: [],
  9062. source: "collectionClass\x0a\x09^ String",
  9063. referencedClasses: ["String"],
  9064. //>>excludeEnd("ide");
  9065. messageSends: []
  9066. }),
  9067. $globals.StringTest.a$cls);
  9068. $core.addClass("SetTest", $globals.CollectionTest, [], "Kernel-Tests");
  9069. $core.addMethod(
  9070. $core.method({
  9071. selector: "collection",
  9072. protocol: "fixture",
  9073. fn: function (){
  9074. var self=this,$self=this;
  9075. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9076. return $core.withContext(function($ctx1) {
  9077. //>>excludeEnd("ctx");
  9078. var $1;
  9079. $1=$recv($globals.Set)._new();
  9080. $recv($1)._add_($globals.Smalltalk);
  9081. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9082. $ctx1.sendIdx["add:"]=1;
  9083. //>>excludeEnd("ctx");
  9084. $recv($1)._add_(nil);
  9085. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9086. $ctx1.sendIdx["add:"]=2;
  9087. //>>excludeEnd("ctx");
  9088. $recv($1)._add_((3).__at((3)));
  9089. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9090. $ctx1.sendIdx["add:"]=3;
  9091. //>>excludeEnd("ctx");
  9092. $recv($1)._add_(false);
  9093. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9094. $ctx1.sendIdx["add:"]=4;
  9095. //>>excludeEnd("ctx");
  9096. $recv($1)._add_($self["@sampleBlock"]);
  9097. return $recv($1)._yourself();
  9098. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9099. }, function($ctx1) {$ctx1.fill(self,"collection",{},$globals.SetTest)});
  9100. //>>excludeEnd("ctx");
  9101. },
  9102. //>>excludeStart("ide", pragmas.excludeIdeData);
  9103. args: [],
  9104. source: "collection\x0a\x09^ Set new\x0a\x09\x09add: Smalltalk;\x0a\x09\x09add: nil;\x0a\x09\x09add: 3@3;\x0a\x09\x09add: false;\x0a\x09\x09add: sampleBlock;\x0a\x09\x09yourself",
  9105. referencedClasses: ["Set", "Smalltalk"],
  9106. //>>excludeEnd("ide");
  9107. messageSends: ["add:", "new", "@", "yourself"]
  9108. }),
  9109. $globals.SetTest);
  9110. $core.addMethod(
  9111. $core.method({
  9112. selector: "collectionOfPrintStrings",
  9113. protocol: "fixture",
  9114. fn: function (){
  9115. var self=this,$self=this;
  9116. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9117. return $core.withContext(function($ctx1) {
  9118. //>>excludeEnd("ctx");
  9119. var $1;
  9120. $1=$recv($globals.Set)._new();
  9121. $recv($1)._add_("a SmalltalkImage");
  9122. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9123. $ctx1.sendIdx["add:"]=1;
  9124. //>>excludeEnd("ctx");
  9125. $recv($1)._add_("nil");
  9126. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9127. $ctx1.sendIdx["add:"]=2;
  9128. //>>excludeEnd("ctx");
  9129. $recv($1)._add_("3@3");
  9130. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9131. $ctx1.sendIdx["add:"]=3;
  9132. //>>excludeEnd("ctx");
  9133. $recv($1)._add_("false");
  9134. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9135. $ctx1.sendIdx["add:"]=4;
  9136. //>>excludeEnd("ctx");
  9137. $recv($1)._add_("a BlockClosure");
  9138. return $recv($1)._yourself();
  9139. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9140. }, function($ctx1) {$ctx1.fill(self,"collectionOfPrintStrings",{},$globals.SetTest)});
  9141. //>>excludeEnd("ctx");
  9142. },
  9143. //>>excludeStart("ide", pragmas.excludeIdeData);
  9144. args: [],
  9145. source: "collectionOfPrintStrings\x0a\x09^ Set new\x0a\x09\x09add: 'a SmalltalkImage';\x0a\x09\x09add: 'nil';\x0a\x09\x09add: '3@3';\x0a\x09\x09add: 'false';\x0a\x09\x09add: 'a BlockClosure';\x0a\x09\x09yourself",
  9146. referencedClasses: ["Set"],
  9147. //>>excludeEnd("ide");
  9148. messageSends: ["add:", "new", "yourself"]
  9149. }),
  9150. $globals.SetTest);
  9151. $core.addMethod(
  9152. $core.method({
  9153. selector: "collectionSize",
  9154. protocol: "fixture",
  9155. fn: function (){
  9156. var self=this,$self=this;
  9157. return (5);
  9158. },
  9159. //>>excludeStart("ide", pragmas.excludeIdeData);
  9160. args: [],
  9161. source: "collectionSize\x0a\x09^ 5",
  9162. referencedClasses: [],
  9163. //>>excludeEnd("ide");
  9164. messageSends: []
  9165. }),
  9166. $globals.SetTest);
  9167. $core.addMethod(
  9168. $core.method({
  9169. selector: "collectionWithDuplicates",
  9170. protocol: "fixture",
  9171. fn: function (){
  9172. var self=this,$self=this;
  9173. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9174. return $core.withContext(function($ctx1) {
  9175. //>>excludeEnd("ctx");
  9176. var $1;
  9177. $1=$self._collection();
  9178. $recv($1)._add_((0));
  9179. return $recv($1)._yourself();
  9180. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9181. }, function($ctx1) {$ctx1.fill(self,"collectionWithDuplicates",{},$globals.SetTest)});
  9182. //>>excludeEnd("ctx");
  9183. },
  9184. //>>excludeStart("ide", pragmas.excludeIdeData);
  9185. args: [],
  9186. source: "collectionWithDuplicates\x0a\x09\x22Set has no duplicates\x22\x0a\x09^ self collection add: 0; yourself",
  9187. referencedClasses: [],
  9188. //>>excludeEnd("ide");
  9189. messageSends: ["add:", "collection", "yourself"]
  9190. }),
  9191. $globals.SetTest);
  9192. $core.addMethod(
  9193. $core.method({
  9194. selector: "collectionWithNewValue",
  9195. protocol: "fixture",
  9196. fn: function (){
  9197. var self=this,$self=this;
  9198. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9199. return $core.withContext(function($ctx1) {
  9200. //>>excludeEnd("ctx");
  9201. var $1;
  9202. $1=$recv($globals.Set)._new();
  9203. $recv($1)._add_($globals.Smalltalk);
  9204. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9205. $ctx1.sendIdx["add:"]=1;
  9206. //>>excludeEnd("ctx");
  9207. $recv($1)._add_(nil);
  9208. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9209. $ctx1.sendIdx["add:"]=2;
  9210. //>>excludeEnd("ctx");
  9211. $recv($1)._add_((3).__at((3)));
  9212. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9213. $ctx1.sendIdx["add:"]=3;
  9214. //>>excludeEnd("ctx");
  9215. $recv($1)._add_("N");
  9216. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9217. $ctx1.sendIdx["add:"]=4;
  9218. //>>excludeEnd("ctx");
  9219. $recv($1)._add_(false);
  9220. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9221. $ctx1.sendIdx["add:"]=5;
  9222. //>>excludeEnd("ctx");
  9223. $recv($1)._add_($self["@sampleBlock"]);
  9224. return $recv($1)._yourself();
  9225. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9226. }, function($ctx1) {$ctx1.fill(self,"collectionWithNewValue",{},$globals.SetTest)});
  9227. //>>excludeEnd("ctx");
  9228. },
  9229. //>>excludeStart("ide", pragmas.excludeIdeData);
  9230. args: [],
  9231. source: "collectionWithNewValue\x0a\x09^ Set new\x0a\x09\x09add: Smalltalk;\x0a\x09\x09add: nil;\x0a\x09\x09add: 3@3;\x0a\x09\x09add: 'N';\x0a\x09\x09add: false;\x0a\x09\x09add: sampleBlock;\x0a\x09\x09yourself",
  9232. referencedClasses: ["Set", "Smalltalk"],
  9233. //>>excludeEnd("ide");
  9234. messageSends: ["add:", "new", "@", "yourself"]
  9235. }),
  9236. $globals.SetTest);
  9237. $core.addMethod(
  9238. $core.method({
  9239. selector: "testAddAll",
  9240. protocol: "tests",
  9241. fn: function (){
  9242. var self=this,$self=this;
  9243. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9244. return $core.withContext(function($ctx1) {
  9245. //>>excludeEnd("ctx");
  9246. var $2,$3,$4,$1,$5,$7,$8,$9,$6,$10,$12,$11;
  9247. (
  9248. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9249. $ctx1.supercall = true,
  9250. //>>excludeEnd("ctx");
  9251. ($globals.SetTest.superclass||$boot.nilAsClass).fn.prototype._testAddAll.apply($self, []));
  9252. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9253. $ctx1.supercall = false;
  9254. //>>excludeEnd("ctx");;
  9255. $2=$self._collection();
  9256. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9257. $ctx1.sendIdx["collection"]=1;
  9258. //>>excludeEnd("ctx");
  9259. $3=$self._collection();
  9260. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9261. $ctx1.sendIdx["collection"]=2;
  9262. //>>excludeEnd("ctx");
  9263. $recv($2)._addAll_($3);
  9264. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9265. $ctx1.sendIdx["addAll:"]=1;
  9266. //>>excludeEnd("ctx");
  9267. $4=$recv($2)._yourself();
  9268. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9269. $ctx1.sendIdx["yourself"]=1;
  9270. //>>excludeEnd("ctx");
  9271. $1=$4;
  9272. $5=$self._collection();
  9273. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9274. $ctx1.sendIdx["collection"]=3;
  9275. //>>excludeEnd("ctx");
  9276. $self._assert_equals_($1,$5);
  9277. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9278. $ctx1.sendIdx["assert:equals:"]=1;
  9279. //>>excludeEnd("ctx");
  9280. $7=$self._collection();
  9281. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9282. $ctx1.sendIdx["collection"]=4;
  9283. //>>excludeEnd("ctx");
  9284. $8=$self._collectionWithNewValue();
  9285. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9286. $ctx1.sendIdx["collectionWithNewValue"]=1;
  9287. //>>excludeEnd("ctx");
  9288. $recv($7)._addAll_($8);
  9289. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9290. $ctx1.sendIdx["addAll:"]=2;
  9291. //>>excludeEnd("ctx");
  9292. $9=$recv($7)._yourself();
  9293. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9294. $ctx1.sendIdx["yourself"]=2;
  9295. //>>excludeEnd("ctx");
  9296. $6=$9;
  9297. $10=$self._collectionWithNewValue();
  9298. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9299. $ctx1.sendIdx["collectionWithNewValue"]=2;
  9300. //>>excludeEnd("ctx");
  9301. $self._assert_equals_($6,$10);
  9302. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9303. $ctx1.sendIdx["assert:equals:"]=2;
  9304. //>>excludeEnd("ctx");
  9305. $12=$self._collectionWithNewValue();
  9306. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9307. $ctx1.sendIdx["collectionWithNewValue"]=3;
  9308. //>>excludeEnd("ctx");
  9309. $recv($12)._addAll_($self._collection());
  9310. $11=$recv($12)._yourself();
  9311. $self._assert_equals_($11,$self._collectionWithNewValue());
  9312. return self;
  9313. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9314. }, function($ctx1) {$ctx1.fill(self,"testAddAll",{},$globals.SetTest)});
  9315. //>>excludeEnd("ctx");
  9316. },
  9317. //>>excludeStart("ide", pragmas.excludeIdeData);
  9318. args: [],
  9319. source: "testAddAll\x0a\x09super testAddAll.\x0a\x09self assert: (self collection addAll: self collection; yourself) equals: self collection.\x0a\x09self assert: (self collection addAll: self collectionWithNewValue; yourself) equals: self collectionWithNewValue.\x0a\x09self assert: (self collectionWithNewValue addAll: self collection; yourself) equals: self collectionWithNewValue",
  9320. referencedClasses: [],
  9321. //>>excludeEnd("ide");
  9322. messageSends: ["testAddAll", "assert:equals:", "addAll:", "collection", "yourself", "collectionWithNewValue"]
  9323. }),
  9324. $globals.SetTest);
  9325. $core.addMethod(
  9326. $core.method({
  9327. selector: "testAddRemove",
  9328. protocol: "tests",
  9329. fn: function (){
  9330. var self=this,$self=this;
  9331. var set;
  9332. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9333. return $core.withContext(function($ctx1) {
  9334. //>>excludeEnd("ctx");
  9335. var $1,$2;
  9336. set=$recv($globals.Set)._new();
  9337. $self._assert_($recv(set)._isEmpty());
  9338. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9339. $ctx1.sendIdx["assert:"]=1;
  9340. //>>excludeEnd("ctx");
  9341. $recv(set)._add_((3));
  9342. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9343. $ctx1.sendIdx["add:"]=1;
  9344. //>>excludeEnd("ctx");
  9345. $1=$recv(set)._includes_((3));
  9346. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9347. $ctx1.sendIdx["includes:"]=1;
  9348. //>>excludeEnd("ctx");
  9349. $self._assert_($1);
  9350. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9351. $ctx1.sendIdx["assert:"]=2;
  9352. //>>excludeEnd("ctx");
  9353. $recv(set)._add_((5));
  9354. $2=$recv(set)._includes_((5));
  9355. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9356. $ctx1.sendIdx["includes:"]=2;
  9357. //>>excludeEnd("ctx");
  9358. $self._assert_($2);
  9359. $recv(set)._remove_((3));
  9360. $self._deny_($recv(set)._includes_((3)));
  9361. return self;
  9362. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9363. }, function($ctx1) {$ctx1.fill(self,"testAddRemove",{set:set},$globals.SetTest)});
  9364. //>>excludeEnd("ctx");
  9365. },
  9366. //>>excludeStart("ide", pragmas.excludeIdeData);
  9367. args: [],
  9368. source: "testAddRemove\x0a\x09| set |\x0a\x09set := Set new.\x0a\x09\x0a\x09self assert: set isEmpty.\x0a\x0a\x09set add: 3.\x0a\x09self assert: (set includes: 3).\x0a\x0a\x09set add: 5.\x0a\x09self assert: (set includes: 5).\x0a\x0a\x09set remove: 3.\x0a\x09self deny: (set includes: 3)",
  9369. referencedClasses: ["Set"],
  9370. //>>excludeEnd("ide");
  9371. messageSends: ["new", "assert:", "isEmpty", "add:", "includes:", "remove:", "deny:"]
  9372. }),
  9373. $globals.SetTest);
  9374. $core.addMethod(
  9375. $core.method({
  9376. selector: "testAt",
  9377. protocol: "tests",
  9378. fn: function (){
  9379. var self=this,$self=this;
  9380. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9381. return $core.withContext(function($ctx1) {
  9382. //>>excludeEnd("ctx");
  9383. $self._should_raise_((function(){
  9384. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9385. return $core.withContext(function($ctx2) {
  9386. //>>excludeEnd("ctx");
  9387. return $recv($recv($globals.Set)._new())._at_put_((1),(2));
  9388. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9389. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  9390. //>>excludeEnd("ctx");
  9391. }),$globals.Error);
  9392. return self;
  9393. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9394. }, function($ctx1) {$ctx1.fill(self,"testAt",{},$globals.SetTest)});
  9395. //>>excludeEnd("ctx");
  9396. },
  9397. //>>excludeStart("ide", pragmas.excludeIdeData);
  9398. args: [],
  9399. source: "testAt\x0a\x09self should: [ Set new at: 1 put: 2 ] raise: Error",
  9400. referencedClasses: ["Set", "Error"],
  9401. //>>excludeEnd("ide");
  9402. messageSends: ["should:raise:", "at:put:", "new"]
  9403. }),
  9404. $globals.SetTest);
  9405. $core.addMethod(
  9406. $core.method({
  9407. selector: "testCollect",
  9408. protocol: "tests",
  9409. fn: function (){
  9410. var self=this,$self=this;
  9411. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9412. return $core.withContext(function($ctx1) {
  9413. //>>excludeEnd("ctx");
  9414. var $2,$1;
  9415. (
  9416. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9417. $ctx1.supercall = true,
  9418. //>>excludeEnd("ctx");
  9419. ($globals.SetTest.superclass||$boot.nilAsClass).fn.prototype._testCollect.apply($self, []));
  9420. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9421. $ctx1.supercall = false;
  9422. //>>excludeEnd("ctx");;
  9423. $2=[(5), (6), (8)]._asSet();
  9424. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9425. $ctx1.sendIdx["asSet"]=1;
  9426. //>>excludeEnd("ctx");
  9427. $1=$recv($2)._collect_((function(x){
  9428. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9429. return $core.withContext(function($ctx2) {
  9430. //>>excludeEnd("ctx");
  9431. return $recv(x).__backslash_backslash((3));
  9432. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9433. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)});
  9434. //>>excludeEnd("ctx");
  9435. }));
  9436. $self._assert_equals_($1,[(0), (2)]._asSet());
  9437. return self;
  9438. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9439. }, function($ctx1) {$ctx1.fill(self,"testCollect",{},$globals.SetTest)});
  9440. //>>excludeEnd("ctx");
  9441. },
  9442. //>>excludeStart("ide", pragmas.excludeIdeData);
  9443. args: [],
  9444. source: "testCollect\x0a\x09super testCollect.\x0a\x09self assert: (#(5 6 8) asSet collect: [ :x | x \x5c\x5c 3 ]) equals: #(0 2) asSet",
  9445. referencedClasses: [],
  9446. //>>excludeEnd("ide");
  9447. messageSends: ["testCollect", "assert:equals:", "collect:", "asSet", "\x5c\x5c"]
  9448. }),
  9449. $globals.SetTest);
  9450. $core.addMethod(
  9451. $core.method({
  9452. selector: "testComma",
  9453. protocol: "tests",
  9454. fn: function (){
  9455. var self=this,$self=this;
  9456. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9457. return $core.withContext(function($ctx1) {
  9458. //>>excludeEnd("ctx");
  9459. var $2,$3,$1,$4,$6,$7,$5,$8,$10,$9;
  9460. (
  9461. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9462. $ctx1.supercall = true,
  9463. //>>excludeEnd("ctx");
  9464. ($globals.SetTest.superclass||$boot.nilAsClass).fn.prototype._testComma.apply($self, []));
  9465. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9466. $ctx1.supercall = false;
  9467. //>>excludeEnd("ctx");;
  9468. $2=$self._collection();
  9469. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9470. $ctx1.sendIdx["collection"]=1;
  9471. //>>excludeEnd("ctx");
  9472. $3=$self._collection();
  9473. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9474. $ctx1.sendIdx["collection"]=2;
  9475. //>>excludeEnd("ctx");
  9476. $1=$recv($2).__comma($3);
  9477. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9478. $ctx1.sendIdx[","]=1;
  9479. //>>excludeEnd("ctx");
  9480. $4=$self._collection();
  9481. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9482. $ctx1.sendIdx["collection"]=3;
  9483. //>>excludeEnd("ctx");
  9484. $self._assert_equals_($1,$4);
  9485. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9486. $ctx1.sendIdx["assert:equals:"]=1;
  9487. //>>excludeEnd("ctx");
  9488. $6=$self._collection();
  9489. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9490. $ctx1.sendIdx["collection"]=4;
  9491. //>>excludeEnd("ctx");
  9492. $7=$self._collectionWithNewValue();
  9493. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9494. $ctx1.sendIdx["collectionWithNewValue"]=1;
  9495. //>>excludeEnd("ctx");
  9496. $5=$recv($6).__comma($7);
  9497. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9498. $ctx1.sendIdx[","]=2;
  9499. //>>excludeEnd("ctx");
  9500. $8=$self._collectionWithNewValue();
  9501. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9502. $ctx1.sendIdx["collectionWithNewValue"]=2;
  9503. //>>excludeEnd("ctx");
  9504. $self._assert_equals_($5,$8);
  9505. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9506. $ctx1.sendIdx["assert:equals:"]=2;
  9507. //>>excludeEnd("ctx");
  9508. $10=$self._collectionWithNewValue();
  9509. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9510. $ctx1.sendIdx["collectionWithNewValue"]=3;
  9511. //>>excludeEnd("ctx");
  9512. $9=$recv($10).__comma($self._collection());
  9513. $self._assert_equals_($9,$self._collectionWithNewValue());
  9514. return self;
  9515. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9516. }, function($ctx1) {$ctx1.fill(self,"testComma",{},$globals.SetTest)});
  9517. //>>excludeEnd("ctx");
  9518. },
  9519. //>>excludeStart("ide", pragmas.excludeIdeData);
  9520. args: [],
  9521. source: "testComma\x0a\x09super testComma.\x0a\x09self assert: self collection, self collection equals: self collection.\x0a\x09self assert: self collection, self collectionWithNewValue equals: self collectionWithNewValue.\x0a\x09self assert: self collectionWithNewValue, self collection equals: self collectionWithNewValue",
  9522. referencedClasses: [],
  9523. //>>excludeEnd("ide");
  9524. messageSends: ["testComma", "assert:equals:", ",", "collection", "collectionWithNewValue"]
  9525. }),
  9526. $globals.SetTest);
  9527. $core.addMethod(
  9528. $core.method({
  9529. selector: "testComparing",
  9530. protocol: "tests",
  9531. fn: function (){
  9532. var self=this,$self=this;
  9533. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9534. return $core.withContext(function($ctx1) {
  9535. //>>excludeEnd("ctx");
  9536. var $1,$2,$3,$4,$6,$7,$5,$9,$8;
  9537. $1=[(0), (2)]._asSet();
  9538. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9539. $ctx1.sendIdx["asSet"]=1;
  9540. //>>excludeEnd("ctx");
  9541. $2=[(0), (2)]._asSet();
  9542. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9543. $ctx1.sendIdx["asSet"]=2;
  9544. //>>excludeEnd("ctx");
  9545. $self._assert_equals_($1,$2);
  9546. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9547. $ctx1.sendIdx["assert:equals:"]=1;
  9548. //>>excludeEnd("ctx");
  9549. $3=[(2), (0)]._asSet();
  9550. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9551. $ctx1.sendIdx["asSet"]=3;
  9552. //>>excludeEnd("ctx");
  9553. $4=[(0), (2)]._asSet();
  9554. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9555. $ctx1.sendIdx["asSet"]=4;
  9556. //>>excludeEnd("ctx");
  9557. $self._assert_equals_($3,$4);
  9558. $6=[(0), (2), (3)]._asSet();
  9559. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9560. $ctx1.sendIdx["asSet"]=5;
  9561. //>>excludeEnd("ctx");
  9562. $7=[(0), (2)]._asSet();
  9563. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9564. $ctx1.sendIdx["asSet"]=6;
  9565. //>>excludeEnd("ctx");
  9566. $5=$recv($6).__eq($7);
  9567. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9568. $ctx1.sendIdx["="]=1;
  9569. //>>excludeEnd("ctx");
  9570. $self._deny_($5);
  9571. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9572. $ctx1.sendIdx["deny:"]=1;
  9573. //>>excludeEnd("ctx");
  9574. $9=[(1), (2)]._asSet();
  9575. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9576. $ctx1.sendIdx["asSet"]=7;
  9577. //>>excludeEnd("ctx");
  9578. $8=$recv($9).__eq([(0), (2)]._asSet());
  9579. $self._deny_($8);
  9580. return self;
  9581. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9582. }, function($ctx1) {$ctx1.fill(self,"testComparing",{},$globals.SetTest)});
  9583. //>>excludeEnd("ctx");
  9584. },
  9585. //>>excludeStart("ide", pragmas.excludeIdeData);
  9586. args: [],
  9587. source: "testComparing\x0a\x09self assert: #(0 2) asSet equals: #(0 2) asSet.\x0a\x09self assert: #(2 0) asSet equals: #(0 2) asSet.\x0a\x09self deny: #(0 2 3) asSet = #(0 2) asSet.\x0a\x09self deny: #(1 2) asSet = #(0 2) asSet",
  9588. referencedClasses: [],
  9589. //>>excludeEnd("ide");
  9590. messageSends: ["assert:equals:", "asSet", "deny:", "="]
  9591. }),
  9592. $globals.SetTest);
  9593. $core.addMethod(
  9594. $core.method({
  9595. selector: "testPrintString",
  9596. protocol: "tests",
  9597. fn: function (){
  9598. var self=this,$self=this;
  9599. var set;
  9600. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9601. return $core.withContext(function($ctx1) {
  9602. //>>excludeEnd("ctx");
  9603. var $1,$2,$3,$4,$5,$6,$7,$8;
  9604. set=$recv($globals.Set)._new();
  9605. $1=$recv(set)._printString();
  9606. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9607. $ctx1.sendIdx["printString"]=1;
  9608. //>>excludeEnd("ctx");
  9609. $self._assert_equals_($1,"a Set ()");
  9610. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9611. $ctx1.sendIdx["assert:equals:"]=1;
  9612. //>>excludeEnd("ctx");
  9613. $2=set;
  9614. $recv($2)._add_((1));
  9615. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9616. $ctx1.sendIdx["add:"]=1;
  9617. //>>excludeEnd("ctx");
  9618. $3=$recv($2)._add_((3));
  9619. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9620. $ctx1.sendIdx["add:"]=2;
  9621. //>>excludeEnd("ctx");
  9622. $4=$recv(set)._printString();
  9623. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9624. $ctx1.sendIdx["printString"]=2;
  9625. //>>excludeEnd("ctx");
  9626. $self._assert_equals_($4,"a Set (1 3)");
  9627. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9628. $ctx1.sendIdx["assert:equals:"]=2;
  9629. //>>excludeEnd("ctx");
  9630. $recv(set)._add_("foo");
  9631. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9632. $ctx1.sendIdx["add:"]=3;
  9633. //>>excludeEnd("ctx");
  9634. $5=$recv(set)._printString();
  9635. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9636. $ctx1.sendIdx["printString"]=3;
  9637. //>>excludeEnd("ctx");
  9638. $self._assert_equals_($5,"a Set (1 3 'foo')");
  9639. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9640. $ctx1.sendIdx["assert:equals:"]=3;
  9641. //>>excludeEnd("ctx");
  9642. $6=set;
  9643. $recv($6)._remove_((1));
  9644. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9645. $ctx1.sendIdx["remove:"]=1;
  9646. //>>excludeEnd("ctx");
  9647. $recv($6)._remove_((3));
  9648. $7=$recv(set)._printString();
  9649. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9650. $ctx1.sendIdx["printString"]=4;
  9651. //>>excludeEnd("ctx");
  9652. $self._assert_equals_($7,"a Set ('foo')");
  9653. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9654. $ctx1.sendIdx["assert:equals:"]=4;
  9655. //>>excludeEnd("ctx");
  9656. $recv(set)._add_((3));
  9657. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9658. $ctx1.sendIdx["add:"]=4;
  9659. //>>excludeEnd("ctx");
  9660. $8=$recv(set)._printString();
  9661. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9662. $ctx1.sendIdx["printString"]=5;
  9663. //>>excludeEnd("ctx");
  9664. $self._assert_equals_($8,"a Set (3 'foo')");
  9665. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9666. $ctx1.sendIdx["assert:equals:"]=5;
  9667. //>>excludeEnd("ctx");
  9668. $recv(set)._add_((3));
  9669. $self._assert_equals_($recv(set)._printString(),"a Set (3 'foo')");
  9670. return self;
  9671. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9672. }, function($ctx1) {$ctx1.fill(self,"testPrintString",{set:set},$globals.SetTest)});
  9673. //>>excludeEnd("ctx");
  9674. },
  9675. //>>excludeStart("ide", pragmas.excludeIdeData);
  9676. args: [],
  9677. source: "testPrintString\x0a\x09| set |\x0a\x09set := Set new.\x0a\x09self assert: set printString equals: 'a Set ()'.\x0a\x09set add: 1; add: 3.\x0a\x09self assert: set printString equals: 'a Set (1 3)'.\x0a\x09set add: 'foo'.\x0a\x09self assert: set printString equals: 'a Set (1 3 ''foo'')'.\x0a\x09set remove: 1; remove: 3.\x0a\x09self assert: set printString equals: 'a Set (''foo'')'.\x0a\x09set add: 3.\x0a\x09self assert: set printString equals: 'a Set (3 ''foo'')'.\x0a\x09set add: 3.\x0a\x09self assert: set printString equals: 'a Set (3 ''foo'')'",
  9678. referencedClasses: ["Set"],
  9679. //>>excludeEnd("ide");
  9680. messageSends: ["new", "assert:equals:", "printString", "add:", "remove:"]
  9681. }),
  9682. $globals.SetTest);
  9683. $core.addMethod(
  9684. $core.method({
  9685. selector: "testUnboxedObjects",
  9686. protocol: "tests",
  9687. fn: function (){
  9688. var self=this,$self=this;
  9689. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9690. return $core.withContext(function($ctx1) {
  9691. //>>excludeEnd("ctx");
  9692. var $4,$3,$2,$1;
  9693. $4="foo"._yourself();
  9694. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9695. $ctx1.sendIdx["yourself"]=1;
  9696. //>>excludeEnd("ctx");
  9697. $3=[$4,"foo"._yourself()];
  9698. $2=$recv($3)._asSet();
  9699. $1=$recv($2)._asArray();
  9700. $self._assert_equals_($1,["foo"]);
  9701. return self;
  9702. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9703. }, function($ctx1) {$ctx1.fill(self,"testUnboxedObjects",{},$globals.SetTest)});
  9704. //>>excludeEnd("ctx");
  9705. },
  9706. //>>excludeStart("ide", pragmas.excludeIdeData);
  9707. args: [],
  9708. source: "testUnboxedObjects\x0a\x09self assert: {'foo' yourself. 'foo' yourself} asSet asArray equals: #('foo')",
  9709. referencedClasses: [],
  9710. //>>excludeEnd("ide");
  9711. messageSends: ["assert:equals:", "asArray", "asSet", "yourself"]
  9712. }),
  9713. $globals.SetTest);
  9714. $core.addMethod(
  9715. $core.method({
  9716. selector: "testUnicity",
  9717. protocol: "tests",
  9718. fn: function (){
  9719. var self=this,$self=this;
  9720. var set;
  9721. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9722. return $core.withContext(function($ctx1) {
  9723. //>>excludeEnd("ctx");
  9724. var $1;
  9725. set=$recv($globals.Set)._new();
  9726. $recv(set)._add_((21));
  9727. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9728. $ctx1.sendIdx["add:"]=1;
  9729. //>>excludeEnd("ctx");
  9730. $recv(set)._add_("hello");
  9731. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9732. $ctx1.sendIdx["add:"]=2;
  9733. //>>excludeEnd("ctx");
  9734. $recv(set)._add_((21));
  9735. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9736. $ctx1.sendIdx["add:"]=3;
  9737. //>>excludeEnd("ctx");
  9738. $1=$recv(set)._size();
  9739. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9740. $ctx1.sendIdx["size"]=1;
  9741. //>>excludeEnd("ctx");
  9742. $self._assert_equals_($1,(2));
  9743. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9744. $ctx1.sendIdx["assert:equals:"]=1;
  9745. //>>excludeEnd("ctx");
  9746. $recv(set)._add_("hello");
  9747. $self._assert_equals_($recv(set)._size(),(2));
  9748. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9749. $ctx1.sendIdx["assert:equals:"]=2;
  9750. //>>excludeEnd("ctx");
  9751. $self._assert_equals_($recv(set)._asArray(),[(21), "hello"]);
  9752. return self;
  9753. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9754. }, function($ctx1) {$ctx1.fill(self,"testUnicity",{set:set},$globals.SetTest)});
  9755. //>>excludeEnd("ctx");
  9756. },
  9757. //>>excludeStart("ide", pragmas.excludeIdeData);
  9758. args: [],
  9759. source: "testUnicity\x0a\x09| set |\x0a\x09set := Set new.\x0a\x09set add: 21.\x0a\x09set add: 'hello'.\x0a\x0a\x09set add: 21.\x0a\x09self assert: set size equals: 2.\x0a\x09\x0a\x09set add: 'hello'.\x0a\x09self assert: set size equals: 2.\x0a\x0a\x09self assert: set asArray equals: #(21 'hello')",
  9760. referencedClasses: ["Set"],
  9761. //>>excludeEnd("ide");
  9762. messageSends: ["new", "add:", "assert:equals:", "size", "asArray"]
  9763. }),
  9764. $globals.SetTest);
  9765. $core.addMethod(
  9766. $core.method({
  9767. selector: "collectionClass",
  9768. protocol: "fixture",
  9769. fn: function (){
  9770. var self=this,$self=this;
  9771. return $globals.Set;
  9772. },
  9773. //>>excludeStart("ide", pragmas.excludeIdeData);
  9774. args: [],
  9775. source: "collectionClass\x0a\x09^ Set",
  9776. referencedClasses: ["Set"],
  9777. //>>excludeEnd("ide");
  9778. messageSends: []
  9779. }),
  9780. $globals.SetTest.a$cls);
  9781. $core.addClass("ConsoleTranscriptTest", $globals.TestCase, [], "Kernel-Tests");
  9782. $core.addMethod(
  9783. $core.method({
  9784. selector: "testShow",
  9785. protocol: "tests",
  9786. fn: function (){
  9787. var self=this,$self=this;
  9788. var originalTranscript;
  9789. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9790. return $core.withContext(function($ctx1) {
  9791. //>>excludeEnd("ctx");
  9792. originalTranscript=$recv($globals.Transcript)._current();
  9793. $recv($globals.Transcript)._register_($recv($globals.ConsoleTranscript)._new());
  9794. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9795. $ctx1.sendIdx["register:"]=1;
  9796. //>>excludeEnd("ctx");
  9797. $self._shouldnt_raise_((function(){
  9798. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9799. return $core.withContext(function($ctx2) {
  9800. //>>excludeEnd("ctx");
  9801. return $recv($globals.Transcript)._show_("Hello console!");
  9802. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9803. $ctx2.sendIdx["show:"]=1;
  9804. //>>excludeEnd("ctx");
  9805. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9806. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  9807. //>>excludeEnd("ctx");
  9808. }),$globals.Error);
  9809. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9810. $ctx1.sendIdx["shouldnt:raise:"]=1;
  9811. //>>excludeEnd("ctx");
  9812. $self._shouldnt_raise_((function(){
  9813. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9814. return $core.withContext(function($ctx2) {
  9815. //>>excludeEnd("ctx");
  9816. return $recv($globals.Transcript)._show_(console);
  9817. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9818. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  9819. //>>excludeEnd("ctx");
  9820. }),$globals.Error);
  9821. $recv($globals.Transcript)._register_(originalTranscript);
  9822. return self;
  9823. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9824. }, function($ctx1) {$ctx1.fill(self,"testShow",{originalTranscript:originalTranscript},$globals.ConsoleTranscriptTest)});
  9825. //>>excludeEnd("ctx");
  9826. },
  9827. //>>excludeStart("ide", pragmas.excludeIdeData);
  9828. args: [],
  9829. source: "testShow\x0a| originalTranscript |\x0aoriginalTranscript := Transcript current.\x0aTranscript register: ConsoleTranscript new.\x0a\x0aself shouldnt: [ Transcript show: 'Hello console!' ] raise: Error.\x0aself shouldnt: [ Transcript show: console ] raise: Error.\x0a\x0aTranscript register: originalTranscript.",
  9830. referencedClasses: ["Transcript", "ConsoleTranscript", "Error"],
  9831. //>>excludeEnd("ide");
  9832. messageSends: ["current", "register:", "new", "shouldnt:raise:", "show:"]
  9833. }),
  9834. $globals.ConsoleTranscriptTest);
  9835. $core.addClass("DateTest", $globals.TestCase, [], "Kernel-Tests");
  9836. $core.addMethod(
  9837. $core.method({
  9838. selector: "testEquality",
  9839. protocol: "tests",
  9840. fn: function (){
  9841. var self=this,$self=this;
  9842. var now;
  9843. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9844. return $core.withContext(function($ctx1) {
  9845. //>>excludeEnd("ctx");
  9846. var $1,$3,$4,$2,$6,$7,$5,$9,$11,$10,$8;
  9847. now=$recv($globals.Date)._new();
  9848. $1=$recv(now).__eq(now);
  9849. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9850. $ctx1.sendIdx["="]=1;
  9851. //>>excludeEnd("ctx");
  9852. $self._assert_($1);
  9853. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9854. $ctx1.sendIdx["assert:"]=1;
  9855. //>>excludeEnd("ctx");
  9856. $3=now;
  9857. $4=$recv($globals.Date)._fromMilliseconds_((0));
  9858. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9859. $ctx1.sendIdx["fromMilliseconds:"]=1;
  9860. //>>excludeEnd("ctx");
  9861. $2=$recv($3).__eq($4);
  9862. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9863. $ctx1.sendIdx["="]=2;
  9864. //>>excludeEnd("ctx");
  9865. $self._deny_($2);
  9866. $6=$recv($globals.Date)._fromMilliseconds_((12345678));
  9867. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9868. $ctx1.sendIdx["fromMilliseconds:"]=2;
  9869. //>>excludeEnd("ctx");
  9870. $7=$recv($globals.Date)._fromMilliseconds_((12345678));
  9871. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9872. $ctx1.sendIdx["fromMilliseconds:"]=3;
  9873. //>>excludeEnd("ctx");
  9874. $5=$recv($6).__eq($7);
  9875. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9876. $ctx1.sendIdx["="]=3;
  9877. //>>excludeEnd("ctx");
  9878. $self._assert_($5);
  9879. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9880. $ctx1.sendIdx["assert:"]=2;
  9881. //>>excludeEnd("ctx");
  9882. $9=now;
  9883. $11=$recv(now)._asMilliseconds();
  9884. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9885. $ctx1.sendIdx["asMilliseconds"]=1;
  9886. //>>excludeEnd("ctx");
  9887. $10=$recv($globals.Date)._fromMilliseconds_($11);
  9888. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9889. $ctx1.sendIdx["fromMilliseconds:"]=4;
  9890. //>>excludeEnd("ctx");
  9891. $8=$recv($9).__eq($10);
  9892. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9893. $ctx1.sendIdx["="]=4;
  9894. //>>excludeEnd("ctx");
  9895. $self._assert_($8);
  9896. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9897. $ctx1.sendIdx["assert:"]=3;
  9898. //>>excludeEnd("ctx");
  9899. $self._assert_($recv($recv($globals.Date)._fromMilliseconds_($recv(now)._asMilliseconds())).__eq(now));
  9900. return self;
  9901. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9902. }, function($ctx1) {$ctx1.fill(self,"testEquality",{now:now},$globals.DateTest)});
  9903. //>>excludeEnd("ctx");
  9904. },
  9905. //>>excludeStart("ide", pragmas.excludeIdeData);
  9906. args: [],
  9907. source: "testEquality\x0a\x09| now |\x0a\x09now := Date new.\x0a\x0a\x09self assert: now = now.\x0a\x0a\x09self deny: now = (Date fromMilliseconds: 0).\x0a\x0a\x09self assert: (Date fromMilliseconds: 12345678) = (Date fromMilliseconds: 12345678).\x0a\x09self assert: now = (Date fromMilliseconds: now asMilliseconds).\x0a\x09self assert: (Date fromMilliseconds: now asMilliseconds) = now",
  9908. referencedClasses: ["Date"],
  9909. //>>excludeEnd("ide");
  9910. messageSends: ["new", "assert:", "=", "deny:", "fromMilliseconds:", "asMilliseconds"]
  9911. }),
  9912. $globals.DateTest);
  9913. $core.addMethod(
  9914. $core.method({
  9915. selector: "testIdentity",
  9916. protocol: "tests",
  9917. fn: function (){
  9918. var self=this,$self=this;
  9919. var now;
  9920. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9921. return $core.withContext(function($ctx1) {
  9922. //>>excludeEnd("ctx");
  9923. var $1,$3,$4,$2,$6,$7,$5,$9,$11,$10,$8;
  9924. now=$recv($globals.Date)._new();
  9925. $1=$recv(now).__eq_eq(now);
  9926. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9927. $ctx1.sendIdx["=="]=1;
  9928. //>>excludeEnd("ctx");
  9929. $self._assert_($1);
  9930. $3=now;
  9931. $4=$recv($globals.Date)._fromMilliseconds_((0));
  9932. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9933. $ctx1.sendIdx["fromMilliseconds:"]=1;
  9934. //>>excludeEnd("ctx");
  9935. $2=$recv($3).__eq_eq($4);
  9936. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9937. $ctx1.sendIdx["=="]=2;
  9938. //>>excludeEnd("ctx");
  9939. $self._deny_($2);
  9940. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9941. $ctx1.sendIdx["deny:"]=1;
  9942. //>>excludeEnd("ctx");
  9943. $6=$recv($globals.Date)._fromMilliseconds_((12345678));
  9944. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9945. $ctx1.sendIdx["fromMilliseconds:"]=2;
  9946. //>>excludeEnd("ctx");
  9947. $7=$recv($globals.Date)._fromMilliseconds_((12345678));
  9948. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9949. $ctx1.sendIdx["fromMilliseconds:"]=3;
  9950. //>>excludeEnd("ctx");
  9951. $5=$recv($6).__eq_eq($7);
  9952. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9953. $ctx1.sendIdx["=="]=3;
  9954. //>>excludeEnd("ctx");
  9955. $self._deny_($5);
  9956. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9957. $ctx1.sendIdx["deny:"]=2;
  9958. //>>excludeEnd("ctx");
  9959. $9=now;
  9960. $11=$recv(now)._asMilliseconds();
  9961. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9962. $ctx1.sendIdx["asMilliseconds"]=1;
  9963. //>>excludeEnd("ctx");
  9964. $10=$recv($globals.Date)._fromMilliseconds_($11);
  9965. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9966. $ctx1.sendIdx["fromMilliseconds:"]=4;
  9967. //>>excludeEnd("ctx");
  9968. $8=$recv($9).__eq_eq($10);
  9969. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9970. $ctx1.sendIdx["=="]=4;
  9971. //>>excludeEnd("ctx");
  9972. $self._deny_($8);
  9973. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9974. $ctx1.sendIdx["deny:"]=3;
  9975. //>>excludeEnd("ctx");
  9976. $self._deny_($recv($recv($globals.Date)._fromMilliseconds_($recv(now)._asMilliseconds())).__eq_eq(now));
  9977. return self;
  9978. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9979. }, function($ctx1) {$ctx1.fill(self,"testIdentity",{now:now},$globals.DateTest)});
  9980. //>>excludeEnd("ctx");
  9981. },
  9982. //>>excludeStart("ide", pragmas.excludeIdeData);
  9983. args: [],
  9984. source: "testIdentity\x0a\x09| now |\x0a\x09now := Date new.\x0a\x0a\x09self assert: now == now.\x0a\x0a\x09self deny: now == (Date fromMilliseconds: 0).\x0a\x0a\x09self deny: (Date fromMilliseconds: 12345678) == (Date fromMilliseconds: 12345678).\x0a\x09self deny: now == (Date fromMilliseconds: now asMilliseconds).\x0a\x09self deny: (Date fromMilliseconds: now asMilliseconds) == now",
  9985. referencedClasses: ["Date"],
  9986. //>>excludeEnd("ide");
  9987. messageSends: ["new", "assert:", "==", "deny:", "fromMilliseconds:", "asMilliseconds"]
  9988. }),
  9989. $globals.DateTest);
  9990. $core.addClass("JSObjectProxyTest", $globals.TestCase, [], "Kernel-Tests");
  9991. $core.addMethod(
  9992. $core.method({
  9993. selector: "jsNull",
  9994. protocol: "accessing",
  9995. fn: function (){
  9996. var self=this,$self=this;
  9997. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9998. return $core.withContext(function($ctx1) {
  9999. //>>excludeEnd("ctx");
  10000. return null;
  10001. return self;
  10002. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10003. }, function($ctx1) {$ctx1.fill(self,"jsNull",{},$globals.JSObjectProxyTest)});
  10004. //>>excludeEnd("ctx");
  10005. },
  10006. //>>excludeStart("ide", pragmas.excludeIdeData);
  10007. args: [],
  10008. source: "jsNull\x0a\x09<inlineJS: 'return null'>",
  10009. referencedClasses: [],
  10010. //>>excludeEnd("ide");
  10011. messageSends: []
  10012. }),
  10013. $globals.JSObjectProxyTest);
  10014. $core.addMethod(
  10015. $core.method({
  10016. selector: "jsObject",
  10017. protocol: "accessing",
  10018. fn: function (){
  10019. var self=this,$self=this;
  10020. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10021. return $core.withContext(function($ctx1) {
  10022. //>>excludeEnd("ctx");
  10023. return {a: 1, b: function() {return 2;}, c: function(object) {return object;}, d: "", "e": null, "f": void 0};
  10024. return self;
  10025. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10026. }, function($ctx1) {$ctx1.fill(self,"jsObject",{},$globals.JSObjectProxyTest)});
  10027. //>>excludeEnd("ctx");
  10028. },
  10029. //>>excludeStart("ide", pragmas.excludeIdeData);
  10030. args: [],
  10031. source: "jsObject\x0a\x09<inlineJS: \x0a\x09\x09'return {a: 1, b: function() {return 2;}, c: function(object) {return object;}, d: \x22\x22, \x22e\x22: null, \x22f\x22: void 0}'>",
  10032. referencedClasses: [],
  10033. //>>excludeEnd("ide");
  10034. messageSends: []
  10035. }),
  10036. $globals.JSObjectProxyTest);
  10037. $core.addMethod(
  10038. $core.method({
  10039. selector: "jsUndefined",
  10040. protocol: "accessing",
  10041. fn: function (){
  10042. var self=this,$self=this;
  10043. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10044. return $core.withContext(function($ctx1) {
  10045. //>>excludeEnd("ctx");
  10046. return;
  10047. return self;
  10048. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10049. }, function($ctx1) {$ctx1.fill(self,"jsUndefined",{},$globals.JSObjectProxyTest)});
  10050. //>>excludeEnd("ctx");
  10051. },
  10052. //>>excludeStart("ide", pragmas.excludeIdeData);
  10053. args: [],
  10054. source: "jsUndefined\x0a\x09<inlineJS: 'return'>",
  10055. referencedClasses: [],
  10056. //>>excludeEnd("ide");
  10057. messageSends: []
  10058. }),
  10059. $globals.JSObjectProxyTest);
  10060. $core.addMethod(
  10061. $core.method({
  10062. selector: "testAtIfAbsent",
  10063. protocol: "tests",
  10064. fn: function (){
  10065. var self=this,$self=this;
  10066. var testObject;
  10067. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10068. return $core.withContext(function($ctx1) {
  10069. //>>excludeEnd("ctx");
  10070. var $1,$2,$3;
  10071. testObject=$self._jsObject();
  10072. $1=$recv(testObject)._at_ifAbsent_("abc",(function(){
  10073. return "Property does not exist";
  10074. }));
  10075. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10076. $ctx1.sendIdx["at:ifAbsent:"]=1;
  10077. //>>excludeEnd("ctx");
  10078. $self._assert_equals_($1,"Property does not exist");
  10079. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10080. $ctx1.sendIdx["assert:equals:"]=1;
  10081. //>>excludeEnd("ctx");
  10082. $2=$recv(testObject)._at_ifAbsent_("e",(function(){
  10083. return "Property does not exist";
  10084. }));
  10085. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10086. $ctx1.sendIdx["at:ifAbsent:"]=2;
  10087. //>>excludeEnd("ctx");
  10088. $self._assert_equals_($2,nil);
  10089. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10090. $ctx1.sendIdx["assert:equals:"]=2;
  10091. //>>excludeEnd("ctx");
  10092. $3=$recv(testObject)._at_ifAbsent_("a",(function(){
  10093. return "Property does not exist";
  10094. }));
  10095. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10096. $ctx1.sendIdx["at:ifAbsent:"]=3;
  10097. //>>excludeEnd("ctx");
  10098. $self._assert_equals_($3,(1));
  10099. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10100. $ctx1.sendIdx["assert:equals:"]=3;
  10101. //>>excludeEnd("ctx");
  10102. $self._assert_equals_($recv(testObject)._at_ifAbsent_("f",(function(){
  10103. return "Property does not exist";
  10104. })),nil);
  10105. return self;
  10106. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10107. }, function($ctx1) {$ctx1.fill(self,"testAtIfAbsent",{testObject:testObject},$globals.JSObjectProxyTest)});
  10108. //>>excludeEnd("ctx");
  10109. },
  10110. //>>excludeStart("ide", pragmas.excludeIdeData);
  10111. args: [],
  10112. source: "testAtIfAbsent\x0a\x09| testObject |\x0a\x09testObject := self jsObject.\x0a\x09self assert: (testObject at: 'abc' ifAbsent: [ 'Property does not exist' ]) equals: 'Property does not exist'.\x0a\x09self assert: (testObject at: 'e' ifAbsent: [ 'Property does not exist' ]) equals: nil.\x0a\x09self assert: (testObject at: 'a' ifAbsent: [ 'Property does not exist' ]) equals: 1.\x0a\x09self assert: (testObject at: 'f' ifAbsent: [ 'Property does not exist' ]) equals: nil.",
  10113. referencedClasses: [],
  10114. //>>excludeEnd("ide");
  10115. messageSends: ["jsObject", "assert:equals:", "at:ifAbsent:"]
  10116. }),
  10117. $globals.JSObjectProxyTest);
  10118. $core.addMethod(
  10119. $core.method({
  10120. selector: "testAtIfPresent",
  10121. protocol: "tests",
  10122. fn: function (){
  10123. var self=this,$self=this;
  10124. var testObject;
  10125. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10126. return $core.withContext(function($ctx1) {
  10127. //>>excludeEnd("ctx");
  10128. var $2,$1,$4,$3,$6,$5;
  10129. testObject=$self._jsObject();
  10130. $1=$recv(testObject)._at_ifPresent_("abc",(function(x){
  10131. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10132. return $core.withContext(function($ctx2) {
  10133. //>>excludeEnd("ctx");
  10134. $2=$recv(x)._asString();
  10135. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10136. $ctx2.sendIdx["asString"]=1;
  10137. //>>excludeEnd("ctx");
  10138. return "hello ".__comma($2);
  10139. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10140. $ctx2.sendIdx[","]=1;
  10141. //>>excludeEnd("ctx");
  10142. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10143. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)});
  10144. //>>excludeEnd("ctx");
  10145. }));
  10146. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10147. $ctx1.sendIdx["at:ifPresent:"]=1;
  10148. //>>excludeEnd("ctx");
  10149. $self._assert_equals_($1,nil);
  10150. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10151. $ctx1.sendIdx["assert:equals:"]=1;
  10152. //>>excludeEnd("ctx");
  10153. $3=$recv(testObject)._at_ifPresent_("e",(function(x){
  10154. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10155. return $core.withContext(function($ctx2) {
  10156. //>>excludeEnd("ctx");
  10157. $4=$recv(x)._asString();
  10158. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10159. $ctx2.sendIdx["asString"]=2;
  10160. //>>excludeEnd("ctx");
  10161. return "hello ".__comma($4);
  10162. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10163. $ctx2.sendIdx[","]=2;
  10164. //>>excludeEnd("ctx");
  10165. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10166. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,2)});
  10167. //>>excludeEnd("ctx");
  10168. }));
  10169. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10170. $ctx1.sendIdx["at:ifPresent:"]=2;
  10171. //>>excludeEnd("ctx");
  10172. $self._assert_equals_($3,"hello nil");
  10173. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10174. $ctx1.sendIdx["assert:equals:"]=2;
  10175. //>>excludeEnd("ctx");
  10176. $5=$recv(testObject)._at_ifPresent_("a",(function(x){
  10177. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10178. return $core.withContext(function($ctx2) {
  10179. //>>excludeEnd("ctx");
  10180. $6=$recv(x)._asString();
  10181. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10182. $ctx2.sendIdx["asString"]=3;
  10183. //>>excludeEnd("ctx");
  10184. return "hello ".__comma($6);
  10185. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10186. $ctx2.sendIdx[","]=3;
  10187. //>>excludeEnd("ctx");
  10188. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10189. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,3)});
  10190. //>>excludeEnd("ctx");
  10191. }));
  10192. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10193. $ctx1.sendIdx["at:ifPresent:"]=3;
  10194. //>>excludeEnd("ctx");
  10195. $self._assert_equals_($5,"hello 1");
  10196. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10197. $ctx1.sendIdx["assert:equals:"]=3;
  10198. //>>excludeEnd("ctx");
  10199. $self._assert_equals_($recv(testObject)._at_ifPresent_("f",(function(x){
  10200. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10201. return $core.withContext(function($ctx2) {
  10202. //>>excludeEnd("ctx");
  10203. return "hello ".__comma($recv(x)._asString());
  10204. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10205. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,4)});
  10206. //>>excludeEnd("ctx");
  10207. })),"hello nil");
  10208. return self;
  10209. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10210. }, function($ctx1) {$ctx1.fill(self,"testAtIfPresent",{testObject:testObject},$globals.JSObjectProxyTest)});
  10211. //>>excludeEnd("ctx");
  10212. },
  10213. //>>excludeStart("ide", pragmas.excludeIdeData);
  10214. args: [],
  10215. source: "testAtIfPresent\x0a\x09| testObject |\x0a\x09\x0a\x09testObject := self jsObject.\x0a\x09\x0a\x09self assert: (testObject at: 'abc' ifPresent: [ :x | 'hello ',x asString ]) equals: nil.\x0a\x09self assert: (testObject at: 'e' ifPresent: [ :x | 'hello ',x asString ]) equals: 'hello nil'.\x0a\x09self assert: (testObject at: 'a' ifPresent: [ :x | 'hello ',x asString ]) equals: 'hello 1'.\x0a\x09self assert: (testObject at: 'f' ifPresent: [ :x | 'hello ',x asString ]) equals: 'hello nil'.",
  10216. referencedClasses: [],
  10217. //>>excludeEnd("ide");
  10218. messageSends: ["jsObject", "assert:equals:", "at:ifPresent:", ",", "asString"]
  10219. }),
  10220. $globals.JSObjectProxyTest);
  10221. $core.addMethod(
  10222. $core.method({
  10223. selector: "testAtIfPresentIfAbsent",
  10224. protocol: "tests",
  10225. fn: function (){
  10226. var self=this,$self=this;
  10227. var testObject;
  10228. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10229. return $core.withContext(function($ctx1) {
  10230. //>>excludeEnd("ctx");
  10231. var $2,$1,$4,$3,$6,$5;
  10232. testObject=$self._jsObject();
  10233. $1=$recv(testObject)._at_ifPresent_ifAbsent_("abc",(function(x){
  10234. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10235. return $core.withContext(function($ctx2) {
  10236. //>>excludeEnd("ctx");
  10237. $2=$recv(x)._asString();
  10238. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10239. $ctx2.sendIdx["asString"]=1;
  10240. //>>excludeEnd("ctx");
  10241. return "hello ".__comma($2);
  10242. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10243. $ctx2.sendIdx[","]=1;
  10244. //>>excludeEnd("ctx");
  10245. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10246. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)});
  10247. //>>excludeEnd("ctx");
  10248. }),(function(){
  10249. return "not present";
  10250. }));
  10251. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10252. $ctx1.sendIdx["at:ifPresent:ifAbsent:"]=1;
  10253. //>>excludeEnd("ctx");
  10254. $self._assert_equals_($1,"not present");
  10255. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10256. $ctx1.sendIdx["assert:equals:"]=1;
  10257. //>>excludeEnd("ctx");
  10258. $3=$recv(testObject)._at_ifPresent_ifAbsent_("e",(function(x){
  10259. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10260. return $core.withContext(function($ctx2) {
  10261. //>>excludeEnd("ctx");
  10262. $4=$recv(x)._asString();
  10263. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10264. $ctx2.sendIdx["asString"]=2;
  10265. //>>excludeEnd("ctx");
  10266. return "hello ".__comma($4);
  10267. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10268. $ctx2.sendIdx[","]=2;
  10269. //>>excludeEnd("ctx");
  10270. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10271. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,3)});
  10272. //>>excludeEnd("ctx");
  10273. }),(function(){
  10274. return "not present";
  10275. }));
  10276. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10277. $ctx1.sendIdx["at:ifPresent:ifAbsent:"]=2;
  10278. //>>excludeEnd("ctx");
  10279. $self._assert_equals_($3,"hello nil");
  10280. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10281. $ctx1.sendIdx["assert:equals:"]=2;
  10282. //>>excludeEnd("ctx");
  10283. $5=$recv(testObject)._at_ifPresent_ifAbsent_("a",(function(x){
  10284. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10285. return $core.withContext(function($ctx2) {
  10286. //>>excludeEnd("ctx");
  10287. $6=$recv(x)._asString();
  10288. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10289. $ctx2.sendIdx["asString"]=3;
  10290. //>>excludeEnd("ctx");
  10291. return "hello ".__comma($6);
  10292. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10293. $ctx2.sendIdx[","]=3;
  10294. //>>excludeEnd("ctx");
  10295. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10296. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,5)});
  10297. //>>excludeEnd("ctx");
  10298. }),(function(){
  10299. return "not present";
  10300. }));
  10301. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10302. $ctx1.sendIdx["at:ifPresent:ifAbsent:"]=3;
  10303. //>>excludeEnd("ctx");
  10304. $self._assert_equals_($5,"hello 1");
  10305. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10306. $ctx1.sendIdx["assert:equals:"]=3;
  10307. //>>excludeEnd("ctx");
  10308. $self._assert_equals_($recv(testObject)._at_ifPresent_ifAbsent_("f",(function(x){
  10309. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10310. return $core.withContext(function($ctx2) {
  10311. //>>excludeEnd("ctx");
  10312. return "hello ".__comma($recv(x)._asString());
  10313. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10314. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,7)});
  10315. //>>excludeEnd("ctx");
  10316. }),(function(){
  10317. return "not present";
  10318. })),"hello nil");
  10319. return self;
  10320. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10321. }, function($ctx1) {$ctx1.fill(self,"testAtIfPresentIfAbsent",{testObject:testObject},$globals.JSObjectProxyTest)});
  10322. //>>excludeEnd("ctx");
  10323. },
  10324. //>>excludeStart("ide", pragmas.excludeIdeData);
  10325. args: [],
  10326. source: "testAtIfPresentIfAbsent\x0a\x09| testObject |\x0a\x09testObject := self jsObject.\x0a\x09self assert: (testObject at: 'abc' ifPresent: [ :x|'hello ',x asString ] ifAbsent: [ 'not present' ]) equals: 'not present'.\x0a\x09self assert: (testObject at: 'e' ifPresent: [ :x|'hello ',x asString ] ifAbsent: [ 'not present' ]) equals: 'hello nil'.\x0a\x09self assert: (testObject at: 'a' ifPresent: [ :x|'hello ',x asString ] ifAbsent: [ 'not present' ]) equals: 'hello 1'.\x0a\x09self assert: (testObject at: 'f' ifPresent: [ :x|'hello ',x asString ] ifAbsent: [ 'not present' ]) equals: 'hello nil'.",
  10327. referencedClasses: [],
  10328. //>>excludeEnd("ide");
  10329. messageSends: ["jsObject", "assert:equals:", "at:ifPresent:ifAbsent:", ",", "asString"]
  10330. }),
  10331. $globals.JSObjectProxyTest);
  10332. $core.addMethod(
  10333. $core.method({
  10334. selector: "testAtPut",
  10335. protocol: "tests",
  10336. fn: function (){
  10337. var self=this,$self=this;
  10338. var testObject;
  10339. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10340. return $core.withContext(function($ctx1) {
  10341. //>>excludeEnd("ctx");
  10342. var $2,$1;
  10343. testObject=$self._jsObject();
  10344. $2=$recv(testObject)._at_("abc");
  10345. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10346. $ctx1.sendIdx["at:"]=1;
  10347. //>>excludeEnd("ctx");
  10348. $1=$recv($2).__tild_eq("xyz");
  10349. $self._assert_($1);
  10350. $self._assert_equals_($recv(testObject)._at_put_("abc","xyz"),"xyz");
  10351. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10352. $ctx1.sendIdx["assert:equals:"]=1;
  10353. //>>excludeEnd("ctx");
  10354. $self._assert_equals_($recv(testObject)._at_("abc"),"xyz");
  10355. return self;
  10356. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10357. }, function($ctx1) {$ctx1.fill(self,"testAtPut",{testObject:testObject},$globals.JSObjectProxyTest)});
  10358. //>>excludeEnd("ctx");
  10359. },
  10360. //>>excludeStart("ide", pragmas.excludeIdeData);
  10361. args: [],
  10362. source: "testAtPut\x0a\x09| testObject |\x0a\x09testObject := self jsObject.\x0a\x09\x0a\x09self assert: (testObject at: 'abc') ~= 'xyz'.\x0a\x09self assert: (testObject at: 'abc' put: 'xyz') equals: 'xyz'.\x0a\x09self assert: (testObject at: 'abc') equals: 'xyz'",
  10363. referencedClasses: [],
  10364. //>>excludeEnd("ide");
  10365. messageSends: ["jsObject", "assert:", "~=", "at:", "assert:equals:", "at:put:"]
  10366. }),
  10367. $globals.JSObjectProxyTest);
  10368. $core.addMethod(
  10369. $core.method({
  10370. selector: "testComparison",
  10371. protocol: "tests",
  10372. fn: function (){
  10373. var self=this,$self=this;
  10374. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10375. return $core.withContext(function($ctx1) {
  10376. //>>excludeEnd("ctx");
  10377. var $1,$2;
  10378. $self._assert_equals_($recv([console,(2)])._indexOf_(console),(1));
  10379. $1=$recv(console).__eq(console);
  10380. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10381. $ctx1.sendIdx["="]=1;
  10382. //>>excludeEnd("ctx");
  10383. $self._assert_($1);
  10384. $2=$recv(console).__eq($recv($globals.Object)._new());
  10385. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10386. $ctx1.sendIdx["="]=2;
  10387. //>>excludeEnd("ctx");
  10388. $self._deny_($2);
  10389. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10390. $ctx1.sendIdx["deny:"]=1;
  10391. //>>excludeEnd("ctx");
  10392. $self._deny_($recv(console).__eq($self._jsObject()));
  10393. return self;
  10394. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10395. }, function($ctx1) {$ctx1.fill(self,"testComparison",{},$globals.JSObjectProxyTest)});
  10396. //>>excludeEnd("ctx");
  10397. },
  10398. //>>excludeStart("ide", pragmas.excludeIdeData);
  10399. args: [],
  10400. source: "testComparison\x0a\x09self assert: ({ console. 2 } indexOf: console) equals: 1.\x0a\x09self assert: console = console.\x0a\x09self deny: console = Object new.\x0a\x09self deny: console = self jsObject",
  10401. referencedClasses: ["Object"],
  10402. //>>excludeEnd("ide");
  10403. messageSends: ["assert:equals:", "indexOf:", "assert:", "=", "deny:", "new", "jsObject"]
  10404. }),
  10405. $globals.JSObjectProxyTest);
  10406. $core.addMethod(
  10407. $core.method({
  10408. selector: "testDNU",
  10409. protocol: "tests",
  10410. fn: function (){
  10411. var self=this,$self=this;
  10412. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10413. return $core.withContext(function($ctx1) {
  10414. //>>excludeEnd("ctx");
  10415. $self._should_raise_((function(){
  10416. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10417. return $core.withContext(function($ctx2) {
  10418. //>>excludeEnd("ctx");
  10419. return $recv($self._jsObject())._foo();
  10420. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10421. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  10422. //>>excludeEnd("ctx");
  10423. }),$globals.MessageNotUnderstood);
  10424. return self;
  10425. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10426. }, function($ctx1) {$ctx1.fill(self,"testDNU",{},$globals.JSObjectProxyTest)});
  10427. //>>excludeEnd("ctx");
  10428. },
  10429. //>>excludeStart("ide", pragmas.excludeIdeData);
  10430. args: [],
  10431. source: "testDNU\x0a\x09self should: [ self jsObject foo ] raise: MessageNotUnderstood",
  10432. referencedClasses: ["MessageNotUnderstood"],
  10433. //>>excludeEnd("ide");
  10434. messageSends: ["should:raise:", "foo", "jsObject"]
  10435. }),
  10436. $globals.JSObjectProxyTest);
  10437. $core.addMethod(
  10438. $core.method({
  10439. selector: "testDNUWithAllowJavaScriptCalls",
  10440. protocol: "tests",
  10441. fn: function (){
  10442. var self=this,$self=this;
  10443. var jsObject;
  10444. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10445. return $core.withContext(function($ctx1) {
  10446. //>>excludeEnd("ctx");
  10447. jsObject=[];
  10448. $recv(jsObject)._basicAt_put_("allowJavaScriptCalls",true);
  10449. $self._should_raise_((function(){
  10450. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10451. return $core.withContext(function($ctx2) {
  10452. //>>excludeEnd("ctx");
  10453. return $recv(jsObject)._foo();
  10454. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10455. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  10456. //>>excludeEnd("ctx");
  10457. }),$globals.MessageNotUnderstood);
  10458. return self;
  10459. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10460. }, function($ctx1) {$ctx1.fill(self,"testDNUWithAllowJavaScriptCalls",{jsObject:jsObject},$globals.JSObjectProxyTest)});
  10461. //>>excludeEnd("ctx");
  10462. },
  10463. //>>excludeStart("ide", pragmas.excludeIdeData);
  10464. args: [],
  10465. source: "testDNUWithAllowJavaScriptCalls\x0a\x09| jsObject |\x0a\x09jsObject := #().\x0a\x09jsObject basicAt: 'allowJavaScriptCalls' put: true.\x0a\x09self should: [ jsObject foo ] raise: MessageNotUnderstood",
  10466. referencedClasses: ["MessageNotUnderstood"],
  10467. //>>excludeEnd("ide");
  10468. messageSends: ["basicAt:put:", "should:raise:", "foo"]
  10469. }),
  10470. $globals.JSObjectProxyTest);
  10471. $core.addMethod(
  10472. $core.method({
  10473. selector: "testMessageSend",
  10474. protocol: "tests",
  10475. fn: function (){
  10476. var self=this,$self=this;
  10477. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10478. return $core.withContext(function($ctx1) {
  10479. //>>excludeEnd("ctx");
  10480. var $2,$1,$4,$3;
  10481. $2=$self._jsObject();
  10482. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10483. $ctx1.sendIdx["jsObject"]=1;
  10484. //>>excludeEnd("ctx");
  10485. $1=$recv($2)._a();
  10486. $self._assert_equals_($1,(1));
  10487. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10488. $ctx1.sendIdx["assert:equals:"]=1;
  10489. //>>excludeEnd("ctx");
  10490. $4=$self._jsObject();
  10491. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10492. $ctx1.sendIdx["jsObject"]=2;
  10493. //>>excludeEnd("ctx");
  10494. $3=$recv($4)._b();
  10495. $self._assert_equals_($3,(2));
  10496. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10497. $ctx1.sendIdx["assert:equals:"]=2;
  10498. //>>excludeEnd("ctx");
  10499. $self._assert_equals_($recv($self._jsObject())._c_((3)),(3));
  10500. return self;
  10501. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10502. }, function($ctx1) {$ctx1.fill(self,"testMessageSend",{},$globals.JSObjectProxyTest)});
  10503. //>>excludeEnd("ctx");
  10504. },
  10505. //>>excludeStart("ide", pragmas.excludeIdeData);
  10506. args: [],
  10507. source: "testMessageSend\x0a\x0a\x09self assert: self jsObject a equals: 1.\x0a\x09self assert: self jsObject b equals: 2.\x0a\x09self assert: (self jsObject c: 3) equals: 3",
  10508. referencedClasses: [],
  10509. //>>excludeEnd("ide");
  10510. messageSends: ["assert:equals:", "a", "jsObject", "b", "c:"]
  10511. }),
  10512. $globals.JSObjectProxyTest);
  10513. $core.addMethod(
  10514. $core.method({
  10515. selector: "testMethodWithArguments",
  10516. protocol: "tests",
  10517. fn: function (){
  10518. var self=this,$self=this;
  10519. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10520. return $core.withContext(function($ctx1) {
  10521. //>>excludeEnd("ctx");
  10522. $self._assert_equals_($recv($self._jsObject())._c_((1)),(1));
  10523. return self;
  10524. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10525. }, function($ctx1) {$ctx1.fill(self,"testMethodWithArguments",{},$globals.JSObjectProxyTest)});
  10526. //>>excludeEnd("ctx");
  10527. },
  10528. //>>excludeStart("ide", pragmas.excludeIdeData);
  10529. args: [],
  10530. source: "testMethodWithArguments\x0a\x09self assert: (self jsObject c: 1) equals: 1",
  10531. referencedClasses: [],
  10532. //>>excludeEnd("ide");
  10533. messageSends: ["assert:equals:", "c:", "jsObject"]
  10534. }),
  10535. $globals.JSObjectProxyTest);
  10536. $core.addMethod(
  10537. $core.method({
  10538. selector: "testPrinting",
  10539. protocol: "tests",
  10540. fn: function (){
  10541. var self=this,$self=this;
  10542. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10543. return $core.withContext(function($ctx1) {
  10544. //>>excludeEnd("ctx");
  10545. $self._assert_equals_($recv($self._jsObject())._printString(),"[object Object]");
  10546. return self;
  10547. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10548. }, function($ctx1) {$ctx1.fill(self,"testPrinting",{},$globals.JSObjectProxyTest)});
  10549. //>>excludeEnd("ctx");
  10550. },
  10551. //>>excludeStart("ide", pragmas.excludeIdeData);
  10552. args: [],
  10553. source: "testPrinting\x0a\x09self assert: self jsObject printString equals: '[object Object]'",
  10554. referencedClasses: [],
  10555. //>>excludeEnd("ide");
  10556. messageSends: ["assert:equals:", "printString", "jsObject"]
  10557. }),
  10558. $globals.JSObjectProxyTest);
  10559. $core.addMethod(
  10560. $core.method({
  10561. selector: "testPropertyThatReturnsEmptyString",
  10562. protocol: "tests",
  10563. fn: function (){
  10564. var self=this,$self=this;
  10565. var object;
  10566. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10567. return $core.withContext(function($ctx1) {
  10568. //>>excludeEnd("ctx");
  10569. var $1;
  10570. object=$self._jsObject();
  10571. $1=$recv(object)._d();
  10572. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10573. $ctx1.sendIdx["d"]=1;
  10574. //>>excludeEnd("ctx");
  10575. $self._assert_equals_($1,"");
  10576. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10577. $ctx1.sendIdx["assert:equals:"]=1;
  10578. //>>excludeEnd("ctx");
  10579. $recv(object)._d_("hello");
  10580. $self._assert_equals_($recv(object)._d(),"hello");
  10581. return self;
  10582. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10583. }, function($ctx1) {$ctx1.fill(self,"testPropertyThatReturnsEmptyString",{object:object},$globals.JSObjectProxyTest)});
  10584. //>>excludeEnd("ctx");
  10585. },
  10586. //>>excludeStart("ide", pragmas.excludeIdeData);
  10587. args: [],
  10588. source: "testPropertyThatReturnsEmptyString\x0a\x09| object |\x0a\x0a\x09object := self jsObject.\x0a\x09self assert: object d equals: ''.\x0a\x0a\x09object d: 'hello'.\x0a\x09self assert: object d equals: 'hello'",
  10589. referencedClasses: [],
  10590. //>>excludeEnd("ide");
  10591. messageSends: ["jsObject", "assert:equals:", "d", "d:"]
  10592. }),
  10593. $globals.JSObjectProxyTest);
  10594. $core.addMethod(
  10595. $core.method({
  10596. selector: "testPropertyThatReturnsUndefined",
  10597. protocol: "tests",
  10598. fn: function (){
  10599. var self=this,$self=this;
  10600. var object;
  10601. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10602. return $core.withContext(function($ctx1) {
  10603. //>>excludeEnd("ctx");
  10604. object=$self._jsObject();
  10605. $self._shouldnt_raise_((function(){
  10606. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10607. return $core.withContext(function($ctx2) {
  10608. //>>excludeEnd("ctx");
  10609. return $recv(object)._e();
  10610. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10611. $ctx2.sendIdx["e"]=1;
  10612. //>>excludeEnd("ctx");
  10613. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10614. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  10615. //>>excludeEnd("ctx");
  10616. }),$globals.MessageNotUnderstood);
  10617. $self._assert_($recv($recv(object)._e())._isNil());
  10618. return self;
  10619. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10620. }, function($ctx1) {$ctx1.fill(self,"testPropertyThatReturnsUndefined",{object:object},$globals.JSObjectProxyTest)});
  10621. //>>excludeEnd("ctx");
  10622. },
  10623. //>>excludeStart("ide", pragmas.excludeIdeData);
  10624. args: [],
  10625. source: "testPropertyThatReturnsUndefined\x0a\x09| object |\x0a\x0a\x09object := self jsObject.\x0a\x09self shouldnt: [ object e ] raise: MessageNotUnderstood.\x0a\x09self assert: object e isNil",
  10626. referencedClasses: ["MessageNotUnderstood"],
  10627. //>>excludeEnd("ide");
  10628. messageSends: ["jsObject", "shouldnt:raise:", "e", "assert:", "isNil"]
  10629. }),
  10630. $globals.JSObjectProxyTest);
  10631. $core.addMethod(
  10632. $core.method({
  10633. selector: "testSetPropertyWithFalsyValue",
  10634. protocol: "tests",
  10635. fn: function (){
  10636. var self=this,$self=this;
  10637. var jsObject;
  10638. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10639. return $core.withContext(function($ctx1) {
  10640. //>>excludeEnd("ctx");
  10641. var $1,$2,$3,$4,$5;
  10642. jsObject=$self._jsObject();
  10643. $1=$recv(jsObject)._a();
  10644. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10645. $ctx1.sendIdx["a"]=1;
  10646. //>>excludeEnd("ctx");
  10647. $self._assert_equals_($1,(1));
  10648. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10649. $ctx1.sendIdx["assert:equals:"]=1;
  10650. //>>excludeEnd("ctx");
  10651. $recv(jsObject)._a_($self._jsNull());
  10652. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10653. $ctx1.sendIdx["a:"]=1;
  10654. //>>excludeEnd("ctx");
  10655. $2=$recv(jsObject)._a();
  10656. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10657. $ctx1.sendIdx["a"]=2;
  10658. //>>excludeEnd("ctx");
  10659. $self._assert_equals_($2,nil);
  10660. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10661. $ctx1.sendIdx["assert:equals:"]=2;
  10662. //>>excludeEnd("ctx");
  10663. $recv(jsObject)._a_((0));
  10664. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10665. $ctx1.sendIdx["a:"]=2;
  10666. //>>excludeEnd("ctx");
  10667. $3=$recv(jsObject)._a();
  10668. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10669. $ctx1.sendIdx["a"]=3;
  10670. //>>excludeEnd("ctx");
  10671. $self._assert_equals_($3,(0));
  10672. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10673. $ctx1.sendIdx["assert:equals:"]=3;
  10674. //>>excludeEnd("ctx");
  10675. $recv(jsObject)._a_($self._jsUndefined());
  10676. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10677. $ctx1.sendIdx["a:"]=3;
  10678. //>>excludeEnd("ctx");
  10679. $4=$recv(jsObject)._a();
  10680. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10681. $ctx1.sendIdx["a"]=4;
  10682. //>>excludeEnd("ctx");
  10683. $self._assert_equals_($4,nil);
  10684. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10685. $ctx1.sendIdx["assert:equals:"]=4;
  10686. //>>excludeEnd("ctx");
  10687. $recv(jsObject)._a_("");
  10688. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10689. $ctx1.sendIdx["a:"]=4;
  10690. //>>excludeEnd("ctx");
  10691. $5=$recv(jsObject)._a();
  10692. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10693. $ctx1.sendIdx["a"]=5;
  10694. //>>excludeEnd("ctx");
  10695. $self._assert_equals_($5,"");
  10696. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10697. $ctx1.sendIdx["assert:equals:"]=5;
  10698. //>>excludeEnd("ctx");
  10699. $recv(jsObject)._a_(false);
  10700. $self._assert_equals_($recv(jsObject)._a(),false);
  10701. return self;
  10702. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10703. }, function($ctx1) {$ctx1.fill(self,"testSetPropertyWithFalsyValue",{jsObject:jsObject},$globals.JSObjectProxyTest)});
  10704. //>>excludeEnd("ctx");
  10705. },
  10706. //>>excludeStart("ide", pragmas.excludeIdeData);
  10707. args: [],
  10708. source: "testSetPropertyWithFalsyValue\x0a\x09| jsObject |\x0a\x09jsObject := self jsObject.\x0a\x09self assert: (jsObject a) equals: 1.\x0a\x0a\x09jsObject a: self jsNull.\x0a\x09self assert: (jsObject a) equals: nil.\x0a\x09jsObject a: 0.\x0a\x09self assert: (jsObject a) equals: 0.\x0a\x09jsObject a: self jsUndefined.\x0a\x09self assert: (jsObject a) equals: nil.\x0a\x09jsObject a: ''.\x0a\x09self assert: (jsObject a) equals: ''.\x0a\x09jsObject a: false.\x0a\x09self assert: (jsObject a) equals: false",
  10709. referencedClasses: [],
  10710. //>>excludeEnd("ide");
  10711. messageSends: ["jsObject", "assert:equals:", "a", "a:", "jsNull", "jsUndefined"]
  10712. }),
  10713. $globals.JSObjectProxyTest);
  10714. $core.addMethod(
  10715. $core.method({
  10716. selector: "testValue",
  10717. protocol: "tests",
  10718. fn: function (){
  10719. var self=this,$self=this;
  10720. var testObject;
  10721. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10722. return $core.withContext(function($ctx1) {
  10723. //>>excludeEnd("ctx");
  10724. testObject=$self._jsObject();
  10725. $recv(testObject)._at_put_("value","aValue");
  10726. $self._assert_equals_($recv(testObject)._value(),"aValue");
  10727. return self;
  10728. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10729. }, function($ctx1) {$ctx1.fill(self,"testValue",{testObject:testObject},$globals.JSObjectProxyTest)});
  10730. //>>excludeEnd("ctx");
  10731. },
  10732. //>>excludeStart("ide", pragmas.excludeIdeData);
  10733. args: [],
  10734. source: "testValue\x0a\x09| testObject |\x0a\x09testObject := self jsObject.\x0a\x09testObject at: 'value' put: 'aValue'.\x0a\x09self assert: testObject value equals: 'aValue'",
  10735. referencedClasses: [],
  10736. //>>excludeEnd("ide");
  10737. messageSends: ["jsObject", "at:put:", "assert:equals:", "value"]
  10738. }),
  10739. $globals.JSObjectProxyTest);
  10740. $core.addMethod(
  10741. $core.method({
  10742. selector: "testYourself",
  10743. protocol: "tests",
  10744. fn: function (){
  10745. var self=this,$self=this;
  10746. var object;
  10747. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10748. return $core.withContext(function($ctx1) {
  10749. //>>excludeEnd("ctx");
  10750. var $1;
  10751. $1=$self._jsObject();
  10752. $recv($1)._d_("test");
  10753. object=$recv($1)._yourself();
  10754. $self._assert_equals_($recv(object)._d(),"test");
  10755. return self;
  10756. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10757. }, function($ctx1) {$ctx1.fill(self,"testYourself",{object:object},$globals.JSObjectProxyTest)});
  10758. //>>excludeEnd("ctx");
  10759. },
  10760. //>>excludeStart("ide", pragmas.excludeIdeData);
  10761. args: [],
  10762. source: "testYourself\x0a\x09| object |\x0a\x09object := self jsObject\x0a\x09\x09d: 'test';\x0a\x09\x09yourself.\x0a\x0a\x09self assert: object d equals: 'test'",
  10763. referencedClasses: [],
  10764. //>>excludeEnd("ide");
  10765. messageSends: ["d:", "jsObject", "yourself", "assert:equals:", "d"]
  10766. }),
  10767. $globals.JSObjectProxyTest);
  10768. $core.addClass("JavaScriptExceptionTest", $globals.TestCase, [], "Kernel-Tests");
  10769. $core.addMethod(
  10770. $core.method({
  10771. selector: "testCatchingException",
  10772. protocol: "tests",
  10773. fn: function (){
  10774. var self=this,$self=this;
  10775. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10776. return $core.withContext(function($ctx1) {
  10777. //>>excludeEnd("ctx");
  10778. $recv((function(){
  10779. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10780. return $core.withContext(function($ctx2) {
  10781. //>>excludeEnd("ctx");
  10782. return $self._throwException();
  10783. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10784. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  10785. //>>excludeEnd("ctx");
  10786. }))._on_do_($globals.Error,(function(error){
  10787. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10788. return $core.withContext(function($ctx2) {
  10789. //>>excludeEnd("ctx");
  10790. return $self._assert_($recv($recv(error)._exception()).__eq("test"));
  10791. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10792. }, function($ctx2) {$ctx2.fillBlock({error:error},$ctx1,2)});
  10793. //>>excludeEnd("ctx");
  10794. }));
  10795. return self;
  10796. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10797. }, function($ctx1) {$ctx1.fill(self,"testCatchingException",{},$globals.JavaScriptExceptionTest)});
  10798. //>>excludeEnd("ctx");
  10799. },
  10800. //>>excludeStart("ide", pragmas.excludeIdeData);
  10801. args: [],
  10802. source: "testCatchingException\x0a\x09[ self throwException ]\x0a\x09\x09on: Error\x0a\x09\x09do: [ :error |\x0a\x09\x09\x09self assert: error exception = 'test' ]",
  10803. referencedClasses: ["Error"],
  10804. //>>excludeEnd("ide");
  10805. messageSends: ["on:do:", "throwException", "assert:", "=", "exception"]
  10806. }),
  10807. $globals.JavaScriptExceptionTest);
  10808. $core.addMethod(
  10809. $core.method({
  10810. selector: "testRaisingException",
  10811. protocol: "tests",
  10812. fn: function (){
  10813. var self=this,$self=this;
  10814. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10815. return $core.withContext(function($ctx1) {
  10816. //>>excludeEnd("ctx");
  10817. $self._should_raise_((function(){
  10818. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10819. return $core.withContext(function($ctx2) {
  10820. //>>excludeEnd("ctx");
  10821. return $self._throwException();
  10822. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10823. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  10824. //>>excludeEnd("ctx");
  10825. }),$globals.JavaScriptException);
  10826. return self;
  10827. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10828. }, function($ctx1) {$ctx1.fill(self,"testRaisingException",{},$globals.JavaScriptExceptionTest)});
  10829. //>>excludeEnd("ctx");
  10830. },
  10831. //>>excludeStart("ide", pragmas.excludeIdeData);
  10832. args: [],
  10833. source: "testRaisingException\x0a\x09self should: [ self throwException ] raise: JavaScriptException",
  10834. referencedClasses: ["JavaScriptException"],
  10835. //>>excludeEnd("ide");
  10836. messageSends: ["should:raise:", "throwException"]
  10837. }),
  10838. $globals.JavaScriptExceptionTest);
  10839. $core.addMethod(
  10840. $core.method({
  10841. selector: "throwException",
  10842. protocol: "helpers",
  10843. fn: function (){
  10844. var self=this,$self=this;
  10845. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10846. return $core.withContext(function($ctx1) {
  10847. //>>excludeEnd("ctx");
  10848. throw "test";
  10849. return self;
  10850. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10851. }, function($ctx1) {$ctx1.fill(self,"throwException",{},$globals.JavaScriptExceptionTest)});
  10852. //>>excludeEnd("ctx");
  10853. },
  10854. //>>excludeStart("ide", pragmas.excludeIdeData);
  10855. args: [],
  10856. source: "throwException\x0a\x09<inlineJS: 'throw \x22test\x22'>",
  10857. referencedClasses: [],
  10858. //>>excludeEnd("ide");
  10859. messageSends: []
  10860. }),
  10861. $globals.JavaScriptExceptionTest);
  10862. $core.addClass("MessageSendTest", $globals.TestCase, [], "Kernel-Tests");
  10863. $core.addMethod(
  10864. $core.method({
  10865. selector: "testValue",
  10866. protocol: "tests",
  10867. fn: function (){
  10868. var self=this,$self=this;
  10869. var messageSend;
  10870. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10871. return $core.withContext(function($ctx1) {
  10872. //>>excludeEnd("ctx");
  10873. var $1;
  10874. $1=$recv($globals.MessageSend)._new();
  10875. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10876. $ctx1.sendIdx["new"]=1;
  10877. //>>excludeEnd("ctx");
  10878. $recv($1)._receiver_($recv($globals.Object)._new());
  10879. $recv($1)._selector_("asString");
  10880. messageSend=$recv($1)._yourself();
  10881. $self._assert_equals_($recv(messageSend)._value(),"an Object");
  10882. return self;
  10883. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10884. }, function($ctx1) {$ctx1.fill(self,"testValue",{messageSend:messageSend},$globals.MessageSendTest)});
  10885. //>>excludeEnd("ctx");
  10886. },
  10887. //>>excludeStart("ide", pragmas.excludeIdeData);
  10888. args: [],
  10889. source: "testValue\x0a\x09| messageSend |\x0a\x09\x0a\x09messageSend := MessageSend new\x0a\x09\x09receiver: Object new;\x0a\x09\x09selector: #asString;\x0a\x09\x09yourself.\x0a\x09\x09\x0a\x09self assert: messageSend value equals: 'an Object'",
  10890. referencedClasses: ["MessageSend", "Object"],
  10891. //>>excludeEnd("ide");
  10892. messageSends: ["receiver:", "new", "selector:", "yourself", "assert:equals:", "value"]
  10893. }),
  10894. $globals.MessageSendTest);
  10895. $core.addMethod(
  10896. $core.method({
  10897. selector: "testValueWithArguments",
  10898. protocol: "tests",
  10899. fn: function (){
  10900. var self=this,$self=this;
  10901. var messageSend;
  10902. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10903. return $core.withContext(function($ctx1) {
  10904. //>>excludeEnd("ctx");
  10905. var $1;
  10906. $1=$recv($globals.MessageSend)._new();
  10907. $recv($1)._receiver_((2));
  10908. $recv($1)._selector_("+");
  10909. messageSend=$recv($1)._yourself();
  10910. $self._assert_equals_($recv(messageSend)._value_((3)),(5));
  10911. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10912. $ctx1.sendIdx["assert:equals:"]=1;
  10913. //>>excludeEnd("ctx");
  10914. $self._assert_equals_($recv(messageSend)._valueWithPossibleArguments_([(4)]),(6));
  10915. return self;
  10916. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10917. }, function($ctx1) {$ctx1.fill(self,"testValueWithArguments",{messageSend:messageSend},$globals.MessageSendTest)});
  10918. //>>excludeEnd("ctx");
  10919. },
  10920. //>>excludeStart("ide", pragmas.excludeIdeData);
  10921. args: [],
  10922. source: "testValueWithArguments\x0a\x09| messageSend |\x0a\x09\x0a\x09messageSend := MessageSend new\x0a\x09\x09receiver: 2;\x0a\x09\x09selector: '+';\x0a\x09\x09yourself.\x0a\x09\x09\x0a\x09self assert: (messageSend value: 3) equals: 5.\x0a\x09\x0a\x09self assert: (messageSend valueWithPossibleArguments: #(4)) equals: 6",
  10923. referencedClasses: ["MessageSend"],
  10924. //>>excludeEnd("ide");
  10925. messageSends: ["receiver:", "new", "selector:", "yourself", "assert:equals:", "value:", "valueWithPossibleArguments:"]
  10926. }),
  10927. $globals.MessageSendTest);
  10928. $core.addClass("MethodInheritanceTest", $globals.TestCase, ["receiverTop", "receiverMiddle", "receiverBottom", "method", "performBlock"], "Kernel-Tests");
  10929. $core.addMethod(
  10930. $core.method({
  10931. selector: "codeGeneratorClass",
  10932. protocol: "accessing",
  10933. fn: function (){
  10934. var self=this,$self=this;
  10935. return $globals.CodeGenerator;
  10936. },
  10937. //>>excludeStart("ide", pragmas.excludeIdeData);
  10938. args: [],
  10939. source: "codeGeneratorClass\x0a\x09^ CodeGenerator",
  10940. referencedClasses: ["CodeGenerator"],
  10941. //>>excludeEnd("ide");
  10942. messageSends: []
  10943. }),
  10944. $globals.MethodInheritanceTest);
  10945. $core.addMethod(
  10946. $core.method({
  10947. selector: "compiler",
  10948. protocol: "factory",
  10949. fn: function (){
  10950. var self=this,$self=this;
  10951. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10952. return $core.withContext(function($ctx1) {
  10953. //>>excludeEnd("ctx");
  10954. var $1;
  10955. $1=$recv($globals.Compiler)._new();
  10956. $recv($1)._codeGeneratorClass_($self._codeGeneratorClass());
  10957. return $recv($1)._yourself();
  10958. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10959. }, function($ctx1) {$ctx1.fill(self,"compiler",{},$globals.MethodInheritanceTest)});
  10960. //>>excludeEnd("ctx");
  10961. },
  10962. //>>excludeStart("ide", pragmas.excludeIdeData);
  10963. args: [],
  10964. source: "compiler\x0a\x09^ Compiler new\x0a\x09\x09codeGeneratorClass: self codeGeneratorClass;\x0a\x09\x09yourself",
  10965. referencedClasses: ["Compiler"],
  10966. //>>excludeEnd("ide");
  10967. messageSends: ["codeGeneratorClass:", "new", "codeGeneratorClass", "yourself"]
  10968. }),
  10969. $globals.MethodInheritanceTest);
  10970. $core.addMethod(
  10971. $core.method({
  10972. selector: "deinstallBottom",
  10973. protocol: "testing",
  10974. fn: function (){
  10975. var self=this,$self=this;
  10976. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10977. return $core.withContext(function($ctx1) {
  10978. //>>excludeEnd("ctx");
  10979. $recv($self._targetClassBottom())._removeCompiledMethod_($self["@method"]);
  10980. return self;
  10981. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10982. }, function($ctx1) {$ctx1.fill(self,"deinstallBottom",{},$globals.MethodInheritanceTest)});
  10983. //>>excludeEnd("ctx");
  10984. },
  10985. //>>excludeStart("ide", pragmas.excludeIdeData);
  10986. args: [],
  10987. source: "deinstallBottom\x0a\x09self targetClassBottom removeCompiledMethod: method",
  10988. referencedClasses: [],
  10989. //>>excludeEnd("ide");
  10990. messageSends: ["removeCompiledMethod:", "targetClassBottom"]
  10991. }),
  10992. $globals.MethodInheritanceTest);
  10993. $core.addMethod(
  10994. $core.method({
  10995. selector: "deinstallMiddle",
  10996. protocol: "testing",
  10997. fn: function (){
  10998. var self=this,$self=this;
  10999. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11000. return $core.withContext(function($ctx1) {
  11001. //>>excludeEnd("ctx");
  11002. $recv($self._targetClassMiddle())._removeCompiledMethod_($self["@method"]);
  11003. return self;
  11004. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11005. }, function($ctx1) {$ctx1.fill(self,"deinstallMiddle",{},$globals.MethodInheritanceTest)});
  11006. //>>excludeEnd("ctx");
  11007. },
  11008. //>>excludeStart("ide", pragmas.excludeIdeData);
  11009. args: [],
  11010. source: "deinstallMiddle\x0a\x09self targetClassMiddle removeCompiledMethod: method",
  11011. referencedClasses: [],
  11012. //>>excludeEnd("ide");
  11013. messageSends: ["removeCompiledMethod:", "targetClassMiddle"]
  11014. }),
  11015. $globals.MethodInheritanceTest);
  11016. $core.addMethod(
  11017. $core.method({
  11018. selector: "deinstallTop",
  11019. protocol: "testing",
  11020. fn: function (){
  11021. var self=this,$self=this;
  11022. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11023. return $core.withContext(function($ctx1) {
  11024. //>>excludeEnd("ctx");
  11025. $recv($self._targetClassTop())._removeCompiledMethod_($self["@method"]);
  11026. return self;
  11027. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11028. }, function($ctx1) {$ctx1.fill(self,"deinstallTop",{},$globals.MethodInheritanceTest)});
  11029. //>>excludeEnd("ctx");
  11030. },
  11031. //>>excludeStart("ide", pragmas.excludeIdeData);
  11032. args: [],
  11033. source: "deinstallTop\x0a\x09self targetClassTop removeCompiledMethod: method",
  11034. referencedClasses: [],
  11035. //>>excludeEnd("ide");
  11036. messageSends: ["removeCompiledMethod:", "targetClassTop"]
  11037. }),
  11038. $globals.MethodInheritanceTest);
  11039. $core.addMethod(
  11040. $core.method({
  11041. selector: "installBottom:",
  11042. protocol: "testing",
  11043. fn: function (aString){
  11044. var self=this,$self=this;
  11045. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11046. return $core.withContext(function($ctx1) {
  11047. //>>excludeEnd("ctx");
  11048. $self["@method"]=$recv($self._compiler())._install_forClass_protocol_(aString,$self._targetClassBottom(),"tests");
  11049. return self;
  11050. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11051. }, function($ctx1) {$ctx1.fill(self,"installBottom:",{aString:aString},$globals.MethodInheritanceTest)});
  11052. //>>excludeEnd("ctx");
  11053. },
  11054. //>>excludeStart("ide", pragmas.excludeIdeData);
  11055. args: ["aString"],
  11056. source: "installBottom: aString\x0a\x09method := self compiler install: aString forClass: self targetClassBottom protocol: 'tests'",
  11057. referencedClasses: [],
  11058. //>>excludeEnd("ide");
  11059. messageSends: ["install:forClass:protocol:", "compiler", "targetClassBottom"]
  11060. }),
  11061. $globals.MethodInheritanceTest);
  11062. $core.addMethod(
  11063. $core.method({
  11064. selector: "installMiddle:",
  11065. protocol: "testing",
  11066. fn: function (aString){
  11067. var self=this,$self=this;
  11068. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11069. return $core.withContext(function($ctx1) {
  11070. //>>excludeEnd("ctx");
  11071. $self["@method"]=$recv($self._compiler())._install_forClass_protocol_(aString,$self._targetClassMiddle(),"tests");
  11072. return self;
  11073. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11074. }, function($ctx1) {$ctx1.fill(self,"installMiddle:",{aString:aString},$globals.MethodInheritanceTest)});
  11075. //>>excludeEnd("ctx");
  11076. },
  11077. //>>excludeStart("ide", pragmas.excludeIdeData);
  11078. args: ["aString"],
  11079. source: "installMiddle: aString\x0a\x09method := self compiler install: aString forClass: self targetClassMiddle protocol: 'tests'",
  11080. referencedClasses: [],
  11081. //>>excludeEnd("ide");
  11082. messageSends: ["install:forClass:protocol:", "compiler", "targetClassMiddle"]
  11083. }),
  11084. $globals.MethodInheritanceTest);
  11085. $core.addMethod(
  11086. $core.method({
  11087. selector: "installTop:",
  11088. protocol: "testing",
  11089. fn: function (aString){
  11090. var self=this,$self=this;
  11091. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11092. return $core.withContext(function($ctx1) {
  11093. //>>excludeEnd("ctx");
  11094. $self["@method"]=$recv($self._compiler())._install_forClass_protocol_(aString,$self._targetClassTop(),"tests");
  11095. return self;
  11096. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11097. }, function($ctx1) {$ctx1.fill(self,"installTop:",{aString:aString},$globals.MethodInheritanceTest)});
  11098. //>>excludeEnd("ctx");
  11099. },
  11100. //>>excludeStart("ide", pragmas.excludeIdeData);
  11101. args: ["aString"],
  11102. source: "installTop: aString\x0a\x09method := self compiler install: aString forClass: self targetClassTop protocol: 'tests'",
  11103. referencedClasses: [],
  11104. //>>excludeEnd("ide");
  11105. messageSends: ["install:forClass:protocol:", "compiler", "targetClassTop"]
  11106. }),
  11107. $globals.MethodInheritanceTest);
  11108. $core.addMethod(
  11109. $core.method({
  11110. selector: "setUp",
  11111. protocol: "initialization",
  11112. fn: function (){
  11113. var self=this,$self=this;
  11114. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11115. return $core.withContext(function($ctx1) {
  11116. //>>excludeEnd("ctx");
  11117. $self["@receiverTop"]=$recv($self._targetClassTop())._new();
  11118. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11119. $ctx1.sendIdx["new"]=1;
  11120. //>>excludeEnd("ctx");
  11121. $self["@receiverMiddle"]=$recv($self._targetClassMiddle())._new();
  11122. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11123. $ctx1.sendIdx["new"]=2;
  11124. //>>excludeEnd("ctx");
  11125. $self["@receiverBottom"]=$recv($self._targetClassBottom())._new();
  11126. $self["@method"]=nil;
  11127. $self["@performBlock"]=(function(){
  11128. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11129. return $core.withContext(function($ctx2) {
  11130. //>>excludeEnd("ctx");
  11131. return $self._error_("performBlock not initialized");
  11132. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11133. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  11134. //>>excludeEnd("ctx");
  11135. });
  11136. return self;
  11137. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11138. }, function($ctx1) {$ctx1.fill(self,"setUp",{},$globals.MethodInheritanceTest)});
  11139. //>>excludeEnd("ctx");
  11140. },
  11141. //>>excludeStart("ide", pragmas.excludeIdeData);
  11142. args: [],
  11143. source: "setUp\x0a\x09receiverTop := self targetClassTop new.\x0a\x09receiverMiddle := self targetClassMiddle new.\x0a\x09receiverBottom := self targetClassBottom new.\x0a\x09method := nil.\x0a\x09performBlock := [ self error: 'performBlock not initialized' ]",
  11144. referencedClasses: [],
  11145. //>>excludeEnd("ide");
  11146. messageSends: ["new", "targetClassTop", "targetClassMiddle", "targetClassBottom", "error:"]
  11147. }),
  11148. $globals.MethodInheritanceTest);
  11149. $core.addMethod(
  11150. $core.method({
  11151. selector: "shouldMNU",
  11152. protocol: "testing",
  11153. fn: function (){
  11154. var self=this,$self=this;
  11155. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11156. return $core.withContext(function($ctx1) {
  11157. //>>excludeEnd("ctx");
  11158. $self._shouldMNUTop();
  11159. $self._shouldMNUMiddle();
  11160. $self._shouldMNUBottom();
  11161. return self;
  11162. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11163. }, function($ctx1) {$ctx1.fill(self,"shouldMNU",{},$globals.MethodInheritanceTest)});
  11164. //>>excludeEnd("ctx");
  11165. },
  11166. //>>excludeStart("ide", pragmas.excludeIdeData);
  11167. args: [],
  11168. source: "shouldMNU\x0a\x09self shouldMNUTop.\x0a\x09self shouldMNUMiddle.\x0a\x09self shouldMNUBottom",
  11169. referencedClasses: [],
  11170. //>>excludeEnd("ide");
  11171. messageSends: ["shouldMNUTop", "shouldMNUMiddle", "shouldMNUBottom"]
  11172. }),
  11173. $globals.MethodInheritanceTest);
  11174. $core.addMethod(
  11175. $core.method({
  11176. selector: "shouldMNUBottom",
  11177. protocol: "testing",
  11178. fn: function (){
  11179. var self=this,$self=this;
  11180. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11181. return $core.withContext(function($ctx1) {
  11182. //>>excludeEnd("ctx");
  11183. $self._should_raise_((function(){
  11184. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11185. return $core.withContext(function($ctx2) {
  11186. //>>excludeEnd("ctx");
  11187. return $recv($self["@performBlock"])._value_($self["@receiverBottom"]);
  11188. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11189. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  11190. //>>excludeEnd("ctx");
  11191. }),$globals.MessageNotUnderstood);
  11192. return self;
  11193. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11194. }, function($ctx1) {$ctx1.fill(self,"shouldMNUBottom",{},$globals.MethodInheritanceTest)});
  11195. //>>excludeEnd("ctx");
  11196. },
  11197. //>>excludeStart("ide", pragmas.excludeIdeData);
  11198. args: [],
  11199. source: "shouldMNUBottom\x0a\x09self should: [ performBlock value: receiverBottom ] raise: MessageNotUnderstood",
  11200. referencedClasses: ["MessageNotUnderstood"],
  11201. //>>excludeEnd("ide");
  11202. messageSends: ["should:raise:", "value:"]
  11203. }),
  11204. $globals.MethodInheritanceTest);
  11205. $core.addMethod(
  11206. $core.method({
  11207. selector: "shouldMNUMiddle",
  11208. protocol: "testing",
  11209. fn: function (){
  11210. var self=this,$self=this;
  11211. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11212. return $core.withContext(function($ctx1) {
  11213. //>>excludeEnd("ctx");
  11214. $self._should_raise_((function(){
  11215. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11216. return $core.withContext(function($ctx2) {
  11217. //>>excludeEnd("ctx");
  11218. return $recv($self["@performBlock"])._value_($self["@receiverMiddle"]);
  11219. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11220. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  11221. //>>excludeEnd("ctx");
  11222. }),$globals.MessageNotUnderstood);
  11223. return self;
  11224. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11225. }, function($ctx1) {$ctx1.fill(self,"shouldMNUMiddle",{},$globals.MethodInheritanceTest)});
  11226. //>>excludeEnd("ctx");
  11227. },
  11228. //>>excludeStart("ide", pragmas.excludeIdeData);
  11229. args: [],
  11230. source: "shouldMNUMiddle\x0a\x09self should: [ performBlock value: receiverMiddle ] raise: MessageNotUnderstood",
  11231. referencedClasses: ["MessageNotUnderstood"],
  11232. //>>excludeEnd("ide");
  11233. messageSends: ["should:raise:", "value:"]
  11234. }),
  11235. $globals.MethodInheritanceTest);
  11236. $core.addMethod(
  11237. $core.method({
  11238. selector: "shouldMNUTop",
  11239. protocol: "testing",
  11240. fn: function (){
  11241. var self=this,$self=this;
  11242. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11243. return $core.withContext(function($ctx1) {
  11244. //>>excludeEnd("ctx");
  11245. $self._should_raise_((function(){
  11246. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11247. return $core.withContext(function($ctx2) {
  11248. //>>excludeEnd("ctx");
  11249. return $recv($self["@performBlock"])._value_($self["@receiverTop"]);
  11250. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11251. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  11252. //>>excludeEnd("ctx");
  11253. }),$globals.MessageNotUnderstood);
  11254. return self;
  11255. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11256. }, function($ctx1) {$ctx1.fill(self,"shouldMNUTop",{},$globals.MethodInheritanceTest)});
  11257. //>>excludeEnd("ctx");
  11258. },
  11259. //>>excludeStart("ide", pragmas.excludeIdeData);
  11260. args: [],
  11261. source: "shouldMNUTop\x0a\x09self should: [ performBlock value: receiverTop ] raise: MessageNotUnderstood",
  11262. referencedClasses: ["MessageNotUnderstood"],
  11263. //>>excludeEnd("ide");
  11264. messageSends: ["should:raise:", "value:"]
  11265. }),
  11266. $globals.MethodInheritanceTest);
  11267. $core.addMethod(
  11268. $core.method({
  11269. selector: "shouldReturn:",
  11270. protocol: "testing",
  11271. fn: function (anObject){
  11272. var self=this,$self=this;
  11273. var result;
  11274. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11275. return $core.withContext(function($ctx1) {
  11276. //>>excludeEnd("ctx");
  11277. result=$recv($self["@performBlock"])._value_($self["@receiverTop"]);
  11278. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11279. $ctx1.sendIdx["value:"]=1;
  11280. //>>excludeEnd("ctx");
  11281. $self._assert_equals_(["top",anObject],["top",result]);
  11282. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11283. $ctx1.sendIdx["assert:equals:"]=1;
  11284. //>>excludeEnd("ctx");
  11285. result=$recv($self["@performBlock"])._value_($self["@receiverMiddle"]);
  11286. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11287. $ctx1.sendIdx["value:"]=2;
  11288. //>>excludeEnd("ctx");
  11289. $self._assert_equals_(["middle",anObject],["middle",result]);
  11290. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11291. $ctx1.sendIdx["assert:equals:"]=2;
  11292. //>>excludeEnd("ctx");
  11293. result=$recv($self["@performBlock"])._value_($self["@receiverBottom"]);
  11294. $self._assert_equals_(["bottom",anObject],["bottom",result]);
  11295. return self;
  11296. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11297. }, function($ctx1) {$ctx1.fill(self,"shouldReturn:",{anObject:anObject,result:result},$globals.MethodInheritanceTest)});
  11298. //>>excludeEnd("ctx");
  11299. },
  11300. //>>excludeStart("ide", pragmas.excludeIdeData);
  11301. args: ["anObject"],
  11302. source: "shouldReturn: anObject\x0a\x09| result |\x0a\x0a\x09result := performBlock value: receiverTop.\x0a\x09self assert: { 'top'. anObject } equals: { 'top'. result }.\x0a\x09result := performBlock value: receiverMiddle.\x0a\x09self assert: { 'middle'. anObject } equals: { 'middle'. result }.\x0a\x09result := performBlock value: receiverBottom.\x0a\x09self assert: { 'bottom'. anObject } equals: { 'bottom'. result }",
  11303. referencedClasses: [],
  11304. //>>excludeEnd("ide");
  11305. messageSends: ["value:", "assert:equals:"]
  11306. }),
  11307. $globals.MethodInheritanceTest);
  11308. $core.addMethod(
  11309. $core.method({
  11310. selector: "shouldReturn:and:and:",
  11311. protocol: "testing",
  11312. fn: function (anObject,anObject2,anObject3){
  11313. var self=this,$self=this;
  11314. var result;
  11315. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11316. return $core.withContext(function($ctx1) {
  11317. //>>excludeEnd("ctx");
  11318. result=$recv($self["@performBlock"])._value_($self["@receiverTop"]);
  11319. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11320. $ctx1.sendIdx["value:"]=1;
  11321. //>>excludeEnd("ctx");
  11322. $self._assert_equals_(["top",anObject],["top",result]);
  11323. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11324. $ctx1.sendIdx["assert:equals:"]=1;
  11325. //>>excludeEnd("ctx");
  11326. result=$recv($self["@performBlock"])._value_($self["@receiverMiddle"]);
  11327. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11328. $ctx1.sendIdx["value:"]=2;
  11329. //>>excludeEnd("ctx");
  11330. $self._assert_equals_(["middle",anObject2],["middle",result]);
  11331. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11332. $ctx1.sendIdx["assert:equals:"]=2;
  11333. //>>excludeEnd("ctx");
  11334. result=$recv($self["@performBlock"])._value_($self["@receiverBottom"]);
  11335. $self._assert_equals_(["bottom",anObject3],["bottom",result]);
  11336. return self;
  11337. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11338. }, function($ctx1) {$ctx1.fill(self,"shouldReturn:and:and:",{anObject:anObject,anObject2:anObject2,anObject3:anObject3,result:result},$globals.MethodInheritanceTest)});
  11339. //>>excludeEnd("ctx");
  11340. },
  11341. //>>excludeStart("ide", pragmas.excludeIdeData);
  11342. args: ["anObject", "anObject2", "anObject3"],
  11343. source: "shouldReturn: anObject and: anObject2 and: anObject3\x0a\x09| result |\x0a\x0a\x09result := performBlock value: receiverTop.\x0a\x09self assert: { 'top'. anObject } equals: { 'top'. result }.\x0a\x09result := performBlock value: receiverMiddle.\x0a\x09self assert: { 'middle'. anObject2 } equals: { 'middle'. result }.\x0a\x09result := performBlock value: receiverBottom.\x0a\x09self assert: { 'bottom'. anObject3 } equals: { 'bottom'. result }",
  11344. referencedClasses: [],
  11345. //>>excludeEnd("ide");
  11346. messageSends: ["value:", "assert:equals:"]
  11347. }),
  11348. $globals.MethodInheritanceTest);
  11349. $core.addMethod(
  11350. $core.method({
  11351. selector: "targetClassBottom",
  11352. protocol: "accessing",
  11353. fn: function (){
  11354. var self=this,$self=this;
  11355. return $globals.JavaScriptException;
  11356. },
  11357. //>>excludeStart("ide", pragmas.excludeIdeData);
  11358. args: [],
  11359. source: "targetClassBottom\x0a\x09^ JavaScriptException",
  11360. referencedClasses: ["JavaScriptException"],
  11361. //>>excludeEnd("ide");
  11362. messageSends: []
  11363. }),
  11364. $globals.MethodInheritanceTest);
  11365. $core.addMethod(
  11366. $core.method({
  11367. selector: "targetClassMiddle",
  11368. protocol: "accessing",
  11369. fn: function (){
  11370. var self=this,$self=this;
  11371. return $globals.Error;
  11372. },
  11373. //>>excludeStart("ide", pragmas.excludeIdeData);
  11374. args: [],
  11375. source: "targetClassMiddle\x0a\x09^ Error",
  11376. referencedClasses: ["Error"],
  11377. //>>excludeEnd("ide");
  11378. messageSends: []
  11379. }),
  11380. $globals.MethodInheritanceTest);
  11381. $core.addMethod(
  11382. $core.method({
  11383. selector: "targetClassTop",
  11384. protocol: "accessing",
  11385. fn: function (){
  11386. var self=this,$self=this;
  11387. return $globals.Object;
  11388. },
  11389. //>>excludeStart("ide", pragmas.excludeIdeData);
  11390. args: [],
  11391. source: "targetClassTop\x0a\x09^ Object",
  11392. referencedClasses: ["Object"],
  11393. //>>excludeEnd("ide");
  11394. messageSends: []
  11395. }),
  11396. $globals.MethodInheritanceTest);
  11397. $core.addMethod(
  11398. $core.method({
  11399. selector: "tearDown",
  11400. protocol: "initialization",
  11401. fn: function (){
  11402. var self=this,$self=this;
  11403. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11404. return $core.withContext(function($ctx1) {
  11405. //>>excludeEnd("ctx");
  11406. $recv((function(){
  11407. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11408. return $core.withContext(function($ctx2) {
  11409. //>>excludeEnd("ctx");
  11410. return $self._deinstallTop();
  11411. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11412. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  11413. //>>excludeEnd("ctx");
  11414. }))._on_do_($globals.Error,(function(){
  11415. }));
  11416. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11417. $ctx1.sendIdx["on:do:"]=1;
  11418. //>>excludeEnd("ctx");
  11419. $recv((function(){
  11420. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11421. return $core.withContext(function($ctx2) {
  11422. //>>excludeEnd("ctx");
  11423. return $self._deinstallMiddle();
  11424. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11425. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  11426. //>>excludeEnd("ctx");
  11427. }))._on_do_($globals.Error,(function(){
  11428. }));
  11429. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11430. $ctx1.sendIdx["on:do:"]=2;
  11431. //>>excludeEnd("ctx");
  11432. $recv((function(){
  11433. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11434. return $core.withContext(function($ctx2) {
  11435. //>>excludeEnd("ctx");
  11436. return $self._deinstallBottom();
  11437. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11438. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,5)});
  11439. //>>excludeEnd("ctx");
  11440. }))._on_do_($globals.Error,(function(){
  11441. }));
  11442. return self;
  11443. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11444. }, function($ctx1) {$ctx1.fill(self,"tearDown",{},$globals.MethodInheritanceTest)});
  11445. //>>excludeEnd("ctx");
  11446. },
  11447. //>>excludeStart("ide", pragmas.excludeIdeData);
  11448. args: [],
  11449. source: "tearDown\x0a\x09[ self deinstallTop ] on: Error do: [ ].\x0a\x09[ self deinstallMiddle ] on: Error do: [ ].\x0a\x09[ self deinstallBottom ] on: Error do: [ ]",
  11450. referencedClasses: ["Error"],
  11451. //>>excludeEnd("ide");
  11452. messageSends: ["on:do:", "deinstallTop", "deinstallMiddle", "deinstallBottom"]
  11453. }),
  11454. $globals.MethodInheritanceTest);
  11455. $core.addMethod(
  11456. $core.method({
  11457. selector: "testMNU11",
  11458. protocol: "tests",
  11459. fn: function (){
  11460. var self=this,$self=this;
  11461. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11462. return $core.withContext(function($ctx1) {
  11463. //>>excludeEnd("ctx");
  11464. $self["@performBlock"]=(function(x){
  11465. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11466. return $core.withContext(function($ctx2) {
  11467. //>>excludeEnd("ctx");
  11468. return $recv(x)._foo();
  11469. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11470. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)});
  11471. //>>excludeEnd("ctx");
  11472. });
  11473. $self._shouldMNU();
  11474. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11475. $ctx1.sendIdx["shouldMNU"]=1;
  11476. //>>excludeEnd("ctx");
  11477. $self._installTop_("foo ^ false");
  11478. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11479. $ctx1.sendIdx["installTop:"]=1;
  11480. //>>excludeEnd("ctx");
  11481. $self._installTop_("foo ^ true");
  11482. $self._deinstallTop();
  11483. $self._shouldMNU();
  11484. return self;
  11485. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11486. }, function($ctx1) {$ctx1.fill(self,"testMNU11",{},$globals.MethodInheritanceTest)});
  11487. //>>excludeEnd("ctx");
  11488. },
  11489. //>>excludeStart("ide", pragmas.excludeIdeData);
  11490. args: [],
  11491. source: "testMNU11\x0a\x09performBlock := [ :x | x foo ].\x0a\x09self shouldMNU.\x0a\x09self installTop: 'foo ^ false'.\x0a\x09self installTop: 'foo ^ true'.\x0a\x09self deinstallTop.\x0a\x09self shouldMNU",
  11492. referencedClasses: [],
  11493. //>>excludeEnd("ide");
  11494. messageSends: ["foo", "shouldMNU", "installTop:", "deinstallTop"]
  11495. }),
  11496. $globals.MethodInheritanceTest);
  11497. $core.addMethod(
  11498. $core.method({
  11499. selector: "testMNU22",
  11500. protocol: "tests",
  11501. fn: function (){
  11502. var self=this,$self=this;
  11503. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11504. return $core.withContext(function($ctx1) {
  11505. //>>excludeEnd("ctx");
  11506. $self["@performBlock"]=(function(x){
  11507. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11508. return $core.withContext(function($ctx2) {
  11509. //>>excludeEnd("ctx");
  11510. return $recv(x)._foo();
  11511. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11512. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)});
  11513. //>>excludeEnd("ctx");
  11514. });
  11515. $self._shouldMNU();
  11516. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11517. $ctx1.sendIdx["shouldMNU"]=1;
  11518. //>>excludeEnd("ctx");
  11519. $self._installMiddle_("foo ^ false");
  11520. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11521. $ctx1.sendIdx["installMiddle:"]=1;
  11522. //>>excludeEnd("ctx");
  11523. $self._installMiddle_("foo ^ true");
  11524. $self._deinstallMiddle();
  11525. $self._shouldMNU();
  11526. return self;
  11527. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11528. }, function($ctx1) {$ctx1.fill(self,"testMNU22",{},$globals.MethodInheritanceTest)});
  11529. //>>excludeEnd("ctx");
  11530. },
  11531. //>>excludeStart("ide", pragmas.excludeIdeData);
  11532. args: [],
  11533. source: "testMNU22\x0a\x09performBlock := [ :x | x foo ].\x0a\x09self shouldMNU.\x0a\x09self installMiddle: 'foo ^ false'.\x0a\x09self installMiddle: 'foo ^ true'.\x0a\x09self deinstallMiddle.\x0a\x09self shouldMNU",
  11534. referencedClasses: [],
  11535. //>>excludeEnd("ide");
  11536. messageSends: ["foo", "shouldMNU", "installMiddle:", "deinstallMiddle"]
  11537. }),
  11538. $globals.MethodInheritanceTest);
  11539. $core.addMethod(
  11540. $core.method({
  11541. selector: "testReturns1",
  11542. protocol: "tests",
  11543. fn: function (){
  11544. var self=this,$self=this;
  11545. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11546. return $core.withContext(function($ctx1) {
  11547. //>>excludeEnd("ctx");
  11548. $self["@performBlock"]=(function(x){
  11549. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11550. return $core.withContext(function($ctx2) {
  11551. //>>excludeEnd("ctx");
  11552. return $recv(x)._foo();
  11553. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11554. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)});
  11555. //>>excludeEnd("ctx");
  11556. });
  11557. $self._installTop_("foo ^ false");
  11558. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11559. $ctx1.sendIdx["installTop:"]=1;
  11560. //>>excludeEnd("ctx");
  11561. $self._shouldReturn_(false);
  11562. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11563. $ctx1.sendIdx["shouldReturn:"]=1;
  11564. //>>excludeEnd("ctx");
  11565. $self._installTop_("foo ^ true");
  11566. $self._shouldReturn_(true);
  11567. return self;
  11568. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11569. }, function($ctx1) {$ctx1.fill(self,"testReturns1",{},$globals.MethodInheritanceTest)});
  11570. //>>excludeEnd("ctx");
  11571. },
  11572. //>>excludeStart("ide", pragmas.excludeIdeData);
  11573. args: [],
  11574. source: "testReturns1\x0a\x09performBlock := [ :x | x foo ].\x0a\x09self installTop: 'foo ^ false'.\x0a\x09self shouldReturn: false.\x0a\x09self installTop: 'foo ^ true'.\x0a\x09self shouldReturn: true",
  11575. referencedClasses: [],
  11576. //>>excludeEnd("ide");
  11577. messageSends: ["foo", "installTop:", "shouldReturn:"]
  11578. }),
  11579. $globals.MethodInheritanceTest);
  11580. $core.addClass("NumberTest", $globals.TestCase, [], "Kernel-Tests");
  11581. $core.addMethod(
  11582. $core.method({
  11583. selector: "testAbs",
  11584. protocol: "tests",
  11585. fn: function (){
  11586. var self=this,$self=this;
  11587. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11588. return $core.withContext(function($ctx1) {
  11589. //>>excludeEnd("ctx");
  11590. var $1;
  11591. $1=(4)._abs();
  11592. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11593. $ctx1.sendIdx["abs"]=1;
  11594. //>>excludeEnd("ctx");
  11595. $self._assert_equals_($1,(4));
  11596. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11597. $ctx1.sendIdx["assert:equals:"]=1;
  11598. //>>excludeEnd("ctx");
  11599. $self._assert_equals_((-4)._abs(),(4));
  11600. return self;
  11601. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11602. }, function($ctx1) {$ctx1.fill(self,"testAbs",{},$globals.NumberTest)});
  11603. //>>excludeEnd("ctx");
  11604. },
  11605. //>>excludeStart("ide", pragmas.excludeIdeData);
  11606. args: [],
  11607. source: "testAbs\x0a\x09self assert: 4 abs equals: 4.\x0a\x09self assert: -4 abs equals: 4",
  11608. referencedClasses: [],
  11609. //>>excludeEnd("ide");
  11610. messageSends: ["assert:equals:", "abs"]
  11611. }),
  11612. $globals.NumberTest);
  11613. $core.addMethod(
  11614. $core.method({
  11615. selector: "testArithmetic",
  11616. protocol: "tests",
  11617. fn: function (){
  11618. var self=this,$self=this;
  11619. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11620. return $core.withContext(function($ctx1) {
  11621. //>>excludeEnd("ctx");
  11622. var $1,$2,$3,$5,$4;
  11623. $1=(1.5).__plus((1));
  11624. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11625. $ctx1.sendIdx["+"]=1;
  11626. //>>excludeEnd("ctx");
  11627. $self._assert_equals_($1,(2.5));
  11628. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11629. $ctx1.sendIdx["assert:equals:"]=1;
  11630. //>>excludeEnd("ctx");
  11631. $2=(2).__minus((1));
  11632. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11633. $ctx1.sendIdx["-"]=1;
  11634. //>>excludeEnd("ctx");
  11635. $self._assert_equals_($2,(1));
  11636. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11637. $ctx1.sendIdx["assert:equals:"]=2;
  11638. //>>excludeEnd("ctx");
  11639. $self._assert_equals_((-2).__minus((1)),(-3));
  11640. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11641. $ctx1.sendIdx["assert:equals:"]=3;
  11642. //>>excludeEnd("ctx");
  11643. $self._assert_equals_((12).__slash((2)),(6));
  11644. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11645. $ctx1.sendIdx["assert:equals:"]=4;
  11646. //>>excludeEnd("ctx");
  11647. $3=(3).__star((4));
  11648. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11649. $ctx1.sendIdx["*"]=1;
  11650. //>>excludeEnd("ctx");
  11651. $self._assert_equals_($3,(12));
  11652. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11653. $ctx1.sendIdx["assert:equals:"]=5;
  11654. //>>excludeEnd("ctx");
  11655. $self._assert_equals_((7).__slash_slash((2)),(3));
  11656. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11657. $ctx1.sendIdx["assert:equals:"]=6;
  11658. //>>excludeEnd("ctx");
  11659. $self._assert_equals_((7).__backslash_backslash((2)),(1));
  11660. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11661. $ctx1.sendIdx["assert:equals:"]=7;
  11662. //>>excludeEnd("ctx");
  11663. $5=(1).__plus((2));
  11664. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11665. $ctx1.sendIdx["+"]=2;
  11666. //>>excludeEnd("ctx");
  11667. $4=$recv($5).__star((3));
  11668. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11669. $ctx1.sendIdx["*"]=2;
  11670. //>>excludeEnd("ctx");
  11671. $self._assert_equals_($4,(9));
  11672. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11673. $ctx1.sendIdx["assert:equals:"]=8;
  11674. //>>excludeEnd("ctx");
  11675. $self._assert_equals_((1).__plus((2).__star((3))),(7));
  11676. return self;
  11677. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11678. }, function($ctx1) {$ctx1.fill(self,"testArithmetic",{},$globals.NumberTest)});
  11679. //>>excludeEnd("ctx");
  11680. },
  11681. //>>excludeStart("ide", pragmas.excludeIdeData);
  11682. args: [],
  11683. source: "testArithmetic\x0a\x09\x0a\x09\x22We rely on JS here, so we won't test complex behavior, just check if\x0a\x09message sends are corrects\x22\x0a\x0a\x09self assert: 1.5 + 1 equals: 2.5.\x0a\x09self assert: 2 - 1 equals: 1.\x0a\x09self assert: -2 - 1 equals: -3.\x0a\x09self assert: 12 / 2 equals: 6.\x0a\x09self assert: 3 * 4 equals: 12.\x0a\x09self assert: 7 // 2 equals: 3.\x0a\x09self assert: 7 \x5c\x5c 2 equals: 1.\x0a\x0a\x09\x22Simple parenthesis and execution order\x22\x0a\x09self assert: 1 + 2 * 3 equals: 9.\x0a\x09self assert: 1 + (2 * 3) equals: 7",
  11684. referencedClasses: [],
  11685. //>>excludeEnd("ide");
  11686. messageSends: ["assert:equals:", "+", "-", "/", "*", "//", "\x5c\x5c"]
  11687. }),
  11688. $globals.NumberTest);
  11689. $core.addMethod(
  11690. $core.method({
  11691. selector: "testAsNumber",
  11692. protocol: "tests",
  11693. fn: function (){
  11694. var self=this,$self=this;
  11695. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11696. return $core.withContext(function($ctx1) {
  11697. //>>excludeEnd("ctx");
  11698. $self._assert_equals_((3)._asNumber(),(3));
  11699. return self;
  11700. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11701. }, function($ctx1) {$ctx1.fill(self,"testAsNumber",{},$globals.NumberTest)});
  11702. //>>excludeEnd("ctx");
  11703. },
  11704. //>>excludeStart("ide", pragmas.excludeIdeData);
  11705. args: [],
  11706. source: "testAsNumber\x0a\x09self assert: 3 asNumber equals: 3.",
  11707. referencedClasses: [],
  11708. //>>excludeEnd("ide");
  11709. messageSends: ["assert:equals:", "asNumber"]
  11710. }),
  11711. $globals.NumberTest);
  11712. $core.addMethod(
  11713. $core.method({
  11714. selector: "testCeiling",
  11715. protocol: "tests",
  11716. fn: function (){
  11717. var self=this,$self=this;
  11718. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11719. return $core.withContext(function($ctx1) {
  11720. //>>excludeEnd("ctx");
  11721. var $1,$2;
  11722. $1=(1.2)._ceiling();
  11723. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11724. $ctx1.sendIdx["ceiling"]=1;
  11725. //>>excludeEnd("ctx");
  11726. $self._assert_equals_($1,(2));
  11727. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11728. $ctx1.sendIdx["assert:equals:"]=1;
  11729. //>>excludeEnd("ctx");
  11730. $2=(-1.2)._ceiling();
  11731. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11732. $ctx1.sendIdx["ceiling"]=2;
  11733. //>>excludeEnd("ctx");
  11734. $self._assert_equals_($2,(-1));
  11735. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11736. $ctx1.sendIdx["assert:equals:"]=2;
  11737. //>>excludeEnd("ctx");
  11738. $self._assert_equals_((1)._ceiling(),(1));
  11739. return self;
  11740. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11741. }, function($ctx1) {$ctx1.fill(self,"testCeiling",{},$globals.NumberTest)});
  11742. //>>excludeEnd("ctx");
  11743. },
  11744. //>>excludeStart("ide", pragmas.excludeIdeData);
  11745. args: [],
  11746. source: "testCeiling\x0a\x09self assert: 1.2 ceiling equals: 2.\x0a\x09self assert: -1.2 ceiling equals: -1.\x0a\x09self assert: 1.0 ceiling equals: 1.",
  11747. referencedClasses: [],
  11748. //>>excludeEnd("ide");
  11749. messageSends: ["assert:equals:", "ceiling"]
  11750. }),
  11751. $globals.NumberTest);
  11752. $core.addMethod(
  11753. $core.method({
  11754. selector: "testComparison",
  11755. protocol: "tests",
  11756. fn: function (){
  11757. var self=this,$self=this;
  11758. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11759. return $core.withContext(function($ctx1) {
  11760. //>>excludeEnd("ctx");
  11761. var $1,$2,$3,$4;
  11762. $1=(3).__gt((2));
  11763. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11764. $ctx1.sendIdx[">"]=1;
  11765. //>>excludeEnd("ctx");
  11766. $self._assert_($1);
  11767. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11768. $ctx1.sendIdx["assert:"]=1;
  11769. //>>excludeEnd("ctx");
  11770. $2=(2).__lt((3));
  11771. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11772. $ctx1.sendIdx["<"]=1;
  11773. //>>excludeEnd("ctx");
  11774. $self._assert_($2);
  11775. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11776. $ctx1.sendIdx["assert:"]=2;
  11777. //>>excludeEnd("ctx");
  11778. $self._deny_((3).__lt((2)));
  11779. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11780. $ctx1.sendIdx["deny:"]=1;
  11781. //>>excludeEnd("ctx");
  11782. $self._deny_((2).__gt((3)));
  11783. $3=(3).__gt_eq((3));
  11784. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11785. $ctx1.sendIdx[">="]=1;
  11786. //>>excludeEnd("ctx");
  11787. $self._assert_($3);
  11788. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11789. $ctx1.sendIdx["assert:"]=3;
  11790. //>>excludeEnd("ctx");
  11791. $self._assert_((3.1).__gt_eq((3)));
  11792. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11793. $ctx1.sendIdx["assert:"]=4;
  11794. //>>excludeEnd("ctx");
  11795. $4=(3).__lt_eq((3));
  11796. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11797. $ctx1.sendIdx["<="]=1;
  11798. //>>excludeEnd("ctx");
  11799. $self._assert_($4);
  11800. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11801. $ctx1.sendIdx["assert:"]=5;
  11802. //>>excludeEnd("ctx");
  11803. $self._assert_((3).__lt_eq((3.1)));
  11804. return self;
  11805. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11806. }, function($ctx1) {$ctx1.fill(self,"testComparison",{},$globals.NumberTest)});
  11807. //>>excludeEnd("ctx");
  11808. },
  11809. //>>excludeStart("ide", pragmas.excludeIdeData);
  11810. args: [],
  11811. source: "testComparison\x0a\x0a\x09self assert: 3 > 2.\x0a\x09self assert: 2 < 3.\x0a\x09\x0a\x09self deny: 3 < 2.\x0a\x09self deny: 2 > 3.\x0a\x0a\x09self assert: 3 >= 3.\x0a\x09self assert: 3.1 >= 3.\x0a\x09self assert: 3 <= 3.\x0a\x09self assert: 3 <= 3.1",
  11812. referencedClasses: [],
  11813. //>>excludeEnd("ide");
  11814. messageSends: ["assert:", ">", "<", "deny:", ">=", "<="]
  11815. }),
  11816. $globals.NumberTest);
  11817. $core.addMethod(
  11818. $core.method({
  11819. selector: "testCopying",
  11820. protocol: "tests",
  11821. fn: function (){
  11822. var self=this,$self=this;
  11823. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11824. return $core.withContext(function($ctx1) {
  11825. //>>excludeEnd("ctx");
  11826. var $1;
  11827. $1=$recv((1)._copy()).__eq_eq((1));
  11828. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11829. $ctx1.sendIdx["=="]=1;
  11830. //>>excludeEnd("ctx");
  11831. $self._assert_($1);
  11832. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11833. $ctx1.sendIdx["assert:"]=1;
  11834. //>>excludeEnd("ctx");
  11835. $self._assert_($recv((1)._deepCopy()).__eq_eq((1)));
  11836. return self;
  11837. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11838. }, function($ctx1) {$ctx1.fill(self,"testCopying",{},$globals.NumberTest)});
  11839. //>>excludeEnd("ctx");
  11840. },
  11841. //>>excludeStart("ide", pragmas.excludeIdeData);
  11842. args: [],
  11843. source: "testCopying\x0a\x09self assert: 1 copy == 1.\x0a\x09self assert: 1 deepCopy == 1",
  11844. referencedClasses: [],
  11845. //>>excludeEnd("ide");
  11846. messageSends: ["assert:", "==", "copy", "deepCopy"]
  11847. }),
  11848. $globals.NumberTest);
  11849. $core.addMethod(
  11850. $core.method({
  11851. selector: "testEquality",
  11852. protocol: "tests",
  11853. fn: function (){
  11854. var self=this,$self=this;
  11855. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11856. return $core.withContext(function($ctx1) {
  11857. //>>excludeEnd("ctx");
  11858. var $1,$2,$3,$5,$4,$7,$6,$9,$8,$10,$11,$12;
  11859. $1=(1).__eq((1));
  11860. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11861. $ctx1.sendIdx["="]=1;
  11862. //>>excludeEnd("ctx");
  11863. $self._assert_($1);
  11864. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11865. $ctx1.sendIdx["assert:"]=1;
  11866. //>>excludeEnd("ctx");
  11867. $2=(0).__eq((0));
  11868. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11869. $ctx1.sendIdx["="]=2;
  11870. //>>excludeEnd("ctx");
  11871. $self._assert_($2);
  11872. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11873. $ctx1.sendIdx["assert:"]=2;
  11874. //>>excludeEnd("ctx");
  11875. $3=(1).__eq((0));
  11876. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11877. $ctx1.sendIdx["="]=3;
  11878. //>>excludeEnd("ctx");
  11879. $self._deny_($3);
  11880. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11881. $ctx1.sendIdx["deny:"]=1;
  11882. //>>excludeEnd("ctx");
  11883. $5=(1)._yourself();
  11884. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11885. $ctx1.sendIdx["yourself"]=1;
  11886. //>>excludeEnd("ctx");
  11887. $4=$recv($5).__eq((1));
  11888. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11889. $ctx1.sendIdx["="]=4;
  11890. //>>excludeEnd("ctx");
  11891. $self._assert_($4);
  11892. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11893. $ctx1.sendIdx["assert:"]=3;
  11894. //>>excludeEnd("ctx");
  11895. $7=(1)._yourself();
  11896. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11897. $ctx1.sendIdx["yourself"]=2;
  11898. //>>excludeEnd("ctx");
  11899. $6=(1).__eq($7);
  11900. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11901. $ctx1.sendIdx["="]=5;
  11902. //>>excludeEnd("ctx");
  11903. $self._assert_($6);
  11904. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11905. $ctx1.sendIdx["assert:"]=4;
  11906. //>>excludeEnd("ctx");
  11907. $9=(1)._yourself();
  11908. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11909. $ctx1.sendIdx["yourself"]=3;
  11910. //>>excludeEnd("ctx");
  11911. $8=$recv($9).__eq((1)._yourself());
  11912. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11913. $ctx1.sendIdx["="]=6;
  11914. //>>excludeEnd("ctx");
  11915. $self._assert_($8);
  11916. $10=(0).__eq(false);
  11917. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11918. $ctx1.sendIdx["="]=7;
  11919. //>>excludeEnd("ctx");
  11920. $self._deny_($10);
  11921. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11922. $ctx1.sendIdx["deny:"]=2;
  11923. //>>excludeEnd("ctx");
  11924. $11=false.__eq((0));
  11925. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11926. $ctx1.sendIdx["="]=8;
  11927. //>>excludeEnd("ctx");
  11928. $self._deny_($11);
  11929. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11930. $ctx1.sendIdx["deny:"]=3;
  11931. //>>excludeEnd("ctx");
  11932. $12="".__eq((0));
  11933. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11934. $ctx1.sendIdx["="]=9;
  11935. //>>excludeEnd("ctx");
  11936. $self._deny_($12);
  11937. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11938. $ctx1.sendIdx["deny:"]=4;
  11939. //>>excludeEnd("ctx");
  11940. $self._deny_((0).__eq(""));
  11941. return self;
  11942. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11943. }, function($ctx1) {$ctx1.fill(self,"testEquality",{},$globals.NumberTest)});
  11944. //>>excludeEnd("ctx");
  11945. },
  11946. //>>excludeStart("ide", pragmas.excludeIdeData);
  11947. args: [],
  11948. source: "testEquality\x0a\x09self assert: (1 = 1).\x0a\x09self assert: (0 = 0).\x0a\x09self deny: (1 = 0).\x0a\x0a\x09self assert: (1 yourself = 1).\x0a\x09self assert: (1 = 1 yourself).\x0a\x09self assert: (1 yourself = 1 yourself).\x0a\x09\x0a\x09self deny: 0 = false.\x0a\x09self deny: false = 0.\x0a\x09self deny: '' = 0.\x0a\x09self deny: 0 = ''",
  11949. referencedClasses: [],
  11950. //>>excludeEnd("ide");
  11951. messageSends: ["assert:", "=", "deny:", "yourself"]
  11952. }),
  11953. $globals.NumberTest);
  11954. $core.addMethod(
  11955. $core.method({
  11956. selector: "testFloor",
  11957. protocol: "tests",
  11958. fn: function (){
  11959. var self=this,$self=this;
  11960. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11961. return $core.withContext(function($ctx1) {
  11962. //>>excludeEnd("ctx");
  11963. var $1,$2;
  11964. $1=(1.2)._floor();
  11965. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11966. $ctx1.sendIdx["floor"]=1;
  11967. //>>excludeEnd("ctx");
  11968. $self._assert_equals_($1,(1));
  11969. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11970. $ctx1.sendIdx["assert:equals:"]=1;
  11971. //>>excludeEnd("ctx");
  11972. $2=(-1.2)._floor();
  11973. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11974. $ctx1.sendIdx["floor"]=2;
  11975. //>>excludeEnd("ctx");
  11976. $self._assert_equals_($2,(-2));
  11977. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11978. $ctx1.sendIdx["assert:equals:"]=2;
  11979. //>>excludeEnd("ctx");
  11980. $self._assert_equals_((1)._floor(),(1));
  11981. return self;
  11982. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11983. }, function($ctx1) {$ctx1.fill(self,"testFloor",{},$globals.NumberTest)});
  11984. //>>excludeEnd("ctx");
  11985. },
  11986. //>>excludeStart("ide", pragmas.excludeIdeData);
  11987. args: [],
  11988. source: "testFloor\x0a\x09self assert: 1.2 floor equals: 1.\x0a\x09self assert: -1.2 floor equals: -2.\x0a\x09self assert: 1.0 floor equals: 1.",
  11989. referencedClasses: [],
  11990. //>>excludeEnd("ide");
  11991. messageSends: ["assert:equals:", "floor"]
  11992. }),
  11993. $globals.NumberTest);
  11994. $core.addMethod(
  11995. $core.method({
  11996. selector: "testHexNumbers",
  11997. protocol: "tests",
  11998. fn: function (){
  11999. var self=this,$self=this;
  12000. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12001. return $core.withContext(function($ctx1) {
  12002. //>>excludeEnd("ctx");
  12003. var $1,$2,$3,$4,$5;
  12004. $self._assert_equals_((9),(9));
  12005. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12006. $ctx1.sendIdx["assert:equals:"]=1;
  12007. //>>excludeEnd("ctx");
  12008. $1=(10)._truncated();
  12009. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12010. $ctx1.sendIdx["truncated"]=1;
  12011. //>>excludeEnd("ctx");
  12012. $self._assert_equals_($1,(10));
  12013. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12014. $ctx1.sendIdx["assert:equals:"]=2;
  12015. //>>excludeEnd("ctx");
  12016. $2=(11)._truncated();
  12017. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12018. $ctx1.sendIdx["truncated"]=2;
  12019. //>>excludeEnd("ctx");
  12020. $self._assert_equals_($2,(11));
  12021. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12022. $ctx1.sendIdx["assert:equals:"]=3;
  12023. //>>excludeEnd("ctx");
  12024. $3=(12)._truncated();
  12025. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12026. $ctx1.sendIdx["truncated"]=3;
  12027. //>>excludeEnd("ctx");
  12028. $self._assert_equals_($3,(12));
  12029. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12030. $ctx1.sendIdx["assert:equals:"]=4;
  12031. //>>excludeEnd("ctx");
  12032. $4=(13)._truncated();
  12033. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12034. $ctx1.sendIdx["truncated"]=4;
  12035. //>>excludeEnd("ctx");
  12036. $self._assert_equals_($4,(13));
  12037. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12038. $ctx1.sendIdx["assert:equals:"]=5;
  12039. //>>excludeEnd("ctx");
  12040. $5=(14)._truncated();
  12041. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12042. $ctx1.sendIdx["truncated"]=5;
  12043. //>>excludeEnd("ctx");
  12044. $self._assert_equals_($5,(14));
  12045. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12046. $ctx1.sendIdx["assert:equals:"]=6;
  12047. //>>excludeEnd("ctx");
  12048. $self._assert_equals_((15)._truncated(),(15));
  12049. return self;
  12050. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12051. }, function($ctx1) {$ctx1.fill(self,"testHexNumbers",{},$globals.NumberTest)});
  12052. //>>excludeEnd("ctx");
  12053. },
  12054. //>>excludeStart("ide", pragmas.excludeIdeData);
  12055. args: [],
  12056. source: "testHexNumbers\x0a\x0a\x09self assert: 16r9 equals: 9.\x0a\x09self assert: 16rA truncated equals: 10.\x0a\x09self assert: 16rB truncated equals: 11.\x0a\x09self assert: 16rC truncated equals: 12.\x0a\x09self assert: 16rD truncated equals: 13.\x0a\x09self assert: 16rE truncated equals: 14.\x0a\x09self assert: 16rF truncated equals: 15",
  12057. referencedClasses: [],
  12058. //>>excludeEnd("ide");
  12059. messageSends: ["assert:equals:", "truncated"]
  12060. }),
  12061. $globals.NumberTest);
  12062. $core.addMethod(
  12063. $core.method({
  12064. selector: "testIdentity",
  12065. protocol: "tests",
  12066. fn: function (){
  12067. var self=this,$self=this;
  12068. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12069. return $core.withContext(function($ctx1) {
  12070. //>>excludeEnd("ctx");
  12071. var $1,$2,$3,$5,$4,$7,$6,$9,$8;
  12072. $1=(1).__eq_eq((1));
  12073. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12074. $ctx1.sendIdx["=="]=1;
  12075. //>>excludeEnd("ctx");
  12076. $self._assert_($1);
  12077. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12078. $ctx1.sendIdx["assert:"]=1;
  12079. //>>excludeEnd("ctx");
  12080. $2=(0).__eq_eq((0));
  12081. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12082. $ctx1.sendIdx["=="]=2;
  12083. //>>excludeEnd("ctx");
  12084. $self._assert_($2);
  12085. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12086. $ctx1.sendIdx["assert:"]=2;
  12087. //>>excludeEnd("ctx");
  12088. $3=(1).__eq_eq((0));
  12089. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12090. $ctx1.sendIdx["=="]=3;
  12091. //>>excludeEnd("ctx");
  12092. $self._deny_($3);
  12093. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12094. $ctx1.sendIdx["deny:"]=1;
  12095. //>>excludeEnd("ctx");
  12096. $5=(1)._yourself();
  12097. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12098. $ctx1.sendIdx["yourself"]=1;
  12099. //>>excludeEnd("ctx");
  12100. $4=$recv($5).__eq_eq((1));
  12101. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12102. $ctx1.sendIdx["=="]=4;
  12103. //>>excludeEnd("ctx");
  12104. $self._assert_($4);
  12105. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12106. $ctx1.sendIdx["assert:"]=3;
  12107. //>>excludeEnd("ctx");
  12108. $7=(1)._yourself();
  12109. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12110. $ctx1.sendIdx["yourself"]=2;
  12111. //>>excludeEnd("ctx");
  12112. $6=(1).__eq_eq($7);
  12113. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12114. $ctx1.sendIdx["=="]=5;
  12115. //>>excludeEnd("ctx");
  12116. $self._assert_($6);
  12117. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12118. $ctx1.sendIdx["assert:"]=4;
  12119. //>>excludeEnd("ctx");
  12120. $9=(1)._yourself();
  12121. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12122. $ctx1.sendIdx["yourself"]=3;
  12123. //>>excludeEnd("ctx");
  12124. $8=$recv($9).__eq_eq((1)._yourself());
  12125. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12126. $ctx1.sendIdx["=="]=6;
  12127. //>>excludeEnd("ctx");
  12128. $self._assert_($8);
  12129. $self._deny_((1).__eq_eq((2)));
  12130. return self;
  12131. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12132. }, function($ctx1) {$ctx1.fill(self,"testIdentity",{},$globals.NumberTest)});
  12133. //>>excludeEnd("ctx");
  12134. },
  12135. //>>excludeStart("ide", pragmas.excludeIdeData);
  12136. args: [],
  12137. source: "testIdentity\x0a\x09self assert: 1 == 1.\x0a\x09self assert: 0 == 0.\x0a\x09self deny: 1 == 0.\x0a\x0a\x09self assert: 1 yourself == 1.\x0a\x09self assert: 1 == 1 yourself.\x0a\x09self assert: 1 yourself == 1 yourself.\x0a\x09\x0a\x09self deny: 1 == 2",
  12138. referencedClasses: [],
  12139. //>>excludeEnd("ide");
  12140. messageSends: ["assert:", "==", "deny:", "yourself"]
  12141. }),
  12142. $globals.NumberTest);
  12143. $core.addMethod(
  12144. $core.method({
  12145. selector: "testInvalidHexNumbers",
  12146. protocol: "tests",
  12147. fn: function (){
  12148. var self=this,$self=this;
  12149. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12150. return $core.withContext(function($ctx1) {
  12151. //>>excludeEnd("ctx");
  12152. $self._should_raise_((function(){
  12153. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12154. return $core.withContext(function($ctx2) {
  12155. //>>excludeEnd("ctx");
  12156. return (16)._rG();
  12157. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12158. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  12159. //>>excludeEnd("ctx");
  12160. }),$globals.MessageNotUnderstood);
  12161. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12162. $ctx1.sendIdx["should:raise:"]=1;
  12163. //>>excludeEnd("ctx");
  12164. $self._should_raise_((function(){
  12165. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12166. return $core.withContext(function($ctx2) {
  12167. //>>excludeEnd("ctx");
  12168. return (16)._rg();
  12169. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12170. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  12171. //>>excludeEnd("ctx");
  12172. }),$globals.MessageNotUnderstood);
  12173. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12174. $ctx1.sendIdx["should:raise:"]=2;
  12175. //>>excludeEnd("ctx");
  12176. $self._should_raise_((function(){
  12177. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12178. return $core.withContext(function($ctx2) {
  12179. //>>excludeEnd("ctx");
  12180. return (16)._rH();
  12181. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12182. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  12183. //>>excludeEnd("ctx");
  12184. }),$globals.MessageNotUnderstood);
  12185. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12186. $ctx1.sendIdx["should:raise:"]=3;
  12187. //>>excludeEnd("ctx");
  12188. $self._should_raise_((function(){
  12189. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12190. return $core.withContext(function($ctx2) {
  12191. //>>excludeEnd("ctx");
  12192. return (16)._rh();
  12193. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12194. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,4)});
  12195. //>>excludeEnd("ctx");
  12196. }),$globals.MessageNotUnderstood);
  12197. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12198. $ctx1.sendIdx["should:raise:"]=4;
  12199. //>>excludeEnd("ctx");
  12200. $self._should_raise_((function(){
  12201. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12202. return $core.withContext(function($ctx2) {
  12203. //>>excludeEnd("ctx");
  12204. return (16)._rI();
  12205. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12206. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,5)});
  12207. //>>excludeEnd("ctx");
  12208. }),$globals.MessageNotUnderstood);
  12209. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12210. $ctx1.sendIdx["should:raise:"]=5;
  12211. //>>excludeEnd("ctx");
  12212. $self._should_raise_((function(){
  12213. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12214. return $core.withContext(function($ctx2) {
  12215. //>>excludeEnd("ctx");
  12216. return (16)._ri();
  12217. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12218. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,6)});
  12219. //>>excludeEnd("ctx");
  12220. }),$globals.MessageNotUnderstood);
  12221. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12222. $ctx1.sendIdx["should:raise:"]=6;
  12223. //>>excludeEnd("ctx");
  12224. $self._should_raise_((function(){
  12225. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12226. return $core.withContext(function($ctx2) {
  12227. //>>excludeEnd("ctx");
  12228. return (16)._rJ();
  12229. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12230. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,7)});
  12231. //>>excludeEnd("ctx");
  12232. }),$globals.MessageNotUnderstood);
  12233. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12234. $ctx1.sendIdx["should:raise:"]=7;
  12235. //>>excludeEnd("ctx");
  12236. $self._should_raise_((function(){
  12237. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12238. return $core.withContext(function($ctx2) {
  12239. //>>excludeEnd("ctx");
  12240. return (16)._rj();
  12241. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12242. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,8)});
  12243. //>>excludeEnd("ctx");
  12244. }),$globals.MessageNotUnderstood);
  12245. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12246. $ctx1.sendIdx["should:raise:"]=8;
  12247. //>>excludeEnd("ctx");
  12248. $self._should_raise_((function(){
  12249. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12250. return $core.withContext(function($ctx2) {
  12251. //>>excludeEnd("ctx");
  12252. return (16)._rK();
  12253. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12254. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,9)});
  12255. //>>excludeEnd("ctx");
  12256. }),$globals.MessageNotUnderstood);
  12257. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12258. $ctx1.sendIdx["should:raise:"]=9;
  12259. //>>excludeEnd("ctx");
  12260. $self._should_raise_((function(){
  12261. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12262. return $core.withContext(function($ctx2) {
  12263. //>>excludeEnd("ctx");
  12264. return (16)._rk();
  12265. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12266. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,10)});
  12267. //>>excludeEnd("ctx");
  12268. }),$globals.MessageNotUnderstood);
  12269. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12270. $ctx1.sendIdx["should:raise:"]=10;
  12271. //>>excludeEnd("ctx");
  12272. $self._should_raise_((function(){
  12273. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12274. return $core.withContext(function($ctx2) {
  12275. //>>excludeEnd("ctx");
  12276. return (16)._rL();
  12277. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12278. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,11)});
  12279. //>>excludeEnd("ctx");
  12280. }),$globals.MessageNotUnderstood);
  12281. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12282. $ctx1.sendIdx["should:raise:"]=11;
  12283. //>>excludeEnd("ctx");
  12284. $self._should_raise_((function(){
  12285. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12286. return $core.withContext(function($ctx2) {
  12287. //>>excludeEnd("ctx");
  12288. return (16)._rl();
  12289. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12290. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,12)});
  12291. //>>excludeEnd("ctx");
  12292. }),$globals.MessageNotUnderstood);
  12293. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12294. $ctx1.sendIdx["should:raise:"]=12;
  12295. //>>excludeEnd("ctx");
  12296. $self._should_raise_((function(){
  12297. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12298. return $core.withContext(function($ctx2) {
  12299. //>>excludeEnd("ctx");
  12300. return (16)._rM();
  12301. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12302. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,13)});
  12303. //>>excludeEnd("ctx");
  12304. }),$globals.MessageNotUnderstood);
  12305. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12306. $ctx1.sendIdx["should:raise:"]=13;
  12307. //>>excludeEnd("ctx");
  12308. $self._should_raise_((function(){
  12309. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12310. return $core.withContext(function($ctx2) {
  12311. //>>excludeEnd("ctx");
  12312. return (16)._rm();
  12313. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12314. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,14)});
  12315. //>>excludeEnd("ctx");
  12316. }),$globals.MessageNotUnderstood);
  12317. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12318. $ctx1.sendIdx["should:raise:"]=14;
  12319. //>>excludeEnd("ctx");
  12320. $self._should_raise_((function(){
  12321. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12322. return $core.withContext(function($ctx2) {
  12323. //>>excludeEnd("ctx");
  12324. return (16)._rN();
  12325. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12326. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,15)});
  12327. //>>excludeEnd("ctx");
  12328. }),$globals.MessageNotUnderstood);
  12329. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12330. $ctx1.sendIdx["should:raise:"]=15;
  12331. //>>excludeEnd("ctx");
  12332. $self._should_raise_((function(){
  12333. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12334. return $core.withContext(function($ctx2) {
  12335. //>>excludeEnd("ctx");
  12336. return (16)._rn();
  12337. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12338. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,16)});
  12339. //>>excludeEnd("ctx");
  12340. }),$globals.MessageNotUnderstood);
  12341. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12342. $ctx1.sendIdx["should:raise:"]=16;
  12343. //>>excludeEnd("ctx");
  12344. $self._should_raise_((function(){
  12345. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12346. return $core.withContext(function($ctx2) {
  12347. //>>excludeEnd("ctx");
  12348. return (16)._rO();
  12349. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12350. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,17)});
  12351. //>>excludeEnd("ctx");
  12352. }),$globals.MessageNotUnderstood);
  12353. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12354. $ctx1.sendIdx["should:raise:"]=17;
  12355. //>>excludeEnd("ctx");
  12356. $self._should_raise_((function(){
  12357. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12358. return $core.withContext(function($ctx2) {
  12359. //>>excludeEnd("ctx");
  12360. return (16)._ro();
  12361. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12362. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,18)});
  12363. //>>excludeEnd("ctx");
  12364. }),$globals.MessageNotUnderstood);
  12365. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12366. $ctx1.sendIdx["should:raise:"]=18;
  12367. //>>excludeEnd("ctx");
  12368. $self._should_raise_((function(){
  12369. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12370. return $core.withContext(function($ctx2) {
  12371. //>>excludeEnd("ctx");
  12372. return (16)._rP();
  12373. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12374. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,19)});
  12375. //>>excludeEnd("ctx");
  12376. }),$globals.MessageNotUnderstood);
  12377. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12378. $ctx1.sendIdx["should:raise:"]=19;
  12379. //>>excludeEnd("ctx");
  12380. $self._should_raise_((function(){
  12381. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12382. return $core.withContext(function($ctx2) {
  12383. //>>excludeEnd("ctx");
  12384. return (16)._rp();
  12385. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12386. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,20)});
  12387. //>>excludeEnd("ctx");
  12388. }),$globals.MessageNotUnderstood);
  12389. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12390. $ctx1.sendIdx["should:raise:"]=20;
  12391. //>>excludeEnd("ctx");
  12392. $self._should_raise_((function(){
  12393. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12394. return $core.withContext(function($ctx2) {
  12395. //>>excludeEnd("ctx");
  12396. return (16)._rQ();
  12397. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12398. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,21)});
  12399. //>>excludeEnd("ctx");
  12400. }),$globals.MessageNotUnderstood);
  12401. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12402. $ctx1.sendIdx["should:raise:"]=21;
  12403. //>>excludeEnd("ctx");
  12404. $self._should_raise_((function(){
  12405. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12406. return $core.withContext(function($ctx2) {
  12407. //>>excludeEnd("ctx");
  12408. return (16)._rq();
  12409. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12410. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,22)});
  12411. //>>excludeEnd("ctx");
  12412. }),$globals.MessageNotUnderstood);
  12413. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12414. $ctx1.sendIdx["should:raise:"]=22;
  12415. //>>excludeEnd("ctx");
  12416. $self._should_raise_((function(){
  12417. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12418. return $core.withContext(function($ctx2) {
  12419. //>>excludeEnd("ctx");
  12420. return (16)._rR();
  12421. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12422. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,23)});
  12423. //>>excludeEnd("ctx");
  12424. }),$globals.MessageNotUnderstood);
  12425. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12426. $ctx1.sendIdx["should:raise:"]=23;
  12427. //>>excludeEnd("ctx");
  12428. $self._should_raise_((function(){
  12429. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12430. return $core.withContext(function($ctx2) {
  12431. //>>excludeEnd("ctx");
  12432. return (16)._rr();
  12433. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12434. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,24)});
  12435. //>>excludeEnd("ctx");
  12436. }),$globals.MessageNotUnderstood);
  12437. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12438. $ctx1.sendIdx["should:raise:"]=24;
  12439. //>>excludeEnd("ctx");
  12440. $self._should_raise_((function(){
  12441. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12442. return $core.withContext(function($ctx2) {
  12443. //>>excludeEnd("ctx");
  12444. return (16)._rS();
  12445. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12446. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,25)});
  12447. //>>excludeEnd("ctx");
  12448. }),$globals.MessageNotUnderstood);
  12449. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12450. $ctx1.sendIdx["should:raise:"]=25;
  12451. //>>excludeEnd("ctx");
  12452. $self._should_raise_((function(){
  12453. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12454. return $core.withContext(function($ctx2) {
  12455. //>>excludeEnd("ctx");
  12456. return (16)._rs();
  12457. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12458. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,26)});
  12459. //>>excludeEnd("ctx");
  12460. }),$globals.MessageNotUnderstood);
  12461. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12462. $ctx1.sendIdx["should:raise:"]=26;
  12463. //>>excludeEnd("ctx");
  12464. $self._should_raise_((function(){
  12465. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12466. return $core.withContext(function($ctx2) {
  12467. //>>excludeEnd("ctx");
  12468. return (16)._rT();
  12469. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12470. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,27)});
  12471. //>>excludeEnd("ctx");
  12472. }),$globals.MessageNotUnderstood);
  12473. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12474. $ctx1.sendIdx["should:raise:"]=27;
  12475. //>>excludeEnd("ctx");
  12476. $self._should_raise_((function(){
  12477. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12478. return $core.withContext(function($ctx2) {
  12479. //>>excludeEnd("ctx");
  12480. return (16)._rt();
  12481. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12482. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,28)});
  12483. //>>excludeEnd("ctx");
  12484. }),$globals.MessageNotUnderstood);
  12485. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12486. $ctx1.sendIdx["should:raise:"]=28;
  12487. //>>excludeEnd("ctx");
  12488. $self._should_raise_((function(){
  12489. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12490. return $core.withContext(function($ctx2) {
  12491. //>>excludeEnd("ctx");
  12492. return (16)._rU();
  12493. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12494. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,29)});
  12495. //>>excludeEnd("ctx");
  12496. }),$globals.MessageNotUnderstood);
  12497. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12498. $ctx1.sendIdx["should:raise:"]=29;
  12499. //>>excludeEnd("ctx");
  12500. $self._should_raise_((function(){
  12501. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12502. return $core.withContext(function($ctx2) {
  12503. //>>excludeEnd("ctx");
  12504. return (16)._ru();
  12505. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12506. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,30)});
  12507. //>>excludeEnd("ctx");
  12508. }),$globals.MessageNotUnderstood);
  12509. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12510. $ctx1.sendIdx["should:raise:"]=30;
  12511. //>>excludeEnd("ctx");
  12512. $self._should_raise_((function(){
  12513. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12514. return $core.withContext(function($ctx2) {
  12515. //>>excludeEnd("ctx");
  12516. return (16)._rV();
  12517. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12518. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,31)});
  12519. //>>excludeEnd("ctx");
  12520. }),$globals.MessageNotUnderstood);
  12521. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12522. $ctx1.sendIdx["should:raise:"]=31;
  12523. //>>excludeEnd("ctx");
  12524. $self._should_raise_((function(){
  12525. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12526. return $core.withContext(function($ctx2) {
  12527. //>>excludeEnd("ctx");
  12528. return (16)._rv();
  12529. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12530. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,32)});
  12531. //>>excludeEnd("ctx");
  12532. }),$globals.MessageNotUnderstood);
  12533. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12534. $ctx1.sendIdx["should:raise:"]=32;
  12535. //>>excludeEnd("ctx");
  12536. $self._should_raise_((function(){
  12537. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12538. return $core.withContext(function($ctx2) {
  12539. //>>excludeEnd("ctx");
  12540. return (16)._rW();
  12541. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12542. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,33)});
  12543. //>>excludeEnd("ctx");
  12544. }),$globals.MessageNotUnderstood);
  12545. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12546. $ctx1.sendIdx["should:raise:"]=33;
  12547. //>>excludeEnd("ctx");
  12548. $self._should_raise_((function(){
  12549. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12550. return $core.withContext(function($ctx2) {
  12551. //>>excludeEnd("ctx");
  12552. return (16)._rw();
  12553. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12554. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,34)});
  12555. //>>excludeEnd("ctx");
  12556. }),$globals.MessageNotUnderstood);
  12557. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12558. $ctx1.sendIdx["should:raise:"]=34;
  12559. //>>excludeEnd("ctx");
  12560. $self._should_raise_((function(){
  12561. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12562. return $core.withContext(function($ctx2) {
  12563. //>>excludeEnd("ctx");
  12564. return (16)._rX();
  12565. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12566. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,35)});
  12567. //>>excludeEnd("ctx");
  12568. }),$globals.MessageNotUnderstood);
  12569. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12570. $ctx1.sendIdx["should:raise:"]=35;
  12571. //>>excludeEnd("ctx");
  12572. $self._should_raise_((function(){
  12573. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12574. return $core.withContext(function($ctx2) {
  12575. //>>excludeEnd("ctx");
  12576. return (16)._rx();
  12577. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12578. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,36)});
  12579. //>>excludeEnd("ctx");
  12580. }),$globals.MessageNotUnderstood);
  12581. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12582. $ctx1.sendIdx["should:raise:"]=36;
  12583. //>>excludeEnd("ctx");
  12584. $self._should_raise_((function(){
  12585. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12586. return $core.withContext(function($ctx2) {
  12587. //>>excludeEnd("ctx");
  12588. return (16)._rY();
  12589. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12590. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,37)});
  12591. //>>excludeEnd("ctx");
  12592. }),$globals.MessageNotUnderstood);
  12593. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12594. $ctx1.sendIdx["should:raise:"]=37;
  12595. //>>excludeEnd("ctx");
  12596. $self._should_raise_((function(){
  12597. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12598. return $core.withContext(function($ctx2) {
  12599. //>>excludeEnd("ctx");
  12600. return (16)._ry();
  12601. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12602. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,38)});
  12603. //>>excludeEnd("ctx");
  12604. }),$globals.MessageNotUnderstood);
  12605. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12606. $ctx1.sendIdx["should:raise:"]=38;
  12607. //>>excludeEnd("ctx");
  12608. $self._should_raise_((function(){
  12609. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12610. return $core.withContext(function($ctx2) {
  12611. //>>excludeEnd("ctx");
  12612. return (16)._rZ();
  12613. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12614. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,39)});
  12615. //>>excludeEnd("ctx");
  12616. }),$globals.MessageNotUnderstood);
  12617. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12618. $ctx1.sendIdx["should:raise:"]=39;
  12619. //>>excludeEnd("ctx");
  12620. $self._should_raise_((function(){
  12621. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12622. return $core.withContext(function($ctx2) {
  12623. //>>excludeEnd("ctx");
  12624. return (16)._rz();
  12625. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12626. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,40)});
  12627. //>>excludeEnd("ctx");
  12628. }),$globals.MessageNotUnderstood);
  12629. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12630. $ctx1.sendIdx["should:raise:"]=40;
  12631. //>>excludeEnd("ctx");
  12632. $self._should_raise_((function(){
  12633. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12634. return $core.withContext(function($ctx2) {
  12635. //>>excludeEnd("ctx");
  12636. return (11259375)._Z();
  12637. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12638. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,41)});
  12639. //>>excludeEnd("ctx");
  12640. }),$globals.MessageNotUnderstood);
  12641. return self;
  12642. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12643. }, function($ctx1) {$ctx1.fill(self,"testInvalidHexNumbers",{},$globals.NumberTest)});
  12644. //>>excludeEnd("ctx");
  12645. },
  12646. //>>excludeStart("ide", pragmas.excludeIdeData);
  12647. args: [],
  12648. source: "testInvalidHexNumbers\x0a\x0a\x09self should: [ 16rG ] raise: MessageNotUnderstood.\x0a\x09self should: [ 16rg ] raise: MessageNotUnderstood.\x0a\x09self should: [ 16rH ] raise: MessageNotUnderstood.\x0a\x09self should: [ 16rh ] raise: MessageNotUnderstood.\x0a\x09self should: [ 16rI ] raise: MessageNotUnderstood.\x0a\x09self should: [ 16ri ] raise: MessageNotUnderstood.\x0a\x09self should: [ 16rJ ] raise: MessageNotUnderstood.\x0a\x09self should: [ 16rj ] raise: MessageNotUnderstood.\x0a\x09self should: [ 16rK ] raise: MessageNotUnderstood.\x0a\x09self should: [ 16rk ] raise: MessageNotUnderstood.\x0a\x09self should: [ 16rL ] raise: MessageNotUnderstood.\x0a\x09self should: [ 16rl ] raise: MessageNotUnderstood.\x0a\x09self should: [ 16rM ] raise: MessageNotUnderstood.\x0a\x09self should: [ 16rm ] raise: MessageNotUnderstood.\x0a\x09self should: [ 16rN ] raise: MessageNotUnderstood.\x0a\x09self should: [ 16rn ] raise: MessageNotUnderstood.\x0a\x09self should: [ 16rO ] raise: MessageNotUnderstood.\x0a\x09self should: [ 16ro ] raise: MessageNotUnderstood.\x0a\x09self should: [ 16rP ] raise: MessageNotUnderstood.\x0a\x09self should: [ 16rp ] raise: MessageNotUnderstood.\x0a\x09self should: [ 16rQ ] raise: MessageNotUnderstood.\x0a\x09self should: [ 16rq ] raise: MessageNotUnderstood.\x0a\x09self should: [ 16rR ] raise: MessageNotUnderstood.\x0a\x09self should: [ 16rr ] raise: MessageNotUnderstood.\x0a\x09self should: [ 16rS ] raise: MessageNotUnderstood.\x0a\x09self should: [ 16rs ] raise: MessageNotUnderstood.\x0a\x09self should: [ 16rT ] raise: MessageNotUnderstood.\x0a\x09self should: [ 16rt ] raise: MessageNotUnderstood.\x0a\x09self should: [ 16rU ] raise: MessageNotUnderstood.\x0a\x09self should: [ 16ru ] raise: MessageNotUnderstood.\x0a\x09self should: [ 16rV ] raise: MessageNotUnderstood.\x0a\x09self should: [ 16rv ] raise: MessageNotUnderstood.\x0a\x09self should: [ 16rW ] raise: MessageNotUnderstood.\x0a\x09self should: [ 16rw ] raise: MessageNotUnderstood.\x0a\x09self should: [ 16rX ] raise: MessageNotUnderstood.\x0a\x09self should: [ 16rx ] raise: MessageNotUnderstood.\x0a\x09self should: [ 16rY ] raise: MessageNotUnderstood.\x0a\x09self should: [ 16ry ] raise: MessageNotUnderstood.\x0a\x09self should: [ 16rZ ] raise: MessageNotUnderstood.\x0a\x09self should: [ 16rz ] raise: MessageNotUnderstood.\x0a\x09self should: [ 16rABcdEfZ ] raise: MessageNotUnderstood.",
  12649. referencedClasses: ["MessageNotUnderstood"],
  12650. //>>excludeEnd("ide");
  12651. 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"]
  12652. }),
  12653. $globals.NumberTest);
  12654. $core.addMethod(
  12655. $core.method({
  12656. selector: "testLog",
  12657. protocol: "tests",
  12658. fn: function (){
  12659. var self=this,$self=this;
  12660. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12661. return $core.withContext(function($ctx1) {
  12662. //>>excludeEnd("ctx");
  12663. $self._assert_equals_((10000)._log(),(4));
  12664. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12665. $ctx1.sendIdx["assert:equals:"]=1;
  12666. //>>excludeEnd("ctx");
  12667. $self._assert_equals_((512)._log_((2)),(9));
  12668. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12669. $ctx1.sendIdx["assert:equals:"]=2;
  12670. //>>excludeEnd("ctx");
  12671. $self._assert_equals_($recv($recv($globals.Number)._e())._ln(),(1));
  12672. return self;
  12673. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12674. }, function($ctx1) {$ctx1.fill(self,"testLog",{},$globals.NumberTest)});
  12675. //>>excludeEnd("ctx");
  12676. },
  12677. //>>excludeStart("ide", pragmas.excludeIdeData);
  12678. args: [],
  12679. source: "testLog\x0a\x09self assert: 10000 log equals: 4.\x0a\x09self assert: (512 log: 2) equals: 9.\x0a\x09self assert: Number e ln equals: 1.",
  12680. referencedClasses: ["Number"],
  12681. //>>excludeEnd("ide");
  12682. messageSends: ["assert:equals:", "log", "log:", "ln", "e"]
  12683. }),
  12684. $globals.NumberTest);
  12685. $core.addMethod(
  12686. $core.method({
  12687. selector: "testMinMax",
  12688. protocol: "tests",
  12689. fn: function (){
  12690. var self=this,$self=this;
  12691. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12692. return $core.withContext(function($ctx1) {
  12693. //>>excludeEnd("ctx");
  12694. $self._assert_equals_((2)._max_((5)),(5));
  12695. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12696. $ctx1.sendIdx["assert:equals:"]=1;
  12697. //>>excludeEnd("ctx");
  12698. $self._assert_equals_((2)._min_((5)),(2));
  12699. return self;
  12700. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12701. }, function($ctx1) {$ctx1.fill(self,"testMinMax",{},$globals.NumberTest)});
  12702. //>>excludeEnd("ctx");
  12703. },
  12704. //>>excludeStart("ide", pragmas.excludeIdeData);
  12705. args: [],
  12706. source: "testMinMax\x0a\x09\x0a\x09self assert: (2 max: 5) equals: 5.\x0a\x09self assert: (2 min: 5) equals: 2",
  12707. referencedClasses: [],
  12708. //>>excludeEnd("ide");
  12709. messageSends: ["assert:equals:", "max:", "min:"]
  12710. }),
  12711. $globals.NumberTest);
  12712. $core.addMethod(
  12713. $core.method({
  12714. selector: "testNegated",
  12715. protocol: "tests",
  12716. fn: function (){
  12717. var self=this,$self=this;
  12718. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12719. return $core.withContext(function($ctx1) {
  12720. //>>excludeEnd("ctx");
  12721. var $1;
  12722. $1=(3)._negated();
  12723. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12724. $ctx1.sendIdx["negated"]=1;
  12725. //>>excludeEnd("ctx");
  12726. $self._assert_equals_($1,(-3));
  12727. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12728. $ctx1.sendIdx["assert:equals:"]=1;
  12729. //>>excludeEnd("ctx");
  12730. $self._assert_equals_((-3)._negated(),(3));
  12731. return self;
  12732. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12733. }, function($ctx1) {$ctx1.fill(self,"testNegated",{},$globals.NumberTest)});
  12734. //>>excludeEnd("ctx");
  12735. },
  12736. //>>excludeStart("ide", pragmas.excludeIdeData);
  12737. args: [],
  12738. source: "testNegated\x0a\x09self assert: 3 negated equals: -3.\x0a\x09self assert: -3 negated equals: 3",
  12739. referencedClasses: [],
  12740. //>>excludeEnd("ide");
  12741. messageSends: ["assert:equals:", "negated"]
  12742. }),
  12743. $globals.NumberTest);
  12744. $core.addMethod(
  12745. $core.method({
  12746. selector: "testPrintShowingDecimalPlaces",
  12747. protocol: "tests",
  12748. fn: function (){
  12749. var self=this,$self=this;
  12750. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12751. return $core.withContext(function($ctx1) {
  12752. //>>excludeEnd("ctx");
  12753. var $1,$2,$4,$3,$5,$6,$8,$7,$10,$9,$11,$12,$13,$14,$15;
  12754. $1=(23)._printShowingDecimalPlaces_((2));
  12755. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12756. $ctx1.sendIdx["printShowingDecimalPlaces:"]=1;
  12757. //>>excludeEnd("ctx");
  12758. $self._assert_equals_($1,"23.00");
  12759. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12760. $ctx1.sendIdx["assert:equals:"]=1;
  12761. //>>excludeEnd("ctx");
  12762. $2=(23.5698)._printShowingDecimalPlaces_((2));
  12763. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12764. $ctx1.sendIdx["printShowingDecimalPlaces:"]=2;
  12765. //>>excludeEnd("ctx");
  12766. $self._assert_equals_($2,"23.57");
  12767. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12768. $ctx1.sendIdx["assert:equals:"]=2;
  12769. //>>excludeEnd("ctx");
  12770. $4=(234.567)._negated();
  12771. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12772. $ctx1.sendIdx["negated"]=1;
  12773. //>>excludeEnd("ctx");
  12774. $3=$recv($4)._printShowingDecimalPlaces_((5));
  12775. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12776. $ctx1.sendIdx["printShowingDecimalPlaces:"]=3;
  12777. //>>excludeEnd("ctx");
  12778. $self._assert_equals_($3,"-234.56700");
  12779. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12780. $ctx1.sendIdx["assert:equals:"]=3;
  12781. //>>excludeEnd("ctx");
  12782. $5=(23.4567)._printShowingDecimalPlaces_((0));
  12783. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12784. $ctx1.sendIdx["printShowingDecimalPlaces:"]=4;
  12785. //>>excludeEnd("ctx");
  12786. $self._assert_equals_($5,"23");
  12787. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12788. $ctx1.sendIdx["assert:equals:"]=4;
  12789. //>>excludeEnd("ctx");
  12790. $6=(23.5567)._printShowingDecimalPlaces_((0));
  12791. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12792. $ctx1.sendIdx["printShowingDecimalPlaces:"]=5;
  12793. //>>excludeEnd("ctx");
  12794. $self._assert_equals_($6,"24");
  12795. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12796. $ctx1.sendIdx["assert:equals:"]=5;
  12797. //>>excludeEnd("ctx");
  12798. $8=(23.4567)._negated();
  12799. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12800. $ctx1.sendIdx["negated"]=2;
  12801. //>>excludeEnd("ctx");
  12802. $7=$recv($8)._printShowingDecimalPlaces_((0));
  12803. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12804. $ctx1.sendIdx["printShowingDecimalPlaces:"]=6;
  12805. //>>excludeEnd("ctx");
  12806. $self._assert_equals_($7,"-23");
  12807. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12808. $ctx1.sendIdx["assert:equals:"]=6;
  12809. //>>excludeEnd("ctx");
  12810. $10=(23.5567)._negated();
  12811. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12812. $ctx1.sendIdx["negated"]=3;
  12813. //>>excludeEnd("ctx");
  12814. $9=$recv($10)._printShowingDecimalPlaces_((0));
  12815. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12816. $ctx1.sendIdx["printShowingDecimalPlaces:"]=7;
  12817. //>>excludeEnd("ctx");
  12818. $self._assert_equals_($9,"-24");
  12819. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12820. $ctx1.sendIdx["assert:equals:"]=7;
  12821. //>>excludeEnd("ctx");
  12822. $11=(100000000)._printShowingDecimalPlaces_((1));
  12823. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12824. $ctx1.sendIdx["printShowingDecimalPlaces:"]=8;
  12825. //>>excludeEnd("ctx");
  12826. $self._assert_equals_($11,"100000000.0");
  12827. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12828. $ctx1.sendIdx["assert:equals:"]=8;
  12829. //>>excludeEnd("ctx");
  12830. $12=(0.98)._printShowingDecimalPlaces_((5));
  12831. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12832. $ctx1.sendIdx["printShowingDecimalPlaces:"]=9;
  12833. //>>excludeEnd("ctx");
  12834. $self._assert_equals_($12,"0.98000");
  12835. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12836. $ctx1.sendIdx["assert:equals:"]=9;
  12837. //>>excludeEnd("ctx");
  12838. $13=$recv((0.98)._negated())._printShowingDecimalPlaces_((2));
  12839. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12840. $ctx1.sendIdx["printShowingDecimalPlaces:"]=10;
  12841. //>>excludeEnd("ctx");
  12842. $self._assert_equals_($13,"-0.98");
  12843. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12844. $ctx1.sendIdx["assert:equals:"]=10;
  12845. //>>excludeEnd("ctx");
  12846. $14=(2.567)._printShowingDecimalPlaces_((2));
  12847. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12848. $ctx1.sendIdx["printShowingDecimalPlaces:"]=11;
  12849. //>>excludeEnd("ctx");
  12850. $self._assert_equals_($14,"2.57");
  12851. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12852. $ctx1.sendIdx["assert:equals:"]=11;
  12853. //>>excludeEnd("ctx");
  12854. $15=(-2.567)._printShowingDecimalPlaces_((2));
  12855. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12856. $ctx1.sendIdx["printShowingDecimalPlaces:"]=12;
  12857. //>>excludeEnd("ctx");
  12858. $self._assert_equals_($15,"-2.57");
  12859. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12860. $ctx1.sendIdx["assert:equals:"]=12;
  12861. //>>excludeEnd("ctx");
  12862. $self._assert_equals_((0)._printShowingDecimalPlaces_((2)),"0.00");
  12863. return self;
  12864. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12865. }, function($ctx1) {$ctx1.fill(self,"testPrintShowingDecimalPlaces",{},$globals.NumberTest)});
  12866. //>>excludeEnd("ctx");
  12867. },
  12868. //>>excludeStart("ide", pragmas.excludeIdeData);
  12869. args: [],
  12870. source: "testPrintShowingDecimalPlaces\x0a\x09self assert: (23 printShowingDecimalPlaces: 2) equals: '23.00'.\x0a\x09self assert: (23.5698 printShowingDecimalPlaces: 2) equals: '23.57'.\x0a\x09self assert: (234.567 negated printShowingDecimalPlaces: 5) equals: '-234.56700'.\x0a\x09self assert: (23.4567 printShowingDecimalPlaces: 0) equals: '23'.\x0a\x09self assert: (23.5567 printShowingDecimalPlaces: 0) equals: '24'.\x0a\x09self assert: (23.4567 negated printShowingDecimalPlaces: 0) equals: '-23'.\x0a\x09self assert: (23.5567 negated printShowingDecimalPlaces: 0) equals: '-24'.\x0a\x09self assert: (100000000 printShowingDecimalPlaces: 1) equals: '100000000.0'.\x0a\x09self assert: (0.98 printShowingDecimalPlaces: 5) equals: '0.98000'.\x0a\x09self assert: (0.98 negated printShowingDecimalPlaces: 2) equals: '-0.98'.\x0a\x09self assert: (2.567 printShowingDecimalPlaces: 2) equals: '2.57'.\x0a\x09self assert: (-2.567 printShowingDecimalPlaces: 2) equals: '-2.57'.\x0a\x09self assert: (0 printShowingDecimalPlaces: 2) equals: '0.00'.",
  12871. referencedClasses: [],
  12872. //>>excludeEnd("ide");
  12873. messageSends: ["assert:equals:", "printShowingDecimalPlaces:", "negated"]
  12874. }),
  12875. $globals.NumberTest);
  12876. $core.addMethod(
  12877. $core.method({
  12878. selector: "testRaisedTo",
  12879. protocol: "tests",
  12880. fn: function (){
  12881. var self=this,$self=this;
  12882. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12883. return $core.withContext(function($ctx1) {
  12884. //>>excludeEnd("ctx");
  12885. var $1,$2,$3;
  12886. $1=(2)._raisedTo_((4));
  12887. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12888. $ctx1.sendIdx["raisedTo:"]=1;
  12889. //>>excludeEnd("ctx");
  12890. $self._assert_equals_($1,(16));
  12891. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12892. $ctx1.sendIdx["assert:equals:"]=1;
  12893. //>>excludeEnd("ctx");
  12894. $2=(2)._raisedTo_((0));
  12895. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12896. $ctx1.sendIdx["raisedTo:"]=2;
  12897. //>>excludeEnd("ctx");
  12898. $self._assert_equals_($2,(1));
  12899. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12900. $ctx1.sendIdx["assert:equals:"]=2;
  12901. //>>excludeEnd("ctx");
  12902. $3=(2)._raisedTo_((-3));
  12903. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12904. $ctx1.sendIdx["raisedTo:"]=3;
  12905. //>>excludeEnd("ctx");
  12906. $self._assert_equals_($3,(0.125));
  12907. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12908. $ctx1.sendIdx["assert:equals:"]=3;
  12909. //>>excludeEnd("ctx");
  12910. $self._assert_equals_((4)._raisedTo_((0.5)),(2));
  12911. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12912. $ctx1.sendIdx["assert:equals:"]=4;
  12913. //>>excludeEnd("ctx");
  12914. $self._assert_equals_((2).__star_star((4)),(16));
  12915. return self;
  12916. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12917. }, function($ctx1) {$ctx1.fill(self,"testRaisedTo",{},$globals.NumberTest)});
  12918. //>>excludeEnd("ctx");
  12919. },
  12920. //>>excludeStart("ide", pragmas.excludeIdeData);
  12921. args: [],
  12922. source: "testRaisedTo\x0a\x09self assert: (2 raisedTo: 4) equals: 16.\x0a\x09self assert: (2 raisedTo: 0) equals: 1.\x0a\x09self assert: (2 raisedTo: -3) equals: 0.125.\x0a\x09self assert: (4 raisedTo: 0.5) equals: 2.\x0a\x09\x0a\x09self assert: 2 ** 4 equals: 16.",
  12923. referencedClasses: [],
  12924. //>>excludeEnd("ide");
  12925. messageSends: ["assert:equals:", "raisedTo:", "**"]
  12926. }),
  12927. $globals.NumberTest);
  12928. $core.addMethod(
  12929. $core.method({
  12930. selector: "testRounded",
  12931. protocol: "tests",
  12932. fn: function (){
  12933. var self=this,$self=this;
  12934. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12935. return $core.withContext(function($ctx1) {
  12936. //>>excludeEnd("ctx");
  12937. var $1,$2;
  12938. $1=(3)._rounded();
  12939. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12940. $ctx1.sendIdx["rounded"]=1;
  12941. //>>excludeEnd("ctx");
  12942. $self._assert_equals_($1,(3));
  12943. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12944. $ctx1.sendIdx["assert:equals:"]=1;
  12945. //>>excludeEnd("ctx");
  12946. $2=(3.212)._rounded();
  12947. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12948. $ctx1.sendIdx["rounded"]=2;
  12949. //>>excludeEnd("ctx");
  12950. $self._assert_equals_($2,(3));
  12951. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12952. $ctx1.sendIdx["assert:equals:"]=2;
  12953. //>>excludeEnd("ctx");
  12954. $self._assert_equals_((3.51)._rounded(),(4));
  12955. return self;
  12956. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12957. }, function($ctx1) {$ctx1.fill(self,"testRounded",{},$globals.NumberTest)});
  12958. //>>excludeEnd("ctx");
  12959. },
  12960. //>>excludeStart("ide", pragmas.excludeIdeData);
  12961. args: [],
  12962. source: "testRounded\x0a\x09\x0a\x09self assert: 3 rounded equals: 3.\x0a\x09self assert: 3.212 rounded equals: 3.\x0a\x09self assert: 3.51 rounded equals: 4",
  12963. referencedClasses: [],
  12964. //>>excludeEnd("ide");
  12965. messageSends: ["assert:equals:", "rounded"]
  12966. }),
  12967. $globals.NumberTest);
  12968. $core.addMethod(
  12969. $core.method({
  12970. selector: "testSign",
  12971. protocol: "tests",
  12972. fn: function (){
  12973. var self=this,$self=this;
  12974. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12975. return $core.withContext(function($ctx1) {
  12976. //>>excludeEnd("ctx");
  12977. var $1,$2;
  12978. $1=(5)._sign();
  12979. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12980. $ctx1.sendIdx["sign"]=1;
  12981. //>>excludeEnd("ctx");
  12982. $self._assert_equals_($1,(1));
  12983. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12984. $ctx1.sendIdx["assert:equals:"]=1;
  12985. //>>excludeEnd("ctx");
  12986. $2=(0)._sign();
  12987. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12988. $ctx1.sendIdx["sign"]=2;
  12989. //>>excludeEnd("ctx");
  12990. $self._assert_equals_($2,(0));
  12991. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12992. $ctx1.sendIdx["assert:equals:"]=2;
  12993. //>>excludeEnd("ctx");
  12994. $self._assert_equals_((-1.4)._sign(),(-1));
  12995. return self;
  12996. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12997. }, function($ctx1) {$ctx1.fill(self,"testSign",{},$globals.NumberTest)});
  12998. //>>excludeEnd("ctx");
  12999. },
  13000. //>>excludeStart("ide", pragmas.excludeIdeData);
  13001. args: [],
  13002. source: "testSign\x0a\x09self assert: 5 sign equals: 1.\x0a\x09self assert: 0 sign equals: 0.\x0a\x09self assert: -1.4 sign equals: -1.",
  13003. referencedClasses: [],
  13004. //>>excludeEnd("ide");
  13005. messageSends: ["assert:equals:", "sign"]
  13006. }),
  13007. $globals.NumberTest);
  13008. $core.addMethod(
  13009. $core.method({
  13010. selector: "testSqrt",
  13011. protocol: "tests",
  13012. fn: function (){
  13013. var self=this,$self=this;
  13014. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13015. return $core.withContext(function($ctx1) {
  13016. //>>excludeEnd("ctx");
  13017. var $1;
  13018. $1=(4)._sqrt();
  13019. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13020. $ctx1.sendIdx["sqrt"]=1;
  13021. //>>excludeEnd("ctx");
  13022. $self._assert_equals_($1,(2));
  13023. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13024. $ctx1.sendIdx["assert:equals:"]=1;
  13025. //>>excludeEnd("ctx");
  13026. $self._assert_equals_((16)._sqrt(),(4));
  13027. return self;
  13028. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13029. }, function($ctx1) {$ctx1.fill(self,"testSqrt",{},$globals.NumberTest)});
  13030. //>>excludeEnd("ctx");
  13031. },
  13032. //>>excludeStart("ide", pragmas.excludeIdeData);
  13033. args: [],
  13034. source: "testSqrt\x0a\x09\x0a\x09self assert: 4 sqrt equals: 2.\x0a\x09self assert: 16 sqrt equals: 4",
  13035. referencedClasses: [],
  13036. //>>excludeEnd("ide");
  13037. messageSends: ["assert:equals:", "sqrt"]
  13038. }),
  13039. $globals.NumberTest);
  13040. $core.addMethod(
  13041. $core.method({
  13042. selector: "testSquared",
  13043. protocol: "tests",
  13044. fn: function (){
  13045. var self=this,$self=this;
  13046. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13047. return $core.withContext(function($ctx1) {
  13048. //>>excludeEnd("ctx");
  13049. $self._assert_equals_((4)._squared(),(16));
  13050. return self;
  13051. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13052. }, function($ctx1) {$ctx1.fill(self,"testSquared",{},$globals.NumberTest)});
  13053. //>>excludeEnd("ctx");
  13054. },
  13055. //>>excludeStart("ide", pragmas.excludeIdeData);
  13056. args: [],
  13057. source: "testSquared\x0a\x09\x0a\x09self assert: 4 squared equals: 16",
  13058. referencedClasses: [],
  13059. //>>excludeEnd("ide");
  13060. messageSends: ["assert:equals:", "squared"]
  13061. }),
  13062. $globals.NumberTest);
  13063. $core.addMethod(
  13064. $core.method({
  13065. selector: "testTimesRepeat",
  13066. protocol: "tests",
  13067. fn: function (){
  13068. var self=this,$self=this;
  13069. var i;
  13070. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13071. return $core.withContext(function($ctx1) {
  13072. //>>excludeEnd("ctx");
  13073. i=(0);
  13074. (0)._timesRepeat_((function(){
  13075. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13076. return $core.withContext(function($ctx2) {
  13077. //>>excludeEnd("ctx");
  13078. i=$recv(i).__plus((1));
  13079. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13080. $ctx2.sendIdx["+"]=1;
  13081. //>>excludeEnd("ctx");
  13082. return i;
  13083. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13084. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  13085. //>>excludeEnd("ctx");
  13086. }));
  13087. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13088. $ctx1.sendIdx["timesRepeat:"]=1;
  13089. //>>excludeEnd("ctx");
  13090. $self._assert_equals_(i,(0));
  13091. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13092. $ctx1.sendIdx["assert:equals:"]=1;
  13093. //>>excludeEnd("ctx");
  13094. (5)._timesRepeat_((function(){
  13095. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13096. return $core.withContext(function($ctx2) {
  13097. //>>excludeEnd("ctx");
  13098. i=$recv(i).__plus((1));
  13099. return i;
  13100. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13101. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  13102. //>>excludeEnd("ctx");
  13103. }));
  13104. $self._assert_equals_(i,(5));
  13105. return self;
  13106. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13107. }, function($ctx1) {$ctx1.fill(self,"testTimesRepeat",{i:i},$globals.NumberTest)});
  13108. //>>excludeEnd("ctx");
  13109. },
  13110. //>>excludeStart("ide", pragmas.excludeIdeData);
  13111. args: [],
  13112. source: "testTimesRepeat\x0a\x09| i |\x0a\x0a\x09i := 0.\x0a\x090 timesRepeat: [ i := i + 1 ].\x0a\x09self assert: i equals: 0.\x0a\x0a\x095 timesRepeat: [ i := i + 1 ].\x0a\x09self assert: i equals: 5",
  13113. referencedClasses: [],
  13114. //>>excludeEnd("ide");
  13115. messageSends: ["timesRepeat:", "+", "assert:equals:"]
  13116. }),
  13117. $globals.NumberTest);
  13118. $core.addMethod(
  13119. $core.method({
  13120. selector: "testTo",
  13121. protocol: "tests",
  13122. fn: function (){
  13123. var self=this,$self=this;
  13124. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13125. return $core.withContext(function($ctx1) {
  13126. //>>excludeEnd("ctx");
  13127. $self._assert_equals_((1)._to_((5)),[(1), (2), (3), (4), (5)]);
  13128. return self;
  13129. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13130. }, function($ctx1) {$ctx1.fill(self,"testTo",{},$globals.NumberTest)});
  13131. //>>excludeEnd("ctx");
  13132. },
  13133. //>>excludeStart("ide", pragmas.excludeIdeData);
  13134. args: [],
  13135. source: "testTo\x0a\x09self assert: (1 to: 5) equals: #(1 2 3 4 5)",
  13136. referencedClasses: [],
  13137. //>>excludeEnd("ide");
  13138. messageSends: ["assert:equals:", "to:"]
  13139. }),
  13140. $globals.NumberTest);
  13141. $core.addMethod(
  13142. $core.method({
  13143. selector: "testToBy",
  13144. protocol: "tests",
  13145. fn: function (){
  13146. var self=this,$self=this;
  13147. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13148. return $core.withContext(function($ctx1) {
  13149. //>>excludeEnd("ctx");
  13150. var $1;
  13151. $1=(0)._to_by_((6),(2));
  13152. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13153. $ctx1.sendIdx["to:by:"]=1;
  13154. //>>excludeEnd("ctx");
  13155. $self._assert_equals_($1,[(0), (2), (4), (6)]);
  13156. $self._should_raise_((function(){
  13157. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13158. return $core.withContext(function($ctx2) {
  13159. //>>excludeEnd("ctx");
  13160. return (1)._to_by_((4),(0));
  13161. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13162. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  13163. //>>excludeEnd("ctx");
  13164. }),$globals.Error);
  13165. return self;
  13166. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13167. }, function($ctx1) {$ctx1.fill(self,"testToBy",{},$globals.NumberTest)});
  13168. //>>excludeEnd("ctx");
  13169. },
  13170. //>>excludeStart("ide", pragmas.excludeIdeData);
  13171. args: [],
  13172. source: "testToBy\x0a\x09self assert: (0 to: 6 by: 2) equals: #(0 2 4 6).\x0a\x0a\x09self should: [ 1 to: 4 by: 0 ] raise: Error",
  13173. referencedClasses: ["Error"],
  13174. //>>excludeEnd("ide");
  13175. messageSends: ["assert:equals:", "to:by:", "should:raise:"]
  13176. }),
  13177. $globals.NumberTest);
  13178. $core.addMethod(
  13179. $core.method({
  13180. selector: "testTrigonometry",
  13181. protocol: "tests",
  13182. fn: function (){
  13183. var self=this,$self=this;
  13184. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13185. return $core.withContext(function($ctx1) {
  13186. //>>excludeEnd("ctx");
  13187. $self._assert_equals_((0)._cos(),(1));
  13188. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13189. $ctx1.sendIdx["assert:equals:"]=1;
  13190. //>>excludeEnd("ctx");
  13191. $self._assert_equals_((0)._sin(),(0));
  13192. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13193. $ctx1.sendIdx["assert:equals:"]=2;
  13194. //>>excludeEnd("ctx");
  13195. $self._assert_equals_((0)._tan(),(0));
  13196. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13197. $ctx1.sendIdx["assert:equals:"]=3;
  13198. //>>excludeEnd("ctx");
  13199. $self._assert_equals_((1)._arcCos(),(0));
  13200. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13201. $ctx1.sendIdx["assert:equals:"]=4;
  13202. //>>excludeEnd("ctx");
  13203. $self._assert_equals_((0)._arcSin(),(0));
  13204. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13205. $ctx1.sendIdx["assert:equals:"]=5;
  13206. //>>excludeEnd("ctx");
  13207. $self._assert_equals_((0)._arcTan(),(0));
  13208. return self;
  13209. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13210. }, function($ctx1) {$ctx1.fill(self,"testTrigonometry",{},$globals.NumberTest)});
  13211. //>>excludeEnd("ctx");
  13212. },
  13213. //>>excludeStart("ide", pragmas.excludeIdeData);
  13214. args: [],
  13215. source: "testTrigonometry\x0a\x09self assert: 0 cos equals: 1.\x0a\x09self assert: 0 sin equals: 0.\x0a\x09self assert: 0 tan equals: 0.\x0a\x09self assert: 1 arcCos equals: 0.\x0a\x09self assert: 0 arcSin equals: 0.\x0a\x09self assert: 0 arcTan equals: 0.",
  13216. referencedClasses: [],
  13217. //>>excludeEnd("ide");
  13218. messageSends: ["assert:equals:", "cos", "sin", "tan", "arcCos", "arcSin", "arcTan"]
  13219. }),
  13220. $globals.NumberTest);
  13221. $core.addMethod(
  13222. $core.method({
  13223. selector: "testTruncated",
  13224. protocol: "tests",
  13225. fn: function (){
  13226. var self=this,$self=this;
  13227. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13228. return $core.withContext(function($ctx1) {
  13229. //>>excludeEnd("ctx");
  13230. var $1,$2;
  13231. $1=(3)._truncated();
  13232. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13233. $ctx1.sendIdx["truncated"]=1;
  13234. //>>excludeEnd("ctx");
  13235. $self._assert_equals_($1,(3));
  13236. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13237. $ctx1.sendIdx["assert:equals:"]=1;
  13238. //>>excludeEnd("ctx");
  13239. $2=(3.212)._truncated();
  13240. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13241. $ctx1.sendIdx["truncated"]=2;
  13242. //>>excludeEnd("ctx");
  13243. $self._assert_equals_($2,(3));
  13244. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13245. $ctx1.sendIdx["assert:equals:"]=2;
  13246. //>>excludeEnd("ctx");
  13247. $self._assert_equals_((3.51)._truncated(),(3));
  13248. return self;
  13249. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13250. }, function($ctx1) {$ctx1.fill(self,"testTruncated",{},$globals.NumberTest)});
  13251. //>>excludeEnd("ctx");
  13252. },
  13253. //>>excludeStart("ide", pragmas.excludeIdeData);
  13254. args: [],
  13255. source: "testTruncated\x0a\x09\x0a\x09self assert: 3 truncated equals: 3.\x0a\x09self assert: 3.212 truncated equals: 3.\x0a\x09self assert: 3.51 truncated equals: 3",
  13256. referencedClasses: [],
  13257. //>>excludeEnd("ide");
  13258. messageSends: ["assert:equals:", "truncated"]
  13259. }),
  13260. $globals.NumberTest);
  13261. $core.addClass("ObjectMock", $globals.Object, ["foo", "bar"], "Kernel-Tests");
  13262. //>>excludeStart("ide", pragmas.excludeIdeData);
  13263. $globals.ObjectMock.comment="ObjectMock is there only to perform tests on classes.";
  13264. //>>excludeEnd("ide");
  13265. $core.addMethod(
  13266. $core.method({
  13267. selector: "foo",
  13268. protocol: "not yet classified",
  13269. fn: function (){
  13270. var self=this,$self=this;
  13271. return $self["@foo"];
  13272. },
  13273. //>>excludeStart("ide", pragmas.excludeIdeData);
  13274. args: [],
  13275. source: "foo\x0a\x09^ foo",
  13276. referencedClasses: [],
  13277. //>>excludeEnd("ide");
  13278. messageSends: []
  13279. }),
  13280. $globals.ObjectMock);
  13281. $core.addMethod(
  13282. $core.method({
  13283. selector: "foo:",
  13284. protocol: "not yet classified",
  13285. fn: function (anObject){
  13286. var self=this,$self=this;
  13287. $self["@foo"]=anObject;
  13288. return self;
  13289. },
  13290. //>>excludeStart("ide", pragmas.excludeIdeData);
  13291. args: ["anObject"],
  13292. source: "foo: anObject\x0a\x09foo := anObject",
  13293. referencedClasses: [],
  13294. //>>excludeEnd("ide");
  13295. messageSends: []
  13296. }),
  13297. $globals.ObjectMock);
  13298. $core.addClass("ObjectTest", $globals.TestCase, [], "Kernel-Tests");
  13299. $core.addMethod(
  13300. $core.method({
  13301. selector: "notDefined",
  13302. protocol: "tests",
  13303. fn: function (){
  13304. var self=this,$self=this;
  13305. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13306. return $core.withContext(function($ctx1) {
  13307. //>>excludeEnd("ctx");
  13308. return void 0;;
  13309. return self;
  13310. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13311. }, function($ctx1) {$ctx1.fill(self,"notDefined",{},$globals.ObjectTest)});
  13312. //>>excludeEnd("ctx");
  13313. },
  13314. //>>excludeStart("ide", pragmas.excludeIdeData);
  13315. args: [],
  13316. source: "notDefined\x0a\x09<inlineJS: 'return void 0;'>",
  13317. referencedClasses: [],
  13318. //>>excludeEnd("ide");
  13319. messageSends: []
  13320. }),
  13321. $globals.ObjectTest);
  13322. $core.addMethod(
  13323. $core.method({
  13324. selector: "testBasicAccess",
  13325. protocol: "tests",
  13326. fn: function (){
  13327. var self=this,$self=this;
  13328. var o;
  13329. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13330. return $core.withContext(function($ctx1) {
  13331. //>>excludeEnd("ctx");
  13332. var $1;
  13333. o=$recv($globals.Object)._new();
  13334. $recv(o)._basicAt_put_("a",(1));
  13335. $1=$recv(o)._basicAt_("a");
  13336. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13337. $ctx1.sendIdx["basicAt:"]=1;
  13338. //>>excludeEnd("ctx");
  13339. $self._assert_equals_($1,(1));
  13340. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13341. $ctx1.sendIdx["assert:equals:"]=1;
  13342. //>>excludeEnd("ctx");
  13343. $self._assert_equals_($recv(o)._basicAt_("b"),nil);
  13344. return self;
  13345. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13346. }, function($ctx1) {$ctx1.fill(self,"testBasicAccess",{o:o},$globals.ObjectTest)});
  13347. //>>excludeEnd("ctx");
  13348. },
  13349. //>>excludeStart("ide", pragmas.excludeIdeData);
  13350. args: [],
  13351. source: "testBasicAccess\x0a\x09| o |\x0a\x09o := Object new.\x0a\x09o basicAt: 'a' put: 1.\x0a\x09self assert: (o basicAt: 'a') equals: 1.\x0a\x09self assert: (o basicAt: 'b') equals: nil",
  13352. referencedClasses: ["Object"],
  13353. //>>excludeEnd("ide");
  13354. messageSends: ["new", "basicAt:put:", "assert:equals:", "basicAt:"]
  13355. }),
  13356. $globals.ObjectTest);
  13357. $core.addMethod(
  13358. $core.method({
  13359. selector: "testBasicPerform",
  13360. protocol: "tests",
  13361. fn: function (){
  13362. var self=this,$self=this;
  13363. var o;
  13364. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13365. return $core.withContext(function($ctx1) {
  13366. //>>excludeEnd("ctx");
  13367. o=$recv($globals.Object)._new();
  13368. $recv(o)._basicAt_put_("func",(function(){
  13369. return "hello";
  13370. }));
  13371. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13372. $ctx1.sendIdx["basicAt:put:"]=1;
  13373. //>>excludeEnd("ctx");
  13374. $recv(o)._basicAt_put_("func2",(function(a){
  13375. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13376. return $core.withContext(function($ctx2) {
  13377. //>>excludeEnd("ctx");
  13378. return $recv(a).__plus((1));
  13379. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13380. }, function($ctx2) {$ctx2.fillBlock({a:a},$ctx1,2)});
  13381. //>>excludeEnd("ctx");
  13382. }));
  13383. $self._assert_equals_($recv(o)._basicPerform_("func"),"hello");
  13384. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13385. $ctx1.sendIdx["assert:equals:"]=1;
  13386. //>>excludeEnd("ctx");
  13387. $self._assert_equals_($recv(o)._basicPerform_withArguments_("func2",[(3)]),(4));
  13388. return self;
  13389. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13390. }, function($ctx1) {$ctx1.fill(self,"testBasicPerform",{o:o},$globals.ObjectTest)});
  13391. //>>excludeEnd("ctx");
  13392. },
  13393. //>>excludeStart("ide", pragmas.excludeIdeData);
  13394. args: [],
  13395. source: "testBasicPerform\x0a\x09| o |\x0a\x09o := Object new.\x0a\x09o basicAt: 'func' put: [ 'hello' ].\x0a\x09o basicAt: 'func2' put: [ :a | a + 1 ].\x0a\x0a\x09self assert: (o basicPerform: 'func') equals: 'hello'.\x0a\x09self assert: (o basicPerform: 'func2' withArguments: #(3)) equals: 4",
  13396. referencedClasses: ["Object"],
  13397. //>>excludeEnd("ide");
  13398. messageSends: ["new", "basicAt:put:", "+", "assert:equals:", "basicPerform:", "basicPerform:withArguments:"]
  13399. }),
  13400. $globals.ObjectTest);
  13401. $core.addMethod(
  13402. $core.method({
  13403. selector: "testDNU",
  13404. protocol: "tests",
  13405. fn: function (){
  13406. var self=this,$self=this;
  13407. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13408. return $core.withContext(function($ctx1) {
  13409. //>>excludeEnd("ctx");
  13410. $self._should_raise_((function(){
  13411. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13412. return $core.withContext(function($ctx2) {
  13413. //>>excludeEnd("ctx");
  13414. return $recv($recv($globals.Object)._new())._foo();
  13415. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13416. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  13417. //>>excludeEnd("ctx");
  13418. }),$globals.MessageNotUnderstood);
  13419. return self;
  13420. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13421. }, function($ctx1) {$ctx1.fill(self,"testDNU",{},$globals.ObjectTest)});
  13422. //>>excludeEnd("ctx");
  13423. },
  13424. //>>excludeStart("ide", pragmas.excludeIdeData);
  13425. args: [],
  13426. source: "testDNU\x0a\x09self should: [ Object new foo ] raise: MessageNotUnderstood",
  13427. referencedClasses: ["Object", "MessageNotUnderstood"],
  13428. //>>excludeEnd("ide");
  13429. messageSends: ["should:raise:", "foo", "new"]
  13430. }),
  13431. $globals.ObjectTest);
  13432. $core.addMethod(
  13433. $core.method({
  13434. selector: "testEquality",
  13435. protocol: "tests",
  13436. fn: function (){
  13437. var self=this,$self=this;
  13438. var o;
  13439. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13440. return $core.withContext(function($ctx1) {
  13441. //>>excludeEnd("ctx");
  13442. var $1,$2,$4,$3;
  13443. o=$recv($globals.Object)._new();
  13444. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13445. $ctx1.sendIdx["new"]=1;
  13446. //>>excludeEnd("ctx");
  13447. $1=$recv(o).__eq($recv($globals.Object)._new());
  13448. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13449. $ctx1.sendIdx["="]=1;
  13450. //>>excludeEnd("ctx");
  13451. $self._deny_($1);
  13452. $2=$recv(o).__eq(o);
  13453. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13454. $ctx1.sendIdx["="]=2;
  13455. //>>excludeEnd("ctx");
  13456. $self._assert_($2);
  13457. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13458. $ctx1.sendIdx["assert:"]=1;
  13459. //>>excludeEnd("ctx");
  13460. $4=$recv(o)._yourself();
  13461. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13462. $ctx1.sendIdx["yourself"]=1;
  13463. //>>excludeEnd("ctx");
  13464. $3=$recv($4).__eq(o);
  13465. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13466. $ctx1.sendIdx["="]=3;
  13467. //>>excludeEnd("ctx");
  13468. $self._assert_($3);
  13469. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13470. $ctx1.sendIdx["assert:"]=2;
  13471. //>>excludeEnd("ctx");
  13472. $self._assert_($recv(o).__eq($recv(o)._yourself()));
  13473. return self;
  13474. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13475. }, function($ctx1) {$ctx1.fill(self,"testEquality",{o:o},$globals.ObjectTest)});
  13476. //>>excludeEnd("ctx");
  13477. },
  13478. //>>excludeStart("ide", pragmas.excludeIdeData);
  13479. args: [],
  13480. source: "testEquality\x0a\x09| o |\x0a\x09o := Object new.\x0a\x09self deny: o = Object new.\x0a\x09self assert: (o = o).\x0a\x09self assert: (o yourself = o).\x0a\x09self assert: (o = o yourself)",
  13481. referencedClasses: ["Object"],
  13482. //>>excludeEnd("ide");
  13483. messageSends: ["new", "deny:", "=", "assert:", "yourself"]
  13484. }),
  13485. $globals.ObjectTest);
  13486. $core.addMethod(
  13487. $core.method({
  13488. selector: "testHalt",
  13489. protocol: "tests",
  13490. fn: function (){
  13491. var self=this,$self=this;
  13492. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13493. return $core.withContext(function($ctx1) {
  13494. //>>excludeEnd("ctx");
  13495. $self._should_raise_((function(){
  13496. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13497. return $core.withContext(function($ctx2) {
  13498. //>>excludeEnd("ctx");
  13499. return $recv($recv($globals.Object)._new())._halt();
  13500. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13501. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  13502. //>>excludeEnd("ctx");
  13503. }),$globals.Error);
  13504. return self;
  13505. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13506. }, function($ctx1) {$ctx1.fill(self,"testHalt",{},$globals.ObjectTest)});
  13507. //>>excludeEnd("ctx");
  13508. },
  13509. //>>excludeStart("ide", pragmas.excludeIdeData);
  13510. args: [],
  13511. source: "testHalt\x0a\x09self should: [ Object new halt ] raise: Error",
  13512. referencedClasses: ["Object", "Error"],
  13513. //>>excludeEnd("ide");
  13514. messageSends: ["should:raise:", "halt", "new"]
  13515. }),
  13516. $globals.ObjectTest);
  13517. $core.addMethod(
  13518. $core.method({
  13519. selector: "testIdentity",
  13520. protocol: "tests",
  13521. fn: function (){
  13522. var self=this,$self=this;
  13523. var o;
  13524. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13525. return $core.withContext(function($ctx1) {
  13526. //>>excludeEnd("ctx");
  13527. var $1,$2,$4,$3;
  13528. o=$recv($globals.Object)._new();
  13529. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13530. $ctx1.sendIdx["new"]=1;
  13531. //>>excludeEnd("ctx");
  13532. $1=$recv(o).__eq_eq($recv($globals.Object)._new());
  13533. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13534. $ctx1.sendIdx["=="]=1;
  13535. //>>excludeEnd("ctx");
  13536. $self._deny_($1);
  13537. $2=$recv(o).__eq_eq(o);
  13538. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13539. $ctx1.sendIdx["=="]=2;
  13540. //>>excludeEnd("ctx");
  13541. $self._assert_($2);
  13542. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13543. $ctx1.sendIdx["assert:"]=1;
  13544. //>>excludeEnd("ctx");
  13545. $4=$recv(o)._yourself();
  13546. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13547. $ctx1.sendIdx["yourself"]=1;
  13548. //>>excludeEnd("ctx");
  13549. $3=$recv($4).__eq_eq(o);
  13550. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13551. $ctx1.sendIdx["=="]=3;
  13552. //>>excludeEnd("ctx");
  13553. $self._assert_($3);
  13554. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13555. $ctx1.sendIdx["assert:"]=2;
  13556. //>>excludeEnd("ctx");
  13557. $self._assert_($recv(o).__eq_eq($recv(o)._yourself()));
  13558. return self;
  13559. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13560. }, function($ctx1) {$ctx1.fill(self,"testIdentity",{o:o},$globals.ObjectTest)});
  13561. //>>excludeEnd("ctx");
  13562. },
  13563. //>>excludeStart("ide", pragmas.excludeIdeData);
  13564. args: [],
  13565. source: "testIdentity\x0a\x09| o |\x0a\x09o := Object new.\x0a\x09self deny: o == Object new.\x0a\x09self assert: o == o.\x0a\x09self assert: o yourself == o.\x0a\x09self assert: o == o yourself",
  13566. referencedClasses: ["Object"],
  13567. //>>excludeEnd("ide");
  13568. messageSends: ["new", "deny:", "==", "assert:", "yourself"]
  13569. }),
  13570. $globals.ObjectTest);
  13571. $core.addMethod(
  13572. $core.method({
  13573. selector: "testIfNil",
  13574. protocol: "tests",
  13575. fn: function (){
  13576. var self=this,$self=this;
  13577. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13578. return $core.withContext(function($ctx1) {
  13579. //>>excludeEnd("ctx");
  13580. var $2,$1,$5,$4,$3,$7,$6,$9,$8,$11,$10,$receiver;
  13581. $2=$recv($globals.Object)._new();
  13582. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13583. $ctx1.sendIdx["new"]=1;
  13584. //>>excludeEnd("ctx");
  13585. $1=$recv($2)._isNil();
  13586. $self._deny_($1);
  13587. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13588. $ctx1.sendIdx["deny:"]=1;
  13589. //>>excludeEnd("ctx");
  13590. $5=$recv($globals.Object)._new();
  13591. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13592. $ctx1.sendIdx["new"]=2;
  13593. //>>excludeEnd("ctx");
  13594. if(($receiver = $5) == null || $receiver.a$nil){
  13595. $4=true;
  13596. } else {
  13597. $4=$5;
  13598. }
  13599. $3=$recv($4).__eq(true);
  13600. $self._deny_($3);
  13601. $7=$recv($globals.Object)._new();
  13602. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13603. $ctx1.sendIdx["new"]=3;
  13604. //>>excludeEnd("ctx");
  13605. if(($receiver = $7) == null || $receiver.a$nil){
  13606. $6=$7;
  13607. } else {
  13608. $6=true;
  13609. }
  13610. $self._assert_equals_($6,true);
  13611. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13612. $ctx1.sendIdx["assert:equals:"]=1;
  13613. //>>excludeEnd("ctx");
  13614. $9=$recv($globals.Object)._new();
  13615. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13616. $ctx1.sendIdx["new"]=4;
  13617. //>>excludeEnd("ctx");
  13618. if(($receiver = $9) == null || $receiver.a$nil){
  13619. $8=false;
  13620. } else {
  13621. $8=true;
  13622. }
  13623. $self._assert_equals_($8,true);
  13624. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13625. $ctx1.sendIdx["assert:equals:"]=2;
  13626. //>>excludeEnd("ctx");
  13627. $11=$recv($globals.Object)._new();
  13628. if(($receiver = $11) == null || $receiver.a$nil){
  13629. $10=false;
  13630. } else {
  13631. $10=true;
  13632. }
  13633. $self._assert_equals_($10,true);
  13634. return self;
  13635. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13636. }, function($ctx1) {$ctx1.fill(self,"testIfNil",{},$globals.ObjectTest)});
  13637. //>>excludeEnd("ctx");
  13638. },
  13639. //>>excludeStart("ide", pragmas.excludeIdeData);
  13640. args: [],
  13641. source: "testIfNil\x0a\x09self deny: Object new isNil.\x0a\x09self deny: (Object new ifNil: [ true ]) = true.\x0a\x09self assert: (Object new ifNotNil: [ true ]) equals: true.\x0a\x0a\x09self assert: (Object new ifNil: [ false ] ifNotNil: [ true ]) equals: true.\x0a\x09self assert: (Object new ifNotNil: [ true ] ifNil: [ false ]) equals: true",
  13642. referencedClasses: ["Object"],
  13643. //>>excludeEnd("ide");
  13644. messageSends: ["deny:", "isNil", "new", "=", "ifNil:", "assert:equals:", "ifNotNil:", "ifNil:ifNotNil:", "ifNotNil:ifNil:"]
  13645. }),
  13646. $globals.ObjectTest);
  13647. $core.addMethod(
  13648. $core.method({
  13649. selector: "testInstVars",
  13650. protocol: "tests",
  13651. fn: function (){
  13652. var self=this,$self=this;
  13653. var o;
  13654. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13655. return $core.withContext(function($ctx1) {
  13656. //>>excludeEnd("ctx");
  13657. var $1,$2;
  13658. o=$recv($globals.ObjectMock)._new();
  13659. $1=$recv(o)._instVarAt_("foo");
  13660. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13661. $ctx1.sendIdx["instVarAt:"]=1;
  13662. //>>excludeEnd("ctx");
  13663. $self._assert_equals_($1,nil);
  13664. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13665. $ctx1.sendIdx["assert:equals:"]=1;
  13666. //>>excludeEnd("ctx");
  13667. $recv(o)._instVarAt_put_("foo",(1));
  13668. $2=$recv(o)._instVarAt_("foo");
  13669. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13670. $ctx1.sendIdx["instVarAt:"]=2;
  13671. //>>excludeEnd("ctx");
  13672. $self._assert_equals_($2,(1));
  13673. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13674. $ctx1.sendIdx["assert:equals:"]=2;
  13675. //>>excludeEnd("ctx");
  13676. $self._assert_equals_($recv(o)._instVarAt_("foo"),(1));
  13677. return self;
  13678. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13679. }, function($ctx1) {$ctx1.fill(self,"testInstVars",{o:o},$globals.ObjectTest)});
  13680. //>>excludeEnd("ctx");
  13681. },
  13682. //>>excludeStart("ide", pragmas.excludeIdeData);
  13683. args: [],
  13684. source: "testInstVars\x0a\x09| o |\x0a\x09o := ObjectMock new.\x0a\x09self assert: (o instVarAt: #foo) equals: nil.\x0a\x0a\x09o instVarAt: #foo put: 1.\x0a\x09self assert: (o instVarAt: #foo) equals: 1.\x0a\x09self assert: (o instVarAt: 'foo') equals: 1",
  13685. referencedClasses: ["ObjectMock"],
  13686. //>>excludeEnd("ide");
  13687. messageSends: ["new", "assert:equals:", "instVarAt:", "instVarAt:put:"]
  13688. }),
  13689. $globals.ObjectTest);
  13690. $core.addMethod(
  13691. $core.method({
  13692. selector: "testNilUndefined",
  13693. protocol: "tests",
  13694. fn: function (){
  13695. var self=this,$self=this;
  13696. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13697. return $core.withContext(function($ctx1) {
  13698. //>>excludeEnd("ctx");
  13699. $self._assert_equals_($self._notDefined(),nil);
  13700. return self;
  13701. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13702. }, function($ctx1) {$ctx1.fill(self,"testNilUndefined",{},$globals.ObjectTest)});
  13703. //>>excludeEnd("ctx");
  13704. },
  13705. //>>excludeStart("ide", pragmas.excludeIdeData);
  13706. args: [],
  13707. source: "testNilUndefined\x0a\x09\x22nil in Smalltalk is the undefined object in JS\x22\x0a\x0a\x09self assert: self notDefined equals: nil",
  13708. referencedClasses: [],
  13709. //>>excludeEnd("ide");
  13710. messageSends: ["assert:equals:", "notDefined"]
  13711. }),
  13712. $globals.ObjectTest);
  13713. $core.addMethod(
  13714. $core.method({
  13715. selector: "testYourself",
  13716. protocol: "tests",
  13717. fn: function (){
  13718. var self=this,$self=this;
  13719. var o;
  13720. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13721. return $core.withContext(function($ctx1) {
  13722. //>>excludeEnd("ctx");
  13723. o=$recv($globals.ObjectMock)._new();
  13724. $self._assert_($recv($recv(o)._yourself()).__eq_eq(o));
  13725. return self;
  13726. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13727. }, function($ctx1) {$ctx1.fill(self,"testYourself",{o:o},$globals.ObjectTest)});
  13728. //>>excludeEnd("ctx");
  13729. },
  13730. //>>excludeStart("ide", pragmas.excludeIdeData);
  13731. args: [],
  13732. source: "testYourself\x0a\x09| o |\x0a\x09o := ObjectMock new.\x0a\x09self assert: o yourself == o",
  13733. referencedClasses: ["ObjectMock"],
  13734. //>>excludeEnd("ide");
  13735. messageSends: ["new", "assert:", "==", "yourself"]
  13736. }),
  13737. $globals.ObjectTest);
  13738. $core.addClass("PointTest", $globals.TestCase, [], "Kernel-Tests");
  13739. $core.addMethod(
  13740. $core.method({
  13741. selector: "testAccessing",
  13742. protocol: "tests",
  13743. fn: function (){
  13744. var self=this,$self=this;
  13745. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13746. return $core.withContext(function($ctx1) {
  13747. //>>excludeEnd("ctx");
  13748. var $2,$1,$3,$6,$5,$4;
  13749. $2=$recv($globals.Point)._x_y_((3),(4));
  13750. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13751. $ctx1.sendIdx["x:y:"]=1;
  13752. //>>excludeEnd("ctx");
  13753. $1=$recv($2)._x();
  13754. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13755. $ctx1.sendIdx["x"]=1;
  13756. //>>excludeEnd("ctx");
  13757. $self._assert_equals_($1,(3));
  13758. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13759. $ctx1.sendIdx["assert:equals:"]=1;
  13760. //>>excludeEnd("ctx");
  13761. $3=$recv($recv($globals.Point)._x_y_((3),(4)))._y();
  13762. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13763. $ctx1.sendIdx["y"]=1;
  13764. //>>excludeEnd("ctx");
  13765. $self._assert_equals_($3,(4));
  13766. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13767. $ctx1.sendIdx["assert:equals:"]=2;
  13768. //>>excludeEnd("ctx");
  13769. $6=$recv($globals.Point)._new();
  13770. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13771. $ctx1.sendIdx["new"]=1;
  13772. //>>excludeEnd("ctx");
  13773. $5=$recv($6)._x_((3));
  13774. $4=$recv($5)._x();
  13775. $self._assert_equals_($4,(3));
  13776. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13777. $ctx1.sendIdx["assert:equals:"]=3;
  13778. //>>excludeEnd("ctx");
  13779. $self._assert_equals_($recv($recv($recv($globals.Point)._new())._y_((4)))._y(),(4));
  13780. return self;
  13781. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13782. }, function($ctx1) {$ctx1.fill(self,"testAccessing",{},$globals.PointTest)});
  13783. //>>excludeEnd("ctx");
  13784. },
  13785. //>>excludeStart("ide", pragmas.excludeIdeData);
  13786. args: [],
  13787. source: "testAccessing\x0a\x09self assert: (Point x: 3 y: 4) x equals: 3.\x0a\x09self assert: (Point x: 3 y: 4) y equals: 4.\x0a\x09self assert: (Point new x: 3) x equals: 3.\x0a\x09self assert: (Point new y: 4) y equals: 4",
  13788. referencedClasses: ["Point"],
  13789. //>>excludeEnd("ide");
  13790. messageSends: ["assert:equals:", "x", "x:y:", "y", "x:", "new", "y:"]
  13791. }),
  13792. $globals.PointTest);
  13793. $core.addMethod(
  13794. $core.method({
  13795. selector: "testArithmetic",
  13796. protocol: "tests",
  13797. fn: function (){
  13798. var self=this,$self=this;
  13799. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13800. return $core.withContext(function($ctx1) {
  13801. //>>excludeEnd("ctx");
  13802. var $2,$3,$1,$4,$6,$7,$5,$8,$10,$11,$9,$12,$14,$13;
  13803. $2=(3).__at((4));
  13804. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13805. $ctx1.sendIdx["@"]=1;
  13806. //>>excludeEnd("ctx");
  13807. $3=(3).__at((4));
  13808. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13809. $ctx1.sendIdx["@"]=2;
  13810. //>>excludeEnd("ctx");
  13811. $1=$recv($2).__star($3);
  13812. $4=$recv($globals.Point)._x_y_((9),(16));
  13813. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13814. $ctx1.sendIdx["x:y:"]=1;
  13815. //>>excludeEnd("ctx");
  13816. $self._assert_equals_($1,$4);
  13817. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13818. $ctx1.sendIdx["assert:equals:"]=1;
  13819. //>>excludeEnd("ctx");
  13820. $6=(3).__at((4));
  13821. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13822. $ctx1.sendIdx["@"]=3;
  13823. //>>excludeEnd("ctx");
  13824. $7=(3).__at((4));
  13825. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13826. $ctx1.sendIdx["@"]=4;
  13827. //>>excludeEnd("ctx");
  13828. $5=$recv($6).__plus($7);
  13829. $8=$recv($globals.Point)._x_y_((6),(8));
  13830. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13831. $ctx1.sendIdx["x:y:"]=2;
  13832. //>>excludeEnd("ctx");
  13833. $self._assert_equals_($5,$8);
  13834. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13835. $ctx1.sendIdx["assert:equals:"]=2;
  13836. //>>excludeEnd("ctx");
  13837. $10=(3).__at((4));
  13838. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13839. $ctx1.sendIdx["@"]=5;
  13840. //>>excludeEnd("ctx");
  13841. $11=(3).__at((4));
  13842. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13843. $ctx1.sendIdx["@"]=6;
  13844. //>>excludeEnd("ctx");
  13845. $9=$recv($10).__minus($11);
  13846. $12=$recv($globals.Point)._x_y_((0),(0));
  13847. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13848. $ctx1.sendIdx["x:y:"]=3;
  13849. //>>excludeEnd("ctx");
  13850. $self._assert_equals_($9,$12);
  13851. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13852. $ctx1.sendIdx["assert:equals:"]=3;
  13853. //>>excludeEnd("ctx");
  13854. $14=(6).__at((8));
  13855. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13856. $ctx1.sendIdx["@"]=7;
  13857. //>>excludeEnd("ctx");
  13858. $13=$recv($14).__slash((3).__at((4)));
  13859. $self._assert_equals_($13,$recv($globals.Point)._x_y_((2),(2)));
  13860. return self;
  13861. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13862. }, function($ctx1) {$ctx1.fill(self,"testArithmetic",{},$globals.PointTest)});
  13863. //>>excludeEnd("ctx");
  13864. },
  13865. //>>excludeStart("ide", pragmas.excludeIdeData);
  13866. args: [],
  13867. source: "testArithmetic\x0a\x09self assert: 3@4 * (3@4 ) equals: (Point x: 9 y: 16).\x0a\x09self assert: 3@4 + (3@4 ) equals: (Point x: 6 y: 8).\x0a\x09self assert: 3@4 - (3@4 ) equals: (Point x: 0 y: 0).\x0a\x09self assert: 6@8 / (3@4 ) equals: (Point x: 2 y: 2)",
  13868. referencedClasses: ["Point"],
  13869. //>>excludeEnd("ide");
  13870. messageSends: ["assert:equals:", "*", "@", "x:y:", "+", "-", "/"]
  13871. }),
  13872. $globals.PointTest);
  13873. $core.addMethod(
  13874. $core.method({
  13875. selector: "testAt",
  13876. protocol: "tests",
  13877. fn: function (){
  13878. var self=this,$self=this;
  13879. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13880. return $core.withContext(function($ctx1) {
  13881. //>>excludeEnd("ctx");
  13882. $self._assert_equals_((3).__at((4)),$recv($globals.Point)._x_y_((3),(4)));
  13883. return self;
  13884. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13885. }, function($ctx1) {$ctx1.fill(self,"testAt",{},$globals.PointTest)});
  13886. //>>excludeEnd("ctx");
  13887. },
  13888. //>>excludeStart("ide", pragmas.excludeIdeData);
  13889. args: [],
  13890. source: "testAt\x0a\x09self assert: 3@4 equals: (Point x: 3 y: 4)",
  13891. referencedClasses: ["Point"],
  13892. //>>excludeEnd("ide");
  13893. messageSends: ["assert:equals:", "@", "x:y:"]
  13894. }),
  13895. $globals.PointTest);
  13896. $core.addMethod(
  13897. $core.method({
  13898. selector: "testComparison",
  13899. protocol: "tests",
  13900. fn: function (){
  13901. var self=this,$self=this;
  13902. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13903. return $core.withContext(function($ctx1) {
  13904. //>>excludeEnd("ctx");
  13905. var $2,$3,$1,$5,$6,$4,$8,$9,$7,$11,$12,$10,$14,$15,$13,$17,$18,$16,$20,$21,$19,$23,$22;
  13906. $2=(3).__at((4));
  13907. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13908. $ctx1.sendIdx["@"]=1;
  13909. //>>excludeEnd("ctx");
  13910. $3=(4).__at((5));
  13911. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13912. $ctx1.sendIdx["@"]=2;
  13913. //>>excludeEnd("ctx");
  13914. $1=$recv($2).__lt($3);
  13915. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13916. $ctx1.sendIdx["<"]=1;
  13917. //>>excludeEnd("ctx");
  13918. $self._assert_($1);
  13919. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13920. $ctx1.sendIdx["assert:"]=1;
  13921. //>>excludeEnd("ctx");
  13922. $5=(3).__at((4));
  13923. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13924. $ctx1.sendIdx["@"]=3;
  13925. //>>excludeEnd("ctx");
  13926. $6=(4).__at((4));
  13927. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13928. $ctx1.sendIdx["@"]=4;
  13929. //>>excludeEnd("ctx");
  13930. $4=$recv($5).__lt($6);
  13931. $self._deny_($4);
  13932. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13933. $ctx1.sendIdx["deny:"]=1;
  13934. //>>excludeEnd("ctx");
  13935. $8=(4).__at((5));
  13936. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13937. $ctx1.sendIdx["@"]=5;
  13938. //>>excludeEnd("ctx");
  13939. $9=(4).__at((5));
  13940. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13941. $ctx1.sendIdx["@"]=6;
  13942. //>>excludeEnd("ctx");
  13943. $7=$recv($8).__lt_eq($9);
  13944. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13945. $ctx1.sendIdx["<="]=1;
  13946. //>>excludeEnd("ctx");
  13947. $self._assert_($7);
  13948. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13949. $ctx1.sendIdx["assert:"]=2;
  13950. //>>excludeEnd("ctx");
  13951. $11=(4).__at((5));
  13952. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13953. $ctx1.sendIdx["@"]=7;
  13954. //>>excludeEnd("ctx");
  13955. $12=(3).__at((5));
  13956. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13957. $ctx1.sendIdx["@"]=8;
  13958. //>>excludeEnd("ctx");
  13959. $10=$recv($11).__lt_eq($12);
  13960. $self._deny_($10);
  13961. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13962. $ctx1.sendIdx["deny:"]=2;
  13963. //>>excludeEnd("ctx");
  13964. $14=(5).__at((6));
  13965. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13966. $ctx1.sendIdx["@"]=9;
  13967. //>>excludeEnd("ctx");
  13968. $15=(4).__at((5));
  13969. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13970. $ctx1.sendIdx["@"]=10;
  13971. //>>excludeEnd("ctx");
  13972. $13=$recv($14).__gt($15);
  13973. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13974. $ctx1.sendIdx[">"]=1;
  13975. //>>excludeEnd("ctx");
  13976. $self._assert_($13);
  13977. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13978. $ctx1.sendIdx["assert:"]=3;
  13979. //>>excludeEnd("ctx");
  13980. $17=(5).__at((6));
  13981. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13982. $ctx1.sendIdx["@"]=11;
  13983. //>>excludeEnd("ctx");
  13984. $18=(6).__at((6));
  13985. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13986. $ctx1.sendIdx["@"]=12;
  13987. //>>excludeEnd("ctx");
  13988. $16=$recv($17).__gt($18);
  13989. $self._deny_($16);
  13990. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13991. $ctx1.sendIdx["deny:"]=3;
  13992. //>>excludeEnd("ctx");
  13993. $20=(4).__at((5));
  13994. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13995. $ctx1.sendIdx["@"]=13;
  13996. //>>excludeEnd("ctx");
  13997. $21=(4).__at((5));
  13998. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13999. $ctx1.sendIdx["@"]=14;
  14000. //>>excludeEnd("ctx");
  14001. $19=$recv($20).__gt_eq($21);
  14002. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14003. $ctx1.sendIdx[">="]=1;
  14004. //>>excludeEnd("ctx");
  14005. $self._assert_($19);
  14006. $23=(4).__at((5));
  14007. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14008. $ctx1.sendIdx["@"]=15;
  14009. //>>excludeEnd("ctx");
  14010. $22=$recv($23).__gt_eq((5).__at((5)));
  14011. $self._deny_($22);
  14012. return self;
  14013. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14014. }, function($ctx1) {$ctx1.fill(self,"testComparison",{},$globals.PointTest)});
  14015. //>>excludeEnd("ctx");
  14016. },
  14017. //>>excludeStart("ide", pragmas.excludeIdeData);
  14018. args: [],
  14019. source: "testComparison\x0a\x09self assert: 3@4 < (4@5).\x0a\x09self deny: 3@4 < (4@4).\x0a\x09\x0a\x09self assert: 4@5 <= (4@5).\x0a\x09self deny: 4@5 <= (3@5).\x0a\x09\x0a\x09self assert: 5@6 > (4@5).\x0a\x09self deny: 5@6 > (6@6).\x0a\x09\x0a\x09self assert: 4@5 >= (4@5).\x0a\x09self deny: 4@5 >= (5@5)",
  14020. referencedClasses: [],
  14021. //>>excludeEnd("ide");
  14022. messageSends: ["assert:", "<", "@", "deny:", "<=", ">", ">="]
  14023. }),
  14024. $globals.PointTest);
  14025. $core.addMethod(
  14026. $core.method({
  14027. selector: "testEgality",
  14028. protocol: "tests",
  14029. fn: function (){
  14030. var self=this,$self=this;
  14031. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14032. return $core.withContext(function($ctx1) {
  14033. //>>excludeEnd("ctx");
  14034. var $2,$3,$1,$5,$4;
  14035. $2=(3).__at((4));
  14036. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14037. $ctx1.sendIdx["@"]=1;
  14038. //>>excludeEnd("ctx");
  14039. $3=(3).__at((4));
  14040. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14041. $ctx1.sendIdx["@"]=2;
  14042. //>>excludeEnd("ctx");
  14043. $1=$recv($2).__eq($3);
  14044. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14045. $ctx1.sendIdx["="]=1;
  14046. //>>excludeEnd("ctx");
  14047. $self._assert_($1);
  14048. $5=(3).__at((5));
  14049. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14050. $ctx1.sendIdx["@"]=3;
  14051. //>>excludeEnd("ctx");
  14052. $4=$recv($5).__eq((3).__at((6)));
  14053. $self._deny_($4);
  14054. return self;
  14055. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14056. }, function($ctx1) {$ctx1.fill(self,"testEgality",{},$globals.PointTest)});
  14057. //>>excludeEnd("ctx");
  14058. },
  14059. //>>excludeStart("ide", pragmas.excludeIdeData);
  14060. args: [],
  14061. source: "testEgality\x0a\x09self assert: (3@4 = (3@4)).\x0a\x09self deny: 3@5 = (3@6)",
  14062. referencedClasses: [],
  14063. //>>excludeEnd("ide");
  14064. messageSends: ["assert:", "=", "@", "deny:"]
  14065. }),
  14066. $globals.PointTest);
  14067. $core.addMethod(
  14068. $core.method({
  14069. selector: "testNew",
  14070. protocol: "tests",
  14071. fn: function (){
  14072. var self=this,$self=this;
  14073. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14074. return $core.withContext(function($ctx1) {
  14075. //>>excludeEnd("ctx");
  14076. var $3,$2,$1,$7,$6,$5,$4,$10,$9,$8;
  14077. $3=$recv($globals.Point)._new();
  14078. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14079. $ctx1.sendIdx["new"]=1;
  14080. //>>excludeEnd("ctx");
  14081. $2=$recv($3)._x_((3));
  14082. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14083. $ctx1.sendIdx["x:"]=1;
  14084. //>>excludeEnd("ctx");
  14085. $1=$recv($2)._y();
  14086. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14087. $ctx1.sendIdx["y"]=1;
  14088. //>>excludeEnd("ctx");
  14089. $self._assert_equals_($1,nil);
  14090. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14091. $ctx1.sendIdx["assert:equals:"]=1;
  14092. //>>excludeEnd("ctx");
  14093. $7=$recv($globals.Point)._new();
  14094. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14095. $ctx1.sendIdx["new"]=2;
  14096. //>>excludeEnd("ctx");
  14097. $6=$recv($7)._x_((3));
  14098. $5=$recv($6)._x();
  14099. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14100. $ctx1.sendIdx["x"]=1;
  14101. //>>excludeEnd("ctx");
  14102. $4=$recv($5).__eq((0));
  14103. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14104. $ctx1.sendIdx["="]=1;
  14105. //>>excludeEnd("ctx");
  14106. $self._deny_($4);
  14107. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14108. $ctx1.sendIdx["deny:"]=1;
  14109. //>>excludeEnd("ctx");
  14110. $10=$recv($globals.Point)._new();
  14111. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14112. $ctx1.sendIdx["new"]=3;
  14113. //>>excludeEnd("ctx");
  14114. $9=$recv($10)._y_((4));
  14115. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14116. $ctx1.sendIdx["y:"]=1;
  14117. //>>excludeEnd("ctx");
  14118. $8=$recv($9)._x();
  14119. $self._assert_equals_($8,nil);
  14120. $self._deny_($recv($recv($recv($recv($globals.Point)._new())._y_((4)))._y()).__eq((0)));
  14121. return self;
  14122. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14123. }, function($ctx1) {$ctx1.fill(self,"testNew",{},$globals.PointTest)});
  14124. //>>excludeEnd("ctx");
  14125. },
  14126. //>>excludeStart("ide", pragmas.excludeIdeData);
  14127. args: [],
  14128. source: "testNew\x0a\x0a\x09self assert: (Point new x: 3) y equals: nil.\x0a\x09self deny: (Point new x: 3) x = 0.\x0a\x09self assert: (Point new y: 4) x equals: nil.\x0a\x09self deny: (Point new y: 4) y = 0",
  14129. referencedClasses: ["Point"],
  14130. //>>excludeEnd("ide");
  14131. messageSends: ["assert:equals:", "y", "x:", "new", "deny:", "=", "x", "y:"]
  14132. }),
  14133. $globals.PointTest);
  14134. $core.addMethod(
  14135. $core.method({
  14136. selector: "testTranslateBy",
  14137. protocol: "tests",
  14138. fn: function (){
  14139. var self=this,$self=this;
  14140. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14141. return $core.withContext(function($ctx1) {
  14142. //>>excludeEnd("ctx");
  14143. var $2,$3,$1,$4,$6,$8,$7,$5,$9,$11,$12,$10,$13,$15,$16,$14;
  14144. $2=(3).__at((3));
  14145. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14146. $ctx1.sendIdx["@"]=1;
  14147. //>>excludeEnd("ctx");
  14148. $3=(0).__at((1));
  14149. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14150. $ctx1.sendIdx["@"]=2;
  14151. //>>excludeEnd("ctx");
  14152. $1=$recv($2)._translateBy_($3);
  14153. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14154. $ctx1.sendIdx["translateBy:"]=1;
  14155. //>>excludeEnd("ctx");
  14156. $4=(3).__at((4));
  14157. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14158. $ctx1.sendIdx["@"]=3;
  14159. //>>excludeEnd("ctx");
  14160. $self._assert_equals_($1,$4);
  14161. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14162. $ctx1.sendIdx["assert:equals:"]=1;
  14163. //>>excludeEnd("ctx");
  14164. $6=(3).__at((3));
  14165. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14166. $ctx1.sendIdx["@"]=4;
  14167. //>>excludeEnd("ctx");
  14168. $8=(1)._negated();
  14169. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14170. $ctx1.sendIdx["negated"]=1;
  14171. //>>excludeEnd("ctx");
  14172. $7=(0).__at($8);
  14173. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14174. $ctx1.sendIdx["@"]=5;
  14175. //>>excludeEnd("ctx");
  14176. $5=$recv($6)._translateBy_($7);
  14177. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14178. $ctx1.sendIdx["translateBy:"]=2;
  14179. //>>excludeEnd("ctx");
  14180. $9=(3).__at((2));
  14181. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14182. $ctx1.sendIdx["@"]=6;
  14183. //>>excludeEnd("ctx");
  14184. $self._assert_equals_($5,$9);
  14185. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14186. $ctx1.sendIdx["assert:equals:"]=2;
  14187. //>>excludeEnd("ctx");
  14188. $11=(3).__at((3));
  14189. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14190. $ctx1.sendIdx["@"]=7;
  14191. //>>excludeEnd("ctx");
  14192. $12=(2).__at((3));
  14193. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14194. $ctx1.sendIdx["@"]=8;
  14195. //>>excludeEnd("ctx");
  14196. $10=$recv($11)._translateBy_($12);
  14197. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14198. $ctx1.sendIdx["translateBy:"]=3;
  14199. //>>excludeEnd("ctx");
  14200. $13=(5).__at((6));
  14201. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14202. $ctx1.sendIdx["@"]=9;
  14203. //>>excludeEnd("ctx");
  14204. $self._assert_equals_($10,$13);
  14205. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14206. $ctx1.sendIdx["assert:equals:"]=3;
  14207. //>>excludeEnd("ctx");
  14208. $15=(3).__at((3));
  14209. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14210. $ctx1.sendIdx["@"]=10;
  14211. //>>excludeEnd("ctx");
  14212. $16=$recv((3)._negated()).__at((0));
  14213. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14214. $ctx1.sendIdx["@"]=11;
  14215. //>>excludeEnd("ctx");
  14216. $14=$recv($15)._translateBy_($16);
  14217. $self._assert_equals_($14,(0).__at((3)));
  14218. return self;
  14219. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14220. }, function($ctx1) {$ctx1.fill(self,"testTranslateBy",{},$globals.PointTest)});
  14221. //>>excludeEnd("ctx");
  14222. },
  14223. //>>excludeStart("ide", pragmas.excludeIdeData);
  14224. args: [],
  14225. source: "testTranslateBy\x0a\x09self assert: (3@3 translateBy: 0@1) equals: 3@4.\x0a\x09self assert: (3@3 translateBy: 0@1 negated) equals: 3@2.\x0a\x09self assert: (3@3 translateBy: 2@3) equals: 5@6.\x0a\x09self assert: (3@3 translateBy: 3 negated @0) equals: 0@3.",
  14226. referencedClasses: [],
  14227. //>>excludeEnd("ide");
  14228. messageSends: ["assert:equals:", "translateBy:", "@", "negated"]
  14229. }),
  14230. $globals.PointTest);
  14231. $core.addClass("QueueTest", $globals.TestCase, [], "Kernel-Tests");
  14232. $core.addMethod(
  14233. $core.method({
  14234. selector: "testNextIfAbsent",
  14235. protocol: "tests",
  14236. fn: function (){
  14237. var self=this,$self=this;
  14238. var queue;
  14239. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14240. return $core.withContext(function($ctx1) {
  14241. //>>excludeEnd("ctx");
  14242. var $2,$1;
  14243. queue=$recv($globals.Queue)._new();
  14244. $recv(queue)._nextPut_("index1");
  14245. $2=$recv(queue)._nextIfAbsent_("empty");
  14246. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14247. $ctx1.sendIdx["nextIfAbsent:"]=1;
  14248. //>>excludeEnd("ctx");
  14249. $1=$recv($2).__eq("index1");
  14250. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14251. $ctx1.sendIdx["="]=1;
  14252. //>>excludeEnd("ctx");
  14253. $self._assert_($1);
  14254. $self._deny_($recv($recv(queue)._nextIfAbsent_("empty")).__eq("index1"));
  14255. return self;
  14256. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14257. }, function($ctx1) {$ctx1.fill(self,"testNextIfAbsent",{queue:queue},$globals.QueueTest)});
  14258. //>>excludeEnd("ctx");
  14259. },
  14260. //>>excludeStart("ide", pragmas.excludeIdeData);
  14261. args: [],
  14262. source: "testNextIfAbsent\x0a\x09| queue |\x0a\x09queue := Queue new.\x0a\x09queue nextPut: 'index1'. \x0a\x0a\x09self assert: (queue nextIfAbsent: 'empty') = 'index1'.\x0a\x09self deny: (queue nextIfAbsent: 'empty') = 'index1'",
  14263. referencedClasses: ["Queue"],
  14264. //>>excludeEnd("ide");
  14265. messageSends: ["new", "nextPut:", "assert:", "=", "nextIfAbsent:", "deny:"]
  14266. }),
  14267. $globals.QueueTest);
  14268. $core.addMethod(
  14269. $core.method({
  14270. selector: "testQueueNext",
  14271. protocol: "tests",
  14272. fn: function (){
  14273. var self=this,$self=this;
  14274. var queue;
  14275. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14276. return $core.withContext(function($ctx1) {
  14277. //>>excludeEnd("ctx");
  14278. var $1,$3,$2,$5,$4;
  14279. queue=$recv($globals.Queue)._new();
  14280. $1=queue;
  14281. $recv($1)._nextPut_("index1");
  14282. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14283. $ctx1.sendIdx["nextPut:"]=1;
  14284. //>>excludeEnd("ctx");
  14285. $recv($1)._nextPut_("index2");
  14286. $3=$recv(queue)._next();
  14287. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14288. $ctx1.sendIdx["next"]=1;
  14289. //>>excludeEnd("ctx");
  14290. $2=$recv($3).__eq("index1");
  14291. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14292. $ctx1.sendIdx["="]=1;
  14293. //>>excludeEnd("ctx");
  14294. $self._assert_($2);
  14295. $5=$recv(queue)._next();
  14296. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14297. $ctx1.sendIdx["next"]=2;
  14298. //>>excludeEnd("ctx");
  14299. $4=$recv($5).__eq("index");
  14300. $self._deny_($4);
  14301. $self._should_raise_((function(){
  14302. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14303. return $core.withContext(function($ctx2) {
  14304. //>>excludeEnd("ctx");
  14305. return $recv(queue)._next();
  14306. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14307. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  14308. //>>excludeEnd("ctx");
  14309. }),$globals.Error);
  14310. return self;
  14311. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14312. }, function($ctx1) {$ctx1.fill(self,"testQueueNext",{queue:queue},$globals.QueueTest)});
  14313. //>>excludeEnd("ctx");
  14314. },
  14315. //>>excludeStart("ide", pragmas.excludeIdeData);
  14316. args: [],
  14317. source: "testQueueNext\x0a\x09| queue | \x0a\x09queue := Queue new.\x0a\x09queue \x0a\x09\x09nextPut: 'index1';\x0a\x09\x09nextPut: 'index2'.\x0a\x0a\x09self assert: queue next = 'index1'.\x0a\x09self deny: queue next = 'index'.\x0a\x09self should: [ queue next ] raise: Error",
  14318. referencedClasses: ["Queue", "Error"],
  14319. //>>excludeEnd("ide");
  14320. messageSends: ["new", "nextPut:", "assert:", "=", "next", "deny:", "should:raise:"]
  14321. }),
  14322. $globals.QueueTest);
  14323. $core.addClass("RandomTest", $globals.TestCase, [], "Kernel-Tests");
  14324. $core.addMethod(
  14325. $core.method({
  14326. selector: "testAtRandomNumber",
  14327. protocol: "tests",
  14328. fn: function (){
  14329. var self=this,$self=this;
  14330. var val;
  14331. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14332. return $core.withContext(function($ctx1) {
  14333. //>>excludeEnd("ctx");
  14334. (100)._timesRepeat_((function(){
  14335. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14336. return $core.withContext(function($ctx2) {
  14337. //>>excludeEnd("ctx");
  14338. val=(10)._atRandom();
  14339. val;
  14340. $self._assert_($recv(val).__gt((0)));
  14341. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14342. $ctx2.sendIdx["assert:"]=1;
  14343. //>>excludeEnd("ctx");
  14344. return $self._assert_($recv(val).__lt((11)));
  14345. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14346. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  14347. //>>excludeEnd("ctx");
  14348. }));
  14349. return self;
  14350. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14351. }, function($ctx1) {$ctx1.fill(self,"testAtRandomNumber",{val:val},$globals.RandomTest)});
  14352. //>>excludeEnd("ctx");
  14353. },
  14354. //>>excludeStart("ide", pragmas.excludeIdeData);
  14355. args: [],
  14356. source: "testAtRandomNumber\x0a\x09|val|\x09\x0a\x0a\x09100 timesRepeat: [\x0a\x09\x09val := 10 atRandom.\x09\x0a\x09\x09self assert: (val > 0).\x0a\x09\x09self assert: (val <11)\x0a\x09]",
  14357. referencedClasses: [],
  14358. //>>excludeEnd("ide");
  14359. messageSends: ["timesRepeat:", "atRandom", "assert:", ">", "<"]
  14360. }),
  14361. $globals.RandomTest);
  14362. $core.addMethod(
  14363. $core.method({
  14364. selector: "testAtRandomSequenceableCollection",
  14365. protocol: "tests",
  14366. fn: function (){
  14367. var self=this,$self=this;
  14368. var val;
  14369. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14370. return $core.withContext(function($ctx1) {
  14371. //>>excludeEnd("ctx");
  14372. var $3,$4,$2,$1;
  14373. (100)._timesRepeat_((function(){
  14374. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14375. return $core.withContext(function($ctx2) {
  14376. //>>excludeEnd("ctx");
  14377. val="abc"._atRandom();
  14378. val;
  14379. $3=$recv(val).__eq("a");
  14380. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14381. $ctx2.sendIdx["="]=1;
  14382. //>>excludeEnd("ctx");
  14383. $4=$recv(val).__eq("b");
  14384. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14385. $ctx2.sendIdx["="]=2;
  14386. //>>excludeEnd("ctx");
  14387. $2=$recv($3).__or($4);
  14388. $1=$recv($2).__or($recv(val).__eq("c"));
  14389. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14390. $ctx2.sendIdx["|"]=1;
  14391. //>>excludeEnd("ctx");
  14392. return $self._assert_($1);
  14393. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14394. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  14395. //>>excludeEnd("ctx");
  14396. }));
  14397. return self;
  14398. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14399. }, function($ctx1) {$ctx1.fill(self,"testAtRandomSequenceableCollection",{val:val},$globals.RandomTest)});
  14400. //>>excludeEnd("ctx");
  14401. },
  14402. //>>excludeStart("ide", pragmas.excludeIdeData);
  14403. args: [],
  14404. source: "testAtRandomSequenceableCollection\x0a\x09|val|\x0a\x09\x0a\x09100 timesRepeat: [\x0a\x09\x09val := 'abc' atRandom.\x0a\x09\x09self assert: ((val = 'a') | (val = 'b') | (val = 'c' )).\x0a\x09].",
  14405. referencedClasses: [],
  14406. //>>excludeEnd("ide");
  14407. messageSends: ["timesRepeat:", "atRandom", "assert:", "|", "="]
  14408. }),
  14409. $globals.RandomTest);
  14410. $core.addMethod(
  14411. $core.method({
  14412. selector: "textNext",
  14413. protocol: "tests",
  14414. fn: function (){
  14415. var self=this,$self=this;
  14416. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14417. return $core.withContext(function($ctx1) {
  14418. //>>excludeEnd("ctx");
  14419. var $1;
  14420. (10000)._timesRepeat_((function(){
  14421. var current,next;
  14422. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14423. return $core.withContext(function($ctx2) {
  14424. //>>excludeEnd("ctx");
  14425. next=$recv($recv($globals.Random)._new())._next();
  14426. next;
  14427. $self._assert_($recv(next).__gt_eq((0)));
  14428. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14429. $ctx2.sendIdx["assert:"]=1;
  14430. //>>excludeEnd("ctx");
  14431. $self._assert_($recv(next).__lt((1)));
  14432. $1=$recv(current).__eq(next);
  14433. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14434. $ctx2.sendIdx["="]=1;
  14435. //>>excludeEnd("ctx");
  14436. $self._deny_($1);
  14437. return $recv(next).__eq(current);
  14438. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14439. }, function($ctx2) {$ctx2.fillBlock({current:current,next:next},$ctx1,1)});
  14440. //>>excludeEnd("ctx");
  14441. }));
  14442. return self;
  14443. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14444. }, function($ctx1) {$ctx1.fill(self,"textNext",{},$globals.RandomTest)});
  14445. //>>excludeEnd("ctx");
  14446. },
  14447. //>>excludeStart("ide", pragmas.excludeIdeData);
  14448. args: [],
  14449. source: "textNext\x0a\x0a\x0910000 timesRepeat: [\x0a\x09\x09\x09| current next |\x0a\x09\x09\x09next := Random new next.\x0a\x09\x09\x09self assert: (next >= 0).\x0a\x09\x09\x09self assert: (next < 1).\x0a\x09\x09\x09self deny: current = next.\x0a\x09\x09\x09next = current ]",
  14450. referencedClasses: ["Random"],
  14451. //>>excludeEnd("ide");
  14452. messageSends: ["timesRepeat:", "next", "new", "assert:", ">=", "<", "deny:", "="]
  14453. }),
  14454. $globals.RandomTest);
  14455. $core.addClass("StreamTest", $globals.TestCase, [], "Kernel-Tests");
  14456. $core.addMethod(
  14457. $core.method({
  14458. selector: "collectionClass",
  14459. protocol: "accessing",
  14460. fn: function (){
  14461. var self=this,$self=this;
  14462. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14463. return $core.withContext(function($ctx1) {
  14464. //>>excludeEnd("ctx");
  14465. return $recv($self._class())._collectionClass();
  14466. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14467. }, function($ctx1) {$ctx1.fill(self,"collectionClass",{},$globals.StreamTest)});
  14468. //>>excludeEnd("ctx");
  14469. },
  14470. //>>excludeStart("ide", pragmas.excludeIdeData);
  14471. args: [],
  14472. source: "collectionClass\x0a\x09^ self class collectionClass",
  14473. referencedClasses: [],
  14474. //>>excludeEnd("ide");
  14475. messageSends: ["collectionClass", "class"]
  14476. }),
  14477. $globals.StreamTest);
  14478. $core.addMethod(
  14479. $core.method({
  14480. selector: "newCollection",
  14481. protocol: "accessing",
  14482. fn: function (){
  14483. var self=this,$self=this;
  14484. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14485. return $core.withContext(function($ctx1) {
  14486. //>>excludeEnd("ctx");
  14487. return $recv($self._collectionClass())._new();
  14488. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14489. }, function($ctx1) {$ctx1.fill(self,"newCollection",{},$globals.StreamTest)});
  14490. //>>excludeEnd("ctx");
  14491. },
  14492. //>>excludeStart("ide", pragmas.excludeIdeData);
  14493. args: [],
  14494. source: "newCollection\x0a\x09^ self collectionClass new",
  14495. referencedClasses: [],
  14496. //>>excludeEnd("ide");
  14497. messageSends: ["new", "collectionClass"]
  14498. }),
  14499. $globals.StreamTest);
  14500. $core.addMethod(
  14501. $core.method({
  14502. selector: "newStream",
  14503. protocol: "accessing",
  14504. fn: function (){
  14505. var self=this,$self=this;
  14506. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14507. return $core.withContext(function($ctx1) {
  14508. //>>excludeEnd("ctx");
  14509. return $recv($recv($self._collectionClass())._new())._stream();
  14510. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14511. }, function($ctx1) {$ctx1.fill(self,"newStream",{},$globals.StreamTest)});
  14512. //>>excludeEnd("ctx");
  14513. },
  14514. //>>excludeStart("ide", pragmas.excludeIdeData);
  14515. args: [],
  14516. source: "newStream\x0a\x09^ self collectionClass new stream",
  14517. referencedClasses: [],
  14518. //>>excludeEnd("ide");
  14519. messageSends: ["stream", "new", "collectionClass"]
  14520. }),
  14521. $globals.StreamTest);
  14522. $core.addMethod(
  14523. $core.method({
  14524. selector: "testAtStartAtEnd",
  14525. protocol: "tests",
  14526. fn: function (){
  14527. var self=this,$self=this;
  14528. var stream;
  14529. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14530. return $core.withContext(function($ctx1) {
  14531. //>>excludeEnd("ctx");
  14532. var $1,$2,$3,$4;
  14533. stream=$self._newStream();
  14534. $1=$recv(stream)._atStart();
  14535. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14536. $ctx1.sendIdx["atStart"]=1;
  14537. //>>excludeEnd("ctx");
  14538. $self._assert_($1);
  14539. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14540. $ctx1.sendIdx["assert:"]=1;
  14541. //>>excludeEnd("ctx");
  14542. $2=$recv(stream)._atEnd();
  14543. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14544. $ctx1.sendIdx["atEnd"]=1;
  14545. //>>excludeEnd("ctx");
  14546. $self._assert_($2);
  14547. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14548. $ctx1.sendIdx["assert:"]=2;
  14549. //>>excludeEnd("ctx");
  14550. $recv(stream)._nextPutAll_($self._newCollection());
  14551. $3=$recv(stream)._atEnd();
  14552. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14553. $ctx1.sendIdx["atEnd"]=2;
  14554. //>>excludeEnd("ctx");
  14555. $self._assert_($3);
  14556. $4=$recv(stream)._atStart();
  14557. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14558. $ctx1.sendIdx["atStart"]=2;
  14559. //>>excludeEnd("ctx");
  14560. $self._deny_($4);
  14561. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14562. $ctx1.sendIdx["deny:"]=1;
  14563. //>>excludeEnd("ctx");
  14564. $recv(stream)._position_((1));
  14565. $self._deny_($recv(stream)._atEnd());
  14566. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14567. $ctx1.sendIdx["deny:"]=2;
  14568. //>>excludeEnd("ctx");
  14569. $self._deny_($recv(stream)._atStart());
  14570. return self;
  14571. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14572. }, function($ctx1) {$ctx1.fill(self,"testAtStartAtEnd",{stream:stream},$globals.StreamTest)});
  14573. //>>excludeEnd("ctx");
  14574. },
  14575. //>>excludeStart("ide", pragmas.excludeIdeData);
  14576. args: [],
  14577. source: "testAtStartAtEnd\x0a\x09| stream |\x0a\x09\x0a\x09stream := self newStream.\x0a\x09self assert: stream atStart.\x0a\x09self assert: stream atEnd.\x0a\x09\x0a\x09stream nextPutAll: self newCollection.\x0a\x09self assert: stream atEnd.\x0a\x09self deny: stream atStart.\x0a\x09\x0a\x09stream position: 1.\x0a\x09self deny: stream atEnd.\x0a\x09self deny: stream atStart",
  14578. referencedClasses: [],
  14579. //>>excludeEnd("ide");
  14580. messageSends: ["newStream", "assert:", "atStart", "atEnd", "nextPutAll:", "newCollection", "deny:", "position:"]
  14581. }),
  14582. $globals.StreamTest);
  14583. $core.addMethod(
  14584. $core.method({
  14585. selector: "testContents",
  14586. protocol: "tests",
  14587. fn: function (){
  14588. var self=this,$self=this;
  14589. var stream;
  14590. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14591. return $core.withContext(function($ctx1) {
  14592. //>>excludeEnd("ctx");
  14593. var $1,$2;
  14594. stream=$self._newStream();
  14595. $1=stream;
  14596. $2=$self._newCollection();
  14597. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14598. $ctx1.sendIdx["newCollection"]=1;
  14599. //>>excludeEnd("ctx");
  14600. $recv($1)._nextPutAll_($2);
  14601. $self._assert_equals_($recv(stream)._contents(),$self._newCollection());
  14602. return self;
  14603. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14604. }, function($ctx1) {$ctx1.fill(self,"testContents",{stream:stream},$globals.StreamTest)});
  14605. //>>excludeEnd("ctx");
  14606. },
  14607. //>>excludeStart("ide", pragmas.excludeIdeData);
  14608. args: [],
  14609. source: "testContents\x0a\x09| stream |\x0a\x09\x0a\x09stream := self newStream.\x0a\x09stream nextPutAll: self newCollection.\x0a\x09\x0a\x09self assert: stream contents equals: self newCollection",
  14610. referencedClasses: [],
  14611. //>>excludeEnd("ide");
  14612. messageSends: ["newStream", "nextPutAll:", "newCollection", "assert:equals:", "contents"]
  14613. }),
  14614. $globals.StreamTest);
  14615. $core.addMethod(
  14616. $core.method({
  14617. selector: "testIsEmpty",
  14618. protocol: "tests",
  14619. fn: function (){
  14620. var self=this,$self=this;
  14621. var stream;
  14622. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14623. return $core.withContext(function($ctx1) {
  14624. //>>excludeEnd("ctx");
  14625. var $1;
  14626. stream=$self._newStream();
  14627. $1=$recv(stream)._isEmpty();
  14628. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14629. $ctx1.sendIdx["isEmpty"]=1;
  14630. //>>excludeEnd("ctx");
  14631. $self._assert_($1);
  14632. $recv(stream)._nextPutAll_($self._newCollection());
  14633. $self._deny_($recv(stream)._isEmpty());
  14634. return self;
  14635. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14636. }, function($ctx1) {$ctx1.fill(self,"testIsEmpty",{stream:stream},$globals.StreamTest)});
  14637. //>>excludeEnd("ctx");
  14638. },
  14639. //>>excludeStart("ide", pragmas.excludeIdeData);
  14640. args: [],
  14641. source: "testIsEmpty\x0a\x09| stream |\x0a\x09\x0a\x09stream := self newStream.\x0a\x09self assert: stream isEmpty.\x0a\x09\x0a\x09stream nextPutAll: self newCollection.\x0a\x09self deny: stream isEmpty",
  14642. referencedClasses: [],
  14643. //>>excludeEnd("ide");
  14644. messageSends: ["newStream", "assert:", "isEmpty", "nextPutAll:", "newCollection", "deny:"]
  14645. }),
  14646. $globals.StreamTest);
  14647. $core.addMethod(
  14648. $core.method({
  14649. selector: "testPosition",
  14650. protocol: "tests",
  14651. fn: function (){
  14652. var self=this,$self=this;
  14653. var collection,stream;
  14654. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14655. return $core.withContext(function($ctx1) {
  14656. //>>excludeEnd("ctx");
  14657. var $1,$2,$3;
  14658. collection=$self._newCollection();
  14659. stream=$self._newStream();
  14660. $recv(stream)._nextPutAll_(collection);
  14661. $1=$recv(stream)._position();
  14662. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14663. $ctx1.sendIdx["position"]=1;
  14664. //>>excludeEnd("ctx");
  14665. $self._assert_equals_($1,$recv(collection)._size());
  14666. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14667. $ctx1.sendIdx["assert:equals:"]=1;
  14668. //>>excludeEnd("ctx");
  14669. $recv(stream)._position_((0));
  14670. $2=$recv(stream)._position();
  14671. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14672. $ctx1.sendIdx["position"]=2;
  14673. //>>excludeEnd("ctx");
  14674. $self._assert_equals_($2,(0));
  14675. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14676. $ctx1.sendIdx["assert:equals:"]=2;
  14677. //>>excludeEnd("ctx");
  14678. $recv(stream)._next();
  14679. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14680. $ctx1.sendIdx["next"]=1;
  14681. //>>excludeEnd("ctx");
  14682. $3=$recv(stream)._position();
  14683. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14684. $ctx1.sendIdx["position"]=3;
  14685. //>>excludeEnd("ctx");
  14686. $self._assert_equals_($3,(1));
  14687. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14688. $ctx1.sendIdx["assert:equals:"]=3;
  14689. //>>excludeEnd("ctx");
  14690. $recv(stream)._next();
  14691. $self._assert_equals_($recv(stream)._position(),(2));
  14692. return self;
  14693. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14694. }, function($ctx1) {$ctx1.fill(self,"testPosition",{collection:collection,stream:stream},$globals.StreamTest)});
  14695. //>>excludeEnd("ctx");
  14696. },
  14697. //>>excludeStart("ide", pragmas.excludeIdeData);
  14698. args: [],
  14699. source: "testPosition\x0a\x09| collection stream |\x0a\x09\x0a\x09collection := self newCollection.\x0a\x09stream := self newStream.\x0a\x09\x0a\x09stream nextPutAll: collection.\x0a\x09self assert: stream position equals: collection size.\x0a\x09\x0a\x09stream position: 0.\x0a\x09self assert: stream position equals: 0.\x0a\x09\x0a\x09stream next.\x0a\x09self assert: stream position equals: 1.\x0a\x09\x0a\x09stream next.\x0a\x09self assert: stream position equals: 2",
  14700. referencedClasses: [],
  14701. //>>excludeEnd("ide");
  14702. messageSends: ["newCollection", "newStream", "nextPutAll:", "assert:equals:", "position", "size", "position:", "next"]
  14703. }),
  14704. $globals.StreamTest);
  14705. $core.addMethod(
  14706. $core.method({
  14707. selector: "testReading",
  14708. protocol: "tests",
  14709. fn: function (){
  14710. var self=this,$self=this;
  14711. var stream,collection;
  14712. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14713. return $core.withContext(function($ctx1) {
  14714. //>>excludeEnd("ctx");
  14715. var $1,$2;
  14716. collection=$self._newCollection();
  14717. stream=$self._newStream();
  14718. $1=stream;
  14719. $recv($1)._nextPutAll_(collection);
  14720. $recv($1)._position_((0));
  14721. $recv(collection)._do_((function(each){
  14722. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14723. return $core.withContext(function($ctx2) {
  14724. //>>excludeEnd("ctx");
  14725. $2=$recv(stream)._next();
  14726. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14727. $ctx2.sendIdx["next"]=1;
  14728. //>>excludeEnd("ctx");
  14729. return $self._assert_equals_($2,each);
  14730. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14731. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  14732. //>>excludeEnd("ctx");
  14733. }));
  14734. $self._assert_($recv($recv(stream)._next())._isNil());
  14735. return self;
  14736. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14737. }, function($ctx1) {$ctx1.fill(self,"testReading",{stream:stream,collection:collection},$globals.StreamTest)});
  14738. //>>excludeEnd("ctx");
  14739. },
  14740. //>>excludeStart("ide", pragmas.excludeIdeData);
  14741. args: [],
  14742. source: "testReading\x0a\x09| stream collection |\x0a\x09\x0a\x09collection := self newCollection.\x0a\x09stream := self newStream.\x0a\x09\x0a\x09stream \x0a\x09\x09nextPutAll: collection;\x0a\x09\x09position: 0.\x0a\x09\x0a\x09collection do: [ :each |\x0a\x09\x09self assert: stream next equals: each ].\x0a\x09\x09\x0a\x09self assert: stream next isNil",
  14743. referencedClasses: [],
  14744. //>>excludeEnd("ide");
  14745. messageSends: ["newCollection", "newStream", "nextPutAll:", "position:", "do:", "assert:equals:", "next", "assert:", "isNil"]
  14746. }),
  14747. $globals.StreamTest);
  14748. $core.addMethod(
  14749. $core.method({
  14750. selector: "testStreamContents",
  14751. protocol: "tests",
  14752. fn: function (){
  14753. var self=this,$self=this;
  14754. return self;
  14755. },
  14756. //>>excludeStart("ide", pragmas.excludeIdeData);
  14757. args: [],
  14758. source: "testStreamContents",
  14759. referencedClasses: [],
  14760. //>>excludeEnd("ide");
  14761. messageSends: []
  14762. }),
  14763. $globals.StreamTest);
  14764. $core.addMethod(
  14765. $core.method({
  14766. selector: "testWrite",
  14767. protocol: "tests",
  14768. fn: function (){
  14769. var self=this,$self=this;
  14770. var stream,collection;
  14771. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14772. return $core.withContext(function($ctx1) {
  14773. //>>excludeEnd("ctx");
  14774. collection=$self._newCollection();
  14775. stream=$self._newStream();
  14776. $recv(collection)._do_((function(each){
  14777. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14778. return $core.withContext(function($ctx2) {
  14779. //>>excludeEnd("ctx");
  14780. return $recv(stream).__lt_lt(each);
  14781. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14782. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  14783. //>>excludeEnd("ctx");
  14784. }));
  14785. $self._assert_equals_($recv(stream)._contents(),collection);
  14786. return self;
  14787. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14788. }, function($ctx1) {$ctx1.fill(self,"testWrite",{stream:stream,collection:collection},$globals.StreamTest)});
  14789. //>>excludeEnd("ctx");
  14790. },
  14791. //>>excludeStart("ide", pragmas.excludeIdeData);
  14792. args: [],
  14793. source: "testWrite\x0a\x09| stream collection |\x0a\x09\x0a\x09collection := self newCollection.\x0a\x09stream := self newStream.\x0a\x09\x0a\x09collection do: [ :each | stream << each ].\x0a\x09self assert: stream contents equals: collection",
  14794. referencedClasses: [],
  14795. //>>excludeEnd("ide");
  14796. messageSends: ["newCollection", "newStream", "do:", "<<", "assert:equals:", "contents"]
  14797. }),
  14798. $globals.StreamTest);
  14799. $core.addMethod(
  14800. $core.method({
  14801. selector: "testWriting",
  14802. protocol: "tests",
  14803. fn: function (){
  14804. var self=this,$self=this;
  14805. var stream,collection;
  14806. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14807. return $core.withContext(function($ctx1) {
  14808. //>>excludeEnd("ctx");
  14809. var $1;
  14810. collection=$self._newCollection();
  14811. stream=$self._newStream();
  14812. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14813. $ctx1.sendIdx["newStream"]=1;
  14814. //>>excludeEnd("ctx");
  14815. $recv(collection)._do_((function(each){
  14816. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14817. return $core.withContext(function($ctx2) {
  14818. //>>excludeEnd("ctx");
  14819. return $recv(stream)._nextPut_(each);
  14820. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14821. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  14822. //>>excludeEnd("ctx");
  14823. }));
  14824. $1=$recv(stream)._contents();
  14825. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14826. $ctx1.sendIdx["contents"]=1;
  14827. //>>excludeEnd("ctx");
  14828. $self._assert_equals_($1,collection);
  14829. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14830. $ctx1.sendIdx["assert:equals:"]=1;
  14831. //>>excludeEnd("ctx");
  14832. stream=$self._newStream();
  14833. $recv(stream)._nextPutAll_(collection);
  14834. $self._assert_equals_($recv(stream)._contents(),collection);
  14835. return self;
  14836. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14837. }, function($ctx1) {$ctx1.fill(self,"testWriting",{stream:stream,collection:collection},$globals.StreamTest)});
  14838. //>>excludeEnd("ctx");
  14839. },
  14840. //>>excludeStart("ide", pragmas.excludeIdeData);
  14841. args: [],
  14842. source: "testWriting\x0a\x09| stream collection |\x0a\x09\x0a\x09collection := self newCollection.\x0a\x09stream := self newStream.\x0a\x09\x0a\x09collection do: [ :each | stream nextPut: each ].\x0a\x09self assert: stream contents equals: collection.\x0a\x09\x0a\x09stream := self newStream.\x0a\x09stream nextPutAll: collection.\x0a\x09self assert: stream contents equals: collection",
  14843. referencedClasses: [],
  14844. //>>excludeEnd("ide");
  14845. messageSends: ["newCollection", "newStream", "do:", "nextPut:", "assert:equals:", "contents", "nextPutAll:"]
  14846. }),
  14847. $globals.StreamTest);
  14848. $core.addMethod(
  14849. $core.method({
  14850. selector: "collectionClass",
  14851. protocol: "accessing",
  14852. fn: function (){
  14853. var self=this,$self=this;
  14854. return nil;
  14855. },
  14856. //>>excludeStart("ide", pragmas.excludeIdeData);
  14857. args: [],
  14858. source: "collectionClass\x0a\x09^ nil",
  14859. referencedClasses: [],
  14860. //>>excludeEnd("ide");
  14861. messageSends: []
  14862. }),
  14863. $globals.StreamTest.a$cls);
  14864. $core.addMethod(
  14865. $core.method({
  14866. selector: "isAbstract",
  14867. protocol: "testing",
  14868. fn: function (){
  14869. var self=this,$self=this;
  14870. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14871. return $core.withContext(function($ctx1) {
  14872. //>>excludeEnd("ctx");
  14873. return $recv($self._collectionClass())._isNil();
  14874. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14875. }, function($ctx1) {$ctx1.fill(self,"isAbstract",{},$globals.StreamTest.a$cls)});
  14876. //>>excludeEnd("ctx");
  14877. },
  14878. //>>excludeStart("ide", pragmas.excludeIdeData);
  14879. args: [],
  14880. source: "isAbstract\x0a\x09^ self collectionClass isNil",
  14881. referencedClasses: [],
  14882. //>>excludeEnd("ide");
  14883. messageSends: ["isNil", "collectionClass"]
  14884. }),
  14885. $globals.StreamTest.a$cls);
  14886. $core.addClass("ArrayStreamTest", $globals.StreamTest, [], "Kernel-Tests");
  14887. $core.addMethod(
  14888. $core.method({
  14889. selector: "newCollection",
  14890. protocol: "accessing",
  14891. fn: function (){
  14892. var self=this,$self=this;
  14893. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14894. return $core.withContext(function($ctx1) {
  14895. //>>excludeEnd("ctx");
  14896. return [true,(1),(3).__at((4)),"foo"];
  14897. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14898. }, function($ctx1) {$ctx1.fill(self,"newCollection",{},$globals.ArrayStreamTest)});
  14899. //>>excludeEnd("ctx");
  14900. },
  14901. //>>excludeStart("ide", pragmas.excludeIdeData);
  14902. args: [],
  14903. source: "newCollection\x0a\x09^ { true. 1. 3@4. 'foo' }",
  14904. referencedClasses: [],
  14905. //>>excludeEnd("ide");
  14906. messageSends: ["@"]
  14907. }),
  14908. $globals.ArrayStreamTest);
  14909. $core.addMethod(
  14910. $core.method({
  14911. selector: "collectionClass",
  14912. protocol: "accessing",
  14913. fn: function (){
  14914. var self=this,$self=this;
  14915. return $globals.Array;
  14916. },
  14917. //>>excludeStart("ide", pragmas.excludeIdeData);
  14918. args: [],
  14919. source: "collectionClass\x0a\x09^ Array",
  14920. referencedClasses: ["Array"],
  14921. //>>excludeEnd("ide");
  14922. messageSends: []
  14923. }),
  14924. $globals.ArrayStreamTest.a$cls);
  14925. $core.addClass("StringStreamTest", $globals.StreamTest, [], "Kernel-Tests");
  14926. $core.addMethod(
  14927. $core.method({
  14928. selector: "newCollection",
  14929. protocol: "accessing",
  14930. fn: function (){
  14931. var self=this,$self=this;
  14932. return "hello world";
  14933. },
  14934. //>>excludeStart("ide", pragmas.excludeIdeData);
  14935. args: [],
  14936. source: "newCollection\x0a\x09^ 'hello world'",
  14937. referencedClasses: [],
  14938. //>>excludeEnd("ide");
  14939. messageSends: []
  14940. }),
  14941. $globals.StringStreamTest);
  14942. $core.addMethod(
  14943. $core.method({
  14944. selector: "collectionClass",
  14945. protocol: "accessing",
  14946. fn: function (){
  14947. var self=this,$self=this;
  14948. return $globals.String;
  14949. },
  14950. //>>excludeStart("ide", pragmas.excludeIdeData);
  14951. args: [],
  14952. source: "collectionClass\x0a\x09^ String",
  14953. referencedClasses: ["String"],
  14954. //>>excludeEnd("ide");
  14955. messageSends: []
  14956. }),
  14957. $globals.StringStreamTest.a$cls);
  14958. $core.addClass("UndefinedTest", $globals.TestCase, [], "Kernel-Tests");
  14959. $core.addMethod(
  14960. $core.method({
  14961. selector: "testCopying",
  14962. protocol: "tests",
  14963. fn: function (){
  14964. var self=this,$self=this;
  14965. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14966. return $core.withContext(function($ctx1) {
  14967. //>>excludeEnd("ctx");
  14968. $self._assert_equals_(nil._copy(),nil);
  14969. return self;
  14970. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14971. }, function($ctx1) {$ctx1.fill(self,"testCopying",{},$globals.UndefinedTest)});
  14972. //>>excludeEnd("ctx");
  14973. },
  14974. //>>excludeStart("ide", pragmas.excludeIdeData);
  14975. args: [],
  14976. source: "testCopying\x0a\x09self assert: nil copy equals: nil",
  14977. referencedClasses: [],
  14978. //>>excludeEnd("ide");
  14979. messageSends: ["assert:equals:", "copy"]
  14980. }),
  14981. $globals.UndefinedTest);
  14982. $core.addMethod(
  14983. $core.method({
  14984. selector: "testDeepCopy",
  14985. protocol: "tests",
  14986. fn: function (){
  14987. var self=this,$self=this;
  14988. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14989. return $core.withContext(function($ctx1) {
  14990. //>>excludeEnd("ctx");
  14991. $self._assert_($recv(nil._deepCopy()).__eq(nil));
  14992. return self;
  14993. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14994. }, function($ctx1) {$ctx1.fill(self,"testDeepCopy",{},$globals.UndefinedTest)});
  14995. //>>excludeEnd("ctx");
  14996. },
  14997. //>>excludeStart("ide", pragmas.excludeIdeData);
  14998. args: [],
  14999. source: "testDeepCopy\x0a\x09self assert: nil deepCopy = nil",
  15000. referencedClasses: [],
  15001. //>>excludeEnd("ide");
  15002. messageSends: ["assert:", "=", "deepCopy"]
  15003. }),
  15004. $globals.UndefinedTest);
  15005. $core.addMethod(
  15006. $core.method({
  15007. selector: "testIfNil",
  15008. protocol: "tests",
  15009. fn: function (){
  15010. var self=this,$self=this;
  15011. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  15012. return $core.withContext(function($ctx1) {
  15013. //>>excludeEnd("ctx");
  15014. var $1,$3,$2,$4,$6,$5,$receiver;
  15015. if(($receiver = nil) == null || $receiver.a$nil){
  15016. $1=true;
  15017. } else {
  15018. $1=nil;
  15019. }
  15020. $self._assert_equals_($1,true);
  15021. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  15022. $ctx1.sendIdx["assert:equals:"]=1;
  15023. //>>excludeEnd("ctx");
  15024. if(($receiver = nil) == null || $receiver.a$nil){
  15025. $3=nil;
  15026. } else {
  15027. $3=true;
  15028. }
  15029. $2=$recv($3).__eq(true);
  15030. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  15031. $ctx1.sendIdx["="]=1;
  15032. //>>excludeEnd("ctx");
  15033. $self._deny_($2);
  15034. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  15035. $ctx1.sendIdx["deny:"]=1;
  15036. //>>excludeEnd("ctx");
  15037. if(($receiver = nil) == null || $receiver.a$nil){
  15038. $4=true;
  15039. } else {
  15040. $4=false;
  15041. }
  15042. $self._assert_equals_($4,true);
  15043. if(($receiver = nil) == null || $receiver.a$nil){
  15044. $6=false;
  15045. } else {
  15046. $6=true;
  15047. }
  15048. $5=$recv($6).__eq(true);
  15049. $self._deny_($5);
  15050. return self;
  15051. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  15052. }, function($ctx1) {$ctx1.fill(self,"testIfNil",{},$globals.UndefinedTest)});
  15053. //>>excludeEnd("ctx");
  15054. },
  15055. //>>excludeStart("ide", pragmas.excludeIdeData);
  15056. args: [],
  15057. source: "testIfNil\x0a\x09self assert: (nil ifNil: [ true ]) equals: true.\x0a\x09self deny: (nil ifNotNil: [ true ]) = true.\x0a\x09self assert: (nil ifNil: [ true ] ifNotNil: [ false ]) equals: true.\x0a\x09self deny: (nil ifNotNil: [ true ] ifNil: [ false ]) = true",
  15058. referencedClasses: [],
  15059. //>>excludeEnd("ide");
  15060. messageSends: ["assert:equals:", "ifNil:", "deny:", "=", "ifNotNil:", "ifNil:ifNotNil:", "ifNotNil:ifNil:"]
  15061. }),
  15062. $globals.UndefinedTest);
  15063. $core.addMethod(
  15064. $core.method({
  15065. selector: "testIsNil",
  15066. protocol: "tests",
  15067. fn: function (){
  15068. var self=this,$self=this;
  15069. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  15070. return $core.withContext(function($ctx1) {
  15071. //>>excludeEnd("ctx");
  15072. $self._assert_(nil._isNil());
  15073. $self._deny_(nil._notNil());
  15074. return self;
  15075. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  15076. }, function($ctx1) {$ctx1.fill(self,"testIsNil",{},$globals.UndefinedTest)});
  15077. //>>excludeEnd("ctx");
  15078. },
  15079. //>>excludeStart("ide", pragmas.excludeIdeData);
  15080. args: [],
  15081. source: "testIsNil\x0a\x09self assert: nil isNil.\x0a\x09self deny: nil notNil.",
  15082. referencedClasses: [],
  15083. //>>excludeEnd("ide");
  15084. messageSends: ["assert:", "isNil", "deny:", "notNil"]
  15085. }),
  15086. $globals.UndefinedTest);
  15087. });