1
0

Kernel-Tests.js 526 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061
  1. define("amber_core/Kernel-Tests", ["amber/boot", "amber_core/SUnit", "amber_core/Kernel-Objects"], function($boot){
  2. var $core=$boot.api,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
  3. $core.addPackage('Kernel-Tests');
  4. $core.packages["Kernel-Tests"].innerEval = function (expr) { return eval(expr); };
  5. $core.packages["Kernel-Tests"].transport = {"type":"amd","amdNamespace":"amber_core"};
  6. $core.addClass('AnnouncementSubscriptionTest', $globals.TestCase, [], 'Kernel-Tests');
  7. $core.addMethod(
  8. $core.method({
  9. selector: "testAddExtensionMethod",
  10. protocol: 'tests',
  11. fn: function (){
  12. var self=this;
  13. var method,dirty;
  14. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  15. return $core.withContext(function($ctx1) {
  16. //>>excludeEnd("ctx");
  17. var $2,$1,$4,$3,$5,$8,$7,$6,$9,$10;
  18. $2=self._class();
  19. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  20. $ctx1.sendIdx["class"]=1;
  21. //>>excludeEnd("ctx");
  22. $1=$recv($2)._package();
  23. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  24. $ctx1.sendIdx["package"]=1;
  25. //>>excludeEnd("ctx");
  26. dirty=$recv($1)._isDirty();
  27. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  28. $ctx1.sendIdx["isDirty"]=1;
  29. //>>excludeEnd("ctx");
  30. $4=self._class();
  31. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  32. $ctx1.sendIdx["class"]=2;
  33. //>>excludeEnd("ctx");
  34. $3=$recv($4)._package();
  35. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  36. $ctx1.sendIdx["package"]=2;
  37. //>>excludeEnd("ctx");
  38. $recv($3)._beClean();
  39. $5=self._class();
  40. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  41. $ctx1.sendIdx["class"]=3;
  42. //>>excludeEnd("ctx");
  43. method=$recv($5)._compile_protocol_("doNothing","**not-a-package");
  44. $8=self._class();
  45. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  46. $ctx1.sendIdx["class"]=4;
  47. //>>excludeEnd("ctx");
  48. $7=$recv($8)._package();
  49. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  50. $ctx1.sendIdx["package"]=3;
  51. //>>excludeEnd("ctx");
  52. $6=$recv($7)._isDirty();
  53. self._deny_($6);
  54. $9=self._class();
  55. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  56. $ctx1.sendIdx["class"]=5;
  57. //>>excludeEnd("ctx");
  58. $recv($9)._removeCompiledMethod_(method);
  59. $10=dirty;
  60. if($core.assert($10)){
  61. $recv($recv(self._class())._package())._beDirty();
  62. };
  63. return self;
  64. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  65. }, function($ctx1) {$ctx1.fill(self,"testAddExtensionMethod",{method:method,dirty:dirty},$globals.AnnouncementSubscriptionTest)});
  66. //>>excludeEnd("ctx");
  67. },
  68. //>>excludeStart("ide", pragmas.excludeIdeData);
  69. args: [],
  70. source: "testAddExtensionMethod\x0a\x09| method dirty |\x0a\x09dirty := self class package isDirty.\x0a\x09self class package beClean.\x0a\x09method := self class compile: 'doNothing' protocol: '**not-a-package'.\x0a\x09self deny: self class package isDirty.\x0a\x09\x0a\x09self class removeCompiledMethod: method.\x0a\x09dirty ifTrue: [ self class package beDirty ]",
  71. referencedClasses: [],
  72. //>>excludeEnd("ide");
  73. messageSends: ["isDirty", "package", "class", "beClean", "compile:protocol:", "deny:", "removeCompiledMethod:", "ifTrue:", "beDirty"]
  74. }),
  75. $globals.AnnouncementSubscriptionTest);
  76. $core.addMethod(
  77. $core.method({
  78. selector: "testHandlesAnnouncement",
  79. protocol: 'tests',
  80. fn: function (){
  81. var self=this;
  82. var subscription,announcementClass1,announcementClass2,classBuilder;
  83. function $ClassBuilder(){return $globals.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  84. function $SystemAnnouncement(){return $globals.SystemAnnouncement||(typeof SystemAnnouncement=="undefined"?nil:SystemAnnouncement)}
  85. function $AnnouncementSubscription(){return $globals.AnnouncementSubscription||(typeof AnnouncementSubscription=="undefined"?nil:AnnouncementSubscription)}
  86. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  87. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  88. return $core.withContext(function($ctx1) {
  89. //>>excludeEnd("ctx");
  90. var $1,$2;
  91. classBuilder=$recv($ClassBuilder())._new();
  92. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  93. $ctx1.sendIdx["new"]=1;
  94. //>>excludeEnd("ctx");
  95. announcementClass1=$recv(classBuilder)._basicAddSubclassOf_named_instanceVariableNames_package_($SystemAnnouncement(),"TestAnnouncement1",[],"Kernel-Tests");
  96. subscription=$recv($recv($AnnouncementSubscription())._new())._announcementClass_($SystemAnnouncement());
  97. $1=$recv(subscription)._handlesAnnouncement_($SystemAnnouncement());
  98. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  99. $ctx1.sendIdx["handlesAnnouncement:"]=1;
  100. //>>excludeEnd("ctx");
  101. self._assert_equals_($1,true);
  102. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  103. $ctx1.sendIdx["assert:equals:"]=1;
  104. //>>excludeEnd("ctx");
  105. $2=$recv(subscription)._handlesAnnouncement_(announcementClass1);
  106. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  107. $ctx1.sendIdx["handlesAnnouncement:"]=2;
  108. //>>excludeEnd("ctx");
  109. self._assert_equals_($2,true);
  110. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  111. $ctx1.sendIdx["assert:equals:"]=2;
  112. //>>excludeEnd("ctx");
  113. self._assert_equals_($recv(subscription)._handlesAnnouncement_($Object()),false);
  114. $recv(classBuilder)._basicRemoveClass_(announcementClass1);
  115. return self;
  116. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  117. }, function($ctx1) {$ctx1.fill(self,"testHandlesAnnouncement",{subscription:subscription,announcementClass1:announcementClass1,announcementClass2:announcementClass2,classBuilder:classBuilder},$globals.AnnouncementSubscriptionTest)});
  118. //>>excludeEnd("ctx");
  119. },
  120. //>>excludeStart("ide", pragmas.excludeIdeData);
  121. args: [],
  122. 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.",
  123. referencedClasses: ["ClassBuilder", "SystemAnnouncement", "AnnouncementSubscription", "Object"],
  124. //>>excludeEnd("ide");
  125. messageSends: ["new", "basicAddSubclassOf:named:instanceVariableNames:package:", "announcementClass:", "assert:equals:", "handlesAnnouncement:", "basicRemoveClass:"]
  126. }),
  127. $globals.AnnouncementSubscriptionTest);
  128. $core.addClass('AnnouncerTest', $globals.TestCase, [], 'Kernel-Tests');
  129. $core.addMethod(
  130. $core.method({
  131. selector: "testOnDo",
  132. protocol: 'tests',
  133. fn: function (){
  134. var self=this;
  135. var counter,announcer;
  136. function $Announcer(){return $globals.Announcer||(typeof Announcer=="undefined"?nil:Announcer)}
  137. function $SystemAnnouncement(){return $globals.SystemAnnouncement||(typeof SystemAnnouncement=="undefined"?nil:SystemAnnouncement)}
  138. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  139. return $core.withContext(function($ctx1) {
  140. //>>excludeEnd("ctx");
  141. var $1,$2;
  142. counter=(0);
  143. announcer=$recv($Announcer())._new();
  144. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  145. $ctx1.sendIdx["new"]=1;
  146. //>>excludeEnd("ctx");
  147. $recv(announcer)._on_do_($SystemAnnouncement(),(function(){
  148. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  149. return $core.withContext(function($ctx2) {
  150. //>>excludeEnd("ctx");
  151. counter=$recv(counter).__plus((1));
  152. return counter;
  153. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  154. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  155. //>>excludeEnd("ctx");
  156. }));
  157. $1=announcer;
  158. $2=$recv($SystemAnnouncement())._new();
  159. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  160. $ctx1.sendIdx["new"]=2;
  161. //>>excludeEnd("ctx");
  162. $recv($1)._announce_($2);
  163. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  164. $ctx1.sendIdx["announce:"]=1;
  165. //>>excludeEnd("ctx");
  166. self._assert_equals_(counter,(1));
  167. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  168. $ctx1.sendIdx["assert:equals:"]=1;
  169. //>>excludeEnd("ctx");
  170. $recv(announcer)._announce_($recv($SystemAnnouncement())._new());
  171. self._assert_equals_(counter,(2));
  172. return self;
  173. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  174. }, function($ctx1) {$ctx1.fill(self,"testOnDo",{counter:counter,announcer:announcer},$globals.AnnouncerTest)});
  175. //>>excludeEnd("ctx");
  176. },
  177. //>>excludeStart("ide", pragmas.excludeIdeData);
  178. args: [],
  179. 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.",
  180. referencedClasses: ["Announcer", "SystemAnnouncement"],
  181. //>>excludeEnd("ide");
  182. messageSends: ["new", "on:do:", "+", "announce:", "assert:equals:"]
  183. }),
  184. $globals.AnnouncerTest);
  185. $core.addMethod(
  186. $core.method({
  187. selector: "testOnDoFor",
  188. protocol: 'tests',
  189. fn: function (){
  190. var self=this;
  191. var counter,announcer;
  192. function $Announcer(){return $globals.Announcer||(typeof Announcer=="undefined"?nil:Announcer)}
  193. function $SystemAnnouncement(){return $globals.SystemAnnouncement||(typeof SystemAnnouncement=="undefined"?nil:SystemAnnouncement)}
  194. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  195. return $core.withContext(function($ctx1) {
  196. //>>excludeEnd("ctx");
  197. var $1,$2,$3,$4;
  198. counter=(0);
  199. announcer=$recv($Announcer())._new();
  200. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  201. $ctx1.sendIdx["new"]=1;
  202. //>>excludeEnd("ctx");
  203. $recv(announcer)._on_do_for_($SystemAnnouncement(),(function(){
  204. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  205. return $core.withContext(function($ctx2) {
  206. //>>excludeEnd("ctx");
  207. counter=$recv(counter).__plus((1));
  208. return counter;
  209. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  210. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  211. //>>excludeEnd("ctx");
  212. }),self);
  213. $1=announcer;
  214. $2=$recv($SystemAnnouncement())._new();
  215. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  216. $ctx1.sendIdx["new"]=2;
  217. //>>excludeEnd("ctx");
  218. $recv($1)._announce_($2);
  219. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  220. $ctx1.sendIdx["announce:"]=1;
  221. //>>excludeEnd("ctx");
  222. self._assert_equals_(counter,(1));
  223. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  224. $ctx1.sendIdx["assert:equals:"]=1;
  225. //>>excludeEnd("ctx");
  226. $3=announcer;
  227. $4=$recv($SystemAnnouncement())._new();
  228. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  229. $ctx1.sendIdx["new"]=3;
  230. //>>excludeEnd("ctx");
  231. $recv($3)._announce_($4);
  232. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  233. $ctx1.sendIdx["announce:"]=2;
  234. //>>excludeEnd("ctx");
  235. self._assert_equals_(counter,(2));
  236. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  237. $ctx1.sendIdx["assert:equals:"]=2;
  238. //>>excludeEnd("ctx");
  239. $recv(announcer)._unsubscribe_(self);
  240. $recv(announcer)._announce_($recv($SystemAnnouncement())._new());
  241. self._assert_equals_(counter,(2));
  242. return self;
  243. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  244. }, function($ctx1) {$ctx1.fill(self,"testOnDoFor",{counter:counter,announcer:announcer},$globals.AnnouncerTest)});
  245. //>>excludeEnd("ctx");
  246. },
  247. //>>excludeStart("ide", pragmas.excludeIdeData);
  248. args: [],
  249. 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.",
  250. referencedClasses: ["Announcer", "SystemAnnouncement"],
  251. //>>excludeEnd("ide");
  252. messageSends: ["new", "on:do:for:", "+", "announce:", "assert:equals:", "unsubscribe:"]
  253. }),
  254. $globals.AnnouncerTest);
  255. $core.addMethod(
  256. $core.method({
  257. selector: "testOnDoOnce",
  258. protocol: 'tests',
  259. fn: function (){
  260. var self=this;
  261. var counter,announcer;
  262. function $Announcer(){return $globals.Announcer||(typeof Announcer=="undefined"?nil:Announcer)}
  263. function $SystemAnnouncement(){return $globals.SystemAnnouncement||(typeof SystemAnnouncement=="undefined"?nil:SystemAnnouncement)}
  264. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  265. return $core.withContext(function($ctx1) {
  266. //>>excludeEnd("ctx");
  267. var $1,$2;
  268. counter=(0);
  269. announcer=$recv($Announcer())._new();
  270. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  271. $ctx1.sendIdx["new"]=1;
  272. //>>excludeEnd("ctx");
  273. $recv(announcer)._on_doOnce_($SystemAnnouncement(),(function(){
  274. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  275. return $core.withContext(function($ctx2) {
  276. //>>excludeEnd("ctx");
  277. counter=$recv(counter).__plus((1));
  278. return counter;
  279. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  280. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  281. //>>excludeEnd("ctx");
  282. }));
  283. $1=announcer;
  284. $2=$recv($SystemAnnouncement())._new();
  285. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  286. $ctx1.sendIdx["new"]=2;
  287. //>>excludeEnd("ctx");
  288. $recv($1)._announce_($2);
  289. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  290. $ctx1.sendIdx["announce:"]=1;
  291. //>>excludeEnd("ctx");
  292. self._assert_equals_(counter,(1));
  293. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  294. $ctx1.sendIdx["assert:equals:"]=1;
  295. //>>excludeEnd("ctx");
  296. $recv(announcer)._announce_($recv($SystemAnnouncement())._new());
  297. self._assert_equals_(counter,(1));
  298. return self;
  299. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  300. }, function($ctx1) {$ctx1.fill(self,"testOnDoOnce",{counter:counter,announcer:announcer},$globals.AnnouncerTest)});
  301. //>>excludeEnd("ctx");
  302. },
  303. //>>excludeStart("ide", pragmas.excludeIdeData);
  304. args: [],
  305. 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.",
  306. referencedClasses: ["Announcer", "SystemAnnouncement"],
  307. //>>excludeEnd("ide");
  308. messageSends: ["new", "on:doOnce:", "+", "announce:", "assert:equals:"]
  309. }),
  310. $globals.AnnouncerTest);
  311. $core.addClass('BlockClosureTest', $globals.TestCase, [], 'Kernel-Tests');
  312. $core.addMethod(
  313. $core.method({
  314. selector: "testCanClearInterval",
  315. protocol: 'tests',
  316. fn: function (){
  317. var self=this;
  318. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  319. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  320. return $core.withContext(function($ctx1) {
  321. //>>excludeEnd("ctx");
  322. self._shouldnt_raise_((function(){
  323. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  324. return $core.withContext(function($ctx2) {
  325. //>>excludeEnd("ctx");
  326. return $recv($recv((function(){
  327. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  328. return $core.withContext(function($ctx3) {
  329. //>>excludeEnd("ctx");
  330. return $recv($recv($Error())._new())._signal();
  331. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  332. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  333. //>>excludeEnd("ctx");
  334. }))._valueWithInterval_((0)))._clearInterval();
  335. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  336. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  337. //>>excludeEnd("ctx");
  338. }),$Error());
  339. return self;
  340. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  341. }, function($ctx1) {$ctx1.fill(self,"testCanClearInterval",{},$globals.BlockClosureTest)});
  342. //>>excludeEnd("ctx");
  343. },
  344. //>>excludeStart("ide", pragmas.excludeIdeData);
  345. args: [],
  346. source: "testCanClearInterval\x0a\x09self shouldnt: [ ([ Error new signal ] valueWithInterval: 0) clearInterval ] raise: Error",
  347. referencedClasses: ["Error"],
  348. //>>excludeEnd("ide");
  349. messageSends: ["shouldnt:raise:", "clearInterval", "valueWithInterval:", "signal", "new"]
  350. }),
  351. $globals.BlockClosureTest);
  352. $core.addMethod(
  353. $core.method({
  354. selector: "testCanClearTimeout",
  355. protocol: 'tests',
  356. fn: function (){
  357. var self=this;
  358. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  359. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  360. return $core.withContext(function($ctx1) {
  361. //>>excludeEnd("ctx");
  362. self._shouldnt_raise_((function(){
  363. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  364. return $core.withContext(function($ctx2) {
  365. //>>excludeEnd("ctx");
  366. return $recv($recv((function(){
  367. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  368. return $core.withContext(function($ctx3) {
  369. //>>excludeEnd("ctx");
  370. return $recv($recv($Error())._new())._signal();
  371. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  372. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  373. //>>excludeEnd("ctx");
  374. }))._valueWithTimeout_((0)))._clearTimeout();
  375. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  376. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  377. //>>excludeEnd("ctx");
  378. }),$Error());
  379. return self;
  380. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  381. }, function($ctx1) {$ctx1.fill(self,"testCanClearTimeout",{},$globals.BlockClosureTest)});
  382. //>>excludeEnd("ctx");
  383. },
  384. //>>excludeStart("ide", pragmas.excludeIdeData);
  385. args: [],
  386. source: "testCanClearTimeout\x0a\x09self shouldnt: [ ([ Error new signal ] valueWithTimeout: 0) clearTimeout ] raise: Error",
  387. referencedClasses: ["Error"],
  388. //>>excludeEnd("ide");
  389. messageSends: ["shouldnt:raise:", "clearTimeout", "valueWithTimeout:", "signal", "new"]
  390. }),
  391. $globals.BlockClosureTest);
  392. $core.addMethod(
  393. $core.method({
  394. selector: "testCompiledSource",
  395. protocol: 'tests',
  396. fn: function (){
  397. var self=this;
  398. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  399. return $core.withContext(function($ctx1) {
  400. //>>excludeEnd("ctx");
  401. self._assert_($recv($recv((function(){
  402. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  403. return $core.withContext(function($ctx2) {
  404. //>>excludeEnd("ctx");
  405. return (1).__plus((1));
  406. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  407. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  408. //>>excludeEnd("ctx");
  409. }))._compiledSource())._includesSubString_("function"));
  410. return self;
  411. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  412. }, function($ctx1) {$ctx1.fill(self,"testCompiledSource",{},$globals.BlockClosureTest)});
  413. //>>excludeEnd("ctx");
  414. },
  415. //>>excludeStart("ide", pragmas.excludeIdeData);
  416. args: [],
  417. source: "testCompiledSource\x0a\x09self assert: ([ 1+1 ] compiledSource includesSubString: 'function')",
  418. referencedClasses: [],
  419. //>>excludeEnd("ide");
  420. messageSends: ["assert:", "includesSubString:", "compiledSource", "+"]
  421. }),
  422. $globals.BlockClosureTest);
  423. $core.addMethod(
  424. $core.method({
  425. selector: "testCurrySelf",
  426. protocol: 'tests',
  427. fn: function (){
  428. var self=this;
  429. var curriedMethod,array;
  430. function $ClassBuilder(){return $globals.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  431. function $Array(){return $globals.Array||(typeof Array=="undefined"?nil:Array)}
  432. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  433. return $core.withContext(function($ctx1) {
  434. //>>excludeEnd("ctx");
  435. curriedMethod=$recv($recv((function(selfarg,x){
  436. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  437. return $core.withContext(function($ctx2) {
  438. //>>excludeEnd("ctx");
  439. return $recv(selfarg)._at_(x);
  440. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  441. }, function($ctx2) {$ctx2.fillBlock({selfarg:selfarg,x:x},$ctx1,1)});
  442. //>>excludeEnd("ctx");
  443. }))._currySelf())._asCompiledMethod_("foo:");
  444. array=[(3), (1), (4)];
  445. $recv($recv($ClassBuilder())._new())._installMethod_forClass_protocol_(curriedMethod,$Array(),"**test helper");
  446. $recv((function(){
  447. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  448. return $core.withContext(function($ctx2) {
  449. //>>excludeEnd("ctx");
  450. return self._assert_equals_($recv(array)._foo_((2)),(1));
  451. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  452. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  453. //>>excludeEnd("ctx");
  454. }))._ensure_((function(){
  455. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  456. return $core.withContext(function($ctx2) {
  457. //>>excludeEnd("ctx");
  458. return $recv($Array())._removeCompiledMethod_(curriedMethod);
  459. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  460. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  461. //>>excludeEnd("ctx");
  462. }));
  463. return self;
  464. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  465. }, function($ctx1) {$ctx1.fill(self,"testCurrySelf",{curriedMethod:curriedMethod,array:array},$globals.BlockClosureTest)});
  466. //>>excludeEnd("ctx");
  467. },
  468. //>>excludeStart("ide", pragmas.excludeIdeData);
  469. args: [],
  470. 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 ]",
  471. referencedClasses: ["ClassBuilder", "Array"],
  472. //>>excludeEnd("ide");
  473. messageSends: ["asCompiledMethod:", "currySelf", "at:", "installMethod:forClass:protocol:", "new", "ensure:", "assert:equals:", "foo:", "removeCompiledMethod:"]
  474. }),
  475. $globals.BlockClosureTest);
  476. $core.addMethod(
  477. $core.method({
  478. selector: "testEnsure",
  479. protocol: 'tests',
  480. fn: function (){
  481. var self=this;
  482. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  483. return $core.withContext(function($ctx1) {
  484. //>>excludeEnd("ctx");
  485. self._assert_equals_($recv((function(){
  486. return (3);
  487. }))._ensure_((function(){
  488. return (4);
  489. })),(3));
  490. return self;
  491. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  492. }, function($ctx1) {$ctx1.fill(self,"testEnsure",{},$globals.BlockClosureTest)});
  493. //>>excludeEnd("ctx");
  494. },
  495. //>>excludeStart("ide", pragmas.excludeIdeData);
  496. args: [],
  497. source: "testEnsure\x0a\x09self assert: ([ 3 ] ensure: [ 4 ]) equals: 3",
  498. referencedClasses: [],
  499. //>>excludeEnd("ide");
  500. messageSends: ["assert:equals:", "ensure:"]
  501. }),
  502. $globals.BlockClosureTest);
  503. $core.addMethod(
  504. $core.method({
  505. selector: "testEnsureRaises",
  506. protocol: 'tests',
  507. fn: function (){
  508. var self=this;
  509. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  510. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  511. return $core.withContext(function($ctx1) {
  512. //>>excludeEnd("ctx");
  513. self._should_raise_((function(){
  514. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  515. return $core.withContext(function($ctx2) {
  516. //>>excludeEnd("ctx");
  517. return $recv((function(){
  518. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  519. return $core.withContext(function($ctx3) {
  520. //>>excludeEnd("ctx");
  521. return $recv($recv($Error())._new())._signal();
  522. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  523. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  524. //>>excludeEnd("ctx");
  525. }))._ensure_((function(){
  526. return true;
  527. }));
  528. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  529. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  530. //>>excludeEnd("ctx");
  531. }),$Error());
  532. return self;
  533. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  534. }, function($ctx1) {$ctx1.fill(self,"testEnsureRaises",{},$globals.BlockClosureTest)});
  535. //>>excludeEnd("ctx");
  536. },
  537. //>>excludeStart("ide", pragmas.excludeIdeData);
  538. args: [],
  539. source: "testEnsureRaises\x0a\x09self should: [ [Error new signal ] ensure: [ true ]] raise: Error",
  540. referencedClasses: ["Error"],
  541. //>>excludeEnd("ide");
  542. messageSends: ["should:raise:", "ensure:", "signal", "new"]
  543. }),
  544. $globals.BlockClosureTest);
  545. $core.addMethod(
  546. $core.method({
  547. selector: "testExceptionSemantics",
  548. protocol: 'tests',
  549. fn: function (){
  550. var self=this;
  551. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  552. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  553. return $core.withContext(function($ctx1) {
  554. //>>excludeEnd("ctx");
  555. self._timeout_((100));
  556. $recv(self._async_((function(){
  557. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  558. return $core.withContext(function($ctx2) {
  559. //>>excludeEnd("ctx");
  560. return $recv((function(){
  561. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  562. return $core.withContext(function($ctx3) {
  563. //>>excludeEnd("ctx");
  564. self._assert_(true);
  565. $recv($Error())._signal();
  566. self._deny_(true);
  567. return self._finished();
  568. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  569. $ctx3.sendIdx["finished"]=1;
  570. //>>excludeEnd("ctx");
  571. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  572. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  573. //>>excludeEnd("ctx");
  574. }))._on_do_($Error(),(function(ex){
  575. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  576. return $core.withContext(function($ctx3) {
  577. //>>excludeEnd("ctx");
  578. return self._finished();
  579. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  580. }, function($ctx3) {$ctx3.fillBlock({ex:ex},$ctx2,3)});
  581. //>>excludeEnd("ctx");
  582. }));
  583. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  584. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  585. //>>excludeEnd("ctx");
  586. })))._valueWithTimeout_((0));
  587. return self;
  588. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  589. }, function($ctx1) {$ctx1.fill(self,"testExceptionSemantics",{},$globals.BlockClosureTest)});
  590. //>>excludeEnd("ctx");
  591. },
  592. //>>excludeStart("ide", pragmas.excludeIdeData);
  593. args: [],
  594. source: "testExceptionSemantics\x0a\x09\x22See https://github.com/NicolasPetton/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",
  595. referencedClasses: ["Error"],
  596. //>>excludeEnd("ide");
  597. messageSends: ["timeout:", "valueWithTimeout:", "async:", "on:do:", "assert:", "signal", "deny:", "finished"]
  598. }),
  599. $globals.BlockClosureTest);
  600. $core.addMethod(
  601. $core.method({
  602. selector: "testNewWithValues",
  603. protocol: 'tests',
  604. fn: function (){
  605. var self=this;
  606. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  607. return $core.withContext(function($ctx1) {
  608. //>>excludeEnd("ctx");
  609. function TestConstructor(arg1, arg2, arg3) {}
  610. TestConstructor.prototype.name = 'theTestPrototype';
  611. var wrappedConstructor = $recv(TestConstructor);
  612. var result = wrappedConstructor._newWithValues_([1, 2, 3 ]);
  613. self._assert_(result instanceof TestConstructor);
  614. self._assert_equals_(result.name, 'theTestPrototype');
  615. "newWithValues: cannot help if the argument list is wrong, and should warn that a mistake was made."
  616. self._should_raise_(function () {wrappedConstructor._newWithValues_('single argument');}, $globals.Error);;
  617. return self;
  618. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  619. }, function($ctx1) {$ctx1.fill(self,"testNewWithValues",{},$globals.BlockClosureTest)});
  620. //>>excludeEnd("ctx");
  621. },
  622. //>>excludeStart("ide", pragmas.excludeIdeData);
  623. args: [],
  624. source: "testNewWithValues\x0a<\x0a\x09function TestConstructor(arg1, arg2, arg3) {}\x0a\x09TestConstructor.prototype.name = 'theTestPrototype';\x0a\x0a\x09var wrappedConstructor = $recv(TestConstructor);\x0a\x09var result = wrappedConstructor._newWithValues_([1, 2, 3 ]);\x0a\x09self._assert_(result instanceof TestConstructor);\x0a\x09self._assert_equals_(result.name, 'theTestPrototype');\x0a\x0a\x09\x22newWithValues: cannot help if the argument list is wrong, and should warn that a mistake was made.\x22\x0a\x09self._should_raise_(function () {wrappedConstructor._newWithValues_('single argument');}, $globals.Error);\x0a>",
  625. referencedClasses: [],
  626. //>>excludeEnd("ide");
  627. messageSends: []
  628. }),
  629. $globals.BlockClosureTest);
  630. $core.addMethod(
  631. $core.method({
  632. selector: "testNumArgs",
  633. protocol: 'tests',
  634. fn: function (){
  635. var self=this;
  636. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  637. return $core.withContext(function($ctx1) {
  638. //>>excludeEnd("ctx");
  639. var $1;
  640. $1=$recv((function(){
  641. }))._numArgs();
  642. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  643. $ctx1.sendIdx["numArgs"]=1;
  644. //>>excludeEnd("ctx");
  645. self._assert_equals_($1,(0));
  646. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  647. $ctx1.sendIdx["assert:equals:"]=1;
  648. //>>excludeEnd("ctx");
  649. self._assert_equals_($recv((function(a,b){
  650. }))._numArgs(),(2));
  651. return self;
  652. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  653. }, function($ctx1) {$ctx1.fill(self,"testNumArgs",{},$globals.BlockClosureTest)});
  654. //>>excludeEnd("ctx");
  655. },
  656. //>>excludeStart("ide", pragmas.excludeIdeData);
  657. args: [],
  658. source: "testNumArgs\x0a\x09self assert: [] numArgs equals: 0.\x0a\x09self assert: [ :a :b | ] numArgs equals: 2",
  659. referencedClasses: [],
  660. //>>excludeEnd("ide");
  661. messageSends: ["assert:equals:", "numArgs"]
  662. }),
  663. $globals.BlockClosureTest);
  664. $core.addMethod(
  665. $core.method({
  666. selector: "testOnDo",
  667. protocol: 'tests',
  668. fn: function (){
  669. var self=this;
  670. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  671. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  672. return $core.withContext(function($ctx1) {
  673. //>>excludeEnd("ctx");
  674. self._assert_($recv((function(){
  675. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  676. return $core.withContext(function($ctx2) {
  677. //>>excludeEnd("ctx");
  678. return $recv($recv($Error())._new())._signal();
  679. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  680. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  681. //>>excludeEnd("ctx");
  682. }))._on_do_($Error(),(function(ex){
  683. return true;
  684. })));
  685. return self;
  686. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  687. }, function($ctx1) {$ctx1.fill(self,"testOnDo",{},$globals.BlockClosureTest)});
  688. //>>excludeEnd("ctx");
  689. },
  690. //>>excludeStart("ide", pragmas.excludeIdeData);
  691. args: [],
  692. source: "testOnDo\x0a\x09self assert: ([ Error new signal ] on: Error do: [ :ex | true ])",
  693. referencedClasses: ["Error"],
  694. //>>excludeEnd("ide");
  695. messageSends: ["assert:", "on:do:", "signal", "new"]
  696. }),
  697. $globals.BlockClosureTest);
  698. $core.addMethod(
  699. $core.method({
  700. selector: "testValue",
  701. protocol: 'tests',
  702. fn: function (){
  703. var self=this;
  704. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  705. return $core.withContext(function($ctx1) {
  706. //>>excludeEnd("ctx");
  707. var $1;
  708. $1=$recv((function(){
  709. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  710. return $core.withContext(function($ctx2) {
  711. //>>excludeEnd("ctx");
  712. return (1).__plus((1));
  713. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  714. $ctx2.sendIdx["+"]=1;
  715. //>>excludeEnd("ctx");
  716. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  717. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  718. //>>excludeEnd("ctx");
  719. }))._value();
  720. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  721. $ctx1.sendIdx["value"]=1;
  722. //>>excludeEnd("ctx");
  723. self._assert_equals_($1,(2));
  724. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  725. $ctx1.sendIdx["assert:equals:"]=1;
  726. //>>excludeEnd("ctx");
  727. self._assert_equals_($recv((function(x){
  728. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  729. return $core.withContext(function($ctx2) {
  730. //>>excludeEnd("ctx");
  731. return $recv(x).__plus((1));
  732. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  733. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,2)});
  734. //>>excludeEnd("ctx");
  735. }))._value_((2)),(3));
  736. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  737. $ctx1.sendIdx["assert:equals:"]=2;
  738. //>>excludeEnd("ctx");
  739. self._assert_equals_($recv((function(x,y){
  740. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  741. return $core.withContext(function($ctx2) {
  742. //>>excludeEnd("ctx");
  743. return $recv(x).__star(y);
  744. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  745. }, function($ctx2) {$ctx2.fillBlock({x:x,y:y},$ctx1,3)});
  746. //>>excludeEnd("ctx");
  747. }))._value_value_((2),(4)),(8));
  748. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  749. $ctx1.sendIdx["assert:equals:"]=3;
  750. //>>excludeEnd("ctx");
  751. self._assert_equals_($recv((function(a,b,c){
  752. return (1);
  753. }))._value(),(1));
  754. return self;
  755. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  756. }, function($ctx1) {$ctx1.fill(self,"testValue",{},$globals.BlockClosureTest)});
  757. //>>excludeEnd("ctx");
  758. },
  759. //>>excludeStart("ide", pragmas.excludeIdeData);
  760. args: [],
  761. 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",
  762. referencedClasses: [],
  763. //>>excludeEnd("ide");
  764. messageSends: ["assert:equals:", "value", "+", "value:", "value:value:", "*"]
  765. }),
  766. $globals.BlockClosureTest);
  767. $core.addMethod(
  768. $core.method({
  769. selector: "testValueWithPossibleArguments",
  770. protocol: 'tests',
  771. fn: function (){
  772. var self=this;
  773. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  774. return $core.withContext(function($ctx1) {
  775. //>>excludeEnd("ctx");
  776. var $1,$2;
  777. $1=$recv((function(){
  778. return (1);
  779. }))._valueWithPossibleArguments_([(3), (4)]);
  780. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  781. $ctx1.sendIdx["valueWithPossibleArguments:"]=1;
  782. //>>excludeEnd("ctx");
  783. self._assert_equals_($1,(1));
  784. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  785. $ctx1.sendIdx["assert:equals:"]=1;
  786. //>>excludeEnd("ctx");
  787. $2=$recv((function(a){
  788. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  789. return $core.withContext(function($ctx2) {
  790. //>>excludeEnd("ctx");
  791. return $recv(a).__plus((4));
  792. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  793. $ctx2.sendIdx["+"]=1;
  794. //>>excludeEnd("ctx");
  795. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  796. }, function($ctx2) {$ctx2.fillBlock({a:a},$ctx1,2)});
  797. //>>excludeEnd("ctx");
  798. }))._valueWithPossibleArguments_([(3), (4)]);
  799. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  800. $ctx1.sendIdx["valueWithPossibleArguments:"]=2;
  801. //>>excludeEnd("ctx");
  802. self._assert_equals_($2,(7));
  803. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  804. $ctx1.sendIdx["assert:equals:"]=2;
  805. //>>excludeEnd("ctx");
  806. self._assert_equals_($recv((function(a,b){
  807. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  808. return $core.withContext(function($ctx2) {
  809. //>>excludeEnd("ctx");
  810. return $recv(a).__plus(b);
  811. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  812. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1,3)});
  813. //>>excludeEnd("ctx");
  814. }))._valueWithPossibleArguments_([(3), (4), (5)]),(7));
  815. return self;
  816. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  817. }, function($ctx1) {$ctx1.fill(self,"testValueWithPossibleArguments",{},$globals.BlockClosureTest)});
  818. //>>excludeEnd("ctx");
  819. },
  820. //>>excludeStart("ide", pragmas.excludeIdeData);
  821. args: [],
  822. 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.",
  823. referencedClasses: [],
  824. //>>excludeEnd("ide");
  825. messageSends: ["assert:equals:", "valueWithPossibleArguments:", "+"]
  826. }),
  827. $globals.BlockClosureTest);
  828. $core.addMethod(
  829. $core.method({
  830. selector: "testWhileFalse",
  831. protocol: 'tests',
  832. fn: function (){
  833. var self=this;
  834. var i;
  835. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  836. return $core.withContext(function($ctx1) {
  837. //>>excludeEnd("ctx");
  838. i=(0);
  839. $recv((function(){
  840. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  841. return $core.withContext(function($ctx2) {
  842. //>>excludeEnd("ctx");
  843. return $recv(i).__gt((5));
  844. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  845. $ctx2.sendIdx[">"]=1;
  846. //>>excludeEnd("ctx");
  847. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  848. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  849. //>>excludeEnd("ctx");
  850. }))._whileFalse_((function(){
  851. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  852. return $core.withContext(function($ctx2) {
  853. //>>excludeEnd("ctx");
  854. i=$recv(i).__plus((1));
  855. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  856. $ctx2.sendIdx["+"]=1;
  857. //>>excludeEnd("ctx");
  858. return i;
  859. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  860. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  861. //>>excludeEnd("ctx");
  862. }));
  863. self._assert_equals_(i,(6));
  864. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  865. $ctx1.sendIdx["assert:equals:"]=1;
  866. //>>excludeEnd("ctx");
  867. i=(0);
  868. $recv((function(){
  869. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  870. return $core.withContext(function($ctx2) {
  871. //>>excludeEnd("ctx");
  872. i=$recv(i).__plus((1));
  873. i;
  874. return $recv(i).__gt((5));
  875. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  876. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  877. //>>excludeEnd("ctx");
  878. }))._whileFalse();
  879. self._assert_equals_(i,(6));
  880. return self;
  881. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  882. }, function($ctx1) {$ctx1.fill(self,"testWhileFalse",{i:i},$globals.BlockClosureTest)});
  883. //>>excludeEnd("ctx");
  884. },
  885. //>>excludeStart("ide", pragmas.excludeIdeData);
  886. args: [],
  887. 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",
  888. referencedClasses: [],
  889. //>>excludeEnd("ide");
  890. messageSends: ["whileFalse:", ">", "+", "assert:equals:", "whileFalse"]
  891. }),
  892. $globals.BlockClosureTest);
  893. $core.addMethod(
  894. $core.method({
  895. selector: "testWhileTrue",
  896. protocol: 'tests',
  897. fn: function (){
  898. var self=this;
  899. var i;
  900. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  901. return $core.withContext(function($ctx1) {
  902. //>>excludeEnd("ctx");
  903. i=(0);
  904. $recv((function(){
  905. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  906. return $core.withContext(function($ctx2) {
  907. //>>excludeEnd("ctx");
  908. return $recv(i).__lt((5));
  909. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  910. $ctx2.sendIdx["<"]=1;
  911. //>>excludeEnd("ctx");
  912. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  913. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  914. //>>excludeEnd("ctx");
  915. }))._whileTrue_((function(){
  916. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  917. return $core.withContext(function($ctx2) {
  918. //>>excludeEnd("ctx");
  919. i=$recv(i).__plus((1));
  920. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  921. $ctx2.sendIdx["+"]=1;
  922. //>>excludeEnd("ctx");
  923. return i;
  924. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  925. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  926. //>>excludeEnd("ctx");
  927. }));
  928. self._assert_equals_(i,(5));
  929. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  930. $ctx1.sendIdx["assert:equals:"]=1;
  931. //>>excludeEnd("ctx");
  932. i=(0);
  933. $recv((function(){
  934. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  935. return $core.withContext(function($ctx2) {
  936. //>>excludeEnd("ctx");
  937. i=$recv(i).__plus((1));
  938. i;
  939. return $recv(i).__lt((5));
  940. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  941. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  942. //>>excludeEnd("ctx");
  943. }))._whileTrue();
  944. self._assert_equals_(i,(5));
  945. return self;
  946. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  947. }, function($ctx1) {$ctx1.fill(self,"testWhileTrue",{i:i},$globals.BlockClosureTest)});
  948. //>>excludeEnd("ctx");
  949. },
  950. //>>excludeStart("ide", pragmas.excludeIdeData);
  951. args: [],
  952. 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",
  953. referencedClasses: [],
  954. //>>excludeEnd("ide");
  955. messageSends: ["whileTrue:", "<", "+", "assert:equals:", "whileTrue"]
  956. }),
  957. $globals.BlockClosureTest);
  958. $core.addClass('BooleanTest', $globals.TestCase, [], 'Kernel-Tests');
  959. $core.addMethod(
  960. $core.method({
  961. selector: "testEquality",
  962. protocol: 'tests',
  963. fn: function (){
  964. var self=this;
  965. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  966. return $core.withContext(function($ctx1) {
  967. //>>excludeEnd("ctx");
  968. var $1,$2,$3,$4,$5,$6,$7,$8,$10,$9,$12,$11;
  969. $1=(0).__eq(false);
  970. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  971. $ctx1.sendIdx["="]=1;
  972. //>>excludeEnd("ctx");
  973. self._deny_($1);
  974. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  975. $ctx1.sendIdx["deny:"]=1;
  976. //>>excludeEnd("ctx");
  977. $2=false.__eq((0));
  978. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  979. $ctx1.sendIdx["="]=2;
  980. //>>excludeEnd("ctx");
  981. self._deny_($2);
  982. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  983. $ctx1.sendIdx["deny:"]=2;
  984. //>>excludeEnd("ctx");
  985. $3="".__eq(false);
  986. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  987. $ctx1.sendIdx["="]=3;
  988. //>>excludeEnd("ctx");
  989. self._deny_($3);
  990. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  991. $ctx1.sendIdx["deny:"]=3;
  992. //>>excludeEnd("ctx");
  993. $4=false.__eq("");
  994. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  995. $ctx1.sendIdx["="]=4;
  996. //>>excludeEnd("ctx");
  997. self._deny_($4);
  998. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  999. $ctx1.sendIdx["deny:"]=4;
  1000. //>>excludeEnd("ctx");
  1001. $5=true.__eq(true);
  1002. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1003. $ctx1.sendIdx["="]=5;
  1004. //>>excludeEnd("ctx");
  1005. self._assert_($5);
  1006. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1007. $ctx1.sendIdx["assert:"]=1;
  1008. //>>excludeEnd("ctx");
  1009. $6=false.__eq(true);
  1010. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1011. $ctx1.sendIdx["="]=6;
  1012. //>>excludeEnd("ctx");
  1013. self._deny_($6);
  1014. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1015. $ctx1.sendIdx["deny:"]=5;
  1016. //>>excludeEnd("ctx");
  1017. $7=true.__eq(false);
  1018. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1019. $ctx1.sendIdx["="]=7;
  1020. //>>excludeEnd("ctx");
  1021. self._deny_($7);
  1022. $8=false.__eq(false);
  1023. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1024. $ctx1.sendIdx["="]=8;
  1025. //>>excludeEnd("ctx");
  1026. self._assert_($8);
  1027. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1028. $ctx1.sendIdx["assert:"]=2;
  1029. //>>excludeEnd("ctx");
  1030. $10=true._yourself();
  1031. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1032. $ctx1.sendIdx["yourself"]=1;
  1033. //>>excludeEnd("ctx");
  1034. $9=$recv($10).__eq(true);
  1035. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1036. $ctx1.sendIdx["="]=9;
  1037. //>>excludeEnd("ctx");
  1038. self._assert_($9);
  1039. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1040. $ctx1.sendIdx["assert:"]=3;
  1041. //>>excludeEnd("ctx");
  1042. $12=true._yourself();
  1043. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1044. $ctx1.sendIdx["yourself"]=2;
  1045. //>>excludeEnd("ctx");
  1046. $11=$recv($12).__eq(true._yourself());
  1047. self._assert_($11);
  1048. return self;
  1049. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1050. }, function($ctx1) {$ctx1.fill(self,"testEquality",{},$globals.BooleanTest)});
  1051. //>>excludeEnd("ctx");
  1052. },
  1053. //>>excludeStart("ide", pragmas.excludeIdeData);
  1054. args: [],
  1055. 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)",
  1056. referencedClasses: [],
  1057. //>>excludeEnd("ide");
  1058. messageSends: ["deny:", "=", "assert:", "yourself"]
  1059. }),
  1060. $globals.BooleanTest);
  1061. $core.addMethod(
  1062. $core.method({
  1063. selector: "testIdentity",
  1064. protocol: 'tests',
  1065. fn: function (){
  1066. var self=this;
  1067. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1068. return $core.withContext(function($ctx1) {
  1069. //>>excludeEnd("ctx");
  1070. var $1,$2,$3,$4,$5,$6,$7,$8,$10,$9,$12,$11;
  1071. $1=(0).__eq_eq(false);
  1072. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1073. $ctx1.sendIdx["=="]=1;
  1074. //>>excludeEnd("ctx");
  1075. self._deny_($1);
  1076. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1077. $ctx1.sendIdx["deny:"]=1;
  1078. //>>excludeEnd("ctx");
  1079. $2=false.__eq_eq((0));
  1080. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1081. $ctx1.sendIdx["=="]=2;
  1082. //>>excludeEnd("ctx");
  1083. self._deny_($2);
  1084. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1085. $ctx1.sendIdx["deny:"]=2;
  1086. //>>excludeEnd("ctx");
  1087. $3="".__eq_eq(false);
  1088. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1089. $ctx1.sendIdx["=="]=3;
  1090. //>>excludeEnd("ctx");
  1091. self._deny_($3);
  1092. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1093. $ctx1.sendIdx["deny:"]=3;
  1094. //>>excludeEnd("ctx");
  1095. $4=false.__eq_eq("");
  1096. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1097. $ctx1.sendIdx["=="]=4;
  1098. //>>excludeEnd("ctx");
  1099. self._deny_($4);
  1100. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1101. $ctx1.sendIdx["deny:"]=4;
  1102. //>>excludeEnd("ctx");
  1103. $5=true.__eq_eq(true);
  1104. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1105. $ctx1.sendIdx["=="]=5;
  1106. //>>excludeEnd("ctx");
  1107. self._assert_($5);
  1108. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1109. $ctx1.sendIdx["assert:"]=1;
  1110. //>>excludeEnd("ctx");
  1111. $6=false.__eq_eq(true);
  1112. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1113. $ctx1.sendIdx["=="]=6;
  1114. //>>excludeEnd("ctx");
  1115. self._deny_($6);
  1116. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1117. $ctx1.sendIdx["deny:"]=5;
  1118. //>>excludeEnd("ctx");
  1119. $7=true.__eq_eq(false);
  1120. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1121. $ctx1.sendIdx["=="]=7;
  1122. //>>excludeEnd("ctx");
  1123. self._deny_($7);
  1124. $8=false.__eq_eq(false);
  1125. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1126. $ctx1.sendIdx["=="]=8;
  1127. //>>excludeEnd("ctx");
  1128. self._assert_($8);
  1129. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1130. $ctx1.sendIdx["assert:"]=2;
  1131. //>>excludeEnd("ctx");
  1132. $10=true._yourself();
  1133. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1134. $ctx1.sendIdx["yourself"]=1;
  1135. //>>excludeEnd("ctx");
  1136. $9=$recv($10).__eq_eq(true);
  1137. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1138. $ctx1.sendIdx["=="]=9;
  1139. //>>excludeEnd("ctx");
  1140. self._assert_($9);
  1141. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1142. $ctx1.sendIdx["assert:"]=3;
  1143. //>>excludeEnd("ctx");
  1144. $12=true._yourself();
  1145. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1146. $ctx1.sendIdx["yourself"]=2;
  1147. //>>excludeEnd("ctx");
  1148. $11=$recv($12).__eq_eq(true._yourself());
  1149. self._assert_($11);
  1150. return self;
  1151. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1152. }, function($ctx1) {$ctx1.fill(self,"testIdentity",{},$globals.BooleanTest)});
  1153. //>>excludeEnd("ctx");
  1154. },
  1155. //>>excludeStart("ide", pragmas.excludeIdeData);
  1156. args: [],
  1157. 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",
  1158. referencedClasses: [],
  1159. //>>excludeEnd("ide");
  1160. messageSends: ["deny:", "==", "assert:", "yourself"]
  1161. }),
  1162. $globals.BooleanTest);
  1163. $core.addMethod(
  1164. $core.method({
  1165. selector: "testIfTrueIfFalse",
  1166. protocol: 'tests',
  1167. fn: function (){
  1168. var self=this;
  1169. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1170. return $core.withContext(function($ctx1) {
  1171. //>>excludeEnd("ctx");
  1172. var $1,$2,$3,$4,$5,$6,$7,$8;
  1173. if($core.assert(true)){
  1174. $1="alternative block";
  1175. };
  1176. self._assert_equals_($1,"alternative block");
  1177. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1178. $ctx1.sendIdx["assert:equals:"]=1;
  1179. //>>excludeEnd("ctx");
  1180. if(!$core.assert(true)){
  1181. $2="alternative block";
  1182. };
  1183. self._assert_equals_($2,nil);
  1184. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1185. $ctx1.sendIdx["assert:equals:"]=2;
  1186. //>>excludeEnd("ctx");
  1187. if($core.assert(false)){
  1188. $3="alternative block";
  1189. };
  1190. self._assert_equals_($3,nil);
  1191. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1192. $ctx1.sendIdx["assert:equals:"]=3;
  1193. //>>excludeEnd("ctx");
  1194. if(!$core.assert(false)){
  1195. $4="alternative block";
  1196. };
  1197. self._assert_equals_($4,"alternative block");
  1198. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1199. $ctx1.sendIdx["assert:equals:"]=4;
  1200. //>>excludeEnd("ctx");
  1201. if($core.assert(false)){
  1202. $5="alternative block";
  1203. } else {
  1204. $5="alternative block2";
  1205. };
  1206. self._assert_equals_($5,"alternative block2");
  1207. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1208. $ctx1.sendIdx["assert:equals:"]=5;
  1209. //>>excludeEnd("ctx");
  1210. if($core.assert(false)){
  1211. $6="alternative block2";
  1212. } else {
  1213. $6="alternative block";
  1214. };
  1215. self._assert_equals_($6,"alternative block");
  1216. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1217. $ctx1.sendIdx["assert:equals:"]=6;
  1218. //>>excludeEnd("ctx");
  1219. if($core.assert(true)){
  1220. $7="alternative block";
  1221. } else {
  1222. $7="alternative block2";
  1223. };
  1224. self._assert_equals_($7,"alternative block");
  1225. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1226. $ctx1.sendIdx["assert:equals:"]=7;
  1227. //>>excludeEnd("ctx");
  1228. if($core.assert(true)){
  1229. $8="alternative block2";
  1230. } else {
  1231. $8="alternative block";
  1232. };
  1233. self._assert_equals_($8,"alternative block2");
  1234. return self;
  1235. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1236. }, function($ctx1) {$ctx1.fill(self,"testIfTrueIfFalse",{},$globals.BooleanTest)});
  1237. //>>excludeEnd("ctx");
  1238. },
  1239. //>>excludeStart("ide", pragmas.excludeIdeData);
  1240. args: [],
  1241. 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'.",
  1242. referencedClasses: [],
  1243. //>>excludeEnd("ide");
  1244. messageSends: ["assert:equals:", "ifTrue:", "ifFalse:", "ifTrue:ifFalse:", "ifFalse:ifTrue:"]
  1245. }),
  1246. $globals.BooleanTest);
  1247. $core.addMethod(
  1248. $core.method({
  1249. selector: "testIfTrueIfFalseWithBoxing",
  1250. protocol: 'tests',
  1251. fn: function (){
  1252. var self=this;
  1253. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1254. return $core.withContext(function($ctx1) {
  1255. //>>excludeEnd("ctx");
  1256. var $2,$1,$4,$3,$6,$5,$8,$7,$10,$9,$12,$11,$14,$13,$16,$15;
  1257. $2=true._yourself();
  1258. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1259. $ctx1.sendIdx["yourself"]=1;
  1260. //>>excludeEnd("ctx");
  1261. if($core.assert($2)){
  1262. $1="alternative block";
  1263. };
  1264. self._assert_equals_($1,"alternative block");
  1265. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1266. $ctx1.sendIdx["assert:equals:"]=1;
  1267. //>>excludeEnd("ctx");
  1268. $4=true._yourself();
  1269. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1270. $ctx1.sendIdx["yourself"]=2;
  1271. //>>excludeEnd("ctx");
  1272. if(!$core.assert($4)){
  1273. $3="alternative block";
  1274. };
  1275. self._assert_equals_($3,nil);
  1276. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1277. $ctx1.sendIdx["assert:equals:"]=2;
  1278. //>>excludeEnd("ctx");
  1279. $6=false._yourself();
  1280. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1281. $ctx1.sendIdx["yourself"]=3;
  1282. //>>excludeEnd("ctx");
  1283. if($core.assert($6)){
  1284. $5="alternative block";
  1285. };
  1286. self._assert_equals_($5,nil);
  1287. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1288. $ctx1.sendIdx["assert:equals:"]=3;
  1289. //>>excludeEnd("ctx");
  1290. $8=false._yourself();
  1291. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1292. $ctx1.sendIdx["yourself"]=4;
  1293. //>>excludeEnd("ctx");
  1294. if(!$core.assert($8)){
  1295. $7="alternative block";
  1296. };
  1297. self._assert_equals_($7,"alternative block");
  1298. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1299. $ctx1.sendIdx["assert:equals:"]=4;
  1300. //>>excludeEnd("ctx");
  1301. $10=false._yourself();
  1302. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1303. $ctx1.sendIdx["yourself"]=5;
  1304. //>>excludeEnd("ctx");
  1305. if($core.assert($10)){
  1306. $9="alternative block";
  1307. } else {
  1308. $9="alternative block2";
  1309. };
  1310. self._assert_equals_($9,"alternative block2");
  1311. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1312. $ctx1.sendIdx["assert:equals:"]=5;
  1313. //>>excludeEnd("ctx");
  1314. $12=false._yourself();
  1315. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1316. $ctx1.sendIdx["yourself"]=6;
  1317. //>>excludeEnd("ctx");
  1318. if($core.assert($12)){
  1319. $11="alternative block2";
  1320. } else {
  1321. $11="alternative block";
  1322. };
  1323. self._assert_equals_($11,"alternative block");
  1324. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1325. $ctx1.sendIdx["assert:equals:"]=6;
  1326. //>>excludeEnd("ctx");
  1327. $14=true._yourself();
  1328. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1329. $ctx1.sendIdx["yourself"]=7;
  1330. //>>excludeEnd("ctx");
  1331. if($core.assert($14)){
  1332. $13="alternative block";
  1333. } else {
  1334. $13="alternative block2";
  1335. };
  1336. self._assert_equals_($13,"alternative block");
  1337. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1338. $ctx1.sendIdx["assert:equals:"]=7;
  1339. //>>excludeEnd("ctx");
  1340. $16=true._yourself();
  1341. if($core.assert($16)){
  1342. $15="alternative block2";
  1343. } else {
  1344. $15="alternative block";
  1345. };
  1346. self._assert_equals_($15,"alternative block2");
  1347. return self;
  1348. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1349. }, function($ctx1) {$ctx1.fill(self,"testIfTrueIfFalseWithBoxing",{},$globals.BooleanTest)});
  1350. //>>excludeEnd("ctx");
  1351. },
  1352. //>>excludeStart("ide", pragmas.excludeIdeData);
  1353. args: [],
  1354. 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'.",
  1355. referencedClasses: [],
  1356. //>>excludeEnd("ide");
  1357. messageSends: ["assert:equals:", "ifTrue:", "yourself", "ifFalse:", "ifTrue:ifFalse:", "ifFalse:ifTrue:"]
  1358. }),
  1359. $globals.BooleanTest);
  1360. $core.addMethod(
  1361. $core.method({
  1362. selector: "testLogic",
  1363. protocol: 'tests',
  1364. fn: function (){
  1365. var self=this;
  1366. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1367. return $core.withContext(function($ctx1) {
  1368. //>>excludeEnd("ctx");
  1369. var $1,$2,$3,$5,$4,$6,$7,$8,$10,$9,$12,$11,$14,$13,$17,$18,$16,$15,$20,$19,$22,$21,$25,$24,$23;
  1370. $1=true.__and(true);
  1371. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1372. $ctx1.sendIdx["&"]=1;
  1373. //>>excludeEnd("ctx");
  1374. self._assert_($1);
  1375. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1376. $ctx1.sendIdx["assert:"]=1;
  1377. //>>excludeEnd("ctx");
  1378. $2=true.__and(false);
  1379. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1380. $ctx1.sendIdx["&"]=2;
  1381. //>>excludeEnd("ctx");
  1382. self._deny_($2);
  1383. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1384. $ctx1.sendIdx["deny:"]=1;
  1385. //>>excludeEnd("ctx");
  1386. $3=false.__and(true);
  1387. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1388. $ctx1.sendIdx["&"]=3;
  1389. //>>excludeEnd("ctx");
  1390. self._deny_($3);
  1391. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1392. $ctx1.sendIdx["deny:"]=2;
  1393. //>>excludeEnd("ctx");
  1394. $5=false.__and(false);
  1395. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1396. $ctx1.sendIdx["&"]=4;
  1397. //>>excludeEnd("ctx");
  1398. $4=self._deny_($5);
  1399. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1400. $ctx1.sendIdx["deny:"]=3;
  1401. //>>excludeEnd("ctx");
  1402. $6=true.__or(true);
  1403. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1404. $ctx1.sendIdx["|"]=1;
  1405. //>>excludeEnd("ctx");
  1406. self._assert_($6);
  1407. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1408. $ctx1.sendIdx["assert:"]=2;
  1409. //>>excludeEnd("ctx");
  1410. $7=true.__or(false);
  1411. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1412. $ctx1.sendIdx["|"]=2;
  1413. //>>excludeEnd("ctx");
  1414. self._assert_($7);
  1415. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1416. $ctx1.sendIdx["assert:"]=3;
  1417. //>>excludeEnd("ctx");
  1418. $8=false.__or(true);
  1419. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1420. $ctx1.sendIdx["|"]=3;
  1421. //>>excludeEnd("ctx");
  1422. self._assert_($8);
  1423. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1424. $ctx1.sendIdx["assert:"]=4;
  1425. //>>excludeEnd("ctx");
  1426. $10=false.__or(false);
  1427. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1428. $ctx1.sendIdx["|"]=4;
  1429. //>>excludeEnd("ctx");
  1430. $9=self._deny_($10);
  1431. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1432. $ctx1.sendIdx["deny:"]=4;
  1433. //>>excludeEnd("ctx");
  1434. $12=(1).__gt((0));
  1435. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1436. $ctx1.sendIdx[">"]=1;
  1437. //>>excludeEnd("ctx");
  1438. $11=true.__and($12);
  1439. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1440. $ctx1.sendIdx["&"]=5;
  1441. //>>excludeEnd("ctx");
  1442. self._assert_($11);
  1443. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1444. $ctx1.sendIdx["assert:"]=5;
  1445. //>>excludeEnd("ctx");
  1446. $14=(1).__gt((0));
  1447. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1448. $ctx1.sendIdx[">"]=2;
  1449. //>>excludeEnd("ctx");
  1450. $13=$recv($14).__and(false);
  1451. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1452. $ctx1.sendIdx["&"]=6;
  1453. //>>excludeEnd("ctx");
  1454. self._deny_($13);
  1455. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1456. $ctx1.sendIdx["deny:"]=5;
  1457. //>>excludeEnd("ctx");
  1458. $17=(1).__gt((0));
  1459. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1460. $ctx1.sendIdx[">"]=3;
  1461. //>>excludeEnd("ctx");
  1462. $18=(1).__gt((2));
  1463. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1464. $ctx1.sendIdx[">"]=4;
  1465. //>>excludeEnd("ctx");
  1466. $16=$recv($17).__and($18);
  1467. $15=self._deny_($16);
  1468. $20=(1).__gt((0));
  1469. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1470. $ctx1.sendIdx[">"]=5;
  1471. //>>excludeEnd("ctx");
  1472. $19=false.__or($20);
  1473. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1474. $ctx1.sendIdx["|"]=5;
  1475. //>>excludeEnd("ctx");
  1476. self._assert_($19);
  1477. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1478. $ctx1.sendIdx["assert:"]=6;
  1479. //>>excludeEnd("ctx");
  1480. $22=(1).__gt((0));
  1481. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1482. $ctx1.sendIdx[">"]=6;
  1483. //>>excludeEnd("ctx");
  1484. $21=$recv($22).__or(false);
  1485. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1486. $ctx1.sendIdx["|"]=6;
  1487. //>>excludeEnd("ctx");
  1488. self._assert_($21);
  1489. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1490. $ctx1.sendIdx["assert:"]=7;
  1491. //>>excludeEnd("ctx");
  1492. $25=(1).__gt((0));
  1493. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1494. $ctx1.sendIdx[">"]=7;
  1495. //>>excludeEnd("ctx");
  1496. $24=$recv($25).__or((1).__gt((2)));
  1497. $23=self._assert_($24);
  1498. return self;
  1499. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1500. }, function($ctx1) {$ctx1.fill(self,"testLogic",{},$globals.BooleanTest)});
  1501. //>>excludeEnd("ctx");
  1502. },
  1503. //>>excludeStart("ide", pragmas.excludeIdeData);
  1504. args: [],
  1505. 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))",
  1506. referencedClasses: [],
  1507. //>>excludeEnd("ide");
  1508. messageSends: ["assert:", "&", "deny:", "|", ">"]
  1509. }),
  1510. $globals.BooleanTest);
  1511. $core.addMethod(
  1512. $core.method({
  1513. selector: "testLogicKeywords",
  1514. protocol: 'tests',
  1515. fn: function (){
  1516. var self=this;
  1517. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1518. return $core.withContext(function($ctx1) {
  1519. //>>excludeEnd("ctx");
  1520. var $1,$2,$3,$5,$4,$6,$7,$8,$10,$9,$11,$13,$12,$16,$15,$14,$17,$19,$18,$22,$21,$20;
  1521. $1=true._and_((function(){
  1522. return true;
  1523. }));
  1524. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1525. $ctx1.sendIdx["and:"]=1;
  1526. //>>excludeEnd("ctx");
  1527. self._assert_($1);
  1528. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1529. $ctx1.sendIdx["assert:"]=1;
  1530. //>>excludeEnd("ctx");
  1531. $2=true._and_((function(){
  1532. return false;
  1533. }));
  1534. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1535. $ctx1.sendIdx["and:"]=2;
  1536. //>>excludeEnd("ctx");
  1537. self._deny_($2);
  1538. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1539. $ctx1.sendIdx["deny:"]=1;
  1540. //>>excludeEnd("ctx");
  1541. $3=false._and_((function(){
  1542. return true;
  1543. }));
  1544. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1545. $ctx1.sendIdx["and:"]=3;
  1546. //>>excludeEnd("ctx");
  1547. self._deny_($3);
  1548. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1549. $ctx1.sendIdx["deny:"]=2;
  1550. //>>excludeEnd("ctx");
  1551. $5=false._and_((function(){
  1552. return false;
  1553. }));
  1554. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1555. $ctx1.sendIdx["and:"]=4;
  1556. //>>excludeEnd("ctx");
  1557. $4=self._deny_($5);
  1558. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1559. $ctx1.sendIdx["deny:"]=3;
  1560. //>>excludeEnd("ctx");
  1561. $6=true._or_((function(){
  1562. return true;
  1563. }));
  1564. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1565. $ctx1.sendIdx["or:"]=1;
  1566. //>>excludeEnd("ctx");
  1567. self._assert_($6);
  1568. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1569. $ctx1.sendIdx["assert:"]=2;
  1570. //>>excludeEnd("ctx");
  1571. $7=true._or_((function(){
  1572. return false;
  1573. }));
  1574. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1575. $ctx1.sendIdx["or:"]=2;
  1576. //>>excludeEnd("ctx");
  1577. self._assert_($7);
  1578. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1579. $ctx1.sendIdx["assert:"]=3;
  1580. //>>excludeEnd("ctx");
  1581. $8=false._or_((function(){
  1582. return true;
  1583. }));
  1584. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1585. $ctx1.sendIdx["or:"]=3;
  1586. //>>excludeEnd("ctx");
  1587. self._assert_($8);
  1588. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1589. $ctx1.sendIdx["assert:"]=4;
  1590. //>>excludeEnd("ctx");
  1591. $10=false._or_((function(){
  1592. return false;
  1593. }));
  1594. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1595. $ctx1.sendIdx["or:"]=4;
  1596. //>>excludeEnd("ctx");
  1597. $9=self._deny_($10);
  1598. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1599. $ctx1.sendIdx["deny:"]=4;
  1600. //>>excludeEnd("ctx");
  1601. $11=true._and_((function(){
  1602. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1603. return $core.withContext(function($ctx2) {
  1604. //>>excludeEnd("ctx");
  1605. return (1).__gt((0));
  1606. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1607. $ctx2.sendIdx[">"]=1;
  1608. //>>excludeEnd("ctx");
  1609. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1610. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,9)});
  1611. //>>excludeEnd("ctx");
  1612. }));
  1613. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1614. $ctx1.sendIdx["and:"]=5;
  1615. //>>excludeEnd("ctx");
  1616. self._assert_($11);
  1617. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1618. $ctx1.sendIdx["assert:"]=5;
  1619. //>>excludeEnd("ctx");
  1620. $13=(1).__gt((0));
  1621. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1622. $ctx1.sendIdx[">"]=2;
  1623. //>>excludeEnd("ctx");
  1624. $12=$recv($13)._and_((function(){
  1625. return false;
  1626. }));
  1627. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1628. $ctx1.sendIdx["and:"]=6;
  1629. //>>excludeEnd("ctx");
  1630. self._deny_($12);
  1631. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1632. $ctx1.sendIdx["deny:"]=5;
  1633. //>>excludeEnd("ctx");
  1634. $16=(1).__gt((0));
  1635. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1636. $ctx1.sendIdx[">"]=3;
  1637. //>>excludeEnd("ctx");
  1638. $15=$recv($16)._and_((function(){
  1639. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1640. return $core.withContext(function($ctx2) {
  1641. //>>excludeEnd("ctx");
  1642. return (1).__gt((2));
  1643. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1644. $ctx2.sendIdx[">"]=4;
  1645. //>>excludeEnd("ctx");
  1646. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1647. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,11)});
  1648. //>>excludeEnd("ctx");
  1649. }));
  1650. $14=self._deny_($15);
  1651. $17=false._or_((function(){
  1652. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1653. return $core.withContext(function($ctx2) {
  1654. //>>excludeEnd("ctx");
  1655. return (1).__gt((0));
  1656. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1657. $ctx2.sendIdx[">"]=5;
  1658. //>>excludeEnd("ctx");
  1659. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1660. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,12)});
  1661. //>>excludeEnd("ctx");
  1662. }));
  1663. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1664. $ctx1.sendIdx["or:"]=5;
  1665. //>>excludeEnd("ctx");
  1666. self._assert_($17);
  1667. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1668. $ctx1.sendIdx["assert:"]=6;
  1669. //>>excludeEnd("ctx");
  1670. $19=(1).__gt((0));
  1671. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1672. $ctx1.sendIdx[">"]=6;
  1673. //>>excludeEnd("ctx");
  1674. $18=$recv($19)._or_((function(){
  1675. return false;
  1676. }));
  1677. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1678. $ctx1.sendIdx["or:"]=6;
  1679. //>>excludeEnd("ctx");
  1680. self._assert_($18);
  1681. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1682. $ctx1.sendIdx["assert:"]=7;
  1683. //>>excludeEnd("ctx");
  1684. $22=(1).__gt((0));
  1685. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1686. $ctx1.sendIdx[">"]=7;
  1687. //>>excludeEnd("ctx");
  1688. $21=$recv($22)._or_((function(){
  1689. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1690. return $core.withContext(function($ctx2) {
  1691. //>>excludeEnd("ctx");
  1692. return (1).__gt((2));
  1693. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1694. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,14)});
  1695. //>>excludeEnd("ctx");
  1696. }));
  1697. $20=self._assert_($21);
  1698. return self;
  1699. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1700. }, function($ctx1) {$ctx1.fill(self,"testLogicKeywords",{},$globals.BooleanTest)});
  1701. //>>excludeEnd("ctx");
  1702. },
  1703. //>>excludeStart("ide", pragmas.excludeIdeData);
  1704. args: [],
  1705. 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 ])",
  1706. referencedClasses: [],
  1707. //>>excludeEnd("ide");
  1708. messageSends: ["assert:", "and:", "deny:", "or:", ">"]
  1709. }),
  1710. $globals.BooleanTest);
  1711. $core.addMethod(
  1712. $core.method({
  1713. selector: "testNonBooleanError",
  1714. protocol: 'tests',
  1715. fn: function (){
  1716. var self=this;
  1717. function $NonBooleanReceiver(){return $globals.NonBooleanReceiver||(typeof NonBooleanReceiver=="undefined"?nil:NonBooleanReceiver)}
  1718. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1719. return $core.withContext(function($ctx1) {
  1720. //>>excludeEnd("ctx");
  1721. self._should_raise_((function(){
  1722. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1723. return $core.withContext(function($ctx2) {
  1724. //>>excludeEnd("ctx");
  1725. if($core.assert("")){
  1726. } else {
  1727. };
  1728. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1729. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  1730. //>>excludeEnd("ctx");
  1731. }),$NonBooleanReceiver());
  1732. return self;
  1733. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1734. }, function($ctx1) {$ctx1.fill(self,"testNonBooleanError",{},$globals.BooleanTest)});
  1735. //>>excludeEnd("ctx");
  1736. },
  1737. //>>excludeStart("ide", pragmas.excludeIdeData);
  1738. args: [],
  1739. source: "testNonBooleanError\x0a\x09self should: [ '' ifTrue: [] ifFalse: [] ] raise: NonBooleanReceiver",
  1740. referencedClasses: ["NonBooleanReceiver"],
  1741. //>>excludeEnd("ide");
  1742. messageSends: ["should:raise:", "ifTrue:ifFalse:"]
  1743. }),
  1744. $globals.BooleanTest);
  1745. $core.addClass('ClassBuilderTest', $globals.TestCase, ['builder', 'theClass'], 'Kernel-Tests');
  1746. $core.addMethod(
  1747. $core.method({
  1748. selector: "setUp",
  1749. protocol: 'running',
  1750. fn: function (){
  1751. var self=this;
  1752. function $ClassBuilder(){return $globals.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  1753. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1754. return $core.withContext(function($ctx1) {
  1755. //>>excludeEnd("ctx");
  1756. self["@builder"]=$recv($ClassBuilder())._new();
  1757. return self;
  1758. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1759. }, function($ctx1) {$ctx1.fill(self,"setUp",{},$globals.ClassBuilderTest)});
  1760. //>>excludeEnd("ctx");
  1761. },
  1762. //>>excludeStart("ide", pragmas.excludeIdeData);
  1763. args: [],
  1764. source: "setUp\x0a\x09builder := ClassBuilder new",
  1765. referencedClasses: ["ClassBuilder"],
  1766. //>>excludeEnd("ide");
  1767. messageSends: ["new"]
  1768. }),
  1769. $globals.ClassBuilderTest);
  1770. $core.addMethod(
  1771. $core.method({
  1772. selector: "tearDown",
  1773. protocol: 'running',
  1774. fn: function (){
  1775. var self=this;
  1776. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1777. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1778. return $core.withContext(function($ctx1) {
  1779. //>>excludeEnd("ctx");
  1780. var $1,$receiver;
  1781. $1=self["@theClass"];
  1782. if(($receiver = $1) == null || $receiver.isNil){
  1783. $1;
  1784. } else {
  1785. $recv($Smalltalk())._removeClass_(self["@theClass"]);
  1786. self["@theClass"]=nil;
  1787. self["@theClass"];
  1788. };
  1789. return self;
  1790. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1791. }, function($ctx1) {$ctx1.fill(self,"tearDown",{},$globals.ClassBuilderTest)});
  1792. //>>excludeEnd("ctx");
  1793. },
  1794. //>>excludeStart("ide", pragmas.excludeIdeData);
  1795. args: [],
  1796. source: "tearDown\x0a\x09theClass ifNotNil: [ Smalltalk removeClass: theClass. theClass := nil ]",
  1797. referencedClasses: ["Smalltalk"],
  1798. //>>excludeEnd("ide");
  1799. messageSends: ["ifNotNil:", "removeClass:"]
  1800. }),
  1801. $globals.ClassBuilderTest);
  1802. $core.addMethod(
  1803. $core.method({
  1804. selector: "testClassCopy",
  1805. protocol: 'tests',
  1806. fn: function (){
  1807. var self=this;
  1808. function $ObjectMock(){return $globals.ObjectMock||(typeof ObjectMock=="undefined"?nil:ObjectMock)}
  1809. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1810. return $core.withContext(function($ctx1) {
  1811. //>>excludeEnd("ctx");
  1812. var $2,$1,$4,$3,$6,$5,$8,$7;
  1813. self["@theClass"]=$recv(self["@builder"])._copyClass_named_($ObjectMock(),"ObjectMock2");
  1814. $2=$recv(self["@theClass"])._superclass();
  1815. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1816. $ctx1.sendIdx["superclass"]=1;
  1817. //>>excludeEnd("ctx");
  1818. $1=$recv($2).__eq_eq($recv($ObjectMock())._superclass());
  1819. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1820. $ctx1.sendIdx["=="]=1;
  1821. //>>excludeEnd("ctx");
  1822. self._assert_($1);
  1823. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1824. $ctx1.sendIdx["assert:"]=1;
  1825. //>>excludeEnd("ctx");
  1826. $4=$recv(self["@theClass"])._instanceVariableNames();
  1827. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1828. $ctx1.sendIdx["instanceVariableNames"]=1;
  1829. //>>excludeEnd("ctx");
  1830. $3=$recv($4).__eq_eq($recv($ObjectMock())._instanceVariableNames());
  1831. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1832. $ctx1.sendIdx["=="]=2;
  1833. //>>excludeEnd("ctx");
  1834. self._assert_($3);
  1835. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1836. $ctx1.sendIdx["assert:"]=2;
  1837. //>>excludeEnd("ctx");
  1838. self._assert_equals_($recv(self["@theClass"])._name(),"ObjectMock2");
  1839. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1840. $ctx1.sendIdx["assert:equals:"]=1;
  1841. //>>excludeEnd("ctx");
  1842. $6=$recv(self["@theClass"])._package();
  1843. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1844. $ctx1.sendIdx["package"]=1;
  1845. //>>excludeEnd("ctx");
  1846. $5=$recv($6).__eq_eq($recv($ObjectMock())._package());
  1847. self._assert_($5);
  1848. $8=$recv(self["@theClass"])._methodDictionary();
  1849. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1850. $ctx1.sendIdx["methodDictionary"]=1;
  1851. //>>excludeEnd("ctx");
  1852. $7=$recv($8)._keys();
  1853. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1854. $ctx1.sendIdx["keys"]=1;
  1855. //>>excludeEnd("ctx");
  1856. self._assert_equals_($7,$recv($recv($ObjectMock())._methodDictionary())._keys());
  1857. return self;
  1858. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1859. }, function($ctx1) {$ctx1.fill(self,"testClassCopy",{},$globals.ClassBuilderTest)});
  1860. //>>excludeEnd("ctx");
  1861. },
  1862. //>>excludeStart("ide", pragmas.excludeIdeData);
  1863. args: [],
  1864. 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",
  1865. referencedClasses: ["ObjectMock"],
  1866. //>>excludeEnd("ide");
  1867. messageSends: ["copyClass:named:", "assert:", "==", "superclass", "instanceVariableNames", "assert:equals:", "name", "package", "keys", "methodDictionary"]
  1868. }),
  1869. $globals.ClassBuilderTest);
  1870. $core.addMethod(
  1871. $core.method({
  1872. selector: "testClassMigration",
  1873. protocol: 'tests',
  1874. fn: function (){
  1875. var self=this;
  1876. var instance,oldClass;
  1877. function $ObjectMock(){return $globals.ObjectMock||(typeof ObjectMock=="undefined"?nil:ObjectMock)}
  1878. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1879. function $ObjectMock2(){return $globals.ObjectMock2||(typeof ObjectMock2=="undefined"?nil:ObjectMock2)}
  1880. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1881. return $core.withContext(function($ctx1) {
  1882. //>>excludeEnd("ctx");
  1883. var $2,$1,$4,$3,$5,$6,$7,$8,$9,$11,$10;
  1884. oldClass=$recv(self["@builder"])._copyClass_named_($ObjectMock(),"ObjectMock2");
  1885. $2=$recv($Smalltalk())._globals();
  1886. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1887. $ctx1.sendIdx["globals"]=1;
  1888. //>>excludeEnd("ctx");
  1889. $1=$recv($2)._at_("ObjectMock2");
  1890. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1891. $ctx1.sendIdx["at:"]=1;
  1892. //>>excludeEnd("ctx");
  1893. instance=$recv($1)._new();
  1894. $4=$recv($Smalltalk())._globals();
  1895. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1896. $ctx1.sendIdx["globals"]=2;
  1897. //>>excludeEnd("ctx");
  1898. $3=$recv($4)._at_("ObjectMock2");
  1899. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1900. $ctx1.sendIdx["at:"]=2;
  1901. //>>excludeEnd("ctx");
  1902. $recv($ObjectMock())._subclass_instanceVariableNames_package_($3,"","Kernel-Tests");
  1903. $5=$recv(oldClass).__eq_eq($ObjectMock2());
  1904. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1905. $ctx1.sendIdx["=="]=1;
  1906. //>>excludeEnd("ctx");
  1907. self._deny_($5);
  1908. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1909. $ctx1.sendIdx["deny:"]=1;
  1910. //>>excludeEnd("ctx");
  1911. $6=$recv($recv($ObjectMock2())._superclass()).__eq_eq($ObjectMock());
  1912. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1913. $ctx1.sendIdx["=="]=2;
  1914. //>>excludeEnd("ctx");
  1915. self._assert_($6);
  1916. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1917. $ctx1.sendIdx["assert:"]=1;
  1918. //>>excludeEnd("ctx");
  1919. self._assert_($recv($recv($ObjectMock2())._instanceVariableNames())._isEmpty());
  1920. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1921. $ctx1.sendIdx["assert:"]=2;
  1922. //>>excludeEnd("ctx");
  1923. $7=$recv($ObjectMock2())._selectors();
  1924. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1925. $ctx1.sendIdx["selectors"]=1;
  1926. //>>excludeEnd("ctx");
  1927. self._assert_equals_($7,$recv(oldClass)._selectors());
  1928. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1929. $ctx1.sendIdx["assert:equals:"]=1;
  1930. //>>excludeEnd("ctx");
  1931. $8=$recv($ObjectMock2())._comment();
  1932. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1933. $ctx1.sendIdx["comment"]=1;
  1934. //>>excludeEnd("ctx");
  1935. self._assert_equals_($8,$recv(oldClass)._comment());
  1936. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1937. $ctx1.sendIdx["assert:equals:"]=2;
  1938. //>>excludeEnd("ctx");
  1939. $9=$recv($recv($ObjectMock2())._package())._name();
  1940. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1941. $ctx1.sendIdx["name"]=1;
  1942. //>>excludeEnd("ctx");
  1943. self._assert_equals_($9,"Kernel-Tests");
  1944. $11=$recv(instance)._class();
  1945. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1946. $ctx1.sendIdx["class"]=1;
  1947. //>>excludeEnd("ctx");
  1948. $10=$recv($11).__eq_eq($ObjectMock2());
  1949. self._deny_($10);
  1950. self._assert_($recv($recv($recv($Smalltalk())._globals())._at_($recv($recv(instance)._class())._name()))._isNil());
  1951. $recv($Smalltalk())._removeClass_($ObjectMock2());
  1952. return self;
  1953. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1954. }, function($ctx1) {$ctx1.fill(self,"testClassMigration",{instance:instance,oldClass:oldClass},$globals.ClassBuilderTest)});
  1955. //>>excludeEnd("ctx");
  1956. },
  1957. //>>excludeStart("ide", pragmas.excludeIdeData);
  1958. args: [],
  1959. 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",
  1960. referencedClasses: ["ObjectMock", "Smalltalk", "ObjectMock2"],
  1961. //>>excludeEnd("ide");
  1962. messageSends: ["copyClass:named:", "new", "at:", "globals", "subclass:instanceVariableNames:package:", "deny:", "==", "assert:", "superclass", "isEmpty", "instanceVariableNames", "assert:equals:", "selectors", "comment", "name", "package", "class", "isNil", "removeClass:"]
  1963. }),
  1964. $globals.ClassBuilderTest);
  1965. $core.addMethod(
  1966. $core.method({
  1967. selector: "testClassMigrationWithClassInstanceVariables",
  1968. protocol: 'tests',
  1969. fn: function (){
  1970. var self=this;
  1971. function $ObjectMock(){return $globals.ObjectMock||(typeof ObjectMock=="undefined"?nil:ObjectMock)}
  1972. function $ObjectMock2(){return $globals.ObjectMock2||(typeof ObjectMock2=="undefined"?nil:ObjectMock2)}
  1973. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1974. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1975. return $core.withContext(function($ctx1) {
  1976. //>>excludeEnd("ctx");
  1977. var $1;
  1978. $recv(self["@builder"])._copyClass_named_($ObjectMock(),"ObjectMock2");
  1979. $1=$recv($ObjectMock2())._class();
  1980. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1981. $ctx1.sendIdx["class"]=1;
  1982. //>>excludeEnd("ctx");
  1983. $recv($1)._instanceVariableNames_("foo bar");
  1984. $recv($ObjectMock())._subclass_instanceVariableNames_package_($recv($recv($Smalltalk())._globals())._at_("ObjectMock2"),"","Kernel-Tests");
  1985. self._assert_equals_($recv($recv($ObjectMock2())._class())._instanceVariableNames(),["foo", "bar"]);
  1986. $recv($Smalltalk())._removeClass_($ObjectMock2());
  1987. return self;
  1988. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1989. }, function($ctx1) {$ctx1.fill(self,"testClassMigrationWithClassInstanceVariables",{},$globals.ClassBuilderTest)});
  1990. //>>excludeEnd("ctx");
  1991. },
  1992. //>>excludeStart("ide", pragmas.excludeIdeData);
  1993. args: [],
  1994. 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",
  1995. referencedClasses: ["ObjectMock", "ObjectMock2", "Smalltalk"],
  1996. //>>excludeEnd("ide");
  1997. messageSends: ["copyClass:named:", "instanceVariableNames:", "class", "subclass:instanceVariableNames:package:", "at:", "globals", "assert:equals:", "instanceVariableNames", "removeClass:"]
  1998. }),
  1999. $globals.ClassBuilderTest);
  2000. $core.addMethod(
  2001. $core.method({
  2002. selector: "testClassMigrationWithSubclasses",
  2003. protocol: 'tests',
  2004. fn: function (){
  2005. var self=this;
  2006. function $ObjectMock(){return $globals.ObjectMock||(typeof ObjectMock=="undefined"?nil:ObjectMock)}
  2007. function $ObjectMock2(){return $globals.ObjectMock2||(typeof ObjectMock2=="undefined"?nil:ObjectMock2)}
  2008. function $ObjectMock3(){return $globals.ObjectMock3||(typeof ObjectMock3=="undefined"?nil:ObjectMock3)}
  2009. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  2010. function $ObjectMock4(){return $globals.ObjectMock4||(typeof ObjectMock4=="undefined"?nil:ObjectMock4)}
  2011. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2012. return $core.withContext(function($ctx1) {
  2013. //>>excludeEnd("ctx");
  2014. var $2,$1,$4,$3;
  2015. $recv(self["@builder"])._copyClass_named_($ObjectMock(),"ObjectMock2");
  2016. $recv($ObjectMock2())._subclass_instanceVariableNames_package_("ObjectMock3","","Kernel-Tests");
  2017. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2018. $ctx1.sendIdx["subclass:instanceVariableNames:package:"]=1;
  2019. //>>excludeEnd("ctx");
  2020. $recv($ObjectMock3())._subclass_instanceVariableNames_package_("ObjectMock4","","Kernel-Tests");
  2021. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2022. $ctx1.sendIdx["subclass:instanceVariableNames:package:"]=2;
  2023. //>>excludeEnd("ctx");
  2024. $recv($ObjectMock())._subclass_instanceVariableNames_package_($recv($recv($Smalltalk())._globals())._at_("ObjectMock2"),"","Kernel-Tests");
  2025. $2=$recv($ObjectMock())._subclasses();
  2026. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2027. $ctx1.sendIdx["subclasses"]=1;
  2028. //>>excludeEnd("ctx");
  2029. $1=$recv($2)._includes_($ObjectMock2());
  2030. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2031. $ctx1.sendIdx["includes:"]=1;
  2032. //>>excludeEnd("ctx");
  2033. self._assert_($1);
  2034. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2035. $ctx1.sendIdx["assert:"]=1;
  2036. //>>excludeEnd("ctx");
  2037. $4=$recv($ObjectMock2())._subclasses();
  2038. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2039. $ctx1.sendIdx["subclasses"]=2;
  2040. //>>excludeEnd("ctx");
  2041. $3=$recv($4)._includes_($ObjectMock3());
  2042. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2043. $ctx1.sendIdx["includes:"]=2;
  2044. //>>excludeEnd("ctx");
  2045. self._assert_($3);
  2046. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2047. $ctx1.sendIdx["assert:"]=2;
  2048. //>>excludeEnd("ctx");
  2049. self._assert_($recv($recv($ObjectMock3())._subclasses())._includes_($ObjectMock4()));
  2050. $recv($recv($ObjectMock())._allSubclasses())._do_((function(each){
  2051. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2052. return $core.withContext(function($ctx2) {
  2053. //>>excludeEnd("ctx");
  2054. return $recv($Smalltalk())._removeClass_(each);
  2055. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2056. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2057. //>>excludeEnd("ctx");
  2058. }));
  2059. return self;
  2060. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2061. }, function($ctx1) {$ctx1.fill(self,"testClassMigrationWithSubclasses",{},$globals.ClassBuilderTest)});
  2062. //>>excludeEnd("ctx");
  2063. },
  2064. //>>excludeStart("ide", pragmas.excludeIdeData);
  2065. args: [],
  2066. 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 ]",
  2067. referencedClasses: ["ObjectMock", "ObjectMock2", "ObjectMock3", "Smalltalk", "ObjectMock4"],
  2068. //>>excludeEnd("ide");
  2069. messageSends: ["copyClass:named:", "subclass:instanceVariableNames:package:", "at:", "globals", "assert:", "includes:", "subclasses", "do:", "allSubclasses", "removeClass:"]
  2070. }),
  2071. $globals.ClassBuilderTest);
  2072. $core.addMethod(
  2073. $core.method({
  2074. selector: "testInstanceVariableNames",
  2075. protocol: 'tests',
  2076. fn: function (){
  2077. var self=this;
  2078. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2079. return $core.withContext(function($ctx1) {
  2080. //>>excludeEnd("ctx");
  2081. self._assert_equals_($recv(self["@builder"])._instanceVariableNamesFor_(" hello world "),["hello", "world"]);
  2082. return self;
  2083. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2084. }, function($ctx1) {$ctx1.fill(self,"testInstanceVariableNames",{},$globals.ClassBuilderTest)});
  2085. //>>excludeEnd("ctx");
  2086. },
  2087. //>>excludeStart("ide", pragmas.excludeIdeData);
  2088. args: [],
  2089. source: "testInstanceVariableNames\x0a\x09self assert: (builder instanceVariableNamesFor: ' hello world ') equals: #('hello' 'world')",
  2090. referencedClasses: [],
  2091. //>>excludeEnd("ide");
  2092. messageSends: ["assert:equals:", "instanceVariableNamesFor:"]
  2093. }),
  2094. $globals.ClassBuilderTest);
  2095. $core.addClass('CollectionTest', $globals.TestCase, [], 'Kernel-Tests');
  2096. $core.addMethod(
  2097. $core.method({
  2098. selector: "assertSameContents:as:",
  2099. protocol: 'convenience',
  2100. fn: function (aCollection,anotherCollection){
  2101. var self=this;
  2102. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2103. return $core.withContext(function($ctx1) {
  2104. //>>excludeEnd("ctx");
  2105. var $2,$1,$4,$3;
  2106. $2=$recv(aCollection)._size();
  2107. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2108. $ctx1.sendIdx["size"]=1;
  2109. //>>excludeEnd("ctx");
  2110. $1=$recv($2).__eq($recv(anotherCollection)._size());
  2111. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2112. $ctx1.sendIdx["="]=1;
  2113. //>>excludeEnd("ctx");
  2114. self._assert_($1);
  2115. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2116. $ctx1.sendIdx["assert:"]=1;
  2117. //>>excludeEnd("ctx");
  2118. $recv(aCollection)._do_((function(each){
  2119. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2120. return $core.withContext(function($ctx2) {
  2121. //>>excludeEnd("ctx");
  2122. $4=$recv(aCollection)._occurrencesOf_(each);
  2123. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2124. $ctx2.sendIdx["occurrencesOf:"]=1;
  2125. //>>excludeEnd("ctx");
  2126. $3=$recv($4).__eq($recv(anotherCollection)._occurrencesOf_(each));
  2127. return self._assert_($3);
  2128. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2129. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2130. //>>excludeEnd("ctx");
  2131. }));
  2132. return self;
  2133. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2134. }, function($ctx1) {$ctx1.fill(self,"assertSameContents:as:",{aCollection:aCollection,anotherCollection:anotherCollection},$globals.CollectionTest)});
  2135. //>>excludeEnd("ctx");
  2136. },
  2137. //>>excludeStart("ide", pragmas.excludeIdeData);
  2138. args: ["aCollection", "anotherCollection"],
  2139. 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)) ]",
  2140. referencedClasses: [],
  2141. //>>excludeEnd("ide");
  2142. messageSends: ["assert:", "=", "size", "do:", "occurrencesOf:"]
  2143. }),
  2144. $globals.CollectionTest);
  2145. $core.addMethod(
  2146. $core.method({
  2147. selector: "collection",
  2148. protocol: 'fixture',
  2149. fn: function (){
  2150. var self=this;
  2151. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2152. return $core.withContext(function($ctx1) {
  2153. //>>excludeEnd("ctx");
  2154. self._subclassResponsibility();
  2155. return self;
  2156. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2157. }, function($ctx1) {$ctx1.fill(self,"collection",{},$globals.CollectionTest)});
  2158. //>>excludeEnd("ctx");
  2159. },
  2160. //>>excludeStart("ide", pragmas.excludeIdeData);
  2161. args: [],
  2162. source: "collection\x0a\x09\x22Answers pre-filled collection of type tested.\x22\x0a\x0a\x09self subclassResponsibility",
  2163. referencedClasses: [],
  2164. //>>excludeEnd("ide");
  2165. messageSends: ["subclassResponsibility"]
  2166. }),
  2167. $globals.CollectionTest);
  2168. $core.addMethod(
  2169. $core.method({
  2170. selector: "collectionClass",
  2171. protocol: 'fixture',
  2172. fn: function (){
  2173. var self=this;
  2174. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2175. return $core.withContext(function($ctx1) {
  2176. //>>excludeEnd("ctx");
  2177. var $1;
  2178. $1=$recv(self._class())._collectionClass();
  2179. return $1;
  2180. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2181. }, function($ctx1) {$ctx1.fill(self,"collectionClass",{},$globals.CollectionTest)});
  2182. //>>excludeEnd("ctx");
  2183. },
  2184. //>>excludeStart("ide", pragmas.excludeIdeData);
  2185. args: [],
  2186. source: "collectionClass\x0a\x09\x22Answers class of collection type tested\x22\x0a\x0a\x09^ self class collectionClass",
  2187. referencedClasses: [],
  2188. //>>excludeEnd("ide");
  2189. messageSends: ["collectionClass", "class"]
  2190. }),
  2191. $globals.CollectionTest);
  2192. $core.addMethod(
  2193. $core.method({
  2194. selector: "collectionOfPrintStrings",
  2195. protocol: 'fixture',
  2196. fn: function (){
  2197. var self=this;
  2198. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2199. return $core.withContext(function($ctx1) {
  2200. //>>excludeEnd("ctx");
  2201. self._subclassResponsibility();
  2202. return self;
  2203. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2204. }, function($ctx1) {$ctx1.fill(self,"collectionOfPrintStrings",{},$globals.CollectionTest)});
  2205. //>>excludeEnd("ctx");
  2206. },
  2207. //>>excludeStart("ide", pragmas.excludeIdeData);
  2208. args: [],
  2209. source: "collectionOfPrintStrings\x0a\x09\x22Answers self collection but with values\x0a\x09changed to their printStrings\x22\x0a\x0a\x09self subclassResponsibility",
  2210. referencedClasses: [],
  2211. //>>excludeEnd("ide");
  2212. messageSends: ["subclassResponsibility"]
  2213. }),
  2214. $globals.CollectionTest);
  2215. $core.addMethod(
  2216. $core.method({
  2217. selector: "collectionSize",
  2218. protocol: 'fixture',
  2219. fn: function (){
  2220. var self=this;
  2221. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2222. return $core.withContext(function($ctx1) {
  2223. //>>excludeEnd("ctx");
  2224. self._subclassResponsibility();
  2225. return self;
  2226. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2227. }, function($ctx1) {$ctx1.fill(self,"collectionSize",{},$globals.CollectionTest)});
  2228. //>>excludeEnd("ctx");
  2229. },
  2230. //>>excludeStart("ide", pragmas.excludeIdeData);
  2231. args: [],
  2232. source: "collectionSize\x0a\x09\x22Answers size of self collection.\x22\x0a\x0a\x09self subclassResponsibility",
  2233. referencedClasses: [],
  2234. //>>excludeEnd("ide");
  2235. messageSends: ["subclassResponsibility"]
  2236. }),
  2237. $globals.CollectionTest);
  2238. $core.addMethod(
  2239. $core.method({
  2240. selector: "collectionWithDuplicates",
  2241. protocol: 'fixture',
  2242. fn: function (){
  2243. var self=this;
  2244. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2245. return $core.withContext(function($ctx1) {
  2246. //>>excludeEnd("ctx");
  2247. self._subclassResponsibility();
  2248. return self;
  2249. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2250. }, function($ctx1) {$ctx1.fill(self,"collectionWithDuplicates",{},$globals.CollectionTest)});
  2251. //>>excludeEnd("ctx");
  2252. },
  2253. //>>excludeStart("ide", pragmas.excludeIdeData);
  2254. args: [],
  2255. 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",
  2256. referencedClasses: [],
  2257. //>>excludeEnd("ide");
  2258. messageSends: ["subclassResponsibility"]
  2259. }),
  2260. $globals.CollectionTest);
  2261. $core.addMethod(
  2262. $core.method({
  2263. selector: "collectionWithNewValue",
  2264. protocol: 'fixture',
  2265. fn: function (){
  2266. var self=this;
  2267. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2268. return $core.withContext(function($ctx1) {
  2269. //>>excludeEnd("ctx");
  2270. self._subclassResponsibility();
  2271. return self;
  2272. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2273. }, function($ctx1) {$ctx1.fill(self,"collectionWithNewValue",{},$globals.CollectionTest)});
  2274. //>>excludeEnd("ctx");
  2275. },
  2276. //>>excludeStart("ide", pragmas.excludeIdeData);
  2277. args: [],
  2278. 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",
  2279. referencedClasses: [],
  2280. //>>excludeEnd("ide");
  2281. messageSends: ["subclassResponsibility"]
  2282. }),
  2283. $globals.CollectionTest);
  2284. $core.addMethod(
  2285. $core.method({
  2286. selector: "isCollectionReadOnly",
  2287. protocol: 'testing',
  2288. fn: function (){
  2289. var self=this;
  2290. return false;
  2291. },
  2292. //>>excludeStart("ide", pragmas.excludeIdeData);
  2293. args: [],
  2294. source: "isCollectionReadOnly\x0a\x09^ false",
  2295. referencedClasses: [],
  2296. //>>excludeEnd("ide");
  2297. messageSends: []
  2298. }),
  2299. $globals.CollectionTest);
  2300. $core.addMethod(
  2301. $core.method({
  2302. selector: "sampleNewValue",
  2303. protocol: 'fixture',
  2304. fn: function (){
  2305. var self=this;
  2306. return "N";
  2307. },
  2308. //>>excludeStart("ide", pragmas.excludeIdeData);
  2309. args: [],
  2310. 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'",
  2311. referencedClasses: [],
  2312. //>>excludeEnd("ide");
  2313. messageSends: []
  2314. }),
  2315. $globals.CollectionTest);
  2316. $core.addMethod(
  2317. $core.method({
  2318. selector: "sampleNewValueAsCollection",
  2319. protocol: 'fixture',
  2320. fn: function (){
  2321. var self=this;
  2322. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2323. return $core.withContext(function($ctx1) {
  2324. //>>excludeEnd("ctx");
  2325. var $1;
  2326. $1=$recv(self._collectionClass())._with_(self._sampleNewValue());
  2327. return $1;
  2328. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2329. }, function($ctx1) {$ctx1.fill(self,"sampleNewValueAsCollection",{},$globals.CollectionTest)});
  2330. //>>excludeEnd("ctx");
  2331. },
  2332. //>>excludeStart("ide", pragmas.excludeIdeData);
  2333. args: [],
  2334. 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",
  2335. referencedClasses: [],
  2336. //>>excludeEnd("ide");
  2337. messageSends: ["with:", "collectionClass", "sampleNewValue"]
  2338. }),
  2339. $globals.CollectionTest);
  2340. $core.addMethod(
  2341. $core.method({
  2342. selector: "testAddAll",
  2343. protocol: 'tests',
  2344. fn: function (){
  2345. var self=this;
  2346. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2347. return $core.withContext(function($ctx1) {
  2348. //>>excludeEnd("ctx");
  2349. var $2,$3,$5,$4,$6,$1,$7,$10,$9,$11,$12,$13,$8,$14,$17,$16,$18,$20,$19,$21,$15,$23,$24,$25,$26,$22,$27,$28,$29;
  2350. $2=self._collection();
  2351. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2352. $ctx1.sendIdx["collection"]=1;
  2353. //>>excludeEnd("ctx");
  2354. $3=$2;
  2355. $5=self._collectionClass();
  2356. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2357. $ctx1.sendIdx["collectionClass"]=1;
  2358. //>>excludeEnd("ctx");
  2359. $4=$recv($5)._new();
  2360. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2361. $ctx1.sendIdx["new"]=1;
  2362. //>>excludeEnd("ctx");
  2363. $recv($3)._addAll_($4);
  2364. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2365. $ctx1.sendIdx["addAll:"]=1;
  2366. //>>excludeEnd("ctx");
  2367. $6=$recv($2)._yourself();
  2368. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2369. $ctx1.sendIdx["yourself"]=1;
  2370. //>>excludeEnd("ctx");
  2371. $1=$6;
  2372. $7=self._collection();
  2373. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2374. $ctx1.sendIdx["collection"]=2;
  2375. //>>excludeEnd("ctx");
  2376. self._assert_equals_($1,$7);
  2377. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2378. $ctx1.sendIdx["assert:equals:"]=1;
  2379. //>>excludeEnd("ctx");
  2380. $10=self._collectionClass();
  2381. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2382. $ctx1.sendIdx["collectionClass"]=2;
  2383. //>>excludeEnd("ctx");
  2384. $9=$recv($10)._new();
  2385. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2386. $ctx1.sendIdx["new"]=2;
  2387. //>>excludeEnd("ctx");
  2388. $11=$9;
  2389. $12=self._collection();
  2390. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2391. $ctx1.sendIdx["collection"]=3;
  2392. //>>excludeEnd("ctx");
  2393. $recv($11)._addAll_($12);
  2394. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2395. $ctx1.sendIdx["addAll:"]=2;
  2396. //>>excludeEnd("ctx");
  2397. $13=$recv($9)._yourself();
  2398. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2399. $ctx1.sendIdx["yourself"]=2;
  2400. //>>excludeEnd("ctx");
  2401. $8=$13;
  2402. $14=self._collection();
  2403. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2404. $ctx1.sendIdx["collection"]=4;
  2405. //>>excludeEnd("ctx");
  2406. self._assert_equals_($8,$14);
  2407. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2408. $ctx1.sendIdx["assert:equals:"]=2;
  2409. //>>excludeEnd("ctx");
  2410. $17=self._collectionClass();
  2411. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2412. $ctx1.sendIdx["collectionClass"]=3;
  2413. //>>excludeEnd("ctx");
  2414. $16=$recv($17)._new();
  2415. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2416. $ctx1.sendIdx["new"]=3;
  2417. //>>excludeEnd("ctx");
  2418. $18=$16;
  2419. $20=self._collectionClass();
  2420. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2421. $ctx1.sendIdx["collectionClass"]=4;
  2422. //>>excludeEnd("ctx");
  2423. $19=$recv($20)._new();
  2424. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2425. $ctx1.sendIdx["new"]=4;
  2426. //>>excludeEnd("ctx");
  2427. $recv($18)._addAll_($19);
  2428. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2429. $ctx1.sendIdx["addAll:"]=3;
  2430. //>>excludeEnd("ctx");
  2431. $21=$recv($16)._yourself();
  2432. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2433. $ctx1.sendIdx["yourself"]=3;
  2434. //>>excludeEnd("ctx");
  2435. $15=$21;
  2436. self._assert_equals_($15,$recv(self._collectionClass())._new());
  2437. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2438. $ctx1.sendIdx["assert:equals:"]=3;
  2439. //>>excludeEnd("ctx");
  2440. $23=self._collection();
  2441. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2442. $ctx1.sendIdx["collection"]=5;
  2443. //>>excludeEnd("ctx");
  2444. $24=$23;
  2445. $25=self._sampleNewValueAsCollection();
  2446. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2447. $ctx1.sendIdx["sampleNewValueAsCollection"]=1;
  2448. //>>excludeEnd("ctx");
  2449. $recv($24)._addAll_($25);
  2450. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2451. $ctx1.sendIdx["addAll:"]=4;
  2452. //>>excludeEnd("ctx");
  2453. $26=$recv($23)._yourself();
  2454. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2455. $ctx1.sendIdx["yourself"]=4;
  2456. //>>excludeEnd("ctx");
  2457. $22=$26;
  2458. $27=self._collectionWithNewValue();
  2459. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2460. $ctx1.sendIdx["collectionWithNewValue"]=1;
  2461. //>>excludeEnd("ctx");
  2462. self._assert_equals_($22,$27);
  2463. $28=self._sampleNewValueAsCollection();
  2464. $recv($28)._addAll_(self._collection());
  2465. $29=$recv($28)._yourself();
  2466. self._assertSameContents_as_($29,self._collectionWithNewValue());
  2467. return self;
  2468. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2469. }, function($ctx1) {$ctx1.fill(self,"testAddAll",{},$globals.CollectionTest)});
  2470. //>>excludeEnd("ctx");
  2471. },
  2472. //>>excludeStart("ide", pragmas.excludeIdeData);
  2473. args: [],
  2474. 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",
  2475. referencedClasses: [],
  2476. //>>excludeEnd("ide");
  2477. messageSends: ["assert:equals:", "addAll:", "collection", "new", "collectionClass", "yourself", "sampleNewValueAsCollection", "collectionWithNewValue", "assertSameContents:as:"]
  2478. }),
  2479. $globals.CollectionTest);
  2480. $core.addMethod(
  2481. $core.method({
  2482. selector: "testAllSatisfy",
  2483. protocol: 'tests',
  2484. fn: function (){
  2485. var self=this;
  2486. var collection,anyOne;
  2487. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2488. return $core.withContext(function($ctx1) {
  2489. //>>excludeEnd("ctx");
  2490. var $1;
  2491. collection=self._collection();
  2492. anyOne=$recv(collection)._anyOne();
  2493. $1=$recv(collection)._allSatisfy_((function(each){
  2494. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2495. return $core.withContext(function($ctx2) {
  2496. //>>excludeEnd("ctx");
  2497. return $recv(collection)._includes_(each);
  2498. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2499. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2500. //>>excludeEnd("ctx");
  2501. }));
  2502. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2503. $ctx1.sendIdx["allSatisfy:"]=1;
  2504. //>>excludeEnd("ctx");
  2505. self._assert_($1);
  2506. self._deny_($recv(collection)._allSatisfy_((function(each){
  2507. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2508. return $core.withContext(function($ctx2) {
  2509. //>>excludeEnd("ctx");
  2510. return $recv(each).__tild_eq(anyOne);
  2511. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2512. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
  2513. //>>excludeEnd("ctx");
  2514. })));
  2515. return self;
  2516. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2517. }, function($ctx1) {$ctx1.fill(self,"testAllSatisfy",{collection:collection,anyOne:anyOne},$globals.CollectionTest)});
  2518. //>>excludeEnd("ctx");
  2519. },
  2520. //>>excludeStart("ide", pragmas.excludeIdeData);
  2521. args: [],
  2522. 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 ])",
  2523. referencedClasses: [],
  2524. //>>excludeEnd("ide");
  2525. messageSends: ["collection", "anyOne", "assert:", "allSatisfy:", "includes:", "deny:", "~="]
  2526. }),
  2527. $globals.CollectionTest);
  2528. $core.addMethod(
  2529. $core.method({
  2530. selector: "testAnyOne",
  2531. protocol: 'tests',
  2532. fn: function (){
  2533. var self=this;
  2534. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  2535. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2536. return $core.withContext(function($ctx1) {
  2537. //>>excludeEnd("ctx");
  2538. var $2,$1;
  2539. self._should_raise_((function(){
  2540. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2541. return $core.withContext(function($ctx2) {
  2542. //>>excludeEnd("ctx");
  2543. return $recv($recv(self._collectionClass())._new())._anyOne();
  2544. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2545. $ctx2.sendIdx["anyOne"]=1;
  2546. //>>excludeEnd("ctx");
  2547. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2548. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  2549. //>>excludeEnd("ctx");
  2550. }),$Error());
  2551. $2=self._collection();
  2552. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2553. $ctx1.sendIdx["collection"]=1;
  2554. //>>excludeEnd("ctx");
  2555. $1=$recv($2)._includes_($recv(self._collection())._anyOne());
  2556. self._assert_($1);
  2557. return self;
  2558. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2559. }, function($ctx1) {$ctx1.fill(self,"testAnyOne",{},$globals.CollectionTest)});
  2560. //>>excludeEnd("ctx");
  2561. },
  2562. //>>excludeStart("ide", pragmas.excludeIdeData);
  2563. args: [],
  2564. source: "testAnyOne\x0a\x09self should: [ self collectionClass new anyOne ] raise: Error.\x0a\x09self assert: (self collection includes: self collection anyOne)",
  2565. referencedClasses: ["Error"],
  2566. //>>excludeEnd("ide");
  2567. messageSends: ["should:raise:", "anyOne", "new", "collectionClass", "assert:", "includes:", "collection"]
  2568. }),
  2569. $globals.CollectionTest);
  2570. $core.addMethod(
  2571. $core.method({
  2572. selector: "testAnySatisfy",
  2573. protocol: 'tests',
  2574. fn: function (){
  2575. var self=this;
  2576. var anyOne;
  2577. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  2578. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2579. return $core.withContext(function($ctx1) {
  2580. //>>excludeEnd("ctx");
  2581. var $1,$3,$2;
  2582. $1=self._collection();
  2583. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2584. $ctx1.sendIdx["collection"]=1;
  2585. //>>excludeEnd("ctx");
  2586. anyOne=$recv($1)._anyOne();
  2587. $3=self._collection();
  2588. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2589. $ctx1.sendIdx["collection"]=2;
  2590. //>>excludeEnd("ctx");
  2591. $2=$recv($3)._anySatisfy_((function(each){
  2592. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2593. return $core.withContext(function($ctx2) {
  2594. //>>excludeEnd("ctx");
  2595. return $recv(each).__eq(anyOne);
  2596. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2597. $ctx2.sendIdx["="]=1;
  2598. //>>excludeEnd("ctx");
  2599. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2600. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2601. //>>excludeEnd("ctx");
  2602. }));
  2603. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2604. $ctx1.sendIdx["anySatisfy:"]=1;
  2605. //>>excludeEnd("ctx");
  2606. self._assert_($2);
  2607. self._deny_($recv(self._collection())._anySatisfy_((function(each){
  2608. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2609. return $core.withContext(function($ctx2) {
  2610. //>>excludeEnd("ctx");
  2611. return $recv(each).__eq($recv($Object())._new());
  2612. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2613. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
  2614. //>>excludeEnd("ctx");
  2615. })));
  2616. return self;
  2617. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2618. }, function($ctx1) {$ctx1.fill(self,"testAnySatisfy",{anyOne:anyOne},$globals.CollectionTest)});
  2619. //>>excludeEnd("ctx");
  2620. },
  2621. //>>excludeStart("ide", pragmas.excludeIdeData);
  2622. args: [],
  2623. 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 ])",
  2624. referencedClasses: ["Object"],
  2625. //>>excludeEnd("ide");
  2626. messageSends: ["anyOne", "collection", "assert:", "anySatisfy:", "=", "deny:", "new"]
  2627. }),
  2628. $globals.CollectionTest);
  2629. $core.addMethod(
  2630. $core.method({
  2631. selector: "testAsArray",
  2632. protocol: 'tests',
  2633. fn: function (){
  2634. var self=this;
  2635. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2636. return $core.withContext(function($ctx1) {
  2637. //>>excludeEnd("ctx");
  2638. var $1;
  2639. $1=self._collection();
  2640. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2641. $ctx1.sendIdx["collection"]=1;
  2642. //>>excludeEnd("ctx");
  2643. self._assertSameContents_as_($1,$recv(self._collection())._asArray());
  2644. return self;
  2645. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2646. }, function($ctx1) {$ctx1.fill(self,"testAsArray",{},$globals.CollectionTest)});
  2647. //>>excludeEnd("ctx");
  2648. },
  2649. //>>excludeStart("ide", pragmas.excludeIdeData);
  2650. args: [],
  2651. source: "testAsArray\x0a\x09self\x0a\x09\x09assertSameContents: self collection\x0a\x09\x09as: self collection asArray",
  2652. referencedClasses: [],
  2653. //>>excludeEnd("ide");
  2654. messageSends: ["assertSameContents:as:", "collection", "asArray"]
  2655. }),
  2656. $globals.CollectionTest);
  2657. $core.addMethod(
  2658. $core.method({
  2659. selector: "testAsOrderedCollection",
  2660. protocol: 'tests',
  2661. fn: function (){
  2662. var self=this;
  2663. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2664. return $core.withContext(function($ctx1) {
  2665. //>>excludeEnd("ctx");
  2666. var $1;
  2667. $1=self._collection();
  2668. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2669. $ctx1.sendIdx["collection"]=1;
  2670. //>>excludeEnd("ctx");
  2671. self._assertSameContents_as_($1,$recv(self._collection())._asOrderedCollection());
  2672. return self;
  2673. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2674. }, function($ctx1) {$ctx1.fill(self,"testAsOrderedCollection",{},$globals.CollectionTest)});
  2675. //>>excludeEnd("ctx");
  2676. },
  2677. //>>excludeStart("ide", pragmas.excludeIdeData);
  2678. args: [],
  2679. source: "testAsOrderedCollection\x0a\x09self\x0a\x09\x09assertSameContents: self collection\x0a\x09\x09as: self collection asOrderedCollection",
  2680. referencedClasses: [],
  2681. //>>excludeEnd("ide");
  2682. messageSends: ["assertSameContents:as:", "collection", "asOrderedCollection"]
  2683. }),
  2684. $globals.CollectionTest);
  2685. $core.addMethod(
  2686. $core.method({
  2687. selector: "testAsSet",
  2688. protocol: 'tests',
  2689. fn: function (){
  2690. var self=this;
  2691. var c,set;
  2692. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2693. return $core.withContext(function($ctx1) {
  2694. //>>excludeEnd("ctx");
  2695. c=self._collectionWithDuplicates();
  2696. set=$recv(c)._asSet();
  2697. self._assert_equals_($recv(set)._size(),(5));
  2698. $recv(c)._do_((function(each){
  2699. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2700. return $core.withContext(function($ctx2) {
  2701. //>>excludeEnd("ctx");
  2702. return self._assert_($recv(set)._includes_(each));
  2703. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2704. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2705. //>>excludeEnd("ctx");
  2706. }));
  2707. return self;
  2708. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2709. }, function($ctx1) {$ctx1.fill(self,"testAsSet",{c:c,set:set},$globals.CollectionTest)});
  2710. //>>excludeEnd("ctx");
  2711. },
  2712. //>>excludeStart("ide", pragmas.excludeIdeData);
  2713. args: [],
  2714. source: "testAsSet\x0a\x09| c set |\x0a\x09c := self collectionWithDuplicates.\x0a\x09set := c asSet.\x0a\x09self assert: set size equals: 5.\x0a\x09c do: [ :each |\x0a\x09\x09self assert: (set includes: each) ]",
  2715. referencedClasses: [],
  2716. //>>excludeEnd("ide");
  2717. messageSends: ["collectionWithDuplicates", "asSet", "assert:equals:", "size", "do:", "assert:", "includes:"]
  2718. }),
  2719. $globals.CollectionTest);
  2720. $core.addMethod(
  2721. $core.method({
  2722. selector: "testCollect",
  2723. protocol: 'tests',
  2724. fn: function (){
  2725. var self=this;
  2726. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2727. return $core.withContext(function($ctx1) {
  2728. //>>excludeEnd("ctx");
  2729. var $2,$1,$3,$5,$4,$8,$7,$6,$11,$10,$9;
  2730. $2=self._collection();
  2731. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2732. $ctx1.sendIdx["collection"]=1;
  2733. //>>excludeEnd("ctx");
  2734. $1=$recv($2)._collect_((function(each){
  2735. return each;
  2736. }));
  2737. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2738. $ctx1.sendIdx["collect:"]=1;
  2739. //>>excludeEnd("ctx");
  2740. $3=self._collection();
  2741. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2742. $ctx1.sendIdx["collection"]=2;
  2743. //>>excludeEnd("ctx");
  2744. self._assert_equals_($1,$3);
  2745. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2746. $ctx1.sendIdx["assert:equals:"]=1;
  2747. //>>excludeEnd("ctx");
  2748. $5=self._collectionWithNewValue();
  2749. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2750. $ctx1.sendIdx["collectionWithNewValue"]=1;
  2751. //>>excludeEnd("ctx");
  2752. $4=$recv($5)._collect_((function(each){
  2753. return each;
  2754. }));
  2755. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2756. $ctx1.sendIdx["collect:"]=2;
  2757. //>>excludeEnd("ctx");
  2758. self._assert_equals_($4,self._collectionWithNewValue());
  2759. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2760. $ctx1.sendIdx["assert:equals:"]=2;
  2761. //>>excludeEnd("ctx");
  2762. $8=self._collectionClass();
  2763. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2764. $ctx1.sendIdx["collectionClass"]=1;
  2765. //>>excludeEnd("ctx");
  2766. $7=$recv($8)._new();
  2767. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2768. $ctx1.sendIdx["new"]=1;
  2769. //>>excludeEnd("ctx");
  2770. $6=$recv($7)._collect_((function(each){
  2771. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2772. return $core.withContext(function($ctx2) {
  2773. //>>excludeEnd("ctx");
  2774. return $recv(each)._printString();
  2775. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2776. $ctx2.sendIdx["printString"]=1;
  2777. //>>excludeEnd("ctx");
  2778. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2779. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,3)});
  2780. //>>excludeEnd("ctx");
  2781. }));
  2782. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2783. $ctx1.sendIdx["collect:"]=3;
  2784. //>>excludeEnd("ctx");
  2785. self._assert_equals_($6,$recv(self._collectionClass())._new());
  2786. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2787. $ctx1.sendIdx["assert:equals:"]=3;
  2788. //>>excludeEnd("ctx");
  2789. $11=self._collection();
  2790. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2791. $ctx1.sendIdx["collection"]=3;
  2792. //>>excludeEnd("ctx");
  2793. $10=$recv($11)._collect_((function(){
  2794. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2795. return $core.withContext(function($ctx2) {
  2796. //>>excludeEnd("ctx");
  2797. return self._sampleNewValue();
  2798. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2799. $ctx2.sendIdx["sampleNewValue"]=1;
  2800. //>>excludeEnd("ctx");
  2801. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2802. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,4)});
  2803. //>>excludeEnd("ctx");
  2804. }));
  2805. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2806. $ctx1.sendIdx["collect:"]=4;
  2807. //>>excludeEnd("ctx");
  2808. $9=$recv($10)._detect_((function(){
  2809. return true;
  2810. }));
  2811. self._assert_equals_($9,self._sampleNewValue());
  2812. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2813. $ctx1.sendIdx["assert:equals:"]=4;
  2814. //>>excludeEnd("ctx");
  2815. self._assert_equals_($recv(self._collection())._collect_((function(each){
  2816. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2817. return $core.withContext(function($ctx2) {
  2818. //>>excludeEnd("ctx");
  2819. return $recv(each)._printString();
  2820. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2821. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,6)});
  2822. //>>excludeEnd("ctx");
  2823. })),self._collectionOfPrintStrings());
  2824. return self;
  2825. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2826. }, function($ctx1) {$ctx1.fill(self,"testCollect",{},$globals.CollectionTest)});
  2827. //>>excludeEnd("ctx");
  2828. },
  2829. //>>excludeStart("ide", pragmas.excludeIdeData);
  2830. args: [],
  2831. 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",
  2832. referencedClasses: [],
  2833. //>>excludeEnd("ide");
  2834. messageSends: ["assert:equals:", "collect:", "collection", "collectionWithNewValue", "new", "collectionClass", "printString", "detect:", "sampleNewValue", "collectionOfPrintStrings"]
  2835. }),
  2836. $globals.CollectionTest);
  2837. $core.addMethod(
  2838. $core.method({
  2839. selector: "testComma",
  2840. protocol: 'tests',
  2841. fn: function (){
  2842. var self=this;
  2843. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2844. return $core.withContext(function($ctx1) {
  2845. //>>excludeEnd("ctx");
  2846. var $2,$4,$3,$1,$5,$8,$7,$9,$6,$10,$13,$12,$15,$14,$11,$17,$18,$16,$19;
  2847. $2=self._collection();
  2848. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2849. $ctx1.sendIdx["collection"]=1;
  2850. //>>excludeEnd("ctx");
  2851. $4=self._collectionClass();
  2852. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2853. $ctx1.sendIdx["collectionClass"]=1;
  2854. //>>excludeEnd("ctx");
  2855. $3=$recv($4)._new();
  2856. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2857. $ctx1.sendIdx["new"]=1;
  2858. //>>excludeEnd("ctx");
  2859. $1=$recv($2).__comma($3);
  2860. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2861. $ctx1.sendIdx[","]=1;
  2862. //>>excludeEnd("ctx");
  2863. $5=self._collection();
  2864. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2865. $ctx1.sendIdx["collection"]=2;
  2866. //>>excludeEnd("ctx");
  2867. self._assert_equals_($1,$5);
  2868. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2869. $ctx1.sendIdx["assert:equals:"]=1;
  2870. //>>excludeEnd("ctx");
  2871. $8=self._collectionClass();
  2872. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2873. $ctx1.sendIdx["collectionClass"]=2;
  2874. //>>excludeEnd("ctx");
  2875. $7=$recv($8)._new();
  2876. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2877. $ctx1.sendIdx["new"]=2;
  2878. //>>excludeEnd("ctx");
  2879. $9=self._collection();
  2880. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2881. $ctx1.sendIdx["collection"]=3;
  2882. //>>excludeEnd("ctx");
  2883. $6=$recv($7).__comma($9);
  2884. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2885. $ctx1.sendIdx[","]=2;
  2886. //>>excludeEnd("ctx");
  2887. $10=self._collection();
  2888. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2889. $ctx1.sendIdx["collection"]=4;
  2890. //>>excludeEnd("ctx");
  2891. self._assert_equals_($6,$10);
  2892. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2893. $ctx1.sendIdx["assert:equals:"]=2;
  2894. //>>excludeEnd("ctx");
  2895. $13=self._collectionClass();
  2896. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2897. $ctx1.sendIdx["collectionClass"]=3;
  2898. //>>excludeEnd("ctx");
  2899. $12=$recv($13)._new();
  2900. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2901. $ctx1.sendIdx["new"]=3;
  2902. //>>excludeEnd("ctx");
  2903. $15=self._collectionClass();
  2904. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2905. $ctx1.sendIdx["collectionClass"]=4;
  2906. //>>excludeEnd("ctx");
  2907. $14=$recv($15)._new();
  2908. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2909. $ctx1.sendIdx["new"]=4;
  2910. //>>excludeEnd("ctx");
  2911. $11=$recv($12).__comma($14);
  2912. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2913. $ctx1.sendIdx[","]=3;
  2914. //>>excludeEnd("ctx");
  2915. self._assert_equals_($11,$recv(self._collectionClass())._new());
  2916. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2917. $ctx1.sendIdx["assert:equals:"]=3;
  2918. //>>excludeEnd("ctx");
  2919. $17=self._collection();
  2920. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2921. $ctx1.sendIdx["collection"]=5;
  2922. //>>excludeEnd("ctx");
  2923. $18=self._sampleNewValueAsCollection();
  2924. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2925. $ctx1.sendIdx["sampleNewValueAsCollection"]=1;
  2926. //>>excludeEnd("ctx");
  2927. $16=$recv($17).__comma($18);
  2928. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2929. $ctx1.sendIdx[","]=4;
  2930. //>>excludeEnd("ctx");
  2931. $19=self._collectionWithNewValue();
  2932. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2933. $ctx1.sendIdx["collectionWithNewValue"]=1;
  2934. //>>excludeEnd("ctx");
  2935. self._assert_equals_($16,$19);
  2936. self._assertSameContents_as_($recv(self._sampleNewValueAsCollection()).__comma(self._collection()),self._collectionWithNewValue());
  2937. return self;
  2938. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2939. }, function($ctx1) {$ctx1.fill(self,"testComma",{},$globals.CollectionTest)});
  2940. //>>excludeEnd("ctx");
  2941. },
  2942. //>>excludeStart("ide", pragmas.excludeIdeData);
  2943. args: [],
  2944. 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",
  2945. referencedClasses: [],
  2946. //>>excludeEnd("ide");
  2947. messageSends: ["assert:equals:", ",", "collection", "new", "collectionClass", "sampleNewValueAsCollection", "collectionWithNewValue", "assertSameContents:as:"]
  2948. }),
  2949. $globals.CollectionTest);
  2950. $core.addMethod(
  2951. $core.method({
  2952. selector: "testDetect",
  2953. protocol: 'tests',
  2954. fn: function (){
  2955. var self=this;
  2956. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  2957. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2958. return $core.withContext(function($ctx1) {
  2959. //>>excludeEnd("ctx");
  2960. var $1,$2,$3,$4,$6,$5,$7;
  2961. self._shouldnt_raise_((function(){
  2962. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2963. return $core.withContext(function($ctx2) {
  2964. //>>excludeEnd("ctx");
  2965. $1=self._collection();
  2966. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2967. $ctx2.sendIdx["collection"]=1;
  2968. //>>excludeEnd("ctx");
  2969. return $recv($1)._detect_((function(){
  2970. return true;
  2971. }));
  2972. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2973. $ctx2.sendIdx["detect:"]=1;
  2974. //>>excludeEnd("ctx");
  2975. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2976. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  2977. //>>excludeEnd("ctx");
  2978. }),$Error());
  2979. self._should_raise_((function(){
  2980. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2981. return $core.withContext(function($ctx2) {
  2982. //>>excludeEnd("ctx");
  2983. $2=self._collection();
  2984. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2985. $ctx2.sendIdx["collection"]=2;
  2986. //>>excludeEnd("ctx");
  2987. return $recv($2)._detect_((function(){
  2988. return false;
  2989. }));
  2990. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2991. $ctx2.sendIdx["detect:"]=2;
  2992. //>>excludeEnd("ctx");
  2993. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2994. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  2995. //>>excludeEnd("ctx");
  2996. }),$Error());
  2997. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2998. $ctx1.sendIdx["should:raise:"]=1;
  2999. //>>excludeEnd("ctx");
  3000. $3=$recv(self._sampleNewValueAsCollection())._detect_((function(){
  3001. return true;
  3002. }));
  3003. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3004. $ctx1.sendIdx["detect:"]=3;
  3005. //>>excludeEnd("ctx");
  3006. $4=self._sampleNewValue();
  3007. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3008. $ctx1.sendIdx["sampleNewValue"]=1;
  3009. //>>excludeEnd("ctx");
  3010. self._assert_equals_($3,$4);
  3011. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3012. $ctx1.sendIdx["assert:equals:"]=1;
  3013. //>>excludeEnd("ctx");
  3014. $5=$recv(self._collectionWithNewValue())._detect_((function(each){
  3015. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3016. return $core.withContext(function($ctx2) {
  3017. //>>excludeEnd("ctx");
  3018. $6=self._sampleNewValue();
  3019. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3020. $ctx2.sendIdx["sampleNewValue"]=2;
  3021. //>>excludeEnd("ctx");
  3022. return $recv(each).__eq($6);
  3023. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3024. $ctx2.sendIdx["="]=1;
  3025. //>>excludeEnd("ctx");
  3026. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3027. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,6)});
  3028. //>>excludeEnd("ctx");
  3029. }));
  3030. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3031. $ctx1.sendIdx["detect:"]=4;
  3032. //>>excludeEnd("ctx");
  3033. $7=self._sampleNewValue();
  3034. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3035. $ctx1.sendIdx["sampleNewValue"]=3;
  3036. //>>excludeEnd("ctx");
  3037. self._assert_equals_($5,$7);
  3038. self._should_raise_((function(){
  3039. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3040. return $core.withContext(function($ctx2) {
  3041. //>>excludeEnd("ctx");
  3042. return $recv(self._collection())._detect_((function(each){
  3043. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3044. return $core.withContext(function($ctx3) {
  3045. //>>excludeEnd("ctx");
  3046. return $recv(each).__eq(self._sampleNewValue());
  3047. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3048. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,8)});
  3049. //>>excludeEnd("ctx");
  3050. }));
  3051. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3052. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,7)});
  3053. //>>excludeEnd("ctx");
  3054. }),$Error());
  3055. return self;
  3056. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3057. }, function($ctx1) {$ctx1.fill(self,"testDetect",{},$globals.CollectionTest)});
  3058. //>>excludeEnd("ctx");
  3059. },
  3060. //>>excludeStart("ide", pragmas.excludeIdeData);
  3061. args: [],
  3062. 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",
  3063. referencedClasses: ["Error"],
  3064. //>>excludeEnd("ide");
  3065. messageSends: ["shouldnt:raise:", "detect:", "collection", "should:raise:", "assert:equals:", "sampleNewValueAsCollection", "sampleNewValue", "collectionWithNewValue", "="]
  3066. }),
  3067. $globals.CollectionTest);
  3068. $core.addMethod(
  3069. $core.method({
  3070. selector: "testDetectIfNone",
  3071. protocol: 'tests',
  3072. fn: function (){
  3073. var self=this;
  3074. var sentinel;
  3075. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  3076. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3077. return $core.withContext(function($ctx1) {
  3078. //>>excludeEnd("ctx");
  3079. var $3,$2,$1,$5,$4,$6,$7,$9,$8,$10;
  3080. sentinel=$recv($Object())._new();
  3081. $3=self._collection();
  3082. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3083. $ctx1.sendIdx["collection"]=1;
  3084. //>>excludeEnd("ctx");
  3085. $2=$recv($3)._detect_ifNone_((function(){
  3086. return true;
  3087. }),(function(){
  3088. return sentinel;
  3089. }));
  3090. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3091. $ctx1.sendIdx["detect:ifNone:"]=1;
  3092. //>>excludeEnd("ctx");
  3093. $1=$recv($2).__tild_eq(sentinel);
  3094. self._assert_($1);
  3095. $5=self._collection();
  3096. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3097. $ctx1.sendIdx["collection"]=2;
  3098. //>>excludeEnd("ctx");
  3099. $4=$recv($5)._detect_ifNone_((function(){
  3100. return false;
  3101. }),(function(){
  3102. return sentinel;
  3103. }));
  3104. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3105. $ctx1.sendIdx["detect:ifNone:"]=2;
  3106. //>>excludeEnd("ctx");
  3107. self._assert_equals_($4,sentinel);
  3108. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3109. $ctx1.sendIdx["assert:equals:"]=1;
  3110. //>>excludeEnd("ctx");
  3111. $6=$recv(self._sampleNewValueAsCollection())._detect_ifNone_((function(){
  3112. return true;
  3113. }),(function(){
  3114. return sentinel;
  3115. }));
  3116. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3117. $ctx1.sendIdx["detect:ifNone:"]=3;
  3118. //>>excludeEnd("ctx");
  3119. $7=self._sampleNewValue();
  3120. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3121. $ctx1.sendIdx["sampleNewValue"]=1;
  3122. //>>excludeEnd("ctx");
  3123. self._assert_equals_($6,$7);
  3124. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3125. $ctx1.sendIdx["assert:equals:"]=2;
  3126. //>>excludeEnd("ctx");
  3127. $8=$recv(self._collectionWithNewValue())._detect_ifNone_((function(each){
  3128. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3129. return $core.withContext(function($ctx2) {
  3130. //>>excludeEnd("ctx");
  3131. $9=self._sampleNewValue();
  3132. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3133. $ctx2.sendIdx["sampleNewValue"]=2;
  3134. //>>excludeEnd("ctx");
  3135. return $recv(each).__eq($9);
  3136. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3137. $ctx2.sendIdx["="]=1;
  3138. //>>excludeEnd("ctx");
  3139. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3140. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,7)});
  3141. //>>excludeEnd("ctx");
  3142. }),(function(){
  3143. return sentinel;
  3144. }));
  3145. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3146. $ctx1.sendIdx["detect:ifNone:"]=4;
  3147. //>>excludeEnd("ctx");
  3148. $10=self._sampleNewValue();
  3149. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3150. $ctx1.sendIdx["sampleNewValue"]=3;
  3151. //>>excludeEnd("ctx");
  3152. self._assert_equals_($8,$10);
  3153. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3154. $ctx1.sendIdx["assert:equals:"]=3;
  3155. //>>excludeEnd("ctx");
  3156. self._assert_equals_($recv(self._collection())._detect_ifNone_((function(each){
  3157. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3158. return $core.withContext(function($ctx2) {
  3159. //>>excludeEnd("ctx");
  3160. return $recv(each).__eq(self._sampleNewValue());
  3161. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3162. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,9)});
  3163. //>>excludeEnd("ctx");
  3164. }),(function(){
  3165. return sentinel;
  3166. })),sentinel);
  3167. return self;
  3168. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3169. }, function($ctx1) {$ctx1.fill(self,"testDetectIfNone",{sentinel:sentinel},$globals.CollectionTest)});
  3170. //>>excludeEnd("ctx");
  3171. },
  3172. //>>excludeStart("ide", pragmas.excludeIdeData);
  3173. args: [],
  3174. 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",
  3175. referencedClasses: ["Object"],
  3176. //>>excludeEnd("ide");
  3177. messageSends: ["new", "assert:", "~=", "detect:ifNone:", "collection", "assert:equals:", "sampleNewValueAsCollection", "sampleNewValue", "collectionWithNewValue", "="]
  3178. }),
  3179. $globals.CollectionTest);
  3180. $core.addMethod(
  3181. $core.method({
  3182. selector: "testDo",
  3183. protocol: 'tests',
  3184. fn: function (){
  3185. var self=this;
  3186. var newCollection;
  3187. function $OrderedCollection(){return $globals.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  3188. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3189. return $core.withContext(function($ctx1) {
  3190. //>>excludeEnd("ctx");
  3191. var $1,$2;
  3192. newCollection=$recv($OrderedCollection())._new();
  3193. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3194. $ctx1.sendIdx["new"]=1;
  3195. //>>excludeEnd("ctx");
  3196. $1=self._collection();
  3197. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3198. $ctx1.sendIdx["collection"]=1;
  3199. //>>excludeEnd("ctx");
  3200. $recv($1)._do_((function(each){
  3201. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3202. return $core.withContext(function($ctx2) {
  3203. //>>excludeEnd("ctx");
  3204. return $recv(newCollection)._add_(each);
  3205. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3206. $ctx2.sendIdx["add:"]=1;
  3207. //>>excludeEnd("ctx");
  3208. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3209. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  3210. //>>excludeEnd("ctx");
  3211. }));
  3212. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3213. $ctx1.sendIdx["do:"]=1;
  3214. //>>excludeEnd("ctx");
  3215. self._assertSameContents_as_(self._collection(),newCollection);
  3216. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3217. $ctx1.sendIdx["assertSameContents:as:"]=1;
  3218. //>>excludeEnd("ctx");
  3219. newCollection=$recv($OrderedCollection())._new();
  3220. $2=self._collectionWithDuplicates();
  3221. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3222. $ctx1.sendIdx["collectionWithDuplicates"]=1;
  3223. //>>excludeEnd("ctx");
  3224. $recv($2)._do_((function(each){
  3225. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3226. return $core.withContext(function($ctx2) {
  3227. //>>excludeEnd("ctx");
  3228. return $recv(newCollection)._add_(each);
  3229. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3230. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
  3231. //>>excludeEnd("ctx");
  3232. }));
  3233. self._assertSameContents_as_(self._collectionWithDuplicates(),newCollection);
  3234. return self;
  3235. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3236. }, function($ctx1) {$ctx1.fill(self,"testDo",{newCollection:newCollection},$globals.CollectionTest)});
  3237. //>>excludeEnd("ctx");
  3238. },
  3239. //>>excludeStart("ide", pragmas.excludeIdeData);
  3240. args: [],
  3241. 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",
  3242. referencedClasses: ["OrderedCollection"],
  3243. //>>excludeEnd("ide");
  3244. messageSends: ["new", "do:", "collection", "add:", "assertSameContents:as:", "collectionWithDuplicates"]
  3245. }),
  3246. $globals.CollectionTest);
  3247. $core.addMethod(
  3248. $core.method({
  3249. selector: "testIfEmptyFamily",
  3250. protocol: 'tests',
  3251. fn: function (){
  3252. var self=this;
  3253. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3254. return $core.withContext(function($ctx1) {
  3255. //>>excludeEnd("ctx");
  3256. 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;
  3257. $3=self._collectionClass();
  3258. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3259. $ctx1.sendIdx["collectionClass"]=1;
  3260. //>>excludeEnd("ctx");
  3261. $2=$recv($3)._new();
  3262. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3263. $ctx1.sendIdx["new"]=1;
  3264. //>>excludeEnd("ctx");
  3265. $1=$recv($2)._ifEmpty_((function(){
  3266. return (42);
  3267. }));
  3268. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3269. $ctx1.sendIdx["ifEmpty:"]=1;
  3270. //>>excludeEnd("ctx");
  3271. self._assert_equals_($1,(42));
  3272. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3273. $ctx1.sendIdx["assert:equals:"]=1;
  3274. //>>excludeEnd("ctx");
  3275. $5=self._collection();
  3276. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3277. $ctx1.sendIdx["collection"]=1;
  3278. //>>excludeEnd("ctx");
  3279. $4=$recv($5)._ifEmpty_((function(){
  3280. return (42);
  3281. }));
  3282. $6=self._collection();
  3283. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3284. $ctx1.sendIdx["collection"]=2;
  3285. //>>excludeEnd("ctx");
  3286. self._assert_equals_($4,$6);
  3287. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3288. $ctx1.sendIdx["assert:equals:"]=2;
  3289. //>>excludeEnd("ctx");
  3290. $9=self._collectionClass();
  3291. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3292. $ctx1.sendIdx["collectionClass"]=2;
  3293. //>>excludeEnd("ctx");
  3294. $8=$recv($9)._new();
  3295. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3296. $ctx1.sendIdx["new"]=2;
  3297. //>>excludeEnd("ctx");
  3298. $7=$recv($8)._ifNotEmpty_((function(){
  3299. return (42);
  3300. }));
  3301. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3302. $ctx1.sendIdx["ifNotEmpty:"]=1;
  3303. //>>excludeEnd("ctx");
  3304. $11=self._collectionClass();
  3305. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3306. $ctx1.sendIdx["collectionClass"]=3;
  3307. //>>excludeEnd("ctx");
  3308. $10=$recv($11)._new();
  3309. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3310. $ctx1.sendIdx["new"]=3;
  3311. //>>excludeEnd("ctx");
  3312. self._assert_equals_($7,$10);
  3313. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3314. $ctx1.sendIdx["assert:equals:"]=3;
  3315. //>>excludeEnd("ctx");
  3316. $13=self._collection();
  3317. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3318. $ctx1.sendIdx["collection"]=3;
  3319. //>>excludeEnd("ctx");
  3320. $12=$recv($13)._ifNotEmpty_((function(){
  3321. return (42);
  3322. }));
  3323. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3324. $ctx1.sendIdx["ifNotEmpty:"]=2;
  3325. //>>excludeEnd("ctx");
  3326. self._assert_equals_($12,(42));
  3327. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3328. $ctx1.sendIdx["assert:equals:"]=4;
  3329. //>>excludeEnd("ctx");
  3330. $15=self._collection();
  3331. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3332. $ctx1.sendIdx["collection"]=4;
  3333. //>>excludeEnd("ctx");
  3334. $14=$recv($15)._ifNotEmpty_((function(col){
  3335. return col;
  3336. }));
  3337. $16=self._collection();
  3338. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3339. $ctx1.sendIdx["collection"]=5;
  3340. //>>excludeEnd("ctx");
  3341. self._assert_equals_($14,$16);
  3342. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3343. $ctx1.sendIdx["assert:equals:"]=5;
  3344. //>>excludeEnd("ctx");
  3345. $19=self._collectionClass();
  3346. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3347. $ctx1.sendIdx["collectionClass"]=4;
  3348. //>>excludeEnd("ctx");
  3349. $18=$recv($19)._new();
  3350. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3351. $ctx1.sendIdx["new"]=4;
  3352. //>>excludeEnd("ctx");
  3353. $17=$recv($18)._ifEmpty_ifNotEmpty_((function(){
  3354. return (42);
  3355. }),(function(){
  3356. return (999);
  3357. }));
  3358. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3359. $ctx1.sendIdx["ifEmpty:ifNotEmpty:"]=1;
  3360. //>>excludeEnd("ctx");
  3361. self._assert_equals_($17,(42));
  3362. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3363. $ctx1.sendIdx["assert:equals:"]=6;
  3364. //>>excludeEnd("ctx");
  3365. $21=self._collection();
  3366. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3367. $ctx1.sendIdx["collection"]=6;
  3368. //>>excludeEnd("ctx");
  3369. $20=$recv($21)._ifEmpty_ifNotEmpty_((function(){
  3370. return (42);
  3371. }),(function(){
  3372. return (999);
  3373. }));
  3374. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3375. $ctx1.sendIdx["ifEmpty:ifNotEmpty:"]=2;
  3376. //>>excludeEnd("ctx");
  3377. self._assert_equals_($20,(999));
  3378. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3379. $ctx1.sendIdx["assert:equals:"]=7;
  3380. //>>excludeEnd("ctx");
  3381. $23=self._collection();
  3382. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3383. $ctx1.sendIdx["collection"]=7;
  3384. //>>excludeEnd("ctx");
  3385. $22=$recv($23)._ifEmpty_ifNotEmpty_((function(){
  3386. return (42);
  3387. }),(function(col){
  3388. return col;
  3389. }));
  3390. $24=self._collection();
  3391. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3392. $ctx1.sendIdx["collection"]=8;
  3393. //>>excludeEnd("ctx");
  3394. self._assert_equals_($22,$24);
  3395. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3396. $ctx1.sendIdx["assert:equals:"]=8;
  3397. //>>excludeEnd("ctx");
  3398. $25=$recv($recv(self._collectionClass())._new())._ifNotEmpty_ifEmpty_((function(){
  3399. return (42);
  3400. }),(function(){
  3401. return (999);
  3402. }));
  3403. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3404. $ctx1.sendIdx["ifNotEmpty:ifEmpty:"]=1;
  3405. //>>excludeEnd("ctx");
  3406. self._assert_equals_($25,(999));
  3407. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3408. $ctx1.sendIdx["assert:equals:"]=9;
  3409. //>>excludeEnd("ctx");
  3410. $27=self._collection();
  3411. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3412. $ctx1.sendIdx["collection"]=9;
  3413. //>>excludeEnd("ctx");
  3414. $26=$recv($27)._ifNotEmpty_ifEmpty_((function(){
  3415. return (42);
  3416. }),(function(){
  3417. return (999);
  3418. }));
  3419. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3420. $ctx1.sendIdx["ifNotEmpty:ifEmpty:"]=2;
  3421. //>>excludeEnd("ctx");
  3422. self._assert_equals_($26,(42));
  3423. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3424. $ctx1.sendIdx["assert:equals:"]=10;
  3425. //>>excludeEnd("ctx");
  3426. $29=self._collection();
  3427. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3428. $ctx1.sendIdx["collection"]=10;
  3429. //>>excludeEnd("ctx");
  3430. $28=$recv($29)._ifNotEmpty_ifEmpty_((function(col){
  3431. return col;
  3432. }),(function(){
  3433. return (999);
  3434. }));
  3435. self._assert_equals_($28,self._collection());
  3436. return self;
  3437. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3438. }, function($ctx1) {$ctx1.fill(self,"testIfEmptyFamily",{},$globals.CollectionTest)});
  3439. //>>excludeEnd("ctx");
  3440. },
  3441. //>>excludeStart("ide", pragmas.excludeIdeData);
  3442. args: [],
  3443. 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.",
  3444. referencedClasses: [],
  3445. //>>excludeEnd("ide");
  3446. messageSends: ["assert:equals:", "ifEmpty:", "new", "collectionClass", "collection", "ifNotEmpty:", "ifEmpty:ifNotEmpty:", "ifNotEmpty:ifEmpty:"]
  3447. }),
  3448. $globals.CollectionTest);
  3449. $core.addMethod(
  3450. $core.method({
  3451. selector: "testIsEmpty",
  3452. protocol: 'tests',
  3453. fn: function (){
  3454. var self=this;
  3455. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3456. return $core.withContext(function($ctx1) {
  3457. //>>excludeEnd("ctx");
  3458. var $1;
  3459. $1=$recv($recv(self._collectionClass())._new())._isEmpty();
  3460. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3461. $ctx1.sendIdx["isEmpty"]=1;
  3462. //>>excludeEnd("ctx");
  3463. self._assert_($1);
  3464. self._deny_($recv(self._collection())._isEmpty());
  3465. return self;
  3466. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3467. }, function($ctx1) {$ctx1.fill(self,"testIsEmpty",{},$globals.CollectionTest)});
  3468. //>>excludeEnd("ctx");
  3469. },
  3470. //>>excludeStart("ide", pragmas.excludeIdeData);
  3471. args: [],
  3472. source: "testIsEmpty\x0a\x09self assert: self collectionClass new isEmpty.\x0a\x09self deny: self collection isEmpty",
  3473. referencedClasses: [],
  3474. //>>excludeEnd("ide");
  3475. messageSends: ["assert:", "isEmpty", "new", "collectionClass", "deny:", "collection"]
  3476. }),
  3477. $globals.CollectionTest);
  3478. $core.addMethod(
  3479. $core.method({
  3480. selector: "testNoneSatisfy",
  3481. protocol: 'tests',
  3482. fn: function (){
  3483. var self=this;
  3484. var anyOne;
  3485. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  3486. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3487. return $core.withContext(function($ctx1) {
  3488. //>>excludeEnd("ctx");
  3489. var $1,$3,$2;
  3490. $1=self._collection();
  3491. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3492. $ctx1.sendIdx["collection"]=1;
  3493. //>>excludeEnd("ctx");
  3494. anyOne=$recv($1)._anyOne();
  3495. $3=self._collection();
  3496. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3497. $ctx1.sendIdx["collection"]=2;
  3498. //>>excludeEnd("ctx");
  3499. $2=$recv($3)._noneSatisfy_((function(each){
  3500. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3501. return $core.withContext(function($ctx2) {
  3502. //>>excludeEnd("ctx");
  3503. return $recv(each).__eq(anyOne);
  3504. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3505. $ctx2.sendIdx["="]=1;
  3506. //>>excludeEnd("ctx");
  3507. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3508. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  3509. //>>excludeEnd("ctx");
  3510. }));
  3511. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3512. $ctx1.sendIdx["noneSatisfy:"]=1;
  3513. //>>excludeEnd("ctx");
  3514. self._deny_($2);
  3515. self._assert_($recv(self._collection())._noneSatisfy_((function(each){
  3516. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3517. return $core.withContext(function($ctx2) {
  3518. //>>excludeEnd("ctx");
  3519. return $recv(each).__eq($recv($Object())._new());
  3520. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3521. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
  3522. //>>excludeEnd("ctx");
  3523. })));
  3524. return self;
  3525. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3526. }, function($ctx1) {$ctx1.fill(self,"testNoneSatisfy",{anyOne:anyOne},$globals.CollectionTest)});
  3527. //>>excludeEnd("ctx");
  3528. },
  3529. //>>excludeStart("ide", pragmas.excludeIdeData);
  3530. args: [],
  3531. 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 ])",
  3532. referencedClasses: ["Object"],
  3533. //>>excludeEnd("ide");
  3534. messageSends: ["anyOne", "collection", "deny:", "noneSatisfy:", "=", "assert:", "new"]
  3535. }),
  3536. $globals.CollectionTest);
  3537. $core.addMethod(
  3538. $core.method({
  3539. selector: "testRemoveAll",
  3540. protocol: 'tests',
  3541. fn: function (){
  3542. var self=this;
  3543. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3544. return $core.withContext(function($ctx1) {
  3545. //>>excludeEnd("ctx");
  3546. var $1,$2;
  3547. $1=self._collection();
  3548. $recv($1)._removeAll();
  3549. $2=$recv($1)._yourself();
  3550. self._assert_equals_($2,$recv(self._collectionClass())._new());
  3551. return self;
  3552. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3553. }, function($ctx1) {$ctx1.fill(self,"testRemoveAll",{},$globals.CollectionTest)});
  3554. //>>excludeEnd("ctx");
  3555. },
  3556. //>>excludeStart("ide", pragmas.excludeIdeData);
  3557. args: [],
  3558. source: "testRemoveAll\x0a\x09self assert: (self collection removeAll; yourself) equals: self collectionClass new",
  3559. referencedClasses: [],
  3560. //>>excludeEnd("ide");
  3561. messageSends: ["assert:equals:", "removeAll", "collection", "yourself", "new", "collectionClass"]
  3562. }),
  3563. $globals.CollectionTest);
  3564. $core.addMethod(
  3565. $core.method({
  3566. selector: "testRemoveSome",
  3567. protocol: 'tests',
  3568. fn: function (){
  3569. var self=this;
  3570. var original,part;
  3571. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3572. return $core.withContext(function($ctx1) {
  3573. //>>excludeEnd("ctx");
  3574. var $1,$2;
  3575. original=[(1), (2), (3), (4), (5), (6), (7), (8), (9)];
  3576. part=[(2), (4), (6)];
  3577. $1=self._collection();
  3578. $recv($1)._removeAll();
  3579. $2=$recv($1)._yourself();
  3580. self._assert_equals_($2,$recv(self._collectionClass())._new());
  3581. return self;
  3582. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3583. }, function($ctx1) {$ctx1.fill(self,"testRemoveSome",{original:original,part:part},$globals.CollectionTest)});
  3584. //>>excludeEnd("ctx");
  3585. },
  3586. //>>excludeStart("ide", pragmas.excludeIdeData);
  3587. args: [],
  3588. source: "testRemoveSome\x0a\x0a\x09| original part |\x0a\x09\x0a\x09original := #( 1 2 3 4 5 6 7 8 9 ).\x0a\x09part := #( 2 4 6 ).\x0a\x09\x0a\x09\x0a\x09self assert: (self collection removeAll; yourself) equals: self collectionClass new",
  3589. referencedClasses: [],
  3590. //>>excludeEnd("ide");
  3591. messageSends: ["assert:equals:", "removeAll", "collection", "yourself", "new", "collectionClass"]
  3592. }),
  3593. $globals.CollectionTest);
  3594. $core.addMethod(
  3595. $core.method({
  3596. selector: "testSelect",
  3597. protocol: 'tests',
  3598. fn: function (){
  3599. var self=this;
  3600. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3601. return $core.withContext(function($ctx1) {
  3602. //>>excludeEnd("ctx");
  3603. var $2,$1,$4,$3,$6,$5,$7,$9,$10,$8,$12,$13,$11,$14,$16,$17,$15;
  3604. $2=self._collection();
  3605. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3606. $ctx1.sendIdx["collection"]=1;
  3607. //>>excludeEnd("ctx");
  3608. $1=$recv($2)._select_((function(){
  3609. return false;
  3610. }));
  3611. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3612. $ctx1.sendIdx["select:"]=1;
  3613. //>>excludeEnd("ctx");
  3614. $4=self._collectionClass();
  3615. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3616. $ctx1.sendIdx["collectionClass"]=1;
  3617. //>>excludeEnd("ctx");
  3618. $3=$recv($4)._new();
  3619. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3620. $ctx1.sendIdx["new"]=1;
  3621. //>>excludeEnd("ctx");
  3622. self._assert_equals_($1,$3);
  3623. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3624. $ctx1.sendIdx["assert:equals:"]=1;
  3625. //>>excludeEnd("ctx");
  3626. $6=self._collection();
  3627. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3628. $ctx1.sendIdx["collection"]=2;
  3629. //>>excludeEnd("ctx");
  3630. $5=$recv($6)._select_((function(){
  3631. return true;
  3632. }));
  3633. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3634. $ctx1.sendIdx["select:"]=2;
  3635. //>>excludeEnd("ctx");
  3636. $7=self._collection();
  3637. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3638. $ctx1.sendIdx["collection"]=3;
  3639. //>>excludeEnd("ctx");
  3640. self._assert_equals_($5,$7);
  3641. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3642. $ctx1.sendIdx["assert:equals:"]=2;
  3643. //>>excludeEnd("ctx");
  3644. $9=self._collectionWithNewValue();
  3645. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3646. $ctx1.sendIdx["collectionWithNewValue"]=1;
  3647. //>>excludeEnd("ctx");
  3648. $8=$recv($9)._select_((function(each){
  3649. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3650. return $core.withContext(function($ctx2) {
  3651. //>>excludeEnd("ctx");
  3652. $10=self._sampleNewValue();
  3653. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3654. $ctx2.sendIdx["sampleNewValue"]=1;
  3655. //>>excludeEnd("ctx");
  3656. return $recv(each).__eq($10);
  3657. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3658. $ctx2.sendIdx["="]=1;
  3659. //>>excludeEnd("ctx");
  3660. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3661. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,3)});
  3662. //>>excludeEnd("ctx");
  3663. }));
  3664. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3665. $ctx1.sendIdx["select:"]=3;
  3666. //>>excludeEnd("ctx");
  3667. self._assert_equals_($8,self._sampleNewValueAsCollection());
  3668. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3669. $ctx1.sendIdx["assert:equals:"]=3;
  3670. //>>excludeEnd("ctx");
  3671. $12=self._collectionWithNewValue();
  3672. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3673. $ctx1.sendIdx["collectionWithNewValue"]=2;
  3674. //>>excludeEnd("ctx");
  3675. $11=$recv($12)._select_((function(each){
  3676. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3677. return $core.withContext(function($ctx2) {
  3678. //>>excludeEnd("ctx");
  3679. $13=self._sampleNewValue();
  3680. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3681. $ctx2.sendIdx["sampleNewValue"]=2;
  3682. //>>excludeEnd("ctx");
  3683. return $recv(each).__tild_eq($13);
  3684. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3685. $ctx2.sendIdx["~="]=1;
  3686. //>>excludeEnd("ctx");
  3687. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3688. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,4)});
  3689. //>>excludeEnd("ctx");
  3690. }));
  3691. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3692. $ctx1.sendIdx["select:"]=4;
  3693. //>>excludeEnd("ctx");
  3694. $14=self._collection();
  3695. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3696. $ctx1.sendIdx["collection"]=4;
  3697. //>>excludeEnd("ctx");
  3698. self._assert_equals_($11,$14);
  3699. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3700. $ctx1.sendIdx["assert:equals:"]=4;
  3701. //>>excludeEnd("ctx");
  3702. $16=self._collection();
  3703. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3704. $ctx1.sendIdx["collection"]=5;
  3705. //>>excludeEnd("ctx");
  3706. $15=$recv($16)._select_((function(each){
  3707. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3708. return $core.withContext(function($ctx2) {
  3709. //>>excludeEnd("ctx");
  3710. $17=self._sampleNewValue();
  3711. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3712. $ctx2.sendIdx["sampleNewValue"]=3;
  3713. //>>excludeEnd("ctx");
  3714. return $recv(each).__eq($17);
  3715. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3716. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,5)});
  3717. //>>excludeEnd("ctx");
  3718. }));
  3719. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3720. $ctx1.sendIdx["select:"]=5;
  3721. //>>excludeEnd("ctx");
  3722. self._assert_equals_($15,$recv(self._collectionClass())._new());
  3723. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3724. $ctx1.sendIdx["assert:equals:"]=5;
  3725. //>>excludeEnd("ctx");
  3726. self._assert_equals_($recv(self._collectionWithNewValue())._select_((function(each){
  3727. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3728. return $core.withContext(function($ctx2) {
  3729. //>>excludeEnd("ctx");
  3730. return $recv(each).__tild_eq(self._sampleNewValue());
  3731. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3732. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,6)});
  3733. //>>excludeEnd("ctx");
  3734. })),self._collection());
  3735. return self;
  3736. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3737. }, function($ctx1) {$ctx1.fill(self,"testSelect",{},$globals.CollectionTest)});
  3738. //>>excludeEnd("ctx");
  3739. },
  3740. //>>excludeStart("ide", pragmas.excludeIdeData);
  3741. args: [],
  3742. 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",
  3743. referencedClasses: [],
  3744. //>>excludeEnd("ide");
  3745. messageSends: ["assert:equals:", "select:", "collection", "new", "collectionClass", "collectionWithNewValue", "=", "sampleNewValue", "sampleNewValueAsCollection", "~="]
  3746. }),
  3747. $globals.CollectionTest);
  3748. $core.addMethod(
  3749. $core.method({
  3750. selector: "testSize",
  3751. protocol: 'tests',
  3752. fn: function (){
  3753. var self=this;
  3754. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3755. return $core.withContext(function($ctx1) {
  3756. //>>excludeEnd("ctx");
  3757. var $1,$2;
  3758. $1=$recv($recv(self._collectionClass())._new())._size();
  3759. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3760. $ctx1.sendIdx["size"]=1;
  3761. //>>excludeEnd("ctx");
  3762. self._assert_equals_($1,(0));
  3763. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3764. $ctx1.sendIdx["assert:equals:"]=1;
  3765. //>>excludeEnd("ctx");
  3766. $2=$recv(self._sampleNewValueAsCollection())._size();
  3767. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3768. $ctx1.sendIdx["size"]=2;
  3769. //>>excludeEnd("ctx");
  3770. self._assert_equals_($2,(1));
  3771. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3772. $ctx1.sendIdx["assert:equals:"]=2;
  3773. //>>excludeEnd("ctx");
  3774. self._assert_equals_($recv(self._collection())._size(),self._collectionSize());
  3775. return self;
  3776. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3777. }, function($ctx1) {$ctx1.fill(self,"testSize",{},$globals.CollectionTest)});
  3778. //>>excludeEnd("ctx");
  3779. },
  3780. //>>excludeStart("ide", pragmas.excludeIdeData);
  3781. args: [],
  3782. 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",
  3783. referencedClasses: [],
  3784. //>>excludeEnd("ide");
  3785. messageSends: ["assert:equals:", "size", "new", "collectionClass", "sampleNewValueAsCollection", "collection", "collectionSize"]
  3786. }),
  3787. $globals.CollectionTest);
  3788. $core.addMethod(
  3789. $core.method({
  3790. selector: "collectionClass",
  3791. protocol: 'fixture',
  3792. fn: function (){
  3793. var self=this;
  3794. return nil;
  3795. },
  3796. //>>excludeStart("ide", pragmas.excludeIdeData);
  3797. args: [],
  3798. source: "collectionClass\x0a\x09\x22Answers class of collection type tested,\x0a\x09or nil if test is abstract\x22\x0a\x0a\x09^ nil",
  3799. referencedClasses: [],
  3800. //>>excludeEnd("ide");
  3801. messageSends: []
  3802. }),
  3803. $globals.CollectionTest.klass);
  3804. $core.addMethod(
  3805. $core.method({
  3806. selector: "isAbstract",
  3807. protocol: 'testing',
  3808. fn: function (){
  3809. var self=this;
  3810. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3811. return $core.withContext(function($ctx1) {
  3812. //>>excludeEnd("ctx");
  3813. var $1;
  3814. $1=$recv(self._collectionClass())._isNil();
  3815. return $1;
  3816. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3817. }, function($ctx1) {$ctx1.fill(self,"isAbstract",{},$globals.CollectionTest.klass)});
  3818. //>>excludeEnd("ctx");
  3819. },
  3820. //>>excludeStart("ide", pragmas.excludeIdeData);
  3821. args: [],
  3822. source: "isAbstract\x0a\x09^ self collectionClass isNil",
  3823. referencedClasses: [],
  3824. //>>excludeEnd("ide");
  3825. messageSends: ["isNil", "collectionClass"]
  3826. }),
  3827. $globals.CollectionTest.klass);
  3828. $core.addClass('IndexableCollectionTest', $globals.CollectionTest, [], 'Kernel-Tests');
  3829. $core.addMethod(
  3830. $core.method({
  3831. selector: "collectionWithNewValue",
  3832. protocol: 'fixture',
  3833. fn: function (){
  3834. var self=this;
  3835. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3836. return $core.withContext(function($ctx1) {
  3837. //>>excludeEnd("ctx");
  3838. self._subclassResponsibility();
  3839. return self;
  3840. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3841. }, function($ctx1) {$ctx1.fill(self,"collectionWithNewValue",{},$globals.IndexableCollectionTest)});
  3842. //>>excludeEnd("ctx");
  3843. },
  3844. //>>excludeStart("ide", pragmas.excludeIdeData);
  3845. args: [],
  3846. 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",
  3847. referencedClasses: [],
  3848. //>>excludeEnd("ide");
  3849. messageSends: ["subclassResponsibility"]
  3850. }),
  3851. $globals.IndexableCollectionTest);
  3852. $core.addMethod(
  3853. $core.method({
  3854. selector: "sampleNewIndex",
  3855. protocol: 'fixture',
  3856. fn: function (){
  3857. var self=this;
  3858. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3859. return $core.withContext(function($ctx1) {
  3860. //>>excludeEnd("ctx");
  3861. self._subclassResponsibility();
  3862. return self;
  3863. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3864. }, function($ctx1) {$ctx1.fill(self,"sampleNewIndex",{},$globals.IndexableCollectionTest)});
  3865. //>>excludeEnd("ctx");
  3866. },
  3867. //>>excludeStart("ide", pragmas.excludeIdeData);
  3868. args: [],
  3869. 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",
  3870. referencedClasses: [],
  3871. //>>excludeEnd("ide");
  3872. messageSends: ["subclassResponsibility"]
  3873. }),
  3874. $globals.IndexableCollectionTest);
  3875. $core.addMethod(
  3876. $core.method({
  3877. selector: "sampleNonIndexesDo:",
  3878. protocol: 'fixture',
  3879. fn: function (aBlock){
  3880. var self=this;
  3881. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3882. return $core.withContext(function($ctx1) {
  3883. //>>excludeEnd("ctx");
  3884. self._subclassResponsibility();
  3885. return self;
  3886. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3887. }, function($ctx1) {$ctx1.fill(self,"sampleNonIndexesDo:",{aBlock:aBlock},$globals.IndexableCollectionTest)});
  3888. //>>excludeEnd("ctx");
  3889. },
  3890. //>>excludeStart("ide", pragmas.excludeIdeData);
  3891. args: ["aBlock"],
  3892. 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",
  3893. referencedClasses: [],
  3894. //>>excludeEnd("ide");
  3895. messageSends: ["subclassResponsibility"]
  3896. }),
  3897. $globals.IndexableCollectionTest);
  3898. $core.addMethod(
  3899. $core.method({
  3900. selector: "samplesDo:",
  3901. protocol: 'fixture',
  3902. fn: function (aBlock){
  3903. var self=this;
  3904. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3905. return $core.withContext(function($ctx1) {
  3906. //>>excludeEnd("ctx");
  3907. self._subclassResponsibility();
  3908. return self;
  3909. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3910. }, function($ctx1) {$ctx1.fill(self,"samplesDo:",{aBlock:aBlock},$globals.IndexableCollectionTest)});
  3911. //>>excludeEnd("ctx");
  3912. },
  3913. //>>excludeStart("ide", pragmas.excludeIdeData);
  3914. args: ["aBlock"],
  3915. 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",
  3916. referencedClasses: [],
  3917. //>>excludeEnd("ide");
  3918. messageSends: ["subclassResponsibility"]
  3919. }),
  3920. $globals.IndexableCollectionTest);
  3921. $core.addMethod(
  3922. $core.method({
  3923. selector: "testAt",
  3924. protocol: 'tests',
  3925. fn: function (){
  3926. var self=this;
  3927. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  3928. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3929. return $core.withContext(function($ctx1) {
  3930. //>>excludeEnd("ctx");
  3931. var $1;
  3932. self._nonIndexesDo_((function(each){
  3933. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3934. return $core.withContext(function($ctx2) {
  3935. //>>excludeEnd("ctx");
  3936. return self._should_raise_((function(){
  3937. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3938. return $core.withContext(function($ctx3) {
  3939. //>>excludeEnd("ctx");
  3940. $1=self._collection();
  3941. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3942. $ctx3.sendIdx["collection"]=1;
  3943. //>>excludeEnd("ctx");
  3944. return $recv($1)._at_(each);
  3945. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3946. $ctx3.sendIdx["at:"]=1;
  3947. //>>excludeEnd("ctx");
  3948. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3949. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  3950. //>>excludeEnd("ctx");
  3951. }),$Error());
  3952. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3953. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  3954. //>>excludeEnd("ctx");
  3955. }));
  3956. self._samplesDo_((function(index,value){
  3957. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3958. return $core.withContext(function($ctx2) {
  3959. //>>excludeEnd("ctx");
  3960. return self._assert_equals_($recv(self._collection())._at_(index),value);
  3961. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3962. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,3)});
  3963. //>>excludeEnd("ctx");
  3964. }));
  3965. return self;
  3966. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3967. }, function($ctx1) {$ctx1.fill(self,"testAt",{},$globals.IndexableCollectionTest)});
  3968. //>>excludeEnd("ctx");
  3969. },
  3970. //>>excludeStart("ide", pragmas.excludeIdeData);
  3971. args: [],
  3972. 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 ]",
  3973. referencedClasses: ["Error"],
  3974. //>>excludeEnd("ide");
  3975. messageSends: ["nonIndexesDo:", "should:raise:", "at:", "collection", "samplesDo:", "assert:equals:"]
  3976. }),
  3977. $globals.IndexableCollectionTest);
  3978. $core.addMethod(
  3979. $core.method({
  3980. selector: "testAtIfAbsent",
  3981. protocol: 'tests',
  3982. fn: function (){
  3983. var self=this;
  3984. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3985. return $core.withContext(function($ctx1) {
  3986. //>>excludeEnd("ctx");
  3987. var $2,$1,$3;
  3988. self._nonIndexesDo_((function(each){
  3989. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3990. return $core.withContext(function($ctx2) {
  3991. //>>excludeEnd("ctx");
  3992. $2=self._collection();
  3993. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3994. $ctx2.sendIdx["collection"]=1;
  3995. //>>excludeEnd("ctx");
  3996. $1=$recv($2)._at_ifAbsent_(each,(function(){
  3997. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3998. return $core.withContext(function($ctx3) {
  3999. //>>excludeEnd("ctx");
  4000. return self._sampleNewValue();
  4001. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4002. $ctx3.sendIdx["sampleNewValue"]=1;
  4003. //>>excludeEnd("ctx");
  4004. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4005. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  4006. //>>excludeEnd("ctx");
  4007. }));
  4008. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4009. $ctx2.sendIdx["at:ifAbsent:"]=1;
  4010. //>>excludeEnd("ctx");
  4011. $3=self._sampleNewValue();
  4012. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4013. $ctx2.sendIdx["sampleNewValue"]=2;
  4014. //>>excludeEnd("ctx");
  4015. return self._assert_equals_($1,$3);
  4016. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4017. $ctx2.sendIdx["assert:equals:"]=1;
  4018. //>>excludeEnd("ctx");
  4019. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4020. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  4021. //>>excludeEnd("ctx");
  4022. }));
  4023. self._samplesDo_((function(index,value){
  4024. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4025. return $core.withContext(function($ctx2) {
  4026. //>>excludeEnd("ctx");
  4027. return self._assert_equals_($recv(self._collection())._at_ifAbsent_(index,(function(){
  4028. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4029. return $core.withContext(function($ctx3) {
  4030. //>>excludeEnd("ctx");
  4031. return self._sampleNewValue();
  4032. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4033. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,4)});
  4034. //>>excludeEnd("ctx");
  4035. })),value);
  4036. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4037. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,3)});
  4038. //>>excludeEnd("ctx");
  4039. }));
  4040. return self;
  4041. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4042. }, function($ctx1) {$ctx1.fill(self,"testAtIfAbsent",{},$globals.IndexableCollectionTest)});
  4043. //>>excludeEnd("ctx");
  4044. },
  4045. //>>excludeStart("ide", pragmas.excludeIdeData);
  4046. args: [],
  4047. 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 ].",
  4048. referencedClasses: [],
  4049. //>>excludeEnd("ide");
  4050. messageSends: ["nonIndexesDo:", "assert:equals:", "at:ifAbsent:", "collection", "sampleNewValue", "samplesDo:"]
  4051. }),
  4052. $globals.IndexableCollectionTest);
  4053. $core.addMethod(
  4054. $core.method({
  4055. selector: "testAtIfAbsentPut",
  4056. protocol: 'tests',
  4057. fn: function (){
  4058. var self=this;
  4059. var newCollection;
  4060. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4061. return $core.withContext(function($ctx1) {
  4062. //>>excludeEnd("ctx");
  4063. var $1;
  4064. newCollection=self._collection();
  4065. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4066. $ctx1.sendIdx["collection"]=1;
  4067. //>>excludeEnd("ctx");
  4068. self._samplesDo_((function(index,value){
  4069. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4070. return $core.withContext(function($ctx2) {
  4071. //>>excludeEnd("ctx");
  4072. $1=$recv(newCollection)._at_ifAbsentPut_(index,(function(){
  4073. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4074. return $core.withContext(function($ctx3) {
  4075. //>>excludeEnd("ctx");
  4076. return self._sampleNewValue();
  4077. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4078. $ctx3.sendIdx["sampleNewValue"]=1;
  4079. //>>excludeEnd("ctx");
  4080. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4081. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  4082. //>>excludeEnd("ctx");
  4083. }));
  4084. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4085. $ctx2.sendIdx["at:ifAbsentPut:"]=1;
  4086. //>>excludeEnd("ctx");
  4087. return self._assert_equals_($1,value);
  4088. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4089. $ctx2.sendIdx["assert:equals:"]=1;
  4090. //>>excludeEnd("ctx");
  4091. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4092. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,1)});
  4093. //>>excludeEnd("ctx");
  4094. }));
  4095. self._assert_equals_(newCollection,self._collection());
  4096. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4097. $ctx1.sendIdx["assert:equals:"]=2;
  4098. //>>excludeEnd("ctx");
  4099. self._assert_equals_($recv(newCollection)._at_ifAbsentPut_(self._sampleNewIndex(),(function(){
  4100. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4101. return $core.withContext(function($ctx2) {
  4102. //>>excludeEnd("ctx");
  4103. return self._sampleNewValue();
  4104. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4105. $ctx2.sendIdx["sampleNewValue"]=2;
  4106. //>>excludeEnd("ctx");
  4107. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4108. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  4109. //>>excludeEnd("ctx");
  4110. })),self._sampleNewValue());
  4111. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4112. $ctx1.sendIdx["assert:equals:"]=3;
  4113. //>>excludeEnd("ctx");
  4114. self._assert_equals_(newCollection,self._collectionWithNewValue());
  4115. return self;
  4116. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4117. }, function($ctx1) {$ctx1.fill(self,"testAtIfAbsentPut",{newCollection:newCollection},$globals.IndexableCollectionTest)});
  4118. //>>excludeEnd("ctx");
  4119. },
  4120. //>>excludeStart("ide", pragmas.excludeIdeData);
  4121. args: [],
  4122. 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",
  4123. referencedClasses: [],
  4124. //>>excludeEnd("ide");
  4125. messageSends: ["collection", "samplesDo:", "assert:equals:", "at:ifAbsentPut:", "sampleNewValue", "sampleNewIndex", "collectionWithNewValue"]
  4126. }),
  4127. $globals.IndexableCollectionTest);
  4128. $core.addMethod(
  4129. $core.method({
  4130. selector: "testAtIfPresent",
  4131. protocol: 'tests',
  4132. fn: function (){
  4133. var self=this;
  4134. var visited,sentinel;
  4135. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  4136. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4137. return $core.withContext(function($ctx1) {
  4138. //>>excludeEnd("ctx");
  4139. var $2,$1,$4,$3;
  4140. sentinel=$recv($Object())._new();
  4141. self._nonIndexesDo_((function(each){
  4142. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4143. return $core.withContext(function($ctx2) {
  4144. //>>excludeEnd("ctx");
  4145. visited=nil;
  4146. visited;
  4147. $2=self._collection();
  4148. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4149. $ctx2.sendIdx["collection"]=1;
  4150. //>>excludeEnd("ctx");
  4151. $1=$recv($2)._at_ifPresent_(each,(function(value1){
  4152. visited=value1;
  4153. visited;
  4154. return sentinel;
  4155. }));
  4156. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4157. $ctx2.sendIdx["at:ifPresent:"]=1;
  4158. //>>excludeEnd("ctx");
  4159. self._assert_equals_($1,nil);
  4160. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4161. $ctx2.sendIdx["assert:equals:"]=1;
  4162. //>>excludeEnd("ctx");
  4163. return self._assert_($recv(visited)._isNil());
  4164. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4165. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  4166. //>>excludeEnd("ctx");
  4167. }));
  4168. self._samplesDo_((function(index,value){
  4169. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4170. return $core.withContext(function($ctx2) {
  4171. //>>excludeEnd("ctx");
  4172. visited=nil;
  4173. visited;
  4174. $4=self._collection();
  4175. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4176. $ctx2.sendIdx["collection"]=2;
  4177. //>>excludeEnd("ctx");
  4178. $3=$recv($4)._at_ifPresent_(index,(function(value2){
  4179. visited=value2;
  4180. visited;
  4181. return sentinel;
  4182. }));
  4183. self._assert_equals_($3,sentinel);
  4184. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4185. $ctx2.sendIdx["assert:equals:"]=2;
  4186. //>>excludeEnd("ctx");
  4187. return self._assert_equals_(visited,$recv(self._collection())._at_(index));
  4188. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4189. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,3)});
  4190. //>>excludeEnd("ctx");
  4191. }));
  4192. return self;
  4193. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4194. }, function($ctx1) {$ctx1.fill(self,"testAtIfPresent",{visited:visited,sentinel:sentinel},$globals.IndexableCollectionTest)});
  4195. //>>excludeEnd("ctx");
  4196. },
  4197. //>>excludeStart("ide", pragmas.excludeIdeData);
  4198. args: [],
  4199. 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) ]",
  4200. referencedClasses: ["Object"],
  4201. //>>excludeEnd("ide");
  4202. messageSends: ["new", "nonIndexesDo:", "assert:equals:", "at:ifPresent:", "collection", "assert:", "isNil", "samplesDo:", "at:"]
  4203. }),
  4204. $globals.IndexableCollectionTest);
  4205. $core.addMethod(
  4206. $core.method({
  4207. selector: "testAtIfPresentIfAbsent",
  4208. protocol: 'tests',
  4209. fn: function (){
  4210. var self=this;
  4211. var visited,sentinel;
  4212. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  4213. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4214. return $core.withContext(function($ctx1) {
  4215. //>>excludeEnd("ctx");
  4216. var $2,$1,$3,$5,$4;
  4217. sentinel=$recv($Object())._new();
  4218. self._nonIndexesDo_((function(each){
  4219. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4220. return $core.withContext(function($ctx2) {
  4221. //>>excludeEnd("ctx");
  4222. visited=nil;
  4223. visited;
  4224. $2=self._collection();
  4225. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4226. $ctx2.sendIdx["collection"]=1;
  4227. //>>excludeEnd("ctx");
  4228. $1=$recv($2)._at_ifPresent_ifAbsent_(each,(function(value1){
  4229. visited=value1;
  4230. visited;
  4231. return sentinel;
  4232. }),(function(){
  4233. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4234. return $core.withContext(function($ctx3) {
  4235. //>>excludeEnd("ctx");
  4236. return self._sampleNewValue();
  4237. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4238. $ctx3.sendIdx["sampleNewValue"]=1;
  4239. //>>excludeEnd("ctx");
  4240. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4241. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)});
  4242. //>>excludeEnd("ctx");
  4243. }));
  4244. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4245. $ctx2.sendIdx["at:ifPresent:ifAbsent:"]=1;
  4246. //>>excludeEnd("ctx");
  4247. $3=self._sampleNewValue();
  4248. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4249. $ctx2.sendIdx["sampleNewValue"]=2;
  4250. //>>excludeEnd("ctx");
  4251. self._assert_equals_($1,$3);
  4252. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4253. $ctx2.sendIdx["assert:equals:"]=1;
  4254. //>>excludeEnd("ctx");
  4255. return self._assert_($recv(visited)._isNil());
  4256. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4257. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  4258. //>>excludeEnd("ctx");
  4259. }));
  4260. self._samplesDo_((function(index,value){
  4261. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4262. return $core.withContext(function($ctx2) {
  4263. //>>excludeEnd("ctx");
  4264. visited=nil;
  4265. visited;
  4266. $5=self._collection();
  4267. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4268. $ctx2.sendIdx["collection"]=2;
  4269. //>>excludeEnd("ctx");
  4270. $4=$recv($5)._at_ifPresent_ifAbsent_(index,(function(value2){
  4271. visited=value2;
  4272. visited;
  4273. return sentinel;
  4274. }),(function(){
  4275. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4276. return $core.withContext(function($ctx3) {
  4277. //>>excludeEnd("ctx");
  4278. return self._sampleNewValue();
  4279. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4280. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,6)});
  4281. //>>excludeEnd("ctx");
  4282. }));
  4283. self._assert_equals_($4,sentinel);
  4284. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4285. $ctx2.sendIdx["assert:equals:"]=2;
  4286. //>>excludeEnd("ctx");
  4287. return self._assert_equals_(visited,$recv(self._collection())._at_(index));
  4288. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4289. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,4)});
  4290. //>>excludeEnd("ctx");
  4291. }));
  4292. return self;
  4293. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4294. }, function($ctx1) {$ctx1.fill(self,"testAtIfPresentIfAbsent",{visited:visited,sentinel:sentinel},$globals.IndexableCollectionTest)});
  4295. //>>excludeEnd("ctx");
  4296. },
  4297. //>>excludeStart("ide", pragmas.excludeIdeData);
  4298. args: [],
  4299. 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) ]",
  4300. referencedClasses: ["Object"],
  4301. //>>excludeEnd("ide");
  4302. messageSends: ["new", "nonIndexesDo:", "assert:equals:", "at:ifPresent:ifAbsent:", "collection", "sampleNewValue", "assert:", "isNil", "samplesDo:", "at:"]
  4303. }),
  4304. $globals.IndexableCollectionTest);
  4305. $core.addMethod(
  4306. $core.method({
  4307. selector: "testAtPut",
  4308. protocol: 'tests',
  4309. fn: function (){
  4310. var self=this;
  4311. var newCollection;
  4312. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4313. return $core.withContext(function($ctx1) {
  4314. //>>excludeEnd("ctx");
  4315. newCollection=self._collection();
  4316. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4317. $ctx1.sendIdx["collection"]=1;
  4318. //>>excludeEnd("ctx");
  4319. self._samplesDo_((function(index,value){
  4320. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4321. return $core.withContext(function($ctx2) {
  4322. //>>excludeEnd("ctx");
  4323. return $recv(newCollection)._at_put_(index,value);
  4324. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4325. $ctx2.sendIdx["at:put:"]=1;
  4326. //>>excludeEnd("ctx");
  4327. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4328. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,1)});
  4329. //>>excludeEnd("ctx");
  4330. }));
  4331. self._assert_equals_(newCollection,self._collection());
  4332. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4333. $ctx1.sendIdx["assert:equals:"]=1;
  4334. //>>excludeEnd("ctx");
  4335. $recv(newCollection)._at_put_(self._sampleNewIndex(),self._sampleNewValue());
  4336. self._assert_equals_(newCollection,self._collectionWithNewValue());
  4337. return self;
  4338. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4339. }, function($ctx1) {$ctx1.fill(self,"testAtPut",{newCollection:newCollection},$globals.IndexableCollectionTest)});
  4340. //>>excludeEnd("ctx");
  4341. },
  4342. //>>excludeStart("ide", pragmas.excludeIdeData);
  4343. args: [],
  4344. 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",
  4345. referencedClasses: [],
  4346. //>>excludeEnd("ide");
  4347. messageSends: ["collection", "samplesDo:", "at:put:", "assert:equals:", "sampleNewIndex", "sampleNewValue", "collectionWithNewValue"]
  4348. }),
  4349. $globals.IndexableCollectionTest);
  4350. $core.addMethod(
  4351. $core.method({
  4352. selector: "testEquality",
  4353. protocol: 'tests',
  4354. fn: function (){
  4355. var self=this;
  4356. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4357. return $core.withContext(function($ctx1) {
  4358. //>>excludeEnd("ctx");
  4359. var $2,$1,$4,$3,$5,$6,$7,$10,$9,$11,$8;
  4360. $2=self._collectionClass();
  4361. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4362. $ctx1.sendIdx["collectionClass"]=1;
  4363. //>>excludeEnd("ctx");
  4364. $1=$recv($2)._new();
  4365. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4366. $ctx1.sendIdx["new"]=1;
  4367. //>>excludeEnd("ctx");
  4368. $4=self._collectionClass();
  4369. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4370. $ctx1.sendIdx["collectionClass"]=2;
  4371. //>>excludeEnd("ctx");
  4372. $3=$recv($4)._new();
  4373. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4374. $ctx1.sendIdx["new"]=2;
  4375. //>>excludeEnd("ctx");
  4376. self._assert_equals_($1,$3);
  4377. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4378. $ctx1.sendIdx["assert:equals:"]=1;
  4379. //>>excludeEnd("ctx");
  4380. $5=self._collection();
  4381. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4382. $ctx1.sendIdx["collection"]=1;
  4383. //>>excludeEnd("ctx");
  4384. $6=self._collection();
  4385. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4386. $ctx1.sendIdx["collection"]=2;
  4387. //>>excludeEnd("ctx");
  4388. self._assert_equals_($5,$6);
  4389. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4390. $ctx1.sendIdx["assert:equals:"]=2;
  4391. //>>excludeEnd("ctx");
  4392. $7=self._collectionWithNewValue();
  4393. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4394. $ctx1.sendIdx["collectionWithNewValue"]=1;
  4395. //>>excludeEnd("ctx");
  4396. self._assert_equals_($7,self._collectionWithNewValue());
  4397. $10=self._collectionClass();
  4398. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4399. $ctx1.sendIdx["collectionClass"]=3;
  4400. //>>excludeEnd("ctx");
  4401. $9=$recv($10)._new();
  4402. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4403. $ctx1.sendIdx["new"]=3;
  4404. //>>excludeEnd("ctx");
  4405. $11=self._collection();
  4406. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4407. $ctx1.sendIdx["collection"]=3;
  4408. //>>excludeEnd("ctx");
  4409. $8=$recv($9).__eq($11);
  4410. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4411. $ctx1.sendIdx["="]=1;
  4412. //>>excludeEnd("ctx");
  4413. self._deny_($8);
  4414. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4415. $ctx1.sendIdx["deny:"]=1;
  4416. //>>excludeEnd("ctx");
  4417. self._deny_($recv(self._collection()).__eq($recv(self._collectionClass())._new()));
  4418. return self;
  4419. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4420. }, function($ctx1) {$ctx1.fill(self,"testEquality",{},$globals.IndexableCollectionTest)});
  4421. //>>excludeEnd("ctx");
  4422. },
  4423. //>>excludeStart("ide", pragmas.excludeIdeData);
  4424. args: [],
  4425. 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",
  4426. referencedClasses: [],
  4427. //>>excludeEnd("ide");
  4428. messageSends: ["assert:equals:", "new", "collectionClass", "collection", "collectionWithNewValue", "deny:", "="]
  4429. }),
  4430. $globals.IndexableCollectionTest);
  4431. $core.addMethod(
  4432. $core.method({
  4433. selector: "testIndexOf",
  4434. protocol: 'tests',
  4435. fn: function (){
  4436. var self=this;
  4437. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  4438. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4439. return $core.withContext(function($ctx1) {
  4440. //>>excludeEnd("ctx");
  4441. var $1;
  4442. self._should_raise_((function(){
  4443. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4444. return $core.withContext(function($ctx2) {
  4445. //>>excludeEnd("ctx");
  4446. $1=self._collection();
  4447. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4448. $ctx2.sendIdx["collection"]=1;
  4449. //>>excludeEnd("ctx");
  4450. return $recv($1)._indexOf_(self._sampleNewValue());
  4451. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4452. $ctx2.sendIdx["indexOf:"]=1;
  4453. //>>excludeEnd("ctx");
  4454. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4455. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  4456. //>>excludeEnd("ctx");
  4457. }),$Error());
  4458. self._samplesDo_((function(index,value){
  4459. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4460. return $core.withContext(function($ctx2) {
  4461. //>>excludeEnd("ctx");
  4462. return self._assert_equals_($recv(self._collection())._indexOf_(value),index);
  4463. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4464. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,2)});
  4465. //>>excludeEnd("ctx");
  4466. }));
  4467. return self;
  4468. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4469. }, function($ctx1) {$ctx1.fill(self,"testIndexOf",{},$globals.IndexableCollectionTest)});
  4470. //>>excludeEnd("ctx");
  4471. },
  4472. //>>excludeStart("ide", pragmas.excludeIdeData);
  4473. args: [],
  4474. 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 ]",
  4475. referencedClasses: ["Error"],
  4476. //>>excludeEnd("ide");
  4477. messageSends: ["should:raise:", "indexOf:", "collection", "sampleNewValue", "samplesDo:", "assert:equals:"]
  4478. }),
  4479. $globals.IndexableCollectionTest);
  4480. $core.addMethod(
  4481. $core.method({
  4482. selector: "testIndexOfWithNull",
  4483. protocol: 'tests',
  4484. fn: function (){
  4485. var self=this;
  4486. var jsNull;
  4487. function $JSON(){return $globals.JSON||(typeof JSON=="undefined"?nil:JSON)}
  4488. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4489. return $core.withContext(function($ctx1) {
  4490. //>>excludeEnd("ctx");
  4491. var $1,$2;
  4492. jsNull=$recv($JSON())._parse_("null");
  4493. self._samplesDo_((function(index,value){
  4494. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4495. return $core.withContext(function($ctx2) {
  4496. //>>excludeEnd("ctx");
  4497. $1=self._collection();
  4498. $recv($1)._at_put_(index,jsNull);
  4499. $2=$recv($1)._indexOf_(jsNull);
  4500. return self._assert_equals_($2,index);
  4501. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4502. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,1)});
  4503. //>>excludeEnd("ctx");
  4504. }));
  4505. return self;
  4506. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4507. }, function($ctx1) {$ctx1.fill(self,"testIndexOfWithNull",{jsNull:jsNull},$globals.IndexableCollectionTest)});
  4508. //>>excludeEnd("ctx");
  4509. },
  4510. //>>excludeStart("ide", pragmas.excludeIdeData);
  4511. args: [],
  4512. 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 ]",
  4513. referencedClasses: ["JSON"],
  4514. //>>excludeEnd("ide");
  4515. messageSends: ["parse:", "samplesDo:", "assert:equals:", "at:put:", "collection", "indexOf:"]
  4516. }),
  4517. $globals.IndexableCollectionTest);
  4518. $core.addMethod(
  4519. $core.method({
  4520. selector: "testWithIndexDo",
  4521. protocol: 'tests',
  4522. fn: function (){
  4523. var self=this;
  4524. var collection;
  4525. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4526. return $core.withContext(function($ctx1) {
  4527. //>>excludeEnd("ctx");
  4528. collection=self._collection();
  4529. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4530. $ctx1.sendIdx["collection"]=1;
  4531. //>>excludeEnd("ctx");
  4532. $recv(self._collection())._withIndexDo_((function(each,index){
  4533. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4534. return $core.withContext(function($ctx2) {
  4535. //>>excludeEnd("ctx");
  4536. return self._assert_equals_($recv(collection)._at_(index),each);
  4537. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4538. }, function($ctx2) {$ctx2.fillBlock({each:each,index:index},$ctx1,1)});
  4539. //>>excludeEnd("ctx");
  4540. }));
  4541. return self;
  4542. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4543. }, function($ctx1) {$ctx1.fill(self,"testWithIndexDo",{collection:collection},$globals.IndexableCollectionTest)});
  4544. //>>excludeEnd("ctx");
  4545. },
  4546. //>>excludeStart("ide", pragmas.excludeIdeData);
  4547. args: [],
  4548. 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 ]",
  4549. referencedClasses: [],
  4550. //>>excludeEnd("ide");
  4551. messageSends: ["collection", "withIndexDo:", "assert:equals:", "at:"]
  4552. }),
  4553. $globals.IndexableCollectionTest);
  4554. $core.addClass('AssociativeCollectionTest', $globals.IndexableCollectionTest, [], 'Kernel-Tests');
  4555. $core.addMethod(
  4556. $core.method({
  4557. selector: "collectionKeys",
  4558. protocol: 'fixture',
  4559. fn: function (){
  4560. var self=this;
  4561. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4562. return $core.withContext(function($ctx1) {
  4563. //>>excludeEnd("ctx");
  4564. self._subclassResponsibility();
  4565. return self;
  4566. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4567. }, function($ctx1) {$ctx1.fill(self,"collectionKeys",{},$globals.AssociativeCollectionTest)});
  4568. //>>excludeEnd("ctx");
  4569. },
  4570. //>>excludeStart("ide", pragmas.excludeIdeData);
  4571. args: [],
  4572. source: "collectionKeys\x0a\x09self subclassResponsibility",
  4573. referencedClasses: [],
  4574. //>>excludeEnd("ide");
  4575. messageSends: ["subclassResponsibility"]
  4576. }),
  4577. $globals.AssociativeCollectionTest);
  4578. $core.addMethod(
  4579. $core.method({
  4580. selector: "collectionValues",
  4581. protocol: 'fixture',
  4582. fn: function (){
  4583. var self=this;
  4584. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4585. return $core.withContext(function($ctx1) {
  4586. //>>excludeEnd("ctx");
  4587. self._subclassResponsibility();
  4588. return self;
  4589. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4590. }, function($ctx1) {$ctx1.fill(self,"collectionValues",{},$globals.AssociativeCollectionTest)});
  4591. //>>excludeEnd("ctx");
  4592. },
  4593. //>>excludeStart("ide", pragmas.excludeIdeData);
  4594. args: [],
  4595. source: "collectionValues\x0a\x09self subclassResponsibility",
  4596. referencedClasses: [],
  4597. //>>excludeEnd("ide");
  4598. messageSends: ["subclassResponsibility"]
  4599. }),
  4600. $globals.AssociativeCollectionTest);
  4601. $core.addMethod(
  4602. $core.method({
  4603. selector: "nonIndexesDo:",
  4604. protocol: 'fixture',
  4605. fn: function (aBlock){
  4606. var self=this;
  4607. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4608. return $core.withContext(function($ctx1) {
  4609. //>>excludeEnd("ctx");
  4610. $recv(aBlock)._value_((5));
  4611. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4612. $ctx1.sendIdx["value:"]=1;
  4613. //>>excludeEnd("ctx");
  4614. $recv(aBlock)._value_("z");
  4615. return self;
  4616. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4617. }, function($ctx1) {$ctx1.fill(self,"nonIndexesDo:",{aBlock:aBlock},$globals.AssociativeCollectionTest)});
  4618. //>>excludeEnd("ctx");
  4619. },
  4620. //>>excludeStart("ide", pragmas.excludeIdeData);
  4621. args: ["aBlock"],
  4622. source: "nonIndexesDo: aBlock\x0a\x09aBlock value: 5.\x0a\x09aBlock value: 'z'",
  4623. referencedClasses: [],
  4624. //>>excludeEnd("ide");
  4625. messageSends: ["value:"]
  4626. }),
  4627. $globals.AssociativeCollectionTest);
  4628. $core.addMethod(
  4629. $core.method({
  4630. selector: "sampleNewIndex",
  4631. protocol: 'fixture',
  4632. fn: function (){
  4633. var self=this;
  4634. return "new";
  4635. },
  4636. //>>excludeStart("ide", pragmas.excludeIdeData);
  4637. args: [],
  4638. source: "sampleNewIndex\x0a\x09^ 'new'",
  4639. referencedClasses: [],
  4640. //>>excludeEnd("ide");
  4641. messageSends: []
  4642. }),
  4643. $globals.AssociativeCollectionTest);
  4644. $core.addMethod(
  4645. $core.method({
  4646. selector: "samplesDo:",
  4647. protocol: 'fixture',
  4648. fn: function (aBlock){
  4649. var self=this;
  4650. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4651. return $core.withContext(function($ctx1) {
  4652. //>>excludeEnd("ctx");
  4653. $recv(aBlock)._value_value_("a",(2));
  4654. return self;
  4655. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4656. }, function($ctx1) {$ctx1.fill(self,"samplesDo:",{aBlock:aBlock},$globals.AssociativeCollectionTest)});
  4657. //>>excludeEnd("ctx");
  4658. },
  4659. //>>excludeStart("ide", pragmas.excludeIdeData);
  4660. args: ["aBlock"],
  4661. source: "samplesDo: aBlock\x0a\x09aBlock value: 'a' value: 2",
  4662. referencedClasses: [],
  4663. //>>excludeEnd("ide");
  4664. messageSends: ["value:value:"]
  4665. }),
  4666. $globals.AssociativeCollectionTest);
  4667. $core.addMethod(
  4668. $core.method({
  4669. selector: "testAddAll",
  4670. protocol: 'tests',
  4671. fn: function (){
  4672. var self=this;
  4673. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4674. return $core.withContext(function($ctx1) {
  4675. //>>excludeEnd("ctx");
  4676. var $2,$3,$4,$5,$1,$6,$8,$9,$10,$11,$7,$12,$14,$15,$13;
  4677. (
  4678. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4679. $ctx1.supercall = true,
  4680. //>>excludeEnd("ctx");
  4681. $globals.AssociativeCollectionTest.superclass.fn.prototype._testAddAll.apply($recv(self), []));
  4682. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4683. $ctx1.supercall = false;
  4684. //>>excludeEnd("ctx");;
  4685. $2=self._collection();
  4686. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4687. $ctx1.sendIdx["collection"]=1;
  4688. //>>excludeEnd("ctx");
  4689. $3=$2;
  4690. $4=self._collection();
  4691. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4692. $ctx1.sendIdx["collection"]=2;
  4693. //>>excludeEnd("ctx");
  4694. $recv($3)._addAll_($4);
  4695. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4696. $ctx1.sendIdx["addAll:"]=1;
  4697. //>>excludeEnd("ctx");
  4698. $5=$recv($2)._yourself();
  4699. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4700. $ctx1.sendIdx["yourself"]=1;
  4701. //>>excludeEnd("ctx");
  4702. $1=$5;
  4703. $6=self._collection();
  4704. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4705. $ctx1.sendIdx["collection"]=3;
  4706. //>>excludeEnd("ctx");
  4707. self._assert_equals_($1,$6);
  4708. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4709. $ctx1.sendIdx["assert:equals:"]=1;
  4710. //>>excludeEnd("ctx");
  4711. $8=self._collection();
  4712. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4713. $ctx1.sendIdx["collection"]=4;
  4714. //>>excludeEnd("ctx");
  4715. $9=$8;
  4716. $10=self._collectionWithNewValue();
  4717. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4718. $ctx1.sendIdx["collectionWithNewValue"]=1;
  4719. //>>excludeEnd("ctx");
  4720. $recv($9)._addAll_($10);
  4721. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4722. $ctx1.sendIdx["addAll:"]=2;
  4723. //>>excludeEnd("ctx");
  4724. $11=$recv($8)._yourself();
  4725. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4726. $ctx1.sendIdx["yourself"]=2;
  4727. //>>excludeEnd("ctx");
  4728. $7=$11;
  4729. $12=self._collectionWithNewValue();
  4730. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4731. $ctx1.sendIdx["collectionWithNewValue"]=2;
  4732. //>>excludeEnd("ctx");
  4733. self._assert_equals_($7,$12);
  4734. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4735. $ctx1.sendIdx["assert:equals:"]=2;
  4736. //>>excludeEnd("ctx");
  4737. $14=self._collectionWithNewValue();
  4738. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4739. $ctx1.sendIdx["collectionWithNewValue"]=3;
  4740. //>>excludeEnd("ctx");
  4741. $recv($14)._addAll_(self._collection());
  4742. $15=$recv($14)._yourself();
  4743. $13=$15;
  4744. self._assert_equals_($13,self._collectionWithNewValue());
  4745. return self;
  4746. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4747. }, function($ctx1) {$ctx1.fill(self,"testAddAll",{},$globals.AssociativeCollectionTest)});
  4748. //>>excludeEnd("ctx");
  4749. },
  4750. //>>excludeStart("ide", pragmas.excludeIdeData);
  4751. args: [],
  4752. 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",
  4753. referencedClasses: [],
  4754. //>>excludeEnd("ide");
  4755. messageSends: ["testAddAll", "assert:equals:", "addAll:", "collection", "yourself", "collectionWithNewValue"]
  4756. }),
  4757. $globals.AssociativeCollectionTest);
  4758. $core.addMethod(
  4759. $core.method({
  4760. selector: "testAsDictionary",
  4761. protocol: 'tests',
  4762. fn: function (){
  4763. var self=this;
  4764. function $Dictionary(){return $globals.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  4765. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4766. return $core.withContext(function($ctx1) {
  4767. //>>excludeEnd("ctx");
  4768. self._assert_($recv($recv($recv(self._collectionClass())._new())._asDictionary())._isMemberOf_($Dictionary()));
  4769. return self;
  4770. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4771. }, function($ctx1) {$ctx1.fill(self,"testAsDictionary",{},$globals.AssociativeCollectionTest)});
  4772. //>>excludeEnd("ctx");
  4773. },
  4774. //>>excludeStart("ide", pragmas.excludeIdeData);
  4775. args: [],
  4776. source: "testAsDictionary\x0aself assert: ( self collectionClass new asDictionary isMemberOf: Dictionary ).",
  4777. referencedClasses: ["Dictionary"],
  4778. //>>excludeEnd("ide");
  4779. messageSends: ["assert:", "isMemberOf:", "asDictionary", "new", "collectionClass"]
  4780. }),
  4781. $globals.AssociativeCollectionTest);
  4782. $core.addMethod(
  4783. $core.method({
  4784. selector: "testAsHashedCollection",
  4785. protocol: 'tests',
  4786. fn: function (){
  4787. var self=this;
  4788. function $HashedCollection(){return $globals.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
  4789. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4790. return $core.withContext(function($ctx1) {
  4791. //>>excludeEnd("ctx");
  4792. self._assert_($recv($recv($recv(self._collectionClass())._new())._asHashedCollection())._isMemberOf_($HashedCollection()));
  4793. return self;
  4794. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4795. }, function($ctx1) {$ctx1.fill(self,"testAsHashedCollection",{},$globals.AssociativeCollectionTest)});
  4796. //>>excludeEnd("ctx");
  4797. },
  4798. //>>excludeStart("ide", pragmas.excludeIdeData);
  4799. args: [],
  4800. source: "testAsHashedCollection\x0aself assert: ( self collectionClass new asHashedCollection isMemberOf: HashedCollection ).",
  4801. referencedClasses: ["HashedCollection"],
  4802. //>>excludeEnd("ide");
  4803. messageSends: ["assert:", "isMemberOf:", "asHashedCollection", "new", "collectionClass"]
  4804. }),
  4805. $globals.AssociativeCollectionTest);
  4806. $core.addMethod(
  4807. $core.method({
  4808. selector: "testComma",
  4809. protocol: 'tests',
  4810. fn: function (){
  4811. var self=this;
  4812. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4813. return $core.withContext(function($ctx1) {
  4814. //>>excludeEnd("ctx");
  4815. var $2,$3,$1,$4,$6,$7,$5,$8,$10,$9;
  4816. (
  4817. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4818. $ctx1.supercall = true,
  4819. //>>excludeEnd("ctx");
  4820. $globals.AssociativeCollectionTest.superclass.fn.prototype._testComma.apply($recv(self), []));
  4821. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4822. $ctx1.supercall = false;
  4823. //>>excludeEnd("ctx");;
  4824. $2=self._collection();
  4825. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4826. $ctx1.sendIdx["collection"]=1;
  4827. //>>excludeEnd("ctx");
  4828. $3=self._collection();
  4829. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4830. $ctx1.sendIdx["collection"]=2;
  4831. //>>excludeEnd("ctx");
  4832. $1=$recv($2).__comma($3);
  4833. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4834. $ctx1.sendIdx[","]=1;
  4835. //>>excludeEnd("ctx");
  4836. $4=self._collection();
  4837. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4838. $ctx1.sendIdx["collection"]=3;
  4839. //>>excludeEnd("ctx");
  4840. self._assert_equals_($1,$4);
  4841. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4842. $ctx1.sendIdx["assert:equals:"]=1;
  4843. //>>excludeEnd("ctx");
  4844. $6=self._collection();
  4845. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4846. $ctx1.sendIdx["collection"]=4;
  4847. //>>excludeEnd("ctx");
  4848. $7=self._collectionWithNewValue();
  4849. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4850. $ctx1.sendIdx["collectionWithNewValue"]=1;
  4851. //>>excludeEnd("ctx");
  4852. $5=$recv($6).__comma($7);
  4853. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4854. $ctx1.sendIdx[","]=2;
  4855. //>>excludeEnd("ctx");
  4856. $8=self._collectionWithNewValue();
  4857. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4858. $ctx1.sendIdx["collectionWithNewValue"]=2;
  4859. //>>excludeEnd("ctx");
  4860. self._assert_equals_($5,$8);
  4861. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4862. $ctx1.sendIdx["assert:equals:"]=2;
  4863. //>>excludeEnd("ctx");
  4864. $10=self._collectionWithNewValue();
  4865. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4866. $ctx1.sendIdx["collectionWithNewValue"]=3;
  4867. //>>excludeEnd("ctx");
  4868. $9=$recv($10).__comma(self._collection());
  4869. self._assert_equals_($9,self._collectionWithNewValue());
  4870. return self;
  4871. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4872. }, function($ctx1) {$ctx1.fill(self,"testComma",{},$globals.AssociativeCollectionTest)});
  4873. //>>excludeEnd("ctx");
  4874. },
  4875. //>>excludeStart("ide", pragmas.excludeIdeData);
  4876. args: [],
  4877. 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",
  4878. referencedClasses: [],
  4879. //>>excludeEnd("ide");
  4880. messageSends: ["testComma", "assert:equals:", ",", "collection", "collectionWithNewValue"]
  4881. }),
  4882. $globals.AssociativeCollectionTest);
  4883. $core.addMethod(
  4884. $core.method({
  4885. selector: "testFrom",
  4886. protocol: 'tests',
  4887. fn: function (){
  4888. var self=this;
  4889. var associations;
  4890. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4891. return $core.withContext(function($ctx1) {
  4892. //>>excludeEnd("ctx");
  4893. var $1;
  4894. $1="a".__minus_gt((1));
  4895. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4896. $ctx1.sendIdx["->"]=1;
  4897. //>>excludeEnd("ctx");
  4898. associations=[$1,"b".__minus_gt((2))];
  4899. self._assertSameContents_as_($recv($recv(self._class())._collectionClass())._from_(associations),$globals.HashedCollection._newFromPairs_(["a",(1),"b",(2)]));
  4900. return self;
  4901. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4902. }, function($ctx1) {$ctx1.fill(self,"testFrom",{associations:associations},$globals.AssociativeCollectionTest)});
  4903. //>>excludeEnd("ctx");
  4904. },
  4905. //>>excludeStart("ide", pragmas.excludeIdeData);
  4906. args: [],
  4907. 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 }.",
  4908. referencedClasses: [],
  4909. //>>excludeEnd("ide");
  4910. messageSends: ["->", "assertSameContents:as:", "from:", "collectionClass", "class"]
  4911. }),
  4912. $globals.AssociativeCollectionTest);
  4913. $core.addMethod(
  4914. $core.method({
  4915. selector: "testKeys",
  4916. protocol: 'tests',
  4917. fn: function (){
  4918. var self=this;
  4919. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4920. return $core.withContext(function($ctx1) {
  4921. //>>excludeEnd("ctx");
  4922. var $2,$1,$3,$4;
  4923. $2=$recv($recv(self._collectionClass())._new())._keys();
  4924. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4925. $ctx1.sendIdx["keys"]=1;
  4926. //>>excludeEnd("ctx");
  4927. $1=$recv($2)._isEmpty();
  4928. self._assert_($1);
  4929. $3=$recv(self._collection())._keys();
  4930. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4931. $ctx1.sendIdx["keys"]=2;
  4932. //>>excludeEnd("ctx");
  4933. $4=self._collectionKeys();
  4934. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4935. $ctx1.sendIdx["collectionKeys"]=1;
  4936. //>>excludeEnd("ctx");
  4937. self._assertSameContents_as_($3,$4);
  4938. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4939. $ctx1.sendIdx["assertSameContents:as:"]=1;
  4940. //>>excludeEnd("ctx");
  4941. self._assertSameContents_as_($recv(self._collectionWithNewValue())._keys(),$recv(self._collectionKeys()).__comma([self._sampleNewIndex()]));
  4942. return self;
  4943. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4944. }, function($ctx1) {$ctx1.fill(self,"testKeys",{},$globals.AssociativeCollectionTest)});
  4945. //>>excludeEnd("ctx");
  4946. },
  4947. //>>excludeStart("ide", pragmas.excludeIdeData);
  4948. args: [],
  4949. 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 }",
  4950. referencedClasses: [],
  4951. //>>excludeEnd("ide");
  4952. messageSends: ["assert:", "isEmpty", "keys", "new", "collectionClass", "assertSameContents:as:", "collection", "collectionKeys", "collectionWithNewValue", ",", "sampleNewIndex"]
  4953. }),
  4954. $globals.AssociativeCollectionTest);
  4955. $core.addMethod(
  4956. $core.method({
  4957. selector: "testNewFromPairs",
  4958. protocol: 'tests',
  4959. fn: function (){
  4960. var self=this;
  4961. var flattenedAssociations;
  4962. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4963. return $core.withContext(function($ctx1) {
  4964. //>>excludeEnd("ctx");
  4965. flattenedAssociations=["a",(1),"b",(2)];
  4966. self._assertSameContents_as_($recv($recv(self._class())._collectionClass())._newFromPairs_(flattenedAssociations),$globals.HashedCollection._newFromPairs_(["a",(1),"b",(2)]));
  4967. return self;
  4968. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4969. }, function($ctx1) {$ctx1.fill(self,"testNewFromPairs",{flattenedAssociations:flattenedAssociations},$globals.AssociativeCollectionTest)});
  4970. //>>excludeEnd("ctx");
  4971. },
  4972. //>>excludeStart("ide", pragmas.excludeIdeData);
  4973. args: [],
  4974. 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 }.",
  4975. referencedClasses: [],
  4976. //>>excludeEnd("ide");
  4977. messageSends: ["assertSameContents:as:", "newFromPairs:", "collectionClass", "class"]
  4978. }),
  4979. $globals.AssociativeCollectionTest);
  4980. $core.addMethod(
  4981. $core.method({
  4982. selector: "testPrintString",
  4983. protocol: 'tests',
  4984. fn: function (){
  4985. var self=this;
  4986. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4987. return $core.withContext(function($ctx1) {
  4988. //>>excludeEnd("ctx");
  4989. var $3,$2,$4,$1,$5;
  4990. $3=self._collectionClass();
  4991. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4992. $ctx1.sendIdx["collectionClass"]=1;
  4993. //>>excludeEnd("ctx");
  4994. $2=$recv($3)._new();
  4995. $recv($2)._at_put_("firstname","James");
  4996. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4997. $ctx1.sendIdx["at:put:"]=1;
  4998. //>>excludeEnd("ctx");
  4999. $recv($2)._at_put_("lastname","Bond");
  5000. $4=$recv($2)._printString();
  5001. $1=$4;
  5002. $5=$recv("a ".__comma($recv(self._collectionClass())._name())).__comma(" ('firstname' -> 'James' , 'lastname' -> 'Bond')");
  5003. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5004. $ctx1.sendIdx[","]=1;
  5005. //>>excludeEnd("ctx");
  5006. self._assert_equals_($1,$5);
  5007. return self;
  5008. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5009. }, function($ctx1) {$ctx1.fill(self,"testPrintString",{},$globals.AssociativeCollectionTest)});
  5010. //>>excludeEnd("ctx");
  5011. },
  5012. //>>excludeStart("ide", pragmas.excludeIdeData);
  5013. args: [],
  5014. 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'')'",
  5015. referencedClasses: [],
  5016. //>>excludeEnd("ide");
  5017. messageSends: ["assert:equals:", "at:put:", "new", "collectionClass", "printString", ",", "name"]
  5018. }),
  5019. $globals.AssociativeCollectionTest);
  5020. $core.addMethod(
  5021. $core.method({
  5022. selector: "testRemoveKey",
  5023. protocol: 'tests',
  5024. fn: function (){
  5025. var self=this;
  5026. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  5027. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5028. return $core.withContext(function($ctx1) {
  5029. //>>excludeEnd("ctx");
  5030. var $1,$2,$3,$5,$6,$4,$7,$8;
  5031. self._nonIndexesDo_((function(each){
  5032. var collection;
  5033. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5034. return $core.withContext(function($ctx2) {
  5035. //>>excludeEnd("ctx");
  5036. collection=self._collection();
  5037. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5038. $ctx2.sendIdx["collection"]=1;
  5039. //>>excludeEnd("ctx");
  5040. collection;
  5041. self._should_raise_((function(){
  5042. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5043. return $core.withContext(function($ctx3) {
  5044. //>>excludeEnd("ctx");
  5045. return $recv(collection)._removeKey_(each);
  5046. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5047. $ctx3.sendIdx["removeKey:"]=1;
  5048. //>>excludeEnd("ctx");
  5049. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5050. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  5051. //>>excludeEnd("ctx");
  5052. }),$Error());
  5053. $1=collection;
  5054. $2=self._collection();
  5055. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5056. $ctx2.sendIdx["collection"]=2;
  5057. //>>excludeEnd("ctx");
  5058. return self._assert_equals_($1,$2);
  5059. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5060. $ctx2.sendIdx["assert:equals:"]=1;
  5061. //>>excludeEnd("ctx");
  5062. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5063. }, function($ctx2) {$ctx2.fillBlock({each:each,collection:collection},$ctx1,1)});
  5064. //>>excludeEnd("ctx");
  5065. }));
  5066. self._samplesDo_((function(index,value){
  5067. var collection;
  5068. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5069. return $core.withContext(function($ctx2) {
  5070. //>>excludeEnd("ctx");
  5071. collection=self._collection();
  5072. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5073. $ctx2.sendIdx["collection"]=3;
  5074. //>>excludeEnd("ctx");
  5075. collection;
  5076. $3=$recv(collection)._removeKey_(index);
  5077. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5078. $ctx2.sendIdx["removeKey:"]=2;
  5079. //>>excludeEnd("ctx");
  5080. self._assert_equals_($3,value);
  5081. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5082. $ctx2.sendIdx["assert:equals:"]=2;
  5083. //>>excludeEnd("ctx");
  5084. $5=collection;
  5085. $6=self._collection();
  5086. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5087. $ctx2.sendIdx["collection"]=4;
  5088. //>>excludeEnd("ctx");
  5089. $4=$recv($5).__eq($6);
  5090. return self._deny_($4);
  5091. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5092. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value,collection:collection},$ctx1,3)});
  5093. //>>excludeEnd("ctx");
  5094. }));
  5095. $7=self._collectionWithNewValue();
  5096. $recv($7)._removeKey_(self._sampleNewIndex());
  5097. $8=$recv($7)._yourself();
  5098. self._assert_equals_($8,self._collection());
  5099. return self;
  5100. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5101. }, function($ctx1) {$ctx1.fill(self,"testRemoveKey",{},$globals.AssociativeCollectionTest)});
  5102. //>>excludeEnd("ctx");
  5103. },
  5104. //>>excludeStart("ide", pragmas.excludeIdeData);
  5105. args: [],
  5106. 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",
  5107. referencedClasses: ["Error"],
  5108. //>>excludeEnd("ide");
  5109. messageSends: ["nonIndexesDo:", "collection", "should:raise:", "removeKey:", "assert:equals:", "samplesDo:", "deny:", "=", "collectionWithNewValue", "sampleNewIndex", "yourself"]
  5110. }),
  5111. $globals.AssociativeCollectionTest);
  5112. $core.addMethod(
  5113. $core.method({
  5114. selector: "testRemoveKeyIfAbsent",
  5115. protocol: 'tests',
  5116. fn: function (){
  5117. var self=this;
  5118. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5119. return $core.withContext(function($ctx1) {
  5120. //>>excludeEnd("ctx");
  5121. var $1,$2,$3,$4,$5,$7,$8,$6,$9,$10;
  5122. self._nonIndexesDo_((function(each){
  5123. var collection;
  5124. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5125. return $core.withContext(function($ctx2) {
  5126. //>>excludeEnd("ctx");
  5127. collection=self._collection();
  5128. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5129. $ctx2.sendIdx["collection"]=1;
  5130. //>>excludeEnd("ctx");
  5131. collection;
  5132. $1=$recv(collection)._removeKey_ifAbsent_(each,(function(){
  5133. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5134. return $core.withContext(function($ctx3) {
  5135. //>>excludeEnd("ctx");
  5136. return self._sampleNewValue();
  5137. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5138. $ctx3.sendIdx["sampleNewValue"]=1;
  5139. //>>excludeEnd("ctx");
  5140. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5141. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  5142. //>>excludeEnd("ctx");
  5143. }));
  5144. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5145. $ctx2.sendIdx["removeKey:ifAbsent:"]=1;
  5146. //>>excludeEnd("ctx");
  5147. $2=self._sampleNewValue();
  5148. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5149. $ctx2.sendIdx["sampleNewValue"]=2;
  5150. //>>excludeEnd("ctx");
  5151. self._assert_equals_($1,$2);
  5152. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5153. $ctx2.sendIdx["assert:equals:"]=1;
  5154. //>>excludeEnd("ctx");
  5155. $3=collection;
  5156. $4=self._collection();
  5157. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5158. $ctx2.sendIdx["collection"]=2;
  5159. //>>excludeEnd("ctx");
  5160. return self._assert_equals_($3,$4);
  5161. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5162. $ctx2.sendIdx["assert:equals:"]=2;
  5163. //>>excludeEnd("ctx");
  5164. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5165. }, function($ctx2) {$ctx2.fillBlock({each:each,collection:collection},$ctx1,1)});
  5166. //>>excludeEnd("ctx");
  5167. }));
  5168. self._samplesDo_((function(index,value){
  5169. var collection;
  5170. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5171. return $core.withContext(function($ctx2) {
  5172. //>>excludeEnd("ctx");
  5173. collection=self._collection();
  5174. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5175. $ctx2.sendIdx["collection"]=3;
  5176. //>>excludeEnd("ctx");
  5177. collection;
  5178. $5=$recv(collection)._removeKey_ifAbsent_(index,(function(){
  5179. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5180. return $core.withContext(function($ctx3) {
  5181. //>>excludeEnd("ctx");
  5182. return self._sampleNewValue();
  5183. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5184. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,4)});
  5185. //>>excludeEnd("ctx");
  5186. }));
  5187. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5188. $ctx2.sendIdx["removeKey:ifAbsent:"]=2;
  5189. //>>excludeEnd("ctx");
  5190. self._assert_equals_($5,value);
  5191. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5192. $ctx2.sendIdx["assert:equals:"]=3;
  5193. //>>excludeEnd("ctx");
  5194. $7=collection;
  5195. $8=self._collection();
  5196. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5197. $ctx2.sendIdx["collection"]=4;
  5198. //>>excludeEnd("ctx");
  5199. $6=$recv($7).__eq($8);
  5200. return self._deny_($6);
  5201. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5202. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value,collection:collection},$ctx1,3)});
  5203. //>>excludeEnd("ctx");
  5204. }));
  5205. $9=self._collectionWithNewValue();
  5206. $recv($9)._removeKey_ifAbsent_(self._sampleNewIndex(),(function(){
  5207. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5208. return $core.withContext(function($ctx2) {
  5209. //>>excludeEnd("ctx");
  5210. return self._assert_(false);
  5211. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5212. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,5)});
  5213. //>>excludeEnd("ctx");
  5214. }));
  5215. $10=$recv($9)._yourself();
  5216. self._assert_equals_($10,self._collection());
  5217. return self;
  5218. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5219. }, function($ctx1) {$ctx1.fill(self,"testRemoveKeyIfAbsent",{},$globals.AssociativeCollectionTest)});
  5220. //>>excludeEnd("ctx");
  5221. },
  5222. //>>excludeStart("ide", pragmas.excludeIdeData);
  5223. args: [],
  5224. 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",
  5225. referencedClasses: [],
  5226. //>>excludeEnd("ide");
  5227. messageSends: ["nonIndexesDo:", "collection", "assert:equals:", "removeKey:ifAbsent:", "sampleNewValue", "samplesDo:", "deny:", "=", "collectionWithNewValue", "sampleNewIndex", "assert:", "yourself"]
  5228. }),
  5229. $globals.AssociativeCollectionTest);
  5230. $core.addMethod(
  5231. $core.method({
  5232. selector: "testValues",
  5233. protocol: 'tests',
  5234. fn: function (){
  5235. var self=this;
  5236. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5237. return $core.withContext(function($ctx1) {
  5238. //>>excludeEnd("ctx");
  5239. var $2,$1,$3,$4;
  5240. $2=$recv($recv(self._collectionClass())._new())._values();
  5241. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5242. $ctx1.sendIdx["values"]=1;
  5243. //>>excludeEnd("ctx");
  5244. $1=$recv($2)._isEmpty();
  5245. self._assert_($1);
  5246. $3=$recv(self._collection())._values();
  5247. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5248. $ctx1.sendIdx["values"]=2;
  5249. //>>excludeEnd("ctx");
  5250. $4=self._collectionValues();
  5251. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5252. $ctx1.sendIdx["collectionValues"]=1;
  5253. //>>excludeEnd("ctx");
  5254. self._assertSameContents_as_($3,$4);
  5255. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5256. $ctx1.sendIdx["assertSameContents:as:"]=1;
  5257. //>>excludeEnd("ctx");
  5258. self._assertSameContents_as_($recv(self._collectionWithNewValue())._values(),$recv(self._collectionValues()).__comma([self._sampleNewValue()]));
  5259. return self;
  5260. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5261. }, function($ctx1) {$ctx1.fill(self,"testValues",{},$globals.AssociativeCollectionTest)});
  5262. //>>excludeEnd("ctx");
  5263. },
  5264. //>>excludeStart("ide", pragmas.excludeIdeData);
  5265. args: [],
  5266. 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 }",
  5267. referencedClasses: [],
  5268. //>>excludeEnd("ide");
  5269. messageSends: ["assert:", "isEmpty", "values", "new", "collectionClass", "assertSameContents:as:", "collection", "collectionValues", "collectionWithNewValue", ",", "sampleNewValue"]
  5270. }),
  5271. $globals.AssociativeCollectionTest);
  5272. $core.addClass('DictionaryTest', $globals.AssociativeCollectionTest, [], 'Kernel-Tests');
  5273. $core.addMethod(
  5274. $core.method({
  5275. selector: "collection",
  5276. protocol: 'fixture',
  5277. fn: function (){
  5278. var self=this;
  5279. function $Dictionary(){return $globals.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  5280. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5281. return $core.withContext(function($ctx1) {
  5282. //>>excludeEnd("ctx");
  5283. var $2,$3,$1;
  5284. $2=$recv($Dictionary())._new();
  5285. $recv($2)._at_put_((1),(1));
  5286. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5287. $ctx1.sendIdx["at:put:"]=1;
  5288. //>>excludeEnd("ctx");
  5289. $recv($2)._at_put_("a",(2));
  5290. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5291. $ctx1.sendIdx["at:put:"]=2;
  5292. //>>excludeEnd("ctx");
  5293. $recv($2)._at_put_(true,(3));
  5294. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5295. $ctx1.sendIdx["at:put:"]=3;
  5296. //>>excludeEnd("ctx");
  5297. $recv($2)._at_put_((1).__at((3)),(-4));
  5298. $3=$recv($2)._yourself();
  5299. $1=$3;
  5300. return $1;
  5301. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5302. }, function($ctx1) {$ctx1.fill(self,"collection",{},$globals.DictionaryTest)});
  5303. //>>excludeEnd("ctx");
  5304. },
  5305. //>>excludeStart("ide", pragmas.excludeIdeData);
  5306. args: [],
  5307. 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\x09yourself",
  5308. referencedClasses: ["Dictionary"],
  5309. //>>excludeEnd("ide");
  5310. messageSends: ["at:put:", "new", "@", "yourself"]
  5311. }),
  5312. $globals.DictionaryTest);
  5313. $core.addMethod(
  5314. $core.method({
  5315. selector: "collectionKeys",
  5316. protocol: 'fixture',
  5317. fn: function (){
  5318. var self=this;
  5319. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5320. return $core.withContext(function($ctx1) {
  5321. //>>excludeEnd("ctx");
  5322. var $1;
  5323. $1=[(1),"a",true,(1).__at((3))];
  5324. return $1;
  5325. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5326. }, function($ctx1) {$ctx1.fill(self,"collectionKeys",{},$globals.DictionaryTest)});
  5327. //>>excludeEnd("ctx");
  5328. },
  5329. //>>excludeStart("ide", pragmas.excludeIdeData);
  5330. args: [],
  5331. source: "collectionKeys\x0a\x09^ {1. 'a'. true. 1@3}",
  5332. referencedClasses: [],
  5333. //>>excludeEnd("ide");
  5334. messageSends: ["@"]
  5335. }),
  5336. $globals.DictionaryTest);
  5337. $core.addMethod(
  5338. $core.method({
  5339. selector: "collectionOfPrintStrings",
  5340. protocol: 'fixture',
  5341. fn: function (){
  5342. var self=this;
  5343. function $Dictionary(){return $globals.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  5344. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5345. return $core.withContext(function($ctx1) {
  5346. //>>excludeEnd("ctx");
  5347. var $2,$3,$1;
  5348. $2=$recv($Dictionary())._new();
  5349. $recv($2)._at_put_((1),"1");
  5350. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5351. $ctx1.sendIdx["at:put:"]=1;
  5352. //>>excludeEnd("ctx");
  5353. $recv($2)._at_put_("a","2");
  5354. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5355. $ctx1.sendIdx["at:put:"]=2;
  5356. //>>excludeEnd("ctx");
  5357. $recv($2)._at_put_(true,"3");
  5358. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5359. $ctx1.sendIdx["at:put:"]=3;
  5360. //>>excludeEnd("ctx");
  5361. $recv($2)._at_put_((1).__at((3)),"-4");
  5362. $3=$recv($2)._yourself();
  5363. $1=$3;
  5364. return $1;
  5365. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5366. }, function($ctx1) {$ctx1.fill(self,"collectionOfPrintStrings",{},$globals.DictionaryTest)});
  5367. //>>excludeEnd("ctx");
  5368. },
  5369. //>>excludeStart("ide", pragmas.excludeIdeData);
  5370. args: [],
  5371. 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\x09yourself",
  5372. referencedClasses: ["Dictionary"],
  5373. //>>excludeEnd("ide");
  5374. messageSends: ["at:put:", "new", "@", "yourself"]
  5375. }),
  5376. $globals.DictionaryTest);
  5377. $core.addMethod(
  5378. $core.method({
  5379. selector: "collectionSize",
  5380. protocol: 'fixture',
  5381. fn: function (){
  5382. var self=this;
  5383. return (4);
  5384. },
  5385. //>>excludeStart("ide", pragmas.excludeIdeData);
  5386. args: [],
  5387. source: "collectionSize\x0a\x09^ 4",
  5388. referencedClasses: [],
  5389. //>>excludeEnd("ide");
  5390. messageSends: []
  5391. }),
  5392. $globals.DictionaryTest);
  5393. $core.addMethod(
  5394. $core.method({
  5395. selector: "collectionValues",
  5396. protocol: 'fixture',
  5397. fn: function (){
  5398. var self=this;
  5399. var $1;
  5400. $1=[(1),(2),(3),(-4)];
  5401. return $1;
  5402. },
  5403. //>>excludeStart("ide", pragmas.excludeIdeData);
  5404. args: [],
  5405. source: "collectionValues\x0a\x09^ {1. 2. 3. -4}",
  5406. referencedClasses: [],
  5407. //>>excludeEnd("ide");
  5408. messageSends: []
  5409. }),
  5410. $globals.DictionaryTest);
  5411. $core.addMethod(
  5412. $core.method({
  5413. selector: "collectionWithDuplicates",
  5414. protocol: 'fixture',
  5415. fn: function (){
  5416. var self=this;
  5417. function $Dictionary(){return $globals.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  5418. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5419. return $core.withContext(function($ctx1) {
  5420. //>>excludeEnd("ctx");
  5421. var $2,$3,$1;
  5422. $2=$recv($Dictionary())._new();
  5423. $recv($2)._at_put_((1),(1));
  5424. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5425. $ctx1.sendIdx["at:put:"]=1;
  5426. //>>excludeEnd("ctx");
  5427. $recv($2)._at_put_("a",(2));
  5428. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5429. $ctx1.sendIdx["at:put:"]=2;
  5430. //>>excludeEnd("ctx");
  5431. $recv($2)._at_put_(true,(3));
  5432. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5433. $ctx1.sendIdx["at:put:"]=3;
  5434. //>>excludeEnd("ctx");
  5435. $recv($2)._at_put_((4),(-4));
  5436. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5437. $ctx1.sendIdx["at:put:"]=4;
  5438. //>>excludeEnd("ctx");
  5439. $recv($2)._at_put_("b",(1));
  5440. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5441. $ctx1.sendIdx["at:put:"]=5;
  5442. //>>excludeEnd("ctx");
  5443. $recv($2)._at_put_((3),(3));
  5444. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5445. $ctx1.sendIdx["at:put:"]=6;
  5446. //>>excludeEnd("ctx");
  5447. $recv($2)._at_put_(false,(12));
  5448. $3=$recv($2)._yourself();
  5449. $1=$3;
  5450. return $1;
  5451. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5452. }, function($ctx1) {$ctx1.fill(self,"collectionWithDuplicates",{},$globals.DictionaryTest)});
  5453. //>>excludeEnd("ctx");
  5454. },
  5455. //>>excludeStart("ide", pragmas.excludeIdeData);
  5456. args: [],
  5457. 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: 'b' put: 1;\x0a\x09\x09at: 3 put: 3;\x0a\x09\x09at: false put: 12;\x0a\x09\x09yourself",
  5458. referencedClasses: ["Dictionary"],
  5459. //>>excludeEnd("ide");
  5460. messageSends: ["at:put:", "new", "yourself"]
  5461. }),
  5462. $globals.DictionaryTest);
  5463. $core.addMethod(
  5464. $core.method({
  5465. selector: "collectionWithNewValue",
  5466. protocol: 'fixture',
  5467. fn: function (){
  5468. var self=this;
  5469. function $Dictionary(){return $globals.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  5470. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5471. return $core.withContext(function($ctx1) {
  5472. //>>excludeEnd("ctx");
  5473. var $2,$3,$1;
  5474. $2=$recv($Dictionary())._new();
  5475. $recv($2)._at_put_((1),(1));
  5476. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5477. $ctx1.sendIdx["at:put:"]=1;
  5478. //>>excludeEnd("ctx");
  5479. $recv($2)._at_put_("a",(2));
  5480. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5481. $ctx1.sendIdx["at:put:"]=2;
  5482. //>>excludeEnd("ctx");
  5483. $recv($2)._at_put_(true,(3));
  5484. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5485. $ctx1.sendIdx["at:put:"]=3;
  5486. //>>excludeEnd("ctx");
  5487. $recv($2)._at_put_((1).__at((3)),(-4));
  5488. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5489. $ctx1.sendIdx["at:put:"]=4;
  5490. //>>excludeEnd("ctx");
  5491. $recv($2)._at_put_("new","N");
  5492. $3=$recv($2)._yourself();
  5493. $1=$3;
  5494. return $1;
  5495. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5496. }, function($ctx1) {$ctx1.fill(self,"collectionWithNewValue",{},$globals.DictionaryTest)});
  5497. //>>excludeEnd("ctx");
  5498. },
  5499. //>>excludeStart("ide", pragmas.excludeIdeData);
  5500. args: [],
  5501. 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: 'new' put: 'N';\x0a\x09\x09yourself",
  5502. referencedClasses: ["Dictionary"],
  5503. //>>excludeEnd("ide");
  5504. messageSends: ["at:put:", "new", "@", "yourself"]
  5505. }),
  5506. $globals.DictionaryTest);
  5507. $core.addMethod(
  5508. $core.method({
  5509. selector: "sampleNewValueAsCollection",
  5510. protocol: 'fixture',
  5511. fn: function (){
  5512. var self=this;
  5513. function $Dictionary(){return $globals.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  5514. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5515. return $core.withContext(function($ctx1) {
  5516. //>>excludeEnd("ctx");
  5517. var $2,$3,$1;
  5518. $2=$recv($Dictionary())._new();
  5519. $recv($2)._at_put_("new","N");
  5520. $3=$recv($2)._yourself();
  5521. $1=$3;
  5522. return $1;
  5523. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5524. }, function($ctx1) {$ctx1.fill(self,"sampleNewValueAsCollection",{},$globals.DictionaryTest)});
  5525. //>>excludeEnd("ctx");
  5526. },
  5527. //>>excludeStart("ide", pragmas.excludeIdeData);
  5528. args: [],
  5529. source: "sampleNewValueAsCollection\x0a\x09^ Dictionary new\x0a\x09\x09at: 'new' put: 'N';\x0a\x09\x09yourself",
  5530. referencedClasses: ["Dictionary"],
  5531. //>>excludeEnd("ide");
  5532. messageSends: ["at:put:", "new", "yourself"]
  5533. }),
  5534. $globals.DictionaryTest);
  5535. $core.addMethod(
  5536. $core.method({
  5537. selector: "samplesDo:",
  5538. protocol: 'fixture',
  5539. fn: function (aBlock){
  5540. var self=this;
  5541. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5542. return $core.withContext(function($ctx1) {
  5543. //>>excludeEnd("ctx");
  5544. (
  5545. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5546. $ctx1.supercall = true,
  5547. //>>excludeEnd("ctx");
  5548. $globals.DictionaryTest.superclass.fn.prototype._samplesDo_.apply($recv(self), [aBlock]));
  5549. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5550. $ctx1.supercall = false;
  5551. //>>excludeEnd("ctx");;
  5552. $recv(aBlock)._value_value_(true,(3));
  5553. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5554. $ctx1.sendIdx["value:value:"]=1;
  5555. //>>excludeEnd("ctx");
  5556. $recv(aBlock)._value_value_((1).__at((3)),(-4));
  5557. return self;
  5558. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5559. }, function($ctx1) {$ctx1.fill(self,"samplesDo:",{aBlock:aBlock},$globals.DictionaryTest)});
  5560. //>>excludeEnd("ctx");
  5561. },
  5562. //>>excludeStart("ide", pragmas.excludeIdeData);
  5563. args: ["aBlock"],
  5564. source: "samplesDo: aBlock\x0a\x09super samplesDo: aBlock.\x0a\x09aBlock value: true value: 3.\x0a\x09aBlock value: 1@3 value: -4",
  5565. referencedClasses: [],
  5566. //>>excludeEnd("ide");
  5567. messageSends: ["samplesDo:", "value:value:", "@"]
  5568. }),
  5569. $globals.DictionaryTest);
  5570. $core.addMethod(
  5571. $core.method({
  5572. selector: "testAccessing",
  5573. protocol: 'tests',
  5574. fn: function (){
  5575. var self=this;
  5576. var d;
  5577. function $Dictionary(){return $globals.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  5578. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5579. return $core.withContext(function($ctx1) {
  5580. //>>excludeEnd("ctx");
  5581. var $1,$2,$3,$4,$5,$6,$7,$9,$10,$8,$12,$13,$11;
  5582. d=$recv($Dictionary())._new();
  5583. $recv(d)._at_put_("hello","world");
  5584. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5585. $ctx1.sendIdx["at:put:"]=1;
  5586. //>>excludeEnd("ctx");
  5587. $1=$recv(d)._at_("hello");
  5588. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5589. $ctx1.sendIdx["at:"]=1;
  5590. //>>excludeEnd("ctx");
  5591. self._assert_equals_($1,"world");
  5592. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5593. $ctx1.sendIdx["assert:equals:"]=1;
  5594. //>>excludeEnd("ctx");
  5595. $2=$recv(d)._at_ifAbsent_("hello",(function(){
  5596. return nil;
  5597. }));
  5598. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5599. $ctx1.sendIdx["at:ifAbsent:"]=1;
  5600. //>>excludeEnd("ctx");
  5601. self._assert_equals_($2,"world");
  5602. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5603. $ctx1.sendIdx["assert:equals:"]=2;
  5604. //>>excludeEnd("ctx");
  5605. self._deny_($recv($recv(d)._at_ifAbsent_("foo",(function(){
  5606. return nil;
  5607. }))).__eq("world"));
  5608. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5609. $ctx1.sendIdx["deny:"]=1;
  5610. //>>excludeEnd("ctx");
  5611. $3=$recv(d)._includesKey_("hello");
  5612. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5613. $ctx1.sendIdx["includesKey:"]=1;
  5614. //>>excludeEnd("ctx");
  5615. self._assert_($3);
  5616. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5617. $ctx1.sendIdx["assert:"]=1;
  5618. //>>excludeEnd("ctx");
  5619. $4=$recv(d)._includesKey_("foo");
  5620. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5621. $ctx1.sendIdx["includesKey:"]=2;
  5622. //>>excludeEnd("ctx");
  5623. self._deny_($4);
  5624. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5625. $ctx1.sendIdx["deny:"]=2;
  5626. //>>excludeEnd("ctx");
  5627. $recv(d)._at_put_((1),(2));
  5628. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5629. $ctx1.sendIdx["at:put:"]=2;
  5630. //>>excludeEnd("ctx");
  5631. $5=$recv(d)._at_((1));
  5632. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5633. $ctx1.sendIdx["at:"]=2;
  5634. //>>excludeEnd("ctx");
  5635. self._assert_equals_($5,(2));
  5636. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5637. $ctx1.sendIdx["assert:equals:"]=3;
  5638. //>>excludeEnd("ctx");
  5639. $6=d;
  5640. $7=(1).__at((3));
  5641. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5642. $ctx1.sendIdx["@"]=1;
  5643. //>>excludeEnd("ctx");
  5644. $recv($6)._at_put_($7,(3));
  5645. $9=d;
  5646. $10=(1).__at((3));
  5647. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5648. $ctx1.sendIdx["@"]=2;
  5649. //>>excludeEnd("ctx");
  5650. $8=$recv($9)._at_($10);
  5651. self._assert_equals_($8,(3));
  5652. $12=d;
  5653. $13=(1).__at((3));
  5654. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5655. $ctx1.sendIdx["@"]=3;
  5656. //>>excludeEnd("ctx");
  5657. $11=$recv($12)._includesKey_($13);
  5658. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5659. $ctx1.sendIdx["includesKey:"]=3;
  5660. //>>excludeEnd("ctx");
  5661. self._assert_($11);
  5662. self._deny_($recv(d)._includesKey_((3).__at((1))));
  5663. return self;
  5664. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5665. }, function($ctx1) {$ctx1.fill(self,"testAccessing",{d:d},$globals.DictionaryTest)});
  5666. //>>excludeEnd("ctx");
  5667. },
  5668. //>>excludeStart("ide", pragmas.excludeIdeData);
  5669. args: [],
  5670. 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)",
  5671. referencedClasses: ["Dictionary"],
  5672. //>>excludeEnd("ide");
  5673. messageSends: ["new", "at:put:", "assert:equals:", "at:", "at:ifAbsent:", "deny:", "=", "assert:", "includesKey:", "@"]
  5674. }),
  5675. $globals.DictionaryTest);
  5676. $core.addMethod(
  5677. $core.method({
  5678. selector: "testDynamicDictionaries",
  5679. protocol: 'tests',
  5680. fn: function (){
  5681. var self=this;
  5682. function $Dictionary(){return $globals.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  5683. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5684. return $core.withContext(function($ctx1) {
  5685. //>>excludeEnd("ctx");
  5686. self._assert_equals_($recv($globals.HashedCollection._newFromPairs_(["hello",(1)]))._asDictionary(),$recv($Dictionary())._with_("hello".__minus_gt((1))));
  5687. return self;
  5688. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5689. }, function($ctx1) {$ctx1.fill(self,"testDynamicDictionaries",{},$globals.DictionaryTest)});
  5690. //>>excludeEnd("ctx");
  5691. },
  5692. //>>excludeStart("ide", pragmas.excludeIdeData);
  5693. args: [],
  5694. source: "testDynamicDictionaries\x0a\x09self assert: #{'hello' -> 1} asDictionary equals: (Dictionary with: 'hello' -> 1)",
  5695. referencedClasses: ["Dictionary"],
  5696. //>>excludeEnd("ide");
  5697. messageSends: ["assert:equals:", "asDictionary", "with:", "->"]
  5698. }),
  5699. $globals.DictionaryTest);
  5700. $core.addMethod(
  5701. $core.method({
  5702. selector: "collectionClass",
  5703. protocol: 'fixture',
  5704. fn: function (){
  5705. var self=this;
  5706. function $Dictionary(){return $globals.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  5707. return $Dictionary();
  5708. },
  5709. //>>excludeStart("ide", pragmas.excludeIdeData);
  5710. args: [],
  5711. source: "collectionClass\x0a\x09^ Dictionary",
  5712. referencedClasses: ["Dictionary"],
  5713. //>>excludeEnd("ide");
  5714. messageSends: []
  5715. }),
  5716. $globals.DictionaryTest.klass);
  5717. $core.addClass('HashedCollectionTest', $globals.AssociativeCollectionTest, [], 'Kernel-Tests');
  5718. $core.addMethod(
  5719. $core.method({
  5720. selector: "collection",
  5721. protocol: 'fixture',
  5722. fn: function (){
  5723. var self=this;
  5724. var $1;
  5725. $1=$globals.HashedCollection._newFromPairs_(["b",(1),"a",(2),"c",(3),"d",(-4)]);
  5726. return $1;
  5727. },
  5728. //>>excludeStart("ide", pragmas.excludeIdeData);
  5729. args: [],
  5730. source: "collection\x0a\x09^ #{ 'b' -> 1. 'a' -> 2. 'c' -> 3. 'd' -> -4 }",
  5731. referencedClasses: [],
  5732. //>>excludeEnd("ide");
  5733. messageSends: []
  5734. }),
  5735. $globals.HashedCollectionTest);
  5736. $core.addMethod(
  5737. $core.method({
  5738. selector: "collectionKeys",
  5739. protocol: 'fixture',
  5740. fn: function (){
  5741. var self=this;
  5742. var $1;
  5743. $1=["b","a","c","d"];
  5744. return $1;
  5745. },
  5746. //>>excludeStart("ide", pragmas.excludeIdeData);
  5747. args: [],
  5748. source: "collectionKeys\x0a\x09^ { 'b'. 'a'. 'c'. 'd' }",
  5749. referencedClasses: [],
  5750. //>>excludeEnd("ide");
  5751. messageSends: []
  5752. }),
  5753. $globals.HashedCollectionTest);
  5754. $core.addMethod(
  5755. $core.method({
  5756. selector: "collectionOfPrintStrings",
  5757. protocol: 'fixture',
  5758. fn: function (){
  5759. var self=this;
  5760. var $1;
  5761. $1=$globals.HashedCollection._newFromPairs_(["b","1","a","2","c","3","d","-4"]);
  5762. return $1;
  5763. },
  5764. //>>excludeStart("ide", pragmas.excludeIdeData);
  5765. args: [],
  5766. source: "collectionOfPrintStrings\x0a\x09^ #{ 'b' -> '1'. 'a' -> '2'. 'c' -> '3'. 'd' -> '-4' }",
  5767. referencedClasses: [],
  5768. //>>excludeEnd("ide");
  5769. messageSends: []
  5770. }),
  5771. $globals.HashedCollectionTest);
  5772. $core.addMethod(
  5773. $core.method({
  5774. selector: "collectionSize",
  5775. protocol: 'fixture',
  5776. fn: function (){
  5777. var self=this;
  5778. return (4);
  5779. },
  5780. //>>excludeStart("ide", pragmas.excludeIdeData);
  5781. args: [],
  5782. source: "collectionSize\x0a\x09^ 4",
  5783. referencedClasses: [],
  5784. //>>excludeEnd("ide");
  5785. messageSends: []
  5786. }),
  5787. $globals.HashedCollectionTest);
  5788. $core.addMethod(
  5789. $core.method({
  5790. selector: "collectionValues",
  5791. protocol: 'fixture',
  5792. fn: function (){
  5793. var self=this;
  5794. var $1;
  5795. $1=[(1),(2),(3),(-4)];
  5796. return $1;
  5797. },
  5798. //>>excludeStart("ide", pragmas.excludeIdeData);
  5799. args: [],
  5800. source: "collectionValues\x0a\x09^ { 1. 2. 3. -4 }",
  5801. referencedClasses: [],
  5802. //>>excludeEnd("ide");
  5803. messageSends: []
  5804. }),
  5805. $globals.HashedCollectionTest);
  5806. $core.addMethod(
  5807. $core.method({
  5808. selector: "collectionWithDuplicates",
  5809. protocol: 'fixture',
  5810. fn: function (){
  5811. var self=this;
  5812. var $1;
  5813. $1=$globals.HashedCollection._newFromPairs_(["b",(1),"a",(2),"c",(3),"d",(-4),"e",(1),"f",(2),"g",(10)]);
  5814. return $1;
  5815. },
  5816. //>>excludeStart("ide", pragmas.excludeIdeData);
  5817. args: [],
  5818. source: "collectionWithDuplicates\x0a\x09^ #{ 'b' -> 1. 'a' -> 2. 'c' -> 3. 'd' -> -4. 'e' -> 1. 'f' -> 2. 'g' -> 10 }",
  5819. referencedClasses: [],
  5820. //>>excludeEnd("ide");
  5821. messageSends: []
  5822. }),
  5823. $globals.HashedCollectionTest);
  5824. $core.addMethod(
  5825. $core.method({
  5826. selector: "collectionWithNewValue",
  5827. protocol: 'fixture',
  5828. fn: function (){
  5829. var self=this;
  5830. var $1;
  5831. $1=$globals.HashedCollection._newFromPairs_(["b",(1),"a",(2),"c",(3),"d",(-4),"new","N"]);
  5832. return $1;
  5833. },
  5834. //>>excludeStart("ide", pragmas.excludeIdeData);
  5835. args: [],
  5836. source: "collectionWithNewValue\x0a\x09^ #{ 'b' -> 1. 'a' -> 2. 'c' -> 3. 'd' -> -4. 'new' -> 'N' }",
  5837. referencedClasses: [],
  5838. //>>excludeEnd("ide");
  5839. messageSends: []
  5840. }),
  5841. $globals.HashedCollectionTest);
  5842. $core.addMethod(
  5843. $core.method({
  5844. selector: "sampleNewValueAsCollection",
  5845. protocol: 'fixture',
  5846. fn: function (){
  5847. var self=this;
  5848. var $1;
  5849. $1=$globals.HashedCollection._newFromPairs_(["new","N"]);
  5850. return $1;
  5851. },
  5852. //>>excludeStart("ide", pragmas.excludeIdeData);
  5853. args: [],
  5854. source: "sampleNewValueAsCollection\x0a\x09^ #{ 'new' -> 'N' }",
  5855. referencedClasses: [],
  5856. //>>excludeEnd("ide");
  5857. messageSends: []
  5858. }),
  5859. $globals.HashedCollectionTest);
  5860. $core.addMethod(
  5861. $core.method({
  5862. selector: "testDynamicDictionaries",
  5863. protocol: 'tests',
  5864. fn: function (){
  5865. var self=this;
  5866. function $HashedCollection(){return $globals.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
  5867. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5868. return $core.withContext(function($ctx1) {
  5869. //>>excludeEnd("ctx");
  5870. self._assert_equals_($recv($globals.HashedCollection._newFromPairs_(["hello",(1)]))._asHashedCollection(),$recv($HashedCollection())._with_("hello".__minus_gt((1))));
  5871. return self;
  5872. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5873. }, function($ctx1) {$ctx1.fill(self,"testDynamicDictionaries",{},$globals.HashedCollectionTest)});
  5874. //>>excludeEnd("ctx");
  5875. },
  5876. //>>excludeStart("ide", pragmas.excludeIdeData);
  5877. args: [],
  5878. source: "testDynamicDictionaries\x0a\x09self assert: #{'hello' -> 1} asHashedCollection equals: (HashedCollection with: 'hello' -> 1)",
  5879. referencedClasses: ["HashedCollection"],
  5880. //>>excludeEnd("ide");
  5881. messageSends: ["assert:equals:", "asHashedCollection", "with:", "->"]
  5882. }),
  5883. $globals.HashedCollectionTest);
  5884. $core.addMethod(
  5885. $core.method({
  5886. selector: "collectionClass",
  5887. protocol: 'fixture',
  5888. fn: function (){
  5889. var self=this;
  5890. function $HashedCollection(){return $globals.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
  5891. return $HashedCollection();
  5892. },
  5893. //>>excludeStart("ide", pragmas.excludeIdeData);
  5894. args: [],
  5895. source: "collectionClass\x0a\x09^ HashedCollection",
  5896. referencedClasses: ["HashedCollection"],
  5897. //>>excludeEnd("ide");
  5898. messageSends: []
  5899. }),
  5900. $globals.HashedCollectionTest.klass);
  5901. $core.addClass('SequenceableCollectionTest', $globals.IndexableCollectionTest, [], 'Kernel-Tests');
  5902. $core.addMethod(
  5903. $core.method({
  5904. selector: "collectionFirst",
  5905. protocol: 'fixture',
  5906. fn: function (){
  5907. var self=this;
  5908. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5909. return $core.withContext(function($ctx1) {
  5910. //>>excludeEnd("ctx");
  5911. self._subclassResponsibility();
  5912. return self;
  5913. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5914. }, function($ctx1) {$ctx1.fill(self,"collectionFirst",{},$globals.SequenceableCollectionTest)});
  5915. //>>excludeEnd("ctx");
  5916. },
  5917. //>>excludeStart("ide", pragmas.excludeIdeData);
  5918. args: [],
  5919. source: "collectionFirst\x0a\x09self subclassResponsibility",
  5920. referencedClasses: [],
  5921. //>>excludeEnd("ide");
  5922. messageSends: ["subclassResponsibility"]
  5923. }),
  5924. $globals.SequenceableCollectionTest);
  5925. $core.addMethod(
  5926. $core.method({
  5927. selector: "collectionFirstTwo",
  5928. protocol: 'fixture',
  5929. fn: function (){
  5930. var self=this;
  5931. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5932. return $core.withContext(function($ctx1) {
  5933. //>>excludeEnd("ctx");
  5934. self._subclassResponsibility();
  5935. return self;
  5936. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5937. }, function($ctx1) {$ctx1.fill(self,"collectionFirstTwo",{},$globals.SequenceableCollectionTest)});
  5938. //>>excludeEnd("ctx");
  5939. },
  5940. //>>excludeStart("ide", pragmas.excludeIdeData);
  5941. args: [],
  5942. source: "collectionFirstTwo\x0a\x09self subclassResponsibility",
  5943. referencedClasses: [],
  5944. //>>excludeEnd("ide");
  5945. messageSends: ["subclassResponsibility"]
  5946. }),
  5947. $globals.SequenceableCollectionTest);
  5948. $core.addMethod(
  5949. $core.method({
  5950. selector: "collectionLast",
  5951. protocol: 'fixture',
  5952. fn: function (){
  5953. var self=this;
  5954. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5955. return $core.withContext(function($ctx1) {
  5956. //>>excludeEnd("ctx");
  5957. self._subclassResponsibility();
  5958. return self;
  5959. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5960. }, function($ctx1) {$ctx1.fill(self,"collectionLast",{},$globals.SequenceableCollectionTest)});
  5961. //>>excludeEnd("ctx");
  5962. },
  5963. //>>excludeStart("ide", pragmas.excludeIdeData);
  5964. args: [],
  5965. source: "collectionLast\x0a\x09self subclassResponsibility",
  5966. referencedClasses: [],
  5967. //>>excludeEnd("ide");
  5968. messageSends: ["subclassResponsibility"]
  5969. }),
  5970. $globals.SequenceableCollectionTest);
  5971. $core.addMethod(
  5972. $core.method({
  5973. selector: "collectionLastTwo",
  5974. protocol: 'fixture',
  5975. fn: function (){
  5976. var self=this;
  5977. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5978. return $core.withContext(function($ctx1) {
  5979. //>>excludeEnd("ctx");
  5980. self._subclassResponsibility();
  5981. return self;
  5982. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5983. }, function($ctx1) {$ctx1.fill(self,"collectionLastTwo",{},$globals.SequenceableCollectionTest)});
  5984. //>>excludeEnd("ctx");
  5985. },
  5986. //>>excludeStart("ide", pragmas.excludeIdeData);
  5987. args: [],
  5988. source: "collectionLastTwo\x0a\x09self subclassResponsibility",
  5989. referencedClasses: [],
  5990. //>>excludeEnd("ide");
  5991. messageSends: ["subclassResponsibility"]
  5992. }),
  5993. $globals.SequenceableCollectionTest);
  5994. $core.addMethod(
  5995. $core.method({
  5996. selector: "nonIndexesDo:",
  5997. protocol: 'fixture',
  5998. fn: function (aBlock){
  5999. var self=this;
  6000. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6001. return $core.withContext(function($ctx1) {
  6002. //>>excludeEnd("ctx");
  6003. $recv(aBlock)._value_((0));
  6004. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6005. $ctx1.sendIdx["value:"]=1;
  6006. //>>excludeEnd("ctx");
  6007. $recv(aBlock)._value_($recv(self._collectionSize()).__plus((1)));
  6008. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6009. $ctx1.sendIdx["value:"]=2;
  6010. //>>excludeEnd("ctx");
  6011. $recv(aBlock)._value_("z");
  6012. return self;
  6013. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6014. }, function($ctx1) {$ctx1.fill(self,"nonIndexesDo:",{aBlock:aBlock},$globals.SequenceableCollectionTest)});
  6015. //>>excludeEnd("ctx");
  6016. },
  6017. //>>excludeStart("ide", pragmas.excludeIdeData);
  6018. args: ["aBlock"],
  6019. source: "nonIndexesDo: aBlock\x0a\x09aBlock value: 0.\x0a\x09aBlock value: self collectionSize + 1.\x0a\x09aBlock value: 'z'",
  6020. referencedClasses: [],
  6021. //>>excludeEnd("ide");
  6022. messageSends: ["value:", "+", "collectionSize"]
  6023. }),
  6024. $globals.SequenceableCollectionTest);
  6025. $core.addMethod(
  6026. $core.method({
  6027. selector: "samplesDo:",
  6028. protocol: 'fixture',
  6029. fn: function (aBlock){
  6030. var self=this;
  6031. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6032. return $core.withContext(function($ctx1) {
  6033. //>>excludeEnd("ctx");
  6034. $recv(aBlock)._value_value_((1),self._collectionFirst());
  6035. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6036. $ctx1.sendIdx["value:value:"]=1;
  6037. //>>excludeEnd("ctx");
  6038. $recv(aBlock)._value_value_(self._collectionSize(),self._collectionLast());
  6039. return self;
  6040. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6041. }, function($ctx1) {$ctx1.fill(self,"samplesDo:",{aBlock:aBlock},$globals.SequenceableCollectionTest)});
  6042. //>>excludeEnd("ctx");
  6043. },
  6044. //>>excludeStart("ide", pragmas.excludeIdeData);
  6045. args: ["aBlock"],
  6046. source: "samplesDo: aBlock\x0a\x09aBlock value: 1 value: self collectionFirst.\x0a\x09aBlock value: self collectionSize value: self collectionLast",
  6047. referencedClasses: [],
  6048. //>>excludeEnd("ide");
  6049. messageSends: ["value:value:", "collectionFirst", "collectionSize", "collectionLast"]
  6050. }),
  6051. $globals.SequenceableCollectionTest);
  6052. $core.addMethod(
  6053. $core.method({
  6054. selector: "testBeginsWith",
  6055. protocol: 'tests',
  6056. fn: function (){
  6057. var self=this;
  6058. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6059. return $core.withContext(function($ctx1) {
  6060. //>>excludeEnd("ctx");
  6061. var $2,$1,$4,$5,$3,$7,$6;
  6062. $2=self._collection();
  6063. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6064. $ctx1.sendIdx["collection"]=1;
  6065. //>>excludeEnd("ctx");
  6066. $1=$recv($2)._beginsWith_($recv(self._collectionClass())._new());
  6067. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6068. $ctx1.sendIdx["beginsWith:"]=1;
  6069. //>>excludeEnd("ctx");
  6070. self._assert_($1);
  6071. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6072. $ctx1.sendIdx["assert:"]=1;
  6073. //>>excludeEnd("ctx");
  6074. $4=self._collection();
  6075. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6076. $ctx1.sendIdx["collection"]=2;
  6077. //>>excludeEnd("ctx");
  6078. $5=self._collection();
  6079. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6080. $ctx1.sendIdx["collection"]=3;
  6081. //>>excludeEnd("ctx");
  6082. $3=$recv($4)._beginsWith_($5);
  6083. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6084. $ctx1.sendIdx["beginsWith:"]=2;
  6085. //>>excludeEnd("ctx");
  6086. self._assert_($3);
  6087. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6088. $ctx1.sendIdx["assert:"]=2;
  6089. //>>excludeEnd("ctx");
  6090. $7=self._collection();
  6091. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6092. $ctx1.sendIdx["collection"]=4;
  6093. //>>excludeEnd("ctx");
  6094. $6=$recv($7)._beginsWith_(self._collectionFirstTwo());
  6095. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6096. $ctx1.sendIdx["beginsWith:"]=3;
  6097. //>>excludeEnd("ctx");
  6098. self._assert_($6);
  6099. self._deny_($recv(self._collection())._beginsWith_(self._collectionLastTwo()));
  6100. return self;
  6101. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6102. }, function($ctx1) {$ctx1.fill(self,"testBeginsWith",{},$globals.SequenceableCollectionTest)});
  6103. //>>excludeEnd("ctx");
  6104. },
  6105. //>>excludeStart("ide", pragmas.excludeIdeData);
  6106. args: [],
  6107. 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)",
  6108. referencedClasses: [],
  6109. //>>excludeEnd("ide");
  6110. messageSends: ["assert:", "beginsWith:", "collection", "new", "collectionClass", "collectionFirstTwo", "deny:", "collectionLastTwo"]
  6111. }),
  6112. $globals.SequenceableCollectionTest);
  6113. $core.addMethod(
  6114. $core.method({
  6115. selector: "testEndsWith",
  6116. protocol: 'tests',
  6117. fn: function (){
  6118. var self=this;
  6119. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6120. return $core.withContext(function($ctx1) {
  6121. //>>excludeEnd("ctx");
  6122. var $2,$1,$4,$5,$3,$7,$6;
  6123. $2=self._collection();
  6124. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6125. $ctx1.sendIdx["collection"]=1;
  6126. //>>excludeEnd("ctx");
  6127. $1=$recv($2)._endsWith_($recv(self._collectionClass())._new());
  6128. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6129. $ctx1.sendIdx["endsWith:"]=1;
  6130. //>>excludeEnd("ctx");
  6131. self._assert_($1);
  6132. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6133. $ctx1.sendIdx["assert:"]=1;
  6134. //>>excludeEnd("ctx");
  6135. $4=self._collection();
  6136. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6137. $ctx1.sendIdx["collection"]=2;
  6138. //>>excludeEnd("ctx");
  6139. $5=self._collection();
  6140. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6141. $ctx1.sendIdx["collection"]=3;
  6142. //>>excludeEnd("ctx");
  6143. $3=$recv($4)._endsWith_($5);
  6144. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6145. $ctx1.sendIdx["endsWith:"]=2;
  6146. //>>excludeEnd("ctx");
  6147. self._assert_($3);
  6148. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6149. $ctx1.sendIdx["assert:"]=2;
  6150. //>>excludeEnd("ctx");
  6151. $7=self._collection();
  6152. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6153. $ctx1.sendIdx["collection"]=4;
  6154. //>>excludeEnd("ctx");
  6155. $6=$recv($7)._endsWith_(self._collectionLastTwo());
  6156. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6157. $ctx1.sendIdx["endsWith:"]=3;
  6158. //>>excludeEnd("ctx");
  6159. self._assert_($6);
  6160. self._deny_($recv(self._collection())._endsWith_(self._collectionFirstTwo()));
  6161. return self;
  6162. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6163. }, function($ctx1) {$ctx1.fill(self,"testEndsWith",{},$globals.SequenceableCollectionTest)});
  6164. //>>excludeEnd("ctx");
  6165. },
  6166. //>>excludeStart("ide", pragmas.excludeIdeData);
  6167. args: [],
  6168. 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)",
  6169. referencedClasses: [],
  6170. //>>excludeEnd("ide");
  6171. messageSends: ["assert:", "endsWith:", "collection", "new", "collectionClass", "collectionLastTwo", "deny:", "collectionFirstTwo"]
  6172. }),
  6173. $globals.SequenceableCollectionTest);
  6174. $core.addMethod(
  6175. $core.method({
  6176. selector: "testFirst",
  6177. protocol: 'tests',
  6178. fn: function (){
  6179. var self=this;
  6180. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6181. return $core.withContext(function($ctx1) {
  6182. //>>excludeEnd("ctx");
  6183. self._assert_equals_($recv(self._collection())._first(),self._collectionFirst());
  6184. return self;
  6185. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6186. }, function($ctx1) {$ctx1.fill(self,"testFirst",{},$globals.SequenceableCollectionTest)});
  6187. //>>excludeEnd("ctx");
  6188. },
  6189. //>>excludeStart("ide", pragmas.excludeIdeData);
  6190. args: [],
  6191. source: "testFirst\x0a\x09self assert: self collection first equals: self collectionFirst",
  6192. referencedClasses: [],
  6193. //>>excludeEnd("ide");
  6194. messageSends: ["assert:equals:", "first", "collection", "collectionFirst"]
  6195. }),
  6196. $globals.SequenceableCollectionTest);
  6197. $core.addMethod(
  6198. $core.method({
  6199. selector: "testFirstN",
  6200. protocol: 'tests',
  6201. fn: function (){
  6202. var self=this;
  6203. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  6204. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6205. return $core.withContext(function($ctx1) {
  6206. //>>excludeEnd("ctx");
  6207. var $2,$1,$4,$3,$6,$5,$7;
  6208. $2=self._collection();
  6209. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6210. $ctx1.sendIdx["collection"]=1;
  6211. //>>excludeEnd("ctx");
  6212. $1=$recv($2)._first_((2));
  6213. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6214. $ctx1.sendIdx["first:"]=1;
  6215. //>>excludeEnd("ctx");
  6216. self._assert_equals_($1,self._collectionFirstTwo());
  6217. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6218. $ctx1.sendIdx["assert:equals:"]=1;
  6219. //>>excludeEnd("ctx");
  6220. $4=self._collection();
  6221. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6222. $ctx1.sendIdx["collection"]=2;
  6223. //>>excludeEnd("ctx");
  6224. $3=$recv($4)._first_((0));
  6225. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6226. $ctx1.sendIdx["first:"]=2;
  6227. //>>excludeEnd("ctx");
  6228. self._assert_equals_($3,$recv(self._collectionClass())._new());
  6229. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6230. $ctx1.sendIdx["assert:equals:"]=2;
  6231. //>>excludeEnd("ctx");
  6232. $6=self._collection();
  6233. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6234. $ctx1.sendIdx["collection"]=3;
  6235. //>>excludeEnd("ctx");
  6236. $5=$recv($6)._first_(self._collectionSize());
  6237. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6238. $ctx1.sendIdx["first:"]=3;
  6239. //>>excludeEnd("ctx");
  6240. $7=self._collection();
  6241. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6242. $ctx1.sendIdx["collection"]=4;
  6243. //>>excludeEnd("ctx");
  6244. self._assert_equals_($5,$7);
  6245. self._should_raise_((function(){
  6246. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6247. return $core.withContext(function($ctx2) {
  6248. //>>excludeEnd("ctx");
  6249. return $recv(self._collection())._first_((33));
  6250. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6251. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  6252. //>>excludeEnd("ctx");
  6253. }),$Error());
  6254. return self;
  6255. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6256. }, function($ctx1) {$ctx1.fill(self,"testFirstN",{},$globals.SequenceableCollectionTest)});
  6257. //>>excludeEnd("ctx");
  6258. },
  6259. //>>excludeStart("ide", pragmas.excludeIdeData);
  6260. args: [],
  6261. 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",
  6262. referencedClasses: ["Error"],
  6263. //>>excludeEnd("ide");
  6264. messageSends: ["assert:equals:", "first:", "collection", "collectionFirstTwo", "new", "collectionClass", "collectionSize", "should:raise:"]
  6265. }),
  6266. $globals.SequenceableCollectionTest);
  6267. $core.addMethod(
  6268. $core.method({
  6269. selector: "testFourth",
  6270. protocol: 'tests',
  6271. fn: function (){
  6272. var self=this;
  6273. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6274. return $core.withContext(function($ctx1) {
  6275. //>>excludeEnd("ctx");
  6276. var $2,$1;
  6277. $2=self._collection();
  6278. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6279. $ctx1.sendIdx["collection"]=1;
  6280. //>>excludeEnd("ctx");
  6281. $1=$recv($2)._fourth();
  6282. self._assert_equals_($1,$recv(self._collection())._at_((4)));
  6283. return self;
  6284. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6285. }, function($ctx1) {$ctx1.fill(self,"testFourth",{},$globals.SequenceableCollectionTest)});
  6286. //>>excludeEnd("ctx");
  6287. },
  6288. //>>excludeStart("ide", pragmas.excludeIdeData);
  6289. args: [],
  6290. source: "testFourth\x0a\x09self assert: (self collection fourth) equals: (self collection at: 4)",
  6291. referencedClasses: [],
  6292. //>>excludeEnd("ide");
  6293. messageSends: ["assert:equals:", "fourth", "collection", "at:"]
  6294. }),
  6295. $globals.SequenceableCollectionTest);
  6296. $core.addMethod(
  6297. $core.method({
  6298. selector: "testIndexOfStartingAt",
  6299. protocol: 'tests',
  6300. fn: function (){
  6301. var self=this;
  6302. var jsNull;
  6303. function $JSON(){return $globals.JSON||(typeof JSON=="undefined"?nil:JSON)}
  6304. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6305. return $core.withContext(function($ctx1) {
  6306. //>>excludeEnd("ctx");
  6307. var $2,$1,$4,$3;
  6308. jsNull=$recv($JSON())._parse_("null");
  6309. self._samplesDo_((function(index,value){
  6310. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6311. return $core.withContext(function($ctx2) {
  6312. //>>excludeEnd("ctx");
  6313. $2=self._collection();
  6314. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6315. $ctx2.sendIdx["collection"]=1;
  6316. //>>excludeEnd("ctx");
  6317. $1=$recv($2)._indexOf_startingAt_(value,(1));
  6318. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6319. $ctx2.sendIdx["indexOf:startingAt:"]=1;
  6320. //>>excludeEnd("ctx");
  6321. self._assert_equals_($1,index);
  6322. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6323. $ctx2.sendIdx["assert:equals:"]=1;
  6324. //>>excludeEnd("ctx");
  6325. $4=self._collection();
  6326. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6327. $ctx2.sendIdx["collection"]=2;
  6328. //>>excludeEnd("ctx");
  6329. $3=$recv($4)._indexOf_startingAt_(value,index);
  6330. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6331. $ctx2.sendIdx["indexOf:startingAt:"]=2;
  6332. //>>excludeEnd("ctx");
  6333. self._assert_equals_($3,index);
  6334. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6335. $ctx2.sendIdx["assert:equals:"]=2;
  6336. //>>excludeEnd("ctx");
  6337. return self._assert_equals_($recv(self._collection())._indexOf_startingAt_(value,$recv(index).__plus((1))),(0));
  6338. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6339. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,1)});
  6340. //>>excludeEnd("ctx");
  6341. }));
  6342. return self;
  6343. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6344. }, function($ctx1) {$ctx1.fill(self,"testIndexOfStartingAt",{jsNull:jsNull},$globals.SequenceableCollectionTest)});
  6345. //>>excludeEnd("ctx");
  6346. },
  6347. //>>excludeStart("ide", pragmas.excludeIdeData);
  6348. args: [],
  6349. 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 ]",
  6350. referencedClasses: ["JSON"],
  6351. //>>excludeEnd("ide");
  6352. messageSends: ["parse:", "samplesDo:", "assert:equals:", "indexOf:startingAt:", "collection", "+"]
  6353. }),
  6354. $globals.SequenceableCollectionTest);
  6355. $core.addMethod(
  6356. $core.method({
  6357. selector: "testIndexOfStartingAtWithNull",
  6358. protocol: 'tests',
  6359. fn: function (){
  6360. var self=this;
  6361. var jsNull;
  6362. function $JSON(){return $globals.JSON||(typeof JSON=="undefined"?nil:JSON)}
  6363. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6364. return $core.withContext(function($ctx1) {
  6365. //>>excludeEnd("ctx");
  6366. var $1,$2;
  6367. jsNull=$recv($JSON())._parse_("null");
  6368. self._samplesDo_((function(index,value){
  6369. var collection;
  6370. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6371. return $core.withContext(function($ctx2) {
  6372. //>>excludeEnd("ctx");
  6373. collection=self._collection();
  6374. collection;
  6375. $recv(collection)._at_put_(index,jsNull);
  6376. $1=$recv(collection)._indexOf_startingAt_(jsNull,(1));
  6377. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6378. $ctx2.sendIdx["indexOf:startingAt:"]=1;
  6379. //>>excludeEnd("ctx");
  6380. self._assert_equals_($1,index);
  6381. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6382. $ctx2.sendIdx["assert:equals:"]=1;
  6383. //>>excludeEnd("ctx");
  6384. $2=$recv(collection)._indexOf_startingAt_(jsNull,index);
  6385. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6386. $ctx2.sendIdx["indexOf:startingAt:"]=2;
  6387. //>>excludeEnd("ctx");
  6388. self._assert_equals_($2,index);
  6389. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6390. $ctx2.sendIdx["assert:equals:"]=2;
  6391. //>>excludeEnd("ctx");
  6392. return self._assert_equals_($recv(collection)._indexOf_startingAt_(jsNull,$recv(index).__plus((1))),(0));
  6393. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6394. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value,collection:collection},$ctx1,1)});
  6395. //>>excludeEnd("ctx");
  6396. }));
  6397. return self;
  6398. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6399. }, function($ctx1) {$ctx1.fill(self,"testIndexOfStartingAtWithNull",{jsNull:jsNull},$globals.SequenceableCollectionTest)});
  6400. //>>excludeEnd("ctx");
  6401. },
  6402. //>>excludeStart("ide", pragmas.excludeIdeData);
  6403. args: [],
  6404. 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 ]",
  6405. referencedClasses: ["JSON"],
  6406. //>>excludeEnd("ide");
  6407. messageSends: ["parse:", "samplesDo:", "collection", "at:put:", "assert:equals:", "indexOf:startingAt:", "+"]
  6408. }),
  6409. $globals.SequenceableCollectionTest);
  6410. $core.addMethod(
  6411. $core.method({
  6412. selector: "testLast",
  6413. protocol: 'tests',
  6414. fn: function (){
  6415. var self=this;
  6416. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6417. return $core.withContext(function($ctx1) {
  6418. //>>excludeEnd("ctx");
  6419. self._assert_equals_($recv(self._collection())._last(),self._collectionLast());
  6420. return self;
  6421. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6422. }, function($ctx1) {$ctx1.fill(self,"testLast",{},$globals.SequenceableCollectionTest)});
  6423. //>>excludeEnd("ctx");
  6424. },
  6425. //>>excludeStart("ide", pragmas.excludeIdeData);
  6426. args: [],
  6427. source: "testLast\x0a\x09self assert: self collection last equals: self collectionLast",
  6428. referencedClasses: [],
  6429. //>>excludeEnd("ide");
  6430. messageSends: ["assert:equals:", "last", "collection", "collectionLast"]
  6431. }),
  6432. $globals.SequenceableCollectionTest);
  6433. $core.addMethod(
  6434. $core.method({
  6435. selector: "testLastN",
  6436. protocol: 'tests',
  6437. fn: function (){
  6438. var self=this;
  6439. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  6440. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6441. return $core.withContext(function($ctx1) {
  6442. //>>excludeEnd("ctx");
  6443. var $2,$1,$4,$3,$6,$5,$7;
  6444. $2=self._collection();
  6445. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6446. $ctx1.sendIdx["collection"]=1;
  6447. //>>excludeEnd("ctx");
  6448. $1=$recv($2)._last_((2));
  6449. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6450. $ctx1.sendIdx["last:"]=1;
  6451. //>>excludeEnd("ctx");
  6452. self._assert_equals_($1,self._collectionLastTwo());
  6453. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6454. $ctx1.sendIdx["assert:equals:"]=1;
  6455. //>>excludeEnd("ctx");
  6456. $4=self._collection();
  6457. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6458. $ctx1.sendIdx["collection"]=2;
  6459. //>>excludeEnd("ctx");
  6460. $3=$recv($4)._last_((0));
  6461. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6462. $ctx1.sendIdx["last:"]=2;
  6463. //>>excludeEnd("ctx");
  6464. self._assert_equals_($3,$recv(self._collectionClass())._new());
  6465. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6466. $ctx1.sendIdx["assert:equals:"]=2;
  6467. //>>excludeEnd("ctx");
  6468. $6=self._collection();
  6469. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6470. $ctx1.sendIdx["collection"]=3;
  6471. //>>excludeEnd("ctx");
  6472. $5=$recv($6)._last_(self._collectionSize());
  6473. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6474. $ctx1.sendIdx["last:"]=3;
  6475. //>>excludeEnd("ctx");
  6476. $7=self._collection();
  6477. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6478. $ctx1.sendIdx["collection"]=4;
  6479. //>>excludeEnd("ctx");
  6480. self._assert_equals_($5,$7);
  6481. self._should_raise_((function(){
  6482. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6483. return $core.withContext(function($ctx2) {
  6484. //>>excludeEnd("ctx");
  6485. return $recv(self._collection())._last_((33));
  6486. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6487. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  6488. //>>excludeEnd("ctx");
  6489. }),$Error());
  6490. return self;
  6491. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6492. }, function($ctx1) {$ctx1.fill(self,"testLastN",{},$globals.SequenceableCollectionTest)});
  6493. //>>excludeEnd("ctx");
  6494. },
  6495. //>>excludeStart("ide", pragmas.excludeIdeData);
  6496. args: [],
  6497. 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",
  6498. referencedClasses: ["Error"],
  6499. //>>excludeEnd("ide");
  6500. messageSends: ["assert:equals:", "last:", "collection", "collectionLastTwo", "new", "collectionClass", "collectionSize", "should:raise:"]
  6501. }),
  6502. $globals.SequenceableCollectionTest);
  6503. $core.addMethod(
  6504. $core.method({
  6505. selector: "testRemoveAllFound",
  6506. protocol: 'tests',
  6507. fn: function (){
  6508. var self=this;
  6509. var original,part;
  6510. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  6511. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6512. return $core.withContext(function($ctx1) {
  6513. //>>excludeEnd("ctx");
  6514. original=[(1), (2), (3), (4), (5), (6), (7), (8), (9)];
  6515. part=[(2), (4), (6)];
  6516. $recv(original)._removeAllFoundIn_(part);
  6517. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6518. $ctx1.sendIdx["removeAllFoundIn:"]=1;
  6519. //>>excludeEnd("ctx");
  6520. self._shouldnt_raise_((function(){
  6521. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6522. return $core.withContext(function($ctx2) {
  6523. //>>excludeEnd("ctx");
  6524. return self._assert_($recv(part)._allSatisfy_((function(e){
  6525. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6526. return $core.withContext(function($ctx3) {
  6527. //>>excludeEnd("ctx");
  6528. return $recv($recv(original)._includes_(e))._not();
  6529. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6530. }, function($ctx3) {$ctx3.fillBlock({e:e},$ctx2,2)});
  6531. //>>excludeEnd("ctx");
  6532. })));
  6533. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6534. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  6535. //>>excludeEnd("ctx");
  6536. }),$Error());
  6537. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6538. $ctx1.sendIdx["shouldnt:raise:"]=1;
  6539. //>>excludeEnd("ctx");
  6540. self._shouldnt_raise_((function(){
  6541. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6542. return $core.withContext(function($ctx2) {
  6543. //>>excludeEnd("ctx");
  6544. return $recv(original)._removeAllFoundIn_([(11), (12)]);
  6545. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6546. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  6547. //>>excludeEnd("ctx");
  6548. }),$Error());
  6549. return self;
  6550. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6551. }, function($ctx1) {$ctx1.fill(self,"testRemoveAllFound",{original:original,part:part},$globals.SequenceableCollectionTest)});
  6552. //>>excludeEnd("ctx");
  6553. },
  6554. //>>excludeStart("ide", pragmas.excludeIdeData);
  6555. args: [],
  6556. source: "testRemoveAllFound\x0a\x0a\x09| original part |\x0a\x09\x0a\x09original := #( 1 2 3 4 5 6 7 8 9 ).\x0a\x09part := #( 2 4 6 ).\x0a\x09\x0a\x09original removeAllFoundIn: part.\x0a\x0a\x09self shouldnt: [ self assert: (part allSatisfy: [ :e | (original includes: e) not ]) ] raise: Error.\x0a\x09self shouldnt: [ original removeAllFoundIn: #( 11 12 ) ] raise: Error",
  6557. referencedClasses: ["Error"],
  6558. //>>excludeEnd("ide");
  6559. messageSends: ["removeAllFoundIn:", "shouldnt:raise:", "assert:", "allSatisfy:", "not", "includes:"]
  6560. }),
  6561. $globals.SequenceableCollectionTest);
  6562. $core.addMethod(
  6563. $core.method({
  6564. selector: "testRemoveAllSuch",
  6565. protocol: 'tests',
  6566. fn: function (){
  6567. var self=this;
  6568. var original,part;
  6569. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  6570. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6571. return $core.withContext(function($ctx1) {
  6572. //>>excludeEnd("ctx");
  6573. original=[(1), (2), (3), (4), (5), (6), (7), (8), (9)];
  6574. part=[(2), (4), (6)];
  6575. $recv(original)._removeAllSuchThat_((function(e){
  6576. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6577. return $core.withContext(function($ctx2) {
  6578. //>>excludeEnd("ctx");
  6579. return $recv(part)._includes_(e);
  6580. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6581. $ctx2.sendIdx["includes:"]=1;
  6582. //>>excludeEnd("ctx");
  6583. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6584. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1,1)});
  6585. //>>excludeEnd("ctx");
  6586. }));
  6587. self._shouldnt_raise_((function(){
  6588. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6589. return $core.withContext(function($ctx2) {
  6590. //>>excludeEnd("ctx");
  6591. return self._assert_($recv(part)._allSatisfy_((function(e){
  6592. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6593. return $core.withContext(function($ctx3) {
  6594. //>>excludeEnd("ctx");
  6595. return $recv($recv(original)._includes_(e))._not();
  6596. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6597. }, function($ctx3) {$ctx3.fillBlock({e:e},$ctx2,3)});
  6598. //>>excludeEnd("ctx");
  6599. })));
  6600. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6601. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  6602. //>>excludeEnd("ctx");
  6603. }),$Error());
  6604. return self;
  6605. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6606. }, function($ctx1) {$ctx1.fill(self,"testRemoveAllSuch",{original:original,part:part},$globals.SequenceableCollectionTest)});
  6607. //>>excludeEnd("ctx");
  6608. },
  6609. //>>excludeStart("ide", pragmas.excludeIdeData);
  6610. args: [],
  6611. source: "testRemoveAllSuch\x0a\x0a\x09| original part |\x0a\x09\x0a\x09original := #( 1 2 3 4 5 6 7 8 9 ).\x0a\x09part := #( 2 4 6 ).\x0a\x09\x0a\x09original removeAllSuchThat: [ :e | part includes: e ].\x0a\x0a\x09self shouldnt: [ self assert: (part allSatisfy: [ :e | (original includes: e) not ]) ] raise: Error.",
  6612. referencedClasses: ["Error"],
  6613. //>>excludeEnd("ide");
  6614. messageSends: ["removeAllSuchThat:", "includes:", "shouldnt:raise:", "assert:", "allSatisfy:", "not"]
  6615. }),
  6616. $globals.SequenceableCollectionTest);
  6617. $core.addMethod(
  6618. $core.method({
  6619. selector: "testRemoveAllUsingSome",
  6620. protocol: 'tests',
  6621. fn: function (){
  6622. var self=this;
  6623. var original,part;
  6624. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  6625. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6626. return $core.withContext(function($ctx1) {
  6627. //>>excludeEnd("ctx");
  6628. original=[(1), (2), (3), (4), (5), (6), (7), (8), (9)];
  6629. part=[(2), (4), (6)];
  6630. $recv(original)._removeAll_(part);
  6631. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6632. $ctx1.sendIdx["removeAll:"]=1;
  6633. //>>excludeEnd("ctx");
  6634. self._shouldnt_raise_((function(){
  6635. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6636. return $core.withContext(function($ctx2) {
  6637. //>>excludeEnd("ctx");
  6638. return self._assert_($recv(part)._allSatisfy_((function(e){
  6639. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6640. return $core.withContext(function($ctx3) {
  6641. //>>excludeEnd("ctx");
  6642. return $recv($recv(original)._includes_(e))._not();
  6643. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6644. }, function($ctx3) {$ctx3.fillBlock({e:e},$ctx2,2)});
  6645. //>>excludeEnd("ctx");
  6646. })));
  6647. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6648. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  6649. //>>excludeEnd("ctx");
  6650. }),$Error());
  6651. self._should_raise_((function(){
  6652. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6653. return $core.withContext(function($ctx2) {
  6654. //>>excludeEnd("ctx");
  6655. return $recv(original)._removeAll_([(11), (12)]);
  6656. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6657. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  6658. //>>excludeEnd("ctx");
  6659. }),$Error());
  6660. return self;
  6661. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6662. }, function($ctx1) {$ctx1.fill(self,"testRemoveAllUsingSome",{original:original,part:part},$globals.SequenceableCollectionTest)});
  6663. //>>excludeEnd("ctx");
  6664. },
  6665. //>>excludeStart("ide", pragmas.excludeIdeData);
  6666. args: [],
  6667. source: "testRemoveAllUsingSome\x0a\x0a\x09| original part |\x0a\x09\x0a\x09original := #( 1 2 3 4 5 6 7 8 9 ).\x0a\x09part := #( 2 4 6 ).\x0a\x09\x0a\x09original removeAll: part.\x0a\x0a\x09self shouldnt: [ self assert: (part allSatisfy: [ :e | (original includes: e) not ]) ] raise: Error.\x0a\x09self should: [ original removeAll: #( 11 12 ) ] raise: Error",
  6668. referencedClasses: ["Error"],
  6669. //>>excludeEnd("ide");
  6670. messageSends: ["removeAll:", "shouldnt:raise:", "assert:", "allSatisfy:", "not", "includes:", "should:raise:"]
  6671. }),
  6672. $globals.SequenceableCollectionTest);
  6673. $core.addMethod(
  6674. $core.method({
  6675. selector: "testSecond",
  6676. protocol: 'tests',
  6677. fn: function (){
  6678. var self=this;
  6679. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6680. return $core.withContext(function($ctx1) {
  6681. //>>excludeEnd("ctx");
  6682. var $2,$1;
  6683. $2=self._collection();
  6684. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6685. $ctx1.sendIdx["collection"]=1;
  6686. //>>excludeEnd("ctx");
  6687. $1=$recv($2)._second();
  6688. self._assert_equals_($1,$recv(self._collection())._at_((2)));
  6689. return self;
  6690. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6691. }, function($ctx1) {$ctx1.fill(self,"testSecond",{},$globals.SequenceableCollectionTest)});
  6692. //>>excludeEnd("ctx");
  6693. },
  6694. //>>excludeStart("ide", pragmas.excludeIdeData);
  6695. args: [],
  6696. source: "testSecond\x0a\x09self assert: (self collection second) equals: (self collection at: 2)",
  6697. referencedClasses: [],
  6698. //>>excludeEnd("ide");
  6699. messageSends: ["assert:equals:", "second", "collection", "at:"]
  6700. }),
  6701. $globals.SequenceableCollectionTest);
  6702. $core.addMethod(
  6703. $core.method({
  6704. selector: "testThird",
  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;
  6712. $2=self._collection();
  6713. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6714. $ctx1.sendIdx["collection"]=1;
  6715. //>>excludeEnd("ctx");
  6716. $1=$recv($2)._third();
  6717. self._assert_equals_($1,$recv(self._collection())._at_((3)));
  6718. return self;
  6719. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6720. }, function($ctx1) {$ctx1.fill(self,"testThird",{},$globals.SequenceableCollectionTest)});
  6721. //>>excludeEnd("ctx");
  6722. },
  6723. //>>excludeStart("ide", pragmas.excludeIdeData);
  6724. args: [],
  6725. source: "testThird\x0a\x09self assert: (self collection third) equals: (self collection at: 3)",
  6726. referencedClasses: [],
  6727. //>>excludeEnd("ide");
  6728. messageSends: ["assert:equals:", "third", "collection", "at:"]
  6729. }),
  6730. $globals.SequenceableCollectionTest);
  6731. $core.addClass('ArrayTest', $globals.SequenceableCollectionTest, [], 'Kernel-Tests');
  6732. $core.addMethod(
  6733. $core.method({
  6734. selector: "collection",
  6735. protocol: 'fixture',
  6736. fn: function (){
  6737. var self=this;
  6738. var $1;
  6739. $1=[(1), (2), (3), (-4)];
  6740. return $1;
  6741. },
  6742. //>>excludeStart("ide", pragmas.excludeIdeData);
  6743. args: [],
  6744. source: "collection\x0a\x09^ #(1 2 3 -4)",
  6745. referencedClasses: [],
  6746. //>>excludeEnd("ide");
  6747. messageSends: []
  6748. }),
  6749. $globals.ArrayTest);
  6750. $core.addMethod(
  6751. $core.method({
  6752. selector: "collectionFirst",
  6753. protocol: 'fixture',
  6754. fn: function (){
  6755. var self=this;
  6756. return (1);
  6757. },
  6758. //>>excludeStart("ide", pragmas.excludeIdeData);
  6759. args: [],
  6760. source: "collectionFirst\x0a\x09^ 1",
  6761. referencedClasses: [],
  6762. //>>excludeEnd("ide");
  6763. messageSends: []
  6764. }),
  6765. $globals.ArrayTest);
  6766. $core.addMethod(
  6767. $core.method({
  6768. selector: "collectionFirstTwo",
  6769. protocol: 'fixture',
  6770. fn: function (){
  6771. var self=this;
  6772. var $1;
  6773. $1=[(1), (2)];
  6774. return $1;
  6775. },
  6776. //>>excludeStart("ide", pragmas.excludeIdeData);
  6777. args: [],
  6778. source: "collectionFirstTwo\x0a\x09^ #(1 2)",
  6779. referencedClasses: [],
  6780. //>>excludeEnd("ide");
  6781. messageSends: []
  6782. }),
  6783. $globals.ArrayTest);
  6784. $core.addMethod(
  6785. $core.method({
  6786. selector: "collectionLast",
  6787. protocol: 'fixture',
  6788. fn: function (){
  6789. var self=this;
  6790. return (-4);
  6791. },
  6792. //>>excludeStart("ide", pragmas.excludeIdeData);
  6793. args: [],
  6794. source: "collectionLast\x0a\x09^ -4",
  6795. referencedClasses: [],
  6796. //>>excludeEnd("ide");
  6797. messageSends: []
  6798. }),
  6799. $globals.ArrayTest);
  6800. $core.addMethod(
  6801. $core.method({
  6802. selector: "collectionLastTwo",
  6803. protocol: 'fixture',
  6804. fn: function (){
  6805. var self=this;
  6806. var $1;
  6807. $1=[(3), (-4)];
  6808. return $1;
  6809. },
  6810. //>>excludeStart("ide", pragmas.excludeIdeData);
  6811. args: [],
  6812. source: "collectionLastTwo\x0a\x09^ #(3 -4)",
  6813. referencedClasses: [],
  6814. //>>excludeEnd("ide");
  6815. messageSends: []
  6816. }),
  6817. $globals.ArrayTest);
  6818. $core.addMethod(
  6819. $core.method({
  6820. selector: "collectionOfPrintStrings",
  6821. protocol: 'fixture',
  6822. fn: function (){
  6823. var self=this;
  6824. var $1;
  6825. $1=["1", "2", "3", "-4"];
  6826. return $1;
  6827. },
  6828. //>>excludeStart("ide", pragmas.excludeIdeData);
  6829. args: [],
  6830. source: "collectionOfPrintStrings\x0a\x09^ #('1' '2' '3' '-4')",
  6831. referencedClasses: [],
  6832. //>>excludeEnd("ide");
  6833. messageSends: []
  6834. }),
  6835. $globals.ArrayTest);
  6836. $core.addMethod(
  6837. $core.method({
  6838. selector: "collectionSize",
  6839. protocol: 'fixture',
  6840. fn: function (){
  6841. var self=this;
  6842. return (4);
  6843. },
  6844. //>>excludeStart("ide", pragmas.excludeIdeData);
  6845. args: [],
  6846. source: "collectionSize\x0a\x09^ 4",
  6847. referencedClasses: [],
  6848. //>>excludeEnd("ide");
  6849. messageSends: []
  6850. }),
  6851. $globals.ArrayTest);
  6852. $core.addMethod(
  6853. $core.method({
  6854. selector: "collectionWithDuplicates",
  6855. protocol: 'fixture',
  6856. fn: function (){
  6857. var self=this;
  6858. var $1;
  6859. $1=["a", "b", "c", (1), (2), (1), "a"];
  6860. return $1;
  6861. },
  6862. //>>excludeStart("ide", pragmas.excludeIdeData);
  6863. args: [],
  6864. source: "collectionWithDuplicates\x0a\x09^ #('a' 'b' 'c' 1 2 1 'a')",
  6865. referencedClasses: [],
  6866. //>>excludeEnd("ide");
  6867. messageSends: []
  6868. }),
  6869. $globals.ArrayTest);
  6870. $core.addMethod(
  6871. $core.method({
  6872. selector: "collectionWithNewValue",
  6873. protocol: 'fixture',
  6874. fn: function (){
  6875. var self=this;
  6876. var $1;
  6877. $1=[(1), (2), (3), (-4), "N"];
  6878. return $1;
  6879. },
  6880. //>>excludeStart("ide", pragmas.excludeIdeData);
  6881. args: [],
  6882. source: "collectionWithNewValue\x0a\x09^ #(1 2 3 -4 'N')",
  6883. referencedClasses: [],
  6884. //>>excludeEnd("ide");
  6885. messageSends: []
  6886. }),
  6887. $globals.ArrayTest);
  6888. $core.addMethod(
  6889. $core.method({
  6890. selector: "sampleNewIndex",
  6891. protocol: 'fixture',
  6892. fn: function (){
  6893. var self=this;
  6894. return (5);
  6895. },
  6896. //>>excludeStart("ide", pragmas.excludeIdeData);
  6897. args: [],
  6898. source: "sampleNewIndex\x0a\x09^ 5",
  6899. referencedClasses: [],
  6900. //>>excludeEnd("ide");
  6901. messageSends: []
  6902. }),
  6903. $globals.ArrayTest);
  6904. $core.addMethod(
  6905. $core.method({
  6906. selector: "samplesDo:",
  6907. protocol: 'fixture',
  6908. fn: function (aBlock){
  6909. var self=this;
  6910. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6911. return $core.withContext(function($ctx1) {
  6912. //>>excludeEnd("ctx");
  6913. (
  6914. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6915. $ctx1.supercall = true,
  6916. //>>excludeEnd("ctx");
  6917. $globals.ArrayTest.superclass.fn.prototype._samplesDo_.apply($recv(self), [aBlock]));
  6918. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6919. $ctx1.supercall = false;
  6920. //>>excludeEnd("ctx");;
  6921. $recv(aBlock)._value_value_((3),(3));
  6922. return self;
  6923. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6924. }, function($ctx1) {$ctx1.fill(self,"samplesDo:",{aBlock:aBlock},$globals.ArrayTest)});
  6925. //>>excludeEnd("ctx");
  6926. },
  6927. //>>excludeStart("ide", pragmas.excludeIdeData);
  6928. args: ["aBlock"],
  6929. source: "samplesDo: aBlock\x0a\x09super samplesDo: aBlock.\x0a\x09aBlock value: 3 value: 3.",
  6930. referencedClasses: [],
  6931. //>>excludeEnd("ide");
  6932. messageSends: ["samplesDo:", "value:value:"]
  6933. }),
  6934. $globals.ArrayTest);
  6935. $core.addMethod(
  6936. $core.method({
  6937. selector: "testAdd",
  6938. protocol: 'tests',
  6939. fn: function (){
  6940. var self=this;
  6941. var array;
  6942. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6943. return $core.withContext(function($ctx1) {
  6944. //>>excludeEnd("ctx");
  6945. array=self._collection();
  6946. $recv(array)._add_((6));
  6947. self._assert_equals_($recv(array)._last(),(6));
  6948. return self;
  6949. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6950. }, function($ctx1) {$ctx1.fill(self,"testAdd",{array:array},$globals.ArrayTest)});
  6951. //>>excludeEnd("ctx");
  6952. },
  6953. //>>excludeStart("ide", pragmas.excludeIdeData);
  6954. args: [],
  6955. source: "testAdd \x0a\x09| array | \x0a\x09array := self collection. \x0a\x09array add: 6.\x0a\x09\x0a\x09self assert: array last equals: 6",
  6956. referencedClasses: [],
  6957. //>>excludeEnd("ide");
  6958. messageSends: ["collection", "add:", "assert:equals:", "last"]
  6959. }),
  6960. $globals.ArrayTest);
  6961. $core.addMethod(
  6962. $core.method({
  6963. selector: "testAddFirst",
  6964. protocol: 'tests',
  6965. fn: function (){
  6966. var self=this;
  6967. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6968. return $core.withContext(function($ctx1) {
  6969. //>>excludeEnd("ctx");
  6970. var $1,$2;
  6971. $1=self._collection();
  6972. $recv($1)._addFirst_((0));
  6973. $2=$recv($1)._yourself();
  6974. self._assert_equals_($recv($2)._first(),(0));
  6975. return self;
  6976. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6977. }, function($ctx1) {$ctx1.fill(self,"testAddFirst",{},$globals.ArrayTest)});
  6978. //>>excludeEnd("ctx");
  6979. },
  6980. //>>excludeStart("ide", pragmas.excludeIdeData);
  6981. args: [],
  6982. source: "testAddFirst\x0a\x09self assert: (self collection addFirst: 0; yourself) first equals: 0",
  6983. referencedClasses: [],
  6984. //>>excludeEnd("ide");
  6985. messageSends: ["assert:equals:", "first", "addFirst:", "collection", "yourself"]
  6986. }),
  6987. $globals.ArrayTest);
  6988. $core.addMethod(
  6989. $core.method({
  6990. selector: "testPrintString",
  6991. protocol: 'tests',
  6992. fn: function (){
  6993. var self=this;
  6994. var array;
  6995. function $Array(){return $globals.Array||(typeof Array=="undefined"?nil:Array)}
  6996. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6997. return $core.withContext(function($ctx1) {
  6998. //>>excludeEnd("ctx");
  6999. var $1,$2,$3,$4,$5,$6,$7,$8,$9;
  7000. array=$recv($Array())._new();
  7001. $1=$recv(array)._printString();
  7002. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7003. $ctx1.sendIdx["printString"]=1;
  7004. //>>excludeEnd("ctx");
  7005. self._assert_equals_($1,"an Array ()");
  7006. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7007. $ctx1.sendIdx["assert:equals:"]=1;
  7008. //>>excludeEnd("ctx");
  7009. $2=array;
  7010. $recv($2)._add_((1));
  7011. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7012. $ctx1.sendIdx["add:"]=1;
  7013. //>>excludeEnd("ctx");
  7014. $3=$recv($2)._add_((3));
  7015. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7016. $ctx1.sendIdx["add:"]=2;
  7017. //>>excludeEnd("ctx");
  7018. $4=$recv(array)._printString();
  7019. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7020. $ctx1.sendIdx["printString"]=2;
  7021. //>>excludeEnd("ctx");
  7022. self._assert_equals_($4,"an Array (1 3)");
  7023. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7024. $ctx1.sendIdx["assert:equals:"]=2;
  7025. //>>excludeEnd("ctx");
  7026. $recv(array)._add_("foo");
  7027. $5=$recv(array)._printString();
  7028. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7029. $ctx1.sendIdx["printString"]=3;
  7030. //>>excludeEnd("ctx");
  7031. self._assert_equals_($5,"an Array (1 3 'foo')");
  7032. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7033. $ctx1.sendIdx["assert:equals:"]=3;
  7034. //>>excludeEnd("ctx");
  7035. $6=array;
  7036. $recv($6)._remove_((1));
  7037. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7038. $ctx1.sendIdx["remove:"]=1;
  7039. //>>excludeEnd("ctx");
  7040. $7=$recv($6)._remove_((3));
  7041. $8=$recv(array)._printString();
  7042. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7043. $ctx1.sendIdx["printString"]=4;
  7044. //>>excludeEnd("ctx");
  7045. self._assert_equals_($8,"an Array ('foo')");
  7046. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7047. $ctx1.sendIdx["assert:equals:"]=4;
  7048. //>>excludeEnd("ctx");
  7049. $recv(array)._addLast_((3));
  7050. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7051. $ctx1.sendIdx["addLast:"]=1;
  7052. //>>excludeEnd("ctx");
  7053. $9=$recv(array)._printString();
  7054. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7055. $ctx1.sendIdx["printString"]=5;
  7056. //>>excludeEnd("ctx");
  7057. self._assert_equals_($9,"an Array ('foo' 3)");
  7058. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7059. $ctx1.sendIdx["assert:equals:"]=5;
  7060. //>>excludeEnd("ctx");
  7061. $recv(array)._addLast_((3));
  7062. self._assert_equals_($recv(array)._printString(),"an Array ('foo' 3 3)");
  7063. return self;
  7064. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7065. }, function($ctx1) {$ctx1.fill(self,"testPrintString",{array:array},$globals.ArrayTest)});
  7066. //>>excludeEnd("ctx");
  7067. },
  7068. //>>excludeStart("ide", pragmas.excludeIdeData);
  7069. args: [],
  7070. 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)'.",
  7071. referencedClasses: ["Array"],
  7072. //>>excludeEnd("ide");
  7073. messageSends: ["new", "assert:equals:", "printString", "add:", "remove:", "addLast:"]
  7074. }),
  7075. $globals.ArrayTest);
  7076. $core.addMethod(
  7077. $core.method({
  7078. selector: "testRemove",
  7079. protocol: 'tests',
  7080. fn: function (){
  7081. var self=this;
  7082. var array;
  7083. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  7084. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7085. return $core.withContext(function($ctx1) {
  7086. //>>excludeEnd("ctx");
  7087. array=[(1), (2), (3), (4), (5)];
  7088. $recv(array)._remove_((3));
  7089. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7090. $ctx1.sendIdx["remove:"]=1;
  7091. //>>excludeEnd("ctx");
  7092. self._assert_equals_(array,[(1), (2), (4), (5)]);
  7093. self._should_raise_((function(){
  7094. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7095. return $core.withContext(function($ctx2) {
  7096. //>>excludeEnd("ctx");
  7097. return $recv(array)._remove_((3));
  7098. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7099. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  7100. //>>excludeEnd("ctx");
  7101. }),$Error());
  7102. return self;
  7103. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7104. }, function($ctx1) {$ctx1.fill(self,"testRemove",{array:array},$globals.ArrayTest)});
  7105. //>>excludeEnd("ctx");
  7106. },
  7107. //>>excludeStart("ide", pragmas.excludeIdeData);
  7108. args: [],
  7109. 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",
  7110. referencedClasses: ["Error"],
  7111. //>>excludeEnd("ide");
  7112. messageSends: ["remove:", "assert:equals:", "should:raise:"]
  7113. }),
  7114. $globals.ArrayTest);
  7115. $core.addMethod(
  7116. $core.method({
  7117. selector: "testRemoveFromTo",
  7118. protocol: 'tests',
  7119. fn: function (){
  7120. var self=this;
  7121. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7122. return $core.withContext(function($ctx1) {
  7123. //>>excludeEnd("ctx");
  7124. var $1,$2;
  7125. $1=[(1), (2), (3), (4)]._removeFrom_to_((1),(3));
  7126. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7127. $ctx1.sendIdx["removeFrom:to:"]=1;
  7128. //>>excludeEnd("ctx");
  7129. self._assert_equals_($1,[(4)]);
  7130. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7131. $ctx1.sendIdx["assert:equals:"]=1;
  7132. //>>excludeEnd("ctx");
  7133. $2=[(1), (2), (3), (4)]._removeFrom_to_((2),(3));
  7134. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7135. $ctx1.sendIdx["removeFrom:to:"]=2;
  7136. //>>excludeEnd("ctx");
  7137. self._assert_equals_($2,[(1), (4)]);
  7138. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7139. $ctx1.sendIdx["assert:equals:"]=2;
  7140. //>>excludeEnd("ctx");
  7141. self._assert_equals_([(1), (2), (3), (4)]._removeFrom_to_((2),(4)),[(1)]);
  7142. return self;
  7143. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7144. }, function($ctx1) {$ctx1.fill(self,"testRemoveFromTo",{},$globals.ArrayTest)});
  7145. //>>excludeEnd("ctx");
  7146. },
  7147. //>>excludeStart("ide", pragmas.excludeIdeData);
  7148. args: [],
  7149. 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)",
  7150. referencedClasses: [],
  7151. //>>excludeEnd("ide");
  7152. messageSends: ["assert:equals:", "removeFrom:to:"]
  7153. }),
  7154. $globals.ArrayTest);
  7155. $core.addMethod(
  7156. $core.method({
  7157. selector: "testRemoveIndex",
  7158. protocol: 'tests',
  7159. fn: function (){
  7160. var self=this;
  7161. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7162. return $core.withContext(function($ctx1) {
  7163. //>>excludeEnd("ctx");
  7164. var $1,$2;
  7165. $1=[(1), (2), (3), (4)]._removeIndex_((2));
  7166. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7167. $ctx1.sendIdx["removeIndex:"]=1;
  7168. //>>excludeEnd("ctx");
  7169. self._assert_equals_($1,[(1), (3), (4)]);
  7170. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7171. $ctx1.sendIdx["assert:equals:"]=1;
  7172. //>>excludeEnd("ctx");
  7173. $2=[(1), (2), (3), (4)]._removeIndex_((1));
  7174. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7175. $ctx1.sendIdx["removeIndex:"]=2;
  7176. //>>excludeEnd("ctx");
  7177. self._assert_equals_($2,[(2), (3), (4)]);
  7178. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7179. $ctx1.sendIdx["assert:equals:"]=2;
  7180. //>>excludeEnd("ctx");
  7181. self._assert_equals_(["hello"]._removeIndex_((1)),[]);
  7182. return self;
  7183. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7184. }, function($ctx1) {$ctx1.fill(self,"testRemoveIndex",{},$globals.ArrayTest)});
  7185. //>>excludeEnd("ctx");
  7186. },
  7187. //>>excludeStart("ide", pragmas.excludeIdeData);
  7188. args: [],
  7189. 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: #()",
  7190. referencedClasses: [],
  7191. //>>excludeEnd("ide");
  7192. messageSends: ["assert:equals:", "removeIndex:"]
  7193. }),
  7194. $globals.ArrayTest);
  7195. $core.addMethod(
  7196. $core.method({
  7197. selector: "testRemoveLast",
  7198. protocol: 'tests',
  7199. fn: function (){
  7200. var self=this;
  7201. var array;
  7202. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7203. return $core.withContext(function($ctx1) {
  7204. //>>excludeEnd("ctx");
  7205. array=[(1), (2)];
  7206. $recv(array)._removeLast();
  7207. self._assert_equals_($recv(array)._last(),(1));
  7208. return self;
  7209. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7210. }, function($ctx1) {$ctx1.fill(self,"testRemoveLast",{array:array},$globals.ArrayTest)});
  7211. //>>excludeEnd("ctx");
  7212. },
  7213. //>>excludeStart("ide", pragmas.excludeIdeData);
  7214. args: [],
  7215. source: "testRemoveLast \x0a\x09| array |\x0a\x09array := #(1 2). \x0a\x09array removeLast.\x0a\x09\x0a\x09self assert: array last equals: 1",
  7216. referencedClasses: [],
  7217. //>>excludeEnd("ide");
  7218. messageSends: ["removeLast", "assert:equals:", "last"]
  7219. }),
  7220. $globals.ArrayTest);
  7221. $core.addMethod(
  7222. $core.method({
  7223. selector: "testReversed",
  7224. protocol: 'tests',
  7225. fn: function (){
  7226. var self=this;
  7227. var array;
  7228. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7229. return $core.withContext(function($ctx1) {
  7230. //>>excludeEnd("ctx");
  7231. array=[(5), (4), (3), (2), (1)];
  7232. self._assert_equals_($recv(array)._reversed(),[(1), (2), (3), (4), (5)]);
  7233. return self;
  7234. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7235. }, function($ctx1) {$ctx1.fill(self,"testReversed",{array:array},$globals.ArrayTest)});
  7236. //>>excludeEnd("ctx");
  7237. },
  7238. //>>excludeStart("ide", pragmas.excludeIdeData);
  7239. args: [],
  7240. source: "testReversed\x0a\x09|array|\x0a\x09array := #(5 4 3 2 1). \x0a\x09self assert: (array reversed) equals: #(1 2 3 4 5)",
  7241. referencedClasses: [],
  7242. //>>excludeEnd("ide");
  7243. messageSends: ["assert:equals:", "reversed"]
  7244. }),
  7245. $globals.ArrayTest);
  7246. $core.addMethod(
  7247. $core.method({
  7248. selector: "testSort",
  7249. protocol: 'tests',
  7250. fn: function (){
  7251. var self=this;
  7252. var array;
  7253. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7254. return $core.withContext(function($ctx1) {
  7255. //>>excludeEnd("ctx");
  7256. array=[(10), (1), (5)];
  7257. $recv(array)._sort();
  7258. self._assert_equals_(array,[(1), (5), (10)]);
  7259. return self;
  7260. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7261. }, function($ctx1) {$ctx1.fill(self,"testSort",{array:array},$globals.ArrayTest)});
  7262. //>>excludeEnd("ctx");
  7263. },
  7264. //>>excludeStart("ide", pragmas.excludeIdeData);
  7265. args: [],
  7266. source: "testSort\x0a\x09| array |\x0a\x09array := #(10 1 5). \x0a\x09array sort.\x0a\x09self assert: array equals: #(1 5 10)",
  7267. referencedClasses: [],
  7268. //>>excludeEnd("ide");
  7269. messageSends: ["sort", "assert:equals:"]
  7270. }),
  7271. $globals.ArrayTest);
  7272. $core.addMethod(
  7273. $core.method({
  7274. selector: "collectionClass",
  7275. protocol: 'fixture',
  7276. fn: function (){
  7277. var self=this;
  7278. function $Array(){return $globals.Array||(typeof Array=="undefined"?nil:Array)}
  7279. return $Array();
  7280. },
  7281. //>>excludeStart("ide", pragmas.excludeIdeData);
  7282. args: [],
  7283. source: "collectionClass\x0a\x09^ Array",
  7284. referencedClasses: ["Array"],
  7285. //>>excludeEnd("ide");
  7286. messageSends: []
  7287. }),
  7288. $globals.ArrayTest.klass);
  7289. $core.addClass('StringTest', $globals.SequenceableCollectionTest, [], 'Kernel-Tests');
  7290. $core.addMethod(
  7291. $core.method({
  7292. selector: "collection",
  7293. protocol: 'fixture',
  7294. fn: function (){
  7295. var self=this;
  7296. return "helLo";
  7297. },
  7298. //>>excludeStart("ide", pragmas.excludeIdeData);
  7299. args: [],
  7300. source: "collection\x0a\x09^ 'helLo'",
  7301. referencedClasses: [],
  7302. //>>excludeEnd("ide");
  7303. messageSends: []
  7304. }),
  7305. $globals.StringTest);
  7306. $core.addMethod(
  7307. $core.method({
  7308. selector: "collectionFirst",
  7309. protocol: 'fixture',
  7310. fn: function (){
  7311. var self=this;
  7312. return "h";
  7313. },
  7314. //>>excludeStart("ide", pragmas.excludeIdeData);
  7315. args: [],
  7316. source: "collectionFirst\x0a\x09^ 'h'",
  7317. referencedClasses: [],
  7318. //>>excludeEnd("ide");
  7319. messageSends: []
  7320. }),
  7321. $globals.StringTest);
  7322. $core.addMethod(
  7323. $core.method({
  7324. selector: "collectionFirstTwo",
  7325. protocol: 'fixture',
  7326. fn: function (){
  7327. var self=this;
  7328. return "he";
  7329. },
  7330. //>>excludeStart("ide", pragmas.excludeIdeData);
  7331. args: [],
  7332. source: "collectionFirstTwo\x0a\x09^ 'he'",
  7333. referencedClasses: [],
  7334. //>>excludeEnd("ide");
  7335. messageSends: []
  7336. }),
  7337. $globals.StringTest);
  7338. $core.addMethod(
  7339. $core.method({
  7340. selector: "collectionLast",
  7341. protocol: 'fixture',
  7342. fn: function (){
  7343. var self=this;
  7344. return "o";
  7345. },
  7346. //>>excludeStart("ide", pragmas.excludeIdeData);
  7347. args: [],
  7348. source: "collectionLast\x0a\x09^ 'o'",
  7349. referencedClasses: [],
  7350. //>>excludeEnd("ide");
  7351. messageSends: []
  7352. }),
  7353. $globals.StringTest);
  7354. $core.addMethod(
  7355. $core.method({
  7356. selector: "collectionLastTwo",
  7357. protocol: 'fixture',
  7358. fn: function (){
  7359. var self=this;
  7360. return "Lo";
  7361. },
  7362. //>>excludeStart("ide", pragmas.excludeIdeData);
  7363. args: [],
  7364. source: "collectionLastTwo\x0a\x09^ 'Lo'",
  7365. referencedClasses: [],
  7366. //>>excludeEnd("ide");
  7367. messageSends: []
  7368. }),
  7369. $globals.StringTest);
  7370. $core.addMethod(
  7371. $core.method({
  7372. selector: "collectionOfPrintStrings",
  7373. protocol: 'fixture',
  7374. fn: function (){
  7375. var self=this;
  7376. return "'h''e''l''L''o'";
  7377. },
  7378. //>>excludeStart("ide", pragmas.excludeIdeData);
  7379. args: [],
  7380. source: "collectionOfPrintStrings\x0a\x09^ '''h''''e''''l''''L''''o'''",
  7381. referencedClasses: [],
  7382. //>>excludeEnd("ide");
  7383. messageSends: []
  7384. }),
  7385. $globals.StringTest);
  7386. $core.addMethod(
  7387. $core.method({
  7388. selector: "collectionSize",
  7389. protocol: 'fixture',
  7390. fn: function (){
  7391. var self=this;
  7392. return (5);
  7393. },
  7394. //>>excludeStart("ide", pragmas.excludeIdeData);
  7395. args: [],
  7396. source: "collectionSize\x0a\x09^ 5",
  7397. referencedClasses: [],
  7398. //>>excludeEnd("ide");
  7399. messageSends: []
  7400. }),
  7401. $globals.StringTest);
  7402. $core.addMethod(
  7403. $core.method({
  7404. selector: "collectionWithDuplicates",
  7405. protocol: 'fixture',
  7406. fn: function (){
  7407. var self=this;
  7408. return "abbaerte";
  7409. },
  7410. //>>excludeStart("ide", pragmas.excludeIdeData);
  7411. args: [],
  7412. source: "collectionWithDuplicates\x0a\x09^ 'abbaerte'",
  7413. referencedClasses: [],
  7414. //>>excludeEnd("ide");
  7415. messageSends: []
  7416. }),
  7417. $globals.StringTest);
  7418. $core.addMethod(
  7419. $core.method({
  7420. selector: "collectionWithNewValue",
  7421. protocol: 'fixture',
  7422. fn: function (){
  7423. var self=this;
  7424. return "helLoN";
  7425. },
  7426. //>>excludeStart("ide", pragmas.excludeIdeData);
  7427. args: [],
  7428. source: "collectionWithNewValue\x0a\x09^ 'helLoN'",
  7429. referencedClasses: [],
  7430. //>>excludeEnd("ide");
  7431. messageSends: []
  7432. }),
  7433. $globals.StringTest);
  7434. $core.addMethod(
  7435. $core.method({
  7436. selector: "sampleNewValueAsCollection",
  7437. protocol: 'fixture',
  7438. fn: function (){
  7439. var self=this;
  7440. return "N";
  7441. },
  7442. //>>excludeStart("ide", pragmas.excludeIdeData);
  7443. args: [],
  7444. source: "sampleNewValueAsCollection\x0a\x09^ 'N'",
  7445. referencedClasses: [],
  7446. //>>excludeEnd("ide");
  7447. messageSends: []
  7448. }),
  7449. $globals.StringTest);
  7450. $core.addMethod(
  7451. $core.method({
  7452. selector: "samplesDo:",
  7453. protocol: 'fixture',
  7454. fn: function (aBlock){
  7455. var self=this;
  7456. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7457. return $core.withContext(function($ctx1) {
  7458. //>>excludeEnd("ctx");
  7459. (
  7460. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7461. $ctx1.supercall = true,
  7462. //>>excludeEnd("ctx");
  7463. $globals.StringTest.superclass.fn.prototype._samplesDo_.apply($recv(self), [aBlock]));
  7464. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7465. $ctx1.supercall = false;
  7466. //>>excludeEnd("ctx");;
  7467. $recv(aBlock)._value_value_((3),"l");
  7468. return self;
  7469. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7470. }, function($ctx1) {$ctx1.fill(self,"samplesDo:",{aBlock:aBlock},$globals.StringTest)});
  7471. //>>excludeEnd("ctx");
  7472. },
  7473. //>>excludeStart("ide", pragmas.excludeIdeData);
  7474. args: ["aBlock"],
  7475. source: "samplesDo: aBlock\x0a\x09super samplesDo: aBlock.\x0a\x09aBlock value: 3 value: 'l'",
  7476. referencedClasses: [],
  7477. //>>excludeEnd("ide");
  7478. messageSends: ["samplesDo:", "value:value:"]
  7479. }),
  7480. $globals.StringTest);
  7481. $core.addMethod(
  7482. $core.method({
  7483. selector: "testAddAll",
  7484. protocol: 'tests',
  7485. fn: function (){
  7486. var self=this;
  7487. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  7488. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7489. return $core.withContext(function($ctx1) {
  7490. //>>excludeEnd("ctx");
  7491. var $1;
  7492. self._should_raise_((function(){
  7493. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7494. return $core.withContext(function($ctx2) {
  7495. //>>excludeEnd("ctx");
  7496. $1=self._collection();
  7497. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7498. $ctx2.sendIdx["collection"]=1;
  7499. //>>excludeEnd("ctx");
  7500. return $recv($1)._addAll_(self._collection());
  7501. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7502. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  7503. //>>excludeEnd("ctx");
  7504. }),$Error());
  7505. return self;
  7506. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7507. }, function($ctx1) {$ctx1.fill(self,"testAddAll",{},$globals.StringTest)});
  7508. //>>excludeEnd("ctx");
  7509. },
  7510. //>>excludeStart("ide", pragmas.excludeIdeData);
  7511. args: [],
  7512. source: "testAddAll\x0a\x09\x22String instances are read-only\x22\x0a\x09self should: [ self collection addAll: self collection ] raise: Error",
  7513. referencedClasses: ["Error"],
  7514. //>>excludeEnd("ide");
  7515. messageSends: ["should:raise:", "addAll:", "collection"]
  7516. }),
  7517. $globals.StringTest);
  7518. $core.addMethod(
  7519. $core.method({
  7520. selector: "testAddRemove",
  7521. protocol: 'tests',
  7522. fn: function (){
  7523. var self=this;
  7524. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  7525. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7526. return $core.withContext(function($ctx1) {
  7527. //>>excludeEnd("ctx");
  7528. self._should_raise_((function(){
  7529. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7530. return $core.withContext(function($ctx2) {
  7531. //>>excludeEnd("ctx");
  7532. return "hello"._add_("a");
  7533. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7534. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  7535. //>>excludeEnd("ctx");
  7536. }),$Error());
  7537. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7538. $ctx1.sendIdx["should:raise:"]=1;
  7539. //>>excludeEnd("ctx");
  7540. self._should_raise_((function(){
  7541. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7542. return $core.withContext(function($ctx2) {
  7543. //>>excludeEnd("ctx");
  7544. return "hello"._remove_("h");
  7545. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7546. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  7547. //>>excludeEnd("ctx");
  7548. }),$Error());
  7549. return self;
  7550. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7551. }, function($ctx1) {$ctx1.fill(self,"testAddRemove",{},$globals.StringTest)});
  7552. //>>excludeEnd("ctx");
  7553. },
  7554. //>>excludeStart("ide", pragmas.excludeIdeData);
  7555. args: [],
  7556. source: "testAddRemove\x0a\x09self should: [ 'hello' add: 'a' ] raise: Error.\x0a\x09self should: [ 'hello' remove: 'h' ] raise: Error",
  7557. referencedClasses: ["Error"],
  7558. //>>excludeEnd("ide");
  7559. messageSends: ["should:raise:", "add:", "remove:"]
  7560. }),
  7561. $globals.StringTest);
  7562. $core.addMethod(
  7563. $core.method({
  7564. selector: "testAsArray",
  7565. protocol: 'tests',
  7566. fn: function (){
  7567. var self=this;
  7568. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7569. return $core.withContext(function($ctx1) {
  7570. //>>excludeEnd("ctx");
  7571. self._assert_equals_("hello"._asArray(),["h", "e", "l", "l", "o"]);
  7572. return self;
  7573. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7574. }, function($ctx1) {$ctx1.fill(self,"testAsArray",{},$globals.StringTest)});
  7575. //>>excludeEnd("ctx");
  7576. },
  7577. //>>excludeStart("ide", pragmas.excludeIdeData);
  7578. args: [],
  7579. source: "testAsArray\x0a\x09self assert: 'hello' asArray equals: #('h' 'e' 'l' 'l' 'o').",
  7580. referencedClasses: [],
  7581. //>>excludeEnd("ide");
  7582. messageSends: ["assert:equals:", "asArray"]
  7583. }),
  7584. $globals.StringTest);
  7585. $core.addMethod(
  7586. $core.method({
  7587. selector: "testAsLowerCase",
  7588. protocol: 'tests',
  7589. fn: function (){
  7590. var self=this;
  7591. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7592. return $core.withContext(function($ctx1) {
  7593. //>>excludeEnd("ctx");
  7594. self._assert_equals_("JACKIE"._asLowercase(),"jackie");
  7595. return self;
  7596. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7597. }, function($ctx1) {$ctx1.fill(self,"testAsLowerCase",{},$globals.StringTest)});
  7598. //>>excludeEnd("ctx");
  7599. },
  7600. //>>excludeStart("ide", pragmas.excludeIdeData);
  7601. args: [],
  7602. source: "testAsLowerCase\x0a\x09self assert: 'JACKIE' asLowercase equals: 'jackie'.",
  7603. referencedClasses: [],
  7604. //>>excludeEnd("ide");
  7605. messageSends: ["assert:equals:", "asLowercase"]
  7606. }),
  7607. $globals.StringTest);
  7608. $core.addMethod(
  7609. $core.method({
  7610. selector: "testAsNumber",
  7611. protocol: 'tests',
  7612. fn: function (){
  7613. var self=this;
  7614. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7615. return $core.withContext(function($ctx1) {
  7616. //>>excludeEnd("ctx");
  7617. var $1,$2;
  7618. $1="3"._asNumber();
  7619. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7620. $ctx1.sendIdx["asNumber"]=1;
  7621. //>>excludeEnd("ctx");
  7622. self._assert_equals_($1,(3));
  7623. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7624. $ctx1.sendIdx["assert:equals:"]=1;
  7625. //>>excludeEnd("ctx");
  7626. $2="-3"._asNumber();
  7627. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7628. $ctx1.sendIdx["asNumber"]=2;
  7629. //>>excludeEnd("ctx");
  7630. self._assert_equals_($2,(-3));
  7631. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7632. $ctx1.sendIdx["assert:equals:"]=2;
  7633. //>>excludeEnd("ctx");
  7634. self._assert_equals_("-1.5"._asNumber(),(-1.5));
  7635. return self;
  7636. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7637. }, function($ctx1) {$ctx1.fill(self,"testAsNumber",{},$globals.StringTest)});
  7638. //>>excludeEnd("ctx");
  7639. },
  7640. //>>excludeStart("ide", pragmas.excludeIdeData);
  7641. args: [],
  7642. 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.",
  7643. referencedClasses: [],
  7644. //>>excludeEnd("ide");
  7645. messageSends: ["assert:equals:", "asNumber"]
  7646. }),
  7647. $globals.StringTest);
  7648. $core.addMethod(
  7649. $core.method({
  7650. selector: "testAsUpperCase",
  7651. protocol: 'tests',
  7652. fn: function (){
  7653. var self=this;
  7654. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7655. return $core.withContext(function($ctx1) {
  7656. //>>excludeEnd("ctx");
  7657. self._assert_equals_("jackie"._asUppercase(),"JACKIE");
  7658. return self;
  7659. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7660. }, function($ctx1) {$ctx1.fill(self,"testAsUpperCase",{},$globals.StringTest)});
  7661. //>>excludeEnd("ctx");
  7662. },
  7663. //>>excludeStart("ide", pragmas.excludeIdeData);
  7664. args: [],
  7665. source: "testAsUpperCase\x0a\x09self assert: 'jackie' asUppercase equals: 'JACKIE'.",
  7666. referencedClasses: [],
  7667. //>>excludeEnd("ide");
  7668. messageSends: ["assert:equals:", "asUppercase"]
  7669. }),
  7670. $globals.StringTest);
  7671. $core.addMethod(
  7672. $core.method({
  7673. selector: "testAsciiValue",
  7674. protocol: 'tests',
  7675. fn: function (){
  7676. var self=this;
  7677. var characterA,characterU;
  7678. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7679. return $core.withContext(function($ctx1) {
  7680. //>>excludeEnd("ctx");
  7681. var $1;
  7682. characterA="A";
  7683. characterU="U";
  7684. $1=$recv(characterA)._asciiValue();
  7685. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7686. $ctx1.sendIdx["asciiValue"]=1;
  7687. //>>excludeEnd("ctx");
  7688. self._assert_equals_($1,(65));
  7689. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7690. $ctx1.sendIdx["assert:equals:"]=1;
  7691. //>>excludeEnd("ctx");
  7692. self._assert_equals_($recv(characterU)._asciiValue(),(85));
  7693. return self;
  7694. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7695. }, function($ctx1) {$ctx1.fill(self,"testAsciiValue",{characterA:characterA,characterU:characterU},$globals.StringTest)});
  7696. //>>excludeEnd("ctx");
  7697. },
  7698. //>>excludeStart("ide", pragmas.excludeIdeData);
  7699. args: [],
  7700. 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",
  7701. referencedClasses: [],
  7702. //>>excludeEnd("ide");
  7703. messageSends: ["assert:equals:", "asciiValue"]
  7704. }),
  7705. $globals.StringTest);
  7706. $core.addMethod(
  7707. $core.method({
  7708. selector: "testAtIfAbsentPut",
  7709. protocol: 'tests',
  7710. fn: function (){
  7711. var self=this;
  7712. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  7713. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7714. return $core.withContext(function($ctx1) {
  7715. //>>excludeEnd("ctx");
  7716. self._should_raise_((function(){
  7717. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7718. return $core.withContext(function($ctx2) {
  7719. //>>excludeEnd("ctx");
  7720. return "hello"._at_ifAbsentPut_((6),(function(){
  7721. return "a";
  7722. }));
  7723. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7724. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  7725. //>>excludeEnd("ctx");
  7726. }),$Error());
  7727. return self;
  7728. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7729. }, function($ctx1) {$ctx1.fill(self,"testAtIfAbsentPut",{},$globals.StringTest)});
  7730. //>>excludeEnd("ctx");
  7731. },
  7732. //>>excludeStart("ide", pragmas.excludeIdeData);
  7733. args: [],
  7734. source: "testAtIfAbsentPut\x0a\x09\x22String instances are read-only\x22\x0a\x09self should: [ 'hello' at: 6 ifAbsentPut: [ 'a' ] ] raise: Error",
  7735. referencedClasses: ["Error"],
  7736. //>>excludeEnd("ide");
  7737. messageSends: ["should:raise:", "at:ifAbsentPut:"]
  7738. }),
  7739. $globals.StringTest);
  7740. $core.addMethod(
  7741. $core.method({
  7742. selector: "testAtPut",
  7743. protocol: 'tests',
  7744. fn: function (){
  7745. var self=this;
  7746. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  7747. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7748. return $core.withContext(function($ctx1) {
  7749. //>>excludeEnd("ctx");
  7750. self._should_raise_((function(){
  7751. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7752. return $core.withContext(function($ctx2) {
  7753. //>>excludeEnd("ctx");
  7754. return "hello"._at_put_((1),"a");
  7755. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7756. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  7757. //>>excludeEnd("ctx");
  7758. }),$Error());
  7759. return self;
  7760. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7761. }, function($ctx1) {$ctx1.fill(self,"testAtPut",{},$globals.StringTest)});
  7762. //>>excludeEnd("ctx");
  7763. },
  7764. //>>excludeStart("ide", pragmas.excludeIdeData);
  7765. args: [],
  7766. source: "testAtPut\x0a\x09\x22String instances are read-only\x22\x0a\x09self should: [ 'hello' at: 1 put: 'a' ] raise: Error",
  7767. referencedClasses: ["Error"],
  7768. //>>excludeEnd("ide");
  7769. messageSends: ["should:raise:", "at:put:"]
  7770. }),
  7771. $globals.StringTest);
  7772. $core.addMethod(
  7773. $core.method({
  7774. selector: "testCapitalized",
  7775. protocol: 'tests',
  7776. fn: function (){
  7777. var self=this;
  7778. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7779. return $core.withContext(function($ctx1) {
  7780. //>>excludeEnd("ctx");
  7781. var $1,$2,$3;
  7782. $1="test"._capitalized();
  7783. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7784. $ctx1.sendIdx["capitalized"]=1;
  7785. //>>excludeEnd("ctx");
  7786. self._assert_equals_($1,"Test");
  7787. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7788. $ctx1.sendIdx["assert:equals:"]=1;
  7789. //>>excludeEnd("ctx");
  7790. $2="Test"._capitalized();
  7791. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7792. $ctx1.sendIdx["capitalized"]=2;
  7793. //>>excludeEnd("ctx");
  7794. self._assert_equals_($2,"Test");
  7795. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7796. $ctx1.sendIdx["assert:equals:"]=2;
  7797. //>>excludeEnd("ctx");
  7798. self._assert_equals_(""._capitalized(),"");
  7799. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7800. $ctx1.sendIdx["assert:equals:"]=3;
  7801. //>>excludeEnd("ctx");
  7802. $3="Test"._isCapitalized();
  7803. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7804. $ctx1.sendIdx["isCapitalized"]=1;
  7805. //>>excludeEnd("ctx");
  7806. self._assert_equals_($3,true);
  7807. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7808. $ctx1.sendIdx["assert:equals:"]=4;
  7809. //>>excludeEnd("ctx");
  7810. self._assert_equals_("test"._isCapitalized(),false);
  7811. return self;
  7812. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7813. }, function($ctx1) {$ctx1.fill(self,"testCapitalized",{},$globals.StringTest)});
  7814. //>>excludeEnd("ctx");
  7815. },
  7816. //>>excludeStart("ide", pragmas.excludeIdeData);
  7817. args: [],
  7818. 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.",
  7819. referencedClasses: [],
  7820. //>>excludeEnd("ide");
  7821. messageSends: ["assert:equals:", "capitalized", "isCapitalized"]
  7822. }),
  7823. $globals.StringTest);
  7824. $core.addMethod(
  7825. $core.method({
  7826. selector: "testCharCodeAt",
  7827. protocol: 'tests',
  7828. fn: function (){
  7829. var self=this;
  7830. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7831. return $core.withContext(function($ctx1) {
  7832. //>>excludeEnd("ctx");
  7833. var $1,$2,$3,$4,$5;
  7834. $1="jackie"._charCodeAt_((1));
  7835. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7836. $ctx1.sendIdx["charCodeAt:"]=1;
  7837. //>>excludeEnd("ctx");
  7838. self._assert_equals_($1,(106));
  7839. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7840. $ctx1.sendIdx["assert:equals:"]=1;
  7841. //>>excludeEnd("ctx");
  7842. $2="jackie"._charCodeAt_((2));
  7843. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7844. $ctx1.sendIdx["charCodeAt:"]=2;
  7845. //>>excludeEnd("ctx");
  7846. self._assert_equals_($2,(97));
  7847. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7848. $ctx1.sendIdx["assert:equals:"]=2;
  7849. //>>excludeEnd("ctx");
  7850. $3="jackie"._charCodeAt_((3));
  7851. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7852. $ctx1.sendIdx["charCodeAt:"]=3;
  7853. //>>excludeEnd("ctx");
  7854. self._assert_equals_($3,(99));
  7855. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7856. $ctx1.sendIdx["assert:equals:"]=3;
  7857. //>>excludeEnd("ctx");
  7858. $4="jackie"._charCodeAt_((4));
  7859. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7860. $ctx1.sendIdx["charCodeAt:"]=4;
  7861. //>>excludeEnd("ctx");
  7862. self._assert_equals_($4,(107));
  7863. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7864. $ctx1.sendIdx["assert:equals:"]=4;
  7865. //>>excludeEnd("ctx");
  7866. $5="jackie"._charCodeAt_((5));
  7867. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7868. $ctx1.sendIdx["charCodeAt:"]=5;
  7869. //>>excludeEnd("ctx");
  7870. self._assert_equals_($5,(105));
  7871. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7872. $ctx1.sendIdx["assert:equals:"]=5;
  7873. //>>excludeEnd("ctx");
  7874. self._assert_equals_("jackie"._charCodeAt_((6)),(101));
  7875. return self;
  7876. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7877. }, function($ctx1) {$ctx1.fill(self,"testCharCodeAt",{},$globals.StringTest)});
  7878. //>>excludeEnd("ctx");
  7879. },
  7880. //>>excludeStart("ide", pragmas.excludeIdeData);
  7881. args: [],
  7882. 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",
  7883. referencedClasses: [],
  7884. //>>excludeEnd("ide");
  7885. messageSends: ["assert:equals:", "charCodeAt:"]
  7886. }),
  7887. $globals.StringTest);
  7888. $core.addMethod(
  7889. $core.method({
  7890. selector: "testCopyFromTo",
  7891. protocol: 'tests',
  7892. fn: function (){
  7893. var self=this;
  7894. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7895. return $core.withContext(function($ctx1) {
  7896. //>>excludeEnd("ctx");
  7897. var $1;
  7898. $1="jackie"._copyFrom_to_((1),(3));
  7899. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7900. $ctx1.sendIdx["copyFrom:to:"]=1;
  7901. //>>excludeEnd("ctx");
  7902. self._assert_equals_($1,"jac");
  7903. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7904. $ctx1.sendIdx["assert:equals:"]=1;
  7905. //>>excludeEnd("ctx");
  7906. self._assert_equals_("jackie"._copyFrom_to_((4),(6)),"kie");
  7907. return self;
  7908. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7909. }, function($ctx1) {$ctx1.fill(self,"testCopyFromTo",{},$globals.StringTest)});
  7910. //>>excludeEnd("ctx");
  7911. },
  7912. //>>excludeStart("ide", pragmas.excludeIdeData);
  7913. args: [],
  7914. source: "testCopyFromTo\x0a\x09self assert: ('jackie' copyFrom: 1 to: 3) equals: 'jac'.\x0a\x09self assert: ('jackie' copyFrom: 4 to: 6) equals: 'kie'.",
  7915. referencedClasses: [],
  7916. //>>excludeEnd("ide");
  7917. messageSends: ["assert:equals:", "copyFrom:to:"]
  7918. }),
  7919. $globals.StringTest);
  7920. $core.addMethod(
  7921. $core.method({
  7922. selector: "testCopyWithoutAll",
  7923. protocol: 'tests',
  7924. fn: function (){
  7925. var self=this;
  7926. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7927. return $core.withContext(function($ctx1) {
  7928. //>>excludeEnd("ctx");
  7929. self._assert_equals_("*hello* *world*"._copyWithoutAll_("*"),"hello world");
  7930. return self;
  7931. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7932. }, function($ctx1) {$ctx1.fill(self,"testCopyWithoutAll",{},$globals.StringTest)});
  7933. //>>excludeEnd("ctx");
  7934. },
  7935. //>>excludeStart("ide", pragmas.excludeIdeData);
  7936. args: [],
  7937. source: "testCopyWithoutAll\x0a\x09self\x0a\x09\x09assert: ('*hello* *world*' copyWithoutAll: '*')\x0a\x09\x09equals: 'hello world'",
  7938. referencedClasses: [],
  7939. //>>excludeEnd("ide");
  7940. messageSends: ["assert:equals:", "copyWithoutAll:"]
  7941. }),
  7942. $globals.StringTest);
  7943. $core.addMethod(
  7944. $core.method({
  7945. selector: "testEquality",
  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,$2,$3;
  7953. self._assert_equals_("hello","hello");
  7954. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7955. $ctx1.sendIdx["assert:equals:"]=1;
  7956. //>>excludeEnd("ctx");
  7957. $1="hello".__eq("world");
  7958. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7959. $ctx1.sendIdx["="]=1;
  7960. //>>excludeEnd("ctx");
  7961. self._deny_($1);
  7962. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7963. $ctx1.sendIdx["deny:"]=1;
  7964. //>>excludeEnd("ctx");
  7965. $2="hello".__eq([]._at_ifAbsent_((1),(function(){
  7966. })));
  7967. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7968. $ctx1.sendIdx["="]=2;
  7969. //>>excludeEnd("ctx");
  7970. self._deny_($2);
  7971. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7972. $ctx1.sendIdx["deny:"]=2;
  7973. //>>excludeEnd("ctx");
  7974. $3="hello"._yourself();
  7975. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7976. $ctx1.sendIdx["yourself"]=1;
  7977. //>>excludeEnd("ctx");
  7978. self._assert_equals_("hello",$3);
  7979. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7980. $ctx1.sendIdx["assert:equals:"]=2;
  7981. //>>excludeEnd("ctx");
  7982. self._assert_equals_("hello"._yourself(),"hello");
  7983. self._deny_("".__eq((0)));
  7984. return self;
  7985. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7986. }, function($ctx1) {$ctx1.fill(self,"testEquality",{},$globals.StringTest)});
  7987. //>>excludeEnd("ctx");
  7988. },
  7989. //>>excludeStart("ide", pragmas.excludeIdeData);
  7990. args: [],
  7991. 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",
  7992. referencedClasses: [],
  7993. //>>excludeEnd("ide");
  7994. messageSends: ["assert:equals:", "deny:", "=", "at:ifAbsent:", "yourself"]
  7995. }),
  7996. $globals.StringTest);
  7997. $core.addMethod(
  7998. $core.method({
  7999. selector: "testIdentity",
  8000. protocol: 'tests',
  8001. fn: function (){
  8002. var self=this;
  8003. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8004. return $core.withContext(function($ctx1) {
  8005. //>>excludeEnd("ctx");
  8006. var $1,$2,$4,$3,$5;
  8007. $1="hello".__eq_eq("hello");
  8008. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8009. $ctx1.sendIdx["=="]=1;
  8010. //>>excludeEnd("ctx");
  8011. self._assert_($1);
  8012. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8013. $ctx1.sendIdx["assert:"]=1;
  8014. //>>excludeEnd("ctx");
  8015. $2="hello".__eq_eq("world");
  8016. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8017. $ctx1.sendIdx["=="]=2;
  8018. //>>excludeEnd("ctx");
  8019. self._deny_($2);
  8020. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8021. $ctx1.sendIdx["deny:"]=1;
  8022. //>>excludeEnd("ctx");
  8023. $4="hello"._yourself();
  8024. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8025. $ctx1.sendIdx["yourself"]=1;
  8026. //>>excludeEnd("ctx");
  8027. $3="hello".__eq_eq($4);
  8028. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8029. $ctx1.sendIdx["=="]=3;
  8030. //>>excludeEnd("ctx");
  8031. self._assert_($3);
  8032. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8033. $ctx1.sendIdx["assert:"]=2;
  8034. //>>excludeEnd("ctx");
  8035. $5=$recv("hello"._yourself()).__eq_eq("hello");
  8036. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8037. $ctx1.sendIdx["=="]=4;
  8038. //>>excludeEnd("ctx");
  8039. self._assert_($5);
  8040. self._deny_("".__eq_eq((0)));
  8041. return self;
  8042. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8043. }, function($ctx1) {$ctx1.fill(self,"testIdentity",{},$globals.StringTest)});
  8044. //>>excludeEnd("ctx");
  8045. },
  8046. //>>excludeStart("ide", pragmas.excludeIdeData);
  8047. args: [],
  8048. 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",
  8049. referencedClasses: [],
  8050. //>>excludeEnd("ide");
  8051. messageSends: ["assert:", "==", "deny:", "yourself"]
  8052. }),
  8053. $globals.StringTest);
  8054. $core.addMethod(
  8055. $core.method({
  8056. selector: "testIdentityHash",
  8057. protocol: 'tests',
  8058. fn: function (){
  8059. var self=this;
  8060. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8061. return $core.withContext(function($ctx1) {
  8062. //>>excludeEnd("ctx");
  8063. var $1,$2,$4,$3;
  8064. $1="foo"._identityHash();
  8065. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8066. $ctx1.sendIdx["identityHash"]=1;
  8067. //>>excludeEnd("ctx");
  8068. $2="foo"._identityHash();
  8069. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8070. $ctx1.sendIdx["identityHash"]=2;
  8071. //>>excludeEnd("ctx");
  8072. self._assert_equals_($1,$2);
  8073. $4="foo"._identityHash();
  8074. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8075. $ctx1.sendIdx["identityHash"]=3;
  8076. //>>excludeEnd("ctx");
  8077. $3=$recv($4).__eq("bar"._identityHash());
  8078. self._deny_($3);
  8079. return self;
  8080. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8081. }, function($ctx1) {$ctx1.fill(self,"testIdentityHash",{},$globals.StringTest)});
  8082. //>>excludeEnd("ctx");
  8083. },
  8084. //>>excludeStart("ide", pragmas.excludeIdeData);
  8085. args: [],
  8086. source: "testIdentityHash\x0a\x09self assert: 'foo' identityHash equals: 'foo' identityHash.\x0a\x09self deny: ('foo' identityHash = 'bar' identityHash)",
  8087. referencedClasses: [],
  8088. //>>excludeEnd("ide");
  8089. messageSends: ["assert:equals:", "identityHash", "deny:", "="]
  8090. }),
  8091. $globals.StringTest);
  8092. $core.addMethod(
  8093. $core.method({
  8094. selector: "testIncludesSubString",
  8095. protocol: 'tests',
  8096. fn: function (){
  8097. var self=this;
  8098. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8099. return $core.withContext(function($ctx1) {
  8100. //>>excludeEnd("ctx");
  8101. var $1;
  8102. $1="amber"._includesSubString_("ber");
  8103. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8104. $ctx1.sendIdx["includesSubString:"]=1;
  8105. //>>excludeEnd("ctx");
  8106. self._assert_($1);
  8107. self._deny_("amber"._includesSubString_("zork"));
  8108. return self;
  8109. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8110. }, function($ctx1) {$ctx1.fill(self,"testIncludesSubString",{},$globals.StringTest)});
  8111. //>>excludeEnd("ctx");
  8112. },
  8113. //>>excludeStart("ide", pragmas.excludeIdeData);
  8114. args: [],
  8115. source: "testIncludesSubString\x0a\x09self assert: ('amber' includesSubString: 'ber').\x0a\x09self deny: ('amber' includesSubString: 'zork').",
  8116. referencedClasses: [],
  8117. //>>excludeEnd("ide");
  8118. messageSends: ["assert:", "includesSubString:", "deny:"]
  8119. }),
  8120. $globals.StringTest);
  8121. $core.addMethod(
  8122. $core.method({
  8123. selector: "testIndexOfStartingAtWithNull",
  8124. protocol: 'tests',
  8125. fn: function (){
  8126. var self=this;
  8127. return self;
  8128. },
  8129. //>>excludeStart("ide", pragmas.excludeIdeData);
  8130. args: [],
  8131. source: "testIndexOfStartingAtWithNull\x0a\x09\x22String cannot hold JS null\x22",
  8132. referencedClasses: [],
  8133. //>>excludeEnd("ide");
  8134. messageSends: []
  8135. }),
  8136. $globals.StringTest);
  8137. $core.addMethod(
  8138. $core.method({
  8139. selector: "testIndexOfWithNull",
  8140. protocol: 'tests',
  8141. fn: function (){
  8142. var self=this;
  8143. return self;
  8144. },
  8145. //>>excludeStart("ide", pragmas.excludeIdeData);
  8146. args: [],
  8147. source: "testIndexOfWithNull\x0a\x09\x22String cannot hold JS null\x22",
  8148. referencedClasses: [],
  8149. //>>excludeEnd("ide");
  8150. messageSends: []
  8151. }),
  8152. $globals.StringTest);
  8153. $core.addMethod(
  8154. $core.method({
  8155. selector: "testIsVowel",
  8156. protocol: 'tests',
  8157. fn: function (){
  8158. var self=this;
  8159. var vowel,consonant;
  8160. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8161. return $core.withContext(function($ctx1) {
  8162. //>>excludeEnd("ctx");
  8163. var $1;
  8164. vowel="u";
  8165. consonant="z";
  8166. $1=$recv(vowel)._isVowel();
  8167. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8168. $ctx1.sendIdx["isVowel"]=1;
  8169. //>>excludeEnd("ctx");
  8170. self._assert_equals_($1,true);
  8171. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8172. $ctx1.sendIdx["assert:equals:"]=1;
  8173. //>>excludeEnd("ctx");
  8174. self._assert_equals_($recv(consonant)._isVowel(),false);
  8175. return self;
  8176. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8177. }, function($ctx1) {$ctx1.fill(self,"testIsVowel",{vowel:vowel,consonant:consonant},$globals.StringTest)});
  8178. //>>excludeEnd("ctx");
  8179. },
  8180. //>>excludeStart("ide", pragmas.excludeIdeData);
  8181. args: [],
  8182. 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",
  8183. referencedClasses: [],
  8184. //>>excludeEnd("ide");
  8185. messageSends: ["assert:equals:", "isVowel"]
  8186. }),
  8187. $globals.StringTest);
  8188. $core.addMethod(
  8189. $core.method({
  8190. selector: "testJoin",
  8191. protocol: 'tests',
  8192. fn: function (){
  8193. var self=this;
  8194. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8195. return $core.withContext(function($ctx1) {
  8196. //>>excludeEnd("ctx");
  8197. self._assert_equals_(","._join_(["hello", "world"]),"hello,world");
  8198. return self;
  8199. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8200. }, function($ctx1) {$ctx1.fill(self,"testJoin",{},$globals.StringTest)});
  8201. //>>excludeEnd("ctx");
  8202. },
  8203. //>>excludeStart("ide", pragmas.excludeIdeData);
  8204. args: [],
  8205. source: "testJoin\x0a\x09self assert: (',' join: #('hello' 'world')) equals: 'hello,world'",
  8206. referencedClasses: [],
  8207. //>>excludeEnd("ide");
  8208. messageSends: ["assert:equals:", "join:"]
  8209. }),
  8210. $globals.StringTest);
  8211. $core.addMethod(
  8212. $core.method({
  8213. selector: "testRemoveAll",
  8214. protocol: 'tests',
  8215. fn: function (){
  8216. var self=this;
  8217. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  8218. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8219. return $core.withContext(function($ctx1) {
  8220. //>>excludeEnd("ctx");
  8221. self._should_raise_((function(){
  8222. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8223. return $core.withContext(function($ctx2) {
  8224. //>>excludeEnd("ctx");
  8225. return $recv(self._collection())._removeAll();
  8226. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8227. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  8228. //>>excludeEnd("ctx");
  8229. }),$Error());
  8230. return self;
  8231. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8232. }, function($ctx1) {$ctx1.fill(self,"testRemoveAll",{},$globals.StringTest)});
  8233. //>>excludeEnd("ctx");
  8234. },
  8235. //>>excludeStart("ide", pragmas.excludeIdeData);
  8236. args: [],
  8237. source: "testRemoveAll\x0a\x09self should: [ self collection removeAll ] raise: Error",
  8238. referencedClasses: ["Error"],
  8239. //>>excludeEnd("ide");
  8240. messageSends: ["should:raise:", "removeAll", "collection"]
  8241. }),
  8242. $globals.StringTest);
  8243. $core.addMethod(
  8244. $core.method({
  8245. selector: "testReversed",
  8246. protocol: 'tests',
  8247. fn: function (){
  8248. var self=this;
  8249. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8250. return $core.withContext(function($ctx1) {
  8251. //>>excludeEnd("ctx");
  8252. self._assert_equals_("jackiechan"._reversed(),"nahceikcaj");
  8253. return self;
  8254. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8255. }, function($ctx1) {$ctx1.fill(self,"testReversed",{},$globals.StringTest)});
  8256. //>>excludeEnd("ctx");
  8257. },
  8258. //>>excludeStart("ide", pragmas.excludeIdeData);
  8259. args: [],
  8260. source: "testReversed\x0a\x09self assert: 'jackiechan' reversed equals: 'nahceikcaj'.",
  8261. referencedClasses: [],
  8262. //>>excludeEnd("ide");
  8263. messageSends: ["assert:equals:", "reversed"]
  8264. }),
  8265. $globals.StringTest);
  8266. $core.addMethod(
  8267. $core.method({
  8268. selector: "testStreamContents",
  8269. protocol: 'tests',
  8270. fn: function (){
  8271. var self=this;
  8272. function $String(){return $globals.String||(typeof String=="undefined"?nil:String)}
  8273. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8274. return $core.withContext(function($ctx1) {
  8275. //>>excludeEnd("ctx");
  8276. var $1;
  8277. self._assert_equals_($recv($String())._streamContents_((function(aStream){
  8278. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8279. return $core.withContext(function($ctx2) {
  8280. //>>excludeEnd("ctx");
  8281. $recv(aStream)._nextPutAll_("hello");
  8282. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8283. $ctx2.sendIdx["nextPutAll:"]=1;
  8284. //>>excludeEnd("ctx");
  8285. $recv(aStream)._space();
  8286. $1=$recv(aStream)._nextPutAll_("world");
  8287. return $1;
  8288. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8289. }, function($ctx2) {$ctx2.fillBlock({aStream:aStream},$ctx1,1)});
  8290. //>>excludeEnd("ctx");
  8291. })),"hello world");
  8292. return self;
  8293. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8294. }, function($ctx1) {$ctx1.fill(self,"testStreamContents",{},$globals.StringTest)});
  8295. //>>excludeEnd("ctx");
  8296. },
  8297. //>>excludeStart("ide", pragmas.excludeIdeData);
  8298. args: [],
  8299. 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'",
  8300. referencedClasses: ["String"],
  8301. //>>excludeEnd("ide");
  8302. messageSends: ["assert:equals:", "streamContents:", "nextPutAll:", "space"]
  8303. }),
  8304. $globals.StringTest);
  8305. $core.addMethod(
  8306. $core.method({
  8307. selector: "testSubStrings",
  8308. protocol: 'tests',
  8309. fn: function (){
  8310. var self=this;
  8311. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8312. return $core.withContext(function($ctx1) {
  8313. //>>excludeEnd("ctx");
  8314. self._assert_equals_("jackiechan"._subStrings_("ie"),["jack", "chan"]);
  8315. return self;
  8316. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8317. }, function($ctx1) {$ctx1.fill(self,"testSubStrings",{},$globals.StringTest)});
  8318. //>>excludeEnd("ctx");
  8319. },
  8320. //>>excludeStart("ide", pragmas.excludeIdeData);
  8321. args: [],
  8322. source: "testSubStrings\x0a\x09self assert: ('jackiechan' subStrings: 'ie') equals: #( 'jack' 'chan' ).",
  8323. referencedClasses: [],
  8324. //>>excludeEnd("ide");
  8325. messageSends: ["assert:equals:", "subStrings:"]
  8326. }),
  8327. $globals.StringTest);
  8328. $core.addMethod(
  8329. $core.method({
  8330. selector: "testTrim",
  8331. protocol: 'tests',
  8332. fn: function (){
  8333. var self=this;
  8334. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8335. return $core.withContext(function($ctx1) {
  8336. //>>excludeEnd("ctx");
  8337. self._assert_equals_(" jackie"._trimLeft(),"jackie");
  8338. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8339. $ctx1.sendIdx["assert:equals:"]=1;
  8340. //>>excludeEnd("ctx");
  8341. self._assert_equals_("jackie "._trimRight(),"jackie");
  8342. return self;
  8343. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8344. }, function($ctx1) {$ctx1.fill(self,"testTrim",{},$globals.StringTest)});
  8345. //>>excludeEnd("ctx");
  8346. },
  8347. //>>excludeStart("ide", pragmas.excludeIdeData);
  8348. args: [],
  8349. source: "testTrim\x0a\x09self assert: ' jackie' trimLeft equals: 'jackie'.\x0a\x09self assert: 'jackie ' trimRight equals: 'jackie'.",
  8350. referencedClasses: [],
  8351. //>>excludeEnd("ide");
  8352. messageSends: ["assert:equals:", "trimLeft", "trimRight"]
  8353. }),
  8354. $globals.StringTest);
  8355. $core.addMethod(
  8356. $core.method({
  8357. selector: "testValue",
  8358. protocol: 'tests',
  8359. fn: function (){
  8360. var self=this;
  8361. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8362. return $core.withContext(function($ctx1) {
  8363. //>>excludeEnd("ctx");
  8364. self._assert_equals_("asString"._value_((1)),"1");
  8365. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8366. $ctx1.sendIdx["assert:equals:"]=1;
  8367. //>>excludeEnd("ctx");
  8368. self._assert_equals_([(1), (2), (3)]._collect_("asString"),["1", "2", "3"]);
  8369. return self;
  8370. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8371. }, function($ctx1) {$ctx1.fill(self,"testValue",{},$globals.StringTest)});
  8372. //>>excludeEnd("ctx");
  8373. },
  8374. //>>excludeStart("ide", pragmas.excludeIdeData);
  8375. args: [],
  8376. 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')",
  8377. referencedClasses: [],
  8378. //>>excludeEnd("ide");
  8379. messageSends: ["assert:equals:", "value:", "collect:"]
  8380. }),
  8381. $globals.StringTest);
  8382. $core.addMethod(
  8383. $core.method({
  8384. selector: "collectionClass",
  8385. protocol: 'fixture',
  8386. fn: function (){
  8387. var self=this;
  8388. function $String(){return $globals.String||(typeof String=="undefined"?nil:String)}
  8389. return $String();
  8390. },
  8391. //>>excludeStart("ide", pragmas.excludeIdeData);
  8392. args: [],
  8393. source: "collectionClass\x0a\x09^ String",
  8394. referencedClasses: ["String"],
  8395. //>>excludeEnd("ide");
  8396. messageSends: []
  8397. }),
  8398. $globals.StringTest.klass);
  8399. $core.addClass('SetTest', $globals.CollectionTest, [], 'Kernel-Tests');
  8400. $core.addMethod(
  8401. $core.method({
  8402. selector: "collection",
  8403. protocol: 'fixture',
  8404. fn: function (){
  8405. var self=this;
  8406. function $Set(){return $globals.Set||(typeof Set=="undefined"?nil:Set)}
  8407. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  8408. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8409. return $core.withContext(function($ctx1) {
  8410. //>>excludeEnd("ctx");
  8411. var $2,$3,$1;
  8412. $2=$recv($Set())._new();
  8413. $recv($2)._add_($Smalltalk());
  8414. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8415. $ctx1.sendIdx["add:"]=1;
  8416. //>>excludeEnd("ctx");
  8417. $recv($2)._add_(nil);
  8418. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8419. $ctx1.sendIdx["add:"]=2;
  8420. //>>excludeEnd("ctx");
  8421. $recv($2)._add_((3).__at((3)));
  8422. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8423. $ctx1.sendIdx["add:"]=3;
  8424. //>>excludeEnd("ctx");
  8425. $recv($2)._add_(false);
  8426. $3=$recv($2)._yourself();
  8427. $1=$3;
  8428. return $1;
  8429. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8430. }, function($ctx1) {$ctx1.fill(self,"collection",{},$globals.SetTest)});
  8431. //>>excludeEnd("ctx");
  8432. },
  8433. //>>excludeStart("ide", pragmas.excludeIdeData);
  8434. args: [],
  8435. 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\x09yourself",
  8436. referencedClasses: ["Set", "Smalltalk"],
  8437. //>>excludeEnd("ide");
  8438. messageSends: ["add:", "new", "@", "yourself"]
  8439. }),
  8440. $globals.SetTest);
  8441. $core.addMethod(
  8442. $core.method({
  8443. selector: "collectionOfPrintStrings",
  8444. protocol: 'fixture',
  8445. fn: function (){
  8446. var self=this;
  8447. function $Set(){return $globals.Set||(typeof Set=="undefined"?nil:Set)}
  8448. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8449. return $core.withContext(function($ctx1) {
  8450. //>>excludeEnd("ctx");
  8451. var $2,$3,$1;
  8452. $2=$recv($Set())._new();
  8453. $recv($2)._add_("a SmalltalkImage");
  8454. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8455. $ctx1.sendIdx["add:"]=1;
  8456. //>>excludeEnd("ctx");
  8457. $recv($2)._add_("nil");
  8458. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8459. $ctx1.sendIdx["add:"]=2;
  8460. //>>excludeEnd("ctx");
  8461. $recv($2)._add_("3@3");
  8462. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8463. $ctx1.sendIdx["add:"]=3;
  8464. //>>excludeEnd("ctx");
  8465. $recv($2)._add_("false");
  8466. $3=$recv($2)._yourself();
  8467. $1=$3;
  8468. return $1;
  8469. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8470. }, function($ctx1) {$ctx1.fill(self,"collectionOfPrintStrings",{},$globals.SetTest)});
  8471. //>>excludeEnd("ctx");
  8472. },
  8473. //>>excludeStart("ide", pragmas.excludeIdeData);
  8474. args: [],
  8475. 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\x09yourself",
  8476. referencedClasses: ["Set"],
  8477. //>>excludeEnd("ide");
  8478. messageSends: ["add:", "new", "yourself"]
  8479. }),
  8480. $globals.SetTest);
  8481. $core.addMethod(
  8482. $core.method({
  8483. selector: "collectionSize",
  8484. protocol: 'fixture',
  8485. fn: function (){
  8486. var self=this;
  8487. return (4);
  8488. },
  8489. //>>excludeStart("ide", pragmas.excludeIdeData);
  8490. args: [],
  8491. source: "collectionSize\x0a\x09^ 4",
  8492. referencedClasses: [],
  8493. //>>excludeEnd("ide");
  8494. messageSends: []
  8495. }),
  8496. $globals.SetTest);
  8497. $core.addMethod(
  8498. $core.method({
  8499. selector: "collectionWithDuplicates",
  8500. protocol: 'fixture',
  8501. fn: function (){
  8502. var self=this;
  8503. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8504. return $core.withContext(function($ctx1) {
  8505. //>>excludeEnd("ctx");
  8506. var $2,$3,$1;
  8507. $2=self._collection();
  8508. $recv($2)._add_((0));
  8509. $3=$recv($2)._yourself();
  8510. $1=$3;
  8511. return $1;
  8512. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8513. }, function($ctx1) {$ctx1.fill(self,"collectionWithDuplicates",{},$globals.SetTest)});
  8514. //>>excludeEnd("ctx");
  8515. },
  8516. //>>excludeStart("ide", pragmas.excludeIdeData);
  8517. args: [],
  8518. source: "collectionWithDuplicates\x0a\x09\x22Set has no duplicates\x22\x0a\x09^ self collection add: 0; yourself",
  8519. referencedClasses: [],
  8520. //>>excludeEnd("ide");
  8521. messageSends: ["add:", "collection", "yourself"]
  8522. }),
  8523. $globals.SetTest);
  8524. $core.addMethod(
  8525. $core.method({
  8526. selector: "collectionWithNewValue",
  8527. protocol: 'fixture',
  8528. fn: function (){
  8529. var self=this;
  8530. function $Set(){return $globals.Set||(typeof Set=="undefined"?nil:Set)}
  8531. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  8532. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8533. return $core.withContext(function($ctx1) {
  8534. //>>excludeEnd("ctx");
  8535. var $2,$3,$1;
  8536. $2=$recv($Set())._new();
  8537. $recv($2)._add_($Smalltalk());
  8538. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8539. $ctx1.sendIdx["add:"]=1;
  8540. //>>excludeEnd("ctx");
  8541. $recv($2)._add_(nil);
  8542. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8543. $ctx1.sendIdx["add:"]=2;
  8544. //>>excludeEnd("ctx");
  8545. $recv($2)._add_((3).__at((3)));
  8546. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8547. $ctx1.sendIdx["add:"]=3;
  8548. //>>excludeEnd("ctx");
  8549. $recv($2)._add_("N");
  8550. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8551. $ctx1.sendIdx["add:"]=4;
  8552. //>>excludeEnd("ctx");
  8553. $recv($2)._add_(false);
  8554. $3=$recv($2)._yourself();
  8555. $1=$3;
  8556. return $1;
  8557. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8558. }, function($ctx1) {$ctx1.fill(self,"collectionWithNewValue",{},$globals.SetTest)});
  8559. //>>excludeEnd("ctx");
  8560. },
  8561. //>>excludeStart("ide", pragmas.excludeIdeData);
  8562. args: [],
  8563. 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\x09yourself",
  8564. referencedClasses: ["Set", "Smalltalk"],
  8565. //>>excludeEnd("ide");
  8566. messageSends: ["add:", "new", "@", "yourself"]
  8567. }),
  8568. $globals.SetTest);
  8569. $core.addMethod(
  8570. $core.method({
  8571. selector: "testAddAll",
  8572. protocol: 'tests',
  8573. fn: function (){
  8574. var self=this;
  8575. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8576. return $core.withContext(function($ctx1) {
  8577. //>>excludeEnd("ctx");
  8578. var $2,$3,$4,$5,$1,$6,$8,$9,$10,$11,$7,$12,$14,$15,$13;
  8579. (
  8580. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8581. $ctx1.supercall = true,
  8582. //>>excludeEnd("ctx");
  8583. $globals.SetTest.superclass.fn.prototype._testAddAll.apply($recv(self), []));
  8584. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8585. $ctx1.supercall = false;
  8586. //>>excludeEnd("ctx");;
  8587. $2=self._collection();
  8588. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8589. $ctx1.sendIdx["collection"]=1;
  8590. //>>excludeEnd("ctx");
  8591. $3=$2;
  8592. $4=self._collection();
  8593. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8594. $ctx1.sendIdx["collection"]=2;
  8595. //>>excludeEnd("ctx");
  8596. $recv($3)._addAll_($4);
  8597. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8598. $ctx1.sendIdx["addAll:"]=1;
  8599. //>>excludeEnd("ctx");
  8600. $5=$recv($2)._yourself();
  8601. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8602. $ctx1.sendIdx["yourself"]=1;
  8603. //>>excludeEnd("ctx");
  8604. $1=$5;
  8605. $6=self._collection();
  8606. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8607. $ctx1.sendIdx["collection"]=3;
  8608. //>>excludeEnd("ctx");
  8609. self._assert_equals_($1,$6);
  8610. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8611. $ctx1.sendIdx["assert:equals:"]=1;
  8612. //>>excludeEnd("ctx");
  8613. $8=self._collection();
  8614. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8615. $ctx1.sendIdx["collection"]=4;
  8616. //>>excludeEnd("ctx");
  8617. $9=$8;
  8618. $10=self._collectionWithNewValue();
  8619. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8620. $ctx1.sendIdx["collectionWithNewValue"]=1;
  8621. //>>excludeEnd("ctx");
  8622. $recv($9)._addAll_($10);
  8623. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8624. $ctx1.sendIdx["addAll:"]=2;
  8625. //>>excludeEnd("ctx");
  8626. $11=$recv($8)._yourself();
  8627. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8628. $ctx1.sendIdx["yourself"]=2;
  8629. //>>excludeEnd("ctx");
  8630. $7=$11;
  8631. $12=self._collectionWithNewValue();
  8632. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8633. $ctx1.sendIdx["collectionWithNewValue"]=2;
  8634. //>>excludeEnd("ctx");
  8635. self._assert_equals_($7,$12);
  8636. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8637. $ctx1.sendIdx["assert:equals:"]=2;
  8638. //>>excludeEnd("ctx");
  8639. $14=self._collectionWithNewValue();
  8640. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8641. $ctx1.sendIdx["collectionWithNewValue"]=3;
  8642. //>>excludeEnd("ctx");
  8643. $recv($14)._addAll_(self._collection());
  8644. $15=$recv($14)._yourself();
  8645. $13=$15;
  8646. self._assert_equals_($13,self._collectionWithNewValue());
  8647. return self;
  8648. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8649. }, function($ctx1) {$ctx1.fill(self,"testAddAll",{},$globals.SetTest)});
  8650. //>>excludeEnd("ctx");
  8651. },
  8652. //>>excludeStart("ide", pragmas.excludeIdeData);
  8653. args: [],
  8654. 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",
  8655. referencedClasses: [],
  8656. //>>excludeEnd("ide");
  8657. messageSends: ["testAddAll", "assert:equals:", "addAll:", "collection", "yourself", "collectionWithNewValue"]
  8658. }),
  8659. $globals.SetTest);
  8660. $core.addMethod(
  8661. $core.method({
  8662. selector: "testAddRemove",
  8663. protocol: 'tests',
  8664. fn: function (){
  8665. var self=this;
  8666. var set;
  8667. function $Set(){return $globals.Set||(typeof Set=="undefined"?nil:Set)}
  8668. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8669. return $core.withContext(function($ctx1) {
  8670. //>>excludeEnd("ctx");
  8671. var $1,$2;
  8672. set=$recv($Set())._new();
  8673. self._assert_($recv(set)._isEmpty());
  8674. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8675. $ctx1.sendIdx["assert:"]=1;
  8676. //>>excludeEnd("ctx");
  8677. $recv(set)._add_((3));
  8678. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8679. $ctx1.sendIdx["add:"]=1;
  8680. //>>excludeEnd("ctx");
  8681. $1=$recv(set)._includes_((3));
  8682. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8683. $ctx1.sendIdx["includes:"]=1;
  8684. //>>excludeEnd("ctx");
  8685. self._assert_($1);
  8686. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8687. $ctx1.sendIdx["assert:"]=2;
  8688. //>>excludeEnd("ctx");
  8689. $recv(set)._add_((5));
  8690. $2=$recv(set)._includes_((5));
  8691. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8692. $ctx1.sendIdx["includes:"]=2;
  8693. //>>excludeEnd("ctx");
  8694. self._assert_($2);
  8695. $recv(set)._remove_((3));
  8696. self._deny_($recv(set)._includes_((3)));
  8697. return self;
  8698. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8699. }, function($ctx1) {$ctx1.fill(self,"testAddRemove",{set:set},$globals.SetTest)});
  8700. //>>excludeEnd("ctx");
  8701. },
  8702. //>>excludeStart("ide", pragmas.excludeIdeData);
  8703. args: [],
  8704. 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)",
  8705. referencedClasses: ["Set"],
  8706. //>>excludeEnd("ide");
  8707. messageSends: ["new", "assert:", "isEmpty", "add:", "includes:", "remove:", "deny:"]
  8708. }),
  8709. $globals.SetTest);
  8710. $core.addMethod(
  8711. $core.method({
  8712. selector: "testAt",
  8713. protocol: 'tests',
  8714. fn: function (){
  8715. var self=this;
  8716. function $Set(){return $globals.Set||(typeof Set=="undefined"?nil:Set)}
  8717. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  8718. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8719. return $core.withContext(function($ctx1) {
  8720. //>>excludeEnd("ctx");
  8721. self._should_raise_((function(){
  8722. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8723. return $core.withContext(function($ctx2) {
  8724. //>>excludeEnd("ctx");
  8725. return $recv($recv($Set())._new())._at_put_((1),(2));
  8726. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8727. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  8728. //>>excludeEnd("ctx");
  8729. }),$Error());
  8730. return self;
  8731. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8732. }, function($ctx1) {$ctx1.fill(self,"testAt",{},$globals.SetTest)});
  8733. //>>excludeEnd("ctx");
  8734. },
  8735. //>>excludeStart("ide", pragmas.excludeIdeData);
  8736. args: [],
  8737. source: "testAt\x0a\x09self should: [ Set new at: 1 put: 2 ] raise: Error",
  8738. referencedClasses: ["Set", "Error"],
  8739. //>>excludeEnd("ide");
  8740. messageSends: ["should:raise:", "at:put:", "new"]
  8741. }),
  8742. $globals.SetTest);
  8743. $core.addMethod(
  8744. $core.method({
  8745. selector: "testCollect",
  8746. protocol: 'tests',
  8747. fn: function (){
  8748. var self=this;
  8749. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8750. return $core.withContext(function($ctx1) {
  8751. //>>excludeEnd("ctx");
  8752. var $2,$1;
  8753. (
  8754. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8755. $ctx1.supercall = true,
  8756. //>>excludeEnd("ctx");
  8757. $globals.SetTest.superclass.fn.prototype._testCollect.apply($recv(self), []));
  8758. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8759. $ctx1.supercall = false;
  8760. //>>excludeEnd("ctx");;
  8761. $2=[(5), (6), (8)]._asSet();
  8762. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8763. $ctx1.sendIdx["asSet"]=1;
  8764. //>>excludeEnd("ctx");
  8765. $1=$recv($2)._collect_((function(x){
  8766. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8767. return $core.withContext(function($ctx2) {
  8768. //>>excludeEnd("ctx");
  8769. return $recv(x).__backslash_backslash((3));
  8770. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8771. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)});
  8772. //>>excludeEnd("ctx");
  8773. }));
  8774. self._assert_equals_($1,[(0), (2)]._asSet());
  8775. return self;
  8776. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8777. }, function($ctx1) {$ctx1.fill(self,"testCollect",{},$globals.SetTest)});
  8778. //>>excludeEnd("ctx");
  8779. },
  8780. //>>excludeStart("ide", pragmas.excludeIdeData);
  8781. args: [],
  8782. source: "testCollect\x0a\x09super testCollect.\x0a\x09self assert: (#(5 6 8) asSet collect: [ :x | x \x5c\x5c 3 ]) equals: #(0 2) asSet",
  8783. referencedClasses: [],
  8784. //>>excludeEnd("ide");
  8785. messageSends: ["testCollect", "assert:equals:", "collect:", "asSet", "\x5c\x5c"]
  8786. }),
  8787. $globals.SetTest);
  8788. $core.addMethod(
  8789. $core.method({
  8790. selector: "testComma",
  8791. protocol: 'tests',
  8792. fn: function (){
  8793. var self=this;
  8794. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8795. return $core.withContext(function($ctx1) {
  8796. //>>excludeEnd("ctx");
  8797. var $2,$3,$1,$4,$6,$7,$5,$8,$10,$9;
  8798. (
  8799. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8800. $ctx1.supercall = true,
  8801. //>>excludeEnd("ctx");
  8802. $globals.SetTest.superclass.fn.prototype._testComma.apply($recv(self), []));
  8803. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8804. $ctx1.supercall = false;
  8805. //>>excludeEnd("ctx");;
  8806. $2=self._collection();
  8807. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8808. $ctx1.sendIdx["collection"]=1;
  8809. //>>excludeEnd("ctx");
  8810. $3=self._collection();
  8811. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8812. $ctx1.sendIdx["collection"]=2;
  8813. //>>excludeEnd("ctx");
  8814. $1=$recv($2).__comma($3);
  8815. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8816. $ctx1.sendIdx[","]=1;
  8817. //>>excludeEnd("ctx");
  8818. $4=self._collection();
  8819. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8820. $ctx1.sendIdx["collection"]=3;
  8821. //>>excludeEnd("ctx");
  8822. self._assert_equals_($1,$4);
  8823. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8824. $ctx1.sendIdx["assert:equals:"]=1;
  8825. //>>excludeEnd("ctx");
  8826. $6=self._collection();
  8827. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8828. $ctx1.sendIdx["collection"]=4;
  8829. //>>excludeEnd("ctx");
  8830. $7=self._collectionWithNewValue();
  8831. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8832. $ctx1.sendIdx["collectionWithNewValue"]=1;
  8833. //>>excludeEnd("ctx");
  8834. $5=$recv($6).__comma($7);
  8835. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8836. $ctx1.sendIdx[","]=2;
  8837. //>>excludeEnd("ctx");
  8838. $8=self._collectionWithNewValue();
  8839. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8840. $ctx1.sendIdx["collectionWithNewValue"]=2;
  8841. //>>excludeEnd("ctx");
  8842. self._assert_equals_($5,$8);
  8843. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8844. $ctx1.sendIdx["assert:equals:"]=2;
  8845. //>>excludeEnd("ctx");
  8846. $10=self._collectionWithNewValue();
  8847. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8848. $ctx1.sendIdx["collectionWithNewValue"]=3;
  8849. //>>excludeEnd("ctx");
  8850. $9=$recv($10).__comma(self._collection());
  8851. self._assert_equals_($9,self._collectionWithNewValue());
  8852. return self;
  8853. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8854. }, function($ctx1) {$ctx1.fill(self,"testComma",{},$globals.SetTest)});
  8855. //>>excludeEnd("ctx");
  8856. },
  8857. //>>excludeStart("ide", pragmas.excludeIdeData);
  8858. args: [],
  8859. 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",
  8860. referencedClasses: [],
  8861. //>>excludeEnd("ide");
  8862. messageSends: ["testComma", "assert:equals:", ",", "collection", "collectionWithNewValue"]
  8863. }),
  8864. $globals.SetTest);
  8865. $core.addMethod(
  8866. $core.method({
  8867. selector: "testComparing",
  8868. protocol: 'tests',
  8869. fn: function (){
  8870. var self=this;
  8871. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8872. return $core.withContext(function($ctx1) {
  8873. //>>excludeEnd("ctx");
  8874. var $1,$2,$3,$4,$6,$7,$5,$9,$8;
  8875. $1=[(0), (2)]._asSet();
  8876. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8877. $ctx1.sendIdx["asSet"]=1;
  8878. //>>excludeEnd("ctx");
  8879. $2=[(0), (2)]._asSet();
  8880. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8881. $ctx1.sendIdx["asSet"]=2;
  8882. //>>excludeEnd("ctx");
  8883. self._assert_equals_($1,$2);
  8884. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8885. $ctx1.sendIdx["assert:equals:"]=1;
  8886. //>>excludeEnd("ctx");
  8887. $3=[(2), (0)]._asSet();
  8888. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8889. $ctx1.sendIdx["asSet"]=3;
  8890. //>>excludeEnd("ctx");
  8891. $4=[(0), (2)]._asSet();
  8892. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8893. $ctx1.sendIdx["asSet"]=4;
  8894. //>>excludeEnd("ctx");
  8895. self._assert_equals_($3,$4);
  8896. $6=[(0), (2), (3)]._asSet();
  8897. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8898. $ctx1.sendIdx["asSet"]=5;
  8899. //>>excludeEnd("ctx");
  8900. $7=[(0), (2)]._asSet();
  8901. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8902. $ctx1.sendIdx["asSet"]=6;
  8903. //>>excludeEnd("ctx");
  8904. $5=$recv($6).__eq($7);
  8905. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8906. $ctx1.sendIdx["="]=1;
  8907. //>>excludeEnd("ctx");
  8908. self._deny_($5);
  8909. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8910. $ctx1.sendIdx["deny:"]=1;
  8911. //>>excludeEnd("ctx");
  8912. $9=[(1), (2)]._asSet();
  8913. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8914. $ctx1.sendIdx["asSet"]=7;
  8915. //>>excludeEnd("ctx");
  8916. $8=$recv($9).__eq([(0), (2)]._asSet());
  8917. self._deny_($8);
  8918. return self;
  8919. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8920. }, function($ctx1) {$ctx1.fill(self,"testComparing",{},$globals.SetTest)});
  8921. //>>excludeEnd("ctx");
  8922. },
  8923. //>>excludeStart("ide", pragmas.excludeIdeData);
  8924. args: [],
  8925. 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",
  8926. referencedClasses: [],
  8927. //>>excludeEnd("ide");
  8928. messageSends: ["assert:equals:", "asSet", "deny:", "="]
  8929. }),
  8930. $globals.SetTest);
  8931. $core.addMethod(
  8932. $core.method({
  8933. selector: "testPrintString",
  8934. protocol: 'tests',
  8935. fn: function (){
  8936. var self=this;
  8937. var set;
  8938. function $Set(){return $globals.Set||(typeof Set=="undefined"?nil:Set)}
  8939. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8940. return $core.withContext(function($ctx1) {
  8941. //>>excludeEnd("ctx");
  8942. var $1,$2,$3,$4,$5,$6,$7,$8,$9;
  8943. set=$recv($Set())._new();
  8944. $1=$recv(set)._printString();
  8945. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8946. $ctx1.sendIdx["printString"]=1;
  8947. //>>excludeEnd("ctx");
  8948. self._assert_equals_($1,"a Set ()");
  8949. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8950. $ctx1.sendIdx["assert:equals:"]=1;
  8951. //>>excludeEnd("ctx");
  8952. $2=set;
  8953. $recv($2)._add_((1));
  8954. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8955. $ctx1.sendIdx["add:"]=1;
  8956. //>>excludeEnd("ctx");
  8957. $3=$recv($2)._add_((3));
  8958. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8959. $ctx1.sendIdx["add:"]=2;
  8960. //>>excludeEnd("ctx");
  8961. $4=$recv(set)._printString();
  8962. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8963. $ctx1.sendIdx["printString"]=2;
  8964. //>>excludeEnd("ctx");
  8965. self._assert_equals_($4,"a Set (1 3)");
  8966. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8967. $ctx1.sendIdx["assert:equals:"]=2;
  8968. //>>excludeEnd("ctx");
  8969. $recv(set)._add_("foo");
  8970. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8971. $ctx1.sendIdx["add:"]=3;
  8972. //>>excludeEnd("ctx");
  8973. $5=$recv(set)._printString();
  8974. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8975. $ctx1.sendIdx["printString"]=3;
  8976. //>>excludeEnd("ctx");
  8977. self._assert_equals_($5,"a Set (1 3 'foo')");
  8978. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8979. $ctx1.sendIdx["assert:equals:"]=3;
  8980. //>>excludeEnd("ctx");
  8981. $6=set;
  8982. $recv($6)._remove_((1));
  8983. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8984. $ctx1.sendIdx["remove:"]=1;
  8985. //>>excludeEnd("ctx");
  8986. $7=$recv($6)._remove_((3));
  8987. $8=$recv(set)._printString();
  8988. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8989. $ctx1.sendIdx["printString"]=4;
  8990. //>>excludeEnd("ctx");
  8991. self._assert_equals_($8,"a Set ('foo')");
  8992. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8993. $ctx1.sendIdx["assert:equals:"]=4;
  8994. //>>excludeEnd("ctx");
  8995. $recv(set)._add_((3));
  8996. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8997. $ctx1.sendIdx["add:"]=4;
  8998. //>>excludeEnd("ctx");
  8999. $9=$recv(set)._printString();
  9000. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9001. $ctx1.sendIdx["printString"]=5;
  9002. //>>excludeEnd("ctx");
  9003. self._assert_equals_($9,"a Set (3 'foo')");
  9004. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9005. $ctx1.sendIdx["assert:equals:"]=5;
  9006. //>>excludeEnd("ctx");
  9007. $recv(set)._add_((3));
  9008. self._assert_equals_($recv(set)._printString(),"a Set (3 'foo')");
  9009. return self;
  9010. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9011. }, function($ctx1) {$ctx1.fill(self,"testPrintString",{set:set},$globals.SetTest)});
  9012. //>>excludeEnd("ctx");
  9013. },
  9014. //>>excludeStart("ide", pragmas.excludeIdeData);
  9015. args: [],
  9016. 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'')'",
  9017. referencedClasses: ["Set"],
  9018. //>>excludeEnd("ide");
  9019. messageSends: ["new", "assert:equals:", "printString", "add:", "remove:"]
  9020. }),
  9021. $globals.SetTest);
  9022. $core.addMethod(
  9023. $core.method({
  9024. selector: "testUnboxedObjects",
  9025. protocol: 'tests',
  9026. fn: function (){
  9027. var self=this;
  9028. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9029. return $core.withContext(function($ctx1) {
  9030. //>>excludeEnd("ctx");
  9031. var $4,$3,$2,$1;
  9032. $4="foo"._yourself();
  9033. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9034. $ctx1.sendIdx["yourself"]=1;
  9035. //>>excludeEnd("ctx");
  9036. $3=[$4,"foo"._yourself()];
  9037. $2=$recv($3)._asSet();
  9038. $1=$recv($2)._asArray();
  9039. self._assert_equals_($1,["foo"]);
  9040. return self;
  9041. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9042. }, function($ctx1) {$ctx1.fill(self,"testUnboxedObjects",{},$globals.SetTest)});
  9043. //>>excludeEnd("ctx");
  9044. },
  9045. //>>excludeStart("ide", pragmas.excludeIdeData);
  9046. args: [],
  9047. source: "testUnboxedObjects\x0a\x09self assert: {'foo' yourself. 'foo' yourself} asSet asArray equals: #('foo')",
  9048. referencedClasses: [],
  9049. //>>excludeEnd("ide");
  9050. messageSends: ["assert:equals:", "asArray", "asSet", "yourself"]
  9051. }),
  9052. $globals.SetTest);
  9053. $core.addMethod(
  9054. $core.method({
  9055. selector: "testUnicity",
  9056. protocol: 'tests',
  9057. fn: function (){
  9058. var self=this;
  9059. var set;
  9060. function $Set(){return $globals.Set||(typeof Set=="undefined"?nil:Set)}
  9061. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9062. return $core.withContext(function($ctx1) {
  9063. //>>excludeEnd("ctx");
  9064. var $1;
  9065. set=$recv($Set())._new();
  9066. $recv(set)._add_((21));
  9067. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9068. $ctx1.sendIdx["add:"]=1;
  9069. //>>excludeEnd("ctx");
  9070. $recv(set)._add_("hello");
  9071. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9072. $ctx1.sendIdx["add:"]=2;
  9073. //>>excludeEnd("ctx");
  9074. $recv(set)._add_((21));
  9075. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9076. $ctx1.sendIdx["add:"]=3;
  9077. //>>excludeEnd("ctx");
  9078. $1=$recv(set)._size();
  9079. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9080. $ctx1.sendIdx["size"]=1;
  9081. //>>excludeEnd("ctx");
  9082. self._assert_equals_($1,(2));
  9083. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9084. $ctx1.sendIdx["assert:equals:"]=1;
  9085. //>>excludeEnd("ctx");
  9086. $recv(set)._add_("hello");
  9087. self._assert_equals_($recv(set)._size(),(2));
  9088. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9089. $ctx1.sendIdx["assert:equals:"]=2;
  9090. //>>excludeEnd("ctx");
  9091. self._assert_equals_($recv(set)._asArray(),[(21), "hello"]);
  9092. return self;
  9093. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9094. }, function($ctx1) {$ctx1.fill(self,"testUnicity",{set:set},$globals.SetTest)});
  9095. //>>excludeEnd("ctx");
  9096. },
  9097. //>>excludeStart("ide", pragmas.excludeIdeData);
  9098. args: [],
  9099. 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')",
  9100. referencedClasses: ["Set"],
  9101. //>>excludeEnd("ide");
  9102. messageSends: ["new", "add:", "assert:equals:", "size", "asArray"]
  9103. }),
  9104. $globals.SetTest);
  9105. $core.addMethod(
  9106. $core.method({
  9107. selector: "collectionClass",
  9108. protocol: 'fixture',
  9109. fn: function (){
  9110. var self=this;
  9111. function $Set(){return $globals.Set||(typeof Set=="undefined"?nil:Set)}
  9112. return $Set();
  9113. },
  9114. //>>excludeStart("ide", pragmas.excludeIdeData);
  9115. args: [],
  9116. source: "collectionClass\x0a\x09^ Set",
  9117. referencedClasses: ["Set"],
  9118. //>>excludeEnd("ide");
  9119. messageSends: []
  9120. }),
  9121. $globals.SetTest.klass);
  9122. $core.addClass('ConsoleTranscriptTest', $globals.TestCase, [], 'Kernel-Tests');
  9123. $core.addMethod(
  9124. $core.method({
  9125. selector: "testShow",
  9126. protocol: 'tests',
  9127. fn: function (){
  9128. var self=this;
  9129. var originalTranscript;
  9130. function $Transcript(){return $globals.Transcript||(typeof Transcript=="undefined"?nil:Transcript)}
  9131. function $ConsoleTranscript(){return $globals.ConsoleTranscript||(typeof ConsoleTranscript=="undefined"?nil:ConsoleTranscript)}
  9132. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  9133. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9134. return $core.withContext(function($ctx1) {
  9135. //>>excludeEnd("ctx");
  9136. originalTranscript=$recv($Transcript())._current();
  9137. $recv($Transcript())._register_($recv($ConsoleTranscript())._new());
  9138. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9139. $ctx1.sendIdx["register:"]=1;
  9140. //>>excludeEnd("ctx");
  9141. self._shouldnt_raise_((function(){
  9142. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9143. return $core.withContext(function($ctx2) {
  9144. //>>excludeEnd("ctx");
  9145. return $recv($Transcript())._show_("Hello console!");
  9146. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9147. $ctx2.sendIdx["show:"]=1;
  9148. //>>excludeEnd("ctx");
  9149. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9150. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  9151. //>>excludeEnd("ctx");
  9152. }),$Error());
  9153. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9154. $ctx1.sendIdx["shouldnt:raise:"]=1;
  9155. //>>excludeEnd("ctx");
  9156. self._shouldnt_raise_((function(){
  9157. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9158. return $core.withContext(function($ctx2) {
  9159. //>>excludeEnd("ctx");
  9160. return $recv($Transcript())._show_(console);
  9161. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9162. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  9163. //>>excludeEnd("ctx");
  9164. }),$Error());
  9165. $recv($Transcript())._register_(originalTranscript);
  9166. return self;
  9167. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9168. }, function($ctx1) {$ctx1.fill(self,"testShow",{originalTranscript:originalTranscript},$globals.ConsoleTranscriptTest)});
  9169. //>>excludeEnd("ctx");
  9170. },
  9171. //>>excludeStart("ide", pragmas.excludeIdeData);
  9172. args: [],
  9173. 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.",
  9174. referencedClasses: ["Transcript", "ConsoleTranscript", "Error"],
  9175. //>>excludeEnd("ide");
  9176. messageSends: ["current", "register:", "new", "shouldnt:raise:", "show:"]
  9177. }),
  9178. $globals.ConsoleTranscriptTest);
  9179. $core.addClass('JSObjectProxyTest', $globals.TestCase, [], 'Kernel-Tests');
  9180. $core.addMethod(
  9181. $core.method({
  9182. selector: "jsNull",
  9183. protocol: 'accessing',
  9184. fn: function (){
  9185. var self=this;
  9186. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9187. return $core.withContext(function($ctx1) {
  9188. //>>excludeEnd("ctx");
  9189. return null;
  9190. return self;
  9191. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9192. }, function($ctx1) {$ctx1.fill(self,"jsNull",{},$globals.JSObjectProxyTest)});
  9193. //>>excludeEnd("ctx");
  9194. },
  9195. //>>excludeStart("ide", pragmas.excludeIdeData);
  9196. args: [],
  9197. source: "jsNull\x0a\x09<return null>",
  9198. referencedClasses: [],
  9199. //>>excludeEnd("ide");
  9200. messageSends: []
  9201. }),
  9202. $globals.JSObjectProxyTest);
  9203. $core.addMethod(
  9204. $core.method({
  9205. selector: "jsObject",
  9206. protocol: 'accessing',
  9207. fn: function (){
  9208. var self=this;
  9209. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9210. return $core.withContext(function($ctx1) {
  9211. //>>excludeEnd("ctx");
  9212. return {a: 1, b: function() {return 2;}, c: function(object) {return object;}, d: '', 'e': null, 'f': void 0};
  9213. return self;
  9214. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9215. }, function($ctx1) {$ctx1.fill(self,"jsObject",{},$globals.JSObjectProxyTest)});
  9216. //>>excludeEnd("ctx");
  9217. },
  9218. //>>excludeStart("ide", pragmas.excludeIdeData);
  9219. args: [],
  9220. source: "jsObject\x0a\x09<return {a: 1, b: function() {return 2;}, c: function(object) {return object;}, d: '', 'e': null, 'f': void 0}>",
  9221. referencedClasses: [],
  9222. //>>excludeEnd("ide");
  9223. messageSends: []
  9224. }),
  9225. $globals.JSObjectProxyTest);
  9226. $core.addMethod(
  9227. $core.method({
  9228. selector: "jsUndefined",
  9229. protocol: 'accessing',
  9230. fn: function (){
  9231. var self=this;
  9232. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9233. return $core.withContext(function($ctx1) {
  9234. //>>excludeEnd("ctx");
  9235. return;
  9236. return self;
  9237. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9238. }, function($ctx1) {$ctx1.fill(self,"jsUndefined",{},$globals.JSObjectProxyTest)});
  9239. //>>excludeEnd("ctx");
  9240. },
  9241. //>>excludeStart("ide", pragmas.excludeIdeData);
  9242. args: [],
  9243. source: "jsUndefined\x0a\x09<return>",
  9244. referencedClasses: [],
  9245. //>>excludeEnd("ide");
  9246. messageSends: []
  9247. }),
  9248. $globals.JSObjectProxyTest);
  9249. $core.addMethod(
  9250. $core.method({
  9251. selector: "testAtIfAbsent",
  9252. protocol: 'tests',
  9253. fn: function (){
  9254. var self=this;
  9255. var testObject;
  9256. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9257. return $core.withContext(function($ctx1) {
  9258. //>>excludeEnd("ctx");
  9259. var $1,$2,$3;
  9260. testObject=self._jsObject();
  9261. $1=$recv(testObject)._at_ifAbsent_("abc",(function(){
  9262. return "Property does not exist";
  9263. }));
  9264. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9265. $ctx1.sendIdx["at:ifAbsent:"]=1;
  9266. //>>excludeEnd("ctx");
  9267. self._assert_equals_($1,"Property does not exist");
  9268. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9269. $ctx1.sendIdx["assert:equals:"]=1;
  9270. //>>excludeEnd("ctx");
  9271. $2=$recv(testObject)._at_ifAbsent_("e",(function(){
  9272. return "Property does not exist";
  9273. }));
  9274. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9275. $ctx1.sendIdx["at:ifAbsent:"]=2;
  9276. //>>excludeEnd("ctx");
  9277. self._assert_equals_($2,nil);
  9278. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9279. $ctx1.sendIdx["assert:equals:"]=2;
  9280. //>>excludeEnd("ctx");
  9281. $3=$recv(testObject)._at_ifAbsent_("a",(function(){
  9282. return "Property does not exist";
  9283. }));
  9284. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9285. $ctx1.sendIdx["at:ifAbsent:"]=3;
  9286. //>>excludeEnd("ctx");
  9287. self._assert_equals_($3,(1));
  9288. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9289. $ctx1.sendIdx["assert:equals:"]=3;
  9290. //>>excludeEnd("ctx");
  9291. self._assert_equals_($recv(testObject)._at_ifAbsent_("f",(function(){
  9292. return "Property does not exist";
  9293. })),nil);
  9294. return self;
  9295. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9296. }, function($ctx1) {$ctx1.fill(self,"testAtIfAbsent",{testObject:testObject},$globals.JSObjectProxyTest)});
  9297. //>>excludeEnd("ctx");
  9298. },
  9299. //>>excludeStart("ide", pragmas.excludeIdeData);
  9300. args: [],
  9301. 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.",
  9302. referencedClasses: [],
  9303. //>>excludeEnd("ide");
  9304. messageSends: ["jsObject", "assert:equals:", "at:ifAbsent:"]
  9305. }),
  9306. $globals.JSObjectProxyTest);
  9307. $core.addMethod(
  9308. $core.method({
  9309. selector: "testAtIfPresent",
  9310. protocol: 'tests',
  9311. fn: function (){
  9312. var self=this;
  9313. var testObject;
  9314. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9315. return $core.withContext(function($ctx1) {
  9316. //>>excludeEnd("ctx");
  9317. var $2,$1,$4,$3,$6,$5;
  9318. testObject=self._jsObject();
  9319. $1=$recv(testObject)._at_ifPresent_("abc",(function(x){
  9320. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9321. return $core.withContext(function($ctx2) {
  9322. //>>excludeEnd("ctx");
  9323. $2=$recv(x)._asString();
  9324. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9325. $ctx2.sendIdx["asString"]=1;
  9326. //>>excludeEnd("ctx");
  9327. return "hello ".__comma($2);
  9328. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9329. $ctx2.sendIdx[","]=1;
  9330. //>>excludeEnd("ctx");
  9331. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9332. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)});
  9333. //>>excludeEnd("ctx");
  9334. }));
  9335. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9336. $ctx1.sendIdx["at:ifPresent:"]=1;
  9337. //>>excludeEnd("ctx");
  9338. self._assert_equals_($1,nil);
  9339. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9340. $ctx1.sendIdx["assert:equals:"]=1;
  9341. //>>excludeEnd("ctx");
  9342. $3=$recv(testObject)._at_ifPresent_("e",(function(x){
  9343. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9344. return $core.withContext(function($ctx2) {
  9345. //>>excludeEnd("ctx");
  9346. $4=$recv(x)._asString();
  9347. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9348. $ctx2.sendIdx["asString"]=2;
  9349. //>>excludeEnd("ctx");
  9350. return "hello ".__comma($4);
  9351. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9352. $ctx2.sendIdx[","]=2;
  9353. //>>excludeEnd("ctx");
  9354. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9355. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,2)});
  9356. //>>excludeEnd("ctx");
  9357. }));
  9358. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9359. $ctx1.sendIdx["at:ifPresent:"]=2;
  9360. //>>excludeEnd("ctx");
  9361. self._assert_equals_($3,"hello nil");
  9362. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9363. $ctx1.sendIdx["assert:equals:"]=2;
  9364. //>>excludeEnd("ctx");
  9365. $5=$recv(testObject)._at_ifPresent_("a",(function(x){
  9366. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9367. return $core.withContext(function($ctx2) {
  9368. //>>excludeEnd("ctx");
  9369. $6=$recv(x)._asString();
  9370. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9371. $ctx2.sendIdx["asString"]=3;
  9372. //>>excludeEnd("ctx");
  9373. return "hello ".__comma($6);
  9374. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9375. $ctx2.sendIdx[","]=3;
  9376. //>>excludeEnd("ctx");
  9377. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9378. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,3)});
  9379. //>>excludeEnd("ctx");
  9380. }));
  9381. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9382. $ctx1.sendIdx["at:ifPresent:"]=3;
  9383. //>>excludeEnd("ctx");
  9384. self._assert_equals_($5,"hello 1");
  9385. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9386. $ctx1.sendIdx["assert:equals:"]=3;
  9387. //>>excludeEnd("ctx");
  9388. self._assert_equals_($recv(testObject)._at_ifPresent_("f",(function(x){
  9389. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9390. return $core.withContext(function($ctx2) {
  9391. //>>excludeEnd("ctx");
  9392. return "hello ".__comma($recv(x)._asString());
  9393. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9394. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,4)});
  9395. //>>excludeEnd("ctx");
  9396. })),"hello nil");
  9397. return self;
  9398. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9399. }, function($ctx1) {$ctx1.fill(self,"testAtIfPresent",{testObject:testObject},$globals.JSObjectProxyTest)});
  9400. //>>excludeEnd("ctx");
  9401. },
  9402. //>>excludeStart("ide", pragmas.excludeIdeData);
  9403. args: [],
  9404. 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'.",
  9405. referencedClasses: [],
  9406. //>>excludeEnd("ide");
  9407. messageSends: ["jsObject", "assert:equals:", "at:ifPresent:", ",", "asString"]
  9408. }),
  9409. $globals.JSObjectProxyTest);
  9410. $core.addMethod(
  9411. $core.method({
  9412. selector: "testAtIfPresentIfAbsent",
  9413. protocol: 'tests',
  9414. fn: function (){
  9415. var self=this;
  9416. var testObject;
  9417. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9418. return $core.withContext(function($ctx1) {
  9419. //>>excludeEnd("ctx");
  9420. var $2,$1,$4,$3,$6,$5;
  9421. testObject=self._jsObject();
  9422. $1=$recv(testObject)._at_ifPresent_ifAbsent_("abc",(function(x){
  9423. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9424. return $core.withContext(function($ctx2) {
  9425. //>>excludeEnd("ctx");
  9426. $2=$recv(x)._asString();
  9427. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9428. $ctx2.sendIdx["asString"]=1;
  9429. //>>excludeEnd("ctx");
  9430. return "hello ".__comma($2);
  9431. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9432. $ctx2.sendIdx[","]=1;
  9433. //>>excludeEnd("ctx");
  9434. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9435. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)});
  9436. //>>excludeEnd("ctx");
  9437. }),(function(){
  9438. return "not present";
  9439. }));
  9440. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9441. $ctx1.sendIdx["at:ifPresent:ifAbsent:"]=1;
  9442. //>>excludeEnd("ctx");
  9443. self._assert_equals_($1,"not present");
  9444. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9445. $ctx1.sendIdx["assert:equals:"]=1;
  9446. //>>excludeEnd("ctx");
  9447. $3=$recv(testObject)._at_ifPresent_ifAbsent_("e",(function(x){
  9448. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9449. return $core.withContext(function($ctx2) {
  9450. //>>excludeEnd("ctx");
  9451. $4=$recv(x)._asString();
  9452. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9453. $ctx2.sendIdx["asString"]=2;
  9454. //>>excludeEnd("ctx");
  9455. return "hello ".__comma($4);
  9456. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9457. $ctx2.sendIdx[","]=2;
  9458. //>>excludeEnd("ctx");
  9459. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9460. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,3)});
  9461. //>>excludeEnd("ctx");
  9462. }),(function(){
  9463. return "not present";
  9464. }));
  9465. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9466. $ctx1.sendIdx["at:ifPresent:ifAbsent:"]=2;
  9467. //>>excludeEnd("ctx");
  9468. self._assert_equals_($3,"hello nil");
  9469. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9470. $ctx1.sendIdx["assert:equals:"]=2;
  9471. //>>excludeEnd("ctx");
  9472. $5=$recv(testObject)._at_ifPresent_ifAbsent_("a",(function(x){
  9473. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9474. return $core.withContext(function($ctx2) {
  9475. //>>excludeEnd("ctx");
  9476. $6=$recv(x)._asString();
  9477. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9478. $ctx2.sendIdx["asString"]=3;
  9479. //>>excludeEnd("ctx");
  9480. return "hello ".__comma($6);
  9481. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9482. $ctx2.sendIdx[","]=3;
  9483. //>>excludeEnd("ctx");
  9484. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9485. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,5)});
  9486. //>>excludeEnd("ctx");
  9487. }),(function(){
  9488. return "not present";
  9489. }));
  9490. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9491. $ctx1.sendIdx["at:ifPresent:ifAbsent:"]=3;
  9492. //>>excludeEnd("ctx");
  9493. self._assert_equals_($5,"hello 1");
  9494. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9495. $ctx1.sendIdx["assert:equals:"]=3;
  9496. //>>excludeEnd("ctx");
  9497. self._assert_equals_($recv(testObject)._at_ifPresent_ifAbsent_("f",(function(x){
  9498. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9499. return $core.withContext(function($ctx2) {
  9500. //>>excludeEnd("ctx");
  9501. return "hello ".__comma($recv(x)._asString());
  9502. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9503. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,7)});
  9504. //>>excludeEnd("ctx");
  9505. }),(function(){
  9506. return "not present";
  9507. })),"hello nil");
  9508. return self;
  9509. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9510. }, function($ctx1) {$ctx1.fill(self,"testAtIfPresentIfAbsent",{testObject:testObject},$globals.JSObjectProxyTest)});
  9511. //>>excludeEnd("ctx");
  9512. },
  9513. //>>excludeStart("ide", pragmas.excludeIdeData);
  9514. args: [],
  9515. 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'.",
  9516. referencedClasses: [],
  9517. //>>excludeEnd("ide");
  9518. messageSends: ["jsObject", "assert:equals:", "at:ifPresent:ifAbsent:", ",", "asString"]
  9519. }),
  9520. $globals.JSObjectProxyTest);
  9521. $core.addMethod(
  9522. $core.method({
  9523. selector: "testAtPut",
  9524. protocol: 'tests',
  9525. fn: function (){
  9526. var self=this;
  9527. var testObject;
  9528. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9529. return $core.withContext(function($ctx1) {
  9530. //>>excludeEnd("ctx");
  9531. var $2,$1;
  9532. testObject=self._jsObject();
  9533. $2=$recv(testObject)._at_("abc");
  9534. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9535. $ctx1.sendIdx["at:"]=1;
  9536. //>>excludeEnd("ctx");
  9537. $1=$recv($2).__tild_eq("xyz");
  9538. self._assert_($1);
  9539. self._assert_equals_($recv(testObject)._at_put_("abc","xyz"),"xyz");
  9540. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9541. $ctx1.sendIdx["assert:equals:"]=1;
  9542. //>>excludeEnd("ctx");
  9543. self._assert_equals_($recv(testObject)._at_("abc"),"xyz");
  9544. return self;
  9545. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9546. }, function($ctx1) {$ctx1.fill(self,"testAtPut",{testObject:testObject},$globals.JSObjectProxyTest)});
  9547. //>>excludeEnd("ctx");
  9548. },
  9549. //>>excludeStart("ide", pragmas.excludeIdeData);
  9550. args: [],
  9551. 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'",
  9552. referencedClasses: [],
  9553. //>>excludeEnd("ide");
  9554. messageSends: ["jsObject", "assert:", "~=", "at:", "assert:equals:", "at:put:"]
  9555. }),
  9556. $globals.JSObjectProxyTest);
  9557. $core.addMethod(
  9558. $core.method({
  9559. selector: "testComparison",
  9560. protocol: 'tests',
  9561. fn: function (){
  9562. var self=this;
  9563. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  9564. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9565. return $core.withContext(function($ctx1) {
  9566. //>>excludeEnd("ctx");
  9567. var $1,$2;
  9568. self._assert_equals_($recv([console,(2)])._indexOf_(console),(1));
  9569. $1=$recv(console).__eq(console);
  9570. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9571. $ctx1.sendIdx["="]=1;
  9572. //>>excludeEnd("ctx");
  9573. self._assert_($1);
  9574. $2=$recv(console).__eq($recv($Object())._new());
  9575. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9576. $ctx1.sendIdx["="]=2;
  9577. //>>excludeEnd("ctx");
  9578. self._deny_($2);
  9579. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9580. $ctx1.sendIdx["deny:"]=1;
  9581. //>>excludeEnd("ctx");
  9582. self._deny_($recv(console).__eq(self._jsObject()));
  9583. return self;
  9584. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9585. }, function($ctx1) {$ctx1.fill(self,"testComparison",{},$globals.JSObjectProxyTest)});
  9586. //>>excludeEnd("ctx");
  9587. },
  9588. //>>excludeStart("ide", pragmas.excludeIdeData);
  9589. args: [],
  9590. 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",
  9591. referencedClasses: ["Object"],
  9592. //>>excludeEnd("ide");
  9593. messageSends: ["assert:equals:", "indexOf:", "assert:", "=", "deny:", "new", "jsObject"]
  9594. }),
  9595. $globals.JSObjectProxyTest);
  9596. $core.addMethod(
  9597. $core.method({
  9598. selector: "testDNU",
  9599. protocol: 'tests',
  9600. fn: function (){
  9601. var self=this;
  9602. function $MessageNotUnderstood(){return $globals.MessageNotUnderstood||(typeof MessageNotUnderstood=="undefined"?nil:MessageNotUnderstood)}
  9603. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9604. return $core.withContext(function($ctx1) {
  9605. //>>excludeEnd("ctx");
  9606. self._should_raise_((function(){
  9607. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9608. return $core.withContext(function($ctx2) {
  9609. //>>excludeEnd("ctx");
  9610. return $recv(self._jsObject())._foo();
  9611. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9612. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  9613. //>>excludeEnd("ctx");
  9614. }),$MessageNotUnderstood());
  9615. return self;
  9616. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9617. }, function($ctx1) {$ctx1.fill(self,"testDNU",{},$globals.JSObjectProxyTest)});
  9618. //>>excludeEnd("ctx");
  9619. },
  9620. //>>excludeStart("ide", pragmas.excludeIdeData);
  9621. args: [],
  9622. source: "testDNU\x0a\x09self should: [ self jsObject foo ] raise: MessageNotUnderstood",
  9623. referencedClasses: ["MessageNotUnderstood"],
  9624. //>>excludeEnd("ide");
  9625. messageSends: ["should:raise:", "foo", "jsObject"]
  9626. }),
  9627. $globals.JSObjectProxyTest);
  9628. $core.addMethod(
  9629. $core.method({
  9630. selector: "testDNURegression1057",
  9631. protocol: 'tests',
  9632. fn: function (){
  9633. var self=this;
  9634. var jsObject;
  9635. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  9636. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9637. return $core.withContext(function($ctx1) {
  9638. //>>excludeEnd("ctx");
  9639. var $1;
  9640. jsObject=[];
  9641. $recv(jsObject)._basicAt_put_("allowJavaScriptCalls",true);
  9642. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9643. $ctx1.sendIdx["basicAt:put:"]=1;
  9644. //>>excludeEnd("ctx");
  9645. $recv(jsObject)._basicAt_put_("foo",(3));
  9646. self._shouldnt_raise_((function(){
  9647. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9648. return $core.withContext(function($ctx2) {
  9649. //>>excludeEnd("ctx");
  9650. return $recv(jsObject)._foo();
  9651. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9652. $ctx2.sendIdx["foo"]=1;
  9653. //>>excludeEnd("ctx");
  9654. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9655. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  9656. //>>excludeEnd("ctx");
  9657. }),$Error());
  9658. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9659. $ctx1.sendIdx["shouldnt:raise:"]=1;
  9660. //>>excludeEnd("ctx");
  9661. $1=$recv(jsObject)._foo();
  9662. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9663. $ctx1.sendIdx["foo"]=2;
  9664. //>>excludeEnd("ctx");
  9665. self._assert_equals_($1,(3));
  9666. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9667. $ctx1.sendIdx["assert:equals:"]=1;
  9668. //>>excludeEnd("ctx");
  9669. self._shouldnt_raise_((function(){
  9670. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9671. return $core.withContext(function($ctx2) {
  9672. //>>excludeEnd("ctx");
  9673. return $recv(jsObject)._foo_((4));
  9674. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9675. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  9676. //>>excludeEnd("ctx");
  9677. }),$Error());
  9678. self._assert_equals_($recv(jsObject)._foo(),(4));
  9679. return self;
  9680. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9681. }, function($ctx1) {$ctx1.fill(self,"testDNURegression1057",{jsObject:jsObject},$globals.JSObjectProxyTest)});
  9682. //>>excludeEnd("ctx");
  9683. },
  9684. //>>excludeStart("ide", pragmas.excludeIdeData);
  9685. args: [],
  9686. 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",
  9687. referencedClasses: ["Error"],
  9688. //>>excludeEnd("ide");
  9689. messageSends: ["basicAt:put:", "shouldnt:raise:", "foo", "assert:equals:", "foo:"]
  9690. }),
  9691. $globals.JSObjectProxyTest);
  9692. $core.addMethod(
  9693. $core.method({
  9694. selector: "testDNURegression1059",
  9695. protocol: 'tests',
  9696. fn: function (){
  9697. var self=this;
  9698. var jsObject;
  9699. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  9700. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9701. return $core.withContext(function($ctx1) {
  9702. //>>excludeEnd("ctx");
  9703. jsObject=[];
  9704. $recv(jsObject)._basicAt_put_("allowJavaScriptCalls",true);
  9705. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9706. $ctx1.sendIdx["basicAt:put:"]=1;
  9707. //>>excludeEnd("ctx");
  9708. $recv(jsObject)._basicAt_put_("x",(3));
  9709. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9710. $ctx1.sendIdx["basicAt:put:"]=2;
  9711. //>>excludeEnd("ctx");
  9712. $recv(jsObject)._basicAt_put_("x:",(function(){
  9713. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9714. return $core.withContext(function($ctx2) {
  9715. //>>excludeEnd("ctx");
  9716. return self._error();
  9717. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9718. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  9719. //>>excludeEnd("ctx");
  9720. }));
  9721. self._shouldnt_raise_((function(){
  9722. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9723. return $core.withContext(function($ctx2) {
  9724. //>>excludeEnd("ctx");
  9725. return $recv(jsObject)._x_((4));
  9726. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9727. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  9728. //>>excludeEnd("ctx");
  9729. }),$Error());
  9730. self._assert_equals_($recv(jsObject)._x(),(4));
  9731. return self;
  9732. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9733. }, function($ctx1) {$ctx1.fill(self,"testDNURegression1059",{jsObject:jsObject},$globals.JSObjectProxyTest)});
  9734. //>>excludeEnd("ctx");
  9735. },
  9736. //>>excludeStart("ide", pragmas.excludeIdeData);
  9737. args: [],
  9738. 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",
  9739. referencedClasses: ["Error"],
  9740. //>>excludeEnd("ide");
  9741. messageSends: ["basicAt:put:", "error", "shouldnt:raise:", "x:", "assert:equals:", "x"]
  9742. }),
  9743. $globals.JSObjectProxyTest);
  9744. $core.addMethod(
  9745. $core.method({
  9746. selector: "testDNURegression1062",
  9747. protocol: 'tests',
  9748. fn: function (){
  9749. var self=this;
  9750. var jsObject,stored;
  9751. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  9752. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9753. return $core.withContext(function($ctx1) {
  9754. //>>excludeEnd("ctx");
  9755. jsObject=[];
  9756. $recv(jsObject)._basicAt_put_("allowJavaScriptCalls",true);
  9757. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9758. $ctx1.sendIdx["basicAt:put:"]=1;
  9759. //>>excludeEnd("ctx");
  9760. $recv(jsObject)._basicAt_put_("x",(function(v){
  9761. stored=v;
  9762. return stored;
  9763. }));
  9764. self._shouldnt_raise_((function(){
  9765. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9766. return $core.withContext(function($ctx2) {
  9767. //>>excludeEnd("ctx");
  9768. return $recv(jsObject)._x_((4));
  9769. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9770. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  9771. //>>excludeEnd("ctx");
  9772. }),$Error());
  9773. self._assert_equals_(stored,(4));
  9774. return self;
  9775. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9776. }, function($ctx1) {$ctx1.fill(self,"testDNURegression1062",{jsObject:jsObject,stored:stored},$globals.JSObjectProxyTest)});
  9777. //>>excludeEnd("ctx");
  9778. },
  9779. //>>excludeStart("ide", pragmas.excludeIdeData);
  9780. args: [],
  9781. 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",
  9782. referencedClasses: ["Error"],
  9783. //>>excludeEnd("ide");
  9784. messageSends: ["basicAt:put:", "shouldnt:raise:", "x:", "assert:equals:"]
  9785. }),
  9786. $globals.JSObjectProxyTest);
  9787. $core.addMethod(
  9788. $core.method({
  9789. selector: "testDNUWithAllowJavaScriptCalls",
  9790. protocol: 'tests',
  9791. fn: function (){
  9792. var self=this;
  9793. var jsObject;
  9794. function $MessageNotUnderstood(){return $globals.MessageNotUnderstood||(typeof MessageNotUnderstood=="undefined"?nil:MessageNotUnderstood)}
  9795. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9796. return $core.withContext(function($ctx1) {
  9797. //>>excludeEnd("ctx");
  9798. jsObject=[];
  9799. $recv(jsObject)._basicAt_put_("allowJavaScriptCalls",true);
  9800. self._should_raise_((function(){
  9801. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9802. return $core.withContext(function($ctx2) {
  9803. //>>excludeEnd("ctx");
  9804. return $recv(jsObject)._foo();
  9805. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9806. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  9807. //>>excludeEnd("ctx");
  9808. }),$MessageNotUnderstood());
  9809. return self;
  9810. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9811. }, function($ctx1) {$ctx1.fill(self,"testDNUWithAllowJavaScriptCalls",{jsObject:jsObject},$globals.JSObjectProxyTest)});
  9812. //>>excludeEnd("ctx");
  9813. },
  9814. //>>excludeStart("ide", pragmas.excludeIdeData);
  9815. args: [],
  9816. source: "testDNUWithAllowJavaScriptCalls\x0a\x09| jsObject |\x0a\x09jsObject := #().\x0a\x09jsObject basicAt: 'allowJavaScriptCalls' put: true.\x0a\x09self should: [ jsObject foo ] raise: MessageNotUnderstood",
  9817. referencedClasses: ["MessageNotUnderstood"],
  9818. //>>excludeEnd("ide");
  9819. messageSends: ["basicAt:put:", "should:raise:", "foo"]
  9820. }),
  9821. $globals.JSObjectProxyTest);
  9822. $core.addMethod(
  9823. $core.method({
  9824. selector: "testMessageSend",
  9825. protocol: 'tests',
  9826. fn: function (){
  9827. var self=this;
  9828. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9829. return $core.withContext(function($ctx1) {
  9830. //>>excludeEnd("ctx");
  9831. var $2,$1,$4,$3;
  9832. $2=self._jsObject();
  9833. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9834. $ctx1.sendIdx["jsObject"]=1;
  9835. //>>excludeEnd("ctx");
  9836. $1=$recv($2)._a();
  9837. self._assert_equals_($1,(1));
  9838. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9839. $ctx1.sendIdx["assert:equals:"]=1;
  9840. //>>excludeEnd("ctx");
  9841. $4=self._jsObject();
  9842. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9843. $ctx1.sendIdx["jsObject"]=2;
  9844. //>>excludeEnd("ctx");
  9845. $3=$recv($4)._b();
  9846. self._assert_equals_($3,(2));
  9847. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9848. $ctx1.sendIdx["assert:equals:"]=2;
  9849. //>>excludeEnd("ctx");
  9850. self._assert_equals_($recv(self._jsObject())._c_((3)),(3));
  9851. return self;
  9852. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9853. }, function($ctx1) {$ctx1.fill(self,"testMessageSend",{},$globals.JSObjectProxyTest)});
  9854. //>>excludeEnd("ctx");
  9855. },
  9856. //>>excludeStart("ide", pragmas.excludeIdeData);
  9857. args: [],
  9858. 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",
  9859. referencedClasses: [],
  9860. //>>excludeEnd("ide");
  9861. messageSends: ["assert:equals:", "a", "jsObject", "b", "c:"]
  9862. }),
  9863. $globals.JSObjectProxyTest);
  9864. $core.addMethod(
  9865. $core.method({
  9866. selector: "testMethodWithArguments",
  9867. protocol: 'tests',
  9868. fn: function (){
  9869. var self=this;
  9870. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9871. return $core.withContext(function($ctx1) {
  9872. //>>excludeEnd("ctx");
  9873. self._assert_equals_($recv(self._jsObject())._c_((1)),(1));
  9874. return self;
  9875. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9876. }, function($ctx1) {$ctx1.fill(self,"testMethodWithArguments",{},$globals.JSObjectProxyTest)});
  9877. //>>excludeEnd("ctx");
  9878. },
  9879. //>>excludeStart("ide", pragmas.excludeIdeData);
  9880. args: [],
  9881. source: "testMethodWithArguments\x0a\x09self assert: (self jsObject c: 1) equals: 1",
  9882. referencedClasses: [],
  9883. //>>excludeEnd("ide");
  9884. messageSends: ["assert:equals:", "c:", "jsObject"]
  9885. }),
  9886. $globals.JSObjectProxyTest);
  9887. $core.addMethod(
  9888. $core.method({
  9889. selector: "testPrinting",
  9890. protocol: 'tests',
  9891. fn: function (){
  9892. var self=this;
  9893. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9894. return $core.withContext(function($ctx1) {
  9895. //>>excludeEnd("ctx");
  9896. self._assert_equals_($recv(self._jsObject())._printString(),"[object Object]");
  9897. return self;
  9898. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9899. }, function($ctx1) {$ctx1.fill(self,"testPrinting",{},$globals.JSObjectProxyTest)});
  9900. //>>excludeEnd("ctx");
  9901. },
  9902. //>>excludeStart("ide", pragmas.excludeIdeData);
  9903. args: [],
  9904. source: "testPrinting\x0a\x09self assert: self jsObject printString equals: '[object Object]'",
  9905. referencedClasses: [],
  9906. //>>excludeEnd("ide");
  9907. messageSends: ["assert:equals:", "printString", "jsObject"]
  9908. }),
  9909. $globals.JSObjectProxyTest);
  9910. $core.addMethod(
  9911. $core.method({
  9912. selector: "testPropertyThatReturnsEmptyString",
  9913. protocol: 'tests',
  9914. fn: function (){
  9915. var self=this;
  9916. var object;
  9917. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9918. return $core.withContext(function($ctx1) {
  9919. //>>excludeEnd("ctx");
  9920. var $1;
  9921. object=self._jsObject();
  9922. $1=$recv(object)._d();
  9923. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9924. $ctx1.sendIdx["d"]=1;
  9925. //>>excludeEnd("ctx");
  9926. self._assert_equals_($1,"");
  9927. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9928. $ctx1.sendIdx["assert:equals:"]=1;
  9929. //>>excludeEnd("ctx");
  9930. $recv(object)._d_("hello");
  9931. self._assert_equals_($recv(object)._d(),"hello");
  9932. return self;
  9933. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9934. }, function($ctx1) {$ctx1.fill(self,"testPropertyThatReturnsEmptyString",{object:object},$globals.JSObjectProxyTest)});
  9935. //>>excludeEnd("ctx");
  9936. },
  9937. //>>excludeStart("ide", pragmas.excludeIdeData);
  9938. args: [],
  9939. 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'",
  9940. referencedClasses: [],
  9941. //>>excludeEnd("ide");
  9942. messageSends: ["jsObject", "assert:equals:", "d", "d:"]
  9943. }),
  9944. $globals.JSObjectProxyTest);
  9945. $core.addMethod(
  9946. $core.method({
  9947. selector: "testPropertyThatReturnsUndefined",
  9948. protocol: 'tests',
  9949. fn: function (){
  9950. var self=this;
  9951. var object;
  9952. function $MessageNotUnderstood(){return $globals.MessageNotUnderstood||(typeof MessageNotUnderstood=="undefined"?nil:MessageNotUnderstood)}
  9953. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9954. return $core.withContext(function($ctx1) {
  9955. //>>excludeEnd("ctx");
  9956. object=self._jsObject();
  9957. self._shouldnt_raise_((function(){
  9958. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9959. return $core.withContext(function($ctx2) {
  9960. //>>excludeEnd("ctx");
  9961. return $recv(object)._e();
  9962. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9963. $ctx2.sendIdx["e"]=1;
  9964. //>>excludeEnd("ctx");
  9965. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9966. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  9967. //>>excludeEnd("ctx");
  9968. }),$MessageNotUnderstood());
  9969. self._assert_($recv($recv(object)._e())._isNil());
  9970. return self;
  9971. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9972. }, function($ctx1) {$ctx1.fill(self,"testPropertyThatReturnsUndefined",{object:object},$globals.JSObjectProxyTest)});
  9973. //>>excludeEnd("ctx");
  9974. },
  9975. //>>excludeStart("ide", pragmas.excludeIdeData);
  9976. args: [],
  9977. source: "testPropertyThatReturnsUndefined\x0a\x09| object |\x0a\x0a\x09object := self jsObject.\x0a\x09self shouldnt: [ object e ] raise: MessageNotUnderstood.\x0a\x09self assert: object e isNil",
  9978. referencedClasses: ["MessageNotUnderstood"],
  9979. //>>excludeEnd("ide");
  9980. messageSends: ["jsObject", "shouldnt:raise:", "e", "assert:", "isNil"]
  9981. }),
  9982. $globals.JSObjectProxyTest);
  9983. $core.addMethod(
  9984. $core.method({
  9985. selector: "testSetPropertyWithFalsyValue",
  9986. protocol: 'tests',
  9987. fn: function (){
  9988. var self=this;
  9989. var jsObject;
  9990. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9991. return $core.withContext(function($ctx1) {
  9992. //>>excludeEnd("ctx");
  9993. var $1,$2,$3,$4,$5;
  9994. jsObject=self._jsObject();
  9995. $1=$recv(jsObject)._a();
  9996. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9997. $ctx1.sendIdx["a"]=1;
  9998. //>>excludeEnd("ctx");
  9999. self._assert_equals_($1,(1));
  10000. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10001. $ctx1.sendIdx["assert:equals:"]=1;
  10002. //>>excludeEnd("ctx");
  10003. $recv(jsObject)._a_(self._jsNull());
  10004. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10005. $ctx1.sendIdx["a:"]=1;
  10006. //>>excludeEnd("ctx");
  10007. $2=$recv(jsObject)._a();
  10008. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10009. $ctx1.sendIdx["a"]=2;
  10010. //>>excludeEnd("ctx");
  10011. self._assert_equals_($2,nil);
  10012. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10013. $ctx1.sendIdx["assert:equals:"]=2;
  10014. //>>excludeEnd("ctx");
  10015. $recv(jsObject)._a_((0));
  10016. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10017. $ctx1.sendIdx["a:"]=2;
  10018. //>>excludeEnd("ctx");
  10019. $3=$recv(jsObject)._a();
  10020. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10021. $ctx1.sendIdx["a"]=3;
  10022. //>>excludeEnd("ctx");
  10023. self._assert_equals_($3,(0));
  10024. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10025. $ctx1.sendIdx["assert:equals:"]=3;
  10026. //>>excludeEnd("ctx");
  10027. $recv(jsObject)._a_(self._jsUndefined());
  10028. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10029. $ctx1.sendIdx["a:"]=3;
  10030. //>>excludeEnd("ctx");
  10031. $4=$recv(jsObject)._a();
  10032. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10033. $ctx1.sendIdx["a"]=4;
  10034. //>>excludeEnd("ctx");
  10035. self._assert_equals_($4,nil);
  10036. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10037. $ctx1.sendIdx["assert:equals:"]=4;
  10038. //>>excludeEnd("ctx");
  10039. $recv(jsObject)._a_("");
  10040. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10041. $ctx1.sendIdx["a:"]=4;
  10042. //>>excludeEnd("ctx");
  10043. $5=$recv(jsObject)._a();
  10044. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10045. $ctx1.sendIdx["a"]=5;
  10046. //>>excludeEnd("ctx");
  10047. self._assert_equals_($5,"");
  10048. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10049. $ctx1.sendIdx["assert:equals:"]=5;
  10050. //>>excludeEnd("ctx");
  10051. $recv(jsObject)._a_(false);
  10052. self._assert_equals_($recv(jsObject)._a(),false);
  10053. return self;
  10054. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10055. }, function($ctx1) {$ctx1.fill(self,"testSetPropertyWithFalsyValue",{jsObject:jsObject},$globals.JSObjectProxyTest)});
  10056. //>>excludeEnd("ctx");
  10057. },
  10058. //>>excludeStart("ide", pragmas.excludeIdeData);
  10059. args: [],
  10060. 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",
  10061. referencedClasses: [],
  10062. //>>excludeEnd("ide");
  10063. messageSends: ["jsObject", "assert:equals:", "a", "a:", "jsNull", "jsUndefined"]
  10064. }),
  10065. $globals.JSObjectProxyTest);
  10066. $core.addMethod(
  10067. $core.method({
  10068. selector: "testValue",
  10069. protocol: 'tests',
  10070. fn: function (){
  10071. var self=this;
  10072. var testObject;
  10073. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10074. return $core.withContext(function($ctx1) {
  10075. //>>excludeEnd("ctx");
  10076. testObject=self._jsObject();
  10077. $recv(testObject)._at_put_("value","aValue");
  10078. self._assert_equals_($recv(testObject)._value(),"aValue");
  10079. return self;
  10080. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10081. }, function($ctx1) {$ctx1.fill(self,"testValue",{testObject:testObject},$globals.JSObjectProxyTest)});
  10082. //>>excludeEnd("ctx");
  10083. },
  10084. //>>excludeStart("ide", pragmas.excludeIdeData);
  10085. args: [],
  10086. source: "testValue\x0a\x09| testObject |\x0a\x09testObject := self jsObject.\x0a\x09testObject at: 'value' put: 'aValue'.\x0a\x09self assert: testObject value equals: 'aValue'",
  10087. referencedClasses: [],
  10088. //>>excludeEnd("ide");
  10089. messageSends: ["jsObject", "at:put:", "assert:equals:", "value"]
  10090. }),
  10091. $globals.JSObjectProxyTest);
  10092. $core.addMethod(
  10093. $core.method({
  10094. selector: "testYourself",
  10095. protocol: 'tests',
  10096. fn: function (){
  10097. var self=this;
  10098. var object;
  10099. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10100. return $core.withContext(function($ctx1) {
  10101. //>>excludeEnd("ctx");
  10102. var $1,$2;
  10103. $1=self._jsObject();
  10104. $recv($1)._d_("test");
  10105. $2=$recv($1)._yourself();
  10106. object=$2;
  10107. self._assert_equals_($recv(object)._d(),"test");
  10108. return self;
  10109. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10110. }, function($ctx1) {$ctx1.fill(self,"testYourself",{object:object},$globals.JSObjectProxyTest)});
  10111. //>>excludeEnd("ctx");
  10112. },
  10113. //>>excludeStart("ide", pragmas.excludeIdeData);
  10114. args: [],
  10115. source: "testYourself\x0a\x09| object |\x0a\x09object := self jsObject\x0a\x09\x09d: 'test';\x0a\x09\x09yourself.\x0a\x0a\x09self assert: object d equals: 'test'",
  10116. referencedClasses: [],
  10117. //>>excludeEnd("ide");
  10118. messageSends: ["d:", "jsObject", "yourself", "assert:equals:", "d"]
  10119. }),
  10120. $globals.JSObjectProxyTest);
  10121. $core.addClass('JavaScriptExceptionTest', $globals.TestCase, [], 'Kernel-Tests');
  10122. $core.addMethod(
  10123. $core.method({
  10124. selector: "testCatchingException",
  10125. protocol: 'tests',
  10126. fn: function (){
  10127. var self=this;
  10128. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  10129. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10130. return $core.withContext(function($ctx1) {
  10131. //>>excludeEnd("ctx");
  10132. $recv((function(){
  10133. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10134. return $core.withContext(function($ctx2) {
  10135. //>>excludeEnd("ctx");
  10136. return self._throwException();
  10137. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10138. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  10139. //>>excludeEnd("ctx");
  10140. }))._on_do_($Error(),(function(error){
  10141. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10142. return $core.withContext(function($ctx2) {
  10143. //>>excludeEnd("ctx");
  10144. return self._assert_($recv($recv(error)._exception()).__eq("test"));
  10145. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10146. }, function($ctx2) {$ctx2.fillBlock({error:error},$ctx1,2)});
  10147. //>>excludeEnd("ctx");
  10148. }));
  10149. return self;
  10150. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10151. }, function($ctx1) {$ctx1.fill(self,"testCatchingException",{},$globals.JavaScriptExceptionTest)});
  10152. //>>excludeEnd("ctx");
  10153. },
  10154. //>>excludeStart("ide", pragmas.excludeIdeData);
  10155. args: [],
  10156. source: "testCatchingException\x0a\x09[ self throwException ]\x0a\x09\x09on: Error\x0a\x09\x09do: [ :error |\x0a\x09\x09\x09self assert: error exception = 'test' ]",
  10157. referencedClasses: ["Error"],
  10158. //>>excludeEnd("ide");
  10159. messageSends: ["on:do:", "throwException", "assert:", "=", "exception"]
  10160. }),
  10161. $globals.JavaScriptExceptionTest);
  10162. $core.addMethod(
  10163. $core.method({
  10164. selector: "testRaisingException",
  10165. protocol: 'tests',
  10166. fn: function (){
  10167. var self=this;
  10168. function $JavaScriptException(){return $globals.JavaScriptException||(typeof JavaScriptException=="undefined"?nil:JavaScriptException)}
  10169. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10170. return $core.withContext(function($ctx1) {
  10171. //>>excludeEnd("ctx");
  10172. self._should_raise_((function(){
  10173. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10174. return $core.withContext(function($ctx2) {
  10175. //>>excludeEnd("ctx");
  10176. return self._throwException();
  10177. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10178. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  10179. //>>excludeEnd("ctx");
  10180. }),$JavaScriptException());
  10181. return self;
  10182. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10183. }, function($ctx1) {$ctx1.fill(self,"testRaisingException",{},$globals.JavaScriptExceptionTest)});
  10184. //>>excludeEnd("ctx");
  10185. },
  10186. //>>excludeStart("ide", pragmas.excludeIdeData);
  10187. args: [],
  10188. source: "testRaisingException\x0a\x09self should: [ self throwException ] raise: JavaScriptException",
  10189. referencedClasses: ["JavaScriptException"],
  10190. //>>excludeEnd("ide");
  10191. messageSends: ["should:raise:", "throwException"]
  10192. }),
  10193. $globals.JavaScriptExceptionTest);
  10194. $core.addMethod(
  10195. $core.method({
  10196. selector: "throwException",
  10197. protocol: 'helpers',
  10198. fn: function (){
  10199. var self=this;
  10200. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10201. return $core.withContext(function($ctx1) {
  10202. //>>excludeEnd("ctx");
  10203. throw 'test';
  10204. return self;
  10205. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10206. }, function($ctx1) {$ctx1.fill(self,"throwException",{},$globals.JavaScriptExceptionTest)});
  10207. //>>excludeEnd("ctx");
  10208. },
  10209. //>>excludeStart("ide", pragmas.excludeIdeData);
  10210. args: [],
  10211. source: "throwException\x0a\x09<throw 'test'>",
  10212. referencedClasses: [],
  10213. //>>excludeEnd("ide");
  10214. messageSends: []
  10215. }),
  10216. $globals.JavaScriptExceptionTest);
  10217. $core.addClass('MessageSendTest', $globals.TestCase, [], 'Kernel-Tests');
  10218. $core.addMethod(
  10219. $core.method({
  10220. selector: "testValue",
  10221. protocol: 'tests',
  10222. fn: function (){
  10223. var self=this;
  10224. var messageSend;
  10225. function $MessageSend(){return $globals.MessageSend||(typeof MessageSend=="undefined"?nil:MessageSend)}
  10226. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  10227. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10228. return $core.withContext(function($ctx1) {
  10229. //>>excludeEnd("ctx");
  10230. var $1,$2;
  10231. $1=$recv($MessageSend())._new();
  10232. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10233. $ctx1.sendIdx["new"]=1;
  10234. //>>excludeEnd("ctx");
  10235. $recv($1)._receiver_($recv($Object())._new());
  10236. $recv($1)._selector_("asString");
  10237. $2=$recv($1)._yourself();
  10238. messageSend=$2;
  10239. self._assert_equals_($recv(messageSend)._value(),"an Object");
  10240. return self;
  10241. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10242. }, function($ctx1) {$ctx1.fill(self,"testValue",{messageSend:messageSend},$globals.MessageSendTest)});
  10243. //>>excludeEnd("ctx");
  10244. },
  10245. //>>excludeStart("ide", pragmas.excludeIdeData);
  10246. args: [],
  10247. 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'",
  10248. referencedClasses: ["MessageSend", "Object"],
  10249. //>>excludeEnd("ide");
  10250. messageSends: ["receiver:", "new", "selector:", "yourself", "assert:equals:", "value"]
  10251. }),
  10252. $globals.MessageSendTest);
  10253. $core.addMethod(
  10254. $core.method({
  10255. selector: "testValueWithArguments",
  10256. protocol: 'tests',
  10257. fn: function (){
  10258. var self=this;
  10259. var messageSend;
  10260. function $MessageSend(){return $globals.MessageSend||(typeof MessageSend=="undefined"?nil:MessageSend)}
  10261. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10262. return $core.withContext(function($ctx1) {
  10263. //>>excludeEnd("ctx");
  10264. var $1,$2;
  10265. $1=$recv($MessageSend())._new();
  10266. $recv($1)._receiver_((2));
  10267. $recv($1)._selector_("+");
  10268. $2=$recv($1)._yourself();
  10269. messageSend=$2;
  10270. self._assert_equals_($recv(messageSend)._value_((3)),(5));
  10271. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10272. $ctx1.sendIdx["assert:equals:"]=1;
  10273. //>>excludeEnd("ctx");
  10274. self._assert_equals_($recv(messageSend)._valueWithPossibleArguments_([(4)]),(6));
  10275. return self;
  10276. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10277. }, function($ctx1) {$ctx1.fill(self,"testValueWithArguments",{messageSend:messageSend},$globals.MessageSendTest)});
  10278. //>>excludeEnd("ctx");
  10279. },
  10280. //>>excludeStart("ide", pragmas.excludeIdeData);
  10281. args: [],
  10282. 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",
  10283. referencedClasses: ["MessageSend"],
  10284. //>>excludeEnd("ide");
  10285. messageSends: ["receiver:", "new", "selector:", "yourself", "assert:equals:", "value:", "valueWithPossibleArguments:"]
  10286. }),
  10287. $globals.MessageSendTest);
  10288. $core.addClass('MethodInheritanceTest', $globals.TestCase, ['receiverTop', 'receiverMiddle', 'receiverBottom', 'method', 'performBlock'], 'Kernel-Tests');
  10289. $core.addMethod(
  10290. $core.method({
  10291. selector: "codeGeneratorClass",
  10292. protocol: 'accessing',
  10293. fn: function (){
  10294. var self=this;
  10295. function $CodeGenerator(){return $globals.CodeGenerator||(typeof CodeGenerator=="undefined"?nil:CodeGenerator)}
  10296. return $CodeGenerator();
  10297. },
  10298. //>>excludeStart("ide", pragmas.excludeIdeData);
  10299. args: [],
  10300. source: "codeGeneratorClass\x0a\x09^ CodeGenerator",
  10301. referencedClasses: ["CodeGenerator"],
  10302. //>>excludeEnd("ide");
  10303. messageSends: []
  10304. }),
  10305. $globals.MethodInheritanceTest);
  10306. $core.addMethod(
  10307. $core.method({
  10308. selector: "compiler",
  10309. protocol: 'factory',
  10310. fn: function (){
  10311. var self=this;
  10312. function $Compiler(){return $globals.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
  10313. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10314. return $core.withContext(function($ctx1) {
  10315. //>>excludeEnd("ctx");
  10316. var $2,$3,$1;
  10317. $2=$recv($Compiler())._new();
  10318. $recv($2)._codeGeneratorClass_(self._codeGeneratorClass());
  10319. $3=$recv($2)._yourself();
  10320. $1=$3;
  10321. return $1;
  10322. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10323. }, function($ctx1) {$ctx1.fill(self,"compiler",{},$globals.MethodInheritanceTest)});
  10324. //>>excludeEnd("ctx");
  10325. },
  10326. //>>excludeStart("ide", pragmas.excludeIdeData);
  10327. args: [],
  10328. source: "compiler\x0a\x09^ Compiler new\x0a\x09\x09codeGeneratorClass: self codeGeneratorClass;\x0a\x09\x09yourself",
  10329. referencedClasses: ["Compiler"],
  10330. //>>excludeEnd("ide");
  10331. messageSends: ["codeGeneratorClass:", "new", "codeGeneratorClass", "yourself"]
  10332. }),
  10333. $globals.MethodInheritanceTest);
  10334. $core.addMethod(
  10335. $core.method({
  10336. selector: "deinstallBottom",
  10337. protocol: 'testing',
  10338. fn: function (){
  10339. var self=this;
  10340. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10341. return $core.withContext(function($ctx1) {
  10342. //>>excludeEnd("ctx");
  10343. $recv(self._targetClassBottom())._removeCompiledMethod_(self["@method"]);
  10344. return self;
  10345. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10346. }, function($ctx1) {$ctx1.fill(self,"deinstallBottom",{},$globals.MethodInheritanceTest)});
  10347. //>>excludeEnd("ctx");
  10348. },
  10349. //>>excludeStart("ide", pragmas.excludeIdeData);
  10350. args: [],
  10351. source: "deinstallBottom\x0a\x09self targetClassBottom removeCompiledMethod: method",
  10352. referencedClasses: [],
  10353. //>>excludeEnd("ide");
  10354. messageSends: ["removeCompiledMethod:", "targetClassBottom"]
  10355. }),
  10356. $globals.MethodInheritanceTest);
  10357. $core.addMethod(
  10358. $core.method({
  10359. selector: "deinstallMiddle",
  10360. protocol: 'testing',
  10361. fn: function (){
  10362. var self=this;
  10363. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10364. return $core.withContext(function($ctx1) {
  10365. //>>excludeEnd("ctx");
  10366. $recv(self._targetClassMiddle())._removeCompiledMethod_(self["@method"]);
  10367. return self;
  10368. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10369. }, function($ctx1) {$ctx1.fill(self,"deinstallMiddle",{},$globals.MethodInheritanceTest)});
  10370. //>>excludeEnd("ctx");
  10371. },
  10372. //>>excludeStart("ide", pragmas.excludeIdeData);
  10373. args: [],
  10374. source: "deinstallMiddle\x0a\x09self targetClassMiddle removeCompiledMethod: method",
  10375. referencedClasses: [],
  10376. //>>excludeEnd("ide");
  10377. messageSends: ["removeCompiledMethod:", "targetClassMiddle"]
  10378. }),
  10379. $globals.MethodInheritanceTest);
  10380. $core.addMethod(
  10381. $core.method({
  10382. selector: "deinstallTop",
  10383. protocol: 'testing',
  10384. fn: function (){
  10385. var self=this;
  10386. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10387. return $core.withContext(function($ctx1) {
  10388. //>>excludeEnd("ctx");
  10389. $recv(self._targetClassTop())._removeCompiledMethod_(self["@method"]);
  10390. return self;
  10391. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10392. }, function($ctx1) {$ctx1.fill(self,"deinstallTop",{},$globals.MethodInheritanceTest)});
  10393. //>>excludeEnd("ctx");
  10394. },
  10395. //>>excludeStart("ide", pragmas.excludeIdeData);
  10396. args: [],
  10397. source: "deinstallTop\x0a\x09self targetClassTop removeCompiledMethod: method",
  10398. referencedClasses: [],
  10399. //>>excludeEnd("ide");
  10400. messageSends: ["removeCompiledMethod:", "targetClassTop"]
  10401. }),
  10402. $globals.MethodInheritanceTest);
  10403. $core.addMethod(
  10404. $core.method({
  10405. selector: "installBottom:",
  10406. protocol: 'testing',
  10407. fn: function (aString){
  10408. var self=this;
  10409. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10410. return $core.withContext(function($ctx1) {
  10411. //>>excludeEnd("ctx");
  10412. self["@method"]=$recv(self._compiler())._install_forClass_protocol_(aString,self._targetClassBottom(),"tests");
  10413. return self;
  10414. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10415. }, function($ctx1) {$ctx1.fill(self,"installBottom:",{aString:aString},$globals.MethodInheritanceTest)});
  10416. //>>excludeEnd("ctx");
  10417. },
  10418. //>>excludeStart("ide", pragmas.excludeIdeData);
  10419. args: ["aString"],
  10420. source: "installBottom: aString\x0a\x09method := self compiler install: aString forClass: self targetClassBottom protocol: 'tests'",
  10421. referencedClasses: [],
  10422. //>>excludeEnd("ide");
  10423. messageSends: ["install:forClass:protocol:", "compiler", "targetClassBottom"]
  10424. }),
  10425. $globals.MethodInheritanceTest);
  10426. $core.addMethod(
  10427. $core.method({
  10428. selector: "installMiddle:",
  10429. protocol: 'testing',
  10430. fn: function (aString){
  10431. var self=this;
  10432. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10433. return $core.withContext(function($ctx1) {
  10434. //>>excludeEnd("ctx");
  10435. self["@method"]=$recv(self._compiler())._install_forClass_protocol_(aString,self._targetClassMiddle(),"tests");
  10436. return self;
  10437. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10438. }, function($ctx1) {$ctx1.fill(self,"installMiddle:",{aString:aString},$globals.MethodInheritanceTest)});
  10439. //>>excludeEnd("ctx");
  10440. },
  10441. //>>excludeStart("ide", pragmas.excludeIdeData);
  10442. args: ["aString"],
  10443. source: "installMiddle: aString\x0a\x09method := self compiler install: aString forClass: self targetClassMiddle protocol: 'tests'",
  10444. referencedClasses: [],
  10445. //>>excludeEnd("ide");
  10446. messageSends: ["install:forClass:protocol:", "compiler", "targetClassMiddle"]
  10447. }),
  10448. $globals.MethodInheritanceTest);
  10449. $core.addMethod(
  10450. $core.method({
  10451. selector: "installTop:",
  10452. protocol: 'testing',
  10453. fn: function (aString){
  10454. var self=this;
  10455. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10456. return $core.withContext(function($ctx1) {
  10457. //>>excludeEnd("ctx");
  10458. self["@method"]=$recv(self._compiler())._install_forClass_protocol_(aString,self._targetClassTop(),"tests");
  10459. return self;
  10460. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10461. }, function($ctx1) {$ctx1.fill(self,"installTop:",{aString:aString},$globals.MethodInheritanceTest)});
  10462. //>>excludeEnd("ctx");
  10463. },
  10464. //>>excludeStart("ide", pragmas.excludeIdeData);
  10465. args: ["aString"],
  10466. source: "installTop: aString\x0a\x09method := self compiler install: aString forClass: self targetClassTop protocol: 'tests'",
  10467. referencedClasses: [],
  10468. //>>excludeEnd("ide");
  10469. messageSends: ["install:forClass:protocol:", "compiler", "targetClassTop"]
  10470. }),
  10471. $globals.MethodInheritanceTest);
  10472. $core.addMethod(
  10473. $core.method({
  10474. selector: "setUp",
  10475. protocol: 'initialization',
  10476. fn: function (){
  10477. var self=this;
  10478. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10479. return $core.withContext(function($ctx1) {
  10480. //>>excludeEnd("ctx");
  10481. self["@receiverTop"]=$recv(self._targetClassTop())._new();
  10482. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10483. $ctx1.sendIdx["new"]=1;
  10484. //>>excludeEnd("ctx");
  10485. self["@receiverMiddle"]=$recv(self._targetClassMiddle())._new();
  10486. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10487. $ctx1.sendIdx["new"]=2;
  10488. //>>excludeEnd("ctx");
  10489. self["@receiverBottom"]=$recv(self._targetClassBottom())._new();
  10490. self["@method"]=nil;
  10491. self["@performBlock"]=(function(){
  10492. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10493. return $core.withContext(function($ctx2) {
  10494. //>>excludeEnd("ctx");
  10495. return self._error_("performBlock not initialized");
  10496. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10497. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  10498. //>>excludeEnd("ctx");
  10499. });
  10500. return self;
  10501. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10502. }, function($ctx1) {$ctx1.fill(self,"setUp",{},$globals.MethodInheritanceTest)});
  10503. //>>excludeEnd("ctx");
  10504. },
  10505. //>>excludeStart("ide", pragmas.excludeIdeData);
  10506. args: [],
  10507. 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' ]",
  10508. referencedClasses: [],
  10509. //>>excludeEnd("ide");
  10510. messageSends: ["new", "targetClassTop", "targetClassMiddle", "targetClassBottom", "error:"]
  10511. }),
  10512. $globals.MethodInheritanceTest);
  10513. $core.addMethod(
  10514. $core.method({
  10515. selector: "shouldMNU",
  10516. protocol: 'testing',
  10517. fn: function (){
  10518. var self=this;
  10519. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10520. return $core.withContext(function($ctx1) {
  10521. //>>excludeEnd("ctx");
  10522. self._shouldMNUTop();
  10523. self._shouldMNUMiddle();
  10524. self._shouldMNUBottom();
  10525. return self;
  10526. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10527. }, function($ctx1) {$ctx1.fill(self,"shouldMNU",{},$globals.MethodInheritanceTest)});
  10528. //>>excludeEnd("ctx");
  10529. },
  10530. //>>excludeStart("ide", pragmas.excludeIdeData);
  10531. args: [],
  10532. source: "shouldMNU\x0a\x09self shouldMNUTop.\x0a\x09self shouldMNUMiddle.\x0a\x09self shouldMNUBottom",
  10533. referencedClasses: [],
  10534. //>>excludeEnd("ide");
  10535. messageSends: ["shouldMNUTop", "shouldMNUMiddle", "shouldMNUBottom"]
  10536. }),
  10537. $globals.MethodInheritanceTest);
  10538. $core.addMethod(
  10539. $core.method({
  10540. selector: "shouldMNUBottom",
  10541. protocol: 'testing',
  10542. fn: function (){
  10543. var self=this;
  10544. function $MessageNotUnderstood(){return $globals.MessageNotUnderstood||(typeof MessageNotUnderstood=="undefined"?nil:MessageNotUnderstood)}
  10545. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10546. return $core.withContext(function($ctx1) {
  10547. //>>excludeEnd("ctx");
  10548. self._should_raise_((function(){
  10549. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10550. return $core.withContext(function($ctx2) {
  10551. //>>excludeEnd("ctx");
  10552. return $recv(self["@performBlock"])._value_(self["@receiverBottom"]);
  10553. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10554. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  10555. //>>excludeEnd("ctx");
  10556. }),$MessageNotUnderstood());
  10557. return self;
  10558. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10559. }, function($ctx1) {$ctx1.fill(self,"shouldMNUBottom",{},$globals.MethodInheritanceTest)});
  10560. //>>excludeEnd("ctx");
  10561. },
  10562. //>>excludeStart("ide", pragmas.excludeIdeData);
  10563. args: [],
  10564. source: "shouldMNUBottom\x0a\x09self should: [ performBlock value: receiverBottom ] raise: MessageNotUnderstood",
  10565. referencedClasses: ["MessageNotUnderstood"],
  10566. //>>excludeEnd("ide");
  10567. messageSends: ["should:raise:", "value:"]
  10568. }),
  10569. $globals.MethodInheritanceTest);
  10570. $core.addMethod(
  10571. $core.method({
  10572. selector: "shouldMNUMiddle",
  10573. protocol: 'testing',
  10574. fn: function (){
  10575. var self=this;
  10576. function $MessageNotUnderstood(){return $globals.MessageNotUnderstood||(typeof MessageNotUnderstood=="undefined"?nil:MessageNotUnderstood)}
  10577. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10578. return $core.withContext(function($ctx1) {
  10579. //>>excludeEnd("ctx");
  10580. self._should_raise_((function(){
  10581. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10582. return $core.withContext(function($ctx2) {
  10583. //>>excludeEnd("ctx");
  10584. return $recv(self["@performBlock"])._value_(self["@receiverMiddle"]);
  10585. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10586. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  10587. //>>excludeEnd("ctx");
  10588. }),$MessageNotUnderstood());
  10589. return self;
  10590. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10591. }, function($ctx1) {$ctx1.fill(self,"shouldMNUMiddle",{},$globals.MethodInheritanceTest)});
  10592. //>>excludeEnd("ctx");
  10593. },
  10594. //>>excludeStart("ide", pragmas.excludeIdeData);
  10595. args: [],
  10596. source: "shouldMNUMiddle\x0a\x09self should: [ performBlock value: receiverMiddle ] raise: MessageNotUnderstood",
  10597. referencedClasses: ["MessageNotUnderstood"],
  10598. //>>excludeEnd("ide");
  10599. messageSends: ["should:raise:", "value:"]
  10600. }),
  10601. $globals.MethodInheritanceTest);
  10602. $core.addMethod(
  10603. $core.method({
  10604. selector: "shouldMNUTop",
  10605. protocol: 'testing',
  10606. fn: function (){
  10607. var self=this;
  10608. function $MessageNotUnderstood(){return $globals.MessageNotUnderstood||(typeof MessageNotUnderstood=="undefined"?nil:MessageNotUnderstood)}
  10609. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10610. return $core.withContext(function($ctx1) {
  10611. //>>excludeEnd("ctx");
  10612. self._should_raise_((function(){
  10613. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10614. return $core.withContext(function($ctx2) {
  10615. //>>excludeEnd("ctx");
  10616. return $recv(self["@performBlock"])._value_(self["@receiverTop"]);
  10617. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10618. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  10619. //>>excludeEnd("ctx");
  10620. }),$MessageNotUnderstood());
  10621. return self;
  10622. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10623. }, function($ctx1) {$ctx1.fill(self,"shouldMNUTop",{},$globals.MethodInheritanceTest)});
  10624. //>>excludeEnd("ctx");
  10625. },
  10626. //>>excludeStart("ide", pragmas.excludeIdeData);
  10627. args: [],
  10628. source: "shouldMNUTop\x0a\x09self should: [ performBlock value: receiverTop ] raise: MessageNotUnderstood",
  10629. referencedClasses: ["MessageNotUnderstood"],
  10630. //>>excludeEnd("ide");
  10631. messageSends: ["should:raise:", "value:"]
  10632. }),
  10633. $globals.MethodInheritanceTest);
  10634. $core.addMethod(
  10635. $core.method({
  10636. selector: "shouldReturn:",
  10637. protocol: 'testing',
  10638. fn: function (anObject){
  10639. var self=this;
  10640. var result;
  10641. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10642. return $core.withContext(function($ctx1) {
  10643. //>>excludeEnd("ctx");
  10644. result=$recv(self["@performBlock"])._value_(self["@receiverTop"]);
  10645. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10646. $ctx1.sendIdx["value:"]=1;
  10647. //>>excludeEnd("ctx");
  10648. self._assert_equals_(["top",anObject],["top",result]);
  10649. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10650. $ctx1.sendIdx["assert:equals:"]=1;
  10651. //>>excludeEnd("ctx");
  10652. result=$recv(self["@performBlock"])._value_(self["@receiverMiddle"]);
  10653. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10654. $ctx1.sendIdx["value:"]=2;
  10655. //>>excludeEnd("ctx");
  10656. self._assert_equals_(["middle",anObject],["middle",result]);
  10657. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10658. $ctx1.sendIdx["assert:equals:"]=2;
  10659. //>>excludeEnd("ctx");
  10660. result=$recv(self["@performBlock"])._value_(self["@receiverBottom"]);
  10661. self._assert_equals_(["bottom",anObject],["bottom",result]);
  10662. return self;
  10663. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10664. }, function($ctx1) {$ctx1.fill(self,"shouldReturn:",{anObject:anObject,result:result},$globals.MethodInheritanceTest)});
  10665. //>>excludeEnd("ctx");
  10666. },
  10667. //>>excludeStart("ide", pragmas.excludeIdeData);
  10668. args: ["anObject"],
  10669. 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 }",
  10670. referencedClasses: [],
  10671. //>>excludeEnd("ide");
  10672. messageSends: ["value:", "assert:equals:"]
  10673. }),
  10674. $globals.MethodInheritanceTest);
  10675. $core.addMethod(
  10676. $core.method({
  10677. selector: "shouldReturn:and:and:",
  10678. protocol: 'testing',
  10679. fn: function (anObject,anObject2,anObject3){
  10680. var self=this;
  10681. var result;
  10682. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10683. return $core.withContext(function($ctx1) {
  10684. //>>excludeEnd("ctx");
  10685. result=$recv(self["@performBlock"])._value_(self["@receiverTop"]);
  10686. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10687. $ctx1.sendIdx["value:"]=1;
  10688. //>>excludeEnd("ctx");
  10689. self._assert_equals_(["top",anObject],["top",result]);
  10690. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10691. $ctx1.sendIdx["assert:equals:"]=1;
  10692. //>>excludeEnd("ctx");
  10693. result=$recv(self["@performBlock"])._value_(self["@receiverMiddle"]);
  10694. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10695. $ctx1.sendIdx["value:"]=2;
  10696. //>>excludeEnd("ctx");
  10697. self._assert_equals_(["middle",anObject2],["middle",result]);
  10698. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10699. $ctx1.sendIdx["assert:equals:"]=2;
  10700. //>>excludeEnd("ctx");
  10701. result=$recv(self["@performBlock"])._value_(self["@receiverBottom"]);
  10702. self._assert_equals_(["bottom",anObject3],["bottom",result]);
  10703. return self;
  10704. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10705. }, function($ctx1) {$ctx1.fill(self,"shouldReturn:and:and:",{anObject:anObject,anObject2:anObject2,anObject3:anObject3,result:result},$globals.MethodInheritanceTest)});
  10706. //>>excludeEnd("ctx");
  10707. },
  10708. //>>excludeStart("ide", pragmas.excludeIdeData);
  10709. args: ["anObject", "anObject2", "anObject3"],
  10710. 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 }",
  10711. referencedClasses: [],
  10712. //>>excludeEnd("ide");
  10713. messageSends: ["value:", "assert:equals:"]
  10714. }),
  10715. $globals.MethodInheritanceTest);
  10716. $core.addMethod(
  10717. $core.method({
  10718. selector: "targetClassBottom",
  10719. protocol: 'accessing',
  10720. fn: function (){
  10721. var self=this;
  10722. function $JavaScriptException(){return $globals.JavaScriptException||(typeof JavaScriptException=="undefined"?nil:JavaScriptException)}
  10723. return $JavaScriptException();
  10724. },
  10725. //>>excludeStart("ide", pragmas.excludeIdeData);
  10726. args: [],
  10727. source: "targetClassBottom\x0a\x09^ JavaScriptException",
  10728. referencedClasses: ["JavaScriptException"],
  10729. //>>excludeEnd("ide");
  10730. messageSends: []
  10731. }),
  10732. $globals.MethodInheritanceTest);
  10733. $core.addMethod(
  10734. $core.method({
  10735. selector: "targetClassMiddle",
  10736. protocol: 'accessing',
  10737. fn: function (){
  10738. var self=this;
  10739. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  10740. return $Error();
  10741. },
  10742. //>>excludeStart("ide", pragmas.excludeIdeData);
  10743. args: [],
  10744. source: "targetClassMiddle\x0a\x09^ Error",
  10745. referencedClasses: ["Error"],
  10746. //>>excludeEnd("ide");
  10747. messageSends: []
  10748. }),
  10749. $globals.MethodInheritanceTest);
  10750. $core.addMethod(
  10751. $core.method({
  10752. selector: "targetClassTop",
  10753. protocol: 'accessing',
  10754. fn: function (){
  10755. var self=this;
  10756. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  10757. return $Object();
  10758. },
  10759. //>>excludeStart("ide", pragmas.excludeIdeData);
  10760. args: [],
  10761. source: "targetClassTop\x0a\x09^ Object",
  10762. referencedClasses: ["Object"],
  10763. //>>excludeEnd("ide");
  10764. messageSends: []
  10765. }),
  10766. $globals.MethodInheritanceTest);
  10767. $core.addMethod(
  10768. $core.method({
  10769. selector: "tearDown",
  10770. protocol: 'initialization',
  10771. fn: function (){
  10772. var self=this;
  10773. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  10774. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10775. return $core.withContext(function($ctx1) {
  10776. //>>excludeEnd("ctx");
  10777. $recv((function(){
  10778. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10779. return $core.withContext(function($ctx2) {
  10780. //>>excludeEnd("ctx");
  10781. return self._deinstallTop();
  10782. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10783. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  10784. //>>excludeEnd("ctx");
  10785. }))._on_do_($Error(),(function(){
  10786. }));
  10787. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10788. $ctx1.sendIdx["on:do:"]=1;
  10789. //>>excludeEnd("ctx");
  10790. $recv((function(){
  10791. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10792. return $core.withContext(function($ctx2) {
  10793. //>>excludeEnd("ctx");
  10794. return self._deinstallMiddle();
  10795. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10796. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  10797. //>>excludeEnd("ctx");
  10798. }))._on_do_($Error(),(function(){
  10799. }));
  10800. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10801. $ctx1.sendIdx["on:do:"]=2;
  10802. //>>excludeEnd("ctx");
  10803. $recv((function(){
  10804. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10805. return $core.withContext(function($ctx2) {
  10806. //>>excludeEnd("ctx");
  10807. return self._deinstallBottom();
  10808. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10809. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,5)});
  10810. //>>excludeEnd("ctx");
  10811. }))._on_do_($Error(),(function(){
  10812. }));
  10813. return self;
  10814. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10815. }, function($ctx1) {$ctx1.fill(self,"tearDown",{},$globals.MethodInheritanceTest)});
  10816. //>>excludeEnd("ctx");
  10817. },
  10818. //>>excludeStart("ide", pragmas.excludeIdeData);
  10819. args: [],
  10820. source: "tearDown\x0a\x09[ self deinstallTop ] on: Error do: [ ].\x0a\x09[ self deinstallMiddle ] on: Error do: [ ].\x0a\x09[ self deinstallBottom ] on: Error do: [ ]",
  10821. referencedClasses: ["Error"],
  10822. //>>excludeEnd("ide");
  10823. messageSends: ["on:do:", "deinstallTop", "deinstallMiddle", "deinstallBottom"]
  10824. }),
  10825. $globals.MethodInheritanceTest);
  10826. $core.addMethod(
  10827. $core.method({
  10828. selector: "testMNU11",
  10829. protocol: 'tests',
  10830. fn: function (){
  10831. var self=this;
  10832. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10833. return $core.withContext(function($ctx1) {
  10834. //>>excludeEnd("ctx");
  10835. self["@performBlock"]=(function(x){
  10836. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10837. return $core.withContext(function($ctx2) {
  10838. //>>excludeEnd("ctx");
  10839. return $recv(x)._foo();
  10840. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10841. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)});
  10842. //>>excludeEnd("ctx");
  10843. });
  10844. self._shouldMNU();
  10845. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10846. $ctx1.sendIdx["shouldMNU"]=1;
  10847. //>>excludeEnd("ctx");
  10848. self._installTop_("foo ^ false");
  10849. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10850. $ctx1.sendIdx["installTop:"]=1;
  10851. //>>excludeEnd("ctx");
  10852. self._installTop_("foo ^ true");
  10853. self._deinstallTop();
  10854. self._shouldMNU();
  10855. return self;
  10856. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10857. }, function($ctx1) {$ctx1.fill(self,"testMNU11",{},$globals.MethodInheritanceTest)});
  10858. //>>excludeEnd("ctx");
  10859. },
  10860. //>>excludeStart("ide", pragmas.excludeIdeData);
  10861. args: [],
  10862. 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",
  10863. referencedClasses: [],
  10864. //>>excludeEnd("ide");
  10865. messageSends: ["foo", "shouldMNU", "installTop:", "deinstallTop"]
  10866. }),
  10867. $globals.MethodInheritanceTest);
  10868. $core.addMethod(
  10869. $core.method({
  10870. selector: "testMNU22",
  10871. protocol: 'tests',
  10872. fn: function (){
  10873. var self=this;
  10874. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10875. return $core.withContext(function($ctx1) {
  10876. //>>excludeEnd("ctx");
  10877. self["@performBlock"]=(function(x){
  10878. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10879. return $core.withContext(function($ctx2) {
  10880. //>>excludeEnd("ctx");
  10881. return $recv(x)._foo();
  10882. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10883. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)});
  10884. //>>excludeEnd("ctx");
  10885. });
  10886. self._shouldMNU();
  10887. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10888. $ctx1.sendIdx["shouldMNU"]=1;
  10889. //>>excludeEnd("ctx");
  10890. self._installMiddle_("foo ^ false");
  10891. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10892. $ctx1.sendIdx["installMiddle:"]=1;
  10893. //>>excludeEnd("ctx");
  10894. self._installMiddle_("foo ^ true");
  10895. self._deinstallMiddle();
  10896. self._shouldMNU();
  10897. return self;
  10898. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10899. }, function($ctx1) {$ctx1.fill(self,"testMNU22",{},$globals.MethodInheritanceTest)});
  10900. //>>excludeEnd("ctx");
  10901. },
  10902. //>>excludeStart("ide", pragmas.excludeIdeData);
  10903. args: [],
  10904. 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",
  10905. referencedClasses: [],
  10906. //>>excludeEnd("ide");
  10907. messageSends: ["foo", "shouldMNU", "installMiddle:", "deinstallMiddle"]
  10908. }),
  10909. $globals.MethodInheritanceTest);
  10910. $core.addMethod(
  10911. $core.method({
  10912. selector: "testReturns1",
  10913. protocol: 'tests',
  10914. fn: function (){
  10915. var self=this;
  10916. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10917. return $core.withContext(function($ctx1) {
  10918. //>>excludeEnd("ctx");
  10919. self["@performBlock"]=(function(x){
  10920. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10921. return $core.withContext(function($ctx2) {
  10922. //>>excludeEnd("ctx");
  10923. return $recv(x)._foo();
  10924. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10925. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)});
  10926. //>>excludeEnd("ctx");
  10927. });
  10928. self._installTop_("foo ^ false");
  10929. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10930. $ctx1.sendIdx["installTop:"]=1;
  10931. //>>excludeEnd("ctx");
  10932. self._shouldReturn_(false);
  10933. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10934. $ctx1.sendIdx["shouldReturn:"]=1;
  10935. //>>excludeEnd("ctx");
  10936. self._installTop_("foo ^ true");
  10937. self._shouldReturn_(true);
  10938. return self;
  10939. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10940. }, function($ctx1) {$ctx1.fill(self,"testReturns1",{},$globals.MethodInheritanceTest)});
  10941. //>>excludeEnd("ctx");
  10942. },
  10943. //>>excludeStart("ide", pragmas.excludeIdeData);
  10944. args: [],
  10945. 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",
  10946. referencedClasses: [],
  10947. //>>excludeEnd("ide");
  10948. messageSends: ["foo", "installTop:", "shouldReturn:"]
  10949. }),
  10950. $globals.MethodInheritanceTest);
  10951. $core.addClass('NumberTest', $globals.TestCase, [], 'Kernel-Tests');
  10952. $core.addMethod(
  10953. $core.method({
  10954. selector: "testAbs",
  10955. protocol: 'tests',
  10956. fn: function (){
  10957. var self=this;
  10958. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10959. return $core.withContext(function($ctx1) {
  10960. //>>excludeEnd("ctx");
  10961. var $1;
  10962. $1=(4)._abs();
  10963. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10964. $ctx1.sendIdx["abs"]=1;
  10965. //>>excludeEnd("ctx");
  10966. self._assert_equals_($1,(4));
  10967. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10968. $ctx1.sendIdx["assert:equals:"]=1;
  10969. //>>excludeEnd("ctx");
  10970. self._assert_equals_((-4)._abs(),(4));
  10971. return self;
  10972. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10973. }, function($ctx1) {$ctx1.fill(self,"testAbs",{},$globals.NumberTest)});
  10974. //>>excludeEnd("ctx");
  10975. },
  10976. //>>excludeStart("ide", pragmas.excludeIdeData);
  10977. args: [],
  10978. source: "testAbs\x0a\x09self assert: 4 abs equals: 4.\x0a\x09self assert: -4 abs equals: 4",
  10979. referencedClasses: [],
  10980. //>>excludeEnd("ide");
  10981. messageSends: ["assert:equals:", "abs"]
  10982. }),
  10983. $globals.NumberTest);
  10984. $core.addMethod(
  10985. $core.method({
  10986. selector: "testArithmetic",
  10987. protocol: 'tests',
  10988. fn: function (){
  10989. var self=this;
  10990. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10991. return $core.withContext(function($ctx1) {
  10992. //>>excludeEnd("ctx");
  10993. var $1,$2,$3,$5,$4;
  10994. $1=(1.5).__plus((1));
  10995. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10996. $ctx1.sendIdx["+"]=1;
  10997. //>>excludeEnd("ctx");
  10998. self._assert_equals_($1,(2.5));
  10999. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11000. $ctx1.sendIdx["assert:equals:"]=1;
  11001. //>>excludeEnd("ctx");
  11002. $2=(2).__minus((1));
  11003. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11004. $ctx1.sendIdx["-"]=1;
  11005. //>>excludeEnd("ctx");
  11006. self._assert_equals_($2,(1));
  11007. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11008. $ctx1.sendIdx["assert:equals:"]=2;
  11009. //>>excludeEnd("ctx");
  11010. self._assert_equals_((-2).__minus((1)),(-3));
  11011. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11012. $ctx1.sendIdx["assert:equals:"]=3;
  11013. //>>excludeEnd("ctx");
  11014. self._assert_equals_((12).__slash((2)),(6));
  11015. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11016. $ctx1.sendIdx["assert:equals:"]=4;
  11017. //>>excludeEnd("ctx");
  11018. $3=(3).__star((4));
  11019. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11020. $ctx1.sendIdx["*"]=1;
  11021. //>>excludeEnd("ctx");
  11022. self._assert_equals_($3,(12));
  11023. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11024. $ctx1.sendIdx["assert:equals:"]=5;
  11025. //>>excludeEnd("ctx");
  11026. self._assert_equals_((7).__slash_slash((2)),(3));
  11027. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11028. $ctx1.sendIdx["assert:equals:"]=6;
  11029. //>>excludeEnd("ctx");
  11030. self._assert_equals_((7).__backslash_backslash((2)),(1));
  11031. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11032. $ctx1.sendIdx["assert:equals:"]=7;
  11033. //>>excludeEnd("ctx");
  11034. $5=(1).__plus((2));
  11035. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11036. $ctx1.sendIdx["+"]=2;
  11037. //>>excludeEnd("ctx");
  11038. $4=$recv($5).__star((3));
  11039. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11040. $ctx1.sendIdx["*"]=2;
  11041. //>>excludeEnd("ctx");
  11042. self._assert_equals_($4,(9));
  11043. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11044. $ctx1.sendIdx["assert:equals:"]=8;
  11045. //>>excludeEnd("ctx");
  11046. self._assert_equals_((1).__plus((2).__star((3))),(7));
  11047. return self;
  11048. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11049. }, function($ctx1) {$ctx1.fill(self,"testArithmetic",{},$globals.NumberTest)});
  11050. //>>excludeEnd("ctx");
  11051. },
  11052. //>>excludeStart("ide", pragmas.excludeIdeData);
  11053. args: [],
  11054. 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",
  11055. referencedClasses: [],
  11056. //>>excludeEnd("ide");
  11057. messageSends: ["assert:equals:", "+", "-", "/", "*", "//", "\x5c\x5c"]
  11058. }),
  11059. $globals.NumberTest);
  11060. $core.addMethod(
  11061. $core.method({
  11062. selector: "testAsNumber",
  11063. protocol: 'tests',
  11064. fn: function (){
  11065. var self=this;
  11066. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11067. return $core.withContext(function($ctx1) {
  11068. //>>excludeEnd("ctx");
  11069. self._assert_equals_((3)._asNumber(),(3));
  11070. return self;
  11071. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11072. }, function($ctx1) {$ctx1.fill(self,"testAsNumber",{},$globals.NumberTest)});
  11073. //>>excludeEnd("ctx");
  11074. },
  11075. //>>excludeStart("ide", pragmas.excludeIdeData);
  11076. args: [],
  11077. source: "testAsNumber\x0a\x09self assert: 3 asNumber equals: 3.",
  11078. referencedClasses: [],
  11079. //>>excludeEnd("ide");
  11080. messageSends: ["assert:equals:", "asNumber"]
  11081. }),
  11082. $globals.NumberTest);
  11083. $core.addMethod(
  11084. $core.method({
  11085. selector: "testCeiling",
  11086. protocol: 'tests',
  11087. fn: function (){
  11088. var self=this;
  11089. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11090. return $core.withContext(function($ctx1) {
  11091. //>>excludeEnd("ctx");
  11092. var $1,$2;
  11093. $1=(1.2)._ceiling();
  11094. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11095. $ctx1.sendIdx["ceiling"]=1;
  11096. //>>excludeEnd("ctx");
  11097. self._assert_equals_($1,(2));
  11098. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11099. $ctx1.sendIdx["assert:equals:"]=1;
  11100. //>>excludeEnd("ctx");
  11101. $2=(-1.2)._ceiling();
  11102. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11103. $ctx1.sendIdx["ceiling"]=2;
  11104. //>>excludeEnd("ctx");
  11105. self._assert_equals_($2,(-1));
  11106. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11107. $ctx1.sendIdx["assert:equals:"]=2;
  11108. //>>excludeEnd("ctx");
  11109. self._assert_equals_((1)._ceiling(),(1));
  11110. return self;
  11111. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11112. }, function($ctx1) {$ctx1.fill(self,"testCeiling",{},$globals.NumberTest)});
  11113. //>>excludeEnd("ctx");
  11114. },
  11115. //>>excludeStart("ide", pragmas.excludeIdeData);
  11116. args: [],
  11117. 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.",
  11118. referencedClasses: [],
  11119. //>>excludeEnd("ide");
  11120. messageSends: ["assert:equals:", "ceiling"]
  11121. }),
  11122. $globals.NumberTest);
  11123. $core.addMethod(
  11124. $core.method({
  11125. selector: "testComparison",
  11126. protocol: 'tests',
  11127. fn: function (){
  11128. var self=this;
  11129. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11130. return $core.withContext(function($ctx1) {
  11131. //>>excludeEnd("ctx");
  11132. var $1,$2,$3,$4;
  11133. $1=(3).__gt((2));
  11134. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11135. $ctx1.sendIdx[">"]=1;
  11136. //>>excludeEnd("ctx");
  11137. self._assert_($1);
  11138. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11139. $ctx1.sendIdx["assert:"]=1;
  11140. //>>excludeEnd("ctx");
  11141. $2=(2).__lt((3));
  11142. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11143. $ctx1.sendIdx["<"]=1;
  11144. //>>excludeEnd("ctx");
  11145. self._assert_($2);
  11146. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11147. $ctx1.sendIdx["assert:"]=2;
  11148. //>>excludeEnd("ctx");
  11149. self._deny_((3).__lt((2)));
  11150. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11151. $ctx1.sendIdx["deny:"]=1;
  11152. //>>excludeEnd("ctx");
  11153. self._deny_((2).__gt((3)));
  11154. $3=(3).__gt_eq((3));
  11155. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11156. $ctx1.sendIdx[">="]=1;
  11157. //>>excludeEnd("ctx");
  11158. self._assert_($3);
  11159. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11160. $ctx1.sendIdx["assert:"]=3;
  11161. //>>excludeEnd("ctx");
  11162. self._assert_((3.1).__gt_eq((3)));
  11163. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11164. $ctx1.sendIdx["assert:"]=4;
  11165. //>>excludeEnd("ctx");
  11166. $4=(3).__lt_eq((3));
  11167. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11168. $ctx1.sendIdx["<="]=1;
  11169. //>>excludeEnd("ctx");
  11170. self._assert_($4);
  11171. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11172. $ctx1.sendIdx["assert:"]=5;
  11173. //>>excludeEnd("ctx");
  11174. self._assert_((3).__lt_eq((3.1)));
  11175. return self;
  11176. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11177. }, function($ctx1) {$ctx1.fill(self,"testComparison",{},$globals.NumberTest)});
  11178. //>>excludeEnd("ctx");
  11179. },
  11180. //>>excludeStart("ide", pragmas.excludeIdeData);
  11181. args: [],
  11182. 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",
  11183. referencedClasses: [],
  11184. //>>excludeEnd("ide");
  11185. messageSends: ["assert:", ">", "<", "deny:", ">=", "<="]
  11186. }),
  11187. $globals.NumberTest);
  11188. $core.addMethod(
  11189. $core.method({
  11190. selector: "testCopying",
  11191. protocol: 'tests',
  11192. fn: function (){
  11193. var self=this;
  11194. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11195. return $core.withContext(function($ctx1) {
  11196. //>>excludeEnd("ctx");
  11197. var $1;
  11198. $1=$recv((1)._copy()).__eq_eq((1));
  11199. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11200. $ctx1.sendIdx["=="]=1;
  11201. //>>excludeEnd("ctx");
  11202. self._assert_($1);
  11203. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11204. $ctx1.sendIdx["assert:"]=1;
  11205. //>>excludeEnd("ctx");
  11206. self._assert_($recv((1)._deepCopy()).__eq_eq((1)));
  11207. return self;
  11208. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11209. }, function($ctx1) {$ctx1.fill(self,"testCopying",{},$globals.NumberTest)});
  11210. //>>excludeEnd("ctx");
  11211. },
  11212. //>>excludeStart("ide", pragmas.excludeIdeData);
  11213. args: [],
  11214. source: "testCopying\x0a\x09self assert: 1 copy == 1.\x0a\x09self assert: 1 deepCopy == 1",
  11215. referencedClasses: [],
  11216. //>>excludeEnd("ide");
  11217. messageSends: ["assert:", "==", "copy", "deepCopy"]
  11218. }),
  11219. $globals.NumberTest);
  11220. $core.addMethod(
  11221. $core.method({
  11222. selector: "testEquality",
  11223. protocol: 'tests',
  11224. fn: function (){
  11225. var self=this;
  11226. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11227. return $core.withContext(function($ctx1) {
  11228. //>>excludeEnd("ctx");
  11229. var $1,$2,$3,$5,$4,$7,$6,$9,$8,$10,$11,$12;
  11230. $1=(1).__eq((1));
  11231. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11232. $ctx1.sendIdx["="]=1;
  11233. //>>excludeEnd("ctx");
  11234. self._assert_($1);
  11235. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11236. $ctx1.sendIdx["assert:"]=1;
  11237. //>>excludeEnd("ctx");
  11238. $2=(0).__eq((0));
  11239. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11240. $ctx1.sendIdx["="]=2;
  11241. //>>excludeEnd("ctx");
  11242. self._assert_($2);
  11243. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11244. $ctx1.sendIdx["assert:"]=2;
  11245. //>>excludeEnd("ctx");
  11246. $3=(1).__eq((0));
  11247. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11248. $ctx1.sendIdx["="]=3;
  11249. //>>excludeEnd("ctx");
  11250. self._deny_($3);
  11251. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11252. $ctx1.sendIdx["deny:"]=1;
  11253. //>>excludeEnd("ctx");
  11254. $5=(1)._yourself();
  11255. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11256. $ctx1.sendIdx["yourself"]=1;
  11257. //>>excludeEnd("ctx");
  11258. $4=$recv($5).__eq((1));
  11259. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11260. $ctx1.sendIdx["="]=4;
  11261. //>>excludeEnd("ctx");
  11262. self._assert_($4);
  11263. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11264. $ctx1.sendIdx["assert:"]=3;
  11265. //>>excludeEnd("ctx");
  11266. $7=(1)._yourself();
  11267. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11268. $ctx1.sendIdx["yourself"]=2;
  11269. //>>excludeEnd("ctx");
  11270. $6=(1).__eq($7);
  11271. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11272. $ctx1.sendIdx["="]=5;
  11273. //>>excludeEnd("ctx");
  11274. self._assert_($6);
  11275. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11276. $ctx1.sendIdx["assert:"]=4;
  11277. //>>excludeEnd("ctx");
  11278. $9=(1)._yourself();
  11279. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11280. $ctx1.sendIdx["yourself"]=3;
  11281. //>>excludeEnd("ctx");
  11282. $8=$recv($9).__eq((1)._yourself());
  11283. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11284. $ctx1.sendIdx["="]=6;
  11285. //>>excludeEnd("ctx");
  11286. self._assert_($8);
  11287. $10=(0).__eq(false);
  11288. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11289. $ctx1.sendIdx["="]=7;
  11290. //>>excludeEnd("ctx");
  11291. self._deny_($10);
  11292. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11293. $ctx1.sendIdx["deny:"]=2;
  11294. //>>excludeEnd("ctx");
  11295. $11=false.__eq((0));
  11296. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11297. $ctx1.sendIdx["="]=8;
  11298. //>>excludeEnd("ctx");
  11299. self._deny_($11);
  11300. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11301. $ctx1.sendIdx["deny:"]=3;
  11302. //>>excludeEnd("ctx");
  11303. $12="".__eq((0));
  11304. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11305. $ctx1.sendIdx["="]=9;
  11306. //>>excludeEnd("ctx");
  11307. self._deny_($12);
  11308. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11309. $ctx1.sendIdx["deny:"]=4;
  11310. //>>excludeEnd("ctx");
  11311. self._deny_((0).__eq(""));
  11312. return self;
  11313. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11314. }, function($ctx1) {$ctx1.fill(self,"testEquality",{},$globals.NumberTest)});
  11315. //>>excludeEnd("ctx");
  11316. },
  11317. //>>excludeStart("ide", pragmas.excludeIdeData);
  11318. args: [],
  11319. 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 = ''",
  11320. referencedClasses: [],
  11321. //>>excludeEnd("ide");
  11322. messageSends: ["assert:", "=", "deny:", "yourself"]
  11323. }),
  11324. $globals.NumberTest);
  11325. $core.addMethod(
  11326. $core.method({
  11327. selector: "testFloor",
  11328. protocol: 'tests',
  11329. fn: function (){
  11330. var self=this;
  11331. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11332. return $core.withContext(function($ctx1) {
  11333. //>>excludeEnd("ctx");
  11334. var $1,$2;
  11335. $1=(1.2)._floor();
  11336. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11337. $ctx1.sendIdx["floor"]=1;
  11338. //>>excludeEnd("ctx");
  11339. self._assert_equals_($1,(1));
  11340. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11341. $ctx1.sendIdx["assert:equals:"]=1;
  11342. //>>excludeEnd("ctx");
  11343. $2=(-1.2)._floor();
  11344. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11345. $ctx1.sendIdx["floor"]=2;
  11346. //>>excludeEnd("ctx");
  11347. self._assert_equals_($2,(-2));
  11348. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11349. $ctx1.sendIdx["assert:equals:"]=2;
  11350. //>>excludeEnd("ctx");
  11351. self._assert_equals_((1)._floor(),(1));
  11352. return self;
  11353. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11354. }, function($ctx1) {$ctx1.fill(self,"testFloor",{},$globals.NumberTest)});
  11355. //>>excludeEnd("ctx");
  11356. },
  11357. //>>excludeStart("ide", pragmas.excludeIdeData);
  11358. args: [],
  11359. 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.",
  11360. referencedClasses: [],
  11361. //>>excludeEnd("ide");
  11362. messageSends: ["assert:equals:", "floor"]
  11363. }),
  11364. $globals.NumberTest);
  11365. $core.addMethod(
  11366. $core.method({
  11367. selector: "testHexNumbers",
  11368. protocol: 'tests',
  11369. fn: function (){
  11370. var self=this;
  11371. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11372. return $core.withContext(function($ctx1) {
  11373. //>>excludeEnd("ctx");
  11374. var $1,$2,$3,$4,$5;
  11375. self._assert_equals_((9),(9));
  11376. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11377. $ctx1.sendIdx["assert:equals:"]=1;
  11378. //>>excludeEnd("ctx");
  11379. $1=(10)._truncated();
  11380. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11381. $ctx1.sendIdx["truncated"]=1;
  11382. //>>excludeEnd("ctx");
  11383. self._assert_equals_($1,(10));
  11384. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11385. $ctx1.sendIdx["assert:equals:"]=2;
  11386. //>>excludeEnd("ctx");
  11387. $2=(11)._truncated();
  11388. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11389. $ctx1.sendIdx["truncated"]=2;
  11390. //>>excludeEnd("ctx");
  11391. self._assert_equals_($2,(11));
  11392. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11393. $ctx1.sendIdx["assert:equals:"]=3;
  11394. //>>excludeEnd("ctx");
  11395. $3=(12)._truncated();
  11396. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11397. $ctx1.sendIdx["truncated"]=3;
  11398. //>>excludeEnd("ctx");
  11399. self._assert_equals_($3,(12));
  11400. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11401. $ctx1.sendIdx["assert:equals:"]=4;
  11402. //>>excludeEnd("ctx");
  11403. $4=(13)._truncated();
  11404. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11405. $ctx1.sendIdx["truncated"]=4;
  11406. //>>excludeEnd("ctx");
  11407. self._assert_equals_($4,(13));
  11408. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11409. $ctx1.sendIdx["assert:equals:"]=5;
  11410. //>>excludeEnd("ctx");
  11411. $5=(14)._truncated();
  11412. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11413. $ctx1.sendIdx["truncated"]=5;
  11414. //>>excludeEnd("ctx");
  11415. self._assert_equals_($5,(14));
  11416. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11417. $ctx1.sendIdx["assert:equals:"]=6;
  11418. //>>excludeEnd("ctx");
  11419. self._assert_equals_((15)._truncated(),(15));
  11420. return self;
  11421. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11422. }, function($ctx1) {$ctx1.fill(self,"testHexNumbers",{},$globals.NumberTest)});
  11423. //>>excludeEnd("ctx");
  11424. },
  11425. //>>excludeStart("ide", pragmas.excludeIdeData);
  11426. args: [],
  11427. 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",
  11428. referencedClasses: [],
  11429. //>>excludeEnd("ide");
  11430. messageSends: ["assert:equals:", "truncated"]
  11431. }),
  11432. $globals.NumberTest);
  11433. $core.addMethod(
  11434. $core.method({
  11435. selector: "testIdentity",
  11436. protocol: 'tests',
  11437. fn: function (){
  11438. var self=this;
  11439. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11440. return $core.withContext(function($ctx1) {
  11441. //>>excludeEnd("ctx");
  11442. var $1,$2,$3,$5,$4,$7,$6,$9,$8;
  11443. $1=(1).__eq_eq((1));
  11444. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11445. $ctx1.sendIdx["=="]=1;
  11446. //>>excludeEnd("ctx");
  11447. self._assert_($1);
  11448. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11449. $ctx1.sendIdx["assert:"]=1;
  11450. //>>excludeEnd("ctx");
  11451. $2=(0).__eq_eq((0));
  11452. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11453. $ctx1.sendIdx["=="]=2;
  11454. //>>excludeEnd("ctx");
  11455. self._assert_($2);
  11456. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11457. $ctx1.sendIdx["assert:"]=2;
  11458. //>>excludeEnd("ctx");
  11459. $3=(1).__eq_eq((0));
  11460. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11461. $ctx1.sendIdx["=="]=3;
  11462. //>>excludeEnd("ctx");
  11463. self._deny_($3);
  11464. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11465. $ctx1.sendIdx["deny:"]=1;
  11466. //>>excludeEnd("ctx");
  11467. $5=(1)._yourself();
  11468. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11469. $ctx1.sendIdx["yourself"]=1;
  11470. //>>excludeEnd("ctx");
  11471. $4=$recv($5).__eq_eq((1));
  11472. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11473. $ctx1.sendIdx["=="]=4;
  11474. //>>excludeEnd("ctx");
  11475. self._assert_($4);
  11476. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11477. $ctx1.sendIdx["assert:"]=3;
  11478. //>>excludeEnd("ctx");
  11479. $7=(1)._yourself();
  11480. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11481. $ctx1.sendIdx["yourself"]=2;
  11482. //>>excludeEnd("ctx");
  11483. $6=(1).__eq_eq($7);
  11484. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11485. $ctx1.sendIdx["=="]=5;
  11486. //>>excludeEnd("ctx");
  11487. self._assert_($6);
  11488. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11489. $ctx1.sendIdx["assert:"]=4;
  11490. //>>excludeEnd("ctx");
  11491. $9=(1)._yourself();
  11492. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11493. $ctx1.sendIdx["yourself"]=3;
  11494. //>>excludeEnd("ctx");
  11495. $8=$recv($9).__eq_eq((1)._yourself());
  11496. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11497. $ctx1.sendIdx["=="]=6;
  11498. //>>excludeEnd("ctx");
  11499. self._assert_($8);
  11500. self._deny_((1).__eq_eq((2)));
  11501. return self;
  11502. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11503. }, function($ctx1) {$ctx1.fill(self,"testIdentity",{},$globals.NumberTest)});
  11504. //>>excludeEnd("ctx");
  11505. },
  11506. //>>excludeStart("ide", pragmas.excludeIdeData);
  11507. args: [],
  11508. 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",
  11509. referencedClasses: [],
  11510. //>>excludeEnd("ide");
  11511. messageSends: ["assert:", "==", "deny:", "yourself"]
  11512. }),
  11513. $globals.NumberTest);
  11514. $core.addMethod(
  11515. $core.method({
  11516. selector: "testInvalidHexNumbers",
  11517. protocol: 'tests',
  11518. fn: function (){
  11519. var self=this;
  11520. function $MessageNotUnderstood(){return $globals.MessageNotUnderstood||(typeof MessageNotUnderstood=="undefined"?nil:MessageNotUnderstood)}
  11521. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11522. return $core.withContext(function($ctx1) {
  11523. //>>excludeEnd("ctx");
  11524. self._should_raise_((function(){
  11525. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11526. return $core.withContext(function($ctx2) {
  11527. //>>excludeEnd("ctx");
  11528. return (16)._rG();
  11529. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11530. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  11531. //>>excludeEnd("ctx");
  11532. }),$MessageNotUnderstood());
  11533. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11534. $ctx1.sendIdx["should:raise:"]=1;
  11535. //>>excludeEnd("ctx");
  11536. self._should_raise_((function(){
  11537. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11538. return $core.withContext(function($ctx2) {
  11539. //>>excludeEnd("ctx");
  11540. return (16)._rg();
  11541. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11542. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  11543. //>>excludeEnd("ctx");
  11544. }),$MessageNotUnderstood());
  11545. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11546. $ctx1.sendIdx["should:raise:"]=2;
  11547. //>>excludeEnd("ctx");
  11548. self._should_raise_((function(){
  11549. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11550. return $core.withContext(function($ctx2) {
  11551. //>>excludeEnd("ctx");
  11552. return (16)._rH();
  11553. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11554. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  11555. //>>excludeEnd("ctx");
  11556. }),$MessageNotUnderstood());
  11557. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11558. $ctx1.sendIdx["should:raise:"]=3;
  11559. //>>excludeEnd("ctx");
  11560. self._should_raise_((function(){
  11561. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11562. return $core.withContext(function($ctx2) {
  11563. //>>excludeEnd("ctx");
  11564. return (16)._rh();
  11565. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11566. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,4)});
  11567. //>>excludeEnd("ctx");
  11568. }),$MessageNotUnderstood());
  11569. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11570. $ctx1.sendIdx["should:raise:"]=4;
  11571. //>>excludeEnd("ctx");
  11572. self._should_raise_((function(){
  11573. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11574. return $core.withContext(function($ctx2) {
  11575. //>>excludeEnd("ctx");
  11576. return (16)._rI();
  11577. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11578. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,5)});
  11579. //>>excludeEnd("ctx");
  11580. }),$MessageNotUnderstood());
  11581. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11582. $ctx1.sendIdx["should:raise:"]=5;
  11583. //>>excludeEnd("ctx");
  11584. self._should_raise_((function(){
  11585. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11586. return $core.withContext(function($ctx2) {
  11587. //>>excludeEnd("ctx");
  11588. return (16)._ri();
  11589. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11590. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,6)});
  11591. //>>excludeEnd("ctx");
  11592. }),$MessageNotUnderstood());
  11593. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11594. $ctx1.sendIdx["should:raise:"]=6;
  11595. //>>excludeEnd("ctx");
  11596. self._should_raise_((function(){
  11597. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11598. return $core.withContext(function($ctx2) {
  11599. //>>excludeEnd("ctx");
  11600. return (16)._rJ();
  11601. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11602. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,7)});
  11603. //>>excludeEnd("ctx");
  11604. }),$MessageNotUnderstood());
  11605. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11606. $ctx1.sendIdx["should:raise:"]=7;
  11607. //>>excludeEnd("ctx");
  11608. self._should_raise_((function(){
  11609. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11610. return $core.withContext(function($ctx2) {
  11611. //>>excludeEnd("ctx");
  11612. return (16)._rj();
  11613. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11614. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,8)});
  11615. //>>excludeEnd("ctx");
  11616. }),$MessageNotUnderstood());
  11617. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11618. $ctx1.sendIdx["should:raise:"]=8;
  11619. //>>excludeEnd("ctx");
  11620. self._should_raise_((function(){
  11621. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11622. return $core.withContext(function($ctx2) {
  11623. //>>excludeEnd("ctx");
  11624. return (16)._rK();
  11625. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11626. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,9)});
  11627. //>>excludeEnd("ctx");
  11628. }),$MessageNotUnderstood());
  11629. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11630. $ctx1.sendIdx["should:raise:"]=9;
  11631. //>>excludeEnd("ctx");
  11632. self._should_raise_((function(){
  11633. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11634. return $core.withContext(function($ctx2) {
  11635. //>>excludeEnd("ctx");
  11636. return (16)._rk();
  11637. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11638. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,10)});
  11639. //>>excludeEnd("ctx");
  11640. }),$MessageNotUnderstood());
  11641. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11642. $ctx1.sendIdx["should:raise:"]=10;
  11643. //>>excludeEnd("ctx");
  11644. self._should_raise_((function(){
  11645. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11646. return $core.withContext(function($ctx2) {
  11647. //>>excludeEnd("ctx");
  11648. return (16)._rL();
  11649. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11650. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,11)});
  11651. //>>excludeEnd("ctx");
  11652. }),$MessageNotUnderstood());
  11653. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11654. $ctx1.sendIdx["should:raise:"]=11;
  11655. //>>excludeEnd("ctx");
  11656. self._should_raise_((function(){
  11657. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11658. return $core.withContext(function($ctx2) {
  11659. //>>excludeEnd("ctx");
  11660. return (16)._rl();
  11661. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11662. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,12)});
  11663. //>>excludeEnd("ctx");
  11664. }),$MessageNotUnderstood());
  11665. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11666. $ctx1.sendIdx["should:raise:"]=12;
  11667. //>>excludeEnd("ctx");
  11668. self._should_raise_((function(){
  11669. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11670. return $core.withContext(function($ctx2) {
  11671. //>>excludeEnd("ctx");
  11672. return (16)._rM();
  11673. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11674. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,13)});
  11675. //>>excludeEnd("ctx");
  11676. }),$MessageNotUnderstood());
  11677. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11678. $ctx1.sendIdx["should:raise:"]=13;
  11679. //>>excludeEnd("ctx");
  11680. self._should_raise_((function(){
  11681. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11682. return $core.withContext(function($ctx2) {
  11683. //>>excludeEnd("ctx");
  11684. return (16)._rm();
  11685. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11686. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,14)});
  11687. //>>excludeEnd("ctx");
  11688. }),$MessageNotUnderstood());
  11689. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11690. $ctx1.sendIdx["should:raise:"]=14;
  11691. //>>excludeEnd("ctx");
  11692. self._should_raise_((function(){
  11693. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11694. return $core.withContext(function($ctx2) {
  11695. //>>excludeEnd("ctx");
  11696. return (16)._rN();
  11697. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11698. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,15)});
  11699. //>>excludeEnd("ctx");
  11700. }),$MessageNotUnderstood());
  11701. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11702. $ctx1.sendIdx["should:raise:"]=15;
  11703. //>>excludeEnd("ctx");
  11704. self._should_raise_((function(){
  11705. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11706. return $core.withContext(function($ctx2) {
  11707. //>>excludeEnd("ctx");
  11708. return (16)._rn();
  11709. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11710. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,16)});
  11711. //>>excludeEnd("ctx");
  11712. }),$MessageNotUnderstood());
  11713. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11714. $ctx1.sendIdx["should:raise:"]=16;
  11715. //>>excludeEnd("ctx");
  11716. self._should_raise_((function(){
  11717. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11718. return $core.withContext(function($ctx2) {
  11719. //>>excludeEnd("ctx");
  11720. return (16)._rO();
  11721. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11722. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,17)});
  11723. //>>excludeEnd("ctx");
  11724. }),$MessageNotUnderstood());
  11725. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11726. $ctx1.sendIdx["should:raise:"]=17;
  11727. //>>excludeEnd("ctx");
  11728. self._should_raise_((function(){
  11729. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11730. return $core.withContext(function($ctx2) {
  11731. //>>excludeEnd("ctx");
  11732. return (16)._ro();
  11733. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11734. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,18)});
  11735. //>>excludeEnd("ctx");
  11736. }),$MessageNotUnderstood());
  11737. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11738. $ctx1.sendIdx["should:raise:"]=18;
  11739. //>>excludeEnd("ctx");
  11740. self._should_raise_((function(){
  11741. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11742. return $core.withContext(function($ctx2) {
  11743. //>>excludeEnd("ctx");
  11744. return (16)._rP();
  11745. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11746. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,19)});
  11747. //>>excludeEnd("ctx");
  11748. }),$MessageNotUnderstood());
  11749. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11750. $ctx1.sendIdx["should:raise:"]=19;
  11751. //>>excludeEnd("ctx");
  11752. self._should_raise_((function(){
  11753. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11754. return $core.withContext(function($ctx2) {
  11755. //>>excludeEnd("ctx");
  11756. return (16)._rp();
  11757. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11758. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,20)});
  11759. //>>excludeEnd("ctx");
  11760. }),$MessageNotUnderstood());
  11761. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11762. $ctx1.sendIdx["should:raise:"]=20;
  11763. //>>excludeEnd("ctx");
  11764. self._should_raise_((function(){
  11765. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11766. return $core.withContext(function($ctx2) {
  11767. //>>excludeEnd("ctx");
  11768. return (16)._rQ();
  11769. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11770. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,21)});
  11771. //>>excludeEnd("ctx");
  11772. }),$MessageNotUnderstood());
  11773. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11774. $ctx1.sendIdx["should:raise:"]=21;
  11775. //>>excludeEnd("ctx");
  11776. self._should_raise_((function(){
  11777. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11778. return $core.withContext(function($ctx2) {
  11779. //>>excludeEnd("ctx");
  11780. return (16)._rq();
  11781. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11782. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,22)});
  11783. //>>excludeEnd("ctx");
  11784. }),$MessageNotUnderstood());
  11785. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11786. $ctx1.sendIdx["should:raise:"]=22;
  11787. //>>excludeEnd("ctx");
  11788. self._should_raise_((function(){
  11789. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11790. return $core.withContext(function($ctx2) {
  11791. //>>excludeEnd("ctx");
  11792. return (16)._rR();
  11793. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11794. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,23)});
  11795. //>>excludeEnd("ctx");
  11796. }),$MessageNotUnderstood());
  11797. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11798. $ctx1.sendIdx["should:raise:"]=23;
  11799. //>>excludeEnd("ctx");
  11800. self._should_raise_((function(){
  11801. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11802. return $core.withContext(function($ctx2) {
  11803. //>>excludeEnd("ctx");
  11804. return (16)._rr();
  11805. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11806. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,24)});
  11807. //>>excludeEnd("ctx");
  11808. }),$MessageNotUnderstood());
  11809. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11810. $ctx1.sendIdx["should:raise:"]=24;
  11811. //>>excludeEnd("ctx");
  11812. self._should_raise_((function(){
  11813. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11814. return $core.withContext(function($ctx2) {
  11815. //>>excludeEnd("ctx");
  11816. return (16)._rS();
  11817. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11818. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,25)});
  11819. //>>excludeEnd("ctx");
  11820. }),$MessageNotUnderstood());
  11821. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11822. $ctx1.sendIdx["should:raise:"]=25;
  11823. //>>excludeEnd("ctx");
  11824. self._should_raise_((function(){
  11825. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11826. return $core.withContext(function($ctx2) {
  11827. //>>excludeEnd("ctx");
  11828. return (16)._rs();
  11829. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11830. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,26)});
  11831. //>>excludeEnd("ctx");
  11832. }),$MessageNotUnderstood());
  11833. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11834. $ctx1.sendIdx["should:raise:"]=26;
  11835. //>>excludeEnd("ctx");
  11836. self._should_raise_((function(){
  11837. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11838. return $core.withContext(function($ctx2) {
  11839. //>>excludeEnd("ctx");
  11840. return (16)._rT();
  11841. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11842. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,27)});
  11843. //>>excludeEnd("ctx");
  11844. }),$MessageNotUnderstood());
  11845. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11846. $ctx1.sendIdx["should:raise:"]=27;
  11847. //>>excludeEnd("ctx");
  11848. self._should_raise_((function(){
  11849. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11850. return $core.withContext(function($ctx2) {
  11851. //>>excludeEnd("ctx");
  11852. return (16)._rt();
  11853. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11854. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,28)});
  11855. //>>excludeEnd("ctx");
  11856. }),$MessageNotUnderstood());
  11857. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11858. $ctx1.sendIdx["should:raise:"]=28;
  11859. //>>excludeEnd("ctx");
  11860. self._should_raise_((function(){
  11861. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11862. return $core.withContext(function($ctx2) {
  11863. //>>excludeEnd("ctx");
  11864. return (16)._rU();
  11865. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11866. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,29)});
  11867. //>>excludeEnd("ctx");
  11868. }),$MessageNotUnderstood());
  11869. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11870. $ctx1.sendIdx["should:raise:"]=29;
  11871. //>>excludeEnd("ctx");
  11872. self._should_raise_((function(){
  11873. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11874. return $core.withContext(function($ctx2) {
  11875. //>>excludeEnd("ctx");
  11876. return (16)._ru();
  11877. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11878. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,30)});
  11879. //>>excludeEnd("ctx");
  11880. }),$MessageNotUnderstood());
  11881. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11882. $ctx1.sendIdx["should:raise:"]=30;
  11883. //>>excludeEnd("ctx");
  11884. self._should_raise_((function(){
  11885. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11886. return $core.withContext(function($ctx2) {
  11887. //>>excludeEnd("ctx");
  11888. return (16)._rV();
  11889. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11890. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,31)});
  11891. //>>excludeEnd("ctx");
  11892. }),$MessageNotUnderstood());
  11893. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11894. $ctx1.sendIdx["should:raise:"]=31;
  11895. //>>excludeEnd("ctx");
  11896. self._should_raise_((function(){
  11897. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11898. return $core.withContext(function($ctx2) {
  11899. //>>excludeEnd("ctx");
  11900. return (16)._rv();
  11901. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11902. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,32)});
  11903. //>>excludeEnd("ctx");
  11904. }),$MessageNotUnderstood());
  11905. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11906. $ctx1.sendIdx["should:raise:"]=32;
  11907. //>>excludeEnd("ctx");
  11908. self._should_raise_((function(){
  11909. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11910. return $core.withContext(function($ctx2) {
  11911. //>>excludeEnd("ctx");
  11912. return (16)._rW();
  11913. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11914. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,33)});
  11915. //>>excludeEnd("ctx");
  11916. }),$MessageNotUnderstood());
  11917. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11918. $ctx1.sendIdx["should:raise:"]=33;
  11919. //>>excludeEnd("ctx");
  11920. self._should_raise_((function(){
  11921. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11922. return $core.withContext(function($ctx2) {
  11923. //>>excludeEnd("ctx");
  11924. return (16)._rw();
  11925. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11926. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,34)});
  11927. //>>excludeEnd("ctx");
  11928. }),$MessageNotUnderstood());
  11929. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11930. $ctx1.sendIdx["should:raise:"]=34;
  11931. //>>excludeEnd("ctx");
  11932. self._should_raise_((function(){
  11933. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11934. return $core.withContext(function($ctx2) {
  11935. //>>excludeEnd("ctx");
  11936. return (16)._rX();
  11937. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11938. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,35)});
  11939. //>>excludeEnd("ctx");
  11940. }),$MessageNotUnderstood());
  11941. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11942. $ctx1.sendIdx["should:raise:"]=35;
  11943. //>>excludeEnd("ctx");
  11944. self._should_raise_((function(){
  11945. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11946. return $core.withContext(function($ctx2) {
  11947. //>>excludeEnd("ctx");
  11948. return (16)._rx();
  11949. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11950. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,36)});
  11951. //>>excludeEnd("ctx");
  11952. }),$MessageNotUnderstood());
  11953. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11954. $ctx1.sendIdx["should:raise:"]=36;
  11955. //>>excludeEnd("ctx");
  11956. self._should_raise_((function(){
  11957. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11958. return $core.withContext(function($ctx2) {
  11959. //>>excludeEnd("ctx");
  11960. return (16)._rY();
  11961. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11962. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,37)});
  11963. //>>excludeEnd("ctx");
  11964. }),$MessageNotUnderstood());
  11965. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11966. $ctx1.sendIdx["should:raise:"]=37;
  11967. //>>excludeEnd("ctx");
  11968. self._should_raise_((function(){
  11969. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11970. return $core.withContext(function($ctx2) {
  11971. //>>excludeEnd("ctx");
  11972. return (16)._ry();
  11973. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11974. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,38)});
  11975. //>>excludeEnd("ctx");
  11976. }),$MessageNotUnderstood());
  11977. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11978. $ctx1.sendIdx["should:raise:"]=38;
  11979. //>>excludeEnd("ctx");
  11980. self._should_raise_((function(){
  11981. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11982. return $core.withContext(function($ctx2) {
  11983. //>>excludeEnd("ctx");
  11984. return (16)._rZ();
  11985. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11986. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,39)});
  11987. //>>excludeEnd("ctx");
  11988. }),$MessageNotUnderstood());
  11989. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11990. $ctx1.sendIdx["should:raise:"]=39;
  11991. //>>excludeEnd("ctx");
  11992. self._should_raise_((function(){
  11993. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11994. return $core.withContext(function($ctx2) {
  11995. //>>excludeEnd("ctx");
  11996. return (16)._rz();
  11997. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11998. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,40)});
  11999. //>>excludeEnd("ctx");
  12000. }),$MessageNotUnderstood());
  12001. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12002. $ctx1.sendIdx["should:raise:"]=40;
  12003. //>>excludeEnd("ctx");
  12004. self._should_raise_((function(){
  12005. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12006. return $core.withContext(function($ctx2) {
  12007. //>>excludeEnd("ctx");
  12008. return (11259375)._Z();
  12009. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12010. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,41)});
  12011. //>>excludeEnd("ctx");
  12012. }),$MessageNotUnderstood());
  12013. return self;
  12014. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12015. }, function($ctx1) {$ctx1.fill(self,"testInvalidHexNumbers",{},$globals.NumberTest)});
  12016. //>>excludeEnd("ctx");
  12017. },
  12018. //>>excludeStart("ide", pragmas.excludeIdeData);
  12019. args: [],
  12020. 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.",
  12021. referencedClasses: ["MessageNotUnderstood"],
  12022. //>>excludeEnd("ide");
  12023. 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"]
  12024. }),
  12025. $globals.NumberTest);
  12026. $core.addMethod(
  12027. $core.method({
  12028. selector: "testLog",
  12029. protocol: 'tests',
  12030. fn: function (){
  12031. var self=this;
  12032. function $Number(){return $globals.Number||(typeof Number=="undefined"?nil:Number)}
  12033. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12034. return $core.withContext(function($ctx1) {
  12035. //>>excludeEnd("ctx");
  12036. self._assert_equals_((10000)._log(),(4));
  12037. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12038. $ctx1.sendIdx["assert:equals:"]=1;
  12039. //>>excludeEnd("ctx");
  12040. self._assert_equals_((512)._log_((2)),(9));
  12041. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12042. $ctx1.sendIdx["assert:equals:"]=2;
  12043. //>>excludeEnd("ctx");
  12044. self._assert_equals_($recv($recv($Number())._e())._ln(),(1));
  12045. return self;
  12046. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12047. }, function($ctx1) {$ctx1.fill(self,"testLog",{},$globals.NumberTest)});
  12048. //>>excludeEnd("ctx");
  12049. },
  12050. //>>excludeStart("ide", pragmas.excludeIdeData);
  12051. args: [],
  12052. 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.",
  12053. referencedClasses: ["Number"],
  12054. //>>excludeEnd("ide");
  12055. messageSends: ["assert:equals:", "log", "log:", "ln", "e"]
  12056. }),
  12057. $globals.NumberTest);
  12058. $core.addMethod(
  12059. $core.method({
  12060. selector: "testMinMax",
  12061. protocol: 'tests',
  12062. fn: function (){
  12063. var self=this;
  12064. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12065. return $core.withContext(function($ctx1) {
  12066. //>>excludeEnd("ctx");
  12067. self._assert_equals_((2)._max_((5)),(5));
  12068. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12069. $ctx1.sendIdx["assert:equals:"]=1;
  12070. //>>excludeEnd("ctx");
  12071. self._assert_equals_((2)._min_((5)),(2));
  12072. return self;
  12073. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12074. }, function($ctx1) {$ctx1.fill(self,"testMinMax",{},$globals.NumberTest)});
  12075. //>>excludeEnd("ctx");
  12076. },
  12077. //>>excludeStart("ide", pragmas.excludeIdeData);
  12078. args: [],
  12079. source: "testMinMax\x0a\x09\x0a\x09self assert: (2 max: 5) equals: 5.\x0a\x09self assert: (2 min: 5) equals: 2",
  12080. referencedClasses: [],
  12081. //>>excludeEnd("ide");
  12082. messageSends: ["assert:equals:", "max:", "min:"]
  12083. }),
  12084. $globals.NumberTest);
  12085. $core.addMethod(
  12086. $core.method({
  12087. selector: "testNegated",
  12088. protocol: 'tests',
  12089. fn: function (){
  12090. var self=this;
  12091. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12092. return $core.withContext(function($ctx1) {
  12093. //>>excludeEnd("ctx");
  12094. var $1;
  12095. $1=(3)._negated();
  12096. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12097. $ctx1.sendIdx["negated"]=1;
  12098. //>>excludeEnd("ctx");
  12099. self._assert_equals_($1,(-3));
  12100. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12101. $ctx1.sendIdx["assert:equals:"]=1;
  12102. //>>excludeEnd("ctx");
  12103. self._assert_equals_((-3)._negated(),(3));
  12104. return self;
  12105. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12106. }, function($ctx1) {$ctx1.fill(self,"testNegated",{},$globals.NumberTest)});
  12107. //>>excludeEnd("ctx");
  12108. },
  12109. //>>excludeStart("ide", pragmas.excludeIdeData);
  12110. args: [],
  12111. source: "testNegated\x0a\x09self assert: 3 negated equals: -3.\x0a\x09self assert: -3 negated equals: 3",
  12112. referencedClasses: [],
  12113. //>>excludeEnd("ide");
  12114. messageSends: ["assert:equals:", "negated"]
  12115. }),
  12116. $globals.NumberTest);
  12117. $core.addMethod(
  12118. $core.method({
  12119. selector: "testPrintShowingDecimalPlaces",
  12120. protocol: 'tests',
  12121. fn: function (){
  12122. var self=this;
  12123. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12124. return $core.withContext(function($ctx1) {
  12125. //>>excludeEnd("ctx");
  12126. var $1,$2,$4,$3,$5,$6,$8,$7,$10,$9,$11,$12,$13,$14,$15;
  12127. $1=(23)._printShowingDecimalPlaces_((2));
  12128. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12129. $ctx1.sendIdx["printShowingDecimalPlaces:"]=1;
  12130. //>>excludeEnd("ctx");
  12131. self._assert_equals_($1,"23.00");
  12132. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12133. $ctx1.sendIdx["assert:equals:"]=1;
  12134. //>>excludeEnd("ctx");
  12135. $2=(23.5698)._printShowingDecimalPlaces_((2));
  12136. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12137. $ctx1.sendIdx["printShowingDecimalPlaces:"]=2;
  12138. //>>excludeEnd("ctx");
  12139. self._assert_equals_($2,"23.57");
  12140. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12141. $ctx1.sendIdx["assert:equals:"]=2;
  12142. //>>excludeEnd("ctx");
  12143. $4=(234.567)._negated();
  12144. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12145. $ctx1.sendIdx["negated"]=1;
  12146. //>>excludeEnd("ctx");
  12147. $3=$recv($4)._printShowingDecimalPlaces_((5));
  12148. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12149. $ctx1.sendIdx["printShowingDecimalPlaces:"]=3;
  12150. //>>excludeEnd("ctx");
  12151. self._assert_equals_($3,"-234.56700");
  12152. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12153. $ctx1.sendIdx["assert:equals:"]=3;
  12154. //>>excludeEnd("ctx");
  12155. $5=(23.4567)._printShowingDecimalPlaces_((0));
  12156. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12157. $ctx1.sendIdx["printShowingDecimalPlaces:"]=4;
  12158. //>>excludeEnd("ctx");
  12159. self._assert_equals_($5,"23");
  12160. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12161. $ctx1.sendIdx["assert:equals:"]=4;
  12162. //>>excludeEnd("ctx");
  12163. $6=(23.5567)._printShowingDecimalPlaces_((0));
  12164. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12165. $ctx1.sendIdx["printShowingDecimalPlaces:"]=5;
  12166. //>>excludeEnd("ctx");
  12167. self._assert_equals_($6,"24");
  12168. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12169. $ctx1.sendIdx["assert:equals:"]=5;
  12170. //>>excludeEnd("ctx");
  12171. $8=(23.4567)._negated();
  12172. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12173. $ctx1.sendIdx["negated"]=2;
  12174. //>>excludeEnd("ctx");
  12175. $7=$recv($8)._printShowingDecimalPlaces_((0));
  12176. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12177. $ctx1.sendIdx["printShowingDecimalPlaces:"]=6;
  12178. //>>excludeEnd("ctx");
  12179. self._assert_equals_($7,"-23");
  12180. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12181. $ctx1.sendIdx["assert:equals:"]=6;
  12182. //>>excludeEnd("ctx");
  12183. $10=(23.5567)._negated();
  12184. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12185. $ctx1.sendIdx["negated"]=3;
  12186. //>>excludeEnd("ctx");
  12187. $9=$recv($10)._printShowingDecimalPlaces_((0));
  12188. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12189. $ctx1.sendIdx["printShowingDecimalPlaces:"]=7;
  12190. //>>excludeEnd("ctx");
  12191. self._assert_equals_($9,"-24");
  12192. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12193. $ctx1.sendIdx["assert:equals:"]=7;
  12194. //>>excludeEnd("ctx");
  12195. $11=(100000000)._printShowingDecimalPlaces_((1));
  12196. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12197. $ctx1.sendIdx["printShowingDecimalPlaces:"]=8;
  12198. //>>excludeEnd("ctx");
  12199. self._assert_equals_($11,"100000000.0");
  12200. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12201. $ctx1.sendIdx["assert:equals:"]=8;
  12202. //>>excludeEnd("ctx");
  12203. $12=(0.98)._printShowingDecimalPlaces_((5));
  12204. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12205. $ctx1.sendIdx["printShowingDecimalPlaces:"]=9;
  12206. //>>excludeEnd("ctx");
  12207. self._assert_equals_($12,"0.98000");
  12208. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12209. $ctx1.sendIdx["assert:equals:"]=9;
  12210. //>>excludeEnd("ctx");
  12211. $13=$recv((0.98)._negated())._printShowingDecimalPlaces_((2));
  12212. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12213. $ctx1.sendIdx["printShowingDecimalPlaces:"]=10;
  12214. //>>excludeEnd("ctx");
  12215. self._assert_equals_($13,"-0.98");
  12216. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12217. $ctx1.sendIdx["assert:equals:"]=10;
  12218. //>>excludeEnd("ctx");
  12219. $14=(2.567)._printShowingDecimalPlaces_((2));
  12220. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12221. $ctx1.sendIdx["printShowingDecimalPlaces:"]=11;
  12222. //>>excludeEnd("ctx");
  12223. self._assert_equals_($14,"2.57");
  12224. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12225. $ctx1.sendIdx["assert:equals:"]=11;
  12226. //>>excludeEnd("ctx");
  12227. $15=(-2.567)._printShowingDecimalPlaces_((2));
  12228. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12229. $ctx1.sendIdx["printShowingDecimalPlaces:"]=12;
  12230. //>>excludeEnd("ctx");
  12231. self._assert_equals_($15,"-2.57");
  12232. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12233. $ctx1.sendIdx["assert:equals:"]=12;
  12234. //>>excludeEnd("ctx");
  12235. self._assert_equals_((0)._printShowingDecimalPlaces_((2)),"0.00");
  12236. return self;
  12237. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12238. }, function($ctx1) {$ctx1.fill(self,"testPrintShowingDecimalPlaces",{},$globals.NumberTest)});
  12239. //>>excludeEnd("ctx");
  12240. },
  12241. //>>excludeStart("ide", pragmas.excludeIdeData);
  12242. args: [],
  12243. 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'.",
  12244. referencedClasses: [],
  12245. //>>excludeEnd("ide");
  12246. messageSends: ["assert:equals:", "printShowingDecimalPlaces:", "negated"]
  12247. }),
  12248. $globals.NumberTest);
  12249. $core.addMethod(
  12250. $core.method({
  12251. selector: "testRaisedTo",
  12252. protocol: 'tests',
  12253. fn: function (){
  12254. var self=this;
  12255. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12256. return $core.withContext(function($ctx1) {
  12257. //>>excludeEnd("ctx");
  12258. var $1,$2,$3;
  12259. $1=(2)._raisedTo_((4));
  12260. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12261. $ctx1.sendIdx["raisedTo:"]=1;
  12262. //>>excludeEnd("ctx");
  12263. self._assert_equals_($1,(16));
  12264. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12265. $ctx1.sendIdx["assert:equals:"]=1;
  12266. //>>excludeEnd("ctx");
  12267. $2=(2)._raisedTo_((0));
  12268. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12269. $ctx1.sendIdx["raisedTo:"]=2;
  12270. //>>excludeEnd("ctx");
  12271. self._assert_equals_($2,(1));
  12272. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12273. $ctx1.sendIdx["assert:equals:"]=2;
  12274. //>>excludeEnd("ctx");
  12275. $3=(2)._raisedTo_((-3));
  12276. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12277. $ctx1.sendIdx["raisedTo:"]=3;
  12278. //>>excludeEnd("ctx");
  12279. self._assert_equals_($3,(0.125));
  12280. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12281. $ctx1.sendIdx["assert:equals:"]=3;
  12282. //>>excludeEnd("ctx");
  12283. self._assert_equals_((4)._raisedTo_((0.5)),(2));
  12284. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12285. $ctx1.sendIdx["assert:equals:"]=4;
  12286. //>>excludeEnd("ctx");
  12287. self._assert_equals_((2).__star_star((4)),(16));
  12288. return self;
  12289. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12290. }, function($ctx1) {$ctx1.fill(self,"testRaisedTo",{},$globals.NumberTest)});
  12291. //>>excludeEnd("ctx");
  12292. },
  12293. //>>excludeStart("ide", pragmas.excludeIdeData);
  12294. args: [],
  12295. 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.",
  12296. referencedClasses: [],
  12297. //>>excludeEnd("ide");
  12298. messageSends: ["assert:equals:", "raisedTo:", "**"]
  12299. }),
  12300. $globals.NumberTest);
  12301. $core.addMethod(
  12302. $core.method({
  12303. selector: "testRounded",
  12304. protocol: 'tests',
  12305. fn: function (){
  12306. var self=this;
  12307. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12308. return $core.withContext(function($ctx1) {
  12309. //>>excludeEnd("ctx");
  12310. var $1,$2;
  12311. $1=(3)._rounded();
  12312. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12313. $ctx1.sendIdx["rounded"]=1;
  12314. //>>excludeEnd("ctx");
  12315. self._assert_equals_($1,(3));
  12316. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12317. $ctx1.sendIdx["assert:equals:"]=1;
  12318. //>>excludeEnd("ctx");
  12319. $2=(3.212)._rounded();
  12320. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12321. $ctx1.sendIdx["rounded"]=2;
  12322. //>>excludeEnd("ctx");
  12323. self._assert_equals_($2,(3));
  12324. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12325. $ctx1.sendIdx["assert:equals:"]=2;
  12326. //>>excludeEnd("ctx");
  12327. self._assert_equals_((3.51)._rounded(),(4));
  12328. return self;
  12329. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12330. }, function($ctx1) {$ctx1.fill(self,"testRounded",{},$globals.NumberTest)});
  12331. //>>excludeEnd("ctx");
  12332. },
  12333. //>>excludeStart("ide", pragmas.excludeIdeData);
  12334. args: [],
  12335. 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",
  12336. referencedClasses: [],
  12337. //>>excludeEnd("ide");
  12338. messageSends: ["assert:equals:", "rounded"]
  12339. }),
  12340. $globals.NumberTest);
  12341. $core.addMethod(
  12342. $core.method({
  12343. selector: "testSign",
  12344. protocol: 'tests',
  12345. fn: function (){
  12346. var self=this;
  12347. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12348. return $core.withContext(function($ctx1) {
  12349. //>>excludeEnd("ctx");
  12350. var $1,$2;
  12351. $1=(5)._sign();
  12352. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12353. $ctx1.sendIdx["sign"]=1;
  12354. //>>excludeEnd("ctx");
  12355. self._assert_equals_($1,(1));
  12356. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12357. $ctx1.sendIdx["assert:equals:"]=1;
  12358. //>>excludeEnd("ctx");
  12359. $2=(0)._sign();
  12360. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12361. $ctx1.sendIdx["sign"]=2;
  12362. //>>excludeEnd("ctx");
  12363. self._assert_equals_($2,(0));
  12364. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12365. $ctx1.sendIdx["assert:equals:"]=2;
  12366. //>>excludeEnd("ctx");
  12367. self._assert_equals_((-1.4)._sign(),(-1));
  12368. return self;
  12369. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12370. }, function($ctx1) {$ctx1.fill(self,"testSign",{},$globals.NumberTest)});
  12371. //>>excludeEnd("ctx");
  12372. },
  12373. //>>excludeStart("ide", pragmas.excludeIdeData);
  12374. args: [],
  12375. source: "testSign\x0a\x09self assert: 5 sign equals: 1.\x0a\x09self assert: 0 sign equals: 0.\x0a\x09self assert: -1.4 sign equals: -1.",
  12376. referencedClasses: [],
  12377. //>>excludeEnd("ide");
  12378. messageSends: ["assert:equals:", "sign"]
  12379. }),
  12380. $globals.NumberTest);
  12381. $core.addMethod(
  12382. $core.method({
  12383. selector: "testSqrt",
  12384. protocol: 'tests',
  12385. fn: function (){
  12386. var self=this;
  12387. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12388. return $core.withContext(function($ctx1) {
  12389. //>>excludeEnd("ctx");
  12390. var $1;
  12391. $1=(4)._sqrt();
  12392. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12393. $ctx1.sendIdx["sqrt"]=1;
  12394. //>>excludeEnd("ctx");
  12395. self._assert_equals_($1,(2));
  12396. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12397. $ctx1.sendIdx["assert:equals:"]=1;
  12398. //>>excludeEnd("ctx");
  12399. self._assert_equals_((16)._sqrt(),(4));
  12400. return self;
  12401. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12402. }, function($ctx1) {$ctx1.fill(self,"testSqrt",{},$globals.NumberTest)});
  12403. //>>excludeEnd("ctx");
  12404. },
  12405. //>>excludeStart("ide", pragmas.excludeIdeData);
  12406. args: [],
  12407. source: "testSqrt\x0a\x09\x0a\x09self assert: 4 sqrt equals: 2.\x0a\x09self assert: 16 sqrt equals: 4",
  12408. referencedClasses: [],
  12409. //>>excludeEnd("ide");
  12410. messageSends: ["assert:equals:", "sqrt"]
  12411. }),
  12412. $globals.NumberTest);
  12413. $core.addMethod(
  12414. $core.method({
  12415. selector: "testSquared",
  12416. protocol: 'tests',
  12417. fn: function (){
  12418. var self=this;
  12419. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12420. return $core.withContext(function($ctx1) {
  12421. //>>excludeEnd("ctx");
  12422. self._assert_equals_((4)._squared(),(16));
  12423. return self;
  12424. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12425. }, function($ctx1) {$ctx1.fill(self,"testSquared",{},$globals.NumberTest)});
  12426. //>>excludeEnd("ctx");
  12427. },
  12428. //>>excludeStart("ide", pragmas.excludeIdeData);
  12429. args: [],
  12430. source: "testSquared\x0a\x09\x0a\x09self assert: 4 squared equals: 16",
  12431. referencedClasses: [],
  12432. //>>excludeEnd("ide");
  12433. messageSends: ["assert:equals:", "squared"]
  12434. }),
  12435. $globals.NumberTest);
  12436. $core.addMethod(
  12437. $core.method({
  12438. selector: "testTimesRepeat",
  12439. protocol: 'tests',
  12440. fn: function (){
  12441. var self=this;
  12442. var i;
  12443. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12444. return $core.withContext(function($ctx1) {
  12445. //>>excludeEnd("ctx");
  12446. i=(0);
  12447. (0)._timesRepeat_((function(){
  12448. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12449. return $core.withContext(function($ctx2) {
  12450. //>>excludeEnd("ctx");
  12451. i=$recv(i).__plus((1));
  12452. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12453. $ctx2.sendIdx["+"]=1;
  12454. //>>excludeEnd("ctx");
  12455. return i;
  12456. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12457. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  12458. //>>excludeEnd("ctx");
  12459. }));
  12460. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12461. $ctx1.sendIdx["timesRepeat:"]=1;
  12462. //>>excludeEnd("ctx");
  12463. self._assert_equals_(i,(0));
  12464. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12465. $ctx1.sendIdx["assert:equals:"]=1;
  12466. //>>excludeEnd("ctx");
  12467. (5)._timesRepeat_((function(){
  12468. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12469. return $core.withContext(function($ctx2) {
  12470. //>>excludeEnd("ctx");
  12471. i=$recv(i).__plus((1));
  12472. return i;
  12473. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12474. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  12475. //>>excludeEnd("ctx");
  12476. }));
  12477. self._assert_equals_(i,(5));
  12478. return self;
  12479. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12480. }, function($ctx1) {$ctx1.fill(self,"testTimesRepeat",{i:i},$globals.NumberTest)});
  12481. //>>excludeEnd("ctx");
  12482. },
  12483. //>>excludeStart("ide", pragmas.excludeIdeData);
  12484. args: [],
  12485. 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",
  12486. referencedClasses: [],
  12487. //>>excludeEnd("ide");
  12488. messageSends: ["timesRepeat:", "+", "assert:equals:"]
  12489. }),
  12490. $globals.NumberTest);
  12491. $core.addMethod(
  12492. $core.method({
  12493. selector: "testTo",
  12494. protocol: 'tests',
  12495. fn: function (){
  12496. var self=this;
  12497. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12498. return $core.withContext(function($ctx1) {
  12499. //>>excludeEnd("ctx");
  12500. self._assert_equals_((1)._to_((5)),[(1), (2), (3), (4), (5)]);
  12501. return self;
  12502. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12503. }, function($ctx1) {$ctx1.fill(self,"testTo",{},$globals.NumberTest)});
  12504. //>>excludeEnd("ctx");
  12505. },
  12506. //>>excludeStart("ide", pragmas.excludeIdeData);
  12507. args: [],
  12508. source: "testTo\x0a\x09self assert: (1 to: 5) equals: #(1 2 3 4 5)",
  12509. referencedClasses: [],
  12510. //>>excludeEnd("ide");
  12511. messageSends: ["assert:equals:", "to:"]
  12512. }),
  12513. $globals.NumberTest);
  12514. $core.addMethod(
  12515. $core.method({
  12516. selector: "testToBy",
  12517. protocol: 'tests',
  12518. fn: function (){
  12519. var self=this;
  12520. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  12521. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12522. return $core.withContext(function($ctx1) {
  12523. //>>excludeEnd("ctx");
  12524. var $1;
  12525. $1=(0)._to_by_((6),(2));
  12526. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12527. $ctx1.sendIdx["to:by:"]=1;
  12528. //>>excludeEnd("ctx");
  12529. self._assert_equals_($1,[(0), (2), (4), (6)]);
  12530. self._should_raise_((function(){
  12531. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12532. return $core.withContext(function($ctx2) {
  12533. //>>excludeEnd("ctx");
  12534. return (1)._to_by_((4),(0));
  12535. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12536. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  12537. //>>excludeEnd("ctx");
  12538. }),$Error());
  12539. return self;
  12540. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12541. }, function($ctx1) {$ctx1.fill(self,"testToBy",{},$globals.NumberTest)});
  12542. //>>excludeEnd("ctx");
  12543. },
  12544. //>>excludeStart("ide", pragmas.excludeIdeData);
  12545. args: [],
  12546. 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",
  12547. referencedClasses: ["Error"],
  12548. //>>excludeEnd("ide");
  12549. messageSends: ["assert:equals:", "to:by:", "should:raise:"]
  12550. }),
  12551. $globals.NumberTest);
  12552. $core.addMethod(
  12553. $core.method({
  12554. selector: "testTrigonometry",
  12555. protocol: 'tests',
  12556. fn: function (){
  12557. var self=this;
  12558. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12559. return $core.withContext(function($ctx1) {
  12560. //>>excludeEnd("ctx");
  12561. self._assert_equals_((0)._cos(),(1));
  12562. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12563. $ctx1.sendIdx["assert:equals:"]=1;
  12564. //>>excludeEnd("ctx");
  12565. self._assert_equals_((0)._sin(),(0));
  12566. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12567. $ctx1.sendIdx["assert:equals:"]=2;
  12568. //>>excludeEnd("ctx");
  12569. self._assert_equals_((0)._tan(),(0));
  12570. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12571. $ctx1.sendIdx["assert:equals:"]=3;
  12572. //>>excludeEnd("ctx");
  12573. self._assert_equals_((1)._arcCos(),(0));
  12574. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12575. $ctx1.sendIdx["assert:equals:"]=4;
  12576. //>>excludeEnd("ctx");
  12577. self._assert_equals_((0)._arcSin(),(0));
  12578. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12579. $ctx1.sendIdx["assert:equals:"]=5;
  12580. //>>excludeEnd("ctx");
  12581. self._assert_equals_((0)._arcTan(),(0));
  12582. return self;
  12583. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12584. }, function($ctx1) {$ctx1.fill(self,"testTrigonometry",{},$globals.NumberTest)});
  12585. //>>excludeEnd("ctx");
  12586. },
  12587. //>>excludeStart("ide", pragmas.excludeIdeData);
  12588. args: [],
  12589. 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.",
  12590. referencedClasses: [],
  12591. //>>excludeEnd("ide");
  12592. messageSends: ["assert:equals:", "cos", "sin", "tan", "arcCos", "arcSin", "arcTan"]
  12593. }),
  12594. $globals.NumberTest);
  12595. $core.addMethod(
  12596. $core.method({
  12597. selector: "testTruncated",
  12598. protocol: 'tests',
  12599. fn: function (){
  12600. var self=this;
  12601. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12602. return $core.withContext(function($ctx1) {
  12603. //>>excludeEnd("ctx");
  12604. var $1,$2;
  12605. $1=(3)._truncated();
  12606. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12607. $ctx1.sendIdx["truncated"]=1;
  12608. //>>excludeEnd("ctx");
  12609. self._assert_equals_($1,(3));
  12610. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12611. $ctx1.sendIdx["assert:equals:"]=1;
  12612. //>>excludeEnd("ctx");
  12613. $2=(3.212)._truncated();
  12614. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12615. $ctx1.sendIdx["truncated"]=2;
  12616. //>>excludeEnd("ctx");
  12617. self._assert_equals_($2,(3));
  12618. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12619. $ctx1.sendIdx["assert:equals:"]=2;
  12620. //>>excludeEnd("ctx");
  12621. self._assert_equals_((3.51)._truncated(),(3));
  12622. return self;
  12623. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12624. }, function($ctx1) {$ctx1.fill(self,"testTruncated",{},$globals.NumberTest)});
  12625. //>>excludeEnd("ctx");
  12626. },
  12627. //>>excludeStart("ide", pragmas.excludeIdeData);
  12628. args: [],
  12629. 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",
  12630. referencedClasses: [],
  12631. //>>excludeEnd("ide");
  12632. messageSends: ["assert:equals:", "truncated"]
  12633. }),
  12634. $globals.NumberTest);
  12635. $core.addClass('ObjectMock', $globals.Object, ['foo', 'bar'], 'Kernel-Tests');
  12636. //>>excludeStart("ide", pragmas.excludeIdeData);
  12637. $globals.ObjectMock.comment="ObjectMock is there only to perform tests on classes.";
  12638. //>>excludeEnd("ide");
  12639. $core.addMethod(
  12640. $core.method({
  12641. selector: "foo",
  12642. protocol: 'not yet classified',
  12643. fn: function (){
  12644. var self=this;
  12645. var $1;
  12646. $1=self["@foo"];
  12647. return $1;
  12648. },
  12649. //>>excludeStart("ide", pragmas.excludeIdeData);
  12650. args: [],
  12651. source: "foo\x0a\x09^ foo",
  12652. referencedClasses: [],
  12653. //>>excludeEnd("ide");
  12654. messageSends: []
  12655. }),
  12656. $globals.ObjectMock);
  12657. $core.addMethod(
  12658. $core.method({
  12659. selector: "foo:",
  12660. protocol: 'not yet classified',
  12661. fn: function (anObject){
  12662. var self=this;
  12663. self["@foo"]=anObject;
  12664. return self;
  12665. },
  12666. //>>excludeStart("ide", pragmas.excludeIdeData);
  12667. args: ["anObject"],
  12668. source: "foo: anObject\x0a\x09foo := anObject",
  12669. referencedClasses: [],
  12670. //>>excludeEnd("ide");
  12671. messageSends: []
  12672. }),
  12673. $globals.ObjectMock);
  12674. $core.addClass('ObjectTest', $globals.TestCase, [], 'Kernel-Tests');
  12675. $core.addMethod(
  12676. $core.method({
  12677. selector: "notDefined",
  12678. protocol: 'tests',
  12679. fn: function (){
  12680. var self=this;
  12681. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12682. return $core.withContext(function($ctx1) {
  12683. //>>excludeEnd("ctx");
  12684. return void 0;;
  12685. return self;
  12686. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12687. }, function($ctx1) {$ctx1.fill(self,"notDefined",{},$globals.ObjectTest)});
  12688. //>>excludeEnd("ctx");
  12689. },
  12690. //>>excludeStart("ide", pragmas.excludeIdeData);
  12691. args: [],
  12692. source: "notDefined\x0a\x09<return void 0;>",
  12693. referencedClasses: [],
  12694. //>>excludeEnd("ide");
  12695. messageSends: []
  12696. }),
  12697. $globals.ObjectTest);
  12698. $core.addMethod(
  12699. $core.method({
  12700. selector: "testBasicAccess",
  12701. protocol: 'tests',
  12702. fn: function (){
  12703. var self=this;
  12704. var o;
  12705. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  12706. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12707. return $core.withContext(function($ctx1) {
  12708. //>>excludeEnd("ctx");
  12709. var $1;
  12710. o=$recv($Object())._new();
  12711. $recv(o)._basicAt_put_("a",(1));
  12712. $1=$recv(o)._basicAt_("a");
  12713. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12714. $ctx1.sendIdx["basicAt:"]=1;
  12715. //>>excludeEnd("ctx");
  12716. self._assert_equals_($1,(1));
  12717. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12718. $ctx1.sendIdx["assert:equals:"]=1;
  12719. //>>excludeEnd("ctx");
  12720. self._assert_equals_($recv(o)._basicAt_("b"),nil);
  12721. return self;
  12722. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12723. }, function($ctx1) {$ctx1.fill(self,"testBasicAccess",{o:o},$globals.ObjectTest)});
  12724. //>>excludeEnd("ctx");
  12725. },
  12726. //>>excludeStart("ide", pragmas.excludeIdeData);
  12727. args: [],
  12728. 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",
  12729. referencedClasses: ["Object"],
  12730. //>>excludeEnd("ide");
  12731. messageSends: ["new", "basicAt:put:", "assert:equals:", "basicAt:"]
  12732. }),
  12733. $globals.ObjectTest);
  12734. $core.addMethod(
  12735. $core.method({
  12736. selector: "testBasicPerform",
  12737. protocol: 'tests',
  12738. fn: function (){
  12739. var self=this;
  12740. var o;
  12741. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  12742. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12743. return $core.withContext(function($ctx1) {
  12744. //>>excludeEnd("ctx");
  12745. o=$recv($Object())._new();
  12746. $recv(o)._basicAt_put_("func",(function(){
  12747. return "hello";
  12748. }));
  12749. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12750. $ctx1.sendIdx["basicAt:put:"]=1;
  12751. //>>excludeEnd("ctx");
  12752. $recv(o)._basicAt_put_("func2",(function(a){
  12753. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12754. return $core.withContext(function($ctx2) {
  12755. //>>excludeEnd("ctx");
  12756. return $recv(a).__plus((1));
  12757. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12758. }, function($ctx2) {$ctx2.fillBlock({a:a},$ctx1,2)});
  12759. //>>excludeEnd("ctx");
  12760. }));
  12761. self._assert_equals_($recv(o)._basicPerform_("func"),"hello");
  12762. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12763. $ctx1.sendIdx["assert:equals:"]=1;
  12764. //>>excludeEnd("ctx");
  12765. self._assert_equals_($recv(o)._basicPerform_withArguments_("func2",[(3)]),(4));
  12766. return self;
  12767. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12768. }, function($ctx1) {$ctx1.fill(self,"testBasicPerform",{o:o},$globals.ObjectTest)});
  12769. //>>excludeEnd("ctx");
  12770. },
  12771. //>>excludeStart("ide", pragmas.excludeIdeData);
  12772. args: [],
  12773. 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",
  12774. referencedClasses: ["Object"],
  12775. //>>excludeEnd("ide");
  12776. messageSends: ["new", "basicAt:put:", "+", "assert:equals:", "basicPerform:", "basicPerform:withArguments:"]
  12777. }),
  12778. $globals.ObjectTest);
  12779. $core.addMethod(
  12780. $core.method({
  12781. selector: "testDNU",
  12782. protocol: 'tests',
  12783. fn: function (){
  12784. var self=this;
  12785. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  12786. function $MessageNotUnderstood(){return $globals.MessageNotUnderstood||(typeof MessageNotUnderstood=="undefined"?nil:MessageNotUnderstood)}
  12787. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12788. return $core.withContext(function($ctx1) {
  12789. //>>excludeEnd("ctx");
  12790. self._should_raise_((function(){
  12791. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12792. return $core.withContext(function($ctx2) {
  12793. //>>excludeEnd("ctx");
  12794. return $recv($recv($Object())._new())._foo();
  12795. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12796. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  12797. //>>excludeEnd("ctx");
  12798. }),$MessageNotUnderstood());
  12799. return self;
  12800. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12801. }, function($ctx1) {$ctx1.fill(self,"testDNU",{},$globals.ObjectTest)});
  12802. //>>excludeEnd("ctx");
  12803. },
  12804. //>>excludeStart("ide", pragmas.excludeIdeData);
  12805. args: [],
  12806. source: "testDNU\x0a\x09self should: [ Object new foo ] raise: MessageNotUnderstood",
  12807. referencedClasses: ["Object", "MessageNotUnderstood"],
  12808. //>>excludeEnd("ide");
  12809. messageSends: ["should:raise:", "foo", "new"]
  12810. }),
  12811. $globals.ObjectTest);
  12812. $core.addMethod(
  12813. $core.method({
  12814. selector: "testEquality",
  12815. protocol: 'tests',
  12816. fn: function (){
  12817. var self=this;
  12818. var o;
  12819. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  12820. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12821. return $core.withContext(function($ctx1) {
  12822. //>>excludeEnd("ctx");
  12823. var $1,$2,$4,$3;
  12824. o=$recv($Object())._new();
  12825. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12826. $ctx1.sendIdx["new"]=1;
  12827. //>>excludeEnd("ctx");
  12828. $1=$recv(o).__eq($recv($Object())._new());
  12829. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12830. $ctx1.sendIdx["="]=1;
  12831. //>>excludeEnd("ctx");
  12832. self._deny_($1);
  12833. $2=$recv(o).__eq(o);
  12834. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12835. $ctx1.sendIdx["="]=2;
  12836. //>>excludeEnd("ctx");
  12837. self._assert_($2);
  12838. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12839. $ctx1.sendIdx["assert:"]=1;
  12840. //>>excludeEnd("ctx");
  12841. $4=$recv(o)._yourself();
  12842. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12843. $ctx1.sendIdx["yourself"]=1;
  12844. //>>excludeEnd("ctx");
  12845. $3=$recv($4).__eq(o);
  12846. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12847. $ctx1.sendIdx["="]=3;
  12848. //>>excludeEnd("ctx");
  12849. self._assert_($3);
  12850. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12851. $ctx1.sendIdx["assert:"]=2;
  12852. //>>excludeEnd("ctx");
  12853. self._assert_($recv(o).__eq($recv(o)._yourself()));
  12854. return self;
  12855. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12856. }, function($ctx1) {$ctx1.fill(self,"testEquality",{o:o},$globals.ObjectTest)});
  12857. //>>excludeEnd("ctx");
  12858. },
  12859. //>>excludeStart("ide", pragmas.excludeIdeData);
  12860. args: [],
  12861. 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)",
  12862. referencedClasses: ["Object"],
  12863. //>>excludeEnd("ide");
  12864. messageSends: ["new", "deny:", "=", "assert:", "yourself"]
  12865. }),
  12866. $globals.ObjectTest);
  12867. $core.addMethod(
  12868. $core.method({
  12869. selector: "testHalt",
  12870. protocol: 'tests',
  12871. fn: function (){
  12872. var self=this;
  12873. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  12874. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  12875. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12876. return $core.withContext(function($ctx1) {
  12877. //>>excludeEnd("ctx");
  12878. self._should_raise_((function(){
  12879. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12880. return $core.withContext(function($ctx2) {
  12881. //>>excludeEnd("ctx");
  12882. return $recv($recv($Object())._new())._halt();
  12883. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12884. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  12885. //>>excludeEnd("ctx");
  12886. }),$Error());
  12887. return self;
  12888. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12889. }, function($ctx1) {$ctx1.fill(self,"testHalt",{},$globals.ObjectTest)});
  12890. //>>excludeEnd("ctx");
  12891. },
  12892. //>>excludeStart("ide", pragmas.excludeIdeData);
  12893. args: [],
  12894. source: "testHalt\x0a\x09self should: [ Object new halt ] raise: Error",
  12895. referencedClasses: ["Object", "Error"],
  12896. //>>excludeEnd("ide");
  12897. messageSends: ["should:raise:", "halt", "new"]
  12898. }),
  12899. $globals.ObjectTest);
  12900. $core.addMethod(
  12901. $core.method({
  12902. selector: "testIdentity",
  12903. protocol: 'tests',
  12904. fn: function (){
  12905. var self=this;
  12906. var o;
  12907. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  12908. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12909. return $core.withContext(function($ctx1) {
  12910. //>>excludeEnd("ctx");
  12911. var $1,$2,$4,$3;
  12912. o=$recv($Object())._new();
  12913. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12914. $ctx1.sendIdx["new"]=1;
  12915. //>>excludeEnd("ctx");
  12916. $1=$recv(o).__eq_eq($recv($Object())._new());
  12917. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12918. $ctx1.sendIdx["=="]=1;
  12919. //>>excludeEnd("ctx");
  12920. self._deny_($1);
  12921. $2=$recv(o).__eq_eq(o);
  12922. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12923. $ctx1.sendIdx["=="]=2;
  12924. //>>excludeEnd("ctx");
  12925. self._assert_($2);
  12926. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12927. $ctx1.sendIdx["assert:"]=1;
  12928. //>>excludeEnd("ctx");
  12929. $4=$recv(o)._yourself();
  12930. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12931. $ctx1.sendIdx["yourself"]=1;
  12932. //>>excludeEnd("ctx");
  12933. $3=$recv($4).__eq_eq(o);
  12934. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12935. $ctx1.sendIdx["=="]=3;
  12936. //>>excludeEnd("ctx");
  12937. self._assert_($3);
  12938. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12939. $ctx1.sendIdx["assert:"]=2;
  12940. //>>excludeEnd("ctx");
  12941. self._assert_($recv(o).__eq_eq($recv(o)._yourself()));
  12942. return self;
  12943. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12944. }, function($ctx1) {$ctx1.fill(self,"testIdentity",{o:o},$globals.ObjectTest)});
  12945. //>>excludeEnd("ctx");
  12946. },
  12947. //>>excludeStart("ide", pragmas.excludeIdeData);
  12948. args: [],
  12949. 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",
  12950. referencedClasses: ["Object"],
  12951. //>>excludeEnd("ide");
  12952. messageSends: ["new", "deny:", "==", "assert:", "yourself"]
  12953. }),
  12954. $globals.ObjectTest);
  12955. $core.addMethod(
  12956. $core.method({
  12957. selector: "testIfNil",
  12958. protocol: 'tests',
  12959. fn: function (){
  12960. var self=this;
  12961. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  12962. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12963. return $core.withContext(function($ctx1) {
  12964. //>>excludeEnd("ctx");
  12965. var $2,$1,$5,$4,$3,$7,$6,$9,$8,$11,$10,$receiver;
  12966. $2=$recv($Object())._new();
  12967. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12968. $ctx1.sendIdx["new"]=1;
  12969. //>>excludeEnd("ctx");
  12970. $1=$recv($2)._isNil();
  12971. self._deny_($1);
  12972. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12973. $ctx1.sendIdx["deny:"]=1;
  12974. //>>excludeEnd("ctx");
  12975. $5=$recv($Object())._new();
  12976. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12977. $ctx1.sendIdx["new"]=2;
  12978. //>>excludeEnd("ctx");
  12979. if(($receiver = $5) == null || $receiver.isNil){
  12980. $4=true;
  12981. } else {
  12982. $4=$5;
  12983. };
  12984. $3=$recv($4).__eq(true);
  12985. self._deny_($3);
  12986. $7=$recv($Object())._new();
  12987. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12988. $ctx1.sendIdx["new"]=3;
  12989. //>>excludeEnd("ctx");
  12990. if(($receiver = $7) == null || $receiver.isNil){
  12991. $6=$7;
  12992. } else {
  12993. $6=true;
  12994. };
  12995. self._assert_equals_($6,true);
  12996. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12997. $ctx1.sendIdx["assert:equals:"]=1;
  12998. //>>excludeEnd("ctx");
  12999. $9=$recv($Object())._new();
  13000. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13001. $ctx1.sendIdx["new"]=4;
  13002. //>>excludeEnd("ctx");
  13003. if(($receiver = $9) == null || $receiver.isNil){
  13004. $8=false;
  13005. } else {
  13006. $8=true;
  13007. };
  13008. self._assert_equals_($8,true);
  13009. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13010. $ctx1.sendIdx["assert:equals:"]=2;
  13011. //>>excludeEnd("ctx");
  13012. $11=$recv($Object())._new();
  13013. if(($receiver = $11) == null || $receiver.isNil){
  13014. $10=false;
  13015. } else {
  13016. $10=true;
  13017. };
  13018. self._assert_equals_($10,true);
  13019. return self;
  13020. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13021. }, function($ctx1) {$ctx1.fill(self,"testIfNil",{},$globals.ObjectTest)});
  13022. //>>excludeEnd("ctx");
  13023. },
  13024. //>>excludeStart("ide", pragmas.excludeIdeData);
  13025. args: [],
  13026. 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",
  13027. referencedClasses: ["Object"],
  13028. //>>excludeEnd("ide");
  13029. messageSends: ["deny:", "isNil", "new", "=", "ifNil:", "assert:equals:", "ifNotNil:", "ifNil:ifNotNil:", "ifNotNil:ifNil:"]
  13030. }),
  13031. $globals.ObjectTest);
  13032. $core.addMethod(
  13033. $core.method({
  13034. selector: "testInstVars",
  13035. protocol: 'tests',
  13036. fn: function (){
  13037. var self=this;
  13038. var o;
  13039. function $ObjectMock(){return $globals.ObjectMock||(typeof ObjectMock=="undefined"?nil:ObjectMock)}
  13040. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13041. return $core.withContext(function($ctx1) {
  13042. //>>excludeEnd("ctx");
  13043. var $1,$2;
  13044. o=$recv($ObjectMock())._new();
  13045. $1=$recv(o)._instVarAt_("foo");
  13046. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13047. $ctx1.sendIdx["instVarAt:"]=1;
  13048. //>>excludeEnd("ctx");
  13049. self._assert_equals_($1,nil);
  13050. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13051. $ctx1.sendIdx["assert:equals:"]=1;
  13052. //>>excludeEnd("ctx");
  13053. $recv(o)._instVarAt_put_("foo",(1));
  13054. $2=$recv(o)._instVarAt_("foo");
  13055. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13056. $ctx1.sendIdx["instVarAt:"]=2;
  13057. //>>excludeEnd("ctx");
  13058. self._assert_equals_($2,(1));
  13059. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13060. $ctx1.sendIdx["assert:equals:"]=2;
  13061. //>>excludeEnd("ctx");
  13062. self._assert_equals_($recv(o)._instVarAt_("foo"),(1));
  13063. return self;
  13064. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13065. }, function($ctx1) {$ctx1.fill(self,"testInstVars",{o:o},$globals.ObjectTest)});
  13066. //>>excludeEnd("ctx");
  13067. },
  13068. //>>excludeStart("ide", pragmas.excludeIdeData);
  13069. args: [],
  13070. 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",
  13071. referencedClasses: ["ObjectMock"],
  13072. //>>excludeEnd("ide");
  13073. messageSends: ["new", "assert:equals:", "instVarAt:", "instVarAt:put:"]
  13074. }),
  13075. $globals.ObjectTest);
  13076. $core.addMethod(
  13077. $core.method({
  13078. selector: "testNilUndefined",
  13079. protocol: 'tests',
  13080. fn: function (){
  13081. var self=this;
  13082. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13083. return $core.withContext(function($ctx1) {
  13084. //>>excludeEnd("ctx");
  13085. self._assert_equals_(self._notDefined(),nil);
  13086. return self;
  13087. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13088. }, function($ctx1) {$ctx1.fill(self,"testNilUndefined",{},$globals.ObjectTest)});
  13089. //>>excludeEnd("ctx");
  13090. },
  13091. //>>excludeStart("ide", pragmas.excludeIdeData);
  13092. args: [],
  13093. source: "testNilUndefined\x0a\x09\x22nil in Smalltalk is the undefined object in JS\x22\x0a\x0a\x09self assert: self notDefined equals: nil",
  13094. referencedClasses: [],
  13095. //>>excludeEnd("ide");
  13096. messageSends: ["assert:equals:", "notDefined"]
  13097. }),
  13098. $globals.ObjectTest);
  13099. $core.addMethod(
  13100. $core.method({
  13101. selector: "testYourself",
  13102. protocol: 'tests',
  13103. fn: function (){
  13104. var self=this;
  13105. var o;
  13106. function $ObjectMock(){return $globals.ObjectMock||(typeof ObjectMock=="undefined"?nil:ObjectMock)}
  13107. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13108. return $core.withContext(function($ctx1) {
  13109. //>>excludeEnd("ctx");
  13110. o=$recv($ObjectMock())._new();
  13111. self._assert_($recv($recv(o)._yourself()).__eq_eq(o));
  13112. return self;
  13113. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13114. }, function($ctx1) {$ctx1.fill(self,"testYourself",{o:o},$globals.ObjectTest)});
  13115. //>>excludeEnd("ctx");
  13116. },
  13117. //>>excludeStart("ide", pragmas.excludeIdeData);
  13118. args: [],
  13119. source: "testYourself\x0a\x09| o |\x0a\x09o := ObjectMock new.\x0a\x09self assert: o yourself == o",
  13120. referencedClasses: ["ObjectMock"],
  13121. //>>excludeEnd("ide");
  13122. messageSends: ["new", "assert:", "==", "yourself"]
  13123. }),
  13124. $globals.ObjectTest);
  13125. $core.addMethod(
  13126. $core.method({
  13127. selector: "testidentityHash",
  13128. protocol: 'tests',
  13129. fn: function (){
  13130. var self=this;
  13131. var o1,o2;
  13132. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  13133. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13134. return $core.withContext(function($ctx1) {
  13135. //>>excludeEnd("ctx");
  13136. var $2,$3,$1,$5,$4;
  13137. o1=$recv($Object())._new();
  13138. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13139. $ctx1.sendIdx["new"]=1;
  13140. //>>excludeEnd("ctx");
  13141. o2=$recv($Object())._new();
  13142. $2=$recv(o1)._identityHash();
  13143. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13144. $ctx1.sendIdx["identityHash"]=1;
  13145. //>>excludeEnd("ctx");
  13146. $3=$recv(o1)._identityHash();
  13147. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13148. $ctx1.sendIdx["identityHash"]=2;
  13149. //>>excludeEnd("ctx");
  13150. $1=$recv($2).__eq_eq($3);
  13151. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13152. $ctx1.sendIdx["=="]=1;
  13153. //>>excludeEnd("ctx");
  13154. self._assert_($1);
  13155. $5=$recv(o1)._identityHash();
  13156. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13157. $ctx1.sendIdx["identityHash"]=3;
  13158. //>>excludeEnd("ctx");
  13159. $4=$recv($5).__eq_eq($recv(o2)._identityHash());
  13160. self._deny_($4);
  13161. return self;
  13162. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13163. }, function($ctx1) {$ctx1.fill(self,"testidentityHash",{o1:o1,o2:o2},$globals.ObjectTest)});
  13164. //>>excludeEnd("ctx");
  13165. },
  13166. //>>excludeStart("ide", pragmas.excludeIdeData);
  13167. args: [],
  13168. 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",
  13169. referencedClasses: ["Object"],
  13170. //>>excludeEnd("ide");
  13171. messageSends: ["new", "assert:", "==", "identityHash", "deny:"]
  13172. }),
  13173. $globals.ObjectTest);
  13174. $core.addClass('PointTest', $globals.TestCase, [], 'Kernel-Tests');
  13175. $core.addMethod(
  13176. $core.method({
  13177. selector: "testAccessing",
  13178. protocol: 'tests',
  13179. fn: function (){
  13180. var self=this;
  13181. function $Point(){return $globals.Point||(typeof Point=="undefined"?nil:Point)}
  13182. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13183. return $core.withContext(function($ctx1) {
  13184. //>>excludeEnd("ctx");
  13185. var $2,$1,$3,$6,$5,$4;
  13186. $2=$recv($Point())._x_y_((3),(4));
  13187. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13188. $ctx1.sendIdx["x:y:"]=1;
  13189. //>>excludeEnd("ctx");
  13190. $1=$recv($2)._x();
  13191. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13192. $ctx1.sendIdx["x"]=1;
  13193. //>>excludeEnd("ctx");
  13194. self._assert_equals_($1,(3));
  13195. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13196. $ctx1.sendIdx["assert:equals:"]=1;
  13197. //>>excludeEnd("ctx");
  13198. $3=$recv($recv($Point())._x_y_((3),(4)))._y();
  13199. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13200. $ctx1.sendIdx["y"]=1;
  13201. //>>excludeEnd("ctx");
  13202. self._assert_equals_($3,(4));
  13203. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13204. $ctx1.sendIdx["assert:equals:"]=2;
  13205. //>>excludeEnd("ctx");
  13206. $6=$recv($Point())._new();
  13207. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13208. $ctx1.sendIdx["new"]=1;
  13209. //>>excludeEnd("ctx");
  13210. $5=$recv($6)._x_((3));
  13211. $4=$recv($5)._x();
  13212. self._assert_equals_($4,(3));
  13213. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13214. $ctx1.sendIdx["assert:equals:"]=3;
  13215. //>>excludeEnd("ctx");
  13216. self._assert_equals_($recv($recv($recv($Point())._new())._y_((4)))._y(),(4));
  13217. return self;
  13218. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13219. }, function($ctx1) {$ctx1.fill(self,"testAccessing",{},$globals.PointTest)});
  13220. //>>excludeEnd("ctx");
  13221. },
  13222. //>>excludeStart("ide", pragmas.excludeIdeData);
  13223. args: [],
  13224. 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",
  13225. referencedClasses: ["Point"],
  13226. //>>excludeEnd("ide");
  13227. messageSends: ["assert:equals:", "x", "x:y:", "y", "x:", "new", "y:"]
  13228. }),
  13229. $globals.PointTest);
  13230. $core.addMethod(
  13231. $core.method({
  13232. selector: "testArithmetic",
  13233. protocol: 'tests',
  13234. fn: function (){
  13235. var self=this;
  13236. function $Point(){return $globals.Point||(typeof Point=="undefined"?nil:Point)}
  13237. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13238. return $core.withContext(function($ctx1) {
  13239. //>>excludeEnd("ctx");
  13240. var $2,$3,$1,$4,$6,$7,$5,$8,$10,$11,$9,$12,$14,$13;
  13241. $2=(3).__at((4));
  13242. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13243. $ctx1.sendIdx["@"]=1;
  13244. //>>excludeEnd("ctx");
  13245. $3=(3).__at((4));
  13246. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13247. $ctx1.sendIdx["@"]=2;
  13248. //>>excludeEnd("ctx");
  13249. $1=$recv($2).__star($3);
  13250. $4=$recv($Point())._x_y_((9),(16));
  13251. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13252. $ctx1.sendIdx["x:y:"]=1;
  13253. //>>excludeEnd("ctx");
  13254. self._assert_equals_($1,$4);
  13255. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13256. $ctx1.sendIdx["assert:equals:"]=1;
  13257. //>>excludeEnd("ctx");
  13258. $6=(3).__at((4));
  13259. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13260. $ctx1.sendIdx["@"]=3;
  13261. //>>excludeEnd("ctx");
  13262. $7=(3).__at((4));
  13263. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13264. $ctx1.sendIdx["@"]=4;
  13265. //>>excludeEnd("ctx");
  13266. $5=$recv($6).__plus($7);
  13267. $8=$recv($Point())._x_y_((6),(8));
  13268. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13269. $ctx1.sendIdx["x:y:"]=2;
  13270. //>>excludeEnd("ctx");
  13271. self._assert_equals_($5,$8);
  13272. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13273. $ctx1.sendIdx["assert:equals:"]=2;
  13274. //>>excludeEnd("ctx");
  13275. $10=(3).__at((4));
  13276. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13277. $ctx1.sendIdx["@"]=5;
  13278. //>>excludeEnd("ctx");
  13279. $11=(3).__at((4));
  13280. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13281. $ctx1.sendIdx["@"]=6;
  13282. //>>excludeEnd("ctx");
  13283. $9=$recv($10).__minus($11);
  13284. $12=$recv($Point())._x_y_((0),(0));
  13285. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13286. $ctx1.sendIdx["x:y:"]=3;
  13287. //>>excludeEnd("ctx");
  13288. self._assert_equals_($9,$12);
  13289. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13290. $ctx1.sendIdx["assert:equals:"]=3;
  13291. //>>excludeEnd("ctx");
  13292. $14=(6).__at((8));
  13293. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13294. $ctx1.sendIdx["@"]=7;
  13295. //>>excludeEnd("ctx");
  13296. $13=$recv($14).__slash((3).__at((4)));
  13297. self._assert_equals_($13,$recv($Point())._x_y_((2),(2)));
  13298. return self;
  13299. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13300. }, function($ctx1) {$ctx1.fill(self,"testArithmetic",{},$globals.PointTest)});
  13301. //>>excludeEnd("ctx");
  13302. },
  13303. //>>excludeStart("ide", pragmas.excludeIdeData);
  13304. args: [],
  13305. 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)",
  13306. referencedClasses: ["Point"],
  13307. //>>excludeEnd("ide");
  13308. messageSends: ["assert:equals:", "*", "@", "x:y:", "+", "-", "/"]
  13309. }),
  13310. $globals.PointTest);
  13311. $core.addMethod(
  13312. $core.method({
  13313. selector: "testAt",
  13314. protocol: 'tests',
  13315. fn: function (){
  13316. var self=this;
  13317. function $Point(){return $globals.Point||(typeof Point=="undefined"?nil:Point)}
  13318. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13319. return $core.withContext(function($ctx1) {
  13320. //>>excludeEnd("ctx");
  13321. self._assert_equals_((3).__at((4)),$recv($Point())._x_y_((3),(4)));
  13322. return self;
  13323. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13324. }, function($ctx1) {$ctx1.fill(self,"testAt",{},$globals.PointTest)});
  13325. //>>excludeEnd("ctx");
  13326. },
  13327. //>>excludeStart("ide", pragmas.excludeIdeData);
  13328. args: [],
  13329. source: "testAt\x0a\x09self assert: 3@4 equals: (Point x: 3 y: 4)",
  13330. referencedClasses: ["Point"],
  13331. //>>excludeEnd("ide");
  13332. messageSends: ["assert:equals:", "@", "x:y:"]
  13333. }),
  13334. $globals.PointTest);
  13335. $core.addMethod(
  13336. $core.method({
  13337. selector: "testComparison",
  13338. protocol: 'tests',
  13339. fn: function (){
  13340. var self=this;
  13341. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13342. return $core.withContext(function($ctx1) {
  13343. //>>excludeEnd("ctx");
  13344. var $2,$3,$1,$5,$6,$4,$8,$9,$7,$11,$12,$10,$14,$15,$13,$17,$18,$16,$20,$21,$19,$23,$22;
  13345. $2=(3).__at((4));
  13346. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13347. $ctx1.sendIdx["@"]=1;
  13348. //>>excludeEnd("ctx");
  13349. $3=(4).__at((5));
  13350. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13351. $ctx1.sendIdx["@"]=2;
  13352. //>>excludeEnd("ctx");
  13353. $1=$recv($2).__lt($3);
  13354. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13355. $ctx1.sendIdx["<"]=1;
  13356. //>>excludeEnd("ctx");
  13357. self._assert_($1);
  13358. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13359. $ctx1.sendIdx["assert:"]=1;
  13360. //>>excludeEnd("ctx");
  13361. $5=(3).__at((4));
  13362. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13363. $ctx1.sendIdx["@"]=3;
  13364. //>>excludeEnd("ctx");
  13365. $6=(4).__at((4));
  13366. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13367. $ctx1.sendIdx["@"]=4;
  13368. //>>excludeEnd("ctx");
  13369. $4=$recv($5).__lt($6);
  13370. self._deny_($4);
  13371. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13372. $ctx1.sendIdx["deny:"]=1;
  13373. //>>excludeEnd("ctx");
  13374. $8=(4).__at((5));
  13375. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13376. $ctx1.sendIdx["@"]=5;
  13377. //>>excludeEnd("ctx");
  13378. $9=(4).__at((5));
  13379. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13380. $ctx1.sendIdx["@"]=6;
  13381. //>>excludeEnd("ctx");
  13382. $7=$recv($8).__lt_eq($9);
  13383. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13384. $ctx1.sendIdx["<="]=1;
  13385. //>>excludeEnd("ctx");
  13386. self._assert_($7);
  13387. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13388. $ctx1.sendIdx["assert:"]=2;
  13389. //>>excludeEnd("ctx");
  13390. $11=(4).__at((5));
  13391. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13392. $ctx1.sendIdx["@"]=7;
  13393. //>>excludeEnd("ctx");
  13394. $12=(3).__at((5));
  13395. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13396. $ctx1.sendIdx["@"]=8;
  13397. //>>excludeEnd("ctx");
  13398. $10=$recv($11).__lt_eq($12);
  13399. self._deny_($10);
  13400. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13401. $ctx1.sendIdx["deny:"]=2;
  13402. //>>excludeEnd("ctx");
  13403. $14=(5).__at((6));
  13404. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13405. $ctx1.sendIdx["@"]=9;
  13406. //>>excludeEnd("ctx");
  13407. $15=(4).__at((5));
  13408. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13409. $ctx1.sendIdx["@"]=10;
  13410. //>>excludeEnd("ctx");
  13411. $13=$recv($14).__gt($15);
  13412. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13413. $ctx1.sendIdx[">"]=1;
  13414. //>>excludeEnd("ctx");
  13415. self._assert_($13);
  13416. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13417. $ctx1.sendIdx["assert:"]=3;
  13418. //>>excludeEnd("ctx");
  13419. $17=(5).__at((6));
  13420. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13421. $ctx1.sendIdx["@"]=11;
  13422. //>>excludeEnd("ctx");
  13423. $18=(6).__at((6));
  13424. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13425. $ctx1.sendIdx["@"]=12;
  13426. //>>excludeEnd("ctx");
  13427. $16=$recv($17).__gt($18);
  13428. self._deny_($16);
  13429. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13430. $ctx1.sendIdx["deny:"]=3;
  13431. //>>excludeEnd("ctx");
  13432. $20=(4).__at((5));
  13433. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13434. $ctx1.sendIdx["@"]=13;
  13435. //>>excludeEnd("ctx");
  13436. $21=(4).__at((5));
  13437. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13438. $ctx1.sendIdx["@"]=14;
  13439. //>>excludeEnd("ctx");
  13440. $19=$recv($20).__gt_eq($21);
  13441. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13442. $ctx1.sendIdx[">="]=1;
  13443. //>>excludeEnd("ctx");
  13444. self._assert_($19);
  13445. $23=(4).__at((5));
  13446. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13447. $ctx1.sendIdx["@"]=15;
  13448. //>>excludeEnd("ctx");
  13449. $22=$recv($23).__gt_eq((5).__at((5)));
  13450. self._deny_($22);
  13451. return self;
  13452. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13453. }, function($ctx1) {$ctx1.fill(self,"testComparison",{},$globals.PointTest)});
  13454. //>>excludeEnd("ctx");
  13455. },
  13456. //>>excludeStart("ide", pragmas.excludeIdeData);
  13457. args: [],
  13458. 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)",
  13459. referencedClasses: [],
  13460. //>>excludeEnd("ide");
  13461. messageSends: ["assert:", "<", "@", "deny:", "<=", ">", ">="]
  13462. }),
  13463. $globals.PointTest);
  13464. $core.addMethod(
  13465. $core.method({
  13466. selector: "testEgality",
  13467. protocol: 'tests',
  13468. fn: function (){
  13469. var self=this;
  13470. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13471. return $core.withContext(function($ctx1) {
  13472. //>>excludeEnd("ctx");
  13473. var $2,$3,$1,$5,$4;
  13474. $2=(3).__at((4));
  13475. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13476. $ctx1.sendIdx["@"]=1;
  13477. //>>excludeEnd("ctx");
  13478. $3=(3).__at((4));
  13479. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13480. $ctx1.sendIdx["@"]=2;
  13481. //>>excludeEnd("ctx");
  13482. $1=$recv($2).__eq($3);
  13483. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13484. $ctx1.sendIdx["="]=1;
  13485. //>>excludeEnd("ctx");
  13486. self._assert_($1);
  13487. $5=(3).__at((5));
  13488. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13489. $ctx1.sendIdx["@"]=3;
  13490. //>>excludeEnd("ctx");
  13491. $4=$recv($5).__eq((3).__at((6)));
  13492. self._deny_($4);
  13493. return self;
  13494. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13495. }, function($ctx1) {$ctx1.fill(self,"testEgality",{},$globals.PointTest)});
  13496. //>>excludeEnd("ctx");
  13497. },
  13498. //>>excludeStart("ide", pragmas.excludeIdeData);
  13499. args: [],
  13500. source: "testEgality\x0a\x09self assert: (3@4 = (3@4)).\x0a\x09self deny: 3@5 = (3@6)",
  13501. referencedClasses: [],
  13502. //>>excludeEnd("ide");
  13503. messageSends: ["assert:", "=", "@", "deny:"]
  13504. }),
  13505. $globals.PointTest);
  13506. $core.addMethod(
  13507. $core.method({
  13508. selector: "testNew",
  13509. protocol: 'tests',
  13510. fn: function (){
  13511. var self=this;
  13512. function $Point(){return $globals.Point||(typeof Point=="undefined"?nil:Point)}
  13513. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13514. return $core.withContext(function($ctx1) {
  13515. //>>excludeEnd("ctx");
  13516. var $3,$2,$1,$7,$6,$5,$4,$10,$9,$8;
  13517. $3=$recv($Point())._new();
  13518. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13519. $ctx1.sendIdx["new"]=1;
  13520. //>>excludeEnd("ctx");
  13521. $2=$recv($3)._x_((3));
  13522. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13523. $ctx1.sendIdx["x:"]=1;
  13524. //>>excludeEnd("ctx");
  13525. $1=$recv($2)._y();
  13526. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13527. $ctx1.sendIdx["y"]=1;
  13528. //>>excludeEnd("ctx");
  13529. self._assert_equals_($1,nil);
  13530. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13531. $ctx1.sendIdx["assert:equals:"]=1;
  13532. //>>excludeEnd("ctx");
  13533. $7=$recv($Point())._new();
  13534. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13535. $ctx1.sendIdx["new"]=2;
  13536. //>>excludeEnd("ctx");
  13537. $6=$recv($7)._x_((3));
  13538. $5=$recv($6)._x();
  13539. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13540. $ctx1.sendIdx["x"]=1;
  13541. //>>excludeEnd("ctx");
  13542. $4=$recv($5).__eq((0));
  13543. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13544. $ctx1.sendIdx["="]=1;
  13545. //>>excludeEnd("ctx");
  13546. self._deny_($4);
  13547. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13548. $ctx1.sendIdx["deny:"]=1;
  13549. //>>excludeEnd("ctx");
  13550. $10=$recv($Point())._new();
  13551. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13552. $ctx1.sendIdx["new"]=3;
  13553. //>>excludeEnd("ctx");
  13554. $9=$recv($10)._y_((4));
  13555. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13556. $ctx1.sendIdx["y:"]=1;
  13557. //>>excludeEnd("ctx");
  13558. $8=$recv($9)._x();
  13559. self._assert_equals_($8,nil);
  13560. self._deny_($recv($recv($recv($recv($Point())._new())._y_((4)))._y()).__eq((0)));
  13561. return self;
  13562. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13563. }, function($ctx1) {$ctx1.fill(self,"testNew",{},$globals.PointTest)});
  13564. //>>excludeEnd("ctx");
  13565. },
  13566. //>>excludeStart("ide", pragmas.excludeIdeData);
  13567. args: [],
  13568. 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",
  13569. referencedClasses: ["Point"],
  13570. //>>excludeEnd("ide");
  13571. messageSends: ["assert:equals:", "y", "x:", "new", "deny:", "=", "x", "y:"]
  13572. }),
  13573. $globals.PointTest);
  13574. $core.addMethod(
  13575. $core.method({
  13576. selector: "testTranslateBy",
  13577. protocol: 'tests',
  13578. fn: function (){
  13579. var self=this;
  13580. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13581. return $core.withContext(function($ctx1) {
  13582. //>>excludeEnd("ctx");
  13583. var $2,$3,$1,$4,$6,$8,$7,$5,$9,$11,$12,$10,$13,$15,$16,$14;
  13584. $2=(3).__at((3));
  13585. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13586. $ctx1.sendIdx["@"]=1;
  13587. //>>excludeEnd("ctx");
  13588. $3=(0).__at((1));
  13589. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13590. $ctx1.sendIdx["@"]=2;
  13591. //>>excludeEnd("ctx");
  13592. $1=$recv($2)._translateBy_($3);
  13593. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13594. $ctx1.sendIdx["translateBy:"]=1;
  13595. //>>excludeEnd("ctx");
  13596. $4=(3).__at((4));
  13597. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13598. $ctx1.sendIdx["@"]=3;
  13599. //>>excludeEnd("ctx");
  13600. self._assert_equals_($1,$4);
  13601. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13602. $ctx1.sendIdx["assert:equals:"]=1;
  13603. //>>excludeEnd("ctx");
  13604. $6=(3).__at((3));
  13605. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13606. $ctx1.sendIdx["@"]=4;
  13607. //>>excludeEnd("ctx");
  13608. $8=(1)._negated();
  13609. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13610. $ctx1.sendIdx["negated"]=1;
  13611. //>>excludeEnd("ctx");
  13612. $7=(0).__at($8);
  13613. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13614. $ctx1.sendIdx["@"]=5;
  13615. //>>excludeEnd("ctx");
  13616. $5=$recv($6)._translateBy_($7);
  13617. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13618. $ctx1.sendIdx["translateBy:"]=2;
  13619. //>>excludeEnd("ctx");
  13620. $9=(3).__at((2));
  13621. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13622. $ctx1.sendIdx["@"]=6;
  13623. //>>excludeEnd("ctx");
  13624. self._assert_equals_($5,$9);
  13625. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13626. $ctx1.sendIdx["assert:equals:"]=2;
  13627. //>>excludeEnd("ctx");
  13628. $11=(3).__at((3));
  13629. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13630. $ctx1.sendIdx["@"]=7;
  13631. //>>excludeEnd("ctx");
  13632. $12=(2).__at((3));
  13633. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13634. $ctx1.sendIdx["@"]=8;
  13635. //>>excludeEnd("ctx");
  13636. $10=$recv($11)._translateBy_($12);
  13637. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13638. $ctx1.sendIdx["translateBy:"]=3;
  13639. //>>excludeEnd("ctx");
  13640. $13=(5).__at((6));
  13641. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13642. $ctx1.sendIdx["@"]=9;
  13643. //>>excludeEnd("ctx");
  13644. self._assert_equals_($10,$13);
  13645. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13646. $ctx1.sendIdx["assert:equals:"]=3;
  13647. //>>excludeEnd("ctx");
  13648. $15=(3).__at((3));
  13649. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13650. $ctx1.sendIdx["@"]=10;
  13651. //>>excludeEnd("ctx");
  13652. $16=$recv((3)._negated()).__at((0));
  13653. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13654. $ctx1.sendIdx["@"]=11;
  13655. //>>excludeEnd("ctx");
  13656. $14=$recv($15)._translateBy_($16);
  13657. self._assert_equals_($14,(0).__at((3)));
  13658. return self;
  13659. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13660. }, function($ctx1) {$ctx1.fill(self,"testTranslateBy",{},$globals.PointTest)});
  13661. //>>excludeEnd("ctx");
  13662. },
  13663. //>>excludeStart("ide", pragmas.excludeIdeData);
  13664. args: [],
  13665. 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.",
  13666. referencedClasses: [],
  13667. //>>excludeEnd("ide");
  13668. messageSends: ["assert:equals:", "translateBy:", "@", "negated"]
  13669. }),
  13670. $globals.PointTest);
  13671. $core.addClass('QueueTest', $globals.TestCase, [], 'Kernel-Tests');
  13672. $core.addMethod(
  13673. $core.method({
  13674. selector: "testNextIfAbsent",
  13675. protocol: 'tests',
  13676. fn: function (){
  13677. var self=this;
  13678. var queue;
  13679. function $Queue(){return $globals.Queue||(typeof Queue=="undefined"?nil:Queue)}
  13680. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13681. return $core.withContext(function($ctx1) {
  13682. //>>excludeEnd("ctx");
  13683. var $2,$1;
  13684. queue=$recv($Queue())._new();
  13685. $recv(queue)._nextPut_("index1");
  13686. $2=$recv(queue)._nextIfAbsent_("empty");
  13687. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13688. $ctx1.sendIdx["nextIfAbsent:"]=1;
  13689. //>>excludeEnd("ctx");
  13690. $1=$recv($2).__eq("index1");
  13691. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13692. $ctx1.sendIdx["="]=1;
  13693. //>>excludeEnd("ctx");
  13694. self._assert_($1);
  13695. self._deny_($recv($recv(queue)._nextIfAbsent_("empty")).__eq("index1"));
  13696. return self;
  13697. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13698. }, function($ctx1) {$ctx1.fill(self,"testNextIfAbsent",{queue:queue},$globals.QueueTest)});
  13699. //>>excludeEnd("ctx");
  13700. },
  13701. //>>excludeStart("ide", pragmas.excludeIdeData);
  13702. args: [],
  13703. 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'",
  13704. referencedClasses: ["Queue"],
  13705. //>>excludeEnd("ide");
  13706. messageSends: ["new", "nextPut:", "assert:", "=", "nextIfAbsent:", "deny:"]
  13707. }),
  13708. $globals.QueueTest);
  13709. $core.addMethod(
  13710. $core.method({
  13711. selector: "testQueueNext",
  13712. protocol: 'tests',
  13713. fn: function (){
  13714. var self=this;
  13715. var queue;
  13716. function $Queue(){return $globals.Queue||(typeof Queue=="undefined"?nil:Queue)}
  13717. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  13718. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13719. return $core.withContext(function($ctx1) {
  13720. //>>excludeEnd("ctx");
  13721. var $1,$2,$4,$3,$6,$5;
  13722. queue=$recv($Queue())._new();
  13723. $1=queue;
  13724. $recv($1)._nextPut_("index1");
  13725. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13726. $ctx1.sendIdx["nextPut:"]=1;
  13727. //>>excludeEnd("ctx");
  13728. $2=$recv($1)._nextPut_("index2");
  13729. $4=$recv(queue)._next();
  13730. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13731. $ctx1.sendIdx["next"]=1;
  13732. //>>excludeEnd("ctx");
  13733. $3=$recv($4).__eq("index1");
  13734. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13735. $ctx1.sendIdx["="]=1;
  13736. //>>excludeEnd("ctx");
  13737. self._assert_($3);
  13738. $6=$recv(queue)._next();
  13739. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13740. $ctx1.sendIdx["next"]=2;
  13741. //>>excludeEnd("ctx");
  13742. $5=$recv($6).__eq("index");
  13743. self._deny_($5);
  13744. self._should_raise_((function(){
  13745. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13746. return $core.withContext(function($ctx2) {
  13747. //>>excludeEnd("ctx");
  13748. return $recv(queue)._next();
  13749. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13750. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  13751. //>>excludeEnd("ctx");
  13752. }),$Error());
  13753. return self;
  13754. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13755. }, function($ctx1) {$ctx1.fill(self,"testQueueNext",{queue:queue},$globals.QueueTest)});
  13756. //>>excludeEnd("ctx");
  13757. },
  13758. //>>excludeStart("ide", pragmas.excludeIdeData);
  13759. args: [],
  13760. 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",
  13761. referencedClasses: ["Queue", "Error"],
  13762. //>>excludeEnd("ide");
  13763. messageSends: ["new", "nextPut:", "assert:", "=", "next", "deny:", "should:raise:"]
  13764. }),
  13765. $globals.QueueTest);
  13766. $core.addClass('RandomTest', $globals.TestCase, [], 'Kernel-Tests');
  13767. $core.addMethod(
  13768. $core.method({
  13769. selector: "testAtRandomNumber",
  13770. protocol: 'tests',
  13771. fn: function (){
  13772. var self=this;
  13773. var val;
  13774. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13775. return $core.withContext(function($ctx1) {
  13776. //>>excludeEnd("ctx");
  13777. (100)._timesRepeat_((function(){
  13778. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13779. return $core.withContext(function($ctx2) {
  13780. //>>excludeEnd("ctx");
  13781. val=(10)._atRandom();
  13782. val;
  13783. self._assert_($recv(val).__gt((0)));
  13784. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13785. $ctx2.sendIdx["assert:"]=1;
  13786. //>>excludeEnd("ctx");
  13787. return self._assert_($recv(val).__lt((11)));
  13788. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13789. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  13790. //>>excludeEnd("ctx");
  13791. }));
  13792. return self;
  13793. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13794. }, function($ctx1) {$ctx1.fill(self,"testAtRandomNumber",{val:val},$globals.RandomTest)});
  13795. //>>excludeEnd("ctx");
  13796. },
  13797. //>>excludeStart("ide", pragmas.excludeIdeData);
  13798. args: [],
  13799. 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]",
  13800. referencedClasses: [],
  13801. //>>excludeEnd("ide");
  13802. messageSends: ["timesRepeat:", "atRandom", "assert:", ">", "<"]
  13803. }),
  13804. $globals.RandomTest);
  13805. $core.addMethod(
  13806. $core.method({
  13807. selector: "testAtRandomSequenceableCollection",
  13808. protocol: 'tests',
  13809. fn: function (){
  13810. var self=this;
  13811. var val;
  13812. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13813. return $core.withContext(function($ctx1) {
  13814. //>>excludeEnd("ctx");
  13815. var $3,$4,$2,$1;
  13816. (100)._timesRepeat_((function(){
  13817. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13818. return $core.withContext(function($ctx2) {
  13819. //>>excludeEnd("ctx");
  13820. val="abc"._atRandom();
  13821. val;
  13822. $3=$recv(val).__eq("a");
  13823. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13824. $ctx2.sendIdx["="]=1;
  13825. //>>excludeEnd("ctx");
  13826. $4=$recv(val).__eq("b");
  13827. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13828. $ctx2.sendIdx["="]=2;
  13829. //>>excludeEnd("ctx");
  13830. $2=$recv($3).__or($4);
  13831. $1=$recv($2).__or($recv(val).__eq("c"));
  13832. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13833. $ctx2.sendIdx["|"]=1;
  13834. //>>excludeEnd("ctx");
  13835. return self._assert_($1);
  13836. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13837. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  13838. //>>excludeEnd("ctx");
  13839. }));
  13840. return self;
  13841. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13842. }, function($ctx1) {$ctx1.fill(self,"testAtRandomSequenceableCollection",{val:val},$globals.RandomTest)});
  13843. //>>excludeEnd("ctx");
  13844. },
  13845. //>>excludeStart("ide", pragmas.excludeIdeData);
  13846. args: [],
  13847. 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].",
  13848. referencedClasses: [],
  13849. //>>excludeEnd("ide");
  13850. messageSends: ["timesRepeat:", "atRandom", "assert:", "|", "="]
  13851. }),
  13852. $globals.RandomTest);
  13853. $core.addMethod(
  13854. $core.method({
  13855. selector: "textNext",
  13856. protocol: 'tests',
  13857. fn: function (){
  13858. var self=this;
  13859. function $Random(){return $globals.Random||(typeof Random=="undefined"?nil:Random)}
  13860. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13861. return $core.withContext(function($ctx1) {
  13862. //>>excludeEnd("ctx");
  13863. var $1;
  13864. (10000)._timesRepeat_((function(){
  13865. var current,next;
  13866. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13867. return $core.withContext(function($ctx2) {
  13868. //>>excludeEnd("ctx");
  13869. next=$recv($recv($Random())._new())._next();
  13870. next;
  13871. self._assert_($recv(next).__gt_eq((0)));
  13872. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13873. $ctx2.sendIdx["assert:"]=1;
  13874. //>>excludeEnd("ctx");
  13875. self._assert_($recv(next).__lt((1)));
  13876. $1=$recv(current).__eq(next);
  13877. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13878. $ctx2.sendIdx["="]=1;
  13879. //>>excludeEnd("ctx");
  13880. self._deny_($1);
  13881. return $recv(next).__eq(current);
  13882. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13883. }, function($ctx2) {$ctx2.fillBlock({current:current,next:next},$ctx1,1)});
  13884. //>>excludeEnd("ctx");
  13885. }));
  13886. return self;
  13887. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13888. }, function($ctx1) {$ctx1.fill(self,"textNext",{},$globals.RandomTest)});
  13889. //>>excludeEnd("ctx");
  13890. },
  13891. //>>excludeStart("ide", pragmas.excludeIdeData);
  13892. args: [],
  13893. 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 ]",
  13894. referencedClasses: ["Random"],
  13895. //>>excludeEnd("ide");
  13896. messageSends: ["timesRepeat:", "next", "new", "assert:", ">=", "<", "deny:", "="]
  13897. }),
  13898. $globals.RandomTest);
  13899. $core.addClass('StreamTest', $globals.TestCase, [], 'Kernel-Tests');
  13900. $core.addMethod(
  13901. $core.method({
  13902. selector: "collectionClass",
  13903. protocol: 'accessing',
  13904. fn: function (){
  13905. var self=this;
  13906. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13907. return $core.withContext(function($ctx1) {
  13908. //>>excludeEnd("ctx");
  13909. var $1;
  13910. $1=$recv(self._class())._collectionClass();
  13911. return $1;
  13912. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13913. }, function($ctx1) {$ctx1.fill(self,"collectionClass",{},$globals.StreamTest)});
  13914. //>>excludeEnd("ctx");
  13915. },
  13916. //>>excludeStart("ide", pragmas.excludeIdeData);
  13917. args: [],
  13918. source: "collectionClass\x0a\x09^ self class collectionClass",
  13919. referencedClasses: [],
  13920. //>>excludeEnd("ide");
  13921. messageSends: ["collectionClass", "class"]
  13922. }),
  13923. $globals.StreamTest);
  13924. $core.addMethod(
  13925. $core.method({
  13926. selector: "newCollection",
  13927. protocol: 'accessing',
  13928. fn: function (){
  13929. var self=this;
  13930. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13931. return $core.withContext(function($ctx1) {
  13932. //>>excludeEnd("ctx");
  13933. var $1;
  13934. $1=$recv(self._collectionClass())._new();
  13935. return $1;
  13936. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13937. }, function($ctx1) {$ctx1.fill(self,"newCollection",{},$globals.StreamTest)});
  13938. //>>excludeEnd("ctx");
  13939. },
  13940. //>>excludeStart("ide", pragmas.excludeIdeData);
  13941. args: [],
  13942. source: "newCollection\x0a\x09^ self collectionClass new",
  13943. referencedClasses: [],
  13944. //>>excludeEnd("ide");
  13945. messageSends: ["new", "collectionClass"]
  13946. }),
  13947. $globals.StreamTest);
  13948. $core.addMethod(
  13949. $core.method({
  13950. selector: "newStream",
  13951. protocol: 'accessing',
  13952. fn: function (){
  13953. var self=this;
  13954. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13955. return $core.withContext(function($ctx1) {
  13956. //>>excludeEnd("ctx");
  13957. var $1;
  13958. $1=$recv($recv(self._collectionClass())._new())._stream();
  13959. return $1;
  13960. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13961. }, function($ctx1) {$ctx1.fill(self,"newStream",{},$globals.StreamTest)});
  13962. //>>excludeEnd("ctx");
  13963. },
  13964. //>>excludeStart("ide", pragmas.excludeIdeData);
  13965. args: [],
  13966. source: "newStream\x0a\x09^ self collectionClass new stream",
  13967. referencedClasses: [],
  13968. //>>excludeEnd("ide");
  13969. messageSends: ["stream", "new", "collectionClass"]
  13970. }),
  13971. $globals.StreamTest);
  13972. $core.addMethod(
  13973. $core.method({
  13974. selector: "testAtStartAtEnd",
  13975. protocol: 'tests',
  13976. fn: function (){
  13977. var self=this;
  13978. var stream;
  13979. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13980. return $core.withContext(function($ctx1) {
  13981. //>>excludeEnd("ctx");
  13982. var $1,$2,$3,$4;
  13983. stream=self._newStream();
  13984. $1=$recv(stream)._atStart();
  13985. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13986. $ctx1.sendIdx["atStart"]=1;
  13987. //>>excludeEnd("ctx");
  13988. self._assert_($1);
  13989. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13990. $ctx1.sendIdx["assert:"]=1;
  13991. //>>excludeEnd("ctx");
  13992. $2=$recv(stream)._atEnd();
  13993. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13994. $ctx1.sendIdx["atEnd"]=1;
  13995. //>>excludeEnd("ctx");
  13996. self._assert_($2);
  13997. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13998. $ctx1.sendIdx["assert:"]=2;
  13999. //>>excludeEnd("ctx");
  14000. $recv(stream)._nextPutAll_(self._newCollection());
  14001. $3=$recv(stream)._atEnd();
  14002. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14003. $ctx1.sendIdx["atEnd"]=2;
  14004. //>>excludeEnd("ctx");
  14005. self._assert_($3);
  14006. $4=$recv(stream)._atStart();
  14007. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14008. $ctx1.sendIdx["atStart"]=2;
  14009. //>>excludeEnd("ctx");
  14010. self._deny_($4);
  14011. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14012. $ctx1.sendIdx["deny:"]=1;
  14013. //>>excludeEnd("ctx");
  14014. $recv(stream)._position_((1));
  14015. self._deny_($recv(stream)._atEnd());
  14016. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14017. $ctx1.sendIdx["deny:"]=2;
  14018. //>>excludeEnd("ctx");
  14019. self._deny_($recv(stream)._atStart());
  14020. return self;
  14021. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14022. }, function($ctx1) {$ctx1.fill(self,"testAtStartAtEnd",{stream:stream},$globals.StreamTest)});
  14023. //>>excludeEnd("ctx");
  14024. },
  14025. //>>excludeStart("ide", pragmas.excludeIdeData);
  14026. args: [],
  14027. 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",
  14028. referencedClasses: [],
  14029. //>>excludeEnd("ide");
  14030. messageSends: ["newStream", "assert:", "atStart", "atEnd", "nextPutAll:", "newCollection", "deny:", "position:"]
  14031. }),
  14032. $globals.StreamTest);
  14033. $core.addMethod(
  14034. $core.method({
  14035. selector: "testContents",
  14036. protocol: 'tests',
  14037. fn: function (){
  14038. var self=this;
  14039. var stream;
  14040. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14041. return $core.withContext(function($ctx1) {
  14042. //>>excludeEnd("ctx");
  14043. var $1,$2;
  14044. stream=self._newStream();
  14045. $1=stream;
  14046. $2=self._newCollection();
  14047. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14048. $ctx1.sendIdx["newCollection"]=1;
  14049. //>>excludeEnd("ctx");
  14050. $recv($1)._nextPutAll_($2);
  14051. self._assert_equals_($recv(stream)._contents(),self._newCollection());
  14052. return self;
  14053. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14054. }, function($ctx1) {$ctx1.fill(self,"testContents",{stream:stream},$globals.StreamTest)});
  14055. //>>excludeEnd("ctx");
  14056. },
  14057. //>>excludeStart("ide", pragmas.excludeIdeData);
  14058. args: [],
  14059. 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",
  14060. referencedClasses: [],
  14061. //>>excludeEnd("ide");
  14062. messageSends: ["newStream", "nextPutAll:", "newCollection", "assert:equals:", "contents"]
  14063. }),
  14064. $globals.StreamTest);
  14065. $core.addMethod(
  14066. $core.method({
  14067. selector: "testIsEmpty",
  14068. protocol: 'tests',
  14069. fn: function (){
  14070. var self=this;
  14071. var stream;
  14072. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14073. return $core.withContext(function($ctx1) {
  14074. //>>excludeEnd("ctx");
  14075. var $1;
  14076. stream=self._newStream();
  14077. $1=$recv(stream)._isEmpty();
  14078. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14079. $ctx1.sendIdx["isEmpty"]=1;
  14080. //>>excludeEnd("ctx");
  14081. self._assert_($1);
  14082. $recv(stream)._nextPutAll_(self._newCollection());
  14083. self._deny_($recv(stream)._isEmpty());
  14084. return self;
  14085. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14086. }, function($ctx1) {$ctx1.fill(self,"testIsEmpty",{stream:stream},$globals.StreamTest)});
  14087. //>>excludeEnd("ctx");
  14088. },
  14089. //>>excludeStart("ide", pragmas.excludeIdeData);
  14090. args: [],
  14091. 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",
  14092. referencedClasses: [],
  14093. //>>excludeEnd("ide");
  14094. messageSends: ["newStream", "assert:", "isEmpty", "nextPutAll:", "newCollection", "deny:"]
  14095. }),
  14096. $globals.StreamTest);
  14097. $core.addMethod(
  14098. $core.method({
  14099. selector: "testPosition",
  14100. protocol: 'tests',
  14101. fn: function (){
  14102. var self=this;
  14103. var collection,stream;
  14104. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14105. return $core.withContext(function($ctx1) {
  14106. //>>excludeEnd("ctx");
  14107. var $1,$2,$3;
  14108. collection=self._newCollection();
  14109. stream=self._newStream();
  14110. $recv(stream)._nextPutAll_(collection);
  14111. $1=$recv(stream)._position();
  14112. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14113. $ctx1.sendIdx["position"]=1;
  14114. //>>excludeEnd("ctx");
  14115. self._assert_equals_($1,$recv(collection)._size());
  14116. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14117. $ctx1.sendIdx["assert:equals:"]=1;
  14118. //>>excludeEnd("ctx");
  14119. $recv(stream)._position_((0));
  14120. $2=$recv(stream)._position();
  14121. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14122. $ctx1.sendIdx["position"]=2;
  14123. //>>excludeEnd("ctx");
  14124. self._assert_equals_($2,(0));
  14125. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14126. $ctx1.sendIdx["assert:equals:"]=2;
  14127. //>>excludeEnd("ctx");
  14128. $recv(stream)._next();
  14129. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14130. $ctx1.sendIdx["next"]=1;
  14131. //>>excludeEnd("ctx");
  14132. $3=$recv(stream)._position();
  14133. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14134. $ctx1.sendIdx["position"]=3;
  14135. //>>excludeEnd("ctx");
  14136. self._assert_equals_($3,(1));
  14137. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14138. $ctx1.sendIdx["assert:equals:"]=3;
  14139. //>>excludeEnd("ctx");
  14140. $recv(stream)._next();
  14141. self._assert_equals_($recv(stream)._position(),(2));
  14142. return self;
  14143. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14144. }, function($ctx1) {$ctx1.fill(self,"testPosition",{collection:collection,stream:stream},$globals.StreamTest)});
  14145. //>>excludeEnd("ctx");
  14146. },
  14147. //>>excludeStart("ide", pragmas.excludeIdeData);
  14148. args: [],
  14149. 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",
  14150. referencedClasses: [],
  14151. //>>excludeEnd("ide");
  14152. messageSends: ["newCollection", "newStream", "nextPutAll:", "assert:equals:", "position", "size", "position:", "next"]
  14153. }),
  14154. $globals.StreamTest);
  14155. $core.addMethod(
  14156. $core.method({
  14157. selector: "testReading",
  14158. protocol: 'tests',
  14159. fn: function (){
  14160. var self=this;
  14161. var stream,collection;
  14162. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14163. return $core.withContext(function($ctx1) {
  14164. //>>excludeEnd("ctx");
  14165. var $1,$2,$3;
  14166. collection=self._newCollection();
  14167. stream=self._newStream();
  14168. $1=stream;
  14169. $recv($1)._nextPutAll_(collection);
  14170. $2=$recv($1)._position_((0));
  14171. $recv(collection)._do_((function(each){
  14172. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14173. return $core.withContext(function($ctx2) {
  14174. //>>excludeEnd("ctx");
  14175. $3=$recv(stream)._next();
  14176. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14177. $ctx2.sendIdx["next"]=1;
  14178. //>>excludeEnd("ctx");
  14179. return self._assert_equals_($3,each);
  14180. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14181. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  14182. //>>excludeEnd("ctx");
  14183. }));
  14184. self._assert_($recv($recv(stream)._next())._isNil());
  14185. return self;
  14186. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14187. }, function($ctx1) {$ctx1.fill(self,"testReading",{stream:stream,collection:collection},$globals.StreamTest)});
  14188. //>>excludeEnd("ctx");
  14189. },
  14190. //>>excludeStart("ide", pragmas.excludeIdeData);
  14191. args: [],
  14192. 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",
  14193. referencedClasses: [],
  14194. //>>excludeEnd("ide");
  14195. messageSends: ["newCollection", "newStream", "nextPutAll:", "position:", "do:", "assert:equals:", "next", "assert:", "isNil"]
  14196. }),
  14197. $globals.StreamTest);
  14198. $core.addMethod(
  14199. $core.method({
  14200. selector: "testStreamContents",
  14201. protocol: 'tests',
  14202. fn: function (){
  14203. var self=this;
  14204. return self;
  14205. },
  14206. //>>excludeStart("ide", pragmas.excludeIdeData);
  14207. args: [],
  14208. source: "testStreamContents",
  14209. referencedClasses: [],
  14210. //>>excludeEnd("ide");
  14211. messageSends: []
  14212. }),
  14213. $globals.StreamTest);
  14214. $core.addMethod(
  14215. $core.method({
  14216. selector: "testWrite",
  14217. protocol: 'tests',
  14218. fn: function (){
  14219. var self=this;
  14220. var stream,collection;
  14221. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14222. return $core.withContext(function($ctx1) {
  14223. //>>excludeEnd("ctx");
  14224. collection=self._newCollection();
  14225. stream=self._newStream();
  14226. $recv(collection)._do_((function(each){
  14227. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14228. return $core.withContext(function($ctx2) {
  14229. //>>excludeEnd("ctx");
  14230. return $recv(stream).__lt_lt(each);
  14231. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14232. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  14233. //>>excludeEnd("ctx");
  14234. }));
  14235. self._assert_equals_($recv(stream)._contents(),collection);
  14236. return self;
  14237. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14238. }, function($ctx1) {$ctx1.fill(self,"testWrite",{stream:stream,collection:collection},$globals.StreamTest)});
  14239. //>>excludeEnd("ctx");
  14240. },
  14241. //>>excludeStart("ide", pragmas.excludeIdeData);
  14242. args: [],
  14243. 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",
  14244. referencedClasses: [],
  14245. //>>excludeEnd("ide");
  14246. messageSends: ["newCollection", "newStream", "do:", "<<", "assert:equals:", "contents"]
  14247. }),
  14248. $globals.StreamTest);
  14249. $core.addMethod(
  14250. $core.method({
  14251. selector: "testWriting",
  14252. protocol: 'tests',
  14253. fn: function (){
  14254. var self=this;
  14255. var stream,collection;
  14256. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14257. return $core.withContext(function($ctx1) {
  14258. //>>excludeEnd("ctx");
  14259. var $1;
  14260. collection=self._newCollection();
  14261. stream=self._newStream();
  14262. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14263. $ctx1.sendIdx["newStream"]=1;
  14264. //>>excludeEnd("ctx");
  14265. $recv(collection)._do_((function(each){
  14266. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14267. return $core.withContext(function($ctx2) {
  14268. //>>excludeEnd("ctx");
  14269. return $recv(stream)._nextPut_(each);
  14270. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14271. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  14272. //>>excludeEnd("ctx");
  14273. }));
  14274. $1=$recv(stream)._contents();
  14275. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14276. $ctx1.sendIdx["contents"]=1;
  14277. //>>excludeEnd("ctx");
  14278. self._assert_equals_($1,collection);
  14279. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14280. $ctx1.sendIdx["assert:equals:"]=1;
  14281. //>>excludeEnd("ctx");
  14282. stream=self._newStream();
  14283. $recv(stream)._nextPutAll_(collection);
  14284. self._assert_equals_($recv(stream)._contents(),collection);
  14285. return self;
  14286. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14287. }, function($ctx1) {$ctx1.fill(self,"testWriting",{stream:stream,collection:collection},$globals.StreamTest)});
  14288. //>>excludeEnd("ctx");
  14289. },
  14290. //>>excludeStart("ide", pragmas.excludeIdeData);
  14291. args: [],
  14292. 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",
  14293. referencedClasses: [],
  14294. //>>excludeEnd("ide");
  14295. messageSends: ["newCollection", "newStream", "do:", "nextPut:", "assert:equals:", "contents", "nextPutAll:"]
  14296. }),
  14297. $globals.StreamTest);
  14298. $core.addMethod(
  14299. $core.method({
  14300. selector: "collectionClass",
  14301. protocol: 'accessing',
  14302. fn: function (){
  14303. var self=this;
  14304. return nil;
  14305. },
  14306. //>>excludeStart("ide", pragmas.excludeIdeData);
  14307. args: [],
  14308. source: "collectionClass\x0a\x09^ nil",
  14309. referencedClasses: [],
  14310. //>>excludeEnd("ide");
  14311. messageSends: []
  14312. }),
  14313. $globals.StreamTest.klass);
  14314. $core.addMethod(
  14315. $core.method({
  14316. selector: "isAbstract",
  14317. protocol: 'testing',
  14318. fn: function (){
  14319. var self=this;
  14320. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14321. return $core.withContext(function($ctx1) {
  14322. //>>excludeEnd("ctx");
  14323. var $1;
  14324. $1=$recv(self._collectionClass())._isNil();
  14325. return $1;
  14326. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14327. }, function($ctx1) {$ctx1.fill(self,"isAbstract",{},$globals.StreamTest.klass)});
  14328. //>>excludeEnd("ctx");
  14329. },
  14330. //>>excludeStart("ide", pragmas.excludeIdeData);
  14331. args: [],
  14332. source: "isAbstract\x0a\x09^ self collectionClass isNil",
  14333. referencedClasses: [],
  14334. //>>excludeEnd("ide");
  14335. messageSends: ["isNil", "collectionClass"]
  14336. }),
  14337. $globals.StreamTest.klass);
  14338. $core.addClass('ArrayStreamTest', $globals.StreamTest, [], 'Kernel-Tests');
  14339. $core.addMethod(
  14340. $core.method({
  14341. selector: "newCollection",
  14342. protocol: 'accessing',
  14343. fn: function (){
  14344. var self=this;
  14345. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14346. return $core.withContext(function($ctx1) {
  14347. //>>excludeEnd("ctx");
  14348. var $1;
  14349. $1=[true,(1),(3).__at((4)),"foo"];
  14350. return $1;
  14351. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14352. }, function($ctx1) {$ctx1.fill(self,"newCollection",{},$globals.ArrayStreamTest)});
  14353. //>>excludeEnd("ctx");
  14354. },
  14355. //>>excludeStart("ide", pragmas.excludeIdeData);
  14356. args: [],
  14357. source: "newCollection\x0a\x09^ { true. 1. 3@4. 'foo' }",
  14358. referencedClasses: [],
  14359. //>>excludeEnd("ide");
  14360. messageSends: ["@"]
  14361. }),
  14362. $globals.ArrayStreamTest);
  14363. $core.addMethod(
  14364. $core.method({
  14365. selector: "collectionClass",
  14366. protocol: 'accessing',
  14367. fn: function (){
  14368. var self=this;
  14369. function $Array(){return $globals.Array||(typeof Array=="undefined"?nil:Array)}
  14370. return $Array();
  14371. },
  14372. //>>excludeStart("ide", pragmas.excludeIdeData);
  14373. args: [],
  14374. source: "collectionClass\x0a\x09^ Array",
  14375. referencedClasses: ["Array"],
  14376. //>>excludeEnd("ide");
  14377. messageSends: []
  14378. }),
  14379. $globals.ArrayStreamTest.klass);
  14380. $core.addClass('StringStreamTest', $globals.StreamTest, [], 'Kernel-Tests');
  14381. $core.addMethod(
  14382. $core.method({
  14383. selector: "newCollection",
  14384. protocol: 'accessing',
  14385. fn: function (){
  14386. var self=this;
  14387. return "hello world";
  14388. },
  14389. //>>excludeStart("ide", pragmas.excludeIdeData);
  14390. args: [],
  14391. source: "newCollection\x0a\x09^ 'hello world'",
  14392. referencedClasses: [],
  14393. //>>excludeEnd("ide");
  14394. messageSends: []
  14395. }),
  14396. $globals.StringStreamTest);
  14397. $core.addMethod(
  14398. $core.method({
  14399. selector: "collectionClass",
  14400. protocol: 'accessing',
  14401. fn: function (){
  14402. var self=this;
  14403. function $String(){return $globals.String||(typeof String=="undefined"?nil:String)}
  14404. return $String();
  14405. },
  14406. //>>excludeStart("ide", pragmas.excludeIdeData);
  14407. args: [],
  14408. source: "collectionClass\x0a\x09^ String",
  14409. referencedClasses: ["String"],
  14410. //>>excludeEnd("ide");
  14411. messageSends: []
  14412. }),
  14413. $globals.StringStreamTest.klass);
  14414. $core.addClass('UndefinedTest', $globals.TestCase, [], 'Kernel-Tests');
  14415. $core.addMethod(
  14416. $core.method({
  14417. selector: "testCopying",
  14418. protocol: 'tests',
  14419. fn: function (){
  14420. var self=this;
  14421. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14422. return $core.withContext(function($ctx1) {
  14423. //>>excludeEnd("ctx");
  14424. self._assert_equals_(nil._copy(),nil);
  14425. return self;
  14426. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14427. }, function($ctx1) {$ctx1.fill(self,"testCopying",{},$globals.UndefinedTest)});
  14428. //>>excludeEnd("ctx");
  14429. },
  14430. //>>excludeStart("ide", pragmas.excludeIdeData);
  14431. args: [],
  14432. source: "testCopying\x0a\x09self assert: nil copy equals: nil",
  14433. referencedClasses: [],
  14434. //>>excludeEnd("ide");
  14435. messageSends: ["assert:equals:", "copy"]
  14436. }),
  14437. $globals.UndefinedTest);
  14438. $core.addMethod(
  14439. $core.method({
  14440. selector: "testDeepCopy",
  14441. protocol: 'tests',
  14442. fn: function (){
  14443. var self=this;
  14444. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14445. return $core.withContext(function($ctx1) {
  14446. //>>excludeEnd("ctx");
  14447. self._assert_($recv(nil._deepCopy()).__eq(nil));
  14448. return self;
  14449. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14450. }, function($ctx1) {$ctx1.fill(self,"testDeepCopy",{},$globals.UndefinedTest)});
  14451. //>>excludeEnd("ctx");
  14452. },
  14453. //>>excludeStart("ide", pragmas.excludeIdeData);
  14454. args: [],
  14455. source: "testDeepCopy\x0a\x09self assert: nil deepCopy = nil",
  14456. referencedClasses: [],
  14457. //>>excludeEnd("ide");
  14458. messageSends: ["assert:", "=", "deepCopy"]
  14459. }),
  14460. $globals.UndefinedTest);
  14461. $core.addMethod(
  14462. $core.method({
  14463. selector: "testIfNil",
  14464. protocol: 'tests',
  14465. fn: function (){
  14466. var self=this;
  14467. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14468. return $core.withContext(function($ctx1) {
  14469. //>>excludeEnd("ctx");
  14470. var $1,$3,$2,$4,$6,$5,$receiver;
  14471. if(($receiver = nil) == null || $receiver.isNil){
  14472. $1=true;
  14473. } else {
  14474. $1=nil;
  14475. };
  14476. self._assert_equals_($1,true);
  14477. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14478. $ctx1.sendIdx["assert:equals:"]=1;
  14479. //>>excludeEnd("ctx");
  14480. if(($receiver = nil) == null || $receiver.isNil){
  14481. $3=nil;
  14482. } else {
  14483. $3=true;
  14484. };
  14485. $2=$recv($3).__eq(true);
  14486. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14487. $ctx1.sendIdx["="]=1;
  14488. //>>excludeEnd("ctx");
  14489. self._deny_($2);
  14490. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14491. $ctx1.sendIdx["deny:"]=1;
  14492. //>>excludeEnd("ctx");
  14493. if(($receiver = nil) == null || $receiver.isNil){
  14494. $4=true;
  14495. } else {
  14496. $4=false;
  14497. };
  14498. self._assert_equals_($4,true);
  14499. if(($receiver = nil) == null || $receiver.isNil){
  14500. $6=false;
  14501. } else {
  14502. $6=true;
  14503. };
  14504. $5=$recv($6).__eq(true);
  14505. self._deny_($5);
  14506. return self;
  14507. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14508. }, function($ctx1) {$ctx1.fill(self,"testIfNil",{},$globals.UndefinedTest)});
  14509. //>>excludeEnd("ctx");
  14510. },
  14511. //>>excludeStart("ide", pragmas.excludeIdeData);
  14512. args: [],
  14513. 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",
  14514. referencedClasses: [],
  14515. //>>excludeEnd("ide");
  14516. messageSends: ["assert:equals:", "ifNil:", "deny:", "=", "ifNotNil:", "ifNil:ifNotNil:", "ifNotNil:ifNil:"]
  14517. }),
  14518. $globals.UndefinedTest);
  14519. $core.addMethod(
  14520. $core.method({
  14521. selector: "testIsNil",
  14522. protocol: 'tests',
  14523. fn: function (){
  14524. var self=this;
  14525. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14526. return $core.withContext(function($ctx1) {
  14527. //>>excludeEnd("ctx");
  14528. self._assert_(nil._isNil());
  14529. self._deny_(nil._notNil());
  14530. return self;
  14531. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14532. }, function($ctx1) {$ctx1.fill(self,"testIsNil",{},$globals.UndefinedTest)});
  14533. //>>excludeEnd("ctx");
  14534. },
  14535. //>>excludeStart("ide", pragmas.excludeIdeData);
  14536. args: [],
  14537. source: "testIsNil\x0a\x09self assert: nil isNil.\x0a\x09self deny: nil notNil.",
  14538. referencedClasses: [],
  14539. //>>excludeEnd("ide");
  14540. messageSends: ["assert:", "isNil", "deny:", "notNil"]
  14541. }),
  14542. $globals.UndefinedTest);
  14543. });