Kernel-Tests.js 541 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558
  1. define("amber_core/Kernel-Tests", ["amber/boot", "amber_core/SUnit", "amber_core/Kernel-Objects"], function($boot){"use strict";
  2. var $core=$boot.api,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
  3. $core.addPackage('Kernel-Tests');
  4. $core.packages["Kernel-Tests"].innerEval = function (expr) { return eval(expr); };
  5. $core.packages["Kernel-Tests"].transport = {"type":"amd","amdNamespace":"amber_core"};
  6. $core.addClass('AnnouncementSubscriptionTest', $globals.TestCase, [], 'Kernel-Tests');
  7. $core.addMethod(
  8. $core.method({
  9. selector: "testAddExtensionMethod",
  10. protocol: 'tests',
  11. fn: function (){
  12. var self=this;
  13. var method,dirty;
  14. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  15. return $core.withContext(function($ctx1) {
  16. //>>excludeEnd("ctx");
  17. var $2,$1,$4,$3,$5,$8,$7,$6,$9,$10;
  18. $2=self._class();
  19. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  20. $ctx1.sendIdx["class"]=1;
  21. //>>excludeEnd("ctx");
  22. $1=$recv($2)._package();
  23. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  24. $ctx1.sendIdx["package"]=1;
  25. //>>excludeEnd("ctx");
  26. dirty=$recv($1)._isDirty();
  27. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  28. $ctx1.sendIdx["isDirty"]=1;
  29. //>>excludeEnd("ctx");
  30. $4=self._class();
  31. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  32. $ctx1.sendIdx["class"]=2;
  33. //>>excludeEnd("ctx");
  34. $3=$recv($4)._package();
  35. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  36. $ctx1.sendIdx["package"]=2;
  37. //>>excludeEnd("ctx");
  38. $recv($3)._beClean();
  39. $5=self._class();
  40. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  41. $ctx1.sendIdx["class"]=3;
  42. //>>excludeEnd("ctx");
  43. method=$recv($5)._compile_protocol_("doNothing","**not-a-package");
  44. $8=self._class();
  45. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  46. $ctx1.sendIdx["class"]=4;
  47. //>>excludeEnd("ctx");
  48. $7=$recv($8)._package();
  49. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  50. $ctx1.sendIdx["package"]=3;
  51. //>>excludeEnd("ctx");
  52. $6=$recv($7)._isDirty();
  53. self._deny_($6);
  54. $9=self._class();
  55. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  56. $ctx1.sendIdx["class"]=5;
  57. //>>excludeEnd("ctx");
  58. $recv($9)._removeCompiledMethod_(method);
  59. $10=dirty;
  60. if($core.assert($10)){
  61. $recv($recv(self._class())._package())._beDirty();
  62. };
  63. return self;
  64. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  65. }, function($ctx1) {$ctx1.fill(self,"testAddExtensionMethod",{method:method,dirty:dirty},$globals.AnnouncementSubscriptionTest)});
  66. //>>excludeEnd("ctx");
  67. },
  68. //>>excludeStart("ide", pragmas.excludeIdeData);
  69. args: [],
  70. 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 ]",
  71. referencedClasses: [],
  72. //>>excludeEnd("ide");
  73. messageSends: ["isDirty", "package", "class", "beClean", "compile:protocol:", "deny:", "removeCompiledMethod:", "ifTrue:", "beDirty"]
  74. }),
  75. $globals.AnnouncementSubscriptionTest);
  76. $core.addMethod(
  77. $core.method({
  78. selector: "testHandlesAnnouncement",
  79. protocol: 'tests',
  80. fn: function (){
  81. var self=this;
  82. var subscription,announcementClass1,announcementClass2,classBuilder;
  83. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  84. return $core.withContext(function($ctx1) {
  85. //>>excludeEnd("ctx");
  86. var $1,$2;
  87. classBuilder=$recv($globals.ClassBuilder)._new();
  88. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  89. $ctx1.sendIdx["new"]=1;
  90. //>>excludeEnd("ctx");
  91. announcementClass1=$recv(classBuilder)._basicAddSubclassOf_named_instanceVariableNames_package_($globals.SystemAnnouncement,"TestAnnouncement1",[],"Kernel-Tests");
  92. subscription=$recv($recv($globals.AnnouncementSubscription)._new())._announcementClass_($globals.SystemAnnouncement);
  93. $1=$recv(subscription)._handlesAnnouncement_($globals.SystemAnnouncement);
  94. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  95. $ctx1.sendIdx["handlesAnnouncement:"]=1;
  96. //>>excludeEnd("ctx");
  97. self._assert_equals_($1,true);
  98. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  99. $ctx1.sendIdx["assert:equals:"]=1;
  100. //>>excludeEnd("ctx");
  101. $2=$recv(subscription)._handlesAnnouncement_(announcementClass1);
  102. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  103. $ctx1.sendIdx["handlesAnnouncement:"]=2;
  104. //>>excludeEnd("ctx");
  105. self._assert_equals_($2,true);
  106. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  107. $ctx1.sendIdx["assert:equals:"]=2;
  108. //>>excludeEnd("ctx");
  109. self._assert_equals_($recv(subscription)._handlesAnnouncement_($globals.Object),false);
  110. $recv(classBuilder)._basicRemoveClass_(announcementClass1);
  111. return self;
  112. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  113. }, function($ctx1) {$ctx1.fill(self,"testHandlesAnnouncement",{subscription:subscription,announcementClass1:announcementClass1,announcementClass2:announcementClass2,classBuilder:classBuilder},$globals.AnnouncementSubscriptionTest)});
  114. //>>excludeEnd("ctx");
  115. },
  116. //>>excludeStart("ide", pragmas.excludeIdeData);
  117. args: [],
  118. 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.",
  119. referencedClasses: ["ClassBuilder", "SystemAnnouncement", "AnnouncementSubscription", "Object"],
  120. //>>excludeEnd("ide");
  121. messageSends: ["new", "basicAddSubclassOf:named:instanceVariableNames:package:", "announcementClass:", "assert:equals:", "handlesAnnouncement:", "basicRemoveClass:"]
  122. }),
  123. $globals.AnnouncementSubscriptionTest);
  124. $core.addClass('AnnouncerTest', $globals.TestCase, [], 'Kernel-Tests');
  125. $core.addMethod(
  126. $core.method({
  127. selector: "testOnDo",
  128. protocol: 'tests',
  129. fn: function (){
  130. var self=this;
  131. var counter,announcer;
  132. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  133. return $core.withContext(function($ctx1) {
  134. //>>excludeEnd("ctx");
  135. var $1,$2;
  136. counter=(0);
  137. announcer=$recv($globals.Announcer)._new();
  138. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  139. $ctx1.sendIdx["new"]=1;
  140. //>>excludeEnd("ctx");
  141. $recv(announcer)._on_do_($globals.SystemAnnouncement,(function(){
  142. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  143. return $core.withContext(function($ctx2) {
  144. //>>excludeEnd("ctx");
  145. counter=$recv(counter).__plus((1));
  146. return counter;
  147. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  148. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  149. //>>excludeEnd("ctx");
  150. }));
  151. $1=announcer;
  152. $2=$recv($globals.SystemAnnouncement)._new();
  153. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  154. $ctx1.sendIdx["new"]=2;
  155. //>>excludeEnd("ctx");
  156. $recv($1)._announce_($2);
  157. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  158. $ctx1.sendIdx["announce:"]=1;
  159. //>>excludeEnd("ctx");
  160. self._assert_equals_(counter,(1));
  161. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  162. $ctx1.sendIdx["assert:equals:"]=1;
  163. //>>excludeEnd("ctx");
  164. $recv(announcer)._announce_($recv($globals.SystemAnnouncement)._new());
  165. self._assert_equals_(counter,(2));
  166. return self;
  167. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  168. }, function($ctx1) {$ctx1.fill(self,"testOnDo",{counter:counter,announcer:announcer},$globals.AnnouncerTest)});
  169. //>>excludeEnd("ctx");
  170. },
  171. //>>excludeStart("ide", pragmas.excludeIdeData);
  172. args: [],
  173. 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.",
  174. referencedClasses: ["Announcer", "SystemAnnouncement"],
  175. //>>excludeEnd("ide");
  176. messageSends: ["new", "on:do:", "+", "announce:", "assert:equals:"]
  177. }),
  178. $globals.AnnouncerTest);
  179. $core.addMethod(
  180. $core.method({
  181. selector: "testOnDoFor",
  182. protocol: 'tests',
  183. fn: function (){
  184. var self=this;
  185. var counter,announcer;
  186. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  187. return $core.withContext(function($ctx1) {
  188. //>>excludeEnd("ctx");
  189. var $1,$2,$3,$4;
  190. counter=(0);
  191. announcer=$recv($globals.Announcer)._new();
  192. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  193. $ctx1.sendIdx["new"]=1;
  194. //>>excludeEnd("ctx");
  195. $recv(announcer)._on_do_for_($globals.SystemAnnouncement,(function(){
  196. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  197. return $core.withContext(function($ctx2) {
  198. //>>excludeEnd("ctx");
  199. counter=$recv(counter).__plus((1));
  200. return counter;
  201. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  202. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  203. //>>excludeEnd("ctx");
  204. }),self);
  205. $1=announcer;
  206. $2=$recv($globals.SystemAnnouncement)._new();
  207. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  208. $ctx1.sendIdx["new"]=2;
  209. //>>excludeEnd("ctx");
  210. $recv($1)._announce_($2);
  211. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  212. $ctx1.sendIdx["announce:"]=1;
  213. //>>excludeEnd("ctx");
  214. self._assert_equals_(counter,(1));
  215. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  216. $ctx1.sendIdx["assert:equals:"]=1;
  217. //>>excludeEnd("ctx");
  218. $3=announcer;
  219. $4=$recv($globals.SystemAnnouncement)._new();
  220. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  221. $ctx1.sendIdx["new"]=3;
  222. //>>excludeEnd("ctx");
  223. $recv($3)._announce_($4);
  224. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  225. $ctx1.sendIdx["announce:"]=2;
  226. //>>excludeEnd("ctx");
  227. self._assert_equals_(counter,(2));
  228. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  229. $ctx1.sendIdx["assert:equals:"]=2;
  230. //>>excludeEnd("ctx");
  231. $recv(announcer)._unsubscribe_(self);
  232. $recv(announcer)._announce_($recv($globals.SystemAnnouncement)._new());
  233. self._assert_equals_(counter,(2));
  234. return self;
  235. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  236. }, function($ctx1) {$ctx1.fill(self,"testOnDoFor",{counter:counter,announcer:announcer},$globals.AnnouncerTest)});
  237. //>>excludeEnd("ctx");
  238. },
  239. //>>excludeStart("ide", pragmas.excludeIdeData);
  240. args: [],
  241. 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.",
  242. referencedClasses: ["Announcer", "SystemAnnouncement"],
  243. //>>excludeEnd("ide");
  244. messageSends: ["new", "on:do:for:", "+", "announce:", "assert:equals:", "unsubscribe:"]
  245. }),
  246. $globals.AnnouncerTest);
  247. $core.addMethod(
  248. $core.method({
  249. selector: "testOnDoOnce",
  250. protocol: 'tests',
  251. fn: function (){
  252. var self=this;
  253. var counter,announcer;
  254. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  255. return $core.withContext(function($ctx1) {
  256. //>>excludeEnd("ctx");
  257. var $1,$2;
  258. counter=(0);
  259. announcer=$recv($globals.Announcer)._new();
  260. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  261. $ctx1.sendIdx["new"]=1;
  262. //>>excludeEnd("ctx");
  263. $recv(announcer)._on_doOnce_($globals.SystemAnnouncement,(function(){
  264. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  265. return $core.withContext(function($ctx2) {
  266. //>>excludeEnd("ctx");
  267. counter=$recv(counter).__plus((1));
  268. return counter;
  269. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  270. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  271. //>>excludeEnd("ctx");
  272. }));
  273. $1=announcer;
  274. $2=$recv($globals.SystemAnnouncement)._new();
  275. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  276. $ctx1.sendIdx["new"]=2;
  277. //>>excludeEnd("ctx");
  278. $recv($1)._announce_($2);
  279. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  280. $ctx1.sendIdx["announce:"]=1;
  281. //>>excludeEnd("ctx");
  282. self._assert_equals_(counter,(1));
  283. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  284. $ctx1.sendIdx["assert:equals:"]=1;
  285. //>>excludeEnd("ctx");
  286. $recv(announcer)._announce_($recv($globals.SystemAnnouncement)._new());
  287. self._assert_equals_(counter,(1));
  288. return self;
  289. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  290. }, function($ctx1) {$ctx1.fill(self,"testOnDoOnce",{counter:counter,announcer:announcer},$globals.AnnouncerTest)});
  291. //>>excludeEnd("ctx");
  292. },
  293. //>>excludeStart("ide", pragmas.excludeIdeData);
  294. args: [],
  295. 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.",
  296. referencedClasses: ["Announcer", "SystemAnnouncement"],
  297. //>>excludeEnd("ide");
  298. messageSends: ["new", "on:doOnce:", "+", "announce:", "assert:equals:"]
  299. }),
  300. $globals.AnnouncerTest);
  301. $core.addClass('BlockClosureTest', $globals.TestCase, [], 'Kernel-Tests');
  302. $core.addMethod(
  303. $core.method({
  304. selector: "localReturnOnDoCatch",
  305. protocol: 'fixture',
  306. fn: function (){
  307. var self=this;
  308. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  309. return $core.withContext(function($ctx1) {
  310. //>>excludeEnd("ctx");
  311. var $early={};
  312. try {
  313. $recv((function(){
  314. throw $early=[(2)];
  315. }))._on_do_($globals.Error,(function(){
  316. }));
  317. return (3);
  318. }
  319. catch(e) {if(e===$early)return e[0]; throw e}
  320. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  321. }, function($ctx1) {$ctx1.fill(self,"localReturnOnDoCatch",{},$globals.BlockClosureTest)});
  322. //>>excludeEnd("ctx");
  323. },
  324. //>>excludeStart("ide", pragmas.excludeIdeData);
  325. args: [],
  326. source: "localReturnOnDoCatch\x0a [ ^ 2 ] on: Error do: [].\x0a ^ 3",
  327. referencedClasses: ["Error"],
  328. //>>excludeEnd("ide");
  329. messageSends: ["on:do:"]
  330. }),
  331. $globals.BlockClosureTest);
  332. $core.addMethod(
  333. $core.method({
  334. selector: "localReturnOnDoMiss",
  335. protocol: 'fixture',
  336. fn: function (){
  337. var self=this;
  338. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  339. return $core.withContext(function($ctx1) {
  340. //>>excludeEnd("ctx");
  341. var $early={};
  342. try {
  343. $recv((function(){
  344. throw $early=[(2)];
  345. }))._on_do_($globals.Class,(function(){
  346. }));
  347. return (3);
  348. }
  349. catch(e) {if(e===$early)return e[0]; throw e}
  350. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  351. }, function($ctx1) {$ctx1.fill(self,"localReturnOnDoMiss",{},$globals.BlockClosureTest)});
  352. //>>excludeEnd("ctx");
  353. },
  354. //>>excludeStart("ide", pragmas.excludeIdeData);
  355. args: [],
  356. source: "localReturnOnDoMiss\x0a [ ^ 2 ] on: Class do: [].\x0a ^ 3",
  357. referencedClasses: ["Class"],
  358. //>>excludeEnd("ide");
  359. messageSends: ["on:do:"]
  360. }),
  361. $globals.BlockClosureTest);
  362. $core.addMethod(
  363. $core.method({
  364. selector: "testCanClearInterval",
  365. protocol: 'tests',
  366. fn: function (){
  367. var self=this;
  368. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  369. return $core.withContext(function($ctx1) {
  370. //>>excludeEnd("ctx");
  371. self._shouldnt_raise_((function(){
  372. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  373. return $core.withContext(function($ctx2) {
  374. //>>excludeEnd("ctx");
  375. return $recv($recv((function(){
  376. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  377. return $core.withContext(function($ctx3) {
  378. //>>excludeEnd("ctx");
  379. return $recv($recv($globals.Error)._new())._signal();
  380. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  381. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  382. //>>excludeEnd("ctx");
  383. }))._valueWithInterval_((0)))._clearInterval();
  384. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  385. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  386. //>>excludeEnd("ctx");
  387. }),$globals.Error);
  388. return self;
  389. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  390. }, function($ctx1) {$ctx1.fill(self,"testCanClearInterval",{},$globals.BlockClosureTest)});
  391. //>>excludeEnd("ctx");
  392. },
  393. //>>excludeStart("ide", pragmas.excludeIdeData);
  394. args: [],
  395. source: "testCanClearInterval\x0a\x09self shouldnt: [ ([ Error new signal ] valueWithInterval: 0) clearInterval ] raise: Error",
  396. referencedClasses: ["Error"],
  397. //>>excludeEnd("ide");
  398. messageSends: ["shouldnt:raise:", "clearInterval", "valueWithInterval:", "signal", "new"]
  399. }),
  400. $globals.BlockClosureTest);
  401. $core.addMethod(
  402. $core.method({
  403. selector: "testCanClearTimeout",
  404. protocol: 'tests',
  405. fn: function (){
  406. var self=this;
  407. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  408. return $core.withContext(function($ctx1) {
  409. //>>excludeEnd("ctx");
  410. self._shouldnt_raise_((function(){
  411. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  412. return $core.withContext(function($ctx2) {
  413. //>>excludeEnd("ctx");
  414. return $recv($recv((function(){
  415. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  416. return $core.withContext(function($ctx3) {
  417. //>>excludeEnd("ctx");
  418. return $recv($recv($globals.Error)._new())._signal();
  419. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  420. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  421. //>>excludeEnd("ctx");
  422. }))._valueWithTimeout_((0)))._clearTimeout();
  423. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  424. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  425. //>>excludeEnd("ctx");
  426. }),$globals.Error);
  427. return self;
  428. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  429. }, function($ctx1) {$ctx1.fill(self,"testCanClearTimeout",{},$globals.BlockClosureTest)});
  430. //>>excludeEnd("ctx");
  431. },
  432. //>>excludeStart("ide", pragmas.excludeIdeData);
  433. args: [],
  434. source: "testCanClearTimeout\x0a\x09self shouldnt: [ ([ Error new signal ] valueWithTimeout: 0) clearTimeout ] raise: Error",
  435. referencedClasses: ["Error"],
  436. //>>excludeEnd("ide");
  437. messageSends: ["shouldnt:raise:", "clearTimeout", "valueWithTimeout:", "signal", "new"]
  438. }),
  439. $globals.BlockClosureTest);
  440. $core.addMethod(
  441. $core.method({
  442. selector: "testCompiledSource",
  443. protocol: 'tests',
  444. fn: function (){
  445. var self=this;
  446. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  447. return $core.withContext(function($ctx1) {
  448. //>>excludeEnd("ctx");
  449. self._assert_($recv($recv((function(){
  450. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  451. return $core.withContext(function($ctx2) {
  452. //>>excludeEnd("ctx");
  453. return (1).__plus((1));
  454. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  455. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  456. //>>excludeEnd("ctx");
  457. }))._compiledSource())._includesSubString_("function"));
  458. return self;
  459. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  460. }, function($ctx1) {$ctx1.fill(self,"testCompiledSource",{},$globals.BlockClosureTest)});
  461. //>>excludeEnd("ctx");
  462. },
  463. //>>excludeStart("ide", pragmas.excludeIdeData);
  464. args: [],
  465. source: "testCompiledSource\x0a\x09self assert: ([ 1+1 ] compiledSource includesSubString: 'function')",
  466. referencedClasses: [],
  467. //>>excludeEnd("ide");
  468. messageSends: ["assert:", "includesSubString:", "compiledSource", "+"]
  469. }),
  470. $globals.BlockClosureTest);
  471. $core.addMethod(
  472. $core.method({
  473. selector: "testCurrySelf",
  474. protocol: 'tests',
  475. fn: function (){
  476. var self=this;
  477. var curriedMethod,array;
  478. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  479. return $core.withContext(function($ctx1) {
  480. //>>excludeEnd("ctx");
  481. curriedMethod=$recv($recv((function(selfarg,x){
  482. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  483. return $core.withContext(function($ctx2) {
  484. //>>excludeEnd("ctx");
  485. return $recv(selfarg)._at_(x);
  486. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  487. }, function($ctx2) {$ctx2.fillBlock({selfarg:selfarg,x:x},$ctx1,1)});
  488. //>>excludeEnd("ctx");
  489. }))._currySelf())._asCompiledMethod_("foo:");
  490. array=[(3), (1), (4)];
  491. $recv($recv($globals.ClassBuilder)._new())._installMethod_forClass_protocol_(curriedMethod,$globals.Array,"**test helper");
  492. $recv((function(){
  493. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  494. return $core.withContext(function($ctx2) {
  495. //>>excludeEnd("ctx");
  496. return self._assert_equals_($recv(array)._foo_((2)),(1));
  497. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  498. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  499. //>>excludeEnd("ctx");
  500. }))._ensure_((function(){
  501. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  502. return $core.withContext(function($ctx2) {
  503. //>>excludeEnd("ctx");
  504. return $recv($globals.Array)._removeCompiledMethod_(curriedMethod);
  505. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  506. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  507. //>>excludeEnd("ctx");
  508. }));
  509. return self;
  510. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  511. }, function($ctx1) {$ctx1.fill(self,"testCurrySelf",{curriedMethod:curriedMethod,array:array},$globals.BlockClosureTest)});
  512. //>>excludeEnd("ctx");
  513. },
  514. //>>excludeStart("ide", pragmas.excludeIdeData);
  515. args: [],
  516. 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 ]",
  517. referencedClasses: ["ClassBuilder", "Array"],
  518. //>>excludeEnd("ide");
  519. messageSends: ["asCompiledMethod:", "currySelf", "at:", "installMethod:forClass:protocol:", "new", "ensure:", "assert:equals:", "foo:", "removeCompiledMethod:"]
  520. }),
  521. $globals.BlockClosureTest);
  522. $core.addMethod(
  523. $core.method({
  524. selector: "testEnsure",
  525. protocol: 'tests',
  526. fn: function (){
  527. var self=this;
  528. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  529. return $core.withContext(function($ctx1) {
  530. //>>excludeEnd("ctx");
  531. self._assert_equals_($recv((function(){
  532. return (3);
  533. }))._ensure_((function(){
  534. return (4);
  535. })),(3));
  536. return self;
  537. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  538. }, function($ctx1) {$ctx1.fill(self,"testEnsure",{},$globals.BlockClosureTest)});
  539. //>>excludeEnd("ctx");
  540. },
  541. //>>excludeStart("ide", pragmas.excludeIdeData);
  542. args: [],
  543. source: "testEnsure\x0a\x09self assert: ([ 3 ] ensure: [ 4 ]) equals: 3",
  544. referencedClasses: [],
  545. //>>excludeEnd("ide");
  546. messageSends: ["assert:equals:", "ensure:"]
  547. }),
  548. $globals.BlockClosureTest);
  549. $core.addMethod(
  550. $core.method({
  551. selector: "testEnsureRaises",
  552. protocol: 'tests',
  553. fn: function (){
  554. var self=this;
  555. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  556. return $core.withContext(function($ctx1) {
  557. //>>excludeEnd("ctx");
  558. self._should_raise_((function(){
  559. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  560. return $core.withContext(function($ctx2) {
  561. //>>excludeEnd("ctx");
  562. return $recv((function(){
  563. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  564. return $core.withContext(function($ctx3) {
  565. //>>excludeEnd("ctx");
  566. return $recv($recv($globals.Error)._new())._signal();
  567. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  568. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  569. //>>excludeEnd("ctx");
  570. }))._ensure_((function(){
  571. return true;
  572. }));
  573. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  574. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  575. //>>excludeEnd("ctx");
  576. }),$globals.Error);
  577. return self;
  578. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  579. }, function($ctx1) {$ctx1.fill(self,"testEnsureRaises",{},$globals.BlockClosureTest)});
  580. //>>excludeEnd("ctx");
  581. },
  582. //>>excludeStart("ide", pragmas.excludeIdeData);
  583. args: [],
  584. source: "testEnsureRaises\x0a\x09self should: [ [Error new signal ] ensure: [ true ]] raise: Error",
  585. referencedClasses: ["Error"],
  586. //>>excludeEnd("ide");
  587. messageSends: ["should:raise:", "ensure:", "signal", "new"]
  588. }),
  589. $globals.BlockClosureTest);
  590. $core.addMethod(
  591. $core.method({
  592. selector: "testExceptionSemantics",
  593. protocol: 'tests',
  594. fn: function (){
  595. var self=this;
  596. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  597. return $core.withContext(function($ctx1) {
  598. //>>excludeEnd("ctx");
  599. self._timeout_((100));
  600. $recv(self._async_((function(){
  601. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  602. return $core.withContext(function($ctx2) {
  603. //>>excludeEnd("ctx");
  604. return $recv((function(){
  605. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  606. return $core.withContext(function($ctx3) {
  607. //>>excludeEnd("ctx");
  608. self._assert_(true);
  609. $recv($globals.Error)._signal();
  610. self._deny_(true);
  611. return self._finished();
  612. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  613. $ctx3.sendIdx["finished"]=1;
  614. //>>excludeEnd("ctx");
  615. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  616. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  617. //>>excludeEnd("ctx");
  618. }))._on_do_($globals.Error,(function(ex){
  619. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  620. return $core.withContext(function($ctx3) {
  621. //>>excludeEnd("ctx");
  622. return self._finished();
  623. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  624. }, function($ctx3) {$ctx3.fillBlock({ex:ex},$ctx2,3)});
  625. //>>excludeEnd("ctx");
  626. }));
  627. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  628. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  629. //>>excludeEnd("ctx");
  630. })))._valueWithTimeout_((0));
  631. return self;
  632. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  633. }, function($ctx1) {$ctx1.fill(self,"testExceptionSemantics",{},$globals.BlockClosureTest)});
  634. //>>excludeEnd("ctx");
  635. },
  636. //>>excludeStart("ide", pragmas.excludeIdeData);
  637. args: [],
  638. 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",
  639. referencedClasses: ["Error"],
  640. //>>excludeEnd("ide");
  641. messageSends: ["timeout:", "valueWithTimeout:", "async:", "on:do:", "assert:", "signal", "deny:", "finished"]
  642. }),
  643. $globals.BlockClosureTest);
  644. $core.addMethod(
  645. $core.method({
  646. selector: "testLocalReturnOnDoCatch",
  647. protocol: 'tests',
  648. fn: function (){
  649. var self=this;
  650. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  651. return $core.withContext(function($ctx1) {
  652. //>>excludeEnd("ctx");
  653. self._assert_equals_(self._localReturnOnDoCatch(),(2));
  654. return self;
  655. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  656. }, function($ctx1) {$ctx1.fill(self,"testLocalReturnOnDoCatch",{},$globals.BlockClosureTest)});
  657. //>>excludeEnd("ctx");
  658. },
  659. //>>excludeStart("ide", pragmas.excludeIdeData);
  660. args: [],
  661. source: "testLocalReturnOnDoCatch\x0a\x09self assert: self localReturnOnDoCatch equals: 2",
  662. referencedClasses: [],
  663. //>>excludeEnd("ide");
  664. messageSends: ["assert:equals:", "localReturnOnDoCatch"]
  665. }),
  666. $globals.BlockClosureTest);
  667. $core.addMethod(
  668. $core.method({
  669. selector: "testLocalReturnOnDoMiss",
  670. protocol: 'tests',
  671. fn: function (){
  672. var self=this;
  673. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  674. return $core.withContext(function($ctx1) {
  675. //>>excludeEnd("ctx");
  676. self._assert_equals_(self._localReturnOnDoMiss(),(2));
  677. return self;
  678. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  679. }, function($ctx1) {$ctx1.fill(self,"testLocalReturnOnDoMiss",{},$globals.BlockClosureTest)});
  680. //>>excludeEnd("ctx");
  681. },
  682. //>>excludeStart("ide", pragmas.excludeIdeData);
  683. args: [],
  684. source: "testLocalReturnOnDoMiss\x0a\x09self assert: self localReturnOnDoMiss equals: 2",
  685. referencedClasses: [],
  686. //>>excludeEnd("ide");
  687. messageSends: ["assert:equals:", "localReturnOnDoMiss"]
  688. }),
  689. $globals.BlockClosureTest);
  690. $core.addMethod(
  691. $core.method({
  692. selector: "testNewWithValues",
  693. protocol: 'tests',
  694. fn: function (){
  695. var self=this;
  696. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  697. return $core.withContext(function($ctx1) {
  698. //>>excludeEnd("ctx");
  699. function TestConstructor(arg1, arg2, arg3) {}
  700. TestConstructor.prototype.name = 'theTestPrototype';
  701. var wrappedConstructor = $recv(TestConstructor);
  702. var result = wrappedConstructor._newWithValues_([1, 2, 3 ]);
  703. self._assert_(result instanceof TestConstructor);
  704. self._assert_equals_(result.name, 'theTestPrototype');
  705. "newWithValues: cannot help if the argument list is wrong, and should warn that a mistake was made."
  706. self._should_raise_(function () {wrappedConstructor._newWithValues_('single argument');}, $globals.Error);;
  707. return self;
  708. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  709. }, function($ctx1) {$ctx1.fill(self,"testNewWithValues",{},$globals.BlockClosureTest)});
  710. //>>excludeEnd("ctx");
  711. },
  712. //>>excludeStart("ide", pragmas.excludeIdeData);
  713. args: [],
  714. source: "testNewWithValues\x0a<\x0a\x09function TestConstructor(arg1, arg2, arg3) {}\x0a\x09TestConstructor.prototype.name = 'theTestPrototype';\x0a\x0a\x09var wrappedConstructor = $recv(TestConstructor);\x0a\x09var result = wrappedConstructor._newWithValues_([1, 2, 3 ]);\x0a\x09self._assert_(result instanceof TestConstructor);\x0a\x09self._assert_equals_(result.name, 'theTestPrototype');\x0a\x0a\x09\x22newWithValues: cannot help if the argument list is wrong, and should warn that a mistake was made.\x22\x0a\x09self._should_raise_(function () {wrappedConstructor._newWithValues_('single argument');}, $globals.Error);\x0a>",
  715. referencedClasses: [],
  716. //>>excludeEnd("ide");
  717. messageSends: []
  718. }),
  719. $globals.BlockClosureTest);
  720. $core.addMethod(
  721. $core.method({
  722. selector: "testNumArgs",
  723. protocol: 'tests',
  724. fn: function (){
  725. var self=this;
  726. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  727. return $core.withContext(function($ctx1) {
  728. //>>excludeEnd("ctx");
  729. var $1;
  730. $1=$recv((function(){
  731. }))._numArgs();
  732. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  733. $ctx1.sendIdx["numArgs"]=1;
  734. //>>excludeEnd("ctx");
  735. self._assert_equals_($1,(0));
  736. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  737. $ctx1.sendIdx["assert:equals:"]=1;
  738. //>>excludeEnd("ctx");
  739. self._assert_equals_($recv((function(a,b){
  740. }))._numArgs(),(2));
  741. return self;
  742. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  743. }, function($ctx1) {$ctx1.fill(self,"testNumArgs",{},$globals.BlockClosureTest)});
  744. //>>excludeEnd("ctx");
  745. },
  746. //>>excludeStart("ide", pragmas.excludeIdeData);
  747. args: [],
  748. source: "testNumArgs\x0a\x09self assert: [] numArgs equals: 0.\x0a\x09self assert: [ :a :b | ] numArgs equals: 2",
  749. referencedClasses: [],
  750. //>>excludeEnd("ide");
  751. messageSends: ["assert:equals:", "numArgs"]
  752. }),
  753. $globals.BlockClosureTest);
  754. $core.addMethod(
  755. $core.method({
  756. selector: "testOnDo",
  757. protocol: 'tests',
  758. fn: function (){
  759. var self=this;
  760. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  761. return $core.withContext(function($ctx1) {
  762. //>>excludeEnd("ctx");
  763. self._assert_($recv((function(){
  764. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  765. return $core.withContext(function($ctx2) {
  766. //>>excludeEnd("ctx");
  767. return $recv($recv($globals.Error)._new())._signal();
  768. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  769. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  770. //>>excludeEnd("ctx");
  771. }))._on_do_($globals.Error,(function(ex){
  772. return true;
  773. })));
  774. return self;
  775. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  776. }, function($ctx1) {$ctx1.fill(self,"testOnDo",{},$globals.BlockClosureTest)});
  777. //>>excludeEnd("ctx");
  778. },
  779. //>>excludeStart("ide", pragmas.excludeIdeData);
  780. args: [],
  781. source: "testOnDo\x0a\x09self assert: ([ Error new signal ] on: Error do: [ :ex | true ])",
  782. referencedClasses: ["Error"],
  783. //>>excludeEnd("ide");
  784. messageSends: ["assert:", "on:do:", "signal", "new"]
  785. }),
  786. $globals.BlockClosureTest);
  787. $core.addMethod(
  788. $core.method({
  789. selector: "testValue",
  790. protocol: 'tests',
  791. fn: function (){
  792. var self=this;
  793. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  794. return $core.withContext(function($ctx1) {
  795. //>>excludeEnd("ctx");
  796. var $1;
  797. $1=$recv((function(){
  798. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  799. return $core.withContext(function($ctx2) {
  800. //>>excludeEnd("ctx");
  801. return (1).__plus((1));
  802. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  803. $ctx2.sendIdx["+"]=1;
  804. //>>excludeEnd("ctx");
  805. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  806. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  807. //>>excludeEnd("ctx");
  808. }))._value();
  809. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  810. $ctx1.sendIdx["value"]=1;
  811. //>>excludeEnd("ctx");
  812. self._assert_equals_($1,(2));
  813. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  814. $ctx1.sendIdx["assert:equals:"]=1;
  815. //>>excludeEnd("ctx");
  816. self._assert_equals_($recv((function(x){
  817. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  818. return $core.withContext(function($ctx2) {
  819. //>>excludeEnd("ctx");
  820. return $recv(x).__plus((1));
  821. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  822. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,2)});
  823. //>>excludeEnd("ctx");
  824. }))._value_((2)),(3));
  825. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  826. $ctx1.sendIdx["assert:equals:"]=2;
  827. //>>excludeEnd("ctx");
  828. self._assert_equals_($recv((function(x,y){
  829. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  830. return $core.withContext(function($ctx2) {
  831. //>>excludeEnd("ctx");
  832. return $recv(x).__star(y);
  833. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  834. }, function($ctx2) {$ctx2.fillBlock({x:x,y:y},$ctx1,3)});
  835. //>>excludeEnd("ctx");
  836. }))._value_value_((2),(4)),(8));
  837. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  838. $ctx1.sendIdx["assert:equals:"]=3;
  839. //>>excludeEnd("ctx");
  840. self._assert_equals_($recv((function(a,b,c){
  841. return (1);
  842. }))._value(),(1));
  843. return self;
  844. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  845. }, function($ctx1) {$ctx1.fill(self,"testValue",{},$globals.BlockClosureTest)});
  846. //>>excludeEnd("ctx");
  847. },
  848. //>>excludeStart("ide", pragmas.excludeIdeData);
  849. args: [],
  850. 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",
  851. referencedClasses: [],
  852. //>>excludeEnd("ide");
  853. messageSends: ["assert:equals:", "value", "+", "value:", "value:value:", "*"]
  854. }),
  855. $globals.BlockClosureTest);
  856. $core.addMethod(
  857. $core.method({
  858. selector: "testValueWithPossibleArguments",
  859. protocol: 'tests',
  860. fn: function (){
  861. var self=this;
  862. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  863. return $core.withContext(function($ctx1) {
  864. //>>excludeEnd("ctx");
  865. var $1,$2;
  866. $1=$recv((function(){
  867. return (1);
  868. }))._valueWithPossibleArguments_([(3), (4)]);
  869. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  870. $ctx1.sendIdx["valueWithPossibleArguments:"]=1;
  871. //>>excludeEnd("ctx");
  872. self._assert_equals_($1,(1));
  873. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  874. $ctx1.sendIdx["assert:equals:"]=1;
  875. //>>excludeEnd("ctx");
  876. $2=$recv((function(a){
  877. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  878. return $core.withContext(function($ctx2) {
  879. //>>excludeEnd("ctx");
  880. return $recv(a).__plus((4));
  881. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  882. $ctx2.sendIdx["+"]=1;
  883. //>>excludeEnd("ctx");
  884. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  885. }, function($ctx2) {$ctx2.fillBlock({a:a},$ctx1,2)});
  886. //>>excludeEnd("ctx");
  887. }))._valueWithPossibleArguments_([(3), (4)]);
  888. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  889. $ctx1.sendIdx["valueWithPossibleArguments:"]=2;
  890. //>>excludeEnd("ctx");
  891. self._assert_equals_($2,(7));
  892. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  893. $ctx1.sendIdx["assert:equals:"]=2;
  894. //>>excludeEnd("ctx");
  895. self._assert_equals_($recv((function(a,b){
  896. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  897. return $core.withContext(function($ctx2) {
  898. //>>excludeEnd("ctx");
  899. return $recv(a).__plus(b);
  900. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  901. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1,3)});
  902. //>>excludeEnd("ctx");
  903. }))._valueWithPossibleArguments_([(3), (4), (5)]),(7));
  904. return self;
  905. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  906. }, function($ctx1) {$ctx1.fill(self,"testValueWithPossibleArguments",{},$globals.BlockClosureTest)});
  907. //>>excludeEnd("ctx");
  908. },
  909. //>>excludeStart("ide", pragmas.excludeIdeData);
  910. args: [],
  911. 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.",
  912. referencedClasses: [],
  913. //>>excludeEnd("ide");
  914. messageSends: ["assert:equals:", "valueWithPossibleArguments:", "+"]
  915. }),
  916. $globals.BlockClosureTest);
  917. $core.addMethod(
  918. $core.method({
  919. selector: "testWhileFalse",
  920. protocol: 'tests',
  921. fn: function (){
  922. var self=this;
  923. var i;
  924. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  925. return $core.withContext(function($ctx1) {
  926. //>>excludeEnd("ctx");
  927. i=(0);
  928. $recv((function(){
  929. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  930. return $core.withContext(function($ctx2) {
  931. //>>excludeEnd("ctx");
  932. return $recv(i).__gt((5));
  933. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  934. $ctx2.sendIdx[">"]=1;
  935. //>>excludeEnd("ctx");
  936. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  937. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  938. //>>excludeEnd("ctx");
  939. }))._whileFalse_((function(){
  940. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  941. return $core.withContext(function($ctx2) {
  942. //>>excludeEnd("ctx");
  943. i=$recv(i).__plus((1));
  944. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  945. $ctx2.sendIdx["+"]=1;
  946. //>>excludeEnd("ctx");
  947. return i;
  948. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  949. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  950. //>>excludeEnd("ctx");
  951. }));
  952. self._assert_equals_(i,(6));
  953. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  954. $ctx1.sendIdx["assert:equals:"]=1;
  955. //>>excludeEnd("ctx");
  956. i=(0);
  957. $recv((function(){
  958. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  959. return $core.withContext(function($ctx2) {
  960. //>>excludeEnd("ctx");
  961. i=$recv(i).__plus((1));
  962. i;
  963. return $recv(i).__gt((5));
  964. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  965. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  966. //>>excludeEnd("ctx");
  967. }))._whileFalse();
  968. self._assert_equals_(i,(6));
  969. return self;
  970. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  971. }, function($ctx1) {$ctx1.fill(self,"testWhileFalse",{i:i},$globals.BlockClosureTest)});
  972. //>>excludeEnd("ctx");
  973. },
  974. //>>excludeStart("ide", pragmas.excludeIdeData);
  975. args: [],
  976. 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",
  977. referencedClasses: [],
  978. //>>excludeEnd("ide");
  979. messageSends: ["whileFalse:", ">", "+", "assert:equals:", "whileFalse"]
  980. }),
  981. $globals.BlockClosureTest);
  982. $core.addMethod(
  983. $core.method({
  984. selector: "testWhileTrue",
  985. protocol: 'tests',
  986. fn: function (){
  987. var self=this;
  988. var i;
  989. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  990. return $core.withContext(function($ctx1) {
  991. //>>excludeEnd("ctx");
  992. i=(0);
  993. $recv((function(){
  994. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  995. return $core.withContext(function($ctx2) {
  996. //>>excludeEnd("ctx");
  997. return $recv(i).__lt((5));
  998. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  999. $ctx2.sendIdx["<"]=1;
  1000. //>>excludeEnd("ctx");
  1001. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1002. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  1003. //>>excludeEnd("ctx");
  1004. }))._whileTrue_((function(){
  1005. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1006. return $core.withContext(function($ctx2) {
  1007. //>>excludeEnd("ctx");
  1008. i=$recv(i).__plus((1));
  1009. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1010. $ctx2.sendIdx["+"]=1;
  1011. //>>excludeEnd("ctx");
  1012. return i;
  1013. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1014. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  1015. //>>excludeEnd("ctx");
  1016. }));
  1017. self._assert_equals_(i,(5));
  1018. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1019. $ctx1.sendIdx["assert:equals:"]=1;
  1020. //>>excludeEnd("ctx");
  1021. i=(0);
  1022. $recv((function(){
  1023. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1024. return $core.withContext(function($ctx2) {
  1025. //>>excludeEnd("ctx");
  1026. i=$recv(i).__plus((1));
  1027. i;
  1028. return $recv(i).__lt((5));
  1029. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1030. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  1031. //>>excludeEnd("ctx");
  1032. }))._whileTrue();
  1033. self._assert_equals_(i,(5));
  1034. return self;
  1035. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1036. }, function($ctx1) {$ctx1.fill(self,"testWhileTrue",{i:i},$globals.BlockClosureTest)});
  1037. //>>excludeEnd("ctx");
  1038. },
  1039. //>>excludeStart("ide", pragmas.excludeIdeData);
  1040. args: [],
  1041. 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",
  1042. referencedClasses: [],
  1043. //>>excludeEnd("ide");
  1044. messageSends: ["whileTrue:", "<", "+", "assert:equals:", "whileTrue"]
  1045. }),
  1046. $globals.BlockClosureTest);
  1047. $core.addClass('BooleanTest', $globals.TestCase, [], 'Kernel-Tests');
  1048. $core.addMethod(
  1049. $core.method({
  1050. selector: "testEquality",
  1051. protocol: 'tests',
  1052. fn: function (){
  1053. var self=this;
  1054. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1055. return $core.withContext(function($ctx1) {
  1056. //>>excludeEnd("ctx");
  1057. var $1,$2,$3,$4,$5,$6,$7,$8,$10,$9,$12,$11;
  1058. $1=(0).__eq(false);
  1059. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1060. $ctx1.sendIdx["="]=1;
  1061. //>>excludeEnd("ctx");
  1062. self._deny_($1);
  1063. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1064. $ctx1.sendIdx["deny:"]=1;
  1065. //>>excludeEnd("ctx");
  1066. $2=false.__eq((0));
  1067. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1068. $ctx1.sendIdx["="]=2;
  1069. //>>excludeEnd("ctx");
  1070. self._deny_($2);
  1071. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1072. $ctx1.sendIdx["deny:"]=2;
  1073. //>>excludeEnd("ctx");
  1074. $3="".__eq(false);
  1075. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1076. $ctx1.sendIdx["="]=3;
  1077. //>>excludeEnd("ctx");
  1078. self._deny_($3);
  1079. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1080. $ctx1.sendIdx["deny:"]=3;
  1081. //>>excludeEnd("ctx");
  1082. $4=false.__eq("");
  1083. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1084. $ctx1.sendIdx["="]=4;
  1085. //>>excludeEnd("ctx");
  1086. self._deny_($4);
  1087. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1088. $ctx1.sendIdx["deny:"]=4;
  1089. //>>excludeEnd("ctx");
  1090. $5=true.__eq(true);
  1091. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1092. $ctx1.sendIdx["="]=5;
  1093. //>>excludeEnd("ctx");
  1094. self._assert_($5);
  1095. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1096. $ctx1.sendIdx["assert:"]=1;
  1097. //>>excludeEnd("ctx");
  1098. $6=false.__eq(true);
  1099. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1100. $ctx1.sendIdx["="]=6;
  1101. //>>excludeEnd("ctx");
  1102. self._deny_($6);
  1103. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1104. $ctx1.sendIdx["deny:"]=5;
  1105. //>>excludeEnd("ctx");
  1106. $7=true.__eq(false);
  1107. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1108. $ctx1.sendIdx["="]=7;
  1109. //>>excludeEnd("ctx");
  1110. self._deny_($7);
  1111. $8=false.__eq(false);
  1112. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1113. $ctx1.sendIdx["="]=8;
  1114. //>>excludeEnd("ctx");
  1115. self._assert_($8);
  1116. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1117. $ctx1.sendIdx["assert:"]=2;
  1118. //>>excludeEnd("ctx");
  1119. $10=true._yourself();
  1120. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1121. $ctx1.sendIdx["yourself"]=1;
  1122. //>>excludeEnd("ctx");
  1123. $9=$recv($10).__eq(true);
  1124. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1125. $ctx1.sendIdx["="]=9;
  1126. //>>excludeEnd("ctx");
  1127. self._assert_($9);
  1128. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1129. $ctx1.sendIdx["assert:"]=3;
  1130. //>>excludeEnd("ctx");
  1131. $12=true._yourself();
  1132. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1133. $ctx1.sendIdx["yourself"]=2;
  1134. //>>excludeEnd("ctx");
  1135. $11=$recv($12).__eq(true._yourself());
  1136. self._assert_($11);
  1137. return self;
  1138. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1139. }, function($ctx1) {$ctx1.fill(self,"testEquality",{},$globals.BooleanTest)});
  1140. //>>excludeEnd("ctx");
  1141. },
  1142. //>>excludeStart("ide", pragmas.excludeIdeData);
  1143. args: [],
  1144. 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)",
  1145. referencedClasses: [],
  1146. //>>excludeEnd("ide");
  1147. messageSends: ["deny:", "=", "assert:", "yourself"]
  1148. }),
  1149. $globals.BooleanTest);
  1150. $core.addMethod(
  1151. $core.method({
  1152. selector: "testIdentity",
  1153. protocol: 'tests',
  1154. fn: function (){
  1155. var self=this;
  1156. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1157. return $core.withContext(function($ctx1) {
  1158. //>>excludeEnd("ctx");
  1159. var $1,$2,$3,$4,$5,$6,$7,$8,$10,$9,$12,$11;
  1160. $1=(0).__eq_eq(false);
  1161. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1162. $ctx1.sendIdx["=="]=1;
  1163. //>>excludeEnd("ctx");
  1164. self._deny_($1);
  1165. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1166. $ctx1.sendIdx["deny:"]=1;
  1167. //>>excludeEnd("ctx");
  1168. $2=false.__eq_eq((0));
  1169. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1170. $ctx1.sendIdx["=="]=2;
  1171. //>>excludeEnd("ctx");
  1172. self._deny_($2);
  1173. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1174. $ctx1.sendIdx["deny:"]=2;
  1175. //>>excludeEnd("ctx");
  1176. $3="".__eq_eq(false);
  1177. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1178. $ctx1.sendIdx["=="]=3;
  1179. //>>excludeEnd("ctx");
  1180. self._deny_($3);
  1181. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1182. $ctx1.sendIdx["deny:"]=3;
  1183. //>>excludeEnd("ctx");
  1184. $4=false.__eq_eq("");
  1185. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1186. $ctx1.sendIdx["=="]=4;
  1187. //>>excludeEnd("ctx");
  1188. self._deny_($4);
  1189. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1190. $ctx1.sendIdx["deny:"]=4;
  1191. //>>excludeEnd("ctx");
  1192. $5=true.__eq_eq(true);
  1193. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1194. $ctx1.sendIdx["=="]=5;
  1195. //>>excludeEnd("ctx");
  1196. self._assert_($5);
  1197. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1198. $ctx1.sendIdx["assert:"]=1;
  1199. //>>excludeEnd("ctx");
  1200. $6=false.__eq_eq(true);
  1201. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1202. $ctx1.sendIdx["=="]=6;
  1203. //>>excludeEnd("ctx");
  1204. self._deny_($6);
  1205. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1206. $ctx1.sendIdx["deny:"]=5;
  1207. //>>excludeEnd("ctx");
  1208. $7=true.__eq_eq(false);
  1209. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1210. $ctx1.sendIdx["=="]=7;
  1211. //>>excludeEnd("ctx");
  1212. self._deny_($7);
  1213. $8=false.__eq_eq(false);
  1214. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1215. $ctx1.sendIdx["=="]=8;
  1216. //>>excludeEnd("ctx");
  1217. self._assert_($8);
  1218. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1219. $ctx1.sendIdx["assert:"]=2;
  1220. //>>excludeEnd("ctx");
  1221. $10=true._yourself();
  1222. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1223. $ctx1.sendIdx["yourself"]=1;
  1224. //>>excludeEnd("ctx");
  1225. $9=$recv($10).__eq_eq(true);
  1226. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1227. $ctx1.sendIdx["=="]=9;
  1228. //>>excludeEnd("ctx");
  1229. self._assert_($9);
  1230. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1231. $ctx1.sendIdx["assert:"]=3;
  1232. //>>excludeEnd("ctx");
  1233. $12=true._yourself();
  1234. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1235. $ctx1.sendIdx["yourself"]=2;
  1236. //>>excludeEnd("ctx");
  1237. $11=$recv($12).__eq_eq(true._yourself());
  1238. self._assert_($11);
  1239. return self;
  1240. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1241. }, function($ctx1) {$ctx1.fill(self,"testIdentity",{},$globals.BooleanTest)});
  1242. //>>excludeEnd("ctx");
  1243. },
  1244. //>>excludeStart("ide", pragmas.excludeIdeData);
  1245. args: [],
  1246. 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",
  1247. referencedClasses: [],
  1248. //>>excludeEnd("ide");
  1249. messageSends: ["deny:", "==", "assert:", "yourself"]
  1250. }),
  1251. $globals.BooleanTest);
  1252. $core.addMethod(
  1253. $core.method({
  1254. selector: "testIfTrueIfFalse",
  1255. protocol: 'tests',
  1256. fn: function (){
  1257. var self=this;
  1258. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1259. return $core.withContext(function($ctx1) {
  1260. //>>excludeEnd("ctx");
  1261. var $1,$2,$3,$4,$5,$6,$7,$8;
  1262. if($core.assert(true)){
  1263. $1="alternative block";
  1264. };
  1265. self._assert_equals_($1,"alternative block");
  1266. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1267. $ctx1.sendIdx["assert:equals:"]=1;
  1268. //>>excludeEnd("ctx");
  1269. if(!$core.assert(true)){
  1270. $2="alternative block";
  1271. };
  1272. self._assert_equals_($2,nil);
  1273. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1274. $ctx1.sendIdx["assert:equals:"]=2;
  1275. //>>excludeEnd("ctx");
  1276. if($core.assert(false)){
  1277. $3="alternative block";
  1278. };
  1279. self._assert_equals_($3,nil);
  1280. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1281. $ctx1.sendIdx["assert:equals:"]=3;
  1282. //>>excludeEnd("ctx");
  1283. if(!$core.assert(false)){
  1284. $4="alternative block";
  1285. };
  1286. self._assert_equals_($4,"alternative block");
  1287. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1288. $ctx1.sendIdx["assert:equals:"]=4;
  1289. //>>excludeEnd("ctx");
  1290. if($core.assert(false)){
  1291. $5="alternative block";
  1292. } else {
  1293. $5="alternative block2";
  1294. };
  1295. self._assert_equals_($5,"alternative block2");
  1296. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1297. $ctx1.sendIdx["assert:equals:"]=5;
  1298. //>>excludeEnd("ctx");
  1299. if($core.assert(false)){
  1300. $6="alternative block2";
  1301. } else {
  1302. $6="alternative block";
  1303. };
  1304. self._assert_equals_($6,"alternative block");
  1305. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1306. $ctx1.sendIdx["assert:equals:"]=6;
  1307. //>>excludeEnd("ctx");
  1308. if($core.assert(true)){
  1309. $7="alternative block";
  1310. } else {
  1311. $7="alternative block2";
  1312. };
  1313. self._assert_equals_($7,"alternative block");
  1314. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1315. $ctx1.sendIdx["assert:equals:"]=7;
  1316. //>>excludeEnd("ctx");
  1317. if($core.assert(true)){
  1318. $8="alternative block2";
  1319. } else {
  1320. $8="alternative block";
  1321. };
  1322. self._assert_equals_($8,"alternative block2");
  1323. return self;
  1324. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1325. }, function($ctx1) {$ctx1.fill(self,"testIfTrueIfFalse",{},$globals.BooleanTest)});
  1326. //>>excludeEnd("ctx");
  1327. },
  1328. //>>excludeStart("ide", pragmas.excludeIdeData);
  1329. args: [],
  1330. 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'.",
  1331. referencedClasses: [],
  1332. //>>excludeEnd("ide");
  1333. messageSends: ["assert:equals:", "ifTrue:", "ifFalse:", "ifTrue:ifFalse:", "ifFalse:ifTrue:"]
  1334. }),
  1335. $globals.BooleanTest);
  1336. $core.addMethod(
  1337. $core.method({
  1338. selector: "testIfTrueIfFalseWithBoxing",
  1339. protocol: 'tests',
  1340. fn: function (){
  1341. var self=this;
  1342. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1343. return $core.withContext(function($ctx1) {
  1344. //>>excludeEnd("ctx");
  1345. var $2,$1,$4,$3,$6,$5,$8,$7,$10,$9,$12,$11,$14,$13,$16,$15;
  1346. $2=true._yourself();
  1347. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1348. $ctx1.sendIdx["yourself"]=1;
  1349. //>>excludeEnd("ctx");
  1350. if($core.assert($2)){
  1351. $1="alternative block";
  1352. };
  1353. self._assert_equals_($1,"alternative block");
  1354. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1355. $ctx1.sendIdx["assert:equals:"]=1;
  1356. //>>excludeEnd("ctx");
  1357. $4=true._yourself();
  1358. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1359. $ctx1.sendIdx["yourself"]=2;
  1360. //>>excludeEnd("ctx");
  1361. if(!$core.assert($4)){
  1362. $3="alternative block";
  1363. };
  1364. self._assert_equals_($3,nil);
  1365. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1366. $ctx1.sendIdx["assert:equals:"]=2;
  1367. //>>excludeEnd("ctx");
  1368. $6=false._yourself();
  1369. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1370. $ctx1.sendIdx["yourself"]=3;
  1371. //>>excludeEnd("ctx");
  1372. if($core.assert($6)){
  1373. $5="alternative block";
  1374. };
  1375. self._assert_equals_($5,nil);
  1376. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1377. $ctx1.sendIdx["assert:equals:"]=3;
  1378. //>>excludeEnd("ctx");
  1379. $8=false._yourself();
  1380. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1381. $ctx1.sendIdx["yourself"]=4;
  1382. //>>excludeEnd("ctx");
  1383. if(!$core.assert($8)){
  1384. $7="alternative block";
  1385. };
  1386. self._assert_equals_($7,"alternative block");
  1387. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1388. $ctx1.sendIdx["assert:equals:"]=4;
  1389. //>>excludeEnd("ctx");
  1390. $10=false._yourself();
  1391. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1392. $ctx1.sendIdx["yourself"]=5;
  1393. //>>excludeEnd("ctx");
  1394. if($core.assert($10)){
  1395. $9="alternative block";
  1396. } else {
  1397. $9="alternative block2";
  1398. };
  1399. self._assert_equals_($9,"alternative block2");
  1400. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1401. $ctx1.sendIdx["assert:equals:"]=5;
  1402. //>>excludeEnd("ctx");
  1403. $12=false._yourself();
  1404. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1405. $ctx1.sendIdx["yourself"]=6;
  1406. //>>excludeEnd("ctx");
  1407. if($core.assert($12)){
  1408. $11="alternative block2";
  1409. } else {
  1410. $11="alternative block";
  1411. };
  1412. self._assert_equals_($11,"alternative block");
  1413. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1414. $ctx1.sendIdx["assert:equals:"]=6;
  1415. //>>excludeEnd("ctx");
  1416. $14=true._yourself();
  1417. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1418. $ctx1.sendIdx["yourself"]=7;
  1419. //>>excludeEnd("ctx");
  1420. if($core.assert($14)){
  1421. $13="alternative block";
  1422. } else {
  1423. $13="alternative block2";
  1424. };
  1425. self._assert_equals_($13,"alternative block");
  1426. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1427. $ctx1.sendIdx["assert:equals:"]=7;
  1428. //>>excludeEnd("ctx");
  1429. $16=true._yourself();
  1430. if($core.assert($16)){
  1431. $15="alternative block2";
  1432. } else {
  1433. $15="alternative block";
  1434. };
  1435. self._assert_equals_($15,"alternative block2");
  1436. return self;
  1437. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1438. }, function($ctx1) {$ctx1.fill(self,"testIfTrueIfFalseWithBoxing",{},$globals.BooleanTest)});
  1439. //>>excludeEnd("ctx");
  1440. },
  1441. //>>excludeStart("ide", pragmas.excludeIdeData);
  1442. args: [],
  1443. 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'.",
  1444. referencedClasses: [],
  1445. //>>excludeEnd("ide");
  1446. messageSends: ["assert:equals:", "ifTrue:", "yourself", "ifFalse:", "ifTrue:ifFalse:", "ifFalse:ifTrue:"]
  1447. }),
  1448. $globals.BooleanTest);
  1449. $core.addMethod(
  1450. $core.method({
  1451. selector: "testLogic",
  1452. protocol: 'tests',
  1453. fn: function (){
  1454. var self=this;
  1455. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1456. return $core.withContext(function($ctx1) {
  1457. //>>excludeEnd("ctx");
  1458. var $1,$2,$3,$5,$4,$6,$7,$8,$10,$9,$12,$11,$14,$13,$16,$17,$15,$19,$18,$21,$20,$23,$22;
  1459. $1=true.__and(true);
  1460. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1461. $ctx1.sendIdx["&"]=1;
  1462. //>>excludeEnd("ctx");
  1463. self._assert_($1);
  1464. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1465. $ctx1.sendIdx["assert:"]=1;
  1466. //>>excludeEnd("ctx");
  1467. $2=true.__and(false);
  1468. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1469. $ctx1.sendIdx["&"]=2;
  1470. //>>excludeEnd("ctx");
  1471. self._deny_($2);
  1472. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1473. $ctx1.sendIdx["deny:"]=1;
  1474. //>>excludeEnd("ctx");
  1475. $3=false.__and(true);
  1476. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1477. $ctx1.sendIdx["&"]=3;
  1478. //>>excludeEnd("ctx");
  1479. self._deny_($3);
  1480. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1481. $ctx1.sendIdx["deny:"]=2;
  1482. //>>excludeEnd("ctx");
  1483. $5=false.__and(false);
  1484. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1485. $ctx1.sendIdx["&"]=4;
  1486. //>>excludeEnd("ctx");
  1487. $4=self._deny_($5);
  1488. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1489. $ctx1.sendIdx["deny:"]=3;
  1490. //>>excludeEnd("ctx");
  1491. $6=true.__or(true);
  1492. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1493. $ctx1.sendIdx["|"]=1;
  1494. //>>excludeEnd("ctx");
  1495. self._assert_($6);
  1496. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1497. $ctx1.sendIdx["assert:"]=2;
  1498. //>>excludeEnd("ctx");
  1499. $7=true.__or(false);
  1500. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1501. $ctx1.sendIdx["|"]=2;
  1502. //>>excludeEnd("ctx");
  1503. self._assert_($7);
  1504. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1505. $ctx1.sendIdx["assert:"]=3;
  1506. //>>excludeEnd("ctx");
  1507. $8=false.__or(true);
  1508. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1509. $ctx1.sendIdx["|"]=3;
  1510. //>>excludeEnd("ctx");
  1511. self._assert_($8);
  1512. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1513. $ctx1.sendIdx["assert:"]=4;
  1514. //>>excludeEnd("ctx");
  1515. $10=false.__or(false);
  1516. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1517. $ctx1.sendIdx["|"]=4;
  1518. //>>excludeEnd("ctx");
  1519. $9=self._deny_($10);
  1520. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1521. $ctx1.sendIdx["deny:"]=4;
  1522. //>>excludeEnd("ctx");
  1523. $12=(1).__gt((0));
  1524. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1525. $ctx1.sendIdx[">"]=1;
  1526. //>>excludeEnd("ctx");
  1527. $11=true.__and($12);
  1528. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1529. $ctx1.sendIdx["&"]=5;
  1530. //>>excludeEnd("ctx");
  1531. self._assert_($11);
  1532. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1533. $ctx1.sendIdx["assert:"]=5;
  1534. //>>excludeEnd("ctx");
  1535. $14=(1).__gt((0));
  1536. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1537. $ctx1.sendIdx[">"]=2;
  1538. //>>excludeEnd("ctx");
  1539. $13=$recv($14).__and(false);
  1540. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1541. $ctx1.sendIdx["&"]=6;
  1542. //>>excludeEnd("ctx");
  1543. self._deny_($13);
  1544. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1545. $ctx1.sendIdx["deny:"]=5;
  1546. //>>excludeEnd("ctx");
  1547. $16=(1).__gt((0));
  1548. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1549. $ctx1.sendIdx[">"]=3;
  1550. //>>excludeEnd("ctx");
  1551. $17=(1).__gt((2));
  1552. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1553. $ctx1.sendIdx[">"]=4;
  1554. //>>excludeEnd("ctx");
  1555. $15=$recv($16).__and($17);
  1556. self._deny_($15);
  1557. $19=(1).__gt((0));
  1558. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1559. $ctx1.sendIdx[">"]=5;
  1560. //>>excludeEnd("ctx");
  1561. $18=false.__or($19);
  1562. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1563. $ctx1.sendIdx["|"]=5;
  1564. //>>excludeEnd("ctx");
  1565. self._assert_($18);
  1566. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1567. $ctx1.sendIdx["assert:"]=6;
  1568. //>>excludeEnd("ctx");
  1569. $21=(1).__gt((0));
  1570. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1571. $ctx1.sendIdx[">"]=6;
  1572. //>>excludeEnd("ctx");
  1573. $20=$recv($21).__or(false);
  1574. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1575. $ctx1.sendIdx["|"]=6;
  1576. //>>excludeEnd("ctx");
  1577. self._assert_($20);
  1578. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1579. $ctx1.sendIdx["assert:"]=7;
  1580. //>>excludeEnd("ctx");
  1581. $23=(1).__gt((0));
  1582. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1583. $ctx1.sendIdx[">"]=7;
  1584. //>>excludeEnd("ctx");
  1585. $22=$recv($23).__or((1).__gt((2)));
  1586. self._assert_($22);
  1587. return self;
  1588. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1589. }, function($ctx1) {$ctx1.fill(self,"testLogic",{},$globals.BooleanTest)});
  1590. //>>excludeEnd("ctx");
  1591. },
  1592. //>>excludeStart("ide", pragmas.excludeIdeData);
  1593. args: [],
  1594. 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))",
  1595. referencedClasses: [],
  1596. //>>excludeEnd("ide");
  1597. messageSends: ["assert:", "&", "deny:", "|", ">"]
  1598. }),
  1599. $globals.BooleanTest);
  1600. $core.addMethod(
  1601. $core.method({
  1602. selector: "testLogicKeywords",
  1603. protocol: 'tests',
  1604. fn: function (){
  1605. var self=this;
  1606. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1607. return $core.withContext(function($ctx1) {
  1608. //>>excludeEnd("ctx");
  1609. var $1,$2,$3,$5,$4,$6,$7,$8,$10,$9,$11,$13,$12,$15,$14,$16,$18,$17,$20,$19;
  1610. $1=true._and_((function(){
  1611. return true;
  1612. }));
  1613. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1614. $ctx1.sendIdx["and:"]=1;
  1615. //>>excludeEnd("ctx");
  1616. self._assert_($1);
  1617. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1618. $ctx1.sendIdx["assert:"]=1;
  1619. //>>excludeEnd("ctx");
  1620. $2=true._and_((function(){
  1621. return false;
  1622. }));
  1623. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1624. $ctx1.sendIdx["and:"]=2;
  1625. //>>excludeEnd("ctx");
  1626. self._deny_($2);
  1627. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1628. $ctx1.sendIdx["deny:"]=1;
  1629. //>>excludeEnd("ctx");
  1630. $3=false._and_((function(){
  1631. return true;
  1632. }));
  1633. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1634. $ctx1.sendIdx["and:"]=3;
  1635. //>>excludeEnd("ctx");
  1636. self._deny_($3);
  1637. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1638. $ctx1.sendIdx["deny:"]=2;
  1639. //>>excludeEnd("ctx");
  1640. $5=false._and_((function(){
  1641. return false;
  1642. }));
  1643. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1644. $ctx1.sendIdx["and:"]=4;
  1645. //>>excludeEnd("ctx");
  1646. $4=self._deny_($5);
  1647. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1648. $ctx1.sendIdx["deny:"]=3;
  1649. //>>excludeEnd("ctx");
  1650. $6=true._or_((function(){
  1651. return true;
  1652. }));
  1653. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1654. $ctx1.sendIdx["or:"]=1;
  1655. //>>excludeEnd("ctx");
  1656. self._assert_($6);
  1657. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1658. $ctx1.sendIdx["assert:"]=2;
  1659. //>>excludeEnd("ctx");
  1660. $7=true._or_((function(){
  1661. return false;
  1662. }));
  1663. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1664. $ctx1.sendIdx["or:"]=2;
  1665. //>>excludeEnd("ctx");
  1666. self._assert_($7);
  1667. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1668. $ctx1.sendIdx["assert:"]=3;
  1669. //>>excludeEnd("ctx");
  1670. $8=false._or_((function(){
  1671. return true;
  1672. }));
  1673. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1674. $ctx1.sendIdx["or:"]=3;
  1675. //>>excludeEnd("ctx");
  1676. self._assert_($8);
  1677. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1678. $ctx1.sendIdx["assert:"]=4;
  1679. //>>excludeEnd("ctx");
  1680. $10=false._or_((function(){
  1681. return false;
  1682. }));
  1683. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1684. $ctx1.sendIdx["or:"]=4;
  1685. //>>excludeEnd("ctx");
  1686. $9=self._deny_($10);
  1687. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1688. $ctx1.sendIdx["deny:"]=4;
  1689. //>>excludeEnd("ctx");
  1690. $11=true._and_((function(){
  1691. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1692. return $core.withContext(function($ctx2) {
  1693. //>>excludeEnd("ctx");
  1694. return (1).__gt((0));
  1695. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1696. $ctx2.sendIdx[">"]=1;
  1697. //>>excludeEnd("ctx");
  1698. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1699. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,9)});
  1700. //>>excludeEnd("ctx");
  1701. }));
  1702. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1703. $ctx1.sendIdx["and:"]=5;
  1704. //>>excludeEnd("ctx");
  1705. self._assert_($11);
  1706. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1707. $ctx1.sendIdx["assert:"]=5;
  1708. //>>excludeEnd("ctx");
  1709. $13=(1).__gt((0));
  1710. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1711. $ctx1.sendIdx[">"]=2;
  1712. //>>excludeEnd("ctx");
  1713. $12=$recv($13)._and_((function(){
  1714. return false;
  1715. }));
  1716. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1717. $ctx1.sendIdx["and:"]=6;
  1718. //>>excludeEnd("ctx");
  1719. self._deny_($12);
  1720. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1721. $ctx1.sendIdx["deny:"]=5;
  1722. //>>excludeEnd("ctx");
  1723. $15=(1).__gt((0));
  1724. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1725. $ctx1.sendIdx[">"]=3;
  1726. //>>excludeEnd("ctx");
  1727. $14=$recv($15)._and_((function(){
  1728. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1729. return $core.withContext(function($ctx2) {
  1730. //>>excludeEnd("ctx");
  1731. return (1).__gt((2));
  1732. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1733. $ctx2.sendIdx[">"]=4;
  1734. //>>excludeEnd("ctx");
  1735. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1736. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,11)});
  1737. //>>excludeEnd("ctx");
  1738. }));
  1739. self._deny_($14);
  1740. $16=false._or_((function(){
  1741. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1742. return $core.withContext(function($ctx2) {
  1743. //>>excludeEnd("ctx");
  1744. return (1).__gt((0));
  1745. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1746. $ctx2.sendIdx[">"]=5;
  1747. //>>excludeEnd("ctx");
  1748. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1749. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,12)});
  1750. //>>excludeEnd("ctx");
  1751. }));
  1752. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1753. $ctx1.sendIdx["or:"]=5;
  1754. //>>excludeEnd("ctx");
  1755. self._assert_($16);
  1756. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1757. $ctx1.sendIdx["assert:"]=6;
  1758. //>>excludeEnd("ctx");
  1759. $18=(1).__gt((0));
  1760. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1761. $ctx1.sendIdx[">"]=6;
  1762. //>>excludeEnd("ctx");
  1763. $17=$recv($18)._or_((function(){
  1764. return false;
  1765. }));
  1766. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1767. $ctx1.sendIdx["or:"]=6;
  1768. //>>excludeEnd("ctx");
  1769. self._assert_($17);
  1770. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1771. $ctx1.sendIdx["assert:"]=7;
  1772. //>>excludeEnd("ctx");
  1773. $20=(1).__gt((0));
  1774. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1775. $ctx1.sendIdx[">"]=7;
  1776. //>>excludeEnd("ctx");
  1777. $19=$recv($20)._or_((function(){
  1778. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1779. return $core.withContext(function($ctx2) {
  1780. //>>excludeEnd("ctx");
  1781. return (1).__gt((2));
  1782. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1783. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,14)});
  1784. //>>excludeEnd("ctx");
  1785. }));
  1786. self._assert_($19);
  1787. return self;
  1788. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1789. }, function($ctx1) {$ctx1.fill(self,"testLogicKeywords",{},$globals.BooleanTest)});
  1790. //>>excludeEnd("ctx");
  1791. },
  1792. //>>excludeStart("ide", pragmas.excludeIdeData);
  1793. args: [],
  1794. 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 ])",
  1795. referencedClasses: [],
  1796. //>>excludeEnd("ide");
  1797. messageSends: ["assert:", "and:", "deny:", "or:", ">"]
  1798. }),
  1799. $globals.BooleanTest);
  1800. $core.addMethod(
  1801. $core.method({
  1802. selector: "testNonBooleanError",
  1803. protocol: 'tests',
  1804. fn: function (){
  1805. var self=this;
  1806. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1807. return $core.withContext(function($ctx1) {
  1808. //>>excludeEnd("ctx");
  1809. self._should_raise_((function(){
  1810. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1811. return $core.withContext(function($ctx2) {
  1812. //>>excludeEnd("ctx");
  1813. if($core.assert("")){
  1814. } else {
  1815. };
  1816. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1817. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  1818. //>>excludeEnd("ctx");
  1819. }),$globals.NonBooleanReceiver);
  1820. return self;
  1821. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1822. }, function($ctx1) {$ctx1.fill(self,"testNonBooleanError",{},$globals.BooleanTest)});
  1823. //>>excludeEnd("ctx");
  1824. },
  1825. //>>excludeStart("ide", pragmas.excludeIdeData);
  1826. args: [],
  1827. source: "testNonBooleanError\x0a\x09self should: [ '' ifTrue: [] ifFalse: [] ] raise: NonBooleanReceiver",
  1828. referencedClasses: ["NonBooleanReceiver"],
  1829. //>>excludeEnd("ide");
  1830. messageSends: ["should:raise:", "ifTrue:ifFalse:"]
  1831. }),
  1832. $globals.BooleanTest);
  1833. $core.addClass('ClassBuilderTest', $globals.TestCase, ['builder', 'theClass'], 'Kernel-Tests');
  1834. $core.addMethod(
  1835. $core.method({
  1836. selector: "setUp",
  1837. protocol: 'running',
  1838. fn: function (){
  1839. var self=this;
  1840. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1841. return $core.withContext(function($ctx1) {
  1842. //>>excludeEnd("ctx");
  1843. self["@builder"]=$recv($globals.ClassBuilder)._new();
  1844. return self;
  1845. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1846. }, function($ctx1) {$ctx1.fill(self,"setUp",{},$globals.ClassBuilderTest)});
  1847. //>>excludeEnd("ctx");
  1848. },
  1849. //>>excludeStart("ide", pragmas.excludeIdeData);
  1850. args: [],
  1851. source: "setUp\x0a\x09builder := ClassBuilder new",
  1852. referencedClasses: ["ClassBuilder"],
  1853. //>>excludeEnd("ide");
  1854. messageSends: ["new"]
  1855. }),
  1856. $globals.ClassBuilderTest);
  1857. $core.addMethod(
  1858. $core.method({
  1859. selector: "tearDown",
  1860. protocol: 'running',
  1861. fn: function (){
  1862. var self=this;
  1863. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1864. return $core.withContext(function($ctx1) {
  1865. //>>excludeEnd("ctx");
  1866. var $1,$receiver;
  1867. $1=self["@theClass"];
  1868. if(($receiver = $1) == null || $receiver.isNil){
  1869. $1;
  1870. } else {
  1871. $recv($globals.Smalltalk)._removeClass_(self["@theClass"]);
  1872. self["@theClass"]=nil;
  1873. self["@theClass"];
  1874. };
  1875. return self;
  1876. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1877. }, function($ctx1) {$ctx1.fill(self,"tearDown",{},$globals.ClassBuilderTest)});
  1878. //>>excludeEnd("ctx");
  1879. },
  1880. //>>excludeStart("ide", pragmas.excludeIdeData);
  1881. args: [],
  1882. source: "tearDown\x0a\x09theClass ifNotNil: [ Smalltalk removeClass: theClass. theClass := nil ]",
  1883. referencedClasses: ["Smalltalk"],
  1884. //>>excludeEnd("ide");
  1885. messageSends: ["ifNotNil:", "removeClass:"]
  1886. }),
  1887. $globals.ClassBuilderTest);
  1888. $core.addMethod(
  1889. $core.method({
  1890. selector: "testClassCopy",
  1891. protocol: 'tests',
  1892. fn: function (){
  1893. var self=this;
  1894. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1895. return $core.withContext(function($ctx1) {
  1896. //>>excludeEnd("ctx");
  1897. var $2,$1,$4,$3,$6,$5,$8,$7;
  1898. self["@theClass"]=$recv(self["@builder"])._copyClass_named_($globals.ObjectMock,"ObjectMock2");
  1899. $2=$recv(self["@theClass"])._superclass();
  1900. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1901. $ctx1.sendIdx["superclass"]=1;
  1902. //>>excludeEnd("ctx");
  1903. $1=$recv($2).__eq_eq($recv($globals.ObjectMock)._superclass());
  1904. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1905. $ctx1.sendIdx["=="]=1;
  1906. //>>excludeEnd("ctx");
  1907. self._assert_($1);
  1908. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1909. $ctx1.sendIdx["assert:"]=1;
  1910. //>>excludeEnd("ctx");
  1911. $4=$recv(self["@theClass"])._instanceVariableNames();
  1912. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1913. $ctx1.sendIdx["instanceVariableNames"]=1;
  1914. //>>excludeEnd("ctx");
  1915. $3=$recv($4).__eq_eq($recv($globals.ObjectMock)._instanceVariableNames());
  1916. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1917. $ctx1.sendIdx["=="]=2;
  1918. //>>excludeEnd("ctx");
  1919. self._assert_($3);
  1920. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1921. $ctx1.sendIdx["assert:"]=2;
  1922. //>>excludeEnd("ctx");
  1923. self._assert_equals_($recv(self["@theClass"])._name(),"ObjectMock2");
  1924. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1925. $ctx1.sendIdx["assert:equals:"]=1;
  1926. //>>excludeEnd("ctx");
  1927. $6=$recv(self["@theClass"])._package();
  1928. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1929. $ctx1.sendIdx["package"]=1;
  1930. //>>excludeEnd("ctx");
  1931. $5=$recv($6).__eq_eq($recv($globals.ObjectMock)._package());
  1932. self._assert_($5);
  1933. $8=$recv(self["@theClass"])._methodDictionary();
  1934. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1935. $ctx1.sendIdx["methodDictionary"]=1;
  1936. //>>excludeEnd("ctx");
  1937. $7=$recv($8)._keys();
  1938. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1939. $ctx1.sendIdx["keys"]=1;
  1940. //>>excludeEnd("ctx");
  1941. self._assert_equals_($7,$recv($recv($globals.ObjectMock)._methodDictionary())._keys());
  1942. return self;
  1943. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1944. }, function($ctx1) {$ctx1.fill(self,"testClassCopy",{},$globals.ClassBuilderTest)});
  1945. //>>excludeEnd("ctx");
  1946. },
  1947. //>>excludeStart("ide", pragmas.excludeIdeData);
  1948. args: [],
  1949. 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 methodDictionary keys equals: ObjectMock methodDictionary keys",
  1950. referencedClasses: ["ObjectMock"],
  1951. //>>excludeEnd("ide");
  1952. messageSends: ["copyClass:named:", "assert:", "==", "superclass", "instanceVariableNames", "assert:equals:", "name", "package", "keys", "methodDictionary"]
  1953. }),
  1954. $globals.ClassBuilderTest);
  1955. $core.addMethod(
  1956. $core.method({
  1957. selector: "testClassMigration",
  1958. protocol: 'tests',
  1959. fn: function (){
  1960. var self=this;
  1961. var instance,oldClass;
  1962. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1963. return $core.withContext(function($ctx1) {
  1964. //>>excludeEnd("ctx");
  1965. var $2,$1,$4,$3,$5,$6,$7,$8,$9,$11,$10;
  1966. oldClass=$recv(self["@builder"])._copyClass_named_($globals.ObjectMock,"ObjectMock2");
  1967. $2=$recv($globals.Smalltalk)._globals();
  1968. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1969. $ctx1.sendIdx["globals"]=1;
  1970. //>>excludeEnd("ctx");
  1971. $1=$recv($2)._at_("ObjectMock2");
  1972. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1973. $ctx1.sendIdx["at:"]=1;
  1974. //>>excludeEnd("ctx");
  1975. instance=$recv($1)._new();
  1976. $4=$recv($globals.Smalltalk)._globals();
  1977. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1978. $ctx1.sendIdx["globals"]=2;
  1979. //>>excludeEnd("ctx");
  1980. $3=$recv($4)._at_("ObjectMock2");
  1981. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1982. $ctx1.sendIdx["at:"]=2;
  1983. //>>excludeEnd("ctx");
  1984. $recv($globals.ObjectMock)._subclass_instanceVariableNames_package_($3,"","Kernel-Tests");
  1985. $5=$recv(oldClass).__eq_eq($globals.ObjectMock2);
  1986. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1987. $ctx1.sendIdx["=="]=1;
  1988. //>>excludeEnd("ctx");
  1989. self._deny_($5);
  1990. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1991. $ctx1.sendIdx["deny:"]=1;
  1992. //>>excludeEnd("ctx");
  1993. $6=$recv($recv($globals.ObjectMock2)._superclass()).__eq_eq($globals.ObjectMock);
  1994. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1995. $ctx1.sendIdx["=="]=2;
  1996. //>>excludeEnd("ctx");
  1997. self._assert_($6);
  1998. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1999. $ctx1.sendIdx["assert:"]=1;
  2000. //>>excludeEnd("ctx");
  2001. self._assert_($recv($recv($globals.ObjectMock2)._instanceVariableNames())._isEmpty());
  2002. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2003. $ctx1.sendIdx["assert:"]=2;
  2004. //>>excludeEnd("ctx");
  2005. $7=$recv($globals.ObjectMock2)._selectors();
  2006. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2007. $ctx1.sendIdx["selectors"]=1;
  2008. //>>excludeEnd("ctx");
  2009. self._assert_equals_($7,$recv(oldClass)._selectors());
  2010. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2011. $ctx1.sendIdx["assert:equals:"]=1;
  2012. //>>excludeEnd("ctx");
  2013. $8=$recv($globals.ObjectMock2)._comment();
  2014. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2015. $ctx1.sendIdx["comment"]=1;
  2016. //>>excludeEnd("ctx");
  2017. self._assert_equals_($8,$recv(oldClass)._comment());
  2018. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2019. $ctx1.sendIdx["assert:equals:"]=2;
  2020. //>>excludeEnd("ctx");
  2021. $9=$recv($recv($globals.ObjectMock2)._package())._name();
  2022. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2023. $ctx1.sendIdx["name"]=1;
  2024. //>>excludeEnd("ctx");
  2025. self._assert_equals_($9,"Kernel-Tests");
  2026. $11=$recv(instance)._class();
  2027. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2028. $ctx1.sendIdx["class"]=1;
  2029. //>>excludeEnd("ctx");
  2030. $10=$recv($11).__eq_eq($globals.ObjectMock2);
  2031. self._deny_($10);
  2032. self._assert_($recv($recv($recv($globals.Smalltalk)._globals())._at_($recv($recv(instance)._class())._name()))._isNil());
  2033. $recv($globals.Smalltalk)._removeClass_($globals.ObjectMock2);
  2034. return self;
  2035. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2036. }, function($ctx1) {$ctx1.fill(self,"testClassMigration",{instance:instance,oldClass:oldClass},$globals.ClassBuilderTest)});
  2037. //>>excludeEnd("ctx");
  2038. },
  2039. //>>excludeStart("ide", pragmas.excludeIdeData);
  2040. args: [],
  2041. 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\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",
  2042. referencedClasses: ["ObjectMock", "Smalltalk", "ObjectMock2"],
  2043. //>>excludeEnd("ide");
  2044. messageSends: ["copyClass:named:", "new", "at:", "globals", "subclass:instanceVariableNames:package:", "deny:", "==", "assert:", "superclass", "isEmpty", "instanceVariableNames", "assert:equals:", "selectors", "comment", "name", "package", "class", "isNil", "removeClass:"]
  2045. }),
  2046. $globals.ClassBuilderTest);
  2047. $core.addMethod(
  2048. $core.method({
  2049. selector: "testClassMigrationWithClassInstanceVariables",
  2050. protocol: 'tests',
  2051. fn: function (){
  2052. var self=this;
  2053. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2054. return $core.withContext(function($ctx1) {
  2055. //>>excludeEnd("ctx");
  2056. var $1;
  2057. $recv(self["@builder"])._copyClass_named_($globals.ObjectMock,"ObjectMock2");
  2058. $1=$recv($globals.ObjectMock2)._class();
  2059. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2060. $ctx1.sendIdx["class"]=1;
  2061. //>>excludeEnd("ctx");
  2062. $recv($1)._instanceVariableNames_("foo bar");
  2063. $recv($globals.ObjectMock)._subclass_instanceVariableNames_package_($recv($recv($globals.Smalltalk)._globals())._at_("ObjectMock2"),"","Kernel-Tests");
  2064. self._assert_equals_($recv($recv($globals.ObjectMock2)._class())._instanceVariableNames(),["foo", "bar"]);
  2065. $recv($globals.Smalltalk)._removeClass_($globals.ObjectMock2);
  2066. return self;
  2067. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2068. }, function($ctx1) {$ctx1.fill(self,"testClassMigrationWithClassInstanceVariables",{},$globals.ClassBuilderTest)});
  2069. //>>excludeEnd("ctx");
  2070. },
  2071. //>>excludeStart("ide", pragmas.excludeIdeData);
  2072. args: [],
  2073. 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",
  2074. referencedClasses: ["ObjectMock", "ObjectMock2", "Smalltalk"],
  2075. //>>excludeEnd("ide");
  2076. messageSends: ["copyClass:named:", "instanceVariableNames:", "class", "subclass:instanceVariableNames:package:", "at:", "globals", "assert:equals:", "instanceVariableNames", "removeClass:"]
  2077. }),
  2078. $globals.ClassBuilderTest);
  2079. $core.addMethod(
  2080. $core.method({
  2081. selector: "testClassMigrationWithSubclasses",
  2082. protocol: 'tests',
  2083. fn: function (){
  2084. var self=this;
  2085. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2086. return $core.withContext(function($ctx1) {
  2087. //>>excludeEnd("ctx");
  2088. var $2,$1,$4,$3;
  2089. $recv(self["@builder"])._copyClass_named_($globals.ObjectMock,"ObjectMock2");
  2090. $recv($globals.ObjectMock2)._subclass_instanceVariableNames_package_("ObjectMock3","","Kernel-Tests");
  2091. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2092. $ctx1.sendIdx["subclass:instanceVariableNames:package:"]=1;
  2093. //>>excludeEnd("ctx");
  2094. $recv($globals.ObjectMock3)._subclass_instanceVariableNames_package_("ObjectMock4","","Kernel-Tests");
  2095. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2096. $ctx1.sendIdx["subclass:instanceVariableNames:package:"]=2;
  2097. //>>excludeEnd("ctx");
  2098. $recv($globals.ObjectMock)._subclass_instanceVariableNames_package_($recv($recv($globals.Smalltalk)._globals())._at_("ObjectMock2"),"","Kernel-Tests");
  2099. $2=$recv($globals.ObjectMock)._subclasses();
  2100. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2101. $ctx1.sendIdx["subclasses"]=1;
  2102. //>>excludeEnd("ctx");
  2103. $1=$recv($2)._includes_($globals.ObjectMock2);
  2104. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2105. $ctx1.sendIdx["includes:"]=1;
  2106. //>>excludeEnd("ctx");
  2107. self._assert_($1);
  2108. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2109. $ctx1.sendIdx["assert:"]=1;
  2110. //>>excludeEnd("ctx");
  2111. $4=$recv($globals.ObjectMock2)._subclasses();
  2112. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2113. $ctx1.sendIdx["subclasses"]=2;
  2114. //>>excludeEnd("ctx");
  2115. $3=$recv($4)._includes_($globals.ObjectMock3);
  2116. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2117. $ctx1.sendIdx["includes:"]=2;
  2118. //>>excludeEnd("ctx");
  2119. self._assert_($3);
  2120. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2121. $ctx1.sendIdx["assert:"]=2;
  2122. //>>excludeEnd("ctx");
  2123. self._assert_($recv($recv($globals.ObjectMock3)._subclasses())._includes_($globals.ObjectMock4));
  2124. $recv($recv($globals.ObjectMock)._allSubclasses())._do_((function(each){
  2125. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2126. return $core.withContext(function($ctx2) {
  2127. //>>excludeEnd("ctx");
  2128. return $recv($globals.Smalltalk)._removeClass_(each);
  2129. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2130. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2131. //>>excludeEnd("ctx");
  2132. }));
  2133. return self;
  2134. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2135. }, function($ctx1) {$ctx1.fill(self,"testClassMigrationWithSubclasses",{},$globals.ClassBuilderTest)});
  2136. //>>excludeEnd("ctx");
  2137. },
  2138. //>>excludeStart("ide", pragmas.excludeIdeData);
  2139. args: [],
  2140. 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 do: [ :each | Smalltalk removeClass: each ]",
  2141. referencedClasses: ["ObjectMock", "ObjectMock2", "ObjectMock3", "Smalltalk", "ObjectMock4"],
  2142. //>>excludeEnd("ide");
  2143. messageSends: ["copyClass:named:", "subclass:instanceVariableNames:package:", "at:", "globals", "assert:", "includes:", "subclasses", "do:", "allSubclasses", "removeClass:"]
  2144. }),
  2145. $globals.ClassBuilderTest);
  2146. $core.addMethod(
  2147. $core.method({
  2148. selector: "testInstanceVariableNames",
  2149. protocol: 'tests',
  2150. fn: function (){
  2151. var self=this;
  2152. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2153. return $core.withContext(function($ctx1) {
  2154. //>>excludeEnd("ctx");
  2155. self._assert_equals_($recv(self["@builder"])._instanceVariableNamesFor_(" hello world "),["hello", "world"]);
  2156. return self;
  2157. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2158. }, function($ctx1) {$ctx1.fill(self,"testInstanceVariableNames",{},$globals.ClassBuilderTest)});
  2159. //>>excludeEnd("ctx");
  2160. },
  2161. //>>excludeStart("ide", pragmas.excludeIdeData);
  2162. args: [],
  2163. source: "testInstanceVariableNames\x0a\x09self assert: (builder instanceVariableNamesFor: ' hello world ') equals: #('hello' 'world')",
  2164. referencedClasses: [],
  2165. //>>excludeEnd("ide");
  2166. messageSends: ["assert:equals:", "instanceVariableNamesFor:"]
  2167. }),
  2168. $globals.ClassBuilderTest);
  2169. $core.addClass('ClassTest', $globals.TestCase, ['builder', 'theClass'], 'Kernel-Tests');
  2170. $core.addMethod(
  2171. $core.method({
  2172. selector: "jsConstructor",
  2173. protocol: 'running',
  2174. fn: function (){
  2175. var self=this;
  2176. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2177. return $core.withContext(function($ctx1) {
  2178. //>>excludeEnd("ctx");
  2179. function Foo(){}
  2180. Foo.prototype.valueOf = function () {return 4;};
  2181. return Foo;
  2182. ;
  2183. return self;
  2184. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2185. }, function($ctx1) {$ctx1.fill(self,"jsConstructor",{},$globals.ClassTest)});
  2186. //>>excludeEnd("ctx");
  2187. },
  2188. //>>excludeStart("ide", pragmas.excludeIdeData);
  2189. args: [],
  2190. source: "jsConstructor\x0a\x09<\x0a\x09\x09function Foo(){}\x0a\x09\x09Foo.prototype.valueOf = function () {return 4;};\x0a\x09\x09return Foo;\x0a\x09>",
  2191. referencedClasses: [],
  2192. //>>excludeEnd("ide");
  2193. messageSends: []
  2194. }),
  2195. $globals.ClassTest);
  2196. $core.addMethod(
  2197. $core.method({
  2198. selector: "setUp",
  2199. protocol: 'running',
  2200. fn: function (){
  2201. var self=this;
  2202. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2203. return $core.withContext(function($ctx1) {
  2204. //>>excludeEnd("ctx");
  2205. self["@builder"]=$recv($globals.ClassBuilder)._new();
  2206. return self;
  2207. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2208. }, function($ctx1) {$ctx1.fill(self,"setUp",{},$globals.ClassTest)});
  2209. //>>excludeEnd("ctx");
  2210. },
  2211. //>>excludeStart("ide", pragmas.excludeIdeData);
  2212. args: [],
  2213. source: "setUp\x0a\x09builder := ClassBuilder new",
  2214. referencedClasses: ["ClassBuilder"],
  2215. //>>excludeEnd("ide");
  2216. messageSends: ["new"]
  2217. }),
  2218. $globals.ClassTest);
  2219. $core.addMethod(
  2220. $core.method({
  2221. selector: "tearDown",
  2222. protocol: 'running',
  2223. fn: function (){
  2224. var self=this;
  2225. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2226. return $core.withContext(function($ctx1) {
  2227. //>>excludeEnd("ctx");
  2228. var $1,$receiver;
  2229. $1=self["@theClass"];
  2230. if(($receiver = $1) == null || $receiver.isNil){
  2231. $1;
  2232. } else {
  2233. $recv($globals.Smalltalk)._removeClass_(self["@theClass"]);
  2234. self["@theClass"]=nil;
  2235. self["@theClass"];
  2236. };
  2237. return self;
  2238. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2239. }, function($ctx1) {$ctx1.fill(self,"tearDown",{},$globals.ClassTest)});
  2240. //>>excludeEnd("ctx");
  2241. },
  2242. //>>excludeStart("ide", pragmas.excludeIdeData);
  2243. args: [],
  2244. source: "tearDown\x0a\x09theClass ifNotNil: [ Smalltalk removeClass: theClass. theClass := nil ]",
  2245. referencedClasses: ["Smalltalk"],
  2246. //>>excludeEnd("ide");
  2247. messageSends: ["ifNotNil:", "removeClass:"]
  2248. }),
  2249. $globals.ClassTest);
  2250. $core.addMethod(
  2251. $core.method({
  2252. selector: "testAllSubclasses",
  2253. protocol: 'tests',
  2254. fn: function (){
  2255. var self=this;
  2256. var subclasses,index;
  2257. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2258. return $core.withContext(function($ctx1) {
  2259. //>>excludeEnd("ctx");
  2260. subclasses=$recv($globals.Object)._subclasses();
  2261. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2262. $ctx1.sendIdx["subclasses"]=1;
  2263. //>>excludeEnd("ctx");
  2264. index=(1);
  2265. $recv((function(){
  2266. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2267. return $core.withContext(function($ctx2) {
  2268. //>>excludeEnd("ctx");
  2269. return $recv(index).__gt($recv(subclasses)._size());
  2270. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2271. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  2272. //>>excludeEnd("ctx");
  2273. }))._whileFalse_((function(){
  2274. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2275. return $core.withContext(function($ctx2) {
  2276. //>>excludeEnd("ctx");
  2277. $recv(subclasses)._addAll_($recv($recv(subclasses)._at_(index))._subclasses());
  2278. index=$recv(index).__plus((1));
  2279. return index;
  2280. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2281. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  2282. //>>excludeEnd("ctx");
  2283. }));
  2284. self._assert_equals_($recv($globals.Object)._allSubclasses(),subclasses);
  2285. return self;
  2286. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2287. }, function($ctx1) {$ctx1.fill(self,"testAllSubclasses",{subclasses:subclasses,index:index},$globals.ClassTest)});
  2288. //>>excludeEnd("ctx");
  2289. },
  2290. //>>excludeStart("ide", pragmas.excludeIdeData);
  2291. args: [],
  2292. 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",
  2293. referencedClasses: ["Object"],
  2294. //>>excludeEnd("ide");
  2295. messageSends: ["subclasses", "whileFalse:", ">", "size", "addAll:", "at:", "+", "assert:equals:", "allSubclasses"]
  2296. }),
  2297. $globals.ClassTest);
  2298. $core.addMethod(
  2299. $core.method({
  2300. selector: "testMetaclassSubclasses",
  2301. protocol: 'tests',
  2302. fn: function (){
  2303. var self=this;
  2304. var subclasses;
  2305. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2306. return $core.withContext(function($ctx1) {
  2307. //>>excludeEnd("ctx");
  2308. var $4,$3,$2,$1;
  2309. $4=$recv($globals.Object)._class();
  2310. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2311. $ctx1.sendIdx["class"]=1;
  2312. //>>excludeEnd("ctx");
  2313. $3=$recv($4)._instanceClass();
  2314. $2=$recv($3)._subclasses();
  2315. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2316. $ctx1.sendIdx["subclasses"]=1;
  2317. //>>excludeEnd("ctx");
  2318. $1=$recv($2)._select_((function(each){
  2319. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2320. return $core.withContext(function($ctx2) {
  2321. //>>excludeEnd("ctx");
  2322. return $recv($recv(each)._isMetaclass())._not();
  2323. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2324. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2325. //>>excludeEnd("ctx");
  2326. }));
  2327. subclasses=$recv($1)._collect_((function(each){
  2328. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2329. return $core.withContext(function($ctx2) {
  2330. //>>excludeEnd("ctx");
  2331. return $recv(each)._theMetaClass();
  2332. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2333. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
  2334. //>>excludeEnd("ctx");
  2335. }));
  2336. self._assert_equals_($recv($recv($globals.Object)._class())._subclasses(),subclasses);
  2337. return self;
  2338. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2339. }, function($ctx1) {$ctx1.fill(self,"testMetaclassSubclasses",{subclasses:subclasses},$globals.ClassTest)});
  2340. //>>excludeEnd("ctx");
  2341. },
  2342. //>>excludeStart("ide", pragmas.excludeIdeData);
  2343. args: [],
  2344. 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",
  2345. referencedClasses: ["Object"],
  2346. //>>excludeEnd("ide");
  2347. messageSends: ["collect:", "select:", "subclasses", "instanceClass", "class", "not", "isMetaclass", "theMetaClass", "assert:equals:"]
  2348. }),
  2349. $globals.ClassTest);
  2350. $core.addMethod(
  2351. $core.method({
  2352. selector: "testSetJavaScriptConstructor",
  2353. protocol: 'tests',
  2354. fn: function (){
  2355. var self=this;
  2356. var instance;
  2357. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2358. return $core.withContext(function($ctx1) {
  2359. //>>excludeEnd("ctx");
  2360. var $2,$1,$4,$3,$6,$5,$8,$7;
  2361. self["@theClass"]=$recv(self["@builder"])._copyClass_named_($globals.ObjectMock,"ObjectMock2");
  2362. $recv(self["@theClass"])._javascriptConstructor_(self._jsConstructor());
  2363. $2=$recv(self["@theClass"])._superclass();
  2364. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2365. $ctx1.sendIdx["superclass"]=1;
  2366. //>>excludeEnd("ctx");
  2367. $1=$recv($2).__eq_eq($recv($globals.ObjectMock)._superclass());
  2368. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2369. $ctx1.sendIdx["=="]=1;
  2370. //>>excludeEnd("ctx");
  2371. self._assert_($1);
  2372. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2373. $ctx1.sendIdx["assert:"]=1;
  2374. //>>excludeEnd("ctx");
  2375. $4=$recv(self["@theClass"])._instanceVariableNames();
  2376. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2377. $ctx1.sendIdx["instanceVariableNames"]=1;
  2378. //>>excludeEnd("ctx");
  2379. $3=$recv($4).__eq_eq($recv($globals.ObjectMock)._instanceVariableNames());
  2380. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2381. $ctx1.sendIdx["=="]=2;
  2382. //>>excludeEnd("ctx");
  2383. self._assert_($3);
  2384. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2385. $ctx1.sendIdx["assert:"]=2;
  2386. //>>excludeEnd("ctx");
  2387. self._assert_equals_($recv(self["@theClass"])._name(),"ObjectMock2");
  2388. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2389. $ctx1.sendIdx["assert:equals:"]=1;
  2390. //>>excludeEnd("ctx");
  2391. $6=$recv(self["@theClass"])._package();
  2392. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2393. $ctx1.sendIdx["package"]=1;
  2394. //>>excludeEnd("ctx");
  2395. $5=$recv($6).__eq_eq($recv($globals.ObjectMock)._package());
  2396. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2397. $ctx1.sendIdx["=="]=3;
  2398. //>>excludeEnd("ctx");
  2399. self._assert_($5);
  2400. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2401. $ctx1.sendIdx["assert:"]=3;
  2402. //>>excludeEnd("ctx");
  2403. $8=$recv(self["@theClass"])._methodDictionary();
  2404. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2405. $ctx1.sendIdx["methodDictionary"]=1;
  2406. //>>excludeEnd("ctx");
  2407. $7=$recv($8)._keys();
  2408. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2409. $ctx1.sendIdx["keys"]=1;
  2410. //>>excludeEnd("ctx");
  2411. self._assert_equals_($7,$recv($recv($globals.ObjectMock)._methodDictionary())._keys());
  2412. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2413. $ctx1.sendIdx["assert:equals:"]=2;
  2414. //>>excludeEnd("ctx");
  2415. instance=$recv(self["@theClass"])._new();
  2416. self._assert_($recv($recv(instance)._class()).__eq_eq(self["@theClass"]));
  2417. self._assert_equals_($recv(instance)._value(),(4));
  2418. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2419. $ctx1.sendIdx["assert:equals:"]=3;
  2420. //>>excludeEnd("ctx");
  2421. self._shouldnt_raise_((function(){
  2422. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2423. return $core.withContext(function($ctx2) {
  2424. //>>excludeEnd("ctx");
  2425. return $recv(instance)._foo_((9));
  2426. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2427. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  2428. //>>excludeEnd("ctx");
  2429. }),$globals.Error);
  2430. self._assert_equals_($recv(instance)._foo(),(9));
  2431. return self;
  2432. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2433. }, function($ctx1) {$ctx1.fill(self,"testSetJavaScriptConstructor",{instance:instance},$globals.ClassTest)});
  2434. //>>excludeEnd("ctx");
  2435. },
  2436. //>>excludeStart("ide", pragmas.excludeIdeData);
  2437. args: [],
  2438. 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",
  2439. referencedClasses: ["ObjectMock", "Error"],
  2440. //>>excludeEnd("ide");
  2441. messageSends: ["copyClass:named:", "javascriptConstructor:", "jsConstructor", "assert:", "==", "superclass", "instanceVariableNames", "assert:equals:", "name", "package", "keys", "methodDictionary", "new", "class", "value", "shouldnt:raise:", "foo:", "foo"]
  2442. }),
  2443. $globals.ClassTest);
  2444. $core.addMethod(
  2445. $core.method({
  2446. selector: "testTrickySetJavaScriptConstructor",
  2447. protocol: 'tests',
  2448. fn: function (){
  2449. var self=this;
  2450. var instance;
  2451. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2452. return $core.withContext(function($ctx1) {
  2453. //>>excludeEnd("ctx");
  2454. var $2,$1,$4,$3,$6,$5,$8,$7;
  2455. self["@theClass"]=$recv(self["@builder"])._copyClass_named_($globals.ObjectMock,"ObjectMock2");
  2456. $recv(self["@theClass"])._javascriptConstructor_(self._trickyJsConstructor());
  2457. $2=$recv(self["@theClass"])._superclass();
  2458. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2459. $ctx1.sendIdx["superclass"]=1;
  2460. //>>excludeEnd("ctx");
  2461. $1=$recv($2).__eq_eq($recv($globals.ObjectMock)._superclass());
  2462. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2463. $ctx1.sendIdx["=="]=1;
  2464. //>>excludeEnd("ctx");
  2465. self._assert_($1);
  2466. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2467. $ctx1.sendIdx["assert:"]=1;
  2468. //>>excludeEnd("ctx");
  2469. $4=$recv(self["@theClass"])._instanceVariableNames();
  2470. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2471. $ctx1.sendIdx["instanceVariableNames"]=1;
  2472. //>>excludeEnd("ctx");
  2473. $3=$recv($4).__eq_eq($recv($globals.ObjectMock)._instanceVariableNames());
  2474. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2475. $ctx1.sendIdx["=="]=2;
  2476. //>>excludeEnd("ctx");
  2477. self._assert_($3);
  2478. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2479. $ctx1.sendIdx["assert:"]=2;
  2480. //>>excludeEnd("ctx");
  2481. self._assert_equals_($recv(self["@theClass"])._name(),"ObjectMock2");
  2482. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2483. $ctx1.sendIdx["assert:equals:"]=1;
  2484. //>>excludeEnd("ctx");
  2485. $6=$recv(self["@theClass"])._package();
  2486. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2487. $ctx1.sendIdx["package"]=1;
  2488. //>>excludeEnd("ctx");
  2489. $5=$recv($6).__eq_eq($recv($globals.ObjectMock)._package());
  2490. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2491. $ctx1.sendIdx["=="]=3;
  2492. //>>excludeEnd("ctx");
  2493. self._assert_($5);
  2494. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2495. $ctx1.sendIdx["assert:"]=3;
  2496. //>>excludeEnd("ctx");
  2497. $8=$recv(self["@theClass"])._methodDictionary();
  2498. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2499. $ctx1.sendIdx["methodDictionary"]=1;
  2500. //>>excludeEnd("ctx");
  2501. $7=$recv($8)._keys();
  2502. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2503. $ctx1.sendIdx["keys"]=1;
  2504. //>>excludeEnd("ctx");
  2505. self._assert_equals_($7,$recv($recv($globals.ObjectMock)._methodDictionary())._keys());
  2506. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2507. $ctx1.sendIdx["assert:equals:"]=2;
  2508. //>>excludeEnd("ctx");
  2509. instance=$recv(self["@theClass"])._new();
  2510. self._assert_($recv($recv(instance)._class()).__eq_eq(self["@theClass"]));
  2511. self._assert_equals_($recv(instance)._value(),(4));
  2512. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2513. $ctx1.sendIdx["assert:equals:"]=3;
  2514. //>>excludeEnd("ctx");
  2515. self._shouldnt_raise_((function(){
  2516. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2517. return $core.withContext(function($ctx2) {
  2518. //>>excludeEnd("ctx");
  2519. return $recv(instance)._foo_((9));
  2520. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2521. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  2522. //>>excludeEnd("ctx");
  2523. }),$globals.Error);
  2524. self._assert_equals_($recv(instance)._foo(),(9));
  2525. return self;
  2526. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2527. }, function($ctx1) {$ctx1.fill(self,"testTrickySetJavaScriptConstructor",{instance:instance},$globals.ClassTest)});
  2528. //>>excludeEnd("ctx");
  2529. },
  2530. //>>excludeStart("ide", pragmas.excludeIdeData);
  2531. args: [],
  2532. 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",
  2533. referencedClasses: ["ObjectMock", "Error"],
  2534. //>>excludeEnd("ide");
  2535. messageSends: ["copyClass:named:", "javascriptConstructor:", "trickyJsConstructor", "assert:", "==", "superclass", "instanceVariableNames", "assert:equals:", "name", "package", "keys", "methodDictionary", "new", "class", "value", "shouldnt:raise:", "foo:", "foo"]
  2536. }),
  2537. $globals.ClassTest);
  2538. $core.addMethod(
  2539. $core.method({
  2540. selector: "trickyJsConstructor",
  2541. protocol: 'running',
  2542. fn: function (){
  2543. var self=this;
  2544. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2545. return $core.withContext(function($ctx1) {
  2546. //>>excludeEnd("ctx");
  2547. function Foo(){}
  2548. Foo.prototype.valueOf = function () {return 4;};
  2549. Foo.prototype._foo = function () {return "bar";};
  2550. return Foo;
  2551. ;
  2552. return self;
  2553. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2554. }, function($ctx1) {$ctx1.fill(self,"trickyJsConstructor",{},$globals.ClassTest)});
  2555. //>>excludeEnd("ctx");
  2556. },
  2557. //>>excludeStart("ide", pragmas.excludeIdeData);
  2558. args: [],
  2559. source: "trickyJsConstructor\x0a\x09<\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>",
  2560. referencedClasses: [],
  2561. //>>excludeEnd("ide");
  2562. messageSends: []
  2563. }),
  2564. $globals.ClassTest);
  2565. $core.addClass('CollectionTest', $globals.TestCase, ['sampleBlock'], 'Kernel-Tests');
  2566. $core.addMethod(
  2567. $core.method({
  2568. selector: "assertSameContents:as:",
  2569. protocol: 'convenience',
  2570. fn: function (aCollection,anotherCollection){
  2571. var self=this;
  2572. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2573. return $core.withContext(function($ctx1) {
  2574. //>>excludeEnd("ctx");
  2575. var $2,$1,$4,$3;
  2576. $2=$recv(aCollection)._size();
  2577. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2578. $ctx1.sendIdx["size"]=1;
  2579. //>>excludeEnd("ctx");
  2580. $1=$recv($2).__eq($recv(anotherCollection)._size());
  2581. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2582. $ctx1.sendIdx["="]=1;
  2583. //>>excludeEnd("ctx");
  2584. self._assert_($1);
  2585. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2586. $ctx1.sendIdx["assert:"]=1;
  2587. //>>excludeEnd("ctx");
  2588. $recv(aCollection)._do_((function(each){
  2589. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2590. return $core.withContext(function($ctx2) {
  2591. //>>excludeEnd("ctx");
  2592. $4=$recv(aCollection)._occurrencesOf_(each);
  2593. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2594. $ctx2.sendIdx["occurrencesOf:"]=1;
  2595. //>>excludeEnd("ctx");
  2596. $3=$recv($4).__eq($recv(anotherCollection)._occurrencesOf_(each));
  2597. return self._assert_($3);
  2598. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2599. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2600. //>>excludeEnd("ctx");
  2601. }));
  2602. return self;
  2603. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2604. }, function($ctx1) {$ctx1.fill(self,"assertSameContents:as:",{aCollection:aCollection,anotherCollection:anotherCollection},$globals.CollectionTest)});
  2605. //>>excludeEnd("ctx");
  2606. },
  2607. //>>excludeStart("ide", pragmas.excludeIdeData);
  2608. args: ["aCollection", "anotherCollection"],
  2609. 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)) ]",
  2610. referencedClasses: [],
  2611. //>>excludeEnd("ide");
  2612. messageSends: ["assert:", "=", "size", "do:", "occurrencesOf:"]
  2613. }),
  2614. $globals.CollectionTest);
  2615. $core.addMethod(
  2616. $core.method({
  2617. selector: "collection",
  2618. protocol: 'fixture',
  2619. fn: function (){
  2620. var self=this;
  2621. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2622. return $core.withContext(function($ctx1) {
  2623. //>>excludeEnd("ctx");
  2624. self._subclassResponsibility();
  2625. return self;
  2626. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2627. }, function($ctx1) {$ctx1.fill(self,"collection",{},$globals.CollectionTest)});
  2628. //>>excludeEnd("ctx");
  2629. },
  2630. //>>excludeStart("ide", pragmas.excludeIdeData);
  2631. args: [],
  2632. source: "collection\x0a\x09\x22Answers pre-filled collection of type tested.\x22\x0a\x0a\x09self subclassResponsibility",
  2633. referencedClasses: [],
  2634. //>>excludeEnd("ide");
  2635. messageSends: ["subclassResponsibility"]
  2636. }),
  2637. $globals.CollectionTest);
  2638. $core.addMethod(
  2639. $core.method({
  2640. selector: "collectionClass",
  2641. protocol: 'fixture',
  2642. fn: function (){
  2643. var self=this;
  2644. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2645. return $core.withContext(function($ctx1) {
  2646. //>>excludeEnd("ctx");
  2647. return $recv(self._class())._collectionClass();
  2648. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2649. }, function($ctx1) {$ctx1.fill(self,"collectionClass",{},$globals.CollectionTest)});
  2650. //>>excludeEnd("ctx");
  2651. },
  2652. //>>excludeStart("ide", pragmas.excludeIdeData);
  2653. args: [],
  2654. source: "collectionClass\x0a\x09\x22Answers class of collection type tested\x22\x0a\x0a\x09^ self class collectionClass",
  2655. referencedClasses: [],
  2656. //>>excludeEnd("ide");
  2657. messageSends: ["collectionClass", "class"]
  2658. }),
  2659. $globals.CollectionTest);
  2660. $core.addMethod(
  2661. $core.method({
  2662. selector: "collectionOfPrintStrings",
  2663. protocol: 'fixture',
  2664. fn: function (){
  2665. var self=this;
  2666. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2667. return $core.withContext(function($ctx1) {
  2668. //>>excludeEnd("ctx");
  2669. self._subclassResponsibility();
  2670. return self;
  2671. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2672. }, function($ctx1) {$ctx1.fill(self,"collectionOfPrintStrings",{},$globals.CollectionTest)});
  2673. //>>excludeEnd("ctx");
  2674. },
  2675. //>>excludeStart("ide", pragmas.excludeIdeData);
  2676. args: [],
  2677. source: "collectionOfPrintStrings\x0a\x09\x22Answers self collection but with values\x0a\x09changed to their printStrings\x22\x0a\x0a\x09self subclassResponsibility",
  2678. referencedClasses: [],
  2679. //>>excludeEnd("ide");
  2680. messageSends: ["subclassResponsibility"]
  2681. }),
  2682. $globals.CollectionTest);
  2683. $core.addMethod(
  2684. $core.method({
  2685. selector: "collectionSize",
  2686. protocol: 'fixture',
  2687. fn: function (){
  2688. var self=this;
  2689. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2690. return $core.withContext(function($ctx1) {
  2691. //>>excludeEnd("ctx");
  2692. self._subclassResponsibility();
  2693. return self;
  2694. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2695. }, function($ctx1) {$ctx1.fill(self,"collectionSize",{},$globals.CollectionTest)});
  2696. //>>excludeEnd("ctx");
  2697. },
  2698. //>>excludeStart("ide", pragmas.excludeIdeData);
  2699. args: [],
  2700. source: "collectionSize\x0a\x09\x22Answers size of self collection.\x22\x0a\x0a\x09self subclassResponsibility",
  2701. referencedClasses: [],
  2702. //>>excludeEnd("ide");
  2703. messageSends: ["subclassResponsibility"]
  2704. }),
  2705. $globals.CollectionTest);
  2706. $core.addMethod(
  2707. $core.method({
  2708. selector: "collectionWithDuplicates",
  2709. protocol: 'fixture',
  2710. fn: function (){
  2711. var self=this;
  2712. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2713. return $core.withContext(function($ctx1) {
  2714. //>>excludeEnd("ctx");
  2715. self._subclassResponsibility();
  2716. return self;
  2717. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2718. }, function($ctx1) {$ctx1.fill(self,"collectionWithDuplicates",{},$globals.CollectionTest)});
  2719. //>>excludeEnd("ctx");
  2720. },
  2721. //>>excludeStart("ide", pragmas.excludeIdeData);
  2722. args: [],
  2723. 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",
  2724. referencedClasses: [],
  2725. //>>excludeEnd("ide");
  2726. messageSends: ["subclassResponsibility"]
  2727. }),
  2728. $globals.CollectionTest);
  2729. $core.addMethod(
  2730. $core.method({
  2731. selector: "collectionWithNewValue",
  2732. protocol: 'fixture',
  2733. fn: function (){
  2734. var self=this;
  2735. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2736. return $core.withContext(function($ctx1) {
  2737. //>>excludeEnd("ctx");
  2738. self._subclassResponsibility();
  2739. return self;
  2740. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2741. }, function($ctx1) {$ctx1.fill(self,"collectionWithNewValue",{},$globals.CollectionTest)});
  2742. //>>excludeEnd("ctx");
  2743. },
  2744. //>>excludeStart("ide", pragmas.excludeIdeData);
  2745. args: [],
  2746. 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",
  2747. referencedClasses: [],
  2748. //>>excludeEnd("ide");
  2749. messageSends: ["subclassResponsibility"]
  2750. }),
  2751. $globals.CollectionTest);
  2752. $core.addMethod(
  2753. $core.method({
  2754. selector: "initialize",
  2755. protocol: 'initialization',
  2756. fn: function (){
  2757. var self=this;
  2758. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2759. return $core.withContext(function($ctx1) {
  2760. //>>excludeEnd("ctx");
  2761. (
  2762. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2763. $ctx1.supercall = true,
  2764. //>>excludeEnd("ctx");
  2765. ($globals.CollectionTest.superclass||$boot.dnu).fn.prototype._initialize.apply($recv(self), []));
  2766. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2767. $ctx1.supercall = false;
  2768. //>>excludeEnd("ctx");;
  2769. self["@sampleBlock"]=(function(){
  2770. });
  2771. return self;
  2772. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2773. }, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.CollectionTest)});
  2774. //>>excludeEnd("ctx");
  2775. },
  2776. //>>excludeStart("ide", pragmas.excludeIdeData);
  2777. args: [],
  2778. source: "initialize\x0a\x09super initialize.\x0a\x0a\x09sampleBlock := []",
  2779. referencedClasses: [],
  2780. //>>excludeEnd("ide");
  2781. messageSends: ["initialize"]
  2782. }),
  2783. $globals.CollectionTest);
  2784. $core.addMethod(
  2785. $core.method({
  2786. selector: "isCollectionReadOnly",
  2787. protocol: 'testing',
  2788. fn: function (){
  2789. var self=this;
  2790. return false;
  2791. },
  2792. //>>excludeStart("ide", pragmas.excludeIdeData);
  2793. args: [],
  2794. source: "isCollectionReadOnly\x0a\x09^ false",
  2795. referencedClasses: [],
  2796. //>>excludeEnd("ide");
  2797. messageSends: []
  2798. }),
  2799. $globals.CollectionTest);
  2800. $core.addMethod(
  2801. $core.method({
  2802. selector: "sampleNewValue",
  2803. protocol: 'fixture',
  2804. fn: function (){
  2805. var self=this;
  2806. return "N";
  2807. },
  2808. //>>excludeStart("ide", pragmas.excludeIdeData);
  2809. args: [],
  2810. 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'",
  2811. referencedClasses: [],
  2812. //>>excludeEnd("ide");
  2813. messageSends: []
  2814. }),
  2815. $globals.CollectionTest);
  2816. $core.addMethod(
  2817. $core.method({
  2818. selector: "sampleNewValueAsCollection",
  2819. protocol: 'fixture',
  2820. fn: function (){
  2821. var self=this;
  2822. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2823. return $core.withContext(function($ctx1) {
  2824. //>>excludeEnd("ctx");
  2825. return $recv(self._collectionClass())._with_(self._sampleNewValue());
  2826. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2827. }, function($ctx1) {$ctx1.fill(self,"sampleNewValueAsCollection",{},$globals.CollectionTest)});
  2828. //>>excludeEnd("ctx");
  2829. },
  2830. //>>excludeStart("ide", pragmas.excludeIdeData);
  2831. args: [],
  2832. 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",
  2833. referencedClasses: [],
  2834. //>>excludeEnd("ide");
  2835. messageSends: ["with:", "collectionClass", "sampleNewValue"]
  2836. }),
  2837. $globals.CollectionTest);
  2838. $core.addMethod(
  2839. $core.method({
  2840. selector: "testAddAll",
  2841. protocol: 'tests',
  2842. fn: function (){
  2843. var self=this;
  2844. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2845. return $core.withContext(function($ctx1) {
  2846. //>>excludeEnd("ctx");
  2847. 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;
  2848. $2=self._collection();
  2849. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2850. $ctx1.sendIdx["collection"]=1;
  2851. //>>excludeEnd("ctx");
  2852. $4=self._collectionClass();
  2853. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2854. $ctx1.sendIdx["collectionClass"]=1;
  2855. //>>excludeEnd("ctx");
  2856. $3=$recv($4)._new();
  2857. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2858. $ctx1.sendIdx["new"]=1;
  2859. //>>excludeEnd("ctx");
  2860. $recv($2)._addAll_($3);
  2861. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2862. $ctx1.sendIdx["addAll:"]=1;
  2863. //>>excludeEnd("ctx");
  2864. $5=$recv($2)._yourself();
  2865. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2866. $ctx1.sendIdx["yourself"]=1;
  2867. //>>excludeEnd("ctx");
  2868. $1=$5;
  2869. $6=self._collection();
  2870. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2871. $ctx1.sendIdx["collection"]=2;
  2872. //>>excludeEnd("ctx");
  2873. self._assert_equals_($1,$6);
  2874. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2875. $ctx1.sendIdx["assert:equals:"]=1;
  2876. //>>excludeEnd("ctx");
  2877. $9=self._collectionClass();
  2878. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2879. $ctx1.sendIdx["collectionClass"]=2;
  2880. //>>excludeEnd("ctx");
  2881. $8=$recv($9)._new();
  2882. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2883. $ctx1.sendIdx["new"]=2;
  2884. //>>excludeEnd("ctx");
  2885. $10=self._collection();
  2886. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2887. $ctx1.sendIdx["collection"]=3;
  2888. //>>excludeEnd("ctx");
  2889. $recv($8)._addAll_($10);
  2890. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2891. $ctx1.sendIdx["addAll:"]=2;
  2892. //>>excludeEnd("ctx");
  2893. $11=$recv($8)._yourself();
  2894. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2895. $ctx1.sendIdx["yourself"]=2;
  2896. //>>excludeEnd("ctx");
  2897. $7=$11;
  2898. $12=self._collection();
  2899. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2900. $ctx1.sendIdx["collection"]=4;
  2901. //>>excludeEnd("ctx");
  2902. self._assert_equals_($7,$12);
  2903. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2904. $ctx1.sendIdx["assert:equals:"]=2;
  2905. //>>excludeEnd("ctx");
  2906. $15=self._collectionClass();
  2907. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2908. $ctx1.sendIdx["collectionClass"]=3;
  2909. //>>excludeEnd("ctx");
  2910. $14=$recv($15)._new();
  2911. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2912. $ctx1.sendIdx["new"]=3;
  2913. //>>excludeEnd("ctx");
  2914. $17=self._collectionClass();
  2915. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2916. $ctx1.sendIdx["collectionClass"]=4;
  2917. //>>excludeEnd("ctx");
  2918. $16=$recv($17)._new();
  2919. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2920. $ctx1.sendIdx["new"]=4;
  2921. //>>excludeEnd("ctx");
  2922. $recv($14)._addAll_($16);
  2923. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2924. $ctx1.sendIdx["addAll:"]=3;
  2925. //>>excludeEnd("ctx");
  2926. $18=$recv($14)._yourself();
  2927. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2928. $ctx1.sendIdx["yourself"]=3;
  2929. //>>excludeEnd("ctx");
  2930. $13=$18;
  2931. self._assert_equals_($13,$recv(self._collectionClass())._new());
  2932. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2933. $ctx1.sendIdx["assert:equals:"]=3;
  2934. //>>excludeEnd("ctx");
  2935. $20=self._collection();
  2936. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2937. $ctx1.sendIdx["collection"]=5;
  2938. //>>excludeEnd("ctx");
  2939. $21=self._sampleNewValueAsCollection();
  2940. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2941. $ctx1.sendIdx["sampleNewValueAsCollection"]=1;
  2942. //>>excludeEnd("ctx");
  2943. $recv($20)._addAll_($21);
  2944. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2945. $ctx1.sendIdx["addAll:"]=4;
  2946. //>>excludeEnd("ctx");
  2947. $22=$recv($20)._yourself();
  2948. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2949. $ctx1.sendIdx["yourself"]=4;
  2950. //>>excludeEnd("ctx");
  2951. $19=$22;
  2952. $23=self._collectionWithNewValue();
  2953. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2954. $ctx1.sendIdx["collectionWithNewValue"]=1;
  2955. //>>excludeEnd("ctx");
  2956. self._assert_equals_($19,$23);
  2957. $25=self._sampleNewValueAsCollection();
  2958. $recv($25)._addAll_(self._collection());
  2959. $24=$recv($25)._yourself();
  2960. self._assertSameContents_as_($24,self._collectionWithNewValue());
  2961. return self;
  2962. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2963. }, function($ctx1) {$ctx1.fill(self,"testAddAll",{},$globals.CollectionTest)});
  2964. //>>excludeEnd("ctx");
  2965. },
  2966. //>>excludeStart("ide", pragmas.excludeIdeData);
  2967. args: [],
  2968. 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",
  2969. referencedClasses: [],
  2970. //>>excludeEnd("ide");
  2971. messageSends: ["assert:equals:", "addAll:", "collection", "new", "collectionClass", "yourself", "sampleNewValueAsCollection", "collectionWithNewValue", "assertSameContents:as:"]
  2972. }),
  2973. $globals.CollectionTest);
  2974. $core.addMethod(
  2975. $core.method({
  2976. selector: "testAllSatisfy",
  2977. protocol: 'tests',
  2978. fn: function (){
  2979. var self=this;
  2980. var collection,anyOne;
  2981. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2982. return $core.withContext(function($ctx1) {
  2983. //>>excludeEnd("ctx");
  2984. var $1;
  2985. collection=self._collection();
  2986. anyOne=$recv(collection)._anyOne();
  2987. $1=$recv(collection)._allSatisfy_((function(each){
  2988. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2989. return $core.withContext(function($ctx2) {
  2990. //>>excludeEnd("ctx");
  2991. return $recv(collection)._includes_(each);
  2992. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2993. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2994. //>>excludeEnd("ctx");
  2995. }));
  2996. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2997. $ctx1.sendIdx["allSatisfy:"]=1;
  2998. //>>excludeEnd("ctx");
  2999. self._assert_($1);
  3000. self._deny_($recv(collection)._allSatisfy_((function(each){
  3001. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3002. return $core.withContext(function($ctx2) {
  3003. //>>excludeEnd("ctx");
  3004. return $recv(each).__tild_eq(anyOne);
  3005. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3006. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
  3007. //>>excludeEnd("ctx");
  3008. })));
  3009. return self;
  3010. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3011. }, function($ctx1) {$ctx1.fill(self,"testAllSatisfy",{collection:collection,anyOne:anyOne},$globals.CollectionTest)});
  3012. //>>excludeEnd("ctx");
  3013. },
  3014. //>>excludeStart("ide", pragmas.excludeIdeData);
  3015. args: [],
  3016. 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 ])",
  3017. referencedClasses: [],
  3018. //>>excludeEnd("ide");
  3019. messageSends: ["collection", "anyOne", "assert:", "allSatisfy:", "includes:", "deny:", "~="]
  3020. }),
  3021. $globals.CollectionTest);
  3022. $core.addMethod(
  3023. $core.method({
  3024. selector: "testAnyOne",
  3025. protocol: 'tests',
  3026. fn: function (){
  3027. var self=this;
  3028. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3029. return $core.withContext(function($ctx1) {
  3030. //>>excludeEnd("ctx");
  3031. var $2,$1;
  3032. self._should_raise_((function(){
  3033. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3034. return $core.withContext(function($ctx2) {
  3035. //>>excludeEnd("ctx");
  3036. return $recv($recv(self._collectionClass())._new())._anyOne();
  3037. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3038. $ctx2.sendIdx["anyOne"]=1;
  3039. //>>excludeEnd("ctx");
  3040. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3041. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  3042. //>>excludeEnd("ctx");
  3043. }),$globals.Error);
  3044. $2=self._collection();
  3045. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3046. $ctx1.sendIdx["collection"]=1;
  3047. //>>excludeEnd("ctx");
  3048. $1=$recv($2)._includes_($recv(self._collection())._anyOne());
  3049. self._assert_($1);
  3050. return self;
  3051. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3052. }, function($ctx1) {$ctx1.fill(self,"testAnyOne",{},$globals.CollectionTest)});
  3053. //>>excludeEnd("ctx");
  3054. },
  3055. //>>excludeStart("ide", pragmas.excludeIdeData);
  3056. args: [],
  3057. source: "testAnyOne\x0a\x09self should: [ self collectionClass new anyOne ] raise: Error.\x0a\x09self assert: (self collection includes: self collection anyOne)",
  3058. referencedClasses: ["Error"],
  3059. //>>excludeEnd("ide");
  3060. messageSends: ["should:raise:", "anyOne", "new", "collectionClass", "assert:", "includes:", "collection"]
  3061. }),
  3062. $globals.CollectionTest);
  3063. $core.addMethod(
  3064. $core.method({
  3065. selector: "testAnySatisfy",
  3066. protocol: 'tests',
  3067. fn: function (){
  3068. var self=this;
  3069. var anyOne;
  3070. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3071. return $core.withContext(function($ctx1) {
  3072. //>>excludeEnd("ctx");
  3073. var $1,$3,$2;
  3074. $1=self._collection();
  3075. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3076. $ctx1.sendIdx["collection"]=1;
  3077. //>>excludeEnd("ctx");
  3078. anyOne=$recv($1)._anyOne();
  3079. $3=self._collection();
  3080. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3081. $ctx1.sendIdx["collection"]=2;
  3082. //>>excludeEnd("ctx");
  3083. $2=$recv($3)._anySatisfy_((function(each){
  3084. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3085. return $core.withContext(function($ctx2) {
  3086. //>>excludeEnd("ctx");
  3087. return $recv(each).__eq(anyOne);
  3088. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3089. $ctx2.sendIdx["="]=1;
  3090. //>>excludeEnd("ctx");
  3091. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3092. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  3093. //>>excludeEnd("ctx");
  3094. }));
  3095. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3096. $ctx1.sendIdx["anySatisfy:"]=1;
  3097. //>>excludeEnd("ctx");
  3098. self._assert_($2);
  3099. self._deny_($recv(self._collection())._anySatisfy_((function(each){
  3100. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3101. return $core.withContext(function($ctx2) {
  3102. //>>excludeEnd("ctx");
  3103. return $recv(each).__eq($recv($globals.Object)._new());
  3104. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3105. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
  3106. //>>excludeEnd("ctx");
  3107. })));
  3108. return self;
  3109. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3110. }, function($ctx1) {$ctx1.fill(self,"testAnySatisfy",{anyOne:anyOne},$globals.CollectionTest)});
  3111. //>>excludeEnd("ctx");
  3112. },
  3113. //>>excludeStart("ide", pragmas.excludeIdeData);
  3114. args: [],
  3115. 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 ])",
  3116. referencedClasses: ["Object"],
  3117. //>>excludeEnd("ide");
  3118. messageSends: ["anyOne", "collection", "assert:", "anySatisfy:", "=", "deny:", "new"]
  3119. }),
  3120. $globals.CollectionTest);
  3121. $core.addMethod(
  3122. $core.method({
  3123. selector: "testAsArray",
  3124. protocol: 'tests',
  3125. fn: function (){
  3126. var self=this;
  3127. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3128. return $core.withContext(function($ctx1) {
  3129. //>>excludeEnd("ctx");
  3130. var $1;
  3131. $1=self._collection();
  3132. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3133. $ctx1.sendIdx["collection"]=1;
  3134. //>>excludeEnd("ctx");
  3135. self._assertSameContents_as_($1,$recv(self._collection())._asArray());
  3136. return self;
  3137. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3138. }, function($ctx1) {$ctx1.fill(self,"testAsArray",{},$globals.CollectionTest)});
  3139. //>>excludeEnd("ctx");
  3140. },
  3141. //>>excludeStart("ide", pragmas.excludeIdeData);
  3142. args: [],
  3143. source: "testAsArray\x0a\x09self\x0a\x09\x09assertSameContents: self collection\x0a\x09\x09as: self collection asArray",
  3144. referencedClasses: [],
  3145. //>>excludeEnd("ide");
  3146. messageSends: ["assertSameContents:as:", "collection", "asArray"]
  3147. }),
  3148. $globals.CollectionTest);
  3149. $core.addMethod(
  3150. $core.method({
  3151. selector: "testAsOrderedCollection",
  3152. protocol: 'tests',
  3153. fn: function (){
  3154. var self=this;
  3155. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3156. return $core.withContext(function($ctx1) {
  3157. //>>excludeEnd("ctx");
  3158. var $1;
  3159. $1=self._collection();
  3160. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3161. $ctx1.sendIdx["collection"]=1;
  3162. //>>excludeEnd("ctx");
  3163. self._assertSameContents_as_($1,$recv(self._collection())._asOrderedCollection());
  3164. return self;
  3165. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3166. }, function($ctx1) {$ctx1.fill(self,"testAsOrderedCollection",{},$globals.CollectionTest)});
  3167. //>>excludeEnd("ctx");
  3168. },
  3169. //>>excludeStart("ide", pragmas.excludeIdeData);
  3170. args: [],
  3171. source: "testAsOrderedCollection\x0a\x09self\x0a\x09\x09assertSameContents: self collection\x0a\x09\x09as: self collection asOrderedCollection",
  3172. referencedClasses: [],
  3173. //>>excludeEnd("ide");
  3174. messageSends: ["assertSameContents:as:", "collection", "asOrderedCollection"]
  3175. }),
  3176. $globals.CollectionTest);
  3177. $core.addMethod(
  3178. $core.method({
  3179. selector: "testAsSet",
  3180. protocol: 'tests',
  3181. fn: function (){
  3182. var self=this;
  3183. var c,set;
  3184. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3185. return $core.withContext(function($ctx1) {
  3186. //>>excludeEnd("ctx");
  3187. c=self._collectionWithDuplicates();
  3188. set=$recv(c)._asSet();
  3189. self._assert_equals_($recv(set)._size(),(6));
  3190. $recv(c)._do_((function(each){
  3191. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3192. return $core.withContext(function($ctx2) {
  3193. //>>excludeEnd("ctx");
  3194. return self._assert_($recv(set)._includes_(each));
  3195. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3196. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  3197. //>>excludeEnd("ctx");
  3198. }));
  3199. return self;
  3200. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3201. }, function($ctx1) {$ctx1.fill(self,"testAsSet",{c:c,set:set},$globals.CollectionTest)});
  3202. //>>excludeEnd("ctx");
  3203. },
  3204. //>>excludeStart("ide", pragmas.excludeIdeData);
  3205. args: [],
  3206. 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) ]",
  3207. referencedClasses: [],
  3208. //>>excludeEnd("ide");
  3209. messageSends: ["collectionWithDuplicates", "asSet", "assert:equals:", "size", "do:", "assert:", "includes:"]
  3210. }),
  3211. $globals.CollectionTest);
  3212. $core.addMethod(
  3213. $core.method({
  3214. selector: "testCollect",
  3215. protocol: 'tests',
  3216. fn: function (){
  3217. var self=this;
  3218. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3219. return $core.withContext(function($ctx1) {
  3220. //>>excludeEnd("ctx");
  3221. var $2,$1,$3,$5,$4,$8,$7,$6,$11,$10,$9;
  3222. $2=self._collection();
  3223. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3224. $ctx1.sendIdx["collection"]=1;
  3225. //>>excludeEnd("ctx");
  3226. $1=$recv($2)._collect_((function(each){
  3227. return each;
  3228. }));
  3229. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3230. $ctx1.sendIdx["collect:"]=1;
  3231. //>>excludeEnd("ctx");
  3232. $3=self._collection();
  3233. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3234. $ctx1.sendIdx["collection"]=2;
  3235. //>>excludeEnd("ctx");
  3236. self._assert_equals_($1,$3);
  3237. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3238. $ctx1.sendIdx["assert:equals:"]=1;
  3239. //>>excludeEnd("ctx");
  3240. $5=self._collectionWithNewValue();
  3241. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3242. $ctx1.sendIdx["collectionWithNewValue"]=1;
  3243. //>>excludeEnd("ctx");
  3244. $4=$recv($5)._collect_((function(each){
  3245. return each;
  3246. }));
  3247. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3248. $ctx1.sendIdx["collect:"]=2;
  3249. //>>excludeEnd("ctx");
  3250. self._assert_equals_($4,self._collectionWithNewValue());
  3251. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3252. $ctx1.sendIdx["assert:equals:"]=2;
  3253. //>>excludeEnd("ctx");
  3254. $8=self._collectionClass();
  3255. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3256. $ctx1.sendIdx["collectionClass"]=1;
  3257. //>>excludeEnd("ctx");
  3258. $7=$recv($8)._new();
  3259. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3260. $ctx1.sendIdx["new"]=1;
  3261. //>>excludeEnd("ctx");
  3262. $6=$recv($7)._collect_((function(each){
  3263. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3264. return $core.withContext(function($ctx2) {
  3265. //>>excludeEnd("ctx");
  3266. return $recv(each)._printString();
  3267. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3268. $ctx2.sendIdx["printString"]=1;
  3269. //>>excludeEnd("ctx");
  3270. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3271. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,3)});
  3272. //>>excludeEnd("ctx");
  3273. }));
  3274. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3275. $ctx1.sendIdx["collect:"]=3;
  3276. //>>excludeEnd("ctx");
  3277. self._assert_equals_($6,$recv(self._collectionClass())._new());
  3278. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3279. $ctx1.sendIdx["assert:equals:"]=3;
  3280. //>>excludeEnd("ctx");
  3281. $11=self._collection();
  3282. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3283. $ctx1.sendIdx["collection"]=3;
  3284. //>>excludeEnd("ctx");
  3285. $10=$recv($11)._collect_((function(){
  3286. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3287. return $core.withContext(function($ctx2) {
  3288. //>>excludeEnd("ctx");
  3289. return self._sampleNewValue();
  3290. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3291. $ctx2.sendIdx["sampleNewValue"]=1;
  3292. //>>excludeEnd("ctx");
  3293. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3294. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,4)});
  3295. //>>excludeEnd("ctx");
  3296. }));
  3297. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3298. $ctx1.sendIdx["collect:"]=4;
  3299. //>>excludeEnd("ctx");
  3300. $9=$recv($10)._detect_((function(){
  3301. return true;
  3302. }));
  3303. self._assert_equals_($9,self._sampleNewValue());
  3304. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3305. $ctx1.sendIdx["assert:equals:"]=4;
  3306. //>>excludeEnd("ctx");
  3307. self._assert_equals_($recv(self._collection())._collect_((function(each){
  3308. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3309. return $core.withContext(function($ctx2) {
  3310. //>>excludeEnd("ctx");
  3311. return $recv(each)._printString();
  3312. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3313. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,6)});
  3314. //>>excludeEnd("ctx");
  3315. })),self._collectionOfPrintStrings());
  3316. return self;
  3317. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3318. }, function($ctx1) {$ctx1.fill(self,"testCollect",{},$globals.CollectionTest)});
  3319. //>>excludeEnd("ctx");
  3320. },
  3321. //>>excludeStart("ide", pragmas.excludeIdeData);
  3322. args: [],
  3323. 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",
  3324. referencedClasses: [],
  3325. //>>excludeEnd("ide");
  3326. messageSends: ["assert:equals:", "collect:", "collection", "collectionWithNewValue", "new", "collectionClass", "printString", "detect:", "sampleNewValue", "collectionOfPrintStrings"]
  3327. }),
  3328. $globals.CollectionTest);
  3329. $core.addMethod(
  3330. $core.method({
  3331. selector: "testComma",
  3332. protocol: 'tests',
  3333. fn: function (){
  3334. var self=this;
  3335. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3336. return $core.withContext(function($ctx1) {
  3337. //>>excludeEnd("ctx");
  3338. var $2,$4,$3,$1,$5,$8,$7,$9,$6,$10,$13,$12,$15,$14,$11,$17,$18,$16,$19;
  3339. $2=self._collection();
  3340. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3341. $ctx1.sendIdx["collection"]=1;
  3342. //>>excludeEnd("ctx");
  3343. $4=self._collectionClass();
  3344. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3345. $ctx1.sendIdx["collectionClass"]=1;
  3346. //>>excludeEnd("ctx");
  3347. $3=$recv($4)._new();
  3348. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3349. $ctx1.sendIdx["new"]=1;
  3350. //>>excludeEnd("ctx");
  3351. $1=$recv($2).__comma($3);
  3352. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3353. $ctx1.sendIdx[","]=1;
  3354. //>>excludeEnd("ctx");
  3355. $5=self._collection();
  3356. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3357. $ctx1.sendIdx["collection"]=2;
  3358. //>>excludeEnd("ctx");
  3359. self._assert_equals_($1,$5);
  3360. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3361. $ctx1.sendIdx["assert:equals:"]=1;
  3362. //>>excludeEnd("ctx");
  3363. $8=self._collectionClass();
  3364. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3365. $ctx1.sendIdx["collectionClass"]=2;
  3366. //>>excludeEnd("ctx");
  3367. $7=$recv($8)._new();
  3368. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3369. $ctx1.sendIdx["new"]=2;
  3370. //>>excludeEnd("ctx");
  3371. $9=self._collection();
  3372. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3373. $ctx1.sendIdx["collection"]=3;
  3374. //>>excludeEnd("ctx");
  3375. $6=$recv($7).__comma($9);
  3376. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3377. $ctx1.sendIdx[","]=2;
  3378. //>>excludeEnd("ctx");
  3379. $10=self._collection();
  3380. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3381. $ctx1.sendIdx["collection"]=4;
  3382. //>>excludeEnd("ctx");
  3383. self._assert_equals_($6,$10);
  3384. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3385. $ctx1.sendIdx["assert:equals:"]=2;
  3386. //>>excludeEnd("ctx");
  3387. $13=self._collectionClass();
  3388. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3389. $ctx1.sendIdx["collectionClass"]=3;
  3390. //>>excludeEnd("ctx");
  3391. $12=$recv($13)._new();
  3392. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3393. $ctx1.sendIdx["new"]=3;
  3394. //>>excludeEnd("ctx");
  3395. $15=self._collectionClass();
  3396. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3397. $ctx1.sendIdx["collectionClass"]=4;
  3398. //>>excludeEnd("ctx");
  3399. $14=$recv($15)._new();
  3400. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3401. $ctx1.sendIdx["new"]=4;
  3402. //>>excludeEnd("ctx");
  3403. $11=$recv($12).__comma($14);
  3404. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3405. $ctx1.sendIdx[","]=3;
  3406. //>>excludeEnd("ctx");
  3407. self._assert_equals_($11,$recv(self._collectionClass())._new());
  3408. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3409. $ctx1.sendIdx["assert:equals:"]=3;
  3410. //>>excludeEnd("ctx");
  3411. $17=self._collection();
  3412. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3413. $ctx1.sendIdx["collection"]=5;
  3414. //>>excludeEnd("ctx");
  3415. $18=self._sampleNewValueAsCollection();
  3416. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3417. $ctx1.sendIdx["sampleNewValueAsCollection"]=1;
  3418. //>>excludeEnd("ctx");
  3419. $16=$recv($17).__comma($18);
  3420. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3421. $ctx1.sendIdx[","]=4;
  3422. //>>excludeEnd("ctx");
  3423. $19=self._collectionWithNewValue();
  3424. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3425. $ctx1.sendIdx["collectionWithNewValue"]=1;
  3426. //>>excludeEnd("ctx");
  3427. self._assert_equals_($16,$19);
  3428. self._assertSameContents_as_($recv(self._sampleNewValueAsCollection()).__comma(self._collection()),self._collectionWithNewValue());
  3429. return self;
  3430. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3431. }, function($ctx1) {$ctx1.fill(self,"testComma",{},$globals.CollectionTest)});
  3432. //>>excludeEnd("ctx");
  3433. },
  3434. //>>excludeStart("ide", pragmas.excludeIdeData);
  3435. args: [],
  3436. 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",
  3437. referencedClasses: [],
  3438. //>>excludeEnd("ide");
  3439. messageSends: ["assert:equals:", ",", "collection", "new", "collectionClass", "sampleNewValueAsCollection", "collectionWithNewValue", "assertSameContents:as:"]
  3440. }),
  3441. $globals.CollectionTest);
  3442. $core.addMethod(
  3443. $core.method({
  3444. selector: "testCopy",
  3445. protocol: 'tests',
  3446. fn: function (){
  3447. var self=this;
  3448. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3449. return $core.withContext(function($ctx1) {
  3450. //>>excludeEnd("ctx");
  3451. var $3,$2,$1,$5,$4,$7,$6,$8,$10,$9,$11,$15,$14,$13,$16,$12,$19,$18,$17;
  3452. $3=self._collectionClass();
  3453. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3454. $ctx1.sendIdx["collectionClass"]=1;
  3455. //>>excludeEnd("ctx");
  3456. $2=$recv($3)._new();
  3457. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3458. $ctx1.sendIdx["new"]=1;
  3459. //>>excludeEnd("ctx");
  3460. $1=$recv($2)._copy();
  3461. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3462. $ctx1.sendIdx["copy"]=1;
  3463. //>>excludeEnd("ctx");
  3464. $5=self._collectionClass();
  3465. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3466. $ctx1.sendIdx["collectionClass"]=2;
  3467. //>>excludeEnd("ctx");
  3468. $4=$recv($5)._new();
  3469. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3470. $ctx1.sendIdx["new"]=2;
  3471. //>>excludeEnd("ctx");
  3472. self._assert_equals_($1,$4);
  3473. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3474. $ctx1.sendIdx["assert:equals:"]=1;
  3475. //>>excludeEnd("ctx");
  3476. $7=self._collection();
  3477. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3478. $ctx1.sendIdx["collection"]=1;
  3479. //>>excludeEnd("ctx");
  3480. $6=$recv($7)._copy();
  3481. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3482. $ctx1.sendIdx["copy"]=2;
  3483. //>>excludeEnd("ctx");
  3484. $8=self._collection();
  3485. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3486. $ctx1.sendIdx["collection"]=2;
  3487. //>>excludeEnd("ctx");
  3488. self._assert_equals_($6,$8);
  3489. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3490. $ctx1.sendIdx["assert:equals:"]=2;
  3491. //>>excludeEnd("ctx");
  3492. $10=self._collectionWithNewValue();
  3493. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3494. $ctx1.sendIdx["collectionWithNewValue"]=1;
  3495. //>>excludeEnd("ctx");
  3496. $9=$recv($10)._copy();
  3497. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3498. $ctx1.sendIdx["copy"]=3;
  3499. //>>excludeEnd("ctx");
  3500. $11=self._collectionWithNewValue();
  3501. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3502. $ctx1.sendIdx["collectionWithNewValue"]=2;
  3503. //>>excludeEnd("ctx");
  3504. self._assert_equals_($9,$11);
  3505. $15=self._collectionClass();
  3506. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3507. $ctx1.sendIdx["collectionClass"]=3;
  3508. //>>excludeEnd("ctx");
  3509. $14=$recv($15)._new();
  3510. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3511. $ctx1.sendIdx["new"]=3;
  3512. //>>excludeEnd("ctx");
  3513. $13=$recv($14)._copy();
  3514. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3515. $ctx1.sendIdx["copy"]=4;
  3516. //>>excludeEnd("ctx");
  3517. $16=self._collection();
  3518. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3519. $ctx1.sendIdx["collection"]=3;
  3520. //>>excludeEnd("ctx");
  3521. $12=$recv($13).__eq($16);
  3522. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3523. $ctx1.sendIdx["="]=1;
  3524. //>>excludeEnd("ctx");
  3525. self._deny_($12);
  3526. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3527. $ctx1.sendIdx["deny:"]=1;
  3528. //>>excludeEnd("ctx");
  3529. $19=self._collection();
  3530. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3531. $ctx1.sendIdx["collection"]=4;
  3532. //>>excludeEnd("ctx");
  3533. $18=$recv($19)._copy();
  3534. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3535. $ctx1.sendIdx["copy"]=5;
  3536. //>>excludeEnd("ctx");
  3537. $17=$recv($18).__eq($recv(self._collectionClass())._new());
  3538. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3539. $ctx1.sendIdx["="]=2;
  3540. //>>excludeEnd("ctx");
  3541. self._deny_($17);
  3542. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3543. $ctx1.sendIdx["deny:"]=2;
  3544. //>>excludeEnd("ctx");
  3545. self._deny_($recv($recv(self._collection())._copy()).__eq(self._collectionWithNewValue()));
  3546. return self;
  3547. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3548. }, function($ctx1) {$ctx1.fill(self,"testCopy",{},$globals.CollectionTest)});
  3549. //>>excludeEnd("ctx");
  3550. },
  3551. //>>excludeStart("ide", pragmas.excludeIdeData);
  3552. args: [],
  3553. 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",
  3554. referencedClasses: [],
  3555. //>>excludeEnd("ide");
  3556. messageSends: ["assert:equals:", "copy", "new", "collectionClass", "collection", "collectionWithNewValue", "deny:", "="]
  3557. }),
  3558. $globals.CollectionTest);
  3559. $core.addMethod(
  3560. $core.method({
  3561. selector: "testCopySeparates",
  3562. protocol: 'tests',
  3563. fn: function (){
  3564. var self=this;
  3565. var original,copy;
  3566. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3567. return $core.withContext(function($ctx1) {
  3568. //>>excludeEnd("ctx");
  3569. original=self._collection();
  3570. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3571. $ctx1.sendIdx["collection"]=1;
  3572. //>>excludeEnd("ctx");
  3573. copy=$recv(original)._copy();
  3574. $recv(copy)._addAll_(self._sampleNewValueAsCollection());
  3575. self._assert_($recv(original).__eq(self._collection()));
  3576. return self;
  3577. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3578. }, function($ctx1) {$ctx1.fill(self,"testCopySeparates",{original:original,copy:copy},$globals.CollectionTest)});
  3579. //>>excludeEnd("ctx");
  3580. },
  3581. //>>excludeStart("ide", pragmas.excludeIdeData);
  3582. args: [],
  3583. 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",
  3584. referencedClasses: [],
  3585. //>>excludeEnd("ide");
  3586. messageSends: ["collection", "copy", "addAll:", "sampleNewValueAsCollection", "assert:", "="]
  3587. }),
  3588. $globals.CollectionTest);
  3589. $core.addMethod(
  3590. $core.method({
  3591. selector: "testDetect",
  3592. protocol: 'tests',
  3593. fn: function (){
  3594. var self=this;
  3595. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3596. return $core.withContext(function($ctx1) {
  3597. //>>excludeEnd("ctx");
  3598. var $1,$2,$3,$4,$6,$5,$7;
  3599. self._shouldnt_raise_((function(){
  3600. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3601. return $core.withContext(function($ctx2) {
  3602. //>>excludeEnd("ctx");
  3603. $1=self._collection();
  3604. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3605. $ctx2.sendIdx["collection"]=1;
  3606. //>>excludeEnd("ctx");
  3607. return $recv($1)._detect_((function(){
  3608. return true;
  3609. }));
  3610. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3611. $ctx2.sendIdx["detect:"]=1;
  3612. //>>excludeEnd("ctx");
  3613. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3614. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  3615. //>>excludeEnd("ctx");
  3616. }),$globals.Error);
  3617. self._should_raise_((function(){
  3618. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3619. return $core.withContext(function($ctx2) {
  3620. //>>excludeEnd("ctx");
  3621. $2=self._collection();
  3622. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3623. $ctx2.sendIdx["collection"]=2;
  3624. //>>excludeEnd("ctx");
  3625. return $recv($2)._detect_((function(){
  3626. return false;
  3627. }));
  3628. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3629. $ctx2.sendIdx["detect:"]=2;
  3630. //>>excludeEnd("ctx");
  3631. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3632. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  3633. //>>excludeEnd("ctx");
  3634. }),$globals.Error);
  3635. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3636. $ctx1.sendIdx["should:raise:"]=1;
  3637. //>>excludeEnd("ctx");
  3638. $3=$recv(self._sampleNewValueAsCollection())._detect_((function(){
  3639. return true;
  3640. }));
  3641. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3642. $ctx1.sendIdx["detect:"]=3;
  3643. //>>excludeEnd("ctx");
  3644. $4=self._sampleNewValue();
  3645. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3646. $ctx1.sendIdx["sampleNewValue"]=1;
  3647. //>>excludeEnd("ctx");
  3648. self._assert_equals_($3,$4);
  3649. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3650. $ctx1.sendIdx["assert:equals:"]=1;
  3651. //>>excludeEnd("ctx");
  3652. $5=$recv(self._collectionWithNewValue())._detect_((function(each){
  3653. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3654. return $core.withContext(function($ctx2) {
  3655. //>>excludeEnd("ctx");
  3656. $6=self._sampleNewValue();
  3657. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3658. $ctx2.sendIdx["sampleNewValue"]=2;
  3659. //>>excludeEnd("ctx");
  3660. return $recv(each).__eq($6);
  3661. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3662. $ctx2.sendIdx["="]=1;
  3663. //>>excludeEnd("ctx");
  3664. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3665. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,6)});
  3666. //>>excludeEnd("ctx");
  3667. }));
  3668. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3669. $ctx1.sendIdx["detect:"]=4;
  3670. //>>excludeEnd("ctx");
  3671. $7=self._sampleNewValue();
  3672. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3673. $ctx1.sendIdx["sampleNewValue"]=3;
  3674. //>>excludeEnd("ctx");
  3675. self._assert_equals_($5,$7);
  3676. self._should_raise_((function(){
  3677. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3678. return $core.withContext(function($ctx2) {
  3679. //>>excludeEnd("ctx");
  3680. return $recv(self._collection())._detect_((function(each){
  3681. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3682. return $core.withContext(function($ctx3) {
  3683. //>>excludeEnd("ctx");
  3684. return $recv(each).__eq(self._sampleNewValue());
  3685. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3686. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,8)});
  3687. //>>excludeEnd("ctx");
  3688. }));
  3689. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3690. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,7)});
  3691. //>>excludeEnd("ctx");
  3692. }),$globals.Error);
  3693. return self;
  3694. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3695. }, function($ctx1) {$ctx1.fill(self,"testDetect",{},$globals.CollectionTest)});
  3696. //>>excludeEnd("ctx");
  3697. },
  3698. //>>excludeStart("ide", pragmas.excludeIdeData);
  3699. args: [],
  3700. 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",
  3701. referencedClasses: ["Error"],
  3702. //>>excludeEnd("ide");
  3703. messageSends: ["shouldnt:raise:", "detect:", "collection", "should:raise:", "assert:equals:", "sampleNewValueAsCollection", "sampleNewValue", "collectionWithNewValue", "="]
  3704. }),
  3705. $globals.CollectionTest);
  3706. $core.addMethod(
  3707. $core.method({
  3708. selector: "testDetectIfNone",
  3709. protocol: 'tests',
  3710. fn: function (){
  3711. var self=this;
  3712. var sentinel;
  3713. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3714. return $core.withContext(function($ctx1) {
  3715. //>>excludeEnd("ctx");
  3716. var $3,$2,$1,$5,$4,$6,$7,$9,$8,$10;
  3717. sentinel=$recv($globals.Object)._new();
  3718. $3=self._collection();
  3719. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3720. $ctx1.sendIdx["collection"]=1;
  3721. //>>excludeEnd("ctx");
  3722. $2=$recv($3)._detect_ifNone_((function(){
  3723. return true;
  3724. }),(function(){
  3725. return sentinel;
  3726. }));
  3727. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3728. $ctx1.sendIdx["detect:ifNone:"]=1;
  3729. //>>excludeEnd("ctx");
  3730. $1=$recv($2).__tild_eq(sentinel);
  3731. self._assert_($1);
  3732. $5=self._collection();
  3733. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3734. $ctx1.sendIdx["collection"]=2;
  3735. //>>excludeEnd("ctx");
  3736. $4=$recv($5)._detect_ifNone_((function(){
  3737. return false;
  3738. }),(function(){
  3739. return sentinel;
  3740. }));
  3741. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3742. $ctx1.sendIdx["detect:ifNone:"]=2;
  3743. //>>excludeEnd("ctx");
  3744. self._assert_equals_($4,sentinel);
  3745. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3746. $ctx1.sendIdx["assert:equals:"]=1;
  3747. //>>excludeEnd("ctx");
  3748. $6=$recv(self._sampleNewValueAsCollection())._detect_ifNone_((function(){
  3749. return true;
  3750. }),(function(){
  3751. return sentinel;
  3752. }));
  3753. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3754. $ctx1.sendIdx["detect:ifNone:"]=3;
  3755. //>>excludeEnd("ctx");
  3756. $7=self._sampleNewValue();
  3757. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3758. $ctx1.sendIdx["sampleNewValue"]=1;
  3759. //>>excludeEnd("ctx");
  3760. self._assert_equals_($6,$7);
  3761. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3762. $ctx1.sendIdx["assert:equals:"]=2;
  3763. //>>excludeEnd("ctx");
  3764. $8=$recv(self._collectionWithNewValue())._detect_ifNone_((function(each){
  3765. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3766. return $core.withContext(function($ctx2) {
  3767. //>>excludeEnd("ctx");
  3768. $9=self._sampleNewValue();
  3769. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3770. $ctx2.sendIdx["sampleNewValue"]=2;
  3771. //>>excludeEnd("ctx");
  3772. return $recv(each).__eq($9);
  3773. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3774. $ctx2.sendIdx["="]=1;
  3775. //>>excludeEnd("ctx");
  3776. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3777. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,7)});
  3778. //>>excludeEnd("ctx");
  3779. }),(function(){
  3780. return sentinel;
  3781. }));
  3782. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3783. $ctx1.sendIdx["detect:ifNone:"]=4;
  3784. //>>excludeEnd("ctx");
  3785. $10=self._sampleNewValue();
  3786. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3787. $ctx1.sendIdx["sampleNewValue"]=3;
  3788. //>>excludeEnd("ctx");
  3789. self._assert_equals_($8,$10);
  3790. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3791. $ctx1.sendIdx["assert:equals:"]=3;
  3792. //>>excludeEnd("ctx");
  3793. self._assert_equals_($recv(self._collection())._detect_ifNone_((function(each){
  3794. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3795. return $core.withContext(function($ctx2) {
  3796. //>>excludeEnd("ctx");
  3797. return $recv(each).__eq(self._sampleNewValue());
  3798. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3799. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,9)});
  3800. //>>excludeEnd("ctx");
  3801. }),(function(){
  3802. return sentinel;
  3803. })),sentinel);
  3804. return self;
  3805. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3806. }, function($ctx1) {$ctx1.fill(self,"testDetectIfNone",{sentinel:sentinel},$globals.CollectionTest)});
  3807. //>>excludeEnd("ctx");
  3808. },
  3809. //>>excludeStart("ide", pragmas.excludeIdeData);
  3810. args: [],
  3811. 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",
  3812. referencedClasses: ["Object"],
  3813. //>>excludeEnd("ide");
  3814. messageSends: ["new", "assert:", "~=", "detect:ifNone:", "collection", "assert:equals:", "sampleNewValueAsCollection", "sampleNewValue", "collectionWithNewValue", "="]
  3815. }),
  3816. $globals.CollectionTest);
  3817. $core.addMethod(
  3818. $core.method({
  3819. selector: "testDo",
  3820. protocol: 'tests',
  3821. fn: function (){
  3822. var self=this;
  3823. var newCollection;
  3824. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3825. return $core.withContext(function($ctx1) {
  3826. //>>excludeEnd("ctx");
  3827. var $1,$2;
  3828. newCollection=$recv($globals.OrderedCollection)._new();
  3829. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3830. $ctx1.sendIdx["new"]=1;
  3831. //>>excludeEnd("ctx");
  3832. $1=self._collection();
  3833. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3834. $ctx1.sendIdx["collection"]=1;
  3835. //>>excludeEnd("ctx");
  3836. $recv($1)._do_((function(each){
  3837. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3838. return $core.withContext(function($ctx2) {
  3839. //>>excludeEnd("ctx");
  3840. return $recv(newCollection)._add_(each);
  3841. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3842. $ctx2.sendIdx["add:"]=1;
  3843. //>>excludeEnd("ctx");
  3844. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3845. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  3846. //>>excludeEnd("ctx");
  3847. }));
  3848. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3849. $ctx1.sendIdx["do:"]=1;
  3850. //>>excludeEnd("ctx");
  3851. self._assertSameContents_as_(self._collection(),newCollection);
  3852. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3853. $ctx1.sendIdx["assertSameContents:as:"]=1;
  3854. //>>excludeEnd("ctx");
  3855. newCollection=$recv($globals.OrderedCollection)._new();
  3856. $2=self._collectionWithDuplicates();
  3857. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3858. $ctx1.sendIdx["collectionWithDuplicates"]=1;
  3859. //>>excludeEnd("ctx");
  3860. $recv($2)._do_((function(each){
  3861. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3862. return $core.withContext(function($ctx2) {
  3863. //>>excludeEnd("ctx");
  3864. return $recv(newCollection)._add_(each);
  3865. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3866. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
  3867. //>>excludeEnd("ctx");
  3868. }));
  3869. self._assertSameContents_as_(self._collectionWithDuplicates(),newCollection);
  3870. return self;
  3871. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3872. }, function($ctx1) {$ctx1.fill(self,"testDo",{newCollection:newCollection},$globals.CollectionTest)});
  3873. //>>excludeEnd("ctx");
  3874. },
  3875. //>>excludeStart("ide", pragmas.excludeIdeData);
  3876. args: [],
  3877. 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",
  3878. referencedClasses: ["OrderedCollection"],
  3879. //>>excludeEnd("ide");
  3880. messageSends: ["new", "do:", "collection", "add:", "assertSameContents:as:", "collectionWithDuplicates"]
  3881. }),
  3882. $globals.CollectionTest);
  3883. $core.addMethod(
  3884. $core.method({
  3885. selector: "testEquality",
  3886. protocol: 'tests',
  3887. fn: function (){
  3888. var self=this;
  3889. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3890. return $core.withContext(function($ctx1) {
  3891. //>>excludeEnd("ctx");
  3892. var $2,$1,$4,$3,$5,$6,$7,$8,$11,$10,$12,$9,$14,$13;
  3893. $2=self._collectionClass();
  3894. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3895. $ctx1.sendIdx["collectionClass"]=1;
  3896. //>>excludeEnd("ctx");
  3897. $1=$recv($2)._new();
  3898. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3899. $ctx1.sendIdx["new"]=1;
  3900. //>>excludeEnd("ctx");
  3901. $4=self._collectionClass();
  3902. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3903. $ctx1.sendIdx["collectionClass"]=2;
  3904. //>>excludeEnd("ctx");
  3905. $3=$recv($4)._new();
  3906. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3907. $ctx1.sendIdx["new"]=2;
  3908. //>>excludeEnd("ctx");
  3909. self._assert_equals_($1,$3);
  3910. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3911. $ctx1.sendIdx["assert:equals:"]=1;
  3912. //>>excludeEnd("ctx");
  3913. $5=self._collection();
  3914. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3915. $ctx1.sendIdx["collection"]=1;
  3916. //>>excludeEnd("ctx");
  3917. $6=self._collection();
  3918. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3919. $ctx1.sendIdx["collection"]=2;
  3920. //>>excludeEnd("ctx");
  3921. self._assert_equals_($5,$6);
  3922. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3923. $ctx1.sendIdx["assert:equals:"]=2;
  3924. //>>excludeEnd("ctx");
  3925. $7=self._collectionWithNewValue();
  3926. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3927. $ctx1.sendIdx["collectionWithNewValue"]=1;
  3928. //>>excludeEnd("ctx");
  3929. $8=self._collectionWithNewValue();
  3930. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3931. $ctx1.sendIdx["collectionWithNewValue"]=2;
  3932. //>>excludeEnd("ctx");
  3933. self._assert_equals_($7,$8);
  3934. $11=self._collectionClass();
  3935. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3936. $ctx1.sendIdx["collectionClass"]=3;
  3937. //>>excludeEnd("ctx");
  3938. $10=$recv($11)._new();
  3939. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3940. $ctx1.sendIdx["new"]=3;
  3941. //>>excludeEnd("ctx");
  3942. $12=self._collection();
  3943. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3944. $ctx1.sendIdx["collection"]=3;
  3945. //>>excludeEnd("ctx");
  3946. $9=$recv($10).__eq($12);
  3947. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3948. $ctx1.sendIdx["="]=1;
  3949. //>>excludeEnd("ctx");
  3950. self._deny_($9);
  3951. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3952. $ctx1.sendIdx["deny:"]=1;
  3953. //>>excludeEnd("ctx");
  3954. $14=self._collection();
  3955. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3956. $ctx1.sendIdx["collection"]=4;
  3957. //>>excludeEnd("ctx");
  3958. $13=$recv($14).__eq($recv(self._collectionClass())._new());
  3959. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3960. $ctx1.sendIdx["="]=2;
  3961. //>>excludeEnd("ctx");
  3962. self._deny_($13);
  3963. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3964. $ctx1.sendIdx["deny:"]=2;
  3965. //>>excludeEnd("ctx");
  3966. self._deny_($recv(self._collection()).__eq(self._collectionWithNewValue()));
  3967. return self;
  3968. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3969. }, function($ctx1) {$ctx1.fill(self,"testEquality",{},$globals.CollectionTest)});
  3970. //>>excludeEnd("ctx");
  3971. },
  3972. //>>excludeStart("ide", pragmas.excludeIdeData);
  3973. args: [],
  3974. 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",
  3975. referencedClasses: [],
  3976. //>>excludeEnd("ide");
  3977. messageSends: ["assert:equals:", "new", "collectionClass", "collection", "collectionWithNewValue", "deny:", "="]
  3978. }),
  3979. $globals.CollectionTest);
  3980. $core.addMethod(
  3981. $core.method({
  3982. selector: "testIfEmptyFamily",
  3983. protocol: 'tests',
  3984. fn: function (){
  3985. var self=this;
  3986. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3987. return $core.withContext(function($ctx1) {
  3988. //>>excludeEnd("ctx");
  3989. 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;
  3990. $3=self._collectionClass();
  3991. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3992. $ctx1.sendIdx["collectionClass"]=1;
  3993. //>>excludeEnd("ctx");
  3994. $2=$recv($3)._new();
  3995. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3996. $ctx1.sendIdx["new"]=1;
  3997. //>>excludeEnd("ctx");
  3998. $1=$recv($2)._ifEmpty_((function(){
  3999. return (42);
  4000. }));
  4001. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4002. $ctx1.sendIdx["ifEmpty:"]=1;
  4003. //>>excludeEnd("ctx");
  4004. self._assert_equals_($1,(42));
  4005. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4006. $ctx1.sendIdx["assert:equals:"]=1;
  4007. //>>excludeEnd("ctx");
  4008. $5=self._collection();
  4009. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4010. $ctx1.sendIdx["collection"]=1;
  4011. //>>excludeEnd("ctx");
  4012. $4=$recv($5)._ifEmpty_((function(){
  4013. return (42);
  4014. }));
  4015. $6=self._collection();
  4016. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4017. $ctx1.sendIdx["collection"]=2;
  4018. //>>excludeEnd("ctx");
  4019. self._assert_equals_($4,$6);
  4020. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4021. $ctx1.sendIdx["assert:equals:"]=2;
  4022. //>>excludeEnd("ctx");
  4023. $9=self._collectionClass();
  4024. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4025. $ctx1.sendIdx["collectionClass"]=2;
  4026. //>>excludeEnd("ctx");
  4027. $8=$recv($9)._new();
  4028. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4029. $ctx1.sendIdx["new"]=2;
  4030. //>>excludeEnd("ctx");
  4031. $7=$recv($8)._ifNotEmpty_((function(){
  4032. return (42);
  4033. }));
  4034. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4035. $ctx1.sendIdx["ifNotEmpty:"]=1;
  4036. //>>excludeEnd("ctx");
  4037. $11=self._collectionClass();
  4038. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4039. $ctx1.sendIdx["collectionClass"]=3;
  4040. //>>excludeEnd("ctx");
  4041. $10=$recv($11)._new();
  4042. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4043. $ctx1.sendIdx["new"]=3;
  4044. //>>excludeEnd("ctx");
  4045. self._assert_equals_($7,$10);
  4046. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4047. $ctx1.sendIdx["assert:equals:"]=3;
  4048. //>>excludeEnd("ctx");
  4049. $13=self._collection();
  4050. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4051. $ctx1.sendIdx["collection"]=3;
  4052. //>>excludeEnd("ctx");
  4053. $12=$recv($13)._ifNotEmpty_((function(){
  4054. return (42);
  4055. }));
  4056. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4057. $ctx1.sendIdx["ifNotEmpty:"]=2;
  4058. //>>excludeEnd("ctx");
  4059. self._assert_equals_($12,(42));
  4060. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4061. $ctx1.sendIdx["assert:equals:"]=4;
  4062. //>>excludeEnd("ctx");
  4063. $15=self._collection();
  4064. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4065. $ctx1.sendIdx["collection"]=4;
  4066. //>>excludeEnd("ctx");
  4067. $14=$recv($15)._ifNotEmpty_((function(col){
  4068. return col;
  4069. }));
  4070. $16=self._collection();
  4071. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4072. $ctx1.sendIdx["collection"]=5;
  4073. //>>excludeEnd("ctx");
  4074. self._assert_equals_($14,$16);
  4075. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4076. $ctx1.sendIdx["assert:equals:"]=5;
  4077. //>>excludeEnd("ctx");
  4078. $19=self._collectionClass();
  4079. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4080. $ctx1.sendIdx["collectionClass"]=4;
  4081. //>>excludeEnd("ctx");
  4082. $18=$recv($19)._new();
  4083. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4084. $ctx1.sendIdx["new"]=4;
  4085. //>>excludeEnd("ctx");
  4086. $17=$recv($18)._ifEmpty_ifNotEmpty_((function(){
  4087. return (42);
  4088. }),(function(){
  4089. return (999);
  4090. }));
  4091. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4092. $ctx1.sendIdx["ifEmpty:ifNotEmpty:"]=1;
  4093. //>>excludeEnd("ctx");
  4094. self._assert_equals_($17,(42));
  4095. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4096. $ctx1.sendIdx["assert:equals:"]=6;
  4097. //>>excludeEnd("ctx");
  4098. $21=self._collection();
  4099. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4100. $ctx1.sendIdx["collection"]=6;
  4101. //>>excludeEnd("ctx");
  4102. $20=$recv($21)._ifEmpty_ifNotEmpty_((function(){
  4103. return (42);
  4104. }),(function(){
  4105. return (999);
  4106. }));
  4107. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4108. $ctx1.sendIdx["ifEmpty:ifNotEmpty:"]=2;
  4109. //>>excludeEnd("ctx");
  4110. self._assert_equals_($20,(999));
  4111. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4112. $ctx1.sendIdx["assert:equals:"]=7;
  4113. //>>excludeEnd("ctx");
  4114. $23=self._collection();
  4115. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4116. $ctx1.sendIdx["collection"]=7;
  4117. //>>excludeEnd("ctx");
  4118. $22=$recv($23)._ifEmpty_ifNotEmpty_((function(){
  4119. return (42);
  4120. }),(function(col){
  4121. return col;
  4122. }));
  4123. $24=self._collection();
  4124. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4125. $ctx1.sendIdx["collection"]=8;
  4126. //>>excludeEnd("ctx");
  4127. self._assert_equals_($22,$24);
  4128. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4129. $ctx1.sendIdx["assert:equals:"]=8;
  4130. //>>excludeEnd("ctx");
  4131. $25=$recv($recv(self._collectionClass())._new())._ifNotEmpty_ifEmpty_((function(){
  4132. return (42);
  4133. }),(function(){
  4134. return (999);
  4135. }));
  4136. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4137. $ctx1.sendIdx["ifNotEmpty:ifEmpty:"]=1;
  4138. //>>excludeEnd("ctx");
  4139. self._assert_equals_($25,(999));
  4140. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4141. $ctx1.sendIdx["assert:equals:"]=9;
  4142. //>>excludeEnd("ctx");
  4143. $27=self._collection();
  4144. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4145. $ctx1.sendIdx["collection"]=9;
  4146. //>>excludeEnd("ctx");
  4147. $26=$recv($27)._ifNotEmpty_ifEmpty_((function(){
  4148. return (42);
  4149. }),(function(){
  4150. return (999);
  4151. }));
  4152. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4153. $ctx1.sendIdx["ifNotEmpty:ifEmpty:"]=2;
  4154. //>>excludeEnd("ctx");
  4155. self._assert_equals_($26,(42));
  4156. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4157. $ctx1.sendIdx["assert:equals:"]=10;
  4158. //>>excludeEnd("ctx");
  4159. $29=self._collection();
  4160. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4161. $ctx1.sendIdx["collection"]=10;
  4162. //>>excludeEnd("ctx");
  4163. $28=$recv($29)._ifNotEmpty_ifEmpty_((function(col){
  4164. return col;
  4165. }),(function(){
  4166. return (999);
  4167. }));
  4168. self._assert_equals_($28,self._collection());
  4169. return self;
  4170. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4171. }, function($ctx1) {$ctx1.fill(self,"testIfEmptyFamily",{},$globals.CollectionTest)});
  4172. //>>excludeEnd("ctx");
  4173. },
  4174. //>>excludeStart("ide", pragmas.excludeIdeData);
  4175. args: [],
  4176. 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.",
  4177. referencedClasses: [],
  4178. //>>excludeEnd("ide");
  4179. messageSends: ["assert:equals:", "ifEmpty:", "new", "collectionClass", "collection", "ifNotEmpty:", "ifEmpty:ifNotEmpty:", "ifNotEmpty:ifEmpty:"]
  4180. }),
  4181. $globals.CollectionTest);
  4182. $core.addMethod(
  4183. $core.method({
  4184. selector: "testIsEmpty",
  4185. protocol: 'tests',
  4186. fn: function (){
  4187. var self=this;
  4188. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4189. return $core.withContext(function($ctx1) {
  4190. //>>excludeEnd("ctx");
  4191. var $1;
  4192. $1=$recv($recv(self._collectionClass())._new())._isEmpty();
  4193. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4194. $ctx1.sendIdx["isEmpty"]=1;
  4195. //>>excludeEnd("ctx");
  4196. self._assert_($1);
  4197. self._deny_($recv(self._collection())._isEmpty());
  4198. return self;
  4199. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4200. }, function($ctx1) {$ctx1.fill(self,"testIsEmpty",{},$globals.CollectionTest)});
  4201. //>>excludeEnd("ctx");
  4202. },
  4203. //>>excludeStart("ide", pragmas.excludeIdeData);
  4204. args: [],
  4205. source: "testIsEmpty\x0a\x09self assert: self collectionClass new isEmpty.\x0a\x09self deny: self collection isEmpty",
  4206. referencedClasses: [],
  4207. //>>excludeEnd("ide");
  4208. messageSends: ["assert:", "isEmpty", "new", "collectionClass", "deny:", "collection"]
  4209. }),
  4210. $globals.CollectionTest);
  4211. $core.addMethod(
  4212. $core.method({
  4213. selector: "testNoneSatisfy",
  4214. protocol: 'tests',
  4215. fn: function (){
  4216. var self=this;
  4217. var anyOne;
  4218. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4219. return $core.withContext(function($ctx1) {
  4220. //>>excludeEnd("ctx");
  4221. var $1,$3,$2;
  4222. $1=self._collection();
  4223. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4224. $ctx1.sendIdx["collection"]=1;
  4225. //>>excludeEnd("ctx");
  4226. anyOne=$recv($1)._anyOne();
  4227. $3=self._collection();
  4228. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4229. $ctx1.sendIdx["collection"]=2;
  4230. //>>excludeEnd("ctx");
  4231. $2=$recv($3)._noneSatisfy_((function(each){
  4232. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4233. return $core.withContext(function($ctx2) {
  4234. //>>excludeEnd("ctx");
  4235. return $recv(each).__eq(anyOne);
  4236. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4237. $ctx2.sendIdx["="]=1;
  4238. //>>excludeEnd("ctx");
  4239. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4240. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  4241. //>>excludeEnd("ctx");
  4242. }));
  4243. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4244. $ctx1.sendIdx["noneSatisfy:"]=1;
  4245. //>>excludeEnd("ctx");
  4246. self._deny_($2);
  4247. self._assert_($recv(self._collection())._noneSatisfy_((function(each){
  4248. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4249. return $core.withContext(function($ctx2) {
  4250. //>>excludeEnd("ctx");
  4251. return $recv(each).__eq($recv($globals.Object)._new());
  4252. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4253. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
  4254. //>>excludeEnd("ctx");
  4255. })));
  4256. return self;
  4257. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4258. }, function($ctx1) {$ctx1.fill(self,"testNoneSatisfy",{anyOne:anyOne},$globals.CollectionTest)});
  4259. //>>excludeEnd("ctx");
  4260. },
  4261. //>>excludeStart("ide", pragmas.excludeIdeData);
  4262. args: [],
  4263. 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 ])",
  4264. referencedClasses: ["Object"],
  4265. //>>excludeEnd("ide");
  4266. messageSends: ["anyOne", "collection", "deny:", "noneSatisfy:", "=", "assert:", "new"]
  4267. }),
  4268. $globals.CollectionTest);
  4269. $core.addMethod(
  4270. $core.method({
  4271. selector: "testRemoveAll",
  4272. protocol: 'tests',
  4273. fn: function (){
  4274. var self=this;
  4275. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4276. return $core.withContext(function($ctx1) {
  4277. //>>excludeEnd("ctx");
  4278. var $2,$1;
  4279. $2=self._collection();
  4280. $recv($2)._removeAll();
  4281. $1=$recv($2)._yourself();
  4282. self._assert_equals_($1,$recv(self._collectionClass())._new());
  4283. return self;
  4284. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4285. }, function($ctx1) {$ctx1.fill(self,"testRemoveAll",{},$globals.CollectionTest)});
  4286. //>>excludeEnd("ctx");
  4287. },
  4288. //>>excludeStart("ide", pragmas.excludeIdeData);
  4289. args: [],
  4290. source: "testRemoveAll\x0a\x09self assert: (self collection removeAll; yourself) equals: self collectionClass new",
  4291. referencedClasses: [],
  4292. //>>excludeEnd("ide");
  4293. messageSends: ["assert:equals:", "removeAll", "collection", "yourself", "new", "collectionClass"]
  4294. }),
  4295. $globals.CollectionTest);
  4296. $core.addMethod(
  4297. $core.method({
  4298. selector: "testSelect",
  4299. protocol: 'tests',
  4300. fn: function (){
  4301. var self=this;
  4302. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4303. return $core.withContext(function($ctx1) {
  4304. //>>excludeEnd("ctx");
  4305. var $2,$1,$4,$3,$6,$5,$7,$9,$10,$8,$12,$13,$11,$14,$16,$17,$15;
  4306. $2=self._collection();
  4307. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4308. $ctx1.sendIdx["collection"]=1;
  4309. //>>excludeEnd("ctx");
  4310. $1=$recv($2)._select_((function(){
  4311. return false;
  4312. }));
  4313. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4314. $ctx1.sendIdx["select:"]=1;
  4315. //>>excludeEnd("ctx");
  4316. $4=self._collectionClass();
  4317. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4318. $ctx1.sendIdx["collectionClass"]=1;
  4319. //>>excludeEnd("ctx");
  4320. $3=$recv($4)._new();
  4321. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4322. $ctx1.sendIdx["new"]=1;
  4323. //>>excludeEnd("ctx");
  4324. self._assert_equals_($1,$3);
  4325. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4326. $ctx1.sendIdx["assert:equals:"]=1;
  4327. //>>excludeEnd("ctx");
  4328. $6=self._collection();
  4329. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4330. $ctx1.sendIdx["collection"]=2;
  4331. //>>excludeEnd("ctx");
  4332. $5=$recv($6)._select_((function(){
  4333. return true;
  4334. }));
  4335. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4336. $ctx1.sendIdx["select:"]=2;
  4337. //>>excludeEnd("ctx");
  4338. $7=self._collection();
  4339. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4340. $ctx1.sendIdx["collection"]=3;
  4341. //>>excludeEnd("ctx");
  4342. self._assert_equals_($5,$7);
  4343. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4344. $ctx1.sendIdx["assert:equals:"]=2;
  4345. //>>excludeEnd("ctx");
  4346. $9=self._collectionWithNewValue();
  4347. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4348. $ctx1.sendIdx["collectionWithNewValue"]=1;
  4349. //>>excludeEnd("ctx");
  4350. $8=$recv($9)._select_((function(each){
  4351. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4352. return $core.withContext(function($ctx2) {
  4353. //>>excludeEnd("ctx");
  4354. $10=self._sampleNewValue();
  4355. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4356. $ctx2.sendIdx["sampleNewValue"]=1;
  4357. //>>excludeEnd("ctx");
  4358. return $recv(each).__eq($10);
  4359. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4360. $ctx2.sendIdx["="]=1;
  4361. //>>excludeEnd("ctx");
  4362. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4363. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,3)});
  4364. //>>excludeEnd("ctx");
  4365. }));
  4366. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4367. $ctx1.sendIdx["select:"]=3;
  4368. //>>excludeEnd("ctx");
  4369. self._assert_equals_($8,self._sampleNewValueAsCollection());
  4370. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4371. $ctx1.sendIdx["assert:equals:"]=3;
  4372. //>>excludeEnd("ctx");
  4373. $12=self._collectionWithNewValue();
  4374. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4375. $ctx1.sendIdx["collectionWithNewValue"]=2;
  4376. //>>excludeEnd("ctx");
  4377. $11=$recv($12)._select_((function(each){
  4378. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4379. return $core.withContext(function($ctx2) {
  4380. //>>excludeEnd("ctx");
  4381. $13=self._sampleNewValue();
  4382. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4383. $ctx2.sendIdx["sampleNewValue"]=2;
  4384. //>>excludeEnd("ctx");
  4385. return $recv(each).__tild_eq($13);
  4386. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4387. $ctx2.sendIdx["~="]=1;
  4388. //>>excludeEnd("ctx");
  4389. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4390. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,4)});
  4391. //>>excludeEnd("ctx");
  4392. }));
  4393. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4394. $ctx1.sendIdx["select:"]=4;
  4395. //>>excludeEnd("ctx");
  4396. $14=self._collection();
  4397. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4398. $ctx1.sendIdx["collection"]=4;
  4399. //>>excludeEnd("ctx");
  4400. self._assert_equals_($11,$14);
  4401. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4402. $ctx1.sendIdx["assert:equals:"]=4;
  4403. //>>excludeEnd("ctx");
  4404. $16=self._collection();
  4405. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4406. $ctx1.sendIdx["collection"]=5;
  4407. //>>excludeEnd("ctx");
  4408. $15=$recv($16)._select_((function(each){
  4409. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4410. return $core.withContext(function($ctx2) {
  4411. //>>excludeEnd("ctx");
  4412. $17=self._sampleNewValue();
  4413. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4414. $ctx2.sendIdx["sampleNewValue"]=3;
  4415. //>>excludeEnd("ctx");
  4416. return $recv(each).__eq($17);
  4417. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4418. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,5)});
  4419. //>>excludeEnd("ctx");
  4420. }));
  4421. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4422. $ctx1.sendIdx["select:"]=5;
  4423. //>>excludeEnd("ctx");
  4424. self._assert_equals_($15,$recv(self._collectionClass())._new());
  4425. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4426. $ctx1.sendIdx["assert:equals:"]=5;
  4427. //>>excludeEnd("ctx");
  4428. self._assert_equals_($recv(self._collectionWithNewValue())._select_((function(each){
  4429. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4430. return $core.withContext(function($ctx2) {
  4431. //>>excludeEnd("ctx");
  4432. return $recv(each).__tild_eq(self._sampleNewValue());
  4433. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4434. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,6)});
  4435. //>>excludeEnd("ctx");
  4436. })),self._collection());
  4437. return self;
  4438. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4439. }, function($ctx1) {$ctx1.fill(self,"testSelect",{},$globals.CollectionTest)});
  4440. //>>excludeEnd("ctx");
  4441. },
  4442. //>>excludeStart("ide", pragmas.excludeIdeData);
  4443. args: [],
  4444. 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",
  4445. referencedClasses: [],
  4446. //>>excludeEnd("ide");
  4447. messageSends: ["assert:equals:", "select:", "collection", "new", "collectionClass", "collectionWithNewValue", "=", "sampleNewValue", "sampleNewValueAsCollection", "~="]
  4448. }),
  4449. $globals.CollectionTest);
  4450. $core.addMethod(
  4451. $core.method({
  4452. selector: "testSize",
  4453. protocol: 'tests',
  4454. fn: function (){
  4455. var self=this;
  4456. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4457. return $core.withContext(function($ctx1) {
  4458. //>>excludeEnd("ctx");
  4459. var $1,$2;
  4460. $1=$recv($recv(self._collectionClass())._new())._size();
  4461. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4462. $ctx1.sendIdx["size"]=1;
  4463. //>>excludeEnd("ctx");
  4464. self._assert_equals_($1,(0));
  4465. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4466. $ctx1.sendIdx["assert:equals:"]=1;
  4467. //>>excludeEnd("ctx");
  4468. $2=$recv(self._sampleNewValueAsCollection())._size();
  4469. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4470. $ctx1.sendIdx["size"]=2;
  4471. //>>excludeEnd("ctx");
  4472. self._assert_equals_($2,(1));
  4473. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4474. $ctx1.sendIdx["assert:equals:"]=2;
  4475. //>>excludeEnd("ctx");
  4476. self._assert_equals_($recv(self._collection())._size(),self._collectionSize());
  4477. return self;
  4478. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4479. }, function($ctx1) {$ctx1.fill(self,"testSize",{},$globals.CollectionTest)});
  4480. //>>excludeEnd("ctx");
  4481. },
  4482. //>>excludeStart("ide", pragmas.excludeIdeData);
  4483. args: [],
  4484. 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",
  4485. referencedClasses: [],
  4486. //>>excludeEnd("ide");
  4487. messageSends: ["assert:equals:", "size", "new", "collectionClass", "sampleNewValueAsCollection", "collection", "collectionSize"]
  4488. }),
  4489. $globals.CollectionTest);
  4490. $core.addMethod(
  4491. $core.method({
  4492. selector: "collectionClass",
  4493. protocol: 'fixture',
  4494. fn: function (){
  4495. var self=this;
  4496. return nil;
  4497. },
  4498. //>>excludeStart("ide", pragmas.excludeIdeData);
  4499. args: [],
  4500. source: "collectionClass\x0a\x09\x22Answers class of collection type tested,\x0a\x09or nil if test is abstract\x22\x0a\x0a\x09^ nil",
  4501. referencedClasses: [],
  4502. //>>excludeEnd("ide");
  4503. messageSends: []
  4504. }),
  4505. $globals.CollectionTest.klass);
  4506. $core.addMethod(
  4507. $core.method({
  4508. selector: "isAbstract",
  4509. protocol: 'testing',
  4510. fn: function (){
  4511. var self=this;
  4512. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4513. return $core.withContext(function($ctx1) {
  4514. //>>excludeEnd("ctx");
  4515. return $recv(self._collectionClass())._isNil();
  4516. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4517. }, function($ctx1) {$ctx1.fill(self,"isAbstract",{},$globals.CollectionTest.klass)});
  4518. //>>excludeEnd("ctx");
  4519. },
  4520. //>>excludeStart("ide", pragmas.excludeIdeData);
  4521. args: [],
  4522. source: "isAbstract\x0a\x09^ self collectionClass isNil",
  4523. referencedClasses: [],
  4524. //>>excludeEnd("ide");
  4525. messageSends: ["isNil", "collectionClass"]
  4526. }),
  4527. $globals.CollectionTest.klass);
  4528. $core.addClass('IndexableCollectionTest', $globals.CollectionTest, [], 'Kernel-Tests');
  4529. $core.addMethod(
  4530. $core.method({
  4531. selector: "collectionWithNewValue",
  4532. protocol: 'fixture',
  4533. fn: function (){
  4534. var self=this;
  4535. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4536. return $core.withContext(function($ctx1) {
  4537. //>>excludeEnd("ctx");
  4538. self._subclassResponsibility();
  4539. return self;
  4540. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4541. }, function($ctx1) {$ctx1.fill(self,"collectionWithNewValue",{},$globals.IndexableCollectionTest)});
  4542. //>>excludeEnd("ctx");
  4543. },
  4544. //>>excludeStart("ide", pragmas.excludeIdeData);
  4545. args: [],
  4546. 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",
  4547. referencedClasses: [],
  4548. //>>excludeEnd("ide");
  4549. messageSends: ["subclassResponsibility"]
  4550. }),
  4551. $globals.IndexableCollectionTest);
  4552. $core.addMethod(
  4553. $core.method({
  4554. selector: "sampleNewIndex",
  4555. protocol: 'fixture',
  4556. fn: function (){
  4557. var self=this;
  4558. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4559. return $core.withContext(function($ctx1) {
  4560. //>>excludeEnd("ctx");
  4561. self._subclassResponsibility();
  4562. return self;
  4563. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4564. }, function($ctx1) {$ctx1.fill(self,"sampleNewIndex",{},$globals.IndexableCollectionTest)});
  4565. //>>excludeEnd("ctx");
  4566. },
  4567. //>>excludeStart("ide", pragmas.excludeIdeData);
  4568. args: [],
  4569. 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",
  4570. referencedClasses: [],
  4571. //>>excludeEnd("ide");
  4572. messageSends: ["subclassResponsibility"]
  4573. }),
  4574. $globals.IndexableCollectionTest);
  4575. $core.addMethod(
  4576. $core.method({
  4577. selector: "sampleNonIndexesDo:",
  4578. protocol: 'fixture',
  4579. fn: function (aBlock){
  4580. var self=this;
  4581. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4582. return $core.withContext(function($ctx1) {
  4583. //>>excludeEnd("ctx");
  4584. self._subclassResponsibility();
  4585. return self;
  4586. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4587. }, function($ctx1) {$ctx1.fill(self,"sampleNonIndexesDo:",{aBlock:aBlock},$globals.IndexableCollectionTest)});
  4588. //>>excludeEnd("ctx");
  4589. },
  4590. //>>excludeStart("ide", pragmas.excludeIdeData);
  4591. args: ["aBlock"],
  4592. 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",
  4593. referencedClasses: [],
  4594. //>>excludeEnd("ide");
  4595. messageSends: ["subclassResponsibility"]
  4596. }),
  4597. $globals.IndexableCollectionTest);
  4598. $core.addMethod(
  4599. $core.method({
  4600. selector: "samplesDo:",
  4601. protocol: 'fixture',
  4602. fn: function (aBlock){
  4603. var self=this;
  4604. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4605. return $core.withContext(function($ctx1) {
  4606. //>>excludeEnd("ctx");
  4607. self._subclassResponsibility();
  4608. return self;
  4609. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4610. }, function($ctx1) {$ctx1.fill(self,"samplesDo:",{aBlock:aBlock},$globals.IndexableCollectionTest)});
  4611. //>>excludeEnd("ctx");
  4612. },
  4613. //>>excludeStart("ide", pragmas.excludeIdeData);
  4614. args: ["aBlock"],
  4615. 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",
  4616. referencedClasses: [],
  4617. //>>excludeEnd("ide");
  4618. messageSends: ["subclassResponsibility"]
  4619. }),
  4620. $globals.IndexableCollectionTest);
  4621. $core.addMethod(
  4622. $core.method({
  4623. selector: "testAt",
  4624. protocol: 'tests',
  4625. fn: function (){
  4626. var self=this;
  4627. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4628. return $core.withContext(function($ctx1) {
  4629. //>>excludeEnd("ctx");
  4630. var $1;
  4631. self._nonIndexesDo_((function(each){
  4632. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4633. return $core.withContext(function($ctx2) {
  4634. //>>excludeEnd("ctx");
  4635. return self._should_raise_((function(){
  4636. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4637. return $core.withContext(function($ctx3) {
  4638. //>>excludeEnd("ctx");
  4639. $1=self._collection();
  4640. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4641. $ctx3.sendIdx["collection"]=1;
  4642. //>>excludeEnd("ctx");
  4643. return $recv($1)._at_(each);
  4644. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4645. $ctx3.sendIdx["at:"]=1;
  4646. //>>excludeEnd("ctx");
  4647. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4648. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  4649. //>>excludeEnd("ctx");
  4650. }),$globals.Error);
  4651. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4652. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  4653. //>>excludeEnd("ctx");
  4654. }));
  4655. self._samplesDo_((function(index,value){
  4656. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4657. return $core.withContext(function($ctx2) {
  4658. //>>excludeEnd("ctx");
  4659. return self._assert_equals_($recv(self._collection())._at_(index),value);
  4660. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4661. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,3)});
  4662. //>>excludeEnd("ctx");
  4663. }));
  4664. return self;
  4665. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4666. }, function($ctx1) {$ctx1.fill(self,"testAt",{},$globals.IndexableCollectionTest)});
  4667. //>>excludeEnd("ctx");
  4668. },
  4669. //>>excludeStart("ide", pragmas.excludeIdeData);
  4670. args: [],
  4671. 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 ]",
  4672. referencedClasses: ["Error"],
  4673. //>>excludeEnd("ide");
  4674. messageSends: ["nonIndexesDo:", "should:raise:", "at:", "collection", "samplesDo:", "assert:equals:"]
  4675. }),
  4676. $globals.IndexableCollectionTest);
  4677. $core.addMethod(
  4678. $core.method({
  4679. selector: "testAtIfAbsent",
  4680. protocol: 'tests',
  4681. fn: function (){
  4682. var self=this;
  4683. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4684. return $core.withContext(function($ctx1) {
  4685. //>>excludeEnd("ctx");
  4686. var $2,$1,$3;
  4687. self._nonIndexesDo_((function(each){
  4688. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4689. return $core.withContext(function($ctx2) {
  4690. //>>excludeEnd("ctx");
  4691. $2=self._collection();
  4692. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4693. $ctx2.sendIdx["collection"]=1;
  4694. //>>excludeEnd("ctx");
  4695. $1=$recv($2)._at_ifAbsent_(each,(function(){
  4696. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4697. return $core.withContext(function($ctx3) {
  4698. //>>excludeEnd("ctx");
  4699. return self._sampleNewValue();
  4700. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4701. $ctx3.sendIdx["sampleNewValue"]=1;
  4702. //>>excludeEnd("ctx");
  4703. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4704. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  4705. //>>excludeEnd("ctx");
  4706. }));
  4707. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4708. $ctx2.sendIdx["at:ifAbsent:"]=1;
  4709. //>>excludeEnd("ctx");
  4710. $3=self._sampleNewValue();
  4711. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4712. $ctx2.sendIdx["sampleNewValue"]=2;
  4713. //>>excludeEnd("ctx");
  4714. return self._assert_equals_($1,$3);
  4715. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4716. $ctx2.sendIdx["assert:equals:"]=1;
  4717. //>>excludeEnd("ctx");
  4718. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4719. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  4720. //>>excludeEnd("ctx");
  4721. }));
  4722. self._samplesDo_((function(index,value){
  4723. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4724. return $core.withContext(function($ctx2) {
  4725. //>>excludeEnd("ctx");
  4726. return self._assert_equals_($recv(self._collection())._at_ifAbsent_(index,(function(){
  4727. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4728. return $core.withContext(function($ctx3) {
  4729. //>>excludeEnd("ctx");
  4730. return self._sampleNewValue();
  4731. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4732. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,4)});
  4733. //>>excludeEnd("ctx");
  4734. })),value);
  4735. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4736. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,3)});
  4737. //>>excludeEnd("ctx");
  4738. }));
  4739. return self;
  4740. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4741. }, function($ctx1) {$ctx1.fill(self,"testAtIfAbsent",{},$globals.IndexableCollectionTest)});
  4742. //>>excludeEnd("ctx");
  4743. },
  4744. //>>excludeStart("ide", pragmas.excludeIdeData);
  4745. args: [],
  4746. 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 ].",
  4747. referencedClasses: [],
  4748. //>>excludeEnd("ide");
  4749. messageSends: ["nonIndexesDo:", "assert:equals:", "at:ifAbsent:", "collection", "sampleNewValue", "samplesDo:"]
  4750. }),
  4751. $globals.IndexableCollectionTest);
  4752. $core.addMethod(
  4753. $core.method({
  4754. selector: "testAtIfAbsentPut",
  4755. protocol: 'tests',
  4756. fn: function (){
  4757. var self=this;
  4758. var newCollection;
  4759. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4760. return $core.withContext(function($ctx1) {
  4761. //>>excludeEnd("ctx");
  4762. var $1;
  4763. newCollection=self._collection();
  4764. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4765. $ctx1.sendIdx["collection"]=1;
  4766. //>>excludeEnd("ctx");
  4767. self._samplesDo_((function(index,value){
  4768. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4769. return $core.withContext(function($ctx2) {
  4770. //>>excludeEnd("ctx");
  4771. $1=$recv(newCollection)._at_ifAbsentPut_(index,(function(){
  4772. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4773. return $core.withContext(function($ctx3) {
  4774. //>>excludeEnd("ctx");
  4775. return self._sampleNewValue();
  4776. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4777. $ctx3.sendIdx["sampleNewValue"]=1;
  4778. //>>excludeEnd("ctx");
  4779. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4780. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  4781. //>>excludeEnd("ctx");
  4782. }));
  4783. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4784. $ctx2.sendIdx["at:ifAbsentPut:"]=1;
  4785. //>>excludeEnd("ctx");
  4786. return self._assert_equals_($1,value);
  4787. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4788. $ctx2.sendIdx["assert:equals:"]=1;
  4789. //>>excludeEnd("ctx");
  4790. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4791. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,1)});
  4792. //>>excludeEnd("ctx");
  4793. }));
  4794. self._assert_equals_(newCollection,self._collection());
  4795. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4796. $ctx1.sendIdx["assert:equals:"]=2;
  4797. //>>excludeEnd("ctx");
  4798. self._assert_equals_($recv(newCollection)._at_ifAbsentPut_(self._sampleNewIndex(),(function(){
  4799. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4800. return $core.withContext(function($ctx2) {
  4801. //>>excludeEnd("ctx");
  4802. return self._sampleNewValue();
  4803. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4804. $ctx2.sendIdx["sampleNewValue"]=2;
  4805. //>>excludeEnd("ctx");
  4806. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4807. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  4808. //>>excludeEnd("ctx");
  4809. })),self._sampleNewValue());
  4810. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4811. $ctx1.sendIdx["assert:equals:"]=3;
  4812. //>>excludeEnd("ctx");
  4813. self._assert_equals_(newCollection,self._collectionWithNewValue());
  4814. return self;
  4815. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4816. }, function($ctx1) {$ctx1.fill(self,"testAtIfAbsentPut",{newCollection:newCollection},$globals.IndexableCollectionTest)});
  4817. //>>excludeEnd("ctx");
  4818. },
  4819. //>>excludeStart("ide", pragmas.excludeIdeData);
  4820. args: [],
  4821. 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",
  4822. referencedClasses: [],
  4823. //>>excludeEnd("ide");
  4824. messageSends: ["collection", "samplesDo:", "assert:equals:", "at:ifAbsentPut:", "sampleNewValue", "sampleNewIndex", "collectionWithNewValue"]
  4825. }),
  4826. $globals.IndexableCollectionTest);
  4827. $core.addMethod(
  4828. $core.method({
  4829. selector: "testAtIfPresent",
  4830. protocol: 'tests',
  4831. fn: function (){
  4832. var self=this;
  4833. var visited,sentinel;
  4834. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4835. return $core.withContext(function($ctx1) {
  4836. //>>excludeEnd("ctx");
  4837. var $2,$1,$4,$3;
  4838. sentinel=$recv($globals.Object)._new();
  4839. self._nonIndexesDo_((function(each){
  4840. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4841. return $core.withContext(function($ctx2) {
  4842. //>>excludeEnd("ctx");
  4843. visited=nil;
  4844. visited;
  4845. $2=self._collection();
  4846. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4847. $ctx2.sendIdx["collection"]=1;
  4848. //>>excludeEnd("ctx");
  4849. $1=$recv($2)._at_ifPresent_(each,(function(value1){
  4850. visited=value1;
  4851. visited;
  4852. return sentinel;
  4853. }));
  4854. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4855. $ctx2.sendIdx["at:ifPresent:"]=1;
  4856. //>>excludeEnd("ctx");
  4857. self._assert_equals_($1,nil);
  4858. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4859. $ctx2.sendIdx["assert:equals:"]=1;
  4860. //>>excludeEnd("ctx");
  4861. return self._assert_($recv(visited)._isNil());
  4862. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4863. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  4864. //>>excludeEnd("ctx");
  4865. }));
  4866. self._samplesDo_((function(index,value){
  4867. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4868. return $core.withContext(function($ctx2) {
  4869. //>>excludeEnd("ctx");
  4870. visited=nil;
  4871. visited;
  4872. $4=self._collection();
  4873. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4874. $ctx2.sendIdx["collection"]=2;
  4875. //>>excludeEnd("ctx");
  4876. $3=$recv($4)._at_ifPresent_(index,(function(value2){
  4877. visited=value2;
  4878. visited;
  4879. return sentinel;
  4880. }));
  4881. self._assert_equals_($3,sentinel);
  4882. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4883. $ctx2.sendIdx["assert:equals:"]=2;
  4884. //>>excludeEnd("ctx");
  4885. return self._assert_equals_(visited,$recv(self._collection())._at_(index));
  4886. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4887. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,3)});
  4888. //>>excludeEnd("ctx");
  4889. }));
  4890. return self;
  4891. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4892. }, function($ctx1) {$ctx1.fill(self,"testAtIfPresent",{visited:visited,sentinel:sentinel},$globals.IndexableCollectionTest)});
  4893. //>>excludeEnd("ctx");
  4894. },
  4895. //>>excludeStart("ide", pragmas.excludeIdeData);
  4896. args: [],
  4897. 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) ]",
  4898. referencedClasses: ["Object"],
  4899. //>>excludeEnd("ide");
  4900. messageSends: ["new", "nonIndexesDo:", "assert:equals:", "at:ifPresent:", "collection", "assert:", "isNil", "samplesDo:", "at:"]
  4901. }),
  4902. $globals.IndexableCollectionTest);
  4903. $core.addMethod(
  4904. $core.method({
  4905. selector: "testAtIfPresentIfAbsent",
  4906. protocol: 'tests',
  4907. fn: function (){
  4908. var self=this;
  4909. var visited,sentinel;
  4910. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4911. return $core.withContext(function($ctx1) {
  4912. //>>excludeEnd("ctx");
  4913. var $2,$1,$3,$5,$4;
  4914. sentinel=$recv($globals.Object)._new();
  4915. self._nonIndexesDo_((function(each){
  4916. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4917. return $core.withContext(function($ctx2) {
  4918. //>>excludeEnd("ctx");
  4919. visited=nil;
  4920. visited;
  4921. $2=self._collection();
  4922. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4923. $ctx2.sendIdx["collection"]=1;
  4924. //>>excludeEnd("ctx");
  4925. $1=$recv($2)._at_ifPresent_ifAbsent_(each,(function(value1){
  4926. visited=value1;
  4927. visited;
  4928. return sentinel;
  4929. }),(function(){
  4930. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4931. return $core.withContext(function($ctx3) {
  4932. //>>excludeEnd("ctx");
  4933. return self._sampleNewValue();
  4934. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4935. $ctx3.sendIdx["sampleNewValue"]=1;
  4936. //>>excludeEnd("ctx");
  4937. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4938. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)});
  4939. //>>excludeEnd("ctx");
  4940. }));
  4941. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4942. $ctx2.sendIdx["at:ifPresent:ifAbsent:"]=1;
  4943. //>>excludeEnd("ctx");
  4944. $3=self._sampleNewValue();
  4945. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4946. $ctx2.sendIdx["sampleNewValue"]=2;
  4947. //>>excludeEnd("ctx");
  4948. self._assert_equals_($1,$3);
  4949. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4950. $ctx2.sendIdx["assert:equals:"]=1;
  4951. //>>excludeEnd("ctx");
  4952. return self._assert_($recv(visited)._isNil());
  4953. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4954. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  4955. //>>excludeEnd("ctx");
  4956. }));
  4957. self._samplesDo_((function(index,value){
  4958. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4959. return $core.withContext(function($ctx2) {
  4960. //>>excludeEnd("ctx");
  4961. visited=nil;
  4962. visited;
  4963. $5=self._collection();
  4964. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4965. $ctx2.sendIdx["collection"]=2;
  4966. //>>excludeEnd("ctx");
  4967. $4=$recv($5)._at_ifPresent_ifAbsent_(index,(function(value2){
  4968. visited=value2;
  4969. visited;
  4970. return sentinel;
  4971. }),(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. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,6)});
  4978. //>>excludeEnd("ctx");
  4979. }));
  4980. self._assert_equals_($4,sentinel);
  4981. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4982. $ctx2.sendIdx["assert:equals:"]=2;
  4983. //>>excludeEnd("ctx");
  4984. return self._assert_equals_(visited,$recv(self._collection())._at_(index));
  4985. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4986. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,4)});
  4987. //>>excludeEnd("ctx");
  4988. }));
  4989. return self;
  4990. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4991. }, function($ctx1) {$ctx1.fill(self,"testAtIfPresentIfAbsent",{visited:visited,sentinel:sentinel},$globals.IndexableCollectionTest)});
  4992. //>>excludeEnd("ctx");
  4993. },
  4994. //>>excludeStart("ide", pragmas.excludeIdeData);
  4995. args: [],
  4996. 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) ]",
  4997. referencedClasses: ["Object"],
  4998. //>>excludeEnd("ide");
  4999. messageSends: ["new", "nonIndexesDo:", "assert:equals:", "at:ifPresent:ifAbsent:", "collection", "sampleNewValue", "assert:", "isNil", "samplesDo:", "at:"]
  5000. }),
  5001. $globals.IndexableCollectionTest);
  5002. $core.addMethod(
  5003. $core.method({
  5004. selector: "testAtPut",
  5005. protocol: 'tests',
  5006. fn: function (){
  5007. var self=this;
  5008. var newCollection;
  5009. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5010. return $core.withContext(function($ctx1) {
  5011. //>>excludeEnd("ctx");
  5012. newCollection=self._collection();
  5013. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5014. $ctx1.sendIdx["collection"]=1;
  5015. //>>excludeEnd("ctx");
  5016. self._samplesDo_((function(index,value){
  5017. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5018. return $core.withContext(function($ctx2) {
  5019. //>>excludeEnd("ctx");
  5020. return $recv(newCollection)._at_put_(index,value);
  5021. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5022. $ctx2.sendIdx["at:put:"]=1;
  5023. //>>excludeEnd("ctx");
  5024. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5025. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,1)});
  5026. //>>excludeEnd("ctx");
  5027. }));
  5028. self._assert_equals_(newCollection,self._collection());
  5029. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5030. $ctx1.sendIdx["assert:equals:"]=1;
  5031. //>>excludeEnd("ctx");
  5032. $recv(newCollection)._at_put_(self._sampleNewIndex(),self._sampleNewValue());
  5033. self._assert_equals_(newCollection,self._collectionWithNewValue());
  5034. return self;
  5035. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5036. }, function($ctx1) {$ctx1.fill(self,"testAtPut",{newCollection:newCollection},$globals.IndexableCollectionTest)});
  5037. //>>excludeEnd("ctx");
  5038. },
  5039. //>>excludeStart("ide", pragmas.excludeIdeData);
  5040. args: [],
  5041. 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",
  5042. referencedClasses: [],
  5043. //>>excludeEnd("ide");
  5044. messageSends: ["collection", "samplesDo:", "at:put:", "assert:equals:", "sampleNewIndex", "sampleNewValue", "collectionWithNewValue"]
  5045. }),
  5046. $globals.IndexableCollectionTest);
  5047. $core.addMethod(
  5048. $core.method({
  5049. selector: "testIndexOf",
  5050. protocol: 'tests',
  5051. fn: function (){
  5052. var self=this;
  5053. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5054. return $core.withContext(function($ctx1) {
  5055. //>>excludeEnd("ctx");
  5056. var $1;
  5057. self._should_raise_((function(){
  5058. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5059. return $core.withContext(function($ctx2) {
  5060. //>>excludeEnd("ctx");
  5061. $1=self._collection();
  5062. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5063. $ctx2.sendIdx["collection"]=1;
  5064. //>>excludeEnd("ctx");
  5065. return $recv($1)._indexOf_(self._sampleNewValue());
  5066. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5067. $ctx2.sendIdx["indexOf:"]=1;
  5068. //>>excludeEnd("ctx");
  5069. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5070. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  5071. //>>excludeEnd("ctx");
  5072. }),$globals.Error);
  5073. self._samplesDo_((function(index,value){
  5074. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5075. return $core.withContext(function($ctx2) {
  5076. //>>excludeEnd("ctx");
  5077. return self._assert_equals_($recv(self._collection())._indexOf_(value),index);
  5078. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5079. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,2)});
  5080. //>>excludeEnd("ctx");
  5081. }));
  5082. return self;
  5083. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5084. }, function($ctx1) {$ctx1.fill(self,"testIndexOf",{},$globals.IndexableCollectionTest)});
  5085. //>>excludeEnd("ctx");
  5086. },
  5087. //>>excludeStart("ide", pragmas.excludeIdeData);
  5088. args: [],
  5089. 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 ]",
  5090. referencedClasses: ["Error"],
  5091. //>>excludeEnd("ide");
  5092. messageSends: ["should:raise:", "indexOf:", "collection", "sampleNewValue", "samplesDo:", "assert:equals:"]
  5093. }),
  5094. $globals.IndexableCollectionTest);
  5095. $core.addMethod(
  5096. $core.method({
  5097. selector: "testIndexOfWithNull",
  5098. protocol: 'tests',
  5099. fn: function (){
  5100. var self=this;
  5101. var jsNull;
  5102. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5103. return $core.withContext(function($ctx1) {
  5104. //>>excludeEnd("ctx");
  5105. var $2,$1;
  5106. jsNull=$recv($globals.JSON)._parse_("null");
  5107. self._samplesDo_((function(index,value){
  5108. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5109. return $core.withContext(function($ctx2) {
  5110. //>>excludeEnd("ctx");
  5111. $2=self._collection();
  5112. $recv($2)._at_put_(index,jsNull);
  5113. $1=$recv($2)._indexOf_(jsNull);
  5114. return self._assert_equals_($1,index);
  5115. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5116. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,1)});
  5117. //>>excludeEnd("ctx");
  5118. }));
  5119. return self;
  5120. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5121. }, function($ctx1) {$ctx1.fill(self,"testIndexOfWithNull",{jsNull:jsNull},$globals.IndexableCollectionTest)});
  5122. //>>excludeEnd("ctx");
  5123. },
  5124. //>>excludeStart("ide", pragmas.excludeIdeData);
  5125. args: [],
  5126. 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 ]",
  5127. referencedClasses: ["JSON"],
  5128. //>>excludeEnd("ide");
  5129. messageSends: ["parse:", "samplesDo:", "assert:equals:", "at:put:", "collection", "indexOf:"]
  5130. }),
  5131. $globals.IndexableCollectionTest);
  5132. $core.addMethod(
  5133. $core.method({
  5134. selector: "testWithIndexDo",
  5135. protocol: 'tests',
  5136. fn: function (){
  5137. var self=this;
  5138. var collection;
  5139. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5140. return $core.withContext(function($ctx1) {
  5141. //>>excludeEnd("ctx");
  5142. collection=self._collection();
  5143. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5144. $ctx1.sendIdx["collection"]=1;
  5145. //>>excludeEnd("ctx");
  5146. $recv(self._collection())._withIndexDo_((function(each,index){
  5147. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5148. return $core.withContext(function($ctx2) {
  5149. //>>excludeEnd("ctx");
  5150. return self._assert_equals_($recv(collection)._at_(index),each);
  5151. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5152. }, function($ctx2) {$ctx2.fillBlock({each:each,index:index},$ctx1,1)});
  5153. //>>excludeEnd("ctx");
  5154. }));
  5155. return self;
  5156. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5157. }, function($ctx1) {$ctx1.fill(self,"testWithIndexDo",{collection:collection},$globals.IndexableCollectionTest)});
  5158. //>>excludeEnd("ctx");
  5159. },
  5160. //>>excludeStart("ide", pragmas.excludeIdeData);
  5161. args: [],
  5162. 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 ]",
  5163. referencedClasses: [],
  5164. //>>excludeEnd("ide");
  5165. messageSends: ["collection", "withIndexDo:", "assert:equals:", "at:"]
  5166. }),
  5167. $globals.IndexableCollectionTest);
  5168. $core.addClass('AssociativeCollectionTest', $globals.IndexableCollectionTest, [], 'Kernel-Tests');
  5169. $core.addMethod(
  5170. $core.method({
  5171. selector: "collectionKeys",
  5172. protocol: 'fixture',
  5173. fn: function (){
  5174. var self=this;
  5175. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5176. return $core.withContext(function($ctx1) {
  5177. //>>excludeEnd("ctx");
  5178. self._subclassResponsibility();
  5179. return self;
  5180. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5181. }, function($ctx1) {$ctx1.fill(self,"collectionKeys",{},$globals.AssociativeCollectionTest)});
  5182. //>>excludeEnd("ctx");
  5183. },
  5184. //>>excludeStart("ide", pragmas.excludeIdeData);
  5185. args: [],
  5186. source: "collectionKeys\x0a\x09self subclassResponsibility",
  5187. referencedClasses: [],
  5188. //>>excludeEnd("ide");
  5189. messageSends: ["subclassResponsibility"]
  5190. }),
  5191. $globals.AssociativeCollectionTest);
  5192. $core.addMethod(
  5193. $core.method({
  5194. selector: "collectionValues",
  5195. protocol: 'fixture',
  5196. fn: function (){
  5197. var self=this;
  5198. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5199. return $core.withContext(function($ctx1) {
  5200. //>>excludeEnd("ctx");
  5201. self._subclassResponsibility();
  5202. return self;
  5203. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5204. }, function($ctx1) {$ctx1.fill(self,"collectionValues",{},$globals.AssociativeCollectionTest)});
  5205. //>>excludeEnd("ctx");
  5206. },
  5207. //>>excludeStart("ide", pragmas.excludeIdeData);
  5208. args: [],
  5209. source: "collectionValues\x0a\x09self subclassResponsibility",
  5210. referencedClasses: [],
  5211. //>>excludeEnd("ide");
  5212. messageSends: ["subclassResponsibility"]
  5213. }),
  5214. $globals.AssociativeCollectionTest);
  5215. $core.addMethod(
  5216. $core.method({
  5217. selector: "nonIndexesDo:",
  5218. protocol: 'fixture',
  5219. fn: function (aBlock){
  5220. var self=this;
  5221. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5222. return $core.withContext(function($ctx1) {
  5223. //>>excludeEnd("ctx");
  5224. $recv(aBlock)._value_((5));
  5225. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5226. $ctx1.sendIdx["value:"]=1;
  5227. //>>excludeEnd("ctx");
  5228. $recv(aBlock)._value_((function(){
  5229. }));
  5230. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5231. $ctx1.sendIdx["value:"]=2;
  5232. //>>excludeEnd("ctx");
  5233. $recv(aBlock)._value_($recv($globals.Object)._new());
  5234. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5235. $ctx1.sendIdx["value:"]=3;
  5236. //>>excludeEnd("ctx");
  5237. $recv(aBlock)._value_("z");
  5238. return self;
  5239. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5240. }, function($ctx1) {$ctx1.fill(self,"nonIndexesDo:",{aBlock:aBlock},$globals.AssociativeCollectionTest)});
  5241. //>>excludeEnd("ctx");
  5242. },
  5243. //>>excludeStart("ide", pragmas.excludeIdeData);
  5244. args: ["aBlock"],
  5245. source: "nonIndexesDo: aBlock\x0a\x09aBlock value: 5.\x0a\x09aBlock value: [].\x0a\x09aBlock value: Object new.\x0a\x09aBlock value: 'z'",
  5246. referencedClasses: ["Object"],
  5247. //>>excludeEnd("ide");
  5248. messageSends: ["value:", "new"]
  5249. }),
  5250. $globals.AssociativeCollectionTest);
  5251. $core.addMethod(
  5252. $core.method({
  5253. selector: "sampleNewIndex",
  5254. protocol: 'fixture',
  5255. fn: function (){
  5256. var self=this;
  5257. return "new";
  5258. },
  5259. //>>excludeStart("ide", pragmas.excludeIdeData);
  5260. args: [],
  5261. source: "sampleNewIndex\x0a\x09^ 'new'",
  5262. referencedClasses: [],
  5263. //>>excludeEnd("ide");
  5264. messageSends: []
  5265. }),
  5266. $globals.AssociativeCollectionTest);
  5267. $core.addMethod(
  5268. $core.method({
  5269. selector: "samplesDo:",
  5270. protocol: 'fixture',
  5271. fn: function (aBlock){
  5272. var self=this;
  5273. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5274. return $core.withContext(function($ctx1) {
  5275. //>>excludeEnd("ctx");
  5276. $recv(aBlock)._value_value_("a",(2));
  5277. return self;
  5278. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5279. }, function($ctx1) {$ctx1.fill(self,"samplesDo:",{aBlock:aBlock},$globals.AssociativeCollectionTest)});
  5280. //>>excludeEnd("ctx");
  5281. },
  5282. //>>excludeStart("ide", pragmas.excludeIdeData);
  5283. args: ["aBlock"],
  5284. source: "samplesDo: aBlock\x0a\x09aBlock value: 'a' value: 2",
  5285. referencedClasses: [],
  5286. //>>excludeEnd("ide");
  5287. messageSends: ["value:value:"]
  5288. }),
  5289. $globals.AssociativeCollectionTest);
  5290. $core.addMethod(
  5291. $core.method({
  5292. selector: "testAddAll",
  5293. protocol: 'tests',
  5294. fn: function (){
  5295. var self=this;
  5296. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5297. return $core.withContext(function($ctx1) {
  5298. //>>excludeEnd("ctx");
  5299. var $2,$3,$4,$1,$5,$7,$8,$9,$6,$10,$12,$11;
  5300. (
  5301. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5302. $ctx1.supercall = true,
  5303. //>>excludeEnd("ctx");
  5304. ($globals.AssociativeCollectionTest.superclass||$boot.dnu).fn.prototype._testAddAll.apply($recv(self), []));
  5305. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5306. $ctx1.supercall = false;
  5307. //>>excludeEnd("ctx");;
  5308. $2=self._collection();
  5309. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5310. $ctx1.sendIdx["collection"]=1;
  5311. //>>excludeEnd("ctx");
  5312. $3=self._collection();
  5313. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5314. $ctx1.sendIdx["collection"]=2;
  5315. //>>excludeEnd("ctx");
  5316. $recv($2)._addAll_($3);
  5317. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5318. $ctx1.sendIdx["addAll:"]=1;
  5319. //>>excludeEnd("ctx");
  5320. $4=$recv($2)._yourself();
  5321. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5322. $ctx1.sendIdx["yourself"]=1;
  5323. //>>excludeEnd("ctx");
  5324. $1=$4;
  5325. $5=self._collection();
  5326. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5327. $ctx1.sendIdx["collection"]=3;
  5328. //>>excludeEnd("ctx");
  5329. self._assert_equals_($1,$5);
  5330. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5331. $ctx1.sendIdx["assert:equals:"]=1;
  5332. //>>excludeEnd("ctx");
  5333. $7=self._collection();
  5334. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5335. $ctx1.sendIdx["collection"]=4;
  5336. //>>excludeEnd("ctx");
  5337. $8=self._collectionWithNewValue();
  5338. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5339. $ctx1.sendIdx["collectionWithNewValue"]=1;
  5340. //>>excludeEnd("ctx");
  5341. $recv($7)._addAll_($8);
  5342. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5343. $ctx1.sendIdx["addAll:"]=2;
  5344. //>>excludeEnd("ctx");
  5345. $9=$recv($7)._yourself();
  5346. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5347. $ctx1.sendIdx["yourself"]=2;
  5348. //>>excludeEnd("ctx");
  5349. $6=$9;
  5350. $10=self._collectionWithNewValue();
  5351. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5352. $ctx1.sendIdx["collectionWithNewValue"]=2;
  5353. //>>excludeEnd("ctx");
  5354. self._assert_equals_($6,$10);
  5355. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5356. $ctx1.sendIdx["assert:equals:"]=2;
  5357. //>>excludeEnd("ctx");
  5358. $12=self._collectionWithNewValue();
  5359. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5360. $ctx1.sendIdx["collectionWithNewValue"]=3;
  5361. //>>excludeEnd("ctx");
  5362. $recv($12)._addAll_(self._collection());
  5363. $11=$recv($12)._yourself();
  5364. self._assert_equals_($11,self._collectionWithNewValue());
  5365. return self;
  5366. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5367. }, function($ctx1) {$ctx1.fill(self,"testAddAll",{},$globals.AssociativeCollectionTest)});
  5368. //>>excludeEnd("ctx");
  5369. },
  5370. //>>excludeStart("ide", pragmas.excludeIdeData);
  5371. args: [],
  5372. 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",
  5373. referencedClasses: [],
  5374. //>>excludeEnd("ide");
  5375. messageSends: ["testAddAll", "assert:equals:", "addAll:", "collection", "yourself", "collectionWithNewValue"]
  5376. }),
  5377. $globals.AssociativeCollectionTest);
  5378. $core.addMethod(
  5379. $core.method({
  5380. selector: "testAsDictionary",
  5381. protocol: 'tests',
  5382. fn: function (){
  5383. var self=this;
  5384. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5385. return $core.withContext(function($ctx1) {
  5386. //>>excludeEnd("ctx");
  5387. self._assert_($recv($recv($recv(self._collectionClass())._new())._asDictionary())._isMemberOf_($globals.Dictionary));
  5388. return self;
  5389. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5390. }, function($ctx1) {$ctx1.fill(self,"testAsDictionary",{},$globals.AssociativeCollectionTest)});
  5391. //>>excludeEnd("ctx");
  5392. },
  5393. //>>excludeStart("ide", pragmas.excludeIdeData);
  5394. args: [],
  5395. source: "testAsDictionary\x0aself assert: ( self collectionClass new asDictionary isMemberOf: Dictionary ).",
  5396. referencedClasses: ["Dictionary"],
  5397. //>>excludeEnd("ide");
  5398. messageSends: ["assert:", "isMemberOf:", "asDictionary", "new", "collectionClass"]
  5399. }),
  5400. $globals.AssociativeCollectionTest);
  5401. $core.addMethod(
  5402. $core.method({
  5403. selector: "testAsHashedCollection",
  5404. protocol: 'tests',
  5405. fn: function (){
  5406. var self=this;
  5407. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5408. return $core.withContext(function($ctx1) {
  5409. //>>excludeEnd("ctx");
  5410. self._assert_($recv($recv($recv(self._collectionClass())._new())._asHashedCollection())._isMemberOf_($globals.HashedCollection));
  5411. return self;
  5412. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5413. }, function($ctx1) {$ctx1.fill(self,"testAsHashedCollection",{},$globals.AssociativeCollectionTest)});
  5414. //>>excludeEnd("ctx");
  5415. },
  5416. //>>excludeStart("ide", pragmas.excludeIdeData);
  5417. args: [],
  5418. source: "testAsHashedCollection\x0aself assert: ( self collectionClass new asHashedCollection isMemberOf: HashedCollection ).",
  5419. referencedClasses: ["HashedCollection"],
  5420. //>>excludeEnd("ide");
  5421. messageSends: ["assert:", "isMemberOf:", "asHashedCollection", "new", "collectionClass"]
  5422. }),
  5423. $globals.AssociativeCollectionTest);
  5424. $core.addMethod(
  5425. $core.method({
  5426. selector: "testComma",
  5427. protocol: 'tests',
  5428. fn: function (){
  5429. var self=this;
  5430. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5431. return $core.withContext(function($ctx1) {
  5432. //>>excludeEnd("ctx");
  5433. var $2,$3,$1,$4,$6,$7,$5,$8,$10,$9;
  5434. (
  5435. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5436. $ctx1.supercall = true,
  5437. //>>excludeEnd("ctx");
  5438. ($globals.AssociativeCollectionTest.superclass||$boot.dnu).fn.prototype._testComma.apply($recv(self), []));
  5439. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5440. $ctx1.supercall = false;
  5441. //>>excludeEnd("ctx");;
  5442. $2=self._collection();
  5443. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5444. $ctx1.sendIdx["collection"]=1;
  5445. //>>excludeEnd("ctx");
  5446. $3=self._collection();
  5447. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5448. $ctx1.sendIdx["collection"]=2;
  5449. //>>excludeEnd("ctx");
  5450. $1=$recv($2).__comma($3);
  5451. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5452. $ctx1.sendIdx[","]=1;
  5453. //>>excludeEnd("ctx");
  5454. $4=self._collection();
  5455. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5456. $ctx1.sendIdx["collection"]=3;
  5457. //>>excludeEnd("ctx");
  5458. self._assert_equals_($1,$4);
  5459. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5460. $ctx1.sendIdx["assert:equals:"]=1;
  5461. //>>excludeEnd("ctx");
  5462. $6=self._collection();
  5463. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5464. $ctx1.sendIdx["collection"]=4;
  5465. //>>excludeEnd("ctx");
  5466. $7=self._collectionWithNewValue();
  5467. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5468. $ctx1.sendIdx["collectionWithNewValue"]=1;
  5469. //>>excludeEnd("ctx");
  5470. $5=$recv($6).__comma($7);
  5471. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5472. $ctx1.sendIdx[","]=2;
  5473. //>>excludeEnd("ctx");
  5474. $8=self._collectionWithNewValue();
  5475. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5476. $ctx1.sendIdx["collectionWithNewValue"]=2;
  5477. //>>excludeEnd("ctx");
  5478. self._assert_equals_($5,$8);
  5479. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5480. $ctx1.sendIdx["assert:equals:"]=2;
  5481. //>>excludeEnd("ctx");
  5482. $10=self._collectionWithNewValue();
  5483. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5484. $ctx1.sendIdx["collectionWithNewValue"]=3;
  5485. //>>excludeEnd("ctx");
  5486. $9=$recv($10).__comma(self._collection());
  5487. self._assert_equals_($9,self._collectionWithNewValue());
  5488. return self;
  5489. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5490. }, function($ctx1) {$ctx1.fill(self,"testComma",{},$globals.AssociativeCollectionTest)});
  5491. //>>excludeEnd("ctx");
  5492. },
  5493. //>>excludeStart("ide", pragmas.excludeIdeData);
  5494. args: [],
  5495. 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",
  5496. referencedClasses: [],
  5497. //>>excludeEnd("ide");
  5498. messageSends: ["testComma", "assert:equals:", ",", "collection", "collectionWithNewValue"]
  5499. }),
  5500. $globals.AssociativeCollectionTest);
  5501. $core.addMethod(
  5502. $core.method({
  5503. selector: "testFrom",
  5504. protocol: 'tests',
  5505. fn: function (){
  5506. var self=this;
  5507. var associations;
  5508. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5509. return $core.withContext(function($ctx1) {
  5510. //>>excludeEnd("ctx");
  5511. var $1;
  5512. $1="a".__minus_gt((1));
  5513. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5514. $ctx1.sendIdx["->"]=1;
  5515. //>>excludeEnd("ctx");
  5516. associations=[$1,"b".__minus_gt((2))];
  5517. self._assertSameContents_as_($recv($recv(self._class())._collectionClass())._from_(associations),$globals.HashedCollection._newFromPairs_(["a",(1),"b",(2)]));
  5518. return self;
  5519. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5520. }, function($ctx1) {$ctx1.fill(self,"testFrom",{associations:associations},$globals.AssociativeCollectionTest)});
  5521. //>>excludeEnd("ctx");
  5522. },
  5523. //>>excludeStart("ide", pragmas.excludeIdeData);
  5524. args: [],
  5525. 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 }.",
  5526. referencedClasses: [],
  5527. //>>excludeEnd("ide");
  5528. messageSends: ["->", "assertSameContents:as:", "from:", "collectionClass", "class"]
  5529. }),
  5530. $globals.AssociativeCollectionTest);
  5531. $core.addMethod(
  5532. $core.method({
  5533. selector: "testKeys",
  5534. protocol: 'tests',
  5535. fn: function (){
  5536. var self=this;
  5537. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5538. return $core.withContext(function($ctx1) {
  5539. //>>excludeEnd("ctx");
  5540. var $2,$1,$3,$4;
  5541. $2=$recv($recv(self._collectionClass())._new())._keys();
  5542. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5543. $ctx1.sendIdx["keys"]=1;
  5544. //>>excludeEnd("ctx");
  5545. $1=$recv($2)._isEmpty();
  5546. self._assert_($1);
  5547. $3=$recv(self._collection())._keys();
  5548. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5549. $ctx1.sendIdx["keys"]=2;
  5550. //>>excludeEnd("ctx");
  5551. $4=self._collectionKeys();
  5552. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5553. $ctx1.sendIdx["collectionKeys"]=1;
  5554. //>>excludeEnd("ctx");
  5555. self._assertSameContents_as_($3,$4);
  5556. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5557. $ctx1.sendIdx["assertSameContents:as:"]=1;
  5558. //>>excludeEnd("ctx");
  5559. self._assertSameContents_as_($recv(self._collectionWithNewValue())._keys(),$recv(self._collectionKeys()).__comma([self._sampleNewIndex()]));
  5560. return self;
  5561. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5562. }, function($ctx1) {$ctx1.fill(self,"testKeys",{},$globals.AssociativeCollectionTest)});
  5563. //>>excludeEnd("ctx");
  5564. },
  5565. //>>excludeStart("ide", pragmas.excludeIdeData);
  5566. args: [],
  5567. 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 }",
  5568. referencedClasses: [],
  5569. //>>excludeEnd("ide");
  5570. messageSends: ["assert:", "isEmpty", "keys", "new", "collectionClass", "assertSameContents:as:", "collection", "collectionKeys", "collectionWithNewValue", ",", "sampleNewIndex"]
  5571. }),
  5572. $globals.AssociativeCollectionTest);
  5573. $core.addMethod(
  5574. $core.method({
  5575. selector: "testNewFromPairs",
  5576. protocol: 'tests',
  5577. fn: function (){
  5578. var self=this;
  5579. var flattenedAssociations;
  5580. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5581. return $core.withContext(function($ctx1) {
  5582. //>>excludeEnd("ctx");
  5583. flattenedAssociations=["a",(1),"b",(2)];
  5584. self._assertSameContents_as_($recv($recv(self._class())._collectionClass())._newFromPairs_(flattenedAssociations),$globals.HashedCollection._newFromPairs_(["a",(1),"b",(2)]));
  5585. return self;
  5586. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5587. }, function($ctx1) {$ctx1.fill(self,"testNewFromPairs",{flattenedAssociations:flattenedAssociations},$globals.AssociativeCollectionTest)});
  5588. //>>excludeEnd("ctx");
  5589. },
  5590. //>>excludeStart("ide", pragmas.excludeIdeData);
  5591. args: [],
  5592. 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 }.",
  5593. referencedClasses: [],
  5594. //>>excludeEnd("ide");
  5595. messageSends: ["assertSameContents:as:", "newFromPairs:", "collectionClass", "class"]
  5596. }),
  5597. $globals.AssociativeCollectionTest);
  5598. $core.addMethod(
  5599. $core.method({
  5600. selector: "testPrintString",
  5601. protocol: 'tests',
  5602. fn: function (){
  5603. var self=this;
  5604. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5605. return $core.withContext(function($ctx1) {
  5606. //>>excludeEnd("ctx");
  5607. var $3,$2,$1,$4;
  5608. $3=self._collectionClass();
  5609. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5610. $ctx1.sendIdx["collectionClass"]=1;
  5611. //>>excludeEnd("ctx");
  5612. $2=$recv($3)._new();
  5613. $recv($2)._at_put_("firstname","James");
  5614. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5615. $ctx1.sendIdx["at:put:"]=1;
  5616. //>>excludeEnd("ctx");
  5617. $recv($2)._at_put_("lastname","Bond");
  5618. $1=$recv($2)._printString();
  5619. $4=$recv("a ".__comma($recv(self._collectionClass())._name())).__comma(" ('firstname' -> 'James' , 'lastname' -> 'Bond')");
  5620. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5621. $ctx1.sendIdx[","]=1;
  5622. //>>excludeEnd("ctx");
  5623. self._assert_equals_($1,$4);
  5624. return self;
  5625. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5626. }, function($ctx1) {$ctx1.fill(self,"testPrintString",{},$globals.AssociativeCollectionTest)});
  5627. //>>excludeEnd("ctx");
  5628. },
  5629. //>>excludeStart("ide", pragmas.excludeIdeData);
  5630. args: [],
  5631. 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'')'",
  5632. referencedClasses: [],
  5633. //>>excludeEnd("ide");
  5634. messageSends: ["assert:equals:", "at:put:", "new", "collectionClass", "printString", ",", "name"]
  5635. }),
  5636. $globals.AssociativeCollectionTest);
  5637. $core.addMethod(
  5638. $core.method({
  5639. selector: "testRemoveKey",
  5640. protocol: 'tests',
  5641. fn: function (){
  5642. var self=this;
  5643. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5644. return $core.withContext(function($ctx1) {
  5645. //>>excludeEnd("ctx");
  5646. var $1,$2,$3,$5,$6,$4,$8,$7;
  5647. self._nonIndexesDo_((function(each){
  5648. var collection;
  5649. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5650. return $core.withContext(function($ctx2) {
  5651. //>>excludeEnd("ctx");
  5652. collection=self._collection();
  5653. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5654. $ctx2.sendIdx["collection"]=1;
  5655. //>>excludeEnd("ctx");
  5656. collection;
  5657. self._should_raise_((function(){
  5658. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5659. return $core.withContext(function($ctx3) {
  5660. //>>excludeEnd("ctx");
  5661. return $recv(collection)._removeKey_(each);
  5662. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5663. $ctx3.sendIdx["removeKey:"]=1;
  5664. //>>excludeEnd("ctx");
  5665. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5666. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  5667. //>>excludeEnd("ctx");
  5668. }),$globals.Error);
  5669. $1=collection;
  5670. $2=self._collection();
  5671. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5672. $ctx2.sendIdx["collection"]=2;
  5673. //>>excludeEnd("ctx");
  5674. return self._assert_equals_($1,$2);
  5675. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5676. $ctx2.sendIdx["assert:equals:"]=1;
  5677. //>>excludeEnd("ctx");
  5678. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5679. }, function($ctx2) {$ctx2.fillBlock({each:each,collection:collection},$ctx1,1)});
  5680. //>>excludeEnd("ctx");
  5681. }));
  5682. self._samplesDo_((function(index,value){
  5683. var collection;
  5684. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5685. return $core.withContext(function($ctx2) {
  5686. //>>excludeEnd("ctx");
  5687. collection=self._collection();
  5688. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5689. $ctx2.sendIdx["collection"]=3;
  5690. //>>excludeEnd("ctx");
  5691. collection;
  5692. $3=$recv(collection)._removeKey_(index);
  5693. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5694. $ctx2.sendIdx["removeKey:"]=2;
  5695. //>>excludeEnd("ctx");
  5696. self._assert_equals_($3,value);
  5697. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5698. $ctx2.sendIdx["assert:equals:"]=2;
  5699. //>>excludeEnd("ctx");
  5700. $5=collection;
  5701. $6=self._collection();
  5702. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5703. $ctx2.sendIdx["collection"]=4;
  5704. //>>excludeEnd("ctx");
  5705. $4=$recv($5).__eq($6);
  5706. return self._deny_($4);
  5707. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5708. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value,collection:collection},$ctx1,3)});
  5709. //>>excludeEnd("ctx");
  5710. }));
  5711. $8=self._collectionWithNewValue();
  5712. $recv($8)._removeKey_(self._sampleNewIndex());
  5713. $7=$recv($8)._yourself();
  5714. self._assert_equals_($7,self._collection());
  5715. return self;
  5716. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5717. }, function($ctx1) {$ctx1.fill(self,"testRemoveKey",{},$globals.AssociativeCollectionTest)});
  5718. //>>excludeEnd("ctx");
  5719. },
  5720. //>>excludeStart("ide", pragmas.excludeIdeData);
  5721. args: [],
  5722. 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",
  5723. referencedClasses: ["Error"],
  5724. //>>excludeEnd("ide");
  5725. messageSends: ["nonIndexesDo:", "collection", "should:raise:", "removeKey:", "assert:equals:", "samplesDo:", "deny:", "=", "collectionWithNewValue", "sampleNewIndex", "yourself"]
  5726. }),
  5727. $globals.AssociativeCollectionTest);
  5728. $core.addMethod(
  5729. $core.method({
  5730. selector: "testRemoveKeyIfAbsent",
  5731. protocol: 'tests',
  5732. fn: function (){
  5733. var self=this;
  5734. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5735. return $core.withContext(function($ctx1) {
  5736. //>>excludeEnd("ctx");
  5737. var $1,$2,$3,$4,$5,$7,$8,$6,$10,$9;
  5738. self._nonIndexesDo_((function(each){
  5739. var collection;
  5740. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5741. return $core.withContext(function($ctx2) {
  5742. //>>excludeEnd("ctx");
  5743. collection=self._collection();
  5744. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5745. $ctx2.sendIdx["collection"]=1;
  5746. //>>excludeEnd("ctx");
  5747. collection;
  5748. $1=$recv(collection)._removeKey_ifAbsent_(each,(function(){
  5749. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5750. return $core.withContext(function($ctx3) {
  5751. //>>excludeEnd("ctx");
  5752. return self._sampleNewValue();
  5753. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5754. $ctx3.sendIdx["sampleNewValue"]=1;
  5755. //>>excludeEnd("ctx");
  5756. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5757. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  5758. //>>excludeEnd("ctx");
  5759. }));
  5760. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5761. $ctx2.sendIdx["removeKey:ifAbsent:"]=1;
  5762. //>>excludeEnd("ctx");
  5763. $2=self._sampleNewValue();
  5764. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5765. $ctx2.sendIdx["sampleNewValue"]=2;
  5766. //>>excludeEnd("ctx");
  5767. self._assert_equals_($1,$2);
  5768. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5769. $ctx2.sendIdx["assert:equals:"]=1;
  5770. //>>excludeEnd("ctx");
  5771. $3=collection;
  5772. $4=self._collection();
  5773. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5774. $ctx2.sendIdx["collection"]=2;
  5775. //>>excludeEnd("ctx");
  5776. return self._assert_equals_($3,$4);
  5777. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5778. $ctx2.sendIdx["assert:equals:"]=2;
  5779. //>>excludeEnd("ctx");
  5780. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5781. }, function($ctx2) {$ctx2.fillBlock({each:each,collection:collection},$ctx1,1)});
  5782. //>>excludeEnd("ctx");
  5783. }));
  5784. self._samplesDo_((function(index,value){
  5785. var collection;
  5786. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5787. return $core.withContext(function($ctx2) {
  5788. //>>excludeEnd("ctx");
  5789. collection=self._collection();
  5790. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5791. $ctx2.sendIdx["collection"]=3;
  5792. //>>excludeEnd("ctx");
  5793. collection;
  5794. $5=$recv(collection)._removeKey_ifAbsent_(index,(function(){
  5795. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5796. return $core.withContext(function($ctx3) {
  5797. //>>excludeEnd("ctx");
  5798. return self._sampleNewValue();
  5799. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5800. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,4)});
  5801. //>>excludeEnd("ctx");
  5802. }));
  5803. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5804. $ctx2.sendIdx["removeKey:ifAbsent:"]=2;
  5805. //>>excludeEnd("ctx");
  5806. self._assert_equals_($5,value);
  5807. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5808. $ctx2.sendIdx["assert:equals:"]=3;
  5809. //>>excludeEnd("ctx");
  5810. $7=collection;
  5811. $8=self._collection();
  5812. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5813. $ctx2.sendIdx["collection"]=4;
  5814. //>>excludeEnd("ctx");
  5815. $6=$recv($7).__eq($8);
  5816. return self._deny_($6);
  5817. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5818. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value,collection:collection},$ctx1,3)});
  5819. //>>excludeEnd("ctx");
  5820. }));
  5821. $10=self._collectionWithNewValue();
  5822. $recv($10)._removeKey_ifAbsent_(self._sampleNewIndex(),(function(){
  5823. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5824. return $core.withContext(function($ctx2) {
  5825. //>>excludeEnd("ctx");
  5826. return self._assert_(false);
  5827. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5828. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,5)});
  5829. //>>excludeEnd("ctx");
  5830. }));
  5831. $9=$recv($10)._yourself();
  5832. self._assert_equals_($9,self._collection());
  5833. return self;
  5834. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5835. }, function($ctx1) {$ctx1.fill(self,"testRemoveKeyIfAbsent",{},$globals.AssociativeCollectionTest)});
  5836. //>>excludeEnd("ctx");
  5837. },
  5838. //>>excludeStart("ide", pragmas.excludeIdeData);
  5839. args: [],
  5840. 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",
  5841. referencedClasses: [],
  5842. //>>excludeEnd("ide");
  5843. messageSends: ["nonIndexesDo:", "collection", "assert:equals:", "removeKey:ifAbsent:", "sampleNewValue", "samplesDo:", "deny:", "=", "collectionWithNewValue", "sampleNewIndex", "assert:", "yourself"]
  5844. }),
  5845. $globals.AssociativeCollectionTest);
  5846. $core.addMethod(
  5847. $core.method({
  5848. selector: "testValues",
  5849. protocol: 'tests',
  5850. fn: function (){
  5851. var self=this;
  5852. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5853. return $core.withContext(function($ctx1) {
  5854. //>>excludeEnd("ctx");
  5855. var $2,$1,$3,$4;
  5856. $2=$recv($recv(self._collectionClass())._new())._values();
  5857. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5858. $ctx1.sendIdx["values"]=1;
  5859. //>>excludeEnd("ctx");
  5860. $1=$recv($2)._isEmpty();
  5861. self._assert_($1);
  5862. $3=$recv(self._collection())._values();
  5863. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5864. $ctx1.sendIdx["values"]=2;
  5865. //>>excludeEnd("ctx");
  5866. $4=self._collectionValues();
  5867. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5868. $ctx1.sendIdx["collectionValues"]=1;
  5869. //>>excludeEnd("ctx");
  5870. self._assertSameContents_as_($3,$4);
  5871. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5872. $ctx1.sendIdx["assertSameContents:as:"]=1;
  5873. //>>excludeEnd("ctx");
  5874. self._assertSameContents_as_($recv(self._collectionWithNewValue())._values(),$recv(self._collectionValues()).__comma([self._sampleNewValue()]));
  5875. return self;
  5876. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5877. }, function($ctx1) {$ctx1.fill(self,"testValues",{},$globals.AssociativeCollectionTest)});
  5878. //>>excludeEnd("ctx");
  5879. },
  5880. //>>excludeStart("ide", pragmas.excludeIdeData);
  5881. args: [],
  5882. 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 }",
  5883. referencedClasses: [],
  5884. //>>excludeEnd("ide");
  5885. messageSends: ["assert:", "isEmpty", "values", "new", "collectionClass", "assertSameContents:as:", "collection", "collectionValues", "collectionWithNewValue", ",", "sampleNewValue"]
  5886. }),
  5887. $globals.AssociativeCollectionTest);
  5888. $core.addClass('DictionaryTest', $globals.AssociativeCollectionTest, [], 'Kernel-Tests');
  5889. $core.addMethod(
  5890. $core.method({
  5891. selector: "collection",
  5892. protocol: 'fixture',
  5893. fn: function (){
  5894. var self=this;
  5895. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5896. return $core.withContext(function($ctx1) {
  5897. //>>excludeEnd("ctx");
  5898. var $1;
  5899. $1=$recv($globals.Dictionary)._new();
  5900. $recv($1)._at_put_((1),(1));
  5901. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5902. $ctx1.sendIdx["at:put:"]=1;
  5903. //>>excludeEnd("ctx");
  5904. $recv($1)._at_put_("a",(2));
  5905. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5906. $ctx1.sendIdx["at:put:"]=2;
  5907. //>>excludeEnd("ctx");
  5908. $recv($1)._at_put_(true,(3));
  5909. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5910. $ctx1.sendIdx["at:put:"]=3;
  5911. //>>excludeEnd("ctx");
  5912. $recv($1)._at_put_((1).__at((3)),(-4));
  5913. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5914. $ctx1.sendIdx["at:put:"]=4;
  5915. //>>excludeEnd("ctx");
  5916. $recv($1)._at_put_(self["@sampleBlock"],(9));
  5917. return $recv($1)._yourself();
  5918. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5919. }, function($ctx1) {$ctx1.fill(self,"collection",{},$globals.DictionaryTest)});
  5920. //>>excludeEnd("ctx");
  5921. },
  5922. //>>excludeStart("ide", pragmas.excludeIdeData);
  5923. args: [],
  5924. 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",
  5925. referencedClasses: ["Dictionary"],
  5926. //>>excludeEnd("ide");
  5927. messageSends: ["at:put:", "new", "@", "yourself"]
  5928. }),
  5929. $globals.DictionaryTest);
  5930. $core.addMethod(
  5931. $core.method({
  5932. selector: "collectionKeys",
  5933. protocol: 'fixture',
  5934. fn: function (){
  5935. var self=this;
  5936. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5937. return $core.withContext(function($ctx1) {
  5938. //>>excludeEnd("ctx");
  5939. return [(1),"a",true,(1).__at((3)),self["@sampleBlock"]];
  5940. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5941. }, function($ctx1) {$ctx1.fill(self,"collectionKeys",{},$globals.DictionaryTest)});
  5942. //>>excludeEnd("ctx");
  5943. },
  5944. //>>excludeStart("ide", pragmas.excludeIdeData);
  5945. args: [],
  5946. source: "collectionKeys\x0a\x09^ {1. 'a'. true. 1@3. sampleBlock}",
  5947. referencedClasses: [],
  5948. //>>excludeEnd("ide");
  5949. messageSends: ["@"]
  5950. }),
  5951. $globals.DictionaryTest);
  5952. $core.addMethod(
  5953. $core.method({
  5954. selector: "collectionOfPrintStrings",
  5955. protocol: 'fixture',
  5956. fn: function (){
  5957. var self=this;
  5958. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5959. return $core.withContext(function($ctx1) {
  5960. //>>excludeEnd("ctx");
  5961. var $1;
  5962. $1=$recv($globals.Dictionary)._new();
  5963. $recv($1)._at_put_((1),"1");
  5964. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5965. $ctx1.sendIdx["at:put:"]=1;
  5966. //>>excludeEnd("ctx");
  5967. $recv($1)._at_put_("a","2");
  5968. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5969. $ctx1.sendIdx["at:put:"]=2;
  5970. //>>excludeEnd("ctx");
  5971. $recv($1)._at_put_(true,"3");
  5972. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5973. $ctx1.sendIdx["at:put:"]=3;
  5974. //>>excludeEnd("ctx");
  5975. $recv($1)._at_put_((1).__at((3)),"-4");
  5976. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5977. $ctx1.sendIdx["at:put:"]=4;
  5978. //>>excludeEnd("ctx");
  5979. $recv($1)._at_put_(self["@sampleBlock"],"9");
  5980. return $recv($1)._yourself();
  5981. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5982. }, function($ctx1) {$ctx1.fill(self,"collectionOfPrintStrings",{},$globals.DictionaryTest)});
  5983. //>>excludeEnd("ctx");
  5984. },
  5985. //>>excludeStart("ide", pragmas.excludeIdeData);
  5986. args: [],
  5987. 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",
  5988. referencedClasses: ["Dictionary"],
  5989. //>>excludeEnd("ide");
  5990. messageSends: ["at:put:", "new", "@", "yourself"]
  5991. }),
  5992. $globals.DictionaryTest);
  5993. $core.addMethod(
  5994. $core.method({
  5995. selector: "collectionSize",
  5996. protocol: 'fixture',
  5997. fn: function (){
  5998. var self=this;
  5999. return (5);
  6000. },
  6001. //>>excludeStart("ide", pragmas.excludeIdeData);
  6002. args: [],
  6003. source: "collectionSize\x0a\x09^ 5",
  6004. referencedClasses: [],
  6005. //>>excludeEnd("ide");
  6006. messageSends: []
  6007. }),
  6008. $globals.DictionaryTest);
  6009. $core.addMethod(
  6010. $core.method({
  6011. selector: "collectionValues",
  6012. protocol: 'fixture',
  6013. fn: function (){
  6014. var self=this;
  6015. return [(1),(2),(3),(-4),(9)];
  6016. },
  6017. //>>excludeStart("ide", pragmas.excludeIdeData);
  6018. args: [],
  6019. source: "collectionValues\x0a\x09^ {1. 2. 3. -4. 9}",
  6020. referencedClasses: [],
  6021. //>>excludeEnd("ide");
  6022. messageSends: []
  6023. }),
  6024. $globals.DictionaryTest);
  6025. $core.addMethod(
  6026. $core.method({
  6027. selector: "collectionWithDuplicates",
  6028. protocol: 'fixture',
  6029. fn: function (){
  6030. var self=this;
  6031. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6032. return $core.withContext(function($ctx1) {
  6033. //>>excludeEnd("ctx");
  6034. var $1;
  6035. $1=$recv($globals.Dictionary)._new();
  6036. $recv($1)._at_put_((1),(1));
  6037. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6038. $ctx1.sendIdx["at:put:"]=1;
  6039. //>>excludeEnd("ctx");
  6040. $recv($1)._at_put_("a",(2));
  6041. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6042. $ctx1.sendIdx["at:put:"]=2;
  6043. //>>excludeEnd("ctx");
  6044. $recv($1)._at_put_(true,(3));
  6045. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6046. $ctx1.sendIdx["at:put:"]=3;
  6047. //>>excludeEnd("ctx");
  6048. $recv($1)._at_put_((4),(-4));
  6049. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6050. $ctx1.sendIdx["at:put:"]=4;
  6051. //>>excludeEnd("ctx");
  6052. $recv($1)._at_put_(self["@sampleBlock"],(9));
  6053. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6054. $ctx1.sendIdx["at:put:"]=5;
  6055. //>>excludeEnd("ctx");
  6056. $recv($1)._at_put_("b",(1));
  6057. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6058. $ctx1.sendIdx["at:put:"]=6;
  6059. //>>excludeEnd("ctx");
  6060. $recv($1)._at_put_((3),(3));
  6061. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6062. $ctx1.sendIdx["at:put:"]=7;
  6063. //>>excludeEnd("ctx");
  6064. $recv($1)._at_put_(false,(12));
  6065. return $recv($1)._yourself();
  6066. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6067. }, function($ctx1) {$ctx1.fill(self,"collectionWithDuplicates",{},$globals.DictionaryTest)});
  6068. //>>excludeEnd("ctx");
  6069. },
  6070. //>>excludeStart("ide", pragmas.excludeIdeData);
  6071. args: [],
  6072. 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",
  6073. referencedClasses: ["Dictionary"],
  6074. //>>excludeEnd("ide");
  6075. messageSends: ["at:put:", "new", "yourself"]
  6076. }),
  6077. $globals.DictionaryTest);
  6078. $core.addMethod(
  6079. $core.method({
  6080. selector: "collectionWithNewValue",
  6081. protocol: 'fixture',
  6082. fn: function (){
  6083. var self=this;
  6084. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6085. return $core.withContext(function($ctx1) {
  6086. //>>excludeEnd("ctx");
  6087. var $1;
  6088. $1=$recv($globals.Dictionary)._new();
  6089. $recv($1)._at_put_((1),(1));
  6090. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6091. $ctx1.sendIdx["at:put:"]=1;
  6092. //>>excludeEnd("ctx");
  6093. $recv($1)._at_put_("a",(2));
  6094. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6095. $ctx1.sendIdx["at:put:"]=2;
  6096. //>>excludeEnd("ctx");
  6097. $recv($1)._at_put_(true,(3));
  6098. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6099. $ctx1.sendIdx["at:put:"]=3;
  6100. //>>excludeEnd("ctx");
  6101. $recv($1)._at_put_((1).__at((3)),(-4));
  6102. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6103. $ctx1.sendIdx["at:put:"]=4;
  6104. //>>excludeEnd("ctx");
  6105. $recv($1)._at_put_(self["@sampleBlock"],(9));
  6106. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6107. $ctx1.sendIdx["at:put:"]=5;
  6108. //>>excludeEnd("ctx");
  6109. $recv($1)._at_put_("new","N");
  6110. return $recv($1)._yourself();
  6111. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6112. }, function($ctx1) {$ctx1.fill(self,"collectionWithNewValue",{},$globals.DictionaryTest)});
  6113. //>>excludeEnd("ctx");
  6114. },
  6115. //>>excludeStart("ide", pragmas.excludeIdeData);
  6116. args: [],
  6117. 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",
  6118. referencedClasses: ["Dictionary"],
  6119. //>>excludeEnd("ide");
  6120. messageSends: ["at:put:", "new", "@", "yourself"]
  6121. }),
  6122. $globals.DictionaryTest);
  6123. $core.addMethod(
  6124. $core.method({
  6125. selector: "sampleNewValueAsCollection",
  6126. protocol: 'fixture',
  6127. fn: function (){
  6128. var self=this;
  6129. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6130. return $core.withContext(function($ctx1) {
  6131. //>>excludeEnd("ctx");
  6132. var $1;
  6133. $1=$recv($globals.Dictionary)._new();
  6134. $recv($1)._at_put_("new","N");
  6135. return $recv($1)._yourself();
  6136. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6137. }, function($ctx1) {$ctx1.fill(self,"sampleNewValueAsCollection",{},$globals.DictionaryTest)});
  6138. //>>excludeEnd("ctx");
  6139. },
  6140. //>>excludeStart("ide", pragmas.excludeIdeData);
  6141. args: [],
  6142. source: "sampleNewValueAsCollection\x0a\x09^ Dictionary new\x0a\x09\x09at: 'new' put: 'N';\x0a\x09\x09yourself",
  6143. referencedClasses: ["Dictionary"],
  6144. //>>excludeEnd("ide");
  6145. messageSends: ["at:put:", "new", "yourself"]
  6146. }),
  6147. $globals.DictionaryTest);
  6148. $core.addMethod(
  6149. $core.method({
  6150. selector: "samplesDo:",
  6151. protocol: 'fixture',
  6152. fn: function (aBlock){
  6153. var self=this;
  6154. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6155. return $core.withContext(function($ctx1) {
  6156. //>>excludeEnd("ctx");
  6157. (
  6158. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6159. $ctx1.supercall = true,
  6160. //>>excludeEnd("ctx");
  6161. ($globals.DictionaryTest.superclass||$boot.dnu).fn.prototype._samplesDo_.apply($recv(self), [aBlock]));
  6162. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6163. $ctx1.supercall = false;
  6164. //>>excludeEnd("ctx");;
  6165. $recv(aBlock)._value_value_(true,(3));
  6166. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6167. $ctx1.sendIdx["value:value:"]=1;
  6168. //>>excludeEnd("ctx");
  6169. $recv(aBlock)._value_value_((1).__at((3)),(-4));
  6170. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6171. $ctx1.sendIdx["value:value:"]=2;
  6172. //>>excludeEnd("ctx");
  6173. $recv(aBlock)._value_value_(self["@sampleBlock"],(9));
  6174. return self;
  6175. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6176. }, function($ctx1) {$ctx1.fill(self,"samplesDo:",{aBlock:aBlock},$globals.DictionaryTest)});
  6177. //>>excludeEnd("ctx");
  6178. },
  6179. //>>excludeStart("ide", pragmas.excludeIdeData);
  6180. args: ["aBlock"],
  6181. 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",
  6182. referencedClasses: [],
  6183. //>>excludeEnd("ide");
  6184. messageSends: ["samplesDo:", "value:value:", "@"]
  6185. }),
  6186. $globals.DictionaryTest);
  6187. $core.addMethod(
  6188. $core.method({
  6189. selector: "testAccessing",
  6190. protocol: 'tests',
  6191. fn: function (){
  6192. var self=this;
  6193. var d;
  6194. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6195. return $core.withContext(function($ctx1) {
  6196. //>>excludeEnd("ctx");
  6197. var $1,$2,$3,$4,$5,$6,$7,$9,$10,$8,$12,$13,$11;
  6198. d=$recv($globals.Dictionary)._new();
  6199. $recv(d)._at_put_("hello","world");
  6200. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6201. $ctx1.sendIdx["at:put:"]=1;
  6202. //>>excludeEnd("ctx");
  6203. $1=$recv(d)._at_("hello");
  6204. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6205. $ctx1.sendIdx["at:"]=1;
  6206. //>>excludeEnd("ctx");
  6207. self._assert_equals_($1,"world");
  6208. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6209. $ctx1.sendIdx["assert:equals:"]=1;
  6210. //>>excludeEnd("ctx");
  6211. $2=$recv(d)._at_ifAbsent_("hello",(function(){
  6212. return nil;
  6213. }));
  6214. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6215. $ctx1.sendIdx["at:ifAbsent:"]=1;
  6216. //>>excludeEnd("ctx");
  6217. self._assert_equals_($2,"world");
  6218. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6219. $ctx1.sendIdx["assert:equals:"]=2;
  6220. //>>excludeEnd("ctx");
  6221. self._deny_($recv($recv(d)._at_ifAbsent_("foo",(function(){
  6222. return nil;
  6223. }))).__eq("world"));
  6224. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6225. $ctx1.sendIdx["deny:"]=1;
  6226. //>>excludeEnd("ctx");
  6227. $3=$recv(d)._includesKey_("hello");
  6228. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6229. $ctx1.sendIdx["includesKey:"]=1;
  6230. //>>excludeEnd("ctx");
  6231. self._assert_($3);
  6232. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6233. $ctx1.sendIdx["assert:"]=1;
  6234. //>>excludeEnd("ctx");
  6235. $4=$recv(d)._includesKey_("foo");
  6236. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6237. $ctx1.sendIdx["includesKey:"]=2;
  6238. //>>excludeEnd("ctx");
  6239. self._deny_($4);
  6240. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6241. $ctx1.sendIdx["deny:"]=2;
  6242. //>>excludeEnd("ctx");
  6243. $recv(d)._at_put_((1),(2));
  6244. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6245. $ctx1.sendIdx["at:put:"]=2;
  6246. //>>excludeEnd("ctx");
  6247. $5=$recv(d)._at_((1));
  6248. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6249. $ctx1.sendIdx["at:"]=2;
  6250. //>>excludeEnd("ctx");
  6251. self._assert_equals_($5,(2));
  6252. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6253. $ctx1.sendIdx["assert:equals:"]=3;
  6254. //>>excludeEnd("ctx");
  6255. $6=d;
  6256. $7=(1).__at((3));
  6257. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6258. $ctx1.sendIdx["@"]=1;
  6259. //>>excludeEnd("ctx");
  6260. $recv($6)._at_put_($7,(3));
  6261. $9=d;
  6262. $10=(1).__at((3));
  6263. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6264. $ctx1.sendIdx["@"]=2;
  6265. //>>excludeEnd("ctx");
  6266. $8=$recv($9)._at_($10);
  6267. self._assert_equals_($8,(3));
  6268. $12=d;
  6269. $13=(1).__at((3));
  6270. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6271. $ctx1.sendIdx["@"]=3;
  6272. //>>excludeEnd("ctx");
  6273. $11=$recv($12)._includesKey_($13);
  6274. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6275. $ctx1.sendIdx["includesKey:"]=3;
  6276. //>>excludeEnd("ctx");
  6277. self._assert_($11);
  6278. self._deny_($recv(d)._includesKey_((3).__at((1))));
  6279. return self;
  6280. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6281. }, function($ctx1) {$ctx1.fill(self,"testAccessing",{d:d},$globals.DictionaryTest)});
  6282. //>>excludeEnd("ctx");
  6283. },
  6284. //>>excludeStart("ide", pragmas.excludeIdeData);
  6285. args: [],
  6286. 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)",
  6287. referencedClasses: ["Dictionary"],
  6288. //>>excludeEnd("ide");
  6289. messageSends: ["new", "at:put:", "assert:equals:", "at:", "at:ifAbsent:", "deny:", "=", "assert:", "includesKey:", "@"]
  6290. }),
  6291. $globals.DictionaryTest);
  6292. $core.addMethod(
  6293. $core.method({
  6294. selector: "testDynamicDictionaries",
  6295. protocol: 'tests',
  6296. fn: function (){
  6297. var self=this;
  6298. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6299. return $core.withContext(function($ctx1) {
  6300. //>>excludeEnd("ctx");
  6301. self._assert_equals_($recv($globals.HashedCollection._newFromPairs_(["hello",(1)]))._asDictionary(),$recv($globals.Dictionary)._with_("hello".__minus_gt((1))));
  6302. return self;
  6303. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6304. }, function($ctx1) {$ctx1.fill(self,"testDynamicDictionaries",{},$globals.DictionaryTest)});
  6305. //>>excludeEnd("ctx");
  6306. },
  6307. //>>excludeStart("ide", pragmas.excludeIdeData);
  6308. args: [],
  6309. source: "testDynamicDictionaries\x0a\x09self assert: #{'hello' -> 1} asDictionary equals: (Dictionary with: 'hello' -> 1)",
  6310. referencedClasses: ["Dictionary"],
  6311. //>>excludeEnd("ide");
  6312. messageSends: ["assert:equals:", "asDictionary", "with:", "->"]
  6313. }),
  6314. $globals.DictionaryTest);
  6315. $core.addMethod(
  6316. $core.method({
  6317. selector: "collectionClass",
  6318. protocol: 'fixture',
  6319. fn: function (){
  6320. var self=this;
  6321. return $globals.Dictionary;
  6322. },
  6323. //>>excludeStart("ide", pragmas.excludeIdeData);
  6324. args: [],
  6325. source: "collectionClass\x0a\x09^ Dictionary",
  6326. referencedClasses: ["Dictionary"],
  6327. //>>excludeEnd("ide");
  6328. messageSends: []
  6329. }),
  6330. $globals.DictionaryTest.klass);
  6331. $core.addClass('HashedCollectionTest', $globals.AssociativeCollectionTest, [], 'Kernel-Tests');
  6332. $core.addMethod(
  6333. $core.method({
  6334. selector: "collection",
  6335. protocol: 'fixture',
  6336. fn: function (){
  6337. var self=this;
  6338. return $globals.HashedCollection._newFromPairs_(["b",(1),"a",(2),"c",(3),"d",(-4)]);
  6339. },
  6340. //>>excludeStart("ide", pragmas.excludeIdeData);
  6341. args: [],
  6342. source: "collection\x0a\x09^ #{ 'b' -> 1. 'a' -> 2. 'c' -> 3. 'd' -> -4 }",
  6343. referencedClasses: [],
  6344. //>>excludeEnd("ide");
  6345. messageSends: []
  6346. }),
  6347. $globals.HashedCollectionTest);
  6348. $core.addMethod(
  6349. $core.method({
  6350. selector: "collectionKeys",
  6351. protocol: 'fixture',
  6352. fn: function (){
  6353. var self=this;
  6354. return ["b","a","c","d"];
  6355. },
  6356. //>>excludeStart("ide", pragmas.excludeIdeData);
  6357. args: [],
  6358. source: "collectionKeys\x0a\x09^ { 'b'. 'a'. 'c'. 'd' }",
  6359. referencedClasses: [],
  6360. //>>excludeEnd("ide");
  6361. messageSends: []
  6362. }),
  6363. $globals.HashedCollectionTest);
  6364. $core.addMethod(
  6365. $core.method({
  6366. selector: "collectionOfPrintStrings",
  6367. protocol: 'fixture',
  6368. fn: function (){
  6369. var self=this;
  6370. return $globals.HashedCollection._newFromPairs_(["b","1","a","2","c","3","d","-4"]);
  6371. },
  6372. //>>excludeStart("ide", pragmas.excludeIdeData);
  6373. args: [],
  6374. source: "collectionOfPrintStrings\x0a\x09^ #{ 'b' -> '1'. 'a' -> '2'. 'c' -> '3'. 'd' -> '-4' }",
  6375. referencedClasses: [],
  6376. //>>excludeEnd("ide");
  6377. messageSends: []
  6378. }),
  6379. $globals.HashedCollectionTest);
  6380. $core.addMethod(
  6381. $core.method({
  6382. selector: "collectionSize",
  6383. protocol: 'fixture',
  6384. fn: function (){
  6385. var self=this;
  6386. return (4);
  6387. },
  6388. //>>excludeStart("ide", pragmas.excludeIdeData);
  6389. args: [],
  6390. source: "collectionSize\x0a\x09^ 4",
  6391. referencedClasses: [],
  6392. //>>excludeEnd("ide");
  6393. messageSends: []
  6394. }),
  6395. $globals.HashedCollectionTest);
  6396. $core.addMethod(
  6397. $core.method({
  6398. selector: "collectionValues",
  6399. protocol: 'fixture',
  6400. fn: function (){
  6401. var self=this;
  6402. return [(1),(2),(3),(-4)];
  6403. },
  6404. //>>excludeStart("ide", pragmas.excludeIdeData);
  6405. args: [],
  6406. source: "collectionValues\x0a\x09^ { 1. 2. 3. -4 }",
  6407. referencedClasses: [],
  6408. //>>excludeEnd("ide");
  6409. messageSends: []
  6410. }),
  6411. $globals.HashedCollectionTest);
  6412. $core.addMethod(
  6413. $core.method({
  6414. selector: "collectionWithDuplicates",
  6415. protocol: 'fixture',
  6416. fn: function (){
  6417. var self=this;
  6418. return $globals.HashedCollection._newFromPairs_(["b",(1),"a",(2),"c",(3),"d",(-4),"e",(1),"f",(2),"g",(10),"h",(0)]);
  6419. },
  6420. //>>excludeStart("ide", pragmas.excludeIdeData);
  6421. args: [],
  6422. source: "collectionWithDuplicates\x0a\x09^ #{ 'b' -> 1. 'a' -> 2. 'c' -> 3. 'd' -> -4. 'e' -> 1. 'f' -> 2. 'g' -> 10. 'h' -> 0 }",
  6423. referencedClasses: [],
  6424. //>>excludeEnd("ide");
  6425. messageSends: []
  6426. }),
  6427. $globals.HashedCollectionTest);
  6428. $core.addMethod(
  6429. $core.method({
  6430. selector: "collectionWithNewValue",
  6431. protocol: 'fixture',
  6432. fn: function (){
  6433. var self=this;
  6434. return $globals.HashedCollection._newFromPairs_(["b",(1),"a",(2),"c",(3),"d",(-4),"new","N"]);
  6435. },
  6436. //>>excludeStart("ide", pragmas.excludeIdeData);
  6437. args: [],
  6438. source: "collectionWithNewValue\x0a\x09^ #{ 'b' -> 1. 'a' -> 2. 'c' -> 3. 'd' -> -4. 'new' -> 'N' }",
  6439. referencedClasses: [],
  6440. //>>excludeEnd("ide");
  6441. messageSends: []
  6442. }),
  6443. $globals.HashedCollectionTest);
  6444. $core.addMethod(
  6445. $core.method({
  6446. selector: "sampleNewValueAsCollection",
  6447. protocol: 'fixture',
  6448. fn: function (){
  6449. var self=this;
  6450. return $globals.HashedCollection._newFromPairs_(["new","N"]);
  6451. },
  6452. //>>excludeStart("ide", pragmas.excludeIdeData);
  6453. args: [],
  6454. source: "sampleNewValueAsCollection\x0a\x09^ #{ 'new' -> 'N' }",
  6455. referencedClasses: [],
  6456. //>>excludeEnd("ide");
  6457. messageSends: []
  6458. }),
  6459. $globals.HashedCollectionTest);
  6460. $core.addMethod(
  6461. $core.method({
  6462. selector: "testDynamicDictionaries",
  6463. protocol: 'tests',
  6464. fn: function (){
  6465. var self=this;
  6466. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6467. return $core.withContext(function($ctx1) {
  6468. //>>excludeEnd("ctx");
  6469. self._assert_equals_($recv($globals.HashedCollection._newFromPairs_(["hello",(1)]))._asHashedCollection(),$recv($globals.HashedCollection)._with_("hello".__minus_gt((1))));
  6470. return self;
  6471. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6472. }, function($ctx1) {$ctx1.fill(self,"testDynamicDictionaries",{},$globals.HashedCollectionTest)});
  6473. //>>excludeEnd("ctx");
  6474. },
  6475. //>>excludeStart("ide", pragmas.excludeIdeData);
  6476. args: [],
  6477. source: "testDynamicDictionaries\x0a\x09self assert: #{'hello' -> 1} asHashedCollection equals: (HashedCollection with: 'hello' -> 1)",
  6478. referencedClasses: ["HashedCollection"],
  6479. //>>excludeEnd("ide");
  6480. messageSends: ["assert:equals:", "asHashedCollection", "with:", "->"]
  6481. }),
  6482. $globals.HashedCollectionTest);
  6483. $core.addMethod(
  6484. $core.method({
  6485. selector: "collectionClass",
  6486. protocol: 'fixture',
  6487. fn: function (){
  6488. var self=this;
  6489. return $globals.HashedCollection;
  6490. },
  6491. //>>excludeStart("ide", pragmas.excludeIdeData);
  6492. args: [],
  6493. source: "collectionClass\x0a\x09^ HashedCollection",
  6494. referencedClasses: ["HashedCollection"],
  6495. //>>excludeEnd("ide");
  6496. messageSends: []
  6497. }),
  6498. $globals.HashedCollectionTest.klass);
  6499. $core.addClass('SequenceableCollectionTest', $globals.IndexableCollectionTest, [], 'Kernel-Tests');
  6500. $core.addMethod(
  6501. $core.method({
  6502. selector: "collectionFirst",
  6503. protocol: 'fixture',
  6504. fn: function (){
  6505. var self=this;
  6506. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6507. return $core.withContext(function($ctx1) {
  6508. //>>excludeEnd("ctx");
  6509. self._subclassResponsibility();
  6510. return self;
  6511. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6512. }, function($ctx1) {$ctx1.fill(self,"collectionFirst",{},$globals.SequenceableCollectionTest)});
  6513. //>>excludeEnd("ctx");
  6514. },
  6515. //>>excludeStart("ide", pragmas.excludeIdeData);
  6516. args: [],
  6517. source: "collectionFirst\x0a\x09self subclassResponsibility",
  6518. referencedClasses: [],
  6519. //>>excludeEnd("ide");
  6520. messageSends: ["subclassResponsibility"]
  6521. }),
  6522. $globals.SequenceableCollectionTest);
  6523. $core.addMethod(
  6524. $core.method({
  6525. selector: "collectionFirstTwo",
  6526. protocol: 'fixture',
  6527. fn: function (){
  6528. var self=this;
  6529. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6530. return $core.withContext(function($ctx1) {
  6531. //>>excludeEnd("ctx");
  6532. self._subclassResponsibility();
  6533. return self;
  6534. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6535. }, function($ctx1) {$ctx1.fill(self,"collectionFirstTwo",{},$globals.SequenceableCollectionTest)});
  6536. //>>excludeEnd("ctx");
  6537. },
  6538. //>>excludeStart("ide", pragmas.excludeIdeData);
  6539. args: [],
  6540. source: "collectionFirstTwo\x0a\x09self subclassResponsibility",
  6541. referencedClasses: [],
  6542. //>>excludeEnd("ide");
  6543. messageSends: ["subclassResponsibility"]
  6544. }),
  6545. $globals.SequenceableCollectionTest);
  6546. $core.addMethod(
  6547. $core.method({
  6548. selector: "collectionLast",
  6549. protocol: 'fixture',
  6550. fn: function (){
  6551. var self=this;
  6552. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6553. return $core.withContext(function($ctx1) {
  6554. //>>excludeEnd("ctx");
  6555. self._subclassResponsibility();
  6556. return self;
  6557. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6558. }, function($ctx1) {$ctx1.fill(self,"collectionLast",{},$globals.SequenceableCollectionTest)});
  6559. //>>excludeEnd("ctx");
  6560. },
  6561. //>>excludeStart("ide", pragmas.excludeIdeData);
  6562. args: [],
  6563. source: "collectionLast\x0a\x09self subclassResponsibility",
  6564. referencedClasses: [],
  6565. //>>excludeEnd("ide");
  6566. messageSends: ["subclassResponsibility"]
  6567. }),
  6568. $globals.SequenceableCollectionTest);
  6569. $core.addMethod(
  6570. $core.method({
  6571. selector: "collectionLastTwo",
  6572. protocol: 'fixture',
  6573. fn: function (){
  6574. var self=this;
  6575. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6576. return $core.withContext(function($ctx1) {
  6577. //>>excludeEnd("ctx");
  6578. self._subclassResponsibility();
  6579. return self;
  6580. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6581. }, function($ctx1) {$ctx1.fill(self,"collectionLastTwo",{},$globals.SequenceableCollectionTest)});
  6582. //>>excludeEnd("ctx");
  6583. },
  6584. //>>excludeStart("ide", pragmas.excludeIdeData);
  6585. args: [],
  6586. source: "collectionLastTwo\x0a\x09self subclassResponsibility",
  6587. referencedClasses: [],
  6588. //>>excludeEnd("ide");
  6589. messageSends: ["subclassResponsibility"]
  6590. }),
  6591. $globals.SequenceableCollectionTest);
  6592. $core.addMethod(
  6593. $core.method({
  6594. selector: "nonIndexesDo:",
  6595. protocol: 'fixture',
  6596. fn: function (aBlock){
  6597. var self=this;
  6598. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6599. return $core.withContext(function($ctx1) {
  6600. //>>excludeEnd("ctx");
  6601. $recv(aBlock)._value_((0));
  6602. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6603. $ctx1.sendIdx["value:"]=1;
  6604. //>>excludeEnd("ctx");
  6605. $recv(aBlock)._value_($recv(self._collectionSize()).__plus((1)));
  6606. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6607. $ctx1.sendIdx["value:"]=2;
  6608. //>>excludeEnd("ctx");
  6609. $recv(aBlock)._value_("z");
  6610. return self;
  6611. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6612. }, function($ctx1) {$ctx1.fill(self,"nonIndexesDo:",{aBlock:aBlock},$globals.SequenceableCollectionTest)});
  6613. //>>excludeEnd("ctx");
  6614. },
  6615. //>>excludeStart("ide", pragmas.excludeIdeData);
  6616. args: ["aBlock"],
  6617. source: "nonIndexesDo: aBlock\x0a\x09aBlock value: 0.\x0a\x09aBlock value: self collectionSize + 1.\x0a\x09aBlock value: 'z'",
  6618. referencedClasses: [],
  6619. //>>excludeEnd("ide");
  6620. messageSends: ["value:", "+", "collectionSize"]
  6621. }),
  6622. $globals.SequenceableCollectionTest);
  6623. $core.addMethod(
  6624. $core.method({
  6625. selector: "samplesDo:",
  6626. protocol: 'fixture',
  6627. fn: function (aBlock){
  6628. var self=this;
  6629. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6630. return $core.withContext(function($ctx1) {
  6631. //>>excludeEnd("ctx");
  6632. $recv(aBlock)._value_value_((1),self._collectionFirst());
  6633. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6634. $ctx1.sendIdx["value:value:"]=1;
  6635. //>>excludeEnd("ctx");
  6636. $recv(aBlock)._value_value_(self._collectionSize(),self._collectionLast());
  6637. return self;
  6638. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6639. }, function($ctx1) {$ctx1.fill(self,"samplesDo:",{aBlock:aBlock},$globals.SequenceableCollectionTest)});
  6640. //>>excludeEnd("ctx");
  6641. },
  6642. //>>excludeStart("ide", pragmas.excludeIdeData);
  6643. args: ["aBlock"],
  6644. source: "samplesDo: aBlock\x0a\x09aBlock value: 1 value: self collectionFirst.\x0a\x09aBlock value: self collectionSize value: self collectionLast",
  6645. referencedClasses: [],
  6646. //>>excludeEnd("ide");
  6647. messageSends: ["value:value:", "collectionFirst", "collectionSize", "collectionLast"]
  6648. }),
  6649. $globals.SequenceableCollectionTest);
  6650. $core.addMethod(
  6651. $core.method({
  6652. selector: "testBeginsWith",
  6653. protocol: 'tests',
  6654. fn: function (){
  6655. var self=this;
  6656. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6657. return $core.withContext(function($ctx1) {
  6658. //>>excludeEnd("ctx");
  6659. var $2,$1,$4,$5,$3,$7,$6;
  6660. $2=self._collection();
  6661. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6662. $ctx1.sendIdx["collection"]=1;
  6663. //>>excludeEnd("ctx");
  6664. $1=$recv($2)._beginsWith_($recv(self._collectionClass())._new());
  6665. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6666. $ctx1.sendIdx["beginsWith:"]=1;
  6667. //>>excludeEnd("ctx");
  6668. self._assert_($1);
  6669. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6670. $ctx1.sendIdx["assert:"]=1;
  6671. //>>excludeEnd("ctx");
  6672. $4=self._collection();
  6673. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6674. $ctx1.sendIdx["collection"]=2;
  6675. //>>excludeEnd("ctx");
  6676. $5=self._collection();
  6677. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6678. $ctx1.sendIdx["collection"]=3;
  6679. //>>excludeEnd("ctx");
  6680. $3=$recv($4)._beginsWith_($5);
  6681. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6682. $ctx1.sendIdx["beginsWith:"]=2;
  6683. //>>excludeEnd("ctx");
  6684. self._assert_($3);
  6685. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6686. $ctx1.sendIdx["assert:"]=2;
  6687. //>>excludeEnd("ctx");
  6688. $7=self._collection();
  6689. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6690. $ctx1.sendIdx["collection"]=4;
  6691. //>>excludeEnd("ctx");
  6692. $6=$recv($7)._beginsWith_(self._collectionFirstTwo());
  6693. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6694. $ctx1.sendIdx["beginsWith:"]=3;
  6695. //>>excludeEnd("ctx");
  6696. self._assert_($6);
  6697. self._deny_($recv(self._collection())._beginsWith_(self._collectionLastTwo()));
  6698. return self;
  6699. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6700. }, function($ctx1) {$ctx1.fill(self,"testBeginsWith",{},$globals.SequenceableCollectionTest)});
  6701. //>>excludeEnd("ctx");
  6702. },
  6703. //>>excludeStart("ide", pragmas.excludeIdeData);
  6704. args: [],
  6705. 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)",
  6706. referencedClasses: [],
  6707. //>>excludeEnd("ide");
  6708. messageSends: ["assert:", "beginsWith:", "collection", "new", "collectionClass", "collectionFirstTwo", "deny:", "collectionLastTwo"]
  6709. }),
  6710. $globals.SequenceableCollectionTest);
  6711. $core.addMethod(
  6712. $core.method({
  6713. selector: "testEndsWith",
  6714. protocol: 'tests',
  6715. fn: function (){
  6716. var self=this;
  6717. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6718. return $core.withContext(function($ctx1) {
  6719. //>>excludeEnd("ctx");
  6720. var $2,$1,$4,$5,$3,$7,$6;
  6721. $2=self._collection();
  6722. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6723. $ctx1.sendIdx["collection"]=1;
  6724. //>>excludeEnd("ctx");
  6725. $1=$recv($2)._endsWith_($recv(self._collectionClass())._new());
  6726. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6727. $ctx1.sendIdx["endsWith:"]=1;
  6728. //>>excludeEnd("ctx");
  6729. self._assert_($1);
  6730. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6731. $ctx1.sendIdx["assert:"]=1;
  6732. //>>excludeEnd("ctx");
  6733. $4=self._collection();
  6734. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6735. $ctx1.sendIdx["collection"]=2;
  6736. //>>excludeEnd("ctx");
  6737. $5=self._collection();
  6738. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6739. $ctx1.sendIdx["collection"]=3;
  6740. //>>excludeEnd("ctx");
  6741. $3=$recv($4)._endsWith_($5);
  6742. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6743. $ctx1.sendIdx["endsWith:"]=2;
  6744. //>>excludeEnd("ctx");
  6745. self._assert_($3);
  6746. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6747. $ctx1.sendIdx["assert:"]=2;
  6748. //>>excludeEnd("ctx");
  6749. $7=self._collection();
  6750. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6751. $ctx1.sendIdx["collection"]=4;
  6752. //>>excludeEnd("ctx");
  6753. $6=$recv($7)._endsWith_(self._collectionLastTwo());
  6754. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6755. $ctx1.sendIdx["endsWith:"]=3;
  6756. //>>excludeEnd("ctx");
  6757. self._assert_($6);
  6758. self._deny_($recv(self._collection())._endsWith_(self._collectionFirstTwo()));
  6759. return self;
  6760. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6761. }, function($ctx1) {$ctx1.fill(self,"testEndsWith",{},$globals.SequenceableCollectionTest)});
  6762. //>>excludeEnd("ctx");
  6763. },
  6764. //>>excludeStart("ide", pragmas.excludeIdeData);
  6765. args: [],
  6766. 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)",
  6767. referencedClasses: [],
  6768. //>>excludeEnd("ide");
  6769. messageSends: ["assert:", "endsWith:", "collection", "new", "collectionClass", "collectionLastTwo", "deny:", "collectionFirstTwo"]
  6770. }),
  6771. $globals.SequenceableCollectionTest);
  6772. $core.addMethod(
  6773. $core.method({
  6774. selector: "testFirst",
  6775. protocol: 'tests',
  6776. fn: function (){
  6777. var self=this;
  6778. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6779. return $core.withContext(function($ctx1) {
  6780. //>>excludeEnd("ctx");
  6781. self._assert_equals_($recv(self._collection())._first(),self._collectionFirst());
  6782. return self;
  6783. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6784. }, function($ctx1) {$ctx1.fill(self,"testFirst",{},$globals.SequenceableCollectionTest)});
  6785. //>>excludeEnd("ctx");
  6786. },
  6787. //>>excludeStart("ide", pragmas.excludeIdeData);
  6788. args: [],
  6789. source: "testFirst\x0a\x09self assert: self collection first equals: self collectionFirst",
  6790. referencedClasses: [],
  6791. //>>excludeEnd("ide");
  6792. messageSends: ["assert:equals:", "first", "collection", "collectionFirst"]
  6793. }),
  6794. $globals.SequenceableCollectionTest);
  6795. $core.addMethod(
  6796. $core.method({
  6797. selector: "testFirstN",
  6798. protocol: 'tests',
  6799. fn: function (){
  6800. var self=this;
  6801. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6802. return $core.withContext(function($ctx1) {
  6803. //>>excludeEnd("ctx");
  6804. var $2,$1,$4,$3,$6,$5,$7;
  6805. $2=self._collection();
  6806. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6807. $ctx1.sendIdx["collection"]=1;
  6808. //>>excludeEnd("ctx");
  6809. $1=$recv($2)._first_((2));
  6810. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6811. $ctx1.sendIdx["first:"]=1;
  6812. //>>excludeEnd("ctx");
  6813. self._assert_equals_($1,self._collectionFirstTwo());
  6814. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6815. $ctx1.sendIdx["assert:equals:"]=1;
  6816. //>>excludeEnd("ctx");
  6817. $4=self._collection();
  6818. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6819. $ctx1.sendIdx["collection"]=2;
  6820. //>>excludeEnd("ctx");
  6821. $3=$recv($4)._first_((0));
  6822. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6823. $ctx1.sendIdx["first:"]=2;
  6824. //>>excludeEnd("ctx");
  6825. self._assert_equals_($3,$recv(self._collectionClass())._new());
  6826. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6827. $ctx1.sendIdx["assert:equals:"]=2;
  6828. //>>excludeEnd("ctx");
  6829. $6=self._collection();
  6830. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6831. $ctx1.sendIdx["collection"]=3;
  6832. //>>excludeEnd("ctx");
  6833. $5=$recv($6)._first_(self._collectionSize());
  6834. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6835. $ctx1.sendIdx["first:"]=3;
  6836. //>>excludeEnd("ctx");
  6837. $7=self._collection();
  6838. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6839. $ctx1.sendIdx["collection"]=4;
  6840. //>>excludeEnd("ctx");
  6841. self._assert_equals_($5,$7);
  6842. self._should_raise_((function(){
  6843. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6844. return $core.withContext(function($ctx2) {
  6845. //>>excludeEnd("ctx");
  6846. return $recv(self._collection())._first_((33));
  6847. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6848. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  6849. //>>excludeEnd("ctx");
  6850. }),$globals.Error);
  6851. return self;
  6852. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6853. }, function($ctx1) {$ctx1.fill(self,"testFirstN",{},$globals.SequenceableCollectionTest)});
  6854. //>>excludeEnd("ctx");
  6855. },
  6856. //>>excludeStart("ide", pragmas.excludeIdeData);
  6857. args: [],
  6858. 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",
  6859. referencedClasses: ["Error"],
  6860. //>>excludeEnd("ide");
  6861. messageSends: ["assert:equals:", "first:", "collection", "collectionFirstTwo", "new", "collectionClass", "collectionSize", "should:raise:"]
  6862. }),
  6863. $globals.SequenceableCollectionTest);
  6864. $core.addMethod(
  6865. $core.method({
  6866. selector: "testFourth",
  6867. protocol: 'tests',
  6868. fn: function (){
  6869. var self=this;
  6870. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6871. return $core.withContext(function($ctx1) {
  6872. //>>excludeEnd("ctx");
  6873. var $2,$1;
  6874. $2=self._collection();
  6875. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6876. $ctx1.sendIdx["collection"]=1;
  6877. //>>excludeEnd("ctx");
  6878. $1=$recv($2)._fourth();
  6879. self._assert_equals_($1,$recv(self._collection())._at_((4)));
  6880. return self;
  6881. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6882. }, function($ctx1) {$ctx1.fill(self,"testFourth",{},$globals.SequenceableCollectionTest)});
  6883. //>>excludeEnd("ctx");
  6884. },
  6885. //>>excludeStart("ide", pragmas.excludeIdeData);
  6886. args: [],
  6887. source: "testFourth\x0a\x09self assert: (self collection fourth) equals: (self collection at: 4)",
  6888. referencedClasses: [],
  6889. //>>excludeEnd("ide");
  6890. messageSends: ["assert:equals:", "fourth", "collection", "at:"]
  6891. }),
  6892. $globals.SequenceableCollectionTest);
  6893. $core.addMethod(
  6894. $core.method({
  6895. selector: "testIndexOfStartingAt",
  6896. protocol: 'tests',
  6897. fn: function (){
  6898. var self=this;
  6899. var jsNull;
  6900. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6901. return $core.withContext(function($ctx1) {
  6902. //>>excludeEnd("ctx");
  6903. var $2,$1,$4,$3;
  6904. jsNull=$recv($globals.JSON)._parse_("null");
  6905. self._samplesDo_((function(index,value){
  6906. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6907. return $core.withContext(function($ctx2) {
  6908. //>>excludeEnd("ctx");
  6909. $2=self._collection();
  6910. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6911. $ctx2.sendIdx["collection"]=1;
  6912. //>>excludeEnd("ctx");
  6913. $1=$recv($2)._indexOf_startingAt_(value,(1));
  6914. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6915. $ctx2.sendIdx["indexOf:startingAt:"]=1;
  6916. //>>excludeEnd("ctx");
  6917. self._assert_equals_($1,index);
  6918. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6919. $ctx2.sendIdx["assert:equals:"]=1;
  6920. //>>excludeEnd("ctx");
  6921. $4=self._collection();
  6922. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6923. $ctx2.sendIdx["collection"]=2;
  6924. //>>excludeEnd("ctx");
  6925. $3=$recv($4)._indexOf_startingAt_(value,index);
  6926. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6927. $ctx2.sendIdx["indexOf:startingAt:"]=2;
  6928. //>>excludeEnd("ctx");
  6929. self._assert_equals_($3,index);
  6930. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6931. $ctx2.sendIdx["assert:equals:"]=2;
  6932. //>>excludeEnd("ctx");
  6933. return self._assert_equals_($recv(self._collection())._indexOf_startingAt_(value,$recv(index).__plus((1))),(0));
  6934. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6935. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,1)});
  6936. //>>excludeEnd("ctx");
  6937. }));
  6938. return self;
  6939. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6940. }, function($ctx1) {$ctx1.fill(self,"testIndexOfStartingAt",{jsNull:jsNull},$globals.SequenceableCollectionTest)});
  6941. //>>excludeEnd("ctx");
  6942. },
  6943. //>>excludeStart("ide", pragmas.excludeIdeData);
  6944. args: [],
  6945. 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 ]",
  6946. referencedClasses: ["JSON"],
  6947. //>>excludeEnd("ide");
  6948. messageSends: ["parse:", "samplesDo:", "assert:equals:", "indexOf:startingAt:", "collection", "+"]
  6949. }),
  6950. $globals.SequenceableCollectionTest);
  6951. $core.addMethod(
  6952. $core.method({
  6953. selector: "testIndexOfStartingAtWithNull",
  6954. protocol: 'tests',
  6955. fn: function (){
  6956. var self=this;
  6957. var jsNull;
  6958. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6959. return $core.withContext(function($ctx1) {
  6960. //>>excludeEnd("ctx");
  6961. var $1,$2;
  6962. jsNull=$recv($globals.JSON)._parse_("null");
  6963. self._samplesDo_((function(index,value){
  6964. var collection;
  6965. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6966. return $core.withContext(function($ctx2) {
  6967. //>>excludeEnd("ctx");
  6968. collection=self._collection();
  6969. collection;
  6970. $recv(collection)._at_put_(index,jsNull);
  6971. $1=$recv(collection)._indexOf_startingAt_(jsNull,(1));
  6972. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6973. $ctx2.sendIdx["indexOf:startingAt:"]=1;
  6974. //>>excludeEnd("ctx");
  6975. self._assert_equals_($1,index);
  6976. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6977. $ctx2.sendIdx["assert:equals:"]=1;
  6978. //>>excludeEnd("ctx");
  6979. $2=$recv(collection)._indexOf_startingAt_(jsNull,index);
  6980. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6981. $ctx2.sendIdx["indexOf:startingAt:"]=2;
  6982. //>>excludeEnd("ctx");
  6983. self._assert_equals_($2,index);
  6984. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6985. $ctx2.sendIdx["assert:equals:"]=2;
  6986. //>>excludeEnd("ctx");
  6987. return self._assert_equals_($recv(collection)._indexOf_startingAt_(jsNull,$recv(index).__plus((1))),(0));
  6988. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6989. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value,collection:collection},$ctx1,1)});
  6990. //>>excludeEnd("ctx");
  6991. }));
  6992. return self;
  6993. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6994. }, function($ctx1) {$ctx1.fill(self,"testIndexOfStartingAtWithNull",{jsNull:jsNull},$globals.SequenceableCollectionTest)});
  6995. //>>excludeEnd("ctx");
  6996. },
  6997. //>>excludeStart("ide", pragmas.excludeIdeData);
  6998. args: [],
  6999. 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 ]",
  7000. referencedClasses: ["JSON"],
  7001. //>>excludeEnd("ide");
  7002. messageSends: ["parse:", "samplesDo:", "collection", "at:put:", "assert:equals:", "indexOf:startingAt:", "+"]
  7003. }),
  7004. $globals.SequenceableCollectionTest);
  7005. $core.addMethod(
  7006. $core.method({
  7007. selector: "testLast",
  7008. protocol: 'tests',
  7009. fn: function (){
  7010. var self=this;
  7011. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7012. return $core.withContext(function($ctx1) {
  7013. //>>excludeEnd("ctx");
  7014. self._assert_equals_($recv(self._collection())._last(),self._collectionLast());
  7015. return self;
  7016. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7017. }, function($ctx1) {$ctx1.fill(self,"testLast",{},$globals.SequenceableCollectionTest)});
  7018. //>>excludeEnd("ctx");
  7019. },
  7020. //>>excludeStart("ide", pragmas.excludeIdeData);
  7021. args: [],
  7022. source: "testLast\x0a\x09self assert: self collection last equals: self collectionLast",
  7023. referencedClasses: [],
  7024. //>>excludeEnd("ide");
  7025. messageSends: ["assert:equals:", "last", "collection", "collectionLast"]
  7026. }),
  7027. $globals.SequenceableCollectionTest);
  7028. $core.addMethod(
  7029. $core.method({
  7030. selector: "testLastN",
  7031. protocol: 'tests',
  7032. fn: function (){
  7033. var self=this;
  7034. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7035. return $core.withContext(function($ctx1) {
  7036. //>>excludeEnd("ctx");
  7037. var $2,$1,$4,$3,$6,$5,$7;
  7038. $2=self._collection();
  7039. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7040. $ctx1.sendIdx["collection"]=1;
  7041. //>>excludeEnd("ctx");
  7042. $1=$recv($2)._last_((2));
  7043. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7044. $ctx1.sendIdx["last:"]=1;
  7045. //>>excludeEnd("ctx");
  7046. self._assert_equals_($1,self._collectionLastTwo());
  7047. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7048. $ctx1.sendIdx["assert:equals:"]=1;
  7049. //>>excludeEnd("ctx");
  7050. $4=self._collection();
  7051. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7052. $ctx1.sendIdx["collection"]=2;
  7053. //>>excludeEnd("ctx");
  7054. $3=$recv($4)._last_((0));
  7055. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7056. $ctx1.sendIdx["last:"]=2;
  7057. //>>excludeEnd("ctx");
  7058. self._assert_equals_($3,$recv(self._collectionClass())._new());
  7059. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7060. $ctx1.sendIdx["assert:equals:"]=2;
  7061. //>>excludeEnd("ctx");
  7062. $6=self._collection();
  7063. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7064. $ctx1.sendIdx["collection"]=3;
  7065. //>>excludeEnd("ctx");
  7066. $5=$recv($6)._last_(self._collectionSize());
  7067. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7068. $ctx1.sendIdx["last:"]=3;
  7069. //>>excludeEnd("ctx");
  7070. $7=self._collection();
  7071. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7072. $ctx1.sendIdx["collection"]=4;
  7073. //>>excludeEnd("ctx");
  7074. self._assert_equals_($5,$7);
  7075. self._should_raise_((function(){
  7076. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7077. return $core.withContext(function($ctx2) {
  7078. //>>excludeEnd("ctx");
  7079. return $recv(self._collection())._last_((33));
  7080. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7081. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  7082. //>>excludeEnd("ctx");
  7083. }),$globals.Error);
  7084. return self;
  7085. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7086. }, function($ctx1) {$ctx1.fill(self,"testLastN",{},$globals.SequenceableCollectionTest)});
  7087. //>>excludeEnd("ctx");
  7088. },
  7089. //>>excludeStart("ide", pragmas.excludeIdeData);
  7090. args: [],
  7091. 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",
  7092. referencedClasses: ["Error"],
  7093. //>>excludeEnd("ide");
  7094. messageSends: ["assert:equals:", "last:", "collection", "collectionLastTwo", "new", "collectionClass", "collectionSize", "should:raise:"]
  7095. }),
  7096. $globals.SequenceableCollectionTest);
  7097. $core.addMethod(
  7098. $core.method({
  7099. selector: "testSecond",
  7100. protocol: 'tests',
  7101. fn: function (){
  7102. var self=this;
  7103. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7104. return $core.withContext(function($ctx1) {
  7105. //>>excludeEnd("ctx");
  7106. var $2,$1;
  7107. $2=self._collection();
  7108. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7109. $ctx1.sendIdx["collection"]=1;
  7110. //>>excludeEnd("ctx");
  7111. $1=$recv($2)._second();
  7112. self._assert_equals_($1,$recv(self._collection())._at_((2)));
  7113. return self;
  7114. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7115. }, function($ctx1) {$ctx1.fill(self,"testSecond",{},$globals.SequenceableCollectionTest)});
  7116. //>>excludeEnd("ctx");
  7117. },
  7118. //>>excludeStart("ide", pragmas.excludeIdeData);
  7119. args: [],
  7120. source: "testSecond\x0a\x09self assert: (self collection second) equals: (self collection at: 2)",
  7121. referencedClasses: [],
  7122. //>>excludeEnd("ide");
  7123. messageSends: ["assert:equals:", "second", "collection", "at:"]
  7124. }),
  7125. $globals.SequenceableCollectionTest);
  7126. $core.addMethod(
  7127. $core.method({
  7128. selector: "testThird",
  7129. protocol: 'tests',
  7130. fn: function (){
  7131. var self=this;
  7132. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7133. return $core.withContext(function($ctx1) {
  7134. //>>excludeEnd("ctx");
  7135. var $2,$1;
  7136. $2=self._collection();
  7137. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7138. $ctx1.sendIdx["collection"]=1;
  7139. //>>excludeEnd("ctx");
  7140. $1=$recv($2)._third();
  7141. self._assert_equals_($1,$recv(self._collection())._at_((3)));
  7142. return self;
  7143. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7144. }, function($ctx1) {$ctx1.fill(self,"testThird",{},$globals.SequenceableCollectionTest)});
  7145. //>>excludeEnd("ctx");
  7146. },
  7147. //>>excludeStart("ide", pragmas.excludeIdeData);
  7148. args: [],
  7149. source: "testThird\x0a\x09self assert: (self collection third) equals: (self collection at: 3)",
  7150. referencedClasses: [],
  7151. //>>excludeEnd("ide");
  7152. messageSends: ["assert:equals:", "third", "collection", "at:"]
  7153. }),
  7154. $globals.SequenceableCollectionTest);
  7155. $core.addClass('ArrayTest', $globals.SequenceableCollectionTest, [], 'Kernel-Tests');
  7156. $core.addMethod(
  7157. $core.method({
  7158. selector: "collection",
  7159. protocol: 'fixture',
  7160. fn: function (){
  7161. var self=this;
  7162. return [(1), (2), (3), (-4)];
  7163. },
  7164. //>>excludeStart("ide", pragmas.excludeIdeData);
  7165. args: [],
  7166. source: "collection\x0a\x09^ #(1 2 3 -4)",
  7167. referencedClasses: [],
  7168. //>>excludeEnd("ide");
  7169. messageSends: []
  7170. }),
  7171. $globals.ArrayTest);
  7172. $core.addMethod(
  7173. $core.method({
  7174. selector: "collectionFirst",
  7175. protocol: 'fixture',
  7176. fn: function (){
  7177. var self=this;
  7178. return (1);
  7179. },
  7180. //>>excludeStart("ide", pragmas.excludeIdeData);
  7181. args: [],
  7182. source: "collectionFirst\x0a\x09^ 1",
  7183. referencedClasses: [],
  7184. //>>excludeEnd("ide");
  7185. messageSends: []
  7186. }),
  7187. $globals.ArrayTest);
  7188. $core.addMethod(
  7189. $core.method({
  7190. selector: "collectionFirstTwo",
  7191. protocol: 'fixture',
  7192. fn: function (){
  7193. var self=this;
  7194. return [(1), (2)];
  7195. },
  7196. //>>excludeStart("ide", pragmas.excludeIdeData);
  7197. args: [],
  7198. source: "collectionFirstTwo\x0a\x09^ #(1 2)",
  7199. referencedClasses: [],
  7200. //>>excludeEnd("ide");
  7201. messageSends: []
  7202. }),
  7203. $globals.ArrayTest);
  7204. $core.addMethod(
  7205. $core.method({
  7206. selector: "collectionLast",
  7207. protocol: 'fixture',
  7208. fn: function (){
  7209. var self=this;
  7210. return (-4);
  7211. },
  7212. //>>excludeStart("ide", pragmas.excludeIdeData);
  7213. args: [],
  7214. source: "collectionLast\x0a\x09^ -4",
  7215. referencedClasses: [],
  7216. //>>excludeEnd("ide");
  7217. messageSends: []
  7218. }),
  7219. $globals.ArrayTest);
  7220. $core.addMethod(
  7221. $core.method({
  7222. selector: "collectionLastTwo",
  7223. protocol: 'fixture',
  7224. fn: function (){
  7225. var self=this;
  7226. return [(3), (-4)];
  7227. },
  7228. //>>excludeStart("ide", pragmas.excludeIdeData);
  7229. args: [],
  7230. source: "collectionLastTwo\x0a\x09^ #(3 -4)",
  7231. referencedClasses: [],
  7232. //>>excludeEnd("ide");
  7233. messageSends: []
  7234. }),
  7235. $globals.ArrayTest);
  7236. $core.addMethod(
  7237. $core.method({
  7238. selector: "collectionOfPrintStrings",
  7239. protocol: 'fixture',
  7240. fn: function (){
  7241. var self=this;
  7242. return ["1", "2", "3", "-4"];
  7243. },
  7244. //>>excludeStart("ide", pragmas.excludeIdeData);
  7245. args: [],
  7246. source: "collectionOfPrintStrings\x0a\x09^ #('1' '2' '3' '-4')",
  7247. referencedClasses: [],
  7248. //>>excludeEnd("ide");
  7249. messageSends: []
  7250. }),
  7251. $globals.ArrayTest);
  7252. $core.addMethod(
  7253. $core.method({
  7254. selector: "collectionSize",
  7255. protocol: 'fixture',
  7256. fn: function (){
  7257. var self=this;
  7258. return (4);
  7259. },
  7260. //>>excludeStart("ide", pragmas.excludeIdeData);
  7261. args: [],
  7262. source: "collectionSize\x0a\x09^ 4",
  7263. referencedClasses: [],
  7264. //>>excludeEnd("ide");
  7265. messageSends: []
  7266. }),
  7267. $globals.ArrayTest);
  7268. $core.addMethod(
  7269. $core.method({
  7270. selector: "collectionWithDuplicates",
  7271. protocol: 'fixture',
  7272. fn: function (){
  7273. var self=this;
  7274. return ["a", "b", "c", (1), (2), (1), "a", []];
  7275. },
  7276. //>>excludeStart("ide", pragmas.excludeIdeData);
  7277. args: [],
  7278. source: "collectionWithDuplicates\x0a\x09^ #('a' 'b' 'c' 1 2 1 'a' ())",
  7279. referencedClasses: [],
  7280. //>>excludeEnd("ide");
  7281. messageSends: []
  7282. }),
  7283. $globals.ArrayTest);
  7284. $core.addMethod(
  7285. $core.method({
  7286. selector: "collectionWithNewValue",
  7287. protocol: 'fixture',
  7288. fn: function (){
  7289. var self=this;
  7290. return [(1), (2), (3), (-4), "N"];
  7291. },
  7292. //>>excludeStart("ide", pragmas.excludeIdeData);
  7293. args: [],
  7294. source: "collectionWithNewValue\x0a\x09^ #(1 2 3 -4 'N')",
  7295. referencedClasses: [],
  7296. //>>excludeEnd("ide");
  7297. messageSends: []
  7298. }),
  7299. $globals.ArrayTest);
  7300. $core.addMethod(
  7301. $core.method({
  7302. selector: "sampleNewIndex",
  7303. protocol: 'fixture',
  7304. fn: function (){
  7305. var self=this;
  7306. return (5);
  7307. },
  7308. //>>excludeStart("ide", pragmas.excludeIdeData);
  7309. args: [],
  7310. source: "sampleNewIndex\x0a\x09^ 5",
  7311. referencedClasses: [],
  7312. //>>excludeEnd("ide");
  7313. messageSends: []
  7314. }),
  7315. $globals.ArrayTest);
  7316. $core.addMethod(
  7317. $core.method({
  7318. selector: "samplesDo:",
  7319. protocol: 'fixture',
  7320. fn: function (aBlock){
  7321. var self=this;
  7322. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7323. return $core.withContext(function($ctx1) {
  7324. //>>excludeEnd("ctx");
  7325. (
  7326. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7327. $ctx1.supercall = true,
  7328. //>>excludeEnd("ctx");
  7329. ($globals.ArrayTest.superclass||$boot.dnu).fn.prototype._samplesDo_.apply($recv(self), [aBlock]));
  7330. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7331. $ctx1.supercall = false;
  7332. //>>excludeEnd("ctx");;
  7333. $recv(aBlock)._value_value_((3),(3));
  7334. return self;
  7335. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7336. }, function($ctx1) {$ctx1.fill(self,"samplesDo:",{aBlock:aBlock},$globals.ArrayTest)});
  7337. //>>excludeEnd("ctx");
  7338. },
  7339. //>>excludeStart("ide", pragmas.excludeIdeData);
  7340. args: ["aBlock"],
  7341. source: "samplesDo: aBlock\x0a\x09super samplesDo: aBlock.\x0a\x09aBlock value: 3 value: 3.",
  7342. referencedClasses: [],
  7343. //>>excludeEnd("ide");
  7344. messageSends: ["samplesDo:", "value:value:"]
  7345. }),
  7346. $globals.ArrayTest);
  7347. $core.addMethod(
  7348. $core.method({
  7349. selector: "testAdd",
  7350. protocol: 'tests',
  7351. fn: function (){
  7352. var self=this;
  7353. var array;
  7354. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7355. return $core.withContext(function($ctx1) {
  7356. //>>excludeEnd("ctx");
  7357. array=self._collection();
  7358. $recv(array)._add_((6));
  7359. self._assert_equals_($recv(array)._last(),(6));
  7360. return self;
  7361. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7362. }, function($ctx1) {$ctx1.fill(self,"testAdd",{array:array},$globals.ArrayTest)});
  7363. //>>excludeEnd("ctx");
  7364. },
  7365. //>>excludeStart("ide", pragmas.excludeIdeData);
  7366. args: [],
  7367. source: "testAdd \x0a\x09| array | \x0a\x09array := self collection. \x0a\x09array add: 6.\x0a\x09\x0a\x09self assert: array last equals: 6",
  7368. referencedClasses: [],
  7369. //>>excludeEnd("ide");
  7370. messageSends: ["collection", "add:", "assert:equals:", "last"]
  7371. }),
  7372. $globals.ArrayTest);
  7373. $core.addMethod(
  7374. $core.method({
  7375. selector: "testAddFirst",
  7376. protocol: 'tests',
  7377. fn: function (){
  7378. var self=this;
  7379. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7380. return $core.withContext(function($ctx1) {
  7381. //>>excludeEnd("ctx");
  7382. var $3,$2,$1;
  7383. $3=self._collection();
  7384. $recv($3)._addFirst_((0));
  7385. $2=$recv($3)._yourself();
  7386. $1=$recv($2)._first();
  7387. self._assert_equals_($1,(0));
  7388. return self;
  7389. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7390. }, function($ctx1) {$ctx1.fill(self,"testAddFirst",{},$globals.ArrayTest)});
  7391. //>>excludeEnd("ctx");
  7392. },
  7393. //>>excludeStart("ide", pragmas.excludeIdeData);
  7394. args: [],
  7395. source: "testAddFirst\x0a\x09self assert: (self collection addFirst: 0; yourself) first equals: 0",
  7396. referencedClasses: [],
  7397. //>>excludeEnd("ide");
  7398. messageSends: ["assert:equals:", "first", "addFirst:", "collection", "yourself"]
  7399. }),
  7400. $globals.ArrayTest);
  7401. $core.addMethod(
  7402. $core.method({
  7403. selector: "testPrintString",
  7404. protocol: 'tests',
  7405. fn: function (){
  7406. var self=this;
  7407. var array;
  7408. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7409. return $core.withContext(function($ctx1) {
  7410. //>>excludeEnd("ctx");
  7411. var $1,$2,$3,$4,$5,$6,$7,$8;
  7412. array=$recv($globals.Array)._new();
  7413. $1=$recv(array)._printString();
  7414. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7415. $ctx1.sendIdx["printString"]=1;
  7416. //>>excludeEnd("ctx");
  7417. self._assert_equals_($1,"an Array ()");
  7418. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7419. $ctx1.sendIdx["assert:equals:"]=1;
  7420. //>>excludeEnd("ctx");
  7421. $2=array;
  7422. $recv($2)._add_((1));
  7423. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7424. $ctx1.sendIdx["add:"]=1;
  7425. //>>excludeEnd("ctx");
  7426. $3=$recv($2)._add_((3));
  7427. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7428. $ctx1.sendIdx["add:"]=2;
  7429. //>>excludeEnd("ctx");
  7430. $4=$recv(array)._printString();
  7431. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7432. $ctx1.sendIdx["printString"]=2;
  7433. //>>excludeEnd("ctx");
  7434. self._assert_equals_($4,"an Array (1 3)");
  7435. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7436. $ctx1.sendIdx["assert:equals:"]=2;
  7437. //>>excludeEnd("ctx");
  7438. $recv(array)._add_("foo");
  7439. $5=$recv(array)._printString();
  7440. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7441. $ctx1.sendIdx["printString"]=3;
  7442. //>>excludeEnd("ctx");
  7443. self._assert_equals_($5,"an Array (1 3 'foo')");
  7444. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7445. $ctx1.sendIdx["assert:equals:"]=3;
  7446. //>>excludeEnd("ctx");
  7447. $6=array;
  7448. $recv($6)._remove_((1));
  7449. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7450. $ctx1.sendIdx["remove:"]=1;
  7451. //>>excludeEnd("ctx");
  7452. $recv($6)._remove_((3));
  7453. $7=$recv(array)._printString();
  7454. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7455. $ctx1.sendIdx["printString"]=4;
  7456. //>>excludeEnd("ctx");
  7457. self._assert_equals_($7,"an Array ('foo')");
  7458. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7459. $ctx1.sendIdx["assert:equals:"]=4;
  7460. //>>excludeEnd("ctx");
  7461. $recv(array)._addLast_((3));
  7462. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7463. $ctx1.sendIdx["addLast:"]=1;
  7464. //>>excludeEnd("ctx");
  7465. $8=$recv(array)._printString();
  7466. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7467. $ctx1.sendIdx["printString"]=5;
  7468. //>>excludeEnd("ctx");
  7469. self._assert_equals_($8,"an Array ('foo' 3)");
  7470. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7471. $ctx1.sendIdx["assert:equals:"]=5;
  7472. //>>excludeEnd("ctx");
  7473. $recv(array)._addLast_((3));
  7474. self._assert_equals_($recv(array)._printString(),"an Array ('foo' 3 3)");
  7475. return self;
  7476. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7477. }, function($ctx1) {$ctx1.fill(self,"testPrintString",{array:array},$globals.ArrayTest)});
  7478. //>>excludeEnd("ctx");
  7479. },
  7480. //>>excludeStart("ide", pragmas.excludeIdeData);
  7481. args: [],
  7482. 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)'.",
  7483. referencedClasses: ["Array"],
  7484. //>>excludeEnd("ide");
  7485. messageSends: ["new", "assert:equals:", "printString", "add:", "remove:", "addLast:"]
  7486. }),
  7487. $globals.ArrayTest);
  7488. $core.addMethod(
  7489. $core.method({
  7490. selector: "testRemove",
  7491. protocol: 'tests',
  7492. fn: function (){
  7493. var self=this;
  7494. var array;
  7495. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7496. return $core.withContext(function($ctx1) {
  7497. //>>excludeEnd("ctx");
  7498. array=[(1), (2), (3), (4), (5)];
  7499. $recv(array)._remove_((3));
  7500. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7501. $ctx1.sendIdx["remove:"]=1;
  7502. //>>excludeEnd("ctx");
  7503. self._assert_equals_(array,[(1), (2), (4), (5)]);
  7504. self._should_raise_((function(){
  7505. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7506. return $core.withContext(function($ctx2) {
  7507. //>>excludeEnd("ctx");
  7508. return $recv(array)._remove_((3));
  7509. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7510. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  7511. //>>excludeEnd("ctx");
  7512. }),$globals.Error);
  7513. return self;
  7514. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7515. }, function($ctx1) {$ctx1.fill(self,"testRemove",{array:array},$globals.ArrayTest)});
  7516. //>>excludeEnd("ctx");
  7517. },
  7518. //>>excludeStart("ide", pragmas.excludeIdeData);
  7519. args: [],
  7520. 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",
  7521. referencedClasses: ["Error"],
  7522. //>>excludeEnd("ide");
  7523. messageSends: ["remove:", "assert:equals:", "should:raise:"]
  7524. }),
  7525. $globals.ArrayTest);
  7526. $core.addMethod(
  7527. $core.method({
  7528. selector: "testRemoveFromTo",
  7529. protocol: 'tests',
  7530. fn: function (){
  7531. var self=this;
  7532. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7533. return $core.withContext(function($ctx1) {
  7534. //>>excludeEnd("ctx");
  7535. var $1,$2;
  7536. $1=[(1), (2), (3), (4)]._removeFrom_to_((1),(3));
  7537. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7538. $ctx1.sendIdx["removeFrom:to:"]=1;
  7539. //>>excludeEnd("ctx");
  7540. self._assert_equals_($1,[(4)]);
  7541. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7542. $ctx1.sendIdx["assert:equals:"]=1;
  7543. //>>excludeEnd("ctx");
  7544. $2=[(1), (2), (3), (4)]._removeFrom_to_((2),(3));
  7545. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7546. $ctx1.sendIdx["removeFrom:to:"]=2;
  7547. //>>excludeEnd("ctx");
  7548. self._assert_equals_($2,[(1), (4)]);
  7549. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7550. $ctx1.sendIdx["assert:equals:"]=2;
  7551. //>>excludeEnd("ctx");
  7552. self._assert_equals_([(1), (2), (3), (4)]._removeFrom_to_((2),(4)),[(1)]);
  7553. return self;
  7554. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7555. }, function($ctx1) {$ctx1.fill(self,"testRemoveFromTo",{},$globals.ArrayTest)});
  7556. //>>excludeEnd("ctx");
  7557. },
  7558. //>>excludeStart("ide", pragmas.excludeIdeData);
  7559. args: [],
  7560. 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)",
  7561. referencedClasses: [],
  7562. //>>excludeEnd("ide");
  7563. messageSends: ["assert:equals:", "removeFrom:to:"]
  7564. }),
  7565. $globals.ArrayTest);
  7566. $core.addMethod(
  7567. $core.method({
  7568. selector: "testRemoveIndex",
  7569. protocol: 'tests',
  7570. fn: function (){
  7571. var self=this;
  7572. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7573. return $core.withContext(function($ctx1) {
  7574. //>>excludeEnd("ctx");
  7575. var $1,$2;
  7576. $1=[(1), (2), (3), (4)]._removeIndex_((2));
  7577. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7578. $ctx1.sendIdx["removeIndex:"]=1;
  7579. //>>excludeEnd("ctx");
  7580. self._assert_equals_($1,[(1), (3), (4)]);
  7581. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7582. $ctx1.sendIdx["assert:equals:"]=1;
  7583. //>>excludeEnd("ctx");
  7584. $2=[(1), (2), (3), (4)]._removeIndex_((1));
  7585. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7586. $ctx1.sendIdx["removeIndex:"]=2;
  7587. //>>excludeEnd("ctx");
  7588. self._assert_equals_($2,[(2), (3), (4)]);
  7589. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7590. $ctx1.sendIdx["assert:equals:"]=2;
  7591. //>>excludeEnd("ctx");
  7592. self._assert_equals_(["hello"]._removeIndex_((1)),[]);
  7593. return self;
  7594. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7595. }, function($ctx1) {$ctx1.fill(self,"testRemoveIndex",{},$globals.ArrayTest)});
  7596. //>>excludeEnd("ctx");
  7597. },
  7598. //>>excludeStart("ide", pragmas.excludeIdeData);
  7599. args: [],
  7600. 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: #()",
  7601. referencedClasses: [],
  7602. //>>excludeEnd("ide");
  7603. messageSends: ["assert:equals:", "removeIndex:"]
  7604. }),
  7605. $globals.ArrayTest);
  7606. $core.addMethod(
  7607. $core.method({
  7608. selector: "testRemoveLast",
  7609. protocol: 'tests',
  7610. fn: function (){
  7611. var self=this;
  7612. var array;
  7613. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7614. return $core.withContext(function($ctx1) {
  7615. //>>excludeEnd("ctx");
  7616. array=[(1), (2)];
  7617. $recv(array)._removeLast();
  7618. self._assert_equals_($recv(array)._last(),(1));
  7619. return self;
  7620. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7621. }, function($ctx1) {$ctx1.fill(self,"testRemoveLast",{array:array},$globals.ArrayTest)});
  7622. //>>excludeEnd("ctx");
  7623. },
  7624. //>>excludeStart("ide", pragmas.excludeIdeData);
  7625. args: [],
  7626. source: "testRemoveLast \x0a\x09| array |\x0a\x09array := #(1 2). \x0a\x09array removeLast.\x0a\x09\x0a\x09self assert: array last equals: 1",
  7627. referencedClasses: [],
  7628. //>>excludeEnd("ide");
  7629. messageSends: ["removeLast", "assert:equals:", "last"]
  7630. }),
  7631. $globals.ArrayTest);
  7632. $core.addMethod(
  7633. $core.method({
  7634. selector: "testReversed",
  7635. protocol: 'tests',
  7636. fn: function (){
  7637. var self=this;
  7638. var array;
  7639. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7640. return $core.withContext(function($ctx1) {
  7641. //>>excludeEnd("ctx");
  7642. array=[(5), (4), (3), (2), (1)];
  7643. self._assert_equals_($recv(array)._reversed(),[(1), (2), (3), (4), (5)]);
  7644. return self;
  7645. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7646. }, function($ctx1) {$ctx1.fill(self,"testReversed",{array:array},$globals.ArrayTest)});
  7647. //>>excludeEnd("ctx");
  7648. },
  7649. //>>excludeStart("ide", pragmas.excludeIdeData);
  7650. args: [],
  7651. source: "testReversed\x0a\x09|array|\x0a\x09array := #(5 4 3 2 1). \x0a\x09self assert: (array reversed) equals: #(1 2 3 4 5)",
  7652. referencedClasses: [],
  7653. //>>excludeEnd("ide");
  7654. messageSends: ["assert:equals:", "reversed"]
  7655. }),
  7656. $globals.ArrayTest);
  7657. $core.addMethod(
  7658. $core.method({
  7659. selector: "testSort",
  7660. protocol: 'tests',
  7661. fn: function (){
  7662. var self=this;
  7663. var array;
  7664. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7665. return $core.withContext(function($ctx1) {
  7666. //>>excludeEnd("ctx");
  7667. array=[(10), (1), (5)];
  7668. $recv(array)._sort();
  7669. self._assert_equals_(array,[(1), (5), (10)]);
  7670. return self;
  7671. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7672. }, function($ctx1) {$ctx1.fill(self,"testSort",{array:array},$globals.ArrayTest)});
  7673. //>>excludeEnd("ctx");
  7674. },
  7675. //>>excludeStart("ide", pragmas.excludeIdeData);
  7676. args: [],
  7677. source: "testSort\x0a\x09| array |\x0a\x09array := #(10 1 5). \x0a\x09array sort.\x0a\x09self assert: array equals: #(1 5 10)",
  7678. referencedClasses: [],
  7679. //>>excludeEnd("ide");
  7680. messageSends: ["sort", "assert:equals:"]
  7681. }),
  7682. $globals.ArrayTest);
  7683. $core.addMethod(
  7684. $core.method({
  7685. selector: "collectionClass",
  7686. protocol: 'fixture',
  7687. fn: function (){
  7688. var self=this;
  7689. return $globals.Array;
  7690. },
  7691. //>>excludeStart("ide", pragmas.excludeIdeData);
  7692. args: [],
  7693. source: "collectionClass\x0a\x09^ Array",
  7694. referencedClasses: ["Array"],
  7695. //>>excludeEnd("ide");
  7696. messageSends: []
  7697. }),
  7698. $globals.ArrayTest.klass);
  7699. $core.addClass('StringTest', $globals.SequenceableCollectionTest, [], 'Kernel-Tests');
  7700. $core.addMethod(
  7701. $core.method({
  7702. selector: "collection",
  7703. protocol: 'fixture',
  7704. fn: function (){
  7705. var self=this;
  7706. return "helLo";
  7707. },
  7708. //>>excludeStart("ide", pragmas.excludeIdeData);
  7709. args: [],
  7710. source: "collection\x0a\x09^ 'helLo'",
  7711. referencedClasses: [],
  7712. //>>excludeEnd("ide");
  7713. messageSends: []
  7714. }),
  7715. $globals.StringTest);
  7716. $core.addMethod(
  7717. $core.method({
  7718. selector: "collectionFirst",
  7719. protocol: 'fixture',
  7720. fn: function (){
  7721. var self=this;
  7722. return "h";
  7723. },
  7724. //>>excludeStart("ide", pragmas.excludeIdeData);
  7725. args: [],
  7726. source: "collectionFirst\x0a\x09^ 'h'",
  7727. referencedClasses: [],
  7728. //>>excludeEnd("ide");
  7729. messageSends: []
  7730. }),
  7731. $globals.StringTest);
  7732. $core.addMethod(
  7733. $core.method({
  7734. selector: "collectionFirstTwo",
  7735. protocol: 'fixture',
  7736. fn: function (){
  7737. var self=this;
  7738. return "he";
  7739. },
  7740. //>>excludeStart("ide", pragmas.excludeIdeData);
  7741. args: [],
  7742. source: "collectionFirstTwo\x0a\x09^ 'he'",
  7743. referencedClasses: [],
  7744. //>>excludeEnd("ide");
  7745. messageSends: []
  7746. }),
  7747. $globals.StringTest);
  7748. $core.addMethod(
  7749. $core.method({
  7750. selector: "collectionLast",
  7751. protocol: 'fixture',
  7752. fn: function (){
  7753. var self=this;
  7754. return "o";
  7755. },
  7756. //>>excludeStart("ide", pragmas.excludeIdeData);
  7757. args: [],
  7758. source: "collectionLast\x0a\x09^ 'o'",
  7759. referencedClasses: [],
  7760. //>>excludeEnd("ide");
  7761. messageSends: []
  7762. }),
  7763. $globals.StringTest);
  7764. $core.addMethod(
  7765. $core.method({
  7766. selector: "collectionLastTwo",
  7767. protocol: 'fixture',
  7768. fn: function (){
  7769. var self=this;
  7770. return "Lo";
  7771. },
  7772. //>>excludeStart("ide", pragmas.excludeIdeData);
  7773. args: [],
  7774. source: "collectionLastTwo\x0a\x09^ 'Lo'",
  7775. referencedClasses: [],
  7776. //>>excludeEnd("ide");
  7777. messageSends: []
  7778. }),
  7779. $globals.StringTest);
  7780. $core.addMethod(
  7781. $core.method({
  7782. selector: "collectionOfPrintStrings",
  7783. protocol: 'fixture',
  7784. fn: function (){
  7785. var self=this;
  7786. return "'h''e''l''L''o'";
  7787. },
  7788. //>>excludeStart("ide", pragmas.excludeIdeData);
  7789. args: [],
  7790. source: "collectionOfPrintStrings\x0a\x09^ '''h''''e''''l''''L''''o'''",
  7791. referencedClasses: [],
  7792. //>>excludeEnd("ide");
  7793. messageSends: []
  7794. }),
  7795. $globals.StringTest);
  7796. $core.addMethod(
  7797. $core.method({
  7798. selector: "collectionSize",
  7799. protocol: 'fixture',
  7800. fn: function (){
  7801. var self=this;
  7802. return (5);
  7803. },
  7804. //>>excludeStart("ide", pragmas.excludeIdeData);
  7805. args: [],
  7806. source: "collectionSize\x0a\x09^ 5",
  7807. referencedClasses: [],
  7808. //>>excludeEnd("ide");
  7809. messageSends: []
  7810. }),
  7811. $globals.StringTest);
  7812. $core.addMethod(
  7813. $core.method({
  7814. selector: "collectionWithDuplicates",
  7815. protocol: 'fixture',
  7816. fn: function (){
  7817. var self=this;
  7818. return "abbaerten";
  7819. },
  7820. //>>excludeStart("ide", pragmas.excludeIdeData);
  7821. args: [],
  7822. source: "collectionWithDuplicates\x0a\x09^ 'abbaerten'",
  7823. referencedClasses: [],
  7824. //>>excludeEnd("ide");
  7825. messageSends: []
  7826. }),
  7827. $globals.StringTest);
  7828. $core.addMethod(
  7829. $core.method({
  7830. selector: "collectionWithNewValue",
  7831. protocol: 'fixture',
  7832. fn: function (){
  7833. var self=this;
  7834. return "helLoN";
  7835. },
  7836. //>>excludeStart("ide", pragmas.excludeIdeData);
  7837. args: [],
  7838. source: "collectionWithNewValue\x0a\x09^ 'helLoN'",
  7839. referencedClasses: [],
  7840. //>>excludeEnd("ide");
  7841. messageSends: []
  7842. }),
  7843. $globals.StringTest);
  7844. $core.addMethod(
  7845. $core.method({
  7846. selector: "sampleNewValueAsCollection",
  7847. protocol: 'fixture',
  7848. fn: function (){
  7849. var self=this;
  7850. return "N";
  7851. },
  7852. //>>excludeStart("ide", pragmas.excludeIdeData);
  7853. args: [],
  7854. source: "sampleNewValueAsCollection\x0a\x09^ 'N'",
  7855. referencedClasses: [],
  7856. //>>excludeEnd("ide");
  7857. messageSends: []
  7858. }),
  7859. $globals.StringTest);
  7860. $core.addMethod(
  7861. $core.method({
  7862. selector: "samplesDo:",
  7863. protocol: 'fixture',
  7864. fn: function (aBlock){
  7865. var self=this;
  7866. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7867. return $core.withContext(function($ctx1) {
  7868. //>>excludeEnd("ctx");
  7869. (
  7870. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7871. $ctx1.supercall = true,
  7872. //>>excludeEnd("ctx");
  7873. ($globals.StringTest.superclass||$boot.dnu).fn.prototype._samplesDo_.apply($recv(self), [aBlock]));
  7874. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7875. $ctx1.supercall = false;
  7876. //>>excludeEnd("ctx");;
  7877. $recv(aBlock)._value_value_((3),"l");
  7878. return self;
  7879. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7880. }, function($ctx1) {$ctx1.fill(self,"samplesDo:",{aBlock:aBlock},$globals.StringTest)});
  7881. //>>excludeEnd("ctx");
  7882. },
  7883. //>>excludeStart("ide", pragmas.excludeIdeData);
  7884. args: ["aBlock"],
  7885. source: "samplesDo: aBlock\x0a\x09super samplesDo: aBlock.\x0a\x09aBlock value: 3 value: 'l'",
  7886. referencedClasses: [],
  7887. //>>excludeEnd("ide");
  7888. messageSends: ["samplesDo:", "value:value:"]
  7889. }),
  7890. $globals.StringTest);
  7891. $core.addMethod(
  7892. $core.method({
  7893. selector: "testAddAll",
  7894. protocol: 'tests',
  7895. fn: function (){
  7896. var self=this;
  7897. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7898. return $core.withContext(function($ctx1) {
  7899. //>>excludeEnd("ctx");
  7900. var $1;
  7901. self._should_raise_((function(){
  7902. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7903. return $core.withContext(function($ctx2) {
  7904. //>>excludeEnd("ctx");
  7905. $1=self._collection();
  7906. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7907. $ctx2.sendIdx["collection"]=1;
  7908. //>>excludeEnd("ctx");
  7909. return $recv($1)._addAll_(self._collection());
  7910. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7911. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  7912. //>>excludeEnd("ctx");
  7913. }),$globals.Error);
  7914. return self;
  7915. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7916. }, function($ctx1) {$ctx1.fill(self,"testAddAll",{},$globals.StringTest)});
  7917. //>>excludeEnd("ctx");
  7918. },
  7919. //>>excludeStart("ide", pragmas.excludeIdeData);
  7920. args: [],
  7921. source: "testAddAll\x0a\x09\x22String instances are read-only\x22\x0a\x09self should: [ self collection addAll: self collection ] raise: Error",
  7922. referencedClasses: ["Error"],
  7923. //>>excludeEnd("ide");
  7924. messageSends: ["should:raise:", "addAll:", "collection"]
  7925. }),
  7926. $globals.StringTest);
  7927. $core.addMethod(
  7928. $core.method({
  7929. selector: "testAddRemove",
  7930. protocol: 'tests',
  7931. fn: function (){
  7932. var self=this;
  7933. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7934. return $core.withContext(function($ctx1) {
  7935. //>>excludeEnd("ctx");
  7936. self._should_raise_((function(){
  7937. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7938. return $core.withContext(function($ctx2) {
  7939. //>>excludeEnd("ctx");
  7940. return "hello"._add_("a");
  7941. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7942. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  7943. //>>excludeEnd("ctx");
  7944. }),$globals.Error);
  7945. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7946. $ctx1.sendIdx["should:raise:"]=1;
  7947. //>>excludeEnd("ctx");
  7948. self._should_raise_((function(){
  7949. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7950. return $core.withContext(function($ctx2) {
  7951. //>>excludeEnd("ctx");
  7952. return "hello"._remove_("h");
  7953. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7954. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  7955. //>>excludeEnd("ctx");
  7956. }),$globals.Error);
  7957. return self;
  7958. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7959. }, function($ctx1) {$ctx1.fill(self,"testAddRemove",{},$globals.StringTest)});
  7960. //>>excludeEnd("ctx");
  7961. },
  7962. //>>excludeStart("ide", pragmas.excludeIdeData);
  7963. args: [],
  7964. source: "testAddRemove\x0a\x09self should: [ 'hello' add: 'a' ] raise: Error.\x0a\x09self should: [ 'hello' remove: 'h' ] raise: Error",
  7965. referencedClasses: ["Error"],
  7966. //>>excludeEnd("ide");
  7967. messageSends: ["should:raise:", "add:", "remove:"]
  7968. }),
  7969. $globals.StringTest);
  7970. $core.addMethod(
  7971. $core.method({
  7972. selector: "testAsArray",
  7973. protocol: 'tests',
  7974. fn: function (){
  7975. var self=this;
  7976. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7977. return $core.withContext(function($ctx1) {
  7978. //>>excludeEnd("ctx");
  7979. self._assert_equals_("hello"._asArray(),["h", "e", "l", "l", "o"]);
  7980. return self;
  7981. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7982. }, function($ctx1) {$ctx1.fill(self,"testAsArray",{},$globals.StringTest)});
  7983. //>>excludeEnd("ctx");
  7984. },
  7985. //>>excludeStart("ide", pragmas.excludeIdeData);
  7986. args: [],
  7987. source: "testAsArray\x0a\x09self assert: 'hello' asArray equals: #('h' 'e' 'l' 'l' 'o').",
  7988. referencedClasses: [],
  7989. //>>excludeEnd("ide");
  7990. messageSends: ["assert:equals:", "asArray"]
  7991. }),
  7992. $globals.StringTest);
  7993. $core.addMethod(
  7994. $core.method({
  7995. selector: "testAsLowerCase",
  7996. protocol: 'tests',
  7997. fn: function (){
  7998. var self=this;
  7999. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8000. return $core.withContext(function($ctx1) {
  8001. //>>excludeEnd("ctx");
  8002. self._assert_equals_("JACKIE"._asLowercase(),"jackie");
  8003. return self;
  8004. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8005. }, function($ctx1) {$ctx1.fill(self,"testAsLowerCase",{},$globals.StringTest)});
  8006. //>>excludeEnd("ctx");
  8007. },
  8008. //>>excludeStart("ide", pragmas.excludeIdeData);
  8009. args: [],
  8010. source: "testAsLowerCase\x0a\x09self assert: 'JACKIE' asLowercase equals: 'jackie'.",
  8011. referencedClasses: [],
  8012. //>>excludeEnd("ide");
  8013. messageSends: ["assert:equals:", "asLowercase"]
  8014. }),
  8015. $globals.StringTest);
  8016. $core.addMethod(
  8017. $core.method({
  8018. selector: "testAsNumber",
  8019. protocol: 'tests',
  8020. fn: function (){
  8021. var self=this;
  8022. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8023. return $core.withContext(function($ctx1) {
  8024. //>>excludeEnd("ctx");
  8025. var $1,$2;
  8026. $1="3"._asNumber();
  8027. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8028. $ctx1.sendIdx["asNumber"]=1;
  8029. //>>excludeEnd("ctx");
  8030. self._assert_equals_($1,(3));
  8031. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8032. $ctx1.sendIdx["assert:equals:"]=1;
  8033. //>>excludeEnd("ctx");
  8034. $2="-3"._asNumber();
  8035. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8036. $ctx1.sendIdx["asNumber"]=2;
  8037. //>>excludeEnd("ctx");
  8038. self._assert_equals_($2,(-3));
  8039. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8040. $ctx1.sendIdx["assert:equals:"]=2;
  8041. //>>excludeEnd("ctx");
  8042. self._assert_equals_("-1.5"._asNumber(),(-1.5));
  8043. return self;
  8044. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8045. }, function($ctx1) {$ctx1.fill(self,"testAsNumber",{},$globals.StringTest)});
  8046. //>>excludeEnd("ctx");
  8047. },
  8048. //>>excludeStart("ide", pragmas.excludeIdeData);
  8049. args: [],
  8050. 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.",
  8051. referencedClasses: [],
  8052. //>>excludeEnd("ide");
  8053. messageSends: ["assert:equals:", "asNumber"]
  8054. }),
  8055. $globals.StringTest);
  8056. $core.addMethod(
  8057. $core.method({
  8058. selector: "testAsUpperCase",
  8059. protocol: 'tests',
  8060. fn: function (){
  8061. var self=this;
  8062. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8063. return $core.withContext(function($ctx1) {
  8064. //>>excludeEnd("ctx");
  8065. self._assert_equals_("jackie"._asUppercase(),"JACKIE");
  8066. return self;
  8067. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8068. }, function($ctx1) {$ctx1.fill(self,"testAsUpperCase",{},$globals.StringTest)});
  8069. //>>excludeEnd("ctx");
  8070. },
  8071. //>>excludeStart("ide", pragmas.excludeIdeData);
  8072. args: [],
  8073. source: "testAsUpperCase\x0a\x09self assert: 'jackie' asUppercase equals: 'JACKIE'.",
  8074. referencedClasses: [],
  8075. //>>excludeEnd("ide");
  8076. messageSends: ["assert:equals:", "asUppercase"]
  8077. }),
  8078. $globals.StringTest);
  8079. $core.addMethod(
  8080. $core.method({
  8081. selector: "testAsciiValue",
  8082. protocol: 'tests',
  8083. fn: function (){
  8084. var self=this;
  8085. var characterA,characterU;
  8086. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8087. return $core.withContext(function($ctx1) {
  8088. //>>excludeEnd("ctx");
  8089. var $1;
  8090. characterA="A";
  8091. characterU="U";
  8092. $1=$recv(characterA)._asciiValue();
  8093. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8094. $ctx1.sendIdx["asciiValue"]=1;
  8095. //>>excludeEnd("ctx");
  8096. self._assert_equals_($1,(65));
  8097. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8098. $ctx1.sendIdx["assert:equals:"]=1;
  8099. //>>excludeEnd("ctx");
  8100. self._assert_equals_($recv(characterU)._asciiValue(),(85));
  8101. return self;
  8102. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8103. }, function($ctx1) {$ctx1.fill(self,"testAsciiValue",{characterA:characterA,characterU:characterU},$globals.StringTest)});
  8104. //>>excludeEnd("ctx");
  8105. },
  8106. //>>excludeStart("ide", pragmas.excludeIdeData);
  8107. args: [],
  8108. 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",
  8109. referencedClasses: [],
  8110. //>>excludeEnd("ide");
  8111. messageSends: ["assert:equals:", "asciiValue"]
  8112. }),
  8113. $globals.StringTest);
  8114. $core.addMethod(
  8115. $core.method({
  8116. selector: "testAtIfAbsentPut",
  8117. protocol: 'tests',
  8118. fn: function (){
  8119. var self=this;
  8120. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8121. return $core.withContext(function($ctx1) {
  8122. //>>excludeEnd("ctx");
  8123. self._should_raise_((function(){
  8124. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8125. return $core.withContext(function($ctx2) {
  8126. //>>excludeEnd("ctx");
  8127. return "hello"._at_ifAbsentPut_((6),(function(){
  8128. return "a";
  8129. }));
  8130. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8131. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  8132. //>>excludeEnd("ctx");
  8133. }),$globals.Error);
  8134. return self;
  8135. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8136. }, function($ctx1) {$ctx1.fill(self,"testAtIfAbsentPut",{},$globals.StringTest)});
  8137. //>>excludeEnd("ctx");
  8138. },
  8139. //>>excludeStart("ide", pragmas.excludeIdeData);
  8140. args: [],
  8141. source: "testAtIfAbsentPut\x0a\x09\x22String instances are read-only\x22\x0a\x09self should: [ 'hello' at: 6 ifAbsentPut: [ 'a' ] ] raise: Error",
  8142. referencedClasses: ["Error"],
  8143. //>>excludeEnd("ide");
  8144. messageSends: ["should:raise:", "at:ifAbsentPut:"]
  8145. }),
  8146. $globals.StringTest);
  8147. $core.addMethod(
  8148. $core.method({
  8149. selector: "testAtPut",
  8150. protocol: 'tests',
  8151. fn: function (){
  8152. var self=this;
  8153. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8154. return $core.withContext(function($ctx1) {
  8155. //>>excludeEnd("ctx");
  8156. self._should_raise_((function(){
  8157. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8158. return $core.withContext(function($ctx2) {
  8159. //>>excludeEnd("ctx");
  8160. return "hello"._at_put_((1),"a");
  8161. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8162. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  8163. //>>excludeEnd("ctx");
  8164. }),$globals.Error);
  8165. return self;
  8166. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8167. }, function($ctx1) {$ctx1.fill(self,"testAtPut",{},$globals.StringTest)});
  8168. //>>excludeEnd("ctx");
  8169. },
  8170. //>>excludeStart("ide", pragmas.excludeIdeData);
  8171. args: [],
  8172. source: "testAtPut\x0a\x09\x22String instances are read-only\x22\x0a\x09self should: [ 'hello' at: 1 put: 'a' ] raise: Error",
  8173. referencedClasses: ["Error"],
  8174. //>>excludeEnd("ide");
  8175. messageSends: ["should:raise:", "at:put:"]
  8176. }),
  8177. $globals.StringTest);
  8178. $core.addMethod(
  8179. $core.method({
  8180. selector: "testCapitalized",
  8181. protocol: 'tests',
  8182. fn: function (){
  8183. var self=this;
  8184. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8185. return $core.withContext(function($ctx1) {
  8186. //>>excludeEnd("ctx");
  8187. var $1,$2,$3;
  8188. $1="test"._capitalized();
  8189. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8190. $ctx1.sendIdx["capitalized"]=1;
  8191. //>>excludeEnd("ctx");
  8192. self._assert_equals_($1,"Test");
  8193. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8194. $ctx1.sendIdx["assert:equals:"]=1;
  8195. //>>excludeEnd("ctx");
  8196. $2="Test"._capitalized();
  8197. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8198. $ctx1.sendIdx["capitalized"]=2;
  8199. //>>excludeEnd("ctx");
  8200. self._assert_equals_($2,"Test");
  8201. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8202. $ctx1.sendIdx["assert:equals:"]=2;
  8203. //>>excludeEnd("ctx");
  8204. self._assert_equals_(""._capitalized(),"");
  8205. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8206. $ctx1.sendIdx["assert:equals:"]=3;
  8207. //>>excludeEnd("ctx");
  8208. $3="Test"._isCapitalized();
  8209. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8210. $ctx1.sendIdx["isCapitalized"]=1;
  8211. //>>excludeEnd("ctx");
  8212. self._assert_equals_($3,true);
  8213. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8214. $ctx1.sendIdx["assert:equals:"]=4;
  8215. //>>excludeEnd("ctx");
  8216. self._assert_equals_("test"._isCapitalized(),false);
  8217. return self;
  8218. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8219. }, function($ctx1) {$ctx1.fill(self,"testCapitalized",{},$globals.StringTest)});
  8220. //>>excludeEnd("ctx");
  8221. },
  8222. //>>excludeStart("ide", pragmas.excludeIdeData);
  8223. args: [],
  8224. 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.",
  8225. referencedClasses: [],
  8226. //>>excludeEnd("ide");
  8227. messageSends: ["assert:equals:", "capitalized", "isCapitalized"]
  8228. }),
  8229. $globals.StringTest);
  8230. $core.addMethod(
  8231. $core.method({
  8232. selector: "testCharCodeAt",
  8233. protocol: 'tests',
  8234. fn: function (){
  8235. var self=this;
  8236. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8237. return $core.withContext(function($ctx1) {
  8238. //>>excludeEnd("ctx");
  8239. var $1,$2,$3,$4,$5;
  8240. $1="jackie"._charCodeAt_((1));
  8241. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8242. $ctx1.sendIdx["charCodeAt:"]=1;
  8243. //>>excludeEnd("ctx");
  8244. self._assert_equals_($1,(106));
  8245. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8246. $ctx1.sendIdx["assert:equals:"]=1;
  8247. //>>excludeEnd("ctx");
  8248. $2="jackie"._charCodeAt_((2));
  8249. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8250. $ctx1.sendIdx["charCodeAt:"]=2;
  8251. //>>excludeEnd("ctx");
  8252. self._assert_equals_($2,(97));
  8253. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8254. $ctx1.sendIdx["assert:equals:"]=2;
  8255. //>>excludeEnd("ctx");
  8256. $3="jackie"._charCodeAt_((3));
  8257. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8258. $ctx1.sendIdx["charCodeAt:"]=3;
  8259. //>>excludeEnd("ctx");
  8260. self._assert_equals_($3,(99));
  8261. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8262. $ctx1.sendIdx["assert:equals:"]=3;
  8263. //>>excludeEnd("ctx");
  8264. $4="jackie"._charCodeAt_((4));
  8265. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8266. $ctx1.sendIdx["charCodeAt:"]=4;
  8267. //>>excludeEnd("ctx");
  8268. self._assert_equals_($4,(107));
  8269. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8270. $ctx1.sendIdx["assert:equals:"]=4;
  8271. //>>excludeEnd("ctx");
  8272. $5="jackie"._charCodeAt_((5));
  8273. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8274. $ctx1.sendIdx["charCodeAt:"]=5;
  8275. //>>excludeEnd("ctx");
  8276. self._assert_equals_($5,(105));
  8277. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8278. $ctx1.sendIdx["assert:equals:"]=5;
  8279. //>>excludeEnd("ctx");
  8280. self._assert_equals_("jackie"._charCodeAt_((6)),(101));
  8281. return self;
  8282. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8283. }, function($ctx1) {$ctx1.fill(self,"testCharCodeAt",{},$globals.StringTest)});
  8284. //>>excludeEnd("ctx");
  8285. },
  8286. //>>excludeStart("ide", pragmas.excludeIdeData);
  8287. args: [],
  8288. 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",
  8289. referencedClasses: [],
  8290. //>>excludeEnd("ide");
  8291. messageSends: ["assert:equals:", "charCodeAt:"]
  8292. }),
  8293. $globals.StringTest);
  8294. $core.addMethod(
  8295. $core.method({
  8296. selector: "testCopyFromTo",
  8297. protocol: 'tests',
  8298. fn: function (){
  8299. var self=this;
  8300. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8301. return $core.withContext(function($ctx1) {
  8302. //>>excludeEnd("ctx");
  8303. var $1;
  8304. $1="jackie"._copyFrom_to_((1),(3));
  8305. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8306. $ctx1.sendIdx["copyFrom:to:"]=1;
  8307. //>>excludeEnd("ctx");
  8308. self._assert_equals_($1,"jac");
  8309. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8310. $ctx1.sendIdx["assert:equals:"]=1;
  8311. //>>excludeEnd("ctx");
  8312. self._assert_equals_("jackie"._copyFrom_to_((4),(6)),"kie");
  8313. return self;
  8314. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8315. }, function($ctx1) {$ctx1.fill(self,"testCopyFromTo",{},$globals.StringTest)});
  8316. //>>excludeEnd("ctx");
  8317. },
  8318. //>>excludeStart("ide", pragmas.excludeIdeData);
  8319. args: [],
  8320. source: "testCopyFromTo\x0a\x09self assert: ('jackie' copyFrom: 1 to: 3) equals: 'jac'.\x0a\x09self assert: ('jackie' copyFrom: 4 to: 6) equals: 'kie'.",
  8321. referencedClasses: [],
  8322. //>>excludeEnd("ide");
  8323. messageSends: ["assert:equals:", "copyFrom:to:"]
  8324. }),
  8325. $globals.StringTest);
  8326. $core.addMethod(
  8327. $core.method({
  8328. selector: "testCopySeparates",
  8329. protocol: 'tests',
  8330. fn: function (){
  8331. var self=this;
  8332. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8333. return $core.withContext(function($ctx1) {
  8334. //>>excludeEnd("ctx");
  8335. var $3,$2,$1;
  8336. $3=self._collection();
  8337. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8338. $ctx1.sendIdx["collection"]=1;
  8339. //>>excludeEnd("ctx");
  8340. $2=$recv($3)._copy();
  8341. $1=$recv($2).__eq_eq(self._collection());
  8342. self._assert_($1);
  8343. return self;
  8344. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8345. }, function($ctx1) {$ctx1.fill(self,"testCopySeparates",{},$globals.StringTest)});
  8346. //>>excludeEnd("ctx");
  8347. },
  8348. //>>excludeStart("ide", pragmas.excludeIdeData);
  8349. args: [],
  8350. source: "testCopySeparates\x0a\x09\x22String instances are immutable\x22\x0a\x09self assert: self collection copy == self collection",
  8351. referencedClasses: [],
  8352. //>>excludeEnd("ide");
  8353. messageSends: ["assert:", "==", "copy", "collection"]
  8354. }),
  8355. $globals.StringTest);
  8356. $core.addMethod(
  8357. $core.method({
  8358. selector: "testCopyWithoutAll",
  8359. protocol: 'tests',
  8360. fn: function (){
  8361. var self=this;
  8362. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8363. return $core.withContext(function($ctx1) {
  8364. //>>excludeEnd("ctx");
  8365. self._assert_equals_("*hello* *world*"._copyWithoutAll_("*"),"hello world");
  8366. return self;
  8367. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8368. }, function($ctx1) {$ctx1.fill(self,"testCopyWithoutAll",{},$globals.StringTest)});
  8369. //>>excludeEnd("ctx");
  8370. },
  8371. //>>excludeStart("ide", pragmas.excludeIdeData);
  8372. args: [],
  8373. source: "testCopyWithoutAll\x0a\x09self\x0a\x09\x09assert: ('*hello* *world*' copyWithoutAll: '*')\x0a\x09\x09equals: 'hello world'",
  8374. referencedClasses: [],
  8375. //>>excludeEnd("ide");
  8376. messageSends: ["assert:equals:", "copyWithoutAll:"]
  8377. }),
  8378. $globals.StringTest);
  8379. $core.addMethod(
  8380. $core.method({
  8381. selector: "testEquality",
  8382. protocol: 'tests',
  8383. fn: function (){
  8384. var self=this;
  8385. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8386. return $core.withContext(function($ctx1) {
  8387. //>>excludeEnd("ctx");
  8388. var $1,$2,$3;
  8389. self._assert_equals_("hello","hello");
  8390. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8391. $ctx1.sendIdx["assert:equals:"]=1;
  8392. //>>excludeEnd("ctx");
  8393. $1="hello".__eq("world");
  8394. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8395. $ctx1.sendIdx["="]=1;
  8396. //>>excludeEnd("ctx");
  8397. self._deny_($1);
  8398. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8399. $ctx1.sendIdx["deny:"]=1;
  8400. //>>excludeEnd("ctx");
  8401. $2="hello".__eq([]._at_ifAbsent_((1),(function(){
  8402. })));
  8403. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8404. $ctx1.sendIdx["="]=2;
  8405. //>>excludeEnd("ctx");
  8406. self._deny_($2);
  8407. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8408. $ctx1.sendIdx["deny:"]=2;
  8409. //>>excludeEnd("ctx");
  8410. $3="hello"._yourself();
  8411. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8412. $ctx1.sendIdx["yourself"]=1;
  8413. //>>excludeEnd("ctx");
  8414. self._assert_equals_("hello",$3);
  8415. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8416. $ctx1.sendIdx["assert:equals:"]=2;
  8417. //>>excludeEnd("ctx");
  8418. self._assert_equals_("hello"._yourself(),"hello");
  8419. self._deny_("".__eq((0)));
  8420. return self;
  8421. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8422. }, function($ctx1) {$ctx1.fill(self,"testEquality",{},$globals.StringTest)});
  8423. //>>excludeEnd("ctx");
  8424. },
  8425. //>>excludeStart("ide", pragmas.excludeIdeData);
  8426. args: [],
  8427. 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",
  8428. referencedClasses: [],
  8429. //>>excludeEnd("ide");
  8430. messageSends: ["assert:equals:", "deny:", "=", "at:ifAbsent:", "yourself"]
  8431. }),
  8432. $globals.StringTest);
  8433. $core.addMethod(
  8434. $core.method({
  8435. selector: "testIdentity",
  8436. protocol: 'tests',
  8437. fn: function (){
  8438. var self=this;
  8439. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8440. return $core.withContext(function($ctx1) {
  8441. //>>excludeEnd("ctx");
  8442. var $1,$2,$4,$3,$5;
  8443. $1="hello".__eq_eq("hello");
  8444. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8445. $ctx1.sendIdx["=="]=1;
  8446. //>>excludeEnd("ctx");
  8447. self._assert_($1);
  8448. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8449. $ctx1.sendIdx["assert:"]=1;
  8450. //>>excludeEnd("ctx");
  8451. $2="hello".__eq_eq("world");
  8452. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8453. $ctx1.sendIdx["=="]=2;
  8454. //>>excludeEnd("ctx");
  8455. self._deny_($2);
  8456. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8457. $ctx1.sendIdx["deny:"]=1;
  8458. //>>excludeEnd("ctx");
  8459. $4="hello"._yourself();
  8460. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8461. $ctx1.sendIdx["yourself"]=1;
  8462. //>>excludeEnd("ctx");
  8463. $3="hello".__eq_eq($4);
  8464. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8465. $ctx1.sendIdx["=="]=3;
  8466. //>>excludeEnd("ctx");
  8467. self._assert_($3);
  8468. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8469. $ctx1.sendIdx["assert:"]=2;
  8470. //>>excludeEnd("ctx");
  8471. $5=$recv("hello"._yourself()).__eq_eq("hello");
  8472. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8473. $ctx1.sendIdx["=="]=4;
  8474. //>>excludeEnd("ctx");
  8475. self._assert_($5);
  8476. self._deny_("".__eq_eq((0)));
  8477. return self;
  8478. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8479. }, function($ctx1) {$ctx1.fill(self,"testIdentity",{},$globals.StringTest)});
  8480. //>>excludeEnd("ctx");
  8481. },
  8482. //>>excludeStart("ide", pragmas.excludeIdeData);
  8483. args: [],
  8484. 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",
  8485. referencedClasses: [],
  8486. //>>excludeEnd("ide");
  8487. messageSends: ["assert:", "==", "deny:", "yourself"]
  8488. }),
  8489. $globals.StringTest);
  8490. $core.addMethod(
  8491. $core.method({
  8492. selector: "testIncludesSubString",
  8493. protocol: 'tests',
  8494. fn: function (){
  8495. var self=this;
  8496. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8497. return $core.withContext(function($ctx1) {
  8498. //>>excludeEnd("ctx");
  8499. var $1;
  8500. $1="amber"._includesSubString_("ber");
  8501. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8502. $ctx1.sendIdx["includesSubString:"]=1;
  8503. //>>excludeEnd("ctx");
  8504. self._assert_($1);
  8505. self._deny_("amber"._includesSubString_("zork"));
  8506. return self;
  8507. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8508. }, function($ctx1) {$ctx1.fill(self,"testIncludesSubString",{},$globals.StringTest)});
  8509. //>>excludeEnd("ctx");
  8510. },
  8511. //>>excludeStart("ide", pragmas.excludeIdeData);
  8512. args: [],
  8513. source: "testIncludesSubString\x0a\x09self assert: ('amber' includesSubString: 'ber').\x0a\x09self deny: ('amber' includesSubString: 'zork').",
  8514. referencedClasses: [],
  8515. //>>excludeEnd("ide");
  8516. messageSends: ["assert:", "includesSubString:", "deny:"]
  8517. }),
  8518. $globals.StringTest);
  8519. $core.addMethod(
  8520. $core.method({
  8521. selector: "testIndexOfStartingAtWithNull",
  8522. protocol: 'tests',
  8523. fn: function (){
  8524. var self=this;
  8525. return self;
  8526. },
  8527. //>>excludeStart("ide", pragmas.excludeIdeData);
  8528. args: [],
  8529. source: "testIndexOfStartingAtWithNull\x0a\x09\x22String cannot hold JS null\x22",
  8530. referencedClasses: [],
  8531. //>>excludeEnd("ide");
  8532. messageSends: []
  8533. }),
  8534. $globals.StringTest);
  8535. $core.addMethod(
  8536. $core.method({
  8537. selector: "testIndexOfWithNull",
  8538. protocol: 'tests',
  8539. fn: function (){
  8540. var self=this;
  8541. return self;
  8542. },
  8543. //>>excludeStart("ide", pragmas.excludeIdeData);
  8544. args: [],
  8545. source: "testIndexOfWithNull\x0a\x09\x22String cannot hold JS null\x22",
  8546. referencedClasses: [],
  8547. //>>excludeEnd("ide");
  8548. messageSends: []
  8549. }),
  8550. $globals.StringTest);
  8551. $core.addMethod(
  8552. $core.method({
  8553. selector: "testIsVowel",
  8554. protocol: 'tests',
  8555. fn: function (){
  8556. var self=this;
  8557. var vowel,consonant;
  8558. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8559. return $core.withContext(function($ctx1) {
  8560. //>>excludeEnd("ctx");
  8561. var $1;
  8562. vowel="u";
  8563. consonant="z";
  8564. $1=$recv(vowel)._isVowel();
  8565. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8566. $ctx1.sendIdx["isVowel"]=1;
  8567. //>>excludeEnd("ctx");
  8568. self._assert_equals_($1,true);
  8569. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8570. $ctx1.sendIdx["assert:equals:"]=1;
  8571. //>>excludeEnd("ctx");
  8572. self._assert_equals_($recv(consonant)._isVowel(),false);
  8573. return self;
  8574. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8575. }, function($ctx1) {$ctx1.fill(self,"testIsVowel",{vowel:vowel,consonant:consonant},$globals.StringTest)});
  8576. //>>excludeEnd("ctx");
  8577. },
  8578. //>>excludeStart("ide", pragmas.excludeIdeData);
  8579. args: [],
  8580. 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",
  8581. referencedClasses: [],
  8582. //>>excludeEnd("ide");
  8583. messageSends: ["assert:equals:", "isVowel"]
  8584. }),
  8585. $globals.StringTest);
  8586. $core.addMethod(
  8587. $core.method({
  8588. selector: "testJoin",
  8589. protocol: 'tests',
  8590. fn: function (){
  8591. var self=this;
  8592. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8593. return $core.withContext(function($ctx1) {
  8594. //>>excludeEnd("ctx");
  8595. self._assert_equals_(","._join_(["hello", "world"]),"hello,world");
  8596. return self;
  8597. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8598. }, function($ctx1) {$ctx1.fill(self,"testJoin",{},$globals.StringTest)});
  8599. //>>excludeEnd("ctx");
  8600. },
  8601. //>>excludeStart("ide", pragmas.excludeIdeData);
  8602. args: [],
  8603. source: "testJoin\x0a\x09self assert: (',' join: #('hello' 'world')) equals: 'hello,world'",
  8604. referencedClasses: [],
  8605. //>>excludeEnd("ide");
  8606. messageSends: ["assert:equals:", "join:"]
  8607. }),
  8608. $globals.StringTest);
  8609. $core.addMethod(
  8610. $core.method({
  8611. selector: "testRemoveAll",
  8612. protocol: 'tests',
  8613. fn: function (){
  8614. var self=this;
  8615. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8616. return $core.withContext(function($ctx1) {
  8617. //>>excludeEnd("ctx");
  8618. self._should_raise_((function(){
  8619. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8620. return $core.withContext(function($ctx2) {
  8621. //>>excludeEnd("ctx");
  8622. return $recv(self._collection())._removeAll();
  8623. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8624. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  8625. //>>excludeEnd("ctx");
  8626. }),$globals.Error);
  8627. return self;
  8628. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8629. }, function($ctx1) {$ctx1.fill(self,"testRemoveAll",{},$globals.StringTest)});
  8630. //>>excludeEnd("ctx");
  8631. },
  8632. //>>excludeStart("ide", pragmas.excludeIdeData);
  8633. args: [],
  8634. source: "testRemoveAll\x0a\x09self should: [ self collection removeAll ] raise: Error",
  8635. referencedClasses: ["Error"],
  8636. //>>excludeEnd("ide");
  8637. messageSends: ["should:raise:", "removeAll", "collection"]
  8638. }),
  8639. $globals.StringTest);
  8640. $core.addMethod(
  8641. $core.method({
  8642. selector: "testReversed",
  8643. protocol: 'tests',
  8644. fn: function (){
  8645. var self=this;
  8646. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8647. return $core.withContext(function($ctx1) {
  8648. //>>excludeEnd("ctx");
  8649. self._assert_equals_("jackiechan"._reversed(),"nahceikcaj");
  8650. return self;
  8651. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8652. }, function($ctx1) {$ctx1.fill(self,"testReversed",{},$globals.StringTest)});
  8653. //>>excludeEnd("ctx");
  8654. },
  8655. //>>excludeStart("ide", pragmas.excludeIdeData);
  8656. args: [],
  8657. source: "testReversed\x0a\x09self assert: 'jackiechan' reversed equals: 'nahceikcaj'.",
  8658. referencedClasses: [],
  8659. //>>excludeEnd("ide");
  8660. messageSends: ["assert:equals:", "reversed"]
  8661. }),
  8662. $globals.StringTest);
  8663. $core.addMethod(
  8664. $core.method({
  8665. selector: "testStreamContents",
  8666. protocol: 'tests',
  8667. fn: function (){
  8668. var self=this;
  8669. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8670. return $core.withContext(function($ctx1) {
  8671. //>>excludeEnd("ctx");
  8672. self._assert_equals_($recv($globals.String)._streamContents_((function(aStream){
  8673. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8674. return $core.withContext(function($ctx2) {
  8675. //>>excludeEnd("ctx");
  8676. $recv(aStream)._nextPutAll_("hello");
  8677. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8678. $ctx2.sendIdx["nextPutAll:"]=1;
  8679. //>>excludeEnd("ctx");
  8680. $recv(aStream)._space();
  8681. return $recv(aStream)._nextPutAll_("world");
  8682. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8683. }, function($ctx2) {$ctx2.fillBlock({aStream:aStream},$ctx1,1)});
  8684. //>>excludeEnd("ctx");
  8685. })),"hello world");
  8686. return self;
  8687. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8688. }, function($ctx1) {$ctx1.fill(self,"testStreamContents",{},$globals.StringTest)});
  8689. //>>excludeEnd("ctx");
  8690. },
  8691. //>>excludeStart("ide", pragmas.excludeIdeData);
  8692. args: [],
  8693. 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'",
  8694. referencedClasses: ["String"],
  8695. //>>excludeEnd("ide");
  8696. messageSends: ["assert:equals:", "streamContents:", "nextPutAll:", "space"]
  8697. }),
  8698. $globals.StringTest);
  8699. $core.addMethod(
  8700. $core.method({
  8701. selector: "testSubStrings",
  8702. protocol: 'tests',
  8703. fn: function (){
  8704. var self=this;
  8705. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8706. return $core.withContext(function($ctx1) {
  8707. //>>excludeEnd("ctx");
  8708. self._assert_equals_("jackiechan"._subStrings_("ie"),["jack", "chan"]);
  8709. return self;
  8710. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8711. }, function($ctx1) {$ctx1.fill(self,"testSubStrings",{},$globals.StringTest)});
  8712. //>>excludeEnd("ctx");
  8713. },
  8714. //>>excludeStart("ide", pragmas.excludeIdeData);
  8715. args: [],
  8716. source: "testSubStrings\x0a\x09self assert: ('jackiechan' subStrings: 'ie') equals: #( 'jack' 'chan' ).",
  8717. referencedClasses: [],
  8718. //>>excludeEnd("ide");
  8719. messageSends: ["assert:equals:", "subStrings:"]
  8720. }),
  8721. $globals.StringTest);
  8722. $core.addMethod(
  8723. $core.method({
  8724. selector: "testTrim",
  8725. protocol: 'tests',
  8726. fn: function (){
  8727. var self=this;
  8728. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8729. return $core.withContext(function($ctx1) {
  8730. //>>excludeEnd("ctx");
  8731. self._assert_equals_(" jackie"._trimLeft(),"jackie");
  8732. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8733. $ctx1.sendIdx["assert:equals:"]=1;
  8734. //>>excludeEnd("ctx");
  8735. self._assert_equals_("jackie "._trimRight(),"jackie");
  8736. return self;
  8737. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8738. }, function($ctx1) {$ctx1.fill(self,"testTrim",{},$globals.StringTest)});
  8739. //>>excludeEnd("ctx");
  8740. },
  8741. //>>excludeStart("ide", pragmas.excludeIdeData);
  8742. args: [],
  8743. source: "testTrim\x0a\x09self assert: ' jackie' trimLeft equals: 'jackie'.\x0a\x09self assert: 'jackie ' trimRight equals: 'jackie'.",
  8744. referencedClasses: [],
  8745. //>>excludeEnd("ide");
  8746. messageSends: ["assert:equals:", "trimLeft", "trimRight"]
  8747. }),
  8748. $globals.StringTest);
  8749. $core.addMethod(
  8750. $core.method({
  8751. selector: "testValue",
  8752. protocol: 'tests',
  8753. fn: function (){
  8754. var self=this;
  8755. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8756. return $core.withContext(function($ctx1) {
  8757. //>>excludeEnd("ctx");
  8758. self._assert_equals_("asString"._value_((1)),"1");
  8759. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8760. $ctx1.sendIdx["assert:equals:"]=1;
  8761. //>>excludeEnd("ctx");
  8762. self._assert_equals_([(1), (2), (3)]._collect_("asString"),["1", "2", "3"]);
  8763. return self;
  8764. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8765. }, function($ctx1) {$ctx1.fill(self,"testValue",{},$globals.StringTest)});
  8766. //>>excludeEnd("ctx");
  8767. },
  8768. //>>excludeStart("ide", pragmas.excludeIdeData);
  8769. args: [],
  8770. 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')",
  8771. referencedClasses: [],
  8772. //>>excludeEnd("ide");
  8773. messageSends: ["assert:equals:", "value:", "collect:"]
  8774. }),
  8775. $globals.StringTest);
  8776. $core.addMethod(
  8777. $core.method({
  8778. selector: "collectionClass",
  8779. protocol: 'fixture',
  8780. fn: function (){
  8781. var self=this;
  8782. return $globals.String;
  8783. },
  8784. //>>excludeStart("ide", pragmas.excludeIdeData);
  8785. args: [],
  8786. source: "collectionClass\x0a\x09^ String",
  8787. referencedClasses: ["String"],
  8788. //>>excludeEnd("ide");
  8789. messageSends: []
  8790. }),
  8791. $globals.StringTest.klass);
  8792. $core.addClass('SetTest', $globals.CollectionTest, [], 'Kernel-Tests');
  8793. $core.addMethod(
  8794. $core.method({
  8795. selector: "collection",
  8796. protocol: 'fixture',
  8797. fn: function (){
  8798. var self=this;
  8799. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8800. return $core.withContext(function($ctx1) {
  8801. //>>excludeEnd("ctx");
  8802. var $1;
  8803. $1=$recv($globals.Set)._new();
  8804. $recv($1)._add_($globals.Smalltalk);
  8805. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8806. $ctx1.sendIdx["add:"]=1;
  8807. //>>excludeEnd("ctx");
  8808. $recv($1)._add_(nil);
  8809. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8810. $ctx1.sendIdx["add:"]=2;
  8811. //>>excludeEnd("ctx");
  8812. $recv($1)._add_((3).__at((3)));
  8813. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8814. $ctx1.sendIdx["add:"]=3;
  8815. //>>excludeEnd("ctx");
  8816. $recv($1)._add_(false);
  8817. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8818. $ctx1.sendIdx["add:"]=4;
  8819. //>>excludeEnd("ctx");
  8820. $recv($1)._add_(self["@sampleBlock"]);
  8821. return $recv($1)._yourself();
  8822. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8823. }, function($ctx1) {$ctx1.fill(self,"collection",{},$globals.SetTest)});
  8824. //>>excludeEnd("ctx");
  8825. },
  8826. //>>excludeStart("ide", pragmas.excludeIdeData);
  8827. args: [],
  8828. 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",
  8829. referencedClasses: ["Set", "Smalltalk"],
  8830. //>>excludeEnd("ide");
  8831. messageSends: ["add:", "new", "@", "yourself"]
  8832. }),
  8833. $globals.SetTest);
  8834. $core.addMethod(
  8835. $core.method({
  8836. selector: "collectionOfPrintStrings",
  8837. protocol: 'fixture',
  8838. fn: function (){
  8839. var self=this;
  8840. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8841. return $core.withContext(function($ctx1) {
  8842. //>>excludeEnd("ctx");
  8843. var $1;
  8844. $1=$recv($globals.Set)._new();
  8845. $recv($1)._add_("a SmalltalkImage");
  8846. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8847. $ctx1.sendIdx["add:"]=1;
  8848. //>>excludeEnd("ctx");
  8849. $recv($1)._add_("nil");
  8850. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8851. $ctx1.sendIdx["add:"]=2;
  8852. //>>excludeEnd("ctx");
  8853. $recv($1)._add_("3@3");
  8854. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8855. $ctx1.sendIdx["add:"]=3;
  8856. //>>excludeEnd("ctx");
  8857. $recv($1)._add_("false");
  8858. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8859. $ctx1.sendIdx["add:"]=4;
  8860. //>>excludeEnd("ctx");
  8861. $recv($1)._add_("a BlockClosure");
  8862. return $recv($1)._yourself();
  8863. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8864. }, function($ctx1) {$ctx1.fill(self,"collectionOfPrintStrings",{},$globals.SetTest)});
  8865. //>>excludeEnd("ctx");
  8866. },
  8867. //>>excludeStart("ide", pragmas.excludeIdeData);
  8868. args: [],
  8869. 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",
  8870. referencedClasses: ["Set"],
  8871. //>>excludeEnd("ide");
  8872. messageSends: ["add:", "new", "yourself"]
  8873. }),
  8874. $globals.SetTest);
  8875. $core.addMethod(
  8876. $core.method({
  8877. selector: "collectionSize",
  8878. protocol: 'fixture',
  8879. fn: function (){
  8880. var self=this;
  8881. return (5);
  8882. },
  8883. //>>excludeStart("ide", pragmas.excludeIdeData);
  8884. args: [],
  8885. source: "collectionSize\x0a\x09^ 5",
  8886. referencedClasses: [],
  8887. //>>excludeEnd("ide");
  8888. messageSends: []
  8889. }),
  8890. $globals.SetTest);
  8891. $core.addMethod(
  8892. $core.method({
  8893. selector: "collectionWithDuplicates",
  8894. protocol: 'fixture',
  8895. fn: function (){
  8896. var self=this;
  8897. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8898. return $core.withContext(function($ctx1) {
  8899. //>>excludeEnd("ctx");
  8900. var $1;
  8901. $1=self._collection();
  8902. $recv($1)._add_((0));
  8903. return $recv($1)._yourself();
  8904. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8905. }, function($ctx1) {$ctx1.fill(self,"collectionWithDuplicates",{},$globals.SetTest)});
  8906. //>>excludeEnd("ctx");
  8907. },
  8908. //>>excludeStart("ide", pragmas.excludeIdeData);
  8909. args: [],
  8910. source: "collectionWithDuplicates\x0a\x09\x22Set has no duplicates\x22\x0a\x09^ self collection add: 0; yourself",
  8911. referencedClasses: [],
  8912. //>>excludeEnd("ide");
  8913. messageSends: ["add:", "collection", "yourself"]
  8914. }),
  8915. $globals.SetTest);
  8916. $core.addMethod(
  8917. $core.method({
  8918. selector: "collectionWithNewValue",
  8919. protocol: 'fixture',
  8920. fn: function (){
  8921. var self=this;
  8922. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8923. return $core.withContext(function($ctx1) {
  8924. //>>excludeEnd("ctx");
  8925. var $1;
  8926. $1=$recv($globals.Set)._new();
  8927. $recv($1)._add_($globals.Smalltalk);
  8928. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8929. $ctx1.sendIdx["add:"]=1;
  8930. //>>excludeEnd("ctx");
  8931. $recv($1)._add_(nil);
  8932. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8933. $ctx1.sendIdx["add:"]=2;
  8934. //>>excludeEnd("ctx");
  8935. $recv($1)._add_((3).__at((3)));
  8936. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8937. $ctx1.sendIdx["add:"]=3;
  8938. //>>excludeEnd("ctx");
  8939. $recv($1)._add_("N");
  8940. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8941. $ctx1.sendIdx["add:"]=4;
  8942. //>>excludeEnd("ctx");
  8943. $recv($1)._add_(false);
  8944. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8945. $ctx1.sendIdx["add:"]=5;
  8946. //>>excludeEnd("ctx");
  8947. $recv($1)._add_(self["@sampleBlock"]);
  8948. return $recv($1)._yourself();
  8949. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8950. }, function($ctx1) {$ctx1.fill(self,"collectionWithNewValue",{},$globals.SetTest)});
  8951. //>>excludeEnd("ctx");
  8952. },
  8953. //>>excludeStart("ide", pragmas.excludeIdeData);
  8954. args: [],
  8955. 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",
  8956. referencedClasses: ["Set", "Smalltalk"],
  8957. //>>excludeEnd("ide");
  8958. messageSends: ["add:", "new", "@", "yourself"]
  8959. }),
  8960. $globals.SetTest);
  8961. $core.addMethod(
  8962. $core.method({
  8963. selector: "testAddAll",
  8964. protocol: 'tests',
  8965. fn: function (){
  8966. var self=this;
  8967. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8968. return $core.withContext(function($ctx1) {
  8969. //>>excludeEnd("ctx");
  8970. var $2,$3,$4,$1,$5,$7,$8,$9,$6,$10,$12,$11;
  8971. (
  8972. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8973. $ctx1.supercall = true,
  8974. //>>excludeEnd("ctx");
  8975. ($globals.SetTest.superclass||$boot.dnu).fn.prototype._testAddAll.apply($recv(self), []));
  8976. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8977. $ctx1.supercall = false;
  8978. //>>excludeEnd("ctx");;
  8979. $2=self._collection();
  8980. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8981. $ctx1.sendIdx["collection"]=1;
  8982. //>>excludeEnd("ctx");
  8983. $3=self._collection();
  8984. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8985. $ctx1.sendIdx["collection"]=2;
  8986. //>>excludeEnd("ctx");
  8987. $recv($2)._addAll_($3);
  8988. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8989. $ctx1.sendIdx["addAll:"]=1;
  8990. //>>excludeEnd("ctx");
  8991. $4=$recv($2)._yourself();
  8992. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8993. $ctx1.sendIdx["yourself"]=1;
  8994. //>>excludeEnd("ctx");
  8995. $1=$4;
  8996. $5=self._collection();
  8997. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8998. $ctx1.sendIdx["collection"]=3;
  8999. //>>excludeEnd("ctx");
  9000. self._assert_equals_($1,$5);
  9001. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9002. $ctx1.sendIdx["assert:equals:"]=1;
  9003. //>>excludeEnd("ctx");
  9004. $7=self._collection();
  9005. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9006. $ctx1.sendIdx["collection"]=4;
  9007. //>>excludeEnd("ctx");
  9008. $8=self._collectionWithNewValue();
  9009. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9010. $ctx1.sendIdx["collectionWithNewValue"]=1;
  9011. //>>excludeEnd("ctx");
  9012. $recv($7)._addAll_($8);
  9013. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9014. $ctx1.sendIdx["addAll:"]=2;
  9015. //>>excludeEnd("ctx");
  9016. $9=$recv($7)._yourself();
  9017. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9018. $ctx1.sendIdx["yourself"]=2;
  9019. //>>excludeEnd("ctx");
  9020. $6=$9;
  9021. $10=self._collectionWithNewValue();
  9022. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9023. $ctx1.sendIdx["collectionWithNewValue"]=2;
  9024. //>>excludeEnd("ctx");
  9025. self._assert_equals_($6,$10);
  9026. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9027. $ctx1.sendIdx["assert:equals:"]=2;
  9028. //>>excludeEnd("ctx");
  9029. $12=self._collectionWithNewValue();
  9030. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9031. $ctx1.sendIdx["collectionWithNewValue"]=3;
  9032. //>>excludeEnd("ctx");
  9033. $recv($12)._addAll_(self._collection());
  9034. $11=$recv($12)._yourself();
  9035. self._assert_equals_($11,self._collectionWithNewValue());
  9036. return self;
  9037. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9038. }, function($ctx1) {$ctx1.fill(self,"testAddAll",{},$globals.SetTest)});
  9039. //>>excludeEnd("ctx");
  9040. },
  9041. //>>excludeStart("ide", pragmas.excludeIdeData);
  9042. args: [],
  9043. 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",
  9044. referencedClasses: [],
  9045. //>>excludeEnd("ide");
  9046. messageSends: ["testAddAll", "assert:equals:", "addAll:", "collection", "yourself", "collectionWithNewValue"]
  9047. }),
  9048. $globals.SetTest);
  9049. $core.addMethod(
  9050. $core.method({
  9051. selector: "testAddRemove",
  9052. protocol: 'tests',
  9053. fn: function (){
  9054. var self=this;
  9055. var set;
  9056. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9057. return $core.withContext(function($ctx1) {
  9058. //>>excludeEnd("ctx");
  9059. var $1,$2;
  9060. set=$recv($globals.Set)._new();
  9061. self._assert_($recv(set)._isEmpty());
  9062. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9063. $ctx1.sendIdx["assert:"]=1;
  9064. //>>excludeEnd("ctx");
  9065. $recv(set)._add_((3));
  9066. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9067. $ctx1.sendIdx["add:"]=1;
  9068. //>>excludeEnd("ctx");
  9069. $1=$recv(set)._includes_((3));
  9070. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9071. $ctx1.sendIdx["includes:"]=1;
  9072. //>>excludeEnd("ctx");
  9073. self._assert_($1);
  9074. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9075. $ctx1.sendIdx["assert:"]=2;
  9076. //>>excludeEnd("ctx");
  9077. $recv(set)._add_((5));
  9078. $2=$recv(set)._includes_((5));
  9079. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9080. $ctx1.sendIdx["includes:"]=2;
  9081. //>>excludeEnd("ctx");
  9082. self._assert_($2);
  9083. $recv(set)._remove_((3));
  9084. self._deny_($recv(set)._includes_((3)));
  9085. return self;
  9086. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9087. }, function($ctx1) {$ctx1.fill(self,"testAddRemove",{set:set},$globals.SetTest)});
  9088. //>>excludeEnd("ctx");
  9089. },
  9090. //>>excludeStart("ide", pragmas.excludeIdeData);
  9091. args: [],
  9092. 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)",
  9093. referencedClasses: ["Set"],
  9094. //>>excludeEnd("ide");
  9095. messageSends: ["new", "assert:", "isEmpty", "add:", "includes:", "remove:", "deny:"]
  9096. }),
  9097. $globals.SetTest);
  9098. $core.addMethod(
  9099. $core.method({
  9100. selector: "testAt",
  9101. protocol: 'tests',
  9102. fn: function (){
  9103. var self=this;
  9104. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9105. return $core.withContext(function($ctx1) {
  9106. //>>excludeEnd("ctx");
  9107. self._should_raise_((function(){
  9108. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9109. return $core.withContext(function($ctx2) {
  9110. //>>excludeEnd("ctx");
  9111. return $recv($recv($globals.Set)._new())._at_put_((1),(2));
  9112. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9113. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  9114. //>>excludeEnd("ctx");
  9115. }),$globals.Error);
  9116. return self;
  9117. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9118. }, function($ctx1) {$ctx1.fill(self,"testAt",{},$globals.SetTest)});
  9119. //>>excludeEnd("ctx");
  9120. },
  9121. //>>excludeStart("ide", pragmas.excludeIdeData);
  9122. args: [],
  9123. source: "testAt\x0a\x09self should: [ Set new at: 1 put: 2 ] raise: Error",
  9124. referencedClasses: ["Set", "Error"],
  9125. //>>excludeEnd("ide");
  9126. messageSends: ["should:raise:", "at:put:", "new"]
  9127. }),
  9128. $globals.SetTest);
  9129. $core.addMethod(
  9130. $core.method({
  9131. selector: "testCollect",
  9132. protocol: 'tests',
  9133. fn: function (){
  9134. var self=this;
  9135. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9136. return $core.withContext(function($ctx1) {
  9137. //>>excludeEnd("ctx");
  9138. var $2,$1;
  9139. (
  9140. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9141. $ctx1.supercall = true,
  9142. //>>excludeEnd("ctx");
  9143. ($globals.SetTest.superclass||$boot.dnu).fn.prototype._testCollect.apply($recv(self), []));
  9144. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9145. $ctx1.supercall = false;
  9146. //>>excludeEnd("ctx");;
  9147. $2=[(5), (6), (8)]._asSet();
  9148. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9149. $ctx1.sendIdx["asSet"]=1;
  9150. //>>excludeEnd("ctx");
  9151. $1=$recv($2)._collect_((function(x){
  9152. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9153. return $core.withContext(function($ctx2) {
  9154. //>>excludeEnd("ctx");
  9155. return $recv(x).__backslash_backslash((3));
  9156. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9157. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)});
  9158. //>>excludeEnd("ctx");
  9159. }));
  9160. self._assert_equals_($1,[(0), (2)]._asSet());
  9161. return self;
  9162. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9163. }, function($ctx1) {$ctx1.fill(self,"testCollect",{},$globals.SetTest)});
  9164. //>>excludeEnd("ctx");
  9165. },
  9166. //>>excludeStart("ide", pragmas.excludeIdeData);
  9167. args: [],
  9168. source: "testCollect\x0a\x09super testCollect.\x0a\x09self assert: (#(5 6 8) asSet collect: [ :x | x \x5c\x5c 3 ]) equals: #(0 2) asSet",
  9169. referencedClasses: [],
  9170. //>>excludeEnd("ide");
  9171. messageSends: ["testCollect", "assert:equals:", "collect:", "asSet", "\x5c\x5c"]
  9172. }),
  9173. $globals.SetTest);
  9174. $core.addMethod(
  9175. $core.method({
  9176. selector: "testComma",
  9177. protocol: 'tests',
  9178. fn: function (){
  9179. var self=this;
  9180. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9181. return $core.withContext(function($ctx1) {
  9182. //>>excludeEnd("ctx");
  9183. var $2,$3,$1,$4,$6,$7,$5,$8,$10,$9;
  9184. (
  9185. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9186. $ctx1.supercall = true,
  9187. //>>excludeEnd("ctx");
  9188. ($globals.SetTest.superclass||$boot.dnu).fn.prototype._testComma.apply($recv(self), []));
  9189. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9190. $ctx1.supercall = false;
  9191. //>>excludeEnd("ctx");;
  9192. $2=self._collection();
  9193. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9194. $ctx1.sendIdx["collection"]=1;
  9195. //>>excludeEnd("ctx");
  9196. $3=self._collection();
  9197. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9198. $ctx1.sendIdx["collection"]=2;
  9199. //>>excludeEnd("ctx");
  9200. $1=$recv($2).__comma($3);
  9201. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9202. $ctx1.sendIdx[","]=1;
  9203. //>>excludeEnd("ctx");
  9204. $4=self._collection();
  9205. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9206. $ctx1.sendIdx["collection"]=3;
  9207. //>>excludeEnd("ctx");
  9208. self._assert_equals_($1,$4);
  9209. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9210. $ctx1.sendIdx["assert:equals:"]=1;
  9211. //>>excludeEnd("ctx");
  9212. $6=self._collection();
  9213. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9214. $ctx1.sendIdx["collection"]=4;
  9215. //>>excludeEnd("ctx");
  9216. $7=self._collectionWithNewValue();
  9217. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9218. $ctx1.sendIdx["collectionWithNewValue"]=1;
  9219. //>>excludeEnd("ctx");
  9220. $5=$recv($6).__comma($7);
  9221. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9222. $ctx1.sendIdx[","]=2;
  9223. //>>excludeEnd("ctx");
  9224. $8=self._collectionWithNewValue();
  9225. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9226. $ctx1.sendIdx["collectionWithNewValue"]=2;
  9227. //>>excludeEnd("ctx");
  9228. self._assert_equals_($5,$8);
  9229. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9230. $ctx1.sendIdx["assert:equals:"]=2;
  9231. //>>excludeEnd("ctx");
  9232. $10=self._collectionWithNewValue();
  9233. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9234. $ctx1.sendIdx["collectionWithNewValue"]=3;
  9235. //>>excludeEnd("ctx");
  9236. $9=$recv($10).__comma(self._collection());
  9237. self._assert_equals_($9,self._collectionWithNewValue());
  9238. return self;
  9239. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9240. }, function($ctx1) {$ctx1.fill(self,"testComma",{},$globals.SetTest)});
  9241. //>>excludeEnd("ctx");
  9242. },
  9243. //>>excludeStart("ide", pragmas.excludeIdeData);
  9244. args: [],
  9245. 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",
  9246. referencedClasses: [],
  9247. //>>excludeEnd("ide");
  9248. messageSends: ["testComma", "assert:equals:", ",", "collection", "collectionWithNewValue"]
  9249. }),
  9250. $globals.SetTest);
  9251. $core.addMethod(
  9252. $core.method({
  9253. selector: "testComparing",
  9254. protocol: 'tests',
  9255. fn: function (){
  9256. var self=this;
  9257. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9258. return $core.withContext(function($ctx1) {
  9259. //>>excludeEnd("ctx");
  9260. var $1,$2,$3,$4,$6,$7,$5,$9,$8;
  9261. $1=[(0), (2)]._asSet();
  9262. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9263. $ctx1.sendIdx["asSet"]=1;
  9264. //>>excludeEnd("ctx");
  9265. $2=[(0), (2)]._asSet();
  9266. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9267. $ctx1.sendIdx["asSet"]=2;
  9268. //>>excludeEnd("ctx");
  9269. self._assert_equals_($1,$2);
  9270. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9271. $ctx1.sendIdx["assert:equals:"]=1;
  9272. //>>excludeEnd("ctx");
  9273. $3=[(2), (0)]._asSet();
  9274. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9275. $ctx1.sendIdx["asSet"]=3;
  9276. //>>excludeEnd("ctx");
  9277. $4=[(0), (2)]._asSet();
  9278. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9279. $ctx1.sendIdx["asSet"]=4;
  9280. //>>excludeEnd("ctx");
  9281. self._assert_equals_($3,$4);
  9282. $6=[(0), (2), (3)]._asSet();
  9283. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9284. $ctx1.sendIdx["asSet"]=5;
  9285. //>>excludeEnd("ctx");
  9286. $7=[(0), (2)]._asSet();
  9287. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9288. $ctx1.sendIdx["asSet"]=6;
  9289. //>>excludeEnd("ctx");
  9290. $5=$recv($6).__eq($7);
  9291. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9292. $ctx1.sendIdx["="]=1;
  9293. //>>excludeEnd("ctx");
  9294. self._deny_($5);
  9295. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9296. $ctx1.sendIdx["deny:"]=1;
  9297. //>>excludeEnd("ctx");
  9298. $9=[(1), (2)]._asSet();
  9299. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9300. $ctx1.sendIdx["asSet"]=7;
  9301. //>>excludeEnd("ctx");
  9302. $8=$recv($9).__eq([(0), (2)]._asSet());
  9303. self._deny_($8);
  9304. return self;
  9305. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9306. }, function($ctx1) {$ctx1.fill(self,"testComparing",{},$globals.SetTest)});
  9307. //>>excludeEnd("ctx");
  9308. },
  9309. //>>excludeStart("ide", pragmas.excludeIdeData);
  9310. args: [],
  9311. 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",
  9312. referencedClasses: [],
  9313. //>>excludeEnd("ide");
  9314. messageSends: ["assert:equals:", "asSet", "deny:", "="]
  9315. }),
  9316. $globals.SetTest);
  9317. $core.addMethod(
  9318. $core.method({
  9319. selector: "testPrintString",
  9320. protocol: 'tests',
  9321. fn: function (){
  9322. var self=this;
  9323. var set;
  9324. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9325. return $core.withContext(function($ctx1) {
  9326. //>>excludeEnd("ctx");
  9327. var $1,$2,$3,$4,$5,$6,$7,$8;
  9328. set=$recv($globals.Set)._new();
  9329. $1=$recv(set)._printString();
  9330. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9331. $ctx1.sendIdx["printString"]=1;
  9332. //>>excludeEnd("ctx");
  9333. self._assert_equals_($1,"a Set ()");
  9334. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9335. $ctx1.sendIdx["assert:equals:"]=1;
  9336. //>>excludeEnd("ctx");
  9337. $2=set;
  9338. $recv($2)._add_((1));
  9339. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9340. $ctx1.sendIdx["add:"]=1;
  9341. //>>excludeEnd("ctx");
  9342. $3=$recv($2)._add_((3));
  9343. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9344. $ctx1.sendIdx["add:"]=2;
  9345. //>>excludeEnd("ctx");
  9346. $4=$recv(set)._printString();
  9347. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9348. $ctx1.sendIdx["printString"]=2;
  9349. //>>excludeEnd("ctx");
  9350. self._assert_equals_($4,"a Set (1 3)");
  9351. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9352. $ctx1.sendIdx["assert:equals:"]=2;
  9353. //>>excludeEnd("ctx");
  9354. $recv(set)._add_("foo");
  9355. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9356. $ctx1.sendIdx["add:"]=3;
  9357. //>>excludeEnd("ctx");
  9358. $5=$recv(set)._printString();
  9359. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9360. $ctx1.sendIdx["printString"]=3;
  9361. //>>excludeEnd("ctx");
  9362. self._assert_equals_($5,"a Set (1 3 'foo')");
  9363. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9364. $ctx1.sendIdx["assert:equals:"]=3;
  9365. //>>excludeEnd("ctx");
  9366. $6=set;
  9367. $recv($6)._remove_((1));
  9368. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9369. $ctx1.sendIdx["remove:"]=1;
  9370. //>>excludeEnd("ctx");
  9371. $recv($6)._remove_((3));
  9372. $7=$recv(set)._printString();
  9373. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9374. $ctx1.sendIdx["printString"]=4;
  9375. //>>excludeEnd("ctx");
  9376. self._assert_equals_($7,"a Set ('foo')");
  9377. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9378. $ctx1.sendIdx["assert:equals:"]=4;
  9379. //>>excludeEnd("ctx");
  9380. $recv(set)._add_((3));
  9381. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9382. $ctx1.sendIdx["add:"]=4;
  9383. //>>excludeEnd("ctx");
  9384. $8=$recv(set)._printString();
  9385. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9386. $ctx1.sendIdx["printString"]=5;
  9387. //>>excludeEnd("ctx");
  9388. self._assert_equals_($8,"a Set (3 'foo')");
  9389. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9390. $ctx1.sendIdx["assert:equals:"]=5;
  9391. //>>excludeEnd("ctx");
  9392. $recv(set)._add_((3));
  9393. self._assert_equals_($recv(set)._printString(),"a Set (3 'foo')");
  9394. return self;
  9395. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9396. }, function($ctx1) {$ctx1.fill(self,"testPrintString",{set:set},$globals.SetTest)});
  9397. //>>excludeEnd("ctx");
  9398. },
  9399. //>>excludeStart("ide", pragmas.excludeIdeData);
  9400. args: [],
  9401. 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'')'",
  9402. referencedClasses: ["Set"],
  9403. //>>excludeEnd("ide");
  9404. messageSends: ["new", "assert:equals:", "printString", "add:", "remove:"]
  9405. }),
  9406. $globals.SetTest);
  9407. $core.addMethod(
  9408. $core.method({
  9409. selector: "testUnboxedObjects",
  9410. protocol: 'tests',
  9411. fn: function (){
  9412. var self=this;
  9413. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9414. return $core.withContext(function($ctx1) {
  9415. //>>excludeEnd("ctx");
  9416. var $4,$3,$2,$1;
  9417. $4="foo"._yourself();
  9418. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9419. $ctx1.sendIdx["yourself"]=1;
  9420. //>>excludeEnd("ctx");
  9421. $3=[$4,"foo"._yourself()];
  9422. $2=$recv($3)._asSet();
  9423. $1=$recv($2)._asArray();
  9424. self._assert_equals_($1,["foo"]);
  9425. return self;
  9426. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9427. }, function($ctx1) {$ctx1.fill(self,"testUnboxedObjects",{},$globals.SetTest)});
  9428. //>>excludeEnd("ctx");
  9429. },
  9430. //>>excludeStart("ide", pragmas.excludeIdeData);
  9431. args: [],
  9432. source: "testUnboxedObjects\x0a\x09self assert: {'foo' yourself. 'foo' yourself} asSet asArray equals: #('foo')",
  9433. referencedClasses: [],
  9434. //>>excludeEnd("ide");
  9435. messageSends: ["assert:equals:", "asArray", "asSet", "yourself"]
  9436. }),
  9437. $globals.SetTest);
  9438. $core.addMethod(
  9439. $core.method({
  9440. selector: "testUnicity",
  9441. protocol: 'tests',
  9442. fn: function (){
  9443. var self=this;
  9444. var set;
  9445. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9446. return $core.withContext(function($ctx1) {
  9447. //>>excludeEnd("ctx");
  9448. var $1;
  9449. set=$recv($globals.Set)._new();
  9450. $recv(set)._add_((21));
  9451. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9452. $ctx1.sendIdx["add:"]=1;
  9453. //>>excludeEnd("ctx");
  9454. $recv(set)._add_("hello");
  9455. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9456. $ctx1.sendIdx["add:"]=2;
  9457. //>>excludeEnd("ctx");
  9458. $recv(set)._add_((21));
  9459. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9460. $ctx1.sendIdx["add:"]=3;
  9461. //>>excludeEnd("ctx");
  9462. $1=$recv(set)._size();
  9463. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9464. $ctx1.sendIdx["size"]=1;
  9465. //>>excludeEnd("ctx");
  9466. self._assert_equals_($1,(2));
  9467. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9468. $ctx1.sendIdx["assert:equals:"]=1;
  9469. //>>excludeEnd("ctx");
  9470. $recv(set)._add_("hello");
  9471. self._assert_equals_($recv(set)._size(),(2));
  9472. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9473. $ctx1.sendIdx["assert:equals:"]=2;
  9474. //>>excludeEnd("ctx");
  9475. self._assert_equals_($recv(set)._asArray(),[(21), "hello"]);
  9476. return self;
  9477. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9478. }, function($ctx1) {$ctx1.fill(self,"testUnicity",{set:set},$globals.SetTest)});
  9479. //>>excludeEnd("ctx");
  9480. },
  9481. //>>excludeStart("ide", pragmas.excludeIdeData);
  9482. args: [],
  9483. 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')",
  9484. referencedClasses: ["Set"],
  9485. //>>excludeEnd("ide");
  9486. messageSends: ["new", "add:", "assert:equals:", "size", "asArray"]
  9487. }),
  9488. $globals.SetTest);
  9489. $core.addMethod(
  9490. $core.method({
  9491. selector: "collectionClass",
  9492. protocol: 'fixture',
  9493. fn: function (){
  9494. var self=this;
  9495. return $globals.Set;
  9496. },
  9497. //>>excludeStart("ide", pragmas.excludeIdeData);
  9498. args: [],
  9499. source: "collectionClass\x0a\x09^ Set",
  9500. referencedClasses: ["Set"],
  9501. //>>excludeEnd("ide");
  9502. messageSends: []
  9503. }),
  9504. $globals.SetTest.klass);
  9505. $core.addClass('ConsoleTranscriptTest', $globals.TestCase, [], 'Kernel-Tests');
  9506. $core.addMethod(
  9507. $core.method({
  9508. selector: "testShow",
  9509. protocol: 'tests',
  9510. fn: function (){
  9511. var self=this;
  9512. var originalTranscript;
  9513. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9514. return $core.withContext(function($ctx1) {
  9515. //>>excludeEnd("ctx");
  9516. originalTranscript=$recv($globals.Transcript)._current();
  9517. $recv($globals.Transcript)._register_($recv($globals.ConsoleTranscript)._new());
  9518. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9519. $ctx1.sendIdx["register:"]=1;
  9520. //>>excludeEnd("ctx");
  9521. self._shouldnt_raise_((function(){
  9522. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9523. return $core.withContext(function($ctx2) {
  9524. //>>excludeEnd("ctx");
  9525. return $recv($globals.Transcript)._show_("Hello console!");
  9526. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9527. $ctx2.sendIdx["show:"]=1;
  9528. //>>excludeEnd("ctx");
  9529. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9530. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  9531. //>>excludeEnd("ctx");
  9532. }),$globals.Error);
  9533. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9534. $ctx1.sendIdx["shouldnt:raise:"]=1;
  9535. //>>excludeEnd("ctx");
  9536. self._shouldnt_raise_((function(){
  9537. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9538. return $core.withContext(function($ctx2) {
  9539. //>>excludeEnd("ctx");
  9540. return $recv($globals.Transcript)._show_(console);
  9541. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9542. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  9543. //>>excludeEnd("ctx");
  9544. }),$globals.Error);
  9545. $recv($globals.Transcript)._register_(originalTranscript);
  9546. return self;
  9547. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9548. }, function($ctx1) {$ctx1.fill(self,"testShow",{originalTranscript:originalTranscript},$globals.ConsoleTranscriptTest)});
  9549. //>>excludeEnd("ctx");
  9550. },
  9551. //>>excludeStart("ide", pragmas.excludeIdeData);
  9552. args: [],
  9553. 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.",
  9554. referencedClasses: ["Transcript", "ConsoleTranscript", "Error"],
  9555. //>>excludeEnd("ide");
  9556. messageSends: ["current", "register:", "new", "shouldnt:raise:", "show:"]
  9557. }),
  9558. $globals.ConsoleTranscriptTest);
  9559. $core.addClass('DateTest', $globals.TestCase, [], 'Kernel-Tests');
  9560. $core.addMethod(
  9561. $core.method({
  9562. selector: "testEquality",
  9563. protocol: 'tests',
  9564. fn: function (){
  9565. var self=this;
  9566. var now;
  9567. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9568. return $core.withContext(function($ctx1) {
  9569. //>>excludeEnd("ctx");
  9570. var $1,$3,$4,$2,$6,$7,$5,$9,$11,$10,$8;
  9571. now=$recv($globals.Date)._new();
  9572. $1=$recv(now).__eq(now);
  9573. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9574. $ctx1.sendIdx["="]=1;
  9575. //>>excludeEnd("ctx");
  9576. self._assert_($1);
  9577. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9578. $ctx1.sendIdx["assert:"]=1;
  9579. //>>excludeEnd("ctx");
  9580. $3=now;
  9581. $4=$recv($globals.Date)._fromMilliseconds_((0));
  9582. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9583. $ctx1.sendIdx["fromMilliseconds:"]=1;
  9584. //>>excludeEnd("ctx");
  9585. $2=$recv($3).__eq($4);
  9586. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9587. $ctx1.sendIdx["="]=2;
  9588. //>>excludeEnd("ctx");
  9589. self._deny_($2);
  9590. $6=$recv($globals.Date)._fromMilliseconds_((12345678));
  9591. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9592. $ctx1.sendIdx["fromMilliseconds:"]=2;
  9593. //>>excludeEnd("ctx");
  9594. $7=$recv($globals.Date)._fromMilliseconds_((12345678));
  9595. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9596. $ctx1.sendIdx["fromMilliseconds:"]=3;
  9597. //>>excludeEnd("ctx");
  9598. $5=$recv($6).__eq($7);
  9599. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9600. $ctx1.sendIdx["="]=3;
  9601. //>>excludeEnd("ctx");
  9602. self._assert_($5);
  9603. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9604. $ctx1.sendIdx["assert:"]=2;
  9605. //>>excludeEnd("ctx");
  9606. $9=now;
  9607. $11=$recv(now)._asMilliseconds();
  9608. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9609. $ctx1.sendIdx["asMilliseconds"]=1;
  9610. //>>excludeEnd("ctx");
  9611. $10=$recv($globals.Date)._fromMilliseconds_($11);
  9612. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9613. $ctx1.sendIdx["fromMilliseconds:"]=4;
  9614. //>>excludeEnd("ctx");
  9615. $8=$recv($9).__eq($10);
  9616. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9617. $ctx1.sendIdx["="]=4;
  9618. //>>excludeEnd("ctx");
  9619. self._assert_($8);
  9620. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9621. $ctx1.sendIdx["assert:"]=3;
  9622. //>>excludeEnd("ctx");
  9623. self._assert_($recv($recv($globals.Date)._fromMilliseconds_($recv(now)._asMilliseconds())).__eq(now));
  9624. return self;
  9625. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9626. }, function($ctx1) {$ctx1.fill(self,"testEquality",{now:now},$globals.DateTest)});
  9627. //>>excludeEnd("ctx");
  9628. },
  9629. //>>excludeStart("ide", pragmas.excludeIdeData);
  9630. args: [],
  9631. 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",
  9632. referencedClasses: ["Date"],
  9633. //>>excludeEnd("ide");
  9634. messageSends: ["new", "assert:", "=", "deny:", "fromMilliseconds:", "asMilliseconds"]
  9635. }),
  9636. $globals.DateTest);
  9637. $core.addMethod(
  9638. $core.method({
  9639. selector: "testIdentity",
  9640. protocol: 'tests',
  9641. fn: function (){
  9642. var self=this;
  9643. var now;
  9644. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9645. return $core.withContext(function($ctx1) {
  9646. //>>excludeEnd("ctx");
  9647. var $1,$3,$4,$2,$6,$7,$5,$9,$11,$10,$8;
  9648. now=$recv($globals.Date)._new();
  9649. $1=$recv(now).__eq_eq(now);
  9650. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9651. $ctx1.sendIdx["=="]=1;
  9652. //>>excludeEnd("ctx");
  9653. self._assert_($1);
  9654. $3=now;
  9655. $4=$recv($globals.Date)._fromMilliseconds_((0));
  9656. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9657. $ctx1.sendIdx["fromMilliseconds:"]=1;
  9658. //>>excludeEnd("ctx");
  9659. $2=$recv($3).__eq_eq($4);
  9660. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9661. $ctx1.sendIdx["=="]=2;
  9662. //>>excludeEnd("ctx");
  9663. self._deny_($2);
  9664. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9665. $ctx1.sendIdx["deny:"]=1;
  9666. //>>excludeEnd("ctx");
  9667. $6=$recv($globals.Date)._fromMilliseconds_((12345678));
  9668. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9669. $ctx1.sendIdx["fromMilliseconds:"]=2;
  9670. //>>excludeEnd("ctx");
  9671. $7=$recv($globals.Date)._fromMilliseconds_((12345678));
  9672. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9673. $ctx1.sendIdx["fromMilliseconds:"]=3;
  9674. //>>excludeEnd("ctx");
  9675. $5=$recv($6).__eq_eq($7);
  9676. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9677. $ctx1.sendIdx["=="]=3;
  9678. //>>excludeEnd("ctx");
  9679. self._deny_($5);
  9680. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9681. $ctx1.sendIdx["deny:"]=2;
  9682. //>>excludeEnd("ctx");
  9683. $9=now;
  9684. $11=$recv(now)._asMilliseconds();
  9685. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9686. $ctx1.sendIdx["asMilliseconds"]=1;
  9687. //>>excludeEnd("ctx");
  9688. $10=$recv($globals.Date)._fromMilliseconds_($11);
  9689. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9690. $ctx1.sendIdx["fromMilliseconds:"]=4;
  9691. //>>excludeEnd("ctx");
  9692. $8=$recv($9).__eq_eq($10);
  9693. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9694. $ctx1.sendIdx["=="]=4;
  9695. //>>excludeEnd("ctx");
  9696. self._deny_($8);
  9697. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9698. $ctx1.sendIdx["deny:"]=3;
  9699. //>>excludeEnd("ctx");
  9700. self._deny_($recv($recv($globals.Date)._fromMilliseconds_($recv(now)._asMilliseconds())).__eq_eq(now));
  9701. return self;
  9702. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9703. }, function($ctx1) {$ctx1.fill(self,"testIdentity",{now:now},$globals.DateTest)});
  9704. //>>excludeEnd("ctx");
  9705. },
  9706. //>>excludeStart("ide", pragmas.excludeIdeData);
  9707. args: [],
  9708. 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",
  9709. referencedClasses: ["Date"],
  9710. //>>excludeEnd("ide");
  9711. messageSends: ["new", "assert:", "==", "deny:", "fromMilliseconds:", "asMilliseconds"]
  9712. }),
  9713. $globals.DateTest);
  9714. $core.addClass('JSObjectProxyTest', $globals.TestCase, [], 'Kernel-Tests');
  9715. $core.addMethod(
  9716. $core.method({
  9717. selector: "jsNull",
  9718. protocol: 'accessing',
  9719. fn: function (){
  9720. var self=this;
  9721. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9722. return $core.withContext(function($ctx1) {
  9723. //>>excludeEnd("ctx");
  9724. return null;
  9725. return self;
  9726. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9727. }, function($ctx1) {$ctx1.fill(self,"jsNull",{},$globals.JSObjectProxyTest)});
  9728. //>>excludeEnd("ctx");
  9729. },
  9730. //>>excludeStart("ide", pragmas.excludeIdeData);
  9731. args: [],
  9732. source: "jsNull\x0a\x09<return null>",
  9733. referencedClasses: [],
  9734. //>>excludeEnd("ide");
  9735. messageSends: []
  9736. }),
  9737. $globals.JSObjectProxyTest);
  9738. $core.addMethod(
  9739. $core.method({
  9740. selector: "jsObject",
  9741. protocol: 'accessing',
  9742. fn: function (){
  9743. var self=this;
  9744. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9745. return $core.withContext(function($ctx1) {
  9746. //>>excludeEnd("ctx");
  9747. return {a: 1, b: function() {return 2;}, c: function(object) {return object;}, d: '', 'e': null, 'f': void 0};
  9748. return self;
  9749. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9750. }, function($ctx1) {$ctx1.fill(self,"jsObject",{},$globals.JSObjectProxyTest)});
  9751. //>>excludeEnd("ctx");
  9752. },
  9753. //>>excludeStart("ide", pragmas.excludeIdeData);
  9754. args: [],
  9755. source: "jsObject\x0a\x09<return {a: 1, b: function() {return 2;}, c: function(object) {return object;}, d: '', 'e': null, 'f': void 0}>",
  9756. referencedClasses: [],
  9757. //>>excludeEnd("ide");
  9758. messageSends: []
  9759. }),
  9760. $globals.JSObjectProxyTest);
  9761. $core.addMethod(
  9762. $core.method({
  9763. selector: "jsUndefined",
  9764. protocol: 'accessing',
  9765. fn: function (){
  9766. var self=this;
  9767. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9768. return $core.withContext(function($ctx1) {
  9769. //>>excludeEnd("ctx");
  9770. return;
  9771. return self;
  9772. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9773. }, function($ctx1) {$ctx1.fill(self,"jsUndefined",{},$globals.JSObjectProxyTest)});
  9774. //>>excludeEnd("ctx");
  9775. },
  9776. //>>excludeStart("ide", pragmas.excludeIdeData);
  9777. args: [],
  9778. source: "jsUndefined\x0a\x09<return>",
  9779. referencedClasses: [],
  9780. //>>excludeEnd("ide");
  9781. messageSends: []
  9782. }),
  9783. $globals.JSObjectProxyTest);
  9784. $core.addMethod(
  9785. $core.method({
  9786. selector: "testAtIfAbsent",
  9787. protocol: 'tests',
  9788. fn: function (){
  9789. var self=this;
  9790. var testObject;
  9791. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9792. return $core.withContext(function($ctx1) {
  9793. //>>excludeEnd("ctx");
  9794. var $1,$2,$3;
  9795. testObject=self._jsObject();
  9796. $1=$recv(testObject)._at_ifAbsent_("abc",(function(){
  9797. return "Property does not exist";
  9798. }));
  9799. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9800. $ctx1.sendIdx["at:ifAbsent:"]=1;
  9801. //>>excludeEnd("ctx");
  9802. self._assert_equals_($1,"Property does not exist");
  9803. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9804. $ctx1.sendIdx["assert:equals:"]=1;
  9805. //>>excludeEnd("ctx");
  9806. $2=$recv(testObject)._at_ifAbsent_("e",(function(){
  9807. return "Property does not exist";
  9808. }));
  9809. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9810. $ctx1.sendIdx["at:ifAbsent:"]=2;
  9811. //>>excludeEnd("ctx");
  9812. self._assert_equals_($2,nil);
  9813. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9814. $ctx1.sendIdx["assert:equals:"]=2;
  9815. //>>excludeEnd("ctx");
  9816. $3=$recv(testObject)._at_ifAbsent_("a",(function(){
  9817. return "Property does not exist";
  9818. }));
  9819. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9820. $ctx1.sendIdx["at:ifAbsent:"]=3;
  9821. //>>excludeEnd("ctx");
  9822. self._assert_equals_($3,(1));
  9823. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9824. $ctx1.sendIdx["assert:equals:"]=3;
  9825. //>>excludeEnd("ctx");
  9826. self._assert_equals_($recv(testObject)._at_ifAbsent_("f",(function(){
  9827. return "Property does not exist";
  9828. })),nil);
  9829. return self;
  9830. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9831. }, function($ctx1) {$ctx1.fill(self,"testAtIfAbsent",{testObject:testObject},$globals.JSObjectProxyTest)});
  9832. //>>excludeEnd("ctx");
  9833. },
  9834. //>>excludeStart("ide", pragmas.excludeIdeData);
  9835. args: [],
  9836. 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.",
  9837. referencedClasses: [],
  9838. //>>excludeEnd("ide");
  9839. messageSends: ["jsObject", "assert:equals:", "at:ifAbsent:"]
  9840. }),
  9841. $globals.JSObjectProxyTest);
  9842. $core.addMethod(
  9843. $core.method({
  9844. selector: "testAtIfPresent",
  9845. protocol: 'tests',
  9846. fn: function (){
  9847. var self=this;
  9848. var testObject;
  9849. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9850. return $core.withContext(function($ctx1) {
  9851. //>>excludeEnd("ctx");
  9852. var $2,$1,$4,$3,$6,$5;
  9853. testObject=self._jsObject();
  9854. $1=$recv(testObject)._at_ifPresent_("abc",(function(x){
  9855. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9856. return $core.withContext(function($ctx2) {
  9857. //>>excludeEnd("ctx");
  9858. $2=$recv(x)._asString();
  9859. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9860. $ctx2.sendIdx["asString"]=1;
  9861. //>>excludeEnd("ctx");
  9862. return "hello ".__comma($2);
  9863. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9864. $ctx2.sendIdx[","]=1;
  9865. //>>excludeEnd("ctx");
  9866. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9867. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)});
  9868. //>>excludeEnd("ctx");
  9869. }));
  9870. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9871. $ctx1.sendIdx["at:ifPresent:"]=1;
  9872. //>>excludeEnd("ctx");
  9873. self._assert_equals_($1,nil);
  9874. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9875. $ctx1.sendIdx["assert:equals:"]=1;
  9876. //>>excludeEnd("ctx");
  9877. $3=$recv(testObject)._at_ifPresent_("e",(function(x){
  9878. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9879. return $core.withContext(function($ctx2) {
  9880. //>>excludeEnd("ctx");
  9881. $4=$recv(x)._asString();
  9882. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9883. $ctx2.sendIdx["asString"]=2;
  9884. //>>excludeEnd("ctx");
  9885. return "hello ".__comma($4);
  9886. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9887. $ctx2.sendIdx[","]=2;
  9888. //>>excludeEnd("ctx");
  9889. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9890. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,2)});
  9891. //>>excludeEnd("ctx");
  9892. }));
  9893. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9894. $ctx1.sendIdx["at:ifPresent:"]=2;
  9895. //>>excludeEnd("ctx");
  9896. self._assert_equals_($3,"hello nil");
  9897. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9898. $ctx1.sendIdx["assert:equals:"]=2;
  9899. //>>excludeEnd("ctx");
  9900. $5=$recv(testObject)._at_ifPresent_("a",(function(x){
  9901. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9902. return $core.withContext(function($ctx2) {
  9903. //>>excludeEnd("ctx");
  9904. $6=$recv(x)._asString();
  9905. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9906. $ctx2.sendIdx["asString"]=3;
  9907. //>>excludeEnd("ctx");
  9908. return "hello ".__comma($6);
  9909. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9910. $ctx2.sendIdx[","]=3;
  9911. //>>excludeEnd("ctx");
  9912. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9913. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,3)});
  9914. //>>excludeEnd("ctx");
  9915. }));
  9916. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9917. $ctx1.sendIdx["at:ifPresent:"]=3;
  9918. //>>excludeEnd("ctx");
  9919. self._assert_equals_($5,"hello 1");
  9920. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9921. $ctx1.sendIdx["assert:equals:"]=3;
  9922. //>>excludeEnd("ctx");
  9923. self._assert_equals_($recv(testObject)._at_ifPresent_("f",(function(x){
  9924. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9925. return $core.withContext(function($ctx2) {
  9926. //>>excludeEnd("ctx");
  9927. return "hello ".__comma($recv(x)._asString());
  9928. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9929. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,4)});
  9930. //>>excludeEnd("ctx");
  9931. })),"hello nil");
  9932. return self;
  9933. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9934. }, function($ctx1) {$ctx1.fill(self,"testAtIfPresent",{testObject:testObject},$globals.JSObjectProxyTest)});
  9935. //>>excludeEnd("ctx");
  9936. },
  9937. //>>excludeStart("ide", pragmas.excludeIdeData);
  9938. args: [],
  9939. 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'.",
  9940. referencedClasses: [],
  9941. //>>excludeEnd("ide");
  9942. messageSends: ["jsObject", "assert:equals:", "at:ifPresent:", ",", "asString"]
  9943. }),
  9944. $globals.JSObjectProxyTest);
  9945. $core.addMethod(
  9946. $core.method({
  9947. selector: "testAtIfPresentIfAbsent",
  9948. protocol: 'tests',
  9949. fn: function (){
  9950. var self=this;
  9951. var testObject;
  9952. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9953. return $core.withContext(function($ctx1) {
  9954. //>>excludeEnd("ctx");
  9955. var $2,$1,$4,$3,$6,$5;
  9956. testObject=self._jsObject();
  9957. $1=$recv(testObject)._at_ifPresent_ifAbsent_("abc",(function(x){
  9958. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9959. return $core.withContext(function($ctx2) {
  9960. //>>excludeEnd("ctx");
  9961. $2=$recv(x)._asString();
  9962. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9963. $ctx2.sendIdx["asString"]=1;
  9964. //>>excludeEnd("ctx");
  9965. return "hello ".__comma($2);
  9966. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9967. $ctx2.sendIdx[","]=1;
  9968. //>>excludeEnd("ctx");
  9969. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9970. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)});
  9971. //>>excludeEnd("ctx");
  9972. }),(function(){
  9973. return "not present";
  9974. }));
  9975. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9976. $ctx1.sendIdx["at:ifPresent:ifAbsent:"]=1;
  9977. //>>excludeEnd("ctx");
  9978. self._assert_equals_($1,"not present");
  9979. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9980. $ctx1.sendIdx["assert:equals:"]=1;
  9981. //>>excludeEnd("ctx");
  9982. $3=$recv(testObject)._at_ifPresent_ifAbsent_("e",(function(x){
  9983. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9984. return $core.withContext(function($ctx2) {
  9985. //>>excludeEnd("ctx");
  9986. $4=$recv(x)._asString();
  9987. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9988. $ctx2.sendIdx["asString"]=2;
  9989. //>>excludeEnd("ctx");
  9990. return "hello ".__comma($4);
  9991. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9992. $ctx2.sendIdx[","]=2;
  9993. //>>excludeEnd("ctx");
  9994. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9995. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,3)});
  9996. //>>excludeEnd("ctx");
  9997. }),(function(){
  9998. return "not present";
  9999. }));
  10000. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10001. $ctx1.sendIdx["at:ifPresent:ifAbsent:"]=2;
  10002. //>>excludeEnd("ctx");
  10003. self._assert_equals_($3,"hello nil");
  10004. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10005. $ctx1.sendIdx["assert:equals:"]=2;
  10006. //>>excludeEnd("ctx");
  10007. $5=$recv(testObject)._at_ifPresent_ifAbsent_("a",(function(x){
  10008. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10009. return $core.withContext(function($ctx2) {
  10010. //>>excludeEnd("ctx");
  10011. $6=$recv(x)._asString();
  10012. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10013. $ctx2.sendIdx["asString"]=3;
  10014. //>>excludeEnd("ctx");
  10015. return "hello ".__comma($6);
  10016. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10017. $ctx2.sendIdx[","]=3;
  10018. //>>excludeEnd("ctx");
  10019. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10020. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,5)});
  10021. //>>excludeEnd("ctx");
  10022. }),(function(){
  10023. return "not present";
  10024. }));
  10025. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10026. $ctx1.sendIdx["at:ifPresent:ifAbsent:"]=3;
  10027. //>>excludeEnd("ctx");
  10028. self._assert_equals_($5,"hello 1");
  10029. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10030. $ctx1.sendIdx["assert:equals:"]=3;
  10031. //>>excludeEnd("ctx");
  10032. self._assert_equals_($recv(testObject)._at_ifPresent_ifAbsent_("f",(function(x){
  10033. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10034. return $core.withContext(function($ctx2) {
  10035. //>>excludeEnd("ctx");
  10036. return "hello ".__comma($recv(x)._asString());
  10037. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10038. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,7)});
  10039. //>>excludeEnd("ctx");
  10040. }),(function(){
  10041. return "not present";
  10042. })),"hello nil");
  10043. return self;
  10044. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10045. }, function($ctx1) {$ctx1.fill(self,"testAtIfPresentIfAbsent",{testObject:testObject},$globals.JSObjectProxyTest)});
  10046. //>>excludeEnd("ctx");
  10047. },
  10048. //>>excludeStart("ide", pragmas.excludeIdeData);
  10049. args: [],
  10050. 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'.",
  10051. referencedClasses: [],
  10052. //>>excludeEnd("ide");
  10053. messageSends: ["jsObject", "assert:equals:", "at:ifPresent:ifAbsent:", ",", "asString"]
  10054. }),
  10055. $globals.JSObjectProxyTest);
  10056. $core.addMethod(
  10057. $core.method({
  10058. selector: "testAtPut",
  10059. protocol: 'tests',
  10060. fn: function (){
  10061. var self=this;
  10062. var testObject;
  10063. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10064. return $core.withContext(function($ctx1) {
  10065. //>>excludeEnd("ctx");
  10066. var $2,$1;
  10067. testObject=self._jsObject();
  10068. $2=$recv(testObject)._at_("abc");
  10069. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10070. $ctx1.sendIdx["at:"]=1;
  10071. //>>excludeEnd("ctx");
  10072. $1=$recv($2).__tild_eq("xyz");
  10073. self._assert_($1);
  10074. self._assert_equals_($recv(testObject)._at_put_("abc","xyz"),"xyz");
  10075. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10076. $ctx1.sendIdx["assert:equals:"]=1;
  10077. //>>excludeEnd("ctx");
  10078. self._assert_equals_($recv(testObject)._at_("abc"),"xyz");
  10079. return self;
  10080. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10081. }, function($ctx1) {$ctx1.fill(self,"testAtPut",{testObject:testObject},$globals.JSObjectProxyTest)});
  10082. //>>excludeEnd("ctx");
  10083. },
  10084. //>>excludeStart("ide", pragmas.excludeIdeData);
  10085. args: [],
  10086. 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'",
  10087. referencedClasses: [],
  10088. //>>excludeEnd("ide");
  10089. messageSends: ["jsObject", "assert:", "~=", "at:", "assert:equals:", "at:put:"]
  10090. }),
  10091. $globals.JSObjectProxyTest);
  10092. $core.addMethod(
  10093. $core.method({
  10094. selector: "testComparison",
  10095. protocol: 'tests',
  10096. fn: function (){
  10097. var self=this;
  10098. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10099. return $core.withContext(function($ctx1) {
  10100. //>>excludeEnd("ctx");
  10101. var $1,$2;
  10102. self._assert_equals_($recv([console,(2)])._indexOf_(console),(1));
  10103. $1=$recv(console).__eq(console);
  10104. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10105. $ctx1.sendIdx["="]=1;
  10106. //>>excludeEnd("ctx");
  10107. self._assert_($1);
  10108. $2=$recv(console).__eq($recv($globals.Object)._new());
  10109. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10110. $ctx1.sendIdx["="]=2;
  10111. //>>excludeEnd("ctx");
  10112. self._deny_($2);
  10113. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10114. $ctx1.sendIdx["deny:"]=1;
  10115. //>>excludeEnd("ctx");
  10116. self._deny_($recv(console).__eq(self._jsObject()));
  10117. return self;
  10118. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10119. }, function($ctx1) {$ctx1.fill(self,"testComparison",{},$globals.JSObjectProxyTest)});
  10120. //>>excludeEnd("ctx");
  10121. },
  10122. //>>excludeStart("ide", pragmas.excludeIdeData);
  10123. args: [],
  10124. 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",
  10125. referencedClasses: ["Object"],
  10126. //>>excludeEnd("ide");
  10127. messageSends: ["assert:equals:", "indexOf:", "assert:", "=", "deny:", "new", "jsObject"]
  10128. }),
  10129. $globals.JSObjectProxyTest);
  10130. $core.addMethod(
  10131. $core.method({
  10132. selector: "testDNU",
  10133. protocol: 'tests',
  10134. fn: function (){
  10135. var self=this;
  10136. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10137. return $core.withContext(function($ctx1) {
  10138. //>>excludeEnd("ctx");
  10139. self._should_raise_((function(){
  10140. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10141. return $core.withContext(function($ctx2) {
  10142. //>>excludeEnd("ctx");
  10143. return $recv(self._jsObject())._foo();
  10144. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10145. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  10146. //>>excludeEnd("ctx");
  10147. }),$globals.MessageNotUnderstood);
  10148. return self;
  10149. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10150. }, function($ctx1) {$ctx1.fill(self,"testDNU",{},$globals.JSObjectProxyTest)});
  10151. //>>excludeEnd("ctx");
  10152. },
  10153. //>>excludeStart("ide", pragmas.excludeIdeData);
  10154. args: [],
  10155. source: "testDNU\x0a\x09self should: [ self jsObject foo ] raise: MessageNotUnderstood",
  10156. referencedClasses: ["MessageNotUnderstood"],
  10157. //>>excludeEnd("ide");
  10158. messageSends: ["should:raise:", "foo", "jsObject"]
  10159. }),
  10160. $globals.JSObjectProxyTest);
  10161. $core.addMethod(
  10162. $core.method({
  10163. selector: "testDNURegression1057",
  10164. protocol: 'tests',
  10165. fn: function (){
  10166. var self=this;
  10167. var jsObject;
  10168. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10169. return $core.withContext(function($ctx1) {
  10170. //>>excludeEnd("ctx");
  10171. var $1;
  10172. jsObject=[];
  10173. $recv(jsObject)._basicAt_put_("allowJavaScriptCalls",true);
  10174. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10175. $ctx1.sendIdx["basicAt:put:"]=1;
  10176. //>>excludeEnd("ctx");
  10177. $recv(jsObject)._basicAt_put_("foo",(3));
  10178. self._shouldnt_raise_((function(){
  10179. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10180. return $core.withContext(function($ctx2) {
  10181. //>>excludeEnd("ctx");
  10182. return $recv(jsObject)._foo();
  10183. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10184. $ctx2.sendIdx["foo"]=1;
  10185. //>>excludeEnd("ctx");
  10186. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10187. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  10188. //>>excludeEnd("ctx");
  10189. }),$globals.Error);
  10190. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10191. $ctx1.sendIdx["shouldnt:raise:"]=1;
  10192. //>>excludeEnd("ctx");
  10193. $1=$recv(jsObject)._foo();
  10194. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10195. $ctx1.sendIdx["foo"]=2;
  10196. //>>excludeEnd("ctx");
  10197. self._assert_equals_($1,(3));
  10198. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10199. $ctx1.sendIdx["assert:equals:"]=1;
  10200. //>>excludeEnd("ctx");
  10201. self._shouldnt_raise_((function(){
  10202. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10203. return $core.withContext(function($ctx2) {
  10204. //>>excludeEnd("ctx");
  10205. return $recv(jsObject)._foo_((4));
  10206. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10207. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  10208. //>>excludeEnd("ctx");
  10209. }),$globals.Error);
  10210. self._assert_equals_($recv(jsObject)._foo(),(4));
  10211. return self;
  10212. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10213. }, function($ctx1) {$ctx1.fill(self,"testDNURegression1057",{jsObject:jsObject},$globals.JSObjectProxyTest)});
  10214. //>>excludeEnd("ctx");
  10215. },
  10216. //>>excludeStart("ide", pragmas.excludeIdeData);
  10217. args: [],
  10218. source: "testDNURegression1057\x0a\x09| jsObject |\x0a\x09jsObject := #().\x0a\x09jsObject basicAt: 'allowJavaScriptCalls' put: true.\x0a\x09jsObject basicAt: 'foo' put: 3.\x0a\x09self shouldnt: [ jsObject foo ] raise: Error.\x0a\x09self assert: jsObject foo equals: 3.\x0a\x09self shouldnt: [ jsObject foo: 4 ] raise: Error.\x0a\x09self assert: jsObject foo equals: 4",
  10219. referencedClasses: ["Error"],
  10220. //>>excludeEnd("ide");
  10221. messageSends: ["basicAt:put:", "shouldnt:raise:", "foo", "assert:equals:", "foo:"]
  10222. }),
  10223. $globals.JSObjectProxyTest);
  10224. $core.addMethod(
  10225. $core.method({
  10226. selector: "testDNURegression1059",
  10227. protocol: 'tests',
  10228. fn: function (){
  10229. var self=this;
  10230. var jsObject;
  10231. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10232. return $core.withContext(function($ctx1) {
  10233. //>>excludeEnd("ctx");
  10234. jsObject=[];
  10235. $recv(jsObject)._basicAt_put_("allowJavaScriptCalls",true);
  10236. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10237. $ctx1.sendIdx["basicAt:put:"]=1;
  10238. //>>excludeEnd("ctx");
  10239. $recv(jsObject)._basicAt_put_("x",(3));
  10240. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10241. $ctx1.sendIdx["basicAt:put:"]=2;
  10242. //>>excludeEnd("ctx");
  10243. $recv(jsObject)._basicAt_put_("x:",(function(){
  10244. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10245. return $core.withContext(function($ctx2) {
  10246. //>>excludeEnd("ctx");
  10247. return self._error();
  10248. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10249. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  10250. //>>excludeEnd("ctx");
  10251. }));
  10252. self._shouldnt_raise_((function(){
  10253. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10254. return $core.withContext(function($ctx2) {
  10255. //>>excludeEnd("ctx");
  10256. return $recv(jsObject)._x_((4));
  10257. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10258. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  10259. //>>excludeEnd("ctx");
  10260. }),$globals.Error);
  10261. self._assert_equals_($recv(jsObject)._x(),(4));
  10262. return self;
  10263. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10264. }, function($ctx1) {$ctx1.fill(self,"testDNURegression1059",{jsObject:jsObject},$globals.JSObjectProxyTest)});
  10265. //>>excludeEnd("ctx");
  10266. },
  10267. //>>excludeStart("ide", pragmas.excludeIdeData);
  10268. args: [],
  10269. source: "testDNURegression1059\x0a\x09| jsObject |\x0a\x09jsObject := #().\x0a\x09jsObject basicAt: 'allowJavaScriptCalls' put: true.\x0a\x09jsObject basicAt: 'x' put: 3.\x0a\x09jsObject basicAt: 'x:' put: [ self error ].\x0a\x09self shouldnt: [ jsObject x: 4 ] raise: Error.\x0a\x09self assert: jsObject x equals: 4",
  10270. referencedClasses: ["Error"],
  10271. //>>excludeEnd("ide");
  10272. messageSends: ["basicAt:put:", "error", "shouldnt:raise:", "x:", "assert:equals:", "x"]
  10273. }),
  10274. $globals.JSObjectProxyTest);
  10275. $core.addMethod(
  10276. $core.method({
  10277. selector: "testDNURegression1062",
  10278. protocol: 'tests',
  10279. fn: function (){
  10280. var self=this;
  10281. var jsObject,stored;
  10282. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10283. return $core.withContext(function($ctx1) {
  10284. //>>excludeEnd("ctx");
  10285. jsObject=[];
  10286. $recv(jsObject)._basicAt_put_("allowJavaScriptCalls",true);
  10287. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10288. $ctx1.sendIdx["basicAt:put:"]=1;
  10289. //>>excludeEnd("ctx");
  10290. $recv(jsObject)._basicAt_put_("x",(function(v){
  10291. stored=v;
  10292. return stored;
  10293. }));
  10294. self._shouldnt_raise_((function(){
  10295. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10296. return $core.withContext(function($ctx2) {
  10297. //>>excludeEnd("ctx");
  10298. return $recv(jsObject)._x_((4));
  10299. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10300. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  10301. //>>excludeEnd("ctx");
  10302. }),$globals.Error);
  10303. self._assert_equals_(stored,(4));
  10304. return self;
  10305. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10306. }, function($ctx1) {$ctx1.fill(self,"testDNURegression1062",{jsObject:jsObject,stored:stored},$globals.JSObjectProxyTest)});
  10307. //>>excludeEnd("ctx");
  10308. },
  10309. //>>excludeStart("ide", pragmas.excludeIdeData);
  10310. args: [],
  10311. source: "testDNURegression1062\x0a\x09| jsObject stored |\x0a\x09jsObject := #().\x0a\x09jsObject basicAt: 'allowJavaScriptCalls' put: true.\x0a\x09jsObject basicAt: 'x' put: [ :v | stored := v ].\x0a\x09self shouldnt: [ jsObject x: 4 ] raise: Error.\x0a\x09self assert: stored equals: 4",
  10312. referencedClasses: ["Error"],
  10313. //>>excludeEnd("ide");
  10314. messageSends: ["basicAt:put:", "shouldnt:raise:", "x:", "assert:equals:"]
  10315. }),
  10316. $globals.JSObjectProxyTest);
  10317. $core.addMethod(
  10318. $core.method({
  10319. selector: "testDNUWithAllowJavaScriptCalls",
  10320. protocol: 'tests',
  10321. fn: function (){
  10322. var self=this;
  10323. var jsObject;
  10324. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10325. return $core.withContext(function($ctx1) {
  10326. //>>excludeEnd("ctx");
  10327. jsObject=[];
  10328. $recv(jsObject)._basicAt_put_("allowJavaScriptCalls",true);
  10329. self._should_raise_((function(){
  10330. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10331. return $core.withContext(function($ctx2) {
  10332. //>>excludeEnd("ctx");
  10333. return $recv(jsObject)._foo();
  10334. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10335. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  10336. //>>excludeEnd("ctx");
  10337. }),$globals.MessageNotUnderstood);
  10338. return self;
  10339. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10340. }, function($ctx1) {$ctx1.fill(self,"testDNUWithAllowJavaScriptCalls",{jsObject:jsObject},$globals.JSObjectProxyTest)});
  10341. //>>excludeEnd("ctx");
  10342. },
  10343. //>>excludeStart("ide", pragmas.excludeIdeData);
  10344. args: [],
  10345. source: "testDNUWithAllowJavaScriptCalls\x0a\x09| jsObject |\x0a\x09jsObject := #().\x0a\x09jsObject basicAt: 'allowJavaScriptCalls' put: true.\x0a\x09self should: [ jsObject foo ] raise: MessageNotUnderstood",
  10346. referencedClasses: ["MessageNotUnderstood"],
  10347. //>>excludeEnd("ide");
  10348. messageSends: ["basicAt:put:", "should:raise:", "foo"]
  10349. }),
  10350. $globals.JSObjectProxyTest);
  10351. $core.addMethod(
  10352. $core.method({
  10353. selector: "testMessageSend",
  10354. protocol: 'tests',
  10355. fn: function (){
  10356. var self=this;
  10357. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10358. return $core.withContext(function($ctx1) {
  10359. //>>excludeEnd("ctx");
  10360. var $2,$1,$4,$3;
  10361. $2=self._jsObject();
  10362. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10363. $ctx1.sendIdx["jsObject"]=1;
  10364. //>>excludeEnd("ctx");
  10365. $1=$recv($2)._a();
  10366. self._assert_equals_($1,(1));
  10367. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10368. $ctx1.sendIdx["assert:equals:"]=1;
  10369. //>>excludeEnd("ctx");
  10370. $4=self._jsObject();
  10371. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10372. $ctx1.sendIdx["jsObject"]=2;
  10373. //>>excludeEnd("ctx");
  10374. $3=$recv($4)._b();
  10375. self._assert_equals_($3,(2));
  10376. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10377. $ctx1.sendIdx["assert:equals:"]=2;
  10378. //>>excludeEnd("ctx");
  10379. self._assert_equals_($recv(self._jsObject())._c_((3)),(3));
  10380. return self;
  10381. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10382. }, function($ctx1) {$ctx1.fill(self,"testMessageSend",{},$globals.JSObjectProxyTest)});
  10383. //>>excludeEnd("ctx");
  10384. },
  10385. //>>excludeStart("ide", pragmas.excludeIdeData);
  10386. args: [],
  10387. 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",
  10388. referencedClasses: [],
  10389. //>>excludeEnd("ide");
  10390. messageSends: ["assert:equals:", "a", "jsObject", "b", "c:"]
  10391. }),
  10392. $globals.JSObjectProxyTest);
  10393. $core.addMethod(
  10394. $core.method({
  10395. selector: "testMethodWithArguments",
  10396. protocol: 'tests',
  10397. fn: function (){
  10398. var self=this;
  10399. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10400. return $core.withContext(function($ctx1) {
  10401. //>>excludeEnd("ctx");
  10402. self._assert_equals_($recv(self._jsObject())._c_((1)),(1));
  10403. return self;
  10404. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10405. }, function($ctx1) {$ctx1.fill(self,"testMethodWithArguments",{},$globals.JSObjectProxyTest)});
  10406. //>>excludeEnd("ctx");
  10407. },
  10408. //>>excludeStart("ide", pragmas.excludeIdeData);
  10409. args: [],
  10410. source: "testMethodWithArguments\x0a\x09self assert: (self jsObject c: 1) equals: 1",
  10411. referencedClasses: [],
  10412. //>>excludeEnd("ide");
  10413. messageSends: ["assert:equals:", "c:", "jsObject"]
  10414. }),
  10415. $globals.JSObjectProxyTest);
  10416. $core.addMethod(
  10417. $core.method({
  10418. selector: "testPrinting",
  10419. protocol: 'tests',
  10420. fn: function (){
  10421. var self=this;
  10422. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10423. return $core.withContext(function($ctx1) {
  10424. //>>excludeEnd("ctx");
  10425. self._assert_equals_($recv(self._jsObject())._printString(),"[object Object]");
  10426. return self;
  10427. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10428. }, function($ctx1) {$ctx1.fill(self,"testPrinting",{},$globals.JSObjectProxyTest)});
  10429. //>>excludeEnd("ctx");
  10430. },
  10431. //>>excludeStart("ide", pragmas.excludeIdeData);
  10432. args: [],
  10433. source: "testPrinting\x0a\x09self assert: self jsObject printString equals: '[object Object]'",
  10434. referencedClasses: [],
  10435. //>>excludeEnd("ide");
  10436. messageSends: ["assert:equals:", "printString", "jsObject"]
  10437. }),
  10438. $globals.JSObjectProxyTest);
  10439. $core.addMethod(
  10440. $core.method({
  10441. selector: "testPropertyThatReturnsEmptyString",
  10442. protocol: 'tests',
  10443. fn: function (){
  10444. var self=this;
  10445. var object;
  10446. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10447. return $core.withContext(function($ctx1) {
  10448. //>>excludeEnd("ctx");
  10449. var $1;
  10450. object=self._jsObject();
  10451. $1=$recv(object)._d();
  10452. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10453. $ctx1.sendIdx["d"]=1;
  10454. //>>excludeEnd("ctx");
  10455. self._assert_equals_($1,"");
  10456. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10457. $ctx1.sendIdx["assert:equals:"]=1;
  10458. //>>excludeEnd("ctx");
  10459. $recv(object)._d_("hello");
  10460. self._assert_equals_($recv(object)._d(),"hello");
  10461. return self;
  10462. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10463. }, function($ctx1) {$ctx1.fill(self,"testPropertyThatReturnsEmptyString",{object:object},$globals.JSObjectProxyTest)});
  10464. //>>excludeEnd("ctx");
  10465. },
  10466. //>>excludeStart("ide", pragmas.excludeIdeData);
  10467. args: [],
  10468. 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'",
  10469. referencedClasses: [],
  10470. //>>excludeEnd("ide");
  10471. messageSends: ["jsObject", "assert:equals:", "d", "d:"]
  10472. }),
  10473. $globals.JSObjectProxyTest);
  10474. $core.addMethod(
  10475. $core.method({
  10476. selector: "testPropertyThatReturnsUndefined",
  10477. protocol: 'tests',
  10478. fn: function (){
  10479. var self=this;
  10480. var object;
  10481. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10482. return $core.withContext(function($ctx1) {
  10483. //>>excludeEnd("ctx");
  10484. object=self._jsObject();
  10485. self._shouldnt_raise_((function(){
  10486. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10487. return $core.withContext(function($ctx2) {
  10488. //>>excludeEnd("ctx");
  10489. return $recv(object)._e();
  10490. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10491. $ctx2.sendIdx["e"]=1;
  10492. //>>excludeEnd("ctx");
  10493. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10494. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  10495. //>>excludeEnd("ctx");
  10496. }),$globals.MessageNotUnderstood);
  10497. self._assert_($recv($recv(object)._e())._isNil());
  10498. return self;
  10499. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10500. }, function($ctx1) {$ctx1.fill(self,"testPropertyThatReturnsUndefined",{object:object},$globals.JSObjectProxyTest)});
  10501. //>>excludeEnd("ctx");
  10502. },
  10503. //>>excludeStart("ide", pragmas.excludeIdeData);
  10504. args: [],
  10505. source: "testPropertyThatReturnsUndefined\x0a\x09| object |\x0a\x0a\x09object := self jsObject.\x0a\x09self shouldnt: [ object e ] raise: MessageNotUnderstood.\x0a\x09self assert: object e isNil",
  10506. referencedClasses: ["MessageNotUnderstood"],
  10507. //>>excludeEnd("ide");
  10508. messageSends: ["jsObject", "shouldnt:raise:", "e", "assert:", "isNil"]
  10509. }),
  10510. $globals.JSObjectProxyTest);
  10511. $core.addMethod(
  10512. $core.method({
  10513. selector: "testSetPropertyWithFalsyValue",
  10514. protocol: 'tests',
  10515. fn: function (){
  10516. var self=this;
  10517. var jsObject;
  10518. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10519. return $core.withContext(function($ctx1) {
  10520. //>>excludeEnd("ctx");
  10521. var $1,$2,$3,$4,$5;
  10522. jsObject=self._jsObject();
  10523. $1=$recv(jsObject)._a();
  10524. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10525. $ctx1.sendIdx["a"]=1;
  10526. //>>excludeEnd("ctx");
  10527. self._assert_equals_($1,(1));
  10528. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10529. $ctx1.sendIdx["assert:equals:"]=1;
  10530. //>>excludeEnd("ctx");
  10531. $recv(jsObject)._a_(self._jsNull());
  10532. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10533. $ctx1.sendIdx["a:"]=1;
  10534. //>>excludeEnd("ctx");
  10535. $2=$recv(jsObject)._a();
  10536. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10537. $ctx1.sendIdx["a"]=2;
  10538. //>>excludeEnd("ctx");
  10539. self._assert_equals_($2,nil);
  10540. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10541. $ctx1.sendIdx["assert:equals:"]=2;
  10542. //>>excludeEnd("ctx");
  10543. $recv(jsObject)._a_((0));
  10544. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10545. $ctx1.sendIdx["a:"]=2;
  10546. //>>excludeEnd("ctx");
  10547. $3=$recv(jsObject)._a();
  10548. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10549. $ctx1.sendIdx["a"]=3;
  10550. //>>excludeEnd("ctx");
  10551. self._assert_equals_($3,(0));
  10552. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10553. $ctx1.sendIdx["assert:equals:"]=3;
  10554. //>>excludeEnd("ctx");
  10555. $recv(jsObject)._a_(self._jsUndefined());
  10556. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10557. $ctx1.sendIdx["a:"]=3;
  10558. //>>excludeEnd("ctx");
  10559. $4=$recv(jsObject)._a();
  10560. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10561. $ctx1.sendIdx["a"]=4;
  10562. //>>excludeEnd("ctx");
  10563. self._assert_equals_($4,nil);
  10564. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10565. $ctx1.sendIdx["assert:equals:"]=4;
  10566. //>>excludeEnd("ctx");
  10567. $recv(jsObject)._a_("");
  10568. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10569. $ctx1.sendIdx["a:"]=4;
  10570. //>>excludeEnd("ctx");
  10571. $5=$recv(jsObject)._a();
  10572. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10573. $ctx1.sendIdx["a"]=5;
  10574. //>>excludeEnd("ctx");
  10575. self._assert_equals_($5,"");
  10576. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10577. $ctx1.sendIdx["assert:equals:"]=5;
  10578. //>>excludeEnd("ctx");
  10579. $recv(jsObject)._a_(false);
  10580. self._assert_equals_($recv(jsObject)._a(),false);
  10581. return self;
  10582. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10583. }, function($ctx1) {$ctx1.fill(self,"testSetPropertyWithFalsyValue",{jsObject:jsObject},$globals.JSObjectProxyTest)});
  10584. //>>excludeEnd("ctx");
  10585. },
  10586. //>>excludeStart("ide", pragmas.excludeIdeData);
  10587. args: [],
  10588. 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",
  10589. referencedClasses: [],
  10590. //>>excludeEnd("ide");
  10591. messageSends: ["jsObject", "assert:equals:", "a", "a:", "jsNull", "jsUndefined"]
  10592. }),
  10593. $globals.JSObjectProxyTest);
  10594. $core.addMethod(
  10595. $core.method({
  10596. selector: "testValue",
  10597. protocol: 'tests',
  10598. fn: function (){
  10599. var self=this;
  10600. var testObject;
  10601. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10602. return $core.withContext(function($ctx1) {
  10603. //>>excludeEnd("ctx");
  10604. testObject=self._jsObject();
  10605. $recv(testObject)._at_put_("value","aValue");
  10606. self._assert_equals_($recv(testObject)._value(),"aValue");
  10607. return self;
  10608. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10609. }, function($ctx1) {$ctx1.fill(self,"testValue",{testObject:testObject},$globals.JSObjectProxyTest)});
  10610. //>>excludeEnd("ctx");
  10611. },
  10612. //>>excludeStart("ide", pragmas.excludeIdeData);
  10613. args: [],
  10614. source: "testValue\x0a\x09| testObject |\x0a\x09testObject := self jsObject.\x0a\x09testObject at: 'value' put: 'aValue'.\x0a\x09self assert: testObject value equals: 'aValue'",
  10615. referencedClasses: [],
  10616. //>>excludeEnd("ide");
  10617. messageSends: ["jsObject", "at:put:", "assert:equals:", "value"]
  10618. }),
  10619. $globals.JSObjectProxyTest);
  10620. $core.addMethod(
  10621. $core.method({
  10622. selector: "testYourself",
  10623. protocol: 'tests',
  10624. fn: function (){
  10625. var self=this;
  10626. var object;
  10627. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10628. return $core.withContext(function($ctx1) {
  10629. //>>excludeEnd("ctx");
  10630. var $1;
  10631. $1=self._jsObject();
  10632. $recv($1)._d_("test");
  10633. object=$recv($1)._yourself();
  10634. self._assert_equals_($recv(object)._d(),"test");
  10635. return self;
  10636. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10637. }, function($ctx1) {$ctx1.fill(self,"testYourself",{object:object},$globals.JSObjectProxyTest)});
  10638. //>>excludeEnd("ctx");
  10639. },
  10640. //>>excludeStart("ide", pragmas.excludeIdeData);
  10641. args: [],
  10642. source: "testYourself\x0a\x09| object |\x0a\x09object := self jsObject\x0a\x09\x09d: 'test';\x0a\x09\x09yourself.\x0a\x0a\x09self assert: object d equals: 'test'",
  10643. referencedClasses: [],
  10644. //>>excludeEnd("ide");
  10645. messageSends: ["d:", "jsObject", "yourself", "assert:equals:", "d"]
  10646. }),
  10647. $globals.JSObjectProxyTest);
  10648. $core.addClass('JavaScriptExceptionTest', $globals.TestCase, [], 'Kernel-Tests');
  10649. $core.addMethod(
  10650. $core.method({
  10651. selector: "testCatchingException",
  10652. protocol: 'tests',
  10653. fn: function (){
  10654. var self=this;
  10655. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10656. return $core.withContext(function($ctx1) {
  10657. //>>excludeEnd("ctx");
  10658. $recv((function(){
  10659. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10660. return $core.withContext(function($ctx2) {
  10661. //>>excludeEnd("ctx");
  10662. return self._throwException();
  10663. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10664. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  10665. //>>excludeEnd("ctx");
  10666. }))._on_do_($globals.Error,(function(error){
  10667. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10668. return $core.withContext(function($ctx2) {
  10669. //>>excludeEnd("ctx");
  10670. return self._assert_($recv($recv(error)._exception()).__eq("test"));
  10671. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10672. }, function($ctx2) {$ctx2.fillBlock({error:error},$ctx1,2)});
  10673. //>>excludeEnd("ctx");
  10674. }));
  10675. return self;
  10676. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10677. }, function($ctx1) {$ctx1.fill(self,"testCatchingException",{},$globals.JavaScriptExceptionTest)});
  10678. //>>excludeEnd("ctx");
  10679. },
  10680. //>>excludeStart("ide", pragmas.excludeIdeData);
  10681. args: [],
  10682. source: "testCatchingException\x0a\x09[ self throwException ]\x0a\x09\x09on: Error\x0a\x09\x09do: [ :error |\x0a\x09\x09\x09self assert: error exception = 'test' ]",
  10683. referencedClasses: ["Error"],
  10684. //>>excludeEnd("ide");
  10685. messageSends: ["on:do:", "throwException", "assert:", "=", "exception"]
  10686. }),
  10687. $globals.JavaScriptExceptionTest);
  10688. $core.addMethod(
  10689. $core.method({
  10690. selector: "testRaisingException",
  10691. protocol: 'tests',
  10692. fn: function (){
  10693. var self=this;
  10694. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10695. return $core.withContext(function($ctx1) {
  10696. //>>excludeEnd("ctx");
  10697. self._should_raise_((function(){
  10698. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10699. return $core.withContext(function($ctx2) {
  10700. //>>excludeEnd("ctx");
  10701. return self._throwException();
  10702. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10703. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  10704. //>>excludeEnd("ctx");
  10705. }),$globals.JavaScriptException);
  10706. return self;
  10707. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10708. }, function($ctx1) {$ctx1.fill(self,"testRaisingException",{},$globals.JavaScriptExceptionTest)});
  10709. //>>excludeEnd("ctx");
  10710. },
  10711. //>>excludeStart("ide", pragmas.excludeIdeData);
  10712. args: [],
  10713. source: "testRaisingException\x0a\x09self should: [ self throwException ] raise: JavaScriptException",
  10714. referencedClasses: ["JavaScriptException"],
  10715. //>>excludeEnd("ide");
  10716. messageSends: ["should:raise:", "throwException"]
  10717. }),
  10718. $globals.JavaScriptExceptionTest);
  10719. $core.addMethod(
  10720. $core.method({
  10721. selector: "throwException",
  10722. protocol: 'helpers',
  10723. fn: function (){
  10724. var self=this;
  10725. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10726. return $core.withContext(function($ctx1) {
  10727. //>>excludeEnd("ctx");
  10728. throw 'test';
  10729. return self;
  10730. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10731. }, function($ctx1) {$ctx1.fill(self,"throwException",{},$globals.JavaScriptExceptionTest)});
  10732. //>>excludeEnd("ctx");
  10733. },
  10734. //>>excludeStart("ide", pragmas.excludeIdeData);
  10735. args: [],
  10736. source: "throwException\x0a\x09<throw 'test'>",
  10737. referencedClasses: [],
  10738. //>>excludeEnd("ide");
  10739. messageSends: []
  10740. }),
  10741. $globals.JavaScriptExceptionTest);
  10742. $core.addClass('MessageSendTest', $globals.TestCase, [], 'Kernel-Tests');
  10743. $core.addMethod(
  10744. $core.method({
  10745. selector: "testValue",
  10746. protocol: 'tests',
  10747. fn: function (){
  10748. var self=this;
  10749. var messageSend;
  10750. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10751. return $core.withContext(function($ctx1) {
  10752. //>>excludeEnd("ctx");
  10753. var $1;
  10754. $1=$recv($globals.MessageSend)._new();
  10755. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10756. $ctx1.sendIdx["new"]=1;
  10757. //>>excludeEnd("ctx");
  10758. $recv($1)._receiver_($recv($globals.Object)._new());
  10759. $recv($1)._selector_("asString");
  10760. messageSend=$recv($1)._yourself();
  10761. self._assert_equals_($recv(messageSend)._value(),"an Object");
  10762. return self;
  10763. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10764. }, function($ctx1) {$ctx1.fill(self,"testValue",{messageSend:messageSend},$globals.MessageSendTest)});
  10765. //>>excludeEnd("ctx");
  10766. },
  10767. //>>excludeStart("ide", pragmas.excludeIdeData);
  10768. args: [],
  10769. 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'",
  10770. referencedClasses: ["MessageSend", "Object"],
  10771. //>>excludeEnd("ide");
  10772. messageSends: ["receiver:", "new", "selector:", "yourself", "assert:equals:", "value"]
  10773. }),
  10774. $globals.MessageSendTest);
  10775. $core.addMethod(
  10776. $core.method({
  10777. selector: "testValueWithArguments",
  10778. protocol: 'tests',
  10779. fn: function (){
  10780. var self=this;
  10781. var messageSend;
  10782. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10783. return $core.withContext(function($ctx1) {
  10784. //>>excludeEnd("ctx");
  10785. var $1;
  10786. $1=$recv($globals.MessageSend)._new();
  10787. $recv($1)._receiver_((2));
  10788. $recv($1)._selector_("+");
  10789. messageSend=$recv($1)._yourself();
  10790. self._assert_equals_($recv(messageSend)._value_((3)),(5));
  10791. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10792. $ctx1.sendIdx["assert:equals:"]=1;
  10793. //>>excludeEnd("ctx");
  10794. self._assert_equals_($recv(messageSend)._valueWithPossibleArguments_([(4)]),(6));
  10795. return self;
  10796. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10797. }, function($ctx1) {$ctx1.fill(self,"testValueWithArguments",{messageSend:messageSend},$globals.MessageSendTest)});
  10798. //>>excludeEnd("ctx");
  10799. },
  10800. //>>excludeStart("ide", pragmas.excludeIdeData);
  10801. args: [],
  10802. 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",
  10803. referencedClasses: ["MessageSend"],
  10804. //>>excludeEnd("ide");
  10805. messageSends: ["receiver:", "new", "selector:", "yourself", "assert:equals:", "value:", "valueWithPossibleArguments:"]
  10806. }),
  10807. $globals.MessageSendTest);
  10808. $core.addClass('MethodInheritanceTest', $globals.TestCase, ['receiverTop', 'receiverMiddle', 'receiverBottom', 'method', 'performBlock'], 'Kernel-Tests');
  10809. $core.addMethod(
  10810. $core.method({
  10811. selector: "codeGeneratorClass",
  10812. protocol: 'accessing',
  10813. fn: function (){
  10814. var self=this;
  10815. return $globals.CodeGenerator;
  10816. },
  10817. //>>excludeStart("ide", pragmas.excludeIdeData);
  10818. args: [],
  10819. source: "codeGeneratorClass\x0a\x09^ CodeGenerator",
  10820. referencedClasses: ["CodeGenerator"],
  10821. //>>excludeEnd("ide");
  10822. messageSends: []
  10823. }),
  10824. $globals.MethodInheritanceTest);
  10825. $core.addMethod(
  10826. $core.method({
  10827. selector: "compiler",
  10828. protocol: 'factory',
  10829. fn: function (){
  10830. var self=this;
  10831. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10832. return $core.withContext(function($ctx1) {
  10833. //>>excludeEnd("ctx");
  10834. var $1;
  10835. $1=$recv($globals.Compiler)._new();
  10836. $recv($1)._codeGeneratorClass_(self._codeGeneratorClass());
  10837. return $recv($1)._yourself();
  10838. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10839. }, function($ctx1) {$ctx1.fill(self,"compiler",{},$globals.MethodInheritanceTest)});
  10840. //>>excludeEnd("ctx");
  10841. },
  10842. //>>excludeStart("ide", pragmas.excludeIdeData);
  10843. args: [],
  10844. source: "compiler\x0a\x09^ Compiler new\x0a\x09\x09codeGeneratorClass: self codeGeneratorClass;\x0a\x09\x09yourself",
  10845. referencedClasses: ["Compiler"],
  10846. //>>excludeEnd("ide");
  10847. messageSends: ["codeGeneratorClass:", "new", "codeGeneratorClass", "yourself"]
  10848. }),
  10849. $globals.MethodInheritanceTest);
  10850. $core.addMethod(
  10851. $core.method({
  10852. selector: "deinstallBottom",
  10853. protocol: 'testing',
  10854. fn: function (){
  10855. var self=this;
  10856. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10857. return $core.withContext(function($ctx1) {
  10858. //>>excludeEnd("ctx");
  10859. $recv(self._targetClassBottom())._removeCompiledMethod_(self["@method"]);
  10860. return self;
  10861. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10862. }, function($ctx1) {$ctx1.fill(self,"deinstallBottom",{},$globals.MethodInheritanceTest)});
  10863. //>>excludeEnd("ctx");
  10864. },
  10865. //>>excludeStart("ide", pragmas.excludeIdeData);
  10866. args: [],
  10867. source: "deinstallBottom\x0a\x09self targetClassBottom removeCompiledMethod: method",
  10868. referencedClasses: [],
  10869. //>>excludeEnd("ide");
  10870. messageSends: ["removeCompiledMethod:", "targetClassBottom"]
  10871. }),
  10872. $globals.MethodInheritanceTest);
  10873. $core.addMethod(
  10874. $core.method({
  10875. selector: "deinstallMiddle",
  10876. protocol: 'testing',
  10877. fn: function (){
  10878. var self=this;
  10879. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10880. return $core.withContext(function($ctx1) {
  10881. //>>excludeEnd("ctx");
  10882. $recv(self._targetClassMiddle())._removeCompiledMethod_(self["@method"]);
  10883. return self;
  10884. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10885. }, function($ctx1) {$ctx1.fill(self,"deinstallMiddle",{},$globals.MethodInheritanceTest)});
  10886. //>>excludeEnd("ctx");
  10887. },
  10888. //>>excludeStart("ide", pragmas.excludeIdeData);
  10889. args: [],
  10890. source: "deinstallMiddle\x0a\x09self targetClassMiddle removeCompiledMethod: method",
  10891. referencedClasses: [],
  10892. //>>excludeEnd("ide");
  10893. messageSends: ["removeCompiledMethod:", "targetClassMiddle"]
  10894. }),
  10895. $globals.MethodInheritanceTest);
  10896. $core.addMethod(
  10897. $core.method({
  10898. selector: "deinstallTop",
  10899. protocol: 'testing',
  10900. fn: function (){
  10901. var self=this;
  10902. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10903. return $core.withContext(function($ctx1) {
  10904. //>>excludeEnd("ctx");
  10905. $recv(self._targetClassTop())._removeCompiledMethod_(self["@method"]);
  10906. return self;
  10907. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10908. }, function($ctx1) {$ctx1.fill(self,"deinstallTop",{},$globals.MethodInheritanceTest)});
  10909. //>>excludeEnd("ctx");
  10910. },
  10911. //>>excludeStart("ide", pragmas.excludeIdeData);
  10912. args: [],
  10913. source: "deinstallTop\x0a\x09self targetClassTop removeCompiledMethod: method",
  10914. referencedClasses: [],
  10915. //>>excludeEnd("ide");
  10916. messageSends: ["removeCompiledMethod:", "targetClassTop"]
  10917. }),
  10918. $globals.MethodInheritanceTest);
  10919. $core.addMethod(
  10920. $core.method({
  10921. selector: "installBottom:",
  10922. protocol: 'testing',
  10923. fn: function (aString){
  10924. var self=this;
  10925. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10926. return $core.withContext(function($ctx1) {
  10927. //>>excludeEnd("ctx");
  10928. self["@method"]=$recv(self._compiler())._install_forClass_protocol_(aString,self._targetClassBottom(),"tests");
  10929. return self;
  10930. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10931. }, function($ctx1) {$ctx1.fill(self,"installBottom:",{aString:aString},$globals.MethodInheritanceTest)});
  10932. //>>excludeEnd("ctx");
  10933. },
  10934. //>>excludeStart("ide", pragmas.excludeIdeData);
  10935. args: ["aString"],
  10936. source: "installBottom: aString\x0a\x09method := self compiler install: aString forClass: self targetClassBottom protocol: 'tests'",
  10937. referencedClasses: [],
  10938. //>>excludeEnd("ide");
  10939. messageSends: ["install:forClass:protocol:", "compiler", "targetClassBottom"]
  10940. }),
  10941. $globals.MethodInheritanceTest);
  10942. $core.addMethod(
  10943. $core.method({
  10944. selector: "installMiddle:",
  10945. protocol: 'testing',
  10946. fn: function (aString){
  10947. var self=this;
  10948. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10949. return $core.withContext(function($ctx1) {
  10950. //>>excludeEnd("ctx");
  10951. self["@method"]=$recv(self._compiler())._install_forClass_protocol_(aString,self._targetClassMiddle(),"tests");
  10952. return self;
  10953. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10954. }, function($ctx1) {$ctx1.fill(self,"installMiddle:",{aString:aString},$globals.MethodInheritanceTest)});
  10955. //>>excludeEnd("ctx");
  10956. },
  10957. //>>excludeStart("ide", pragmas.excludeIdeData);
  10958. args: ["aString"],
  10959. source: "installMiddle: aString\x0a\x09method := self compiler install: aString forClass: self targetClassMiddle protocol: 'tests'",
  10960. referencedClasses: [],
  10961. //>>excludeEnd("ide");
  10962. messageSends: ["install:forClass:protocol:", "compiler", "targetClassMiddle"]
  10963. }),
  10964. $globals.MethodInheritanceTest);
  10965. $core.addMethod(
  10966. $core.method({
  10967. selector: "installTop:",
  10968. protocol: 'testing',
  10969. fn: function (aString){
  10970. var self=this;
  10971. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10972. return $core.withContext(function($ctx1) {
  10973. //>>excludeEnd("ctx");
  10974. self["@method"]=$recv(self._compiler())._install_forClass_protocol_(aString,self._targetClassTop(),"tests");
  10975. return self;
  10976. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10977. }, function($ctx1) {$ctx1.fill(self,"installTop:",{aString:aString},$globals.MethodInheritanceTest)});
  10978. //>>excludeEnd("ctx");
  10979. },
  10980. //>>excludeStart("ide", pragmas.excludeIdeData);
  10981. args: ["aString"],
  10982. source: "installTop: aString\x0a\x09method := self compiler install: aString forClass: self targetClassTop protocol: 'tests'",
  10983. referencedClasses: [],
  10984. //>>excludeEnd("ide");
  10985. messageSends: ["install:forClass:protocol:", "compiler", "targetClassTop"]
  10986. }),
  10987. $globals.MethodInheritanceTest);
  10988. $core.addMethod(
  10989. $core.method({
  10990. selector: "setUp",
  10991. protocol: 'initialization',
  10992. fn: function (){
  10993. var self=this;
  10994. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10995. return $core.withContext(function($ctx1) {
  10996. //>>excludeEnd("ctx");
  10997. self["@receiverTop"]=$recv(self._targetClassTop())._new();
  10998. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10999. $ctx1.sendIdx["new"]=1;
  11000. //>>excludeEnd("ctx");
  11001. self["@receiverMiddle"]=$recv(self._targetClassMiddle())._new();
  11002. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11003. $ctx1.sendIdx["new"]=2;
  11004. //>>excludeEnd("ctx");
  11005. self["@receiverBottom"]=$recv(self._targetClassBottom())._new();
  11006. self["@method"]=nil;
  11007. self["@performBlock"]=(function(){
  11008. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11009. return $core.withContext(function($ctx2) {
  11010. //>>excludeEnd("ctx");
  11011. return self._error_("performBlock not initialized");
  11012. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11013. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  11014. //>>excludeEnd("ctx");
  11015. });
  11016. return self;
  11017. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11018. }, function($ctx1) {$ctx1.fill(self,"setUp",{},$globals.MethodInheritanceTest)});
  11019. //>>excludeEnd("ctx");
  11020. },
  11021. //>>excludeStart("ide", pragmas.excludeIdeData);
  11022. args: [],
  11023. 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' ]",
  11024. referencedClasses: [],
  11025. //>>excludeEnd("ide");
  11026. messageSends: ["new", "targetClassTop", "targetClassMiddle", "targetClassBottom", "error:"]
  11027. }),
  11028. $globals.MethodInheritanceTest);
  11029. $core.addMethod(
  11030. $core.method({
  11031. selector: "shouldMNU",
  11032. protocol: 'testing',
  11033. fn: function (){
  11034. var self=this;
  11035. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11036. return $core.withContext(function($ctx1) {
  11037. //>>excludeEnd("ctx");
  11038. self._shouldMNUTop();
  11039. self._shouldMNUMiddle();
  11040. self._shouldMNUBottom();
  11041. return self;
  11042. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11043. }, function($ctx1) {$ctx1.fill(self,"shouldMNU",{},$globals.MethodInheritanceTest)});
  11044. //>>excludeEnd("ctx");
  11045. },
  11046. //>>excludeStart("ide", pragmas.excludeIdeData);
  11047. args: [],
  11048. source: "shouldMNU\x0a\x09self shouldMNUTop.\x0a\x09self shouldMNUMiddle.\x0a\x09self shouldMNUBottom",
  11049. referencedClasses: [],
  11050. //>>excludeEnd("ide");
  11051. messageSends: ["shouldMNUTop", "shouldMNUMiddle", "shouldMNUBottom"]
  11052. }),
  11053. $globals.MethodInheritanceTest);
  11054. $core.addMethod(
  11055. $core.method({
  11056. selector: "shouldMNUBottom",
  11057. protocol: 'testing',
  11058. fn: function (){
  11059. var self=this;
  11060. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11061. return $core.withContext(function($ctx1) {
  11062. //>>excludeEnd("ctx");
  11063. self._should_raise_((function(){
  11064. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11065. return $core.withContext(function($ctx2) {
  11066. //>>excludeEnd("ctx");
  11067. return $recv(self["@performBlock"])._value_(self["@receiverBottom"]);
  11068. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11069. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  11070. //>>excludeEnd("ctx");
  11071. }),$globals.MessageNotUnderstood);
  11072. return self;
  11073. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11074. }, function($ctx1) {$ctx1.fill(self,"shouldMNUBottom",{},$globals.MethodInheritanceTest)});
  11075. //>>excludeEnd("ctx");
  11076. },
  11077. //>>excludeStart("ide", pragmas.excludeIdeData);
  11078. args: [],
  11079. source: "shouldMNUBottom\x0a\x09self should: [ performBlock value: receiverBottom ] raise: MessageNotUnderstood",
  11080. referencedClasses: ["MessageNotUnderstood"],
  11081. //>>excludeEnd("ide");
  11082. messageSends: ["should:raise:", "value:"]
  11083. }),
  11084. $globals.MethodInheritanceTest);
  11085. $core.addMethod(
  11086. $core.method({
  11087. selector: "shouldMNUMiddle",
  11088. protocol: 'testing',
  11089. fn: function (){
  11090. var self=this;
  11091. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11092. return $core.withContext(function($ctx1) {
  11093. //>>excludeEnd("ctx");
  11094. self._should_raise_((function(){
  11095. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11096. return $core.withContext(function($ctx2) {
  11097. //>>excludeEnd("ctx");
  11098. return $recv(self["@performBlock"])._value_(self["@receiverMiddle"]);
  11099. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11100. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  11101. //>>excludeEnd("ctx");
  11102. }),$globals.MessageNotUnderstood);
  11103. return self;
  11104. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11105. }, function($ctx1) {$ctx1.fill(self,"shouldMNUMiddle",{},$globals.MethodInheritanceTest)});
  11106. //>>excludeEnd("ctx");
  11107. },
  11108. //>>excludeStart("ide", pragmas.excludeIdeData);
  11109. args: [],
  11110. source: "shouldMNUMiddle\x0a\x09self should: [ performBlock value: receiverMiddle ] raise: MessageNotUnderstood",
  11111. referencedClasses: ["MessageNotUnderstood"],
  11112. //>>excludeEnd("ide");
  11113. messageSends: ["should:raise:", "value:"]
  11114. }),
  11115. $globals.MethodInheritanceTest);
  11116. $core.addMethod(
  11117. $core.method({
  11118. selector: "shouldMNUTop",
  11119. protocol: 'testing',
  11120. fn: function (){
  11121. var self=this;
  11122. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11123. return $core.withContext(function($ctx1) {
  11124. //>>excludeEnd("ctx");
  11125. self._should_raise_((function(){
  11126. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11127. return $core.withContext(function($ctx2) {
  11128. //>>excludeEnd("ctx");
  11129. return $recv(self["@performBlock"])._value_(self["@receiverTop"]);
  11130. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11131. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  11132. //>>excludeEnd("ctx");
  11133. }),$globals.MessageNotUnderstood);
  11134. return self;
  11135. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11136. }, function($ctx1) {$ctx1.fill(self,"shouldMNUTop",{},$globals.MethodInheritanceTest)});
  11137. //>>excludeEnd("ctx");
  11138. },
  11139. //>>excludeStart("ide", pragmas.excludeIdeData);
  11140. args: [],
  11141. source: "shouldMNUTop\x0a\x09self should: [ performBlock value: receiverTop ] raise: MessageNotUnderstood",
  11142. referencedClasses: ["MessageNotUnderstood"],
  11143. //>>excludeEnd("ide");
  11144. messageSends: ["should:raise:", "value:"]
  11145. }),
  11146. $globals.MethodInheritanceTest);
  11147. $core.addMethod(
  11148. $core.method({
  11149. selector: "shouldReturn:",
  11150. protocol: 'testing',
  11151. fn: function (anObject){
  11152. var self=this;
  11153. var result;
  11154. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11155. return $core.withContext(function($ctx1) {
  11156. //>>excludeEnd("ctx");
  11157. result=$recv(self["@performBlock"])._value_(self["@receiverTop"]);
  11158. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11159. $ctx1.sendIdx["value:"]=1;
  11160. //>>excludeEnd("ctx");
  11161. self._assert_equals_(["top",anObject],["top",result]);
  11162. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11163. $ctx1.sendIdx["assert:equals:"]=1;
  11164. //>>excludeEnd("ctx");
  11165. result=$recv(self["@performBlock"])._value_(self["@receiverMiddle"]);
  11166. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11167. $ctx1.sendIdx["value:"]=2;
  11168. //>>excludeEnd("ctx");
  11169. self._assert_equals_(["middle",anObject],["middle",result]);
  11170. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11171. $ctx1.sendIdx["assert:equals:"]=2;
  11172. //>>excludeEnd("ctx");
  11173. result=$recv(self["@performBlock"])._value_(self["@receiverBottom"]);
  11174. self._assert_equals_(["bottom",anObject],["bottom",result]);
  11175. return self;
  11176. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11177. }, function($ctx1) {$ctx1.fill(self,"shouldReturn:",{anObject:anObject,result:result},$globals.MethodInheritanceTest)});
  11178. //>>excludeEnd("ctx");
  11179. },
  11180. //>>excludeStart("ide", pragmas.excludeIdeData);
  11181. args: ["anObject"],
  11182. 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 }",
  11183. referencedClasses: [],
  11184. //>>excludeEnd("ide");
  11185. messageSends: ["value:", "assert:equals:"]
  11186. }),
  11187. $globals.MethodInheritanceTest);
  11188. $core.addMethod(
  11189. $core.method({
  11190. selector: "shouldReturn:and:and:",
  11191. protocol: 'testing',
  11192. fn: function (anObject,anObject2,anObject3){
  11193. var self=this;
  11194. var result;
  11195. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11196. return $core.withContext(function($ctx1) {
  11197. //>>excludeEnd("ctx");
  11198. result=$recv(self["@performBlock"])._value_(self["@receiverTop"]);
  11199. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11200. $ctx1.sendIdx["value:"]=1;
  11201. //>>excludeEnd("ctx");
  11202. self._assert_equals_(["top",anObject],["top",result]);
  11203. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11204. $ctx1.sendIdx["assert:equals:"]=1;
  11205. //>>excludeEnd("ctx");
  11206. result=$recv(self["@performBlock"])._value_(self["@receiverMiddle"]);
  11207. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11208. $ctx1.sendIdx["value:"]=2;
  11209. //>>excludeEnd("ctx");
  11210. self._assert_equals_(["middle",anObject2],["middle",result]);
  11211. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11212. $ctx1.sendIdx["assert:equals:"]=2;
  11213. //>>excludeEnd("ctx");
  11214. result=$recv(self["@performBlock"])._value_(self["@receiverBottom"]);
  11215. self._assert_equals_(["bottom",anObject3],["bottom",result]);
  11216. return self;
  11217. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11218. }, function($ctx1) {$ctx1.fill(self,"shouldReturn:and:and:",{anObject:anObject,anObject2:anObject2,anObject3:anObject3,result:result},$globals.MethodInheritanceTest)});
  11219. //>>excludeEnd("ctx");
  11220. },
  11221. //>>excludeStart("ide", pragmas.excludeIdeData);
  11222. args: ["anObject", "anObject2", "anObject3"],
  11223. 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 }",
  11224. referencedClasses: [],
  11225. //>>excludeEnd("ide");
  11226. messageSends: ["value:", "assert:equals:"]
  11227. }),
  11228. $globals.MethodInheritanceTest);
  11229. $core.addMethod(
  11230. $core.method({
  11231. selector: "targetClassBottom",
  11232. protocol: 'accessing',
  11233. fn: function (){
  11234. var self=this;
  11235. return $globals.JavaScriptException;
  11236. },
  11237. //>>excludeStart("ide", pragmas.excludeIdeData);
  11238. args: [],
  11239. source: "targetClassBottom\x0a\x09^ JavaScriptException",
  11240. referencedClasses: ["JavaScriptException"],
  11241. //>>excludeEnd("ide");
  11242. messageSends: []
  11243. }),
  11244. $globals.MethodInheritanceTest);
  11245. $core.addMethod(
  11246. $core.method({
  11247. selector: "targetClassMiddle",
  11248. protocol: 'accessing',
  11249. fn: function (){
  11250. var self=this;
  11251. return $globals.Error;
  11252. },
  11253. //>>excludeStart("ide", pragmas.excludeIdeData);
  11254. args: [],
  11255. source: "targetClassMiddle\x0a\x09^ Error",
  11256. referencedClasses: ["Error"],
  11257. //>>excludeEnd("ide");
  11258. messageSends: []
  11259. }),
  11260. $globals.MethodInheritanceTest);
  11261. $core.addMethod(
  11262. $core.method({
  11263. selector: "targetClassTop",
  11264. protocol: 'accessing',
  11265. fn: function (){
  11266. var self=this;
  11267. return $globals.Object;
  11268. },
  11269. //>>excludeStart("ide", pragmas.excludeIdeData);
  11270. args: [],
  11271. source: "targetClassTop\x0a\x09^ Object",
  11272. referencedClasses: ["Object"],
  11273. //>>excludeEnd("ide");
  11274. messageSends: []
  11275. }),
  11276. $globals.MethodInheritanceTest);
  11277. $core.addMethod(
  11278. $core.method({
  11279. selector: "tearDown",
  11280. protocol: 'initialization',
  11281. fn: function (){
  11282. var self=this;
  11283. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11284. return $core.withContext(function($ctx1) {
  11285. //>>excludeEnd("ctx");
  11286. $recv((function(){
  11287. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11288. return $core.withContext(function($ctx2) {
  11289. //>>excludeEnd("ctx");
  11290. return self._deinstallTop();
  11291. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11292. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  11293. //>>excludeEnd("ctx");
  11294. }))._on_do_($globals.Error,(function(){
  11295. }));
  11296. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11297. $ctx1.sendIdx["on:do:"]=1;
  11298. //>>excludeEnd("ctx");
  11299. $recv((function(){
  11300. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11301. return $core.withContext(function($ctx2) {
  11302. //>>excludeEnd("ctx");
  11303. return self._deinstallMiddle();
  11304. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11305. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  11306. //>>excludeEnd("ctx");
  11307. }))._on_do_($globals.Error,(function(){
  11308. }));
  11309. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11310. $ctx1.sendIdx["on:do:"]=2;
  11311. //>>excludeEnd("ctx");
  11312. $recv((function(){
  11313. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11314. return $core.withContext(function($ctx2) {
  11315. //>>excludeEnd("ctx");
  11316. return self._deinstallBottom();
  11317. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11318. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,5)});
  11319. //>>excludeEnd("ctx");
  11320. }))._on_do_($globals.Error,(function(){
  11321. }));
  11322. return self;
  11323. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11324. }, function($ctx1) {$ctx1.fill(self,"tearDown",{},$globals.MethodInheritanceTest)});
  11325. //>>excludeEnd("ctx");
  11326. },
  11327. //>>excludeStart("ide", pragmas.excludeIdeData);
  11328. args: [],
  11329. source: "tearDown\x0a\x09[ self deinstallTop ] on: Error do: [ ].\x0a\x09[ self deinstallMiddle ] on: Error do: [ ].\x0a\x09[ self deinstallBottom ] on: Error do: [ ]",
  11330. referencedClasses: ["Error"],
  11331. //>>excludeEnd("ide");
  11332. messageSends: ["on:do:", "deinstallTop", "deinstallMiddle", "deinstallBottom"]
  11333. }),
  11334. $globals.MethodInheritanceTest);
  11335. $core.addMethod(
  11336. $core.method({
  11337. selector: "testMNU11",
  11338. protocol: 'tests',
  11339. fn: function (){
  11340. var self=this;
  11341. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11342. return $core.withContext(function($ctx1) {
  11343. //>>excludeEnd("ctx");
  11344. self["@performBlock"]=(function(x){
  11345. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11346. return $core.withContext(function($ctx2) {
  11347. //>>excludeEnd("ctx");
  11348. return $recv(x)._foo();
  11349. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11350. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)});
  11351. //>>excludeEnd("ctx");
  11352. });
  11353. self._shouldMNU();
  11354. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11355. $ctx1.sendIdx["shouldMNU"]=1;
  11356. //>>excludeEnd("ctx");
  11357. self._installTop_("foo ^ false");
  11358. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11359. $ctx1.sendIdx["installTop:"]=1;
  11360. //>>excludeEnd("ctx");
  11361. self._installTop_("foo ^ true");
  11362. self._deinstallTop();
  11363. self._shouldMNU();
  11364. return self;
  11365. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11366. }, function($ctx1) {$ctx1.fill(self,"testMNU11",{},$globals.MethodInheritanceTest)});
  11367. //>>excludeEnd("ctx");
  11368. },
  11369. //>>excludeStart("ide", pragmas.excludeIdeData);
  11370. args: [],
  11371. 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",
  11372. referencedClasses: [],
  11373. //>>excludeEnd("ide");
  11374. messageSends: ["foo", "shouldMNU", "installTop:", "deinstallTop"]
  11375. }),
  11376. $globals.MethodInheritanceTest);
  11377. $core.addMethod(
  11378. $core.method({
  11379. selector: "testMNU22",
  11380. protocol: 'tests',
  11381. fn: function (){
  11382. var self=this;
  11383. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11384. return $core.withContext(function($ctx1) {
  11385. //>>excludeEnd("ctx");
  11386. self["@performBlock"]=(function(x){
  11387. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11388. return $core.withContext(function($ctx2) {
  11389. //>>excludeEnd("ctx");
  11390. return $recv(x)._foo();
  11391. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11392. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)});
  11393. //>>excludeEnd("ctx");
  11394. });
  11395. self._shouldMNU();
  11396. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11397. $ctx1.sendIdx["shouldMNU"]=1;
  11398. //>>excludeEnd("ctx");
  11399. self._installMiddle_("foo ^ false");
  11400. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11401. $ctx1.sendIdx["installMiddle:"]=1;
  11402. //>>excludeEnd("ctx");
  11403. self._installMiddle_("foo ^ true");
  11404. self._deinstallMiddle();
  11405. self._shouldMNU();
  11406. return self;
  11407. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11408. }, function($ctx1) {$ctx1.fill(self,"testMNU22",{},$globals.MethodInheritanceTest)});
  11409. //>>excludeEnd("ctx");
  11410. },
  11411. //>>excludeStart("ide", pragmas.excludeIdeData);
  11412. args: [],
  11413. 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",
  11414. referencedClasses: [],
  11415. //>>excludeEnd("ide");
  11416. messageSends: ["foo", "shouldMNU", "installMiddle:", "deinstallMiddle"]
  11417. }),
  11418. $globals.MethodInheritanceTest);
  11419. $core.addMethod(
  11420. $core.method({
  11421. selector: "testReturns1",
  11422. protocol: 'tests',
  11423. fn: function (){
  11424. var self=this;
  11425. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11426. return $core.withContext(function($ctx1) {
  11427. //>>excludeEnd("ctx");
  11428. self["@performBlock"]=(function(x){
  11429. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11430. return $core.withContext(function($ctx2) {
  11431. //>>excludeEnd("ctx");
  11432. return $recv(x)._foo();
  11433. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11434. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)});
  11435. //>>excludeEnd("ctx");
  11436. });
  11437. self._installTop_("foo ^ false");
  11438. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11439. $ctx1.sendIdx["installTop:"]=1;
  11440. //>>excludeEnd("ctx");
  11441. self._shouldReturn_(false);
  11442. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11443. $ctx1.sendIdx["shouldReturn:"]=1;
  11444. //>>excludeEnd("ctx");
  11445. self._installTop_("foo ^ true");
  11446. self._shouldReturn_(true);
  11447. return self;
  11448. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11449. }, function($ctx1) {$ctx1.fill(self,"testReturns1",{},$globals.MethodInheritanceTest)});
  11450. //>>excludeEnd("ctx");
  11451. },
  11452. //>>excludeStart("ide", pragmas.excludeIdeData);
  11453. args: [],
  11454. 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",
  11455. referencedClasses: [],
  11456. //>>excludeEnd("ide");
  11457. messageSends: ["foo", "installTop:", "shouldReturn:"]
  11458. }),
  11459. $globals.MethodInheritanceTest);
  11460. $core.addClass('NumberTest', $globals.TestCase, [], 'Kernel-Tests');
  11461. $core.addMethod(
  11462. $core.method({
  11463. selector: "testAbs",
  11464. protocol: 'tests',
  11465. fn: function (){
  11466. var self=this;
  11467. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11468. return $core.withContext(function($ctx1) {
  11469. //>>excludeEnd("ctx");
  11470. var $1;
  11471. $1=(4)._abs();
  11472. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11473. $ctx1.sendIdx["abs"]=1;
  11474. //>>excludeEnd("ctx");
  11475. self._assert_equals_($1,(4));
  11476. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11477. $ctx1.sendIdx["assert:equals:"]=1;
  11478. //>>excludeEnd("ctx");
  11479. self._assert_equals_((-4)._abs(),(4));
  11480. return self;
  11481. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11482. }, function($ctx1) {$ctx1.fill(self,"testAbs",{},$globals.NumberTest)});
  11483. //>>excludeEnd("ctx");
  11484. },
  11485. //>>excludeStart("ide", pragmas.excludeIdeData);
  11486. args: [],
  11487. source: "testAbs\x0a\x09self assert: 4 abs equals: 4.\x0a\x09self assert: -4 abs equals: 4",
  11488. referencedClasses: [],
  11489. //>>excludeEnd("ide");
  11490. messageSends: ["assert:equals:", "abs"]
  11491. }),
  11492. $globals.NumberTest);
  11493. $core.addMethod(
  11494. $core.method({
  11495. selector: "testArithmetic",
  11496. protocol: 'tests',
  11497. fn: function (){
  11498. var self=this;
  11499. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11500. return $core.withContext(function($ctx1) {
  11501. //>>excludeEnd("ctx");
  11502. var $1,$2,$3,$5,$4;
  11503. $1=(1.5).__plus((1));
  11504. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11505. $ctx1.sendIdx["+"]=1;
  11506. //>>excludeEnd("ctx");
  11507. self._assert_equals_($1,(2.5));
  11508. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11509. $ctx1.sendIdx["assert:equals:"]=1;
  11510. //>>excludeEnd("ctx");
  11511. $2=(2).__minus((1));
  11512. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11513. $ctx1.sendIdx["-"]=1;
  11514. //>>excludeEnd("ctx");
  11515. self._assert_equals_($2,(1));
  11516. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11517. $ctx1.sendIdx["assert:equals:"]=2;
  11518. //>>excludeEnd("ctx");
  11519. self._assert_equals_((-2).__minus((1)),(-3));
  11520. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11521. $ctx1.sendIdx["assert:equals:"]=3;
  11522. //>>excludeEnd("ctx");
  11523. self._assert_equals_((12).__slash((2)),(6));
  11524. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11525. $ctx1.sendIdx["assert:equals:"]=4;
  11526. //>>excludeEnd("ctx");
  11527. $3=(3).__star((4));
  11528. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11529. $ctx1.sendIdx["*"]=1;
  11530. //>>excludeEnd("ctx");
  11531. self._assert_equals_($3,(12));
  11532. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11533. $ctx1.sendIdx["assert:equals:"]=5;
  11534. //>>excludeEnd("ctx");
  11535. self._assert_equals_((7).__slash_slash((2)),(3));
  11536. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11537. $ctx1.sendIdx["assert:equals:"]=6;
  11538. //>>excludeEnd("ctx");
  11539. self._assert_equals_((7).__backslash_backslash((2)),(1));
  11540. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11541. $ctx1.sendIdx["assert:equals:"]=7;
  11542. //>>excludeEnd("ctx");
  11543. $5=(1).__plus((2));
  11544. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11545. $ctx1.sendIdx["+"]=2;
  11546. //>>excludeEnd("ctx");
  11547. $4=$recv($5).__star((3));
  11548. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11549. $ctx1.sendIdx["*"]=2;
  11550. //>>excludeEnd("ctx");
  11551. self._assert_equals_($4,(9));
  11552. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11553. $ctx1.sendIdx["assert:equals:"]=8;
  11554. //>>excludeEnd("ctx");
  11555. self._assert_equals_((1).__plus((2).__star((3))),(7));
  11556. return self;
  11557. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11558. }, function($ctx1) {$ctx1.fill(self,"testArithmetic",{},$globals.NumberTest)});
  11559. //>>excludeEnd("ctx");
  11560. },
  11561. //>>excludeStart("ide", pragmas.excludeIdeData);
  11562. args: [],
  11563. 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",
  11564. referencedClasses: [],
  11565. //>>excludeEnd("ide");
  11566. messageSends: ["assert:equals:", "+", "-", "/", "*", "//", "\x5c\x5c"]
  11567. }),
  11568. $globals.NumberTest);
  11569. $core.addMethod(
  11570. $core.method({
  11571. selector: "testAsNumber",
  11572. protocol: 'tests',
  11573. fn: function (){
  11574. var self=this;
  11575. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11576. return $core.withContext(function($ctx1) {
  11577. //>>excludeEnd("ctx");
  11578. self._assert_equals_((3)._asNumber(),(3));
  11579. return self;
  11580. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11581. }, function($ctx1) {$ctx1.fill(self,"testAsNumber",{},$globals.NumberTest)});
  11582. //>>excludeEnd("ctx");
  11583. },
  11584. //>>excludeStart("ide", pragmas.excludeIdeData);
  11585. args: [],
  11586. source: "testAsNumber\x0a\x09self assert: 3 asNumber equals: 3.",
  11587. referencedClasses: [],
  11588. //>>excludeEnd("ide");
  11589. messageSends: ["assert:equals:", "asNumber"]
  11590. }),
  11591. $globals.NumberTest);
  11592. $core.addMethod(
  11593. $core.method({
  11594. selector: "testCeiling",
  11595. protocol: 'tests',
  11596. fn: function (){
  11597. var self=this;
  11598. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11599. return $core.withContext(function($ctx1) {
  11600. //>>excludeEnd("ctx");
  11601. var $1,$2;
  11602. $1=(1.2)._ceiling();
  11603. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11604. $ctx1.sendIdx["ceiling"]=1;
  11605. //>>excludeEnd("ctx");
  11606. self._assert_equals_($1,(2));
  11607. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11608. $ctx1.sendIdx["assert:equals:"]=1;
  11609. //>>excludeEnd("ctx");
  11610. $2=(-1.2)._ceiling();
  11611. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11612. $ctx1.sendIdx["ceiling"]=2;
  11613. //>>excludeEnd("ctx");
  11614. self._assert_equals_($2,(-1));
  11615. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11616. $ctx1.sendIdx["assert:equals:"]=2;
  11617. //>>excludeEnd("ctx");
  11618. self._assert_equals_((1)._ceiling(),(1));
  11619. return self;
  11620. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11621. }, function($ctx1) {$ctx1.fill(self,"testCeiling",{},$globals.NumberTest)});
  11622. //>>excludeEnd("ctx");
  11623. },
  11624. //>>excludeStart("ide", pragmas.excludeIdeData);
  11625. args: [],
  11626. 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.",
  11627. referencedClasses: [],
  11628. //>>excludeEnd("ide");
  11629. messageSends: ["assert:equals:", "ceiling"]
  11630. }),
  11631. $globals.NumberTest);
  11632. $core.addMethod(
  11633. $core.method({
  11634. selector: "testComparison",
  11635. protocol: 'tests',
  11636. fn: function (){
  11637. var self=this;
  11638. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11639. return $core.withContext(function($ctx1) {
  11640. //>>excludeEnd("ctx");
  11641. var $1,$2,$3,$4;
  11642. $1=(3).__gt((2));
  11643. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11644. $ctx1.sendIdx[">"]=1;
  11645. //>>excludeEnd("ctx");
  11646. self._assert_($1);
  11647. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11648. $ctx1.sendIdx["assert:"]=1;
  11649. //>>excludeEnd("ctx");
  11650. $2=(2).__lt((3));
  11651. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11652. $ctx1.sendIdx["<"]=1;
  11653. //>>excludeEnd("ctx");
  11654. self._assert_($2);
  11655. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11656. $ctx1.sendIdx["assert:"]=2;
  11657. //>>excludeEnd("ctx");
  11658. self._deny_((3).__lt((2)));
  11659. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11660. $ctx1.sendIdx["deny:"]=1;
  11661. //>>excludeEnd("ctx");
  11662. self._deny_((2).__gt((3)));
  11663. $3=(3).__gt_eq((3));
  11664. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11665. $ctx1.sendIdx[">="]=1;
  11666. //>>excludeEnd("ctx");
  11667. self._assert_($3);
  11668. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11669. $ctx1.sendIdx["assert:"]=3;
  11670. //>>excludeEnd("ctx");
  11671. self._assert_((3.1).__gt_eq((3)));
  11672. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11673. $ctx1.sendIdx["assert:"]=4;
  11674. //>>excludeEnd("ctx");
  11675. $4=(3).__lt_eq((3));
  11676. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11677. $ctx1.sendIdx["<="]=1;
  11678. //>>excludeEnd("ctx");
  11679. self._assert_($4);
  11680. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11681. $ctx1.sendIdx["assert:"]=5;
  11682. //>>excludeEnd("ctx");
  11683. self._assert_((3).__lt_eq((3.1)));
  11684. return self;
  11685. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11686. }, function($ctx1) {$ctx1.fill(self,"testComparison",{},$globals.NumberTest)});
  11687. //>>excludeEnd("ctx");
  11688. },
  11689. //>>excludeStart("ide", pragmas.excludeIdeData);
  11690. args: [],
  11691. 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",
  11692. referencedClasses: [],
  11693. //>>excludeEnd("ide");
  11694. messageSends: ["assert:", ">", "<", "deny:", ">=", "<="]
  11695. }),
  11696. $globals.NumberTest);
  11697. $core.addMethod(
  11698. $core.method({
  11699. selector: "testCopying",
  11700. protocol: 'tests',
  11701. fn: function (){
  11702. var self=this;
  11703. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11704. return $core.withContext(function($ctx1) {
  11705. //>>excludeEnd("ctx");
  11706. var $1;
  11707. $1=$recv((1)._copy()).__eq_eq((1));
  11708. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11709. $ctx1.sendIdx["=="]=1;
  11710. //>>excludeEnd("ctx");
  11711. self._assert_($1);
  11712. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11713. $ctx1.sendIdx["assert:"]=1;
  11714. //>>excludeEnd("ctx");
  11715. self._assert_($recv((1)._deepCopy()).__eq_eq((1)));
  11716. return self;
  11717. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11718. }, function($ctx1) {$ctx1.fill(self,"testCopying",{},$globals.NumberTest)});
  11719. //>>excludeEnd("ctx");
  11720. },
  11721. //>>excludeStart("ide", pragmas.excludeIdeData);
  11722. args: [],
  11723. source: "testCopying\x0a\x09self assert: 1 copy == 1.\x0a\x09self assert: 1 deepCopy == 1",
  11724. referencedClasses: [],
  11725. //>>excludeEnd("ide");
  11726. messageSends: ["assert:", "==", "copy", "deepCopy"]
  11727. }),
  11728. $globals.NumberTest);
  11729. $core.addMethod(
  11730. $core.method({
  11731. selector: "testEquality",
  11732. protocol: 'tests',
  11733. fn: function (){
  11734. var self=this;
  11735. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11736. return $core.withContext(function($ctx1) {
  11737. //>>excludeEnd("ctx");
  11738. var $1,$2,$3,$5,$4,$7,$6,$9,$8,$10,$11,$12;
  11739. $1=(1).__eq((1));
  11740. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11741. $ctx1.sendIdx["="]=1;
  11742. //>>excludeEnd("ctx");
  11743. self._assert_($1);
  11744. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11745. $ctx1.sendIdx["assert:"]=1;
  11746. //>>excludeEnd("ctx");
  11747. $2=(0).__eq((0));
  11748. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11749. $ctx1.sendIdx["="]=2;
  11750. //>>excludeEnd("ctx");
  11751. self._assert_($2);
  11752. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11753. $ctx1.sendIdx["assert:"]=2;
  11754. //>>excludeEnd("ctx");
  11755. $3=(1).__eq((0));
  11756. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11757. $ctx1.sendIdx["="]=3;
  11758. //>>excludeEnd("ctx");
  11759. self._deny_($3);
  11760. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11761. $ctx1.sendIdx["deny:"]=1;
  11762. //>>excludeEnd("ctx");
  11763. $5=(1)._yourself();
  11764. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11765. $ctx1.sendIdx["yourself"]=1;
  11766. //>>excludeEnd("ctx");
  11767. $4=$recv($5).__eq((1));
  11768. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11769. $ctx1.sendIdx["="]=4;
  11770. //>>excludeEnd("ctx");
  11771. self._assert_($4);
  11772. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11773. $ctx1.sendIdx["assert:"]=3;
  11774. //>>excludeEnd("ctx");
  11775. $7=(1)._yourself();
  11776. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11777. $ctx1.sendIdx["yourself"]=2;
  11778. //>>excludeEnd("ctx");
  11779. $6=(1).__eq($7);
  11780. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11781. $ctx1.sendIdx["="]=5;
  11782. //>>excludeEnd("ctx");
  11783. self._assert_($6);
  11784. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11785. $ctx1.sendIdx["assert:"]=4;
  11786. //>>excludeEnd("ctx");
  11787. $9=(1)._yourself();
  11788. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11789. $ctx1.sendIdx["yourself"]=3;
  11790. //>>excludeEnd("ctx");
  11791. $8=$recv($9).__eq((1)._yourself());
  11792. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11793. $ctx1.sendIdx["="]=6;
  11794. //>>excludeEnd("ctx");
  11795. self._assert_($8);
  11796. $10=(0).__eq(false);
  11797. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11798. $ctx1.sendIdx["="]=7;
  11799. //>>excludeEnd("ctx");
  11800. self._deny_($10);
  11801. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11802. $ctx1.sendIdx["deny:"]=2;
  11803. //>>excludeEnd("ctx");
  11804. $11=false.__eq((0));
  11805. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11806. $ctx1.sendIdx["="]=8;
  11807. //>>excludeEnd("ctx");
  11808. self._deny_($11);
  11809. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11810. $ctx1.sendIdx["deny:"]=3;
  11811. //>>excludeEnd("ctx");
  11812. $12="".__eq((0));
  11813. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11814. $ctx1.sendIdx["="]=9;
  11815. //>>excludeEnd("ctx");
  11816. self._deny_($12);
  11817. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11818. $ctx1.sendIdx["deny:"]=4;
  11819. //>>excludeEnd("ctx");
  11820. self._deny_((0).__eq(""));
  11821. return self;
  11822. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11823. }, function($ctx1) {$ctx1.fill(self,"testEquality",{},$globals.NumberTest)});
  11824. //>>excludeEnd("ctx");
  11825. },
  11826. //>>excludeStart("ide", pragmas.excludeIdeData);
  11827. args: [],
  11828. 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 = ''",
  11829. referencedClasses: [],
  11830. //>>excludeEnd("ide");
  11831. messageSends: ["assert:", "=", "deny:", "yourself"]
  11832. }),
  11833. $globals.NumberTest);
  11834. $core.addMethod(
  11835. $core.method({
  11836. selector: "testFloor",
  11837. protocol: 'tests',
  11838. fn: function (){
  11839. var self=this;
  11840. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11841. return $core.withContext(function($ctx1) {
  11842. //>>excludeEnd("ctx");
  11843. var $1,$2;
  11844. $1=(1.2)._floor();
  11845. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11846. $ctx1.sendIdx["floor"]=1;
  11847. //>>excludeEnd("ctx");
  11848. self._assert_equals_($1,(1));
  11849. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11850. $ctx1.sendIdx["assert:equals:"]=1;
  11851. //>>excludeEnd("ctx");
  11852. $2=(-1.2)._floor();
  11853. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11854. $ctx1.sendIdx["floor"]=2;
  11855. //>>excludeEnd("ctx");
  11856. self._assert_equals_($2,(-2));
  11857. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11858. $ctx1.sendIdx["assert:equals:"]=2;
  11859. //>>excludeEnd("ctx");
  11860. self._assert_equals_((1)._floor(),(1));
  11861. return self;
  11862. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11863. }, function($ctx1) {$ctx1.fill(self,"testFloor",{},$globals.NumberTest)});
  11864. //>>excludeEnd("ctx");
  11865. },
  11866. //>>excludeStart("ide", pragmas.excludeIdeData);
  11867. args: [],
  11868. 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.",
  11869. referencedClasses: [],
  11870. //>>excludeEnd("ide");
  11871. messageSends: ["assert:equals:", "floor"]
  11872. }),
  11873. $globals.NumberTest);
  11874. $core.addMethod(
  11875. $core.method({
  11876. selector: "testHexNumbers",
  11877. protocol: 'tests',
  11878. fn: function (){
  11879. var self=this;
  11880. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11881. return $core.withContext(function($ctx1) {
  11882. //>>excludeEnd("ctx");
  11883. var $1,$2,$3,$4,$5;
  11884. self._assert_equals_((9),(9));
  11885. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11886. $ctx1.sendIdx["assert:equals:"]=1;
  11887. //>>excludeEnd("ctx");
  11888. $1=(10)._truncated();
  11889. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11890. $ctx1.sendIdx["truncated"]=1;
  11891. //>>excludeEnd("ctx");
  11892. self._assert_equals_($1,(10));
  11893. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11894. $ctx1.sendIdx["assert:equals:"]=2;
  11895. //>>excludeEnd("ctx");
  11896. $2=(11)._truncated();
  11897. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11898. $ctx1.sendIdx["truncated"]=2;
  11899. //>>excludeEnd("ctx");
  11900. self._assert_equals_($2,(11));
  11901. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11902. $ctx1.sendIdx["assert:equals:"]=3;
  11903. //>>excludeEnd("ctx");
  11904. $3=(12)._truncated();
  11905. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11906. $ctx1.sendIdx["truncated"]=3;
  11907. //>>excludeEnd("ctx");
  11908. self._assert_equals_($3,(12));
  11909. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11910. $ctx1.sendIdx["assert:equals:"]=4;
  11911. //>>excludeEnd("ctx");
  11912. $4=(13)._truncated();
  11913. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11914. $ctx1.sendIdx["truncated"]=4;
  11915. //>>excludeEnd("ctx");
  11916. self._assert_equals_($4,(13));
  11917. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11918. $ctx1.sendIdx["assert:equals:"]=5;
  11919. //>>excludeEnd("ctx");
  11920. $5=(14)._truncated();
  11921. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11922. $ctx1.sendIdx["truncated"]=5;
  11923. //>>excludeEnd("ctx");
  11924. self._assert_equals_($5,(14));
  11925. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11926. $ctx1.sendIdx["assert:equals:"]=6;
  11927. //>>excludeEnd("ctx");
  11928. self._assert_equals_((15)._truncated(),(15));
  11929. return self;
  11930. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11931. }, function($ctx1) {$ctx1.fill(self,"testHexNumbers",{},$globals.NumberTest)});
  11932. //>>excludeEnd("ctx");
  11933. },
  11934. //>>excludeStart("ide", pragmas.excludeIdeData);
  11935. args: [],
  11936. 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",
  11937. referencedClasses: [],
  11938. //>>excludeEnd("ide");
  11939. messageSends: ["assert:equals:", "truncated"]
  11940. }),
  11941. $globals.NumberTest);
  11942. $core.addMethod(
  11943. $core.method({
  11944. selector: "testIdentity",
  11945. protocol: 'tests',
  11946. fn: function (){
  11947. var self=this;
  11948. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11949. return $core.withContext(function($ctx1) {
  11950. //>>excludeEnd("ctx");
  11951. var $1,$2,$3,$5,$4,$7,$6,$9,$8;
  11952. $1=(1).__eq_eq((1));
  11953. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11954. $ctx1.sendIdx["=="]=1;
  11955. //>>excludeEnd("ctx");
  11956. self._assert_($1);
  11957. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11958. $ctx1.sendIdx["assert:"]=1;
  11959. //>>excludeEnd("ctx");
  11960. $2=(0).__eq_eq((0));
  11961. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11962. $ctx1.sendIdx["=="]=2;
  11963. //>>excludeEnd("ctx");
  11964. self._assert_($2);
  11965. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11966. $ctx1.sendIdx["assert:"]=2;
  11967. //>>excludeEnd("ctx");
  11968. $3=(1).__eq_eq((0));
  11969. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11970. $ctx1.sendIdx["=="]=3;
  11971. //>>excludeEnd("ctx");
  11972. self._deny_($3);
  11973. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11974. $ctx1.sendIdx["deny:"]=1;
  11975. //>>excludeEnd("ctx");
  11976. $5=(1)._yourself();
  11977. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11978. $ctx1.sendIdx["yourself"]=1;
  11979. //>>excludeEnd("ctx");
  11980. $4=$recv($5).__eq_eq((1));
  11981. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11982. $ctx1.sendIdx["=="]=4;
  11983. //>>excludeEnd("ctx");
  11984. self._assert_($4);
  11985. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11986. $ctx1.sendIdx["assert:"]=3;
  11987. //>>excludeEnd("ctx");
  11988. $7=(1)._yourself();
  11989. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11990. $ctx1.sendIdx["yourself"]=2;
  11991. //>>excludeEnd("ctx");
  11992. $6=(1).__eq_eq($7);
  11993. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11994. $ctx1.sendIdx["=="]=5;
  11995. //>>excludeEnd("ctx");
  11996. self._assert_($6);
  11997. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11998. $ctx1.sendIdx["assert:"]=4;
  11999. //>>excludeEnd("ctx");
  12000. $9=(1)._yourself();
  12001. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12002. $ctx1.sendIdx["yourself"]=3;
  12003. //>>excludeEnd("ctx");
  12004. $8=$recv($9).__eq_eq((1)._yourself());
  12005. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12006. $ctx1.sendIdx["=="]=6;
  12007. //>>excludeEnd("ctx");
  12008. self._assert_($8);
  12009. self._deny_((1).__eq_eq((2)));
  12010. return self;
  12011. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12012. }, function($ctx1) {$ctx1.fill(self,"testIdentity",{},$globals.NumberTest)});
  12013. //>>excludeEnd("ctx");
  12014. },
  12015. //>>excludeStart("ide", pragmas.excludeIdeData);
  12016. args: [],
  12017. 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",
  12018. referencedClasses: [],
  12019. //>>excludeEnd("ide");
  12020. messageSends: ["assert:", "==", "deny:", "yourself"]
  12021. }),
  12022. $globals.NumberTest);
  12023. $core.addMethod(
  12024. $core.method({
  12025. selector: "testInvalidHexNumbers",
  12026. protocol: 'tests',
  12027. fn: function (){
  12028. var self=this;
  12029. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12030. return $core.withContext(function($ctx1) {
  12031. //>>excludeEnd("ctx");
  12032. self._should_raise_((function(){
  12033. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12034. return $core.withContext(function($ctx2) {
  12035. //>>excludeEnd("ctx");
  12036. return (16)._rG();
  12037. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12038. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  12039. //>>excludeEnd("ctx");
  12040. }),$globals.MessageNotUnderstood);
  12041. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12042. $ctx1.sendIdx["should:raise:"]=1;
  12043. //>>excludeEnd("ctx");
  12044. self._should_raise_((function(){
  12045. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12046. return $core.withContext(function($ctx2) {
  12047. //>>excludeEnd("ctx");
  12048. return (16)._rg();
  12049. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12050. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  12051. //>>excludeEnd("ctx");
  12052. }),$globals.MessageNotUnderstood);
  12053. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12054. $ctx1.sendIdx["should:raise:"]=2;
  12055. //>>excludeEnd("ctx");
  12056. self._should_raise_((function(){
  12057. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12058. return $core.withContext(function($ctx2) {
  12059. //>>excludeEnd("ctx");
  12060. return (16)._rH();
  12061. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12062. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  12063. //>>excludeEnd("ctx");
  12064. }),$globals.MessageNotUnderstood);
  12065. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12066. $ctx1.sendIdx["should:raise:"]=3;
  12067. //>>excludeEnd("ctx");
  12068. self._should_raise_((function(){
  12069. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12070. return $core.withContext(function($ctx2) {
  12071. //>>excludeEnd("ctx");
  12072. return (16)._rh();
  12073. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12074. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,4)});
  12075. //>>excludeEnd("ctx");
  12076. }),$globals.MessageNotUnderstood);
  12077. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12078. $ctx1.sendIdx["should:raise:"]=4;
  12079. //>>excludeEnd("ctx");
  12080. self._should_raise_((function(){
  12081. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12082. return $core.withContext(function($ctx2) {
  12083. //>>excludeEnd("ctx");
  12084. return (16)._rI();
  12085. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12086. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,5)});
  12087. //>>excludeEnd("ctx");
  12088. }),$globals.MessageNotUnderstood);
  12089. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12090. $ctx1.sendIdx["should:raise:"]=5;
  12091. //>>excludeEnd("ctx");
  12092. self._should_raise_((function(){
  12093. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12094. return $core.withContext(function($ctx2) {
  12095. //>>excludeEnd("ctx");
  12096. return (16)._ri();
  12097. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12098. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,6)});
  12099. //>>excludeEnd("ctx");
  12100. }),$globals.MessageNotUnderstood);
  12101. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12102. $ctx1.sendIdx["should:raise:"]=6;
  12103. //>>excludeEnd("ctx");
  12104. self._should_raise_((function(){
  12105. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12106. return $core.withContext(function($ctx2) {
  12107. //>>excludeEnd("ctx");
  12108. return (16)._rJ();
  12109. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12110. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,7)});
  12111. //>>excludeEnd("ctx");
  12112. }),$globals.MessageNotUnderstood);
  12113. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12114. $ctx1.sendIdx["should:raise:"]=7;
  12115. //>>excludeEnd("ctx");
  12116. self._should_raise_((function(){
  12117. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12118. return $core.withContext(function($ctx2) {
  12119. //>>excludeEnd("ctx");
  12120. return (16)._rj();
  12121. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12122. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,8)});
  12123. //>>excludeEnd("ctx");
  12124. }),$globals.MessageNotUnderstood);
  12125. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12126. $ctx1.sendIdx["should:raise:"]=8;
  12127. //>>excludeEnd("ctx");
  12128. self._should_raise_((function(){
  12129. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12130. return $core.withContext(function($ctx2) {
  12131. //>>excludeEnd("ctx");
  12132. return (16)._rK();
  12133. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12134. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,9)});
  12135. //>>excludeEnd("ctx");
  12136. }),$globals.MessageNotUnderstood);
  12137. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12138. $ctx1.sendIdx["should:raise:"]=9;
  12139. //>>excludeEnd("ctx");
  12140. self._should_raise_((function(){
  12141. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12142. return $core.withContext(function($ctx2) {
  12143. //>>excludeEnd("ctx");
  12144. return (16)._rk();
  12145. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12146. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,10)});
  12147. //>>excludeEnd("ctx");
  12148. }),$globals.MessageNotUnderstood);
  12149. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12150. $ctx1.sendIdx["should:raise:"]=10;
  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)._rL();
  12157. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12158. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,11)});
  12159. //>>excludeEnd("ctx");
  12160. }),$globals.MessageNotUnderstood);
  12161. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12162. $ctx1.sendIdx["should:raise:"]=11;
  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)._rl();
  12169. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12170. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,12)});
  12171. //>>excludeEnd("ctx");
  12172. }),$globals.MessageNotUnderstood);
  12173. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12174. $ctx1.sendIdx["should:raise:"]=12;
  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)._rM();
  12181. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12182. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,13)});
  12183. //>>excludeEnd("ctx");
  12184. }),$globals.MessageNotUnderstood);
  12185. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12186. $ctx1.sendIdx["should:raise:"]=13;
  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)._rm();
  12193. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12194. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,14)});
  12195. //>>excludeEnd("ctx");
  12196. }),$globals.MessageNotUnderstood);
  12197. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12198. $ctx1.sendIdx["should:raise:"]=14;
  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)._rN();
  12205. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12206. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,15)});
  12207. //>>excludeEnd("ctx");
  12208. }),$globals.MessageNotUnderstood);
  12209. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12210. $ctx1.sendIdx["should:raise:"]=15;
  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)._rn();
  12217. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12218. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,16)});
  12219. //>>excludeEnd("ctx");
  12220. }),$globals.MessageNotUnderstood);
  12221. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12222. $ctx1.sendIdx["should:raise:"]=16;
  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)._rO();
  12229. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12230. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,17)});
  12231. //>>excludeEnd("ctx");
  12232. }),$globals.MessageNotUnderstood);
  12233. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12234. $ctx1.sendIdx["should:raise:"]=17;
  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)._ro();
  12241. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12242. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,18)});
  12243. //>>excludeEnd("ctx");
  12244. }),$globals.MessageNotUnderstood);
  12245. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12246. $ctx1.sendIdx["should:raise:"]=18;
  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)._rP();
  12253. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12254. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,19)});
  12255. //>>excludeEnd("ctx");
  12256. }),$globals.MessageNotUnderstood);
  12257. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12258. $ctx1.sendIdx["should:raise:"]=19;
  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)._rp();
  12265. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12266. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,20)});
  12267. //>>excludeEnd("ctx");
  12268. }),$globals.MessageNotUnderstood);
  12269. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12270. $ctx1.sendIdx["should:raise:"]=20;
  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)._rQ();
  12277. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12278. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,21)});
  12279. //>>excludeEnd("ctx");
  12280. }),$globals.MessageNotUnderstood);
  12281. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12282. $ctx1.sendIdx["should:raise:"]=21;
  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)._rq();
  12289. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12290. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,22)});
  12291. //>>excludeEnd("ctx");
  12292. }),$globals.MessageNotUnderstood);
  12293. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12294. $ctx1.sendIdx["should:raise:"]=22;
  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)._rR();
  12301. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12302. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,23)});
  12303. //>>excludeEnd("ctx");
  12304. }),$globals.MessageNotUnderstood);
  12305. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12306. $ctx1.sendIdx["should:raise:"]=23;
  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)._rr();
  12313. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12314. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,24)});
  12315. //>>excludeEnd("ctx");
  12316. }),$globals.MessageNotUnderstood);
  12317. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12318. $ctx1.sendIdx["should:raise:"]=24;
  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)._rS();
  12325. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12326. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,25)});
  12327. //>>excludeEnd("ctx");
  12328. }),$globals.MessageNotUnderstood);
  12329. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12330. $ctx1.sendIdx["should:raise:"]=25;
  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)._rs();
  12337. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12338. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,26)});
  12339. //>>excludeEnd("ctx");
  12340. }),$globals.MessageNotUnderstood);
  12341. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12342. $ctx1.sendIdx["should:raise:"]=26;
  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)._rT();
  12349. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12350. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,27)});
  12351. //>>excludeEnd("ctx");
  12352. }),$globals.MessageNotUnderstood);
  12353. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12354. $ctx1.sendIdx["should:raise:"]=27;
  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)._rt();
  12361. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12362. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,28)});
  12363. //>>excludeEnd("ctx");
  12364. }),$globals.MessageNotUnderstood);
  12365. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12366. $ctx1.sendIdx["should:raise:"]=28;
  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)._rU();
  12373. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12374. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,29)});
  12375. //>>excludeEnd("ctx");
  12376. }),$globals.MessageNotUnderstood);
  12377. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12378. $ctx1.sendIdx["should:raise:"]=29;
  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)._ru();
  12385. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12386. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,30)});
  12387. //>>excludeEnd("ctx");
  12388. }),$globals.MessageNotUnderstood);
  12389. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12390. $ctx1.sendIdx["should:raise:"]=30;
  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)._rV();
  12397. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12398. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,31)});
  12399. //>>excludeEnd("ctx");
  12400. }),$globals.MessageNotUnderstood);
  12401. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12402. $ctx1.sendIdx["should:raise:"]=31;
  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)._rv();
  12409. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12410. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,32)});
  12411. //>>excludeEnd("ctx");
  12412. }),$globals.MessageNotUnderstood);
  12413. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12414. $ctx1.sendIdx["should:raise:"]=32;
  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)._rW();
  12421. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12422. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,33)});
  12423. //>>excludeEnd("ctx");
  12424. }),$globals.MessageNotUnderstood);
  12425. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12426. $ctx1.sendIdx["should:raise:"]=33;
  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)._rw();
  12433. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12434. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,34)});
  12435. //>>excludeEnd("ctx");
  12436. }),$globals.MessageNotUnderstood);
  12437. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12438. $ctx1.sendIdx["should:raise:"]=34;
  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)._rX();
  12445. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12446. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,35)});
  12447. //>>excludeEnd("ctx");
  12448. }),$globals.MessageNotUnderstood);
  12449. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12450. $ctx1.sendIdx["should:raise:"]=35;
  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)._rx();
  12457. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12458. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,36)});
  12459. //>>excludeEnd("ctx");
  12460. }),$globals.MessageNotUnderstood);
  12461. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12462. $ctx1.sendIdx["should:raise:"]=36;
  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)._rY();
  12469. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12470. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,37)});
  12471. //>>excludeEnd("ctx");
  12472. }),$globals.MessageNotUnderstood);
  12473. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12474. $ctx1.sendIdx["should:raise:"]=37;
  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)._ry();
  12481. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12482. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,38)});
  12483. //>>excludeEnd("ctx");
  12484. }),$globals.MessageNotUnderstood);
  12485. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12486. $ctx1.sendIdx["should:raise:"]=38;
  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)._rZ();
  12493. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12494. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,39)});
  12495. //>>excludeEnd("ctx");
  12496. }),$globals.MessageNotUnderstood);
  12497. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12498. $ctx1.sendIdx["should:raise:"]=39;
  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)._rz();
  12505. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12506. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,40)});
  12507. //>>excludeEnd("ctx");
  12508. }),$globals.MessageNotUnderstood);
  12509. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12510. $ctx1.sendIdx["should:raise:"]=40;
  12511. //>>excludeEnd("ctx");
  12512. self._should_raise_((function(){
  12513. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12514. return $core.withContext(function($ctx2) {
  12515. //>>excludeEnd("ctx");
  12516. return (11259375)._Z();
  12517. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12518. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,41)});
  12519. //>>excludeEnd("ctx");
  12520. }),$globals.MessageNotUnderstood);
  12521. return self;
  12522. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12523. }, function($ctx1) {$ctx1.fill(self,"testInvalidHexNumbers",{},$globals.NumberTest)});
  12524. //>>excludeEnd("ctx");
  12525. },
  12526. //>>excludeStart("ide", pragmas.excludeIdeData);
  12527. args: [],
  12528. 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.",
  12529. referencedClasses: ["MessageNotUnderstood"],
  12530. //>>excludeEnd("ide");
  12531. 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"]
  12532. }),
  12533. $globals.NumberTest);
  12534. $core.addMethod(
  12535. $core.method({
  12536. selector: "testLog",
  12537. protocol: 'tests',
  12538. fn: function (){
  12539. var self=this;
  12540. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12541. return $core.withContext(function($ctx1) {
  12542. //>>excludeEnd("ctx");
  12543. self._assert_equals_((10000)._log(),(4));
  12544. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12545. $ctx1.sendIdx["assert:equals:"]=1;
  12546. //>>excludeEnd("ctx");
  12547. self._assert_equals_((512)._log_((2)),(9));
  12548. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12549. $ctx1.sendIdx["assert:equals:"]=2;
  12550. //>>excludeEnd("ctx");
  12551. self._assert_equals_($recv($recv($globals.Number)._e())._ln(),(1));
  12552. return self;
  12553. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12554. }, function($ctx1) {$ctx1.fill(self,"testLog",{},$globals.NumberTest)});
  12555. //>>excludeEnd("ctx");
  12556. },
  12557. //>>excludeStart("ide", pragmas.excludeIdeData);
  12558. args: [],
  12559. 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.",
  12560. referencedClasses: ["Number"],
  12561. //>>excludeEnd("ide");
  12562. messageSends: ["assert:equals:", "log", "log:", "ln", "e"]
  12563. }),
  12564. $globals.NumberTest);
  12565. $core.addMethod(
  12566. $core.method({
  12567. selector: "testMinMax",
  12568. protocol: 'tests',
  12569. fn: function (){
  12570. var self=this;
  12571. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12572. return $core.withContext(function($ctx1) {
  12573. //>>excludeEnd("ctx");
  12574. self._assert_equals_((2)._max_((5)),(5));
  12575. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12576. $ctx1.sendIdx["assert:equals:"]=1;
  12577. //>>excludeEnd("ctx");
  12578. self._assert_equals_((2)._min_((5)),(2));
  12579. return self;
  12580. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12581. }, function($ctx1) {$ctx1.fill(self,"testMinMax",{},$globals.NumberTest)});
  12582. //>>excludeEnd("ctx");
  12583. },
  12584. //>>excludeStart("ide", pragmas.excludeIdeData);
  12585. args: [],
  12586. source: "testMinMax\x0a\x09\x0a\x09self assert: (2 max: 5) equals: 5.\x0a\x09self assert: (2 min: 5) equals: 2",
  12587. referencedClasses: [],
  12588. //>>excludeEnd("ide");
  12589. messageSends: ["assert:equals:", "max:", "min:"]
  12590. }),
  12591. $globals.NumberTest);
  12592. $core.addMethod(
  12593. $core.method({
  12594. selector: "testNegated",
  12595. protocol: 'tests',
  12596. fn: function (){
  12597. var self=this;
  12598. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12599. return $core.withContext(function($ctx1) {
  12600. //>>excludeEnd("ctx");
  12601. var $1;
  12602. $1=(3)._negated();
  12603. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12604. $ctx1.sendIdx["negated"]=1;
  12605. //>>excludeEnd("ctx");
  12606. self._assert_equals_($1,(-3));
  12607. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12608. $ctx1.sendIdx["assert:equals:"]=1;
  12609. //>>excludeEnd("ctx");
  12610. self._assert_equals_((-3)._negated(),(3));
  12611. return self;
  12612. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12613. }, function($ctx1) {$ctx1.fill(self,"testNegated",{},$globals.NumberTest)});
  12614. //>>excludeEnd("ctx");
  12615. },
  12616. //>>excludeStart("ide", pragmas.excludeIdeData);
  12617. args: [],
  12618. source: "testNegated\x0a\x09self assert: 3 negated equals: -3.\x0a\x09self assert: -3 negated equals: 3",
  12619. referencedClasses: [],
  12620. //>>excludeEnd("ide");
  12621. messageSends: ["assert:equals:", "negated"]
  12622. }),
  12623. $globals.NumberTest);
  12624. $core.addMethod(
  12625. $core.method({
  12626. selector: "testPrintShowingDecimalPlaces",
  12627. protocol: 'tests',
  12628. fn: function (){
  12629. var self=this;
  12630. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12631. return $core.withContext(function($ctx1) {
  12632. //>>excludeEnd("ctx");
  12633. var $1,$2,$4,$3,$5,$6,$8,$7,$10,$9,$11,$12,$13,$14,$15;
  12634. $1=(23)._printShowingDecimalPlaces_((2));
  12635. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12636. $ctx1.sendIdx["printShowingDecimalPlaces:"]=1;
  12637. //>>excludeEnd("ctx");
  12638. self._assert_equals_($1,"23.00");
  12639. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12640. $ctx1.sendIdx["assert:equals:"]=1;
  12641. //>>excludeEnd("ctx");
  12642. $2=(23.5698)._printShowingDecimalPlaces_((2));
  12643. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12644. $ctx1.sendIdx["printShowingDecimalPlaces:"]=2;
  12645. //>>excludeEnd("ctx");
  12646. self._assert_equals_($2,"23.57");
  12647. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12648. $ctx1.sendIdx["assert:equals:"]=2;
  12649. //>>excludeEnd("ctx");
  12650. $4=(234.567)._negated();
  12651. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12652. $ctx1.sendIdx["negated"]=1;
  12653. //>>excludeEnd("ctx");
  12654. $3=$recv($4)._printShowingDecimalPlaces_((5));
  12655. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12656. $ctx1.sendIdx["printShowingDecimalPlaces:"]=3;
  12657. //>>excludeEnd("ctx");
  12658. self._assert_equals_($3,"-234.56700");
  12659. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12660. $ctx1.sendIdx["assert:equals:"]=3;
  12661. //>>excludeEnd("ctx");
  12662. $5=(23.4567)._printShowingDecimalPlaces_((0));
  12663. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12664. $ctx1.sendIdx["printShowingDecimalPlaces:"]=4;
  12665. //>>excludeEnd("ctx");
  12666. self._assert_equals_($5,"23");
  12667. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12668. $ctx1.sendIdx["assert:equals:"]=4;
  12669. //>>excludeEnd("ctx");
  12670. $6=(23.5567)._printShowingDecimalPlaces_((0));
  12671. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12672. $ctx1.sendIdx["printShowingDecimalPlaces:"]=5;
  12673. //>>excludeEnd("ctx");
  12674. self._assert_equals_($6,"24");
  12675. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12676. $ctx1.sendIdx["assert:equals:"]=5;
  12677. //>>excludeEnd("ctx");
  12678. $8=(23.4567)._negated();
  12679. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12680. $ctx1.sendIdx["negated"]=2;
  12681. //>>excludeEnd("ctx");
  12682. $7=$recv($8)._printShowingDecimalPlaces_((0));
  12683. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12684. $ctx1.sendIdx["printShowingDecimalPlaces:"]=6;
  12685. //>>excludeEnd("ctx");
  12686. self._assert_equals_($7,"-23");
  12687. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12688. $ctx1.sendIdx["assert:equals:"]=6;
  12689. //>>excludeEnd("ctx");
  12690. $10=(23.5567)._negated();
  12691. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12692. $ctx1.sendIdx["negated"]=3;
  12693. //>>excludeEnd("ctx");
  12694. $9=$recv($10)._printShowingDecimalPlaces_((0));
  12695. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12696. $ctx1.sendIdx["printShowingDecimalPlaces:"]=7;
  12697. //>>excludeEnd("ctx");
  12698. self._assert_equals_($9,"-24");
  12699. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12700. $ctx1.sendIdx["assert:equals:"]=7;
  12701. //>>excludeEnd("ctx");
  12702. $11=(100000000)._printShowingDecimalPlaces_((1));
  12703. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12704. $ctx1.sendIdx["printShowingDecimalPlaces:"]=8;
  12705. //>>excludeEnd("ctx");
  12706. self._assert_equals_($11,"100000000.0");
  12707. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12708. $ctx1.sendIdx["assert:equals:"]=8;
  12709. //>>excludeEnd("ctx");
  12710. $12=(0.98)._printShowingDecimalPlaces_((5));
  12711. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12712. $ctx1.sendIdx["printShowingDecimalPlaces:"]=9;
  12713. //>>excludeEnd("ctx");
  12714. self._assert_equals_($12,"0.98000");
  12715. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12716. $ctx1.sendIdx["assert:equals:"]=9;
  12717. //>>excludeEnd("ctx");
  12718. $13=$recv((0.98)._negated())._printShowingDecimalPlaces_((2));
  12719. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12720. $ctx1.sendIdx["printShowingDecimalPlaces:"]=10;
  12721. //>>excludeEnd("ctx");
  12722. self._assert_equals_($13,"-0.98");
  12723. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12724. $ctx1.sendIdx["assert:equals:"]=10;
  12725. //>>excludeEnd("ctx");
  12726. $14=(2.567)._printShowingDecimalPlaces_((2));
  12727. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12728. $ctx1.sendIdx["printShowingDecimalPlaces:"]=11;
  12729. //>>excludeEnd("ctx");
  12730. self._assert_equals_($14,"2.57");
  12731. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12732. $ctx1.sendIdx["assert:equals:"]=11;
  12733. //>>excludeEnd("ctx");
  12734. $15=(-2.567)._printShowingDecimalPlaces_((2));
  12735. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12736. $ctx1.sendIdx["printShowingDecimalPlaces:"]=12;
  12737. //>>excludeEnd("ctx");
  12738. self._assert_equals_($15,"-2.57");
  12739. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12740. $ctx1.sendIdx["assert:equals:"]=12;
  12741. //>>excludeEnd("ctx");
  12742. self._assert_equals_((0)._printShowingDecimalPlaces_((2)),"0.00");
  12743. return self;
  12744. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12745. }, function($ctx1) {$ctx1.fill(self,"testPrintShowingDecimalPlaces",{},$globals.NumberTest)});
  12746. //>>excludeEnd("ctx");
  12747. },
  12748. //>>excludeStart("ide", pragmas.excludeIdeData);
  12749. args: [],
  12750. 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'.",
  12751. referencedClasses: [],
  12752. //>>excludeEnd("ide");
  12753. messageSends: ["assert:equals:", "printShowingDecimalPlaces:", "negated"]
  12754. }),
  12755. $globals.NumberTest);
  12756. $core.addMethod(
  12757. $core.method({
  12758. selector: "testRaisedTo",
  12759. protocol: 'tests',
  12760. fn: function (){
  12761. var self=this;
  12762. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12763. return $core.withContext(function($ctx1) {
  12764. //>>excludeEnd("ctx");
  12765. var $1,$2,$3;
  12766. $1=(2)._raisedTo_((4));
  12767. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12768. $ctx1.sendIdx["raisedTo:"]=1;
  12769. //>>excludeEnd("ctx");
  12770. self._assert_equals_($1,(16));
  12771. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12772. $ctx1.sendIdx["assert:equals:"]=1;
  12773. //>>excludeEnd("ctx");
  12774. $2=(2)._raisedTo_((0));
  12775. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12776. $ctx1.sendIdx["raisedTo:"]=2;
  12777. //>>excludeEnd("ctx");
  12778. self._assert_equals_($2,(1));
  12779. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12780. $ctx1.sendIdx["assert:equals:"]=2;
  12781. //>>excludeEnd("ctx");
  12782. $3=(2)._raisedTo_((-3));
  12783. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12784. $ctx1.sendIdx["raisedTo:"]=3;
  12785. //>>excludeEnd("ctx");
  12786. self._assert_equals_($3,(0.125));
  12787. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12788. $ctx1.sendIdx["assert:equals:"]=3;
  12789. //>>excludeEnd("ctx");
  12790. self._assert_equals_((4)._raisedTo_((0.5)),(2));
  12791. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12792. $ctx1.sendIdx["assert:equals:"]=4;
  12793. //>>excludeEnd("ctx");
  12794. self._assert_equals_((2).__star_star((4)),(16));
  12795. return self;
  12796. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12797. }, function($ctx1) {$ctx1.fill(self,"testRaisedTo",{},$globals.NumberTest)});
  12798. //>>excludeEnd("ctx");
  12799. },
  12800. //>>excludeStart("ide", pragmas.excludeIdeData);
  12801. args: [],
  12802. 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.",
  12803. referencedClasses: [],
  12804. //>>excludeEnd("ide");
  12805. messageSends: ["assert:equals:", "raisedTo:", "**"]
  12806. }),
  12807. $globals.NumberTest);
  12808. $core.addMethod(
  12809. $core.method({
  12810. selector: "testRounded",
  12811. protocol: 'tests',
  12812. fn: function (){
  12813. var self=this;
  12814. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12815. return $core.withContext(function($ctx1) {
  12816. //>>excludeEnd("ctx");
  12817. var $1,$2;
  12818. $1=(3)._rounded();
  12819. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12820. $ctx1.sendIdx["rounded"]=1;
  12821. //>>excludeEnd("ctx");
  12822. self._assert_equals_($1,(3));
  12823. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12824. $ctx1.sendIdx["assert:equals:"]=1;
  12825. //>>excludeEnd("ctx");
  12826. $2=(3.212)._rounded();
  12827. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12828. $ctx1.sendIdx["rounded"]=2;
  12829. //>>excludeEnd("ctx");
  12830. self._assert_equals_($2,(3));
  12831. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12832. $ctx1.sendIdx["assert:equals:"]=2;
  12833. //>>excludeEnd("ctx");
  12834. self._assert_equals_((3.51)._rounded(),(4));
  12835. return self;
  12836. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12837. }, function($ctx1) {$ctx1.fill(self,"testRounded",{},$globals.NumberTest)});
  12838. //>>excludeEnd("ctx");
  12839. },
  12840. //>>excludeStart("ide", pragmas.excludeIdeData);
  12841. args: [],
  12842. 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",
  12843. referencedClasses: [],
  12844. //>>excludeEnd("ide");
  12845. messageSends: ["assert:equals:", "rounded"]
  12846. }),
  12847. $globals.NumberTest);
  12848. $core.addMethod(
  12849. $core.method({
  12850. selector: "testSign",
  12851. protocol: 'tests',
  12852. fn: function (){
  12853. var self=this;
  12854. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12855. return $core.withContext(function($ctx1) {
  12856. //>>excludeEnd("ctx");
  12857. var $1,$2;
  12858. $1=(5)._sign();
  12859. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12860. $ctx1.sendIdx["sign"]=1;
  12861. //>>excludeEnd("ctx");
  12862. self._assert_equals_($1,(1));
  12863. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12864. $ctx1.sendIdx["assert:equals:"]=1;
  12865. //>>excludeEnd("ctx");
  12866. $2=(0)._sign();
  12867. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12868. $ctx1.sendIdx["sign"]=2;
  12869. //>>excludeEnd("ctx");
  12870. self._assert_equals_($2,(0));
  12871. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12872. $ctx1.sendIdx["assert:equals:"]=2;
  12873. //>>excludeEnd("ctx");
  12874. self._assert_equals_((-1.4)._sign(),(-1));
  12875. return self;
  12876. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12877. }, function($ctx1) {$ctx1.fill(self,"testSign",{},$globals.NumberTest)});
  12878. //>>excludeEnd("ctx");
  12879. },
  12880. //>>excludeStart("ide", pragmas.excludeIdeData);
  12881. args: [],
  12882. source: "testSign\x0a\x09self assert: 5 sign equals: 1.\x0a\x09self assert: 0 sign equals: 0.\x0a\x09self assert: -1.4 sign equals: -1.",
  12883. referencedClasses: [],
  12884. //>>excludeEnd("ide");
  12885. messageSends: ["assert:equals:", "sign"]
  12886. }),
  12887. $globals.NumberTest);
  12888. $core.addMethod(
  12889. $core.method({
  12890. selector: "testSqrt",
  12891. protocol: 'tests',
  12892. fn: function (){
  12893. var self=this;
  12894. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12895. return $core.withContext(function($ctx1) {
  12896. //>>excludeEnd("ctx");
  12897. var $1;
  12898. $1=(4)._sqrt();
  12899. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12900. $ctx1.sendIdx["sqrt"]=1;
  12901. //>>excludeEnd("ctx");
  12902. self._assert_equals_($1,(2));
  12903. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12904. $ctx1.sendIdx["assert:equals:"]=1;
  12905. //>>excludeEnd("ctx");
  12906. self._assert_equals_((16)._sqrt(),(4));
  12907. return self;
  12908. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12909. }, function($ctx1) {$ctx1.fill(self,"testSqrt",{},$globals.NumberTest)});
  12910. //>>excludeEnd("ctx");
  12911. },
  12912. //>>excludeStart("ide", pragmas.excludeIdeData);
  12913. args: [],
  12914. source: "testSqrt\x0a\x09\x0a\x09self assert: 4 sqrt equals: 2.\x0a\x09self assert: 16 sqrt equals: 4",
  12915. referencedClasses: [],
  12916. //>>excludeEnd("ide");
  12917. messageSends: ["assert:equals:", "sqrt"]
  12918. }),
  12919. $globals.NumberTest);
  12920. $core.addMethod(
  12921. $core.method({
  12922. selector: "testSquared",
  12923. protocol: 'tests',
  12924. fn: function (){
  12925. var self=this;
  12926. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12927. return $core.withContext(function($ctx1) {
  12928. //>>excludeEnd("ctx");
  12929. self._assert_equals_((4)._squared(),(16));
  12930. return self;
  12931. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12932. }, function($ctx1) {$ctx1.fill(self,"testSquared",{},$globals.NumberTest)});
  12933. //>>excludeEnd("ctx");
  12934. },
  12935. //>>excludeStart("ide", pragmas.excludeIdeData);
  12936. args: [],
  12937. source: "testSquared\x0a\x09\x0a\x09self assert: 4 squared equals: 16",
  12938. referencedClasses: [],
  12939. //>>excludeEnd("ide");
  12940. messageSends: ["assert:equals:", "squared"]
  12941. }),
  12942. $globals.NumberTest);
  12943. $core.addMethod(
  12944. $core.method({
  12945. selector: "testTimesRepeat",
  12946. protocol: 'tests',
  12947. fn: function (){
  12948. var self=this;
  12949. var i;
  12950. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12951. return $core.withContext(function($ctx1) {
  12952. //>>excludeEnd("ctx");
  12953. i=(0);
  12954. (0)._timesRepeat_((function(){
  12955. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12956. return $core.withContext(function($ctx2) {
  12957. //>>excludeEnd("ctx");
  12958. i=$recv(i).__plus((1));
  12959. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12960. $ctx2.sendIdx["+"]=1;
  12961. //>>excludeEnd("ctx");
  12962. return i;
  12963. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12964. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  12965. //>>excludeEnd("ctx");
  12966. }));
  12967. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12968. $ctx1.sendIdx["timesRepeat:"]=1;
  12969. //>>excludeEnd("ctx");
  12970. self._assert_equals_(i,(0));
  12971. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12972. $ctx1.sendIdx["assert:equals:"]=1;
  12973. //>>excludeEnd("ctx");
  12974. (5)._timesRepeat_((function(){
  12975. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12976. return $core.withContext(function($ctx2) {
  12977. //>>excludeEnd("ctx");
  12978. i=$recv(i).__plus((1));
  12979. return i;
  12980. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12981. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  12982. //>>excludeEnd("ctx");
  12983. }));
  12984. self._assert_equals_(i,(5));
  12985. return self;
  12986. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12987. }, function($ctx1) {$ctx1.fill(self,"testTimesRepeat",{i:i},$globals.NumberTest)});
  12988. //>>excludeEnd("ctx");
  12989. },
  12990. //>>excludeStart("ide", pragmas.excludeIdeData);
  12991. args: [],
  12992. 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",
  12993. referencedClasses: [],
  12994. //>>excludeEnd("ide");
  12995. messageSends: ["timesRepeat:", "+", "assert:equals:"]
  12996. }),
  12997. $globals.NumberTest);
  12998. $core.addMethod(
  12999. $core.method({
  13000. selector: "testTo",
  13001. protocol: 'tests',
  13002. fn: function (){
  13003. var self=this;
  13004. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13005. return $core.withContext(function($ctx1) {
  13006. //>>excludeEnd("ctx");
  13007. self._assert_equals_((1)._to_((5)),[(1), (2), (3), (4), (5)]);
  13008. return self;
  13009. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13010. }, function($ctx1) {$ctx1.fill(self,"testTo",{},$globals.NumberTest)});
  13011. //>>excludeEnd("ctx");
  13012. },
  13013. //>>excludeStart("ide", pragmas.excludeIdeData);
  13014. args: [],
  13015. source: "testTo\x0a\x09self assert: (1 to: 5) equals: #(1 2 3 4 5)",
  13016. referencedClasses: [],
  13017. //>>excludeEnd("ide");
  13018. messageSends: ["assert:equals:", "to:"]
  13019. }),
  13020. $globals.NumberTest);
  13021. $core.addMethod(
  13022. $core.method({
  13023. selector: "testToBy",
  13024. protocol: 'tests',
  13025. fn: function (){
  13026. var self=this;
  13027. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13028. return $core.withContext(function($ctx1) {
  13029. //>>excludeEnd("ctx");
  13030. var $1;
  13031. $1=(0)._to_by_((6),(2));
  13032. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13033. $ctx1.sendIdx["to:by:"]=1;
  13034. //>>excludeEnd("ctx");
  13035. self._assert_equals_($1,[(0), (2), (4), (6)]);
  13036. self._should_raise_((function(){
  13037. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13038. return $core.withContext(function($ctx2) {
  13039. //>>excludeEnd("ctx");
  13040. return (1)._to_by_((4),(0));
  13041. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13042. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  13043. //>>excludeEnd("ctx");
  13044. }),$globals.Error);
  13045. return self;
  13046. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13047. }, function($ctx1) {$ctx1.fill(self,"testToBy",{},$globals.NumberTest)});
  13048. //>>excludeEnd("ctx");
  13049. },
  13050. //>>excludeStart("ide", pragmas.excludeIdeData);
  13051. args: [],
  13052. 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",
  13053. referencedClasses: ["Error"],
  13054. //>>excludeEnd("ide");
  13055. messageSends: ["assert:equals:", "to:by:", "should:raise:"]
  13056. }),
  13057. $globals.NumberTest);
  13058. $core.addMethod(
  13059. $core.method({
  13060. selector: "testTrigonometry",
  13061. protocol: 'tests',
  13062. fn: function (){
  13063. var self=this;
  13064. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13065. return $core.withContext(function($ctx1) {
  13066. //>>excludeEnd("ctx");
  13067. self._assert_equals_((0)._cos(),(1));
  13068. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13069. $ctx1.sendIdx["assert:equals:"]=1;
  13070. //>>excludeEnd("ctx");
  13071. self._assert_equals_((0)._sin(),(0));
  13072. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13073. $ctx1.sendIdx["assert:equals:"]=2;
  13074. //>>excludeEnd("ctx");
  13075. self._assert_equals_((0)._tan(),(0));
  13076. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13077. $ctx1.sendIdx["assert:equals:"]=3;
  13078. //>>excludeEnd("ctx");
  13079. self._assert_equals_((1)._arcCos(),(0));
  13080. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13081. $ctx1.sendIdx["assert:equals:"]=4;
  13082. //>>excludeEnd("ctx");
  13083. self._assert_equals_((0)._arcSin(),(0));
  13084. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13085. $ctx1.sendIdx["assert:equals:"]=5;
  13086. //>>excludeEnd("ctx");
  13087. self._assert_equals_((0)._arcTan(),(0));
  13088. return self;
  13089. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13090. }, function($ctx1) {$ctx1.fill(self,"testTrigonometry",{},$globals.NumberTest)});
  13091. //>>excludeEnd("ctx");
  13092. },
  13093. //>>excludeStart("ide", pragmas.excludeIdeData);
  13094. args: [],
  13095. 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.",
  13096. referencedClasses: [],
  13097. //>>excludeEnd("ide");
  13098. messageSends: ["assert:equals:", "cos", "sin", "tan", "arcCos", "arcSin", "arcTan"]
  13099. }),
  13100. $globals.NumberTest);
  13101. $core.addMethod(
  13102. $core.method({
  13103. selector: "testTruncated",
  13104. protocol: 'tests',
  13105. fn: function (){
  13106. var self=this;
  13107. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13108. return $core.withContext(function($ctx1) {
  13109. //>>excludeEnd("ctx");
  13110. var $1,$2;
  13111. $1=(3)._truncated();
  13112. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13113. $ctx1.sendIdx["truncated"]=1;
  13114. //>>excludeEnd("ctx");
  13115. self._assert_equals_($1,(3));
  13116. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13117. $ctx1.sendIdx["assert:equals:"]=1;
  13118. //>>excludeEnd("ctx");
  13119. $2=(3.212)._truncated();
  13120. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13121. $ctx1.sendIdx["truncated"]=2;
  13122. //>>excludeEnd("ctx");
  13123. self._assert_equals_($2,(3));
  13124. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13125. $ctx1.sendIdx["assert:equals:"]=2;
  13126. //>>excludeEnd("ctx");
  13127. self._assert_equals_((3.51)._truncated(),(3));
  13128. return self;
  13129. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13130. }, function($ctx1) {$ctx1.fill(self,"testTruncated",{},$globals.NumberTest)});
  13131. //>>excludeEnd("ctx");
  13132. },
  13133. //>>excludeStart("ide", pragmas.excludeIdeData);
  13134. args: [],
  13135. 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",
  13136. referencedClasses: [],
  13137. //>>excludeEnd("ide");
  13138. messageSends: ["assert:equals:", "truncated"]
  13139. }),
  13140. $globals.NumberTest);
  13141. $core.addClass('ObjectMock', $globals.Object, ['foo', 'bar'], 'Kernel-Tests');
  13142. //>>excludeStart("ide", pragmas.excludeIdeData);
  13143. $globals.ObjectMock.comment="ObjectMock is there only to perform tests on classes.";
  13144. //>>excludeEnd("ide");
  13145. $core.addMethod(
  13146. $core.method({
  13147. selector: "foo",
  13148. protocol: 'not yet classified',
  13149. fn: function (){
  13150. var self=this;
  13151. return self["@foo"];
  13152. },
  13153. //>>excludeStart("ide", pragmas.excludeIdeData);
  13154. args: [],
  13155. source: "foo\x0a\x09^ foo",
  13156. referencedClasses: [],
  13157. //>>excludeEnd("ide");
  13158. messageSends: []
  13159. }),
  13160. $globals.ObjectMock);
  13161. $core.addMethod(
  13162. $core.method({
  13163. selector: "foo:",
  13164. protocol: 'not yet classified',
  13165. fn: function (anObject){
  13166. var self=this;
  13167. self["@foo"]=anObject;
  13168. return self;
  13169. },
  13170. //>>excludeStart("ide", pragmas.excludeIdeData);
  13171. args: ["anObject"],
  13172. source: "foo: anObject\x0a\x09foo := anObject",
  13173. referencedClasses: [],
  13174. //>>excludeEnd("ide");
  13175. messageSends: []
  13176. }),
  13177. $globals.ObjectMock);
  13178. $core.addClass('ObjectTest', $globals.TestCase, [], 'Kernel-Tests');
  13179. $core.addMethod(
  13180. $core.method({
  13181. selector: "notDefined",
  13182. protocol: 'tests',
  13183. fn: function (){
  13184. var self=this;
  13185. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13186. return $core.withContext(function($ctx1) {
  13187. //>>excludeEnd("ctx");
  13188. return void 0;;
  13189. return self;
  13190. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13191. }, function($ctx1) {$ctx1.fill(self,"notDefined",{},$globals.ObjectTest)});
  13192. //>>excludeEnd("ctx");
  13193. },
  13194. //>>excludeStart("ide", pragmas.excludeIdeData);
  13195. args: [],
  13196. source: "notDefined\x0a\x09<return void 0;>",
  13197. referencedClasses: [],
  13198. //>>excludeEnd("ide");
  13199. messageSends: []
  13200. }),
  13201. $globals.ObjectTest);
  13202. $core.addMethod(
  13203. $core.method({
  13204. selector: "testBasicAccess",
  13205. protocol: 'tests',
  13206. fn: function (){
  13207. var self=this;
  13208. var o;
  13209. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13210. return $core.withContext(function($ctx1) {
  13211. //>>excludeEnd("ctx");
  13212. var $1;
  13213. o=$recv($globals.Object)._new();
  13214. $recv(o)._basicAt_put_("a",(1));
  13215. $1=$recv(o)._basicAt_("a");
  13216. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13217. $ctx1.sendIdx["basicAt:"]=1;
  13218. //>>excludeEnd("ctx");
  13219. self._assert_equals_($1,(1));
  13220. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13221. $ctx1.sendIdx["assert:equals:"]=1;
  13222. //>>excludeEnd("ctx");
  13223. self._assert_equals_($recv(o)._basicAt_("b"),nil);
  13224. return self;
  13225. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13226. }, function($ctx1) {$ctx1.fill(self,"testBasicAccess",{o:o},$globals.ObjectTest)});
  13227. //>>excludeEnd("ctx");
  13228. },
  13229. //>>excludeStart("ide", pragmas.excludeIdeData);
  13230. args: [],
  13231. 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",
  13232. referencedClasses: ["Object"],
  13233. //>>excludeEnd("ide");
  13234. messageSends: ["new", "basicAt:put:", "assert:equals:", "basicAt:"]
  13235. }),
  13236. $globals.ObjectTest);
  13237. $core.addMethod(
  13238. $core.method({
  13239. selector: "testBasicPerform",
  13240. protocol: 'tests',
  13241. fn: function (){
  13242. var self=this;
  13243. var o;
  13244. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13245. return $core.withContext(function($ctx1) {
  13246. //>>excludeEnd("ctx");
  13247. o=$recv($globals.Object)._new();
  13248. $recv(o)._basicAt_put_("func",(function(){
  13249. return "hello";
  13250. }));
  13251. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13252. $ctx1.sendIdx["basicAt:put:"]=1;
  13253. //>>excludeEnd("ctx");
  13254. $recv(o)._basicAt_put_("func2",(function(a){
  13255. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13256. return $core.withContext(function($ctx2) {
  13257. //>>excludeEnd("ctx");
  13258. return $recv(a).__plus((1));
  13259. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13260. }, function($ctx2) {$ctx2.fillBlock({a:a},$ctx1,2)});
  13261. //>>excludeEnd("ctx");
  13262. }));
  13263. self._assert_equals_($recv(o)._basicPerform_("func"),"hello");
  13264. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13265. $ctx1.sendIdx["assert:equals:"]=1;
  13266. //>>excludeEnd("ctx");
  13267. self._assert_equals_($recv(o)._basicPerform_withArguments_("func2",[(3)]),(4));
  13268. return self;
  13269. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13270. }, function($ctx1) {$ctx1.fill(self,"testBasicPerform",{o:o},$globals.ObjectTest)});
  13271. //>>excludeEnd("ctx");
  13272. },
  13273. //>>excludeStart("ide", pragmas.excludeIdeData);
  13274. args: [],
  13275. 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",
  13276. referencedClasses: ["Object"],
  13277. //>>excludeEnd("ide");
  13278. messageSends: ["new", "basicAt:put:", "+", "assert:equals:", "basicPerform:", "basicPerform:withArguments:"]
  13279. }),
  13280. $globals.ObjectTest);
  13281. $core.addMethod(
  13282. $core.method({
  13283. selector: "testDNU",
  13284. protocol: 'tests',
  13285. fn: function (){
  13286. var self=this;
  13287. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13288. return $core.withContext(function($ctx1) {
  13289. //>>excludeEnd("ctx");
  13290. self._should_raise_((function(){
  13291. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13292. return $core.withContext(function($ctx2) {
  13293. //>>excludeEnd("ctx");
  13294. return $recv($recv($globals.Object)._new())._foo();
  13295. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13296. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  13297. //>>excludeEnd("ctx");
  13298. }),$globals.MessageNotUnderstood);
  13299. return self;
  13300. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13301. }, function($ctx1) {$ctx1.fill(self,"testDNU",{},$globals.ObjectTest)});
  13302. //>>excludeEnd("ctx");
  13303. },
  13304. //>>excludeStart("ide", pragmas.excludeIdeData);
  13305. args: [],
  13306. source: "testDNU\x0a\x09self should: [ Object new foo ] raise: MessageNotUnderstood",
  13307. referencedClasses: ["Object", "MessageNotUnderstood"],
  13308. //>>excludeEnd("ide");
  13309. messageSends: ["should:raise:", "foo", "new"]
  13310. }),
  13311. $globals.ObjectTest);
  13312. $core.addMethod(
  13313. $core.method({
  13314. selector: "testEquality",
  13315. protocol: 'tests',
  13316. fn: function (){
  13317. var self=this;
  13318. var o;
  13319. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13320. return $core.withContext(function($ctx1) {
  13321. //>>excludeEnd("ctx");
  13322. var $1,$2,$4,$3;
  13323. o=$recv($globals.Object)._new();
  13324. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13325. $ctx1.sendIdx["new"]=1;
  13326. //>>excludeEnd("ctx");
  13327. $1=$recv(o).__eq($recv($globals.Object)._new());
  13328. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13329. $ctx1.sendIdx["="]=1;
  13330. //>>excludeEnd("ctx");
  13331. self._deny_($1);
  13332. $2=$recv(o).__eq(o);
  13333. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13334. $ctx1.sendIdx["="]=2;
  13335. //>>excludeEnd("ctx");
  13336. self._assert_($2);
  13337. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13338. $ctx1.sendIdx["assert:"]=1;
  13339. //>>excludeEnd("ctx");
  13340. $4=$recv(o)._yourself();
  13341. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13342. $ctx1.sendIdx["yourself"]=1;
  13343. //>>excludeEnd("ctx");
  13344. $3=$recv($4).__eq(o);
  13345. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13346. $ctx1.sendIdx["="]=3;
  13347. //>>excludeEnd("ctx");
  13348. self._assert_($3);
  13349. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13350. $ctx1.sendIdx["assert:"]=2;
  13351. //>>excludeEnd("ctx");
  13352. self._assert_($recv(o).__eq($recv(o)._yourself()));
  13353. return self;
  13354. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13355. }, function($ctx1) {$ctx1.fill(self,"testEquality",{o:o},$globals.ObjectTest)});
  13356. //>>excludeEnd("ctx");
  13357. },
  13358. //>>excludeStart("ide", pragmas.excludeIdeData);
  13359. args: [],
  13360. 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)",
  13361. referencedClasses: ["Object"],
  13362. //>>excludeEnd("ide");
  13363. messageSends: ["new", "deny:", "=", "assert:", "yourself"]
  13364. }),
  13365. $globals.ObjectTest);
  13366. $core.addMethod(
  13367. $core.method({
  13368. selector: "testHalt",
  13369. protocol: 'tests',
  13370. fn: function (){
  13371. var self=this;
  13372. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13373. return $core.withContext(function($ctx1) {
  13374. //>>excludeEnd("ctx");
  13375. self._should_raise_((function(){
  13376. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13377. return $core.withContext(function($ctx2) {
  13378. //>>excludeEnd("ctx");
  13379. return $recv($recv($globals.Object)._new())._halt();
  13380. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13381. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  13382. //>>excludeEnd("ctx");
  13383. }),$globals.Error);
  13384. return self;
  13385. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13386. }, function($ctx1) {$ctx1.fill(self,"testHalt",{},$globals.ObjectTest)});
  13387. //>>excludeEnd("ctx");
  13388. },
  13389. //>>excludeStart("ide", pragmas.excludeIdeData);
  13390. args: [],
  13391. source: "testHalt\x0a\x09self should: [ Object new halt ] raise: Error",
  13392. referencedClasses: ["Object", "Error"],
  13393. //>>excludeEnd("ide");
  13394. messageSends: ["should:raise:", "halt", "new"]
  13395. }),
  13396. $globals.ObjectTest);
  13397. $core.addMethod(
  13398. $core.method({
  13399. selector: "testIdentity",
  13400. protocol: 'tests',
  13401. fn: function (){
  13402. var self=this;
  13403. var o;
  13404. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13405. return $core.withContext(function($ctx1) {
  13406. //>>excludeEnd("ctx");
  13407. var $1,$2,$4,$3;
  13408. o=$recv($globals.Object)._new();
  13409. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13410. $ctx1.sendIdx["new"]=1;
  13411. //>>excludeEnd("ctx");
  13412. $1=$recv(o).__eq_eq($recv($globals.Object)._new());
  13413. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13414. $ctx1.sendIdx["=="]=1;
  13415. //>>excludeEnd("ctx");
  13416. self._deny_($1);
  13417. $2=$recv(o).__eq_eq(o);
  13418. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13419. $ctx1.sendIdx["=="]=2;
  13420. //>>excludeEnd("ctx");
  13421. self._assert_($2);
  13422. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13423. $ctx1.sendIdx["assert:"]=1;
  13424. //>>excludeEnd("ctx");
  13425. $4=$recv(o)._yourself();
  13426. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13427. $ctx1.sendIdx["yourself"]=1;
  13428. //>>excludeEnd("ctx");
  13429. $3=$recv($4).__eq_eq(o);
  13430. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13431. $ctx1.sendIdx["=="]=3;
  13432. //>>excludeEnd("ctx");
  13433. self._assert_($3);
  13434. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13435. $ctx1.sendIdx["assert:"]=2;
  13436. //>>excludeEnd("ctx");
  13437. self._assert_($recv(o).__eq_eq($recv(o)._yourself()));
  13438. return self;
  13439. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13440. }, function($ctx1) {$ctx1.fill(self,"testIdentity",{o:o},$globals.ObjectTest)});
  13441. //>>excludeEnd("ctx");
  13442. },
  13443. //>>excludeStart("ide", pragmas.excludeIdeData);
  13444. args: [],
  13445. 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",
  13446. referencedClasses: ["Object"],
  13447. //>>excludeEnd("ide");
  13448. messageSends: ["new", "deny:", "==", "assert:", "yourself"]
  13449. }),
  13450. $globals.ObjectTest);
  13451. $core.addMethod(
  13452. $core.method({
  13453. selector: "testIfNil",
  13454. protocol: 'tests',
  13455. fn: function (){
  13456. var self=this;
  13457. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13458. return $core.withContext(function($ctx1) {
  13459. //>>excludeEnd("ctx");
  13460. var $2,$1,$5,$4,$3,$7,$6,$9,$8,$11,$10,$receiver;
  13461. $2=$recv($globals.Object)._new();
  13462. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13463. $ctx1.sendIdx["new"]=1;
  13464. //>>excludeEnd("ctx");
  13465. $1=$recv($2)._isNil();
  13466. self._deny_($1);
  13467. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13468. $ctx1.sendIdx["deny:"]=1;
  13469. //>>excludeEnd("ctx");
  13470. $5=$recv($globals.Object)._new();
  13471. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13472. $ctx1.sendIdx["new"]=2;
  13473. //>>excludeEnd("ctx");
  13474. if(($receiver = $5) == null || $receiver.isNil){
  13475. $4=true;
  13476. } else {
  13477. $4=$5;
  13478. };
  13479. $3=$recv($4).__eq(true);
  13480. self._deny_($3);
  13481. $7=$recv($globals.Object)._new();
  13482. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13483. $ctx1.sendIdx["new"]=3;
  13484. //>>excludeEnd("ctx");
  13485. if(($receiver = $7) == null || $receiver.isNil){
  13486. $6=$7;
  13487. } else {
  13488. $6=true;
  13489. };
  13490. self._assert_equals_($6,true);
  13491. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13492. $ctx1.sendIdx["assert:equals:"]=1;
  13493. //>>excludeEnd("ctx");
  13494. $9=$recv($globals.Object)._new();
  13495. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13496. $ctx1.sendIdx["new"]=4;
  13497. //>>excludeEnd("ctx");
  13498. if(($receiver = $9) == null || $receiver.isNil){
  13499. $8=false;
  13500. } else {
  13501. $8=true;
  13502. };
  13503. self._assert_equals_($8,true);
  13504. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13505. $ctx1.sendIdx["assert:equals:"]=2;
  13506. //>>excludeEnd("ctx");
  13507. $11=$recv($globals.Object)._new();
  13508. if(($receiver = $11) == null || $receiver.isNil){
  13509. $10=false;
  13510. } else {
  13511. $10=true;
  13512. };
  13513. self._assert_equals_($10,true);
  13514. return self;
  13515. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13516. }, function($ctx1) {$ctx1.fill(self,"testIfNil",{},$globals.ObjectTest)});
  13517. //>>excludeEnd("ctx");
  13518. },
  13519. //>>excludeStart("ide", pragmas.excludeIdeData);
  13520. args: [],
  13521. 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",
  13522. referencedClasses: ["Object"],
  13523. //>>excludeEnd("ide");
  13524. messageSends: ["deny:", "isNil", "new", "=", "ifNil:", "assert:equals:", "ifNotNil:", "ifNil:ifNotNil:", "ifNotNil:ifNil:"]
  13525. }),
  13526. $globals.ObjectTest);
  13527. $core.addMethod(
  13528. $core.method({
  13529. selector: "testInstVars",
  13530. protocol: 'tests',
  13531. fn: function (){
  13532. var self=this;
  13533. var o;
  13534. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13535. return $core.withContext(function($ctx1) {
  13536. //>>excludeEnd("ctx");
  13537. var $1,$2;
  13538. o=$recv($globals.ObjectMock)._new();
  13539. $1=$recv(o)._instVarAt_("foo");
  13540. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13541. $ctx1.sendIdx["instVarAt:"]=1;
  13542. //>>excludeEnd("ctx");
  13543. self._assert_equals_($1,nil);
  13544. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13545. $ctx1.sendIdx["assert:equals:"]=1;
  13546. //>>excludeEnd("ctx");
  13547. $recv(o)._instVarAt_put_("foo",(1));
  13548. $2=$recv(o)._instVarAt_("foo");
  13549. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13550. $ctx1.sendIdx["instVarAt:"]=2;
  13551. //>>excludeEnd("ctx");
  13552. self._assert_equals_($2,(1));
  13553. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13554. $ctx1.sendIdx["assert:equals:"]=2;
  13555. //>>excludeEnd("ctx");
  13556. self._assert_equals_($recv(o)._instVarAt_("foo"),(1));
  13557. return self;
  13558. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13559. }, function($ctx1) {$ctx1.fill(self,"testInstVars",{o:o},$globals.ObjectTest)});
  13560. //>>excludeEnd("ctx");
  13561. },
  13562. //>>excludeStart("ide", pragmas.excludeIdeData);
  13563. args: [],
  13564. 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",
  13565. referencedClasses: ["ObjectMock"],
  13566. //>>excludeEnd("ide");
  13567. messageSends: ["new", "assert:equals:", "instVarAt:", "instVarAt:put:"]
  13568. }),
  13569. $globals.ObjectTest);
  13570. $core.addMethod(
  13571. $core.method({
  13572. selector: "testNilUndefined",
  13573. protocol: 'tests',
  13574. fn: function (){
  13575. var self=this;
  13576. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13577. return $core.withContext(function($ctx1) {
  13578. //>>excludeEnd("ctx");
  13579. self._assert_equals_(self._notDefined(),nil);
  13580. return self;
  13581. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13582. }, function($ctx1) {$ctx1.fill(self,"testNilUndefined",{},$globals.ObjectTest)});
  13583. //>>excludeEnd("ctx");
  13584. },
  13585. //>>excludeStart("ide", pragmas.excludeIdeData);
  13586. args: [],
  13587. source: "testNilUndefined\x0a\x09\x22nil in Smalltalk is the undefined object in JS\x22\x0a\x0a\x09self assert: self notDefined equals: nil",
  13588. referencedClasses: [],
  13589. //>>excludeEnd("ide");
  13590. messageSends: ["assert:equals:", "notDefined"]
  13591. }),
  13592. $globals.ObjectTest);
  13593. $core.addMethod(
  13594. $core.method({
  13595. selector: "testYourself",
  13596. protocol: 'tests',
  13597. fn: function (){
  13598. var self=this;
  13599. var o;
  13600. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13601. return $core.withContext(function($ctx1) {
  13602. //>>excludeEnd("ctx");
  13603. o=$recv($globals.ObjectMock)._new();
  13604. self._assert_($recv($recv(o)._yourself()).__eq_eq(o));
  13605. return self;
  13606. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13607. }, function($ctx1) {$ctx1.fill(self,"testYourself",{o:o},$globals.ObjectTest)});
  13608. //>>excludeEnd("ctx");
  13609. },
  13610. //>>excludeStart("ide", pragmas.excludeIdeData);
  13611. args: [],
  13612. source: "testYourself\x0a\x09| o |\x0a\x09o := ObjectMock new.\x0a\x09self assert: o yourself == o",
  13613. referencedClasses: ["ObjectMock"],
  13614. //>>excludeEnd("ide");
  13615. messageSends: ["new", "assert:", "==", "yourself"]
  13616. }),
  13617. $globals.ObjectTest);
  13618. $core.addMethod(
  13619. $core.method({
  13620. selector: "testidentityHash",
  13621. protocol: 'tests',
  13622. fn: function (){
  13623. var self=this;
  13624. var o1,o2;
  13625. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13626. return $core.withContext(function($ctx1) {
  13627. //>>excludeEnd("ctx");
  13628. var $2,$3,$1,$5,$4;
  13629. o1=$recv($globals.Object)._new();
  13630. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13631. $ctx1.sendIdx["new"]=1;
  13632. //>>excludeEnd("ctx");
  13633. o2=$recv($globals.Object)._new();
  13634. $2=$recv(o1)._identityHash();
  13635. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13636. $ctx1.sendIdx["identityHash"]=1;
  13637. //>>excludeEnd("ctx");
  13638. $3=$recv(o1)._identityHash();
  13639. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13640. $ctx1.sendIdx["identityHash"]=2;
  13641. //>>excludeEnd("ctx");
  13642. $1=$recv($2).__eq_eq($3);
  13643. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13644. $ctx1.sendIdx["=="]=1;
  13645. //>>excludeEnd("ctx");
  13646. self._assert_($1);
  13647. $5=$recv(o1)._identityHash();
  13648. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13649. $ctx1.sendIdx["identityHash"]=3;
  13650. //>>excludeEnd("ctx");
  13651. $4=$recv($5).__eq_eq($recv(o2)._identityHash());
  13652. self._deny_($4);
  13653. return self;
  13654. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13655. }, function($ctx1) {$ctx1.fill(self,"testidentityHash",{o1:o1,o2:o2},$globals.ObjectTest)});
  13656. //>>excludeEnd("ctx");
  13657. },
  13658. //>>excludeStart("ide", pragmas.excludeIdeData);
  13659. args: [],
  13660. source: "testidentityHash\x0a\x09| o1 o2 |\x0a\x09\x0a\x09o1 := Object new.\x0a\x09o2 := Object new.\x0a\x0a\x09self assert: o1 identityHash == o1 identityHash.\x0a\x09self deny: o1 identityHash == o2 identityHash",
  13661. referencedClasses: ["Object"],
  13662. //>>excludeEnd("ide");
  13663. messageSends: ["new", "assert:", "==", "identityHash", "deny:"]
  13664. }),
  13665. $globals.ObjectTest);
  13666. $core.addClass('PointTest', $globals.TestCase, [], 'Kernel-Tests');
  13667. $core.addMethod(
  13668. $core.method({
  13669. selector: "testAccessing",
  13670. protocol: 'tests',
  13671. fn: function (){
  13672. var self=this;
  13673. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13674. return $core.withContext(function($ctx1) {
  13675. //>>excludeEnd("ctx");
  13676. var $2,$1,$3,$6,$5,$4;
  13677. $2=$recv($globals.Point)._x_y_((3),(4));
  13678. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13679. $ctx1.sendIdx["x:y:"]=1;
  13680. //>>excludeEnd("ctx");
  13681. $1=$recv($2)._x();
  13682. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13683. $ctx1.sendIdx["x"]=1;
  13684. //>>excludeEnd("ctx");
  13685. self._assert_equals_($1,(3));
  13686. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13687. $ctx1.sendIdx["assert:equals:"]=1;
  13688. //>>excludeEnd("ctx");
  13689. $3=$recv($recv($globals.Point)._x_y_((3),(4)))._y();
  13690. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13691. $ctx1.sendIdx["y"]=1;
  13692. //>>excludeEnd("ctx");
  13693. self._assert_equals_($3,(4));
  13694. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13695. $ctx1.sendIdx["assert:equals:"]=2;
  13696. //>>excludeEnd("ctx");
  13697. $6=$recv($globals.Point)._new();
  13698. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13699. $ctx1.sendIdx["new"]=1;
  13700. //>>excludeEnd("ctx");
  13701. $5=$recv($6)._x_((3));
  13702. $4=$recv($5)._x();
  13703. self._assert_equals_($4,(3));
  13704. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13705. $ctx1.sendIdx["assert:equals:"]=3;
  13706. //>>excludeEnd("ctx");
  13707. self._assert_equals_($recv($recv($recv($globals.Point)._new())._y_((4)))._y(),(4));
  13708. return self;
  13709. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13710. }, function($ctx1) {$ctx1.fill(self,"testAccessing",{},$globals.PointTest)});
  13711. //>>excludeEnd("ctx");
  13712. },
  13713. //>>excludeStart("ide", pragmas.excludeIdeData);
  13714. args: [],
  13715. 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",
  13716. referencedClasses: ["Point"],
  13717. //>>excludeEnd("ide");
  13718. messageSends: ["assert:equals:", "x", "x:y:", "y", "x:", "new", "y:"]
  13719. }),
  13720. $globals.PointTest);
  13721. $core.addMethod(
  13722. $core.method({
  13723. selector: "testArithmetic",
  13724. protocol: 'tests',
  13725. fn: function (){
  13726. var self=this;
  13727. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13728. return $core.withContext(function($ctx1) {
  13729. //>>excludeEnd("ctx");
  13730. var $2,$3,$1,$4,$6,$7,$5,$8,$10,$11,$9,$12,$14,$13;
  13731. $2=(3).__at((4));
  13732. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13733. $ctx1.sendIdx["@"]=1;
  13734. //>>excludeEnd("ctx");
  13735. $3=(3).__at((4));
  13736. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13737. $ctx1.sendIdx["@"]=2;
  13738. //>>excludeEnd("ctx");
  13739. $1=$recv($2).__star($3);
  13740. $4=$recv($globals.Point)._x_y_((9),(16));
  13741. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13742. $ctx1.sendIdx["x:y:"]=1;
  13743. //>>excludeEnd("ctx");
  13744. self._assert_equals_($1,$4);
  13745. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13746. $ctx1.sendIdx["assert:equals:"]=1;
  13747. //>>excludeEnd("ctx");
  13748. $6=(3).__at((4));
  13749. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13750. $ctx1.sendIdx["@"]=3;
  13751. //>>excludeEnd("ctx");
  13752. $7=(3).__at((4));
  13753. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13754. $ctx1.sendIdx["@"]=4;
  13755. //>>excludeEnd("ctx");
  13756. $5=$recv($6).__plus($7);
  13757. $8=$recv($globals.Point)._x_y_((6),(8));
  13758. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13759. $ctx1.sendIdx["x:y:"]=2;
  13760. //>>excludeEnd("ctx");
  13761. self._assert_equals_($5,$8);
  13762. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13763. $ctx1.sendIdx["assert:equals:"]=2;
  13764. //>>excludeEnd("ctx");
  13765. $10=(3).__at((4));
  13766. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13767. $ctx1.sendIdx["@"]=5;
  13768. //>>excludeEnd("ctx");
  13769. $11=(3).__at((4));
  13770. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13771. $ctx1.sendIdx["@"]=6;
  13772. //>>excludeEnd("ctx");
  13773. $9=$recv($10).__minus($11);
  13774. $12=$recv($globals.Point)._x_y_((0),(0));
  13775. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13776. $ctx1.sendIdx["x:y:"]=3;
  13777. //>>excludeEnd("ctx");
  13778. self._assert_equals_($9,$12);
  13779. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13780. $ctx1.sendIdx["assert:equals:"]=3;
  13781. //>>excludeEnd("ctx");
  13782. $14=(6).__at((8));
  13783. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13784. $ctx1.sendIdx["@"]=7;
  13785. //>>excludeEnd("ctx");
  13786. $13=$recv($14).__slash((3).__at((4)));
  13787. self._assert_equals_($13,$recv($globals.Point)._x_y_((2),(2)));
  13788. return self;
  13789. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13790. }, function($ctx1) {$ctx1.fill(self,"testArithmetic",{},$globals.PointTest)});
  13791. //>>excludeEnd("ctx");
  13792. },
  13793. //>>excludeStart("ide", pragmas.excludeIdeData);
  13794. args: [],
  13795. 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)",
  13796. referencedClasses: ["Point"],
  13797. //>>excludeEnd("ide");
  13798. messageSends: ["assert:equals:", "*", "@", "x:y:", "+", "-", "/"]
  13799. }),
  13800. $globals.PointTest);
  13801. $core.addMethod(
  13802. $core.method({
  13803. selector: "testAt",
  13804. protocol: 'tests',
  13805. fn: function (){
  13806. var self=this;
  13807. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13808. return $core.withContext(function($ctx1) {
  13809. //>>excludeEnd("ctx");
  13810. self._assert_equals_((3).__at((4)),$recv($globals.Point)._x_y_((3),(4)));
  13811. return self;
  13812. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13813. }, function($ctx1) {$ctx1.fill(self,"testAt",{},$globals.PointTest)});
  13814. //>>excludeEnd("ctx");
  13815. },
  13816. //>>excludeStart("ide", pragmas.excludeIdeData);
  13817. args: [],
  13818. source: "testAt\x0a\x09self assert: 3@4 equals: (Point x: 3 y: 4)",
  13819. referencedClasses: ["Point"],
  13820. //>>excludeEnd("ide");
  13821. messageSends: ["assert:equals:", "@", "x:y:"]
  13822. }),
  13823. $globals.PointTest);
  13824. $core.addMethod(
  13825. $core.method({
  13826. selector: "testComparison",
  13827. protocol: 'tests',
  13828. fn: function (){
  13829. var self=this;
  13830. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13831. return $core.withContext(function($ctx1) {
  13832. //>>excludeEnd("ctx");
  13833. var $2,$3,$1,$5,$6,$4,$8,$9,$7,$11,$12,$10,$14,$15,$13,$17,$18,$16,$20,$21,$19,$23,$22;
  13834. $2=(3).__at((4));
  13835. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13836. $ctx1.sendIdx["@"]=1;
  13837. //>>excludeEnd("ctx");
  13838. $3=(4).__at((5));
  13839. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13840. $ctx1.sendIdx["@"]=2;
  13841. //>>excludeEnd("ctx");
  13842. $1=$recv($2).__lt($3);
  13843. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13844. $ctx1.sendIdx["<"]=1;
  13845. //>>excludeEnd("ctx");
  13846. self._assert_($1);
  13847. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13848. $ctx1.sendIdx["assert:"]=1;
  13849. //>>excludeEnd("ctx");
  13850. $5=(3).__at((4));
  13851. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13852. $ctx1.sendIdx["@"]=3;
  13853. //>>excludeEnd("ctx");
  13854. $6=(4).__at((4));
  13855. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13856. $ctx1.sendIdx["@"]=4;
  13857. //>>excludeEnd("ctx");
  13858. $4=$recv($5).__lt($6);
  13859. self._deny_($4);
  13860. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13861. $ctx1.sendIdx["deny:"]=1;
  13862. //>>excludeEnd("ctx");
  13863. $8=(4).__at((5));
  13864. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13865. $ctx1.sendIdx["@"]=5;
  13866. //>>excludeEnd("ctx");
  13867. $9=(4).__at((5));
  13868. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13869. $ctx1.sendIdx["@"]=6;
  13870. //>>excludeEnd("ctx");
  13871. $7=$recv($8).__lt_eq($9);
  13872. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13873. $ctx1.sendIdx["<="]=1;
  13874. //>>excludeEnd("ctx");
  13875. self._assert_($7);
  13876. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13877. $ctx1.sendIdx["assert:"]=2;
  13878. //>>excludeEnd("ctx");
  13879. $11=(4).__at((5));
  13880. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13881. $ctx1.sendIdx["@"]=7;
  13882. //>>excludeEnd("ctx");
  13883. $12=(3).__at((5));
  13884. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13885. $ctx1.sendIdx["@"]=8;
  13886. //>>excludeEnd("ctx");
  13887. $10=$recv($11).__lt_eq($12);
  13888. self._deny_($10);
  13889. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13890. $ctx1.sendIdx["deny:"]=2;
  13891. //>>excludeEnd("ctx");
  13892. $14=(5).__at((6));
  13893. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13894. $ctx1.sendIdx["@"]=9;
  13895. //>>excludeEnd("ctx");
  13896. $15=(4).__at((5));
  13897. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13898. $ctx1.sendIdx["@"]=10;
  13899. //>>excludeEnd("ctx");
  13900. $13=$recv($14).__gt($15);
  13901. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13902. $ctx1.sendIdx[">"]=1;
  13903. //>>excludeEnd("ctx");
  13904. self._assert_($13);
  13905. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13906. $ctx1.sendIdx["assert:"]=3;
  13907. //>>excludeEnd("ctx");
  13908. $17=(5).__at((6));
  13909. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13910. $ctx1.sendIdx["@"]=11;
  13911. //>>excludeEnd("ctx");
  13912. $18=(6).__at((6));
  13913. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13914. $ctx1.sendIdx["@"]=12;
  13915. //>>excludeEnd("ctx");
  13916. $16=$recv($17).__gt($18);
  13917. self._deny_($16);
  13918. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13919. $ctx1.sendIdx["deny:"]=3;
  13920. //>>excludeEnd("ctx");
  13921. $20=(4).__at((5));
  13922. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13923. $ctx1.sendIdx["@"]=13;
  13924. //>>excludeEnd("ctx");
  13925. $21=(4).__at((5));
  13926. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13927. $ctx1.sendIdx["@"]=14;
  13928. //>>excludeEnd("ctx");
  13929. $19=$recv($20).__gt_eq($21);
  13930. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13931. $ctx1.sendIdx[">="]=1;
  13932. //>>excludeEnd("ctx");
  13933. self._assert_($19);
  13934. $23=(4).__at((5));
  13935. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13936. $ctx1.sendIdx["@"]=15;
  13937. //>>excludeEnd("ctx");
  13938. $22=$recv($23).__gt_eq((5).__at((5)));
  13939. self._deny_($22);
  13940. return self;
  13941. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13942. }, function($ctx1) {$ctx1.fill(self,"testComparison",{},$globals.PointTest)});
  13943. //>>excludeEnd("ctx");
  13944. },
  13945. //>>excludeStart("ide", pragmas.excludeIdeData);
  13946. args: [],
  13947. 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)",
  13948. referencedClasses: [],
  13949. //>>excludeEnd("ide");
  13950. messageSends: ["assert:", "<", "@", "deny:", "<=", ">", ">="]
  13951. }),
  13952. $globals.PointTest);
  13953. $core.addMethod(
  13954. $core.method({
  13955. selector: "testEgality",
  13956. protocol: 'tests',
  13957. fn: function (){
  13958. var self=this;
  13959. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13960. return $core.withContext(function($ctx1) {
  13961. //>>excludeEnd("ctx");
  13962. var $2,$3,$1,$5,$4;
  13963. $2=(3).__at((4));
  13964. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13965. $ctx1.sendIdx["@"]=1;
  13966. //>>excludeEnd("ctx");
  13967. $3=(3).__at((4));
  13968. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13969. $ctx1.sendIdx["@"]=2;
  13970. //>>excludeEnd("ctx");
  13971. $1=$recv($2).__eq($3);
  13972. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13973. $ctx1.sendIdx["="]=1;
  13974. //>>excludeEnd("ctx");
  13975. self._assert_($1);
  13976. $5=(3).__at((5));
  13977. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13978. $ctx1.sendIdx["@"]=3;
  13979. //>>excludeEnd("ctx");
  13980. $4=$recv($5).__eq((3).__at((6)));
  13981. self._deny_($4);
  13982. return self;
  13983. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13984. }, function($ctx1) {$ctx1.fill(self,"testEgality",{},$globals.PointTest)});
  13985. //>>excludeEnd("ctx");
  13986. },
  13987. //>>excludeStart("ide", pragmas.excludeIdeData);
  13988. args: [],
  13989. source: "testEgality\x0a\x09self assert: (3@4 = (3@4)).\x0a\x09self deny: 3@5 = (3@6)",
  13990. referencedClasses: [],
  13991. //>>excludeEnd("ide");
  13992. messageSends: ["assert:", "=", "@", "deny:"]
  13993. }),
  13994. $globals.PointTest);
  13995. $core.addMethod(
  13996. $core.method({
  13997. selector: "testNew",
  13998. protocol: 'tests',
  13999. fn: function (){
  14000. var self=this;
  14001. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14002. return $core.withContext(function($ctx1) {
  14003. //>>excludeEnd("ctx");
  14004. var $3,$2,$1,$7,$6,$5,$4,$10,$9,$8;
  14005. $3=$recv($globals.Point)._new();
  14006. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14007. $ctx1.sendIdx["new"]=1;
  14008. //>>excludeEnd("ctx");
  14009. $2=$recv($3)._x_((3));
  14010. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14011. $ctx1.sendIdx["x:"]=1;
  14012. //>>excludeEnd("ctx");
  14013. $1=$recv($2)._y();
  14014. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14015. $ctx1.sendIdx["y"]=1;
  14016. //>>excludeEnd("ctx");
  14017. self._assert_equals_($1,nil);
  14018. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14019. $ctx1.sendIdx["assert:equals:"]=1;
  14020. //>>excludeEnd("ctx");
  14021. $7=$recv($globals.Point)._new();
  14022. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14023. $ctx1.sendIdx["new"]=2;
  14024. //>>excludeEnd("ctx");
  14025. $6=$recv($7)._x_((3));
  14026. $5=$recv($6)._x();
  14027. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14028. $ctx1.sendIdx["x"]=1;
  14029. //>>excludeEnd("ctx");
  14030. $4=$recv($5).__eq((0));
  14031. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14032. $ctx1.sendIdx["="]=1;
  14033. //>>excludeEnd("ctx");
  14034. self._deny_($4);
  14035. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14036. $ctx1.sendIdx["deny:"]=1;
  14037. //>>excludeEnd("ctx");
  14038. $10=$recv($globals.Point)._new();
  14039. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14040. $ctx1.sendIdx["new"]=3;
  14041. //>>excludeEnd("ctx");
  14042. $9=$recv($10)._y_((4));
  14043. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14044. $ctx1.sendIdx["y:"]=1;
  14045. //>>excludeEnd("ctx");
  14046. $8=$recv($9)._x();
  14047. self._assert_equals_($8,nil);
  14048. self._deny_($recv($recv($recv($recv($globals.Point)._new())._y_((4)))._y()).__eq((0)));
  14049. return self;
  14050. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14051. }, function($ctx1) {$ctx1.fill(self,"testNew",{},$globals.PointTest)});
  14052. //>>excludeEnd("ctx");
  14053. },
  14054. //>>excludeStart("ide", pragmas.excludeIdeData);
  14055. args: [],
  14056. 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",
  14057. referencedClasses: ["Point"],
  14058. //>>excludeEnd("ide");
  14059. messageSends: ["assert:equals:", "y", "x:", "new", "deny:", "=", "x", "y:"]
  14060. }),
  14061. $globals.PointTest);
  14062. $core.addMethod(
  14063. $core.method({
  14064. selector: "testTranslateBy",
  14065. protocol: 'tests',
  14066. fn: function (){
  14067. var self=this;
  14068. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14069. return $core.withContext(function($ctx1) {
  14070. //>>excludeEnd("ctx");
  14071. var $2,$3,$1,$4,$6,$8,$7,$5,$9,$11,$12,$10,$13,$15,$16,$14;
  14072. $2=(3).__at((3));
  14073. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14074. $ctx1.sendIdx["@"]=1;
  14075. //>>excludeEnd("ctx");
  14076. $3=(0).__at((1));
  14077. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14078. $ctx1.sendIdx["@"]=2;
  14079. //>>excludeEnd("ctx");
  14080. $1=$recv($2)._translateBy_($3);
  14081. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14082. $ctx1.sendIdx["translateBy:"]=1;
  14083. //>>excludeEnd("ctx");
  14084. $4=(3).__at((4));
  14085. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14086. $ctx1.sendIdx["@"]=3;
  14087. //>>excludeEnd("ctx");
  14088. self._assert_equals_($1,$4);
  14089. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14090. $ctx1.sendIdx["assert:equals:"]=1;
  14091. //>>excludeEnd("ctx");
  14092. $6=(3).__at((3));
  14093. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14094. $ctx1.sendIdx["@"]=4;
  14095. //>>excludeEnd("ctx");
  14096. $8=(1)._negated();
  14097. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14098. $ctx1.sendIdx["negated"]=1;
  14099. //>>excludeEnd("ctx");
  14100. $7=(0).__at($8);
  14101. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14102. $ctx1.sendIdx["@"]=5;
  14103. //>>excludeEnd("ctx");
  14104. $5=$recv($6)._translateBy_($7);
  14105. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14106. $ctx1.sendIdx["translateBy:"]=2;
  14107. //>>excludeEnd("ctx");
  14108. $9=(3).__at((2));
  14109. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14110. $ctx1.sendIdx["@"]=6;
  14111. //>>excludeEnd("ctx");
  14112. self._assert_equals_($5,$9);
  14113. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14114. $ctx1.sendIdx["assert:equals:"]=2;
  14115. //>>excludeEnd("ctx");
  14116. $11=(3).__at((3));
  14117. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14118. $ctx1.sendIdx["@"]=7;
  14119. //>>excludeEnd("ctx");
  14120. $12=(2).__at((3));
  14121. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14122. $ctx1.sendIdx["@"]=8;
  14123. //>>excludeEnd("ctx");
  14124. $10=$recv($11)._translateBy_($12);
  14125. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14126. $ctx1.sendIdx["translateBy:"]=3;
  14127. //>>excludeEnd("ctx");
  14128. $13=(5).__at((6));
  14129. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14130. $ctx1.sendIdx["@"]=9;
  14131. //>>excludeEnd("ctx");
  14132. self._assert_equals_($10,$13);
  14133. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14134. $ctx1.sendIdx["assert:equals:"]=3;
  14135. //>>excludeEnd("ctx");
  14136. $15=(3).__at((3));
  14137. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14138. $ctx1.sendIdx["@"]=10;
  14139. //>>excludeEnd("ctx");
  14140. $16=$recv((3)._negated()).__at((0));
  14141. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14142. $ctx1.sendIdx["@"]=11;
  14143. //>>excludeEnd("ctx");
  14144. $14=$recv($15)._translateBy_($16);
  14145. self._assert_equals_($14,(0).__at((3)));
  14146. return self;
  14147. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14148. }, function($ctx1) {$ctx1.fill(self,"testTranslateBy",{},$globals.PointTest)});
  14149. //>>excludeEnd("ctx");
  14150. },
  14151. //>>excludeStart("ide", pragmas.excludeIdeData);
  14152. args: [],
  14153. 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.",
  14154. referencedClasses: [],
  14155. //>>excludeEnd("ide");
  14156. messageSends: ["assert:equals:", "translateBy:", "@", "negated"]
  14157. }),
  14158. $globals.PointTest);
  14159. $core.addClass('QueueTest', $globals.TestCase, [], 'Kernel-Tests');
  14160. $core.addMethod(
  14161. $core.method({
  14162. selector: "testNextIfAbsent",
  14163. protocol: 'tests',
  14164. fn: function (){
  14165. var self=this;
  14166. var queue;
  14167. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14168. return $core.withContext(function($ctx1) {
  14169. //>>excludeEnd("ctx");
  14170. var $2,$1;
  14171. queue=$recv($globals.Queue)._new();
  14172. $recv(queue)._nextPut_("index1");
  14173. $2=$recv(queue)._nextIfAbsent_("empty");
  14174. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14175. $ctx1.sendIdx["nextIfAbsent:"]=1;
  14176. //>>excludeEnd("ctx");
  14177. $1=$recv($2).__eq("index1");
  14178. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14179. $ctx1.sendIdx["="]=1;
  14180. //>>excludeEnd("ctx");
  14181. self._assert_($1);
  14182. self._deny_($recv($recv(queue)._nextIfAbsent_("empty")).__eq("index1"));
  14183. return self;
  14184. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14185. }, function($ctx1) {$ctx1.fill(self,"testNextIfAbsent",{queue:queue},$globals.QueueTest)});
  14186. //>>excludeEnd("ctx");
  14187. },
  14188. //>>excludeStart("ide", pragmas.excludeIdeData);
  14189. args: [],
  14190. 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'",
  14191. referencedClasses: ["Queue"],
  14192. //>>excludeEnd("ide");
  14193. messageSends: ["new", "nextPut:", "assert:", "=", "nextIfAbsent:", "deny:"]
  14194. }),
  14195. $globals.QueueTest);
  14196. $core.addMethod(
  14197. $core.method({
  14198. selector: "testQueueNext",
  14199. protocol: 'tests',
  14200. fn: function (){
  14201. var self=this;
  14202. var queue;
  14203. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14204. return $core.withContext(function($ctx1) {
  14205. //>>excludeEnd("ctx");
  14206. var $1,$3,$2,$5,$4;
  14207. queue=$recv($globals.Queue)._new();
  14208. $1=queue;
  14209. $recv($1)._nextPut_("index1");
  14210. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14211. $ctx1.sendIdx["nextPut:"]=1;
  14212. //>>excludeEnd("ctx");
  14213. $recv($1)._nextPut_("index2");
  14214. $3=$recv(queue)._next();
  14215. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14216. $ctx1.sendIdx["next"]=1;
  14217. //>>excludeEnd("ctx");
  14218. $2=$recv($3).__eq("index1");
  14219. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14220. $ctx1.sendIdx["="]=1;
  14221. //>>excludeEnd("ctx");
  14222. self._assert_($2);
  14223. $5=$recv(queue)._next();
  14224. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14225. $ctx1.sendIdx["next"]=2;
  14226. //>>excludeEnd("ctx");
  14227. $4=$recv($5).__eq("index");
  14228. self._deny_($4);
  14229. self._should_raise_((function(){
  14230. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14231. return $core.withContext(function($ctx2) {
  14232. //>>excludeEnd("ctx");
  14233. return $recv(queue)._next();
  14234. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14235. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  14236. //>>excludeEnd("ctx");
  14237. }),$globals.Error);
  14238. return self;
  14239. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14240. }, function($ctx1) {$ctx1.fill(self,"testQueueNext",{queue:queue},$globals.QueueTest)});
  14241. //>>excludeEnd("ctx");
  14242. },
  14243. //>>excludeStart("ide", pragmas.excludeIdeData);
  14244. args: [],
  14245. 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",
  14246. referencedClasses: ["Queue", "Error"],
  14247. //>>excludeEnd("ide");
  14248. messageSends: ["new", "nextPut:", "assert:", "=", "next", "deny:", "should:raise:"]
  14249. }),
  14250. $globals.QueueTest);
  14251. $core.addClass('RandomTest', $globals.TestCase, [], 'Kernel-Tests');
  14252. $core.addMethod(
  14253. $core.method({
  14254. selector: "testAtRandomNumber",
  14255. protocol: 'tests',
  14256. fn: function (){
  14257. var self=this;
  14258. var val;
  14259. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14260. return $core.withContext(function($ctx1) {
  14261. //>>excludeEnd("ctx");
  14262. (100)._timesRepeat_((function(){
  14263. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14264. return $core.withContext(function($ctx2) {
  14265. //>>excludeEnd("ctx");
  14266. val=(10)._atRandom();
  14267. val;
  14268. self._assert_($recv(val).__gt((0)));
  14269. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14270. $ctx2.sendIdx["assert:"]=1;
  14271. //>>excludeEnd("ctx");
  14272. return self._assert_($recv(val).__lt((11)));
  14273. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14274. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  14275. //>>excludeEnd("ctx");
  14276. }));
  14277. return self;
  14278. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14279. }, function($ctx1) {$ctx1.fill(self,"testAtRandomNumber",{val:val},$globals.RandomTest)});
  14280. //>>excludeEnd("ctx");
  14281. },
  14282. //>>excludeStart("ide", pragmas.excludeIdeData);
  14283. args: [],
  14284. 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]",
  14285. referencedClasses: [],
  14286. //>>excludeEnd("ide");
  14287. messageSends: ["timesRepeat:", "atRandom", "assert:", ">", "<"]
  14288. }),
  14289. $globals.RandomTest);
  14290. $core.addMethod(
  14291. $core.method({
  14292. selector: "testAtRandomSequenceableCollection",
  14293. protocol: 'tests',
  14294. fn: function (){
  14295. var self=this;
  14296. var val;
  14297. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14298. return $core.withContext(function($ctx1) {
  14299. //>>excludeEnd("ctx");
  14300. var $3,$4,$2,$1;
  14301. (100)._timesRepeat_((function(){
  14302. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14303. return $core.withContext(function($ctx2) {
  14304. //>>excludeEnd("ctx");
  14305. val="abc"._atRandom();
  14306. val;
  14307. $3=$recv(val).__eq("a");
  14308. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14309. $ctx2.sendIdx["="]=1;
  14310. //>>excludeEnd("ctx");
  14311. $4=$recv(val).__eq("b");
  14312. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14313. $ctx2.sendIdx["="]=2;
  14314. //>>excludeEnd("ctx");
  14315. $2=$recv($3).__or($4);
  14316. $1=$recv($2).__or($recv(val).__eq("c"));
  14317. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14318. $ctx2.sendIdx["|"]=1;
  14319. //>>excludeEnd("ctx");
  14320. return self._assert_($1);
  14321. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14322. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  14323. //>>excludeEnd("ctx");
  14324. }));
  14325. return self;
  14326. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14327. }, function($ctx1) {$ctx1.fill(self,"testAtRandomSequenceableCollection",{val:val},$globals.RandomTest)});
  14328. //>>excludeEnd("ctx");
  14329. },
  14330. //>>excludeStart("ide", pragmas.excludeIdeData);
  14331. args: [],
  14332. 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].",
  14333. referencedClasses: [],
  14334. //>>excludeEnd("ide");
  14335. messageSends: ["timesRepeat:", "atRandom", "assert:", "|", "="]
  14336. }),
  14337. $globals.RandomTest);
  14338. $core.addMethod(
  14339. $core.method({
  14340. selector: "textNext",
  14341. protocol: 'tests',
  14342. fn: function (){
  14343. var self=this;
  14344. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14345. return $core.withContext(function($ctx1) {
  14346. //>>excludeEnd("ctx");
  14347. var $1;
  14348. (10000)._timesRepeat_((function(){
  14349. var current,next;
  14350. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14351. return $core.withContext(function($ctx2) {
  14352. //>>excludeEnd("ctx");
  14353. next=$recv($recv($globals.Random)._new())._next();
  14354. next;
  14355. self._assert_($recv(next).__gt_eq((0)));
  14356. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14357. $ctx2.sendIdx["assert:"]=1;
  14358. //>>excludeEnd("ctx");
  14359. self._assert_($recv(next).__lt((1)));
  14360. $1=$recv(current).__eq(next);
  14361. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14362. $ctx2.sendIdx["="]=1;
  14363. //>>excludeEnd("ctx");
  14364. self._deny_($1);
  14365. return $recv(next).__eq(current);
  14366. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14367. }, function($ctx2) {$ctx2.fillBlock({current:current,next:next},$ctx1,1)});
  14368. //>>excludeEnd("ctx");
  14369. }));
  14370. return self;
  14371. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14372. }, function($ctx1) {$ctx1.fill(self,"textNext",{},$globals.RandomTest)});
  14373. //>>excludeEnd("ctx");
  14374. },
  14375. //>>excludeStart("ide", pragmas.excludeIdeData);
  14376. args: [],
  14377. 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 ]",
  14378. referencedClasses: ["Random"],
  14379. //>>excludeEnd("ide");
  14380. messageSends: ["timesRepeat:", "next", "new", "assert:", ">=", "<", "deny:", "="]
  14381. }),
  14382. $globals.RandomTest);
  14383. $core.addClass('StreamTest', $globals.TestCase, [], 'Kernel-Tests');
  14384. $core.addMethod(
  14385. $core.method({
  14386. selector: "collectionClass",
  14387. protocol: 'accessing',
  14388. fn: function (){
  14389. var self=this;
  14390. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14391. return $core.withContext(function($ctx1) {
  14392. //>>excludeEnd("ctx");
  14393. return $recv(self._class())._collectionClass();
  14394. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14395. }, function($ctx1) {$ctx1.fill(self,"collectionClass",{},$globals.StreamTest)});
  14396. //>>excludeEnd("ctx");
  14397. },
  14398. //>>excludeStart("ide", pragmas.excludeIdeData);
  14399. args: [],
  14400. source: "collectionClass\x0a\x09^ self class collectionClass",
  14401. referencedClasses: [],
  14402. //>>excludeEnd("ide");
  14403. messageSends: ["collectionClass", "class"]
  14404. }),
  14405. $globals.StreamTest);
  14406. $core.addMethod(
  14407. $core.method({
  14408. selector: "newCollection",
  14409. protocol: 'accessing',
  14410. fn: function (){
  14411. var self=this;
  14412. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14413. return $core.withContext(function($ctx1) {
  14414. //>>excludeEnd("ctx");
  14415. return $recv(self._collectionClass())._new();
  14416. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14417. }, function($ctx1) {$ctx1.fill(self,"newCollection",{},$globals.StreamTest)});
  14418. //>>excludeEnd("ctx");
  14419. },
  14420. //>>excludeStart("ide", pragmas.excludeIdeData);
  14421. args: [],
  14422. source: "newCollection\x0a\x09^ self collectionClass new",
  14423. referencedClasses: [],
  14424. //>>excludeEnd("ide");
  14425. messageSends: ["new", "collectionClass"]
  14426. }),
  14427. $globals.StreamTest);
  14428. $core.addMethod(
  14429. $core.method({
  14430. selector: "newStream",
  14431. protocol: 'accessing',
  14432. fn: function (){
  14433. var self=this;
  14434. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14435. return $core.withContext(function($ctx1) {
  14436. //>>excludeEnd("ctx");
  14437. return $recv($recv(self._collectionClass())._new())._stream();
  14438. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14439. }, function($ctx1) {$ctx1.fill(self,"newStream",{},$globals.StreamTest)});
  14440. //>>excludeEnd("ctx");
  14441. },
  14442. //>>excludeStart("ide", pragmas.excludeIdeData);
  14443. args: [],
  14444. source: "newStream\x0a\x09^ self collectionClass new stream",
  14445. referencedClasses: [],
  14446. //>>excludeEnd("ide");
  14447. messageSends: ["stream", "new", "collectionClass"]
  14448. }),
  14449. $globals.StreamTest);
  14450. $core.addMethod(
  14451. $core.method({
  14452. selector: "testAtStartAtEnd",
  14453. protocol: 'tests',
  14454. fn: function (){
  14455. var self=this;
  14456. var stream;
  14457. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14458. return $core.withContext(function($ctx1) {
  14459. //>>excludeEnd("ctx");
  14460. var $1,$2,$3,$4;
  14461. stream=self._newStream();
  14462. $1=$recv(stream)._atStart();
  14463. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14464. $ctx1.sendIdx["atStart"]=1;
  14465. //>>excludeEnd("ctx");
  14466. self._assert_($1);
  14467. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14468. $ctx1.sendIdx["assert:"]=1;
  14469. //>>excludeEnd("ctx");
  14470. $2=$recv(stream)._atEnd();
  14471. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14472. $ctx1.sendIdx["atEnd"]=1;
  14473. //>>excludeEnd("ctx");
  14474. self._assert_($2);
  14475. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14476. $ctx1.sendIdx["assert:"]=2;
  14477. //>>excludeEnd("ctx");
  14478. $recv(stream)._nextPutAll_(self._newCollection());
  14479. $3=$recv(stream)._atEnd();
  14480. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14481. $ctx1.sendIdx["atEnd"]=2;
  14482. //>>excludeEnd("ctx");
  14483. self._assert_($3);
  14484. $4=$recv(stream)._atStart();
  14485. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14486. $ctx1.sendIdx["atStart"]=2;
  14487. //>>excludeEnd("ctx");
  14488. self._deny_($4);
  14489. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14490. $ctx1.sendIdx["deny:"]=1;
  14491. //>>excludeEnd("ctx");
  14492. $recv(stream)._position_((1));
  14493. self._deny_($recv(stream)._atEnd());
  14494. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14495. $ctx1.sendIdx["deny:"]=2;
  14496. //>>excludeEnd("ctx");
  14497. self._deny_($recv(stream)._atStart());
  14498. return self;
  14499. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14500. }, function($ctx1) {$ctx1.fill(self,"testAtStartAtEnd",{stream:stream},$globals.StreamTest)});
  14501. //>>excludeEnd("ctx");
  14502. },
  14503. //>>excludeStart("ide", pragmas.excludeIdeData);
  14504. args: [],
  14505. 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",
  14506. referencedClasses: [],
  14507. //>>excludeEnd("ide");
  14508. messageSends: ["newStream", "assert:", "atStart", "atEnd", "nextPutAll:", "newCollection", "deny:", "position:"]
  14509. }),
  14510. $globals.StreamTest);
  14511. $core.addMethod(
  14512. $core.method({
  14513. selector: "testContents",
  14514. protocol: 'tests',
  14515. fn: function (){
  14516. var self=this;
  14517. var stream;
  14518. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14519. return $core.withContext(function($ctx1) {
  14520. //>>excludeEnd("ctx");
  14521. var $1,$2;
  14522. stream=self._newStream();
  14523. $1=stream;
  14524. $2=self._newCollection();
  14525. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14526. $ctx1.sendIdx["newCollection"]=1;
  14527. //>>excludeEnd("ctx");
  14528. $recv($1)._nextPutAll_($2);
  14529. self._assert_equals_($recv(stream)._contents(),self._newCollection());
  14530. return self;
  14531. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14532. }, function($ctx1) {$ctx1.fill(self,"testContents",{stream:stream},$globals.StreamTest)});
  14533. //>>excludeEnd("ctx");
  14534. },
  14535. //>>excludeStart("ide", pragmas.excludeIdeData);
  14536. args: [],
  14537. 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",
  14538. referencedClasses: [],
  14539. //>>excludeEnd("ide");
  14540. messageSends: ["newStream", "nextPutAll:", "newCollection", "assert:equals:", "contents"]
  14541. }),
  14542. $globals.StreamTest);
  14543. $core.addMethod(
  14544. $core.method({
  14545. selector: "testIsEmpty",
  14546. protocol: 'tests',
  14547. fn: function (){
  14548. var self=this;
  14549. var stream;
  14550. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14551. return $core.withContext(function($ctx1) {
  14552. //>>excludeEnd("ctx");
  14553. var $1;
  14554. stream=self._newStream();
  14555. $1=$recv(stream)._isEmpty();
  14556. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14557. $ctx1.sendIdx["isEmpty"]=1;
  14558. //>>excludeEnd("ctx");
  14559. self._assert_($1);
  14560. $recv(stream)._nextPutAll_(self._newCollection());
  14561. self._deny_($recv(stream)._isEmpty());
  14562. return self;
  14563. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14564. }, function($ctx1) {$ctx1.fill(self,"testIsEmpty",{stream:stream},$globals.StreamTest)});
  14565. //>>excludeEnd("ctx");
  14566. },
  14567. //>>excludeStart("ide", pragmas.excludeIdeData);
  14568. args: [],
  14569. 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",
  14570. referencedClasses: [],
  14571. //>>excludeEnd("ide");
  14572. messageSends: ["newStream", "assert:", "isEmpty", "nextPutAll:", "newCollection", "deny:"]
  14573. }),
  14574. $globals.StreamTest);
  14575. $core.addMethod(
  14576. $core.method({
  14577. selector: "testPosition",
  14578. protocol: 'tests',
  14579. fn: function (){
  14580. var self=this;
  14581. var collection,stream;
  14582. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14583. return $core.withContext(function($ctx1) {
  14584. //>>excludeEnd("ctx");
  14585. var $1,$2,$3;
  14586. collection=self._newCollection();
  14587. stream=self._newStream();
  14588. $recv(stream)._nextPutAll_(collection);
  14589. $1=$recv(stream)._position();
  14590. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14591. $ctx1.sendIdx["position"]=1;
  14592. //>>excludeEnd("ctx");
  14593. self._assert_equals_($1,$recv(collection)._size());
  14594. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14595. $ctx1.sendIdx["assert:equals:"]=1;
  14596. //>>excludeEnd("ctx");
  14597. $recv(stream)._position_((0));
  14598. $2=$recv(stream)._position();
  14599. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14600. $ctx1.sendIdx["position"]=2;
  14601. //>>excludeEnd("ctx");
  14602. self._assert_equals_($2,(0));
  14603. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14604. $ctx1.sendIdx["assert:equals:"]=2;
  14605. //>>excludeEnd("ctx");
  14606. $recv(stream)._next();
  14607. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14608. $ctx1.sendIdx["next"]=1;
  14609. //>>excludeEnd("ctx");
  14610. $3=$recv(stream)._position();
  14611. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14612. $ctx1.sendIdx["position"]=3;
  14613. //>>excludeEnd("ctx");
  14614. self._assert_equals_($3,(1));
  14615. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14616. $ctx1.sendIdx["assert:equals:"]=3;
  14617. //>>excludeEnd("ctx");
  14618. $recv(stream)._next();
  14619. self._assert_equals_($recv(stream)._position(),(2));
  14620. return self;
  14621. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14622. }, function($ctx1) {$ctx1.fill(self,"testPosition",{collection:collection,stream:stream},$globals.StreamTest)});
  14623. //>>excludeEnd("ctx");
  14624. },
  14625. //>>excludeStart("ide", pragmas.excludeIdeData);
  14626. args: [],
  14627. 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",
  14628. referencedClasses: [],
  14629. //>>excludeEnd("ide");
  14630. messageSends: ["newCollection", "newStream", "nextPutAll:", "assert:equals:", "position", "size", "position:", "next"]
  14631. }),
  14632. $globals.StreamTest);
  14633. $core.addMethod(
  14634. $core.method({
  14635. selector: "testReading",
  14636. protocol: 'tests',
  14637. fn: function (){
  14638. var self=this;
  14639. var stream,collection;
  14640. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14641. return $core.withContext(function($ctx1) {
  14642. //>>excludeEnd("ctx");
  14643. var $1,$2;
  14644. collection=self._newCollection();
  14645. stream=self._newStream();
  14646. $1=stream;
  14647. $recv($1)._nextPutAll_(collection);
  14648. $recv($1)._position_((0));
  14649. $recv(collection)._do_((function(each){
  14650. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14651. return $core.withContext(function($ctx2) {
  14652. //>>excludeEnd("ctx");
  14653. $2=$recv(stream)._next();
  14654. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14655. $ctx2.sendIdx["next"]=1;
  14656. //>>excludeEnd("ctx");
  14657. return self._assert_equals_($2,each);
  14658. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14659. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  14660. //>>excludeEnd("ctx");
  14661. }));
  14662. self._assert_($recv($recv(stream)._next())._isNil());
  14663. return self;
  14664. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14665. }, function($ctx1) {$ctx1.fill(self,"testReading",{stream:stream,collection:collection},$globals.StreamTest)});
  14666. //>>excludeEnd("ctx");
  14667. },
  14668. //>>excludeStart("ide", pragmas.excludeIdeData);
  14669. args: [],
  14670. 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",
  14671. referencedClasses: [],
  14672. //>>excludeEnd("ide");
  14673. messageSends: ["newCollection", "newStream", "nextPutAll:", "position:", "do:", "assert:equals:", "next", "assert:", "isNil"]
  14674. }),
  14675. $globals.StreamTest);
  14676. $core.addMethod(
  14677. $core.method({
  14678. selector: "testStreamContents",
  14679. protocol: 'tests',
  14680. fn: function (){
  14681. var self=this;
  14682. return self;
  14683. },
  14684. //>>excludeStart("ide", pragmas.excludeIdeData);
  14685. args: [],
  14686. source: "testStreamContents",
  14687. referencedClasses: [],
  14688. //>>excludeEnd("ide");
  14689. messageSends: []
  14690. }),
  14691. $globals.StreamTest);
  14692. $core.addMethod(
  14693. $core.method({
  14694. selector: "testWrite",
  14695. protocol: 'tests',
  14696. fn: function (){
  14697. var self=this;
  14698. var stream,collection;
  14699. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14700. return $core.withContext(function($ctx1) {
  14701. //>>excludeEnd("ctx");
  14702. collection=self._newCollection();
  14703. stream=self._newStream();
  14704. $recv(collection)._do_((function(each){
  14705. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14706. return $core.withContext(function($ctx2) {
  14707. //>>excludeEnd("ctx");
  14708. return $recv(stream).__lt_lt(each);
  14709. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14710. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  14711. //>>excludeEnd("ctx");
  14712. }));
  14713. self._assert_equals_($recv(stream)._contents(),collection);
  14714. return self;
  14715. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14716. }, function($ctx1) {$ctx1.fill(self,"testWrite",{stream:stream,collection:collection},$globals.StreamTest)});
  14717. //>>excludeEnd("ctx");
  14718. },
  14719. //>>excludeStart("ide", pragmas.excludeIdeData);
  14720. args: [],
  14721. 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",
  14722. referencedClasses: [],
  14723. //>>excludeEnd("ide");
  14724. messageSends: ["newCollection", "newStream", "do:", "<<", "assert:equals:", "contents"]
  14725. }),
  14726. $globals.StreamTest);
  14727. $core.addMethod(
  14728. $core.method({
  14729. selector: "testWriting",
  14730. protocol: 'tests',
  14731. fn: function (){
  14732. var self=this;
  14733. var stream,collection;
  14734. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14735. return $core.withContext(function($ctx1) {
  14736. //>>excludeEnd("ctx");
  14737. var $1;
  14738. collection=self._newCollection();
  14739. stream=self._newStream();
  14740. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14741. $ctx1.sendIdx["newStream"]=1;
  14742. //>>excludeEnd("ctx");
  14743. $recv(collection)._do_((function(each){
  14744. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14745. return $core.withContext(function($ctx2) {
  14746. //>>excludeEnd("ctx");
  14747. return $recv(stream)._nextPut_(each);
  14748. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14749. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  14750. //>>excludeEnd("ctx");
  14751. }));
  14752. $1=$recv(stream)._contents();
  14753. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14754. $ctx1.sendIdx["contents"]=1;
  14755. //>>excludeEnd("ctx");
  14756. self._assert_equals_($1,collection);
  14757. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14758. $ctx1.sendIdx["assert:equals:"]=1;
  14759. //>>excludeEnd("ctx");
  14760. stream=self._newStream();
  14761. $recv(stream)._nextPutAll_(collection);
  14762. self._assert_equals_($recv(stream)._contents(),collection);
  14763. return self;
  14764. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14765. }, function($ctx1) {$ctx1.fill(self,"testWriting",{stream:stream,collection:collection},$globals.StreamTest)});
  14766. //>>excludeEnd("ctx");
  14767. },
  14768. //>>excludeStart("ide", pragmas.excludeIdeData);
  14769. args: [],
  14770. 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",
  14771. referencedClasses: [],
  14772. //>>excludeEnd("ide");
  14773. messageSends: ["newCollection", "newStream", "do:", "nextPut:", "assert:equals:", "contents", "nextPutAll:"]
  14774. }),
  14775. $globals.StreamTest);
  14776. $core.addMethod(
  14777. $core.method({
  14778. selector: "collectionClass",
  14779. protocol: 'accessing',
  14780. fn: function (){
  14781. var self=this;
  14782. return nil;
  14783. },
  14784. //>>excludeStart("ide", pragmas.excludeIdeData);
  14785. args: [],
  14786. source: "collectionClass\x0a\x09^ nil",
  14787. referencedClasses: [],
  14788. //>>excludeEnd("ide");
  14789. messageSends: []
  14790. }),
  14791. $globals.StreamTest.klass);
  14792. $core.addMethod(
  14793. $core.method({
  14794. selector: "isAbstract",
  14795. protocol: 'testing',
  14796. fn: function (){
  14797. var self=this;
  14798. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14799. return $core.withContext(function($ctx1) {
  14800. //>>excludeEnd("ctx");
  14801. return $recv(self._collectionClass())._isNil();
  14802. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14803. }, function($ctx1) {$ctx1.fill(self,"isAbstract",{},$globals.StreamTest.klass)});
  14804. //>>excludeEnd("ctx");
  14805. },
  14806. //>>excludeStart("ide", pragmas.excludeIdeData);
  14807. args: [],
  14808. source: "isAbstract\x0a\x09^ self collectionClass isNil",
  14809. referencedClasses: [],
  14810. //>>excludeEnd("ide");
  14811. messageSends: ["isNil", "collectionClass"]
  14812. }),
  14813. $globals.StreamTest.klass);
  14814. $core.addClass('ArrayStreamTest', $globals.StreamTest, [], 'Kernel-Tests');
  14815. $core.addMethod(
  14816. $core.method({
  14817. selector: "newCollection",
  14818. protocol: 'accessing',
  14819. fn: function (){
  14820. var self=this;
  14821. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14822. return $core.withContext(function($ctx1) {
  14823. //>>excludeEnd("ctx");
  14824. return [true,(1),(3).__at((4)),"foo"];
  14825. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14826. }, function($ctx1) {$ctx1.fill(self,"newCollection",{},$globals.ArrayStreamTest)});
  14827. //>>excludeEnd("ctx");
  14828. },
  14829. //>>excludeStart("ide", pragmas.excludeIdeData);
  14830. args: [],
  14831. source: "newCollection\x0a\x09^ { true. 1. 3@4. 'foo' }",
  14832. referencedClasses: [],
  14833. //>>excludeEnd("ide");
  14834. messageSends: ["@"]
  14835. }),
  14836. $globals.ArrayStreamTest);
  14837. $core.addMethod(
  14838. $core.method({
  14839. selector: "collectionClass",
  14840. protocol: 'accessing',
  14841. fn: function (){
  14842. var self=this;
  14843. return $globals.Array;
  14844. },
  14845. //>>excludeStart("ide", pragmas.excludeIdeData);
  14846. args: [],
  14847. source: "collectionClass\x0a\x09^ Array",
  14848. referencedClasses: ["Array"],
  14849. //>>excludeEnd("ide");
  14850. messageSends: []
  14851. }),
  14852. $globals.ArrayStreamTest.klass);
  14853. $core.addClass('StringStreamTest', $globals.StreamTest, [], 'Kernel-Tests');
  14854. $core.addMethod(
  14855. $core.method({
  14856. selector: "newCollection",
  14857. protocol: 'accessing',
  14858. fn: function (){
  14859. var self=this;
  14860. return "hello world";
  14861. },
  14862. //>>excludeStart("ide", pragmas.excludeIdeData);
  14863. args: [],
  14864. source: "newCollection\x0a\x09^ 'hello world'",
  14865. referencedClasses: [],
  14866. //>>excludeEnd("ide");
  14867. messageSends: []
  14868. }),
  14869. $globals.StringStreamTest);
  14870. $core.addMethod(
  14871. $core.method({
  14872. selector: "collectionClass",
  14873. protocol: 'accessing',
  14874. fn: function (){
  14875. var self=this;
  14876. return $globals.String;
  14877. },
  14878. //>>excludeStart("ide", pragmas.excludeIdeData);
  14879. args: [],
  14880. source: "collectionClass\x0a\x09^ String",
  14881. referencedClasses: ["String"],
  14882. //>>excludeEnd("ide");
  14883. messageSends: []
  14884. }),
  14885. $globals.StringStreamTest.klass);
  14886. $core.addClass('UndefinedTest', $globals.TestCase, [], 'Kernel-Tests');
  14887. $core.addMethod(
  14888. $core.method({
  14889. selector: "testCopying",
  14890. protocol: 'tests',
  14891. fn: function (){
  14892. var self=this;
  14893. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14894. return $core.withContext(function($ctx1) {
  14895. //>>excludeEnd("ctx");
  14896. self._assert_equals_(nil._copy(),nil);
  14897. return self;
  14898. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14899. }, function($ctx1) {$ctx1.fill(self,"testCopying",{},$globals.UndefinedTest)});
  14900. //>>excludeEnd("ctx");
  14901. },
  14902. //>>excludeStart("ide", pragmas.excludeIdeData);
  14903. args: [],
  14904. source: "testCopying\x0a\x09self assert: nil copy equals: nil",
  14905. referencedClasses: [],
  14906. //>>excludeEnd("ide");
  14907. messageSends: ["assert:equals:", "copy"]
  14908. }),
  14909. $globals.UndefinedTest);
  14910. $core.addMethod(
  14911. $core.method({
  14912. selector: "testDeepCopy",
  14913. protocol: 'tests',
  14914. fn: function (){
  14915. var self=this;
  14916. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14917. return $core.withContext(function($ctx1) {
  14918. //>>excludeEnd("ctx");
  14919. self._assert_($recv(nil._deepCopy()).__eq(nil));
  14920. return self;
  14921. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14922. }, function($ctx1) {$ctx1.fill(self,"testDeepCopy",{},$globals.UndefinedTest)});
  14923. //>>excludeEnd("ctx");
  14924. },
  14925. //>>excludeStart("ide", pragmas.excludeIdeData);
  14926. args: [],
  14927. source: "testDeepCopy\x0a\x09self assert: nil deepCopy = nil",
  14928. referencedClasses: [],
  14929. //>>excludeEnd("ide");
  14930. messageSends: ["assert:", "=", "deepCopy"]
  14931. }),
  14932. $globals.UndefinedTest);
  14933. $core.addMethod(
  14934. $core.method({
  14935. selector: "testIfNil",
  14936. protocol: 'tests',
  14937. fn: function (){
  14938. var self=this;
  14939. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14940. return $core.withContext(function($ctx1) {
  14941. //>>excludeEnd("ctx");
  14942. var $1,$3,$2,$4,$6,$5,$receiver;
  14943. if(($receiver = nil) == null || $receiver.isNil){
  14944. $1=true;
  14945. } else {
  14946. $1=nil;
  14947. };
  14948. self._assert_equals_($1,true);
  14949. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14950. $ctx1.sendIdx["assert:equals:"]=1;
  14951. //>>excludeEnd("ctx");
  14952. if(($receiver = nil) == null || $receiver.isNil){
  14953. $3=nil;
  14954. } else {
  14955. $3=true;
  14956. };
  14957. $2=$recv($3).__eq(true);
  14958. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14959. $ctx1.sendIdx["="]=1;
  14960. //>>excludeEnd("ctx");
  14961. self._deny_($2);
  14962. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14963. $ctx1.sendIdx["deny:"]=1;
  14964. //>>excludeEnd("ctx");
  14965. if(($receiver = nil) == null || $receiver.isNil){
  14966. $4=true;
  14967. } else {
  14968. $4=false;
  14969. };
  14970. self._assert_equals_($4,true);
  14971. if(($receiver = nil) == null || $receiver.isNil){
  14972. $6=false;
  14973. } else {
  14974. $6=true;
  14975. };
  14976. $5=$recv($6).__eq(true);
  14977. self._deny_($5);
  14978. return self;
  14979. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14980. }, function($ctx1) {$ctx1.fill(self,"testIfNil",{},$globals.UndefinedTest)});
  14981. //>>excludeEnd("ctx");
  14982. },
  14983. //>>excludeStart("ide", pragmas.excludeIdeData);
  14984. args: [],
  14985. 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",
  14986. referencedClasses: [],
  14987. //>>excludeEnd("ide");
  14988. messageSends: ["assert:equals:", "ifNil:", "deny:", "=", "ifNotNil:", "ifNil:ifNotNil:", "ifNotNil:ifNil:"]
  14989. }),
  14990. $globals.UndefinedTest);
  14991. $core.addMethod(
  14992. $core.method({
  14993. selector: "testIsNil",
  14994. protocol: 'tests',
  14995. fn: function (){
  14996. var self=this;
  14997. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14998. return $core.withContext(function($ctx1) {
  14999. //>>excludeEnd("ctx");
  15000. self._assert_(nil._isNil());
  15001. self._deny_(nil._notNil());
  15002. return self;
  15003. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  15004. }, function($ctx1) {$ctx1.fill(self,"testIsNil",{},$globals.UndefinedTest)});
  15005. //>>excludeEnd("ctx");
  15006. },
  15007. //>>excludeStart("ide", pragmas.excludeIdeData);
  15008. args: [],
  15009. source: "testIsNil\x0a\x09self assert: nil isNil.\x0a\x09self deny: nil notNil.",
  15010. referencedClasses: [],
  15011. //>>excludeEnd("ide");
  15012. messageSends: ["assert:", "isNil", "deny:", "notNil"]
  15013. }),
  15014. $globals.UndefinedTest);
  15015. });