Kernel-Tests.js 543 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611
  1. define(["amber/boot", "amber_core/Kernel-Objects", "amber_core/SUnit"], function($boot){"use strict";
  2. if(!$boot.nilAsReceiver)$boot.nilAsReceiver=$boot.nil;
  3. var $core=$boot.api,nil=$boot.nilAsReceiver,$recv=$boot.asReceiver,$globals=$boot.globals;
  4. if(!$boot.nilAsClass)$boot.nilAsClass=$boot.dnu;
  5. $core.addPackage('Kernel-Tests');
  6. $core.packages["Kernel-Tests"].innerEval = function (expr) { return eval(expr); };
  7. $core.packages["Kernel-Tests"].transport = {"type":"amd","amdNamespace":"amber_core"};
  8. $core.addClass('AnnouncementSubscriptionTest', $globals.TestCase, [], 'Kernel-Tests');
  9. $core.addMethod(
  10. $core.method({
  11. selector: "testAddExtensionMethod",
  12. protocol: 'tests',
  13. fn: function (){
  14. var self=this;
  15. var method,dirty;
  16. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  17. return $core.withContext(function($ctx1) {
  18. //>>excludeEnd("ctx");
  19. var $2,$1,$4,$3,$5,$8,$7,$6,$9,$10;
  20. $2=self._class();
  21. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  22. $ctx1.sendIdx["class"]=1;
  23. //>>excludeEnd("ctx");
  24. $1=$recv($2)._package();
  25. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  26. $ctx1.sendIdx["package"]=1;
  27. //>>excludeEnd("ctx");
  28. dirty=$recv($1)._isDirty();
  29. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  30. $ctx1.sendIdx["isDirty"]=1;
  31. //>>excludeEnd("ctx");
  32. $4=self._class();
  33. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  34. $ctx1.sendIdx["class"]=2;
  35. //>>excludeEnd("ctx");
  36. $3=$recv($4)._package();
  37. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  38. $ctx1.sendIdx["package"]=2;
  39. //>>excludeEnd("ctx");
  40. $recv($3)._beClean();
  41. $5=self._class();
  42. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  43. $ctx1.sendIdx["class"]=3;
  44. //>>excludeEnd("ctx");
  45. method=$recv($5)._compile_protocol_("doNothing","**not-a-package");
  46. $8=self._class();
  47. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  48. $ctx1.sendIdx["class"]=4;
  49. //>>excludeEnd("ctx");
  50. $7=$recv($8)._package();
  51. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  52. $ctx1.sendIdx["package"]=3;
  53. //>>excludeEnd("ctx");
  54. $6=$recv($7)._isDirty();
  55. self._deny_($6);
  56. $9=self._class();
  57. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  58. $ctx1.sendIdx["class"]=5;
  59. //>>excludeEnd("ctx");
  60. $recv($9)._removeCompiledMethod_(method);
  61. $10=dirty;
  62. if($core.assert($10)){
  63. $recv($recv(self._class())._package())._beDirty();
  64. };
  65. return self;
  66. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  67. }, function($ctx1) {$ctx1.fill(self,"testAddExtensionMethod",{method:method,dirty:dirty},$globals.AnnouncementSubscriptionTest)});
  68. //>>excludeEnd("ctx");
  69. },
  70. //>>excludeStart("ide", pragmas.excludeIdeData);
  71. args: [],
  72. 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 ]",
  73. referencedClasses: [],
  74. //>>excludeEnd("ide");
  75. messageSends: ["isDirty", "package", "class", "beClean", "compile:protocol:", "deny:", "removeCompiledMethod:", "ifTrue:", "beDirty"]
  76. }),
  77. $globals.AnnouncementSubscriptionTest);
  78. $core.addMethod(
  79. $core.method({
  80. selector: "testHandlesAnnouncement",
  81. protocol: 'tests',
  82. fn: function (){
  83. var self=this;
  84. var subscription,announcementClass1,announcementClass2,classBuilder;
  85. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  86. return $core.withContext(function($ctx1) {
  87. //>>excludeEnd("ctx");
  88. var $1,$2;
  89. classBuilder=$recv($globals.ClassBuilder)._new();
  90. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  91. $ctx1.sendIdx["new"]=1;
  92. //>>excludeEnd("ctx");
  93. announcementClass1=$recv(classBuilder)._basicAddSubclassOf_named_instanceVariableNames_package_($globals.SystemAnnouncement,"TestAnnouncement1",[],"Kernel-Tests");
  94. subscription=$recv($recv($globals.AnnouncementSubscription)._new())._announcementClass_($globals.SystemAnnouncement);
  95. $1=$recv(subscription)._handlesAnnouncement_($globals.SystemAnnouncement);
  96. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  97. $ctx1.sendIdx["handlesAnnouncement:"]=1;
  98. //>>excludeEnd("ctx");
  99. self._assert_equals_($1,true);
  100. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  101. $ctx1.sendIdx["assert:equals:"]=1;
  102. //>>excludeEnd("ctx");
  103. $2=$recv(subscription)._handlesAnnouncement_(announcementClass1);
  104. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  105. $ctx1.sendIdx["handlesAnnouncement:"]=2;
  106. //>>excludeEnd("ctx");
  107. self._assert_equals_($2,true);
  108. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  109. $ctx1.sendIdx["assert:equals:"]=2;
  110. //>>excludeEnd("ctx");
  111. self._assert_equals_($recv(subscription)._handlesAnnouncement_($globals.Object),false);
  112. $recv(classBuilder)._basicRemoveClass_(announcementClass1);
  113. return self;
  114. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  115. }, function($ctx1) {$ctx1.fill(self,"testHandlesAnnouncement",{subscription:subscription,announcementClass1:announcementClass1,announcementClass2:announcementClass2,classBuilder:classBuilder},$globals.AnnouncementSubscriptionTest)});
  116. //>>excludeEnd("ctx");
  117. },
  118. //>>excludeStart("ide", pragmas.excludeIdeData);
  119. args: [],
  120. 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.",
  121. referencedClasses: ["ClassBuilder", "SystemAnnouncement", "AnnouncementSubscription", "Object"],
  122. //>>excludeEnd("ide");
  123. messageSends: ["new", "basicAddSubclassOf:named:instanceVariableNames:package:", "announcementClass:", "assert:equals:", "handlesAnnouncement:", "basicRemoveClass:"]
  124. }),
  125. $globals.AnnouncementSubscriptionTest);
  126. $core.addClass('AnnouncerTest', $globals.TestCase, [], 'Kernel-Tests');
  127. $core.addMethod(
  128. $core.method({
  129. selector: "testOnDo",
  130. protocol: 'tests',
  131. fn: function (){
  132. var self=this;
  133. var counter,announcer;
  134. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  135. return $core.withContext(function($ctx1) {
  136. //>>excludeEnd("ctx");
  137. var $1,$2;
  138. counter=(0);
  139. announcer=$recv($globals.Announcer)._new();
  140. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  141. $ctx1.sendIdx["new"]=1;
  142. //>>excludeEnd("ctx");
  143. $recv(announcer)._on_do_($globals.SystemAnnouncement,(function(){
  144. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  145. return $core.withContext(function($ctx2) {
  146. //>>excludeEnd("ctx");
  147. counter=$recv(counter).__plus((1));
  148. return counter;
  149. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  150. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  151. //>>excludeEnd("ctx");
  152. }));
  153. $1=announcer;
  154. $2=$recv($globals.SystemAnnouncement)._new();
  155. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  156. $ctx1.sendIdx["new"]=2;
  157. //>>excludeEnd("ctx");
  158. $recv($1)._announce_($2);
  159. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  160. $ctx1.sendIdx["announce:"]=1;
  161. //>>excludeEnd("ctx");
  162. self._assert_equals_(counter,(1));
  163. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  164. $ctx1.sendIdx["assert:equals:"]=1;
  165. //>>excludeEnd("ctx");
  166. $recv(announcer)._announce_($recv($globals.SystemAnnouncement)._new());
  167. self._assert_equals_(counter,(2));
  168. return self;
  169. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  170. }, function($ctx1) {$ctx1.fill(self,"testOnDo",{counter:counter,announcer:announcer},$globals.AnnouncerTest)});
  171. //>>excludeEnd("ctx");
  172. },
  173. //>>excludeStart("ide", pragmas.excludeIdeData);
  174. args: [],
  175. 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.",
  176. referencedClasses: ["Announcer", "SystemAnnouncement"],
  177. //>>excludeEnd("ide");
  178. messageSends: ["new", "on:do:", "+", "announce:", "assert:equals:"]
  179. }),
  180. $globals.AnnouncerTest);
  181. $core.addMethod(
  182. $core.method({
  183. selector: "testOnDoFor",
  184. protocol: 'tests',
  185. fn: function (){
  186. var self=this;
  187. var counter,announcer;
  188. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  189. return $core.withContext(function($ctx1) {
  190. //>>excludeEnd("ctx");
  191. var $1,$2,$3,$4;
  192. counter=(0);
  193. announcer=$recv($globals.Announcer)._new();
  194. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  195. $ctx1.sendIdx["new"]=1;
  196. //>>excludeEnd("ctx");
  197. $recv(announcer)._on_do_for_($globals.SystemAnnouncement,(function(){
  198. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  199. return $core.withContext(function($ctx2) {
  200. //>>excludeEnd("ctx");
  201. counter=$recv(counter).__plus((1));
  202. return counter;
  203. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  204. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  205. //>>excludeEnd("ctx");
  206. }),self);
  207. $1=announcer;
  208. $2=$recv($globals.SystemAnnouncement)._new();
  209. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  210. $ctx1.sendIdx["new"]=2;
  211. //>>excludeEnd("ctx");
  212. $recv($1)._announce_($2);
  213. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  214. $ctx1.sendIdx["announce:"]=1;
  215. //>>excludeEnd("ctx");
  216. self._assert_equals_(counter,(1));
  217. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  218. $ctx1.sendIdx["assert:equals:"]=1;
  219. //>>excludeEnd("ctx");
  220. $3=announcer;
  221. $4=$recv($globals.SystemAnnouncement)._new();
  222. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  223. $ctx1.sendIdx["new"]=3;
  224. //>>excludeEnd("ctx");
  225. $recv($3)._announce_($4);
  226. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  227. $ctx1.sendIdx["announce:"]=2;
  228. //>>excludeEnd("ctx");
  229. self._assert_equals_(counter,(2));
  230. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  231. $ctx1.sendIdx["assert:equals:"]=2;
  232. //>>excludeEnd("ctx");
  233. $recv(announcer)._unsubscribe_(self);
  234. $recv(announcer)._announce_($recv($globals.SystemAnnouncement)._new());
  235. self._assert_equals_(counter,(2));
  236. return self;
  237. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  238. }, function($ctx1) {$ctx1.fill(self,"testOnDoFor",{counter:counter,announcer:announcer},$globals.AnnouncerTest)});
  239. //>>excludeEnd("ctx");
  240. },
  241. //>>excludeStart("ide", pragmas.excludeIdeData);
  242. args: [],
  243. 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.",
  244. referencedClasses: ["Announcer", "SystemAnnouncement"],
  245. //>>excludeEnd("ide");
  246. messageSends: ["new", "on:do:for:", "+", "announce:", "assert:equals:", "unsubscribe:"]
  247. }),
  248. $globals.AnnouncerTest);
  249. $core.addMethod(
  250. $core.method({
  251. selector: "testOnDoOnce",
  252. protocol: 'tests',
  253. fn: function (){
  254. var self=this;
  255. var counter,announcer;
  256. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  257. return $core.withContext(function($ctx1) {
  258. //>>excludeEnd("ctx");
  259. var $1,$2;
  260. counter=(0);
  261. announcer=$recv($globals.Announcer)._new();
  262. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  263. $ctx1.sendIdx["new"]=1;
  264. //>>excludeEnd("ctx");
  265. $recv(announcer)._on_doOnce_($globals.SystemAnnouncement,(function(){
  266. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  267. return $core.withContext(function($ctx2) {
  268. //>>excludeEnd("ctx");
  269. counter=$recv(counter).__plus((1));
  270. return counter;
  271. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  272. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  273. //>>excludeEnd("ctx");
  274. }));
  275. $1=announcer;
  276. $2=$recv($globals.SystemAnnouncement)._new();
  277. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  278. $ctx1.sendIdx["new"]=2;
  279. //>>excludeEnd("ctx");
  280. $recv($1)._announce_($2);
  281. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  282. $ctx1.sendIdx["announce:"]=1;
  283. //>>excludeEnd("ctx");
  284. self._assert_equals_(counter,(1));
  285. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  286. $ctx1.sendIdx["assert:equals:"]=1;
  287. //>>excludeEnd("ctx");
  288. $recv(announcer)._announce_($recv($globals.SystemAnnouncement)._new());
  289. self._assert_equals_(counter,(1));
  290. return self;
  291. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  292. }, function($ctx1) {$ctx1.fill(self,"testOnDoOnce",{counter:counter,announcer:announcer},$globals.AnnouncerTest)});
  293. //>>excludeEnd("ctx");
  294. },
  295. //>>excludeStart("ide", pragmas.excludeIdeData);
  296. args: [],
  297. 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.",
  298. referencedClasses: ["Announcer", "SystemAnnouncement"],
  299. //>>excludeEnd("ide");
  300. messageSends: ["new", "on:doOnce:", "+", "announce:", "assert:equals:"]
  301. }),
  302. $globals.AnnouncerTest);
  303. $core.addClass('BlockClosureTest', $globals.TestCase, [], 'Kernel-Tests');
  304. $core.addMethod(
  305. $core.method({
  306. selector: "localReturnOnDoCatch",
  307. protocol: 'fixture',
  308. fn: function (){
  309. var self=this;
  310. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  311. return $core.withContext(function($ctx1) {
  312. //>>excludeEnd("ctx");
  313. var $early={};
  314. try {
  315. $recv((function(){
  316. throw $early=[(2)];
  317. }))._on_do_($globals.Error,(function(){
  318. }));
  319. return (3);
  320. }
  321. catch(e) {if(e===$early)return e[0]; throw e}
  322. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  323. }, function($ctx1) {$ctx1.fill(self,"localReturnOnDoCatch",{},$globals.BlockClosureTest)});
  324. //>>excludeEnd("ctx");
  325. },
  326. //>>excludeStart("ide", pragmas.excludeIdeData);
  327. args: [],
  328. source: "localReturnOnDoCatch\x0a [ ^ 2 ] on: Error do: [].\x0a ^ 3",
  329. referencedClasses: ["Error"],
  330. //>>excludeEnd("ide");
  331. messageSends: ["on:do:"]
  332. }),
  333. $globals.BlockClosureTest);
  334. $core.addMethod(
  335. $core.method({
  336. selector: "localReturnOnDoMiss",
  337. protocol: 'fixture',
  338. fn: function (){
  339. var self=this;
  340. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  341. return $core.withContext(function($ctx1) {
  342. //>>excludeEnd("ctx");
  343. var $early={};
  344. try {
  345. $recv((function(){
  346. throw $early=[(2)];
  347. }))._on_do_($globals.Class,(function(){
  348. }));
  349. return (3);
  350. }
  351. catch(e) {if(e===$early)return e[0]; throw e}
  352. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  353. }, function($ctx1) {$ctx1.fill(self,"localReturnOnDoMiss",{},$globals.BlockClosureTest)});
  354. //>>excludeEnd("ctx");
  355. },
  356. //>>excludeStart("ide", pragmas.excludeIdeData);
  357. args: [],
  358. source: "localReturnOnDoMiss\x0a [ ^ 2 ] on: Class do: [].\x0a ^ 3",
  359. referencedClasses: ["Class"],
  360. //>>excludeEnd("ide");
  361. messageSends: ["on:do:"]
  362. }),
  363. $globals.BlockClosureTest);
  364. $core.addMethod(
  365. $core.method({
  366. selector: "testCanClearInterval",
  367. protocol: 'tests',
  368. fn: function (){
  369. var self=this;
  370. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  371. return $core.withContext(function($ctx1) {
  372. //>>excludeEnd("ctx");
  373. self._shouldnt_raise_((function(){
  374. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  375. return $core.withContext(function($ctx2) {
  376. //>>excludeEnd("ctx");
  377. return $recv($recv((function(){
  378. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  379. return $core.withContext(function($ctx3) {
  380. //>>excludeEnd("ctx");
  381. return $recv($recv($globals.Error)._new())._signal();
  382. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  383. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  384. //>>excludeEnd("ctx");
  385. }))._valueWithInterval_((0)))._clearInterval();
  386. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  387. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  388. //>>excludeEnd("ctx");
  389. }),$globals.Error);
  390. return self;
  391. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  392. }, function($ctx1) {$ctx1.fill(self,"testCanClearInterval",{},$globals.BlockClosureTest)});
  393. //>>excludeEnd("ctx");
  394. },
  395. //>>excludeStart("ide", pragmas.excludeIdeData);
  396. args: [],
  397. source: "testCanClearInterval\x0a\x09self shouldnt: [ ([ Error new signal ] valueWithInterval: 0) clearInterval ] raise: Error",
  398. referencedClasses: ["Error"],
  399. //>>excludeEnd("ide");
  400. messageSends: ["shouldnt:raise:", "clearInterval", "valueWithInterval:", "signal", "new"]
  401. }),
  402. $globals.BlockClosureTest);
  403. $core.addMethod(
  404. $core.method({
  405. selector: "testCanClearTimeout",
  406. protocol: 'tests',
  407. fn: function (){
  408. var self=this;
  409. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  410. return $core.withContext(function($ctx1) {
  411. //>>excludeEnd("ctx");
  412. self._shouldnt_raise_((function(){
  413. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  414. return $core.withContext(function($ctx2) {
  415. //>>excludeEnd("ctx");
  416. return $recv($recv((function(){
  417. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  418. return $core.withContext(function($ctx3) {
  419. //>>excludeEnd("ctx");
  420. return $recv($recv($globals.Error)._new())._signal();
  421. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  422. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  423. //>>excludeEnd("ctx");
  424. }))._valueWithTimeout_((0)))._clearTimeout();
  425. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  426. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  427. //>>excludeEnd("ctx");
  428. }),$globals.Error);
  429. return self;
  430. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  431. }, function($ctx1) {$ctx1.fill(self,"testCanClearTimeout",{},$globals.BlockClosureTest)});
  432. //>>excludeEnd("ctx");
  433. },
  434. //>>excludeStart("ide", pragmas.excludeIdeData);
  435. args: [],
  436. source: "testCanClearTimeout\x0a\x09self shouldnt: [ ([ Error new signal ] valueWithTimeout: 0) clearTimeout ] raise: Error",
  437. referencedClasses: ["Error"],
  438. //>>excludeEnd("ide");
  439. messageSends: ["shouldnt:raise:", "clearTimeout", "valueWithTimeout:", "signal", "new"]
  440. }),
  441. $globals.BlockClosureTest);
  442. $core.addMethod(
  443. $core.method({
  444. selector: "testCompiledSource",
  445. protocol: 'tests',
  446. fn: function (){
  447. var self=this;
  448. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  449. return $core.withContext(function($ctx1) {
  450. //>>excludeEnd("ctx");
  451. self._assert_($recv($recv((function(){
  452. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  453. return $core.withContext(function($ctx2) {
  454. //>>excludeEnd("ctx");
  455. return (1).__plus((1));
  456. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  457. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  458. //>>excludeEnd("ctx");
  459. }))._compiledSource())._includesSubString_("function"));
  460. return self;
  461. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  462. }, function($ctx1) {$ctx1.fill(self,"testCompiledSource",{},$globals.BlockClosureTest)});
  463. //>>excludeEnd("ctx");
  464. },
  465. //>>excludeStart("ide", pragmas.excludeIdeData);
  466. args: [],
  467. source: "testCompiledSource\x0a\x09self assert: ([ 1+1 ] compiledSource includesSubString: 'function')",
  468. referencedClasses: [],
  469. //>>excludeEnd("ide");
  470. messageSends: ["assert:", "includesSubString:", "compiledSource", "+"]
  471. }),
  472. $globals.BlockClosureTest);
  473. $core.addMethod(
  474. $core.method({
  475. selector: "testCurrySelf",
  476. protocol: 'tests',
  477. fn: function (){
  478. var self=this;
  479. var curriedMethod,array;
  480. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  481. return $core.withContext(function($ctx1) {
  482. //>>excludeEnd("ctx");
  483. curriedMethod=$recv($recv((function(selfarg,x){
  484. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  485. return $core.withContext(function($ctx2) {
  486. //>>excludeEnd("ctx");
  487. return $recv(selfarg)._at_(x);
  488. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  489. }, function($ctx2) {$ctx2.fillBlock({selfarg:selfarg,x:x},$ctx1,1)});
  490. //>>excludeEnd("ctx");
  491. }))._currySelf())._asCompiledMethod_("foo:");
  492. array=[(3), (1), (4)];
  493. $recv($recv($globals.ClassBuilder)._new())._installMethod_forClass_protocol_(curriedMethod,$globals.Array,"**test helper");
  494. $recv((function(){
  495. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  496. return $core.withContext(function($ctx2) {
  497. //>>excludeEnd("ctx");
  498. return self._assert_equals_($recv(array)._foo_((2)),(1));
  499. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  500. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  501. //>>excludeEnd("ctx");
  502. }))._ensure_((function(){
  503. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  504. return $core.withContext(function($ctx2) {
  505. //>>excludeEnd("ctx");
  506. return $recv($globals.Array)._removeCompiledMethod_(curriedMethod);
  507. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  508. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  509. //>>excludeEnd("ctx");
  510. }));
  511. return self;
  512. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  513. }, function($ctx1) {$ctx1.fill(self,"testCurrySelf",{curriedMethod:curriedMethod,array:array},$globals.BlockClosureTest)});
  514. //>>excludeEnd("ctx");
  515. },
  516. //>>excludeStart("ide", pragmas.excludeIdeData);
  517. args: [],
  518. 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 ]",
  519. referencedClasses: ["ClassBuilder", "Array"],
  520. //>>excludeEnd("ide");
  521. messageSends: ["asCompiledMethod:", "currySelf", "at:", "installMethod:forClass:protocol:", "new", "ensure:", "assert:equals:", "foo:", "removeCompiledMethod:"]
  522. }),
  523. $globals.BlockClosureTest);
  524. $core.addMethod(
  525. $core.method({
  526. selector: "testEnsure",
  527. protocol: 'tests',
  528. fn: function (){
  529. var self=this;
  530. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  531. return $core.withContext(function($ctx1) {
  532. //>>excludeEnd("ctx");
  533. self._assert_equals_($recv((function(){
  534. return (3);
  535. }))._ensure_((function(){
  536. return (4);
  537. })),(3));
  538. return self;
  539. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  540. }, function($ctx1) {$ctx1.fill(self,"testEnsure",{},$globals.BlockClosureTest)});
  541. //>>excludeEnd("ctx");
  542. },
  543. //>>excludeStart("ide", pragmas.excludeIdeData);
  544. args: [],
  545. source: "testEnsure\x0a\x09self assert: ([ 3 ] ensure: [ 4 ]) equals: 3",
  546. referencedClasses: [],
  547. //>>excludeEnd("ide");
  548. messageSends: ["assert:equals:", "ensure:"]
  549. }),
  550. $globals.BlockClosureTest);
  551. $core.addMethod(
  552. $core.method({
  553. selector: "testEnsureRaises",
  554. protocol: 'tests',
  555. fn: function (){
  556. var self=this;
  557. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  558. return $core.withContext(function($ctx1) {
  559. //>>excludeEnd("ctx");
  560. self._should_raise_((function(){
  561. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  562. return $core.withContext(function($ctx2) {
  563. //>>excludeEnd("ctx");
  564. return $recv((function(){
  565. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  566. return $core.withContext(function($ctx3) {
  567. //>>excludeEnd("ctx");
  568. return $recv($recv($globals.Error)._new())._signal();
  569. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  570. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  571. //>>excludeEnd("ctx");
  572. }))._ensure_((function(){
  573. return true;
  574. }));
  575. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  576. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  577. //>>excludeEnd("ctx");
  578. }),$globals.Error);
  579. return self;
  580. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  581. }, function($ctx1) {$ctx1.fill(self,"testEnsureRaises",{},$globals.BlockClosureTest)});
  582. //>>excludeEnd("ctx");
  583. },
  584. //>>excludeStart("ide", pragmas.excludeIdeData);
  585. args: [],
  586. source: "testEnsureRaises\x0a\x09self should: [ [Error new signal ] ensure: [ true ]] raise: Error",
  587. referencedClasses: ["Error"],
  588. //>>excludeEnd("ide");
  589. messageSends: ["should:raise:", "ensure:", "signal", "new"]
  590. }),
  591. $globals.BlockClosureTest);
  592. $core.addMethod(
  593. $core.method({
  594. selector: "testExceptionSemantics",
  595. protocol: 'tests',
  596. fn: function (){
  597. var self=this;
  598. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  599. return $core.withContext(function($ctx1) {
  600. //>>excludeEnd("ctx");
  601. self._timeout_((100));
  602. $recv(self._async_((function(){
  603. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  604. return $core.withContext(function($ctx2) {
  605. //>>excludeEnd("ctx");
  606. return $recv((function(){
  607. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  608. return $core.withContext(function($ctx3) {
  609. //>>excludeEnd("ctx");
  610. self._assert_(true);
  611. $recv($globals.Error)._signal();
  612. self._deny_(true);
  613. return self._finished();
  614. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  615. $ctx3.sendIdx["finished"]=1;
  616. //>>excludeEnd("ctx");
  617. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  618. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  619. //>>excludeEnd("ctx");
  620. }))._on_do_($globals.Error,(function(ex){
  621. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  622. return $core.withContext(function($ctx3) {
  623. //>>excludeEnd("ctx");
  624. return self._finished();
  625. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  626. }, function($ctx3) {$ctx3.fillBlock({ex:ex},$ctx2,3)});
  627. //>>excludeEnd("ctx");
  628. }));
  629. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  630. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  631. //>>excludeEnd("ctx");
  632. })))._valueWithTimeout_((0));
  633. return self;
  634. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  635. }, function($ctx1) {$ctx1.fill(self,"testExceptionSemantics",{},$globals.BlockClosureTest)});
  636. //>>excludeEnd("ctx");
  637. },
  638. //>>excludeStart("ide", pragmas.excludeIdeData);
  639. args: [],
  640. 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",
  641. referencedClasses: ["Error"],
  642. //>>excludeEnd("ide");
  643. messageSends: ["timeout:", "valueWithTimeout:", "async:", "on:do:", "assert:", "signal", "deny:", "finished"]
  644. }),
  645. $globals.BlockClosureTest);
  646. $core.addMethod(
  647. $core.method({
  648. selector: "testLocalReturnOnDoCatch",
  649. protocol: 'tests',
  650. fn: function (){
  651. var self=this;
  652. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  653. return $core.withContext(function($ctx1) {
  654. //>>excludeEnd("ctx");
  655. self._assert_equals_(self._localReturnOnDoCatch(),(2));
  656. return self;
  657. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  658. }, function($ctx1) {$ctx1.fill(self,"testLocalReturnOnDoCatch",{},$globals.BlockClosureTest)});
  659. //>>excludeEnd("ctx");
  660. },
  661. //>>excludeStart("ide", pragmas.excludeIdeData);
  662. args: [],
  663. source: "testLocalReturnOnDoCatch\x0a\x09self assert: self localReturnOnDoCatch equals: 2",
  664. referencedClasses: [],
  665. //>>excludeEnd("ide");
  666. messageSends: ["assert:equals:", "localReturnOnDoCatch"]
  667. }),
  668. $globals.BlockClosureTest);
  669. $core.addMethod(
  670. $core.method({
  671. selector: "testLocalReturnOnDoMiss",
  672. protocol: 'tests',
  673. fn: function (){
  674. var self=this;
  675. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  676. return $core.withContext(function($ctx1) {
  677. //>>excludeEnd("ctx");
  678. self._assert_equals_(self._localReturnOnDoMiss(),(2));
  679. return self;
  680. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  681. }, function($ctx1) {$ctx1.fill(self,"testLocalReturnOnDoMiss",{},$globals.BlockClosureTest)});
  682. //>>excludeEnd("ctx");
  683. },
  684. //>>excludeStart("ide", pragmas.excludeIdeData);
  685. args: [],
  686. source: "testLocalReturnOnDoMiss\x0a\x09self assert: self localReturnOnDoMiss equals: 2",
  687. referencedClasses: [],
  688. //>>excludeEnd("ide");
  689. messageSends: ["assert:equals:", "localReturnOnDoMiss"]
  690. }),
  691. $globals.BlockClosureTest);
  692. $core.addMethod(
  693. $core.method({
  694. selector: "testNewWithValues",
  695. protocol: 'tests',
  696. fn: function (){
  697. var self=this;
  698. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  699. return $core.withContext(function($ctx1) {
  700. //>>excludeEnd("ctx");
  701. function TestConstructor(arg1, arg2, arg3) {}
  702. TestConstructor.prototype.name = "theTestPrototype";
  703. var wrappedConstructor = $recv(TestConstructor);
  704. var result = wrappedConstructor._newWithValues_([1, 2, 3]);
  705. self._assert_(result instanceof TestConstructor);
  706. self._assert_equals_(result.name, "theTestPrototype");
  707. /* newWithValues: cannot help if the argument list is wrong, and should warn that a mistake was made. */
  708. self._should_raise_(function () {wrappedConstructor._newWithValues_("single argument");}, $globals.Error);;
  709. return self;
  710. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  711. }, function($ctx1) {$ctx1.fill(self,"testNewWithValues",{},$globals.BlockClosureTest)});
  712. //>>excludeEnd("ctx");
  713. },
  714. //>>excludeStart("ide", pragmas.excludeIdeData);
  715. args: [],
  716. source: "testNewWithValues\x0a<inlineJS: '\x0a\x09function TestConstructor(arg1, arg2, arg3) {}\x0a\x09TestConstructor.prototype.name = \x22theTestPrototype\x22;\x0a\x0a\x09var wrappedConstructor = $recv(TestConstructor);\x0a\x09var result = wrappedConstructor._newWithValues_([1, 2, 3]);\x0a\x09self._assert_(result instanceof TestConstructor);\x0a\x09self._assert_equals_(result.name, \x22theTestPrototype\x22);\x0a\x0a\x09/* newWithValues: cannot help if the argument list is wrong, and should warn that a mistake was made. */\x0a\x09self._should_raise_(function () {wrappedConstructor._newWithValues_(\x22single argument\x22);}, $globals.Error);\x0a'>",
  717. referencedClasses: [],
  718. //>>excludeEnd("ide");
  719. messageSends: []
  720. }),
  721. $globals.BlockClosureTest);
  722. $core.addMethod(
  723. $core.method({
  724. selector: "testNumArgs",
  725. protocol: 'tests',
  726. fn: function (){
  727. var self=this;
  728. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  729. return $core.withContext(function($ctx1) {
  730. //>>excludeEnd("ctx");
  731. var $1;
  732. $1=$recv((function(){
  733. }))._numArgs();
  734. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  735. $ctx1.sendIdx["numArgs"]=1;
  736. //>>excludeEnd("ctx");
  737. self._assert_equals_($1,(0));
  738. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  739. $ctx1.sendIdx["assert:equals:"]=1;
  740. //>>excludeEnd("ctx");
  741. self._assert_equals_($recv((function(a,b){
  742. }))._numArgs(),(2));
  743. return self;
  744. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  745. }, function($ctx1) {$ctx1.fill(self,"testNumArgs",{},$globals.BlockClosureTest)});
  746. //>>excludeEnd("ctx");
  747. },
  748. //>>excludeStart("ide", pragmas.excludeIdeData);
  749. args: [],
  750. source: "testNumArgs\x0a\x09self assert: [] numArgs equals: 0.\x0a\x09self assert: [ :a :b | ] numArgs equals: 2",
  751. referencedClasses: [],
  752. //>>excludeEnd("ide");
  753. messageSends: ["assert:equals:", "numArgs"]
  754. }),
  755. $globals.BlockClosureTest);
  756. $core.addMethod(
  757. $core.method({
  758. selector: "testOnDo",
  759. protocol: 'tests',
  760. fn: function (){
  761. var self=this;
  762. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  763. return $core.withContext(function($ctx1) {
  764. //>>excludeEnd("ctx");
  765. self._assert_($recv((function(){
  766. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  767. return $core.withContext(function($ctx2) {
  768. //>>excludeEnd("ctx");
  769. return $recv($recv($globals.Error)._new())._signal();
  770. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  771. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  772. //>>excludeEnd("ctx");
  773. }))._on_do_($globals.Error,(function(ex){
  774. return true;
  775. })));
  776. return self;
  777. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  778. }, function($ctx1) {$ctx1.fill(self,"testOnDo",{},$globals.BlockClosureTest)});
  779. //>>excludeEnd("ctx");
  780. },
  781. //>>excludeStart("ide", pragmas.excludeIdeData);
  782. args: [],
  783. source: "testOnDo\x0a\x09self assert: ([ Error new signal ] on: Error do: [ :ex | true ])",
  784. referencedClasses: ["Error"],
  785. //>>excludeEnd("ide");
  786. messageSends: ["assert:", "on:do:", "signal", "new"]
  787. }),
  788. $globals.BlockClosureTest);
  789. $core.addMethod(
  790. $core.method({
  791. selector: "testValue",
  792. protocol: 'tests',
  793. fn: function (){
  794. var self=this;
  795. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  796. return $core.withContext(function($ctx1) {
  797. //>>excludeEnd("ctx");
  798. var $1;
  799. $1=$recv((function(){
  800. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  801. return $core.withContext(function($ctx2) {
  802. //>>excludeEnd("ctx");
  803. return (1).__plus((1));
  804. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  805. $ctx2.sendIdx["+"]=1;
  806. //>>excludeEnd("ctx");
  807. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  808. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  809. //>>excludeEnd("ctx");
  810. }))._value();
  811. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  812. $ctx1.sendIdx["value"]=1;
  813. //>>excludeEnd("ctx");
  814. self._assert_equals_($1,(2));
  815. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  816. $ctx1.sendIdx["assert:equals:"]=1;
  817. //>>excludeEnd("ctx");
  818. self._assert_equals_($recv((function(x){
  819. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  820. return $core.withContext(function($ctx2) {
  821. //>>excludeEnd("ctx");
  822. return $recv(x).__plus((1));
  823. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  824. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,2)});
  825. //>>excludeEnd("ctx");
  826. }))._value_((2)),(3));
  827. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  828. $ctx1.sendIdx["assert:equals:"]=2;
  829. //>>excludeEnd("ctx");
  830. self._assert_equals_($recv((function(x,y){
  831. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  832. return $core.withContext(function($ctx2) {
  833. //>>excludeEnd("ctx");
  834. return $recv(x).__star(y);
  835. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  836. }, function($ctx2) {$ctx2.fillBlock({x:x,y:y},$ctx1,3)});
  837. //>>excludeEnd("ctx");
  838. }))._value_value_((2),(4)),(8));
  839. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  840. $ctx1.sendIdx["assert:equals:"]=3;
  841. //>>excludeEnd("ctx");
  842. self._assert_equals_($recv((function(a,b,c){
  843. return (1);
  844. }))._value(),(1));
  845. return self;
  846. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  847. }, function($ctx1) {$ctx1.fill(self,"testValue",{},$globals.BlockClosureTest)});
  848. //>>excludeEnd("ctx");
  849. },
  850. //>>excludeStart("ide", pragmas.excludeIdeData);
  851. args: [],
  852. 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",
  853. referencedClasses: [],
  854. //>>excludeEnd("ide");
  855. messageSends: ["assert:equals:", "value", "+", "value:", "value:value:", "*"]
  856. }),
  857. $globals.BlockClosureTest);
  858. $core.addMethod(
  859. $core.method({
  860. selector: "testValueWithPossibleArguments",
  861. protocol: 'tests',
  862. fn: function (){
  863. var self=this;
  864. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  865. return $core.withContext(function($ctx1) {
  866. //>>excludeEnd("ctx");
  867. var $1,$2;
  868. $1=$recv((function(){
  869. return (1);
  870. }))._valueWithPossibleArguments_([(3), (4)]);
  871. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  872. $ctx1.sendIdx["valueWithPossibleArguments:"]=1;
  873. //>>excludeEnd("ctx");
  874. self._assert_equals_($1,(1));
  875. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  876. $ctx1.sendIdx["assert:equals:"]=1;
  877. //>>excludeEnd("ctx");
  878. $2=$recv((function(a){
  879. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  880. return $core.withContext(function($ctx2) {
  881. //>>excludeEnd("ctx");
  882. return $recv(a).__plus((4));
  883. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  884. $ctx2.sendIdx["+"]=1;
  885. //>>excludeEnd("ctx");
  886. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  887. }, function($ctx2) {$ctx2.fillBlock({a:a},$ctx1,2)});
  888. //>>excludeEnd("ctx");
  889. }))._valueWithPossibleArguments_([(3), (4)]);
  890. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  891. $ctx1.sendIdx["valueWithPossibleArguments:"]=2;
  892. //>>excludeEnd("ctx");
  893. self._assert_equals_($2,(7));
  894. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  895. $ctx1.sendIdx["assert:equals:"]=2;
  896. //>>excludeEnd("ctx");
  897. self._assert_equals_($recv((function(a,b){
  898. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  899. return $core.withContext(function($ctx2) {
  900. //>>excludeEnd("ctx");
  901. return $recv(a).__plus(b);
  902. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  903. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1,3)});
  904. //>>excludeEnd("ctx");
  905. }))._valueWithPossibleArguments_([(3), (4), (5)]),(7));
  906. return self;
  907. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  908. }, function($ctx1) {$ctx1.fill(self,"testValueWithPossibleArguments",{},$globals.BlockClosureTest)});
  909. //>>excludeEnd("ctx");
  910. },
  911. //>>excludeStart("ide", pragmas.excludeIdeData);
  912. args: [],
  913. 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.",
  914. referencedClasses: [],
  915. //>>excludeEnd("ide");
  916. messageSends: ["assert:equals:", "valueWithPossibleArguments:", "+"]
  917. }),
  918. $globals.BlockClosureTest);
  919. $core.addMethod(
  920. $core.method({
  921. selector: "testWhileFalse",
  922. protocol: 'tests',
  923. fn: function (){
  924. var self=this;
  925. var i;
  926. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  927. return $core.withContext(function($ctx1) {
  928. //>>excludeEnd("ctx");
  929. i=(0);
  930. $recv((function(){
  931. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  932. return $core.withContext(function($ctx2) {
  933. //>>excludeEnd("ctx");
  934. return $recv(i).__gt((5));
  935. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  936. $ctx2.sendIdx[">"]=1;
  937. //>>excludeEnd("ctx");
  938. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  939. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  940. //>>excludeEnd("ctx");
  941. }))._whileFalse_((function(){
  942. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  943. return $core.withContext(function($ctx2) {
  944. //>>excludeEnd("ctx");
  945. i=$recv(i).__plus((1));
  946. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  947. $ctx2.sendIdx["+"]=1;
  948. //>>excludeEnd("ctx");
  949. return i;
  950. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  951. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  952. //>>excludeEnd("ctx");
  953. }));
  954. self._assert_equals_(i,(6));
  955. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  956. $ctx1.sendIdx["assert:equals:"]=1;
  957. //>>excludeEnd("ctx");
  958. i=(0);
  959. $recv((function(){
  960. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  961. return $core.withContext(function($ctx2) {
  962. //>>excludeEnd("ctx");
  963. i=$recv(i).__plus((1));
  964. i;
  965. return $recv(i).__gt((5));
  966. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  967. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  968. //>>excludeEnd("ctx");
  969. }))._whileFalse();
  970. self._assert_equals_(i,(6));
  971. return self;
  972. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  973. }, function($ctx1) {$ctx1.fill(self,"testWhileFalse",{i:i},$globals.BlockClosureTest)});
  974. //>>excludeEnd("ctx");
  975. },
  976. //>>excludeStart("ide", pragmas.excludeIdeData);
  977. args: [],
  978. 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",
  979. referencedClasses: [],
  980. //>>excludeEnd("ide");
  981. messageSends: ["whileFalse:", ">", "+", "assert:equals:", "whileFalse"]
  982. }),
  983. $globals.BlockClosureTest);
  984. $core.addMethod(
  985. $core.method({
  986. selector: "testWhileTrue",
  987. protocol: 'tests',
  988. fn: function (){
  989. var self=this;
  990. var i;
  991. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  992. return $core.withContext(function($ctx1) {
  993. //>>excludeEnd("ctx");
  994. i=(0);
  995. $recv((function(){
  996. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  997. return $core.withContext(function($ctx2) {
  998. //>>excludeEnd("ctx");
  999. return $recv(i).__lt((5));
  1000. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1001. $ctx2.sendIdx["<"]=1;
  1002. //>>excludeEnd("ctx");
  1003. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1004. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  1005. //>>excludeEnd("ctx");
  1006. }))._whileTrue_((function(){
  1007. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1008. return $core.withContext(function($ctx2) {
  1009. //>>excludeEnd("ctx");
  1010. i=$recv(i).__plus((1));
  1011. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1012. $ctx2.sendIdx["+"]=1;
  1013. //>>excludeEnd("ctx");
  1014. return i;
  1015. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1016. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  1017. //>>excludeEnd("ctx");
  1018. }));
  1019. self._assert_equals_(i,(5));
  1020. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1021. $ctx1.sendIdx["assert:equals:"]=1;
  1022. //>>excludeEnd("ctx");
  1023. i=(0);
  1024. $recv((function(){
  1025. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1026. return $core.withContext(function($ctx2) {
  1027. //>>excludeEnd("ctx");
  1028. i=$recv(i).__plus((1));
  1029. i;
  1030. return $recv(i).__lt((5));
  1031. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1032. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  1033. //>>excludeEnd("ctx");
  1034. }))._whileTrue();
  1035. self._assert_equals_(i,(5));
  1036. return self;
  1037. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1038. }, function($ctx1) {$ctx1.fill(self,"testWhileTrue",{i:i},$globals.BlockClosureTest)});
  1039. //>>excludeEnd("ctx");
  1040. },
  1041. //>>excludeStart("ide", pragmas.excludeIdeData);
  1042. args: [],
  1043. 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",
  1044. referencedClasses: [],
  1045. //>>excludeEnd("ide");
  1046. messageSends: ["whileTrue:", "<", "+", "assert:equals:", "whileTrue"]
  1047. }),
  1048. $globals.BlockClosureTest);
  1049. $core.addClass('BooleanTest', $globals.TestCase, [], 'Kernel-Tests');
  1050. $core.addMethod(
  1051. $core.method({
  1052. selector: "testEquality",
  1053. protocol: 'tests',
  1054. fn: function (){
  1055. var self=this;
  1056. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1057. return $core.withContext(function($ctx1) {
  1058. //>>excludeEnd("ctx");
  1059. var $1,$2,$3,$4,$5,$6,$7,$8,$10,$9,$12,$11;
  1060. $1=(0).__eq(false);
  1061. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1062. $ctx1.sendIdx["="]=1;
  1063. //>>excludeEnd("ctx");
  1064. self._deny_($1);
  1065. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1066. $ctx1.sendIdx["deny:"]=1;
  1067. //>>excludeEnd("ctx");
  1068. $2=false.__eq((0));
  1069. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1070. $ctx1.sendIdx["="]=2;
  1071. //>>excludeEnd("ctx");
  1072. self._deny_($2);
  1073. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1074. $ctx1.sendIdx["deny:"]=2;
  1075. //>>excludeEnd("ctx");
  1076. $3="".__eq(false);
  1077. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1078. $ctx1.sendIdx["="]=3;
  1079. //>>excludeEnd("ctx");
  1080. self._deny_($3);
  1081. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1082. $ctx1.sendIdx["deny:"]=3;
  1083. //>>excludeEnd("ctx");
  1084. $4=false.__eq("");
  1085. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1086. $ctx1.sendIdx["="]=4;
  1087. //>>excludeEnd("ctx");
  1088. self._deny_($4);
  1089. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1090. $ctx1.sendIdx["deny:"]=4;
  1091. //>>excludeEnd("ctx");
  1092. $5=true.__eq(true);
  1093. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1094. $ctx1.sendIdx["="]=5;
  1095. //>>excludeEnd("ctx");
  1096. self._assert_($5);
  1097. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1098. $ctx1.sendIdx["assert:"]=1;
  1099. //>>excludeEnd("ctx");
  1100. $6=false.__eq(true);
  1101. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1102. $ctx1.sendIdx["="]=6;
  1103. //>>excludeEnd("ctx");
  1104. self._deny_($6);
  1105. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1106. $ctx1.sendIdx["deny:"]=5;
  1107. //>>excludeEnd("ctx");
  1108. $7=true.__eq(false);
  1109. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1110. $ctx1.sendIdx["="]=7;
  1111. //>>excludeEnd("ctx");
  1112. self._deny_($7);
  1113. $8=false.__eq(false);
  1114. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1115. $ctx1.sendIdx["="]=8;
  1116. //>>excludeEnd("ctx");
  1117. self._assert_($8);
  1118. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1119. $ctx1.sendIdx["assert:"]=2;
  1120. //>>excludeEnd("ctx");
  1121. $10=true._yourself();
  1122. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1123. $ctx1.sendIdx["yourself"]=1;
  1124. //>>excludeEnd("ctx");
  1125. $9=$recv($10).__eq(true);
  1126. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1127. $ctx1.sendIdx["="]=9;
  1128. //>>excludeEnd("ctx");
  1129. self._assert_($9);
  1130. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1131. $ctx1.sendIdx["assert:"]=3;
  1132. //>>excludeEnd("ctx");
  1133. $12=true._yourself();
  1134. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1135. $ctx1.sendIdx["yourself"]=2;
  1136. //>>excludeEnd("ctx");
  1137. $11=$recv($12).__eq(true._yourself());
  1138. self._assert_($11);
  1139. return self;
  1140. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1141. }, function($ctx1) {$ctx1.fill(self,"testEquality",{},$globals.BooleanTest)});
  1142. //>>excludeEnd("ctx");
  1143. },
  1144. //>>excludeStart("ide", pragmas.excludeIdeData);
  1145. args: [],
  1146. 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)",
  1147. referencedClasses: [],
  1148. //>>excludeEnd("ide");
  1149. messageSends: ["deny:", "=", "assert:", "yourself"]
  1150. }),
  1151. $globals.BooleanTest);
  1152. $core.addMethod(
  1153. $core.method({
  1154. selector: "testIdentity",
  1155. protocol: 'tests',
  1156. fn: function (){
  1157. var self=this;
  1158. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1159. return $core.withContext(function($ctx1) {
  1160. //>>excludeEnd("ctx");
  1161. var $1,$2,$3,$4,$5,$6,$7,$8,$10,$9,$12,$11;
  1162. $1=(0).__eq_eq(false);
  1163. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1164. $ctx1.sendIdx["=="]=1;
  1165. //>>excludeEnd("ctx");
  1166. self._deny_($1);
  1167. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1168. $ctx1.sendIdx["deny:"]=1;
  1169. //>>excludeEnd("ctx");
  1170. $2=false.__eq_eq((0));
  1171. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1172. $ctx1.sendIdx["=="]=2;
  1173. //>>excludeEnd("ctx");
  1174. self._deny_($2);
  1175. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1176. $ctx1.sendIdx["deny:"]=2;
  1177. //>>excludeEnd("ctx");
  1178. $3="".__eq_eq(false);
  1179. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1180. $ctx1.sendIdx["=="]=3;
  1181. //>>excludeEnd("ctx");
  1182. self._deny_($3);
  1183. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1184. $ctx1.sendIdx["deny:"]=3;
  1185. //>>excludeEnd("ctx");
  1186. $4=false.__eq_eq("");
  1187. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1188. $ctx1.sendIdx["=="]=4;
  1189. //>>excludeEnd("ctx");
  1190. self._deny_($4);
  1191. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1192. $ctx1.sendIdx["deny:"]=4;
  1193. //>>excludeEnd("ctx");
  1194. $5=true.__eq_eq(true);
  1195. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1196. $ctx1.sendIdx["=="]=5;
  1197. //>>excludeEnd("ctx");
  1198. self._assert_($5);
  1199. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1200. $ctx1.sendIdx["assert:"]=1;
  1201. //>>excludeEnd("ctx");
  1202. $6=false.__eq_eq(true);
  1203. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1204. $ctx1.sendIdx["=="]=6;
  1205. //>>excludeEnd("ctx");
  1206. self._deny_($6);
  1207. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1208. $ctx1.sendIdx["deny:"]=5;
  1209. //>>excludeEnd("ctx");
  1210. $7=true.__eq_eq(false);
  1211. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1212. $ctx1.sendIdx["=="]=7;
  1213. //>>excludeEnd("ctx");
  1214. self._deny_($7);
  1215. $8=false.__eq_eq(false);
  1216. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1217. $ctx1.sendIdx["=="]=8;
  1218. //>>excludeEnd("ctx");
  1219. self._assert_($8);
  1220. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1221. $ctx1.sendIdx["assert:"]=2;
  1222. //>>excludeEnd("ctx");
  1223. $10=true._yourself();
  1224. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1225. $ctx1.sendIdx["yourself"]=1;
  1226. //>>excludeEnd("ctx");
  1227. $9=$recv($10).__eq_eq(true);
  1228. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1229. $ctx1.sendIdx["=="]=9;
  1230. //>>excludeEnd("ctx");
  1231. self._assert_($9);
  1232. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1233. $ctx1.sendIdx["assert:"]=3;
  1234. //>>excludeEnd("ctx");
  1235. $12=true._yourself();
  1236. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1237. $ctx1.sendIdx["yourself"]=2;
  1238. //>>excludeEnd("ctx");
  1239. $11=$recv($12).__eq_eq(true._yourself());
  1240. self._assert_($11);
  1241. return self;
  1242. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1243. }, function($ctx1) {$ctx1.fill(self,"testIdentity",{},$globals.BooleanTest)});
  1244. //>>excludeEnd("ctx");
  1245. },
  1246. //>>excludeStart("ide", pragmas.excludeIdeData);
  1247. args: [],
  1248. 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",
  1249. referencedClasses: [],
  1250. //>>excludeEnd("ide");
  1251. messageSends: ["deny:", "==", "assert:", "yourself"]
  1252. }),
  1253. $globals.BooleanTest);
  1254. $core.addMethod(
  1255. $core.method({
  1256. selector: "testIfTrueIfFalse",
  1257. protocol: 'tests',
  1258. fn: function (){
  1259. var self=this;
  1260. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1261. return $core.withContext(function($ctx1) {
  1262. //>>excludeEnd("ctx");
  1263. var $1,$2,$3,$4,$5,$6,$7,$8;
  1264. if($core.assert(true)){
  1265. $1="alternative block";
  1266. };
  1267. self._assert_equals_($1,"alternative block");
  1268. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1269. $ctx1.sendIdx["assert:equals:"]=1;
  1270. //>>excludeEnd("ctx");
  1271. if(!$core.assert(true)){
  1272. $2="alternative block";
  1273. };
  1274. self._assert_equals_($2,nil);
  1275. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1276. $ctx1.sendIdx["assert:equals:"]=2;
  1277. //>>excludeEnd("ctx");
  1278. if($core.assert(false)){
  1279. $3="alternative block";
  1280. };
  1281. self._assert_equals_($3,nil);
  1282. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1283. $ctx1.sendIdx["assert:equals:"]=3;
  1284. //>>excludeEnd("ctx");
  1285. if(!$core.assert(false)){
  1286. $4="alternative block";
  1287. };
  1288. self._assert_equals_($4,"alternative block");
  1289. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1290. $ctx1.sendIdx["assert:equals:"]=4;
  1291. //>>excludeEnd("ctx");
  1292. if($core.assert(false)){
  1293. $5="alternative block";
  1294. } else {
  1295. $5="alternative block2";
  1296. };
  1297. self._assert_equals_($5,"alternative block2");
  1298. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1299. $ctx1.sendIdx["assert:equals:"]=5;
  1300. //>>excludeEnd("ctx");
  1301. if($core.assert(false)){
  1302. $6="alternative block2";
  1303. } else {
  1304. $6="alternative block";
  1305. };
  1306. self._assert_equals_($6,"alternative block");
  1307. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1308. $ctx1.sendIdx["assert:equals:"]=6;
  1309. //>>excludeEnd("ctx");
  1310. if($core.assert(true)){
  1311. $7="alternative block";
  1312. } else {
  1313. $7="alternative block2";
  1314. };
  1315. self._assert_equals_($7,"alternative block");
  1316. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1317. $ctx1.sendIdx["assert:equals:"]=7;
  1318. //>>excludeEnd("ctx");
  1319. if($core.assert(true)){
  1320. $8="alternative block2";
  1321. } else {
  1322. $8="alternative block";
  1323. };
  1324. self._assert_equals_($8,"alternative block2");
  1325. return self;
  1326. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1327. }, function($ctx1) {$ctx1.fill(self,"testIfTrueIfFalse",{},$globals.BooleanTest)});
  1328. //>>excludeEnd("ctx");
  1329. },
  1330. //>>excludeStart("ide", pragmas.excludeIdeData);
  1331. args: [],
  1332. 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'.",
  1333. referencedClasses: [],
  1334. //>>excludeEnd("ide");
  1335. messageSends: ["assert:equals:", "ifTrue:", "ifFalse:", "ifTrue:ifFalse:", "ifFalse:ifTrue:"]
  1336. }),
  1337. $globals.BooleanTest);
  1338. $core.addMethod(
  1339. $core.method({
  1340. selector: "testIfTrueIfFalseWithBoxing",
  1341. protocol: 'tests',
  1342. fn: function (){
  1343. var self=this;
  1344. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1345. return $core.withContext(function($ctx1) {
  1346. //>>excludeEnd("ctx");
  1347. var $2,$1,$4,$3,$6,$5,$8,$7,$10,$9,$12,$11,$14,$13,$16,$15;
  1348. $2=true._yourself();
  1349. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1350. $ctx1.sendIdx["yourself"]=1;
  1351. //>>excludeEnd("ctx");
  1352. if($core.assert($2)){
  1353. $1="alternative block";
  1354. };
  1355. self._assert_equals_($1,"alternative block");
  1356. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1357. $ctx1.sendIdx["assert:equals:"]=1;
  1358. //>>excludeEnd("ctx");
  1359. $4=true._yourself();
  1360. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1361. $ctx1.sendIdx["yourself"]=2;
  1362. //>>excludeEnd("ctx");
  1363. if(!$core.assert($4)){
  1364. $3="alternative block";
  1365. };
  1366. self._assert_equals_($3,nil);
  1367. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1368. $ctx1.sendIdx["assert:equals:"]=2;
  1369. //>>excludeEnd("ctx");
  1370. $6=false._yourself();
  1371. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1372. $ctx1.sendIdx["yourself"]=3;
  1373. //>>excludeEnd("ctx");
  1374. if($core.assert($6)){
  1375. $5="alternative block";
  1376. };
  1377. self._assert_equals_($5,nil);
  1378. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1379. $ctx1.sendIdx["assert:equals:"]=3;
  1380. //>>excludeEnd("ctx");
  1381. $8=false._yourself();
  1382. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1383. $ctx1.sendIdx["yourself"]=4;
  1384. //>>excludeEnd("ctx");
  1385. if(!$core.assert($8)){
  1386. $7="alternative block";
  1387. };
  1388. self._assert_equals_($7,"alternative block");
  1389. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1390. $ctx1.sendIdx["assert:equals:"]=4;
  1391. //>>excludeEnd("ctx");
  1392. $10=false._yourself();
  1393. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1394. $ctx1.sendIdx["yourself"]=5;
  1395. //>>excludeEnd("ctx");
  1396. if($core.assert($10)){
  1397. $9="alternative block";
  1398. } else {
  1399. $9="alternative block2";
  1400. };
  1401. self._assert_equals_($9,"alternative block2");
  1402. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1403. $ctx1.sendIdx["assert:equals:"]=5;
  1404. //>>excludeEnd("ctx");
  1405. $12=false._yourself();
  1406. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1407. $ctx1.sendIdx["yourself"]=6;
  1408. //>>excludeEnd("ctx");
  1409. if($core.assert($12)){
  1410. $11="alternative block2";
  1411. } else {
  1412. $11="alternative block";
  1413. };
  1414. self._assert_equals_($11,"alternative block");
  1415. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1416. $ctx1.sendIdx["assert:equals:"]=6;
  1417. //>>excludeEnd("ctx");
  1418. $14=true._yourself();
  1419. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1420. $ctx1.sendIdx["yourself"]=7;
  1421. //>>excludeEnd("ctx");
  1422. if($core.assert($14)){
  1423. $13="alternative block";
  1424. } else {
  1425. $13="alternative block2";
  1426. };
  1427. self._assert_equals_($13,"alternative block");
  1428. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1429. $ctx1.sendIdx["assert:equals:"]=7;
  1430. //>>excludeEnd("ctx");
  1431. $16=true._yourself();
  1432. if($core.assert($16)){
  1433. $15="alternative block2";
  1434. } else {
  1435. $15="alternative block";
  1436. };
  1437. self._assert_equals_($15,"alternative block2");
  1438. return self;
  1439. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1440. }, function($ctx1) {$ctx1.fill(self,"testIfTrueIfFalseWithBoxing",{},$globals.BooleanTest)});
  1441. //>>excludeEnd("ctx");
  1442. },
  1443. //>>excludeStart("ide", pragmas.excludeIdeData);
  1444. args: [],
  1445. 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'.",
  1446. referencedClasses: [],
  1447. //>>excludeEnd("ide");
  1448. messageSends: ["assert:equals:", "ifTrue:", "yourself", "ifFalse:", "ifTrue:ifFalse:", "ifFalse:ifTrue:"]
  1449. }),
  1450. $globals.BooleanTest);
  1451. $core.addMethod(
  1452. $core.method({
  1453. selector: "testLogic",
  1454. protocol: 'tests',
  1455. fn: function (){
  1456. var self=this;
  1457. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1458. return $core.withContext(function($ctx1) {
  1459. //>>excludeEnd("ctx");
  1460. var $1,$2,$3,$5,$4,$6,$7,$8,$10,$9,$12,$11,$14,$13,$16,$17,$15,$19,$18,$21,$20,$23,$22;
  1461. $1=true.__and(true);
  1462. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1463. $ctx1.sendIdx["&"]=1;
  1464. //>>excludeEnd("ctx");
  1465. self._assert_($1);
  1466. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1467. $ctx1.sendIdx["assert:"]=1;
  1468. //>>excludeEnd("ctx");
  1469. $2=true.__and(false);
  1470. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1471. $ctx1.sendIdx["&"]=2;
  1472. //>>excludeEnd("ctx");
  1473. self._deny_($2);
  1474. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1475. $ctx1.sendIdx["deny:"]=1;
  1476. //>>excludeEnd("ctx");
  1477. $3=false.__and(true);
  1478. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1479. $ctx1.sendIdx["&"]=3;
  1480. //>>excludeEnd("ctx");
  1481. self._deny_($3);
  1482. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1483. $ctx1.sendIdx["deny:"]=2;
  1484. //>>excludeEnd("ctx");
  1485. $5=false.__and(false);
  1486. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1487. $ctx1.sendIdx["&"]=4;
  1488. //>>excludeEnd("ctx");
  1489. $4=self._deny_($5);
  1490. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1491. $ctx1.sendIdx["deny:"]=3;
  1492. //>>excludeEnd("ctx");
  1493. $6=true.__or(true);
  1494. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1495. $ctx1.sendIdx["|"]=1;
  1496. //>>excludeEnd("ctx");
  1497. self._assert_($6);
  1498. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1499. $ctx1.sendIdx["assert:"]=2;
  1500. //>>excludeEnd("ctx");
  1501. $7=true.__or(false);
  1502. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1503. $ctx1.sendIdx["|"]=2;
  1504. //>>excludeEnd("ctx");
  1505. self._assert_($7);
  1506. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1507. $ctx1.sendIdx["assert:"]=3;
  1508. //>>excludeEnd("ctx");
  1509. $8=false.__or(true);
  1510. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1511. $ctx1.sendIdx["|"]=3;
  1512. //>>excludeEnd("ctx");
  1513. self._assert_($8);
  1514. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1515. $ctx1.sendIdx["assert:"]=4;
  1516. //>>excludeEnd("ctx");
  1517. $10=false.__or(false);
  1518. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1519. $ctx1.sendIdx["|"]=4;
  1520. //>>excludeEnd("ctx");
  1521. $9=self._deny_($10);
  1522. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1523. $ctx1.sendIdx["deny:"]=4;
  1524. //>>excludeEnd("ctx");
  1525. $12=(1).__gt((0));
  1526. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1527. $ctx1.sendIdx[">"]=1;
  1528. //>>excludeEnd("ctx");
  1529. $11=true.__and($12);
  1530. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1531. $ctx1.sendIdx["&"]=5;
  1532. //>>excludeEnd("ctx");
  1533. self._assert_($11);
  1534. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1535. $ctx1.sendIdx["assert:"]=5;
  1536. //>>excludeEnd("ctx");
  1537. $14=(1).__gt((0));
  1538. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1539. $ctx1.sendIdx[">"]=2;
  1540. //>>excludeEnd("ctx");
  1541. $13=$recv($14).__and(false);
  1542. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1543. $ctx1.sendIdx["&"]=6;
  1544. //>>excludeEnd("ctx");
  1545. self._deny_($13);
  1546. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1547. $ctx1.sendIdx["deny:"]=5;
  1548. //>>excludeEnd("ctx");
  1549. $16=(1).__gt((0));
  1550. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1551. $ctx1.sendIdx[">"]=3;
  1552. //>>excludeEnd("ctx");
  1553. $17=(1).__gt((2));
  1554. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1555. $ctx1.sendIdx[">"]=4;
  1556. //>>excludeEnd("ctx");
  1557. $15=$recv($16).__and($17);
  1558. self._deny_($15);
  1559. $19=(1).__gt((0));
  1560. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1561. $ctx1.sendIdx[">"]=5;
  1562. //>>excludeEnd("ctx");
  1563. $18=false.__or($19);
  1564. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1565. $ctx1.sendIdx["|"]=5;
  1566. //>>excludeEnd("ctx");
  1567. self._assert_($18);
  1568. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1569. $ctx1.sendIdx["assert:"]=6;
  1570. //>>excludeEnd("ctx");
  1571. $21=(1).__gt((0));
  1572. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1573. $ctx1.sendIdx[">"]=6;
  1574. //>>excludeEnd("ctx");
  1575. $20=$recv($21).__or(false);
  1576. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1577. $ctx1.sendIdx["|"]=6;
  1578. //>>excludeEnd("ctx");
  1579. self._assert_($20);
  1580. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1581. $ctx1.sendIdx["assert:"]=7;
  1582. //>>excludeEnd("ctx");
  1583. $23=(1).__gt((0));
  1584. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1585. $ctx1.sendIdx[">"]=7;
  1586. //>>excludeEnd("ctx");
  1587. $22=$recv($23).__or((1).__gt((2)));
  1588. self._assert_($22);
  1589. return self;
  1590. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1591. }, function($ctx1) {$ctx1.fill(self,"testLogic",{},$globals.BooleanTest)});
  1592. //>>excludeEnd("ctx");
  1593. },
  1594. //>>excludeStart("ide", pragmas.excludeIdeData);
  1595. args: [],
  1596. 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))",
  1597. referencedClasses: [],
  1598. //>>excludeEnd("ide");
  1599. messageSends: ["assert:", "&", "deny:", "|", ">"]
  1600. }),
  1601. $globals.BooleanTest);
  1602. $core.addMethod(
  1603. $core.method({
  1604. selector: "testLogicKeywords",
  1605. protocol: 'tests',
  1606. fn: function (){
  1607. var self=this;
  1608. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1609. return $core.withContext(function($ctx1) {
  1610. //>>excludeEnd("ctx");
  1611. var $1,$2,$3,$5,$4,$6,$7,$8,$10,$9,$11,$13,$12,$15,$14,$16,$18,$17,$20,$19;
  1612. $1=true._and_((function(){
  1613. return true;
  1614. }));
  1615. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1616. $ctx1.sendIdx["and:"]=1;
  1617. //>>excludeEnd("ctx");
  1618. self._assert_($1);
  1619. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1620. $ctx1.sendIdx["assert:"]=1;
  1621. //>>excludeEnd("ctx");
  1622. $2=true._and_((function(){
  1623. return false;
  1624. }));
  1625. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1626. $ctx1.sendIdx["and:"]=2;
  1627. //>>excludeEnd("ctx");
  1628. self._deny_($2);
  1629. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1630. $ctx1.sendIdx["deny:"]=1;
  1631. //>>excludeEnd("ctx");
  1632. $3=false._and_((function(){
  1633. return true;
  1634. }));
  1635. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1636. $ctx1.sendIdx["and:"]=3;
  1637. //>>excludeEnd("ctx");
  1638. self._deny_($3);
  1639. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1640. $ctx1.sendIdx["deny:"]=2;
  1641. //>>excludeEnd("ctx");
  1642. $5=false._and_((function(){
  1643. return false;
  1644. }));
  1645. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1646. $ctx1.sendIdx["and:"]=4;
  1647. //>>excludeEnd("ctx");
  1648. $4=self._deny_($5);
  1649. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1650. $ctx1.sendIdx["deny:"]=3;
  1651. //>>excludeEnd("ctx");
  1652. $6=true._or_((function(){
  1653. return true;
  1654. }));
  1655. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1656. $ctx1.sendIdx["or:"]=1;
  1657. //>>excludeEnd("ctx");
  1658. self._assert_($6);
  1659. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1660. $ctx1.sendIdx["assert:"]=2;
  1661. //>>excludeEnd("ctx");
  1662. $7=true._or_((function(){
  1663. return false;
  1664. }));
  1665. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1666. $ctx1.sendIdx["or:"]=2;
  1667. //>>excludeEnd("ctx");
  1668. self._assert_($7);
  1669. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1670. $ctx1.sendIdx["assert:"]=3;
  1671. //>>excludeEnd("ctx");
  1672. $8=false._or_((function(){
  1673. return true;
  1674. }));
  1675. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1676. $ctx1.sendIdx["or:"]=3;
  1677. //>>excludeEnd("ctx");
  1678. self._assert_($8);
  1679. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1680. $ctx1.sendIdx["assert:"]=4;
  1681. //>>excludeEnd("ctx");
  1682. $10=false._or_((function(){
  1683. return false;
  1684. }));
  1685. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1686. $ctx1.sendIdx["or:"]=4;
  1687. //>>excludeEnd("ctx");
  1688. $9=self._deny_($10);
  1689. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1690. $ctx1.sendIdx["deny:"]=4;
  1691. //>>excludeEnd("ctx");
  1692. $11=true._and_((function(){
  1693. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1694. return $core.withContext(function($ctx2) {
  1695. //>>excludeEnd("ctx");
  1696. return (1).__gt((0));
  1697. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1698. $ctx2.sendIdx[">"]=1;
  1699. //>>excludeEnd("ctx");
  1700. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1701. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,9)});
  1702. //>>excludeEnd("ctx");
  1703. }));
  1704. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1705. $ctx1.sendIdx["and:"]=5;
  1706. //>>excludeEnd("ctx");
  1707. self._assert_($11);
  1708. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1709. $ctx1.sendIdx["assert:"]=5;
  1710. //>>excludeEnd("ctx");
  1711. $13=(1).__gt((0));
  1712. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1713. $ctx1.sendIdx[">"]=2;
  1714. //>>excludeEnd("ctx");
  1715. $12=$recv($13)._and_((function(){
  1716. return false;
  1717. }));
  1718. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1719. $ctx1.sendIdx["and:"]=6;
  1720. //>>excludeEnd("ctx");
  1721. self._deny_($12);
  1722. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1723. $ctx1.sendIdx["deny:"]=5;
  1724. //>>excludeEnd("ctx");
  1725. $15=(1).__gt((0));
  1726. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1727. $ctx1.sendIdx[">"]=3;
  1728. //>>excludeEnd("ctx");
  1729. $14=$recv($15)._and_((function(){
  1730. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1731. return $core.withContext(function($ctx2) {
  1732. //>>excludeEnd("ctx");
  1733. return (1).__gt((2));
  1734. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1735. $ctx2.sendIdx[">"]=4;
  1736. //>>excludeEnd("ctx");
  1737. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1738. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,11)});
  1739. //>>excludeEnd("ctx");
  1740. }));
  1741. self._deny_($14);
  1742. $16=false._or_((function(){
  1743. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1744. return $core.withContext(function($ctx2) {
  1745. //>>excludeEnd("ctx");
  1746. return (1).__gt((0));
  1747. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1748. $ctx2.sendIdx[">"]=5;
  1749. //>>excludeEnd("ctx");
  1750. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1751. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,12)});
  1752. //>>excludeEnd("ctx");
  1753. }));
  1754. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1755. $ctx1.sendIdx["or:"]=5;
  1756. //>>excludeEnd("ctx");
  1757. self._assert_($16);
  1758. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1759. $ctx1.sendIdx["assert:"]=6;
  1760. //>>excludeEnd("ctx");
  1761. $18=(1).__gt((0));
  1762. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1763. $ctx1.sendIdx[">"]=6;
  1764. //>>excludeEnd("ctx");
  1765. $17=$recv($18)._or_((function(){
  1766. return false;
  1767. }));
  1768. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1769. $ctx1.sendIdx["or:"]=6;
  1770. //>>excludeEnd("ctx");
  1771. self._assert_($17);
  1772. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1773. $ctx1.sendIdx["assert:"]=7;
  1774. //>>excludeEnd("ctx");
  1775. $20=(1).__gt((0));
  1776. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1777. $ctx1.sendIdx[">"]=7;
  1778. //>>excludeEnd("ctx");
  1779. $19=$recv($20)._or_((function(){
  1780. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1781. return $core.withContext(function($ctx2) {
  1782. //>>excludeEnd("ctx");
  1783. return (1).__gt((2));
  1784. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1785. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,14)});
  1786. //>>excludeEnd("ctx");
  1787. }));
  1788. self._assert_($19);
  1789. return self;
  1790. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1791. }, function($ctx1) {$ctx1.fill(self,"testLogicKeywords",{},$globals.BooleanTest)});
  1792. //>>excludeEnd("ctx");
  1793. },
  1794. //>>excludeStart("ide", pragmas.excludeIdeData);
  1795. args: [],
  1796. 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 ])",
  1797. referencedClasses: [],
  1798. //>>excludeEnd("ide");
  1799. messageSends: ["assert:", "and:", "deny:", "or:", ">"]
  1800. }),
  1801. $globals.BooleanTest);
  1802. $core.addMethod(
  1803. $core.method({
  1804. selector: "testNonBooleanError",
  1805. protocol: 'tests',
  1806. fn: function (){
  1807. var self=this;
  1808. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1809. return $core.withContext(function($ctx1) {
  1810. //>>excludeEnd("ctx");
  1811. self._should_raise_((function(){
  1812. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1813. return $core.withContext(function($ctx2) {
  1814. //>>excludeEnd("ctx");
  1815. if($core.assert("")){
  1816. } else {
  1817. };
  1818. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1819. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  1820. //>>excludeEnd("ctx");
  1821. }),$globals.NonBooleanReceiver);
  1822. return self;
  1823. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1824. }, function($ctx1) {$ctx1.fill(self,"testNonBooleanError",{},$globals.BooleanTest)});
  1825. //>>excludeEnd("ctx");
  1826. },
  1827. //>>excludeStart("ide", pragmas.excludeIdeData);
  1828. args: [],
  1829. source: "testNonBooleanError\x0a\x09self should: [ '' ifTrue: [] ifFalse: [] ] raise: NonBooleanReceiver",
  1830. referencedClasses: ["NonBooleanReceiver"],
  1831. //>>excludeEnd("ide");
  1832. messageSends: ["should:raise:", "ifTrue:ifFalse:"]
  1833. }),
  1834. $globals.BooleanTest);
  1835. $core.addClass('ClassBuilderTest', $globals.TestCase, ['builder', 'theClass'], 'Kernel-Tests');
  1836. $core.addMethod(
  1837. $core.method({
  1838. selector: "setUp",
  1839. protocol: 'running',
  1840. fn: function (){
  1841. var self=this;
  1842. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1843. return $core.withContext(function($ctx1) {
  1844. //>>excludeEnd("ctx");
  1845. self["@builder"]=$recv($globals.ClassBuilder)._new();
  1846. return self;
  1847. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1848. }, function($ctx1) {$ctx1.fill(self,"setUp",{},$globals.ClassBuilderTest)});
  1849. //>>excludeEnd("ctx");
  1850. },
  1851. //>>excludeStart("ide", pragmas.excludeIdeData);
  1852. args: [],
  1853. source: "setUp\x0a\x09builder := ClassBuilder new",
  1854. referencedClasses: ["ClassBuilder"],
  1855. //>>excludeEnd("ide");
  1856. messageSends: ["new"]
  1857. }),
  1858. $globals.ClassBuilderTest);
  1859. $core.addMethod(
  1860. $core.method({
  1861. selector: "tearDown",
  1862. protocol: 'running',
  1863. fn: function (){
  1864. var self=this;
  1865. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1866. return $core.withContext(function($ctx1) {
  1867. //>>excludeEnd("ctx");
  1868. var $1,$receiver;
  1869. $1=self["@theClass"];
  1870. if(($receiver = $1) == null || $receiver.isNil){
  1871. $1;
  1872. } else {
  1873. $recv($globals.Smalltalk)._removeClass_(self["@theClass"]);
  1874. self["@theClass"]=nil;
  1875. self["@theClass"];
  1876. };
  1877. return self;
  1878. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1879. }, function($ctx1) {$ctx1.fill(self,"tearDown",{},$globals.ClassBuilderTest)});
  1880. //>>excludeEnd("ctx");
  1881. },
  1882. //>>excludeStart("ide", pragmas.excludeIdeData);
  1883. args: [],
  1884. source: "tearDown\x0a\x09theClass ifNotNil: [ Smalltalk removeClass: theClass. theClass := nil ]",
  1885. referencedClasses: ["Smalltalk"],
  1886. //>>excludeEnd("ide");
  1887. messageSends: ["ifNotNil:", "removeClass:"]
  1888. }),
  1889. $globals.ClassBuilderTest);
  1890. $core.addMethod(
  1891. $core.method({
  1892. selector: "testClassCopy",
  1893. protocol: 'tests',
  1894. fn: function (){
  1895. var self=this;
  1896. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1897. return $core.withContext(function($ctx1) {
  1898. //>>excludeEnd("ctx");
  1899. var $2,$1,$4,$3,$6,$5,$8,$7;
  1900. self["@theClass"]=$recv(self["@builder"])._copyClass_named_($globals.ObjectMock,"ObjectMock2");
  1901. $2=$recv(self["@theClass"])._superclass();
  1902. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1903. $ctx1.sendIdx["superclass"]=1;
  1904. //>>excludeEnd("ctx");
  1905. $1=$recv($2).__eq_eq($recv($globals.ObjectMock)._superclass());
  1906. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1907. $ctx1.sendIdx["=="]=1;
  1908. //>>excludeEnd("ctx");
  1909. self._assert_($1);
  1910. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1911. $ctx1.sendIdx["assert:"]=1;
  1912. //>>excludeEnd("ctx");
  1913. $4=$recv(self["@theClass"])._instanceVariableNames();
  1914. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1915. $ctx1.sendIdx["instanceVariableNames"]=1;
  1916. //>>excludeEnd("ctx");
  1917. $3=$recv($4).__eq_eq($recv($globals.ObjectMock)._instanceVariableNames());
  1918. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1919. $ctx1.sendIdx["=="]=2;
  1920. //>>excludeEnd("ctx");
  1921. self._assert_($3);
  1922. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1923. $ctx1.sendIdx["assert:"]=2;
  1924. //>>excludeEnd("ctx");
  1925. self._assert_equals_($recv(self["@theClass"])._name(),"ObjectMock2");
  1926. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1927. $ctx1.sendIdx["assert:equals:"]=1;
  1928. //>>excludeEnd("ctx");
  1929. $6=$recv(self["@theClass"])._package();
  1930. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1931. $ctx1.sendIdx["package"]=1;
  1932. //>>excludeEnd("ctx");
  1933. $5=$recv($6).__eq_eq($recv($globals.ObjectMock)._package());
  1934. self._assert_($5);
  1935. $8=$recv(self["@theClass"])._methodDictionary();
  1936. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1937. $ctx1.sendIdx["methodDictionary"]=1;
  1938. //>>excludeEnd("ctx");
  1939. $7=$recv($8)._keys();
  1940. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1941. $ctx1.sendIdx["keys"]=1;
  1942. //>>excludeEnd("ctx");
  1943. self._assert_equals_($7,$recv($recv($globals.ObjectMock)._methodDictionary())._keys());
  1944. return self;
  1945. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1946. }, function($ctx1) {$ctx1.fill(self,"testClassCopy",{},$globals.ClassBuilderTest)});
  1947. //>>excludeEnd("ctx");
  1948. },
  1949. //>>excludeStart("ide", pragmas.excludeIdeData);
  1950. args: [],
  1951. 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",
  1952. referencedClasses: ["ObjectMock"],
  1953. //>>excludeEnd("ide");
  1954. messageSends: ["copyClass:named:", "assert:", "==", "superclass", "instanceVariableNames", "assert:equals:", "name", "package", "keys", "methodDictionary"]
  1955. }),
  1956. $globals.ClassBuilderTest);
  1957. $core.addMethod(
  1958. $core.method({
  1959. selector: "testClassMigration",
  1960. protocol: 'tests',
  1961. fn: function (){
  1962. var self=this;
  1963. var instance,oldClass;
  1964. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1965. return $core.withContext(function($ctx1) {
  1966. //>>excludeEnd("ctx");
  1967. var $2,$1,$4,$3,$5,$6,$7,$8,$9,$11,$10;
  1968. oldClass=$recv(self["@builder"])._copyClass_named_($globals.ObjectMock,"ObjectMock2");
  1969. $2=$recv($globals.Smalltalk)._globals();
  1970. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1971. $ctx1.sendIdx["globals"]=1;
  1972. //>>excludeEnd("ctx");
  1973. $1=$recv($2)._at_("ObjectMock2");
  1974. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1975. $ctx1.sendIdx["at:"]=1;
  1976. //>>excludeEnd("ctx");
  1977. instance=$recv($1)._new();
  1978. $4=$recv($globals.Smalltalk)._globals();
  1979. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1980. $ctx1.sendIdx["globals"]=2;
  1981. //>>excludeEnd("ctx");
  1982. $3=$recv($4)._at_("ObjectMock2");
  1983. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1984. $ctx1.sendIdx["at:"]=2;
  1985. //>>excludeEnd("ctx");
  1986. $recv($globals.ObjectMock)._subclass_instanceVariableNames_package_($3,"","Kernel-Tests");
  1987. $5=$recv(oldClass).__eq_eq($globals.ObjectMock2);
  1988. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1989. $ctx1.sendIdx["=="]=1;
  1990. //>>excludeEnd("ctx");
  1991. self._deny_($5);
  1992. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1993. $ctx1.sendIdx["deny:"]=1;
  1994. //>>excludeEnd("ctx");
  1995. $6=$recv($recv($globals.ObjectMock2)._superclass()).__eq_eq($globals.ObjectMock);
  1996. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1997. $ctx1.sendIdx["=="]=2;
  1998. //>>excludeEnd("ctx");
  1999. self._assert_($6);
  2000. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2001. $ctx1.sendIdx["assert:"]=1;
  2002. //>>excludeEnd("ctx");
  2003. self._assert_($recv($recv($globals.ObjectMock2)._instanceVariableNames())._isEmpty());
  2004. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2005. $ctx1.sendIdx["assert:"]=2;
  2006. //>>excludeEnd("ctx");
  2007. $7=$recv($globals.ObjectMock2)._selectors();
  2008. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2009. $ctx1.sendIdx["selectors"]=1;
  2010. //>>excludeEnd("ctx");
  2011. self._assert_equals_($7,$recv(oldClass)._selectors());
  2012. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2013. $ctx1.sendIdx["assert:equals:"]=1;
  2014. //>>excludeEnd("ctx");
  2015. $8=$recv($globals.ObjectMock2)._comment();
  2016. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2017. $ctx1.sendIdx["comment"]=1;
  2018. //>>excludeEnd("ctx");
  2019. self._assert_equals_($8,$recv(oldClass)._comment());
  2020. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2021. $ctx1.sendIdx["assert:equals:"]=2;
  2022. //>>excludeEnd("ctx");
  2023. $9=$recv($recv($globals.ObjectMock2)._package())._name();
  2024. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2025. $ctx1.sendIdx["name"]=1;
  2026. //>>excludeEnd("ctx");
  2027. self._assert_equals_($9,"Kernel-Tests");
  2028. $11=$recv(instance)._class();
  2029. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2030. $ctx1.sendIdx["class"]=1;
  2031. //>>excludeEnd("ctx");
  2032. $10=$recv($11).__eq_eq($globals.ObjectMock2);
  2033. self._deny_($10);
  2034. self._assert_($recv($recv($recv($globals.Smalltalk)._globals())._at_($recv($recv(instance)._class())._name()))._isNil());
  2035. $recv($globals.Smalltalk)._removeClass_($globals.ObjectMock2);
  2036. return self;
  2037. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2038. }, function($ctx1) {$ctx1.fill(self,"testClassMigration",{instance:instance,oldClass:oldClass},$globals.ClassBuilderTest)});
  2039. //>>excludeEnd("ctx");
  2040. },
  2041. //>>excludeStart("ide", pragmas.excludeIdeData);
  2042. args: [],
  2043. 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",
  2044. referencedClasses: ["ObjectMock", "Smalltalk", "ObjectMock2"],
  2045. //>>excludeEnd("ide");
  2046. messageSends: ["copyClass:named:", "new", "at:", "globals", "subclass:instanceVariableNames:package:", "deny:", "==", "assert:", "superclass", "isEmpty", "instanceVariableNames", "assert:equals:", "selectors", "comment", "name", "package", "class", "isNil", "removeClass:"]
  2047. }),
  2048. $globals.ClassBuilderTest);
  2049. $core.addMethod(
  2050. $core.method({
  2051. selector: "testClassMigrationWithClassInstanceVariables",
  2052. protocol: 'tests',
  2053. fn: function (){
  2054. var self=this;
  2055. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2056. return $core.withContext(function($ctx1) {
  2057. //>>excludeEnd("ctx");
  2058. var $1;
  2059. $recv(self["@builder"])._copyClass_named_($globals.ObjectMock,"ObjectMock2");
  2060. $1=$recv($globals.ObjectMock2)._class();
  2061. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2062. $ctx1.sendIdx["class"]=1;
  2063. //>>excludeEnd("ctx");
  2064. $recv($1)._instanceVariableNames_("foo bar");
  2065. $recv($globals.ObjectMock)._subclass_instanceVariableNames_package_($recv($recv($globals.Smalltalk)._globals())._at_("ObjectMock2"),"","Kernel-Tests");
  2066. self._assert_equals_($recv($recv($globals.ObjectMock2)._class())._instanceVariableNames(),["foo", "bar"]);
  2067. $recv($globals.Smalltalk)._removeClass_($globals.ObjectMock2);
  2068. return self;
  2069. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2070. }, function($ctx1) {$ctx1.fill(self,"testClassMigrationWithClassInstanceVariables",{},$globals.ClassBuilderTest)});
  2071. //>>excludeEnd("ctx");
  2072. },
  2073. //>>excludeStart("ide", pragmas.excludeIdeData);
  2074. args: [],
  2075. 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",
  2076. referencedClasses: ["ObjectMock", "ObjectMock2", "Smalltalk"],
  2077. //>>excludeEnd("ide");
  2078. messageSends: ["copyClass:named:", "instanceVariableNames:", "class", "subclass:instanceVariableNames:package:", "at:", "globals", "assert:equals:", "instanceVariableNames", "removeClass:"]
  2079. }),
  2080. $globals.ClassBuilderTest);
  2081. $core.addMethod(
  2082. $core.method({
  2083. selector: "testClassMigrationWithSubclasses",
  2084. protocol: 'tests',
  2085. fn: function (){
  2086. var self=this;
  2087. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2088. return $core.withContext(function($ctx1) {
  2089. //>>excludeEnd("ctx");
  2090. var $2,$1,$4,$3;
  2091. $recv(self["@builder"])._copyClass_named_($globals.ObjectMock,"ObjectMock2");
  2092. $recv($globals.ObjectMock2)._subclass_instanceVariableNames_package_("ObjectMock3","","Kernel-Tests");
  2093. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2094. $ctx1.sendIdx["subclass:instanceVariableNames:package:"]=1;
  2095. //>>excludeEnd("ctx");
  2096. $recv($globals.ObjectMock3)._subclass_instanceVariableNames_package_("ObjectMock4","","Kernel-Tests");
  2097. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2098. $ctx1.sendIdx["subclass:instanceVariableNames:package:"]=2;
  2099. //>>excludeEnd("ctx");
  2100. $recv($globals.ObjectMock)._subclass_instanceVariableNames_package_($recv($recv($globals.Smalltalk)._globals())._at_("ObjectMock2"),"","Kernel-Tests");
  2101. $2=$recv($globals.ObjectMock)._subclasses();
  2102. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2103. $ctx1.sendIdx["subclasses"]=1;
  2104. //>>excludeEnd("ctx");
  2105. $1=$recv($2)._includes_($globals.ObjectMock2);
  2106. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2107. $ctx1.sendIdx["includes:"]=1;
  2108. //>>excludeEnd("ctx");
  2109. self._assert_($1);
  2110. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2111. $ctx1.sendIdx["assert:"]=1;
  2112. //>>excludeEnd("ctx");
  2113. $4=$recv($globals.ObjectMock2)._subclasses();
  2114. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2115. $ctx1.sendIdx["subclasses"]=2;
  2116. //>>excludeEnd("ctx");
  2117. $3=$recv($4)._includes_($globals.ObjectMock3);
  2118. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2119. $ctx1.sendIdx["includes:"]=2;
  2120. //>>excludeEnd("ctx");
  2121. self._assert_($3);
  2122. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2123. $ctx1.sendIdx["assert:"]=2;
  2124. //>>excludeEnd("ctx");
  2125. self._assert_($recv($recv($globals.ObjectMock3)._subclasses())._includes_($globals.ObjectMock4));
  2126. $recv($recv($globals.ObjectMock)._allSubclasses())._do_((function(each){
  2127. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2128. return $core.withContext(function($ctx2) {
  2129. //>>excludeEnd("ctx");
  2130. return $recv($globals.Smalltalk)._removeClass_(each);
  2131. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2132. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2133. //>>excludeEnd("ctx");
  2134. }));
  2135. return self;
  2136. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2137. }, function($ctx1) {$ctx1.fill(self,"testClassMigrationWithSubclasses",{},$globals.ClassBuilderTest)});
  2138. //>>excludeEnd("ctx");
  2139. },
  2140. //>>excludeStart("ide", pragmas.excludeIdeData);
  2141. args: [],
  2142. 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 ]",
  2143. referencedClasses: ["ObjectMock", "ObjectMock2", "ObjectMock3", "Smalltalk", "ObjectMock4"],
  2144. //>>excludeEnd("ide");
  2145. messageSends: ["copyClass:named:", "subclass:instanceVariableNames:package:", "at:", "globals", "assert:", "includes:", "subclasses", "do:", "allSubclasses", "removeClass:"]
  2146. }),
  2147. $globals.ClassBuilderTest);
  2148. $core.addMethod(
  2149. $core.method({
  2150. selector: "testInstanceVariableNames",
  2151. protocol: 'tests',
  2152. fn: function (){
  2153. var self=this;
  2154. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2155. return $core.withContext(function($ctx1) {
  2156. //>>excludeEnd("ctx");
  2157. self._assert_equals_($recv(self["@builder"])._instanceVariableNamesFor_(" hello world "),["hello", "world"]);
  2158. return self;
  2159. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2160. }, function($ctx1) {$ctx1.fill(self,"testInstanceVariableNames",{},$globals.ClassBuilderTest)});
  2161. //>>excludeEnd("ctx");
  2162. },
  2163. //>>excludeStart("ide", pragmas.excludeIdeData);
  2164. args: [],
  2165. source: "testInstanceVariableNames\x0a\x09self assert: (builder instanceVariableNamesFor: ' hello world ') equals: #('hello' 'world')",
  2166. referencedClasses: [],
  2167. //>>excludeEnd("ide");
  2168. messageSends: ["assert:equals:", "instanceVariableNamesFor:"]
  2169. }),
  2170. $globals.ClassBuilderTest);
  2171. $core.addClass('ClassTest', $globals.TestCase, ['builder', 'theClass'], 'Kernel-Tests');
  2172. $core.addMethod(
  2173. $core.method({
  2174. selector: "jsConstructor",
  2175. protocol: 'running',
  2176. fn: function (){
  2177. var self=this;
  2178. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2179. return $core.withContext(function($ctx1) {
  2180. //>>excludeEnd("ctx");
  2181. function Foo(){}
  2182. Foo.prototype.valueOf = function () {return 4;};
  2183. return Foo;
  2184. ;
  2185. return self;
  2186. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2187. }, function($ctx1) {$ctx1.fill(self,"jsConstructor",{},$globals.ClassTest)});
  2188. //>>excludeEnd("ctx");
  2189. },
  2190. //>>excludeStart("ide", pragmas.excludeIdeData);
  2191. args: [],
  2192. source: "jsConstructor\x0a\x09<inlineJS: '\x0a\x09\x09function Foo(){}\x0a\x09\x09Foo.prototype.valueOf = function () {return 4;};\x0a\x09\x09return Foo;\x0a\x09'>",
  2193. referencedClasses: [],
  2194. //>>excludeEnd("ide");
  2195. messageSends: []
  2196. }),
  2197. $globals.ClassTest);
  2198. $core.addMethod(
  2199. $core.method({
  2200. selector: "setUp",
  2201. protocol: 'running',
  2202. fn: function (){
  2203. var self=this;
  2204. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2205. return $core.withContext(function($ctx1) {
  2206. //>>excludeEnd("ctx");
  2207. self["@builder"]=$recv($globals.ClassBuilder)._new();
  2208. return self;
  2209. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2210. }, function($ctx1) {$ctx1.fill(self,"setUp",{},$globals.ClassTest)});
  2211. //>>excludeEnd("ctx");
  2212. },
  2213. //>>excludeStart("ide", pragmas.excludeIdeData);
  2214. args: [],
  2215. source: "setUp\x0a\x09builder := ClassBuilder new",
  2216. referencedClasses: ["ClassBuilder"],
  2217. //>>excludeEnd("ide");
  2218. messageSends: ["new"]
  2219. }),
  2220. $globals.ClassTest);
  2221. $core.addMethod(
  2222. $core.method({
  2223. selector: "tearDown",
  2224. protocol: 'running',
  2225. fn: function (){
  2226. var self=this;
  2227. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2228. return $core.withContext(function($ctx1) {
  2229. //>>excludeEnd("ctx");
  2230. var $1,$receiver;
  2231. $1=self["@theClass"];
  2232. if(($receiver = $1) == null || $receiver.isNil){
  2233. $1;
  2234. } else {
  2235. $recv($globals.Smalltalk)._removeClass_(self["@theClass"]);
  2236. self["@theClass"]=nil;
  2237. self["@theClass"];
  2238. };
  2239. return self;
  2240. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2241. }, function($ctx1) {$ctx1.fill(self,"tearDown",{},$globals.ClassTest)});
  2242. //>>excludeEnd("ctx");
  2243. },
  2244. //>>excludeStart("ide", pragmas.excludeIdeData);
  2245. args: [],
  2246. source: "tearDown\x0a\x09theClass ifNotNil: [ Smalltalk removeClass: theClass. theClass := nil ]",
  2247. referencedClasses: ["Smalltalk"],
  2248. //>>excludeEnd("ide");
  2249. messageSends: ["ifNotNil:", "removeClass:"]
  2250. }),
  2251. $globals.ClassTest);
  2252. $core.addMethod(
  2253. $core.method({
  2254. selector: "testAllSubclasses",
  2255. protocol: 'tests',
  2256. fn: function (){
  2257. var self=this;
  2258. var subclasses,index;
  2259. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2260. return $core.withContext(function($ctx1) {
  2261. //>>excludeEnd("ctx");
  2262. subclasses=$recv($globals.Object)._subclasses();
  2263. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2264. $ctx1.sendIdx["subclasses"]=1;
  2265. //>>excludeEnd("ctx");
  2266. index=(1);
  2267. $recv((function(){
  2268. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2269. return $core.withContext(function($ctx2) {
  2270. //>>excludeEnd("ctx");
  2271. return $recv(index).__gt($recv(subclasses)._size());
  2272. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2273. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  2274. //>>excludeEnd("ctx");
  2275. }))._whileFalse_((function(){
  2276. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2277. return $core.withContext(function($ctx2) {
  2278. //>>excludeEnd("ctx");
  2279. $recv(subclasses)._addAll_($recv($recv(subclasses)._at_(index))._subclasses());
  2280. index=$recv(index).__plus((1));
  2281. return index;
  2282. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2283. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  2284. //>>excludeEnd("ctx");
  2285. }));
  2286. self._assert_equals_($recv($globals.Object)._allSubclasses(),subclasses);
  2287. return self;
  2288. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2289. }, function($ctx1) {$ctx1.fill(self,"testAllSubclasses",{subclasses:subclasses,index:index},$globals.ClassTest)});
  2290. //>>excludeEnd("ctx");
  2291. },
  2292. //>>excludeStart("ide", pragmas.excludeIdeData);
  2293. args: [],
  2294. 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",
  2295. referencedClasses: ["Object"],
  2296. //>>excludeEnd("ide");
  2297. messageSends: ["subclasses", "whileFalse:", ">", "size", "addAll:", "at:", "+", "assert:equals:", "allSubclasses"]
  2298. }),
  2299. $globals.ClassTest);
  2300. $core.addMethod(
  2301. $core.method({
  2302. selector: "testMetaclassSubclasses",
  2303. protocol: 'tests',
  2304. fn: function (){
  2305. var self=this;
  2306. var subclasses;
  2307. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2308. return $core.withContext(function($ctx1) {
  2309. //>>excludeEnd("ctx");
  2310. var $4,$3,$2,$1;
  2311. $4=$recv($globals.Object)._class();
  2312. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2313. $ctx1.sendIdx["class"]=1;
  2314. //>>excludeEnd("ctx");
  2315. $3=$recv($4)._instanceClass();
  2316. $2=$recv($3)._subclasses();
  2317. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2318. $ctx1.sendIdx["subclasses"]=1;
  2319. //>>excludeEnd("ctx");
  2320. $1=$recv($2)._select_((function(each){
  2321. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2322. return $core.withContext(function($ctx2) {
  2323. //>>excludeEnd("ctx");
  2324. return $recv($recv(each)._isMetaclass())._not();
  2325. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2326. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2327. //>>excludeEnd("ctx");
  2328. }));
  2329. subclasses=$recv($1)._collect_((function(each){
  2330. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2331. return $core.withContext(function($ctx2) {
  2332. //>>excludeEnd("ctx");
  2333. return $recv(each)._theMetaClass();
  2334. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2335. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
  2336. //>>excludeEnd("ctx");
  2337. }));
  2338. self._assert_equals_($recv($recv($globals.Object)._class())._subclasses(),subclasses);
  2339. return self;
  2340. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2341. }, function($ctx1) {$ctx1.fill(self,"testMetaclassSubclasses",{subclasses:subclasses},$globals.ClassTest)});
  2342. //>>excludeEnd("ctx");
  2343. },
  2344. //>>excludeStart("ide", pragmas.excludeIdeData);
  2345. args: [],
  2346. 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",
  2347. referencedClasses: ["Object"],
  2348. //>>excludeEnd("ide");
  2349. messageSends: ["collect:", "select:", "subclasses", "instanceClass", "class", "not", "isMetaclass", "theMetaClass", "assert:equals:"]
  2350. }),
  2351. $globals.ClassTest);
  2352. $core.addMethod(
  2353. $core.method({
  2354. selector: "testSetJavaScriptConstructor",
  2355. protocol: 'tests',
  2356. fn: function (){
  2357. var self=this;
  2358. var instance;
  2359. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2360. return $core.withContext(function($ctx1) {
  2361. //>>excludeEnd("ctx");
  2362. var $2,$1,$4,$3,$6,$5,$8,$7;
  2363. self["@theClass"]=$recv(self["@builder"])._copyClass_named_($globals.ObjectMock,"ObjectMock2");
  2364. $recv(self["@theClass"])._javascriptConstructor_(self._jsConstructor());
  2365. $2=$recv(self["@theClass"])._superclass();
  2366. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2367. $ctx1.sendIdx["superclass"]=1;
  2368. //>>excludeEnd("ctx");
  2369. $1=$recv($2).__eq_eq($recv($globals.ObjectMock)._superclass());
  2370. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2371. $ctx1.sendIdx["=="]=1;
  2372. //>>excludeEnd("ctx");
  2373. self._assert_($1);
  2374. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2375. $ctx1.sendIdx["assert:"]=1;
  2376. //>>excludeEnd("ctx");
  2377. $4=$recv(self["@theClass"])._instanceVariableNames();
  2378. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2379. $ctx1.sendIdx["instanceVariableNames"]=1;
  2380. //>>excludeEnd("ctx");
  2381. $3=$recv($4).__eq_eq($recv($globals.ObjectMock)._instanceVariableNames());
  2382. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2383. $ctx1.sendIdx["=="]=2;
  2384. //>>excludeEnd("ctx");
  2385. self._assert_($3);
  2386. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2387. $ctx1.sendIdx["assert:"]=2;
  2388. //>>excludeEnd("ctx");
  2389. self._assert_equals_($recv(self["@theClass"])._name(),"ObjectMock2");
  2390. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2391. $ctx1.sendIdx["assert:equals:"]=1;
  2392. //>>excludeEnd("ctx");
  2393. $6=$recv(self["@theClass"])._package();
  2394. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2395. $ctx1.sendIdx["package"]=1;
  2396. //>>excludeEnd("ctx");
  2397. $5=$recv($6).__eq_eq($recv($globals.ObjectMock)._package());
  2398. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2399. $ctx1.sendIdx["=="]=3;
  2400. //>>excludeEnd("ctx");
  2401. self._assert_($5);
  2402. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2403. $ctx1.sendIdx["assert:"]=3;
  2404. //>>excludeEnd("ctx");
  2405. $8=$recv(self["@theClass"])._methodDictionary();
  2406. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2407. $ctx1.sendIdx["methodDictionary"]=1;
  2408. //>>excludeEnd("ctx");
  2409. $7=$recv($8)._keys();
  2410. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2411. $ctx1.sendIdx["keys"]=1;
  2412. //>>excludeEnd("ctx");
  2413. self._assert_equals_($7,$recv($recv($globals.ObjectMock)._methodDictionary())._keys());
  2414. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2415. $ctx1.sendIdx["assert:equals:"]=2;
  2416. //>>excludeEnd("ctx");
  2417. instance=$recv(self["@theClass"])._new();
  2418. self._assert_($recv($recv(instance)._class()).__eq_eq(self["@theClass"]));
  2419. self._assert_equals_($recv(instance)._value(),(4));
  2420. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2421. $ctx1.sendIdx["assert:equals:"]=3;
  2422. //>>excludeEnd("ctx");
  2423. self._shouldnt_raise_((function(){
  2424. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2425. return $core.withContext(function($ctx2) {
  2426. //>>excludeEnd("ctx");
  2427. return $recv(instance)._foo_((9));
  2428. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2429. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  2430. //>>excludeEnd("ctx");
  2431. }),$globals.Error);
  2432. self._assert_equals_($recv(instance)._foo(),(9));
  2433. return self;
  2434. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2435. }, function($ctx1) {$ctx1.fill(self,"testSetJavaScriptConstructor",{instance:instance},$globals.ClassTest)});
  2436. //>>excludeEnd("ctx");
  2437. },
  2438. //>>excludeStart("ide", pragmas.excludeIdeData);
  2439. args: [],
  2440. 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",
  2441. referencedClasses: ["ObjectMock", "Error"],
  2442. //>>excludeEnd("ide");
  2443. messageSends: ["copyClass:named:", "javascriptConstructor:", "jsConstructor", "assert:", "==", "superclass", "instanceVariableNames", "assert:equals:", "name", "package", "keys", "methodDictionary", "new", "class", "value", "shouldnt:raise:", "foo:", "foo"]
  2444. }),
  2445. $globals.ClassTest);
  2446. $core.addMethod(
  2447. $core.method({
  2448. selector: "testTrickySetJavaScriptConstructor",
  2449. protocol: 'tests',
  2450. fn: function (){
  2451. var self=this;
  2452. var instance;
  2453. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2454. return $core.withContext(function($ctx1) {
  2455. //>>excludeEnd("ctx");
  2456. var $2,$1,$4,$3,$6,$5,$8,$7;
  2457. self["@theClass"]=$recv(self["@builder"])._copyClass_named_($globals.ObjectMock,"ObjectMock2");
  2458. $recv(self["@theClass"])._javascriptConstructor_(self._trickyJsConstructor());
  2459. $2=$recv(self["@theClass"])._superclass();
  2460. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2461. $ctx1.sendIdx["superclass"]=1;
  2462. //>>excludeEnd("ctx");
  2463. $1=$recv($2).__eq_eq($recv($globals.ObjectMock)._superclass());
  2464. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2465. $ctx1.sendIdx["=="]=1;
  2466. //>>excludeEnd("ctx");
  2467. self._assert_($1);
  2468. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2469. $ctx1.sendIdx["assert:"]=1;
  2470. //>>excludeEnd("ctx");
  2471. $4=$recv(self["@theClass"])._instanceVariableNames();
  2472. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2473. $ctx1.sendIdx["instanceVariableNames"]=1;
  2474. //>>excludeEnd("ctx");
  2475. $3=$recv($4).__eq_eq($recv($globals.ObjectMock)._instanceVariableNames());
  2476. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2477. $ctx1.sendIdx["=="]=2;
  2478. //>>excludeEnd("ctx");
  2479. self._assert_($3);
  2480. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2481. $ctx1.sendIdx["assert:"]=2;
  2482. //>>excludeEnd("ctx");
  2483. self._assert_equals_($recv(self["@theClass"])._name(),"ObjectMock2");
  2484. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2485. $ctx1.sendIdx["assert:equals:"]=1;
  2486. //>>excludeEnd("ctx");
  2487. $6=$recv(self["@theClass"])._package();
  2488. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2489. $ctx1.sendIdx["package"]=1;
  2490. //>>excludeEnd("ctx");
  2491. $5=$recv($6).__eq_eq($recv($globals.ObjectMock)._package());
  2492. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2493. $ctx1.sendIdx["=="]=3;
  2494. //>>excludeEnd("ctx");
  2495. self._assert_($5);
  2496. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2497. $ctx1.sendIdx["assert:"]=3;
  2498. //>>excludeEnd("ctx");
  2499. $8=$recv(self["@theClass"])._methodDictionary();
  2500. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2501. $ctx1.sendIdx["methodDictionary"]=1;
  2502. //>>excludeEnd("ctx");
  2503. $7=$recv($8)._keys();
  2504. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2505. $ctx1.sendIdx["keys"]=1;
  2506. //>>excludeEnd("ctx");
  2507. self._assert_equals_($7,$recv($recv($globals.ObjectMock)._methodDictionary())._keys());
  2508. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2509. $ctx1.sendIdx["assert:equals:"]=2;
  2510. //>>excludeEnd("ctx");
  2511. instance=$recv(self["@theClass"])._new();
  2512. self._assert_($recv($recv(instance)._class()).__eq_eq(self["@theClass"]));
  2513. self._assert_equals_($recv(instance)._value(),(4));
  2514. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2515. $ctx1.sendIdx["assert:equals:"]=3;
  2516. //>>excludeEnd("ctx");
  2517. self._shouldnt_raise_((function(){
  2518. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2519. return $core.withContext(function($ctx2) {
  2520. //>>excludeEnd("ctx");
  2521. return $recv(instance)._foo_((9));
  2522. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2523. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  2524. //>>excludeEnd("ctx");
  2525. }),$globals.Error);
  2526. self._assert_equals_($recv(instance)._foo(),(9));
  2527. return self;
  2528. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2529. }, function($ctx1) {$ctx1.fill(self,"testTrickySetJavaScriptConstructor",{instance:instance},$globals.ClassTest)});
  2530. //>>excludeEnd("ctx");
  2531. },
  2532. //>>excludeStart("ide", pragmas.excludeIdeData);
  2533. args: [],
  2534. 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",
  2535. referencedClasses: ["ObjectMock", "Error"],
  2536. //>>excludeEnd("ide");
  2537. messageSends: ["copyClass:named:", "javascriptConstructor:", "trickyJsConstructor", "assert:", "==", "superclass", "instanceVariableNames", "assert:equals:", "name", "package", "keys", "methodDictionary", "new", "class", "value", "shouldnt:raise:", "foo:", "foo"]
  2538. }),
  2539. $globals.ClassTest);
  2540. $core.addMethod(
  2541. $core.method({
  2542. selector: "trickyJsConstructor",
  2543. protocol: 'running',
  2544. fn: function (){
  2545. var self=this;
  2546. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2547. return $core.withContext(function($ctx1) {
  2548. //>>excludeEnd("ctx");
  2549. function Foo(){}
  2550. Foo.prototype.valueOf = function () {return 4;};
  2551. Foo.prototype._foo = function () {return "bar";};
  2552. return Foo;
  2553. ;
  2554. return self;
  2555. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2556. }, function($ctx1) {$ctx1.fill(self,"trickyJsConstructor",{},$globals.ClassTest)});
  2557. //>>excludeEnd("ctx");
  2558. },
  2559. //>>excludeStart("ide", pragmas.excludeIdeData);
  2560. args: [],
  2561. source: "trickyJsConstructor\x0a\x09<inlineJS: '\x0a\x09\x09function Foo(){}\x0a\x09\x09Foo.prototype.valueOf = function () {return 4;};\x0a\x09\x09Foo.prototype._foo = function () {return \x22bar\x22;};\x0a\x09\x09return Foo;\x0a\x09'>",
  2562. referencedClasses: [],
  2563. //>>excludeEnd("ide");
  2564. messageSends: []
  2565. }),
  2566. $globals.ClassTest);
  2567. $core.addClass('CollectionTest', $globals.TestCase, ['sampleBlock'], 'Kernel-Tests');
  2568. $core.addMethod(
  2569. $core.method({
  2570. selector: "assertSameContents:as:",
  2571. protocol: 'convenience',
  2572. fn: function (aCollection,anotherCollection){
  2573. var self=this;
  2574. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2575. return $core.withContext(function($ctx1) {
  2576. //>>excludeEnd("ctx");
  2577. var $2,$1,$4,$3;
  2578. $2=$recv(aCollection)._size();
  2579. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2580. $ctx1.sendIdx["size"]=1;
  2581. //>>excludeEnd("ctx");
  2582. $1=$recv($2).__eq($recv(anotherCollection)._size());
  2583. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2584. $ctx1.sendIdx["="]=1;
  2585. //>>excludeEnd("ctx");
  2586. self._assert_($1);
  2587. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2588. $ctx1.sendIdx["assert:"]=1;
  2589. //>>excludeEnd("ctx");
  2590. $recv(aCollection)._do_((function(each){
  2591. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2592. return $core.withContext(function($ctx2) {
  2593. //>>excludeEnd("ctx");
  2594. $4=$recv(aCollection)._occurrencesOf_(each);
  2595. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2596. $ctx2.sendIdx["occurrencesOf:"]=1;
  2597. //>>excludeEnd("ctx");
  2598. $3=$recv($4).__eq($recv(anotherCollection)._occurrencesOf_(each));
  2599. return self._assert_($3);
  2600. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2601. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2602. //>>excludeEnd("ctx");
  2603. }));
  2604. return self;
  2605. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2606. }, function($ctx1) {$ctx1.fill(self,"assertSameContents:as:",{aCollection:aCollection,anotherCollection:anotherCollection},$globals.CollectionTest)});
  2607. //>>excludeEnd("ctx");
  2608. },
  2609. //>>excludeStart("ide", pragmas.excludeIdeData);
  2610. args: ["aCollection", "anotherCollection"],
  2611. 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)) ]",
  2612. referencedClasses: [],
  2613. //>>excludeEnd("ide");
  2614. messageSends: ["assert:", "=", "size", "do:", "occurrencesOf:"]
  2615. }),
  2616. $globals.CollectionTest);
  2617. $core.addMethod(
  2618. $core.method({
  2619. selector: "collection",
  2620. protocol: 'fixture',
  2621. fn: function (){
  2622. var self=this;
  2623. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2624. return $core.withContext(function($ctx1) {
  2625. //>>excludeEnd("ctx");
  2626. self._subclassResponsibility();
  2627. return self;
  2628. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2629. }, function($ctx1) {$ctx1.fill(self,"collection",{},$globals.CollectionTest)});
  2630. //>>excludeEnd("ctx");
  2631. },
  2632. //>>excludeStart("ide", pragmas.excludeIdeData);
  2633. args: [],
  2634. source: "collection\x0a\x09\x22Answers pre-filled collection of type tested.\x22\x0a\x0a\x09self subclassResponsibility",
  2635. referencedClasses: [],
  2636. //>>excludeEnd("ide");
  2637. messageSends: ["subclassResponsibility"]
  2638. }),
  2639. $globals.CollectionTest);
  2640. $core.addMethod(
  2641. $core.method({
  2642. selector: "collectionClass",
  2643. protocol: 'fixture',
  2644. fn: function (){
  2645. var self=this;
  2646. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2647. return $core.withContext(function($ctx1) {
  2648. //>>excludeEnd("ctx");
  2649. return $recv(self._class())._collectionClass();
  2650. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2651. }, function($ctx1) {$ctx1.fill(self,"collectionClass",{},$globals.CollectionTest)});
  2652. //>>excludeEnd("ctx");
  2653. },
  2654. //>>excludeStart("ide", pragmas.excludeIdeData);
  2655. args: [],
  2656. source: "collectionClass\x0a\x09\x22Answers class of collection type tested\x22\x0a\x0a\x09^ self class collectionClass",
  2657. referencedClasses: [],
  2658. //>>excludeEnd("ide");
  2659. messageSends: ["collectionClass", "class"]
  2660. }),
  2661. $globals.CollectionTest);
  2662. $core.addMethod(
  2663. $core.method({
  2664. selector: "collectionOfPrintStrings",
  2665. protocol: 'fixture',
  2666. fn: function (){
  2667. var self=this;
  2668. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2669. return $core.withContext(function($ctx1) {
  2670. //>>excludeEnd("ctx");
  2671. self._subclassResponsibility();
  2672. return self;
  2673. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2674. }, function($ctx1) {$ctx1.fill(self,"collectionOfPrintStrings",{},$globals.CollectionTest)});
  2675. //>>excludeEnd("ctx");
  2676. },
  2677. //>>excludeStart("ide", pragmas.excludeIdeData);
  2678. args: [],
  2679. source: "collectionOfPrintStrings\x0a\x09\x22Answers self collection but with values\x0a\x09changed to their printStrings\x22\x0a\x0a\x09self subclassResponsibility",
  2680. referencedClasses: [],
  2681. //>>excludeEnd("ide");
  2682. messageSends: ["subclassResponsibility"]
  2683. }),
  2684. $globals.CollectionTest);
  2685. $core.addMethod(
  2686. $core.method({
  2687. selector: "collectionSize",
  2688. protocol: 'fixture',
  2689. fn: function (){
  2690. var self=this;
  2691. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2692. return $core.withContext(function($ctx1) {
  2693. //>>excludeEnd("ctx");
  2694. self._subclassResponsibility();
  2695. return self;
  2696. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2697. }, function($ctx1) {$ctx1.fill(self,"collectionSize",{},$globals.CollectionTest)});
  2698. //>>excludeEnd("ctx");
  2699. },
  2700. //>>excludeStart("ide", pragmas.excludeIdeData);
  2701. args: [],
  2702. source: "collectionSize\x0a\x09\x22Answers size of self collection.\x22\x0a\x0a\x09self subclassResponsibility",
  2703. referencedClasses: [],
  2704. //>>excludeEnd("ide");
  2705. messageSends: ["subclassResponsibility"]
  2706. }),
  2707. $globals.CollectionTest);
  2708. $core.addMethod(
  2709. $core.method({
  2710. selector: "collectionWithDuplicates",
  2711. protocol: 'fixture',
  2712. fn: function (){
  2713. var self=this;
  2714. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2715. return $core.withContext(function($ctx1) {
  2716. //>>excludeEnd("ctx");
  2717. self._subclassResponsibility();
  2718. return self;
  2719. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2720. }, function($ctx1) {$ctx1.fill(self,"collectionWithDuplicates",{},$globals.CollectionTest)});
  2721. //>>excludeEnd("ctx");
  2722. },
  2723. //>>excludeStart("ide", pragmas.excludeIdeData);
  2724. args: [],
  2725. 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",
  2726. referencedClasses: [],
  2727. //>>excludeEnd("ide");
  2728. messageSends: ["subclassResponsibility"]
  2729. }),
  2730. $globals.CollectionTest);
  2731. $core.addMethod(
  2732. $core.method({
  2733. selector: "collectionWithNewValue",
  2734. protocol: 'fixture',
  2735. fn: function (){
  2736. var self=this;
  2737. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2738. return $core.withContext(function($ctx1) {
  2739. //>>excludeEnd("ctx");
  2740. self._subclassResponsibility();
  2741. return self;
  2742. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2743. }, function($ctx1) {$ctx1.fill(self,"collectionWithNewValue",{},$globals.CollectionTest)});
  2744. //>>excludeEnd("ctx");
  2745. },
  2746. //>>excludeStart("ide", pragmas.excludeIdeData);
  2747. args: [],
  2748. 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",
  2749. referencedClasses: [],
  2750. //>>excludeEnd("ide");
  2751. messageSends: ["subclassResponsibility"]
  2752. }),
  2753. $globals.CollectionTest);
  2754. $core.addMethod(
  2755. $core.method({
  2756. selector: "initialize",
  2757. protocol: 'initialization',
  2758. fn: function (){
  2759. var self=this;
  2760. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2761. return $core.withContext(function($ctx1) {
  2762. //>>excludeEnd("ctx");
  2763. (
  2764. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2765. $ctx1.supercall = true,
  2766. //>>excludeEnd("ctx");
  2767. ($globals.CollectionTest.superclass||$boot.nilAsClass).fn.prototype._initialize.apply($recv(self), []));
  2768. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2769. $ctx1.supercall = false;
  2770. //>>excludeEnd("ctx");;
  2771. self["@sampleBlock"]=(function(){
  2772. });
  2773. return self;
  2774. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2775. }, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.CollectionTest)});
  2776. //>>excludeEnd("ctx");
  2777. },
  2778. //>>excludeStart("ide", pragmas.excludeIdeData);
  2779. args: [],
  2780. source: "initialize\x0a\x09super initialize.\x0a\x0a\x09sampleBlock := []",
  2781. referencedClasses: [],
  2782. //>>excludeEnd("ide");
  2783. messageSends: ["initialize"]
  2784. }),
  2785. $globals.CollectionTest);
  2786. $core.addMethod(
  2787. $core.method({
  2788. selector: "isCollectionReadOnly",
  2789. protocol: 'testing',
  2790. fn: function (){
  2791. var self=this;
  2792. return false;
  2793. },
  2794. //>>excludeStart("ide", pragmas.excludeIdeData);
  2795. args: [],
  2796. source: "isCollectionReadOnly\x0a\x09^ false",
  2797. referencedClasses: [],
  2798. //>>excludeEnd("ide");
  2799. messageSends: []
  2800. }),
  2801. $globals.CollectionTest);
  2802. $core.addMethod(
  2803. $core.method({
  2804. selector: "sampleNewValue",
  2805. protocol: 'fixture',
  2806. fn: function (){
  2807. var self=this;
  2808. return "N";
  2809. },
  2810. //>>excludeStart("ide", pragmas.excludeIdeData);
  2811. args: [],
  2812. 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'",
  2813. referencedClasses: [],
  2814. //>>excludeEnd("ide");
  2815. messageSends: []
  2816. }),
  2817. $globals.CollectionTest);
  2818. $core.addMethod(
  2819. $core.method({
  2820. selector: "sampleNewValueAsCollection",
  2821. protocol: 'fixture',
  2822. fn: function (){
  2823. var self=this;
  2824. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2825. return $core.withContext(function($ctx1) {
  2826. //>>excludeEnd("ctx");
  2827. return $recv(self._collectionClass())._with_(self._sampleNewValue());
  2828. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2829. }, function($ctx1) {$ctx1.fill(self,"sampleNewValueAsCollection",{},$globals.CollectionTest)});
  2830. //>>excludeEnd("ctx");
  2831. },
  2832. //>>excludeStart("ide", pragmas.excludeIdeData);
  2833. args: [],
  2834. 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",
  2835. referencedClasses: [],
  2836. //>>excludeEnd("ide");
  2837. messageSends: ["with:", "collectionClass", "sampleNewValue"]
  2838. }),
  2839. $globals.CollectionTest);
  2840. $core.addMethod(
  2841. $core.method({
  2842. selector: "testAddAll",
  2843. protocol: 'tests',
  2844. fn: function (){
  2845. var self=this;
  2846. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2847. return $core.withContext(function($ctx1) {
  2848. //>>excludeEnd("ctx");
  2849. 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;
  2850. $2=self._collection();
  2851. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2852. $ctx1.sendIdx["collection"]=1;
  2853. //>>excludeEnd("ctx");
  2854. $4=self._collectionClass();
  2855. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2856. $ctx1.sendIdx["collectionClass"]=1;
  2857. //>>excludeEnd("ctx");
  2858. $3=$recv($4)._new();
  2859. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2860. $ctx1.sendIdx["new"]=1;
  2861. //>>excludeEnd("ctx");
  2862. $recv($2)._addAll_($3);
  2863. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2864. $ctx1.sendIdx["addAll:"]=1;
  2865. //>>excludeEnd("ctx");
  2866. $5=$recv($2)._yourself();
  2867. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2868. $ctx1.sendIdx["yourself"]=1;
  2869. //>>excludeEnd("ctx");
  2870. $1=$5;
  2871. $6=self._collection();
  2872. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2873. $ctx1.sendIdx["collection"]=2;
  2874. //>>excludeEnd("ctx");
  2875. self._assert_equals_($1,$6);
  2876. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2877. $ctx1.sendIdx["assert:equals:"]=1;
  2878. //>>excludeEnd("ctx");
  2879. $9=self._collectionClass();
  2880. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2881. $ctx1.sendIdx["collectionClass"]=2;
  2882. //>>excludeEnd("ctx");
  2883. $8=$recv($9)._new();
  2884. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2885. $ctx1.sendIdx["new"]=2;
  2886. //>>excludeEnd("ctx");
  2887. $10=self._collection();
  2888. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2889. $ctx1.sendIdx["collection"]=3;
  2890. //>>excludeEnd("ctx");
  2891. $recv($8)._addAll_($10);
  2892. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2893. $ctx1.sendIdx["addAll:"]=2;
  2894. //>>excludeEnd("ctx");
  2895. $11=$recv($8)._yourself();
  2896. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2897. $ctx1.sendIdx["yourself"]=2;
  2898. //>>excludeEnd("ctx");
  2899. $7=$11;
  2900. $12=self._collection();
  2901. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2902. $ctx1.sendIdx["collection"]=4;
  2903. //>>excludeEnd("ctx");
  2904. self._assert_equals_($7,$12);
  2905. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2906. $ctx1.sendIdx["assert:equals:"]=2;
  2907. //>>excludeEnd("ctx");
  2908. $15=self._collectionClass();
  2909. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2910. $ctx1.sendIdx["collectionClass"]=3;
  2911. //>>excludeEnd("ctx");
  2912. $14=$recv($15)._new();
  2913. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2914. $ctx1.sendIdx["new"]=3;
  2915. //>>excludeEnd("ctx");
  2916. $17=self._collectionClass();
  2917. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2918. $ctx1.sendIdx["collectionClass"]=4;
  2919. //>>excludeEnd("ctx");
  2920. $16=$recv($17)._new();
  2921. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2922. $ctx1.sendIdx["new"]=4;
  2923. //>>excludeEnd("ctx");
  2924. $recv($14)._addAll_($16);
  2925. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2926. $ctx1.sendIdx["addAll:"]=3;
  2927. //>>excludeEnd("ctx");
  2928. $18=$recv($14)._yourself();
  2929. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2930. $ctx1.sendIdx["yourself"]=3;
  2931. //>>excludeEnd("ctx");
  2932. $13=$18;
  2933. self._assert_equals_($13,$recv(self._collectionClass())._new());
  2934. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2935. $ctx1.sendIdx["assert:equals:"]=3;
  2936. //>>excludeEnd("ctx");
  2937. $20=self._collection();
  2938. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2939. $ctx1.sendIdx["collection"]=5;
  2940. //>>excludeEnd("ctx");
  2941. $21=self._sampleNewValueAsCollection();
  2942. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2943. $ctx1.sendIdx["sampleNewValueAsCollection"]=1;
  2944. //>>excludeEnd("ctx");
  2945. $recv($20)._addAll_($21);
  2946. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2947. $ctx1.sendIdx["addAll:"]=4;
  2948. //>>excludeEnd("ctx");
  2949. $22=$recv($20)._yourself();
  2950. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2951. $ctx1.sendIdx["yourself"]=4;
  2952. //>>excludeEnd("ctx");
  2953. $19=$22;
  2954. $23=self._collectionWithNewValue();
  2955. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2956. $ctx1.sendIdx["collectionWithNewValue"]=1;
  2957. //>>excludeEnd("ctx");
  2958. self._assert_equals_($19,$23);
  2959. $25=self._sampleNewValueAsCollection();
  2960. $recv($25)._addAll_(self._collection());
  2961. $24=$recv($25)._yourself();
  2962. self._assertSameContents_as_($24,self._collectionWithNewValue());
  2963. return self;
  2964. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2965. }, function($ctx1) {$ctx1.fill(self,"testAddAll",{},$globals.CollectionTest)});
  2966. //>>excludeEnd("ctx");
  2967. },
  2968. //>>excludeStart("ide", pragmas.excludeIdeData);
  2969. args: [],
  2970. 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",
  2971. referencedClasses: [],
  2972. //>>excludeEnd("ide");
  2973. messageSends: ["assert:equals:", "addAll:", "collection", "new", "collectionClass", "yourself", "sampleNewValueAsCollection", "collectionWithNewValue", "assertSameContents:as:"]
  2974. }),
  2975. $globals.CollectionTest);
  2976. $core.addMethod(
  2977. $core.method({
  2978. selector: "testAllSatisfy",
  2979. protocol: 'tests',
  2980. fn: function (){
  2981. var self=this;
  2982. var collection,anyOne;
  2983. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2984. return $core.withContext(function($ctx1) {
  2985. //>>excludeEnd("ctx");
  2986. var $1;
  2987. collection=self._collection();
  2988. anyOne=$recv(collection)._anyOne();
  2989. $1=$recv(collection)._allSatisfy_((function(each){
  2990. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2991. return $core.withContext(function($ctx2) {
  2992. //>>excludeEnd("ctx");
  2993. return $recv(collection)._includes_(each);
  2994. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2995. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2996. //>>excludeEnd("ctx");
  2997. }));
  2998. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2999. $ctx1.sendIdx["allSatisfy:"]=1;
  3000. //>>excludeEnd("ctx");
  3001. self._assert_($1);
  3002. self._deny_($recv(collection)._allSatisfy_((function(each){
  3003. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3004. return $core.withContext(function($ctx2) {
  3005. //>>excludeEnd("ctx");
  3006. return $recv(each).__tild_eq(anyOne);
  3007. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3008. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
  3009. //>>excludeEnd("ctx");
  3010. })));
  3011. return self;
  3012. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3013. }, function($ctx1) {$ctx1.fill(self,"testAllSatisfy",{collection:collection,anyOne:anyOne},$globals.CollectionTest)});
  3014. //>>excludeEnd("ctx");
  3015. },
  3016. //>>excludeStart("ide", pragmas.excludeIdeData);
  3017. args: [],
  3018. 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 ])",
  3019. referencedClasses: [],
  3020. //>>excludeEnd("ide");
  3021. messageSends: ["collection", "anyOne", "assert:", "allSatisfy:", "includes:", "deny:", "~="]
  3022. }),
  3023. $globals.CollectionTest);
  3024. $core.addMethod(
  3025. $core.method({
  3026. selector: "testAnyOne",
  3027. protocol: 'tests',
  3028. fn: function (){
  3029. var self=this;
  3030. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3031. return $core.withContext(function($ctx1) {
  3032. //>>excludeEnd("ctx");
  3033. var $2,$1;
  3034. self._should_raise_((function(){
  3035. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3036. return $core.withContext(function($ctx2) {
  3037. //>>excludeEnd("ctx");
  3038. return $recv($recv(self._collectionClass())._new())._anyOne();
  3039. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3040. $ctx2.sendIdx["anyOne"]=1;
  3041. //>>excludeEnd("ctx");
  3042. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3043. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  3044. //>>excludeEnd("ctx");
  3045. }),$globals.Error);
  3046. $2=self._collection();
  3047. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3048. $ctx1.sendIdx["collection"]=1;
  3049. //>>excludeEnd("ctx");
  3050. $1=$recv($2)._includes_($recv(self._collection())._anyOne());
  3051. self._assert_($1);
  3052. return self;
  3053. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3054. }, function($ctx1) {$ctx1.fill(self,"testAnyOne",{},$globals.CollectionTest)});
  3055. //>>excludeEnd("ctx");
  3056. },
  3057. //>>excludeStart("ide", pragmas.excludeIdeData);
  3058. args: [],
  3059. source: "testAnyOne\x0a\x09self should: [ self collectionClass new anyOne ] raise: Error.\x0a\x09self assert: (self collection includes: self collection anyOne)",
  3060. referencedClasses: ["Error"],
  3061. //>>excludeEnd("ide");
  3062. messageSends: ["should:raise:", "anyOne", "new", "collectionClass", "assert:", "includes:", "collection"]
  3063. }),
  3064. $globals.CollectionTest);
  3065. $core.addMethod(
  3066. $core.method({
  3067. selector: "testAnySatisfy",
  3068. protocol: 'tests',
  3069. fn: function (){
  3070. var self=this;
  3071. var anyOne;
  3072. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3073. return $core.withContext(function($ctx1) {
  3074. //>>excludeEnd("ctx");
  3075. var $1,$3,$2;
  3076. $1=self._collection();
  3077. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3078. $ctx1.sendIdx["collection"]=1;
  3079. //>>excludeEnd("ctx");
  3080. anyOne=$recv($1)._anyOne();
  3081. $3=self._collection();
  3082. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3083. $ctx1.sendIdx["collection"]=2;
  3084. //>>excludeEnd("ctx");
  3085. $2=$recv($3)._anySatisfy_((function(each){
  3086. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3087. return $core.withContext(function($ctx2) {
  3088. //>>excludeEnd("ctx");
  3089. return $recv(each).__eq(anyOne);
  3090. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3091. $ctx2.sendIdx["="]=1;
  3092. //>>excludeEnd("ctx");
  3093. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3094. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  3095. //>>excludeEnd("ctx");
  3096. }));
  3097. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3098. $ctx1.sendIdx["anySatisfy:"]=1;
  3099. //>>excludeEnd("ctx");
  3100. self._assert_($2);
  3101. self._deny_($recv(self._collection())._anySatisfy_((function(each){
  3102. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3103. return $core.withContext(function($ctx2) {
  3104. //>>excludeEnd("ctx");
  3105. return $recv(each).__eq($recv($globals.Object)._new());
  3106. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3107. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
  3108. //>>excludeEnd("ctx");
  3109. })));
  3110. return self;
  3111. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3112. }, function($ctx1) {$ctx1.fill(self,"testAnySatisfy",{anyOne:anyOne},$globals.CollectionTest)});
  3113. //>>excludeEnd("ctx");
  3114. },
  3115. //>>excludeStart("ide", pragmas.excludeIdeData);
  3116. args: [],
  3117. 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 ])",
  3118. referencedClasses: ["Object"],
  3119. //>>excludeEnd("ide");
  3120. messageSends: ["anyOne", "collection", "assert:", "anySatisfy:", "=", "deny:", "new"]
  3121. }),
  3122. $globals.CollectionTest);
  3123. $core.addMethod(
  3124. $core.method({
  3125. selector: "testAsArray",
  3126. protocol: 'tests',
  3127. fn: function (){
  3128. var self=this;
  3129. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3130. return $core.withContext(function($ctx1) {
  3131. //>>excludeEnd("ctx");
  3132. var $1;
  3133. $1=self._collection();
  3134. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3135. $ctx1.sendIdx["collection"]=1;
  3136. //>>excludeEnd("ctx");
  3137. self._assertSameContents_as_($1,$recv(self._collection())._asArray());
  3138. return self;
  3139. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3140. }, function($ctx1) {$ctx1.fill(self,"testAsArray",{},$globals.CollectionTest)});
  3141. //>>excludeEnd("ctx");
  3142. },
  3143. //>>excludeStart("ide", pragmas.excludeIdeData);
  3144. args: [],
  3145. source: "testAsArray\x0a\x09self\x0a\x09\x09assertSameContents: self collection\x0a\x09\x09as: self collection asArray",
  3146. referencedClasses: [],
  3147. //>>excludeEnd("ide");
  3148. messageSends: ["assertSameContents:as:", "collection", "asArray"]
  3149. }),
  3150. $globals.CollectionTest);
  3151. $core.addMethod(
  3152. $core.method({
  3153. selector: "testAsOrderedCollection",
  3154. protocol: 'tests',
  3155. fn: function (){
  3156. var self=this;
  3157. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3158. return $core.withContext(function($ctx1) {
  3159. //>>excludeEnd("ctx");
  3160. var $1;
  3161. $1=self._collection();
  3162. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3163. $ctx1.sendIdx["collection"]=1;
  3164. //>>excludeEnd("ctx");
  3165. self._assertSameContents_as_($1,$recv(self._collection())._asOrderedCollection());
  3166. return self;
  3167. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3168. }, function($ctx1) {$ctx1.fill(self,"testAsOrderedCollection",{},$globals.CollectionTest)});
  3169. //>>excludeEnd("ctx");
  3170. },
  3171. //>>excludeStart("ide", pragmas.excludeIdeData);
  3172. args: [],
  3173. source: "testAsOrderedCollection\x0a\x09self\x0a\x09\x09assertSameContents: self collection\x0a\x09\x09as: self collection asOrderedCollection",
  3174. referencedClasses: [],
  3175. //>>excludeEnd("ide");
  3176. messageSends: ["assertSameContents:as:", "collection", "asOrderedCollection"]
  3177. }),
  3178. $globals.CollectionTest);
  3179. $core.addMethod(
  3180. $core.method({
  3181. selector: "testAsSet",
  3182. protocol: 'tests',
  3183. fn: function (){
  3184. var self=this;
  3185. var c,set;
  3186. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3187. return $core.withContext(function($ctx1) {
  3188. //>>excludeEnd("ctx");
  3189. c=self._collectionWithDuplicates();
  3190. set=$recv(c)._asSet();
  3191. self._assert_equals_($recv(set)._size(),(6));
  3192. $recv(c)._do_((function(each){
  3193. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3194. return $core.withContext(function($ctx2) {
  3195. //>>excludeEnd("ctx");
  3196. return self._assert_($recv(set)._includes_(each));
  3197. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3198. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  3199. //>>excludeEnd("ctx");
  3200. }));
  3201. return self;
  3202. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3203. }, function($ctx1) {$ctx1.fill(self,"testAsSet",{c:c,set:set},$globals.CollectionTest)});
  3204. //>>excludeEnd("ctx");
  3205. },
  3206. //>>excludeStart("ide", pragmas.excludeIdeData);
  3207. args: [],
  3208. 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) ]",
  3209. referencedClasses: [],
  3210. //>>excludeEnd("ide");
  3211. messageSends: ["collectionWithDuplicates", "asSet", "assert:equals:", "size", "do:", "assert:", "includes:"]
  3212. }),
  3213. $globals.CollectionTest);
  3214. $core.addMethod(
  3215. $core.method({
  3216. selector: "testCollect",
  3217. protocol: 'tests',
  3218. fn: function (){
  3219. var self=this;
  3220. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3221. return $core.withContext(function($ctx1) {
  3222. //>>excludeEnd("ctx");
  3223. var $2,$1,$3,$5,$4,$8,$7,$6,$11,$10,$9;
  3224. $2=self._collection();
  3225. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3226. $ctx1.sendIdx["collection"]=1;
  3227. //>>excludeEnd("ctx");
  3228. $1=$recv($2)._collect_((function(each){
  3229. return each;
  3230. }));
  3231. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3232. $ctx1.sendIdx["collect:"]=1;
  3233. //>>excludeEnd("ctx");
  3234. $3=self._collection();
  3235. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3236. $ctx1.sendIdx["collection"]=2;
  3237. //>>excludeEnd("ctx");
  3238. self._assert_equals_($1,$3);
  3239. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3240. $ctx1.sendIdx["assert:equals:"]=1;
  3241. //>>excludeEnd("ctx");
  3242. $5=self._collectionWithNewValue();
  3243. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3244. $ctx1.sendIdx["collectionWithNewValue"]=1;
  3245. //>>excludeEnd("ctx");
  3246. $4=$recv($5)._collect_((function(each){
  3247. return each;
  3248. }));
  3249. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3250. $ctx1.sendIdx["collect:"]=2;
  3251. //>>excludeEnd("ctx");
  3252. self._assert_equals_($4,self._collectionWithNewValue());
  3253. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3254. $ctx1.sendIdx["assert:equals:"]=2;
  3255. //>>excludeEnd("ctx");
  3256. $8=self._collectionClass();
  3257. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3258. $ctx1.sendIdx["collectionClass"]=1;
  3259. //>>excludeEnd("ctx");
  3260. $7=$recv($8)._new();
  3261. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3262. $ctx1.sendIdx["new"]=1;
  3263. //>>excludeEnd("ctx");
  3264. $6=$recv($7)._collect_((function(each){
  3265. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3266. return $core.withContext(function($ctx2) {
  3267. //>>excludeEnd("ctx");
  3268. return $recv(each)._printString();
  3269. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3270. $ctx2.sendIdx["printString"]=1;
  3271. //>>excludeEnd("ctx");
  3272. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3273. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,3)});
  3274. //>>excludeEnd("ctx");
  3275. }));
  3276. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3277. $ctx1.sendIdx["collect:"]=3;
  3278. //>>excludeEnd("ctx");
  3279. self._assert_equals_($6,$recv(self._collectionClass())._new());
  3280. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3281. $ctx1.sendIdx["assert:equals:"]=3;
  3282. //>>excludeEnd("ctx");
  3283. $11=self._collection();
  3284. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3285. $ctx1.sendIdx["collection"]=3;
  3286. //>>excludeEnd("ctx");
  3287. $10=$recv($11)._collect_((function(){
  3288. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3289. return $core.withContext(function($ctx2) {
  3290. //>>excludeEnd("ctx");
  3291. return self._sampleNewValue();
  3292. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3293. $ctx2.sendIdx["sampleNewValue"]=1;
  3294. //>>excludeEnd("ctx");
  3295. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3296. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,4)});
  3297. //>>excludeEnd("ctx");
  3298. }));
  3299. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3300. $ctx1.sendIdx["collect:"]=4;
  3301. //>>excludeEnd("ctx");
  3302. $9=$recv($10)._detect_((function(){
  3303. return true;
  3304. }));
  3305. self._assert_equals_($9,self._sampleNewValue());
  3306. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3307. $ctx1.sendIdx["assert:equals:"]=4;
  3308. //>>excludeEnd("ctx");
  3309. self._assert_equals_($recv(self._collection())._collect_((function(each){
  3310. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3311. return $core.withContext(function($ctx2) {
  3312. //>>excludeEnd("ctx");
  3313. return $recv(each)._printString();
  3314. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3315. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,6)});
  3316. //>>excludeEnd("ctx");
  3317. })),self._collectionOfPrintStrings());
  3318. return self;
  3319. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3320. }, function($ctx1) {$ctx1.fill(self,"testCollect",{},$globals.CollectionTest)});
  3321. //>>excludeEnd("ctx");
  3322. },
  3323. //>>excludeStart("ide", pragmas.excludeIdeData);
  3324. args: [],
  3325. 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",
  3326. referencedClasses: [],
  3327. //>>excludeEnd("ide");
  3328. messageSends: ["assert:equals:", "collect:", "collection", "collectionWithNewValue", "new", "collectionClass", "printString", "detect:", "sampleNewValue", "collectionOfPrintStrings"]
  3329. }),
  3330. $globals.CollectionTest);
  3331. $core.addMethod(
  3332. $core.method({
  3333. selector: "testComma",
  3334. protocol: 'tests',
  3335. fn: function (){
  3336. var self=this;
  3337. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3338. return $core.withContext(function($ctx1) {
  3339. //>>excludeEnd("ctx");
  3340. var $2,$4,$3,$1,$5,$8,$7,$9,$6,$10,$13,$12,$15,$14,$11,$17,$18,$16,$19;
  3341. $2=self._collection();
  3342. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3343. $ctx1.sendIdx["collection"]=1;
  3344. //>>excludeEnd("ctx");
  3345. $4=self._collectionClass();
  3346. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3347. $ctx1.sendIdx["collectionClass"]=1;
  3348. //>>excludeEnd("ctx");
  3349. $3=$recv($4)._new();
  3350. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3351. $ctx1.sendIdx["new"]=1;
  3352. //>>excludeEnd("ctx");
  3353. $1=$recv($2).__comma($3);
  3354. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3355. $ctx1.sendIdx[","]=1;
  3356. //>>excludeEnd("ctx");
  3357. $5=self._collection();
  3358. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3359. $ctx1.sendIdx["collection"]=2;
  3360. //>>excludeEnd("ctx");
  3361. self._assert_equals_($1,$5);
  3362. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3363. $ctx1.sendIdx["assert:equals:"]=1;
  3364. //>>excludeEnd("ctx");
  3365. $8=self._collectionClass();
  3366. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3367. $ctx1.sendIdx["collectionClass"]=2;
  3368. //>>excludeEnd("ctx");
  3369. $7=$recv($8)._new();
  3370. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3371. $ctx1.sendIdx["new"]=2;
  3372. //>>excludeEnd("ctx");
  3373. $9=self._collection();
  3374. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3375. $ctx1.sendIdx["collection"]=3;
  3376. //>>excludeEnd("ctx");
  3377. $6=$recv($7).__comma($9);
  3378. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3379. $ctx1.sendIdx[","]=2;
  3380. //>>excludeEnd("ctx");
  3381. $10=self._collection();
  3382. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3383. $ctx1.sendIdx["collection"]=4;
  3384. //>>excludeEnd("ctx");
  3385. self._assert_equals_($6,$10);
  3386. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3387. $ctx1.sendIdx["assert:equals:"]=2;
  3388. //>>excludeEnd("ctx");
  3389. $13=self._collectionClass();
  3390. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3391. $ctx1.sendIdx["collectionClass"]=3;
  3392. //>>excludeEnd("ctx");
  3393. $12=$recv($13)._new();
  3394. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3395. $ctx1.sendIdx["new"]=3;
  3396. //>>excludeEnd("ctx");
  3397. $15=self._collectionClass();
  3398. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3399. $ctx1.sendIdx["collectionClass"]=4;
  3400. //>>excludeEnd("ctx");
  3401. $14=$recv($15)._new();
  3402. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3403. $ctx1.sendIdx["new"]=4;
  3404. //>>excludeEnd("ctx");
  3405. $11=$recv($12).__comma($14);
  3406. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3407. $ctx1.sendIdx[","]=3;
  3408. //>>excludeEnd("ctx");
  3409. self._assert_equals_($11,$recv(self._collectionClass())._new());
  3410. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3411. $ctx1.sendIdx["assert:equals:"]=3;
  3412. //>>excludeEnd("ctx");
  3413. $17=self._collection();
  3414. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3415. $ctx1.sendIdx["collection"]=5;
  3416. //>>excludeEnd("ctx");
  3417. $18=self._sampleNewValueAsCollection();
  3418. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3419. $ctx1.sendIdx["sampleNewValueAsCollection"]=1;
  3420. //>>excludeEnd("ctx");
  3421. $16=$recv($17).__comma($18);
  3422. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3423. $ctx1.sendIdx[","]=4;
  3424. //>>excludeEnd("ctx");
  3425. $19=self._collectionWithNewValue();
  3426. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3427. $ctx1.sendIdx["collectionWithNewValue"]=1;
  3428. //>>excludeEnd("ctx");
  3429. self._assert_equals_($16,$19);
  3430. self._assertSameContents_as_($recv(self._sampleNewValueAsCollection()).__comma(self._collection()),self._collectionWithNewValue());
  3431. return self;
  3432. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3433. }, function($ctx1) {$ctx1.fill(self,"testComma",{},$globals.CollectionTest)});
  3434. //>>excludeEnd("ctx");
  3435. },
  3436. //>>excludeStart("ide", pragmas.excludeIdeData);
  3437. args: [],
  3438. 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",
  3439. referencedClasses: [],
  3440. //>>excludeEnd("ide");
  3441. messageSends: ["assert:equals:", ",", "collection", "new", "collectionClass", "sampleNewValueAsCollection", "collectionWithNewValue", "assertSameContents:as:"]
  3442. }),
  3443. $globals.CollectionTest);
  3444. $core.addMethod(
  3445. $core.method({
  3446. selector: "testCopy",
  3447. protocol: 'tests',
  3448. fn: function (){
  3449. var self=this;
  3450. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3451. return $core.withContext(function($ctx1) {
  3452. //>>excludeEnd("ctx");
  3453. var $3,$2,$1,$5,$4,$7,$6,$8,$10,$9,$11,$15,$14,$13,$16,$12,$19,$18,$17;
  3454. $3=self._collectionClass();
  3455. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3456. $ctx1.sendIdx["collectionClass"]=1;
  3457. //>>excludeEnd("ctx");
  3458. $2=$recv($3)._new();
  3459. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3460. $ctx1.sendIdx["new"]=1;
  3461. //>>excludeEnd("ctx");
  3462. $1=$recv($2)._copy();
  3463. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3464. $ctx1.sendIdx["copy"]=1;
  3465. //>>excludeEnd("ctx");
  3466. $5=self._collectionClass();
  3467. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3468. $ctx1.sendIdx["collectionClass"]=2;
  3469. //>>excludeEnd("ctx");
  3470. $4=$recv($5)._new();
  3471. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3472. $ctx1.sendIdx["new"]=2;
  3473. //>>excludeEnd("ctx");
  3474. self._assert_equals_($1,$4);
  3475. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3476. $ctx1.sendIdx["assert:equals:"]=1;
  3477. //>>excludeEnd("ctx");
  3478. $7=self._collection();
  3479. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3480. $ctx1.sendIdx["collection"]=1;
  3481. //>>excludeEnd("ctx");
  3482. $6=$recv($7)._copy();
  3483. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3484. $ctx1.sendIdx["copy"]=2;
  3485. //>>excludeEnd("ctx");
  3486. $8=self._collection();
  3487. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3488. $ctx1.sendIdx["collection"]=2;
  3489. //>>excludeEnd("ctx");
  3490. self._assert_equals_($6,$8);
  3491. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3492. $ctx1.sendIdx["assert:equals:"]=2;
  3493. //>>excludeEnd("ctx");
  3494. $10=self._collectionWithNewValue();
  3495. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3496. $ctx1.sendIdx["collectionWithNewValue"]=1;
  3497. //>>excludeEnd("ctx");
  3498. $9=$recv($10)._copy();
  3499. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3500. $ctx1.sendIdx["copy"]=3;
  3501. //>>excludeEnd("ctx");
  3502. $11=self._collectionWithNewValue();
  3503. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3504. $ctx1.sendIdx["collectionWithNewValue"]=2;
  3505. //>>excludeEnd("ctx");
  3506. self._assert_equals_($9,$11);
  3507. $15=self._collectionClass();
  3508. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3509. $ctx1.sendIdx["collectionClass"]=3;
  3510. //>>excludeEnd("ctx");
  3511. $14=$recv($15)._new();
  3512. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3513. $ctx1.sendIdx["new"]=3;
  3514. //>>excludeEnd("ctx");
  3515. $13=$recv($14)._copy();
  3516. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3517. $ctx1.sendIdx["copy"]=4;
  3518. //>>excludeEnd("ctx");
  3519. $16=self._collection();
  3520. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3521. $ctx1.sendIdx["collection"]=3;
  3522. //>>excludeEnd("ctx");
  3523. $12=$recv($13).__eq($16);
  3524. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3525. $ctx1.sendIdx["="]=1;
  3526. //>>excludeEnd("ctx");
  3527. self._deny_($12);
  3528. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3529. $ctx1.sendIdx["deny:"]=1;
  3530. //>>excludeEnd("ctx");
  3531. $19=self._collection();
  3532. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3533. $ctx1.sendIdx["collection"]=4;
  3534. //>>excludeEnd("ctx");
  3535. $18=$recv($19)._copy();
  3536. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3537. $ctx1.sendIdx["copy"]=5;
  3538. //>>excludeEnd("ctx");
  3539. $17=$recv($18).__eq($recv(self._collectionClass())._new());
  3540. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3541. $ctx1.sendIdx["="]=2;
  3542. //>>excludeEnd("ctx");
  3543. self._deny_($17);
  3544. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3545. $ctx1.sendIdx["deny:"]=2;
  3546. //>>excludeEnd("ctx");
  3547. self._deny_($recv($recv(self._collection())._copy()).__eq(self._collectionWithNewValue()));
  3548. return self;
  3549. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3550. }, function($ctx1) {$ctx1.fill(self,"testCopy",{},$globals.CollectionTest)});
  3551. //>>excludeEnd("ctx");
  3552. },
  3553. //>>excludeStart("ide", pragmas.excludeIdeData);
  3554. args: [],
  3555. 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",
  3556. referencedClasses: [],
  3557. //>>excludeEnd("ide");
  3558. messageSends: ["assert:equals:", "copy", "new", "collectionClass", "collection", "collectionWithNewValue", "deny:", "="]
  3559. }),
  3560. $globals.CollectionTest);
  3561. $core.addMethod(
  3562. $core.method({
  3563. selector: "testCopySeparates",
  3564. protocol: 'tests',
  3565. fn: function (){
  3566. var self=this;
  3567. var original,copy;
  3568. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3569. return $core.withContext(function($ctx1) {
  3570. //>>excludeEnd("ctx");
  3571. original=self._collection();
  3572. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3573. $ctx1.sendIdx["collection"]=1;
  3574. //>>excludeEnd("ctx");
  3575. copy=$recv(original)._copy();
  3576. $recv(copy)._addAll_(self._sampleNewValueAsCollection());
  3577. self._assert_($recv(original).__eq(self._collection()));
  3578. return self;
  3579. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3580. }, function($ctx1) {$ctx1.fill(self,"testCopySeparates",{original:original,copy:copy},$globals.CollectionTest)});
  3581. //>>excludeEnd("ctx");
  3582. },
  3583. //>>excludeStart("ide", pragmas.excludeIdeData);
  3584. args: [],
  3585. 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",
  3586. referencedClasses: [],
  3587. //>>excludeEnd("ide");
  3588. messageSends: ["collection", "copy", "addAll:", "sampleNewValueAsCollection", "assert:", "="]
  3589. }),
  3590. $globals.CollectionTest);
  3591. $core.addMethod(
  3592. $core.method({
  3593. selector: "testDetect",
  3594. protocol: 'tests',
  3595. fn: function (){
  3596. var self=this;
  3597. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3598. return $core.withContext(function($ctx1) {
  3599. //>>excludeEnd("ctx");
  3600. var $1,$2,$3,$4,$6,$5,$7;
  3601. self._shouldnt_raise_((function(){
  3602. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3603. return $core.withContext(function($ctx2) {
  3604. //>>excludeEnd("ctx");
  3605. $1=self._collection();
  3606. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3607. $ctx2.sendIdx["collection"]=1;
  3608. //>>excludeEnd("ctx");
  3609. return $recv($1)._detect_((function(){
  3610. return true;
  3611. }));
  3612. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3613. $ctx2.sendIdx["detect:"]=1;
  3614. //>>excludeEnd("ctx");
  3615. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3616. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  3617. //>>excludeEnd("ctx");
  3618. }),$globals.Error);
  3619. self._should_raise_((function(){
  3620. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3621. return $core.withContext(function($ctx2) {
  3622. //>>excludeEnd("ctx");
  3623. $2=self._collection();
  3624. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3625. $ctx2.sendIdx["collection"]=2;
  3626. //>>excludeEnd("ctx");
  3627. return $recv($2)._detect_((function(){
  3628. return false;
  3629. }));
  3630. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3631. $ctx2.sendIdx["detect:"]=2;
  3632. //>>excludeEnd("ctx");
  3633. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3634. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  3635. //>>excludeEnd("ctx");
  3636. }),$globals.Error);
  3637. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3638. $ctx1.sendIdx["should:raise:"]=1;
  3639. //>>excludeEnd("ctx");
  3640. $3=$recv(self._sampleNewValueAsCollection())._detect_((function(){
  3641. return true;
  3642. }));
  3643. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3644. $ctx1.sendIdx["detect:"]=3;
  3645. //>>excludeEnd("ctx");
  3646. $4=self._sampleNewValue();
  3647. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3648. $ctx1.sendIdx["sampleNewValue"]=1;
  3649. //>>excludeEnd("ctx");
  3650. self._assert_equals_($3,$4);
  3651. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3652. $ctx1.sendIdx["assert:equals:"]=1;
  3653. //>>excludeEnd("ctx");
  3654. $5=$recv(self._collectionWithNewValue())._detect_((function(each){
  3655. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3656. return $core.withContext(function($ctx2) {
  3657. //>>excludeEnd("ctx");
  3658. $6=self._sampleNewValue();
  3659. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3660. $ctx2.sendIdx["sampleNewValue"]=2;
  3661. //>>excludeEnd("ctx");
  3662. return $recv(each).__eq($6);
  3663. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3664. $ctx2.sendIdx["="]=1;
  3665. //>>excludeEnd("ctx");
  3666. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3667. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,6)});
  3668. //>>excludeEnd("ctx");
  3669. }));
  3670. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3671. $ctx1.sendIdx["detect:"]=4;
  3672. //>>excludeEnd("ctx");
  3673. $7=self._sampleNewValue();
  3674. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3675. $ctx1.sendIdx["sampleNewValue"]=3;
  3676. //>>excludeEnd("ctx");
  3677. self._assert_equals_($5,$7);
  3678. self._should_raise_((function(){
  3679. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3680. return $core.withContext(function($ctx2) {
  3681. //>>excludeEnd("ctx");
  3682. return $recv(self._collection())._detect_((function(each){
  3683. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3684. return $core.withContext(function($ctx3) {
  3685. //>>excludeEnd("ctx");
  3686. return $recv(each).__eq(self._sampleNewValue());
  3687. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3688. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,8)});
  3689. //>>excludeEnd("ctx");
  3690. }));
  3691. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3692. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,7)});
  3693. //>>excludeEnd("ctx");
  3694. }),$globals.Error);
  3695. return self;
  3696. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3697. }, function($ctx1) {$ctx1.fill(self,"testDetect",{},$globals.CollectionTest)});
  3698. //>>excludeEnd("ctx");
  3699. },
  3700. //>>excludeStart("ide", pragmas.excludeIdeData);
  3701. args: [],
  3702. 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",
  3703. referencedClasses: ["Error"],
  3704. //>>excludeEnd("ide");
  3705. messageSends: ["shouldnt:raise:", "detect:", "collection", "should:raise:", "assert:equals:", "sampleNewValueAsCollection", "sampleNewValue", "collectionWithNewValue", "="]
  3706. }),
  3707. $globals.CollectionTest);
  3708. $core.addMethod(
  3709. $core.method({
  3710. selector: "testDetectIfNone",
  3711. protocol: 'tests',
  3712. fn: function (){
  3713. var self=this;
  3714. var sentinel;
  3715. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3716. return $core.withContext(function($ctx1) {
  3717. //>>excludeEnd("ctx");
  3718. var $3,$2,$1,$5,$4,$6,$7,$9,$8,$10;
  3719. sentinel=$recv($globals.Object)._new();
  3720. $3=self._collection();
  3721. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3722. $ctx1.sendIdx["collection"]=1;
  3723. //>>excludeEnd("ctx");
  3724. $2=$recv($3)._detect_ifNone_((function(){
  3725. return true;
  3726. }),(function(){
  3727. return sentinel;
  3728. }));
  3729. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3730. $ctx1.sendIdx["detect:ifNone:"]=1;
  3731. //>>excludeEnd("ctx");
  3732. $1=$recv($2).__tild_eq(sentinel);
  3733. self._assert_($1);
  3734. $5=self._collection();
  3735. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3736. $ctx1.sendIdx["collection"]=2;
  3737. //>>excludeEnd("ctx");
  3738. $4=$recv($5)._detect_ifNone_((function(){
  3739. return false;
  3740. }),(function(){
  3741. return sentinel;
  3742. }));
  3743. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3744. $ctx1.sendIdx["detect:ifNone:"]=2;
  3745. //>>excludeEnd("ctx");
  3746. self._assert_equals_($4,sentinel);
  3747. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3748. $ctx1.sendIdx["assert:equals:"]=1;
  3749. //>>excludeEnd("ctx");
  3750. $6=$recv(self._sampleNewValueAsCollection())._detect_ifNone_((function(){
  3751. return true;
  3752. }),(function(){
  3753. return sentinel;
  3754. }));
  3755. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3756. $ctx1.sendIdx["detect:ifNone:"]=3;
  3757. //>>excludeEnd("ctx");
  3758. $7=self._sampleNewValue();
  3759. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3760. $ctx1.sendIdx["sampleNewValue"]=1;
  3761. //>>excludeEnd("ctx");
  3762. self._assert_equals_($6,$7);
  3763. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3764. $ctx1.sendIdx["assert:equals:"]=2;
  3765. //>>excludeEnd("ctx");
  3766. $8=$recv(self._collectionWithNewValue())._detect_ifNone_((function(each){
  3767. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3768. return $core.withContext(function($ctx2) {
  3769. //>>excludeEnd("ctx");
  3770. $9=self._sampleNewValue();
  3771. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3772. $ctx2.sendIdx["sampleNewValue"]=2;
  3773. //>>excludeEnd("ctx");
  3774. return $recv(each).__eq($9);
  3775. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3776. $ctx2.sendIdx["="]=1;
  3777. //>>excludeEnd("ctx");
  3778. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3779. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,7)});
  3780. //>>excludeEnd("ctx");
  3781. }),(function(){
  3782. return sentinel;
  3783. }));
  3784. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3785. $ctx1.sendIdx["detect:ifNone:"]=4;
  3786. //>>excludeEnd("ctx");
  3787. $10=self._sampleNewValue();
  3788. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3789. $ctx1.sendIdx["sampleNewValue"]=3;
  3790. //>>excludeEnd("ctx");
  3791. self._assert_equals_($8,$10);
  3792. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3793. $ctx1.sendIdx["assert:equals:"]=3;
  3794. //>>excludeEnd("ctx");
  3795. self._assert_equals_($recv(self._collection())._detect_ifNone_((function(each){
  3796. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3797. return $core.withContext(function($ctx2) {
  3798. //>>excludeEnd("ctx");
  3799. return $recv(each).__eq(self._sampleNewValue());
  3800. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3801. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,9)});
  3802. //>>excludeEnd("ctx");
  3803. }),(function(){
  3804. return sentinel;
  3805. })),sentinel);
  3806. return self;
  3807. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3808. }, function($ctx1) {$ctx1.fill(self,"testDetectIfNone",{sentinel:sentinel},$globals.CollectionTest)});
  3809. //>>excludeEnd("ctx");
  3810. },
  3811. //>>excludeStart("ide", pragmas.excludeIdeData);
  3812. args: [],
  3813. 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",
  3814. referencedClasses: ["Object"],
  3815. //>>excludeEnd("ide");
  3816. messageSends: ["new", "assert:", "~=", "detect:ifNone:", "collection", "assert:equals:", "sampleNewValueAsCollection", "sampleNewValue", "collectionWithNewValue", "="]
  3817. }),
  3818. $globals.CollectionTest);
  3819. $core.addMethod(
  3820. $core.method({
  3821. selector: "testDo",
  3822. protocol: 'tests',
  3823. fn: function (){
  3824. var self=this;
  3825. var newCollection;
  3826. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3827. return $core.withContext(function($ctx1) {
  3828. //>>excludeEnd("ctx");
  3829. var $1,$2;
  3830. newCollection=$recv($globals.OrderedCollection)._new();
  3831. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3832. $ctx1.sendIdx["new"]=1;
  3833. //>>excludeEnd("ctx");
  3834. $1=self._collection();
  3835. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3836. $ctx1.sendIdx["collection"]=1;
  3837. //>>excludeEnd("ctx");
  3838. $recv($1)._do_((function(each){
  3839. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3840. return $core.withContext(function($ctx2) {
  3841. //>>excludeEnd("ctx");
  3842. return $recv(newCollection)._add_(each);
  3843. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3844. $ctx2.sendIdx["add:"]=1;
  3845. //>>excludeEnd("ctx");
  3846. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3847. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  3848. //>>excludeEnd("ctx");
  3849. }));
  3850. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3851. $ctx1.sendIdx["do:"]=1;
  3852. //>>excludeEnd("ctx");
  3853. self._assertSameContents_as_(self._collection(),newCollection);
  3854. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3855. $ctx1.sendIdx["assertSameContents:as:"]=1;
  3856. //>>excludeEnd("ctx");
  3857. newCollection=$recv($globals.OrderedCollection)._new();
  3858. $2=self._collectionWithDuplicates();
  3859. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3860. $ctx1.sendIdx["collectionWithDuplicates"]=1;
  3861. //>>excludeEnd("ctx");
  3862. $recv($2)._do_((function(each){
  3863. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3864. return $core.withContext(function($ctx2) {
  3865. //>>excludeEnd("ctx");
  3866. return $recv(newCollection)._add_(each);
  3867. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3868. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
  3869. //>>excludeEnd("ctx");
  3870. }));
  3871. self._assertSameContents_as_(self._collectionWithDuplicates(),newCollection);
  3872. return self;
  3873. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3874. }, function($ctx1) {$ctx1.fill(self,"testDo",{newCollection:newCollection},$globals.CollectionTest)});
  3875. //>>excludeEnd("ctx");
  3876. },
  3877. //>>excludeStart("ide", pragmas.excludeIdeData);
  3878. args: [],
  3879. 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",
  3880. referencedClasses: ["OrderedCollection"],
  3881. //>>excludeEnd("ide");
  3882. messageSends: ["new", "do:", "collection", "add:", "assertSameContents:as:", "collectionWithDuplicates"]
  3883. }),
  3884. $globals.CollectionTest);
  3885. $core.addMethod(
  3886. $core.method({
  3887. selector: "testEquality",
  3888. protocol: 'tests',
  3889. fn: function (){
  3890. var self=this;
  3891. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3892. return $core.withContext(function($ctx1) {
  3893. //>>excludeEnd("ctx");
  3894. var $2,$1,$4,$3,$5,$6,$7,$8,$11,$10,$12,$9,$14,$13;
  3895. $2=self._collectionClass();
  3896. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3897. $ctx1.sendIdx["collectionClass"]=1;
  3898. //>>excludeEnd("ctx");
  3899. $1=$recv($2)._new();
  3900. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3901. $ctx1.sendIdx["new"]=1;
  3902. //>>excludeEnd("ctx");
  3903. $4=self._collectionClass();
  3904. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3905. $ctx1.sendIdx["collectionClass"]=2;
  3906. //>>excludeEnd("ctx");
  3907. $3=$recv($4)._new();
  3908. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3909. $ctx1.sendIdx["new"]=2;
  3910. //>>excludeEnd("ctx");
  3911. self._assert_equals_($1,$3);
  3912. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3913. $ctx1.sendIdx["assert:equals:"]=1;
  3914. //>>excludeEnd("ctx");
  3915. $5=self._collection();
  3916. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3917. $ctx1.sendIdx["collection"]=1;
  3918. //>>excludeEnd("ctx");
  3919. $6=self._collection();
  3920. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3921. $ctx1.sendIdx["collection"]=2;
  3922. //>>excludeEnd("ctx");
  3923. self._assert_equals_($5,$6);
  3924. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3925. $ctx1.sendIdx["assert:equals:"]=2;
  3926. //>>excludeEnd("ctx");
  3927. $7=self._collectionWithNewValue();
  3928. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3929. $ctx1.sendIdx["collectionWithNewValue"]=1;
  3930. //>>excludeEnd("ctx");
  3931. $8=self._collectionWithNewValue();
  3932. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3933. $ctx1.sendIdx["collectionWithNewValue"]=2;
  3934. //>>excludeEnd("ctx");
  3935. self._assert_equals_($7,$8);
  3936. $11=self._collectionClass();
  3937. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3938. $ctx1.sendIdx["collectionClass"]=3;
  3939. //>>excludeEnd("ctx");
  3940. $10=$recv($11)._new();
  3941. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3942. $ctx1.sendIdx["new"]=3;
  3943. //>>excludeEnd("ctx");
  3944. $12=self._collection();
  3945. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3946. $ctx1.sendIdx["collection"]=3;
  3947. //>>excludeEnd("ctx");
  3948. $9=$recv($10).__eq($12);
  3949. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3950. $ctx1.sendIdx["="]=1;
  3951. //>>excludeEnd("ctx");
  3952. self._deny_($9);
  3953. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3954. $ctx1.sendIdx["deny:"]=1;
  3955. //>>excludeEnd("ctx");
  3956. $14=self._collection();
  3957. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3958. $ctx1.sendIdx["collection"]=4;
  3959. //>>excludeEnd("ctx");
  3960. $13=$recv($14).__eq($recv(self._collectionClass())._new());
  3961. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3962. $ctx1.sendIdx["="]=2;
  3963. //>>excludeEnd("ctx");
  3964. self._deny_($13);
  3965. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3966. $ctx1.sendIdx["deny:"]=2;
  3967. //>>excludeEnd("ctx");
  3968. self._deny_($recv(self._collection()).__eq(self._collectionWithNewValue()));
  3969. return self;
  3970. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3971. }, function($ctx1) {$ctx1.fill(self,"testEquality",{},$globals.CollectionTest)});
  3972. //>>excludeEnd("ctx");
  3973. },
  3974. //>>excludeStart("ide", pragmas.excludeIdeData);
  3975. args: [],
  3976. 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",
  3977. referencedClasses: [],
  3978. //>>excludeEnd("ide");
  3979. messageSends: ["assert:equals:", "new", "collectionClass", "collection", "collectionWithNewValue", "deny:", "="]
  3980. }),
  3981. $globals.CollectionTest);
  3982. $core.addMethod(
  3983. $core.method({
  3984. selector: "testIfEmptyFamily",
  3985. protocol: 'tests',
  3986. fn: function (){
  3987. var self=this;
  3988. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3989. return $core.withContext(function($ctx1) {
  3990. //>>excludeEnd("ctx");
  3991. 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;
  3992. $3=self._collectionClass();
  3993. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3994. $ctx1.sendIdx["collectionClass"]=1;
  3995. //>>excludeEnd("ctx");
  3996. $2=$recv($3)._new();
  3997. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3998. $ctx1.sendIdx["new"]=1;
  3999. //>>excludeEnd("ctx");
  4000. $1=$recv($2)._ifEmpty_((function(){
  4001. return (42);
  4002. }));
  4003. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4004. $ctx1.sendIdx["ifEmpty:"]=1;
  4005. //>>excludeEnd("ctx");
  4006. self._assert_equals_($1,(42));
  4007. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4008. $ctx1.sendIdx["assert:equals:"]=1;
  4009. //>>excludeEnd("ctx");
  4010. $5=self._collection();
  4011. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4012. $ctx1.sendIdx["collection"]=1;
  4013. //>>excludeEnd("ctx");
  4014. $4=$recv($5)._ifEmpty_((function(){
  4015. return (42);
  4016. }));
  4017. $6=self._collection();
  4018. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4019. $ctx1.sendIdx["collection"]=2;
  4020. //>>excludeEnd("ctx");
  4021. self._assert_equals_($4,$6);
  4022. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4023. $ctx1.sendIdx["assert:equals:"]=2;
  4024. //>>excludeEnd("ctx");
  4025. $9=self._collectionClass();
  4026. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4027. $ctx1.sendIdx["collectionClass"]=2;
  4028. //>>excludeEnd("ctx");
  4029. $8=$recv($9)._new();
  4030. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4031. $ctx1.sendIdx["new"]=2;
  4032. //>>excludeEnd("ctx");
  4033. $7=$recv($8)._ifNotEmpty_((function(){
  4034. return (42);
  4035. }));
  4036. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4037. $ctx1.sendIdx["ifNotEmpty:"]=1;
  4038. //>>excludeEnd("ctx");
  4039. $11=self._collectionClass();
  4040. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4041. $ctx1.sendIdx["collectionClass"]=3;
  4042. //>>excludeEnd("ctx");
  4043. $10=$recv($11)._new();
  4044. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4045. $ctx1.sendIdx["new"]=3;
  4046. //>>excludeEnd("ctx");
  4047. self._assert_equals_($7,$10);
  4048. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4049. $ctx1.sendIdx["assert:equals:"]=3;
  4050. //>>excludeEnd("ctx");
  4051. $13=self._collection();
  4052. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4053. $ctx1.sendIdx["collection"]=3;
  4054. //>>excludeEnd("ctx");
  4055. $12=$recv($13)._ifNotEmpty_((function(){
  4056. return (42);
  4057. }));
  4058. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4059. $ctx1.sendIdx["ifNotEmpty:"]=2;
  4060. //>>excludeEnd("ctx");
  4061. self._assert_equals_($12,(42));
  4062. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4063. $ctx1.sendIdx["assert:equals:"]=4;
  4064. //>>excludeEnd("ctx");
  4065. $15=self._collection();
  4066. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4067. $ctx1.sendIdx["collection"]=4;
  4068. //>>excludeEnd("ctx");
  4069. $14=$recv($15)._ifNotEmpty_((function(col){
  4070. return col;
  4071. }));
  4072. $16=self._collection();
  4073. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4074. $ctx1.sendIdx["collection"]=5;
  4075. //>>excludeEnd("ctx");
  4076. self._assert_equals_($14,$16);
  4077. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4078. $ctx1.sendIdx["assert:equals:"]=5;
  4079. //>>excludeEnd("ctx");
  4080. $19=self._collectionClass();
  4081. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4082. $ctx1.sendIdx["collectionClass"]=4;
  4083. //>>excludeEnd("ctx");
  4084. $18=$recv($19)._new();
  4085. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4086. $ctx1.sendIdx["new"]=4;
  4087. //>>excludeEnd("ctx");
  4088. $17=$recv($18)._ifEmpty_ifNotEmpty_((function(){
  4089. return (42);
  4090. }),(function(){
  4091. return (999);
  4092. }));
  4093. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4094. $ctx1.sendIdx["ifEmpty:ifNotEmpty:"]=1;
  4095. //>>excludeEnd("ctx");
  4096. self._assert_equals_($17,(42));
  4097. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4098. $ctx1.sendIdx["assert:equals:"]=6;
  4099. //>>excludeEnd("ctx");
  4100. $21=self._collection();
  4101. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4102. $ctx1.sendIdx["collection"]=6;
  4103. //>>excludeEnd("ctx");
  4104. $20=$recv($21)._ifEmpty_ifNotEmpty_((function(){
  4105. return (42);
  4106. }),(function(){
  4107. return (999);
  4108. }));
  4109. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4110. $ctx1.sendIdx["ifEmpty:ifNotEmpty:"]=2;
  4111. //>>excludeEnd("ctx");
  4112. self._assert_equals_($20,(999));
  4113. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4114. $ctx1.sendIdx["assert:equals:"]=7;
  4115. //>>excludeEnd("ctx");
  4116. $23=self._collection();
  4117. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4118. $ctx1.sendIdx["collection"]=7;
  4119. //>>excludeEnd("ctx");
  4120. $22=$recv($23)._ifEmpty_ifNotEmpty_((function(){
  4121. return (42);
  4122. }),(function(col){
  4123. return col;
  4124. }));
  4125. $24=self._collection();
  4126. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4127. $ctx1.sendIdx["collection"]=8;
  4128. //>>excludeEnd("ctx");
  4129. self._assert_equals_($22,$24);
  4130. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4131. $ctx1.sendIdx["assert:equals:"]=8;
  4132. //>>excludeEnd("ctx");
  4133. $25=$recv($recv(self._collectionClass())._new())._ifNotEmpty_ifEmpty_((function(){
  4134. return (42);
  4135. }),(function(){
  4136. return (999);
  4137. }));
  4138. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4139. $ctx1.sendIdx["ifNotEmpty:ifEmpty:"]=1;
  4140. //>>excludeEnd("ctx");
  4141. self._assert_equals_($25,(999));
  4142. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4143. $ctx1.sendIdx["assert:equals:"]=9;
  4144. //>>excludeEnd("ctx");
  4145. $27=self._collection();
  4146. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4147. $ctx1.sendIdx["collection"]=9;
  4148. //>>excludeEnd("ctx");
  4149. $26=$recv($27)._ifNotEmpty_ifEmpty_((function(){
  4150. return (42);
  4151. }),(function(){
  4152. return (999);
  4153. }));
  4154. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4155. $ctx1.sendIdx["ifNotEmpty:ifEmpty:"]=2;
  4156. //>>excludeEnd("ctx");
  4157. self._assert_equals_($26,(42));
  4158. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4159. $ctx1.sendIdx["assert:equals:"]=10;
  4160. //>>excludeEnd("ctx");
  4161. $29=self._collection();
  4162. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4163. $ctx1.sendIdx["collection"]=10;
  4164. //>>excludeEnd("ctx");
  4165. $28=$recv($29)._ifNotEmpty_ifEmpty_((function(col){
  4166. return col;
  4167. }),(function(){
  4168. return (999);
  4169. }));
  4170. self._assert_equals_($28,self._collection());
  4171. return self;
  4172. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4173. }, function($ctx1) {$ctx1.fill(self,"testIfEmptyFamily",{},$globals.CollectionTest)});
  4174. //>>excludeEnd("ctx");
  4175. },
  4176. //>>excludeStart("ide", pragmas.excludeIdeData);
  4177. args: [],
  4178. 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.",
  4179. referencedClasses: [],
  4180. //>>excludeEnd("ide");
  4181. messageSends: ["assert:equals:", "ifEmpty:", "new", "collectionClass", "collection", "ifNotEmpty:", "ifEmpty:ifNotEmpty:", "ifNotEmpty:ifEmpty:"]
  4182. }),
  4183. $globals.CollectionTest);
  4184. $core.addMethod(
  4185. $core.method({
  4186. selector: "testIsEmpty",
  4187. protocol: 'tests',
  4188. fn: function (){
  4189. var self=this;
  4190. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4191. return $core.withContext(function($ctx1) {
  4192. //>>excludeEnd("ctx");
  4193. var $1;
  4194. $1=$recv($recv(self._collectionClass())._new())._isEmpty();
  4195. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4196. $ctx1.sendIdx["isEmpty"]=1;
  4197. //>>excludeEnd("ctx");
  4198. self._assert_($1);
  4199. self._deny_($recv(self._collection())._isEmpty());
  4200. return self;
  4201. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4202. }, function($ctx1) {$ctx1.fill(self,"testIsEmpty",{},$globals.CollectionTest)});
  4203. //>>excludeEnd("ctx");
  4204. },
  4205. //>>excludeStart("ide", pragmas.excludeIdeData);
  4206. args: [],
  4207. source: "testIsEmpty\x0a\x09self assert: self collectionClass new isEmpty.\x0a\x09self deny: self collection isEmpty",
  4208. referencedClasses: [],
  4209. //>>excludeEnd("ide");
  4210. messageSends: ["assert:", "isEmpty", "new", "collectionClass", "deny:", "collection"]
  4211. }),
  4212. $globals.CollectionTest);
  4213. $core.addMethod(
  4214. $core.method({
  4215. selector: "testNoneSatisfy",
  4216. protocol: 'tests',
  4217. fn: function (){
  4218. var self=this;
  4219. var anyOne;
  4220. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4221. return $core.withContext(function($ctx1) {
  4222. //>>excludeEnd("ctx");
  4223. var $1,$3,$2;
  4224. $1=self._collection();
  4225. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4226. $ctx1.sendIdx["collection"]=1;
  4227. //>>excludeEnd("ctx");
  4228. anyOne=$recv($1)._anyOne();
  4229. $3=self._collection();
  4230. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4231. $ctx1.sendIdx["collection"]=2;
  4232. //>>excludeEnd("ctx");
  4233. $2=$recv($3)._noneSatisfy_((function(each){
  4234. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4235. return $core.withContext(function($ctx2) {
  4236. //>>excludeEnd("ctx");
  4237. return $recv(each).__eq(anyOne);
  4238. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4239. $ctx2.sendIdx["="]=1;
  4240. //>>excludeEnd("ctx");
  4241. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4242. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  4243. //>>excludeEnd("ctx");
  4244. }));
  4245. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4246. $ctx1.sendIdx["noneSatisfy:"]=1;
  4247. //>>excludeEnd("ctx");
  4248. self._deny_($2);
  4249. self._assert_($recv(self._collection())._noneSatisfy_((function(each){
  4250. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4251. return $core.withContext(function($ctx2) {
  4252. //>>excludeEnd("ctx");
  4253. return $recv(each).__eq($recv($globals.Object)._new());
  4254. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4255. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
  4256. //>>excludeEnd("ctx");
  4257. })));
  4258. return self;
  4259. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4260. }, function($ctx1) {$ctx1.fill(self,"testNoneSatisfy",{anyOne:anyOne},$globals.CollectionTest)});
  4261. //>>excludeEnd("ctx");
  4262. },
  4263. //>>excludeStart("ide", pragmas.excludeIdeData);
  4264. args: [],
  4265. 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 ])",
  4266. referencedClasses: ["Object"],
  4267. //>>excludeEnd("ide");
  4268. messageSends: ["anyOne", "collection", "deny:", "noneSatisfy:", "=", "assert:", "new"]
  4269. }),
  4270. $globals.CollectionTest);
  4271. $core.addMethod(
  4272. $core.method({
  4273. selector: "testRemoveAll",
  4274. protocol: 'tests',
  4275. fn: function (){
  4276. var self=this;
  4277. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4278. return $core.withContext(function($ctx1) {
  4279. //>>excludeEnd("ctx");
  4280. var $2,$1;
  4281. $2=self._collection();
  4282. $recv($2)._removeAll();
  4283. $1=$recv($2)._yourself();
  4284. self._assert_equals_($1,$recv(self._collectionClass())._new());
  4285. return self;
  4286. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4287. }, function($ctx1) {$ctx1.fill(self,"testRemoveAll",{},$globals.CollectionTest)});
  4288. //>>excludeEnd("ctx");
  4289. },
  4290. //>>excludeStart("ide", pragmas.excludeIdeData);
  4291. args: [],
  4292. source: "testRemoveAll\x0a\x09self assert: (self collection removeAll; yourself) equals: self collectionClass new",
  4293. referencedClasses: [],
  4294. //>>excludeEnd("ide");
  4295. messageSends: ["assert:equals:", "removeAll", "collection", "yourself", "new", "collectionClass"]
  4296. }),
  4297. $globals.CollectionTest);
  4298. $core.addMethod(
  4299. $core.method({
  4300. selector: "testSelect",
  4301. protocol: 'tests',
  4302. fn: function (){
  4303. var self=this;
  4304. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4305. return $core.withContext(function($ctx1) {
  4306. //>>excludeEnd("ctx");
  4307. var $2,$1,$4,$3,$6,$5,$7,$9,$10,$8,$12,$13,$11,$14,$16,$17,$15;
  4308. $2=self._collection();
  4309. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4310. $ctx1.sendIdx["collection"]=1;
  4311. //>>excludeEnd("ctx");
  4312. $1=$recv($2)._select_((function(){
  4313. return false;
  4314. }));
  4315. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4316. $ctx1.sendIdx["select:"]=1;
  4317. //>>excludeEnd("ctx");
  4318. $4=self._collectionClass();
  4319. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4320. $ctx1.sendIdx["collectionClass"]=1;
  4321. //>>excludeEnd("ctx");
  4322. $3=$recv($4)._new();
  4323. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4324. $ctx1.sendIdx["new"]=1;
  4325. //>>excludeEnd("ctx");
  4326. self._assert_equals_($1,$3);
  4327. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4328. $ctx1.sendIdx["assert:equals:"]=1;
  4329. //>>excludeEnd("ctx");
  4330. $6=self._collection();
  4331. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4332. $ctx1.sendIdx["collection"]=2;
  4333. //>>excludeEnd("ctx");
  4334. $5=$recv($6)._select_((function(){
  4335. return true;
  4336. }));
  4337. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4338. $ctx1.sendIdx["select:"]=2;
  4339. //>>excludeEnd("ctx");
  4340. $7=self._collection();
  4341. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4342. $ctx1.sendIdx["collection"]=3;
  4343. //>>excludeEnd("ctx");
  4344. self._assert_equals_($5,$7);
  4345. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4346. $ctx1.sendIdx["assert:equals:"]=2;
  4347. //>>excludeEnd("ctx");
  4348. $9=self._collectionWithNewValue();
  4349. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4350. $ctx1.sendIdx["collectionWithNewValue"]=1;
  4351. //>>excludeEnd("ctx");
  4352. $8=$recv($9)._select_((function(each){
  4353. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4354. return $core.withContext(function($ctx2) {
  4355. //>>excludeEnd("ctx");
  4356. $10=self._sampleNewValue();
  4357. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4358. $ctx2.sendIdx["sampleNewValue"]=1;
  4359. //>>excludeEnd("ctx");
  4360. return $recv(each).__eq($10);
  4361. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4362. $ctx2.sendIdx["="]=1;
  4363. //>>excludeEnd("ctx");
  4364. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4365. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,3)});
  4366. //>>excludeEnd("ctx");
  4367. }));
  4368. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4369. $ctx1.sendIdx["select:"]=3;
  4370. //>>excludeEnd("ctx");
  4371. self._assert_equals_($8,self._sampleNewValueAsCollection());
  4372. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4373. $ctx1.sendIdx["assert:equals:"]=3;
  4374. //>>excludeEnd("ctx");
  4375. $12=self._collectionWithNewValue();
  4376. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4377. $ctx1.sendIdx["collectionWithNewValue"]=2;
  4378. //>>excludeEnd("ctx");
  4379. $11=$recv($12)._select_((function(each){
  4380. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4381. return $core.withContext(function($ctx2) {
  4382. //>>excludeEnd("ctx");
  4383. $13=self._sampleNewValue();
  4384. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4385. $ctx2.sendIdx["sampleNewValue"]=2;
  4386. //>>excludeEnd("ctx");
  4387. return $recv(each).__tild_eq($13);
  4388. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4389. $ctx2.sendIdx["~="]=1;
  4390. //>>excludeEnd("ctx");
  4391. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4392. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,4)});
  4393. //>>excludeEnd("ctx");
  4394. }));
  4395. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4396. $ctx1.sendIdx["select:"]=4;
  4397. //>>excludeEnd("ctx");
  4398. $14=self._collection();
  4399. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4400. $ctx1.sendIdx["collection"]=4;
  4401. //>>excludeEnd("ctx");
  4402. self._assert_equals_($11,$14);
  4403. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4404. $ctx1.sendIdx["assert:equals:"]=4;
  4405. //>>excludeEnd("ctx");
  4406. $16=self._collection();
  4407. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4408. $ctx1.sendIdx["collection"]=5;
  4409. //>>excludeEnd("ctx");
  4410. $15=$recv($16)._select_((function(each){
  4411. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4412. return $core.withContext(function($ctx2) {
  4413. //>>excludeEnd("ctx");
  4414. $17=self._sampleNewValue();
  4415. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4416. $ctx2.sendIdx["sampleNewValue"]=3;
  4417. //>>excludeEnd("ctx");
  4418. return $recv(each).__eq($17);
  4419. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4420. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,5)});
  4421. //>>excludeEnd("ctx");
  4422. }));
  4423. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4424. $ctx1.sendIdx["select:"]=5;
  4425. //>>excludeEnd("ctx");
  4426. self._assert_equals_($15,$recv(self._collectionClass())._new());
  4427. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4428. $ctx1.sendIdx["assert:equals:"]=5;
  4429. //>>excludeEnd("ctx");
  4430. self._assert_equals_($recv(self._collectionWithNewValue())._select_((function(each){
  4431. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4432. return $core.withContext(function($ctx2) {
  4433. //>>excludeEnd("ctx");
  4434. return $recv(each).__tild_eq(self._sampleNewValue());
  4435. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4436. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,6)});
  4437. //>>excludeEnd("ctx");
  4438. })),self._collection());
  4439. return self;
  4440. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4441. }, function($ctx1) {$ctx1.fill(self,"testSelect",{},$globals.CollectionTest)});
  4442. //>>excludeEnd("ctx");
  4443. },
  4444. //>>excludeStart("ide", pragmas.excludeIdeData);
  4445. args: [],
  4446. 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",
  4447. referencedClasses: [],
  4448. //>>excludeEnd("ide");
  4449. messageSends: ["assert:equals:", "select:", "collection", "new", "collectionClass", "collectionWithNewValue", "=", "sampleNewValue", "sampleNewValueAsCollection", "~="]
  4450. }),
  4451. $globals.CollectionTest);
  4452. $core.addMethod(
  4453. $core.method({
  4454. selector: "testSingle",
  4455. protocol: 'tests',
  4456. fn: function (){
  4457. var self=this;
  4458. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4459. return $core.withContext(function($ctx1) {
  4460. //>>excludeEnd("ctx");
  4461. self._should_raise_((function(){
  4462. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4463. return $core.withContext(function($ctx2) {
  4464. //>>excludeEnd("ctx");
  4465. return $recv($recv(self._collectionClass())._new())._single();
  4466. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4467. $ctx2.sendIdx["single"]=1;
  4468. //>>excludeEnd("ctx");
  4469. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4470. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  4471. //>>excludeEnd("ctx");
  4472. }),$globals.Error);
  4473. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4474. $ctx1.sendIdx["should:raise:"]=1;
  4475. //>>excludeEnd("ctx");
  4476. self._should_raise_((function(){
  4477. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4478. return $core.withContext(function($ctx2) {
  4479. //>>excludeEnd("ctx");
  4480. return $recv(self._collection())._single();
  4481. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4482. $ctx2.sendIdx["single"]=2;
  4483. //>>excludeEnd("ctx");
  4484. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4485. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  4486. //>>excludeEnd("ctx");
  4487. }),$globals.Error);
  4488. self._assert_equals_($recv(self._sampleNewValueAsCollection())._single(),self._sampleNewValue());
  4489. return self;
  4490. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4491. }, function($ctx1) {$ctx1.fill(self,"testSingle",{},$globals.CollectionTest)});
  4492. //>>excludeEnd("ctx");
  4493. },
  4494. //>>excludeStart("ide", pragmas.excludeIdeData);
  4495. args: [],
  4496. source: "testSingle\x0a\x09self should: [ self collectionClass new single ] raise: Error.\x0a\x09self should: [ self collection single ] raise: Error.\x0a\x09self assert: self sampleNewValueAsCollection single equals: self sampleNewValue",
  4497. referencedClasses: ["Error"],
  4498. //>>excludeEnd("ide");
  4499. messageSends: ["should:raise:", "single", "new", "collectionClass", "collection", "assert:equals:", "sampleNewValueAsCollection", "sampleNewValue"]
  4500. }),
  4501. $globals.CollectionTest);
  4502. $core.addMethod(
  4503. $core.method({
  4504. selector: "testSize",
  4505. protocol: 'tests',
  4506. fn: function (){
  4507. var self=this;
  4508. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4509. return $core.withContext(function($ctx1) {
  4510. //>>excludeEnd("ctx");
  4511. var $1,$2;
  4512. $1=$recv($recv(self._collectionClass())._new())._size();
  4513. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4514. $ctx1.sendIdx["size"]=1;
  4515. //>>excludeEnd("ctx");
  4516. self._assert_equals_($1,(0));
  4517. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4518. $ctx1.sendIdx["assert:equals:"]=1;
  4519. //>>excludeEnd("ctx");
  4520. $2=$recv(self._sampleNewValueAsCollection())._size();
  4521. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4522. $ctx1.sendIdx["size"]=2;
  4523. //>>excludeEnd("ctx");
  4524. self._assert_equals_($2,(1));
  4525. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4526. $ctx1.sendIdx["assert:equals:"]=2;
  4527. //>>excludeEnd("ctx");
  4528. self._assert_equals_($recv(self._collection())._size(),self._collectionSize());
  4529. return self;
  4530. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4531. }, function($ctx1) {$ctx1.fill(self,"testSize",{},$globals.CollectionTest)});
  4532. //>>excludeEnd("ctx");
  4533. },
  4534. //>>excludeStart("ide", pragmas.excludeIdeData);
  4535. args: [],
  4536. 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",
  4537. referencedClasses: [],
  4538. //>>excludeEnd("ide");
  4539. messageSends: ["assert:equals:", "size", "new", "collectionClass", "sampleNewValueAsCollection", "collection", "collectionSize"]
  4540. }),
  4541. $globals.CollectionTest);
  4542. $core.addMethod(
  4543. $core.method({
  4544. selector: "collectionClass",
  4545. protocol: 'fixture',
  4546. fn: function (){
  4547. var self=this;
  4548. return nil;
  4549. },
  4550. //>>excludeStart("ide", pragmas.excludeIdeData);
  4551. args: [],
  4552. source: "collectionClass\x0a\x09\x22Answers class of collection type tested,\x0a\x09or nil if test is abstract\x22\x0a\x0a\x09^ nil",
  4553. referencedClasses: [],
  4554. //>>excludeEnd("ide");
  4555. messageSends: []
  4556. }),
  4557. $globals.CollectionTest.klass);
  4558. $core.addMethod(
  4559. $core.method({
  4560. selector: "isAbstract",
  4561. protocol: 'testing',
  4562. fn: function (){
  4563. var self=this;
  4564. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4565. return $core.withContext(function($ctx1) {
  4566. //>>excludeEnd("ctx");
  4567. return $recv(self._collectionClass())._isNil();
  4568. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4569. }, function($ctx1) {$ctx1.fill(self,"isAbstract",{},$globals.CollectionTest.klass)});
  4570. //>>excludeEnd("ctx");
  4571. },
  4572. //>>excludeStart("ide", pragmas.excludeIdeData);
  4573. args: [],
  4574. source: "isAbstract\x0a\x09^ self collectionClass isNil",
  4575. referencedClasses: [],
  4576. //>>excludeEnd("ide");
  4577. messageSends: ["isNil", "collectionClass"]
  4578. }),
  4579. $globals.CollectionTest.klass);
  4580. $core.addClass('IndexableCollectionTest', $globals.CollectionTest, [], 'Kernel-Tests');
  4581. $core.addMethod(
  4582. $core.method({
  4583. selector: "collectionWithNewValue",
  4584. protocol: 'fixture',
  4585. fn: function (){
  4586. var self=this;
  4587. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4588. return $core.withContext(function($ctx1) {
  4589. //>>excludeEnd("ctx");
  4590. self._subclassResponsibility();
  4591. return self;
  4592. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4593. }, function($ctx1) {$ctx1.fill(self,"collectionWithNewValue",{},$globals.IndexableCollectionTest)});
  4594. //>>excludeEnd("ctx");
  4595. },
  4596. //>>excludeStart("ide", pragmas.excludeIdeData);
  4597. args: [],
  4598. 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",
  4599. referencedClasses: [],
  4600. //>>excludeEnd("ide");
  4601. messageSends: ["subclassResponsibility"]
  4602. }),
  4603. $globals.IndexableCollectionTest);
  4604. $core.addMethod(
  4605. $core.method({
  4606. selector: "sampleNewIndex",
  4607. protocol: 'fixture',
  4608. fn: function (){
  4609. var self=this;
  4610. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4611. return $core.withContext(function($ctx1) {
  4612. //>>excludeEnd("ctx");
  4613. self._subclassResponsibility();
  4614. return self;
  4615. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4616. }, function($ctx1) {$ctx1.fill(self,"sampleNewIndex",{},$globals.IndexableCollectionTest)});
  4617. //>>excludeEnd("ctx");
  4618. },
  4619. //>>excludeStart("ide", pragmas.excludeIdeData);
  4620. args: [],
  4621. 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",
  4622. referencedClasses: [],
  4623. //>>excludeEnd("ide");
  4624. messageSends: ["subclassResponsibility"]
  4625. }),
  4626. $globals.IndexableCollectionTest);
  4627. $core.addMethod(
  4628. $core.method({
  4629. selector: "sampleNonIndexesDo:",
  4630. protocol: 'fixture',
  4631. fn: function (aBlock){
  4632. var self=this;
  4633. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4634. return $core.withContext(function($ctx1) {
  4635. //>>excludeEnd("ctx");
  4636. self._subclassResponsibility();
  4637. return self;
  4638. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4639. }, function($ctx1) {$ctx1.fill(self,"sampleNonIndexesDo:",{aBlock:aBlock},$globals.IndexableCollectionTest)});
  4640. //>>excludeEnd("ctx");
  4641. },
  4642. //>>excludeStart("ide", pragmas.excludeIdeData);
  4643. args: ["aBlock"],
  4644. 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",
  4645. referencedClasses: [],
  4646. //>>excludeEnd("ide");
  4647. messageSends: ["subclassResponsibility"]
  4648. }),
  4649. $globals.IndexableCollectionTest);
  4650. $core.addMethod(
  4651. $core.method({
  4652. selector: "samplesDo:",
  4653. protocol: 'fixture',
  4654. fn: function (aBlock){
  4655. var self=this;
  4656. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4657. return $core.withContext(function($ctx1) {
  4658. //>>excludeEnd("ctx");
  4659. self._subclassResponsibility();
  4660. return self;
  4661. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4662. }, function($ctx1) {$ctx1.fill(self,"samplesDo:",{aBlock:aBlock},$globals.IndexableCollectionTest)});
  4663. //>>excludeEnd("ctx");
  4664. },
  4665. //>>excludeStart("ide", pragmas.excludeIdeData);
  4666. args: ["aBlock"],
  4667. 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",
  4668. referencedClasses: [],
  4669. //>>excludeEnd("ide");
  4670. messageSends: ["subclassResponsibility"]
  4671. }),
  4672. $globals.IndexableCollectionTest);
  4673. $core.addMethod(
  4674. $core.method({
  4675. selector: "testAt",
  4676. protocol: 'tests',
  4677. fn: function (){
  4678. var self=this;
  4679. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4680. return $core.withContext(function($ctx1) {
  4681. //>>excludeEnd("ctx");
  4682. var $1;
  4683. self._nonIndexesDo_((function(each){
  4684. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4685. return $core.withContext(function($ctx2) {
  4686. //>>excludeEnd("ctx");
  4687. return self._should_raise_((function(){
  4688. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4689. return $core.withContext(function($ctx3) {
  4690. //>>excludeEnd("ctx");
  4691. $1=self._collection();
  4692. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4693. $ctx3.sendIdx["collection"]=1;
  4694. //>>excludeEnd("ctx");
  4695. return $recv($1)._at_(each);
  4696. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4697. $ctx3.sendIdx["at:"]=1;
  4698. //>>excludeEnd("ctx");
  4699. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4700. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  4701. //>>excludeEnd("ctx");
  4702. }),$globals.Error);
  4703. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4704. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  4705. //>>excludeEnd("ctx");
  4706. }));
  4707. self._samplesDo_((function(index,value){
  4708. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4709. return $core.withContext(function($ctx2) {
  4710. //>>excludeEnd("ctx");
  4711. return self._assert_equals_($recv(self._collection())._at_(index),value);
  4712. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4713. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,3)});
  4714. //>>excludeEnd("ctx");
  4715. }));
  4716. return self;
  4717. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4718. }, function($ctx1) {$ctx1.fill(self,"testAt",{},$globals.IndexableCollectionTest)});
  4719. //>>excludeEnd("ctx");
  4720. },
  4721. //>>excludeStart("ide", pragmas.excludeIdeData);
  4722. args: [],
  4723. 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 ]",
  4724. referencedClasses: ["Error"],
  4725. //>>excludeEnd("ide");
  4726. messageSends: ["nonIndexesDo:", "should:raise:", "at:", "collection", "samplesDo:", "assert:equals:"]
  4727. }),
  4728. $globals.IndexableCollectionTest);
  4729. $core.addMethod(
  4730. $core.method({
  4731. selector: "testAtIfAbsent",
  4732. protocol: 'tests',
  4733. fn: function (){
  4734. var self=this;
  4735. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4736. return $core.withContext(function($ctx1) {
  4737. //>>excludeEnd("ctx");
  4738. var $2,$1,$3;
  4739. self._nonIndexesDo_((function(each){
  4740. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4741. return $core.withContext(function($ctx2) {
  4742. //>>excludeEnd("ctx");
  4743. $2=self._collection();
  4744. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4745. $ctx2.sendIdx["collection"]=1;
  4746. //>>excludeEnd("ctx");
  4747. $1=$recv($2)._at_ifAbsent_(each,(function(){
  4748. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4749. return $core.withContext(function($ctx3) {
  4750. //>>excludeEnd("ctx");
  4751. return self._sampleNewValue();
  4752. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4753. $ctx3.sendIdx["sampleNewValue"]=1;
  4754. //>>excludeEnd("ctx");
  4755. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4756. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  4757. //>>excludeEnd("ctx");
  4758. }));
  4759. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4760. $ctx2.sendIdx["at:ifAbsent:"]=1;
  4761. //>>excludeEnd("ctx");
  4762. $3=self._sampleNewValue();
  4763. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4764. $ctx2.sendIdx["sampleNewValue"]=2;
  4765. //>>excludeEnd("ctx");
  4766. return self._assert_equals_($1,$3);
  4767. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4768. $ctx2.sendIdx["assert:equals:"]=1;
  4769. //>>excludeEnd("ctx");
  4770. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4771. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  4772. //>>excludeEnd("ctx");
  4773. }));
  4774. self._samplesDo_((function(index,value){
  4775. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4776. return $core.withContext(function($ctx2) {
  4777. //>>excludeEnd("ctx");
  4778. return self._assert_equals_($recv(self._collection())._at_ifAbsent_(index,(function(){
  4779. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4780. return $core.withContext(function($ctx3) {
  4781. //>>excludeEnd("ctx");
  4782. return self._sampleNewValue();
  4783. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4784. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,4)});
  4785. //>>excludeEnd("ctx");
  4786. })),value);
  4787. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4788. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,3)});
  4789. //>>excludeEnd("ctx");
  4790. }));
  4791. return self;
  4792. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4793. }, function($ctx1) {$ctx1.fill(self,"testAtIfAbsent",{},$globals.IndexableCollectionTest)});
  4794. //>>excludeEnd("ctx");
  4795. },
  4796. //>>excludeStart("ide", pragmas.excludeIdeData);
  4797. args: [],
  4798. 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 ].",
  4799. referencedClasses: [],
  4800. //>>excludeEnd("ide");
  4801. messageSends: ["nonIndexesDo:", "assert:equals:", "at:ifAbsent:", "collection", "sampleNewValue", "samplesDo:"]
  4802. }),
  4803. $globals.IndexableCollectionTest);
  4804. $core.addMethod(
  4805. $core.method({
  4806. selector: "testAtIfAbsentPut",
  4807. protocol: 'tests',
  4808. fn: function (){
  4809. var self=this;
  4810. var newCollection;
  4811. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4812. return $core.withContext(function($ctx1) {
  4813. //>>excludeEnd("ctx");
  4814. var $1;
  4815. newCollection=self._collection();
  4816. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4817. $ctx1.sendIdx["collection"]=1;
  4818. //>>excludeEnd("ctx");
  4819. self._samplesDo_((function(index,value){
  4820. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4821. return $core.withContext(function($ctx2) {
  4822. //>>excludeEnd("ctx");
  4823. $1=$recv(newCollection)._at_ifAbsentPut_(index,(function(){
  4824. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4825. return $core.withContext(function($ctx3) {
  4826. //>>excludeEnd("ctx");
  4827. return self._sampleNewValue();
  4828. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4829. $ctx3.sendIdx["sampleNewValue"]=1;
  4830. //>>excludeEnd("ctx");
  4831. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4832. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  4833. //>>excludeEnd("ctx");
  4834. }));
  4835. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4836. $ctx2.sendIdx["at:ifAbsentPut:"]=1;
  4837. //>>excludeEnd("ctx");
  4838. return self._assert_equals_($1,value);
  4839. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4840. $ctx2.sendIdx["assert:equals:"]=1;
  4841. //>>excludeEnd("ctx");
  4842. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4843. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,1)});
  4844. //>>excludeEnd("ctx");
  4845. }));
  4846. self._assert_equals_(newCollection,self._collection());
  4847. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4848. $ctx1.sendIdx["assert:equals:"]=2;
  4849. //>>excludeEnd("ctx");
  4850. self._assert_equals_($recv(newCollection)._at_ifAbsentPut_(self._sampleNewIndex(),(function(){
  4851. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4852. return $core.withContext(function($ctx2) {
  4853. //>>excludeEnd("ctx");
  4854. return self._sampleNewValue();
  4855. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4856. $ctx2.sendIdx["sampleNewValue"]=2;
  4857. //>>excludeEnd("ctx");
  4858. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4859. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  4860. //>>excludeEnd("ctx");
  4861. })),self._sampleNewValue());
  4862. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4863. $ctx1.sendIdx["assert:equals:"]=3;
  4864. //>>excludeEnd("ctx");
  4865. self._assert_equals_(newCollection,self._collectionWithNewValue());
  4866. return self;
  4867. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4868. }, function($ctx1) {$ctx1.fill(self,"testAtIfAbsentPut",{newCollection:newCollection},$globals.IndexableCollectionTest)});
  4869. //>>excludeEnd("ctx");
  4870. },
  4871. //>>excludeStart("ide", pragmas.excludeIdeData);
  4872. args: [],
  4873. 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",
  4874. referencedClasses: [],
  4875. //>>excludeEnd("ide");
  4876. messageSends: ["collection", "samplesDo:", "assert:equals:", "at:ifAbsentPut:", "sampleNewValue", "sampleNewIndex", "collectionWithNewValue"]
  4877. }),
  4878. $globals.IndexableCollectionTest);
  4879. $core.addMethod(
  4880. $core.method({
  4881. selector: "testAtIfPresent",
  4882. protocol: 'tests',
  4883. fn: function (){
  4884. var self=this;
  4885. var visited,sentinel;
  4886. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4887. return $core.withContext(function($ctx1) {
  4888. //>>excludeEnd("ctx");
  4889. var $2,$1,$4,$3;
  4890. sentinel=$recv($globals.Object)._new();
  4891. self._nonIndexesDo_((function(each){
  4892. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4893. return $core.withContext(function($ctx2) {
  4894. //>>excludeEnd("ctx");
  4895. visited=nil;
  4896. visited;
  4897. $2=self._collection();
  4898. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4899. $ctx2.sendIdx["collection"]=1;
  4900. //>>excludeEnd("ctx");
  4901. $1=$recv($2)._at_ifPresent_(each,(function(value1){
  4902. visited=value1;
  4903. visited;
  4904. return sentinel;
  4905. }));
  4906. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4907. $ctx2.sendIdx["at:ifPresent:"]=1;
  4908. //>>excludeEnd("ctx");
  4909. self._assert_equals_($1,nil);
  4910. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4911. $ctx2.sendIdx["assert:equals:"]=1;
  4912. //>>excludeEnd("ctx");
  4913. return self._assert_($recv(visited)._isNil());
  4914. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4915. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  4916. //>>excludeEnd("ctx");
  4917. }));
  4918. self._samplesDo_((function(index,value){
  4919. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4920. return $core.withContext(function($ctx2) {
  4921. //>>excludeEnd("ctx");
  4922. visited=nil;
  4923. visited;
  4924. $4=self._collection();
  4925. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4926. $ctx2.sendIdx["collection"]=2;
  4927. //>>excludeEnd("ctx");
  4928. $3=$recv($4)._at_ifPresent_(index,(function(value2){
  4929. visited=value2;
  4930. visited;
  4931. return sentinel;
  4932. }));
  4933. self._assert_equals_($3,sentinel);
  4934. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4935. $ctx2.sendIdx["assert:equals:"]=2;
  4936. //>>excludeEnd("ctx");
  4937. return self._assert_equals_(visited,$recv(self._collection())._at_(index));
  4938. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4939. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,3)});
  4940. //>>excludeEnd("ctx");
  4941. }));
  4942. return self;
  4943. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4944. }, function($ctx1) {$ctx1.fill(self,"testAtIfPresent",{visited:visited,sentinel:sentinel},$globals.IndexableCollectionTest)});
  4945. //>>excludeEnd("ctx");
  4946. },
  4947. //>>excludeStart("ide", pragmas.excludeIdeData);
  4948. args: [],
  4949. 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) ]",
  4950. referencedClasses: ["Object"],
  4951. //>>excludeEnd("ide");
  4952. messageSends: ["new", "nonIndexesDo:", "assert:equals:", "at:ifPresent:", "collection", "assert:", "isNil", "samplesDo:", "at:"]
  4953. }),
  4954. $globals.IndexableCollectionTest);
  4955. $core.addMethod(
  4956. $core.method({
  4957. selector: "testAtIfPresentIfAbsent",
  4958. protocol: 'tests',
  4959. fn: function (){
  4960. var self=this;
  4961. var visited,sentinel;
  4962. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4963. return $core.withContext(function($ctx1) {
  4964. //>>excludeEnd("ctx");
  4965. var $2,$1,$3,$5,$4;
  4966. sentinel=$recv($globals.Object)._new();
  4967. self._nonIndexesDo_((function(each){
  4968. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4969. return $core.withContext(function($ctx2) {
  4970. //>>excludeEnd("ctx");
  4971. visited=nil;
  4972. visited;
  4973. $2=self._collection();
  4974. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4975. $ctx2.sendIdx["collection"]=1;
  4976. //>>excludeEnd("ctx");
  4977. $1=$recv($2)._at_ifPresent_ifAbsent_(each,(function(value1){
  4978. visited=value1;
  4979. visited;
  4980. return sentinel;
  4981. }),(function(){
  4982. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4983. return $core.withContext(function($ctx3) {
  4984. //>>excludeEnd("ctx");
  4985. return self._sampleNewValue();
  4986. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4987. $ctx3.sendIdx["sampleNewValue"]=1;
  4988. //>>excludeEnd("ctx");
  4989. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4990. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)});
  4991. //>>excludeEnd("ctx");
  4992. }));
  4993. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4994. $ctx2.sendIdx["at:ifPresent:ifAbsent:"]=1;
  4995. //>>excludeEnd("ctx");
  4996. $3=self._sampleNewValue();
  4997. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4998. $ctx2.sendIdx["sampleNewValue"]=2;
  4999. //>>excludeEnd("ctx");
  5000. self._assert_equals_($1,$3);
  5001. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5002. $ctx2.sendIdx["assert:equals:"]=1;
  5003. //>>excludeEnd("ctx");
  5004. return self._assert_($recv(visited)._isNil());
  5005. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5006. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  5007. //>>excludeEnd("ctx");
  5008. }));
  5009. self._samplesDo_((function(index,value){
  5010. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5011. return $core.withContext(function($ctx2) {
  5012. //>>excludeEnd("ctx");
  5013. visited=nil;
  5014. visited;
  5015. $5=self._collection();
  5016. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5017. $ctx2.sendIdx["collection"]=2;
  5018. //>>excludeEnd("ctx");
  5019. $4=$recv($5)._at_ifPresent_ifAbsent_(index,(function(value2){
  5020. visited=value2;
  5021. visited;
  5022. return sentinel;
  5023. }),(function(){
  5024. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5025. return $core.withContext(function($ctx3) {
  5026. //>>excludeEnd("ctx");
  5027. return self._sampleNewValue();
  5028. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5029. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,6)});
  5030. //>>excludeEnd("ctx");
  5031. }));
  5032. self._assert_equals_($4,sentinel);
  5033. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5034. $ctx2.sendIdx["assert:equals:"]=2;
  5035. //>>excludeEnd("ctx");
  5036. return self._assert_equals_(visited,$recv(self._collection())._at_(index));
  5037. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5038. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,4)});
  5039. //>>excludeEnd("ctx");
  5040. }));
  5041. return self;
  5042. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5043. }, function($ctx1) {$ctx1.fill(self,"testAtIfPresentIfAbsent",{visited:visited,sentinel:sentinel},$globals.IndexableCollectionTest)});
  5044. //>>excludeEnd("ctx");
  5045. },
  5046. //>>excludeStart("ide", pragmas.excludeIdeData);
  5047. args: [],
  5048. 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) ]",
  5049. referencedClasses: ["Object"],
  5050. //>>excludeEnd("ide");
  5051. messageSends: ["new", "nonIndexesDo:", "assert:equals:", "at:ifPresent:ifAbsent:", "collection", "sampleNewValue", "assert:", "isNil", "samplesDo:", "at:"]
  5052. }),
  5053. $globals.IndexableCollectionTest);
  5054. $core.addMethod(
  5055. $core.method({
  5056. selector: "testAtPut",
  5057. protocol: 'tests',
  5058. fn: function (){
  5059. var self=this;
  5060. var newCollection;
  5061. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5062. return $core.withContext(function($ctx1) {
  5063. //>>excludeEnd("ctx");
  5064. newCollection=self._collection();
  5065. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5066. $ctx1.sendIdx["collection"]=1;
  5067. //>>excludeEnd("ctx");
  5068. self._samplesDo_((function(index,value){
  5069. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5070. return $core.withContext(function($ctx2) {
  5071. //>>excludeEnd("ctx");
  5072. return $recv(newCollection)._at_put_(index,value);
  5073. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5074. $ctx2.sendIdx["at:put:"]=1;
  5075. //>>excludeEnd("ctx");
  5076. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5077. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,1)});
  5078. //>>excludeEnd("ctx");
  5079. }));
  5080. self._assert_equals_(newCollection,self._collection());
  5081. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5082. $ctx1.sendIdx["assert:equals:"]=1;
  5083. //>>excludeEnd("ctx");
  5084. $recv(newCollection)._at_put_(self._sampleNewIndex(),self._sampleNewValue());
  5085. self._assert_equals_(newCollection,self._collectionWithNewValue());
  5086. return self;
  5087. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5088. }, function($ctx1) {$ctx1.fill(self,"testAtPut",{newCollection:newCollection},$globals.IndexableCollectionTest)});
  5089. //>>excludeEnd("ctx");
  5090. },
  5091. //>>excludeStart("ide", pragmas.excludeIdeData);
  5092. args: [],
  5093. 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",
  5094. referencedClasses: [],
  5095. //>>excludeEnd("ide");
  5096. messageSends: ["collection", "samplesDo:", "at:put:", "assert:equals:", "sampleNewIndex", "sampleNewValue", "collectionWithNewValue"]
  5097. }),
  5098. $globals.IndexableCollectionTest);
  5099. $core.addMethod(
  5100. $core.method({
  5101. selector: "testIndexOf",
  5102. protocol: 'tests',
  5103. fn: function (){
  5104. var self=this;
  5105. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5106. return $core.withContext(function($ctx1) {
  5107. //>>excludeEnd("ctx");
  5108. var $1;
  5109. self._should_raise_((function(){
  5110. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5111. return $core.withContext(function($ctx2) {
  5112. //>>excludeEnd("ctx");
  5113. $1=self._collection();
  5114. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5115. $ctx2.sendIdx["collection"]=1;
  5116. //>>excludeEnd("ctx");
  5117. return $recv($1)._indexOf_(self._sampleNewValue());
  5118. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5119. $ctx2.sendIdx["indexOf:"]=1;
  5120. //>>excludeEnd("ctx");
  5121. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5122. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  5123. //>>excludeEnd("ctx");
  5124. }),$globals.Error);
  5125. self._samplesDo_((function(index,value){
  5126. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5127. return $core.withContext(function($ctx2) {
  5128. //>>excludeEnd("ctx");
  5129. return self._assert_equals_($recv(self._collection())._indexOf_(value),index);
  5130. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5131. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,2)});
  5132. //>>excludeEnd("ctx");
  5133. }));
  5134. return self;
  5135. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5136. }, function($ctx1) {$ctx1.fill(self,"testIndexOf",{},$globals.IndexableCollectionTest)});
  5137. //>>excludeEnd("ctx");
  5138. },
  5139. //>>excludeStart("ide", pragmas.excludeIdeData);
  5140. args: [],
  5141. 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 ]",
  5142. referencedClasses: ["Error"],
  5143. //>>excludeEnd("ide");
  5144. messageSends: ["should:raise:", "indexOf:", "collection", "sampleNewValue", "samplesDo:", "assert:equals:"]
  5145. }),
  5146. $globals.IndexableCollectionTest);
  5147. $core.addMethod(
  5148. $core.method({
  5149. selector: "testIndexOfWithNull",
  5150. protocol: 'tests',
  5151. fn: function (){
  5152. var self=this;
  5153. var jsNull;
  5154. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5155. return $core.withContext(function($ctx1) {
  5156. //>>excludeEnd("ctx");
  5157. var $2,$1;
  5158. jsNull=$recv($globals.JSON)._parse_("null");
  5159. self._samplesDo_((function(index,value){
  5160. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5161. return $core.withContext(function($ctx2) {
  5162. //>>excludeEnd("ctx");
  5163. $2=self._collection();
  5164. $recv($2)._at_put_(index,jsNull);
  5165. $1=$recv($2)._indexOf_(jsNull);
  5166. return self._assert_equals_($1,index);
  5167. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5168. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,1)});
  5169. //>>excludeEnd("ctx");
  5170. }));
  5171. return self;
  5172. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5173. }, function($ctx1) {$ctx1.fill(self,"testIndexOfWithNull",{jsNull:jsNull},$globals.IndexableCollectionTest)});
  5174. //>>excludeEnd("ctx");
  5175. },
  5176. //>>excludeStart("ide", pragmas.excludeIdeData);
  5177. args: [],
  5178. 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 ]",
  5179. referencedClasses: ["JSON"],
  5180. //>>excludeEnd("ide");
  5181. messageSends: ["parse:", "samplesDo:", "assert:equals:", "at:put:", "collection", "indexOf:"]
  5182. }),
  5183. $globals.IndexableCollectionTest);
  5184. $core.addMethod(
  5185. $core.method({
  5186. selector: "testWithIndexDo",
  5187. protocol: 'tests',
  5188. fn: function (){
  5189. var self=this;
  5190. var collection;
  5191. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5192. return $core.withContext(function($ctx1) {
  5193. //>>excludeEnd("ctx");
  5194. collection=self._collection();
  5195. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5196. $ctx1.sendIdx["collection"]=1;
  5197. //>>excludeEnd("ctx");
  5198. $recv(self._collection())._withIndexDo_((function(each,index){
  5199. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5200. return $core.withContext(function($ctx2) {
  5201. //>>excludeEnd("ctx");
  5202. return self._assert_equals_($recv(collection)._at_(index),each);
  5203. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5204. }, function($ctx2) {$ctx2.fillBlock({each:each,index:index},$ctx1,1)});
  5205. //>>excludeEnd("ctx");
  5206. }));
  5207. return self;
  5208. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5209. }, function($ctx1) {$ctx1.fill(self,"testWithIndexDo",{collection:collection},$globals.IndexableCollectionTest)});
  5210. //>>excludeEnd("ctx");
  5211. },
  5212. //>>excludeStart("ide", pragmas.excludeIdeData);
  5213. args: [],
  5214. 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 ]",
  5215. referencedClasses: [],
  5216. //>>excludeEnd("ide");
  5217. messageSends: ["collection", "withIndexDo:", "assert:equals:", "at:"]
  5218. }),
  5219. $globals.IndexableCollectionTest);
  5220. $core.addClass('AssociativeCollectionTest', $globals.IndexableCollectionTest, [], 'Kernel-Tests');
  5221. $core.addMethod(
  5222. $core.method({
  5223. selector: "collectionKeys",
  5224. protocol: 'fixture',
  5225. fn: function (){
  5226. var self=this;
  5227. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5228. return $core.withContext(function($ctx1) {
  5229. //>>excludeEnd("ctx");
  5230. self._subclassResponsibility();
  5231. return self;
  5232. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5233. }, function($ctx1) {$ctx1.fill(self,"collectionKeys",{},$globals.AssociativeCollectionTest)});
  5234. //>>excludeEnd("ctx");
  5235. },
  5236. //>>excludeStart("ide", pragmas.excludeIdeData);
  5237. args: [],
  5238. source: "collectionKeys\x0a\x09self subclassResponsibility",
  5239. referencedClasses: [],
  5240. //>>excludeEnd("ide");
  5241. messageSends: ["subclassResponsibility"]
  5242. }),
  5243. $globals.AssociativeCollectionTest);
  5244. $core.addMethod(
  5245. $core.method({
  5246. selector: "collectionValues",
  5247. protocol: 'fixture',
  5248. fn: function (){
  5249. var self=this;
  5250. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5251. return $core.withContext(function($ctx1) {
  5252. //>>excludeEnd("ctx");
  5253. self._subclassResponsibility();
  5254. return self;
  5255. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5256. }, function($ctx1) {$ctx1.fill(self,"collectionValues",{},$globals.AssociativeCollectionTest)});
  5257. //>>excludeEnd("ctx");
  5258. },
  5259. //>>excludeStart("ide", pragmas.excludeIdeData);
  5260. args: [],
  5261. source: "collectionValues\x0a\x09self subclassResponsibility",
  5262. referencedClasses: [],
  5263. //>>excludeEnd("ide");
  5264. messageSends: ["subclassResponsibility"]
  5265. }),
  5266. $globals.AssociativeCollectionTest);
  5267. $core.addMethod(
  5268. $core.method({
  5269. selector: "nonIndexesDo:",
  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_((5));
  5277. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5278. $ctx1.sendIdx["value:"]=1;
  5279. //>>excludeEnd("ctx");
  5280. $recv(aBlock)._value_((function(){
  5281. }));
  5282. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5283. $ctx1.sendIdx["value:"]=2;
  5284. //>>excludeEnd("ctx");
  5285. $recv(aBlock)._value_($recv($globals.Object)._new());
  5286. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5287. $ctx1.sendIdx["value:"]=3;
  5288. //>>excludeEnd("ctx");
  5289. $recv(aBlock)._value_("z");
  5290. return self;
  5291. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5292. }, function($ctx1) {$ctx1.fill(self,"nonIndexesDo:",{aBlock:aBlock},$globals.AssociativeCollectionTest)});
  5293. //>>excludeEnd("ctx");
  5294. },
  5295. //>>excludeStart("ide", pragmas.excludeIdeData);
  5296. args: ["aBlock"],
  5297. source: "nonIndexesDo: aBlock\x0a\x09aBlock value: 5.\x0a\x09aBlock value: [].\x0a\x09aBlock value: Object new.\x0a\x09aBlock value: 'z'",
  5298. referencedClasses: ["Object"],
  5299. //>>excludeEnd("ide");
  5300. messageSends: ["value:", "new"]
  5301. }),
  5302. $globals.AssociativeCollectionTest);
  5303. $core.addMethod(
  5304. $core.method({
  5305. selector: "sampleNewIndex",
  5306. protocol: 'fixture',
  5307. fn: function (){
  5308. var self=this;
  5309. return "new";
  5310. },
  5311. //>>excludeStart("ide", pragmas.excludeIdeData);
  5312. args: [],
  5313. source: "sampleNewIndex\x0a\x09^ 'new'",
  5314. referencedClasses: [],
  5315. //>>excludeEnd("ide");
  5316. messageSends: []
  5317. }),
  5318. $globals.AssociativeCollectionTest);
  5319. $core.addMethod(
  5320. $core.method({
  5321. selector: "samplesDo:",
  5322. protocol: 'fixture',
  5323. fn: function (aBlock){
  5324. var self=this;
  5325. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5326. return $core.withContext(function($ctx1) {
  5327. //>>excludeEnd("ctx");
  5328. $recv(aBlock)._value_value_("a",(2));
  5329. return self;
  5330. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5331. }, function($ctx1) {$ctx1.fill(self,"samplesDo:",{aBlock:aBlock},$globals.AssociativeCollectionTest)});
  5332. //>>excludeEnd("ctx");
  5333. },
  5334. //>>excludeStart("ide", pragmas.excludeIdeData);
  5335. args: ["aBlock"],
  5336. source: "samplesDo: aBlock\x0a\x09aBlock value: 'a' value: 2",
  5337. referencedClasses: [],
  5338. //>>excludeEnd("ide");
  5339. messageSends: ["value:value:"]
  5340. }),
  5341. $globals.AssociativeCollectionTest);
  5342. $core.addMethod(
  5343. $core.method({
  5344. selector: "testAddAll",
  5345. protocol: 'tests',
  5346. fn: function (){
  5347. var self=this;
  5348. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5349. return $core.withContext(function($ctx1) {
  5350. //>>excludeEnd("ctx");
  5351. var $2,$3,$4,$1,$5,$7,$8,$9,$6,$10,$12,$11;
  5352. (
  5353. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5354. $ctx1.supercall = true,
  5355. //>>excludeEnd("ctx");
  5356. ($globals.AssociativeCollectionTest.superclass||$boot.nilAsClass).fn.prototype._testAddAll.apply($recv(self), []));
  5357. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5358. $ctx1.supercall = false;
  5359. //>>excludeEnd("ctx");;
  5360. $2=self._collection();
  5361. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5362. $ctx1.sendIdx["collection"]=1;
  5363. //>>excludeEnd("ctx");
  5364. $3=self._collection();
  5365. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5366. $ctx1.sendIdx["collection"]=2;
  5367. //>>excludeEnd("ctx");
  5368. $recv($2)._addAll_($3);
  5369. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5370. $ctx1.sendIdx["addAll:"]=1;
  5371. //>>excludeEnd("ctx");
  5372. $4=$recv($2)._yourself();
  5373. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5374. $ctx1.sendIdx["yourself"]=1;
  5375. //>>excludeEnd("ctx");
  5376. $1=$4;
  5377. $5=self._collection();
  5378. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5379. $ctx1.sendIdx["collection"]=3;
  5380. //>>excludeEnd("ctx");
  5381. self._assert_equals_($1,$5);
  5382. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5383. $ctx1.sendIdx["assert:equals:"]=1;
  5384. //>>excludeEnd("ctx");
  5385. $7=self._collection();
  5386. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5387. $ctx1.sendIdx["collection"]=4;
  5388. //>>excludeEnd("ctx");
  5389. $8=self._collectionWithNewValue();
  5390. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5391. $ctx1.sendIdx["collectionWithNewValue"]=1;
  5392. //>>excludeEnd("ctx");
  5393. $recv($7)._addAll_($8);
  5394. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5395. $ctx1.sendIdx["addAll:"]=2;
  5396. //>>excludeEnd("ctx");
  5397. $9=$recv($7)._yourself();
  5398. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5399. $ctx1.sendIdx["yourself"]=2;
  5400. //>>excludeEnd("ctx");
  5401. $6=$9;
  5402. $10=self._collectionWithNewValue();
  5403. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5404. $ctx1.sendIdx["collectionWithNewValue"]=2;
  5405. //>>excludeEnd("ctx");
  5406. self._assert_equals_($6,$10);
  5407. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5408. $ctx1.sendIdx["assert:equals:"]=2;
  5409. //>>excludeEnd("ctx");
  5410. $12=self._collectionWithNewValue();
  5411. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5412. $ctx1.sendIdx["collectionWithNewValue"]=3;
  5413. //>>excludeEnd("ctx");
  5414. $recv($12)._addAll_(self._collection());
  5415. $11=$recv($12)._yourself();
  5416. self._assert_equals_($11,self._collectionWithNewValue());
  5417. return self;
  5418. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5419. }, function($ctx1) {$ctx1.fill(self,"testAddAll",{},$globals.AssociativeCollectionTest)});
  5420. //>>excludeEnd("ctx");
  5421. },
  5422. //>>excludeStart("ide", pragmas.excludeIdeData);
  5423. args: [],
  5424. 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",
  5425. referencedClasses: [],
  5426. //>>excludeEnd("ide");
  5427. messageSends: ["testAddAll", "assert:equals:", "addAll:", "collection", "yourself", "collectionWithNewValue"]
  5428. }),
  5429. $globals.AssociativeCollectionTest);
  5430. $core.addMethod(
  5431. $core.method({
  5432. selector: "testAsDictionary",
  5433. protocol: 'tests',
  5434. fn: function (){
  5435. var self=this;
  5436. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5437. return $core.withContext(function($ctx1) {
  5438. //>>excludeEnd("ctx");
  5439. self._assert_($recv($recv($recv(self._collectionClass())._new())._asDictionary())._isMemberOf_($globals.Dictionary));
  5440. return self;
  5441. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5442. }, function($ctx1) {$ctx1.fill(self,"testAsDictionary",{},$globals.AssociativeCollectionTest)});
  5443. //>>excludeEnd("ctx");
  5444. },
  5445. //>>excludeStart("ide", pragmas.excludeIdeData);
  5446. args: [],
  5447. source: "testAsDictionary\x0aself assert: ( self collectionClass new asDictionary isMemberOf: Dictionary ).",
  5448. referencedClasses: ["Dictionary"],
  5449. //>>excludeEnd("ide");
  5450. messageSends: ["assert:", "isMemberOf:", "asDictionary", "new", "collectionClass"]
  5451. }),
  5452. $globals.AssociativeCollectionTest);
  5453. $core.addMethod(
  5454. $core.method({
  5455. selector: "testAsHashedCollection",
  5456. protocol: 'tests',
  5457. fn: function (){
  5458. var self=this;
  5459. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5460. return $core.withContext(function($ctx1) {
  5461. //>>excludeEnd("ctx");
  5462. self._assert_($recv($recv($recv(self._collectionClass())._new())._asHashedCollection())._isMemberOf_($globals.HashedCollection));
  5463. return self;
  5464. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5465. }, function($ctx1) {$ctx1.fill(self,"testAsHashedCollection",{},$globals.AssociativeCollectionTest)});
  5466. //>>excludeEnd("ctx");
  5467. },
  5468. //>>excludeStart("ide", pragmas.excludeIdeData);
  5469. args: [],
  5470. source: "testAsHashedCollection\x0aself assert: ( self collectionClass new asHashedCollection isMemberOf: HashedCollection ).",
  5471. referencedClasses: ["HashedCollection"],
  5472. //>>excludeEnd("ide");
  5473. messageSends: ["assert:", "isMemberOf:", "asHashedCollection", "new", "collectionClass"]
  5474. }),
  5475. $globals.AssociativeCollectionTest);
  5476. $core.addMethod(
  5477. $core.method({
  5478. selector: "testComma",
  5479. protocol: 'tests',
  5480. fn: function (){
  5481. var self=this;
  5482. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5483. return $core.withContext(function($ctx1) {
  5484. //>>excludeEnd("ctx");
  5485. var $2,$3,$1,$4,$6,$7,$5,$8,$10,$9;
  5486. (
  5487. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5488. $ctx1.supercall = true,
  5489. //>>excludeEnd("ctx");
  5490. ($globals.AssociativeCollectionTest.superclass||$boot.nilAsClass).fn.prototype._testComma.apply($recv(self), []));
  5491. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5492. $ctx1.supercall = false;
  5493. //>>excludeEnd("ctx");;
  5494. $2=self._collection();
  5495. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5496. $ctx1.sendIdx["collection"]=1;
  5497. //>>excludeEnd("ctx");
  5498. $3=self._collection();
  5499. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5500. $ctx1.sendIdx["collection"]=2;
  5501. //>>excludeEnd("ctx");
  5502. $1=$recv($2).__comma($3);
  5503. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5504. $ctx1.sendIdx[","]=1;
  5505. //>>excludeEnd("ctx");
  5506. $4=self._collection();
  5507. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5508. $ctx1.sendIdx["collection"]=3;
  5509. //>>excludeEnd("ctx");
  5510. self._assert_equals_($1,$4);
  5511. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5512. $ctx1.sendIdx["assert:equals:"]=1;
  5513. //>>excludeEnd("ctx");
  5514. $6=self._collection();
  5515. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5516. $ctx1.sendIdx["collection"]=4;
  5517. //>>excludeEnd("ctx");
  5518. $7=self._collectionWithNewValue();
  5519. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5520. $ctx1.sendIdx["collectionWithNewValue"]=1;
  5521. //>>excludeEnd("ctx");
  5522. $5=$recv($6).__comma($7);
  5523. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5524. $ctx1.sendIdx[","]=2;
  5525. //>>excludeEnd("ctx");
  5526. $8=self._collectionWithNewValue();
  5527. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5528. $ctx1.sendIdx["collectionWithNewValue"]=2;
  5529. //>>excludeEnd("ctx");
  5530. self._assert_equals_($5,$8);
  5531. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5532. $ctx1.sendIdx["assert:equals:"]=2;
  5533. //>>excludeEnd("ctx");
  5534. $10=self._collectionWithNewValue();
  5535. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5536. $ctx1.sendIdx["collectionWithNewValue"]=3;
  5537. //>>excludeEnd("ctx");
  5538. $9=$recv($10).__comma(self._collection());
  5539. self._assert_equals_($9,self._collectionWithNewValue());
  5540. return self;
  5541. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5542. }, function($ctx1) {$ctx1.fill(self,"testComma",{},$globals.AssociativeCollectionTest)});
  5543. //>>excludeEnd("ctx");
  5544. },
  5545. //>>excludeStart("ide", pragmas.excludeIdeData);
  5546. args: [],
  5547. 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",
  5548. referencedClasses: [],
  5549. //>>excludeEnd("ide");
  5550. messageSends: ["testComma", "assert:equals:", ",", "collection", "collectionWithNewValue"]
  5551. }),
  5552. $globals.AssociativeCollectionTest);
  5553. $core.addMethod(
  5554. $core.method({
  5555. selector: "testFrom",
  5556. protocol: 'tests',
  5557. fn: function (){
  5558. var self=this;
  5559. var associations;
  5560. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5561. return $core.withContext(function($ctx1) {
  5562. //>>excludeEnd("ctx");
  5563. var $1;
  5564. $1="a".__minus_gt((1));
  5565. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5566. $ctx1.sendIdx["->"]=1;
  5567. //>>excludeEnd("ctx");
  5568. associations=[$1,"b".__minus_gt((2))];
  5569. self._assertSameContents_as_($recv($recv(self._class())._collectionClass())._from_(associations),$globals.HashedCollection._newFromPairs_(["a",(1),"b",(2)]));
  5570. return self;
  5571. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5572. }, function($ctx1) {$ctx1.fill(self,"testFrom",{associations:associations},$globals.AssociativeCollectionTest)});
  5573. //>>excludeEnd("ctx");
  5574. },
  5575. //>>excludeStart("ide", pragmas.excludeIdeData);
  5576. args: [],
  5577. 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 }.",
  5578. referencedClasses: [],
  5579. //>>excludeEnd("ide");
  5580. messageSends: ["->", "assertSameContents:as:", "from:", "collectionClass", "class"]
  5581. }),
  5582. $globals.AssociativeCollectionTest);
  5583. $core.addMethod(
  5584. $core.method({
  5585. selector: "testKeys",
  5586. protocol: 'tests',
  5587. fn: function (){
  5588. var self=this;
  5589. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5590. return $core.withContext(function($ctx1) {
  5591. //>>excludeEnd("ctx");
  5592. var $2,$1,$3,$4;
  5593. $2=$recv($recv(self._collectionClass())._new())._keys();
  5594. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5595. $ctx1.sendIdx["keys"]=1;
  5596. //>>excludeEnd("ctx");
  5597. $1=$recv($2)._isEmpty();
  5598. self._assert_($1);
  5599. $3=$recv(self._collection())._keys();
  5600. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5601. $ctx1.sendIdx["keys"]=2;
  5602. //>>excludeEnd("ctx");
  5603. $4=self._collectionKeys();
  5604. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5605. $ctx1.sendIdx["collectionKeys"]=1;
  5606. //>>excludeEnd("ctx");
  5607. self._assertSameContents_as_($3,$4);
  5608. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5609. $ctx1.sendIdx["assertSameContents:as:"]=1;
  5610. //>>excludeEnd("ctx");
  5611. self._assertSameContents_as_($recv(self._collectionWithNewValue())._keys(),$recv(self._collectionKeys()).__comma([self._sampleNewIndex()]));
  5612. return self;
  5613. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5614. }, function($ctx1) {$ctx1.fill(self,"testKeys",{},$globals.AssociativeCollectionTest)});
  5615. //>>excludeEnd("ctx");
  5616. },
  5617. //>>excludeStart("ide", pragmas.excludeIdeData);
  5618. args: [],
  5619. 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 }",
  5620. referencedClasses: [],
  5621. //>>excludeEnd("ide");
  5622. messageSends: ["assert:", "isEmpty", "keys", "new", "collectionClass", "assertSameContents:as:", "collection", "collectionKeys", "collectionWithNewValue", ",", "sampleNewIndex"]
  5623. }),
  5624. $globals.AssociativeCollectionTest);
  5625. $core.addMethod(
  5626. $core.method({
  5627. selector: "testNewFromPairs",
  5628. protocol: 'tests',
  5629. fn: function (){
  5630. var self=this;
  5631. var flattenedAssociations;
  5632. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5633. return $core.withContext(function($ctx1) {
  5634. //>>excludeEnd("ctx");
  5635. flattenedAssociations=["a",(1),"b",(2)];
  5636. self._assertSameContents_as_($recv($recv(self._class())._collectionClass())._newFromPairs_(flattenedAssociations),$globals.HashedCollection._newFromPairs_(["a",(1),"b",(2)]));
  5637. return self;
  5638. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5639. }, function($ctx1) {$ctx1.fill(self,"testNewFromPairs",{flattenedAssociations:flattenedAssociations},$globals.AssociativeCollectionTest)});
  5640. //>>excludeEnd("ctx");
  5641. },
  5642. //>>excludeStart("ide", pragmas.excludeIdeData);
  5643. args: [],
  5644. 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 }.",
  5645. referencedClasses: [],
  5646. //>>excludeEnd("ide");
  5647. messageSends: ["assertSameContents:as:", "newFromPairs:", "collectionClass", "class"]
  5648. }),
  5649. $globals.AssociativeCollectionTest);
  5650. $core.addMethod(
  5651. $core.method({
  5652. selector: "testPrintString",
  5653. protocol: 'tests',
  5654. fn: function (){
  5655. var self=this;
  5656. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5657. return $core.withContext(function($ctx1) {
  5658. //>>excludeEnd("ctx");
  5659. var $3,$2,$1,$4;
  5660. $3=self._collectionClass();
  5661. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5662. $ctx1.sendIdx["collectionClass"]=1;
  5663. //>>excludeEnd("ctx");
  5664. $2=$recv($3)._new();
  5665. $recv($2)._at_put_("firstname","James");
  5666. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5667. $ctx1.sendIdx["at:put:"]=1;
  5668. //>>excludeEnd("ctx");
  5669. $recv($2)._at_put_("lastname","Bond");
  5670. $1=$recv($2)._printString();
  5671. $4=$recv("a ".__comma($recv(self._collectionClass())._name())).__comma(" ('firstname' -> 'James' , 'lastname' -> 'Bond')");
  5672. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5673. $ctx1.sendIdx[","]=1;
  5674. //>>excludeEnd("ctx");
  5675. self._assert_equals_($1,$4);
  5676. return self;
  5677. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5678. }, function($ctx1) {$ctx1.fill(self,"testPrintString",{},$globals.AssociativeCollectionTest)});
  5679. //>>excludeEnd("ctx");
  5680. },
  5681. //>>excludeStart("ide", pragmas.excludeIdeData);
  5682. args: [],
  5683. 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'')'",
  5684. referencedClasses: [],
  5685. //>>excludeEnd("ide");
  5686. messageSends: ["assert:equals:", "at:put:", "new", "collectionClass", "printString", ",", "name"]
  5687. }),
  5688. $globals.AssociativeCollectionTest);
  5689. $core.addMethod(
  5690. $core.method({
  5691. selector: "testRemoveKey",
  5692. protocol: 'tests',
  5693. fn: function (){
  5694. var self=this;
  5695. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5696. return $core.withContext(function($ctx1) {
  5697. //>>excludeEnd("ctx");
  5698. var $1,$2,$3,$5,$6,$4,$8,$7;
  5699. self._nonIndexesDo_((function(each){
  5700. var collection;
  5701. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5702. return $core.withContext(function($ctx2) {
  5703. //>>excludeEnd("ctx");
  5704. collection=self._collection();
  5705. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5706. $ctx2.sendIdx["collection"]=1;
  5707. //>>excludeEnd("ctx");
  5708. collection;
  5709. self._should_raise_((function(){
  5710. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5711. return $core.withContext(function($ctx3) {
  5712. //>>excludeEnd("ctx");
  5713. return $recv(collection)._removeKey_(each);
  5714. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5715. $ctx3.sendIdx["removeKey:"]=1;
  5716. //>>excludeEnd("ctx");
  5717. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5718. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  5719. //>>excludeEnd("ctx");
  5720. }),$globals.Error);
  5721. $1=collection;
  5722. $2=self._collection();
  5723. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5724. $ctx2.sendIdx["collection"]=2;
  5725. //>>excludeEnd("ctx");
  5726. return self._assert_equals_($1,$2);
  5727. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5728. $ctx2.sendIdx["assert:equals:"]=1;
  5729. //>>excludeEnd("ctx");
  5730. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5731. }, function($ctx2) {$ctx2.fillBlock({each:each,collection:collection},$ctx1,1)});
  5732. //>>excludeEnd("ctx");
  5733. }));
  5734. self._samplesDo_((function(index,value){
  5735. var collection;
  5736. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5737. return $core.withContext(function($ctx2) {
  5738. //>>excludeEnd("ctx");
  5739. collection=self._collection();
  5740. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5741. $ctx2.sendIdx["collection"]=3;
  5742. //>>excludeEnd("ctx");
  5743. collection;
  5744. $3=$recv(collection)._removeKey_(index);
  5745. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5746. $ctx2.sendIdx["removeKey:"]=2;
  5747. //>>excludeEnd("ctx");
  5748. self._assert_equals_($3,value);
  5749. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5750. $ctx2.sendIdx["assert:equals:"]=2;
  5751. //>>excludeEnd("ctx");
  5752. $5=collection;
  5753. $6=self._collection();
  5754. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5755. $ctx2.sendIdx["collection"]=4;
  5756. //>>excludeEnd("ctx");
  5757. $4=$recv($5).__eq($6);
  5758. return self._deny_($4);
  5759. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5760. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value,collection:collection},$ctx1,3)});
  5761. //>>excludeEnd("ctx");
  5762. }));
  5763. $8=self._collectionWithNewValue();
  5764. $recv($8)._removeKey_(self._sampleNewIndex());
  5765. $7=$recv($8)._yourself();
  5766. self._assert_equals_($7,self._collection());
  5767. return self;
  5768. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5769. }, function($ctx1) {$ctx1.fill(self,"testRemoveKey",{},$globals.AssociativeCollectionTest)});
  5770. //>>excludeEnd("ctx");
  5771. },
  5772. //>>excludeStart("ide", pragmas.excludeIdeData);
  5773. args: [],
  5774. 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",
  5775. referencedClasses: ["Error"],
  5776. //>>excludeEnd("ide");
  5777. messageSends: ["nonIndexesDo:", "collection", "should:raise:", "removeKey:", "assert:equals:", "samplesDo:", "deny:", "=", "collectionWithNewValue", "sampleNewIndex", "yourself"]
  5778. }),
  5779. $globals.AssociativeCollectionTest);
  5780. $core.addMethod(
  5781. $core.method({
  5782. selector: "testRemoveKeyIfAbsent",
  5783. protocol: 'tests',
  5784. fn: function (){
  5785. var self=this;
  5786. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5787. return $core.withContext(function($ctx1) {
  5788. //>>excludeEnd("ctx");
  5789. var $1,$2,$3,$4,$5,$7,$8,$6,$10,$9;
  5790. self._nonIndexesDo_((function(each){
  5791. var collection;
  5792. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5793. return $core.withContext(function($ctx2) {
  5794. //>>excludeEnd("ctx");
  5795. collection=self._collection();
  5796. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5797. $ctx2.sendIdx["collection"]=1;
  5798. //>>excludeEnd("ctx");
  5799. collection;
  5800. $1=$recv(collection)._removeKey_ifAbsent_(each,(function(){
  5801. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5802. return $core.withContext(function($ctx3) {
  5803. //>>excludeEnd("ctx");
  5804. return self._sampleNewValue();
  5805. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5806. $ctx3.sendIdx["sampleNewValue"]=1;
  5807. //>>excludeEnd("ctx");
  5808. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5809. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  5810. //>>excludeEnd("ctx");
  5811. }));
  5812. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5813. $ctx2.sendIdx["removeKey:ifAbsent:"]=1;
  5814. //>>excludeEnd("ctx");
  5815. $2=self._sampleNewValue();
  5816. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5817. $ctx2.sendIdx["sampleNewValue"]=2;
  5818. //>>excludeEnd("ctx");
  5819. self._assert_equals_($1,$2);
  5820. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5821. $ctx2.sendIdx["assert:equals:"]=1;
  5822. //>>excludeEnd("ctx");
  5823. $3=collection;
  5824. $4=self._collection();
  5825. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5826. $ctx2.sendIdx["collection"]=2;
  5827. //>>excludeEnd("ctx");
  5828. return self._assert_equals_($3,$4);
  5829. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5830. $ctx2.sendIdx["assert:equals:"]=2;
  5831. //>>excludeEnd("ctx");
  5832. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5833. }, function($ctx2) {$ctx2.fillBlock({each:each,collection:collection},$ctx1,1)});
  5834. //>>excludeEnd("ctx");
  5835. }));
  5836. self._samplesDo_((function(index,value){
  5837. var collection;
  5838. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5839. return $core.withContext(function($ctx2) {
  5840. //>>excludeEnd("ctx");
  5841. collection=self._collection();
  5842. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5843. $ctx2.sendIdx["collection"]=3;
  5844. //>>excludeEnd("ctx");
  5845. collection;
  5846. $5=$recv(collection)._removeKey_ifAbsent_(index,(function(){
  5847. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5848. return $core.withContext(function($ctx3) {
  5849. //>>excludeEnd("ctx");
  5850. return self._sampleNewValue();
  5851. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5852. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,4)});
  5853. //>>excludeEnd("ctx");
  5854. }));
  5855. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5856. $ctx2.sendIdx["removeKey:ifAbsent:"]=2;
  5857. //>>excludeEnd("ctx");
  5858. self._assert_equals_($5,value);
  5859. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5860. $ctx2.sendIdx["assert:equals:"]=3;
  5861. //>>excludeEnd("ctx");
  5862. $7=collection;
  5863. $8=self._collection();
  5864. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5865. $ctx2.sendIdx["collection"]=4;
  5866. //>>excludeEnd("ctx");
  5867. $6=$recv($7).__eq($8);
  5868. return self._deny_($6);
  5869. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5870. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value,collection:collection},$ctx1,3)});
  5871. //>>excludeEnd("ctx");
  5872. }));
  5873. $10=self._collectionWithNewValue();
  5874. $recv($10)._removeKey_ifAbsent_(self._sampleNewIndex(),(function(){
  5875. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5876. return $core.withContext(function($ctx2) {
  5877. //>>excludeEnd("ctx");
  5878. return self._assert_(false);
  5879. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5880. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,5)});
  5881. //>>excludeEnd("ctx");
  5882. }));
  5883. $9=$recv($10)._yourself();
  5884. self._assert_equals_($9,self._collection());
  5885. return self;
  5886. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5887. }, function($ctx1) {$ctx1.fill(self,"testRemoveKeyIfAbsent",{},$globals.AssociativeCollectionTest)});
  5888. //>>excludeEnd("ctx");
  5889. },
  5890. //>>excludeStart("ide", pragmas.excludeIdeData);
  5891. args: [],
  5892. 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",
  5893. referencedClasses: [],
  5894. //>>excludeEnd("ide");
  5895. messageSends: ["nonIndexesDo:", "collection", "assert:equals:", "removeKey:ifAbsent:", "sampleNewValue", "samplesDo:", "deny:", "=", "collectionWithNewValue", "sampleNewIndex", "assert:", "yourself"]
  5896. }),
  5897. $globals.AssociativeCollectionTest);
  5898. $core.addMethod(
  5899. $core.method({
  5900. selector: "testValues",
  5901. protocol: 'tests',
  5902. fn: function (){
  5903. var self=this;
  5904. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5905. return $core.withContext(function($ctx1) {
  5906. //>>excludeEnd("ctx");
  5907. var $2,$1,$3,$4;
  5908. $2=$recv($recv(self._collectionClass())._new())._values();
  5909. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5910. $ctx1.sendIdx["values"]=1;
  5911. //>>excludeEnd("ctx");
  5912. $1=$recv($2)._isEmpty();
  5913. self._assert_($1);
  5914. $3=$recv(self._collection())._values();
  5915. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5916. $ctx1.sendIdx["values"]=2;
  5917. //>>excludeEnd("ctx");
  5918. $4=self._collectionValues();
  5919. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5920. $ctx1.sendIdx["collectionValues"]=1;
  5921. //>>excludeEnd("ctx");
  5922. self._assertSameContents_as_($3,$4);
  5923. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5924. $ctx1.sendIdx["assertSameContents:as:"]=1;
  5925. //>>excludeEnd("ctx");
  5926. self._assertSameContents_as_($recv(self._collectionWithNewValue())._values(),$recv(self._collectionValues()).__comma([self._sampleNewValue()]));
  5927. return self;
  5928. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5929. }, function($ctx1) {$ctx1.fill(self,"testValues",{},$globals.AssociativeCollectionTest)});
  5930. //>>excludeEnd("ctx");
  5931. },
  5932. //>>excludeStart("ide", pragmas.excludeIdeData);
  5933. args: [],
  5934. 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 }",
  5935. referencedClasses: [],
  5936. //>>excludeEnd("ide");
  5937. messageSends: ["assert:", "isEmpty", "values", "new", "collectionClass", "assertSameContents:as:", "collection", "collectionValues", "collectionWithNewValue", ",", "sampleNewValue"]
  5938. }),
  5939. $globals.AssociativeCollectionTest);
  5940. $core.addClass('DictionaryTest', $globals.AssociativeCollectionTest, [], 'Kernel-Tests');
  5941. $core.addMethod(
  5942. $core.method({
  5943. selector: "collection",
  5944. protocol: 'fixture',
  5945. fn: function (){
  5946. var self=this;
  5947. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5948. return $core.withContext(function($ctx1) {
  5949. //>>excludeEnd("ctx");
  5950. var $1;
  5951. $1=$recv($globals.Dictionary)._new();
  5952. $recv($1)._at_put_((1),(1));
  5953. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5954. $ctx1.sendIdx["at:put:"]=1;
  5955. //>>excludeEnd("ctx");
  5956. $recv($1)._at_put_("a",(2));
  5957. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5958. $ctx1.sendIdx["at:put:"]=2;
  5959. //>>excludeEnd("ctx");
  5960. $recv($1)._at_put_(true,(3));
  5961. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5962. $ctx1.sendIdx["at:put:"]=3;
  5963. //>>excludeEnd("ctx");
  5964. $recv($1)._at_put_((1).__at((3)),(-4));
  5965. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5966. $ctx1.sendIdx["at:put:"]=4;
  5967. //>>excludeEnd("ctx");
  5968. $recv($1)._at_put_(self["@sampleBlock"],(9));
  5969. return $recv($1)._yourself();
  5970. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5971. }, function($ctx1) {$ctx1.fill(self,"collection",{},$globals.DictionaryTest)});
  5972. //>>excludeEnd("ctx");
  5973. },
  5974. //>>excludeStart("ide", pragmas.excludeIdeData);
  5975. args: [],
  5976. 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",
  5977. referencedClasses: ["Dictionary"],
  5978. //>>excludeEnd("ide");
  5979. messageSends: ["at:put:", "new", "@", "yourself"]
  5980. }),
  5981. $globals.DictionaryTest);
  5982. $core.addMethod(
  5983. $core.method({
  5984. selector: "collectionKeys",
  5985. protocol: 'fixture',
  5986. fn: function (){
  5987. var self=this;
  5988. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5989. return $core.withContext(function($ctx1) {
  5990. //>>excludeEnd("ctx");
  5991. return [(1),"a",true,(1).__at((3)),self["@sampleBlock"]];
  5992. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5993. }, function($ctx1) {$ctx1.fill(self,"collectionKeys",{},$globals.DictionaryTest)});
  5994. //>>excludeEnd("ctx");
  5995. },
  5996. //>>excludeStart("ide", pragmas.excludeIdeData);
  5997. args: [],
  5998. source: "collectionKeys\x0a\x09^ {1. 'a'. true. 1@3. sampleBlock}",
  5999. referencedClasses: [],
  6000. //>>excludeEnd("ide");
  6001. messageSends: ["@"]
  6002. }),
  6003. $globals.DictionaryTest);
  6004. $core.addMethod(
  6005. $core.method({
  6006. selector: "collectionOfPrintStrings",
  6007. protocol: 'fixture',
  6008. fn: function (){
  6009. var self=this;
  6010. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6011. return $core.withContext(function($ctx1) {
  6012. //>>excludeEnd("ctx");
  6013. var $1;
  6014. $1=$recv($globals.Dictionary)._new();
  6015. $recv($1)._at_put_((1),"1");
  6016. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6017. $ctx1.sendIdx["at:put:"]=1;
  6018. //>>excludeEnd("ctx");
  6019. $recv($1)._at_put_("a","2");
  6020. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6021. $ctx1.sendIdx["at:put:"]=2;
  6022. //>>excludeEnd("ctx");
  6023. $recv($1)._at_put_(true,"3");
  6024. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6025. $ctx1.sendIdx["at:put:"]=3;
  6026. //>>excludeEnd("ctx");
  6027. $recv($1)._at_put_((1).__at((3)),"-4");
  6028. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6029. $ctx1.sendIdx["at:put:"]=4;
  6030. //>>excludeEnd("ctx");
  6031. $recv($1)._at_put_(self["@sampleBlock"],"9");
  6032. return $recv($1)._yourself();
  6033. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6034. }, function($ctx1) {$ctx1.fill(self,"collectionOfPrintStrings",{},$globals.DictionaryTest)});
  6035. //>>excludeEnd("ctx");
  6036. },
  6037. //>>excludeStart("ide", pragmas.excludeIdeData);
  6038. args: [],
  6039. 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",
  6040. referencedClasses: ["Dictionary"],
  6041. //>>excludeEnd("ide");
  6042. messageSends: ["at:put:", "new", "@", "yourself"]
  6043. }),
  6044. $globals.DictionaryTest);
  6045. $core.addMethod(
  6046. $core.method({
  6047. selector: "collectionSize",
  6048. protocol: 'fixture',
  6049. fn: function (){
  6050. var self=this;
  6051. return (5);
  6052. },
  6053. //>>excludeStart("ide", pragmas.excludeIdeData);
  6054. args: [],
  6055. source: "collectionSize\x0a\x09^ 5",
  6056. referencedClasses: [],
  6057. //>>excludeEnd("ide");
  6058. messageSends: []
  6059. }),
  6060. $globals.DictionaryTest);
  6061. $core.addMethod(
  6062. $core.method({
  6063. selector: "collectionValues",
  6064. protocol: 'fixture',
  6065. fn: function (){
  6066. var self=this;
  6067. return [(1),(2),(3),(-4),(9)];
  6068. },
  6069. //>>excludeStart("ide", pragmas.excludeIdeData);
  6070. args: [],
  6071. source: "collectionValues\x0a\x09^ {1. 2. 3. -4. 9}",
  6072. referencedClasses: [],
  6073. //>>excludeEnd("ide");
  6074. messageSends: []
  6075. }),
  6076. $globals.DictionaryTest);
  6077. $core.addMethod(
  6078. $core.method({
  6079. selector: "collectionWithDuplicates",
  6080. protocol: 'fixture',
  6081. fn: function (){
  6082. var self=this;
  6083. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6084. return $core.withContext(function($ctx1) {
  6085. //>>excludeEnd("ctx");
  6086. var $1;
  6087. $1=$recv($globals.Dictionary)._new();
  6088. $recv($1)._at_put_((1),(1));
  6089. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6090. $ctx1.sendIdx["at:put:"]=1;
  6091. //>>excludeEnd("ctx");
  6092. $recv($1)._at_put_("a",(2));
  6093. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6094. $ctx1.sendIdx["at:put:"]=2;
  6095. //>>excludeEnd("ctx");
  6096. $recv($1)._at_put_(true,(3));
  6097. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6098. $ctx1.sendIdx["at:put:"]=3;
  6099. //>>excludeEnd("ctx");
  6100. $recv($1)._at_put_((4),(-4));
  6101. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6102. $ctx1.sendIdx["at:put:"]=4;
  6103. //>>excludeEnd("ctx");
  6104. $recv($1)._at_put_(self["@sampleBlock"],(9));
  6105. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6106. $ctx1.sendIdx["at:put:"]=5;
  6107. //>>excludeEnd("ctx");
  6108. $recv($1)._at_put_("b",(1));
  6109. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6110. $ctx1.sendIdx["at:put:"]=6;
  6111. //>>excludeEnd("ctx");
  6112. $recv($1)._at_put_((3),(3));
  6113. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6114. $ctx1.sendIdx["at:put:"]=7;
  6115. //>>excludeEnd("ctx");
  6116. $recv($1)._at_put_(false,(12));
  6117. return $recv($1)._yourself();
  6118. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6119. }, function($ctx1) {$ctx1.fill(self,"collectionWithDuplicates",{},$globals.DictionaryTest)});
  6120. //>>excludeEnd("ctx");
  6121. },
  6122. //>>excludeStart("ide", pragmas.excludeIdeData);
  6123. args: [],
  6124. 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",
  6125. referencedClasses: ["Dictionary"],
  6126. //>>excludeEnd("ide");
  6127. messageSends: ["at:put:", "new", "yourself"]
  6128. }),
  6129. $globals.DictionaryTest);
  6130. $core.addMethod(
  6131. $core.method({
  6132. selector: "collectionWithNewValue",
  6133. protocol: 'fixture',
  6134. fn: function (){
  6135. var self=this;
  6136. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6137. return $core.withContext(function($ctx1) {
  6138. //>>excludeEnd("ctx");
  6139. var $1;
  6140. $1=$recv($globals.Dictionary)._new();
  6141. $recv($1)._at_put_((1),(1));
  6142. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6143. $ctx1.sendIdx["at:put:"]=1;
  6144. //>>excludeEnd("ctx");
  6145. $recv($1)._at_put_("a",(2));
  6146. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6147. $ctx1.sendIdx["at:put:"]=2;
  6148. //>>excludeEnd("ctx");
  6149. $recv($1)._at_put_(true,(3));
  6150. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6151. $ctx1.sendIdx["at:put:"]=3;
  6152. //>>excludeEnd("ctx");
  6153. $recv($1)._at_put_((1).__at((3)),(-4));
  6154. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6155. $ctx1.sendIdx["at:put:"]=4;
  6156. //>>excludeEnd("ctx");
  6157. $recv($1)._at_put_(self["@sampleBlock"],(9));
  6158. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6159. $ctx1.sendIdx["at:put:"]=5;
  6160. //>>excludeEnd("ctx");
  6161. $recv($1)._at_put_("new","N");
  6162. return $recv($1)._yourself();
  6163. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6164. }, function($ctx1) {$ctx1.fill(self,"collectionWithNewValue",{},$globals.DictionaryTest)});
  6165. //>>excludeEnd("ctx");
  6166. },
  6167. //>>excludeStart("ide", pragmas.excludeIdeData);
  6168. args: [],
  6169. 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",
  6170. referencedClasses: ["Dictionary"],
  6171. //>>excludeEnd("ide");
  6172. messageSends: ["at:put:", "new", "@", "yourself"]
  6173. }),
  6174. $globals.DictionaryTest);
  6175. $core.addMethod(
  6176. $core.method({
  6177. selector: "sampleNewValueAsCollection",
  6178. protocol: 'fixture',
  6179. fn: function (){
  6180. var self=this;
  6181. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6182. return $core.withContext(function($ctx1) {
  6183. //>>excludeEnd("ctx");
  6184. var $1;
  6185. $1=$recv($globals.Dictionary)._new();
  6186. $recv($1)._at_put_("new","N");
  6187. return $recv($1)._yourself();
  6188. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6189. }, function($ctx1) {$ctx1.fill(self,"sampleNewValueAsCollection",{},$globals.DictionaryTest)});
  6190. //>>excludeEnd("ctx");
  6191. },
  6192. //>>excludeStart("ide", pragmas.excludeIdeData);
  6193. args: [],
  6194. source: "sampleNewValueAsCollection\x0a\x09^ Dictionary new\x0a\x09\x09at: 'new' put: 'N';\x0a\x09\x09yourself",
  6195. referencedClasses: ["Dictionary"],
  6196. //>>excludeEnd("ide");
  6197. messageSends: ["at:put:", "new", "yourself"]
  6198. }),
  6199. $globals.DictionaryTest);
  6200. $core.addMethod(
  6201. $core.method({
  6202. selector: "samplesDo:",
  6203. protocol: 'fixture',
  6204. fn: function (aBlock){
  6205. var self=this;
  6206. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6207. return $core.withContext(function($ctx1) {
  6208. //>>excludeEnd("ctx");
  6209. (
  6210. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6211. $ctx1.supercall = true,
  6212. //>>excludeEnd("ctx");
  6213. ($globals.DictionaryTest.superclass||$boot.nilAsClass).fn.prototype._samplesDo_.apply($recv(self), [aBlock]));
  6214. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6215. $ctx1.supercall = false;
  6216. //>>excludeEnd("ctx");;
  6217. $recv(aBlock)._value_value_(true,(3));
  6218. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6219. $ctx1.sendIdx["value:value:"]=1;
  6220. //>>excludeEnd("ctx");
  6221. $recv(aBlock)._value_value_((1).__at((3)),(-4));
  6222. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6223. $ctx1.sendIdx["value:value:"]=2;
  6224. //>>excludeEnd("ctx");
  6225. $recv(aBlock)._value_value_(self["@sampleBlock"],(9));
  6226. return self;
  6227. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6228. }, function($ctx1) {$ctx1.fill(self,"samplesDo:",{aBlock:aBlock},$globals.DictionaryTest)});
  6229. //>>excludeEnd("ctx");
  6230. },
  6231. //>>excludeStart("ide", pragmas.excludeIdeData);
  6232. args: ["aBlock"],
  6233. 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",
  6234. referencedClasses: [],
  6235. //>>excludeEnd("ide");
  6236. messageSends: ["samplesDo:", "value:value:", "@"]
  6237. }),
  6238. $globals.DictionaryTest);
  6239. $core.addMethod(
  6240. $core.method({
  6241. selector: "testAccessing",
  6242. protocol: 'tests',
  6243. fn: function (){
  6244. var self=this;
  6245. var d;
  6246. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6247. return $core.withContext(function($ctx1) {
  6248. //>>excludeEnd("ctx");
  6249. var $1,$2,$3,$4,$5,$6,$7,$9,$10,$8,$12,$13,$11;
  6250. d=$recv($globals.Dictionary)._new();
  6251. $recv(d)._at_put_("hello","world");
  6252. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6253. $ctx1.sendIdx["at:put:"]=1;
  6254. //>>excludeEnd("ctx");
  6255. $1=$recv(d)._at_("hello");
  6256. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6257. $ctx1.sendIdx["at:"]=1;
  6258. //>>excludeEnd("ctx");
  6259. self._assert_equals_($1,"world");
  6260. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6261. $ctx1.sendIdx["assert:equals:"]=1;
  6262. //>>excludeEnd("ctx");
  6263. $2=$recv(d)._at_ifAbsent_("hello",(function(){
  6264. return nil;
  6265. }));
  6266. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6267. $ctx1.sendIdx["at:ifAbsent:"]=1;
  6268. //>>excludeEnd("ctx");
  6269. self._assert_equals_($2,"world");
  6270. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6271. $ctx1.sendIdx["assert:equals:"]=2;
  6272. //>>excludeEnd("ctx");
  6273. self._deny_($recv($recv(d)._at_ifAbsent_("foo",(function(){
  6274. return nil;
  6275. }))).__eq("world"));
  6276. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6277. $ctx1.sendIdx["deny:"]=1;
  6278. //>>excludeEnd("ctx");
  6279. $3=$recv(d)._includesKey_("hello");
  6280. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6281. $ctx1.sendIdx["includesKey:"]=1;
  6282. //>>excludeEnd("ctx");
  6283. self._assert_($3);
  6284. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6285. $ctx1.sendIdx["assert:"]=1;
  6286. //>>excludeEnd("ctx");
  6287. $4=$recv(d)._includesKey_("foo");
  6288. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6289. $ctx1.sendIdx["includesKey:"]=2;
  6290. //>>excludeEnd("ctx");
  6291. self._deny_($4);
  6292. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6293. $ctx1.sendIdx["deny:"]=2;
  6294. //>>excludeEnd("ctx");
  6295. $recv(d)._at_put_((1),(2));
  6296. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6297. $ctx1.sendIdx["at:put:"]=2;
  6298. //>>excludeEnd("ctx");
  6299. $5=$recv(d)._at_((1));
  6300. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6301. $ctx1.sendIdx["at:"]=2;
  6302. //>>excludeEnd("ctx");
  6303. self._assert_equals_($5,(2));
  6304. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6305. $ctx1.sendIdx["assert:equals:"]=3;
  6306. //>>excludeEnd("ctx");
  6307. $6=d;
  6308. $7=(1).__at((3));
  6309. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6310. $ctx1.sendIdx["@"]=1;
  6311. //>>excludeEnd("ctx");
  6312. $recv($6)._at_put_($7,(3));
  6313. $9=d;
  6314. $10=(1).__at((3));
  6315. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6316. $ctx1.sendIdx["@"]=2;
  6317. //>>excludeEnd("ctx");
  6318. $8=$recv($9)._at_($10);
  6319. self._assert_equals_($8,(3));
  6320. $12=d;
  6321. $13=(1).__at((3));
  6322. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6323. $ctx1.sendIdx["@"]=3;
  6324. //>>excludeEnd("ctx");
  6325. $11=$recv($12)._includesKey_($13);
  6326. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6327. $ctx1.sendIdx["includesKey:"]=3;
  6328. //>>excludeEnd("ctx");
  6329. self._assert_($11);
  6330. self._deny_($recv(d)._includesKey_((3).__at((1))));
  6331. return self;
  6332. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6333. }, function($ctx1) {$ctx1.fill(self,"testAccessing",{d:d},$globals.DictionaryTest)});
  6334. //>>excludeEnd("ctx");
  6335. },
  6336. //>>excludeStart("ide", pragmas.excludeIdeData);
  6337. args: [],
  6338. 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)",
  6339. referencedClasses: ["Dictionary"],
  6340. //>>excludeEnd("ide");
  6341. messageSends: ["new", "at:put:", "assert:equals:", "at:", "at:ifAbsent:", "deny:", "=", "assert:", "includesKey:", "@"]
  6342. }),
  6343. $globals.DictionaryTest);
  6344. $core.addMethod(
  6345. $core.method({
  6346. selector: "testDynamicDictionaries",
  6347. protocol: 'tests',
  6348. fn: function (){
  6349. var self=this;
  6350. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6351. return $core.withContext(function($ctx1) {
  6352. //>>excludeEnd("ctx");
  6353. self._assert_equals_($recv($globals.HashedCollection._newFromPairs_(["hello",(1)]))._asDictionary(),$recv($globals.Dictionary)._with_("hello".__minus_gt((1))));
  6354. return self;
  6355. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6356. }, function($ctx1) {$ctx1.fill(self,"testDynamicDictionaries",{},$globals.DictionaryTest)});
  6357. //>>excludeEnd("ctx");
  6358. },
  6359. //>>excludeStart("ide", pragmas.excludeIdeData);
  6360. args: [],
  6361. source: "testDynamicDictionaries\x0a\x09self assert: #{'hello' -> 1} asDictionary equals: (Dictionary with: 'hello' -> 1)",
  6362. referencedClasses: ["Dictionary"],
  6363. //>>excludeEnd("ide");
  6364. messageSends: ["assert:equals:", "asDictionary", "with:", "->"]
  6365. }),
  6366. $globals.DictionaryTest);
  6367. $core.addMethod(
  6368. $core.method({
  6369. selector: "collectionClass",
  6370. protocol: 'fixture',
  6371. fn: function (){
  6372. var self=this;
  6373. return $globals.Dictionary;
  6374. },
  6375. //>>excludeStart("ide", pragmas.excludeIdeData);
  6376. args: [],
  6377. source: "collectionClass\x0a\x09^ Dictionary",
  6378. referencedClasses: ["Dictionary"],
  6379. //>>excludeEnd("ide");
  6380. messageSends: []
  6381. }),
  6382. $globals.DictionaryTest.klass);
  6383. $core.addClass('HashedCollectionTest', $globals.AssociativeCollectionTest, [], 'Kernel-Tests');
  6384. $core.addMethod(
  6385. $core.method({
  6386. selector: "collection",
  6387. protocol: 'fixture',
  6388. fn: function (){
  6389. var self=this;
  6390. return $globals.HashedCollection._newFromPairs_(["b",(1),"a",(2),"c",(3),"d",(-4)]);
  6391. },
  6392. //>>excludeStart("ide", pragmas.excludeIdeData);
  6393. args: [],
  6394. source: "collection\x0a\x09^ #{ 'b' -> 1. 'a' -> 2. 'c' -> 3. 'd' -> -4 }",
  6395. referencedClasses: [],
  6396. //>>excludeEnd("ide");
  6397. messageSends: []
  6398. }),
  6399. $globals.HashedCollectionTest);
  6400. $core.addMethod(
  6401. $core.method({
  6402. selector: "collectionKeys",
  6403. protocol: 'fixture',
  6404. fn: function (){
  6405. var self=this;
  6406. return ["b","a","c","d"];
  6407. },
  6408. //>>excludeStart("ide", pragmas.excludeIdeData);
  6409. args: [],
  6410. source: "collectionKeys\x0a\x09^ { 'b'. 'a'. 'c'. 'd' }",
  6411. referencedClasses: [],
  6412. //>>excludeEnd("ide");
  6413. messageSends: []
  6414. }),
  6415. $globals.HashedCollectionTest);
  6416. $core.addMethod(
  6417. $core.method({
  6418. selector: "collectionOfPrintStrings",
  6419. protocol: 'fixture',
  6420. fn: function (){
  6421. var self=this;
  6422. return $globals.HashedCollection._newFromPairs_(["b","1","a","2","c","3","d","-4"]);
  6423. },
  6424. //>>excludeStart("ide", pragmas.excludeIdeData);
  6425. args: [],
  6426. source: "collectionOfPrintStrings\x0a\x09^ #{ 'b' -> '1'. 'a' -> '2'. 'c' -> '3'. 'd' -> '-4' }",
  6427. referencedClasses: [],
  6428. //>>excludeEnd("ide");
  6429. messageSends: []
  6430. }),
  6431. $globals.HashedCollectionTest);
  6432. $core.addMethod(
  6433. $core.method({
  6434. selector: "collectionSize",
  6435. protocol: 'fixture',
  6436. fn: function (){
  6437. var self=this;
  6438. return (4);
  6439. },
  6440. //>>excludeStart("ide", pragmas.excludeIdeData);
  6441. args: [],
  6442. source: "collectionSize\x0a\x09^ 4",
  6443. referencedClasses: [],
  6444. //>>excludeEnd("ide");
  6445. messageSends: []
  6446. }),
  6447. $globals.HashedCollectionTest);
  6448. $core.addMethod(
  6449. $core.method({
  6450. selector: "collectionValues",
  6451. protocol: 'fixture',
  6452. fn: function (){
  6453. var self=this;
  6454. return [(1),(2),(3),(-4)];
  6455. },
  6456. //>>excludeStart("ide", pragmas.excludeIdeData);
  6457. args: [],
  6458. source: "collectionValues\x0a\x09^ { 1. 2. 3. -4 }",
  6459. referencedClasses: [],
  6460. //>>excludeEnd("ide");
  6461. messageSends: []
  6462. }),
  6463. $globals.HashedCollectionTest);
  6464. $core.addMethod(
  6465. $core.method({
  6466. selector: "collectionWithDuplicates",
  6467. protocol: 'fixture',
  6468. fn: function (){
  6469. var self=this;
  6470. return $globals.HashedCollection._newFromPairs_(["b",(1),"a",(2),"c",(3),"d",(-4),"e",(1),"f",(2),"g",(10),"h",(0)]);
  6471. },
  6472. //>>excludeStart("ide", pragmas.excludeIdeData);
  6473. args: [],
  6474. source: "collectionWithDuplicates\x0a\x09^ #{ 'b' -> 1. 'a' -> 2. 'c' -> 3. 'd' -> -4. 'e' -> 1. 'f' -> 2. 'g' -> 10. 'h' -> 0 }",
  6475. referencedClasses: [],
  6476. //>>excludeEnd("ide");
  6477. messageSends: []
  6478. }),
  6479. $globals.HashedCollectionTest);
  6480. $core.addMethod(
  6481. $core.method({
  6482. selector: "collectionWithNewValue",
  6483. protocol: 'fixture',
  6484. fn: function (){
  6485. var self=this;
  6486. return $globals.HashedCollection._newFromPairs_(["b",(1),"a",(2),"c",(3),"d",(-4),"new","N"]);
  6487. },
  6488. //>>excludeStart("ide", pragmas.excludeIdeData);
  6489. args: [],
  6490. source: "collectionWithNewValue\x0a\x09^ #{ 'b' -> 1. 'a' -> 2. 'c' -> 3. 'd' -> -4. 'new' -> 'N' }",
  6491. referencedClasses: [],
  6492. //>>excludeEnd("ide");
  6493. messageSends: []
  6494. }),
  6495. $globals.HashedCollectionTest);
  6496. $core.addMethod(
  6497. $core.method({
  6498. selector: "sampleNewValueAsCollection",
  6499. protocol: 'fixture',
  6500. fn: function (){
  6501. var self=this;
  6502. return $globals.HashedCollection._newFromPairs_(["new","N"]);
  6503. },
  6504. //>>excludeStart("ide", pragmas.excludeIdeData);
  6505. args: [],
  6506. source: "sampleNewValueAsCollection\x0a\x09^ #{ 'new' -> 'N' }",
  6507. referencedClasses: [],
  6508. //>>excludeEnd("ide");
  6509. messageSends: []
  6510. }),
  6511. $globals.HashedCollectionTest);
  6512. $core.addMethod(
  6513. $core.method({
  6514. selector: "testDynamicDictionaries",
  6515. protocol: 'tests',
  6516. fn: function (){
  6517. var self=this;
  6518. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6519. return $core.withContext(function($ctx1) {
  6520. //>>excludeEnd("ctx");
  6521. self._assert_equals_($recv($globals.HashedCollection._newFromPairs_(["hello",(1)]))._asHashedCollection(),$recv($globals.HashedCollection)._with_("hello".__minus_gt((1))));
  6522. return self;
  6523. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6524. }, function($ctx1) {$ctx1.fill(self,"testDynamicDictionaries",{},$globals.HashedCollectionTest)});
  6525. //>>excludeEnd("ctx");
  6526. },
  6527. //>>excludeStart("ide", pragmas.excludeIdeData);
  6528. args: [],
  6529. source: "testDynamicDictionaries\x0a\x09self assert: #{'hello' -> 1} asHashedCollection equals: (HashedCollection with: 'hello' -> 1)",
  6530. referencedClasses: ["HashedCollection"],
  6531. //>>excludeEnd("ide");
  6532. messageSends: ["assert:equals:", "asHashedCollection", "with:", "->"]
  6533. }),
  6534. $globals.HashedCollectionTest);
  6535. $core.addMethod(
  6536. $core.method({
  6537. selector: "collectionClass",
  6538. protocol: 'fixture',
  6539. fn: function (){
  6540. var self=this;
  6541. return $globals.HashedCollection;
  6542. },
  6543. //>>excludeStart("ide", pragmas.excludeIdeData);
  6544. args: [],
  6545. source: "collectionClass\x0a\x09^ HashedCollection",
  6546. referencedClasses: ["HashedCollection"],
  6547. //>>excludeEnd("ide");
  6548. messageSends: []
  6549. }),
  6550. $globals.HashedCollectionTest.klass);
  6551. $core.addClass('SequenceableCollectionTest', $globals.IndexableCollectionTest, [], 'Kernel-Tests');
  6552. $core.addMethod(
  6553. $core.method({
  6554. selector: "collectionFirst",
  6555. protocol: 'fixture',
  6556. fn: function (){
  6557. var self=this;
  6558. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6559. return $core.withContext(function($ctx1) {
  6560. //>>excludeEnd("ctx");
  6561. self._subclassResponsibility();
  6562. return self;
  6563. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6564. }, function($ctx1) {$ctx1.fill(self,"collectionFirst",{},$globals.SequenceableCollectionTest)});
  6565. //>>excludeEnd("ctx");
  6566. },
  6567. //>>excludeStart("ide", pragmas.excludeIdeData);
  6568. args: [],
  6569. source: "collectionFirst\x0a\x09self subclassResponsibility",
  6570. referencedClasses: [],
  6571. //>>excludeEnd("ide");
  6572. messageSends: ["subclassResponsibility"]
  6573. }),
  6574. $globals.SequenceableCollectionTest);
  6575. $core.addMethod(
  6576. $core.method({
  6577. selector: "collectionFirstTwo",
  6578. protocol: 'fixture',
  6579. fn: function (){
  6580. var self=this;
  6581. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6582. return $core.withContext(function($ctx1) {
  6583. //>>excludeEnd("ctx");
  6584. self._subclassResponsibility();
  6585. return self;
  6586. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6587. }, function($ctx1) {$ctx1.fill(self,"collectionFirstTwo",{},$globals.SequenceableCollectionTest)});
  6588. //>>excludeEnd("ctx");
  6589. },
  6590. //>>excludeStart("ide", pragmas.excludeIdeData);
  6591. args: [],
  6592. source: "collectionFirstTwo\x0a\x09self subclassResponsibility",
  6593. referencedClasses: [],
  6594. //>>excludeEnd("ide");
  6595. messageSends: ["subclassResponsibility"]
  6596. }),
  6597. $globals.SequenceableCollectionTest);
  6598. $core.addMethod(
  6599. $core.method({
  6600. selector: "collectionLast",
  6601. protocol: 'fixture',
  6602. fn: function (){
  6603. var self=this;
  6604. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6605. return $core.withContext(function($ctx1) {
  6606. //>>excludeEnd("ctx");
  6607. self._subclassResponsibility();
  6608. return self;
  6609. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6610. }, function($ctx1) {$ctx1.fill(self,"collectionLast",{},$globals.SequenceableCollectionTest)});
  6611. //>>excludeEnd("ctx");
  6612. },
  6613. //>>excludeStart("ide", pragmas.excludeIdeData);
  6614. args: [],
  6615. source: "collectionLast\x0a\x09self subclassResponsibility",
  6616. referencedClasses: [],
  6617. //>>excludeEnd("ide");
  6618. messageSends: ["subclassResponsibility"]
  6619. }),
  6620. $globals.SequenceableCollectionTest);
  6621. $core.addMethod(
  6622. $core.method({
  6623. selector: "collectionLastTwo",
  6624. protocol: 'fixture',
  6625. fn: function (){
  6626. var self=this;
  6627. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6628. return $core.withContext(function($ctx1) {
  6629. //>>excludeEnd("ctx");
  6630. self._subclassResponsibility();
  6631. return self;
  6632. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6633. }, function($ctx1) {$ctx1.fill(self,"collectionLastTwo",{},$globals.SequenceableCollectionTest)});
  6634. //>>excludeEnd("ctx");
  6635. },
  6636. //>>excludeStart("ide", pragmas.excludeIdeData);
  6637. args: [],
  6638. source: "collectionLastTwo\x0a\x09self subclassResponsibility",
  6639. referencedClasses: [],
  6640. //>>excludeEnd("ide");
  6641. messageSends: ["subclassResponsibility"]
  6642. }),
  6643. $globals.SequenceableCollectionTest);
  6644. $core.addMethod(
  6645. $core.method({
  6646. selector: "nonIndexesDo:",
  6647. protocol: 'fixture',
  6648. fn: function (aBlock){
  6649. var self=this;
  6650. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6651. return $core.withContext(function($ctx1) {
  6652. //>>excludeEnd("ctx");
  6653. $recv(aBlock)._value_((0));
  6654. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6655. $ctx1.sendIdx["value:"]=1;
  6656. //>>excludeEnd("ctx");
  6657. $recv(aBlock)._value_($recv(self._collectionSize()).__plus((1)));
  6658. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6659. $ctx1.sendIdx["value:"]=2;
  6660. //>>excludeEnd("ctx");
  6661. $recv(aBlock)._value_("z");
  6662. return self;
  6663. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6664. }, function($ctx1) {$ctx1.fill(self,"nonIndexesDo:",{aBlock:aBlock},$globals.SequenceableCollectionTest)});
  6665. //>>excludeEnd("ctx");
  6666. },
  6667. //>>excludeStart("ide", pragmas.excludeIdeData);
  6668. args: ["aBlock"],
  6669. source: "nonIndexesDo: aBlock\x0a\x09aBlock value: 0.\x0a\x09aBlock value: self collectionSize + 1.\x0a\x09aBlock value: 'z'",
  6670. referencedClasses: [],
  6671. //>>excludeEnd("ide");
  6672. messageSends: ["value:", "+", "collectionSize"]
  6673. }),
  6674. $globals.SequenceableCollectionTest);
  6675. $core.addMethod(
  6676. $core.method({
  6677. selector: "samplesDo:",
  6678. protocol: 'fixture',
  6679. fn: function (aBlock){
  6680. var self=this;
  6681. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6682. return $core.withContext(function($ctx1) {
  6683. //>>excludeEnd("ctx");
  6684. $recv(aBlock)._value_value_((1),self._collectionFirst());
  6685. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6686. $ctx1.sendIdx["value:value:"]=1;
  6687. //>>excludeEnd("ctx");
  6688. $recv(aBlock)._value_value_(self._collectionSize(),self._collectionLast());
  6689. return self;
  6690. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6691. }, function($ctx1) {$ctx1.fill(self,"samplesDo:",{aBlock:aBlock},$globals.SequenceableCollectionTest)});
  6692. //>>excludeEnd("ctx");
  6693. },
  6694. //>>excludeStart("ide", pragmas.excludeIdeData);
  6695. args: ["aBlock"],
  6696. source: "samplesDo: aBlock\x0a\x09aBlock value: 1 value: self collectionFirst.\x0a\x09aBlock value: self collectionSize value: self collectionLast",
  6697. referencedClasses: [],
  6698. //>>excludeEnd("ide");
  6699. messageSends: ["value:value:", "collectionFirst", "collectionSize", "collectionLast"]
  6700. }),
  6701. $globals.SequenceableCollectionTest);
  6702. $core.addMethod(
  6703. $core.method({
  6704. selector: "testBeginsWith",
  6705. protocol: 'tests',
  6706. fn: function (){
  6707. var self=this;
  6708. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6709. return $core.withContext(function($ctx1) {
  6710. //>>excludeEnd("ctx");
  6711. var $2,$1,$4,$5,$3,$7,$6;
  6712. $2=self._collection();
  6713. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6714. $ctx1.sendIdx["collection"]=1;
  6715. //>>excludeEnd("ctx");
  6716. $1=$recv($2)._beginsWith_($recv(self._collectionClass())._new());
  6717. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6718. $ctx1.sendIdx["beginsWith:"]=1;
  6719. //>>excludeEnd("ctx");
  6720. self._assert_($1);
  6721. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6722. $ctx1.sendIdx["assert:"]=1;
  6723. //>>excludeEnd("ctx");
  6724. $4=self._collection();
  6725. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6726. $ctx1.sendIdx["collection"]=2;
  6727. //>>excludeEnd("ctx");
  6728. $5=self._collection();
  6729. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6730. $ctx1.sendIdx["collection"]=3;
  6731. //>>excludeEnd("ctx");
  6732. $3=$recv($4)._beginsWith_($5);
  6733. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6734. $ctx1.sendIdx["beginsWith:"]=2;
  6735. //>>excludeEnd("ctx");
  6736. self._assert_($3);
  6737. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6738. $ctx1.sendIdx["assert:"]=2;
  6739. //>>excludeEnd("ctx");
  6740. $7=self._collection();
  6741. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6742. $ctx1.sendIdx["collection"]=4;
  6743. //>>excludeEnd("ctx");
  6744. $6=$recv($7)._beginsWith_(self._collectionFirstTwo());
  6745. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6746. $ctx1.sendIdx["beginsWith:"]=3;
  6747. //>>excludeEnd("ctx");
  6748. self._assert_($6);
  6749. self._deny_($recv(self._collection())._beginsWith_(self._collectionLastTwo()));
  6750. return self;
  6751. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6752. }, function($ctx1) {$ctx1.fill(self,"testBeginsWith",{},$globals.SequenceableCollectionTest)});
  6753. //>>excludeEnd("ctx");
  6754. },
  6755. //>>excludeStart("ide", pragmas.excludeIdeData);
  6756. args: [],
  6757. 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)",
  6758. referencedClasses: [],
  6759. //>>excludeEnd("ide");
  6760. messageSends: ["assert:", "beginsWith:", "collection", "new", "collectionClass", "collectionFirstTwo", "deny:", "collectionLastTwo"]
  6761. }),
  6762. $globals.SequenceableCollectionTest);
  6763. $core.addMethod(
  6764. $core.method({
  6765. selector: "testEndsWith",
  6766. protocol: 'tests',
  6767. fn: function (){
  6768. var self=this;
  6769. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6770. return $core.withContext(function($ctx1) {
  6771. //>>excludeEnd("ctx");
  6772. var $2,$1,$4,$5,$3,$7,$6;
  6773. $2=self._collection();
  6774. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6775. $ctx1.sendIdx["collection"]=1;
  6776. //>>excludeEnd("ctx");
  6777. $1=$recv($2)._endsWith_($recv(self._collectionClass())._new());
  6778. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6779. $ctx1.sendIdx["endsWith:"]=1;
  6780. //>>excludeEnd("ctx");
  6781. self._assert_($1);
  6782. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6783. $ctx1.sendIdx["assert:"]=1;
  6784. //>>excludeEnd("ctx");
  6785. $4=self._collection();
  6786. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6787. $ctx1.sendIdx["collection"]=2;
  6788. //>>excludeEnd("ctx");
  6789. $5=self._collection();
  6790. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6791. $ctx1.sendIdx["collection"]=3;
  6792. //>>excludeEnd("ctx");
  6793. $3=$recv($4)._endsWith_($5);
  6794. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6795. $ctx1.sendIdx["endsWith:"]=2;
  6796. //>>excludeEnd("ctx");
  6797. self._assert_($3);
  6798. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6799. $ctx1.sendIdx["assert:"]=2;
  6800. //>>excludeEnd("ctx");
  6801. $7=self._collection();
  6802. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6803. $ctx1.sendIdx["collection"]=4;
  6804. //>>excludeEnd("ctx");
  6805. $6=$recv($7)._endsWith_(self._collectionLastTwo());
  6806. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6807. $ctx1.sendIdx["endsWith:"]=3;
  6808. //>>excludeEnd("ctx");
  6809. self._assert_($6);
  6810. self._deny_($recv(self._collection())._endsWith_(self._collectionFirstTwo()));
  6811. return self;
  6812. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6813. }, function($ctx1) {$ctx1.fill(self,"testEndsWith",{},$globals.SequenceableCollectionTest)});
  6814. //>>excludeEnd("ctx");
  6815. },
  6816. //>>excludeStart("ide", pragmas.excludeIdeData);
  6817. args: [],
  6818. 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)",
  6819. referencedClasses: [],
  6820. //>>excludeEnd("ide");
  6821. messageSends: ["assert:", "endsWith:", "collection", "new", "collectionClass", "collectionLastTwo", "deny:", "collectionFirstTwo"]
  6822. }),
  6823. $globals.SequenceableCollectionTest);
  6824. $core.addMethod(
  6825. $core.method({
  6826. selector: "testFirst",
  6827. protocol: 'tests',
  6828. fn: function (){
  6829. var self=this;
  6830. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6831. return $core.withContext(function($ctx1) {
  6832. //>>excludeEnd("ctx");
  6833. self._assert_equals_($recv(self._collection())._first(),self._collectionFirst());
  6834. return self;
  6835. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6836. }, function($ctx1) {$ctx1.fill(self,"testFirst",{},$globals.SequenceableCollectionTest)});
  6837. //>>excludeEnd("ctx");
  6838. },
  6839. //>>excludeStart("ide", pragmas.excludeIdeData);
  6840. args: [],
  6841. source: "testFirst\x0a\x09self assert: self collection first equals: self collectionFirst",
  6842. referencedClasses: [],
  6843. //>>excludeEnd("ide");
  6844. messageSends: ["assert:equals:", "first", "collection", "collectionFirst"]
  6845. }),
  6846. $globals.SequenceableCollectionTest);
  6847. $core.addMethod(
  6848. $core.method({
  6849. selector: "testFirstN",
  6850. protocol: 'tests',
  6851. fn: function (){
  6852. var self=this;
  6853. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6854. return $core.withContext(function($ctx1) {
  6855. //>>excludeEnd("ctx");
  6856. var $2,$1,$4,$3,$6,$5,$7;
  6857. $2=self._collection();
  6858. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6859. $ctx1.sendIdx["collection"]=1;
  6860. //>>excludeEnd("ctx");
  6861. $1=$recv($2)._first_((2));
  6862. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6863. $ctx1.sendIdx["first:"]=1;
  6864. //>>excludeEnd("ctx");
  6865. self._assert_equals_($1,self._collectionFirstTwo());
  6866. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6867. $ctx1.sendIdx["assert:equals:"]=1;
  6868. //>>excludeEnd("ctx");
  6869. $4=self._collection();
  6870. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6871. $ctx1.sendIdx["collection"]=2;
  6872. //>>excludeEnd("ctx");
  6873. $3=$recv($4)._first_((0));
  6874. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6875. $ctx1.sendIdx["first:"]=2;
  6876. //>>excludeEnd("ctx");
  6877. self._assert_equals_($3,$recv(self._collectionClass())._new());
  6878. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6879. $ctx1.sendIdx["assert:equals:"]=2;
  6880. //>>excludeEnd("ctx");
  6881. $6=self._collection();
  6882. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6883. $ctx1.sendIdx["collection"]=3;
  6884. //>>excludeEnd("ctx");
  6885. $5=$recv($6)._first_(self._collectionSize());
  6886. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6887. $ctx1.sendIdx["first:"]=3;
  6888. //>>excludeEnd("ctx");
  6889. $7=self._collection();
  6890. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6891. $ctx1.sendIdx["collection"]=4;
  6892. //>>excludeEnd("ctx");
  6893. self._assert_equals_($5,$7);
  6894. self._should_raise_((function(){
  6895. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6896. return $core.withContext(function($ctx2) {
  6897. //>>excludeEnd("ctx");
  6898. return $recv(self._collection())._first_((33));
  6899. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6900. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  6901. //>>excludeEnd("ctx");
  6902. }),$globals.Error);
  6903. return self;
  6904. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6905. }, function($ctx1) {$ctx1.fill(self,"testFirstN",{},$globals.SequenceableCollectionTest)});
  6906. //>>excludeEnd("ctx");
  6907. },
  6908. //>>excludeStart("ide", pragmas.excludeIdeData);
  6909. args: [],
  6910. 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",
  6911. referencedClasses: ["Error"],
  6912. //>>excludeEnd("ide");
  6913. messageSends: ["assert:equals:", "first:", "collection", "collectionFirstTwo", "new", "collectionClass", "collectionSize", "should:raise:"]
  6914. }),
  6915. $globals.SequenceableCollectionTest);
  6916. $core.addMethod(
  6917. $core.method({
  6918. selector: "testFourth",
  6919. protocol: 'tests',
  6920. fn: function (){
  6921. var self=this;
  6922. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6923. return $core.withContext(function($ctx1) {
  6924. //>>excludeEnd("ctx");
  6925. var $2,$1;
  6926. $2=self._collection();
  6927. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6928. $ctx1.sendIdx["collection"]=1;
  6929. //>>excludeEnd("ctx");
  6930. $1=$recv($2)._fourth();
  6931. self._assert_equals_($1,$recv(self._collection())._at_((4)));
  6932. return self;
  6933. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6934. }, function($ctx1) {$ctx1.fill(self,"testFourth",{},$globals.SequenceableCollectionTest)});
  6935. //>>excludeEnd("ctx");
  6936. },
  6937. //>>excludeStart("ide", pragmas.excludeIdeData);
  6938. args: [],
  6939. source: "testFourth\x0a\x09self assert: (self collection fourth) equals: (self collection at: 4)",
  6940. referencedClasses: [],
  6941. //>>excludeEnd("ide");
  6942. messageSends: ["assert:equals:", "fourth", "collection", "at:"]
  6943. }),
  6944. $globals.SequenceableCollectionTest);
  6945. $core.addMethod(
  6946. $core.method({
  6947. selector: "testIndexOfStartingAt",
  6948. protocol: 'tests',
  6949. fn: function (){
  6950. var self=this;
  6951. var jsNull;
  6952. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6953. return $core.withContext(function($ctx1) {
  6954. //>>excludeEnd("ctx");
  6955. var $2,$1,$4,$3;
  6956. jsNull=$recv($globals.JSON)._parse_("null");
  6957. self._samplesDo_((function(index,value){
  6958. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6959. return $core.withContext(function($ctx2) {
  6960. //>>excludeEnd("ctx");
  6961. $2=self._collection();
  6962. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6963. $ctx2.sendIdx["collection"]=1;
  6964. //>>excludeEnd("ctx");
  6965. $1=$recv($2)._indexOf_startingAt_(value,(1));
  6966. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6967. $ctx2.sendIdx["indexOf:startingAt:"]=1;
  6968. //>>excludeEnd("ctx");
  6969. self._assert_equals_($1,index);
  6970. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6971. $ctx2.sendIdx["assert:equals:"]=1;
  6972. //>>excludeEnd("ctx");
  6973. $4=self._collection();
  6974. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6975. $ctx2.sendIdx["collection"]=2;
  6976. //>>excludeEnd("ctx");
  6977. $3=$recv($4)._indexOf_startingAt_(value,index);
  6978. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6979. $ctx2.sendIdx["indexOf:startingAt:"]=2;
  6980. //>>excludeEnd("ctx");
  6981. self._assert_equals_($3,index);
  6982. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6983. $ctx2.sendIdx["assert:equals:"]=2;
  6984. //>>excludeEnd("ctx");
  6985. return self._assert_equals_($recv(self._collection())._indexOf_startingAt_(value,$recv(index).__plus((1))),(0));
  6986. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6987. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,1)});
  6988. //>>excludeEnd("ctx");
  6989. }));
  6990. return self;
  6991. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6992. }, function($ctx1) {$ctx1.fill(self,"testIndexOfStartingAt",{jsNull:jsNull},$globals.SequenceableCollectionTest)});
  6993. //>>excludeEnd("ctx");
  6994. },
  6995. //>>excludeStart("ide", pragmas.excludeIdeData);
  6996. args: [],
  6997. 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 ]",
  6998. referencedClasses: ["JSON"],
  6999. //>>excludeEnd("ide");
  7000. messageSends: ["parse:", "samplesDo:", "assert:equals:", "indexOf:startingAt:", "collection", "+"]
  7001. }),
  7002. $globals.SequenceableCollectionTest);
  7003. $core.addMethod(
  7004. $core.method({
  7005. selector: "testIndexOfStartingAtWithNull",
  7006. protocol: 'tests',
  7007. fn: function (){
  7008. var self=this;
  7009. var jsNull;
  7010. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7011. return $core.withContext(function($ctx1) {
  7012. //>>excludeEnd("ctx");
  7013. var $1,$2;
  7014. jsNull=$recv($globals.JSON)._parse_("null");
  7015. self._samplesDo_((function(index,value){
  7016. var collection;
  7017. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7018. return $core.withContext(function($ctx2) {
  7019. //>>excludeEnd("ctx");
  7020. collection=self._collection();
  7021. collection;
  7022. $recv(collection)._at_put_(index,jsNull);
  7023. $1=$recv(collection)._indexOf_startingAt_(jsNull,(1));
  7024. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7025. $ctx2.sendIdx["indexOf:startingAt:"]=1;
  7026. //>>excludeEnd("ctx");
  7027. self._assert_equals_($1,index);
  7028. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7029. $ctx2.sendIdx["assert:equals:"]=1;
  7030. //>>excludeEnd("ctx");
  7031. $2=$recv(collection)._indexOf_startingAt_(jsNull,index);
  7032. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7033. $ctx2.sendIdx["indexOf:startingAt:"]=2;
  7034. //>>excludeEnd("ctx");
  7035. self._assert_equals_($2,index);
  7036. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7037. $ctx2.sendIdx["assert:equals:"]=2;
  7038. //>>excludeEnd("ctx");
  7039. return self._assert_equals_($recv(collection)._indexOf_startingAt_(jsNull,$recv(index).__plus((1))),(0));
  7040. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7041. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value,collection:collection},$ctx1,1)});
  7042. //>>excludeEnd("ctx");
  7043. }));
  7044. return self;
  7045. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7046. }, function($ctx1) {$ctx1.fill(self,"testIndexOfStartingAtWithNull",{jsNull:jsNull},$globals.SequenceableCollectionTest)});
  7047. //>>excludeEnd("ctx");
  7048. },
  7049. //>>excludeStart("ide", pragmas.excludeIdeData);
  7050. args: [],
  7051. 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 ]",
  7052. referencedClasses: ["JSON"],
  7053. //>>excludeEnd("ide");
  7054. messageSends: ["parse:", "samplesDo:", "collection", "at:put:", "assert:equals:", "indexOf:startingAt:", "+"]
  7055. }),
  7056. $globals.SequenceableCollectionTest);
  7057. $core.addMethod(
  7058. $core.method({
  7059. selector: "testLast",
  7060. protocol: 'tests',
  7061. fn: function (){
  7062. var self=this;
  7063. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7064. return $core.withContext(function($ctx1) {
  7065. //>>excludeEnd("ctx");
  7066. self._assert_equals_($recv(self._collection())._last(),self._collectionLast());
  7067. return self;
  7068. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7069. }, function($ctx1) {$ctx1.fill(self,"testLast",{},$globals.SequenceableCollectionTest)});
  7070. //>>excludeEnd("ctx");
  7071. },
  7072. //>>excludeStart("ide", pragmas.excludeIdeData);
  7073. args: [],
  7074. source: "testLast\x0a\x09self assert: self collection last equals: self collectionLast",
  7075. referencedClasses: [],
  7076. //>>excludeEnd("ide");
  7077. messageSends: ["assert:equals:", "last", "collection", "collectionLast"]
  7078. }),
  7079. $globals.SequenceableCollectionTest);
  7080. $core.addMethod(
  7081. $core.method({
  7082. selector: "testLastN",
  7083. protocol: 'tests',
  7084. fn: function (){
  7085. var self=this;
  7086. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7087. return $core.withContext(function($ctx1) {
  7088. //>>excludeEnd("ctx");
  7089. var $2,$1,$4,$3,$6,$5,$7;
  7090. $2=self._collection();
  7091. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7092. $ctx1.sendIdx["collection"]=1;
  7093. //>>excludeEnd("ctx");
  7094. $1=$recv($2)._last_((2));
  7095. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7096. $ctx1.sendIdx["last:"]=1;
  7097. //>>excludeEnd("ctx");
  7098. self._assert_equals_($1,self._collectionLastTwo());
  7099. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7100. $ctx1.sendIdx["assert:equals:"]=1;
  7101. //>>excludeEnd("ctx");
  7102. $4=self._collection();
  7103. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7104. $ctx1.sendIdx["collection"]=2;
  7105. //>>excludeEnd("ctx");
  7106. $3=$recv($4)._last_((0));
  7107. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7108. $ctx1.sendIdx["last:"]=2;
  7109. //>>excludeEnd("ctx");
  7110. self._assert_equals_($3,$recv(self._collectionClass())._new());
  7111. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7112. $ctx1.sendIdx["assert:equals:"]=2;
  7113. //>>excludeEnd("ctx");
  7114. $6=self._collection();
  7115. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7116. $ctx1.sendIdx["collection"]=3;
  7117. //>>excludeEnd("ctx");
  7118. $5=$recv($6)._last_(self._collectionSize());
  7119. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7120. $ctx1.sendIdx["last:"]=3;
  7121. //>>excludeEnd("ctx");
  7122. $7=self._collection();
  7123. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7124. $ctx1.sendIdx["collection"]=4;
  7125. //>>excludeEnd("ctx");
  7126. self._assert_equals_($5,$7);
  7127. self._should_raise_((function(){
  7128. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7129. return $core.withContext(function($ctx2) {
  7130. //>>excludeEnd("ctx");
  7131. return $recv(self._collection())._last_((33));
  7132. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7133. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  7134. //>>excludeEnd("ctx");
  7135. }),$globals.Error);
  7136. return self;
  7137. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7138. }, function($ctx1) {$ctx1.fill(self,"testLastN",{},$globals.SequenceableCollectionTest)});
  7139. //>>excludeEnd("ctx");
  7140. },
  7141. //>>excludeStart("ide", pragmas.excludeIdeData);
  7142. args: [],
  7143. 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",
  7144. referencedClasses: ["Error"],
  7145. //>>excludeEnd("ide");
  7146. messageSends: ["assert:equals:", "last:", "collection", "collectionLastTwo", "new", "collectionClass", "collectionSize", "should:raise:"]
  7147. }),
  7148. $globals.SequenceableCollectionTest);
  7149. $core.addMethod(
  7150. $core.method({
  7151. selector: "testSecond",
  7152. protocol: 'tests',
  7153. fn: function (){
  7154. var self=this;
  7155. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7156. return $core.withContext(function($ctx1) {
  7157. //>>excludeEnd("ctx");
  7158. var $2,$1;
  7159. $2=self._collection();
  7160. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7161. $ctx1.sendIdx["collection"]=1;
  7162. //>>excludeEnd("ctx");
  7163. $1=$recv($2)._second();
  7164. self._assert_equals_($1,$recv(self._collection())._at_((2)));
  7165. return self;
  7166. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7167. }, function($ctx1) {$ctx1.fill(self,"testSecond",{},$globals.SequenceableCollectionTest)});
  7168. //>>excludeEnd("ctx");
  7169. },
  7170. //>>excludeStart("ide", pragmas.excludeIdeData);
  7171. args: [],
  7172. source: "testSecond\x0a\x09self assert: (self collection second) equals: (self collection at: 2)",
  7173. referencedClasses: [],
  7174. //>>excludeEnd("ide");
  7175. messageSends: ["assert:equals:", "second", "collection", "at:"]
  7176. }),
  7177. $globals.SequenceableCollectionTest);
  7178. $core.addMethod(
  7179. $core.method({
  7180. selector: "testThird",
  7181. protocol: 'tests',
  7182. fn: function (){
  7183. var self=this;
  7184. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7185. return $core.withContext(function($ctx1) {
  7186. //>>excludeEnd("ctx");
  7187. var $2,$1;
  7188. $2=self._collection();
  7189. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7190. $ctx1.sendIdx["collection"]=1;
  7191. //>>excludeEnd("ctx");
  7192. $1=$recv($2)._third();
  7193. self._assert_equals_($1,$recv(self._collection())._at_((3)));
  7194. return self;
  7195. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7196. }, function($ctx1) {$ctx1.fill(self,"testThird",{},$globals.SequenceableCollectionTest)});
  7197. //>>excludeEnd("ctx");
  7198. },
  7199. //>>excludeStart("ide", pragmas.excludeIdeData);
  7200. args: [],
  7201. source: "testThird\x0a\x09self assert: (self collection third) equals: (self collection at: 3)",
  7202. referencedClasses: [],
  7203. //>>excludeEnd("ide");
  7204. messageSends: ["assert:equals:", "third", "collection", "at:"]
  7205. }),
  7206. $globals.SequenceableCollectionTest);
  7207. $core.addClass('ArrayTest', $globals.SequenceableCollectionTest, [], 'Kernel-Tests');
  7208. $core.addMethod(
  7209. $core.method({
  7210. selector: "collection",
  7211. protocol: 'fixture',
  7212. fn: function (){
  7213. var self=this;
  7214. return [(1), (2), (3), (-4)];
  7215. },
  7216. //>>excludeStart("ide", pragmas.excludeIdeData);
  7217. args: [],
  7218. source: "collection\x0a\x09^ #(1 2 3 -4)",
  7219. referencedClasses: [],
  7220. //>>excludeEnd("ide");
  7221. messageSends: []
  7222. }),
  7223. $globals.ArrayTest);
  7224. $core.addMethod(
  7225. $core.method({
  7226. selector: "collectionFirst",
  7227. protocol: 'fixture',
  7228. fn: function (){
  7229. var self=this;
  7230. return (1);
  7231. },
  7232. //>>excludeStart("ide", pragmas.excludeIdeData);
  7233. args: [],
  7234. source: "collectionFirst\x0a\x09^ 1",
  7235. referencedClasses: [],
  7236. //>>excludeEnd("ide");
  7237. messageSends: []
  7238. }),
  7239. $globals.ArrayTest);
  7240. $core.addMethod(
  7241. $core.method({
  7242. selector: "collectionFirstTwo",
  7243. protocol: 'fixture',
  7244. fn: function (){
  7245. var self=this;
  7246. return [(1), (2)];
  7247. },
  7248. //>>excludeStart("ide", pragmas.excludeIdeData);
  7249. args: [],
  7250. source: "collectionFirstTwo\x0a\x09^ #(1 2)",
  7251. referencedClasses: [],
  7252. //>>excludeEnd("ide");
  7253. messageSends: []
  7254. }),
  7255. $globals.ArrayTest);
  7256. $core.addMethod(
  7257. $core.method({
  7258. selector: "collectionLast",
  7259. protocol: 'fixture',
  7260. fn: function (){
  7261. var self=this;
  7262. return (-4);
  7263. },
  7264. //>>excludeStart("ide", pragmas.excludeIdeData);
  7265. args: [],
  7266. source: "collectionLast\x0a\x09^ -4",
  7267. referencedClasses: [],
  7268. //>>excludeEnd("ide");
  7269. messageSends: []
  7270. }),
  7271. $globals.ArrayTest);
  7272. $core.addMethod(
  7273. $core.method({
  7274. selector: "collectionLastTwo",
  7275. protocol: 'fixture',
  7276. fn: function (){
  7277. var self=this;
  7278. return [(3), (-4)];
  7279. },
  7280. //>>excludeStart("ide", pragmas.excludeIdeData);
  7281. args: [],
  7282. source: "collectionLastTwo\x0a\x09^ #(3 -4)",
  7283. referencedClasses: [],
  7284. //>>excludeEnd("ide");
  7285. messageSends: []
  7286. }),
  7287. $globals.ArrayTest);
  7288. $core.addMethod(
  7289. $core.method({
  7290. selector: "collectionOfPrintStrings",
  7291. protocol: 'fixture',
  7292. fn: function (){
  7293. var self=this;
  7294. return ["1", "2", "3", "-4"];
  7295. },
  7296. //>>excludeStart("ide", pragmas.excludeIdeData);
  7297. args: [],
  7298. source: "collectionOfPrintStrings\x0a\x09^ #('1' '2' '3' '-4')",
  7299. referencedClasses: [],
  7300. //>>excludeEnd("ide");
  7301. messageSends: []
  7302. }),
  7303. $globals.ArrayTest);
  7304. $core.addMethod(
  7305. $core.method({
  7306. selector: "collectionSize",
  7307. protocol: 'fixture',
  7308. fn: function (){
  7309. var self=this;
  7310. return (4);
  7311. },
  7312. //>>excludeStart("ide", pragmas.excludeIdeData);
  7313. args: [],
  7314. source: "collectionSize\x0a\x09^ 4",
  7315. referencedClasses: [],
  7316. //>>excludeEnd("ide");
  7317. messageSends: []
  7318. }),
  7319. $globals.ArrayTest);
  7320. $core.addMethod(
  7321. $core.method({
  7322. selector: "collectionWithDuplicates",
  7323. protocol: 'fixture',
  7324. fn: function (){
  7325. var self=this;
  7326. return ["a", "b", "c", (1), (2), (1), "a", []];
  7327. },
  7328. //>>excludeStart("ide", pragmas.excludeIdeData);
  7329. args: [],
  7330. source: "collectionWithDuplicates\x0a\x09^ #('a' 'b' 'c' 1 2 1 'a' ())",
  7331. referencedClasses: [],
  7332. //>>excludeEnd("ide");
  7333. messageSends: []
  7334. }),
  7335. $globals.ArrayTest);
  7336. $core.addMethod(
  7337. $core.method({
  7338. selector: "collectionWithNewValue",
  7339. protocol: 'fixture',
  7340. fn: function (){
  7341. var self=this;
  7342. return [(1), (2), (3), (-4), "N"];
  7343. },
  7344. //>>excludeStart("ide", pragmas.excludeIdeData);
  7345. args: [],
  7346. source: "collectionWithNewValue\x0a\x09^ #(1 2 3 -4 'N')",
  7347. referencedClasses: [],
  7348. //>>excludeEnd("ide");
  7349. messageSends: []
  7350. }),
  7351. $globals.ArrayTest);
  7352. $core.addMethod(
  7353. $core.method({
  7354. selector: "sampleNewIndex",
  7355. protocol: 'fixture',
  7356. fn: function (){
  7357. var self=this;
  7358. return (5);
  7359. },
  7360. //>>excludeStart("ide", pragmas.excludeIdeData);
  7361. args: [],
  7362. source: "sampleNewIndex\x0a\x09^ 5",
  7363. referencedClasses: [],
  7364. //>>excludeEnd("ide");
  7365. messageSends: []
  7366. }),
  7367. $globals.ArrayTest);
  7368. $core.addMethod(
  7369. $core.method({
  7370. selector: "samplesDo:",
  7371. protocol: 'fixture',
  7372. fn: function (aBlock){
  7373. var self=this;
  7374. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7375. return $core.withContext(function($ctx1) {
  7376. //>>excludeEnd("ctx");
  7377. (
  7378. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7379. $ctx1.supercall = true,
  7380. //>>excludeEnd("ctx");
  7381. ($globals.ArrayTest.superclass||$boot.nilAsClass).fn.prototype._samplesDo_.apply($recv(self), [aBlock]));
  7382. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7383. $ctx1.supercall = false;
  7384. //>>excludeEnd("ctx");;
  7385. $recv(aBlock)._value_value_((3),(3));
  7386. return self;
  7387. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7388. }, function($ctx1) {$ctx1.fill(self,"samplesDo:",{aBlock:aBlock},$globals.ArrayTest)});
  7389. //>>excludeEnd("ctx");
  7390. },
  7391. //>>excludeStart("ide", pragmas.excludeIdeData);
  7392. args: ["aBlock"],
  7393. source: "samplesDo: aBlock\x0a\x09super samplesDo: aBlock.\x0a\x09aBlock value: 3 value: 3.",
  7394. referencedClasses: [],
  7395. //>>excludeEnd("ide");
  7396. messageSends: ["samplesDo:", "value:value:"]
  7397. }),
  7398. $globals.ArrayTest);
  7399. $core.addMethod(
  7400. $core.method({
  7401. selector: "testAdd",
  7402. protocol: 'tests',
  7403. fn: function (){
  7404. var self=this;
  7405. var array;
  7406. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7407. return $core.withContext(function($ctx1) {
  7408. //>>excludeEnd("ctx");
  7409. array=self._collection();
  7410. $recv(array)._add_((6));
  7411. self._assert_equals_($recv(array)._last(),(6));
  7412. return self;
  7413. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7414. }, function($ctx1) {$ctx1.fill(self,"testAdd",{array:array},$globals.ArrayTest)});
  7415. //>>excludeEnd("ctx");
  7416. },
  7417. //>>excludeStart("ide", pragmas.excludeIdeData);
  7418. args: [],
  7419. source: "testAdd \x0a\x09| array | \x0a\x09array := self collection. \x0a\x09array add: 6.\x0a\x09\x0a\x09self assert: array last equals: 6",
  7420. referencedClasses: [],
  7421. //>>excludeEnd("ide");
  7422. messageSends: ["collection", "add:", "assert:equals:", "last"]
  7423. }),
  7424. $globals.ArrayTest);
  7425. $core.addMethod(
  7426. $core.method({
  7427. selector: "testAddFirst",
  7428. protocol: 'tests',
  7429. fn: function (){
  7430. var self=this;
  7431. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7432. return $core.withContext(function($ctx1) {
  7433. //>>excludeEnd("ctx");
  7434. var $3,$2,$1;
  7435. $3=self._collection();
  7436. $recv($3)._addFirst_((0));
  7437. $2=$recv($3)._yourself();
  7438. $1=$recv($2)._first();
  7439. self._assert_equals_($1,(0));
  7440. return self;
  7441. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7442. }, function($ctx1) {$ctx1.fill(self,"testAddFirst",{},$globals.ArrayTest)});
  7443. //>>excludeEnd("ctx");
  7444. },
  7445. //>>excludeStart("ide", pragmas.excludeIdeData);
  7446. args: [],
  7447. source: "testAddFirst\x0a\x09self assert: (self collection addFirst: 0; yourself) first equals: 0",
  7448. referencedClasses: [],
  7449. //>>excludeEnd("ide");
  7450. messageSends: ["assert:equals:", "first", "addFirst:", "collection", "yourself"]
  7451. }),
  7452. $globals.ArrayTest);
  7453. $core.addMethod(
  7454. $core.method({
  7455. selector: "testPrintString",
  7456. protocol: 'tests',
  7457. fn: function (){
  7458. var self=this;
  7459. var array;
  7460. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7461. return $core.withContext(function($ctx1) {
  7462. //>>excludeEnd("ctx");
  7463. var $1,$2,$3,$4,$5,$6,$7,$8;
  7464. array=$recv($globals.Array)._new();
  7465. $1=$recv(array)._printString();
  7466. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7467. $ctx1.sendIdx["printString"]=1;
  7468. //>>excludeEnd("ctx");
  7469. self._assert_equals_($1,"an Array ()");
  7470. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7471. $ctx1.sendIdx["assert:equals:"]=1;
  7472. //>>excludeEnd("ctx");
  7473. $2=array;
  7474. $recv($2)._add_((1));
  7475. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7476. $ctx1.sendIdx["add:"]=1;
  7477. //>>excludeEnd("ctx");
  7478. $3=$recv($2)._add_((3));
  7479. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7480. $ctx1.sendIdx["add:"]=2;
  7481. //>>excludeEnd("ctx");
  7482. $4=$recv(array)._printString();
  7483. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7484. $ctx1.sendIdx["printString"]=2;
  7485. //>>excludeEnd("ctx");
  7486. self._assert_equals_($4,"an Array (1 3)");
  7487. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7488. $ctx1.sendIdx["assert:equals:"]=2;
  7489. //>>excludeEnd("ctx");
  7490. $recv(array)._add_("foo");
  7491. $5=$recv(array)._printString();
  7492. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7493. $ctx1.sendIdx["printString"]=3;
  7494. //>>excludeEnd("ctx");
  7495. self._assert_equals_($5,"an Array (1 3 'foo')");
  7496. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7497. $ctx1.sendIdx["assert:equals:"]=3;
  7498. //>>excludeEnd("ctx");
  7499. $6=array;
  7500. $recv($6)._remove_((1));
  7501. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7502. $ctx1.sendIdx["remove:"]=1;
  7503. //>>excludeEnd("ctx");
  7504. $recv($6)._remove_((3));
  7505. $7=$recv(array)._printString();
  7506. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7507. $ctx1.sendIdx["printString"]=4;
  7508. //>>excludeEnd("ctx");
  7509. self._assert_equals_($7,"an Array ('foo')");
  7510. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7511. $ctx1.sendIdx["assert:equals:"]=4;
  7512. //>>excludeEnd("ctx");
  7513. $recv(array)._addLast_((3));
  7514. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7515. $ctx1.sendIdx["addLast:"]=1;
  7516. //>>excludeEnd("ctx");
  7517. $8=$recv(array)._printString();
  7518. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7519. $ctx1.sendIdx["printString"]=5;
  7520. //>>excludeEnd("ctx");
  7521. self._assert_equals_($8,"an Array ('foo' 3)");
  7522. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7523. $ctx1.sendIdx["assert:equals:"]=5;
  7524. //>>excludeEnd("ctx");
  7525. $recv(array)._addLast_((3));
  7526. self._assert_equals_($recv(array)._printString(),"an Array ('foo' 3 3)");
  7527. return self;
  7528. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7529. }, function($ctx1) {$ctx1.fill(self,"testPrintString",{array:array},$globals.ArrayTest)});
  7530. //>>excludeEnd("ctx");
  7531. },
  7532. //>>excludeStart("ide", pragmas.excludeIdeData);
  7533. args: [],
  7534. 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)'.",
  7535. referencedClasses: ["Array"],
  7536. //>>excludeEnd("ide");
  7537. messageSends: ["new", "assert:equals:", "printString", "add:", "remove:", "addLast:"]
  7538. }),
  7539. $globals.ArrayTest);
  7540. $core.addMethod(
  7541. $core.method({
  7542. selector: "testRemove",
  7543. protocol: 'tests',
  7544. fn: function (){
  7545. var self=this;
  7546. var array;
  7547. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7548. return $core.withContext(function($ctx1) {
  7549. //>>excludeEnd("ctx");
  7550. array=[(1), (2), (3), (4), (5)];
  7551. $recv(array)._remove_((3));
  7552. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7553. $ctx1.sendIdx["remove:"]=1;
  7554. //>>excludeEnd("ctx");
  7555. self._assert_equals_(array,[(1), (2), (4), (5)]);
  7556. self._should_raise_((function(){
  7557. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7558. return $core.withContext(function($ctx2) {
  7559. //>>excludeEnd("ctx");
  7560. return $recv(array)._remove_((3));
  7561. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7562. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  7563. //>>excludeEnd("ctx");
  7564. }),$globals.Error);
  7565. return self;
  7566. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7567. }, function($ctx1) {$ctx1.fill(self,"testRemove",{array:array},$globals.ArrayTest)});
  7568. //>>excludeEnd("ctx");
  7569. },
  7570. //>>excludeStart("ide", pragmas.excludeIdeData);
  7571. args: [],
  7572. 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",
  7573. referencedClasses: ["Error"],
  7574. //>>excludeEnd("ide");
  7575. messageSends: ["remove:", "assert:equals:", "should:raise:"]
  7576. }),
  7577. $globals.ArrayTest);
  7578. $core.addMethod(
  7579. $core.method({
  7580. selector: "testRemoveFromTo",
  7581. protocol: 'tests',
  7582. fn: function (){
  7583. var self=this;
  7584. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7585. return $core.withContext(function($ctx1) {
  7586. //>>excludeEnd("ctx");
  7587. var $1,$2;
  7588. $1=[(1), (2), (3), (4)]._removeFrom_to_((1),(3));
  7589. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7590. $ctx1.sendIdx["removeFrom:to:"]=1;
  7591. //>>excludeEnd("ctx");
  7592. self._assert_equals_($1,[(4)]);
  7593. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7594. $ctx1.sendIdx["assert:equals:"]=1;
  7595. //>>excludeEnd("ctx");
  7596. $2=[(1), (2), (3), (4)]._removeFrom_to_((2),(3));
  7597. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7598. $ctx1.sendIdx["removeFrom:to:"]=2;
  7599. //>>excludeEnd("ctx");
  7600. self._assert_equals_($2,[(1), (4)]);
  7601. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7602. $ctx1.sendIdx["assert:equals:"]=2;
  7603. //>>excludeEnd("ctx");
  7604. self._assert_equals_([(1), (2), (3), (4)]._removeFrom_to_((2),(4)),[(1)]);
  7605. return self;
  7606. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7607. }, function($ctx1) {$ctx1.fill(self,"testRemoveFromTo",{},$globals.ArrayTest)});
  7608. //>>excludeEnd("ctx");
  7609. },
  7610. //>>excludeStart("ide", pragmas.excludeIdeData);
  7611. args: [],
  7612. 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)",
  7613. referencedClasses: [],
  7614. //>>excludeEnd("ide");
  7615. messageSends: ["assert:equals:", "removeFrom:to:"]
  7616. }),
  7617. $globals.ArrayTest);
  7618. $core.addMethod(
  7619. $core.method({
  7620. selector: "testRemoveIndex",
  7621. protocol: 'tests',
  7622. fn: function (){
  7623. var self=this;
  7624. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7625. return $core.withContext(function($ctx1) {
  7626. //>>excludeEnd("ctx");
  7627. var $1,$2;
  7628. $1=[(1), (2), (3), (4)]._removeIndex_((2));
  7629. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7630. $ctx1.sendIdx["removeIndex:"]=1;
  7631. //>>excludeEnd("ctx");
  7632. self._assert_equals_($1,[(1), (3), (4)]);
  7633. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7634. $ctx1.sendIdx["assert:equals:"]=1;
  7635. //>>excludeEnd("ctx");
  7636. $2=[(1), (2), (3), (4)]._removeIndex_((1));
  7637. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7638. $ctx1.sendIdx["removeIndex:"]=2;
  7639. //>>excludeEnd("ctx");
  7640. self._assert_equals_($2,[(2), (3), (4)]);
  7641. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7642. $ctx1.sendIdx["assert:equals:"]=2;
  7643. //>>excludeEnd("ctx");
  7644. self._assert_equals_(["hello"]._removeIndex_((1)),[]);
  7645. return self;
  7646. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7647. }, function($ctx1) {$ctx1.fill(self,"testRemoveIndex",{},$globals.ArrayTest)});
  7648. //>>excludeEnd("ctx");
  7649. },
  7650. //>>excludeStart("ide", pragmas.excludeIdeData);
  7651. args: [],
  7652. 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: #()",
  7653. referencedClasses: [],
  7654. //>>excludeEnd("ide");
  7655. messageSends: ["assert:equals:", "removeIndex:"]
  7656. }),
  7657. $globals.ArrayTest);
  7658. $core.addMethod(
  7659. $core.method({
  7660. selector: "testRemoveLast",
  7661. protocol: 'tests',
  7662. fn: function (){
  7663. var self=this;
  7664. var array;
  7665. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7666. return $core.withContext(function($ctx1) {
  7667. //>>excludeEnd("ctx");
  7668. array=[(1), (2)];
  7669. $recv(array)._removeLast();
  7670. self._assert_equals_($recv(array)._last(),(1));
  7671. return self;
  7672. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7673. }, function($ctx1) {$ctx1.fill(self,"testRemoveLast",{array:array},$globals.ArrayTest)});
  7674. //>>excludeEnd("ctx");
  7675. },
  7676. //>>excludeStart("ide", pragmas.excludeIdeData);
  7677. args: [],
  7678. source: "testRemoveLast \x0a\x09| array |\x0a\x09array := #(1 2). \x0a\x09array removeLast.\x0a\x09\x0a\x09self assert: array last equals: 1",
  7679. referencedClasses: [],
  7680. //>>excludeEnd("ide");
  7681. messageSends: ["removeLast", "assert:equals:", "last"]
  7682. }),
  7683. $globals.ArrayTest);
  7684. $core.addMethod(
  7685. $core.method({
  7686. selector: "testReversed",
  7687. protocol: 'tests',
  7688. fn: function (){
  7689. var self=this;
  7690. var array;
  7691. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7692. return $core.withContext(function($ctx1) {
  7693. //>>excludeEnd("ctx");
  7694. array=[(5), (4), (3), (2), (1)];
  7695. self._assert_equals_($recv(array)._reversed(),[(1), (2), (3), (4), (5)]);
  7696. return self;
  7697. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7698. }, function($ctx1) {$ctx1.fill(self,"testReversed",{array:array},$globals.ArrayTest)});
  7699. //>>excludeEnd("ctx");
  7700. },
  7701. //>>excludeStart("ide", pragmas.excludeIdeData);
  7702. args: [],
  7703. source: "testReversed\x0a\x09|array|\x0a\x09array := #(5 4 3 2 1). \x0a\x09self assert: (array reversed) equals: #(1 2 3 4 5)",
  7704. referencedClasses: [],
  7705. //>>excludeEnd("ide");
  7706. messageSends: ["assert:equals:", "reversed"]
  7707. }),
  7708. $globals.ArrayTest);
  7709. $core.addMethod(
  7710. $core.method({
  7711. selector: "testSort",
  7712. protocol: 'tests',
  7713. fn: function (){
  7714. var self=this;
  7715. var array;
  7716. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7717. return $core.withContext(function($ctx1) {
  7718. //>>excludeEnd("ctx");
  7719. array=[(10), (1), (5)];
  7720. $recv(array)._sort();
  7721. self._assert_equals_(array,[(1), (5), (10)]);
  7722. return self;
  7723. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7724. }, function($ctx1) {$ctx1.fill(self,"testSort",{array:array},$globals.ArrayTest)});
  7725. //>>excludeEnd("ctx");
  7726. },
  7727. //>>excludeStart("ide", pragmas.excludeIdeData);
  7728. args: [],
  7729. source: "testSort\x0a\x09| array |\x0a\x09array := #(10 1 5). \x0a\x09array sort.\x0a\x09self assert: array equals: #(1 5 10)",
  7730. referencedClasses: [],
  7731. //>>excludeEnd("ide");
  7732. messageSends: ["sort", "assert:equals:"]
  7733. }),
  7734. $globals.ArrayTest);
  7735. $core.addMethod(
  7736. $core.method({
  7737. selector: "collectionClass",
  7738. protocol: 'fixture',
  7739. fn: function (){
  7740. var self=this;
  7741. return $globals.Array;
  7742. },
  7743. //>>excludeStart("ide", pragmas.excludeIdeData);
  7744. args: [],
  7745. source: "collectionClass\x0a\x09^ Array",
  7746. referencedClasses: ["Array"],
  7747. //>>excludeEnd("ide");
  7748. messageSends: []
  7749. }),
  7750. $globals.ArrayTest.klass);
  7751. $core.addClass('StringTest', $globals.SequenceableCollectionTest, [], 'Kernel-Tests');
  7752. $core.addMethod(
  7753. $core.method({
  7754. selector: "collection",
  7755. protocol: 'fixture',
  7756. fn: function (){
  7757. var self=this;
  7758. return "helLo";
  7759. },
  7760. //>>excludeStart("ide", pragmas.excludeIdeData);
  7761. args: [],
  7762. source: "collection\x0a\x09^ 'helLo'",
  7763. referencedClasses: [],
  7764. //>>excludeEnd("ide");
  7765. messageSends: []
  7766. }),
  7767. $globals.StringTest);
  7768. $core.addMethod(
  7769. $core.method({
  7770. selector: "collectionFirst",
  7771. protocol: 'fixture',
  7772. fn: function (){
  7773. var self=this;
  7774. return "h";
  7775. },
  7776. //>>excludeStart("ide", pragmas.excludeIdeData);
  7777. args: [],
  7778. source: "collectionFirst\x0a\x09^ 'h'",
  7779. referencedClasses: [],
  7780. //>>excludeEnd("ide");
  7781. messageSends: []
  7782. }),
  7783. $globals.StringTest);
  7784. $core.addMethod(
  7785. $core.method({
  7786. selector: "collectionFirstTwo",
  7787. protocol: 'fixture',
  7788. fn: function (){
  7789. var self=this;
  7790. return "he";
  7791. },
  7792. //>>excludeStart("ide", pragmas.excludeIdeData);
  7793. args: [],
  7794. source: "collectionFirstTwo\x0a\x09^ 'he'",
  7795. referencedClasses: [],
  7796. //>>excludeEnd("ide");
  7797. messageSends: []
  7798. }),
  7799. $globals.StringTest);
  7800. $core.addMethod(
  7801. $core.method({
  7802. selector: "collectionLast",
  7803. protocol: 'fixture',
  7804. fn: function (){
  7805. var self=this;
  7806. return "o";
  7807. },
  7808. //>>excludeStart("ide", pragmas.excludeIdeData);
  7809. args: [],
  7810. source: "collectionLast\x0a\x09^ 'o'",
  7811. referencedClasses: [],
  7812. //>>excludeEnd("ide");
  7813. messageSends: []
  7814. }),
  7815. $globals.StringTest);
  7816. $core.addMethod(
  7817. $core.method({
  7818. selector: "collectionLastTwo",
  7819. protocol: 'fixture',
  7820. fn: function (){
  7821. var self=this;
  7822. return "Lo";
  7823. },
  7824. //>>excludeStart("ide", pragmas.excludeIdeData);
  7825. args: [],
  7826. source: "collectionLastTwo\x0a\x09^ 'Lo'",
  7827. referencedClasses: [],
  7828. //>>excludeEnd("ide");
  7829. messageSends: []
  7830. }),
  7831. $globals.StringTest);
  7832. $core.addMethod(
  7833. $core.method({
  7834. selector: "collectionOfPrintStrings",
  7835. protocol: 'fixture',
  7836. fn: function (){
  7837. var self=this;
  7838. return "'h''e''l''L''o'";
  7839. },
  7840. //>>excludeStart("ide", pragmas.excludeIdeData);
  7841. args: [],
  7842. source: "collectionOfPrintStrings\x0a\x09^ '''h''''e''''l''''L''''o'''",
  7843. referencedClasses: [],
  7844. //>>excludeEnd("ide");
  7845. messageSends: []
  7846. }),
  7847. $globals.StringTest);
  7848. $core.addMethod(
  7849. $core.method({
  7850. selector: "collectionSize",
  7851. protocol: 'fixture',
  7852. fn: function (){
  7853. var self=this;
  7854. return (5);
  7855. },
  7856. //>>excludeStart("ide", pragmas.excludeIdeData);
  7857. args: [],
  7858. source: "collectionSize\x0a\x09^ 5",
  7859. referencedClasses: [],
  7860. //>>excludeEnd("ide");
  7861. messageSends: []
  7862. }),
  7863. $globals.StringTest);
  7864. $core.addMethod(
  7865. $core.method({
  7866. selector: "collectionWithDuplicates",
  7867. protocol: 'fixture',
  7868. fn: function (){
  7869. var self=this;
  7870. return "abbaerten";
  7871. },
  7872. //>>excludeStart("ide", pragmas.excludeIdeData);
  7873. args: [],
  7874. source: "collectionWithDuplicates\x0a\x09^ 'abbaerten'",
  7875. referencedClasses: [],
  7876. //>>excludeEnd("ide");
  7877. messageSends: []
  7878. }),
  7879. $globals.StringTest);
  7880. $core.addMethod(
  7881. $core.method({
  7882. selector: "collectionWithNewValue",
  7883. protocol: 'fixture',
  7884. fn: function (){
  7885. var self=this;
  7886. return "helLoN";
  7887. },
  7888. //>>excludeStart("ide", pragmas.excludeIdeData);
  7889. args: [],
  7890. source: "collectionWithNewValue\x0a\x09^ 'helLoN'",
  7891. referencedClasses: [],
  7892. //>>excludeEnd("ide");
  7893. messageSends: []
  7894. }),
  7895. $globals.StringTest);
  7896. $core.addMethod(
  7897. $core.method({
  7898. selector: "sampleNewValueAsCollection",
  7899. protocol: 'fixture',
  7900. fn: function (){
  7901. var self=this;
  7902. return "N";
  7903. },
  7904. //>>excludeStart("ide", pragmas.excludeIdeData);
  7905. args: [],
  7906. source: "sampleNewValueAsCollection\x0a\x09^ 'N'",
  7907. referencedClasses: [],
  7908. //>>excludeEnd("ide");
  7909. messageSends: []
  7910. }),
  7911. $globals.StringTest);
  7912. $core.addMethod(
  7913. $core.method({
  7914. selector: "samplesDo:",
  7915. protocol: 'fixture',
  7916. fn: function (aBlock){
  7917. var self=this;
  7918. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7919. return $core.withContext(function($ctx1) {
  7920. //>>excludeEnd("ctx");
  7921. (
  7922. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7923. $ctx1.supercall = true,
  7924. //>>excludeEnd("ctx");
  7925. ($globals.StringTest.superclass||$boot.nilAsClass).fn.prototype._samplesDo_.apply($recv(self), [aBlock]));
  7926. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7927. $ctx1.supercall = false;
  7928. //>>excludeEnd("ctx");;
  7929. $recv(aBlock)._value_value_((3),"l");
  7930. return self;
  7931. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7932. }, function($ctx1) {$ctx1.fill(self,"samplesDo:",{aBlock:aBlock},$globals.StringTest)});
  7933. //>>excludeEnd("ctx");
  7934. },
  7935. //>>excludeStart("ide", pragmas.excludeIdeData);
  7936. args: ["aBlock"],
  7937. source: "samplesDo: aBlock\x0a\x09super samplesDo: aBlock.\x0a\x09aBlock value: 3 value: 'l'",
  7938. referencedClasses: [],
  7939. //>>excludeEnd("ide");
  7940. messageSends: ["samplesDo:", "value:value:"]
  7941. }),
  7942. $globals.StringTest);
  7943. $core.addMethod(
  7944. $core.method({
  7945. selector: "testAddAll",
  7946. protocol: 'tests',
  7947. fn: function (){
  7948. var self=this;
  7949. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7950. return $core.withContext(function($ctx1) {
  7951. //>>excludeEnd("ctx");
  7952. var $1;
  7953. self._should_raise_((function(){
  7954. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7955. return $core.withContext(function($ctx2) {
  7956. //>>excludeEnd("ctx");
  7957. $1=self._collection();
  7958. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7959. $ctx2.sendIdx["collection"]=1;
  7960. //>>excludeEnd("ctx");
  7961. return $recv($1)._addAll_(self._collection());
  7962. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7963. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  7964. //>>excludeEnd("ctx");
  7965. }),$globals.Error);
  7966. return self;
  7967. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7968. }, function($ctx1) {$ctx1.fill(self,"testAddAll",{},$globals.StringTest)});
  7969. //>>excludeEnd("ctx");
  7970. },
  7971. //>>excludeStart("ide", pragmas.excludeIdeData);
  7972. args: [],
  7973. source: "testAddAll\x0a\x09\x22String instances are read-only\x22\x0a\x09self should: [ self collection addAll: self collection ] raise: Error",
  7974. referencedClasses: ["Error"],
  7975. //>>excludeEnd("ide");
  7976. messageSends: ["should:raise:", "addAll:", "collection"]
  7977. }),
  7978. $globals.StringTest);
  7979. $core.addMethod(
  7980. $core.method({
  7981. selector: "testAddRemove",
  7982. protocol: 'tests',
  7983. fn: function (){
  7984. var self=this;
  7985. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7986. return $core.withContext(function($ctx1) {
  7987. //>>excludeEnd("ctx");
  7988. self._should_raise_((function(){
  7989. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7990. return $core.withContext(function($ctx2) {
  7991. //>>excludeEnd("ctx");
  7992. return "hello"._add_("a");
  7993. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7994. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  7995. //>>excludeEnd("ctx");
  7996. }),$globals.Error);
  7997. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7998. $ctx1.sendIdx["should:raise:"]=1;
  7999. //>>excludeEnd("ctx");
  8000. self._should_raise_((function(){
  8001. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8002. return $core.withContext(function($ctx2) {
  8003. //>>excludeEnd("ctx");
  8004. return "hello"._remove_("h");
  8005. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8006. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  8007. //>>excludeEnd("ctx");
  8008. }),$globals.Error);
  8009. return self;
  8010. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8011. }, function($ctx1) {$ctx1.fill(self,"testAddRemove",{},$globals.StringTest)});
  8012. //>>excludeEnd("ctx");
  8013. },
  8014. //>>excludeStart("ide", pragmas.excludeIdeData);
  8015. args: [],
  8016. source: "testAddRemove\x0a\x09self should: [ 'hello' add: 'a' ] raise: Error.\x0a\x09self should: [ 'hello' remove: 'h' ] raise: Error",
  8017. referencedClasses: ["Error"],
  8018. //>>excludeEnd("ide");
  8019. messageSends: ["should:raise:", "add:", "remove:"]
  8020. }),
  8021. $globals.StringTest);
  8022. $core.addMethod(
  8023. $core.method({
  8024. selector: "testAsArray",
  8025. protocol: 'tests',
  8026. fn: function (){
  8027. var self=this;
  8028. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8029. return $core.withContext(function($ctx1) {
  8030. //>>excludeEnd("ctx");
  8031. self._assert_equals_("hello"._asArray(),["h", "e", "l", "l", "o"]);
  8032. return self;
  8033. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8034. }, function($ctx1) {$ctx1.fill(self,"testAsArray",{},$globals.StringTest)});
  8035. //>>excludeEnd("ctx");
  8036. },
  8037. //>>excludeStart("ide", pragmas.excludeIdeData);
  8038. args: [],
  8039. source: "testAsArray\x0a\x09self assert: 'hello' asArray equals: #('h' 'e' 'l' 'l' 'o').",
  8040. referencedClasses: [],
  8041. //>>excludeEnd("ide");
  8042. messageSends: ["assert:equals:", "asArray"]
  8043. }),
  8044. $globals.StringTest);
  8045. $core.addMethod(
  8046. $core.method({
  8047. selector: "testAsLowerCase",
  8048. protocol: 'tests',
  8049. fn: function (){
  8050. var self=this;
  8051. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8052. return $core.withContext(function($ctx1) {
  8053. //>>excludeEnd("ctx");
  8054. self._assert_equals_("JACKIE"._asLowercase(),"jackie");
  8055. return self;
  8056. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8057. }, function($ctx1) {$ctx1.fill(self,"testAsLowerCase",{},$globals.StringTest)});
  8058. //>>excludeEnd("ctx");
  8059. },
  8060. //>>excludeStart("ide", pragmas.excludeIdeData);
  8061. args: [],
  8062. source: "testAsLowerCase\x0a\x09self assert: 'JACKIE' asLowercase equals: 'jackie'.",
  8063. referencedClasses: [],
  8064. //>>excludeEnd("ide");
  8065. messageSends: ["assert:equals:", "asLowercase"]
  8066. }),
  8067. $globals.StringTest);
  8068. $core.addMethod(
  8069. $core.method({
  8070. selector: "testAsNumber",
  8071. protocol: 'tests',
  8072. fn: function (){
  8073. var self=this;
  8074. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8075. return $core.withContext(function($ctx1) {
  8076. //>>excludeEnd("ctx");
  8077. var $1,$2;
  8078. $1="3"._asNumber();
  8079. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8080. $ctx1.sendIdx["asNumber"]=1;
  8081. //>>excludeEnd("ctx");
  8082. self._assert_equals_($1,(3));
  8083. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8084. $ctx1.sendIdx["assert:equals:"]=1;
  8085. //>>excludeEnd("ctx");
  8086. $2="-3"._asNumber();
  8087. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8088. $ctx1.sendIdx["asNumber"]=2;
  8089. //>>excludeEnd("ctx");
  8090. self._assert_equals_($2,(-3));
  8091. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8092. $ctx1.sendIdx["assert:equals:"]=2;
  8093. //>>excludeEnd("ctx");
  8094. self._assert_equals_("-1.5"._asNumber(),(-1.5));
  8095. return self;
  8096. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8097. }, function($ctx1) {$ctx1.fill(self,"testAsNumber",{},$globals.StringTest)});
  8098. //>>excludeEnd("ctx");
  8099. },
  8100. //>>excludeStart("ide", pragmas.excludeIdeData);
  8101. args: [],
  8102. 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.",
  8103. referencedClasses: [],
  8104. //>>excludeEnd("ide");
  8105. messageSends: ["assert:equals:", "asNumber"]
  8106. }),
  8107. $globals.StringTest);
  8108. $core.addMethod(
  8109. $core.method({
  8110. selector: "testAsUpperCase",
  8111. protocol: 'tests',
  8112. fn: function (){
  8113. var self=this;
  8114. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8115. return $core.withContext(function($ctx1) {
  8116. //>>excludeEnd("ctx");
  8117. self._assert_equals_("jackie"._asUppercase(),"JACKIE");
  8118. return self;
  8119. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8120. }, function($ctx1) {$ctx1.fill(self,"testAsUpperCase",{},$globals.StringTest)});
  8121. //>>excludeEnd("ctx");
  8122. },
  8123. //>>excludeStart("ide", pragmas.excludeIdeData);
  8124. args: [],
  8125. source: "testAsUpperCase\x0a\x09self assert: 'jackie' asUppercase equals: 'JACKIE'.",
  8126. referencedClasses: [],
  8127. //>>excludeEnd("ide");
  8128. messageSends: ["assert:equals:", "asUppercase"]
  8129. }),
  8130. $globals.StringTest);
  8131. $core.addMethod(
  8132. $core.method({
  8133. selector: "testAsciiValue",
  8134. protocol: 'tests',
  8135. fn: function (){
  8136. var self=this;
  8137. var characterA,characterU;
  8138. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8139. return $core.withContext(function($ctx1) {
  8140. //>>excludeEnd("ctx");
  8141. var $1;
  8142. characterA="A";
  8143. characterU="U";
  8144. $1=$recv(characterA)._asciiValue();
  8145. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8146. $ctx1.sendIdx["asciiValue"]=1;
  8147. //>>excludeEnd("ctx");
  8148. self._assert_equals_($1,(65));
  8149. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8150. $ctx1.sendIdx["assert:equals:"]=1;
  8151. //>>excludeEnd("ctx");
  8152. self._assert_equals_($recv(characterU)._asciiValue(),(85));
  8153. return self;
  8154. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8155. }, function($ctx1) {$ctx1.fill(self,"testAsciiValue",{characterA:characterA,characterU:characterU},$globals.StringTest)});
  8156. //>>excludeEnd("ctx");
  8157. },
  8158. //>>excludeStart("ide", pragmas.excludeIdeData);
  8159. args: [],
  8160. 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",
  8161. referencedClasses: [],
  8162. //>>excludeEnd("ide");
  8163. messageSends: ["assert:equals:", "asciiValue"]
  8164. }),
  8165. $globals.StringTest);
  8166. $core.addMethod(
  8167. $core.method({
  8168. selector: "testAtIfAbsentPut",
  8169. protocol: 'tests',
  8170. fn: function (){
  8171. var self=this;
  8172. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8173. return $core.withContext(function($ctx1) {
  8174. //>>excludeEnd("ctx");
  8175. self._should_raise_((function(){
  8176. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8177. return $core.withContext(function($ctx2) {
  8178. //>>excludeEnd("ctx");
  8179. return "hello"._at_ifAbsentPut_((6),(function(){
  8180. return "a";
  8181. }));
  8182. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8183. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  8184. //>>excludeEnd("ctx");
  8185. }),$globals.Error);
  8186. return self;
  8187. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8188. }, function($ctx1) {$ctx1.fill(self,"testAtIfAbsentPut",{},$globals.StringTest)});
  8189. //>>excludeEnd("ctx");
  8190. },
  8191. //>>excludeStart("ide", pragmas.excludeIdeData);
  8192. args: [],
  8193. source: "testAtIfAbsentPut\x0a\x09\x22String instances are read-only\x22\x0a\x09self should: [ 'hello' at: 6 ifAbsentPut: [ 'a' ] ] raise: Error",
  8194. referencedClasses: ["Error"],
  8195. //>>excludeEnd("ide");
  8196. messageSends: ["should:raise:", "at:ifAbsentPut:"]
  8197. }),
  8198. $globals.StringTest);
  8199. $core.addMethod(
  8200. $core.method({
  8201. selector: "testAtPut",
  8202. protocol: 'tests',
  8203. fn: function (){
  8204. var self=this;
  8205. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8206. return $core.withContext(function($ctx1) {
  8207. //>>excludeEnd("ctx");
  8208. self._should_raise_((function(){
  8209. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8210. return $core.withContext(function($ctx2) {
  8211. //>>excludeEnd("ctx");
  8212. return "hello"._at_put_((1),"a");
  8213. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8214. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  8215. //>>excludeEnd("ctx");
  8216. }),$globals.Error);
  8217. return self;
  8218. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8219. }, function($ctx1) {$ctx1.fill(self,"testAtPut",{},$globals.StringTest)});
  8220. //>>excludeEnd("ctx");
  8221. },
  8222. //>>excludeStart("ide", pragmas.excludeIdeData);
  8223. args: [],
  8224. source: "testAtPut\x0a\x09\x22String instances are read-only\x22\x0a\x09self should: [ 'hello' at: 1 put: 'a' ] raise: Error",
  8225. referencedClasses: ["Error"],
  8226. //>>excludeEnd("ide");
  8227. messageSends: ["should:raise:", "at:put:"]
  8228. }),
  8229. $globals.StringTest);
  8230. $core.addMethod(
  8231. $core.method({
  8232. selector: "testCapitalized",
  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;
  8240. $1="test"._capitalized();
  8241. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8242. $ctx1.sendIdx["capitalized"]=1;
  8243. //>>excludeEnd("ctx");
  8244. self._assert_equals_($1,"Test");
  8245. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8246. $ctx1.sendIdx["assert:equals:"]=1;
  8247. //>>excludeEnd("ctx");
  8248. $2="Test"._capitalized();
  8249. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8250. $ctx1.sendIdx["capitalized"]=2;
  8251. //>>excludeEnd("ctx");
  8252. self._assert_equals_($2,"Test");
  8253. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8254. $ctx1.sendIdx["assert:equals:"]=2;
  8255. //>>excludeEnd("ctx");
  8256. self._assert_equals_(""._capitalized(),"");
  8257. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8258. $ctx1.sendIdx["assert:equals:"]=3;
  8259. //>>excludeEnd("ctx");
  8260. $3="Test"._isCapitalized();
  8261. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8262. $ctx1.sendIdx["isCapitalized"]=1;
  8263. //>>excludeEnd("ctx");
  8264. self._assert_equals_($3,true);
  8265. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8266. $ctx1.sendIdx["assert:equals:"]=4;
  8267. //>>excludeEnd("ctx");
  8268. self._assert_equals_("test"._isCapitalized(),false);
  8269. return self;
  8270. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8271. }, function($ctx1) {$ctx1.fill(self,"testCapitalized",{},$globals.StringTest)});
  8272. //>>excludeEnd("ctx");
  8273. },
  8274. //>>excludeStart("ide", pragmas.excludeIdeData);
  8275. args: [],
  8276. 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.",
  8277. referencedClasses: [],
  8278. //>>excludeEnd("ide");
  8279. messageSends: ["assert:equals:", "capitalized", "isCapitalized"]
  8280. }),
  8281. $globals.StringTest);
  8282. $core.addMethod(
  8283. $core.method({
  8284. selector: "testCharCodeAt",
  8285. protocol: 'tests',
  8286. fn: function (){
  8287. var self=this;
  8288. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8289. return $core.withContext(function($ctx1) {
  8290. //>>excludeEnd("ctx");
  8291. var $1,$2,$3,$4,$5;
  8292. $1="jackie"._charCodeAt_((1));
  8293. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8294. $ctx1.sendIdx["charCodeAt:"]=1;
  8295. //>>excludeEnd("ctx");
  8296. self._assert_equals_($1,(106));
  8297. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8298. $ctx1.sendIdx["assert:equals:"]=1;
  8299. //>>excludeEnd("ctx");
  8300. $2="jackie"._charCodeAt_((2));
  8301. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8302. $ctx1.sendIdx["charCodeAt:"]=2;
  8303. //>>excludeEnd("ctx");
  8304. self._assert_equals_($2,(97));
  8305. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8306. $ctx1.sendIdx["assert:equals:"]=2;
  8307. //>>excludeEnd("ctx");
  8308. $3="jackie"._charCodeAt_((3));
  8309. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8310. $ctx1.sendIdx["charCodeAt:"]=3;
  8311. //>>excludeEnd("ctx");
  8312. self._assert_equals_($3,(99));
  8313. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8314. $ctx1.sendIdx["assert:equals:"]=3;
  8315. //>>excludeEnd("ctx");
  8316. $4="jackie"._charCodeAt_((4));
  8317. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8318. $ctx1.sendIdx["charCodeAt:"]=4;
  8319. //>>excludeEnd("ctx");
  8320. self._assert_equals_($4,(107));
  8321. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8322. $ctx1.sendIdx["assert:equals:"]=4;
  8323. //>>excludeEnd("ctx");
  8324. $5="jackie"._charCodeAt_((5));
  8325. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8326. $ctx1.sendIdx["charCodeAt:"]=5;
  8327. //>>excludeEnd("ctx");
  8328. self._assert_equals_($5,(105));
  8329. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8330. $ctx1.sendIdx["assert:equals:"]=5;
  8331. //>>excludeEnd("ctx");
  8332. self._assert_equals_("jackie"._charCodeAt_((6)),(101));
  8333. return self;
  8334. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8335. }, function($ctx1) {$ctx1.fill(self,"testCharCodeAt",{},$globals.StringTest)});
  8336. //>>excludeEnd("ctx");
  8337. },
  8338. //>>excludeStart("ide", pragmas.excludeIdeData);
  8339. args: [],
  8340. 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",
  8341. referencedClasses: [],
  8342. //>>excludeEnd("ide");
  8343. messageSends: ["assert:equals:", "charCodeAt:"]
  8344. }),
  8345. $globals.StringTest);
  8346. $core.addMethod(
  8347. $core.method({
  8348. selector: "testCopyFromTo",
  8349. protocol: 'tests',
  8350. fn: function (){
  8351. var self=this;
  8352. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8353. return $core.withContext(function($ctx1) {
  8354. //>>excludeEnd("ctx");
  8355. var $1;
  8356. $1="jackie"._copyFrom_to_((1),(3));
  8357. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8358. $ctx1.sendIdx["copyFrom:to:"]=1;
  8359. //>>excludeEnd("ctx");
  8360. self._assert_equals_($1,"jac");
  8361. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8362. $ctx1.sendIdx["assert:equals:"]=1;
  8363. //>>excludeEnd("ctx");
  8364. self._assert_equals_("jackie"._copyFrom_to_((4),(6)),"kie");
  8365. return self;
  8366. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8367. }, function($ctx1) {$ctx1.fill(self,"testCopyFromTo",{},$globals.StringTest)});
  8368. //>>excludeEnd("ctx");
  8369. },
  8370. //>>excludeStart("ide", pragmas.excludeIdeData);
  8371. args: [],
  8372. source: "testCopyFromTo\x0a\x09self assert: ('jackie' copyFrom: 1 to: 3) equals: 'jac'.\x0a\x09self assert: ('jackie' copyFrom: 4 to: 6) equals: 'kie'.",
  8373. referencedClasses: [],
  8374. //>>excludeEnd("ide");
  8375. messageSends: ["assert:equals:", "copyFrom:to:"]
  8376. }),
  8377. $globals.StringTest);
  8378. $core.addMethod(
  8379. $core.method({
  8380. selector: "testCopySeparates",
  8381. protocol: 'tests',
  8382. fn: function (){
  8383. var self=this;
  8384. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8385. return $core.withContext(function($ctx1) {
  8386. //>>excludeEnd("ctx");
  8387. var $3,$2,$1;
  8388. $3=self._collection();
  8389. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8390. $ctx1.sendIdx["collection"]=1;
  8391. //>>excludeEnd("ctx");
  8392. $2=$recv($3)._copy();
  8393. $1=$recv($2).__eq_eq(self._collection());
  8394. self._assert_($1);
  8395. return self;
  8396. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8397. }, function($ctx1) {$ctx1.fill(self,"testCopySeparates",{},$globals.StringTest)});
  8398. //>>excludeEnd("ctx");
  8399. },
  8400. //>>excludeStart("ide", pragmas.excludeIdeData);
  8401. args: [],
  8402. source: "testCopySeparates\x0a\x09\x22String instances are immutable\x22\x0a\x09self assert: self collection copy == self collection",
  8403. referencedClasses: [],
  8404. //>>excludeEnd("ide");
  8405. messageSends: ["assert:", "==", "copy", "collection"]
  8406. }),
  8407. $globals.StringTest);
  8408. $core.addMethod(
  8409. $core.method({
  8410. selector: "testCopyWithoutAll",
  8411. protocol: 'tests',
  8412. fn: function (){
  8413. var self=this;
  8414. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8415. return $core.withContext(function($ctx1) {
  8416. //>>excludeEnd("ctx");
  8417. self._assert_equals_("*hello* *world*"._copyWithoutAll_("*"),"hello world");
  8418. return self;
  8419. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8420. }, function($ctx1) {$ctx1.fill(self,"testCopyWithoutAll",{},$globals.StringTest)});
  8421. //>>excludeEnd("ctx");
  8422. },
  8423. //>>excludeStart("ide", pragmas.excludeIdeData);
  8424. args: [],
  8425. source: "testCopyWithoutAll\x0a\x09self\x0a\x09\x09assert: ('*hello* *world*' copyWithoutAll: '*')\x0a\x09\x09equals: 'hello world'",
  8426. referencedClasses: [],
  8427. //>>excludeEnd("ide");
  8428. messageSends: ["assert:equals:", "copyWithoutAll:"]
  8429. }),
  8430. $globals.StringTest);
  8431. $core.addMethod(
  8432. $core.method({
  8433. selector: "testEquality",
  8434. protocol: 'tests',
  8435. fn: function (){
  8436. var self=this;
  8437. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8438. return $core.withContext(function($ctx1) {
  8439. //>>excludeEnd("ctx");
  8440. var $1,$2,$3;
  8441. self._assert_equals_("hello","hello");
  8442. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8443. $ctx1.sendIdx["assert:equals:"]=1;
  8444. //>>excludeEnd("ctx");
  8445. $1="hello".__eq("world");
  8446. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8447. $ctx1.sendIdx["="]=1;
  8448. //>>excludeEnd("ctx");
  8449. self._deny_($1);
  8450. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8451. $ctx1.sendIdx["deny:"]=1;
  8452. //>>excludeEnd("ctx");
  8453. $2="hello".__eq([]._at_ifAbsent_((1),(function(){
  8454. })));
  8455. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8456. $ctx1.sendIdx["="]=2;
  8457. //>>excludeEnd("ctx");
  8458. self._deny_($2);
  8459. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8460. $ctx1.sendIdx["deny:"]=2;
  8461. //>>excludeEnd("ctx");
  8462. $3="hello"._yourself();
  8463. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8464. $ctx1.sendIdx["yourself"]=1;
  8465. //>>excludeEnd("ctx");
  8466. self._assert_equals_("hello",$3);
  8467. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8468. $ctx1.sendIdx["assert:equals:"]=2;
  8469. //>>excludeEnd("ctx");
  8470. self._assert_equals_("hello"._yourself(),"hello");
  8471. self._deny_("".__eq((0)));
  8472. return self;
  8473. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8474. }, function($ctx1) {$ctx1.fill(self,"testEquality",{},$globals.StringTest)});
  8475. //>>excludeEnd("ctx");
  8476. },
  8477. //>>excludeStart("ide", pragmas.excludeIdeData);
  8478. args: [],
  8479. 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",
  8480. referencedClasses: [],
  8481. //>>excludeEnd("ide");
  8482. messageSends: ["assert:equals:", "deny:", "=", "at:ifAbsent:", "yourself"]
  8483. }),
  8484. $globals.StringTest);
  8485. $core.addMethod(
  8486. $core.method({
  8487. selector: "testIdentity",
  8488. protocol: 'tests',
  8489. fn: function (){
  8490. var self=this;
  8491. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8492. return $core.withContext(function($ctx1) {
  8493. //>>excludeEnd("ctx");
  8494. var $1,$2,$4,$3,$5;
  8495. $1="hello".__eq_eq("hello");
  8496. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8497. $ctx1.sendIdx["=="]=1;
  8498. //>>excludeEnd("ctx");
  8499. self._assert_($1);
  8500. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8501. $ctx1.sendIdx["assert:"]=1;
  8502. //>>excludeEnd("ctx");
  8503. $2="hello".__eq_eq("world");
  8504. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8505. $ctx1.sendIdx["=="]=2;
  8506. //>>excludeEnd("ctx");
  8507. self._deny_($2);
  8508. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8509. $ctx1.sendIdx["deny:"]=1;
  8510. //>>excludeEnd("ctx");
  8511. $4="hello"._yourself();
  8512. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8513. $ctx1.sendIdx["yourself"]=1;
  8514. //>>excludeEnd("ctx");
  8515. $3="hello".__eq_eq($4);
  8516. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8517. $ctx1.sendIdx["=="]=3;
  8518. //>>excludeEnd("ctx");
  8519. self._assert_($3);
  8520. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8521. $ctx1.sendIdx["assert:"]=2;
  8522. //>>excludeEnd("ctx");
  8523. $5=$recv("hello"._yourself()).__eq_eq("hello");
  8524. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8525. $ctx1.sendIdx["=="]=4;
  8526. //>>excludeEnd("ctx");
  8527. self._assert_($5);
  8528. self._deny_("".__eq_eq((0)));
  8529. return self;
  8530. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8531. }, function($ctx1) {$ctx1.fill(self,"testIdentity",{},$globals.StringTest)});
  8532. //>>excludeEnd("ctx");
  8533. },
  8534. //>>excludeStart("ide", pragmas.excludeIdeData);
  8535. args: [],
  8536. 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",
  8537. referencedClasses: [],
  8538. //>>excludeEnd("ide");
  8539. messageSends: ["assert:", "==", "deny:", "yourself"]
  8540. }),
  8541. $globals.StringTest);
  8542. $core.addMethod(
  8543. $core.method({
  8544. selector: "testIncludesSubString",
  8545. protocol: 'tests',
  8546. fn: function (){
  8547. var self=this;
  8548. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8549. return $core.withContext(function($ctx1) {
  8550. //>>excludeEnd("ctx");
  8551. var $1;
  8552. $1="amber"._includesSubString_("ber");
  8553. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8554. $ctx1.sendIdx["includesSubString:"]=1;
  8555. //>>excludeEnd("ctx");
  8556. self._assert_($1);
  8557. self._deny_("amber"._includesSubString_("zork"));
  8558. return self;
  8559. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8560. }, function($ctx1) {$ctx1.fill(self,"testIncludesSubString",{},$globals.StringTest)});
  8561. //>>excludeEnd("ctx");
  8562. },
  8563. //>>excludeStart("ide", pragmas.excludeIdeData);
  8564. args: [],
  8565. source: "testIncludesSubString\x0a\x09self assert: ('amber' includesSubString: 'ber').\x0a\x09self deny: ('amber' includesSubString: 'zork').",
  8566. referencedClasses: [],
  8567. //>>excludeEnd("ide");
  8568. messageSends: ["assert:", "includesSubString:", "deny:"]
  8569. }),
  8570. $globals.StringTest);
  8571. $core.addMethod(
  8572. $core.method({
  8573. selector: "testIndexOfStartingAtWithNull",
  8574. protocol: 'tests',
  8575. fn: function (){
  8576. var self=this;
  8577. return self;
  8578. },
  8579. //>>excludeStart("ide", pragmas.excludeIdeData);
  8580. args: [],
  8581. source: "testIndexOfStartingAtWithNull\x0a\x09\x22String cannot hold JS null\x22",
  8582. referencedClasses: [],
  8583. //>>excludeEnd("ide");
  8584. messageSends: []
  8585. }),
  8586. $globals.StringTest);
  8587. $core.addMethod(
  8588. $core.method({
  8589. selector: "testIndexOfWithNull",
  8590. protocol: 'tests',
  8591. fn: function (){
  8592. var self=this;
  8593. return self;
  8594. },
  8595. //>>excludeStart("ide", pragmas.excludeIdeData);
  8596. args: [],
  8597. source: "testIndexOfWithNull\x0a\x09\x22String cannot hold JS null\x22",
  8598. referencedClasses: [],
  8599. //>>excludeEnd("ide");
  8600. messageSends: []
  8601. }),
  8602. $globals.StringTest);
  8603. $core.addMethod(
  8604. $core.method({
  8605. selector: "testIsVowel",
  8606. protocol: 'tests',
  8607. fn: function (){
  8608. var self=this;
  8609. var vowel,consonant;
  8610. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8611. return $core.withContext(function($ctx1) {
  8612. //>>excludeEnd("ctx");
  8613. var $1;
  8614. vowel="u";
  8615. consonant="z";
  8616. $1=$recv(vowel)._isVowel();
  8617. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8618. $ctx1.sendIdx["isVowel"]=1;
  8619. //>>excludeEnd("ctx");
  8620. self._assert_equals_($1,true);
  8621. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8622. $ctx1.sendIdx["assert:equals:"]=1;
  8623. //>>excludeEnd("ctx");
  8624. self._assert_equals_($recv(consonant)._isVowel(),false);
  8625. return self;
  8626. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8627. }, function($ctx1) {$ctx1.fill(self,"testIsVowel",{vowel:vowel,consonant:consonant},$globals.StringTest)});
  8628. //>>excludeEnd("ctx");
  8629. },
  8630. //>>excludeStart("ide", pragmas.excludeIdeData);
  8631. args: [],
  8632. 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",
  8633. referencedClasses: [],
  8634. //>>excludeEnd("ide");
  8635. messageSends: ["assert:equals:", "isVowel"]
  8636. }),
  8637. $globals.StringTest);
  8638. $core.addMethod(
  8639. $core.method({
  8640. selector: "testJoin",
  8641. protocol: 'tests',
  8642. fn: function (){
  8643. var self=this;
  8644. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8645. return $core.withContext(function($ctx1) {
  8646. //>>excludeEnd("ctx");
  8647. self._assert_equals_(","._join_(["hello", "world"]),"hello,world");
  8648. return self;
  8649. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8650. }, function($ctx1) {$ctx1.fill(self,"testJoin",{},$globals.StringTest)});
  8651. //>>excludeEnd("ctx");
  8652. },
  8653. //>>excludeStart("ide", pragmas.excludeIdeData);
  8654. args: [],
  8655. source: "testJoin\x0a\x09self assert: (',' join: #('hello' 'world')) equals: 'hello,world'",
  8656. referencedClasses: [],
  8657. //>>excludeEnd("ide");
  8658. messageSends: ["assert:equals:", "join:"]
  8659. }),
  8660. $globals.StringTest);
  8661. $core.addMethod(
  8662. $core.method({
  8663. selector: "testRemoveAll",
  8664. protocol: 'tests',
  8665. fn: function (){
  8666. var self=this;
  8667. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8668. return $core.withContext(function($ctx1) {
  8669. //>>excludeEnd("ctx");
  8670. self._should_raise_((function(){
  8671. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8672. return $core.withContext(function($ctx2) {
  8673. //>>excludeEnd("ctx");
  8674. return $recv(self._collection())._removeAll();
  8675. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8676. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  8677. //>>excludeEnd("ctx");
  8678. }),$globals.Error);
  8679. return self;
  8680. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8681. }, function($ctx1) {$ctx1.fill(self,"testRemoveAll",{},$globals.StringTest)});
  8682. //>>excludeEnd("ctx");
  8683. },
  8684. //>>excludeStart("ide", pragmas.excludeIdeData);
  8685. args: [],
  8686. source: "testRemoveAll\x0a\x09self should: [ self collection removeAll ] raise: Error",
  8687. referencedClasses: ["Error"],
  8688. //>>excludeEnd("ide");
  8689. messageSends: ["should:raise:", "removeAll", "collection"]
  8690. }),
  8691. $globals.StringTest);
  8692. $core.addMethod(
  8693. $core.method({
  8694. selector: "testReversed",
  8695. protocol: 'tests',
  8696. fn: function (){
  8697. var self=this;
  8698. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8699. return $core.withContext(function($ctx1) {
  8700. //>>excludeEnd("ctx");
  8701. self._assert_equals_("jackiechan"._reversed(),"nahceikcaj");
  8702. return self;
  8703. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8704. }, function($ctx1) {$ctx1.fill(self,"testReversed",{},$globals.StringTest)});
  8705. //>>excludeEnd("ctx");
  8706. },
  8707. //>>excludeStart("ide", pragmas.excludeIdeData);
  8708. args: [],
  8709. source: "testReversed\x0a\x09self assert: 'jackiechan' reversed equals: 'nahceikcaj'.",
  8710. referencedClasses: [],
  8711. //>>excludeEnd("ide");
  8712. messageSends: ["assert:equals:", "reversed"]
  8713. }),
  8714. $globals.StringTest);
  8715. $core.addMethod(
  8716. $core.method({
  8717. selector: "testStreamContents",
  8718. protocol: 'tests',
  8719. fn: function (){
  8720. var self=this;
  8721. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8722. return $core.withContext(function($ctx1) {
  8723. //>>excludeEnd("ctx");
  8724. self._assert_equals_($recv($globals.String)._streamContents_((function(aStream){
  8725. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8726. return $core.withContext(function($ctx2) {
  8727. //>>excludeEnd("ctx");
  8728. $recv(aStream)._nextPutAll_("hello");
  8729. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8730. $ctx2.sendIdx["nextPutAll:"]=1;
  8731. //>>excludeEnd("ctx");
  8732. $recv(aStream)._space();
  8733. return $recv(aStream)._nextPutAll_("world");
  8734. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8735. }, function($ctx2) {$ctx2.fillBlock({aStream:aStream},$ctx1,1)});
  8736. //>>excludeEnd("ctx");
  8737. })),"hello world");
  8738. return self;
  8739. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8740. }, function($ctx1) {$ctx1.fill(self,"testStreamContents",{},$globals.StringTest)});
  8741. //>>excludeEnd("ctx");
  8742. },
  8743. //>>excludeStart("ide", pragmas.excludeIdeData);
  8744. args: [],
  8745. 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'",
  8746. referencedClasses: ["String"],
  8747. //>>excludeEnd("ide");
  8748. messageSends: ["assert:equals:", "streamContents:", "nextPutAll:", "space"]
  8749. }),
  8750. $globals.StringTest);
  8751. $core.addMethod(
  8752. $core.method({
  8753. selector: "testSubStrings",
  8754. protocol: 'tests',
  8755. fn: function (){
  8756. var self=this;
  8757. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8758. return $core.withContext(function($ctx1) {
  8759. //>>excludeEnd("ctx");
  8760. self._assert_equals_("jackiechan"._subStrings_("ie"),["jack", "chan"]);
  8761. return self;
  8762. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8763. }, function($ctx1) {$ctx1.fill(self,"testSubStrings",{},$globals.StringTest)});
  8764. //>>excludeEnd("ctx");
  8765. },
  8766. //>>excludeStart("ide", pragmas.excludeIdeData);
  8767. args: [],
  8768. source: "testSubStrings\x0a\x09self assert: ('jackiechan' subStrings: 'ie') equals: #( 'jack' 'chan' ).",
  8769. referencedClasses: [],
  8770. //>>excludeEnd("ide");
  8771. messageSends: ["assert:equals:", "subStrings:"]
  8772. }),
  8773. $globals.StringTest);
  8774. $core.addMethod(
  8775. $core.method({
  8776. selector: "testTrim",
  8777. protocol: 'tests',
  8778. fn: function (){
  8779. var self=this;
  8780. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8781. return $core.withContext(function($ctx1) {
  8782. //>>excludeEnd("ctx");
  8783. self._assert_equals_(" jackie"._trimLeft(),"jackie");
  8784. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8785. $ctx1.sendIdx["assert:equals:"]=1;
  8786. //>>excludeEnd("ctx");
  8787. self._assert_equals_("jackie "._trimRight(),"jackie");
  8788. return self;
  8789. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8790. }, function($ctx1) {$ctx1.fill(self,"testTrim",{},$globals.StringTest)});
  8791. //>>excludeEnd("ctx");
  8792. },
  8793. //>>excludeStart("ide", pragmas.excludeIdeData);
  8794. args: [],
  8795. source: "testTrim\x0a\x09self assert: ' jackie' trimLeft equals: 'jackie'.\x0a\x09self assert: 'jackie ' trimRight equals: 'jackie'.",
  8796. referencedClasses: [],
  8797. //>>excludeEnd("ide");
  8798. messageSends: ["assert:equals:", "trimLeft", "trimRight"]
  8799. }),
  8800. $globals.StringTest);
  8801. $core.addMethod(
  8802. $core.method({
  8803. selector: "testValue",
  8804. protocol: 'tests',
  8805. fn: function (){
  8806. var self=this;
  8807. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8808. return $core.withContext(function($ctx1) {
  8809. //>>excludeEnd("ctx");
  8810. self._assert_equals_("asString"._value_((1)),"1");
  8811. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8812. $ctx1.sendIdx["assert:equals:"]=1;
  8813. //>>excludeEnd("ctx");
  8814. self._assert_equals_([(1), (2), (3)]._collect_("asString"),["1", "2", "3"]);
  8815. return self;
  8816. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8817. }, function($ctx1) {$ctx1.fill(self,"testValue",{},$globals.StringTest)});
  8818. //>>excludeEnd("ctx");
  8819. },
  8820. //>>excludeStart("ide", pragmas.excludeIdeData);
  8821. args: [],
  8822. 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')",
  8823. referencedClasses: [],
  8824. //>>excludeEnd("ide");
  8825. messageSends: ["assert:equals:", "value:", "collect:"]
  8826. }),
  8827. $globals.StringTest);
  8828. $core.addMethod(
  8829. $core.method({
  8830. selector: "collectionClass",
  8831. protocol: 'fixture',
  8832. fn: function (){
  8833. var self=this;
  8834. return $globals.String;
  8835. },
  8836. //>>excludeStart("ide", pragmas.excludeIdeData);
  8837. args: [],
  8838. source: "collectionClass\x0a\x09^ String",
  8839. referencedClasses: ["String"],
  8840. //>>excludeEnd("ide");
  8841. messageSends: []
  8842. }),
  8843. $globals.StringTest.klass);
  8844. $core.addClass('SetTest', $globals.CollectionTest, [], 'Kernel-Tests');
  8845. $core.addMethod(
  8846. $core.method({
  8847. selector: "collection",
  8848. protocol: 'fixture',
  8849. fn: function (){
  8850. var self=this;
  8851. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8852. return $core.withContext(function($ctx1) {
  8853. //>>excludeEnd("ctx");
  8854. var $1;
  8855. $1=$recv($globals.Set)._new();
  8856. $recv($1)._add_($globals.Smalltalk);
  8857. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8858. $ctx1.sendIdx["add:"]=1;
  8859. //>>excludeEnd("ctx");
  8860. $recv($1)._add_(nil);
  8861. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8862. $ctx1.sendIdx["add:"]=2;
  8863. //>>excludeEnd("ctx");
  8864. $recv($1)._add_((3).__at((3)));
  8865. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8866. $ctx1.sendIdx["add:"]=3;
  8867. //>>excludeEnd("ctx");
  8868. $recv($1)._add_(false);
  8869. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8870. $ctx1.sendIdx["add:"]=4;
  8871. //>>excludeEnd("ctx");
  8872. $recv($1)._add_(self["@sampleBlock"]);
  8873. return $recv($1)._yourself();
  8874. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8875. }, function($ctx1) {$ctx1.fill(self,"collection",{},$globals.SetTest)});
  8876. //>>excludeEnd("ctx");
  8877. },
  8878. //>>excludeStart("ide", pragmas.excludeIdeData);
  8879. args: [],
  8880. 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",
  8881. referencedClasses: ["Set", "Smalltalk"],
  8882. //>>excludeEnd("ide");
  8883. messageSends: ["add:", "new", "@", "yourself"]
  8884. }),
  8885. $globals.SetTest);
  8886. $core.addMethod(
  8887. $core.method({
  8888. selector: "collectionOfPrintStrings",
  8889. protocol: 'fixture',
  8890. fn: function (){
  8891. var self=this;
  8892. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8893. return $core.withContext(function($ctx1) {
  8894. //>>excludeEnd("ctx");
  8895. var $1;
  8896. $1=$recv($globals.Set)._new();
  8897. $recv($1)._add_("a SmalltalkImage");
  8898. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8899. $ctx1.sendIdx["add:"]=1;
  8900. //>>excludeEnd("ctx");
  8901. $recv($1)._add_("nil");
  8902. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8903. $ctx1.sendIdx["add:"]=2;
  8904. //>>excludeEnd("ctx");
  8905. $recv($1)._add_("3@3");
  8906. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8907. $ctx1.sendIdx["add:"]=3;
  8908. //>>excludeEnd("ctx");
  8909. $recv($1)._add_("false");
  8910. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8911. $ctx1.sendIdx["add:"]=4;
  8912. //>>excludeEnd("ctx");
  8913. $recv($1)._add_("a BlockClosure");
  8914. return $recv($1)._yourself();
  8915. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8916. }, function($ctx1) {$ctx1.fill(self,"collectionOfPrintStrings",{},$globals.SetTest)});
  8917. //>>excludeEnd("ctx");
  8918. },
  8919. //>>excludeStart("ide", pragmas.excludeIdeData);
  8920. args: [],
  8921. 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",
  8922. referencedClasses: ["Set"],
  8923. //>>excludeEnd("ide");
  8924. messageSends: ["add:", "new", "yourself"]
  8925. }),
  8926. $globals.SetTest);
  8927. $core.addMethod(
  8928. $core.method({
  8929. selector: "collectionSize",
  8930. protocol: 'fixture',
  8931. fn: function (){
  8932. var self=this;
  8933. return (5);
  8934. },
  8935. //>>excludeStart("ide", pragmas.excludeIdeData);
  8936. args: [],
  8937. source: "collectionSize\x0a\x09^ 5",
  8938. referencedClasses: [],
  8939. //>>excludeEnd("ide");
  8940. messageSends: []
  8941. }),
  8942. $globals.SetTest);
  8943. $core.addMethod(
  8944. $core.method({
  8945. selector: "collectionWithDuplicates",
  8946. protocol: 'fixture',
  8947. fn: function (){
  8948. var self=this;
  8949. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8950. return $core.withContext(function($ctx1) {
  8951. //>>excludeEnd("ctx");
  8952. var $1;
  8953. $1=self._collection();
  8954. $recv($1)._add_((0));
  8955. return $recv($1)._yourself();
  8956. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8957. }, function($ctx1) {$ctx1.fill(self,"collectionWithDuplicates",{},$globals.SetTest)});
  8958. //>>excludeEnd("ctx");
  8959. },
  8960. //>>excludeStart("ide", pragmas.excludeIdeData);
  8961. args: [],
  8962. source: "collectionWithDuplicates\x0a\x09\x22Set has no duplicates\x22\x0a\x09^ self collection add: 0; yourself",
  8963. referencedClasses: [],
  8964. //>>excludeEnd("ide");
  8965. messageSends: ["add:", "collection", "yourself"]
  8966. }),
  8967. $globals.SetTest);
  8968. $core.addMethod(
  8969. $core.method({
  8970. selector: "collectionWithNewValue",
  8971. protocol: 'fixture',
  8972. fn: function (){
  8973. var self=this;
  8974. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8975. return $core.withContext(function($ctx1) {
  8976. //>>excludeEnd("ctx");
  8977. var $1;
  8978. $1=$recv($globals.Set)._new();
  8979. $recv($1)._add_($globals.Smalltalk);
  8980. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8981. $ctx1.sendIdx["add:"]=1;
  8982. //>>excludeEnd("ctx");
  8983. $recv($1)._add_(nil);
  8984. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8985. $ctx1.sendIdx["add:"]=2;
  8986. //>>excludeEnd("ctx");
  8987. $recv($1)._add_((3).__at((3)));
  8988. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8989. $ctx1.sendIdx["add:"]=3;
  8990. //>>excludeEnd("ctx");
  8991. $recv($1)._add_("N");
  8992. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8993. $ctx1.sendIdx["add:"]=4;
  8994. //>>excludeEnd("ctx");
  8995. $recv($1)._add_(false);
  8996. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8997. $ctx1.sendIdx["add:"]=5;
  8998. //>>excludeEnd("ctx");
  8999. $recv($1)._add_(self["@sampleBlock"]);
  9000. return $recv($1)._yourself();
  9001. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9002. }, function($ctx1) {$ctx1.fill(self,"collectionWithNewValue",{},$globals.SetTest)});
  9003. //>>excludeEnd("ctx");
  9004. },
  9005. //>>excludeStart("ide", pragmas.excludeIdeData);
  9006. args: [],
  9007. 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",
  9008. referencedClasses: ["Set", "Smalltalk"],
  9009. //>>excludeEnd("ide");
  9010. messageSends: ["add:", "new", "@", "yourself"]
  9011. }),
  9012. $globals.SetTest);
  9013. $core.addMethod(
  9014. $core.method({
  9015. selector: "testAddAll",
  9016. protocol: 'tests',
  9017. fn: function (){
  9018. var self=this;
  9019. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9020. return $core.withContext(function($ctx1) {
  9021. //>>excludeEnd("ctx");
  9022. var $2,$3,$4,$1,$5,$7,$8,$9,$6,$10,$12,$11;
  9023. (
  9024. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9025. $ctx1.supercall = true,
  9026. //>>excludeEnd("ctx");
  9027. ($globals.SetTest.superclass||$boot.nilAsClass).fn.prototype._testAddAll.apply($recv(self), []));
  9028. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9029. $ctx1.supercall = false;
  9030. //>>excludeEnd("ctx");;
  9031. $2=self._collection();
  9032. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9033. $ctx1.sendIdx["collection"]=1;
  9034. //>>excludeEnd("ctx");
  9035. $3=self._collection();
  9036. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9037. $ctx1.sendIdx["collection"]=2;
  9038. //>>excludeEnd("ctx");
  9039. $recv($2)._addAll_($3);
  9040. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9041. $ctx1.sendIdx["addAll:"]=1;
  9042. //>>excludeEnd("ctx");
  9043. $4=$recv($2)._yourself();
  9044. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9045. $ctx1.sendIdx["yourself"]=1;
  9046. //>>excludeEnd("ctx");
  9047. $1=$4;
  9048. $5=self._collection();
  9049. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9050. $ctx1.sendIdx["collection"]=3;
  9051. //>>excludeEnd("ctx");
  9052. self._assert_equals_($1,$5);
  9053. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9054. $ctx1.sendIdx["assert:equals:"]=1;
  9055. //>>excludeEnd("ctx");
  9056. $7=self._collection();
  9057. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9058. $ctx1.sendIdx["collection"]=4;
  9059. //>>excludeEnd("ctx");
  9060. $8=self._collectionWithNewValue();
  9061. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9062. $ctx1.sendIdx["collectionWithNewValue"]=1;
  9063. //>>excludeEnd("ctx");
  9064. $recv($7)._addAll_($8);
  9065. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9066. $ctx1.sendIdx["addAll:"]=2;
  9067. //>>excludeEnd("ctx");
  9068. $9=$recv($7)._yourself();
  9069. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9070. $ctx1.sendIdx["yourself"]=2;
  9071. //>>excludeEnd("ctx");
  9072. $6=$9;
  9073. $10=self._collectionWithNewValue();
  9074. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9075. $ctx1.sendIdx["collectionWithNewValue"]=2;
  9076. //>>excludeEnd("ctx");
  9077. self._assert_equals_($6,$10);
  9078. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9079. $ctx1.sendIdx["assert:equals:"]=2;
  9080. //>>excludeEnd("ctx");
  9081. $12=self._collectionWithNewValue();
  9082. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9083. $ctx1.sendIdx["collectionWithNewValue"]=3;
  9084. //>>excludeEnd("ctx");
  9085. $recv($12)._addAll_(self._collection());
  9086. $11=$recv($12)._yourself();
  9087. self._assert_equals_($11,self._collectionWithNewValue());
  9088. return self;
  9089. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9090. }, function($ctx1) {$ctx1.fill(self,"testAddAll",{},$globals.SetTest)});
  9091. //>>excludeEnd("ctx");
  9092. },
  9093. //>>excludeStart("ide", pragmas.excludeIdeData);
  9094. args: [],
  9095. 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",
  9096. referencedClasses: [],
  9097. //>>excludeEnd("ide");
  9098. messageSends: ["testAddAll", "assert:equals:", "addAll:", "collection", "yourself", "collectionWithNewValue"]
  9099. }),
  9100. $globals.SetTest);
  9101. $core.addMethod(
  9102. $core.method({
  9103. selector: "testAddRemove",
  9104. protocol: 'tests',
  9105. fn: function (){
  9106. var self=this;
  9107. var set;
  9108. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9109. return $core.withContext(function($ctx1) {
  9110. //>>excludeEnd("ctx");
  9111. var $1,$2;
  9112. set=$recv($globals.Set)._new();
  9113. self._assert_($recv(set)._isEmpty());
  9114. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9115. $ctx1.sendIdx["assert:"]=1;
  9116. //>>excludeEnd("ctx");
  9117. $recv(set)._add_((3));
  9118. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9119. $ctx1.sendIdx["add:"]=1;
  9120. //>>excludeEnd("ctx");
  9121. $1=$recv(set)._includes_((3));
  9122. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9123. $ctx1.sendIdx["includes:"]=1;
  9124. //>>excludeEnd("ctx");
  9125. self._assert_($1);
  9126. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9127. $ctx1.sendIdx["assert:"]=2;
  9128. //>>excludeEnd("ctx");
  9129. $recv(set)._add_((5));
  9130. $2=$recv(set)._includes_((5));
  9131. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9132. $ctx1.sendIdx["includes:"]=2;
  9133. //>>excludeEnd("ctx");
  9134. self._assert_($2);
  9135. $recv(set)._remove_((3));
  9136. self._deny_($recv(set)._includes_((3)));
  9137. return self;
  9138. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9139. }, function($ctx1) {$ctx1.fill(self,"testAddRemove",{set:set},$globals.SetTest)});
  9140. //>>excludeEnd("ctx");
  9141. },
  9142. //>>excludeStart("ide", pragmas.excludeIdeData);
  9143. args: [],
  9144. 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)",
  9145. referencedClasses: ["Set"],
  9146. //>>excludeEnd("ide");
  9147. messageSends: ["new", "assert:", "isEmpty", "add:", "includes:", "remove:", "deny:"]
  9148. }),
  9149. $globals.SetTest);
  9150. $core.addMethod(
  9151. $core.method({
  9152. selector: "testAt",
  9153. protocol: 'tests',
  9154. fn: function (){
  9155. var self=this;
  9156. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9157. return $core.withContext(function($ctx1) {
  9158. //>>excludeEnd("ctx");
  9159. self._should_raise_((function(){
  9160. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9161. return $core.withContext(function($ctx2) {
  9162. //>>excludeEnd("ctx");
  9163. return $recv($recv($globals.Set)._new())._at_put_((1),(2));
  9164. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9165. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  9166. //>>excludeEnd("ctx");
  9167. }),$globals.Error);
  9168. return self;
  9169. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9170. }, function($ctx1) {$ctx1.fill(self,"testAt",{},$globals.SetTest)});
  9171. //>>excludeEnd("ctx");
  9172. },
  9173. //>>excludeStart("ide", pragmas.excludeIdeData);
  9174. args: [],
  9175. source: "testAt\x0a\x09self should: [ Set new at: 1 put: 2 ] raise: Error",
  9176. referencedClasses: ["Set", "Error"],
  9177. //>>excludeEnd("ide");
  9178. messageSends: ["should:raise:", "at:put:", "new"]
  9179. }),
  9180. $globals.SetTest);
  9181. $core.addMethod(
  9182. $core.method({
  9183. selector: "testCollect",
  9184. protocol: 'tests',
  9185. fn: function (){
  9186. var self=this;
  9187. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9188. return $core.withContext(function($ctx1) {
  9189. //>>excludeEnd("ctx");
  9190. var $2,$1;
  9191. (
  9192. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9193. $ctx1.supercall = true,
  9194. //>>excludeEnd("ctx");
  9195. ($globals.SetTest.superclass||$boot.nilAsClass).fn.prototype._testCollect.apply($recv(self), []));
  9196. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9197. $ctx1.supercall = false;
  9198. //>>excludeEnd("ctx");;
  9199. $2=[(5), (6), (8)]._asSet();
  9200. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9201. $ctx1.sendIdx["asSet"]=1;
  9202. //>>excludeEnd("ctx");
  9203. $1=$recv($2)._collect_((function(x){
  9204. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9205. return $core.withContext(function($ctx2) {
  9206. //>>excludeEnd("ctx");
  9207. return $recv(x).__backslash_backslash((3));
  9208. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9209. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)});
  9210. //>>excludeEnd("ctx");
  9211. }));
  9212. self._assert_equals_($1,[(0), (2)]._asSet());
  9213. return self;
  9214. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9215. }, function($ctx1) {$ctx1.fill(self,"testCollect",{},$globals.SetTest)});
  9216. //>>excludeEnd("ctx");
  9217. },
  9218. //>>excludeStart("ide", pragmas.excludeIdeData);
  9219. args: [],
  9220. source: "testCollect\x0a\x09super testCollect.\x0a\x09self assert: (#(5 6 8) asSet collect: [ :x | x \x5c\x5c 3 ]) equals: #(0 2) asSet",
  9221. referencedClasses: [],
  9222. //>>excludeEnd("ide");
  9223. messageSends: ["testCollect", "assert:equals:", "collect:", "asSet", "\x5c\x5c"]
  9224. }),
  9225. $globals.SetTest);
  9226. $core.addMethod(
  9227. $core.method({
  9228. selector: "testComma",
  9229. protocol: 'tests',
  9230. fn: function (){
  9231. var self=this;
  9232. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9233. return $core.withContext(function($ctx1) {
  9234. //>>excludeEnd("ctx");
  9235. var $2,$3,$1,$4,$6,$7,$5,$8,$10,$9;
  9236. (
  9237. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9238. $ctx1.supercall = true,
  9239. //>>excludeEnd("ctx");
  9240. ($globals.SetTest.superclass||$boot.nilAsClass).fn.prototype._testComma.apply($recv(self), []));
  9241. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9242. $ctx1.supercall = false;
  9243. //>>excludeEnd("ctx");;
  9244. $2=self._collection();
  9245. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9246. $ctx1.sendIdx["collection"]=1;
  9247. //>>excludeEnd("ctx");
  9248. $3=self._collection();
  9249. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9250. $ctx1.sendIdx["collection"]=2;
  9251. //>>excludeEnd("ctx");
  9252. $1=$recv($2).__comma($3);
  9253. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9254. $ctx1.sendIdx[","]=1;
  9255. //>>excludeEnd("ctx");
  9256. $4=self._collection();
  9257. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9258. $ctx1.sendIdx["collection"]=3;
  9259. //>>excludeEnd("ctx");
  9260. self._assert_equals_($1,$4);
  9261. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9262. $ctx1.sendIdx["assert:equals:"]=1;
  9263. //>>excludeEnd("ctx");
  9264. $6=self._collection();
  9265. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9266. $ctx1.sendIdx["collection"]=4;
  9267. //>>excludeEnd("ctx");
  9268. $7=self._collectionWithNewValue();
  9269. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9270. $ctx1.sendIdx["collectionWithNewValue"]=1;
  9271. //>>excludeEnd("ctx");
  9272. $5=$recv($6).__comma($7);
  9273. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9274. $ctx1.sendIdx[","]=2;
  9275. //>>excludeEnd("ctx");
  9276. $8=self._collectionWithNewValue();
  9277. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9278. $ctx1.sendIdx["collectionWithNewValue"]=2;
  9279. //>>excludeEnd("ctx");
  9280. self._assert_equals_($5,$8);
  9281. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9282. $ctx1.sendIdx["assert:equals:"]=2;
  9283. //>>excludeEnd("ctx");
  9284. $10=self._collectionWithNewValue();
  9285. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9286. $ctx1.sendIdx["collectionWithNewValue"]=3;
  9287. //>>excludeEnd("ctx");
  9288. $9=$recv($10).__comma(self._collection());
  9289. self._assert_equals_($9,self._collectionWithNewValue());
  9290. return self;
  9291. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9292. }, function($ctx1) {$ctx1.fill(self,"testComma",{},$globals.SetTest)});
  9293. //>>excludeEnd("ctx");
  9294. },
  9295. //>>excludeStart("ide", pragmas.excludeIdeData);
  9296. args: [],
  9297. 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",
  9298. referencedClasses: [],
  9299. //>>excludeEnd("ide");
  9300. messageSends: ["testComma", "assert:equals:", ",", "collection", "collectionWithNewValue"]
  9301. }),
  9302. $globals.SetTest);
  9303. $core.addMethod(
  9304. $core.method({
  9305. selector: "testComparing",
  9306. protocol: 'tests',
  9307. fn: function (){
  9308. var self=this;
  9309. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9310. return $core.withContext(function($ctx1) {
  9311. //>>excludeEnd("ctx");
  9312. var $1,$2,$3,$4,$6,$7,$5,$9,$8;
  9313. $1=[(0), (2)]._asSet();
  9314. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9315. $ctx1.sendIdx["asSet"]=1;
  9316. //>>excludeEnd("ctx");
  9317. $2=[(0), (2)]._asSet();
  9318. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9319. $ctx1.sendIdx["asSet"]=2;
  9320. //>>excludeEnd("ctx");
  9321. self._assert_equals_($1,$2);
  9322. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9323. $ctx1.sendIdx["assert:equals:"]=1;
  9324. //>>excludeEnd("ctx");
  9325. $3=[(2), (0)]._asSet();
  9326. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9327. $ctx1.sendIdx["asSet"]=3;
  9328. //>>excludeEnd("ctx");
  9329. $4=[(0), (2)]._asSet();
  9330. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9331. $ctx1.sendIdx["asSet"]=4;
  9332. //>>excludeEnd("ctx");
  9333. self._assert_equals_($3,$4);
  9334. $6=[(0), (2), (3)]._asSet();
  9335. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9336. $ctx1.sendIdx["asSet"]=5;
  9337. //>>excludeEnd("ctx");
  9338. $7=[(0), (2)]._asSet();
  9339. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9340. $ctx1.sendIdx["asSet"]=6;
  9341. //>>excludeEnd("ctx");
  9342. $5=$recv($6).__eq($7);
  9343. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9344. $ctx1.sendIdx["="]=1;
  9345. //>>excludeEnd("ctx");
  9346. self._deny_($5);
  9347. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9348. $ctx1.sendIdx["deny:"]=1;
  9349. //>>excludeEnd("ctx");
  9350. $9=[(1), (2)]._asSet();
  9351. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9352. $ctx1.sendIdx["asSet"]=7;
  9353. //>>excludeEnd("ctx");
  9354. $8=$recv($9).__eq([(0), (2)]._asSet());
  9355. self._deny_($8);
  9356. return self;
  9357. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9358. }, function($ctx1) {$ctx1.fill(self,"testComparing",{},$globals.SetTest)});
  9359. //>>excludeEnd("ctx");
  9360. },
  9361. //>>excludeStart("ide", pragmas.excludeIdeData);
  9362. args: [],
  9363. 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",
  9364. referencedClasses: [],
  9365. //>>excludeEnd("ide");
  9366. messageSends: ["assert:equals:", "asSet", "deny:", "="]
  9367. }),
  9368. $globals.SetTest);
  9369. $core.addMethod(
  9370. $core.method({
  9371. selector: "testPrintString",
  9372. protocol: 'tests',
  9373. fn: function (){
  9374. var self=this;
  9375. var set;
  9376. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9377. return $core.withContext(function($ctx1) {
  9378. //>>excludeEnd("ctx");
  9379. var $1,$2,$3,$4,$5,$6,$7,$8;
  9380. set=$recv($globals.Set)._new();
  9381. $1=$recv(set)._printString();
  9382. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9383. $ctx1.sendIdx["printString"]=1;
  9384. //>>excludeEnd("ctx");
  9385. self._assert_equals_($1,"a Set ()");
  9386. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9387. $ctx1.sendIdx["assert:equals:"]=1;
  9388. //>>excludeEnd("ctx");
  9389. $2=set;
  9390. $recv($2)._add_((1));
  9391. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9392. $ctx1.sendIdx["add:"]=1;
  9393. //>>excludeEnd("ctx");
  9394. $3=$recv($2)._add_((3));
  9395. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9396. $ctx1.sendIdx["add:"]=2;
  9397. //>>excludeEnd("ctx");
  9398. $4=$recv(set)._printString();
  9399. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9400. $ctx1.sendIdx["printString"]=2;
  9401. //>>excludeEnd("ctx");
  9402. self._assert_equals_($4,"a Set (1 3)");
  9403. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9404. $ctx1.sendIdx["assert:equals:"]=2;
  9405. //>>excludeEnd("ctx");
  9406. $recv(set)._add_("foo");
  9407. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9408. $ctx1.sendIdx["add:"]=3;
  9409. //>>excludeEnd("ctx");
  9410. $5=$recv(set)._printString();
  9411. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9412. $ctx1.sendIdx["printString"]=3;
  9413. //>>excludeEnd("ctx");
  9414. self._assert_equals_($5,"a Set (1 3 'foo')");
  9415. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9416. $ctx1.sendIdx["assert:equals:"]=3;
  9417. //>>excludeEnd("ctx");
  9418. $6=set;
  9419. $recv($6)._remove_((1));
  9420. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9421. $ctx1.sendIdx["remove:"]=1;
  9422. //>>excludeEnd("ctx");
  9423. $recv($6)._remove_((3));
  9424. $7=$recv(set)._printString();
  9425. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9426. $ctx1.sendIdx["printString"]=4;
  9427. //>>excludeEnd("ctx");
  9428. self._assert_equals_($7,"a Set ('foo')");
  9429. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9430. $ctx1.sendIdx["assert:equals:"]=4;
  9431. //>>excludeEnd("ctx");
  9432. $recv(set)._add_((3));
  9433. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9434. $ctx1.sendIdx["add:"]=4;
  9435. //>>excludeEnd("ctx");
  9436. $8=$recv(set)._printString();
  9437. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9438. $ctx1.sendIdx["printString"]=5;
  9439. //>>excludeEnd("ctx");
  9440. self._assert_equals_($8,"a Set (3 'foo')");
  9441. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9442. $ctx1.sendIdx["assert:equals:"]=5;
  9443. //>>excludeEnd("ctx");
  9444. $recv(set)._add_((3));
  9445. self._assert_equals_($recv(set)._printString(),"a Set (3 'foo')");
  9446. return self;
  9447. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9448. }, function($ctx1) {$ctx1.fill(self,"testPrintString",{set:set},$globals.SetTest)});
  9449. //>>excludeEnd("ctx");
  9450. },
  9451. //>>excludeStart("ide", pragmas.excludeIdeData);
  9452. args: [],
  9453. 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'')'",
  9454. referencedClasses: ["Set"],
  9455. //>>excludeEnd("ide");
  9456. messageSends: ["new", "assert:equals:", "printString", "add:", "remove:"]
  9457. }),
  9458. $globals.SetTest);
  9459. $core.addMethod(
  9460. $core.method({
  9461. selector: "testUnboxedObjects",
  9462. protocol: 'tests',
  9463. fn: function (){
  9464. var self=this;
  9465. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9466. return $core.withContext(function($ctx1) {
  9467. //>>excludeEnd("ctx");
  9468. var $4,$3,$2,$1;
  9469. $4="foo"._yourself();
  9470. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9471. $ctx1.sendIdx["yourself"]=1;
  9472. //>>excludeEnd("ctx");
  9473. $3=[$4,"foo"._yourself()];
  9474. $2=$recv($3)._asSet();
  9475. $1=$recv($2)._asArray();
  9476. self._assert_equals_($1,["foo"]);
  9477. return self;
  9478. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9479. }, function($ctx1) {$ctx1.fill(self,"testUnboxedObjects",{},$globals.SetTest)});
  9480. //>>excludeEnd("ctx");
  9481. },
  9482. //>>excludeStart("ide", pragmas.excludeIdeData);
  9483. args: [],
  9484. source: "testUnboxedObjects\x0a\x09self assert: {'foo' yourself. 'foo' yourself} asSet asArray equals: #('foo')",
  9485. referencedClasses: [],
  9486. //>>excludeEnd("ide");
  9487. messageSends: ["assert:equals:", "asArray", "asSet", "yourself"]
  9488. }),
  9489. $globals.SetTest);
  9490. $core.addMethod(
  9491. $core.method({
  9492. selector: "testUnicity",
  9493. protocol: 'tests',
  9494. fn: function (){
  9495. var self=this;
  9496. var set;
  9497. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9498. return $core.withContext(function($ctx1) {
  9499. //>>excludeEnd("ctx");
  9500. var $1;
  9501. set=$recv($globals.Set)._new();
  9502. $recv(set)._add_((21));
  9503. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9504. $ctx1.sendIdx["add:"]=1;
  9505. //>>excludeEnd("ctx");
  9506. $recv(set)._add_("hello");
  9507. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9508. $ctx1.sendIdx["add:"]=2;
  9509. //>>excludeEnd("ctx");
  9510. $recv(set)._add_((21));
  9511. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9512. $ctx1.sendIdx["add:"]=3;
  9513. //>>excludeEnd("ctx");
  9514. $1=$recv(set)._size();
  9515. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9516. $ctx1.sendIdx["size"]=1;
  9517. //>>excludeEnd("ctx");
  9518. self._assert_equals_($1,(2));
  9519. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9520. $ctx1.sendIdx["assert:equals:"]=1;
  9521. //>>excludeEnd("ctx");
  9522. $recv(set)._add_("hello");
  9523. self._assert_equals_($recv(set)._size(),(2));
  9524. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9525. $ctx1.sendIdx["assert:equals:"]=2;
  9526. //>>excludeEnd("ctx");
  9527. self._assert_equals_($recv(set)._asArray(),[(21), "hello"]);
  9528. return self;
  9529. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9530. }, function($ctx1) {$ctx1.fill(self,"testUnicity",{set:set},$globals.SetTest)});
  9531. //>>excludeEnd("ctx");
  9532. },
  9533. //>>excludeStart("ide", pragmas.excludeIdeData);
  9534. args: [],
  9535. 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')",
  9536. referencedClasses: ["Set"],
  9537. //>>excludeEnd("ide");
  9538. messageSends: ["new", "add:", "assert:equals:", "size", "asArray"]
  9539. }),
  9540. $globals.SetTest);
  9541. $core.addMethod(
  9542. $core.method({
  9543. selector: "collectionClass",
  9544. protocol: 'fixture',
  9545. fn: function (){
  9546. var self=this;
  9547. return $globals.Set;
  9548. },
  9549. //>>excludeStart("ide", pragmas.excludeIdeData);
  9550. args: [],
  9551. source: "collectionClass\x0a\x09^ Set",
  9552. referencedClasses: ["Set"],
  9553. //>>excludeEnd("ide");
  9554. messageSends: []
  9555. }),
  9556. $globals.SetTest.klass);
  9557. $core.addClass('ConsoleTranscriptTest', $globals.TestCase, [], 'Kernel-Tests');
  9558. $core.addMethod(
  9559. $core.method({
  9560. selector: "testShow",
  9561. protocol: 'tests',
  9562. fn: function (){
  9563. var self=this;
  9564. var originalTranscript;
  9565. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9566. return $core.withContext(function($ctx1) {
  9567. //>>excludeEnd("ctx");
  9568. originalTranscript=$recv($globals.Transcript)._current();
  9569. $recv($globals.Transcript)._register_($recv($globals.ConsoleTranscript)._new());
  9570. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9571. $ctx1.sendIdx["register:"]=1;
  9572. //>>excludeEnd("ctx");
  9573. self._shouldnt_raise_((function(){
  9574. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9575. return $core.withContext(function($ctx2) {
  9576. //>>excludeEnd("ctx");
  9577. return $recv($globals.Transcript)._show_("Hello console!");
  9578. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9579. $ctx2.sendIdx["show:"]=1;
  9580. //>>excludeEnd("ctx");
  9581. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9582. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  9583. //>>excludeEnd("ctx");
  9584. }),$globals.Error);
  9585. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9586. $ctx1.sendIdx["shouldnt:raise:"]=1;
  9587. //>>excludeEnd("ctx");
  9588. self._shouldnt_raise_((function(){
  9589. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9590. return $core.withContext(function($ctx2) {
  9591. //>>excludeEnd("ctx");
  9592. return $recv($globals.Transcript)._show_(console);
  9593. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9594. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  9595. //>>excludeEnd("ctx");
  9596. }),$globals.Error);
  9597. $recv($globals.Transcript)._register_(originalTranscript);
  9598. return self;
  9599. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9600. }, function($ctx1) {$ctx1.fill(self,"testShow",{originalTranscript:originalTranscript},$globals.ConsoleTranscriptTest)});
  9601. //>>excludeEnd("ctx");
  9602. },
  9603. //>>excludeStart("ide", pragmas.excludeIdeData);
  9604. args: [],
  9605. 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.",
  9606. referencedClasses: ["Transcript", "ConsoleTranscript", "Error"],
  9607. //>>excludeEnd("ide");
  9608. messageSends: ["current", "register:", "new", "shouldnt:raise:", "show:"]
  9609. }),
  9610. $globals.ConsoleTranscriptTest);
  9611. $core.addClass('DateTest', $globals.TestCase, [], 'Kernel-Tests');
  9612. $core.addMethod(
  9613. $core.method({
  9614. selector: "testEquality",
  9615. protocol: 'tests',
  9616. fn: function (){
  9617. var self=this;
  9618. var now;
  9619. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9620. return $core.withContext(function($ctx1) {
  9621. //>>excludeEnd("ctx");
  9622. var $1,$3,$4,$2,$6,$7,$5,$9,$11,$10,$8;
  9623. now=$recv($globals.Date)._new();
  9624. $1=$recv(now).__eq(now);
  9625. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9626. $ctx1.sendIdx["="]=1;
  9627. //>>excludeEnd("ctx");
  9628. self._assert_($1);
  9629. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9630. $ctx1.sendIdx["assert:"]=1;
  9631. //>>excludeEnd("ctx");
  9632. $3=now;
  9633. $4=$recv($globals.Date)._fromMilliseconds_((0));
  9634. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9635. $ctx1.sendIdx["fromMilliseconds:"]=1;
  9636. //>>excludeEnd("ctx");
  9637. $2=$recv($3).__eq($4);
  9638. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9639. $ctx1.sendIdx["="]=2;
  9640. //>>excludeEnd("ctx");
  9641. self._deny_($2);
  9642. $6=$recv($globals.Date)._fromMilliseconds_((12345678));
  9643. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9644. $ctx1.sendIdx["fromMilliseconds:"]=2;
  9645. //>>excludeEnd("ctx");
  9646. $7=$recv($globals.Date)._fromMilliseconds_((12345678));
  9647. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9648. $ctx1.sendIdx["fromMilliseconds:"]=3;
  9649. //>>excludeEnd("ctx");
  9650. $5=$recv($6).__eq($7);
  9651. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9652. $ctx1.sendIdx["="]=3;
  9653. //>>excludeEnd("ctx");
  9654. self._assert_($5);
  9655. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9656. $ctx1.sendIdx["assert:"]=2;
  9657. //>>excludeEnd("ctx");
  9658. $9=now;
  9659. $11=$recv(now)._asMilliseconds();
  9660. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9661. $ctx1.sendIdx["asMilliseconds"]=1;
  9662. //>>excludeEnd("ctx");
  9663. $10=$recv($globals.Date)._fromMilliseconds_($11);
  9664. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9665. $ctx1.sendIdx["fromMilliseconds:"]=4;
  9666. //>>excludeEnd("ctx");
  9667. $8=$recv($9).__eq($10);
  9668. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9669. $ctx1.sendIdx["="]=4;
  9670. //>>excludeEnd("ctx");
  9671. self._assert_($8);
  9672. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9673. $ctx1.sendIdx["assert:"]=3;
  9674. //>>excludeEnd("ctx");
  9675. self._assert_($recv($recv($globals.Date)._fromMilliseconds_($recv(now)._asMilliseconds())).__eq(now));
  9676. return self;
  9677. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9678. }, function($ctx1) {$ctx1.fill(self,"testEquality",{now:now},$globals.DateTest)});
  9679. //>>excludeEnd("ctx");
  9680. },
  9681. //>>excludeStart("ide", pragmas.excludeIdeData);
  9682. args: [],
  9683. 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",
  9684. referencedClasses: ["Date"],
  9685. //>>excludeEnd("ide");
  9686. messageSends: ["new", "assert:", "=", "deny:", "fromMilliseconds:", "asMilliseconds"]
  9687. }),
  9688. $globals.DateTest);
  9689. $core.addMethod(
  9690. $core.method({
  9691. selector: "testIdentity",
  9692. protocol: 'tests',
  9693. fn: function (){
  9694. var self=this;
  9695. var now;
  9696. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9697. return $core.withContext(function($ctx1) {
  9698. //>>excludeEnd("ctx");
  9699. var $1,$3,$4,$2,$6,$7,$5,$9,$11,$10,$8;
  9700. now=$recv($globals.Date)._new();
  9701. $1=$recv(now).__eq_eq(now);
  9702. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9703. $ctx1.sendIdx["=="]=1;
  9704. //>>excludeEnd("ctx");
  9705. self._assert_($1);
  9706. $3=now;
  9707. $4=$recv($globals.Date)._fromMilliseconds_((0));
  9708. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9709. $ctx1.sendIdx["fromMilliseconds:"]=1;
  9710. //>>excludeEnd("ctx");
  9711. $2=$recv($3).__eq_eq($4);
  9712. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9713. $ctx1.sendIdx["=="]=2;
  9714. //>>excludeEnd("ctx");
  9715. self._deny_($2);
  9716. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9717. $ctx1.sendIdx["deny:"]=1;
  9718. //>>excludeEnd("ctx");
  9719. $6=$recv($globals.Date)._fromMilliseconds_((12345678));
  9720. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9721. $ctx1.sendIdx["fromMilliseconds:"]=2;
  9722. //>>excludeEnd("ctx");
  9723. $7=$recv($globals.Date)._fromMilliseconds_((12345678));
  9724. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9725. $ctx1.sendIdx["fromMilliseconds:"]=3;
  9726. //>>excludeEnd("ctx");
  9727. $5=$recv($6).__eq_eq($7);
  9728. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9729. $ctx1.sendIdx["=="]=3;
  9730. //>>excludeEnd("ctx");
  9731. self._deny_($5);
  9732. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9733. $ctx1.sendIdx["deny:"]=2;
  9734. //>>excludeEnd("ctx");
  9735. $9=now;
  9736. $11=$recv(now)._asMilliseconds();
  9737. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9738. $ctx1.sendIdx["asMilliseconds"]=1;
  9739. //>>excludeEnd("ctx");
  9740. $10=$recv($globals.Date)._fromMilliseconds_($11);
  9741. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9742. $ctx1.sendIdx["fromMilliseconds:"]=4;
  9743. //>>excludeEnd("ctx");
  9744. $8=$recv($9).__eq_eq($10);
  9745. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9746. $ctx1.sendIdx["=="]=4;
  9747. //>>excludeEnd("ctx");
  9748. self._deny_($8);
  9749. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9750. $ctx1.sendIdx["deny:"]=3;
  9751. //>>excludeEnd("ctx");
  9752. self._deny_($recv($recv($globals.Date)._fromMilliseconds_($recv(now)._asMilliseconds())).__eq_eq(now));
  9753. return self;
  9754. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9755. }, function($ctx1) {$ctx1.fill(self,"testIdentity",{now:now},$globals.DateTest)});
  9756. //>>excludeEnd("ctx");
  9757. },
  9758. //>>excludeStart("ide", pragmas.excludeIdeData);
  9759. args: [],
  9760. 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",
  9761. referencedClasses: ["Date"],
  9762. //>>excludeEnd("ide");
  9763. messageSends: ["new", "assert:", "==", "deny:", "fromMilliseconds:", "asMilliseconds"]
  9764. }),
  9765. $globals.DateTest);
  9766. $core.addClass('JSObjectProxyTest', $globals.TestCase, [], 'Kernel-Tests');
  9767. $core.addMethod(
  9768. $core.method({
  9769. selector: "jsNull",
  9770. protocol: 'accessing',
  9771. fn: function (){
  9772. var self=this;
  9773. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9774. return $core.withContext(function($ctx1) {
  9775. //>>excludeEnd("ctx");
  9776. return null;
  9777. return self;
  9778. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9779. }, function($ctx1) {$ctx1.fill(self,"jsNull",{},$globals.JSObjectProxyTest)});
  9780. //>>excludeEnd("ctx");
  9781. },
  9782. //>>excludeStart("ide", pragmas.excludeIdeData);
  9783. args: [],
  9784. source: "jsNull\x0a\x09<inlineJS: 'return null'>",
  9785. referencedClasses: [],
  9786. //>>excludeEnd("ide");
  9787. messageSends: []
  9788. }),
  9789. $globals.JSObjectProxyTest);
  9790. $core.addMethod(
  9791. $core.method({
  9792. selector: "jsObject",
  9793. protocol: 'accessing',
  9794. fn: function (){
  9795. var self=this;
  9796. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9797. return $core.withContext(function($ctx1) {
  9798. //>>excludeEnd("ctx");
  9799. return {a: 1, b: function() {return 2;}, c: function(object) {return object;}, d: "", "e": null, "f": void 0};
  9800. return self;
  9801. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9802. }, function($ctx1) {$ctx1.fill(self,"jsObject",{},$globals.JSObjectProxyTest)});
  9803. //>>excludeEnd("ctx");
  9804. },
  9805. //>>excludeStart("ide", pragmas.excludeIdeData);
  9806. args: [],
  9807. source: "jsObject\x0a\x09<inlineJS: \x0a\x09\x09'return {a: 1, b: function() {return 2;}, c: function(object) {return object;}, d: \x22\x22, \x22e\x22: null, \x22f\x22: void 0}'>",
  9808. referencedClasses: [],
  9809. //>>excludeEnd("ide");
  9810. messageSends: []
  9811. }),
  9812. $globals.JSObjectProxyTest);
  9813. $core.addMethod(
  9814. $core.method({
  9815. selector: "jsUndefined",
  9816. protocol: 'accessing',
  9817. fn: function (){
  9818. var self=this;
  9819. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9820. return $core.withContext(function($ctx1) {
  9821. //>>excludeEnd("ctx");
  9822. return;
  9823. return self;
  9824. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9825. }, function($ctx1) {$ctx1.fill(self,"jsUndefined",{},$globals.JSObjectProxyTest)});
  9826. //>>excludeEnd("ctx");
  9827. },
  9828. //>>excludeStart("ide", pragmas.excludeIdeData);
  9829. args: [],
  9830. source: "jsUndefined\x0a\x09<inlineJS: 'return'>",
  9831. referencedClasses: [],
  9832. //>>excludeEnd("ide");
  9833. messageSends: []
  9834. }),
  9835. $globals.JSObjectProxyTest);
  9836. $core.addMethod(
  9837. $core.method({
  9838. selector: "testAtIfAbsent",
  9839. protocol: 'tests',
  9840. fn: function (){
  9841. var self=this;
  9842. var testObject;
  9843. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9844. return $core.withContext(function($ctx1) {
  9845. //>>excludeEnd("ctx");
  9846. var $1,$2,$3;
  9847. testObject=self._jsObject();
  9848. $1=$recv(testObject)._at_ifAbsent_("abc",(function(){
  9849. return "Property does not exist";
  9850. }));
  9851. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9852. $ctx1.sendIdx["at:ifAbsent:"]=1;
  9853. //>>excludeEnd("ctx");
  9854. self._assert_equals_($1,"Property does not exist");
  9855. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9856. $ctx1.sendIdx["assert:equals:"]=1;
  9857. //>>excludeEnd("ctx");
  9858. $2=$recv(testObject)._at_ifAbsent_("e",(function(){
  9859. return "Property does not exist";
  9860. }));
  9861. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9862. $ctx1.sendIdx["at:ifAbsent:"]=2;
  9863. //>>excludeEnd("ctx");
  9864. self._assert_equals_($2,nil);
  9865. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9866. $ctx1.sendIdx["assert:equals:"]=2;
  9867. //>>excludeEnd("ctx");
  9868. $3=$recv(testObject)._at_ifAbsent_("a",(function(){
  9869. return "Property does not exist";
  9870. }));
  9871. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9872. $ctx1.sendIdx["at:ifAbsent:"]=3;
  9873. //>>excludeEnd("ctx");
  9874. self._assert_equals_($3,(1));
  9875. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9876. $ctx1.sendIdx["assert:equals:"]=3;
  9877. //>>excludeEnd("ctx");
  9878. self._assert_equals_($recv(testObject)._at_ifAbsent_("f",(function(){
  9879. return "Property does not exist";
  9880. })),nil);
  9881. return self;
  9882. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9883. }, function($ctx1) {$ctx1.fill(self,"testAtIfAbsent",{testObject:testObject},$globals.JSObjectProxyTest)});
  9884. //>>excludeEnd("ctx");
  9885. },
  9886. //>>excludeStart("ide", pragmas.excludeIdeData);
  9887. args: [],
  9888. 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.",
  9889. referencedClasses: [],
  9890. //>>excludeEnd("ide");
  9891. messageSends: ["jsObject", "assert:equals:", "at:ifAbsent:"]
  9892. }),
  9893. $globals.JSObjectProxyTest);
  9894. $core.addMethod(
  9895. $core.method({
  9896. selector: "testAtIfPresent",
  9897. protocol: 'tests',
  9898. fn: function (){
  9899. var self=this;
  9900. var testObject;
  9901. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9902. return $core.withContext(function($ctx1) {
  9903. //>>excludeEnd("ctx");
  9904. var $2,$1,$4,$3,$6,$5;
  9905. testObject=self._jsObject();
  9906. $1=$recv(testObject)._at_ifPresent_("abc",(function(x){
  9907. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9908. return $core.withContext(function($ctx2) {
  9909. //>>excludeEnd("ctx");
  9910. $2=$recv(x)._asString();
  9911. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9912. $ctx2.sendIdx["asString"]=1;
  9913. //>>excludeEnd("ctx");
  9914. return "hello ".__comma($2);
  9915. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9916. $ctx2.sendIdx[","]=1;
  9917. //>>excludeEnd("ctx");
  9918. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9919. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)});
  9920. //>>excludeEnd("ctx");
  9921. }));
  9922. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9923. $ctx1.sendIdx["at:ifPresent:"]=1;
  9924. //>>excludeEnd("ctx");
  9925. self._assert_equals_($1,nil);
  9926. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9927. $ctx1.sendIdx["assert:equals:"]=1;
  9928. //>>excludeEnd("ctx");
  9929. $3=$recv(testObject)._at_ifPresent_("e",(function(x){
  9930. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9931. return $core.withContext(function($ctx2) {
  9932. //>>excludeEnd("ctx");
  9933. $4=$recv(x)._asString();
  9934. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9935. $ctx2.sendIdx["asString"]=2;
  9936. //>>excludeEnd("ctx");
  9937. return "hello ".__comma($4);
  9938. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9939. $ctx2.sendIdx[","]=2;
  9940. //>>excludeEnd("ctx");
  9941. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9942. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,2)});
  9943. //>>excludeEnd("ctx");
  9944. }));
  9945. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9946. $ctx1.sendIdx["at:ifPresent:"]=2;
  9947. //>>excludeEnd("ctx");
  9948. self._assert_equals_($3,"hello nil");
  9949. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9950. $ctx1.sendIdx["assert:equals:"]=2;
  9951. //>>excludeEnd("ctx");
  9952. $5=$recv(testObject)._at_ifPresent_("a",(function(x){
  9953. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9954. return $core.withContext(function($ctx2) {
  9955. //>>excludeEnd("ctx");
  9956. $6=$recv(x)._asString();
  9957. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9958. $ctx2.sendIdx["asString"]=3;
  9959. //>>excludeEnd("ctx");
  9960. return "hello ".__comma($6);
  9961. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9962. $ctx2.sendIdx[","]=3;
  9963. //>>excludeEnd("ctx");
  9964. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9965. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,3)});
  9966. //>>excludeEnd("ctx");
  9967. }));
  9968. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9969. $ctx1.sendIdx["at:ifPresent:"]=3;
  9970. //>>excludeEnd("ctx");
  9971. self._assert_equals_($5,"hello 1");
  9972. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9973. $ctx1.sendIdx["assert:equals:"]=3;
  9974. //>>excludeEnd("ctx");
  9975. self._assert_equals_($recv(testObject)._at_ifPresent_("f",(function(x){
  9976. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9977. return $core.withContext(function($ctx2) {
  9978. //>>excludeEnd("ctx");
  9979. return "hello ".__comma($recv(x)._asString());
  9980. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9981. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,4)});
  9982. //>>excludeEnd("ctx");
  9983. })),"hello nil");
  9984. return self;
  9985. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9986. }, function($ctx1) {$ctx1.fill(self,"testAtIfPresent",{testObject:testObject},$globals.JSObjectProxyTest)});
  9987. //>>excludeEnd("ctx");
  9988. },
  9989. //>>excludeStart("ide", pragmas.excludeIdeData);
  9990. args: [],
  9991. 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'.",
  9992. referencedClasses: [],
  9993. //>>excludeEnd("ide");
  9994. messageSends: ["jsObject", "assert:equals:", "at:ifPresent:", ",", "asString"]
  9995. }),
  9996. $globals.JSObjectProxyTest);
  9997. $core.addMethod(
  9998. $core.method({
  9999. selector: "testAtIfPresentIfAbsent",
  10000. protocol: 'tests',
  10001. fn: function (){
  10002. var self=this;
  10003. var testObject;
  10004. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10005. return $core.withContext(function($ctx1) {
  10006. //>>excludeEnd("ctx");
  10007. var $2,$1,$4,$3,$6,$5;
  10008. testObject=self._jsObject();
  10009. $1=$recv(testObject)._at_ifPresent_ifAbsent_("abc",(function(x){
  10010. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10011. return $core.withContext(function($ctx2) {
  10012. //>>excludeEnd("ctx");
  10013. $2=$recv(x)._asString();
  10014. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10015. $ctx2.sendIdx["asString"]=1;
  10016. //>>excludeEnd("ctx");
  10017. return "hello ".__comma($2);
  10018. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10019. $ctx2.sendIdx[","]=1;
  10020. //>>excludeEnd("ctx");
  10021. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10022. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)});
  10023. //>>excludeEnd("ctx");
  10024. }),(function(){
  10025. return "not present";
  10026. }));
  10027. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10028. $ctx1.sendIdx["at:ifPresent:ifAbsent:"]=1;
  10029. //>>excludeEnd("ctx");
  10030. self._assert_equals_($1,"not present");
  10031. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10032. $ctx1.sendIdx["assert:equals:"]=1;
  10033. //>>excludeEnd("ctx");
  10034. $3=$recv(testObject)._at_ifPresent_ifAbsent_("e",(function(x){
  10035. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10036. return $core.withContext(function($ctx2) {
  10037. //>>excludeEnd("ctx");
  10038. $4=$recv(x)._asString();
  10039. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10040. $ctx2.sendIdx["asString"]=2;
  10041. //>>excludeEnd("ctx");
  10042. return "hello ".__comma($4);
  10043. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10044. $ctx2.sendIdx[","]=2;
  10045. //>>excludeEnd("ctx");
  10046. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10047. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,3)});
  10048. //>>excludeEnd("ctx");
  10049. }),(function(){
  10050. return "not present";
  10051. }));
  10052. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10053. $ctx1.sendIdx["at:ifPresent:ifAbsent:"]=2;
  10054. //>>excludeEnd("ctx");
  10055. self._assert_equals_($3,"hello nil");
  10056. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10057. $ctx1.sendIdx["assert:equals:"]=2;
  10058. //>>excludeEnd("ctx");
  10059. $5=$recv(testObject)._at_ifPresent_ifAbsent_("a",(function(x){
  10060. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10061. return $core.withContext(function($ctx2) {
  10062. //>>excludeEnd("ctx");
  10063. $6=$recv(x)._asString();
  10064. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10065. $ctx2.sendIdx["asString"]=3;
  10066. //>>excludeEnd("ctx");
  10067. return "hello ".__comma($6);
  10068. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10069. $ctx2.sendIdx[","]=3;
  10070. //>>excludeEnd("ctx");
  10071. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10072. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,5)});
  10073. //>>excludeEnd("ctx");
  10074. }),(function(){
  10075. return "not present";
  10076. }));
  10077. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10078. $ctx1.sendIdx["at:ifPresent:ifAbsent:"]=3;
  10079. //>>excludeEnd("ctx");
  10080. self._assert_equals_($5,"hello 1");
  10081. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10082. $ctx1.sendIdx["assert:equals:"]=3;
  10083. //>>excludeEnd("ctx");
  10084. self._assert_equals_($recv(testObject)._at_ifPresent_ifAbsent_("f",(function(x){
  10085. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10086. return $core.withContext(function($ctx2) {
  10087. //>>excludeEnd("ctx");
  10088. return "hello ".__comma($recv(x)._asString());
  10089. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10090. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,7)});
  10091. //>>excludeEnd("ctx");
  10092. }),(function(){
  10093. return "not present";
  10094. })),"hello nil");
  10095. return self;
  10096. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10097. }, function($ctx1) {$ctx1.fill(self,"testAtIfPresentIfAbsent",{testObject:testObject},$globals.JSObjectProxyTest)});
  10098. //>>excludeEnd("ctx");
  10099. },
  10100. //>>excludeStart("ide", pragmas.excludeIdeData);
  10101. args: [],
  10102. 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'.",
  10103. referencedClasses: [],
  10104. //>>excludeEnd("ide");
  10105. messageSends: ["jsObject", "assert:equals:", "at:ifPresent:ifAbsent:", ",", "asString"]
  10106. }),
  10107. $globals.JSObjectProxyTest);
  10108. $core.addMethod(
  10109. $core.method({
  10110. selector: "testAtPut",
  10111. protocol: 'tests',
  10112. fn: function (){
  10113. var self=this;
  10114. var testObject;
  10115. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10116. return $core.withContext(function($ctx1) {
  10117. //>>excludeEnd("ctx");
  10118. var $2,$1;
  10119. testObject=self._jsObject();
  10120. $2=$recv(testObject)._at_("abc");
  10121. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10122. $ctx1.sendIdx["at:"]=1;
  10123. //>>excludeEnd("ctx");
  10124. $1=$recv($2).__tild_eq("xyz");
  10125. self._assert_($1);
  10126. self._assert_equals_($recv(testObject)._at_put_("abc","xyz"),"xyz");
  10127. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10128. $ctx1.sendIdx["assert:equals:"]=1;
  10129. //>>excludeEnd("ctx");
  10130. self._assert_equals_($recv(testObject)._at_("abc"),"xyz");
  10131. return self;
  10132. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10133. }, function($ctx1) {$ctx1.fill(self,"testAtPut",{testObject:testObject},$globals.JSObjectProxyTest)});
  10134. //>>excludeEnd("ctx");
  10135. },
  10136. //>>excludeStart("ide", pragmas.excludeIdeData);
  10137. args: [],
  10138. 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'",
  10139. referencedClasses: [],
  10140. //>>excludeEnd("ide");
  10141. messageSends: ["jsObject", "assert:", "~=", "at:", "assert:equals:", "at:put:"]
  10142. }),
  10143. $globals.JSObjectProxyTest);
  10144. $core.addMethod(
  10145. $core.method({
  10146. selector: "testComparison",
  10147. protocol: 'tests',
  10148. fn: function (){
  10149. var self=this;
  10150. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10151. return $core.withContext(function($ctx1) {
  10152. //>>excludeEnd("ctx");
  10153. var $1,$2;
  10154. self._assert_equals_($recv([console,(2)])._indexOf_(console),(1));
  10155. $1=$recv(console).__eq(console);
  10156. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10157. $ctx1.sendIdx["="]=1;
  10158. //>>excludeEnd("ctx");
  10159. self._assert_($1);
  10160. $2=$recv(console).__eq($recv($globals.Object)._new());
  10161. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10162. $ctx1.sendIdx["="]=2;
  10163. //>>excludeEnd("ctx");
  10164. self._deny_($2);
  10165. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10166. $ctx1.sendIdx["deny:"]=1;
  10167. //>>excludeEnd("ctx");
  10168. self._deny_($recv(console).__eq(self._jsObject()));
  10169. return self;
  10170. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10171. }, function($ctx1) {$ctx1.fill(self,"testComparison",{},$globals.JSObjectProxyTest)});
  10172. //>>excludeEnd("ctx");
  10173. },
  10174. //>>excludeStart("ide", pragmas.excludeIdeData);
  10175. args: [],
  10176. 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",
  10177. referencedClasses: ["Object"],
  10178. //>>excludeEnd("ide");
  10179. messageSends: ["assert:equals:", "indexOf:", "assert:", "=", "deny:", "new", "jsObject"]
  10180. }),
  10181. $globals.JSObjectProxyTest);
  10182. $core.addMethod(
  10183. $core.method({
  10184. selector: "testDNU",
  10185. protocol: 'tests',
  10186. fn: function (){
  10187. var self=this;
  10188. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10189. return $core.withContext(function($ctx1) {
  10190. //>>excludeEnd("ctx");
  10191. self._should_raise_((function(){
  10192. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10193. return $core.withContext(function($ctx2) {
  10194. //>>excludeEnd("ctx");
  10195. return $recv(self._jsObject())._foo();
  10196. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10197. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  10198. //>>excludeEnd("ctx");
  10199. }),$globals.MessageNotUnderstood);
  10200. return self;
  10201. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10202. }, function($ctx1) {$ctx1.fill(self,"testDNU",{},$globals.JSObjectProxyTest)});
  10203. //>>excludeEnd("ctx");
  10204. },
  10205. //>>excludeStart("ide", pragmas.excludeIdeData);
  10206. args: [],
  10207. source: "testDNU\x0a\x09self should: [ self jsObject foo ] raise: MessageNotUnderstood",
  10208. referencedClasses: ["MessageNotUnderstood"],
  10209. //>>excludeEnd("ide");
  10210. messageSends: ["should:raise:", "foo", "jsObject"]
  10211. }),
  10212. $globals.JSObjectProxyTest);
  10213. $core.addMethod(
  10214. $core.method({
  10215. selector: "testDNURegression1057",
  10216. protocol: 'tests',
  10217. fn: function (){
  10218. var self=this;
  10219. var jsObject;
  10220. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10221. return $core.withContext(function($ctx1) {
  10222. //>>excludeEnd("ctx");
  10223. var $1;
  10224. jsObject=[];
  10225. $recv(jsObject)._basicAt_put_("allowJavaScriptCalls",true);
  10226. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10227. $ctx1.sendIdx["basicAt:put:"]=1;
  10228. //>>excludeEnd("ctx");
  10229. $recv(jsObject)._basicAt_put_("foo",(3));
  10230. self._shouldnt_raise_((function(){
  10231. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10232. return $core.withContext(function($ctx2) {
  10233. //>>excludeEnd("ctx");
  10234. return $recv(jsObject)._foo();
  10235. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10236. $ctx2.sendIdx["foo"]=1;
  10237. //>>excludeEnd("ctx");
  10238. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10239. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  10240. //>>excludeEnd("ctx");
  10241. }),$globals.Error);
  10242. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10243. $ctx1.sendIdx["shouldnt:raise:"]=1;
  10244. //>>excludeEnd("ctx");
  10245. $1=$recv(jsObject)._foo();
  10246. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10247. $ctx1.sendIdx["foo"]=2;
  10248. //>>excludeEnd("ctx");
  10249. self._assert_equals_($1,(3));
  10250. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10251. $ctx1.sendIdx["assert:equals:"]=1;
  10252. //>>excludeEnd("ctx");
  10253. self._shouldnt_raise_((function(){
  10254. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10255. return $core.withContext(function($ctx2) {
  10256. //>>excludeEnd("ctx");
  10257. return $recv(jsObject)._foo_((4));
  10258. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10259. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  10260. //>>excludeEnd("ctx");
  10261. }),$globals.Error);
  10262. self._assert_equals_($recv(jsObject)._foo(),(4));
  10263. return self;
  10264. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10265. }, function($ctx1) {$ctx1.fill(self,"testDNURegression1057",{jsObject:jsObject},$globals.JSObjectProxyTest)});
  10266. //>>excludeEnd("ctx");
  10267. },
  10268. //>>excludeStart("ide", pragmas.excludeIdeData);
  10269. args: [],
  10270. 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",
  10271. referencedClasses: ["Error"],
  10272. //>>excludeEnd("ide");
  10273. messageSends: ["basicAt:put:", "shouldnt:raise:", "foo", "assert:equals:", "foo:"]
  10274. }),
  10275. $globals.JSObjectProxyTest);
  10276. $core.addMethod(
  10277. $core.method({
  10278. selector: "testDNURegression1059",
  10279. protocol: 'tests',
  10280. fn: function (){
  10281. var self=this;
  10282. var jsObject;
  10283. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10284. return $core.withContext(function($ctx1) {
  10285. //>>excludeEnd("ctx");
  10286. jsObject=[];
  10287. $recv(jsObject)._basicAt_put_("allowJavaScriptCalls",true);
  10288. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10289. $ctx1.sendIdx["basicAt:put:"]=1;
  10290. //>>excludeEnd("ctx");
  10291. $recv(jsObject)._basicAt_put_("x",(3));
  10292. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10293. $ctx1.sendIdx["basicAt:put:"]=2;
  10294. //>>excludeEnd("ctx");
  10295. $recv(jsObject)._basicAt_put_("x:",(function(){
  10296. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10297. return $core.withContext(function($ctx2) {
  10298. //>>excludeEnd("ctx");
  10299. return self._error();
  10300. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10301. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  10302. //>>excludeEnd("ctx");
  10303. }));
  10304. self._shouldnt_raise_((function(){
  10305. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10306. return $core.withContext(function($ctx2) {
  10307. //>>excludeEnd("ctx");
  10308. return $recv(jsObject)._x_((4));
  10309. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10310. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  10311. //>>excludeEnd("ctx");
  10312. }),$globals.Error);
  10313. self._assert_equals_($recv(jsObject)._x(),(4));
  10314. return self;
  10315. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10316. }, function($ctx1) {$ctx1.fill(self,"testDNURegression1059",{jsObject:jsObject},$globals.JSObjectProxyTest)});
  10317. //>>excludeEnd("ctx");
  10318. },
  10319. //>>excludeStart("ide", pragmas.excludeIdeData);
  10320. args: [],
  10321. 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",
  10322. referencedClasses: ["Error"],
  10323. //>>excludeEnd("ide");
  10324. messageSends: ["basicAt:put:", "error", "shouldnt:raise:", "x:", "assert:equals:", "x"]
  10325. }),
  10326. $globals.JSObjectProxyTest);
  10327. $core.addMethod(
  10328. $core.method({
  10329. selector: "testDNURegression1062",
  10330. protocol: 'tests',
  10331. fn: function (){
  10332. var self=this;
  10333. var jsObject,stored;
  10334. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10335. return $core.withContext(function($ctx1) {
  10336. //>>excludeEnd("ctx");
  10337. jsObject=[];
  10338. $recv(jsObject)._basicAt_put_("allowJavaScriptCalls",true);
  10339. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10340. $ctx1.sendIdx["basicAt:put:"]=1;
  10341. //>>excludeEnd("ctx");
  10342. $recv(jsObject)._basicAt_put_("x",(function(v){
  10343. stored=v;
  10344. return stored;
  10345. }));
  10346. self._shouldnt_raise_((function(){
  10347. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10348. return $core.withContext(function($ctx2) {
  10349. //>>excludeEnd("ctx");
  10350. return $recv(jsObject)._x_((4));
  10351. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10352. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  10353. //>>excludeEnd("ctx");
  10354. }),$globals.Error);
  10355. self._assert_equals_(stored,(4));
  10356. return self;
  10357. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10358. }, function($ctx1) {$ctx1.fill(self,"testDNURegression1062",{jsObject:jsObject,stored:stored},$globals.JSObjectProxyTest)});
  10359. //>>excludeEnd("ctx");
  10360. },
  10361. //>>excludeStart("ide", pragmas.excludeIdeData);
  10362. args: [],
  10363. 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",
  10364. referencedClasses: ["Error"],
  10365. //>>excludeEnd("ide");
  10366. messageSends: ["basicAt:put:", "shouldnt:raise:", "x:", "assert:equals:"]
  10367. }),
  10368. $globals.JSObjectProxyTest);
  10369. $core.addMethod(
  10370. $core.method({
  10371. selector: "testDNUWithAllowJavaScriptCalls",
  10372. protocol: 'tests',
  10373. fn: function (){
  10374. var self=this;
  10375. var jsObject;
  10376. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10377. return $core.withContext(function($ctx1) {
  10378. //>>excludeEnd("ctx");
  10379. jsObject=[];
  10380. $recv(jsObject)._basicAt_put_("allowJavaScriptCalls",true);
  10381. self._should_raise_((function(){
  10382. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10383. return $core.withContext(function($ctx2) {
  10384. //>>excludeEnd("ctx");
  10385. return $recv(jsObject)._foo();
  10386. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10387. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  10388. //>>excludeEnd("ctx");
  10389. }),$globals.MessageNotUnderstood);
  10390. return self;
  10391. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10392. }, function($ctx1) {$ctx1.fill(self,"testDNUWithAllowJavaScriptCalls",{jsObject:jsObject},$globals.JSObjectProxyTest)});
  10393. //>>excludeEnd("ctx");
  10394. },
  10395. //>>excludeStart("ide", pragmas.excludeIdeData);
  10396. args: [],
  10397. source: "testDNUWithAllowJavaScriptCalls\x0a\x09| jsObject |\x0a\x09jsObject := #().\x0a\x09jsObject basicAt: 'allowJavaScriptCalls' put: true.\x0a\x09self should: [ jsObject foo ] raise: MessageNotUnderstood",
  10398. referencedClasses: ["MessageNotUnderstood"],
  10399. //>>excludeEnd("ide");
  10400. messageSends: ["basicAt:put:", "should:raise:", "foo"]
  10401. }),
  10402. $globals.JSObjectProxyTest);
  10403. $core.addMethod(
  10404. $core.method({
  10405. selector: "testMessageSend",
  10406. protocol: 'tests',
  10407. fn: function (){
  10408. var self=this;
  10409. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10410. return $core.withContext(function($ctx1) {
  10411. //>>excludeEnd("ctx");
  10412. var $2,$1,$4,$3;
  10413. $2=self._jsObject();
  10414. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10415. $ctx1.sendIdx["jsObject"]=1;
  10416. //>>excludeEnd("ctx");
  10417. $1=$recv($2)._a();
  10418. self._assert_equals_($1,(1));
  10419. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10420. $ctx1.sendIdx["assert:equals:"]=1;
  10421. //>>excludeEnd("ctx");
  10422. $4=self._jsObject();
  10423. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10424. $ctx1.sendIdx["jsObject"]=2;
  10425. //>>excludeEnd("ctx");
  10426. $3=$recv($4)._b();
  10427. self._assert_equals_($3,(2));
  10428. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10429. $ctx1.sendIdx["assert:equals:"]=2;
  10430. //>>excludeEnd("ctx");
  10431. self._assert_equals_($recv(self._jsObject())._c_((3)),(3));
  10432. return self;
  10433. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10434. }, function($ctx1) {$ctx1.fill(self,"testMessageSend",{},$globals.JSObjectProxyTest)});
  10435. //>>excludeEnd("ctx");
  10436. },
  10437. //>>excludeStart("ide", pragmas.excludeIdeData);
  10438. args: [],
  10439. 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",
  10440. referencedClasses: [],
  10441. //>>excludeEnd("ide");
  10442. messageSends: ["assert:equals:", "a", "jsObject", "b", "c:"]
  10443. }),
  10444. $globals.JSObjectProxyTest);
  10445. $core.addMethod(
  10446. $core.method({
  10447. selector: "testMethodWithArguments",
  10448. protocol: 'tests',
  10449. fn: function (){
  10450. var self=this;
  10451. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10452. return $core.withContext(function($ctx1) {
  10453. //>>excludeEnd("ctx");
  10454. self._assert_equals_($recv(self._jsObject())._c_((1)),(1));
  10455. return self;
  10456. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10457. }, function($ctx1) {$ctx1.fill(self,"testMethodWithArguments",{},$globals.JSObjectProxyTest)});
  10458. //>>excludeEnd("ctx");
  10459. },
  10460. //>>excludeStart("ide", pragmas.excludeIdeData);
  10461. args: [],
  10462. source: "testMethodWithArguments\x0a\x09self assert: (self jsObject c: 1) equals: 1",
  10463. referencedClasses: [],
  10464. //>>excludeEnd("ide");
  10465. messageSends: ["assert:equals:", "c:", "jsObject"]
  10466. }),
  10467. $globals.JSObjectProxyTest);
  10468. $core.addMethod(
  10469. $core.method({
  10470. selector: "testPrinting",
  10471. protocol: 'tests',
  10472. fn: function (){
  10473. var self=this;
  10474. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10475. return $core.withContext(function($ctx1) {
  10476. //>>excludeEnd("ctx");
  10477. self._assert_equals_($recv(self._jsObject())._printString(),"[object Object]");
  10478. return self;
  10479. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10480. }, function($ctx1) {$ctx1.fill(self,"testPrinting",{},$globals.JSObjectProxyTest)});
  10481. //>>excludeEnd("ctx");
  10482. },
  10483. //>>excludeStart("ide", pragmas.excludeIdeData);
  10484. args: [],
  10485. source: "testPrinting\x0a\x09self assert: self jsObject printString equals: '[object Object]'",
  10486. referencedClasses: [],
  10487. //>>excludeEnd("ide");
  10488. messageSends: ["assert:equals:", "printString", "jsObject"]
  10489. }),
  10490. $globals.JSObjectProxyTest);
  10491. $core.addMethod(
  10492. $core.method({
  10493. selector: "testPropertyThatReturnsEmptyString",
  10494. protocol: 'tests',
  10495. fn: function (){
  10496. var self=this;
  10497. var object;
  10498. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10499. return $core.withContext(function($ctx1) {
  10500. //>>excludeEnd("ctx");
  10501. var $1;
  10502. object=self._jsObject();
  10503. $1=$recv(object)._d();
  10504. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10505. $ctx1.sendIdx["d"]=1;
  10506. //>>excludeEnd("ctx");
  10507. self._assert_equals_($1,"");
  10508. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10509. $ctx1.sendIdx["assert:equals:"]=1;
  10510. //>>excludeEnd("ctx");
  10511. $recv(object)._d_("hello");
  10512. self._assert_equals_($recv(object)._d(),"hello");
  10513. return self;
  10514. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10515. }, function($ctx1) {$ctx1.fill(self,"testPropertyThatReturnsEmptyString",{object:object},$globals.JSObjectProxyTest)});
  10516. //>>excludeEnd("ctx");
  10517. },
  10518. //>>excludeStart("ide", pragmas.excludeIdeData);
  10519. args: [],
  10520. 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'",
  10521. referencedClasses: [],
  10522. //>>excludeEnd("ide");
  10523. messageSends: ["jsObject", "assert:equals:", "d", "d:"]
  10524. }),
  10525. $globals.JSObjectProxyTest);
  10526. $core.addMethod(
  10527. $core.method({
  10528. selector: "testPropertyThatReturnsUndefined",
  10529. protocol: 'tests',
  10530. fn: function (){
  10531. var self=this;
  10532. var object;
  10533. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10534. return $core.withContext(function($ctx1) {
  10535. //>>excludeEnd("ctx");
  10536. object=self._jsObject();
  10537. self._shouldnt_raise_((function(){
  10538. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10539. return $core.withContext(function($ctx2) {
  10540. //>>excludeEnd("ctx");
  10541. return $recv(object)._e();
  10542. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10543. $ctx2.sendIdx["e"]=1;
  10544. //>>excludeEnd("ctx");
  10545. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10546. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  10547. //>>excludeEnd("ctx");
  10548. }),$globals.MessageNotUnderstood);
  10549. self._assert_($recv($recv(object)._e())._isNil());
  10550. return self;
  10551. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10552. }, function($ctx1) {$ctx1.fill(self,"testPropertyThatReturnsUndefined",{object:object},$globals.JSObjectProxyTest)});
  10553. //>>excludeEnd("ctx");
  10554. },
  10555. //>>excludeStart("ide", pragmas.excludeIdeData);
  10556. args: [],
  10557. source: "testPropertyThatReturnsUndefined\x0a\x09| object |\x0a\x0a\x09object := self jsObject.\x0a\x09self shouldnt: [ object e ] raise: MessageNotUnderstood.\x0a\x09self assert: object e isNil",
  10558. referencedClasses: ["MessageNotUnderstood"],
  10559. //>>excludeEnd("ide");
  10560. messageSends: ["jsObject", "shouldnt:raise:", "e", "assert:", "isNil"]
  10561. }),
  10562. $globals.JSObjectProxyTest);
  10563. $core.addMethod(
  10564. $core.method({
  10565. selector: "testSetPropertyWithFalsyValue",
  10566. protocol: 'tests',
  10567. fn: function (){
  10568. var self=this;
  10569. var jsObject;
  10570. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10571. return $core.withContext(function($ctx1) {
  10572. //>>excludeEnd("ctx");
  10573. var $1,$2,$3,$4,$5;
  10574. jsObject=self._jsObject();
  10575. $1=$recv(jsObject)._a();
  10576. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10577. $ctx1.sendIdx["a"]=1;
  10578. //>>excludeEnd("ctx");
  10579. self._assert_equals_($1,(1));
  10580. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10581. $ctx1.sendIdx["assert:equals:"]=1;
  10582. //>>excludeEnd("ctx");
  10583. $recv(jsObject)._a_(self._jsNull());
  10584. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10585. $ctx1.sendIdx["a:"]=1;
  10586. //>>excludeEnd("ctx");
  10587. $2=$recv(jsObject)._a();
  10588. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10589. $ctx1.sendIdx["a"]=2;
  10590. //>>excludeEnd("ctx");
  10591. self._assert_equals_($2,nil);
  10592. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10593. $ctx1.sendIdx["assert:equals:"]=2;
  10594. //>>excludeEnd("ctx");
  10595. $recv(jsObject)._a_((0));
  10596. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10597. $ctx1.sendIdx["a:"]=2;
  10598. //>>excludeEnd("ctx");
  10599. $3=$recv(jsObject)._a();
  10600. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10601. $ctx1.sendIdx["a"]=3;
  10602. //>>excludeEnd("ctx");
  10603. self._assert_equals_($3,(0));
  10604. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10605. $ctx1.sendIdx["assert:equals:"]=3;
  10606. //>>excludeEnd("ctx");
  10607. $recv(jsObject)._a_(self._jsUndefined());
  10608. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10609. $ctx1.sendIdx["a:"]=3;
  10610. //>>excludeEnd("ctx");
  10611. $4=$recv(jsObject)._a();
  10612. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10613. $ctx1.sendIdx["a"]=4;
  10614. //>>excludeEnd("ctx");
  10615. self._assert_equals_($4,nil);
  10616. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10617. $ctx1.sendIdx["assert:equals:"]=4;
  10618. //>>excludeEnd("ctx");
  10619. $recv(jsObject)._a_("");
  10620. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10621. $ctx1.sendIdx["a:"]=4;
  10622. //>>excludeEnd("ctx");
  10623. $5=$recv(jsObject)._a();
  10624. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10625. $ctx1.sendIdx["a"]=5;
  10626. //>>excludeEnd("ctx");
  10627. self._assert_equals_($5,"");
  10628. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10629. $ctx1.sendIdx["assert:equals:"]=5;
  10630. //>>excludeEnd("ctx");
  10631. $recv(jsObject)._a_(false);
  10632. self._assert_equals_($recv(jsObject)._a(),false);
  10633. return self;
  10634. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10635. }, function($ctx1) {$ctx1.fill(self,"testSetPropertyWithFalsyValue",{jsObject:jsObject},$globals.JSObjectProxyTest)});
  10636. //>>excludeEnd("ctx");
  10637. },
  10638. //>>excludeStart("ide", pragmas.excludeIdeData);
  10639. args: [],
  10640. 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",
  10641. referencedClasses: [],
  10642. //>>excludeEnd("ide");
  10643. messageSends: ["jsObject", "assert:equals:", "a", "a:", "jsNull", "jsUndefined"]
  10644. }),
  10645. $globals.JSObjectProxyTest);
  10646. $core.addMethod(
  10647. $core.method({
  10648. selector: "testValue",
  10649. protocol: 'tests',
  10650. fn: function (){
  10651. var self=this;
  10652. var testObject;
  10653. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10654. return $core.withContext(function($ctx1) {
  10655. //>>excludeEnd("ctx");
  10656. testObject=self._jsObject();
  10657. $recv(testObject)._at_put_("value","aValue");
  10658. self._assert_equals_($recv(testObject)._value(),"aValue");
  10659. return self;
  10660. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10661. }, function($ctx1) {$ctx1.fill(self,"testValue",{testObject:testObject},$globals.JSObjectProxyTest)});
  10662. //>>excludeEnd("ctx");
  10663. },
  10664. //>>excludeStart("ide", pragmas.excludeIdeData);
  10665. args: [],
  10666. source: "testValue\x0a\x09| testObject |\x0a\x09testObject := self jsObject.\x0a\x09testObject at: 'value' put: 'aValue'.\x0a\x09self assert: testObject value equals: 'aValue'",
  10667. referencedClasses: [],
  10668. //>>excludeEnd("ide");
  10669. messageSends: ["jsObject", "at:put:", "assert:equals:", "value"]
  10670. }),
  10671. $globals.JSObjectProxyTest);
  10672. $core.addMethod(
  10673. $core.method({
  10674. selector: "testYourself",
  10675. protocol: 'tests',
  10676. fn: function (){
  10677. var self=this;
  10678. var object;
  10679. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10680. return $core.withContext(function($ctx1) {
  10681. //>>excludeEnd("ctx");
  10682. var $1;
  10683. $1=self._jsObject();
  10684. $recv($1)._d_("test");
  10685. object=$recv($1)._yourself();
  10686. self._assert_equals_($recv(object)._d(),"test");
  10687. return self;
  10688. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10689. }, function($ctx1) {$ctx1.fill(self,"testYourself",{object:object},$globals.JSObjectProxyTest)});
  10690. //>>excludeEnd("ctx");
  10691. },
  10692. //>>excludeStart("ide", pragmas.excludeIdeData);
  10693. args: [],
  10694. source: "testYourself\x0a\x09| object |\x0a\x09object := self jsObject\x0a\x09\x09d: 'test';\x0a\x09\x09yourself.\x0a\x0a\x09self assert: object d equals: 'test'",
  10695. referencedClasses: [],
  10696. //>>excludeEnd("ide");
  10697. messageSends: ["d:", "jsObject", "yourself", "assert:equals:", "d"]
  10698. }),
  10699. $globals.JSObjectProxyTest);
  10700. $core.addClass('JavaScriptExceptionTest', $globals.TestCase, [], 'Kernel-Tests');
  10701. $core.addMethod(
  10702. $core.method({
  10703. selector: "testCatchingException",
  10704. protocol: 'tests',
  10705. fn: function (){
  10706. var self=this;
  10707. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10708. return $core.withContext(function($ctx1) {
  10709. //>>excludeEnd("ctx");
  10710. $recv((function(){
  10711. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10712. return $core.withContext(function($ctx2) {
  10713. //>>excludeEnd("ctx");
  10714. return self._throwException();
  10715. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10716. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  10717. //>>excludeEnd("ctx");
  10718. }))._on_do_($globals.Error,(function(error){
  10719. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10720. return $core.withContext(function($ctx2) {
  10721. //>>excludeEnd("ctx");
  10722. return self._assert_($recv($recv(error)._exception()).__eq("test"));
  10723. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10724. }, function($ctx2) {$ctx2.fillBlock({error:error},$ctx1,2)});
  10725. //>>excludeEnd("ctx");
  10726. }));
  10727. return self;
  10728. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10729. }, function($ctx1) {$ctx1.fill(self,"testCatchingException",{},$globals.JavaScriptExceptionTest)});
  10730. //>>excludeEnd("ctx");
  10731. },
  10732. //>>excludeStart("ide", pragmas.excludeIdeData);
  10733. args: [],
  10734. source: "testCatchingException\x0a\x09[ self throwException ]\x0a\x09\x09on: Error\x0a\x09\x09do: [ :error |\x0a\x09\x09\x09self assert: error exception = 'test' ]",
  10735. referencedClasses: ["Error"],
  10736. //>>excludeEnd("ide");
  10737. messageSends: ["on:do:", "throwException", "assert:", "=", "exception"]
  10738. }),
  10739. $globals.JavaScriptExceptionTest);
  10740. $core.addMethod(
  10741. $core.method({
  10742. selector: "testRaisingException",
  10743. protocol: 'tests',
  10744. fn: function (){
  10745. var self=this;
  10746. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10747. return $core.withContext(function($ctx1) {
  10748. //>>excludeEnd("ctx");
  10749. self._should_raise_((function(){
  10750. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10751. return $core.withContext(function($ctx2) {
  10752. //>>excludeEnd("ctx");
  10753. return self._throwException();
  10754. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10755. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  10756. //>>excludeEnd("ctx");
  10757. }),$globals.JavaScriptException);
  10758. return self;
  10759. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10760. }, function($ctx1) {$ctx1.fill(self,"testRaisingException",{},$globals.JavaScriptExceptionTest)});
  10761. //>>excludeEnd("ctx");
  10762. },
  10763. //>>excludeStart("ide", pragmas.excludeIdeData);
  10764. args: [],
  10765. source: "testRaisingException\x0a\x09self should: [ self throwException ] raise: JavaScriptException",
  10766. referencedClasses: ["JavaScriptException"],
  10767. //>>excludeEnd("ide");
  10768. messageSends: ["should:raise:", "throwException"]
  10769. }),
  10770. $globals.JavaScriptExceptionTest);
  10771. $core.addMethod(
  10772. $core.method({
  10773. selector: "throwException",
  10774. protocol: 'helpers',
  10775. fn: function (){
  10776. var self=this;
  10777. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10778. return $core.withContext(function($ctx1) {
  10779. //>>excludeEnd("ctx");
  10780. throw "test";
  10781. return self;
  10782. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10783. }, function($ctx1) {$ctx1.fill(self,"throwException",{},$globals.JavaScriptExceptionTest)});
  10784. //>>excludeEnd("ctx");
  10785. },
  10786. //>>excludeStart("ide", pragmas.excludeIdeData);
  10787. args: [],
  10788. source: "throwException\x0a\x09<inlineJS: 'throw \x22test\x22'>",
  10789. referencedClasses: [],
  10790. //>>excludeEnd("ide");
  10791. messageSends: []
  10792. }),
  10793. $globals.JavaScriptExceptionTest);
  10794. $core.addClass('MessageSendTest', $globals.TestCase, [], 'Kernel-Tests');
  10795. $core.addMethod(
  10796. $core.method({
  10797. selector: "testValue",
  10798. protocol: 'tests',
  10799. fn: function (){
  10800. var self=this;
  10801. var messageSend;
  10802. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10803. return $core.withContext(function($ctx1) {
  10804. //>>excludeEnd("ctx");
  10805. var $1;
  10806. $1=$recv($globals.MessageSend)._new();
  10807. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10808. $ctx1.sendIdx["new"]=1;
  10809. //>>excludeEnd("ctx");
  10810. $recv($1)._receiver_($recv($globals.Object)._new());
  10811. $recv($1)._selector_("asString");
  10812. messageSend=$recv($1)._yourself();
  10813. self._assert_equals_($recv(messageSend)._value(),"an Object");
  10814. return self;
  10815. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10816. }, function($ctx1) {$ctx1.fill(self,"testValue",{messageSend:messageSend},$globals.MessageSendTest)});
  10817. //>>excludeEnd("ctx");
  10818. },
  10819. //>>excludeStart("ide", pragmas.excludeIdeData);
  10820. args: [],
  10821. 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'",
  10822. referencedClasses: ["MessageSend", "Object"],
  10823. //>>excludeEnd("ide");
  10824. messageSends: ["receiver:", "new", "selector:", "yourself", "assert:equals:", "value"]
  10825. }),
  10826. $globals.MessageSendTest);
  10827. $core.addMethod(
  10828. $core.method({
  10829. selector: "testValueWithArguments",
  10830. protocol: 'tests',
  10831. fn: function (){
  10832. var self=this;
  10833. var messageSend;
  10834. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10835. return $core.withContext(function($ctx1) {
  10836. //>>excludeEnd("ctx");
  10837. var $1;
  10838. $1=$recv($globals.MessageSend)._new();
  10839. $recv($1)._receiver_((2));
  10840. $recv($1)._selector_("+");
  10841. messageSend=$recv($1)._yourself();
  10842. self._assert_equals_($recv(messageSend)._value_((3)),(5));
  10843. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10844. $ctx1.sendIdx["assert:equals:"]=1;
  10845. //>>excludeEnd("ctx");
  10846. self._assert_equals_($recv(messageSend)._valueWithPossibleArguments_([(4)]),(6));
  10847. return self;
  10848. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10849. }, function($ctx1) {$ctx1.fill(self,"testValueWithArguments",{messageSend:messageSend},$globals.MessageSendTest)});
  10850. //>>excludeEnd("ctx");
  10851. },
  10852. //>>excludeStart("ide", pragmas.excludeIdeData);
  10853. args: [],
  10854. 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",
  10855. referencedClasses: ["MessageSend"],
  10856. //>>excludeEnd("ide");
  10857. messageSends: ["receiver:", "new", "selector:", "yourself", "assert:equals:", "value:", "valueWithPossibleArguments:"]
  10858. }),
  10859. $globals.MessageSendTest);
  10860. $core.addClass('MethodInheritanceTest', $globals.TestCase, ['receiverTop', 'receiverMiddle', 'receiverBottom', 'method', 'performBlock'], 'Kernel-Tests');
  10861. $core.addMethod(
  10862. $core.method({
  10863. selector: "codeGeneratorClass",
  10864. protocol: 'accessing',
  10865. fn: function (){
  10866. var self=this;
  10867. return $globals.CodeGenerator;
  10868. },
  10869. //>>excludeStart("ide", pragmas.excludeIdeData);
  10870. args: [],
  10871. source: "codeGeneratorClass\x0a\x09^ CodeGenerator",
  10872. referencedClasses: ["CodeGenerator"],
  10873. //>>excludeEnd("ide");
  10874. messageSends: []
  10875. }),
  10876. $globals.MethodInheritanceTest);
  10877. $core.addMethod(
  10878. $core.method({
  10879. selector: "compiler",
  10880. protocol: 'factory',
  10881. fn: function (){
  10882. var self=this;
  10883. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10884. return $core.withContext(function($ctx1) {
  10885. //>>excludeEnd("ctx");
  10886. var $1;
  10887. $1=$recv($globals.Compiler)._new();
  10888. $recv($1)._codeGeneratorClass_(self._codeGeneratorClass());
  10889. return $recv($1)._yourself();
  10890. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10891. }, function($ctx1) {$ctx1.fill(self,"compiler",{},$globals.MethodInheritanceTest)});
  10892. //>>excludeEnd("ctx");
  10893. },
  10894. //>>excludeStart("ide", pragmas.excludeIdeData);
  10895. args: [],
  10896. source: "compiler\x0a\x09^ Compiler new\x0a\x09\x09codeGeneratorClass: self codeGeneratorClass;\x0a\x09\x09yourself",
  10897. referencedClasses: ["Compiler"],
  10898. //>>excludeEnd("ide");
  10899. messageSends: ["codeGeneratorClass:", "new", "codeGeneratorClass", "yourself"]
  10900. }),
  10901. $globals.MethodInheritanceTest);
  10902. $core.addMethod(
  10903. $core.method({
  10904. selector: "deinstallBottom",
  10905. protocol: 'testing',
  10906. fn: function (){
  10907. var self=this;
  10908. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10909. return $core.withContext(function($ctx1) {
  10910. //>>excludeEnd("ctx");
  10911. $recv(self._targetClassBottom())._removeCompiledMethod_(self["@method"]);
  10912. return self;
  10913. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10914. }, function($ctx1) {$ctx1.fill(self,"deinstallBottom",{},$globals.MethodInheritanceTest)});
  10915. //>>excludeEnd("ctx");
  10916. },
  10917. //>>excludeStart("ide", pragmas.excludeIdeData);
  10918. args: [],
  10919. source: "deinstallBottom\x0a\x09self targetClassBottom removeCompiledMethod: method",
  10920. referencedClasses: [],
  10921. //>>excludeEnd("ide");
  10922. messageSends: ["removeCompiledMethod:", "targetClassBottom"]
  10923. }),
  10924. $globals.MethodInheritanceTest);
  10925. $core.addMethod(
  10926. $core.method({
  10927. selector: "deinstallMiddle",
  10928. protocol: 'testing',
  10929. fn: function (){
  10930. var self=this;
  10931. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10932. return $core.withContext(function($ctx1) {
  10933. //>>excludeEnd("ctx");
  10934. $recv(self._targetClassMiddle())._removeCompiledMethod_(self["@method"]);
  10935. return self;
  10936. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10937. }, function($ctx1) {$ctx1.fill(self,"deinstallMiddle",{},$globals.MethodInheritanceTest)});
  10938. //>>excludeEnd("ctx");
  10939. },
  10940. //>>excludeStart("ide", pragmas.excludeIdeData);
  10941. args: [],
  10942. source: "deinstallMiddle\x0a\x09self targetClassMiddle removeCompiledMethod: method",
  10943. referencedClasses: [],
  10944. //>>excludeEnd("ide");
  10945. messageSends: ["removeCompiledMethod:", "targetClassMiddle"]
  10946. }),
  10947. $globals.MethodInheritanceTest);
  10948. $core.addMethod(
  10949. $core.method({
  10950. selector: "deinstallTop",
  10951. protocol: 'testing',
  10952. fn: function (){
  10953. var self=this;
  10954. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10955. return $core.withContext(function($ctx1) {
  10956. //>>excludeEnd("ctx");
  10957. $recv(self._targetClassTop())._removeCompiledMethod_(self["@method"]);
  10958. return self;
  10959. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10960. }, function($ctx1) {$ctx1.fill(self,"deinstallTop",{},$globals.MethodInheritanceTest)});
  10961. //>>excludeEnd("ctx");
  10962. },
  10963. //>>excludeStart("ide", pragmas.excludeIdeData);
  10964. args: [],
  10965. source: "deinstallTop\x0a\x09self targetClassTop removeCompiledMethod: method",
  10966. referencedClasses: [],
  10967. //>>excludeEnd("ide");
  10968. messageSends: ["removeCompiledMethod:", "targetClassTop"]
  10969. }),
  10970. $globals.MethodInheritanceTest);
  10971. $core.addMethod(
  10972. $core.method({
  10973. selector: "installBottom:",
  10974. protocol: 'testing',
  10975. fn: function (aString){
  10976. var self=this;
  10977. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10978. return $core.withContext(function($ctx1) {
  10979. //>>excludeEnd("ctx");
  10980. self["@method"]=$recv(self._compiler())._install_forClass_protocol_(aString,self._targetClassBottom(),"tests");
  10981. return self;
  10982. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10983. }, function($ctx1) {$ctx1.fill(self,"installBottom:",{aString:aString},$globals.MethodInheritanceTest)});
  10984. //>>excludeEnd("ctx");
  10985. },
  10986. //>>excludeStart("ide", pragmas.excludeIdeData);
  10987. args: ["aString"],
  10988. source: "installBottom: aString\x0a\x09method := self compiler install: aString forClass: self targetClassBottom protocol: 'tests'",
  10989. referencedClasses: [],
  10990. //>>excludeEnd("ide");
  10991. messageSends: ["install:forClass:protocol:", "compiler", "targetClassBottom"]
  10992. }),
  10993. $globals.MethodInheritanceTest);
  10994. $core.addMethod(
  10995. $core.method({
  10996. selector: "installMiddle:",
  10997. protocol: 'testing',
  10998. fn: function (aString){
  10999. var self=this;
  11000. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11001. return $core.withContext(function($ctx1) {
  11002. //>>excludeEnd("ctx");
  11003. self["@method"]=$recv(self._compiler())._install_forClass_protocol_(aString,self._targetClassMiddle(),"tests");
  11004. return self;
  11005. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11006. }, function($ctx1) {$ctx1.fill(self,"installMiddle:",{aString:aString},$globals.MethodInheritanceTest)});
  11007. //>>excludeEnd("ctx");
  11008. },
  11009. //>>excludeStart("ide", pragmas.excludeIdeData);
  11010. args: ["aString"],
  11011. source: "installMiddle: aString\x0a\x09method := self compiler install: aString forClass: self targetClassMiddle protocol: 'tests'",
  11012. referencedClasses: [],
  11013. //>>excludeEnd("ide");
  11014. messageSends: ["install:forClass:protocol:", "compiler", "targetClassMiddle"]
  11015. }),
  11016. $globals.MethodInheritanceTest);
  11017. $core.addMethod(
  11018. $core.method({
  11019. selector: "installTop:",
  11020. protocol: 'testing',
  11021. fn: function (aString){
  11022. var self=this;
  11023. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11024. return $core.withContext(function($ctx1) {
  11025. //>>excludeEnd("ctx");
  11026. self["@method"]=$recv(self._compiler())._install_forClass_protocol_(aString,self._targetClassTop(),"tests");
  11027. return self;
  11028. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11029. }, function($ctx1) {$ctx1.fill(self,"installTop:",{aString:aString},$globals.MethodInheritanceTest)});
  11030. //>>excludeEnd("ctx");
  11031. },
  11032. //>>excludeStart("ide", pragmas.excludeIdeData);
  11033. args: ["aString"],
  11034. source: "installTop: aString\x0a\x09method := self compiler install: aString forClass: self targetClassTop protocol: 'tests'",
  11035. referencedClasses: [],
  11036. //>>excludeEnd("ide");
  11037. messageSends: ["install:forClass:protocol:", "compiler", "targetClassTop"]
  11038. }),
  11039. $globals.MethodInheritanceTest);
  11040. $core.addMethod(
  11041. $core.method({
  11042. selector: "setUp",
  11043. protocol: 'initialization',
  11044. fn: function (){
  11045. var self=this;
  11046. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11047. return $core.withContext(function($ctx1) {
  11048. //>>excludeEnd("ctx");
  11049. self["@receiverTop"]=$recv(self._targetClassTop())._new();
  11050. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11051. $ctx1.sendIdx["new"]=1;
  11052. //>>excludeEnd("ctx");
  11053. self["@receiverMiddle"]=$recv(self._targetClassMiddle())._new();
  11054. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11055. $ctx1.sendIdx["new"]=2;
  11056. //>>excludeEnd("ctx");
  11057. self["@receiverBottom"]=$recv(self._targetClassBottom())._new();
  11058. self["@method"]=nil;
  11059. self["@performBlock"]=(function(){
  11060. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11061. return $core.withContext(function($ctx2) {
  11062. //>>excludeEnd("ctx");
  11063. return self._error_("performBlock not initialized");
  11064. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11065. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  11066. //>>excludeEnd("ctx");
  11067. });
  11068. return self;
  11069. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11070. }, function($ctx1) {$ctx1.fill(self,"setUp",{},$globals.MethodInheritanceTest)});
  11071. //>>excludeEnd("ctx");
  11072. },
  11073. //>>excludeStart("ide", pragmas.excludeIdeData);
  11074. args: [],
  11075. 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' ]",
  11076. referencedClasses: [],
  11077. //>>excludeEnd("ide");
  11078. messageSends: ["new", "targetClassTop", "targetClassMiddle", "targetClassBottom", "error:"]
  11079. }),
  11080. $globals.MethodInheritanceTest);
  11081. $core.addMethod(
  11082. $core.method({
  11083. selector: "shouldMNU",
  11084. protocol: 'testing',
  11085. fn: function (){
  11086. var self=this;
  11087. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11088. return $core.withContext(function($ctx1) {
  11089. //>>excludeEnd("ctx");
  11090. self._shouldMNUTop();
  11091. self._shouldMNUMiddle();
  11092. self._shouldMNUBottom();
  11093. return self;
  11094. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11095. }, function($ctx1) {$ctx1.fill(self,"shouldMNU",{},$globals.MethodInheritanceTest)});
  11096. //>>excludeEnd("ctx");
  11097. },
  11098. //>>excludeStart("ide", pragmas.excludeIdeData);
  11099. args: [],
  11100. source: "shouldMNU\x0a\x09self shouldMNUTop.\x0a\x09self shouldMNUMiddle.\x0a\x09self shouldMNUBottom",
  11101. referencedClasses: [],
  11102. //>>excludeEnd("ide");
  11103. messageSends: ["shouldMNUTop", "shouldMNUMiddle", "shouldMNUBottom"]
  11104. }),
  11105. $globals.MethodInheritanceTest);
  11106. $core.addMethod(
  11107. $core.method({
  11108. selector: "shouldMNUBottom",
  11109. protocol: 'testing',
  11110. fn: function (){
  11111. var self=this;
  11112. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11113. return $core.withContext(function($ctx1) {
  11114. //>>excludeEnd("ctx");
  11115. self._should_raise_((function(){
  11116. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11117. return $core.withContext(function($ctx2) {
  11118. //>>excludeEnd("ctx");
  11119. return $recv(self["@performBlock"])._value_(self["@receiverBottom"]);
  11120. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11121. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  11122. //>>excludeEnd("ctx");
  11123. }),$globals.MessageNotUnderstood);
  11124. return self;
  11125. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11126. }, function($ctx1) {$ctx1.fill(self,"shouldMNUBottom",{},$globals.MethodInheritanceTest)});
  11127. //>>excludeEnd("ctx");
  11128. },
  11129. //>>excludeStart("ide", pragmas.excludeIdeData);
  11130. args: [],
  11131. source: "shouldMNUBottom\x0a\x09self should: [ performBlock value: receiverBottom ] raise: MessageNotUnderstood",
  11132. referencedClasses: ["MessageNotUnderstood"],
  11133. //>>excludeEnd("ide");
  11134. messageSends: ["should:raise:", "value:"]
  11135. }),
  11136. $globals.MethodInheritanceTest);
  11137. $core.addMethod(
  11138. $core.method({
  11139. selector: "shouldMNUMiddle",
  11140. protocol: 'testing',
  11141. fn: function (){
  11142. var self=this;
  11143. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11144. return $core.withContext(function($ctx1) {
  11145. //>>excludeEnd("ctx");
  11146. self._should_raise_((function(){
  11147. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11148. return $core.withContext(function($ctx2) {
  11149. //>>excludeEnd("ctx");
  11150. return $recv(self["@performBlock"])._value_(self["@receiverMiddle"]);
  11151. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11152. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  11153. //>>excludeEnd("ctx");
  11154. }),$globals.MessageNotUnderstood);
  11155. return self;
  11156. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11157. }, function($ctx1) {$ctx1.fill(self,"shouldMNUMiddle",{},$globals.MethodInheritanceTest)});
  11158. //>>excludeEnd("ctx");
  11159. },
  11160. //>>excludeStart("ide", pragmas.excludeIdeData);
  11161. args: [],
  11162. source: "shouldMNUMiddle\x0a\x09self should: [ performBlock value: receiverMiddle ] raise: MessageNotUnderstood",
  11163. referencedClasses: ["MessageNotUnderstood"],
  11164. //>>excludeEnd("ide");
  11165. messageSends: ["should:raise:", "value:"]
  11166. }),
  11167. $globals.MethodInheritanceTest);
  11168. $core.addMethod(
  11169. $core.method({
  11170. selector: "shouldMNUTop",
  11171. protocol: 'testing',
  11172. fn: function (){
  11173. var self=this;
  11174. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11175. return $core.withContext(function($ctx1) {
  11176. //>>excludeEnd("ctx");
  11177. self._should_raise_((function(){
  11178. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11179. return $core.withContext(function($ctx2) {
  11180. //>>excludeEnd("ctx");
  11181. return $recv(self["@performBlock"])._value_(self["@receiverTop"]);
  11182. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11183. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  11184. //>>excludeEnd("ctx");
  11185. }),$globals.MessageNotUnderstood);
  11186. return self;
  11187. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11188. }, function($ctx1) {$ctx1.fill(self,"shouldMNUTop",{},$globals.MethodInheritanceTest)});
  11189. //>>excludeEnd("ctx");
  11190. },
  11191. //>>excludeStart("ide", pragmas.excludeIdeData);
  11192. args: [],
  11193. source: "shouldMNUTop\x0a\x09self should: [ performBlock value: receiverTop ] raise: MessageNotUnderstood",
  11194. referencedClasses: ["MessageNotUnderstood"],
  11195. //>>excludeEnd("ide");
  11196. messageSends: ["should:raise:", "value:"]
  11197. }),
  11198. $globals.MethodInheritanceTest);
  11199. $core.addMethod(
  11200. $core.method({
  11201. selector: "shouldReturn:",
  11202. protocol: 'testing',
  11203. fn: function (anObject){
  11204. var self=this;
  11205. var result;
  11206. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11207. return $core.withContext(function($ctx1) {
  11208. //>>excludeEnd("ctx");
  11209. result=$recv(self["@performBlock"])._value_(self["@receiverTop"]);
  11210. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11211. $ctx1.sendIdx["value:"]=1;
  11212. //>>excludeEnd("ctx");
  11213. self._assert_equals_(["top",anObject],["top",result]);
  11214. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11215. $ctx1.sendIdx["assert:equals:"]=1;
  11216. //>>excludeEnd("ctx");
  11217. result=$recv(self["@performBlock"])._value_(self["@receiverMiddle"]);
  11218. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11219. $ctx1.sendIdx["value:"]=2;
  11220. //>>excludeEnd("ctx");
  11221. self._assert_equals_(["middle",anObject],["middle",result]);
  11222. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11223. $ctx1.sendIdx["assert:equals:"]=2;
  11224. //>>excludeEnd("ctx");
  11225. result=$recv(self["@performBlock"])._value_(self["@receiverBottom"]);
  11226. self._assert_equals_(["bottom",anObject],["bottom",result]);
  11227. return self;
  11228. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11229. }, function($ctx1) {$ctx1.fill(self,"shouldReturn:",{anObject:anObject,result:result},$globals.MethodInheritanceTest)});
  11230. //>>excludeEnd("ctx");
  11231. },
  11232. //>>excludeStart("ide", pragmas.excludeIdeData);
  11233. args: ["anObject"],
  11234. 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 }",
  11235. referencedClasses: [],
  11236. //>>excludeEnd("ide");
  11237. messageSends: ["value:", "assert:equals:"]
  11238. }),
  11239. $globals.MethodInheritanceTest);
  11240. $core.addMethod(
  11241. $core.method({
  11242. selector: "shouldReturn:and:and:",
  11243. protocol: 'testing',
  11244. fn: function (anObject,anObject2,anObject3){
  11245. var self=this;
  11246. var result;
  11247. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11248. return $core.withContext(function($ctx1) {
  11249. //>>excludeEnd("ctx");
  11250. result=$recv(self["@performBlock"])._value_(self["@receiverTop"]);
  11251. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11252. $ctx1.sendIdx["value:"]=1;
  11253. //>>excludeEnd("ctx");
  11254. self._assert_equals_(["top",anObject],["top",result]);
  11255. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11256. $ctx1.sendIdx["assert:equals:"]=1;
  11257. //>>excludeEnd("ctx");
  11258. result=$recv(self["@performBlock"])._value_(self["@receiverMiddle"]);
  11259. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11260. $ctx1.sendIdx["value:"]=2;
  11261. //>>excludeEnd("ctx");
  11262. self._assert_equals_(["middle",anObject2],["middle",result]);
  11263. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11264. $ctx1.sendIdx["assert:equals:"]=2;
  11265. //>>excludeEnd("ctx");
  11266. result=$recv(self["@performBlock"])._value_(self["@receiverBottom"]);
  11267. self._assert_equals_(["bottom",anObject3],["bottom",result]);
  11268. return self;
  11269. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11270. }, function($ctx1) {$ctx1.fill(self,"shouldReturn:and:and:",{anObject:anObject,anObject2:anObject2,anObject3:anObject3,result:result},$globals.MethodInheritanceTest)});
  11271. //>>excludeEnd("ctx");
  11272. },
  11273. //>>excludeStart("ide", pragmas.excludeIdeData);
  11274. args: ["anObject", "anObject2", "anObject3"],
  11275. 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 }",
  11276. referencedClasses: [],
  11277. //>>excludeEnd("ide");
  11278. messageSends: ["value:", "assert:equals:"]
  11279. }),
  11280. $globals.MethodInheritanceTest);
  11281. $core.addMethod(
  11282. $core.method({
  11283. selector: "targetClassBottom",
  11284. protocol: 'accessing',
  11285. fn: function (){
  11286. var self=this;
  11287. return $globals.JavaScriptException;
  11288. },
  11289. //>>excludeStart("ide", pragmas.excludeIdeData);
  11290. args: [],
  11291. source: "targetClassBottom\x0a\x09^ JavaScriptException",
  11292. referencedClasses: ["JavaScriptException"],
  11293. //>>excludeEnd("ide");
  11294. messageSends: []
  11295. }),
  11296. $globals.MethodInheritanceTest);
  11297. $core.addMethod(
  11298. $core.method({
  11299. selector: "targetClassMiddle",
  11300. protocol: 'accessing',
  11301. fn: function (){
  11302. var self=this;
  11303. return $globals.Error;
  11304. },
  11305. //>>excludeStart("ide", pragmas.excludeIdeData);
  11306. args: [],
  11307. source: "targetClassMiddle\x0a\x09^ Error",
  11308. referencedClasses: ["Error"],
  11309. //>>excludeEnd("ide");
  11310. messageSends: []
  11311. }),
  11312. $globals.MethodInheritanceTest);
  11313. $core.addMethod(
  11314. $core.method({
  11315. selector: "targetClassTop",
  11316. protocol: 'accessing',
  11317. fn: function (){
  11318. var self=this;
  11319. return $globals.Object;
  11320. },
  11321. //>>excludeStart("ide", pragmas.excludeIdeData);
  11322. args: [],
  11323. source: "targetClassTop\x0a\x09^ Object",
  11324. referencedClasses: ["Object"],
  11325. //>>excludeEnd("ide");
  11326. messageSends: []
  11327. }),
  11328. $globals.MethodInheritanceTest);
  11329. $core.addMethod(
  11330. $core.method({
  11331. selector: "tearDown",
  11332. protocol: 'initialization',
  11333. fn: function (){
  11334. var self=this;
  11335. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11336. return $core.withContext(function($ctx1) {
  11337. //>>excludeEnd("ctx");
  11338. $recv((function(){
  11339. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11340. return $core.withContext(function($ctx2) {
  11341. //>>excludeEnd("ctx");
  11342. return self._deinstallTop();
  11343. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11344. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  11345. //>>excludeEnd("ctx");
  11346. }))._on_do_($globals.Error,(function(){
  11347. }));
  11348. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11349. $ctx1.sendIdx["on:do:"]=1;
  11350. //>>excludeEnd("ctx");
  11351. $recv((function(){
  11352. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11353. return $core.withContext(function($ctx2) {
  11354. //>>excludeEnd("ctx");
  11355. return self._deinstallMiddle();
  11356. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11357. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  11358. //>>excludeEnd("ctx");
  11359. }))._on_do_($globals.Error,(function(){
  11360. }));
  11361. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11362. $ctx1.sendIdx["on:do:"]=2;
  11363. //>>excludeEnd("ctx");
  11364. $recv((function(){
  11365. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11366. return $core.withContext(function($ctx2) {
  11367. //>>excludeEnd("ctx");
  11368. return self._deinstallBottom();
  11369. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11370. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,5)});
  11371. //>>excludeEnd("ctx");
  11372. }))._on_do_($globals.Error,(function(){
  11373. }));
  11374. return self;
  11375. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11376. }, function($ctx1) {$ctx1.fill(self,"tearDown",{},$globals.MethodInheritanceTest)});
  11377. //>>excludeEnd("ctx");
  11378. },
  11379. //>>excludeStart("ide", pragmas.excludeIdeData);
  11380. args: [],
  11381. source: "tearDown\x0a\x09[ self deinstallTop ] on: Error do: [ ].\x0a\x09[ self deinstallMiddle ] on: Error do: [ ].\x0a\x09[ self deinstallBottom ] on: Error do: [ ]",
  11382. referencedClasses: ["Error"],
  11383. //>>excludeEnd("ide");
  11384. messageSends: ["on:do:", "deinstallTop", "deinstallMiddle", "deinstallBottom"]
  11385. }),
  11386. $globals.MethodInheritanceTest);
  11387. $core.addMethod(
  11388. $core.method({
  11389. selector: "testMNU11",
  11390. protocol: 'tests',
  11391. fn: function (){
  11392. var self=this;
  11393. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11394. return $core.withContext(function($ctx1) {
  11395. //>>excludeEnd("ctx");
  11396. self["@performBlock"]=(function(x){
  11397. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11398. return $core.withContext(function($ctx2) {
  11399. //>>excludeEnd("ctx");
  11400. return $recv(x)._foo();
  11401. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11402. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)});
  11403. //>>excludeEnd("ctx");
  11404. });
  11405. self._shouldMNU();
  11406. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11407. $ctx1.sendIdx["shouldMNU"]=1;
  11408. //>>excludeEnd("ctx");
  11409. self._installTop_("foo ^ false");
  11410. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11411. $ctx1.sendIdx["installTop:"]=1;
  11412. //>>excludeEnd("ctx");
  11413. self._installTop_("foo ^ true");
  11414. self._deinstallTop();
  11415. self._shouldMNU();
  11416. return self;
  11417. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11418. }, function($ctx1) {$ctx1.fill(self,"testMNU11",{},$globals.MethodInheritanceTest)});
  11419. //>>excludeEnd("ctx");
  11420. },
  11421. //>>excludeStart("ide", pragmas.excludeIdeData);
  11422. args: [],
  11423. 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",
  11424. referencedClasses: [],
  11425. //>>excludeEnd("ide");
  11426. messageSends: ["foo", "shouldMNU", "installTop:", "deinstallTop"]
  11427. }),
  11428. $globals.MethodInheritanceTest);
  11429. $core.addMethod(
  11430. $core.method({
  11431. selector: "testMNU22",
  11432. protocol: 'tests',
  11433. fn: function (){
  11434. var self=this;
  11435. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11436. return $core.withContext(function($ctx1) {
  11437. //>>excludeEnd("ctx");
  11438. self["@performBlock"]=(function(x){
  11439. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11440. return $core.withContext(function($ctx2) {
  11441. //>>excludeEnd("ctx");
  11442. return $recv(x)._foo();
  11443. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11444. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)});
  11445. //>>excludeEnd("ctx");
  11446. });
  11447. self._shouldMNU();
  11448. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11449. $ctx1.sendIdx["shouldMNU"]=1;
  11450. //>>excludeEnd("ctx");
  11451. self._installMiddle_("foo ^ false");
  11452. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11453. $ctx1.sendIdx["installMiddle:"]=1;
  11454. //>>excludeEnd("ctx");
  11455. self._installMiddle_("foo ^ true");
  11456. self._deinstallMiddle();
  11457. self._shouldMNU();
  11458. return self;
  11459. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11460. }, function($ctx1) {$ctx1.fill(self,"testMNU22",{},$globals.MethodInheritanceTest)});
  11461. //>>excludeEnd("ctx");
  11462. },
  11463. //>>excludeStart("ide", pragmas.excludeIdeData);
  11464. args: [],
  11465. 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",
  11466. referencedClasses: [],
  11467. //>>excludeEnd("ide");
  11468. messageSends: ["foo", "shouldMNU", "installMiddle:", "deinstallMiddle"]
  11469. }),
  11470. $globals.MethodInheritanceTest);
  11471. $core.addMethod(
  11472. $core.method({
  11473. selector: "testReturns1",
  11474. protocol: 'tests',
  11475. fn: function (){
  11476. var self=this;
  11477. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11478. return $core.withContext(function($ctx1) {
  11479. //>>excludeEnd("ctx");
  11480. self["@performBlock"]=(function(x){
  11481. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11482. return $core.withContext(function($ctx2) {
  11483. //>>excludeEnd("ctx");
  11484. return $recv(x)._foo();
  11485. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11486. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)});
  11487. //>>excludeEnd("ctx");
  11488. });
  11489. self._installTop_("foo ^ false");
  11490. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11491. $ctx1.sendIdx["installTop:"]=1;
  11492. //>>excludeEnd("ctx");
  11493. self._shouldReturn_(false);
  11494. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11495. $ctx1.sendIdx["shouldReturn:"]=1;
  11496. //>>excludeEnd("ctx");
  11497. self._installTop_("foo ^ true");
  11498. self._shouldReturn_(true);
  11499. return self;
  11500. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11501. }, function($ctx1) {$ctx1.fill(self,"testReturns1",{},$globals.MethodInheritanceTest)});
  11502. //>>excludeEnd("ctx");
  11503. },
  11504. //>>excludeStart("ide", pragmas.excludeIdeData);
  11505. args: [],
  11506. 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",
  11507. referencedClasses: [],
  11508. //>>excludeEnd("ide");
  11509. messageSends: ["foo", "installTop:", "shouldReturn:"]
  11510. }),
  11511. $globals.MethodInheritanceTest);
  11512. $core.addClass('NumberTest', $globals.TestCase, [], 'Kernel-Tests');
  11513. $core.addMethod(
  11514. $core.method({
  11515. selector: "testAbs",
  11516. protocol: 'tests',
  11517. fn: function (){
  11518. var self=this;
  11519. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11520. return $core.withContext(function($ctx1) {
  11521. //>>excludeEnd("ctx");
  11522. var $1;
  11523. $1=(4)._abs();
  11524. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11525. $ctx1.sendIdx["abs"]=1;
  11526. //>>excludeEnd("ctx");
  11527. self._assert_equals_($1,(4));
  11528. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11529. $ctx1.sendIdx["assert:equals:"]=1;
  11530. //>>excludeEnd("ctx");
  11531. self._assert_equals_((-4)._abs(),(4));
  11532. return self;
  11533. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11534. }, function($ctx1) {$ctx1.fill(self,"testAbs",{},$globals.NumberTest)});
  11535. //>>excludeEnd("ctx");
  11536. },
  11537. //>>excludeStart("ide", pragmas.excludeIdeData);
  11538. args: [],
  11539. source: "testAbs\x0a\x09self assert: 4 abs equals: 4.\x0a\x09self assert: -4 abs equals: 4",
  11540. referencedClasses: [],
  11541. //>>excludeEnd("ide");
  11542. messageSends: ["assert:equals:", "abs"]
  11543. }),
  11544. $globals.NumberTest);
  11545. $core.addMethod(
  11546. $core.method({
  11547. selector: "testArithmetic",
  11548. protocol: 'tests',
  11549. fn: function (){
  11550. var self=this;
  11551. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11552. return $core.withContext(function($ctx1) {
  11553. //>>excludeEnd("ctx");
  11554. var $1,$2,$3,$5,$4;
  11555. $1=(1.5).__plus((1));
  11556. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11557. $ctx1.sendIdx["+"]=1;
  11558. //>>excludeEnd("ctx");
  11559. self._assert_equals_($1,(2.5));
  11560. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11561. $ctx1.sendIdx["assert:equals:"]=1;
  11562. //>>excludeEnd("ctx");
  11563. $2=(2).__minus((1));
  11564. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11565. $ctx1.sendIdx["-"]=1;
  11566. //>>excludeEnd("ctx");
  11567. self._assert_equals_($2,(1));
  11568. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11569. $ctx1.sendIdx["assert:equals:"]=2;
  11570. //>>excludeEnd("ctx");
  11571. self._assert_equals_((-2).__minus((1)),(-3));
  11572. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11573. $ctx1.sendIdx["assert:equals:"]=3;
  11574. //>>excludeEnd("ctx");
  11575. self._assert_equals_((12).__slash((2)),(6));
  11576. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11577. $ctx1.sendIdx["assert:equals:"]=4;
  11578. //>>excludeEnd("ctx");
  11579. $3=(3).__star((4));
  11580. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11581. $ctx1.sendIdx["*"]=1;
  11582. //>>excludeEnd("ctx");
  11583. self._assert_equals_($3,(12));
  11584. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11585. $ctx1.sendIdx["assert:equals:"]=5;
  11586. //>>excludeEnd("ctx");
  11587. self._assert_equals_((7).__slash_slash((2)),(3));
  11588. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11589. $ctx1.sendIdx["assert:equals:"]=6;
  11590. //>>excludeEnd("ctx");
  11591. self._assert_equals_((7).__backslash_backslash((2)),(1));
  11592. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11593. $ctx1.sendIdx["assert:equals:"]=7;
  11594. //>>excludeEnd("ctx");
  11595. $5=(1).__plus((2));
  11596. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11597. $ctx1.sendIdx["+"]=2;
  11598. //>>excludeEnd("ctx");
  11599. $4=$recv($5).__star((3));
  11600. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11601. $ctx1.sendIdx["*"]=2;
  11602. //>>excludeEnd("ctx");
  11603. self._assert_equals_($4,(9));
  11604. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11605. $ctx1.sendIdx["assert:equals:"]=8;
  11606. //>>excludeEnd("ctx");
  11607. self._assert_equals_((1).__plus((2).__star((3))),(7));
  11608. return self;
  11609. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11610. }, function($ctx1) {$ctx1.fill(self,"testArithmetic",{},$globals.NumberTest)});
  11611. //>>excludeEnd("ctx");
  11612. },
  11613. //>>excludeStart("ide", pragmas.excludeIdeData);
  11614. args: [],
  11615. 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",
  11616. referencedClasses: [],
  11617. //>>excludeEnd("ide");
  11618. messageSends: ["assert:equals:", "+", "-", "/", "*", "//", "\x5c\x5c"]
  11619. }),
  11620. $globals.NumberTest);
  11621. $core.addMethod(
  11622. $core.method({
  11623. selector: "testAsNumber",
  11624. protocol: 'tests',
  11625. fn: function (){
  11626. var self=this;
  11627. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11628. return $core.withContext(function($ctx1) {
  11629. //>>excludeEnd("ctx");
  11630. self._assert_equals_((3)._asNumber(),(3));
  11631. return self;
  11632. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11633. }, function($ctx1) {$ctx1.fill(self,"testAsNumber",{},$globals.NumberTest)});
  11634. //>>excludeEnd("ctx");
  11635. },
  11636. //>>excludeStart("ide", pragmas.excludeIdeData);
  11637. args: [],
  11638. source: "testAsNumber\x0a\x09self assert: 3 asNumber equals: 3.",
  11639. referencedClasses: [],
  11640. //>>excludeEnd("ide");
  11641. messageSends: ["assert:equals:", "asNumber"]
  11642. }),
  11643. $globals.NumberTest);
  11644. $core.addMethod(
  11645. $core.method({
  11646. selector: "testCeiling",
  11647. protocol: 'tests',
  11648. fn: function (){
  11649. var self=this;
  11650. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11651. return $core.withContext(function($ctx1) {
  11652. //>>excludeEnd("ctx");
  11653. var $1,$2;
  11654. $1=(1.2)._ceiling();
  11655. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11656. $ctx1.sendIdx["ceiling"]=1;
  11657. //>>excludeEnd("ctx");
  11658. self._assert_equals_($1,(2));
  11659. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11660. $ctx1.sendIdx["assert:equals:"]=1;
  11661. //>>excludeEnd("ctx");
  11662. $2=(-1.2)._ceiling();
  11663. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11664. $ctx1.sendIdx["ceiling"]=2;
  11665. //>>excludeEnd("ctx");
  11666. self._assert_equals_($2,(-1));
  11667. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11668. $ctx1.sendIdx["assert:equals:"]=2;
  11669. //>>excludeEnd("ctx");
  11670. self._assert_equals_((1)._ceiling(),(1));
  11671. return self;
  11672. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11673. }, function($ctx1) {$ctx1.fill(self,"testCeiling",{},$globals.NumberTest)});
  11674. //>>excludeEnd("ctx");
  11675. },
  11676. //>>excludeStart("ide", pragmas.excludeIdeData);
  11677. args: [],
  11678. 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.",
  11679. referencedClasses: [],
  11680. //>>excludeEnd("ide");
  11681. messageSends: ["assert:equals:", "ceiling"]
  11682. }),
  11683. $globals.NumberTest);
  11684. $core.addMethod(
  11685. $core.method({
  11686. selector: "testComparison",
  11687. protocol: 'tests',
  11688. fn: function (){
  11689. var self=this;
  11690. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11691. return $core.withContext(function($ctx1) {
  11692. //>>excludeEnd("ctx");
  11693. var $1,$2,$3,$4;
  11694. $1=(3).__gt((2));
  11695. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11696. $ctx1.sendIdx[">"]=1;
  11697. //>>excludeEnd("ctx");
  11698. self._assert_($1);
  11699. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11700. $ctx1.sendIdx["assert:"]=1;
  11701. //>>excludeEnd("ctx");
  11702. $2=(2).__lt((3));
  11703. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11704. $ctx1.sendIdx["<"]=1;
  11705. //>>excludeEnd("ctx");
  11706. self._assert_($2);
  11707. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11708. $ctx1.sendIdx["assert:"]=2;
  11709. //>>excludeEnd("ctx");
  11710. self._deny_((3).__lt((2)));
  11711. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11712. $ctx1.sendIdx["deny:"]=1;
  11713. //>>excludeEnd("ctx");
  11714. self._deny_((2).__gt((3)));
  11715. $3=(3).__gt_eq((3));
  11716. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11717. $ctx1.sendIdx[">="]=1;
  11718. //>>excludeEnd("ctx");
  11719. self._assert_($3);
  11720. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11721. $ctx1.sendIdx["assert:"]=3;
  11722. //>>excludeEnd("ctx");
  11723. self._assert_((3.1).__gt_eq((3)));
  11724. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11725. $ctx1.sendIdx["assert:"]=4;
  11726. //>>excludeEnd("ctx");
  11727. $4=(3).__lt_eq((3));
  11728. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11729. $ctx1.sendIdx["<="]=1;
  11730. //>>excludeEnd("ctx");
  11731. self._assert_($4);
  11732. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11733. $ctx1.sendIdx["assert:"]=5;
  11734. //>>excludeEnd("ctx");
  11735. self._assert_((3).__lt_eq((3.1)));
  11736. return self;
  11737. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11738. }, function($ctx1) {$ctx1.fill(self,"testComparison",{},$globals.NumberTest)});
  11739. //>>excludeEnd("ctx");
  11740. },
  11741. //>>excludeStart("ide", pragmas.excludeIdeData);
  11742. args: [],
  11743. 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",
  11744. referencedClasses: [],
  11745. //>>excludeEnd("ide");
  11746. messageSends: ["assert:", ">", "<", "deny:", ">=", "<="]
  11747. }),
  11748. $globals.NumberTest);
  11749. $core.addMethod(
  11750. $core.method({
  11751. selector: "testCopying",
  11752. protocol: 'tests',
  11753. fn: function (){
  11754. var self=this;
  11755. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11756. return $core.withContext(function($ctx1) {
  11757. //>>excludeEnd("ctx");
  11758. var $1;
  11759. $1=$recv((1)._copy()).__eq_eq((1));
  11760. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11761. $ctx1.sendIdx["=="]=1;
  11762. //>>excludeEnd("ctx");
  11763. self._assert_($1);
  11764. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11765. $ctx1.sendIdx["assert:"]=1;
  11766. //>>excludeEnd("ctx");
  11767. self._assert_($recv((1)._deepCopy()).__eq_eq((1)));
  11768. return self;
  11769. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11770. }, function($ctx1) {$ctx1.fill(self,"testCopying",{},$globals.NumberTest)});
  11771. //>>excludeEnd("ctx");
  11772. },
  11773. //>>excludeStart("ide", pragmas.excludeIdeData);
  11774. args: [],
  11775. source: "testCopying\x0a\x09self assert: 1 copy == 1.\x0a\x09self assert: 1 deepCopy == 1",
  11776. referencedClasses: [],
  11777. //>>excludeEnd("ide");
  11778. messageSends: ["assert:", "==", "copy", "deepCopy"]
  11779. }),
  11780. $globals.NumberTest);
  11781. $core.addMethod(
  11782. $core.method({
  11783. selector: "testEquality",
  11784. protocol: 'tests',
  11785. fn: function (){
  11786. var self=this;
  11787. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11788. return $core.withContext(function($ctx1) {
  11789. //>>excludeEnd("ctx");
  11790. var $1,$2,$3,$5,$4,$7,$6,$9,$8,$10,$11,$12;
  11791. $1=(1).__eq((1));
  11792. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11793. $ctx1.sendIdx["="]=1;
  11794. //>>excludeEnd("ctx");
  11795. self._assert_($1);
  11796. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11797. $ctx1.sendIdx["assert:"]=1;
  11798. //>>excludeEnd("ctx");
  11799. $2=(0).__eq((0));
  11800. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11801. $ctx1.sendIdx["="]=2;
  11802. //>>excludeEnd("ctx");
  11803. self._assert_($2);
  11804. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11805. $ctx1.sendIdx["assert:"]=2;
  11806. //>>excludeEnd("ctx");
  11807. $3=(1).__eq((0));
  11808. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11809. $ctx1.sendIdx["="]=3;
  11810. //>>excludeEnd("ctx");
  11811. self._deny_($3);
  11812. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11813. $ctx1.sendIdx["deny:"]=1;
  11814. //>>excludeEnd("ctx");
  11815. $5=(1)._yourself();
  11816. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11817. $ctx1.sendIdx["yourself"]=1;
  11818. //>>excludeEnd("ctx");
  11819. $4=$recv($5).__eq((1));
  11820. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11821. $ctx1.sendIdx["="]=4;
  11822. //>>excludeEnd("ctx");
  11823. self._assert_($4);
  11824. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11825. $ctx1.sendIdx["assert:"]=3;
  11826. //>>excludeEnd("ctx");
  11827. $7=(1)._yourself();
  11828. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11829. $ctx1.sendIdx["yourself"]=2;
  11830. //>>excludeEnd("ctx");
  11831. $6=(1).__eq($7);
  11832. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11833. $ctx1.sendIdx["="]=5;
  11834. //>>excludeEnd("ctx");
  11835. self._assert_($6);
  11836. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11837. $ctx1.sendIdx["assert:"]=4;
  11838. //>>excludeEnd("ctx");
  11839. $9=(1)._yourself();
  11840. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11841. $ctx1.sendIdx["yourself"]=3;
  11842. //>>excludeEnd("ctx");
  11843. $8=$recv($9).__eq((1)._yourself());
  11844. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11845. $ctx1.sendIdx["="]=6;
  11846. //>>excludeEnd("ctx");
  11847. self._assert_($8);
  11848. $10=(0).__eq(false);
  11849. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11850. $ctx1.sendIdx["="]=7;
  11851. //>>excludeEnd("ctx");
  11852. self._deny_($10);
  11853. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11854. $ctx1.sendIdx["deny:"]=2;
  11855. //>>excludeEnd("ctx");
  11856. $11=false.__eq((0));
  11857. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11858. $ctx1.sendIdx["="]=8;
  11859. //>>excludeEnd("ctx");
  11860. self._deny_($11);
  11861. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11862. $ctx1.sendIdx["deny:"]=3;
  11863. //>>excludeEnd("ctx");
  11864. $12="".__eq((0));
  11865. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11866. $ctx1.sendIdx["="]=9;
  11867. //>>excludeEnd("ctx");
  11868. self._deny_($12);
  11869. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11870. $ctx1.sendIdx["deny:"]=4;
  11871. //>>excludeEnd("ctx");
  11872. self._deny_((0).__eq(""));
  11873. return self;
  11874. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11875. }, function($ctx1) {$ctx1.fill(self,"testEquality",{},$globals.NumberTest)});
  11876. //>>excludeEnd("ctx");
  11877. },
  11878. //>>excludeStart("ide", pragmas.excludeIdeData);
  11879. args: [],
  11880. 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 = ''",
  11881. referencedClasses: [],
  11882. //>>excludeEnd("ide");
  11883. messageSends: ["assert:", "=", "deny:", "yourself"]
  11884. }),
  11885. $globals.NumberTest);
  11886. $core.addMethod(
  11887. $core.method({
  11888. selector: "testFloor",
  11889. protocol: 'tests',
  11890. fn: function (){
  11891. var self=this;
  11892. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11893. return $core.withContext(function($ctx1) {
  11894. //>>excludeEnd("ctx");
  11895. var $1,$2;
  11896. $1=(1.2)._floor();
  11897. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11898. $ctx1.sendIdx["floor"]=1;
  11899. //>>excludeEnd("ctx");
  11900. self._assert_equals_($1,(1));
  11901. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11902. $ctx1.sendIdx["assert:equals:"]=1;
  11903. //>>excludeEnd("ctx");
  11904. $2=(-1.2)._floor();
  11905. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11906. $ctx1.sendIdx["floor"]=2;
  11907. //>>excludeEnd("ctx");
  11908. self._assert_equals_($2,(-2));
  11909. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11910. $ctx1.sendIdx["assert:equals:"]=2;
  11911. //>>excludeEnd("ctx");
  11912. self._assert_equals_((1)._floor(),(1));
  11913. return self;
  11914. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11915. }, function($ctx1) {$ctx1.fill(self,"testFloor",{},$globals.NumberTest)});
  11916. //>>excludeEnd("ctx");
  11917. },
  11918. //>>excludeStart("ide", pragmas.excludeIdeData);
  11919. args: [],
  11920. 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.",
  11921. referencedClasses: [],
  11922. //>>excludeEnd("ide");
  11923. messageSends: ["assert:equals:", "floor"]
  11924. }),
  11925. $globals.NumberTest);
  11926. $core.addMethod(
  11927. $core.method({
  11928. selector: "testHexNumbers",
  11929. protocol: 'tests',
  11930. fn: function (){
  11931. var self=this;
  11932. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11933. return $core.withContext(function($ctx1) {
  11934. //>>excludeEnd("ctx");
  11935. var $1,$2,$3,$4,$5;
  11936. self._assert_equals_((9),(9));
  11937. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11938. $ctx1.sendIdx["assert:equals:"]=1;
  11939. //>>excludeEnd("ctx");
  11940. $1=(10)._truncated();
  11941. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11942. $ctx1.sendIdx["truncated"]=1;
  11943. //>>excludeEnd("ctx");
  11944. self._assert_equals_($1,(10));
  11945. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11946. $ctx1.sendIdx["assert:equals:"]=2;
  11947. //>>excludeEnd("ctx");
  11948. $2=(11)._truncated();
  11949. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11950. $ctx1.sendIdx["truncated"]=2;
  11951. //>>excludeEnd("ctx");
  11952. self._assert_equals_($2,(11));
  11953. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11954. $ctx1.sendIdx["assert:equals:"]=3;
  11955. //>>excludeEnd("ctx");
  11956. $3=(12)._truncated();
  11957. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11958. $ctx1.sendIdx["truncated"]=3;
  11959. //>>excludeEnd("ctx");
  11960. self._assert_equals_($3,(12));
  11961. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11962. $ctx1.sendIdx["assert:equals:"]=4;
  11963. //>>excludeEnd("ctx");
  11964. $4=(13)._truncated();
  11965. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11966. $ctx1.sendIdx["truncated"]=4;
  11967. //>>excludeEnd("ctx");
  11968. self._assert_equals_($4,(13));
  11969. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11970. $ctx1.sendIdx["assert:equals:"]=5;
  11971. //>>excludeEnd("ctx");
  11972. $5=(14)._truncated();
  11973. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11974. $ctx1.sendIdx["truncated"]=5;
  11975. //>>excludeEnd("ctx");
  11976. self._assert_equals_($5,(14));
  11977. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11978. $ctx1.sendIdx["assert:equals:"]=6;
  11979. //>>excludeEnd("ctx");
  11980. self._assert_equals_((15)._truncated(),(15));
  11981. return self;
  11982. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11983. }, function($ctx1) {$ctx1.fill(self,"testHexNumbers",{},$globals.NumberTest)});
  11984. //>>excludeEnd("ctx");
  11985. },
  11986. //>>excludeStart("ide", pragmas.excludeIdeData);
  11987. args: [],
  11988. 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",
  11989. referencedClasses: [],
  11990. //>>excludeEnd("ide");
  11991. messageSends: ["assert:equals:", "truncated"]
  11992. }),
  11993. $globals.NumberTest);
  11994. $core.addMethod(
  11995. $core.method({
  11996. selector: "testIdentity",
  11997. protocol: 'tests',
  11998. fn: function (){
  11999. var self=this;
  12000. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12001. return $core.withContext(function($ctx1) {
  12002. //>>excludeEnd("ctx");
  12003. var $1,$2,$3,$5,$4,$7,$6,$9,$8;
  12004. $1=(1).__eq_eq((1));
  12005. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12006. $ctx1.sendIdx["=="]=1;
  12007. //>>excludeEnd("ctx");
  12008. self._assert_($1);
  12009. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12010. $ctx1.sendIdx["assert:"]=1;
  12011. //>>excludeEnd("ctx");
  12012. $2=(0).__eq_eq((0));
  12013. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12014. $ctx1.sendIdx["=="]=2;
  12015. //>>excludeEnd("ctx");
  12016. self._assert_($2);
  12017. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12018. $ctx1.sendIdx["assert:"]=2;
  12019. //>>excludeEnd("ctx");
  12020. $3=(1).__eq_eq((0));
  12021. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12022. $ctx1.sendIdx["=="]=3;
  12023. //>>excludeEnd("ctx");
  12024. self._deny_($3);
  12025. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12026. $ctx1.sendIdx["deny:"]=1;
  12027. //>>excludeEnd("ctx");
  12028. $5=(1)._yourself();
  12029. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12030. $ctx1.sendIdx["yourself"]=1;
  12031. //>>excludeEnd("ctx");
  12032. $4=$recv($5).__eq_eq((1));
  12033. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12034. $ctx1.sendIdx["=="]=4;
  12035. //>>excludeEnd("ctx");
  12036. self._assert_($4);
  12037. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12038. $ctx1.sendIdx["assert:"]=3;
  12039. //>>excludeEnd("ctx");
  12040. $7=(1)._yourself();
  12041. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12042. $ctx1.sendIdx["yourself"]=2;
  12043. //>>excludeEnd("ctx");
  12044. $6=(1).__eq_eq($7);
  12045. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12046. $ctx1.sendIdx["=="]=5;
  12047. //>>excludeEnd("ctx");
  12048. self._assert_($6);
  12049. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12050. $ctx1.sendIdx["assert:"]=4;
  12051. //>>excludeEnd("ctx");
  12052. $9=(1)._yourself();
  12053. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12054. $ctx1.sendIdx["yourself"]=3;
  12055. //>>excludeEnd("ctx");
  12056. $8=$recv($9).__eq_eq((1)._yourself());
  12057. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12058. $ctx1.sendIdx["=="]=6;
  12059. //>>excludeEnd("ctx");
  12060. self._assert_($8);
  12061. self._deny_((1).__eq_eq((2)));
  12062. return self;
  12063. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12064. }, function($ctx1) {$ctx1.fill(self,"testIdentity",{},$globals.NumberTest)});
  12065. //>>excludeEnd("ctx");
  12066. },
  12067. //>>excludeStart("ide", pragmas.excludeIdeData);
  12068. args: [],
  12069. 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",
  12070. referencedClasses: [],
  12071. //>>excludeEnd("ide");
  12072. messageSends: ["assert:", "==", "deny:", "yourself"]
  12073. }),
  12074. $globals.NumberTest);
  12075. $core.addMethod(
  12076. $core.method({
  12077. selector: "testInvalidHexNumbers",
  12078. protocol: 'tests',
  12079. fn: function (){
  12080. var self=this;
  12081. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12082. return $core.withContext(function($ctx1) {
  12083. //>>excludeEnd("ctx");
  12084. self._should_raise_((function(){
  12085. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12086. return $core.withContext(function($ctx2) {
  12087. //>>excludeEnd("ctx");
  12088. return (16)._rG();
  12089. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12090. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  12091. //>>excludeEnd("ctx");
  12092. }),$globals.MessageNotUnderstood);
  12093. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12094. $ctx1.sendIdx["should:raise:"]=1;
  12095. //>>excludeEnd("ctx");
  12096. self._should_raise_((function(){
  12097. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12098. return $core.withContext(function($ctx2) {
  12099. //>>excludeEnd("ctx");
  12100. return (16)._rg();
  12101. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12102. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  12103. //>>excludeEnd("ctx");
  12104. }),$globals.MessageNotUnderstood);
  12105. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12106. $ctx1.sendIdx["should:raise:"]=2;
  12107. //>>excludeEnd("ctx");
  12108. self._should_raise_((function(){
  12109. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12110. return $core.withContext(function($ctx2) {
  12111. //>>excludeEnd("ctx");
  12112. return (16)._rH();
  12113. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12114. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  12115. //>>excludeEnd("ctx");
  12116. }),$globals.MessageNotUnderstood);
  12117. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12118. $ctx1.sendIdx["should:raise:"]=3;
  12119. //>>excludeEnd("ctx");
  12120. self._should_raise_((function(){
  12121. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12122. return $core.withContext(function($ctx2) {
  12123. //>>excludeEnd("ctx");
  12124. return (16)._rh();
  12125. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12126. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,4)});
  12127. //>>excludeEnd("ctx");
  12128. }),$globals.MessageNotUnderstood);
  12129. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12130. $ctx1.sendIdx["should:raise:"]=4;
  12131. //>>excludeEnd("ctx");
  12132. self._should_raise_((function(){
  12133. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12134. return $core.withContext(function($ctx2) {
  12135. //>>excludeEnd("ctx");
  12136. return (16)._rI();
  12137. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12138. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,5)});
  12139. //>>excludeEnd("ctx");
  12140. }),$globals.MessageNotUnderstood);
  12141. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12142. $ctx1.sendIdx["should:raise:"]=5;
  12143. //>>excludeEnd("ctx");
  12144. self._should_raise_((function(){
  12145. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12146. return $core.withContext(function($ctx2) {
  12147. //>>excludeEnd("ctx");
  12148. return (16)._ri();
  12149. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12150. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,6)});
  12151. //>>excludeEnd("ctx");
  12152. }),$globals.MessageNotUnderstood);
  12153. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12154. $ctx1.sendIdx["should:raise:"]=6;
  12155. //>>excludeEnd("ctx");
  12156. self._should_raise_((function(){
  12157. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12158. return $core.withContext(function($ctx2) {
  12159. //>>excludeEnd("ctx");
  12160. return (16)._rJ();
  12161. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12162. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,7)});
  12163. //>>excludeEnd("ctx");
  12164. }),$globals.MessageNotUnderstood);
  12165. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12166. $ctx1.sendIdx["should:raise:"]=7;
  12167. //>>excludeEnd("ctx");
  12168. self._should_raise_((function(){
  12169. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12170. return $core.withContext(function($ctx2) {
  12171. //>>excludeEnd("ctx");
  12172. return (16)._rj();
  12173. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12174. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,8)});
  12175. //>>excludeEnd("ctx");
  12176. }),$globals.MessageNotUnderstood);
  12177. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12178. $ctx1.sendIdx["should:raise:"]=8;
  12179. //>>excludeEnd("ctx");
  12180. self._should_raise_((function(){
  12181. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12182. return $core.withContext(function($ctx2) {
  12183. //>>excludeEnd("ctx");
  12184. return (16)._rK();
  12185. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12186. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,9)});
  12187. //>>excludeEnd("ctx");
  12188. }),$globals.MessageNotUnderstood);
  12189. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12190. $ctx1.sendIdx["should:raise:"]=9;
  12191. //>>excludeEnd("ctx");
  12192. self._should_raise_((function(){
  12193. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12194. return $core.withContext(function($ctx2) {
  12195. //>>excludeEnd("ctx");
  12196. return (16)._rk();
  12197. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12198. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,10)});
  12199. //>>excludeEnd("ctx");
  12200. }),$globals.MessageNotUnderstood);
  12201. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12202. $ctx1.sendIdx["should:raise:"]=10;
  12203. //>>excludeEnd("ctx");
  12204. self._should_raise_((function(){
  12205. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12206. return $core.withContext(function($ctx2) {
  12207. //>>excludeEnd("ctx");
  12208. return (16)._rL();
  12209. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12210. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,11)});
  12211. //>>excludeEnd("ctx");
  12212. }),$globals.MessageNotUnderstood);
  12213. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12214. $ctx1.sendIdx["should:raise:"]=11;
  12215. //>>excludeEnd("ctx");
  12216. self._should_raise_((function(){
  12217. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12218. return $core.withContext(function($ctx2) {
  12219. //>>excludeEnd("ctx");
  12220. return (16)._rl();
  12221. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12222. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,12)});
  12223. //>>excludeEnd("ctx");
  12224. }),$globals.MessageNotUnderstood);
  12225. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12226. $ctx1.sendIdx["should:raise:"]=12;
  12227. //>>excludeEnd("ctx");
  12228. self._should_raise_((function(){
  12229. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12230. return $core.withContext(function($ctx2) {
  12231. //>>excludeEnd("ctx");
  12232. return (16)._rM();
  12233. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12234. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,13)});
  12235. //>>excludeEnd("ctx");
  12236. }),$globals.MessageNotUnderstood);
  12237. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12238. $ctx1.sendIdx["should:raise:"]=13;
  12239. //>>excludeEnd("ctx");
  12240. self._should_raise_((function(){
  12241. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12242. return $core.withContext(function($ctx2) {
  12243. //>>excludeEnd("ctx");
  12244. return (16)._rm();
  12245. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12246. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,14)});
  12247. //>>excludeEnd("ctx");
  12248. }),$globals.MessageNotUnderstood);
  12249. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12250. $ctx1.sendIdx["should:raise:"]=14;
  12251. //>>excludeEnd("ctx");
  12252. self._should_raise_((function(){
  12253. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12254. return $core.withContext(function($ctx2) {
  12255. //>>excludeEnd("ctx");
  12256. return (16)._rN();
  12257. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12258. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,15)});
  12259. //>>excludeEnd("ctx");
  12260. }),$globals.MessageNotUnderstood);
  12261. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12262. $ctx1.sendIdx["should:raise:"]=15;
  12263. //>>excludeEnd("ctx");
  12264. self._should_raise_((function(){
  12265. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12266. return $core.withContext(function($ctx2) {
  12267. //>>excludeEnd("ctx");
  12268. return (16)._rn();
  12269. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12270. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,16)});
  12271. //>>excludeEnd("ctx");
  12272. }),$globals.MessageNotUnderstood);
  12273. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12274. $ctx1.sendIdx["should:raise:"]=16;
  12275. //>>excludeEnd("ctx");
  12276. self._should_raise_((function(){
  12277. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12278. return $core.withContext(function($ctx2) {
  12279. //>>excludeEnd("ctx");
  12280. return (16)._rO();
  12281. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12282. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,17)});
  12283. //>>excludeEnd("ctx");
  12284. }),$globals.MessageNotUnderstood);
  12285. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12286. $ctx1.sendIdx["should:raise:"]=17;
  12287. //>>excludeEnd("ctx");
  12288. self._should_raise_((function(){
  12289. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12290. return $core.withContext(function($ctx2) {
  12291. //>>excludeEnd("ctx");
  12292. return (16)._ro();
  12293. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12294. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,18)});
  12295. //>>excludeEnd("ctx");
  12296. }),$globals.MessageNotUnderstood);
  12297. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12298. $ctx1.sendIdx["should:raise:"]=18;
  12299. //>>excludeEnd("ctx");
  12300. self._should_raise_((function(){
  12301. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12302. return $core.withContext(function($ctx2) {
  12303. //>>excludeEnd("ctx");
  12304. return (16)._rP();
  12305. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12306. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,19)});
  12307. //>>excludeEnd("ctx");
  12308. }),$globals.MessageNotUnderstood);
  12309. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12310. $ctx1.sendIdx["should:raise:"]=19;
  12311. //>>excludeEnd("ctx");
  12312. self._should_raise_((function(){
  12313. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12314. return $core.withContext(function($ctx2) {
  12315. //>>excludeEnd("ctx");
  12316. return (16)._rp();
  12317. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12318. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,20)});
  12319. //>>excludeEnd("ctx");
  12320. }),$globals.MessageNotUnderstood);
  12321. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12322. $ctx1.sendIdx["should:raise:"]=20;
  12323. //>>excludeEnd("ctx");
  12324. self._should_raise_((function(){
  12325. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12326. return $core.withContext(function($ctx2) {
  12327. //>>excludeEnd("ctx");
  12328. return (16)._rQ();
  12329. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12330. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,21)});
  12331. //>>excludeEnd("ctx");
  12332. }),$globals.MessageNotUnderstood);
  12333. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12334. $ctx1.sendIdx["should:raise:"]=21;
  12335. //>>excludeEnd("ctx");
  12336. self._should_raise_((function(){
  12337. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12338. return $core.withContext(function($ctx2) {
  12339. //>>excludeEnd("ctx");
  12340. return (16)._rq();
  12341. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12342. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,22)});
  12343. //>>excludeEnd("ctx");
  12344. }),$globals.MessageNotUnderstood);
  12345. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12346. $ctx1.sendIdx["should:raise:"]=22;
  12347. //>>excludeEnd("ctx");
  12348. self._should_raise_((function(){
  12349. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12350. return $core.withContext(function($ctx2) {
  12351. //>>excludeEnd("ctx");
  12352. return (16)._rR();
  12353. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12354. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,23)});
  12355. //>>excludeEnd("ctx");
  12356. }),$globals.MessageNotUnderstood);
  12357. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12358. $ctx1.sendIdx["should:raise:"]=23;
  12359. //>>excludeEnd("ctx");
  12360. self._should_raise_((function(){
  12361. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12362. return $core.withContext(function($ctx2) {
  12363. //>>excludeEnd("ctx");
  12364. return (16)._rr();
  12365. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12366. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,24)});
  12367. //>>excludeEnd("ctx");
  12368. }),$globals.MessageNotUnderstood);
  12369. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12370. $ctx1.sendIdx["should:raise:"]=24;
  12371. //>>excludeEnd("ctx");
  12372. self._should_raise_((function(){
  12373. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12374. return $core.withContext(function($ctx2) {
  12375. //>>excludeEnd("ctx");
  12376. return (16)._rS();
  12377. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12378. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,25)});
  12379. //>>excludeEnd("ctx");
  12380. }),$globals.MessageNotUnderstood);
  12381. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12382. $ctx1.sendIdx["should:raise:"]=25;
  12383. //>>excludeEnd("ctx");
  12384. self._should_raise_((function(){
  12385. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12386. return $core.withContext(function($ctx2) {
  12387. //>>excludeEnd("ctx");
  12388. return (16)._rs();
  12389. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12390. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,26)});
  12391. //>>excludeEnd("ctx");
  12392. }),$globals.MessageNotUnderstood);
  12393. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12394. $ctx1.sendIdx["should:raise:"]=26;
  12395. //>>excludeEnd("ctx");
  12396. self._should_raise_((function(){
  12397. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12398. return $core.withContext(function($ctx2) {
  12399. //>>excludeEnd("ctx");
  12400. return (16)._rT();
  12401. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12402. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,27)});
  12403. //>>excludeEnd("ctx");
  12404. }),$globals.MessageNotUnderstood);
  12405. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12406. $ctx1.sendIdx["should:raise:"]=27;
  12407. //>>excludeEnd("ctx");
  12408. self._should_raise_((function(){
  12409. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12410. return $core.withContext(function($ctx2) {
  12411. //>>excludeEnd("ctx");
  12412. return (16)._rt();
  12413. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12414. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,28)});
  12415. //>>excludeEnd("ctx");
  12416. }),$globals.MessageNotUnderstood);
  12417. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12418. $ctx1.sendIdx["should:raise:"]=28;
  12419. //>>excludeEnd("ctx");
  12420. self._should_raise_((function(){
  12421. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12422. return $core.withContext(function($ctx2) {
  12423. //>>excludeEnd("ctx");
  12424. return (16)._rU();
  12425. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12426. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,29)});
  12427. //>>excludeEnd("ctx");
  12428. }),$globals.MessageNotUnderstood);
  12429. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12430. $ctx1.sendIdx["should:raise:"]=29;
  12431. //>>excludeEnd("ctx");
  12432. self._should_raise_((function(){
  12433. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12434. return $core.withContext(function($ctx2) {
  12435. //>>excludeEnd("ctx");
  12436. return (16)._ru();
  12437. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12438. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,30)});
  12439. //>>excludeEnd("ctx");
  12440. }),$globals.MessageNotUnderstood);
  12441. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12442. $ctx1.sendIdx["should:raise:"]=30;
  12443. //>>excludeEnd("ctx");
  12444. self._should_raise_((function(){
  12445. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12446. return $core.withContext(function($ctx2) {
  12447. //>>excludeEnd("ctx");
  12448. return (16)._rV();
  12449. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12450. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,31)});
  12451. //>>excludeEnd("ctx");
  12452. }),$globals.MessageNotUnderstood);
  12453. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12454. $ctx1.sendIdx["should:raise:"]=31;
  12455. //>>excludeEnd("ctx");
  12456. self._should_raise_((function(){
  12457. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12458. return $core.withContext(function($ctx2) {
  12459. //>>excludeEnd("ctx");
  12460. return (16)._rv();
  12461. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12462. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,32)});
  12463. //>>excludeEnd("ctx");
  12464. }),$globals.MessageNotUnderstood);
  12465. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12466. $ctx1.sendIdx["should:raise:"]=32;
  12467. //>>excludeEnd("ctx");
  12468. self._should_raise_((function(){
  12469. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12470. return $core.withContext(function($ctx2) {
  12471. //>>excludeEnd("ctx");
  12472. return (16)._rW();
  12473. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12474. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,33)});
  12475. //>>excludeEnd("ctx");
  12476. }),$globals.MessageNotUnderstood);
  12477. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12478. $ctx1.sendIdx["should:raise:"]=33;
  12479. //>>excludeEnd("ctx");
  12480. self._should_raise_((function(){
  12481. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12482. return $core.withContext(function($ctx2) {
  12483. //>>excludeEnd("ctx");
  12484. return (16)._rw();
  12485. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12486. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,34)});
  12487. //>>excludeEnd("ctx");
  12488. }),$globals.MessageNotUnderstood);
  12489. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12490. $ctx1.sendIdx["should:raise:"]=34;
  12491. //>>excludeEnd("ctx");
  12492. self._should_raise_((function(){
  12493. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12494. return $core.withContext(function($ctx2) {
  12495. //>>excludeEnd("ctx");
  12496. return (16)._rX();
  12497. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12498. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,35)});
  12499. //>>excludeEnd("ctx");
  12500. }),$globals.MessageNotUnderstood);
  12501. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12502. $ctx1.sendIdx["should:raise:"]=35;
  12503. //>>excludeEnd("ctx");
  12504. self._should_raise_((function(){
  12505. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12506. return $core.withContext(function($ctx2) {
  12507. //>>excludeEnd("ctx");
  12508. return (16)._rx();
  12509. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12510. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,36)});
  12511. //>>excludeEnd("ctx");
  12512. }),$globals.MessageNotUnderstood);
  12513. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12514. $ctx1.sendIdx["should:raise:"]=36;
  12515. //>>excludeEnd("ctx");
  12516. self._should_raise_((function(){
  12517. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12518. return $core.withContext(function($ctx2) {
  12519. //>>excludeEnd("ctx");
  12520. return (16)._rY();
  12521. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12522. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,37)});
  12523. //>>excludeEnd("ctx");
  12524. }),$globals.MessageNotUnderstood);
  12525. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12526. $ctx1.sendIdx["should:raise:"]=37;
  12527. //>>excludeEnd("ctx");
  12528. self._should_raise_((function(){
  12529. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12530. return $core.withContext(function($ctx2) {
  12531. //>>excludeEnd("ctx");
  12532. return (16)._ry();
  12533. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12534. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,38)});
  12535. //>>excludeEnd("ctx");
  12536. }),$globals.MessageNotUnderstood);
  12537. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12538. $ctx1.sendIdx["should:raise:"]=38;
  12539. //>>excludeEnd("ctx");
  12540. self._should_raise_((function(){
  12541. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12542. return $core.withContext(function($ctx2) {
  12543. //>>excludeEnd("ctx");
  12544. return (16)._rZ();
  12545. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12546. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,39)});
  12547. //>>excludeEnd("ctx");
  12548. }),$globals.MessageNotUnderstood);
  12549. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12550. $ctx1.sendIdx["should:raise:"]=39;
  12551. //>>excludeEnd("ctx");
  12552. self._should_raise_((function(){
  12553. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12554. return $core.withContext(function($ctx2) {
  12555. //>>excludeEnd("ctx");
  12556. return (16)._rz();
  12557. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12558. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,40)});
  12559. //>>excludeEnd("ctx");
  12560. }),$globals.MessageNotUnderstood);
  12561. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12562. $ctx1.sendIdx["should:raise:"]=40;
  12563. //>>excludeEnd("ctx");
  12564. self._should_raise_((function(){
  12565. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12566. return $core.withContext(function($ctx2) {
  12567. //>>excludeEnd("ctx");
  12568. return (11259375)._Z();
  12569. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12570. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,41)});
  12571. //>>excludeEnd("ctx");
  12572. }),$globals.MessageNotUnderstood);
  12573. return self;
  12574. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12575. }, function($ctx1) {$ctx1.fill(self,"testInvalidHexNumbers",{},$globals.NumberTest)});
  12576. //>>excludeEnd("ctx");
  12577. },
  12578. //>>excludeStart("ide", pragmas.excludeIdeData);
  12579. args: [],
  12580. 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.",
  12581. referencedClasses: ["MessageNotUnderstood"],
  12582. //>>excludeEnd("ide");
  12583. 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"]
  12584. }),
  12585. $globals.NumberTest);
  12586. $core.addMethod(
  12587. $core.method({
  12588. selector: "testLog",
  12589. protocol: 'tests',
  12590. fn: function (){
  12591. var self=this;
  12592. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12593. return $core.withContext(function($ctx1) {
  12594. //>>excludeEnd("ctx");
  12595. self._assert_equals_((10000)._log(),(4));
  12596. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12597. $ctx1.sendIdx["assert:equals:"]=1;
  12598. //>>excludeEnd("ctx");
  12599. self._assert_equals_((512)._log_((2)),(9));
  12600. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12601. $ctx1.sendIdx["assert:equals:"]=2;
  12602. //>>excludeEnd("ctx");
  12603. self._assert_equals_($recv($recv($globals.Number)._e())._ln(),(1));
  12604. return self;
  12605. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12606. }, function($ctx1) {$ctx1.fill(self,"testLog",{},$globals.NumberTest)});
  12607. //>>excludeEnd("ctx");
  12608. },
  12609. //>>excludeStart("ide", pragmas.excludeIdeData);
  12610. args: [],
  12611. 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.",
  12612. referencedClasses: ["Number"],
  12613. //>>excludeEnd("ide");
  12614. messageSends: ["assert:equals:", "log", "log:", "ln", "e"]
  12615. }),
  12616. $globals.NumberTest);
  12617. $core.addMethod(
  12618. $core.method({
  12619. selector: "testMinMax",
  12620. protocol: 'tests',
  12621. fn: function (){
  12622. var self=this;
  12623. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12624. return $core.withContext(function($ctx1) {
  12625. //>>excludeEnd("ctx");
  12626. self._assert_equals_((2)._max_((5)),(5));
  12627. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12628. $ctx1.sendIdx["assert:equals:"]=1;
  12629. //>>excludeEnd("ctx");
  12630. self._assert_equals_((2)._min_((5)),(2));
  12631. return self;
  12632. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12633. }, function($ctx1) {$ctx1.fill(self,"testMinMax",{},$globals.NumberTest)});
  12634. //>>excludeEnd("ctx");
  12635. },
  12636. //>>excludeStart("ide", pragmas.excludeIdeData);
  12637. args: [],
  12638. source: "testMinMax\x0a\x09\x0a\x09self assert: (2 max: 5) equals: 5.\x0a\x09self assert: (2 min: 5) equals: 2",
  12639. referencedClasses: [],
  12640. //>>excludeEnd("ide");
  12641. messageSends: ["assert:equals:", "max:", "min:"]
  12642. }),
  12643. $globals.NumberTest);
  12644. $core.addMethod(
  12645. $core.method({
  12646. selector: "testNegated",
  12647. protocol: 'tests',
  12648. fn: function (){
  12649. var self=this;
  12650. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12651. return $core.withContext(function($ctx1) {
  12652. //>>excludeEnd("ctx");
  12653. var $1;
  12654. $1=(3)._negated();
  12655. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12656. $ctx1.sendIdx["negated"]=1;
  12657. //>>excludeEnd("ctx");
  12658. self._assert_equals_($1,(-3));
  12659. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12660. $ctx1.sendIdx["assert:equals:"]=1;
  12661. //>>excludeEnd("ctx");
  12662. self._assert_equals_((-3)._negated(),(3));
  12663. return self;
  12664. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12665. }, function($ctx1) {$ctx1.fill(self,"testNegated",{},$globals.NumberTest)});
  12666. //>>excludeEnd("ctx");
  12667. },
  12668. //>>excludeStart("ide", pragmas.excludeIdeData);
  12669. args: [],
  12670. source: "testNegated\x0a\x09self assert: 3 negated equals: -3.\x0a\x09self assert: -3 negated equals: 3",
  12671. referencedClasses: [],
  12672. //>>excludeEnd("ide");
  12673. messageSends: ["assert:equals:", "negated"]
  12674. }),
  12675. $globals.NumberTest);
  12676. $core.addMethod(
  12677. $core.method({
  12678. selector: "testPrintShowingDecimalPlaces",
  12679. protocol: 'tests',
  12680. fn: function (){
  12681. var self=this;
  12682. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12683. return $core.withContext(function($ctx1) {
  12684. //>>excludeEnd("ctx");
  12685. var $1,$2,$4,$3,$5,$6,$8,$7,$10,$9,$11,$12,$13,$14,$15;
  12686. $1=(23)._printShowingDecimalPlaces_((2));
  12687. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12688. $ctx1.sendIdx["printShowingDecimalPlaces:"]=1;
  12689. //>>excludeEnd("ctx");
  12690. self._assert_equals_($1,"23.00");
  12691. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12692. $ctx1.sendIdx["assert:equals:"]=1;
  12693. //>>excludeEnd("ctx");
  12694. $2=(23.5698)._printShowingDecimalPlaces_((2));
  12695. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12696. $ctx1.sendIdx["printShowingDecimalPlaces:"]=2;
  12697. //>>excludeEnd("ctx");
  12698. self._assert_equals_($2,"23.57");
  12699. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12700. $ctx1.sendIdx["assert:equals:"]=2;
  12701. //>>excludeEnd("ctx");
  12702. $4=(234.567)._negated();
  12703. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12704. $ctx1.sendIdx["negated"]=1;
  12705. //>>excludeEnd("ctx");
  12706. $3=$recv($4)._printShowingDecimalPlaces_((5));
  12707. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12708. $ctx1.sendIdx["printShowingDecimalPlaces:"]=3;
  12709. //>>excludeEnd("ctx");
  12710. self._assert_equals_($3,"-234.56700");
  12711. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12712. $ctx1.sendIdx["assert:equals:"]=3;
  12713. //>>excludeEnd("ctx");
  12714. $5=(23.4567)._printShowingDecimalPlaces_((0));
  12715. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12716. $ctx1.sendIdx["printShowingDecimalPlaces:"]=4;
  12717. //>>excludeEnd("ctx");
  12718. self._assert_equals_($5,"23");
  12719. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12720. $ctx1.sendIdx["assert:equals:"]=4;
  12721. //>>excludeEnd("ctx");
  12722. $6=(23.5567)._printShowingDecimalPlaces_((0));
  12723. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12724. $ctx1.sendIdx["printShowingDecimalPlaces:"]=5;
  12725. //>>excludeEnd("ctx");
  12726. self._assert_equals_($6,"24");
  12727. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12728. $ctx1.sendIdx["assert:equals:"]=5;
  12729. //>>excludeEnd("ctx");
  12730. $8=(23.4567)._negated();
  12731. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12732. $ctx1.sendIdx["negated"]=2;
  12733. //>>excludeEnd("ctx");
  12734. $7=$recv($8)._printShowingDecimalPlaces_((0));
  12735. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12736. $ctx1.sendIdx["printShowingDecimalPlaces:"]=6;
  12737. //>>excludeEnd("ctx");
  12738. self._assert_equals_($7,"-23");
  12739. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12740. $ctx1.sendIdx["assert:equals:"]=6;
  12741. //>>excludeEnd("ctx");
  12742. $10=(23.5567)._negated();
  12743. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12744. $ctx1.sendIdx["negated"]=3;
  12745. //>>excludeEnd("ctx");
  12746. $9=$recv($10)._printShowingDecimalPlaces_((0));
  12747. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12748. $ctx1.sendIdx["printShowingDecimalPlaces:"]=7;
  12749. //>>excludeEnd("ctx");
  12750. self._assert_equals_($9,"-24");
  12751. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12752. $ctx1.sendIdx["assert:equals:"]=7;
  12753. //>>excludeEnd("ctx");
  12754. $11=(100000000)._printShowingDecimalPlaces_((1));
  12755. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12756. $ctx1.sendIdx["printShowingDecimalPlaces:"]=8;
  12757. //>>excludeEnd("ctx");
  12758. self._assert_equals_($11,"100000000.0");
  12759. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12760. $ctx1.sendIdx["assert:equals:"]=8;
  12761. //>>excludeEnd("ctx");
  12762. $12=(0.98)._printShowingDecimalPlaces_((5));
  12763. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12764. $ctx1.sendIdx["printShowingDecimalPlaces:"]=9;
  12765. //>>excludeEnd("ctx");
  12766. self._assert_equals_($12,"0.98000");
  12767. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12768. $ctx1.sendIdx["assert:equals:"]=9;
  12769. //>>excludeEnd("ctx");
  12770. $13=$recv((0.98)._negated())._printShowingDecimalPlaces_((2));
  12771. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12772. $ctx1.sendIdx["printShowingDecimalPlaces:"]=10;
  12773. //>>excludeEnd("ctx");
  12774. self._assert_equals_($13,"-0.98");
  12775. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12776. $ctx1.sendIdx["assert:equals:"]=10;
  12777. //>>excludeEnd("ctx");
  12778. $14=(2.567)._printShowingDecimalPlaces_((2));
  12779. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12780. $ctx1.sendIdx["printShowingDecimalPlaces:"]=11;
  12781. //>>excludeEnd("ctx");
  12782. self._assert_equals_($14,"2.57");
  12783. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12784. $ctx1.sendIdx["assert:equals:"]=11;
  12785. //>>excludeEnd("ctx");
  12786. $15=(-2.567)._printShowingDecimalPlaces_((2));
  12787. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12788. $ctx1.sendIdx["printShowingDecimalPlaces:"]=12;
  12789. //>>excludeEnd("ctx");
  12790. self._assert_equals_($15,"-2.57");
  12791. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12792. $ctx1.sendIdx["assert:equals:"]=12;
  12793. //>>excludeEnd("ctx");
  12794. self._assert_equals_((0)._printShowingDecimalPlaces_((2)),"0.00");
  12795. return self;
  12796. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12797. }, function($ctx1) {$ctx1.fill(self,"testPrintShowingDecimalPlaces",{},$globals.NumberTest)});
  12798. //>>excludeEnd("ctx");
  12799. },
  12800. //>>excludeStart("ide", pragmas.excludeIdeData);
  12801. args: [],
  12802. 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'.",
  12803. referencedClasses: [],
  12804. //>>excludeEnd("ide");
  12805. messageSends: ["assert:equals:", "printShowingDecimalPlaces:", "negated"]
  12806. }),
  12807. $globals.NumberTest);
  12808. $core.addMethod(
  12809. $core.method({
  12810. selector: "testRaisedTo",
  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,$3;
  12818. $1=(2)._raisedTo_((4));
  12819. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12820. $ctx1.sendIdx["raisedTo:"]=1;
  12821. //>>excludeEnd("ctx");
  12822. self._assert_equals_($1,(16));
  12823. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12824. $ctx1.sendIdx["assert:equals:"]=1;
  12825. //>>excludeEnd("ctx");
  12826. $2=(2)._raisedTo_((0));
  12827. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12828. $ctx1.sendIdx["raisedTo:"]=2;
  12829. //>>excludeEnd("ctx");
  12830. self._assert_equals_($2,(1));
  12831. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12832. $ctx1.sendIdx["assert:equals:"]=2;
  12833. //>>excludeEnd("ctx");
  12834. $3=(2)._raisedTo_((-3));
  12835. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12836. $ctx1.sendIdx["raisedTo:"]=3;
  12837. //>>excludeEnd("ctx");
  12838. self._assert_equals_($3,(0.125));
  12839. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12840. $ctx1.sendIdx["assert:equals:"]=3;
  12841. //>>excludeEnd("ctx");
  12842. self._assert_equals_((4)._raisedTo_((0.5)),(2));
  12843. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12844. $ctx1.sendIdx["assert:equals:"]=4;
  12845. //>>excludeEnd("ctx");
  12846. self._assert_equals_((2).__star_star((4)),(16));
  12847. return self;
  12848. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12849. }, function($ctx1) {$ctx1.fill(self,"testRaisedTo",{},$globals.NumberTest)});
  12850. //>>excludeEnd("ctx");
  12851. },
  12852. //>>excludeStart("ide", pragmas.excludeIdeData);
  12853. args: [],
  12854. 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.",
  12855. referencedClasses: [],
  12856. //>>excludeEnd("ide");
  12857. messageSends: ["assert:equals:", "raisedTo:", "**"]
  12858. }),
  12859. $globals.NumberTest);
  12860. $core.addMethod(
  12861. $core.method({
  12862. selector: "testRounded",
  12863. protocol: 'tests',
  12864. fn: function (){
  12865. var self=this;
  12866. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12867. return $core.withContext(function($ctx1) {
  12868. //>>excludeEnd("ctx");
  12869. var $1,$2;
  12870. $1=(3)._rounded();
  12871. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12872. $ctx1.sendIdx["rounded"]=1;
  12873. //>>excludeEnd("ctx");
  12874. self._assert_equals_($1,(3));
  12875. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12876. $ctx1.sendIdx["assert:equals:"]=1;
  12877. //>>excludeEnd("ctx");
  12878. $2=(3.212)._rounded();
  12879. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12880. $ctx1.sendIdx["rounded"]=2;
  12881. //>>excludeEnd("ctx");
  12882. self._assert_equals_($2,(3));
  12883. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12884. $ctx1.sendIdx["assert:equals:"]=2;
  12885. //>>excludeEnd("ctx");
  12886. self._assert_equals_((3.51)._rounded(),(4));
  12887. return self;
  12888. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12889. }, function($ctx1) {$ctx1.fill(self,"testRounded",{},$globals.NumberTest)});
  12890. //>>excludeEnd("ctx");
  12891. },
  12892. //>>excludeStart("ide", pragmas.excludeIdeData);
  12893. args: [],
  12894. 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",
  12895. referencedClasses: [],
  12896. //>>excludeEnd("ide");
  12897. messageSends: ["assert:equals:", "rounded"]
  12898. }),
  12899. $globals.NumberTest);
  12900. $core.addMethod(
  12901. $core.method({
  12902. selector: "testSign",
  12903. protocol: 'tests',
  12904. fn: function (){
  12905. var self=this;
  12906. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12907. return $core.withContext(function($ctx1) {
  12908. //>>excludeEnd("ctx");
  12909. var $1,$2;
  12910. $1=(5)._sign();
  12911. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12912. $ctx1.sendIdx["sign"]=1;
  12913. //>>excludeEnd("ctx");
  12914. self._assert_equals_($1,(1));
  12915. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12916. $ctx1.sendIdx["assert:equals:"]=1;
  12917. //>>excludeEnd("ctx");
  12918. $2=(0)._sign();
  12919. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12920. $ctx1.sendIdx["sign"]=2;
  12921. //>>excludeEnd("ctx");
  12922. self._assert_equals_($2,(0));
  12923. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12924. $ctx1.sendIdx["assert:equals:"]=2;
  12925. //>>excludeEnd("ctx");
  12926. self._assert_equals_((-1.4)._sign(),(-1));
  12927. return self;
  12928. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12929. }, function($ctx1) {$ctx1.fill(self,"testSign",{},$globals.NumberTest)});
  12930. //>>excludeEnd("ctx");
  12931. },
  12932. //>>excludeStart("ide", pragmas.excludeIdeData);
  12933. args: [],
  12934. source: "testSign\x0a\x09self assert: 5 sign equals: 1.\x0a\x09self assert: 0 sign equals: 0.\x0a\x09self assert: -1.4 sign equals: -1.",
  12935. referencedClasses: [],
  12936. //>>excludeEnd("ide");
  12937. messageSends: ["assert:equals:", "sign"]
  12938. }),
  12939. $globals.NumberTest);
  12940. $core.addMethod(
  12941. $core.method({
  12942. selector: "testSqrt",
  12943. protocol: 'tests',
  12944. fn: function (){
  12945. var self=this;
  12946. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12947. return $core.withContext(function($ctx1) {
  12948. //>>excludeEnd("ctx");
  12949. var $1;
  12950. $1=(4)._sqrt();
  12951. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12952. $ctx1.sendIdx["sqrt"]=1;
  12953. //>>excludeEnd("ctx");
  12954. self._assert_equals_($1,(2));
  12955. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12956. $ctx1.sendIdx["assert:equals:"]=1;
  12957. //>>excludeEnd("ctx");
  12958. self._assert_equals_((16)._sqrt(),(4));
  12959. return self;
  12960. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12961. }, function($ctx1) {$ctx1.fill(self,"testSqrt",{},$globals.NumberTest)});
  12962. //>>excludeEnd("ctx");
  12963. },
  12964. //>>excludeStart("ide", pragmas.excludeIdeData);
  12965. args: [],
  12966. source: "testSqrt\x0a\x09\x0a\x09self assert: 4 sqrt equals: 2.\x0a\x09self assert: 16 sqrt equals: 4",
  12967. referencedClasses: [],
  12968. //>>excludeEnd("ide");
  12969. messageSends: ["assert:equals:", "sqrt"]
  12970. }),
  12971. $globals.NumberTest);
  12972. $core.addMethod(
  12973. $core.method({
  12974. selector: "testSquared",
  12975. protocol: 'tests',
  12976. fn: function (){
  12977. var self=this;
  12978. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12979. return $core.withContext(function($ctx1) {
  12980. //>>excludeEnd("ctx");
  12981. self._assert_equals_((4)._squared(),(16));
  12982. return self;
  12983. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12984. }, function($ctx1) {$ctx1.fill(self,"testSquared",{},$globals.NumberTest)});
  12985. //>>excludeEnd("ctx");
  12986. },
  12987. //>>excludeStart("ide", pragmas.excludeIdeData);
  12988. args: [],
  12989. source: "testSquared\x0a\x09\x0a\x09self assert: 4 squared equals: 16",
  12990. referencedClasses: [],
  12991. //>>excludeEnd("ide");
  12992. messageSends: ["assert:equals:", "squared"]
  12993. }),
  12994. $globals.NumberTest);
  12995. $core.addMethod(
  12996. $core.method({
  12997. selector: "testTimesRepeat",
  12998. protocol: 'tests',
  12999. fn: function (){
  13000. var self=this;
  13001. var i;
  13002. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13003. return $core.withContext(function($ctx1) {
  13004. //>>excludeEnd("ctx");
  13005. i=(0);
  13006. (0)._timesRepeat_((function(){
  13007. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13008. return $core.withContext(function($ctx2) {
  13009. //>>excludeEnd("ctx");
  13010. i=$recv(i).__plus((1));
  13011. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13012. $ctx2.sendIdx["+"]=1;
  13013. //>>excludeEnd("ctx");
  13014. return i;
  13015. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13016. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  13017. //>>excludeEnd("ctx");
  13018. }));
  13019. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13020. $ctx1.sendIdx["timesRepeat:"]=1;
  13021. //>>excludeEnd("ctx");
  13022. self._assert_equals_(i,(0));
  13023. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13024. $ctx1.sendIdx["assert:equals:"]=1;
  13025. //>>excludeEnd("ctx");
  13026. (5)._timesRepeat_((function(){
  13027. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13028. return $core.withContext(function($ctx2) {
  13029. //>>excludeEnd("ctx");
  13030. i=$recv(i).__plus((1));
  13031. return i;
  13032. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13033. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  13034. //>>excludeEnd("ctx");
  13035. }));
  13036. self._assert_equals_(i,(5));
  13037. return self;
  13038. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13039. }, function($ctx1) {$ctx1.fill(self,"testTimesRepeat",{i:i},$globals.NumberTest)});
  13040. //>>excludeEnd("ctx");
  13041. },
  13042. //>>excludeStart("ide", pragmas.excludeIdeData);
  13043. args: [],
  13044. 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",
  13045. referencedClasses: [],
  13046. //>>excludeEnd("ide");
  13047. messageSends: ["timesRepeat:", "+", "assert:equals:"]
  13048. }),
  13049. $globals.NumberTest);
  13050. $core.addMethod(
  13051. $core.method({
  13052. selector: "testTo",
  13053. protocol: 'tests',
  13054. fn: function (){
  13055. var self=this;
  13056. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13057. return $core.withContext(function($ctx1) {
  13058. //>>excludeEnd("ctx");
  13059. self._assert_equals_((1)._to_((5)),[(1), (2), (3), (4), (5)]);
  13060. return self;
  13061. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13062. }, function($ctx1) {$ctx1.fill(self,"testTo",{},$globals.NumberTest)});
  13063. //>>excludeEnd("ctx");
  13064. },
  13065. //>>excludeStart("ide", pragmas.excludeIdeData);
  13066. args: [],
  13067. source: "testTo\x0a\x09self assert: (1 to: 5) equals: #(1 2 3 4 5)",
  13068. referencedClasses: [],
  13069. //>>excludeEnd("ide");
  13070. messageSends: ["assert:equals:", "to:"]
  13071. }),
  13072. $globals.NumberTest);
  13073. $core.addMethod(
  13074. $core.method({
  13075. selector: "testToBy",
  13076. protocol: 'tests',
  13077. fn: function (){
  13078. var self=this;
  13079. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13080. return $core.withContext(function($ctx1) {
  13081. //>>excludeEnd("ctx");
  13082. var $1;
  13083. $1=(0)._to_by_((6),(2));
  13084. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13085. $ctx1.sendIdx["to:by:"]=1;
  13086. //>>excludeEnd("ctx");
  13087. self._assert_equals_($1,[(0), (2), (4), (6)]);
  13088. self._should_raise_((function(){
  13089. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13090. return $core.withContext(function($ctx2) {
  13091. //>>excludeEnd("ctx");
  13092. return (1)._to_by_((4),(0));
  13093. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13094. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  13095. //>>excludeEnd("ctx");
  13096. }),$globals.Error);
  13097. return self;
  13098. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13099. }, function($ctx1) {$ctx1.fill(self,"testToBy",{},$globals.NumberTest)});
  13100. //>>excludeEnd("ctx");
  13101. },
  13102. //>>excludeStart("ide", pragmas.excludeIdeData);
  13103. args: [],
  13104. 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",
  13105. referencedClasses: ["Error"],
  13106. //>>excludeEnd("ide");
  13107. messageSends: ["assert:equals:", "to:by:", "should:raise:"]
  13108. }),
  13109. $globals.NumberTest);
  13110. $core.addMethod(
  13111. $core.method({
  13112. selector: "testTrigonometry",
  13113. protocol: 'tests',
  13114. fn: function (){
  13115. var self=this;
  13116. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13117. return $core.withContext(function($ctx1) {
  13118. //>>excludeEnd("ctx");
  13119. self._assert_equals_((0)._cos(),(1));
  13120. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13121. $ctx1.sendIdx["assert:equals:"]=1;
  13122. //>>excludeEnd("ctx");
  13123. self._assert_equals_((0)._sin(),(0));
  13124. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13125. $ctx1.sendIdx["assert:equals:"]=2;
  13126. //>>excludeEnd("ctx");
  13127. self._assert_equals_((0)._tan(),(0));
  13128. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13129. $ctx1.sendIdx["assert:equals:"]=3;
  13130. //>>excludeEnd("ctx");
  13131. self._assert_equals_((1)._arcCos(),(0));
  13132. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13133. $ctx1.sendIdx["assert:equals:"]=4;
  13134. //>>excludeEnd("ctx");
  13135. self._assert_equals_((0)._arcSin(),(0));
  13136. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13137. $ctx1.sendIdx["assert:equals:"]=5;
  13138. //>>excludeEnd("ctx");
  13139. self._assert_equals_((0)._arcTan(),(0));
  13140. return self;
  13141. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13142. }, function($ctx1) {$ctx1.fill(self,"testTrigonometry",{},$globals.NumberTest)});
  13143. //>>excludeEnd("ctx");
  13144. },
  13145. //>>excludeStart("ide", pragmas.excludeIdeData);
  13146. args: [],
  13147. 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.",
  13148. referencedClasses: [],
  13149. //>>excludeEnd("ide");
  13150. messageSends: ["assert:equals:", "cos", "sin", "tan", "arcCos", "arcSin", "arcTan"]
  13151. }),
  13152. $globals.NumberTest);
  13153. $core.addMethod(
  13154. $core.method({
  13155. selector: "testTruncated",
  13156. protocol: 'tests',
  13157. fn: function (){
  13158. var self=this;
  13159. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13160. return $core.withContext(function($ctx1) {
  13161. //>>excludeEnd("ctx");
  13162. var $1,$2;
  13163. $1=(3)._truncated();
  13164. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13165. $ctx1.sendIdx["truncated"]=1;
  13166. //>>excludeEnd("ctx");
  13167. self._assert_equals_($1,(3));
  13168. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13169. $ctx1.sendIdx["assert:equals:"]=1;
  13170. //>>excludeEnd("ctx");
  13171. $2=(3.212)._truncated();
  13172. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13173. $ctx1.sendIdx["truncated"]=2;
  13174. //>>excludeEnd("ctx");
  13175. self._assert_equals_($2,(3));
  13176. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13177. $ctx1.sendIdx["assert:equals:"]=2;
  13178. //>>excludeEnd("ctx");
  13179. self._assert_equals_((3.51)._truncated(),(3));
  13180. return self;
  13181. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13182. }, function($ctx1) {$ctx1.fill(self,"testTruncated",{},$globals.NumberTest)});
  13183. //>>excludeEnd("ctx");
  13184. },
  13185. //>>excludeStart("ide", pragmas.excludeIdeData);
  13186. args: [],
  13187. 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",
  13188. referencedClasses: [],
  13189. //>>excludeEnd("ide");
  13190. messageSends: ["assert:equals:", "truncated"]
  13191. }),
  13192. $globals.NumberTest);
  13193. $core.addClass('ObjectMock', $globals.Object, ['foo', 'bar'], 'Kernel-Tests');
  13194. //>>excludeStart("ide", pragmas.excludeIdeData);
  13195. $globals.ObjectMock.comment="ObjectMock is there only to perform tests on classes.";
  13196. //>>excludeEnd("ide");
  13197. $core.addMethod(
  13198. $core.method({
  13199. selector: "foo",
  13200. protocol: 'not yet classified',
  13201. fn: function (){
  13202. var self=this;
  13203. return self["@foo"];
  13204. },
  13205. //>>excludeStart("ide", pragmas.excludeIdeData);
  13206. args: [],
  13207. source: "foo\x0a\x09^ foo",
  13208. referencedClasses: [],
  13209. //>>excludeEnd("ide");
  13210. messageSends: []
  13211. }),
  13212. $globals.ObjectMock);
  13213. $core.addMethod(
  13214. $core.method({
  13215. selector: "foo:",
  13216. protocol: 'not yet classified',
  13217. fn: function (anObject){
  13218. var self=this;
  13219. self["@foo"]=anObject;
  13220. return self;
  13221. },
  13222. //>>excludeStart("ide", pragmas.excludeIdeData);
  13223. args: ["anObject"],
  13224. source: "foo: anObject\x0a\x09foo := anObject",
  13225. referencedClasses: [],
  13226. //>>excludeEnd("ide");
  13227. messageSends: []
  13228. }),
  13229. $globals.ObjectMock);
  13230. $core.addClass('ObjectTest', $globals.TestCase, [], 'Kernel-Tests');
  13231. $core.addMethod(
  13232. $core.method({
  13233. selector: "notDefined",
  13234. protocol: 'tests',
  13235. fn: function (){
  13236. var self=this;
  13237. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13238. return $core.withContext(function($ctx1) {
  13239. //>>excludeEnd("ctx");
  13240. return void 0;;
  13241. return self;
  13242. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13243. }, function($ctx1) {$ctx1.fill(self,"notDefined",{},$globals.ObjectTest)});
  13244. //>>excludeEnd("ctx");
  13245. },
  13246. //>>excludeStart("ide", pragmas.excludeIdeData);
  13247. args: [],
  13248. source: "notDefined\x0a\x09<inlineJS: 'return void 0;'>",
  13249. referencedClasses: [],
  13250. //>>excludeEnd("ide");
  13251. messageSends: []
  13252. }),
  13253. $globals.ObjectTest);
  13254. $core.addMethod(
  13255. $core.method({
  13256. selector: "testBasicAccess",
  13257. protocol: 'tests',
  13258. fn: function (){
  13259. var self=this;
  13260. var o;
  13261. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13262. return $core.withContext(function($ctx1) {
  13263. //>>excludeEnd("ctx");
  13264. var $1;
  13265. o=$recv($globals.Object)._new();
  13266. $recv(o)._basicAt_put_("a",(1));
  13267. $1=$recv(o)._basicAt_("a");
  13268. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13269. $ctx1.sendIdx["basicAt:"]=1;
  13270. //>>excludeEnd("ctx");
  13271. self._assert_equals_($1,(1));
  13272. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13273. $ctx1.sendIdx["assert:equals:"]=1;
  13274. //>>excludeEnd("ctx");
  13275. self._assert_equals_($recv(o)._basicAt_("b"),nil);
  13276. return self;
  13277. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13278. }, function($ctx1) {$ctx1.fill(self,"testBasicAccess",{o:o},$globals.ObjectTest)});
  13279. //>>excludeEnd("ctx");
  13280. },
  13281. //>>excludeStart("ide", pragmas.excludeIdeData);
  13282. args: [],
  13283. 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",
  13284. referencedClasses: ["Object"],
  13285. //>>excludeEnd("ide");
  13286. messageSends: ["new", "basicAt:put:", "assert:equals:", "basicAt:"]
  13287. }),
  13288. $globals.ObjectTest);
  13289. $core.addMethod(
  13290. $core.method({
  13291. selector: "testBasicPerform",
  13292. protocol: 'tests',
  13293. fn: function (){
  13294. var self=this;
  13295. var o;
  13296. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13297. return $core.withContext(function($ctx1) {
  13298. //>>excludeEnd("ctx");
  13299. o=$recv($globals.Object)._new();
  13300. $recv(o)._basicAt_put_("func",(function(){
  13301. return "hello";
  13302. }));
  13303. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13304. $ctx1.sendIdx["basicAt:put:"]=1;
  13305. //>>excludeEnd("ctx");
  13306. $recv(o)._basicAt_put_("func2",(function(a){
  13307. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13308. return $core.withContext(function($ctx2) {
  13309. //>>excludeEnd("ctx");
  13310. return $recv(a).__plus((1));
  13311. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13312. }, function($ctx2) {$ctx2.fillBlock({a:a},$ctx1,2)});
  13313. //>>excludeEnd("ctx");
  13314. }));
  13315. self._assert_equals_($recv(o)._basicPerform_("func"),"hello");
  13316. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13317. $ctx1.sendIdx["assert:equals:"]=1;
  13318. //>>excludeEnd("ctx");
  13319. self._assert_equals_($recv(o)._basicPerform_withArguments_("func2",[(3)]),(4));
  13320. return self;
  13321. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13322. }, function($ctx1) {$ctx1.fill(self,"testBasicPerform",{o:o},$globals.ObjectTest)});
  13323. //>>excludeEnd("ctx");
  13324. },
  13325. //>>excludeStart("ide", pragmas.excludeIdeData);
  13326. args: [],
  13327. 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",
  13328. referencedClasses: ["Object"],
  13329. //>>excludeEnd("ide");
  13330. messageSends: ["new", "basicAt:put:", "+", "assert:equals:", "basicPerform:", "basicPerform:withArguments:"]
  13331. }),
  13332. $globals.ObjectTest);
  13333. $core.addMethod(
  13334. $core.method({
  13335. selector: "testDNU",
  13336. protocol: 'tests',
  13337. fn: function (){
  13338. var self=this;
  13339. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13340. return $core.withContext(function($ctx1) {
  13341. //>>excludeEnd("ctx");
  13342. self._should_raise_((function(){
  13343. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13344. return $core.withContext(function($ctx2) {
  13345. //>>excludeEnd("ctx");
  13346. return $recv($recv($globals.Object)._new())._foo();
  13347. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13348. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  13349. //>>excludeEnd("ctx");
  13350. }),$globals.MessageNotUnderstood);
  13351. return self;
  13352. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13353. }, function($ctx1) {$ctx1.fill(self,"testDNU",{},$globals.ObjectTest)});
  13354. //>>excludeEnd("ctx");
  13355. },
  13356. //>>excludeStart("ide", pragmas.excludeIdeData);
  13357. args: [],
  13358. source: "testDNU\x0a\x09self should: [ Object new foo ] raise: MessageNotUnderstood",
  13359. referencedClasses: ["Object", "MessageNotUnderstood"],
  13360. //>>excludeEnd("ide");
  13361. messageSends: ["should:raise:", "foo", "new"]
  13362. }),
  13363. $globals.ObjectTest);
  13364. $core.addMethod(
  13365. $core.method({
  13366. selector: "testEquality",
  13367. protocol: 'tests',
  13368. fn: function (){
  13369. var self=this;
  13370. var o;
  13371. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13372. return $core.withContext(function($ctx1) {
  13373. //>>excludeEnd("ctx");
  13374. var $1,$2,$4,$3;
  13375. o=$recv($globals.Object)._new();
  13376. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13377. $ctx1.sendIdx["new"]=1;
  13378. //>>excludeEnd("ctx");
  13379. $1=$recv(o).__eq($recv($globals.Object)._new());
  13380. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13381. $ctx1.sendIdx["="]=1;
  13382. //>>excludeEnd("ctx");
  13383. self._deny_($1);
  13384. $2=$recv(o).__eq(o);
  13385. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13386. $ctx1.sendIdx["="]=2;
  13387. //>>excludeEnd("ctx");
  13388. self._assert_($2);
  13389. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13390. $ctx1.sendIdx["assert:"]=1;
  13391. //>>excludeEnd("ctx");
  13392. $4=$recv(o)._yourself();
  13393. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13394. $ctx1.sendIdx["yourself"]=1;
  13395. //>>excludeEnd("ctx");
  13396. $3=$recv($4).__eq(o);
  13397. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13398. $ctx1.sendIdx["="]=3;
  13399. //>>excludeEnd("ctx");
  13400. self._assert_($3);
  13401. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13402. $ctx1.sendIdx["assert:"]=2;
  13403. //>>excludeEnd("ctx");
  13404. self._assert_($recv(o).__eq($recv(o)._yourself()));
  13405. return self;
  13406. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13407. }, function($ctx1) {$ctx1.fill(self,"testEquality",{o:o},$globals.ObjectTest)});
  13408. //>>excludeEnd("ctx");
  13409. },
  13410. //>>excludeStart("ide", pragmas.excludeIdeData);
  13411. args: [],
  13412. 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)",
  13413. referencedClasses: ["Object"],
  13414. //>>excludeEnd("ide");
  13415. messageSends: ["new", "deny:", "=", "assert:", "yourself"]
  13416. }),
  13417. $globals.ObjectTest);
  13418. $core.addMethod(
  13419. $core.method({
  13420. selector: "testHalt",
  13421. protocol: 'tests',
  13422. fn: function (){
  13423. var self=this;
  13424. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13425. return $core.withContext(function($ctx1) {
  13426. //>>excludeEnd("ctx");
  13427. self._should_raise_((function(){
  13428. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13429. return $core.withContext(function($ctx2) {
  13430. //>>excludeEnd("ctx");
  13431. return $recv($recv($globals.Object)._new())._halt();
  13432. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13433. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  13434. //>>excludeEnd("ctx");
  13435. }),$globals.Error);
  13436. return self;
  13437. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13438. }, function($ctx1) {$ctx1.fill(self,"testHalt",{},$globals.ObjectTest)});
  13439. //>>excludeEnd("ctx");
  13440. },
  13441. //>>excludeStart("ide", pragmas.excludeIdeData);
  13442. args: [],
  13443. source: "testHalt\x0a\x09self should: [ Object new halt ] raise: Error",
  13444. referencedClasses: ["Object", "Error"],
  13445. //>>excludeEnd("ide");
  13446. messageSends: ["should:raise:", "halt", "new"]
  13447. }),
  13448. $globals.ObjectTest);
  13449. $core.addMethod(
  13450. $core.method({
  13451. selector: "testIdentity",
  13452. protocol: 'tests',
  13453. fn: function (){
  13454. var self=this;
  13455. var o;
  13456. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13457. return $core.withContext(function($ctx1) {
  13458. //>>excludeEnd("ctx");
  13459. var $1,$2,$4,$3;
  13460. o=$recv($globals.Object)._new();
  13461. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13462. $ctx1.sendIdx["new"]=1;
  13463. //>>excludeEnd("ctx");
  13464. $1=$recv(o).__eq_eq($recv($globals.Object)._new());
  13465. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13466. $ctx1.sendIdx["=="]=1;
  13467. //>>excludeEnd("ctx");
  13468. self._deny_($1);
  13469. $2=$recv(o).__eq_eq(o);
  13470. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13471. $ctx1.sendIdx["=="]=2;
  13472. //>>excludeEnd("ctx");
  13473. self._assert_($2);
  13474. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13475. $ctx1.sendIdx["assert:"]=1;
  13476. //>>excludeEnd("ctx");
  13477. $4=$recv(o)._yourself();
  13478. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13479. $ctx1.sendIdx["yourself"]=1;
  13480. //>>excludeEnd("ctx");
  13481. $3=$recv($4).__eq_eq(o);
  13482. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13483. $ctx1.sendIdx["=="]=3;
  13484. //>>excludeEnd("ctx");
  13485. self._assert_($3);
  13486. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13487. $ctx1.sendIdx["assert:"]=2;
  13488. //>>excludeEnd("ctx");
  13489. self._assert_($recv(o).__eq_eq($recv(o)._yourself()));
  13490. return self;
  13491. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13492. }, function($ctx1) {$ctx1.fill(self,"testIdentity",{o:o},$globals.ObjectTest)});
  13493. //>>excludeEnd("ctx");
  13494. },
  13495. //>>excludeStart("ide", pragmas.excludeIdeData);
  13496. args: [],
  13497. 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",
  13498. referencedClasses: ["Object"],
  13499. //>>excludeEnd("ide");
  13500. messageSends: ["new", "deny:", "==", "assert:", "yourself"]
  13501. }),
  13502. $globals.ObjectTest);
  13503. $core.addMethod(
  13504. $core.method({
  13505. selector: "testIfNil",
  13506. protocol: 'tests',
  13507. fn: function (){
  13508. var self=this;
  13509. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13510. return $core.withContext(function($ctx1) {
  13511. //>>excludeEnd("ctx");
  13512. var $2,$1,$5,$4,$3,$7,$6,$9,$8,$11,$10,$receiver;
  13513. $2=$recv($globals.Object)._new();
  13514. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13515. $ctx1.sendIdx["new"]=1;
  13516. //>>excludeEnd("ctx");
  13517. $1=$recv($2)._isNil();
  13518. self._deny_($1);
  13519. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13520. $ctx1.sendIdx["deny:"]=1;
  13521. //>>excludeEnd("ctx");
  13522. $5=$recv($globals.Object)._new();
  13523. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13524. $ctx1.sendIdx["new"]=2;
  13525. //>>excludeEnd("ctx");
  13526. if(($receiver = $5) == null || $receiver.isNil){
  13527. $4=true;
  13528. } else {
  13529. $4=$5;
  13530. };
  13531. $3=$recv($4).__eq(true);
  13532. self._deny_($3);
  13533. $7=$recv($globals.Object)._new();
  13534. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13535. $ctx1.sendIdx["new"]=3;
  13536. //>>excludeEnd("ctx");
  13537. if(($receiver = $7) == null || $receiver.isNil){
  13538. $6=$7;
  13539. } else {
  13540. $6=true;
  13541. };
  13542. self._assert_equals_($6,true);
  13543. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13544. $ctx1.sendIdx["assert:equals:"]=1;
  13545. //>>excludeEnd("ctx");
  13546. $9=$recv($globals.Object)._new();
  13547. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13548. $ctx1.sendIdx["new"]=4;
  13549. //>>excludeEnd("ctx");
  13550. if(($receiver = $9) == null || $receiver.isNil){
  13551. $8=false;
  13552. } else {
  13553. $8=true;
  13554. };
  13555. self._assert_equals_($8,true);
  13556. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13557. $ctx1.sendIdx["assert:equals:"]=2;
  13558. //>>excludeEnd("ctx");
  13559. $11=$recv($globals.Object)._new();
  13560. if(($receiver = $11) == null || $receiver.isNil){
  13561. $10=false;
  13562. } else {
  13563. $10=true;
  13564. };
  13565. self._assert_equals_($10,true);
  13566. return self;
  13567. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13568. }, function($ctx1) {$ctx1.fill(self,"testIfNil",{},$globals.ObjectTest)});
  13569. //>>excludeEnd("ctx");
  13570. },
  13571. //>>excludeStart("ide", pragmas.excludeIdeData);
  13572. args: [],
  13573. 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",
  13574. referencedClasses: ["Object"],
  13575. //>>excludeEnd("ide");
  13576. messageSends: ["deny:", "isNil", "new", "=", "ifNil:", "assert:equals:", "ifNotNil:", "ifNil:ifNotNil:", "ifNotNil:ifNil:"]
  13577. }),
  13578. $globals.ObjectTest);
  13579. $core.addMethod(
  13580. $core.method({
  13581. selector: "testInstVars",
  13582. protocol: 'tests',
  13583. fn: function (){
  13584. var self=this;
  13585. var o;
  13586. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13587. return $core.withContext(function($ctx1) {
  13588. //>>excludeEnd("ctx");
  13589. var $1,$2;
  13590. o=$recv($globals.ObjectMock)._new();
  13591. $1=$recv(o)._instVarAt_("foo");
  13592. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13593. $ctx1.sendIdx["instVarAt:"]=1;
  13594. //>>excludeEnd("ctx");
  13595. self._assert_equals_($1,nil);
  13596. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13597. $ctx1.sendIdx["assert:equals:"]=1;
  13598. //>>excludeEnd("ctx");
  13599. $recv(o)._instVarAt_put_("foo",(1));
  13600. $2=$recv(o)._instVarAt_("foo");
  13601. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13602. $ctx1.sendIdx["instVarAt:"]=2;
  13603. //>>excludeEnd("ctx");
  13604. self._assert_equals_($2,(1));
  13605. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13606. $ctx1.sendIdx["assert:equals:"]=2;
  13607. //>>excludeEnd("ctx");
  13608. self._assert_equals_($recv(o)._instVarAt_("foo"),(1));
  13609. return self;
  13610. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13611. }, function($ctx1) {$ctx1.fill(self,"testInstVars",{o:o},$globals.ObjectTest)});
  13612. //>>excludeEnd("ctx");
  13613. },
  13614. //>>excludeStart("ide", pragmas.excludeIdeData);
  13615. args: [],
  13616. 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",
  13617. referencedClasses: ["ObjectMock"],
  13618. //>>excludeEnd("ide");
  13619. messageSends: ["new", "assert:equals:", "instVarAt:", "instVarAt:put:"]
  13620. }),
  13621. $globals.ObjectTest);
  13622. $core.addMethod(
  13623. $core.method({
  13624. selector: "testNilUndefined",
  13625. protocol: 'tests',
  13626. fn: function (){
  13627. var self=this;
  13628. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13629. return $core.withContext(function($ctx1) {
  13630. //>>excludeEnd("ctx");
  13631. self._assert_equals_(self._notDefined(),nil);
  13632. return self;
  13633. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13634. }, function($ctx1) {$ctx1.fill(self,"testNilUndefined",{},$globals.ObjectTest)});
  13635. //>>excludeEnd("ctx");
  13636. },
  13637. //>>excludeStart("ide", pragmas.excludeIdeData);
  13638. args: [],
  13639. source: "testNilUndefined\x0a\x09\x22nil in Smalltalk is the undefined object in JS\x22\x0a\x0a\x09self assert: self notDefined equals: nil",
  13640. referencedClasses: [],
  13641. //>>excludeEnd("ide");
  13642. messageSends: ["assert:equals:", "notDefined"]
  13643. }),
  13644. $globals.ObjectTest);
  13645. $core.addMethod(
  13646. $core.method({
  13647. selector: "testYourself",
  13648. protocol: 'tests',
  13649. fn: function (){
  13650. var self=this;
  13651. var o;
  13652. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13653. return $core.withContext(function($ctx1) {
  13654. //>>excludeEnd("ctx");
  13655. o=$recv($globals.ObjectMock)._new();
  13656. self._assert_($recv($recv(o)._yourself()).__eq_eq(o));
  13657. return self;
  13658. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13659. }, function($ctx1) {$ctx1.fill(self,"testYourself",{o:o},$globals.ObjectTest)});
  13660. //>>excludeEnd("ctx");
  13661. },
  13662. //>>excludeStart("ide", pragmas.excludeIdeData);
  13663. args: [],
  13664. source: "testYourself\x0a\x09| o |\x0a\x09o := ObjectMock new.\x0a\x09self assert: o yourself == o",
  13665. referencedClasses: ["ObjectMock"],
  13666. //>>excludeEnd("ide");
  13667. messageSends: ["new", "assert:", "==", "yourself"]
  13668. }),
  13669. $globals.ObjectTest);
  13670. $core.addMethod(
  13671. $core.method({
  13672. selector: "testidentityHash",
  13673. protocol: 'tests',
  13674. fn: function (){
  13675. var self=this;
  13676. var o1,o2;
  13677. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13678. return $core.withContext(function($ctx1) {
  13679. //>>excludeEnd("ctx");
  13680. var $2,$3,$1,$5,$4;
  13681. o1=$recv($globals.Object)._new();
  13682. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13683. $ctx1.sendIdx["new"]=1;
  13684. //>>excludeEnd("ctx");
  13685. o2=$recv($globals.Object)._new();
  13686. $2=$recv(o1)._identityHash();
  13687. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13688. $ctx1.sendIdx["identityHash"]=1;
  13689. //>>excludeEnd("ctx");
  13690. $3=$recv(o1)._identityHash();
  13691. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13692. $ctx1.sendIdx["identityHash"]=2;
  13693. //>>excludeEnd("ctx");
  13694. $1=$recv($2).__eq_eq($3);
  13695. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13696. $ctx1.sendIdx["=="]=1;
  13697. //>>excludeEnd("ctx");
  13698. self._assert_($1);
  13699. $5=$recv(o1)._identityHash();
  13700. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13701. $ctx1.sendIdx["identityHash"]=3;
  13702. //>>excludeEnd("ctx");
  13703. $4=$recv($5).__eq_eq($recv(o2)._identityHash());
  13704. self._deny_($4);
  13705. return self;
  13706. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13707. }, function($ctx1) {$ctx1.fill(self,"testidentityHash",{o1:o1,o2:o2},$globals.ObjectTest)});
  13708. //>>excludeEnd("ctx");
  13709. },
  13710. //>>excludeStart("ide", pragmas.excludeIdeData);
  13711. args: [],
  13712. 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",
  13713. referencedClasses: ["Object"],
  13714. //>>excludeEnd("ide");
  13715. messageSends: ["new", "assert:", "==", "identityHash", "deny:"]
  13716. }),
  13717. $globals.ObjectTest);
  13718. $core.addClass('PointTest', $globals.TestCase, [], 'Kernel-Tests');
  13719. $core.addMethod(
  13720. $core.method({
  13721. selector: "testAccessing",
  13722. protocol: 'tests',
  13723. fn: function (){
  13724. var self=this;
  13725. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13726. return $core.withContext(function($ctx1) {
  13727. //>>excludeEnd("ctx");
  13728. var $2,$1,$3,$6,$5,$4;
  13729. $2=$recv($globals.Point)._x_y_((3),(4));
  13730. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13731. $ctx1.sendIdx["x:y:"]=1;
  13732. //>>excludeEnd("ctx");
  13733. $1=$recv($2)._x();
  13734. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13735. $ctx1.sendIdx["x"]=1;
  13736. //>>excludeEnd("ctx");
  13737. self._assert_equals_($1,(3));
  13738. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13739. $ctx1.sendIdx["assert:equals:"]=1;
  13740. //>>excludeEnd("ctx");
  13741. $3=$recv($recv($globals.Point)._x_y_((3),(4)))._y();
  13742. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13743. $ctx1.sendIdx["y"]=1;
  13744. //>>excludeEnd("ctx");
  13745. self._assert_equals_($3,(4));
  13746. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13747. $ctx1.sendIdx["assert:equals:"]=2;
  13748. //>>excludeEnd("ctx");
  13749. $6=$recv($globals.Point)._new();
  13750. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13751. $ctx1.sendIdx["new"]=1;
  13752. //>>excludeEnd("ctx");
  13753. $5=$recv($6)._x_((3));
  13754. $4=$recv($5)._x();
  13755. self._assert_equals_($4,(3));
  13756. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13757. $ctx1.sendIdx["assert:equals:"]=3;
  13758. //>>excludeEnd("ctx");
  13759. self._assert_equals_($recv($recv($recv($globals.Point)._new())._y_((4)))._y(),(4));
  13760. return self;
  13761. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13762. }, function($ctx1) {$ctx1.fill(self,"testAccessing",{},$globals.PointTest)});
  13763. //>>excludeEnd("ctx");
  13764. },
  13765. //>>excludeStart("ide", pragmas.excludeIdeData);
  13766. args: [],
  13767. 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",
  13768. referencedClasses: ["Point"],
  13769. //>>excludeEnd("ide");
  13770. messageSends: ["assert:equals:", "x", "x:y:", "y", "x:", "new", "y:"]
  13771. }),
  13772. $globals.PointTest);
  13773. $core.addMethod(
  13774. $core.method({
  13775. selector: "testArithmetic",
  13776. protocol: 'tests',
  13777. fn: function (){
  13778. var self=this;
  13779. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13780. return $core.withContext(function($ctx1) {
  13781. //>>excludeEnd("ctx");
  13782. var $2,$3,$1,$4,$6,$7,$5,$8,$10,$11,$9,$12,$14,$13;
  13783. $2=(3).__at((4));
  13784. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13785. $ctx1.sendIdx["@"]=1;
  13786. //>>excludeEnd("ctx");
  13787. $3=(3).__at((4));
  13788. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13789. $ctx1.sendIdx["@"]=2;
  13790. //>>excludeEnd("ctx");
  13791. $1=$recv($2).__star($3);
  13792. $4=$recv($globals.Point)._x_y_((9),(16));
  13793. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13794. $ctx1.sendIdx["x:y:"]=1;
  13795. //>>excludeEnd("ctx");
  13796. self._assert_equals_($1,$4);
  13797. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13798. $ctx1.sendIdx["assert:equals:"]=1;
  13799. //>>excludeEnd("ctx");
  13800. $6=(3).__at((4));
  13801. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13802. $ctx1.sendIdx["@"]=3;
  13803. //>>excludeEnd("ctx");
  13804. $7=(3).__at((4));
  13805. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13806. $ctx1.sendIdx["@"]=4;
  13807. //>>excludeEnd("ctx");
  13808. $5=$recv($6).__plus($7);
  13809. $8=$recv($globals.Point)._x_y_((6),(8));
  13810. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13811. $ctx1.sendIdx["x:y:"]=2;
  13812. //>>excludeEnd("ctx");
  13813. self._assert_equals_($5,$8);
  13814. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13815. $ctx1.sendIdx["assert:equals:"]=2;
  13816. //>>excludeEnd("ctx");
  13817. $10=(3).__at((4));
  13818. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13819. $ctx1.sendIdx["@"]=5;
  13820. //>>excludeEnd("ctx");
  13821. $11=(3).__at((4));
  13822. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13823. $ctx1.sendIdx["@"]=6;
  13824. //>>excludeEnd("ctx");
  13825. $9=$recv($10).__minus($11);
  13826. $12=$recv($globals.Point)._x_y_((0),(0));
  13827. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13828. $ctx1.sendIdx["x:y:"]=3;
  13829. //>>excludeEnd("ctx");
  13830. self._assert_equals_($9,$12);
  13831. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13832. $ctx1.sendIdx["assert:equals:"]=3;
  13833. //>>excludeEnd("ctx");
  13834. $14=(6).__at((8));
  13835. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13836. $ctx1.sendIdx["@"]=7;
  13837. //>>excludeEnd("ctx");
  13838. $13=$recv($14).__slash((3).__at((4)));
  13839. self._assert_equals_($13,$recv($globals.Point)._x_y_((2),(2)));
  13840. return self;
  13841. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13842. }, function($ctx1) {$ctx1.fill(self,"testArithmetic",{},$globals.PointTest)});
  13843. //>>excludeEnd("ctx");
  13844. },
  13845. //>>excludeStart("ide", pragmas.excludeIdeData);
  13846. args: [],
  13847. 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)",
  13848. referencedClasses: ["Point"],
  13849. //>>excludeEnd("ide");
  13850. messageSends: ["assert:equals:", "*", "@", "x:y:", "+", "-", "/"]
  13851. }),
  13852. $globals.PointTest);
  13853. $core.addMethod(
  13854. $core.method({
  13855. selector: "testAt",
  13856. protocol: 'tests',
  13857. fn: function (){
  13858. var self=this;
  13859. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13860. return $core.withContext(function($ctx1) {
  13861. //>>excludeEnd("ctx");
  13862. self._assert_equals_((3).__at((4)),$recv($globals.Point)._x_y_((3),(4)));
  13863. return self;
  13864. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13865. }, function($ctx1) {$ctx1.fill(self,"testAt",{},$globals.PointTest)});
  13866. //>>excludeEnd("ctx");
  13867. },
  13868. //>>excludeStart("ide", pragmas.excludeIdeData);
  13869. args: [],
  13870. source: "testAt\x0a\x09self assert: 3@4 equals: (Point x: 3 y: 4)",
  13871. referencedClasses: ["Point"],
  13872. //>>excludeEnd("ide");
  13873. messageSends: ["assert:equals:", "@", "x:y:"]
  13874. }),
  13875. $globals.PointTest);
  13876. $core.addMethod(
  13877. $core.method({
  13878. selector: "testComparison",
  13879. protocol: 'tests',
  13880. fn: function (){
  13881. var self=this;
  13882. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13883. return $core.withContext(function($ctx1) {
  13884. //>>excludeEnd("ctx");
  13885. var $2,$3,$1,$5,$6,$4,$8,$9,$7,$11,$12,$10,$14,$15,$13,$17,$18,$16,$20,$21,$19,$23,$22;
  13886. $2=(3).__at((4));
  13887. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13888. $ctx1.sendIdx["@"]=1;
  13889. //>>excludeEnd("ctx");
  13890. $3=(4).__at((5));
  13891. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13892. $ctx1.sendIdx["@"]=2;
  13893. //>>excludeEnd("ctx");
  13894. $1=$recv($2).__lt($3);
  13895. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13896. $ctx1.sendIdx["<"]=1;
  13897. //>>excludeEnd("ctx");
  13898. self._assert_($1);
  13899. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13900. $ctx1.sendIdx["assert:"]=1;
  13901. //>>excludeEnd("ctx");
  13902. $5=(3).__at((4));
  13903. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13904. $ctx1.sendIdx["@"]=3;
  13905. //>>excludeEnd("ctx");
  13906. $6=(4).__at((4));
  13907. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13908. $ctx1.sendIdx["@"]=4;
  13909. //>>excludeEnd("ctx");
  13910. $4=$recv($5).__lt($6);
  13911. self._deny_($4);
  13912. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13913. $ctx1.sendIdx["deny:"]=1;
  13914. //>>excludeEnd("ctx");
  13915. $8=(4).__at((5));
  13916. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13917. $ctx1.sendIdx["@"]=5;
  13918. //>>excludeEnd("ctx");
  13919. $9=(4).__at((5));
  13920. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13921. $ctx1.sendIdx["@"]=6;
  13922. //>>excludeEnd("ctx");
  13923. $7=$recv($8).__lt_eq($9);
  13924. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13925. $ctx1.sendIdx["<="]=1;
  13926. //>>excludeEnd("ctx");
  13927. self._assert_($7);
  13928. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13929. $ctx1.sendIdx["assert:"]=2;
  13930. //>>excludeEnd("ctx");
  13931. $11=(4).__at((5));
  13932. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13933. $ctx1.sendIdx["@"]=7;
  13934. //>>excludeEnd("ctx");
  13935. $12=(3).__at((5));
  13936. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13937. $ctx1.sendIdx["@"]=8;
  13938. //>>excludeEnd("ctx");
  13939. $10=$recv($11).__lt_eq($12);
  13940. self._deny_($10);
  13941. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13942. $ctx1.sendIdx["deny:"]=2;
  13943. //>>excludeEnd("ctx");
  13944. $14=(5).__at((6));
  13945. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13946. $ctx1.sendIdx["@"]=9;
  13947. //>>excludeEnd("ctx");
  13948. $15=(4).__at((5));
  13949. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13950. $ctx1.sendIdx["@"]=10;
  13951. //>>excludeEnd("ctx");
  13952. $13=$recv($14).__gt($15);
  13953. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13954. $ctx1.sendIdx[">"]=1;
  13955. //>>excludeEnd("ctx");
  13956. self._assert_($13);
  13957. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13958. $ctx1.sendIdx["assert:"]=3;
  13959. //>>excludeEnd("ctx");
  13960. $17=(5).__at((6));
  13961. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13962. $ctx1.sendIdx["@"]=11;
  13963. //>>excludeEnd("ctx");
  13964. $18=(6).__at((6));
  13965. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13966. $ctx1.sendIdx["@"]=12;
  13967. //>>excludeEnd("ctx");
  13968. $16=$recv($17).__gt($18);
  13969. self._deny_($16);
  13970. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13971. $ctx1.sendIdx["deny:"]=3;
  13972. //>>excludeEnd("ctx");
  13973. $20=(4).__at((5));
  13974. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13975. $ctx1.sendIdx["@"]=13;
  13976. //>>excludeEnd("ctx");
  13977. $21=(4).__at((5));
  13978. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13979. $ctx1.sendIdx["@"]=14;
  13980. //>>excludeEnd("ctx");
  13981. $19=$recv($20).__gt_eq($21);
  13982. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13983. $ctx1.sendIdx[">="]=1;
  13984. //>>excludeEnd("ctx");
  13985. self._assert_($19);
  13986. $23=(4).__at((5));
  13987. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13988. $ctx1.sendIdx["@"]=15;
  13989. //>>excludeEnd("ctx");
  13990. $22=$recv($23).__gt_eq((5).__at((5)));
  13991. self._deny_($22);
  13992. return self;
  13993. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13994. }, function($ctx1) {$ctx1.fill(self,"testComparison",{},$globals.PointTest)});
  13995. //>>excludeEnd("ctx");
  13996. },
  13997. //>>excludeStart("ide", pragmas.excludeIdeData);
  13998. args: [],
  13999. 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)",
  14000. referencedClasses: [],
  14001. //>>excludeEnd("ide");
  14002. messageSends: ["assert:", "<", "@", "deny:", "<=", ">", ">="]
  14003. }),
  14004. $globals.PointTest);
  14005. $core.addMethod(
  14006. $core.method({
  14007. selector: "testEgality",
  14008. protocol: 'tests',
  14009. fn: function (){
  14010. var self=this;
  14011. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14012. return $core.withContext(function($ctx1) {
  14013. //>>excludeEnd("ctx");
  14014. var $2,$3,$1,$5,$4;
  14015. $2=(3).__at((4));
  14016. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14017. $ctx1.sendIdx["@"]=1;
  14018. //>>excludeEnd("ctx");
  14019. $3=(3).__at((4));
  14020. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14021. $ctx1.sendIdx["@"]=2;
  14022. //>>excludeEnd("ctx");
  14023. $1=$recv($2).__eq($3);
  14024. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14025. $ctx1.sendIdx["="]=1;
  14026. //>>excludeEnd("ctx");
  14027. self._assert_($1);
  14028. $5=(3).__at((5));
  14029. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14030. $ctx1.sendIdx["@"]=3;
  14031. //>>excludeEnd("ctx");
  14032. $4=$recv($5).__eq((3).__at((6)));
  14033. self._deny_($4);
  14034. return self;
  14035. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14036. }, function($ctx1) {$ctx1.fill(self,"testEgality",{},$globals.PointTest)});
  14037. //>>excludeEnd("ctx");
  14038. },
  14039. //>>excludeStart("ide", pragmas.excludeIdeData);
  14040. args: [],
  14041. source: "testEgality\x0a\x09self assert: (3@4 = (3@4)).\x0a\x09self deny: 3@5 = (3@6)",
  14042. referencedClasses: [],
  14043. //>>excludeEnd("ide");
  14044. messageSends: ["assert:", "=", "@", "deny:"]
  14045. }),
  14046. $globals.PointTest);
  14047. $core.addMethod(
  14048. $core.method({
  14049. selector: "testNew",
  14050. protocol: 'tests',
  14051. fn: function (){
  14052. var self=this;
  14053. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14054. return $core.withContext(function($ctx1) {
  14055. //>>excludeEnd("ctx");
  14056. var $3,$2,$1,$7,$6,$5,$4,$10,$9,$8;
  14057. $3=$recv($globals.Point)._new();
  14058. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14059. $ctx1.sendIdx["new"]=1;
  14060. //>>excludeEnd("ctx");
  14061. $2=$recv($3)._x_((3));
  14062. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14063. $ctx1.sendIdx["x:"]=1;
  14064. //>>excludeEnd("ctx");
  14065. $1=$recv($2)._y();
  14066. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14067. $ctx1.sendIdx["y"]=1;
  14068. //>>excludeEnd("ctx");
  14069. self._assert_equals_($1,nil);
  14070. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14071. $ctx1.sendIdx["assert:equals:"]=1;
  14072. //>>excludeEnd("ctx");
  14073. $7=$recv($globals.Point)._new();
  14074. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14075. $ctx1.sendIdx["new"]=2;
  14076. //>>excludeEnd("ctx");
  14077. $6=$recv($7)._x_((3));
  14078. $5=$recv($6)._x();
  14079. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14080. $ctx1.sendIdx["x"]=1;
  14081. //>>excludeEnd("ctx");
  14082. $4=$recv($5).__eq((0));
  14083. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14084. $ctx1.sendIdx["="]=1;
  14085. //>>excludeEnd("ctx");
  14086. self._deny_($4);
  14087. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14088. $ctx1.sendIdx["deny:"]=1;
  14089. //>>excludeEnd("ctx");
  14090. $10=$recv($globals.Point)._new();
  14091. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14092. $ctx1.sendIdx["new"]=3;
  14093. //>>excludeEnd("ctx");
  14094. $9=$recv($10)._y_((4));
  14095. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14096. $ctx1.sendIdx["y:"]=1;
  14097. //>>excludeEnd("ctx");
  14098. $8=$recv($9)._x();
  14099. self._assert_equals_($8,nil);
  14100. self._deny_($recv($recv($recv($recv($globals.Point)._new())._y_((4)))._y()).__eq((0)));
  14101. return self;
  14102. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14103. }, function($ctx1) {$ctx1.fill(self,"testNew",{},$globals.PointTest)});
  14104. //>>excludeEnd("ctx");
  14105. },
  14106. //>>excludeStart("ide", pragmas.excludeIdeData);
  14107. args: [],
  14108. 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",
  14109. referencedClasses: ["Point"],
  14110. //>>excludeEnd("ide");
  14111. messageSends: ["assert:equals:", "y", "x:", "new", "deny:", "=", "x", "y:"]
  14112. }),
  14113. $globals.PointTest);
  14114. $core.addMethod(
  14115. $core.method({
  14116. selector: "testTranslateBy",
  14117. protocol: 'tests',
  14118. fn: function (){
  14119. var self=this;
  14120. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14121. return $core.withContext(function($ctx1) {
  14122. //>>excludeEnd("ctx");
  14123. var $2,$3,$1,$4,$6,$8,$7,$5,$9,$11,$12,$10,$13,$15,$16,$14;
  14124. $2=(3).__at((3));
  14125. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14126. $ctx1.sendIdx["@"]=1;
  14127. //>>excludeEnd("ctx");
  14128. $3=(0).__at((1));
  14129. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14130. $ctx1.sendIdx["@"]=2;
  14131. //>>excludeEnd("ctx");
  14132. $1=$recv($2)._translateBy_($3);
  14133. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14134. $ctx1.sendIdx["translateBy:"]=1;
  14135. //>>excludeEnd("ctx");
  14136. $4=(3).__at((4));
  14137. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14138. $ctx1.sendIdx["@"]=3;
  14139. //>>excludeEnd("ctx");
  14140. self._assert_equals_($1,$4);
  14141. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14142. $ctx1.sendIdx["assert:equals:"]=1;
  14143. //>>excludeEnd("ctx");
  14144. $6=(3).__at((3));
  14145. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14146. $ctx1.sendIdx["@"]=4;
  14147. //>>excludeEnd("ctx");
  14148. $8=(1)._negated();
  14149. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14150. $ctx1.sendIdx["negated"]=1;
  14151. //>>excludeEnd("ctx");
  14152. $7=(0).__at($8);
  14153. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14154. $ctx1.sendIdx["@"]=5;
  14155. //>>excludeEnd("ctx");
  14156. $5=$recv($6)._translateBy_($7);
  14157. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14158. $ctx1.sendIdx["translateBy:"]=2;
  14159. //>>excludeEnd("ctx");
  14160. $9=(3).__at((2));
  14161. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14162. $ctx1.sendIdx["@"]=6;
  14163. //>>excludeEnd("ctx");
  14164. self._assert_equals_($5,$9);
  14165. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14166. $ctx1.sendIdx["assert:equals:"]=2;
  14167. //>>excludeEnd("ctx");
  14168. $11=(3).__at((3));
  14169. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14170. $ctx1.sendIdx["@"]=7;
  14171. //>>excludeEnd("ctx");
  14172. $12=(2).__at((3));
  14173. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14174. $ctx1.sendIdx["@"]=8;
  14175. //>>excludeEnd("ctx");
  14176. $10=$recv($11)._translateBy_($12);
  14177. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14178. $ctx1.sendIdx["translateBy:"]=3;
  14179. //>>excludeEnd("ctx");
  14180. $13=(5).__at((6));
  14181. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14182. $ctx1.sendIdx["@"]=9;
  14183. //>>excludeEnd("ctx");
  14184. self._assert_equals_($10,$13);
  14185. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14186. $ctx1.sendIdx["assert:equals:"]=3;
  14187. //>>excludeEnd("ctx");
  14188. $15=(3).__at((3));
  14189. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14190. $ctx1.sendIdx["@"]=10;
  14191. //>>excludeEnd("ctx");
  14192. $16=$recv((3)._negated()).__at((0));
  14193. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14194. $ctx1.sendIdx["@"]=11;
  14195. //>>excludeEnd("ctx");
  14196. $14=$recv($15)._translateBy_($16);
  14197. self._assert_equals_($14,(0).__at((3)));
  14198. return self;
  14199. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14200. }, function($ctx1) {$ctx1.fill(self,"testTranslateBy",{},$globals.PointTest)});
  14201. //>>excludeEnd("ctx");
  14202. },
  14203. //>>excludeStart("ide", pragmas.excludeIdeData);
  14204. args: [],
  14205. 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.",
  14206. referencedClasses: [],
  14207. //>>excludeEnd("ide");
  14208. messageSends: ["assert:equals:", "translateBy:", "@", "negated"]
  14209. }),
  14210. $globals.PointTest);
  14211. $core.addClass('QueueTest', $globals.TestCase, [], 'Kernel-Tests');
  14212. $core.addMethod(
  14213. $core.method({
  14214. selector: "testNextIfAbsent",
  14215. protocol: 'tests',
  14216. fn: function (){
  14217. var self=this;
  14218. var queue;
  14219. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14220. return $core.withContext(function($ctx1) {
  14221. //>>excludeEnd("ctx");
  14222. var $2,$1;
  14223. queue=$recv($globals.Queue)._new();
  14224. $recv(queue)._nextPut_("index1");
  14225. $2=$recv(queue)._nextIfAbsent_("empty");
  14226. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14227. $ctx1.sendIdx["nextIfAbsent:"]=1;
  14228. //>>excludeEnd("ctx");
  14229. $1=$recv($2).__eq("index1");
  14230. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14231. $ctx1.sendIdx["="]=1;
  14232. //>>excludeEnd("ctx");
  14233. self._assert_($1);
  14234. self._deny_($recv($recv(queue)._nextIfAbsent_("empty")).__eq("index1"));
  14235. return self;
  14236. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14237. }, function($ctx1) {$ctx1.fill(self,"testNextIfAbsent",{queue:queue},$globals.QueueTest)});
  14238. //>>excludeEnd("ctx");
  14239. },
  14240. //>>excludeStart("ide", pragmas.excludeIdeData);
  14241. args: [],
  14242. 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'",
  14243. referencedClasses: ["Queue"],
  14244. //>>excludeEnd("ide");
  14245. messageSends: ["new", "nextPut:", "assert:", "=", "nextIfAbsent:", "deny:"]
  14246. }),
  14247. $globals.QueueTest);
  14248. $core.addMethod(
  14249. $core.method({
  14250. selector: "testQueueNext",
  14251. protocol: 'tests',
  14252. fn: function (){
  14253. var self=this;
  14254. var queue;
  14255. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14256. return $core.withContext(function($ctx1) {
  14257. //>>excludeEnd("ctx");
  14258. var $1,$3,$2,$5,$4;
  14259. queue=$recv($globals.Queue)._new();
  14260. $1=queue;
  14261. $recv($1)._nextPut_("index1");
  14262. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14263. $ctx1.sendIdx["nextPut:"]=1;
  14264. //>>excludeEnd("ctx");
  14265. $recv($1)._nextPut_("index2");
  14266. $3=$recv(queue)._next();
  14267. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14268. $ctx1.sendIdx["next"]=1;
  14269. //>>excludeEnd("ctx");
  14270. $2=$recv($3).__eq("index1");
  14271. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14272. $ctx1.sendIdx["="]=1;
  14273. //>>excludeEnd("ctx");
  14274. self._assert_($2);
  14275. $5=$recv(queue)._next();
  14276. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14277. $ctx1.sendIdx["next"]=2;
  14278. //>>excludeEnd("ctx");
  14279. $4=$recv($5).__eq("index");
  14280. self._deny_($4);
  14281. self._should_raise_((function(){
  14282. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14283. return $core.withContext(function($ctx2) {
  14284. //>>excludeEnd("ctx");
  14285. return $recv(queue)._next();
  14286. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14287. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  14288. //>>excludeEnd("ctx");
  14289. }),$globals.Error);
  14290. return self;
  14291. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14292. }, function($ctx1) {$ctx1.fill(self,"testQueueNext",{queue:queue},$globals.QueueTest)});
  14293. //>>excludeEnd("ctx");
  14294. },
  14295. //>>excludeStart("ide", pragmas.excludeIdeData);
  14296. args: [],
  14297. 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",
  14298. referencedClasses: ["Queue", "Error"],
  14299. //>>excludeEnd("ide");
  14300. messageSends: ["new", "nextPut:", "assert:", "=", "next", "deny:", "should:raise:"]
  14301. }),
  14302. $globals.QueueTest);
  14303. $core.addClass('RandomTest', $globals.TestCase, [], 'Kernel-Tests');
  14304. $core.addMethod(
  14305. $core.method({
  14306. selector: "testAtRandomNumber",
  14307. protocol: 'tests',
  14308. fn: function (){
  14309. var self=this;
  14310. var val;
  14311. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14312. return $core.withContext(function($ctx1) {
  14313. //>>excludeEnd("ctx");
  14314. (100)._timesRepeat_((function(){
  14315. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14316. return $core.withContext(function($ctx2) {
  14317. //>>excludeEnd("ctx");
  14318. val=(10)._atRandom();
  14319. val;
  14320. self._assert_($recv(val).__gt((0)));
  14321. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14322. $ctx2.sendIdx["assert:"]=1;
  14323. //>>excludeEnd("ctx");
  14324. return self._assert_($recv(val).__lt((11)));
  14325. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14326. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  14327. //>>excludeEnd("ctx");
  14328. }));
  14329. return self;
  14330. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14331. }, function($ctx1) {$ctx1.fill(self,"testAtRandomNumber",{val:val},$globals.RandomTest)});
  14332. //>>excludeEnd("ctx");
  14333. },
  14334. //>>excludeStart("ide", pragmas.excludeIdeData);
  14335. args: [],
  14336. 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]",
  14337. referencedClasses: [],
  14338. //>>excludeEnd("ide");
  14339. messageSends: ["timesRepeat:", "atRandom", "assert:", ">", "<"]
  14340. }),
  14341. $globals.RandomTest);
  14342. $core.addMethod(
  14343. $core.method({
  14344. selector: "testAtRandomSequenceableCollection",
  14345. protocol: 'tests',
  14346. fn: function (){
  14347. var self=this;
  14348. var val;
  14349. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14350. return $core.withContext(function($ctx1) {
  14351. //>>excludeEnd("ctx");
  14352. var $3,$4,$2,$1;
  14353. (100)._timesRepeat_((function(){
  14354. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14355. return $core.withContext(function($ctx2) {
  14356. //>>excludeEnd("ctx");
  14357. val="abc"._atRandom();
  14358. val;
  14359. $3=$recv(val).__eq("a");
  14360. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14361. $ctx2.sendIdx["="]=1;
  14362. //>>excludeEnd("ctx");
  14363. $4=$recv(val).__eq("b");
  14364. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14365. $ctx2.sendIdx["="]=2;
  14366. //>>excludeEnd("ctx");
  14367. $2=$recv($3).__or($4);
  14368. $1=$recv($2).__or($recv(val).__eq("c"));
  14369. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14370. $ctx2.sendIdx["|"]=1;
  14371. //>>excludeEnd("ctx");
  14372. return self._assert_($1);
  14373. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14374. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  14375. //>>excludeEnd("ctx");
  14376. }));
  14377. return self;
  14378. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14379. }, function($ctx1) {$ctx1.fill(self,"testAtRandomSequenceableCollection",{val:val},$globals.RandomTest)});
  14380. //>>excludeEnd("ctx");
  14381. },
  14382. //>>excludeStart("ide", pragmas.excludeIdeData);
  14383. args: [],
  14384. 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].",
  14385. referencedClasses: [],
  14386. //>>excludeEnd("ide");
  14387. messageSends: ["timesRepeat:", "atRandom", "assert:", "|", "="]
  14388. }),
  14389. $globals.RandomTest);
  14390. $core.addMethod(
  14391. $core.method({
  14392. selector: "textNext",
  14393. protocol: 'tests',
  14394. fn: function (){
  14395. var self=this;
  14396. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14397. return $core.withContext(function($ctx1) {
  14398. //>>excludeEnd("ctx");
  14399. var $1;
  14400. (10000)._timesRepeat_((function(){
  14401. var current,next;
  14402. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14403. return $core.withContext(function($ctx2) {
  14404. //>>excludeEnd("ctx");
  14405. next=$recv($recv($globals.Random)._new())._next();
  14406. next;
  14407. self._assert_($recv(next).__gt_eq((0)));
  14408. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14409. $ctx2.sendIdx["assert:"]=1;
  14410. //>>excludeEnd("ctx");
  14411. self._assert_($recv(next).__lt((1)));
  14412. $1=$recv(current).__eq(next);
  14413. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14414. $ctx2.sendIdx["="]=1;
  14415. //>>excludeEnd("ctx");
  14416. self._deny_($1);
  14417. return $recv(next).__eq(current);
  14418. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14419. }, function($ctx2) {$ctx2.fillBlock({current:current,next:next},$ctx1,1)});
  14420. //>>excludeEnd("ctx");
  14421. }));
  14422. return self;
  14423. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14424. }, function($ctx1) {$ctx1.fill(self,"textNext",{},$globals.RandomTest)});
  14425. //>>excludeEnd("ctx");
  14426. },
  14427. //>>excludeStart("ide", pragmas.excludeIdeData);
  14428. args: [],
  14429. 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 ]",
  14430. referencedClasses: ["Random"],
  14431. //>>excludeEnd("ide");
  14432. messageSends: ["timesRepeat:", "next", "new", "assert:", ">=", "<", "deny:", "="]
  14433. }),
  14434. $globals.RandomTest);
  14435. $core.addClass('StreamTest', $globals.TestCase, [], 'Kernel-Tests');
  14436. $core.addMethod(
  14437. $core.method({
  14438. selector: "collectionClass",
  14439. protocol: 'accessing',
  14440. fn: function (){
  14441. var self=this;
  14442. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14443. return $core.withContext(function($ctx1) {
  14444. //>>excludeEnd("ctx");
  14445. return $recv(self._class())._collectionClass();
  14446. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14447. }, function($ctx1) {$ctx1.fill(self,"collectionClass",{},$globals.StreamTest)});
  14448. //>>excludeEnd("ctx");
  14449. },
  14450. //>>excludeStart("ide", pragmas.excludeIdeData);
  14451. args: [],
  14452. source: "collectionClass\x0a\x09^ self class collectionClass",
  14453. referencedClasses: [],
  14454. //>>excludeEnd("ide");
  14455. messageSends: ["collectionClass", "class"]
  14456. }),
  14457. $globals.StreamTest);
  14458. $core.addMethod(
  14459. $core.method({
  14460. selector: "newCollection",
  14461. protocol: 'accessing',
  14462. fn: function (){
  14463. var self=this;
  14464. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14465. return $core.withContext(function($ctx1) {
  14466. //>>excludeEnd("ctx");
  14467. return $recv(self._collectionClass())._new();
  14468. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14469. }, function($ctx1) {$ctx1.fill(self,"newCollection",{},$globals.StreamTest)});
  14470. //>>excludeEnd("ctx");
  14471. },
  14472. //>>excludeStart("ide", pragmas.excludeIdeData);
  14473. args: [],
  14474. source: "newCollection\x0a\x09^ self collectionClass new",
  14475. referencedClasses: [],
  14476. //>>excludeEnd("ide");
  14477. messageSends: ["new", "collectionClass"]
  14478. }),
  14479. $globals.StreamTest);
  14480. $core.addMethod(
  14481. $core.method({
  14482. selector: "newStream",
  14483. protocol: 'accessing',
  14484. fn: function (){
  14485. var self=this;
  14486. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14487. return $core.withContext(function($ctx1) {
  14488. //>>excludeEnd("ctx");
  14489. return $recv($recv(self._collectionClass())._new())._stream();
  14490. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14491. }, function($ctx1) {$ctx1.fill(self,"newStream",{},$globals.StreamTest)});
  14492. //>>excludeEnd("ctx");
  14493. },
  14494. //>>excludeStart("ide", pragmas.excludeIdeData);
  14495. args: [],
  14496. source: "newStream\x0a\x09^ self collectionClass new stream",
  14497. referencedClasses: [],
  14498. //>>excludeEnd("ide");
  14499. messageSends: ["stream", "new", "collectionClass"]
  14500. }),
  14501. $globals.StreamTest);
  14502. $core.addMethod(
  14503. $core.method({
  14504. selector: "testAtStartAtEnd",
  14505. protocol: 'tests',
  14506. fn: function (){
  14507. var self=this;
  14508. var stream;
  14509. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14510. return $core.withContext(function($ctx1) {
  14511. //>>excludeEnd("ctx");
  14512. var $1,$2,$3,$4;
  14513. stream=self._newStream();
  14514. $1=$recv(stream)._atStart();
  14515. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14516. $ctx1.sendIdx["atStart"]=1;
  14517. //>>excludeEnd("ctx");
  14518. self._assert_($1);
  14519. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14520. $ctx1.sendIdx["assert:"]=1;
  14521. //>>excludeEnd("ctx");
  14522. $2=$recv(stream)._atEnd();
  14523. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14524. $ctx1.sendIdx["atEnd"]=1;
  14525. //>>excludeEnd("ctx");
  14526. self._assert_($2);
  14527. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14528. $ctx1.sendIdx["assert:"]=2;
  14529. //>>excludeEnd("ctx");
  14530. $recv(stream)._nextPutAll_(self._newCollection());
  14531. $3=$recv(stream)._atEnd();
  14532. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14533. $ctx1.sendIdx["atEnd"]=2;
  14534. //>>excludeEnd("ctx");
  14535. self._assert_($3);
  14536. $4=$recv(stream)._atStart();
  14537. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14538. $ctx1.sendIdx["atStart"]=2;
  14539. //>>excludeEnd("ctx");
  14540. self._deny_($4);
  14541. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14542. $ctx1.sendIdx["deny:"]=1;
  14543. //>>excludeEnd("ctx");
  14544. $recv(stream)._position_((1));
  14545. self._deny_($recv(stream)._atEnd());
  14546. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14547. $ctx1.sendIdx["deny:"]=2;
  14548. //>>excludeEnd("ctx");
  14549. self._deny_($recv(stream)._atStart());
  14550. return self;
  14551. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14552. }, function($ctx1) {$ctx1.fill(self,"testAtStartAtEnd",{stream:stream},$globals.StreamTest)});
  14553. //>>excludeEnd("ctx");
  14554. },
  14555. //>>excludeStart("ide", pragmas.excludeIdeData);
  14556. args: [],
  14557. 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",
  14558. referencedClasses: [],
  14559. //>>excludeEnd("ide");
  14560. messageSends: ["newStream", "assert:", "atStart", "atEnd", "nextPutAll:", "newCollection", "deny:", "position:"]
  14561. }),
  14562. $globals.StreamTest);
  14563. $core.addMethod(
  14564. $core.method({
  14565. selector: "testContents",
  14566. protocol: 'tests',
  14567. fn: function (){
  14568. var self=this;
  14569. var stream;
  14570. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14571. return $core.withContext(function($ctx1) {
  14572. //>>excludeEnd("ctx");
  14573. var $1,$2;
  14574. stream=self._newStream();
  14575. $1=stream;
  14576. $2=self._newCollection();
  14577. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14578. $ctx1.sendIdx["newCollection"]=1;
  14579. //>>excludeEnd("ctx");
  14580. $recv($1)._nextPutAll_($2);
  14581. self._assert_equals_($recv(stream)._contents(),self._newCollection());
  14582. return self;
  14583. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14584. }, function($ctx1) {$ctx1.fill(self,"testContents",{stream:stream},$globals.StreamTest)});
  14585. //>>excludeEnd("ctx");
  14586. },
  14587. //>>excludeStart("ide", pragmas.excludeIdeData);
  14588. args: [],
  14589. 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",
  14590. referencedClasses: [],
  14591. //>>excludeEnd("ide");
  14592. messageSends: ["newStream", "nextPutAll:", "newCollection", "assert:equals:", "contents"]
  14593. }),
  14594. $globals.StreamTest);
  14595. $core.addMethod(
  14596. $core.method({
  14597. selector: "testIsEmpty",
  14598. protocol: 'tests',
  14599. fn: function (){
  14600. var self=this;
  14601. var stream;
  14602. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14603. return $core.withContext(function($ctx1) {
  14604. //>>excludeEnd("ctx");
  14605. var $1;
  14606. stream=self._newStream();
  14607. $1=$recv(stream)._isEmpty();
  14608. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14609. $ctx1.sendIdx["isEmpty"]=1;
  14610. //>>excludeEnd("ctx");
  14611. self._assert_($1);
  14612. $recv(stream)._nextPutAll_(self._newCollection());
  14613. self._deny_($recv(stream)._isEmpty());
  14614. return self;
  14615. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14616. }, function($ctx1) {$ctx1.fill(self,"testIsEmpty",{stream:stream},$globals.StreamTest)});
  14617. //>>excludeEnd("ctx");
  14618. },
  14619. //>>excludeStart("ide", pragmas.excludeIdeData);
  14620. args: [],
  14621. 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",
  14622. referencedClasses: [],
  14623. //>>excludeEnd("ide");
  14624. messageSends: ["newStream", "assert:", "isEmpty", "nextPutAll:", "newCollection", "deny:"]
  14625. }),
  14626. $globals.StreamTest);
  14627. $core.addMethod(
  14628. $core.method({
  14629. selector: "testPosition",
  14630. protocol: 'tests',
  14631. fn: function (){
  14632. var self=this;
  14633. var collection,stream;
  14634. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14635. return $core.withContext(function($ctx1) {
  14636. //>>excludeEnd("ctx");
  14637. var $1,$2,$3;
  14638. collection=self._newCollection();
  14639. stream=self._newStream();
  14640. $recv(stream)._nextPutAll_(collection);
  14641. $1=$recv(stream)._position();
  14642. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14643. $ctx1.sendIdx["position"]=1;
  14644. //>>excludeEnd("ctx");
  14645. self._assert_equals_($1,$recv(collection)._size());
  14646. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14647. $ctx1.sendIdx["assert:equals:"]=1;
  14648. //>>excludeEnd("ctx");
  14649. $recv(stream)._position_((0));
  14650. $2=$recv(stream)._position();
  14651. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14652. $ctx1.sendIdx["position"]=2;
  14653. //>>excludeEnd("ctx");
  14654. self._assert_equals_($2,(0));
  14655. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14656. $ctx1.sendIdx["assert:equals:"]=2;
  14657. //>>excludeEnd("ctx");
  14658. $recv(stream)._next();
  14659. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14660. $ctx1.sendIdx["next"]=1;
  14661. //>>excludeEnd("ctx");
  14662. $3=$recv(stream)._position();
  14663. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14664. $ctx1.sendIdx["position"]=3;
  14665. //>>excludeEnd("ctx");
  14666. self._assert_equals_($3,(1));
  14667. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14668. $ctx1.sendIdx["assert:equals:"]=3;
  14669. //>>excludeEnd("ctx");
  14670. $recv(stream)._next();
  14671. self._assert_equals_($recv(stream)._position(),(2));
  14672. return self;
  14673. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14674. }, function($ctx1) {$ctx1.fill(self,"testPosition",{collection:collection,stream:stream},$globals.StreamTest)});
  14675. //>>excludeEnd("ctx");
  14676. },
  14677. //>>excludeStart("ide", pragmas.excludeIdeData);
  14678. args: [],
  14679. 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",
  14680. referencedClasses: [],
  14681. //>>excludeEnd("ide");
  14682. messageSends: ["newCollection", "newStream", "nextPutAll:", "assert:equals:", "position", "size", "position:", "next"]
  14683. }),
  14684. $globals.StreamTest);
  14685. $core.addMethod(
  14686. $core.method({
  14687. selector: "testReading",
  14688. protocol: 'tests',
  14689. fn: function (){
  14690. var self=this;
  14691. var stream,collection;
  14692. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14693. return $core.withContext(function($ctx1) {
  14694. //>>excludeEnd("ctx");
  14695. var $1,$2;
  14696. collection=self._newCollection();
  14697. stream=self._newStream();
  14698. $1=stream;
  14699. $recv($1)._nextPutAll_(collection);
  14700. $recv($1)._position_((0));
  14701. $recv(collection)._do_((function(each){
  14702. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14703. return $core.withContext(function($ctx2) {
  14704. //>>excludeEnd("ctx");
  14705. $2=$recv(stream)._next();
  14706. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14707. $ctx2.sendIdx["next"]=1;
  14708. //>>excludeEnd("ctx");
  14709. return self._assert_equals_($2,each);
  14710. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14711. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  14712. //>>excludeEnd("ctx");
  14713. }));
  14714. self._assert_($recv($recv(stream)._next())._isNil());
  14715. return self;
  14716. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14717. }, function($ctx1) {$ctx1.fill(self,"testReading",{stream:stream,collection:collection},$globals.StreamTest)});
  14718. //>>excludeEnd("ctx");
  14719. },
  14720. //>>excludeStart("ide", pragmas.excludeIdeData);
  14721. args: [],
  14722. 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",
  14723. referencedClasses: [],
  14724. //>>excludeEnd("ide");
  14725. messageSends: ["newCollection", "newStream", "nextPutAll:", "position:", "do:", "assert:equals:", "next", "assert:", "isNil"]
  14726. }),
  14727. $globals.StreamTest);
  14728. $core.addMethod(
  14729. $core.method({
  14730. selector: "testStreamContents",
  14731. protocol: 'tests',
  14732. fn: function (){
  14733. var self=this;
  14734. return self;
  14735. },
  14736. //>>excludeStart("ide", pragmas.excludeIdeData);
  14737. args: [],
  14738. source: "testStreamContents",
  14739. referencedClasses: [],
  14740. //>>excludeEnd("ide");
  14741. messageSends: []
  14742. }),
  14743. $globals.StreamTest);
  14744. $core.addMethod(
  14745. $core.method({
  14746. selector: "testWrite",
  14747. protocol: 'tests',
  14748. fn: function (){
  14749. var self=this;
  14750. var stream,collection;
  14751. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14752. return $core.withContext(function($ctx1) {
  14753. //>>excludeEnd("ctx");
  14754. collection=self._newCollection();
  14755. stream=self._newStream();
  14756. $recv(collection)._do_((function(each){
  14757. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14758. return $core.withContext(function($ctx2) {
  14759. //>>excludeEnd("ctx");
  14760. return $recv(stream).__lt_lt(each);
  14761. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14762. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  14763. //>>excludeEnd("ctx");
  14764. }));
  14765. self._assert_equals_($recv(stream)._contents(),collection);
  14766. return self;
  14767. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14768. }, function($ctx1) {$ctx1.fill(self,"testWrite",{stream:stream,collection:collection},$globals.StreamTest)});
  14769. //>>excludeEnd("ctx");
  14770. },
  14771. //>>excludeStart("ide", pragmas.excludeIdeData);
  14772. args: [],
  14773. 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",
  14774. referencedClasses: [],
  14775. //>>excludeEnd("ide");
  14776. messageSends: ["newCollection", "newStream", "do:", "<<", "assert:equals:", "contents"]
  14777. }),
  14778. $globals.StreamTest);
  14779. $core.addMethod(
  14780. $core.method({
  14781. selector: "testWriting",
  14782. protocol: 'tests',
  14783. fn: function (){
  14784. var self=this;
  14785. var stream,collection;
  14786. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14787. return $core.withContext(function($ctx1) {
  14788. //>>excludeEnd("ctx");
  14789. var $1;
  14790. collection=self._newCollection();
  14791. stream=self._newStream();
  14792. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14793. $ctx1.sendIdx["newStream"]=1;
  14794. //>>excludeEnd("ctx");
  14795. $recv(collection)._do_((function(each){
  14796. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14797. return $core.withContext(function($ctx2) {
  14798. //>>excludeEnd("ctx");
  14799. return $recv(stream)._nextPut_(each);
  14800. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14801. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  14802. //>>excludeEnd("ctx");
  14803. }));
  14804. $1=$recv(stream)._contents();
  14805. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14806. $ctx1.sendIdx["contents"]=1;
  14807. //>>excludeEnd("ctx");
  14808. self._assert_equals_($1,collection);
  14809. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14810. $ctx1.sendIdx["assert:equals:"]=1;
  14811. //>>excludeEnd("ctx");
  14812. stream=self._newStream();
  14813. $recv(stream)._nextPutAll_(collection);
  14814. self._assert_equals_($recv(stream)._contents(),collection);
  14815. return self;
  14816. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14817. }, function($ctx1) {$ctx1.fill(self,"testWriting",{stream:stream,collection:collection},$globals.StreamTest)});
  14818. //>>excludeEnd("ctx");
  14819. },
  14820. //>>excludeStart("ide", pragmas.excludeIdeData);
  14821. args: [],
  14822. 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",
  14823. referencedClasses: [],
  14824. //>>excludeEnd("ide");
  14825. messageSends: ["newCollection", "newStream", "do:", "nextPut:", "assert:equals:", "contents", "nextPutAll:"]
  14826. }),
  14827. $globals.StreamTest);
  14828. $core.addMethod(
  14829. $core.method({
  14830. selector: "collectionClass",
  14831. protocol: 'accessing',
  14832. fn: function (){
  14833. var self=this;
  14834. return nil;
  14835. },
  14836. //>>excludeStart("ide", pragmas.excludeIdeData);
  14837. args: [],
  14838. source: "collectionClass\x0a\x09^ nil",
  14839. referencedClasses: [],
  14840. //>>excludeEnd("ide");
  14841. messageSends: []
  14842. }),
  14843. $globals.StreamTest.klass);
  14844. $core.addMethod(
  14845. $core.method({
  14846. selector: "isAbstract",
  14847. protocol: 'testing',
  14848. fn: function (){
  14849. var self=this;
  14850. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14851. return $core.withContext(function($ctx1) {
  14852. //>>excludeEnd("ctx");
  14853. return $recv(self._collectionClass())._isNil();
  14854. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14855. }, function($ctx1) {$ctx1.fill(self,"isAbstract",{},$globals.StreamTest.klass)});
  14856. //>>excludeEnd("ctx");
  14857. },
  14858. //>>excludeStart("ide", pragmas.excludeIdeData);
  14859. args: [],
  14860. source: "isAbstract\x0a\x09^ self collectionClass isNil",
  14861. referencedClasses: [],
  14862. //>>excludeEnd("ide");
  14863. messageSends: ["isNil", "collectionClass"]
  14864. }),
  14865. $globals.StreamTest.klass);
  14866. $core.addClass('ArrayStreamTest', $globals.StreamTest, [], 'Kernel-Tests');
  14867. $core.addMethod(
  14868. $core.method({
  14869. selector: "newCollection",
  14870. protocol: 'accessing',
  14871. fn: function (){
  14872. var self=this;
  14873. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14874. return $core.withContext(function($ctx1) {
  14875. //>>excludeEnd("ctx");
  14876. return [true,(1),(3).__at((4)),"foo"];
  14877. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14878. }, function($ctx1) {$ctx1.fill(self,"newCollection",{},$globals.ArrayStreamTest)});
  14879. //>>excludeEnd("ctx");
  14880. },
  14881. //>>excludeStart("ide", pragmas.excludeIdeData);
  14882. args: [],
  14883. source: "newCollection\x0a\x09^ { true. 1. 3@4. 'foo' }",
  14884. referencedClasses: [],
  14885. //>>excludeEnd("ide");
  14886. messageSends: ["@"]
  14887. }),
  14888. $globals.ArrayStreamTest);
  14889. $core.addMethod(
  14890. $core.method({
  14891. selector: "collectionClass",
  14892. protocol: 'accessing',
  14893. fn: function (){
  14894. var self=this;
  14895. return $globals.Array;
  14896. },
  14897. //>>excludeStart("ide", pragmas.excludeIdeData);
  14898. args: [],
  14899. source: "collectionClass\x0a\x09^ Array",
  14900. referencedClasses: ["Array"],
  14901. //>>excludeEnd("ide");
  14902. messageSends: []
  14903. }),
  14904. $globals.ArrayStreamTest.klass);
  14905. $core.addClass('StringStreamTest', $globals.StreamTest, [], 'Kernel-Tests');
  14906. $core.addMethod(
  14907. $core.method({
  14908. selector: "newCollection",
  14909. protocol: 'accessing',
  14910. fn: function (){
  14911. var self=this;
  14912. return "hello world";
  14913. },
  14914. //>>excludeStart("ide", pragmas.excludeIdeData);
  14915. args: [],
  14916. source: "newCollection\x0a\x09^ 'hello world'",
  14917. referencedClasses: [],
  14918. //>>excludeEnd("ide");
  14919. messageSends: []
  14920. }),
  14921. $globals.StringStreamTest);
  14922. $core.addMethod(
  14923. $core.method({
  14924. selector: "collectionClass",
  14925. protocol: 'accessing',
  14926. fn: function (){
  14927. var self=this;
  14928. return $globals.String;
  14929. },
  14930. //>>excludeStart("ide", pragmas.excludeIdeData);
  14931. args: [],
  14932. source: "collectionClass\x0a\x09^ String",
  14933. referencedClasses: ["String"],
  14934. //>>excludeEnd("ide");
  14935. messageSends: []
  14936. }),
  14937. $globals.StringStreamTest.klass);
  14938. $core.addClass('UndefinedTest', $globals.TestCase, [], 'Kernel-Tests');
  14939. $core.addMethod(
  14940. $core.method({
  14941. selector: "testCopying",
  14942. protocol: 'tests',
  14943. fn: function (){
  14944. var self=this;
  14945. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14946. return $core.withContext(function($ctx1) {
  14947. //>>excludeEnd("ctx");
  14948. self._assert_equals_(nil._copy(),nil);
  14949. return self;
  14950. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14951. }, function($ctx1) {$ctx1.fill(self,"testCopying",{},$globals.UndefinedTest)});
  14952. //>>excludeEnd("ctx");
  14953. },
  14954. //>>excludeStart("ide", pragmas.excludeIdeData);
  14955. args: [],
  14956. source: "testCopying\x0a\x09self assert: nil copy equals: nil",
  14957. referencedClasses: [],
  14958. //>>excludeEnd("ide");
  14959. messageSends: ["assert:equals:", "copy"]
  14960. }),
  14961. $globals.UndefinedTest);
  14962. $core.addMethod(
  14963. $core.method({
  14964. selector: "testDeepCopy",
  14965. protocol: 'tests',
  14966. fn: function (){
  14967. var self=this;
  14968. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14969. return $core.withContext(function($ctx1) {
  14970. //>>excludeEnd("ctx");
  14971. self._assert_($recv(nil._deepCopy()).__eq(nil));
  14972. return self;
  14973. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14974. }, function($ctx1) {$ctx1.fill(self,"testDeepCopy",{},$globals.UndefinedTest)});
  14975. //>>excludeEnd("ctx");
  14976. },
  14977. //>>excludeStart("ide", pragmas.excludeIdeData);
  14978. args: [],
  14979. source: "testDeepCopy\x0a\x09self assert: nil deepCopy = nil",
  14980. referencedClasses: [],
  14981. //>>excludeEnd("ide");
  14982. messageSends: ["assert:", "=", "deepCopy"]
  14983. }),
  14984. $globals.UndefinedTest);
  14985. $core.addMethod(
  14986. $core.method({
  14987. selector: "testIfNil",
  14988. protocol: 'tests',
  14989. fn: function (){
  14990. var self=this;
  14991. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14992. return $core.withContext(function($ctx1) {
  14993. //>>excludeEnd("ctx");
  14994. var $1,$3,$2,$4,$6,$5,$receiver;
  14995. if(($receiver = nil) == null || $receiver.isNil){
  14996. $1=true;
  14997. } else {
  14998. $1=nil;
  14999. };
  15000. self._assert_equals_($1,true);
  15001. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  15002. $ctx1.sendIdx["assert:equals:"]=1;
  15003. //>>excludeEnd("ctx");
  15004. if(($receiver = nil) == null || $receiver.isNil){
  15005. $3=nil;
  15006. } else {
  15007. $3=true;
  15008. };
  15009. $2=$recv($3).__eq(true);
  15010. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  15011. $ctx1.sendIdx["="]=1;
  15012. //>>excludeEnd("ctx");
  15013. self._deny_($2);
  15014. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  15015. $ctx1.sendIdx["deny:"]=1;
  15016. //>>excludeEnd("ctx");
  15017. if(($receiver = nil) == null || $receiver.isNil){
  15018. $4=true;
  15019. } else {
  15020. $4=false;
  15021. };
  15022. self._assert_equals_($4,true);
  15023. if(($receiver = nil) == null || $receiver.isNil){
  15024. $6=false;
  15025. } else {
  15026. $6=true;
  15027. };
  15028. $5=$recv($6).__eq(true);
  15029. self._deny_($5);
  15030. return self;
  15031. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  15032. }, function($ctx1) {$ctx1.fill(self,"testIfNil",{},$globals.UndefinedTest)});
  15033. //>>excludeEnd("ctx");
  15034. },
  15035. //>>excludeStart("ide", pragmas.excludeIdeData);
  15036. args: [],
  15037. 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",
  15038. referencedClasses: [],
  15039. //>>excludeEnd("ide");
  15040. messageSends: ["assert:equals:", "ifNil:", "deny:", "=", "ifNotNil:", "ifNil:ifNotNil:", "ifNotNil:ifNil:"]
  15041. }),
  15042. $globals.UndefinedTest);
  15043. $core.addMethod(
  15044. $core.method({
  15045. selector: "testIsNil",
  15046. protocol: 'tests',
  15047. fn: function (){
  15048. var self=this;
  15049. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  15050. return $core.withContext(function($ctx1) {
  15051. //>>excludeEnd("ctx");
  15052. self._assert_(nil._isNil());
  15053. self._deny_(nil._notNil());
  15054. return self;
  15055. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  15056. }, function($ctx1) {$ctx1.fill(self,"testIsNil",{},$globals.UndefinedTest)});
  15057. //>>excludeEnd("ctx");
  15058. },
  15059. //>>excludeStart("ide", pragmas.excludeIdeData);
  15060. args: [],
  15061. source: "testIsNil\x0a\x09self assert: nil isNil.\x0a\x09self deny: nil notNil.",
  15062. referencedClasses: [],
  15063. //>>excludeEnd("ide");
  15064. messageSends: ["assert:", "isNil", "deny:", "notNil"]
  15065. }),
  15066. $globals.UndefinedTest);
  15067. });