2
0

Kernel-Tests.js 542 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471
  1. define("amber_core/Kernel-Tests", ["amber/boot", "amber_core/SUnit", "amber_core/Kernel-Objects"], function($boot){"use strict";
  2. var $core=$boot.api,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
  3. $core.addPackage('Kernel-Tests');
  4. $core.packages["Kernel-Tests"].innerEval = function (expr) { return eval(expr); };
  5. $core.packages["Kernel-Tests"].transport = {"type":"amd","amdNamespace":"amber_core"};
  6. $core.addClass('AnnouncementSubscriptionTest', $globals.TestCase, [], 'Kernel-Tests');
  7. $core.addMethod(
  8. $core.method({
  9. selector: "testAddExtensionMethod",
  10. protocol: 'tests',
  11. fn: function (){
  12. var self=this;
  13. var method,dirty;
  14. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  15. return $core.withContext(function($ctx1) {
  16. //>>excludeEnd("ctx");
  17. var $2,$1,$4,$3,$5,$8,$7,$6,$9,$10;
  18. $2=self._class();
  19. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  20. $ctx1.sendIdx["class"]=1;
  21. //>>excludeEnd("ctx");
  22. $1=$recv($2)._package();
  23. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  24. $ctx1.sendIdx["package"]=1;
  25. //>>excludeEnd("ctx");
  26. dirty=$recv($1)._isDirty();
  27. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  28. $ctx1.sendIdx["isDirty"]=1;
  29. //>>excludeEnd("ctx");
  30. $4=self._class();
  31. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  32. $ctx1.sendIdx["class"]=2;
  33. //>>excludeEnd("ctx");
  34. $3=$recv($4)._package();
  35. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  36. $ctx1.sendIdx["package"]=2;
  37. //>>excludeEnd("ctx");
  38. $recv($3)._beClean();
  39. $5=self._class();
  40. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  41. $ctx1.sendIdx["class"]=3;
  42. //>>excludeEnd("ctx");
  43. method=$recv($5)._compile_protocol_("doNothing","**not-a-package");
  44. $8=self._class();
  45. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  46. $ctx1.sendIdx["class"]=4;
  47. //>>excludeEnd("ctx");
  48. $7=$recv($8)._package();
  49. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  50. $ctx1.sendIdx["package"]=3;
  51. //>>excludeEnd("ctx");
  52. $6=$recv($7)._isDirty();
  53. self._deny_($6);
  54. $9=self._class();
  55. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  56. $ctx1.sendIdx["class"]=5;
  57. //>>excludeEnd("ctx");
  58. $recv($9)._removeCompiledMethod_(method);
  59. $10=dirty;
  60. if($core.assert($10)){
  61. $recv($recv(self._class())._package())._beDirty();
  62. };
  63. return self;
  64. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  65. }, function($ctx1) {$ctx1.fill(self,"testAddExtensionMethod",{method:method,dirty:dirty},$globals.AnnouncementSubscriptionTest)});
  66. //>>excludeEnd("ctx");
  67. },
  68. //>>excludeStart("ide", pragmas.excludeIdeData);
  69. args: [],
  70. source: "testAddExtensionMethod\x0a\x09| method dirty |\x0a\x09dirty := self class package isDirty.\x0a\x09self class package beClean.\x0a\x09method := self class compile: 'doNothing' protocol: '**not-a-package'.\x0a\x09self deny: self class package isDirty.\x0a\x09\x0a\x09self class removeCompiledMethod: method.\x0a\x09dirty ifTrue: [ self class package beDirty ]",
  71. referencedClasses: [],
  72. //>>excludeEnd("ide");
  73. messageSends: ["isDirty", "package", "class", "beClean", "compile:protocol:", "deny:", "removeCompiledMethod:", "ifTrue:", "beDirty"]
  74. }),
  75. $globals.AnnouncementSubscriptionTest);
  76. $core.addMethod(
  77. $core.method({
  78. selector: "testHandlesAnnouncement",
  79. protocol: 'tests',
  80. fn: function (){
  81. var self=this;
  82. var subscription,announcementClass1,announcementClass2,classBuilder;
  83. 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: "localReturnOnDoCatch",
  315. protocol: 'fixture',
  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. var $early={};
  323. try {
  324. $recv((function(){
  325. throw $early=[(2)];
  326. }))._on_do_($Error(),(function(){
  327. }));
  328. return (3);
  329. }
  330. catch(e) {if(e===$early)return e[0]; throw e}
  331. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  332. }, function($ctx1) {$ctx1.fill(self,"localReturnOnDoCatch",{},$globals.BlockClosureTest)});
  333. //>>excludeEnd("ctx");
  334. },
  335. //>>excludeStart("ide", pragmas.excludeIdeData);
  336. args: [],
  337. source: "localReturnOnDoCatch\x0a [ ^ 2 ] on: Error do: [].\x0a ^ 3",
  338. referencedClasses: ["Error"],
  339. //>>excludeEnd("ide");
  340. messageSends: ["on:do:"]
  341. }),
  342. $globals.BlockClosureTest);
  343. $core.addMethod(
  344. $core.method({
  345. selector: "localReturnOnDoMiss",
  346. protocol: 'fixture',
  347. fn: function (){
  348. var self=this;
  349. function $Class(){return $globals.Class||(typeof Class=="undefined"?nil:Class)}
  350. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  351. return $core.withContext(function($ctx1) {
  352. //>>excludeEnd("ctx");
  353. var $early={};
  354. try {
  355. $recv((function(){
  356. throw $early=[(2)];
  357. }))._on_do_($Class(),(function(){
  358. }));
  359. return (3);
  360. }
  361. catch(e) {if(e===$early)return e[0]; throw e}
  362. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  363. }, function($ctx1) {$ctx1.fill(self,"localReturnOnDoMiss",{},$globals.BlockClosureTest)});
  364. //>>excludeEnd("ctx");
  365. },
  366. //>>excludeStart("ide", pragmas.excludeIdeData);
  367. args: [],
  368. source: "localReturnOnDoMiss\x0a [ ^ 2 ] on: Class do: [].\x0a ^ 3",
  369. referencedClasses: ["Class"],
  370. //>>excludeEnd("ide");
  371. messageSends: ["on:do:"]
  372. }),
  373. $globals.BlockClosureTest);
  374. $core.addMethod(
  375. $core.method({
  376. selector: "testCanClearInterval",
  377. protocol: 'tests',
  378. fn: function (){
  379. var self=this;
  380. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  381. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  382. return $core.withContext(function($ctx1) {
  383. //>>excludeEnd("ctx");
  384. self._shouldnt_raise_((function(){
  385. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  386. return $core.withContext(function($ctx2) {
  387. //>>excludeEnd("ctx");
  388. return $recv($recv((function(){
  389. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  390. return $core.withContext(function($ctx3) {
  391. //>>excludeEnd("ctx");
  392. return $recv($recv($Error())._new())._signal();
  393. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  394. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  395. //>>excludeEnd("ctx");
  396. }))._valueWithInterval_((0)))._clearInterval();
  397. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  398. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  399. //>>excludeEnd("ctx");
  400. }),$Error());
  401. return self;
  402. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  403. }, function($ctx1) {$ctx1.fill(self,"testCanClearInterval",{},$globals.BlockClosureTest)});
  404. //>>excludeEnd("ctx");
  405. },
  406. //>>excludeStart("ide", pragmas.excludeIdeData);
  407. args: [],
  408. source: "testCanClearInterval\x0a\x09self shouldnt: [ ([ Error new signal ] valueWithInterval: 0) clearInterval ] raise: Error",
  409. referencedClasses: ["Error"],
  410. //>>excludeEnd("ide");
  411. messageSends: ["shouldnt:raise:", "clearInterval", "valueWithInterval:", "signal", "new"]
  412. }),
  413. $globals.BlockClosureTest);
  414. $core.addMethod(
  415. $core.method({
  416. selector: "testCanClearTimeout",
  417. protocol: 'tests',
  418. fn: function (){
  419. var self=this;
  420. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  421. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  422. return $core.withContext(function($ctx1) {
  423. //>>excludeEnd("ctx");
  424. self._shouldnt_raise_((function(){
  425. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  426. return $core.withContext(function($ctx2) {
  427. //>>excludeEnd("ctx");
  428. return $recv($recv((function(){
  429. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  430. return $core.withContext(function($ctx3) {
  431. //>>excludeEnd("ctx");
  432. return $recv($recv($Error())._new())._signal();
  433. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  434. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  435. //>>excludeEnd("ctx");
  436. }))._valueWithTimeout_((0)))._clearTimeout();
  437. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  438. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  439. //>>excludeEnd("ctx");
  440. }),$Error());
  441. return self;
  442. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  443. }, function($ctx1) {$ctx1.fill(self,"testCanClearTimeout",{},$globals.BlockClosureTest)});
  444. //>>excludeEnd("ctx");
  445. },
  446. //>>excludeStart("ide", pragmas.excludeIdeData);
  447. args: [],
  448. source: "testCanClearTimeout\x0a\x09self shouldnt: [ ([ Error new signal ] valueWithTimeout: 0) clearTimeout ] raise: Error",
  449. referencedClasses: ["Error"],
  450. //>>excludeEnd("ide");
  451. messageSends: ["shouldnt:raise:", "clearTimeout", "valueWithTimeout:", "signal", "new"]
  452. }),
  453. $globals.BlockClosureTest);
  454. $core.addMethod(
  455. $core.method({
  456. selector: "testCompiledSource",
  457. protocol: 'tests',
  458. fn: function (){
  459. var self=this;
  460. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  461. return $core.withContext(function($ctx1) {
  462. //>>excludeEnd("ctx");
  463. self._assert_($recv($recv((function(){
  464. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  465. return $core.withContext(function($ctx2) {
  466. //>>excludeEnd("ctx");
  467. return (1).__plus((1));
  468. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  469. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  470. //>>excludeEnd("ctx");
  471. }))._compiledSource())._includesSubString_("function"));
  472. return self;
  473. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  474. }, function($ctx1) {$ctx1.fill(self,"testCompiledSource",{},$globals.BlockClosureTest)});
  475. //>>excludeEnd("ctx");
  476. },
  477. //>>excludeStart("ide", pragmas.excludeIdeData);
  478. args: [],
  479. source: "testCompiledSource\x0a\x09self assert: ([ 1+1 ] compiledSource includesSubString: 'function')",
  480. referencedClasses: [],
  481. //>>excludeEnd("ide");
  482. messageSends: ["assert:", "includesSubString:", "compiledSource", "+"]
  483. }),
  484. $globals.BlockClosureTest);
  485. $core.addMethod(
  486. $core.method({
  487. selector: "testCurrySelf",
  488. protocol: 'tests',
  489. fn: function (){
  490. var self=this;
  491. var curriedMethod,array;
  492. function $ClassBuilder(){return $globals.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  493. function $Array(){return $globals.Array||(typeof Array=="undefined"?nil:Array)}
  494. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  495. return $core.withContext(function($ctx1) {
  496. //>>excludeEnd("ctx");
  497. curriedMethod=$recv($recv((function(selfarg,x){
  498. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  499. return $core.withContext(function($ctx2) {
  500. //>>excludeEnd("ctx");
  501. return $recv(selfarg)._at_(x);
  502. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  503. }, function($ctx2) {$ctx2.fillBlock({selfarg:selfarg,x:x},$ctx1,1)});
  504. //>>excludeEnd("ctx");
  505. }))._currySelf())._asCompiledMethod_("foo:");
  506. array=[(3), (1), (4)];
  507. $recv($recv($ClassBuilder())._new())._installMethod_forClass_protocol_(curriedMethod,$Array(),"**test helper");
  508. $recv((function(){
  509. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  510. return $core.withContext(function($ctx2) {
  511. //>>excludeEnd("ctx");
  512. return self._assert_equals_($recv(array)._foo_((2)),(1));
  513. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  514. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  515. //>>excludeEnd("ctx");
  516. }))._ensure_((function(){
  517. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  518. return $core.withContext(function($ctx2) {
  519. //>>excludeEnd("ctx");
  520. return $recv($Array())._removeCompiledMethod_(curriedMethod);
  521. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  522. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  523. //>>excludeEnd("ctx");
  524. }));
  525. return self;
  526. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  527. }, function($ctx1) {$ctx1.fill(self,"testCurrySelf",{curriedMethod:curriedMethod,array:array},$globals.BlockClosureTest)});
  528. //>>excludeEnd("ctx");
  529. },
  530. //>>excludeStart("ide", pragmas.excludeIdeData);
  531. args: [],
  532. 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 ]",
  533. referencedClasses: ["ClassBuilder", "Array"],
  534. //>>excludeEnd("ide");
  535. messageSends: ["asCompiledMethod:", "currySelf", "at:", "installMethod:forClass:protocol:", "new", "ensure:", "assert:equals:", "foo:", "removeCompiledMethod:"]
  536. }),
  537. $globals.BlockClosureTest);
  538. $core.addMethod(
  539. $core.method({
  540. selector: "testEnsure",
  541. protocol: 'tests',
  542. fn: function (){
  543. var self=this;
  544. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  545. return $core.withContext(function($ctx1) {
  546. //>>excludeEnd("ctx");
  547. self._assert_equals_($recv((function(){
  548. return (3);
  549. }))._ensure_((function(){
  550. return (4);
  551. })),(3));
  552. return self;
  553. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  554. }, function($ctx1) {$ctx1.fill(self,"testEnsure",{},$globals.BlockClosureTest)});
  555. //>>excludeEnd("ctx");
  556. },
  557. //>>excludeStart("ide", pragmas.excludeIdeData);
  558. args: [],
  559. source: "testEnsure\x0a\x09self assert: ([ 3 ] ensure: [ 4 ]) equals: 3",
  560. referencedClasses: [],
  561. //>>excludeEnd("ide");
  562. messageSends: ["assert:equals:", "ensure:"]
  563. }),
  564. $globals.BlockClosureTest);
  565. $core.addMethod(
  566. $core.method({
  567. selector: "testEnsureRaises",
  568. protocol: 'tests',
  569. fn: function (){
  570. var self=this;
  571. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  572. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  573. return $core.withContext(function($ctx1) {
  574. //>>excludeEnd("ctx");
  575. self._should_raise_((function(){
  576. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  577. return $core.withContext(function($ctx2) {
  578. //>>excludeEnd("ctx");
  579. return $recv((function(){
  580. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  581. return $core.withContext(function($ctx3) {
  582. //>>excludeEnd("ctx");
  583. return $recv($recv($Error())._new())._signal();
  584. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  585. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  586. //>>excludeEnd("ctx");
  587. }))._ensure_((function(){
  588. return true;
  589. }));
  590. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  591. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  592. //>>excludeEnd("ctx");
  593. }),$Error());
  594. return self;
  595. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  596. }, function($ctx1) {$ctx1.fill(self,"testEnsureRaises",{},$globals.BlockClosureTest)});
  597. //>>excludeEnd("ctx");
  598. },
  599. //>>excludeStart("ide", pragmas.excludeIdeData);
  600. args: [],
  601. source: "testEnsureRaises\x0a\x09self should: [ [Error new signal ] ensure: [ true ]] raise: Error",
  602. referencedClasses: ["Error"],
  603. //>>excludeEnd("ide");
  604. messageSends: ["should:raise:", "ensure:", "signal", "new"]
  605. }),
  606. $globals.BlockClosureTest);
  607. $core.addMethod(
  608. $core.method({
  609. selector: "testExceptionSemantics",
  610. protocol: 'tests',
  611. fn: function (){
  612. var self=this;
  613. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  614. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  615. return $core.withContext(function($ctx1) {
  616. //>>excludeEnd("ctx");
  617. self._timeout_((100));
  618. $recv(self._async_((function(){
  619. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  620. return $core.withContext(function($ctx2) {
  621. //>>excludeEnd("ctx");
  622. return $recv((function(){
  623. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  624. return $core.withContext(function($ctx3) {
  625. //>>excludeEnd("ctx");
  626. self._assert_(true);
  627. $recv($Error())._signal();
  628. self._deny_(true);
  629. return self._finished();
  630. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  631. $ctx3.sendIdx["finished"]=1;
  632. //>>excludeEnd("ctx");
  633. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  634. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  635. //>>excludeEnd("ctx");
  636. }))._on_do_($Error(),(function(ex){
  637. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  638. return $core.withContext(function($ctx3) {
  639. //>>excludeEnd("ctx");
  640. return self._finished();
  641. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  642. }, function($ctx3) {$ctx3.fillBlock({ex:ex},$ctx2,3)});
  643. //>>excludeEnd("ctx");
  644. }));
  645. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  646. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  647. //>>excludeEnd("ctx");
  648. })))._valueWithTimeout_((0));
  649. return self;
  650. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  651. }, function($ctx1) {$ctx1.fill(self,"testExceptionSemantics",{},$globals.BlockClosureTest)});
  652. //>>excludeEnd("ctx");
  653. },
  654. //>>excludeStart("ide", pragmas.excludeIdeData);
  655. args: [],
  656. 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",
  657. referencedClasses: ["Error"],
  658. //>>excludeEnd("ide");
  659. messageSends: ["timeout:", "valueWithTimeout:", "async:", "on:do:", "assert:", "signal", "deny:", "finished"]
  660. }),
  661. $globals.BlockClosureTest);
  662. $core.addMethod(
  663. $core.method({
  664. selector: "testLocalReturnOnDoCatch",
  665. protocol: 'tests',
  666. fn: function (){
  667. var self=this;
  668. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  669. return $core.withContext(function($ctx1) {
  670. //>>excludeEnd("ctx");
  671. self._assert_equals_(self._localReturnOnDoCatch(),(2));
  672. return self;
  673. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  674. }, function($ctx1) {$ctx1.fill(self,"testLocalReturnOnDoCatch",{},$globals.BlockClosureTest)});
  675. //>>excludeEnd("ctx");
  676. },
  677. //>>excludeStart("ide", pragmas.excludeIdeData);
  678. args: [],
  679. source: "testLocalReturnOnDoCatch\x0a\x09self assert: self localReturnOnDoCatch equals: 2",
  680. referencedClasses: [],
  681. //>>excludeEnd("ide");
  682. messageSends: ["assert:equals:", "localReturnOnDoCatch"]
  683. }),
  684. $globals.BlockClosureTest);
  685. $core.addMethod(
  686. $core.method({
  687. selector: "testLocalReturnOnDoMiss",
  688. protocol: 'tests',
  689. fn: function (){
  690. var self=this;
  691. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  692. return $core.withContext(function($ctx1) {
  693. //>>excludeEnd("ctx");
  694. self._assert_equals_(self._localReturnOnDoMiss(),(2));
  695. return self;
  696. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  697. }, function($ctx1) {$ctx1.fill(self,"testLocalReturnOnDoMiss",{},$globals.BlockClosureTest)});
  698. //>>excludeEnd("ctx");
  699. },
  700. //>>excludeStart("ide", pragmas.excludeIdeData);
  701. args: [],
  702. source: "testLocalReturnOnDoMiss\x0a\x09self assert: self localReturnOnDoMiss equals: 2",
  703. referencedClasses: [],
  704. //>>excludeEnd("ide");
  705. messageSends: ["assert:equals:", "localReturnOnDoMiss"]
  706. }),
  707. $globals.BlockClosureTest);
  708. $core.addMethod(
  709. $core.method({
  710. selector: "testNewWithValues",
  711. protocol: 'tests',
  712. fn: function (){
  713. var self=this;
  714. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  715. return $core.withContext(function($ctx1) {
  716. //>>excludeEnd("ctx");
  717. function TestConstructor(arg1, arg2, arg3) {}
  718. TestConstructor.prototype.name = 'theTestPrototype';
  719. var wrappedConstructor = $recv(TestConstructor);
  720. var result = wrappedConstructor._newWithValues_([1, 2, 3 ]);
  721. self._assert_(result instanceof TestConstructor);
  722. self._assert_equals_(result.name, 'theTestPrototype');
  723. "newWithValues: cannot help if the argument list is wrong, and should warn that a mistake was made."
  724. self._should_raise_(function () {wrappedConstructor._newWithValues_('single argument');}, $globals.Error);;
  725. return self;
  726. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  727. }, function($ctx1) {$ctx1.fill(self,"testNewWithValues",{},$globals.BlockClosureTest)});
  728. //>>excludeEnd("ctx");
  729. },
  730. //>>excludeStart("ide", pragmas.excludeIdeData);
  731. args: [],
  732. 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>",
  733. referencedClasses: [],
  734. //>>excludeEnd("ide");
  735. messageSends: []
  736. }),
  737. $globals.BlockClosureTest);
  738. $core.addMethod(
  739. $core.method({
  740. selector: "testNumArgs",
  741. protocol: 'tests',
  742. fn: function (){
  743. var self=this;
  744. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  745. return $core.withContext(function($ctx1) {
  746. //>>excludeEnd("ctx");
  747. var $1;
  748. $1=$recv((function(){
  749. }))._numArgs();
  750. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  751. $ctx1.sendIdx["numArgs"]=1;
  752. //>>excludeEnd("ctx");
  753. self._assert_equals_($1,(0));
  754. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  755. $ctx1.sendIdx["assert:equals:"]=1;
  756. //>>excludeEnd("ctx");
  757. self._assert_equals_($recv((function(a,b){
  758. }))._numArgs(),(2));
  759. return self;
  760. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  761. }, function($ctx1) {$ctx1.fill(self,"testNumArgs",{},$globals.BlockClosureTest)});
  762. //>>excludeEnd("ctx");
  763. },
  764. //>>excludeStart("ide", pragmas.excludeIdeData);
  765. args: [],
  766. source: "testNumArgs\x0a\x09self assert: [] numArgs equals: 0.\x0a\x09self assert: [ :a :b | ] numArgs equals: 2",
  767. referencedClasses: [],
  768. //>>excludeEnd("ide");
  769. messageSends: ["assert:equals:", "numArgs"]
  770. }),
  771. $globals.BlockClosureTest);
  772. $core.addMethod(
  773. $core.method({
  774. selector: "testOnDo",
  775. protocol: 'tests',
  776. fn: function (){
  777. var self=this;
  778. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  779. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  780. return $core.withContext(function($ctx1) {
  781. //>>excludeEnd("ctx");
  782. self._assert_($recv((function(){
  783. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  784. return $core.withContext(function($ctx2) {
  785. //>>excludeEnd("ctx");
  786. return $recv($recv($Error())._new())._signal();
  787. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  788. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  789. //>>excludeEnd("ctx");
  790. }))._on_do_($Error(),(function(ex){
  791. return true;
  792. })));
  793. return self;
  794. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  795. }, function($ctx1) {$ctx1.fill(self,"testOnDo",{},$globals.BlockClosureTest)});
  796. //>>excludeEnd("ctx");
  797. },
  798. //>>excludeStart("ide", pragmas.excludeIdeData);
  799. args: [],
  800. source: "testOnDo\x0a\x09self assert: ([ Error new signal ] on: Error do: [ :ex | true ])",
  801. referencedClasses: ["Error"],
  802. //>>excludeEnd("ide");
  803. messageSends: ["assert:", "on:do:", "signal", "new"]
  804. }),
  805. $globals.BlockClosureTest);
  806. $core.addMethod(
  807. $core.method({
  808. selector: "testValue",
  809. protocol: 'tests',
  810. fn: function (){
  811. var self=this;
  812. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  813. return $core.withContext(function($ctx1) {
  814. //>>excludeEnd("ctx");
  815. var $1;
  816. $1=$recv((function(){
  817. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  818. return $core.withContext(function($ctx2) {
  819. //>>excludeEnd("ctx");
  820. return (1).__plus((1));
  821. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  822. $ctx2.sendIdx["+"]=1;
  823. //>>excludeEnd("ctx");
  824. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  825. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  826. //>>excludeEnd("ctx");
  827. }))._value();
  828. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  829. $ctx1.sendIdx["value"]=1;
  830. //>>excludeEnd("ctx");
  831. self._assert_equals_($1,(2));
  832. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  833. $ctx1.sendIdx["assert:equals:"]=1;
  834. //>>excludeEnd("ctx");
  835. self._assert_equals_($recv((function(x){
  836. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  837. return $core.withContext(function($ctx2) {
  838. //>>excludeEnd("ctx");
  839. return $recv(x).__plus((1));
  840. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  841. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,2)});
  842. //>>excludeEnd("ctx");
  843. }))._value_((2)),(3));
  844. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  845. $ctx1.sendIdx["assert:equals:"]=2;
  846. //>>excludeEnd("ctx");
  847. self._assert_equals_($recv((function(x,y){
  848. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  849. return $core.withContext(function($ctx2) {
  850. //>>excludeEnd("ctx");
  851. return $recv(x).__star(y);
  852. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  853. }, function($ctx2) {$ctx2.fillBlock({x:x,y:y},$ctx1,3)});
  854. //>>excludeEnd("ctx");
  855. }))._value_value_((2),(4)),(8));
  856. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  857. $ctx1.sendIdx["assert:equals:"]=3;
  858. //>>excludeEnd("ctx");
  859. self._assert_equals_($recv((function(a,b,c){
  860. return (1);
  861. }))._value(),(1));
  862. return self;
  863. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  864. }, function($ctx1) {$ctx1.fill(self,"testValue",{},$globals.BlockClosureTest)});
  865. //>>excludeEnd("ctx");
  866. },
  867. //>>excludeStart("ide", pragmas.excludeIdeData);
  868. args: [],
  869. 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",
  870. referencedClasses: [],
  871. //>>excludeEnd("ide");
  872. messageSends: ["assert:equals:", "value", "+", "value:", "value:value:", "*"]
  873. }),
  874. $globals.BlockClosureTest);
  875. $core.addMethod(
  876. $core.method({
  877. selector: "testValueWithPossibleArguments",
  878. protocol: 'tests',
  879. fn: function (){
  880. var self=this;
  881. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  882. return $core.withContext(function($ctx1) {
  883. //>>excludeEnd("ctx");
  884. var $1,$2;
  885. $1=$recv((function(){
  886. return (1);
  887. }))._valueWithPossibleArguments_([(3), (4)]);
  888. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  889. $ctx1.sendIdx["valueWithPossibleArguments:"]=1;
  890. //>>excludeEnd("ctx");
  891. self._assert_equals_($1,(1));
  892. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  893. $ctx1.sendIdx["assert:equals:"]=1;
  894. //>>excludeEnd("ctx");
  895. $2=$recv((function(a){
  896. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  897. return $core.withContext(function($ctx2) {
  898. //>>excludeEnd("ctx");
  899. return $recv(a).__plus((4));
  900. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  901. $ctx2.sendIdx["+"]=1;
  902. //>>excludeEnd("ctx");
  903. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  904. }, function($ctx2) {$ctx2.fillBlock({a:a},$ctx1,2)});
  905. //>>excludeEnd("ctx");
  906. }))._valueWithPossibleArguments_([(3), (4)]);
  907. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  908. $ctx1.sendIdx["valueWithPossibleArguments:"]=2;
  909. //>>excludeEnd("ctx");
  910. self._assert_equals_($2,(7));
  911. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  912. $ctx1.sendIdx["assert:equals:"]=2;
  913. //>>excludeEnd("ctx");
  914. self._assert_equals_($recv((function(a,b){
  915. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  916. return $core.withContext(function($ctx2) {
  917. //>>excludeEnd("ctx");
  918. return $recv(a).__plus(b);
  919. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  920. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1,3)});
  921. //>>excludeEnd("ctx");
  922. }))._valueWithPossibleArguments_([(3), (4), (5)]),(7));
  923. return self;
  924. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  925. }, function($ctx1) {$ctx1.fill(self,"testValueWithPossibleArguments",{},$globals.BlockClosureTest)});
  926. //>>excludeEnd("ctx");
  927. },
  928. //>>excludeStart("ide", pragmas.excludeIdeData);
  929. args: [],
  930. 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.",
  931. referencedClasses: [],
  932. //>>excludeEnd("ide");
  933. messageSends: ["assert:equals:", "valueWithPossibleArguments:", "+"]
  934. }),
  935. $globals.BlockClosureTest);
  936. $core.addMethod(
  937. $core.method({
  938. selector: "testWhileFalse",
  939. protocol: 'tests',
  940. fn: function (){
  941. var self=this;
  942. var i;
  943. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  944. return $core.withContext(function($ctx1) {
  945. //>>excludeEnd("ctx");
  946. i=(0);
  947. $recv((function(){
  948. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  949. return $core.withContext(function($ctx2) {
  950. //>>excludeEnd("ctx");
  951. return $recv(i).__gt((5));
  952. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  953. $ctx2.sendIdx[">"]=1;
  954. //>>excludeEnd("ctx");
  955. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  956. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  957. //>>excludeEnd("ctx");
  958. }))._whileFalse_((function(){
  959. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  960. return $core.withContext(function($ctx2) {
  961. //>>excludeEnd("ctx");
  962. i=$recv(i).__plus((1));
  963. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  964. $ctx2.sendIdx["+"]=1;
  965. //>>excludeEnd("ctx");
  966. return i;
  967. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  968. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  969. //>>excludeEnd("ctx");
  970. }));
  971. self._assert_equals_(i,(6));
  972. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  973. $ctx1.sendIdx["assert:equals:"]=1;
  974. //>>excludeEnd("ctx");
  975. i=(0);
  976. $recv((function(){
  977. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  978. return $core.withContext(function($ctx2) {
  979. //>>excludeEnd("ctx");
  980. i=$recv(i).__plus((1));
  981. i;
  982. return $recv(i).__gt((5));
  983. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  984. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  985. //>>excludeEnd("ctx");
  986. }))._whileFalse();
  987. self._assert_equals_(i,(6));
  988. return self;
  989. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  990. }, function($ctx1) {$ctx1.fill(self,"testWhileFalse",{i:i},$globals.BlockClosureTest)});
  991. //>>excludeEnd("ctx");
  992. },
  993. //>>excludeStart("ide", pragmas.excludeIdeData);
  994. args: [],
  995. 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",
  996. referencedClasses: [],
  997. //>>excludeEnd("ide");
  998. messageSends: ["whileFalse:", ">", "+", "assert:equals:", "whileFalse"]
  999. }),
  1000. $globals.BlockClosureTest);
  1001. $core.addMethod(
  1002. $core.method({
  1003. selector: "testWhileTrue",
  1004. protocol: 'tests',
  1005. fn: function (){
  1006. var self=this;
  1007. var i;
  1008. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1009. return $core.withContext(function($ctx1) {
  1010. //>>excludeEnd("ctx");
  1011. i=(0);
  1012. $recv((function(){
  1013. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1014. return $core.withContext(function($ctx2) {
  1015. //>>excludeEnd("ctx");
  1016. return $recv(i).__lt((5));
  1017. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1018. $ctx2.sendIdx["<"]=1;
  1019. //>>excludeEnd("ctx");
  1020. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1021. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  1022. //>>excludeEnd("ctx");
  1023. }))._whileTrue_((function(){
  1024. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1025. return $core.withContext(function($ctx2) {
  1026. //>>excludeEnd("ctx");
  1027. i=$recv(i).__plus((1));
  1028. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1029. $ctx2.sendIdx["+"]=1;
  1030. //>>excludeEnd("ctx");
  1031. return i;
  1032. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1033. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  1034. //>>excludeEnd("ctx");
  1035. }));
  1036. self._assert_equals_(i,(5));
  1037. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1038. $ctx1.sendIdx["assert:equals:"]=1;
  1039. //>>excludeEnd("ctx");
  1040. i=(0);
  1041. $recv((function(){
  1042. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1043. return $core.withContext(function($ctx2) {
  1044. //>>excludeEnd("ctx");
  1045. i=$recv(i).__plus((1));
  1046. i;
  1047. return $recv(i).__lt((5));
  1048. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1049. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  1050. //>>excludeEnd("ctx");
  1051. }))._whileTrue();
  1052. self._assert_equals_(i,(5));
  1053. return self;
  1054. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1055. }, function($ctx1) {$ctx1.fill(self,"testWhileTrue",{i:i},$globals.BlockClosureTest)});
  1056. //>>excludeEnd("ctx");
  1057. },
  1058. //>>excludeStart("ide", pragmas.excludeIdeData);
  1059. args: [],
  1060. 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",
  1061. referencedClasses: [],
  1062. //>>excludeEnd("ide");
  1063. messageSends: ["whileTrue:", "<", "+", "assert:equals:", "whileTrue"]
  1064. }),
  1065. $globals.BlockClosureTest);
  1066. $core.addClass('BooleanTest', $globals.TestCase, [], 'Kernel-Tests');
  1067. $core.addMethod(
  1068. $core.method({
  1069. selector: "testEquality",
  1070. protocol: 'tests',
  1071. fn: function (){
  1072. var self=this;
  1073. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1074. return $core.withContext(function($ctx1) {
  1075. //>>excludeEnd("ctx");
  1076. var $1,$2,$3,$4,$5,$6,$7,$8,$10,$9,$12,$11;
  1077. $1=(0).__eq(false);
  1078. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1079. $ctx1.sendIdx["="]=1;
  1080. //>>excludeEnd("ctx");
  1081. self._deny_($1);
  1082. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1083. $ctx1.sendIdx["deny:"]=1;
  1084. //>>excludeEnd("ctx");
  1085. $2=false.__eq((0));
  1086. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1087. $ctx1.sendIdx["="]=2;
  1088. //>>excludeEnd("ctx");
  1089. self._deny_($2);
  1090. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1091. $ctx1.sendIdx["deny:"]=2;
  1092. //>>excludeEnd("ctx");
  1093. $3="".__eq(false);
  1094. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1095. $ctx1.sendIdx["="]=3;
  1096. //>>excludeEnd("ctx");
  1097. self._deny_($3);
  1098. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1099. $ctx1.sendIdx["deny:"]=3;
  1100. //>>excludeEnd("ctx");
  1101. $4=false.__eq("");
  1102. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1103. $ctx1.sendIdx["="]=4;
  1104. //>>excludeEnd("ctx");
  1105. self._deny_($4);
  1106. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1107. $ctx1.sendIdx["deny:"]=4;
  1108. //>>excludeEnd("ctx");
  1109. $5=true.__eq(true);
  1110. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1111. $ctx1.sendIdx["="]=5;
  1112. //>>excludeEnd("ctx");
  1113. self._assert_($5);
  1114. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1115. $ctx1.sendIdx["assert:"]=1;
  1116. //>>excludeEnd("ctx");
  1117. $6=false.__eq(true);
  1118. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1119. $ctx1.sendIdx["="]=6;
  1120. //>>excludeEnd("ctx");
  1121. self._deny_($6);
  1122. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1123. $ctx1.sendIdx["deny:"]=5;
  1124. //>>excludeEnd("ctx");
  1125. $7=true.__eq(false);
  1126. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1127. $ctx1.sendIdx["="]=7;
  1128. //>>excludeEnd("ctx");
  1129. self._deny_($7);
  1130. $8=false.__eq(false);
  1131. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1132. $ctx1.sendIdx["="]=8;
  1133. //>>excludeEnd("ctx");
  1134. self._assert_($8);
  1135. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1136. $ctx1.sendIdx["assert:"]=2;
  1137. //>>excludeEnd("ctx");
  1138. $10=true._yourself();
  1139. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1140. $ctx1.sendIdx["yourself"]=1;
  1141. //>>excludeEnd("ctx");
  1142. $9=$recv($10).__eq(true);
  1143. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1144. $ctx1.sendIdx["="]=9;
  1145. //>>excludeEnd("ctx");
  1146. self._assert_($9);
  1147. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1148. $ctx1.sendIdx["assert:"]=3;
  1149. //>>excludeEnd("ctx");
  1150. $12=true._yourself();
  1151. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1152. $ctx1.sendIdx["yourself"]=2;
  1153. //>>excludeEnd("ctx");
  1154. $11=$recv($12).__eq(true._yourself());
  1155. self._assert_($11);
  1156. return self;
  1157. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1158. }, function($ctx1) {$ctx1.fill(self,"testEquality",{},$globals.BooleanTest)});
  1159. //>>excludeEnd("ctx");
  1160. },
  1161. //>>excludeStart("ide", pragmas.excludeIdeData);
  1162. args: [],
  1163. 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)",
  1164. referencedClasses: [],
  1165. //>>excludeEnd("ide");
  1166. messageSends: ["deny:", "=", "assert:", "yourself"]
  1167. }),
  1168. $globals.BooleanTest);
  1169. $core.addMethod(
  1170. $core.method({
  1171. selector: "testIdentity",
  1172. protocol: 'tests',
  1173. fn: function (){
  1174. var self=this;
  1175. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1176. return $core.withContext(function($ctx1) {
  1177. //>>excludeEnd("ctx");
  1178. var $1,$2,$3,$4,$5,$6,$7,$8,$10,$9,$12,$11;
  1179. $1=(0).__eq_eq(false);
  1180. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1181. $ctx1.sendIdx["=="]=1;
  1182. //>>excludeEnd("ctx");
  1183. self._deny_($1);
  1184. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1185. $ctx1.sendIdx["deny:"]=1;
  1186. //>>excludeEnd("ctx");
  1187. $2=false.__eq_eq((0));
  1188. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1189. $ctx1.sendIdx["=="]=2;
  1190. //>>excludeEnd("ctx");
  1191. self._deny_($2);
  1192. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1193. $ctx1.sendIdx["deny:"]=2;
  1194. //>>excludeEnd("ctx");
  1195. $3="".__eq_eq(false);
  1196. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1197. $ctx1.sendIdx["=="]=3;
  1198. //>>excludeEnd("ctx");
  1199. self._deny_($3);
  1200. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1201. $ctx1.sendIdx["deny:"]=3;
  1202. //>>excludeEnd("ctx");
  1203. $4=false.__eq_eq("");
  1204. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1205. $ctx1.sendIdx["=="]=4;
  1206. //>>excludeEnd("ctx");
  1207. self._deny_($4);
  1208. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1209. $ctx1.sendIdx["deny:"]=4;
  1210. //>>excludeEnd("ctx");
  1211. $5=true.__eq_eq(true);
  1212. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1213. $ctx1.sendIdx["=="]=5;
  1214. //>>excludeEnd("ctx");
  1215. self._assert_($5);
  1216. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1217. $ctx1.sendIdx["assert:"]=1;
  1218. //>>excludeEnd("ctx");
  1219. $6=false.__eq_eq(true);
  1220. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1221. $ctx1.sendIdx["=="]=6;
  1222. //>>excludeEnd("ctx");
  1223. self._deny_($6);
  1224. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1225. $ctx1.sendIdx["deny:"]=5;
  1226. //>>excludeEnd("ctx");
  1227. $7=true.__eq_eq(false);
  1228. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1229. $ctx1.sendIdx["=="]=7;
  1230. //>>excludeEnd("ctx");
  1231. self._deny_($7);
  1232. $8=false.__eq_eq(false);
  1233. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1234. $ctx1.sendIdx["=="]=8;
  1235. //>>excludeEnd("ctx");
  1236. self._assert_($8);
  1237. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1238. $ctx1.sendIdx["assert:"]=2;
  1239. //>>excludeEnd("ctx");
  1240. $10=true._yourself();
  1241. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1242. $ctx1.sendIdx["yourself"]=1;
  1243. //>>excludeEnd("ctx");
  1244. $9=$recv($10).__eq_eq(true);
  1245. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1246. $ctx1.sendIdx["=="]=9;
  1247. //>>excludeEnd("ctx");
  1248. self._assert_($9);
  1249. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1250. $ctx1.sendIdx["assert:"]=3;
  1251. //>>excludeEnd("ctx");
  1252. $12=true._yourself();
  1253. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1254. $ctx1.sendIdx["yourself"]=2;
  1255. //>>excludeEnd("ctx");
  1256. $11=$recv($12).__eq_eq(true._yourself());
  1257. self._assert_($11);
  1258. return self;
  1259. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1260. }, function($ctx1) {$ctx1.fill(self,"testIdentity",{},$globals.BooleanTest)});
  1261. //>>excludeEnd("ctx");
  1262. },
  1263. //>>excludeStart("ide", pragmas.excludeIdeData);
  1264. args: [],
  1265. 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",
  1266. referencedClasses: [],
  1267. //>>excludeEnd("ide");
  1268. messageSends: ["deny:", "==", "assert:", "yourself"]
  1269. }),
  1270. $globals.BooleanTest);
  1271. $core.addMethod(
  1272. $core.method({
  1273. selector: "testIfTrueIfFalse",
  1274. protocol: 'tests',
  1275. fn: function (){
  1276. var self=this;
  1277. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1278. return $core.withContext(function($ctx1) {
  1279. //>>excludeEnd("ctx");
  1280. var $1,$2,$3,$4,$5,$6,$7,$8;
  1281. if($core.assert(true)){
  1282. $1="alternative block";
  1283. };
  1284. self._assert_equals_($1,"alternative block");
  1285. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1286. $ctx1.sendIdx["assert:equals:"]=1;
  1287. //>>excludeEnd("ctx");
  1288. if(!$core.assert(true)){
  1289. $2="alternative block";
  1290. };
  1291. self._assert_equals_($2,nil);
  1292. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1293. $ctx1.sendIdx["assert:equals:"]=2;
  1294. //>>excludeEnd("ctx");
  1295. if($core.assert(false)){
  1296. $3="alternative block";
  1297. };
  1298. self._assert_equals_($3,nil);
  1299. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1300. $ctx1.sendIdx["assert:equals:"]=3;
  1301. //>>excludeEnd("ctx");
  1302. if(!$core.assert(false)){
  1303. $4="alternative block";
  1304. };
  1305. self._assert_equals_($4,"alternative block");
  1306. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1307. $ctx1.sendIdx["assert:equals:"]=4;
  1308. //>>excludeEnd("ctx");
  1309. if($core.assert(false)){
  1310. $5="alternative block";
  1311. } else {
  1312. $5="alternative block2";
  1313. };
  1314. self._assert_equals_($5,"alternative block2");
  1315. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1316. $ctx1.sendIdx["assert:equals:"]=5;
  1317. //>>excludeEnd("ctx");
  1318. if($core.assert(false)){
  1319. $6="alternative block2";
  1320. } else {
  1321. $6="alternative block";
  1322. };
  1323. self._assert_equals_($6,"alternative block");
  1324. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1325. $ctx1.sendIdx["assert:equals:"]=6;
  1326. //>>excludeEnd("ctx");
  1327. if($core.assert(true)){
  1328. $7="alternative block";
  1329. } else {
  1330. $7="alternative block2";
  1331. };
  1332. self._assert_equals_($7,"alternative block");
  1333. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1334. $ctx1.sendIdx["assert:equals:"]=7;
  1335. //>>excludeEnd("ctx");
  1336. if($core.assert(true)){
  1337. $8="alternative block2";
  1338. } else {
  1339. $8="alternative block";
  1340. };
  1341. self._assert_equals_($8,"alternative block2");
  1342. return self;
  1343. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1344. }, function($ctx1) {$ctx1.fill(self,"testIfTrueIfFalse",{},$globals.BooleanTest)});
  1345. //>>excludeEnd("ctx");
  1346. },
  1347. //>>excludeStart("ide", pragmas.excludeIdeData);
  1348. args: [],
  1349. 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'.",
  1350. referencedClasses: [],
  1351. //>>excludeEnd("ide");
  1352. messageSends: ["assert:equals:", "ifTrue:", "ifFalse:", "ifTrue:ifFalse:", "ifFalse:ifTrue:"]
  1353. }),
  1354. $globals.BooleanTest);
  1355. $core.addMethod(
  1356. $core.method({
  1357. selector: "testIfTrueIfFalseWithBoxing",
  1358. protocol: 'tests',
  1359. fn: function (){
  1360. var self=this;
  1361. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1362. return $core.withContext(function($ctx1) {
  1363. //>>excludeEnd("ctx");
  1364. var $2,$1,$4,$3,$6,$5,$8,$7,$10,$9,$12,$11,$14,$13,$16,$15;
  1365. $2=true._yourself();
  1366. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1367. $ctx1.sendIdx["yourself"]=1;
  1368. //>>excludeEnd("ctx");
  1369. if($core.assert($2)){
  1370. $1="alternative block";
  1371. };
  1372. self._assert_equals_($1,"alternative block");
  1373. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1374. $ctx1.sendIdx["assert:equals:"]=1;
  1375. //>>excludeEnd("ctx");
  1376. $4=true._yourself();
  1377. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1378. $ctx1.sendIdx["yourself"]=2;
  1379. //>>excludeEnd("ctx");
  1380. if(!$core.assert($4)){
  1381. $3="alternative block";
  1382. };
  1383. self._assert_equals_($3,nil);
  1384. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1385. $ctx1.sendIdx["assert:equals:"]=2;
  1386. //>>excludeEnd("ctx");
  1387. $6=false._yourself();
  1388. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1389. $ctx1.sendIdx["yourself"]=3;
  1390. //>>excludeEnd("ctx");
  1391. if($core.assert($6)){
  1392. $5="alternative block";
  1393. };
  1394. self._assert_equals_($5,nil);
  1395. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1396. $ctx1.sendIdx["assert:equals:"]=3;
  1397. //>>excludeEnd("ctx");
  1398. $8=false._yourself();
  1399. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1400. $ctx1.sendIdx["yourself"]=4;
  1401. //>>excludeEnd("ctx");
  1402. if(!$core.assert($8)){
  1403. $7="alternative block";
  1404. };
  1405. self._assert_equals_($7,"alternative block");
  1406. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1407. $ctx1.sendIdx["assert:equals:"]=4;
  1408. //>>excludeEnd("ctx");
  1409. $10=false._yourself();
  1410. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1411. $ctx1.sendIdx["yourself"]=5;
  1412. //>>excludeEnd("ctx");
  1413. if($core.assert($10)){
  1414. $9="alternative block";
  1415. } else {
  1416. $9="alternative block2";
  1417. };
  1418. self._assert_equals_($9,"alternative block2");
  1419. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1420. $ctx1.sendIdx["assert:equals:"]=5;
  1421. //>>excludeEnd("ctx");
  1422. $12=false._yourself();
  1423. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1424. $ctx1.sendIdx["yourself"]=6;
  1425. //>>excludeEnd("ctx");
  1426. if($core.assert($12)){
  1427. $11="alternative block2";
  1428. } else {
  1429. $11="alternative block";
  1430. };
  1431. self._assert_equals_($11,"alternative block");
  1432. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1433. $ctx1.sendIdx["assert:equals:"]=6;
  1434. //>>excludeEnd("ctx");
  1435. $14=true._yourself();
  1436. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1437. $ctx1.sendIdx["yourself"]=7;
  1438. //>>excludeEnd("ctx");
  1439. if($core.assert($14)){
  1440. $13="alternative block";
  1441. } else {
  1442. $13="alternative block2";
  1443. };
  1444. self._assert_equals_($13,"alternative block");
  1445. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1446. $ctx1.sendIdx["assert:equals:"]=7;
  1447. //>>excludeEnd("ctx");
  1448. $16=true._yourself();
  1449. if($core.assert($16)){
  1450. $15="alternative block2";
  1451. } else {
  1452. $15="alternative block";
  1453. };
  1454. self._assert_equals_($15,"alternative block2");
  1455. return self;
  1456. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1457. }, function($ctx1) {$ctx1.fill(self,"testIfTrueIfFalseWithBoxing",{},$globals.BooleanTest)});
  1458. //>>excludeEnd("ctx");
  1459. },
  1460. //>>excludeStart("ide", pragmas.excludeIdeData);
  1461. args: [],
  1462. 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'.",
  1463. referencedClasses: [],
  1464. //>>excludeEnd("ide");
  1465. messageSends: ["assert:equals:", "ifTrue:", "yourself", "ifFalse:", "ifTrue:ifFalse:", "ifFalse:ifTrue:"]
  1466. }),
  1467. $globals.BooleanTest);
  1468. $core.addMethod(
  1469. $core.method({
  1470. selector: "testLogic",
  1471. protocol: 'tests',
  1472. fn: function (){
  1473. var self=this;
  1474. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1475. return $core.withContext(function($ctx1) {
  1476. //>>excludeEnd("ctx");
  1477. var $1,$2,$3,$5,$4,$6,$7,$8,$10,$9,$12,$11,$14,$13,$16,$17,$15,$19,$18,$21,$20,$23,$22;
  1478. $1=true.__and(true);
  1479. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1480. $ctx1.sendIdx["&"]=1;
  1481. //>>excludeEnd("ctx");
  1482. self._assert_($1);
  1483. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1484. $ctx1.sendIdx["assert:"]=1;
  1485. //>>excludeEnd("ctx");
  1486. $2=true.__and(false);
  1487. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1488. $ctx1.sendIdx["&"]=2;
  1489. //>>excludeEnd("ctx");
  1490. self._deny_($2);
  1491. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1492. $ctx1.sendIdx["deny:"]=1;
  1493. //>>excludeEnd("ctx");
  1494. $3=false.__and(true);
  1495. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1496. $ctx1.sendIdx["&"]=3;
  1497. //>>excludeEnd("ctx");
  1498. self._deny_($3);
  1499. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1500. $ctx1.sendIdx["deny:"]=2;
  1501. //>>excludeEnd("ctx");
  1502. $5=false.__and(false);
  1503. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1504. $ctx1.sendIdx["&"]=4;
  1505. //>>excludeEnd("ctx");
  1506. $4=self._deny_($5);
  1507. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1508. $ctx1.sendIdx["deny:"]=3;
  1509. //>>excludeEnd("ctx");
  1510. $6=true.__or(true);
  1511. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1512. $ctx1.sendIdx["|"]=1;
  1513. //>>excludeEnd("ctx");
  1514. self._assert_($6);
  1515. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1516. $ctx1.sendIdx["assert:"]=2;
  1517. //>>excludeEnd("ctx");
  1518. $7=true.__or(false);
  1519. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1520. $ctx1.sendIdx["|"]=2;
  1521. //>>excludeEnd("ctx");
  1522. self._assert_($7);
  1523. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1524. $ctx1.sendIdx["assert:"]=3;
  1525. //>>excludeEnd("ctx");
  1526. $8=false.__or(true);
  1527. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1528. $ctx1.sendIdx["|"]=3;
  1529. //>>excludeEnd("ctx");
  1530. self._assert_($8);
  1531. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1532. $ctx1.sendIdx["assert:"]=4;
  1533. //>>excludeEnd("ctx");
  1534. $10=false.__or(false);
  1535. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1536. $ctx1.sendIdx["|"]=4;
  1537. //>>excludeEnd("ctx");
  1538. $9=self._deny_($10);
  1539. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1540. $ctx1.sendIdx["deny:"]=4;
  1541. //>>excludeEnd("ctx");
  1542. $12=(1).__gt((0));
  1543. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1544. $ctx1.sendIdx[">"]=1;
  1545. //>>excludeEnd("ctx");
  1546. $11=true.__and($12);
  1547. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1548. $ctx1.sendIdx["&"]=5;
  1549. //>>excludeEnd("ctx");
  1550. self._assert_($11);
  1551. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1552. $ctx1.sendIdx["assert:"]=5;
  1553. //>>excludeEnd("ctx");
  1554. $14=(1).__gt((0));
  1555. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1556. $ctx1.sendIdx[">"]=2;
  1557. //>>excludeEnd("ctx");
  1558. $13=$recv($14).__and(false);
  1559. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1560. $ctx1.sendIdx["&"]=6;
  1561. //>>excludeEnd("ctx");
  1562. self._deny_($13);
  1563. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1564. $ctx1.sendIdx["deny:"]=5;
  1565. //>>excludeEnd("ctx");
  1566. $16=(1).__gt((0));
  1567. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1568. $ctx1.sendIdx[">"]=3;
  1569. //>>excludeEnd("ctx");
  1570. $17=(1).__gt((2));
  1571. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1572. $ctx1.sendIdx[">"]=4;
  1573. //>>excludeEnd("ctx");
  1574. $15=$recv($16).__and($17);
  1575. self._deny_($15);
  1576. $19=(1).__gt((0));
  1577. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1578. $ctx1.sendIdx[">"]=5;
  1579. //>>excludeEnd("ctx");
  1580. $18=false.__or($19);
  1581. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1582. $ctx1.sendIdx["|"]=5;
  1583. //>>excludeEnd("ctx");
  1584. self._assert_($18);
  1585. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1586. $ctx1.sendIdx["assert:"]=6;
  1587. //>>excludeEnd("ctx");
  1588. $21=(1).__gt((0));
  1589. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1590. $ctx1.sendIdx[">"]=6;
  1591. //>>excludeEnd("ctx");
  1592. $20=$recv($21).__or(false);
  1593. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1594. $ctx1.sendIdx["|"]=6;
  1595. //>>excludeEnd("ctx");
  1596. self._assert_($20);
  1597. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1598. $ctx1.sendIdx["assert:"]=7;
  1599. //>>excludeEnd("ctx");
  1600. $23=(1).__gt((0));
  1601. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1602. $ctx1.sendIdx[">"]=7;
  1603. //>>excludeEnd("ctx");
  1604. $22=$recv($23).__or((1).__gt((2)));
  1605. self._assert_($22);
  1606. return self;
  1607. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1608. }, function($ctx1) {$ctx1.fill(self,"testLogic",{},$globals.BooleanTest)});
  1609. //>>excludeEnd("ctx");
  1610. },
  1611. //>>excludeStart("ide", pragmas.excludeIdeData);
  1612. args: [],
  1613. 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))",
  1614. referencedClasses: [],
  1615. //>>excludeEnd("ide");
  1616. messageSends: ["assert:", "&", "deny:", "|", ">"]
  1617. }),
  1618. $globals.BooleanTest);
  1619. $core.addMethod(
  1620. $core.method({
  1621. selector: "testLogicKeywords",
  1622. protocol: 'tests',
  1623. fn: function (){
  1624. var self=this;
  1625. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1626. return $core.withContext(function($ctx1) {
  1627. //>>excludeEnd("ctx");
  1628. var $1,$2,$3,$5,$4,$6,$7,$8,$10,$9,$11,$13,$12,$15,$14,$16,$18,$17,$20,$19;
  1629. $1=true._and_((function(){
  1630. return true;
  1631. }));
  1632. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1633. $ctx1.sendIdx["and:"]=1;
  1634. //>>excludeEnd("ctx");
  1635. self._assert_($1);
  1636. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1637. $ctx1.sendIdx["assert:"]=1;
  1638. //>>excludeEnd("ctx");
  1639. $2=true._and_((function(){
  1640. return false;
  1641. }));
  1642. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1643. $ctx1.sendIdx["and:"]=2;
  1644. //>>excludeEnd("ctx");
  1645. self._deny_($2);
  1646. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1647. $ctx1.sendIdx["deny:"]=1;
  1648. //>>excludeEnd("ctx");
  1649. $3=false._and_((function(){
  1650. return true;
  1651. }));
  1652. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1653. $ctx1.sendIdx["and:"]=3;
  1654. //>>excludeEnd("ctx");
  1655. self._deny_($3);
  1656. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1657. $ctx1.sendIdx["deny:"]=2;
  1658. //>>excludeEnd("ctx");
  1659. $5=false._and_((function(){
  1660. return false;
  1661. }));
  1662. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1663. $ctx1.sendIdx["and:"]=4;
  1664. //>>excludeEnd("ctx");
  1665. $4=self._deny_($5);
  1666. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1667. $ctx1.sendIdx["deny:"]=3;
  1668. //>>excludeEnd("ctx");
  1669. $6=true._or_((function(){
  1670. return true;
  1671. }));
  1672. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1673. $ctx1.sendIdx["or:"]=1;
  1674. //>>excludeEnd("ctx");
  1675. self._assert_($6);
  1676. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1677. $ctx1.sendIdx["assert:"]=2;
  1678. //>>excludeEnd("ctx");
  1679. $7=true._or_((function(){
  1680. return false;
  1681. }));
  1682. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1683. $ctx1.sendIdx["or:"]=2;
  1684. //>>excludeEnd("ctx");
  1685. self._assert_($7);
  1686. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1687. $ctx1.sendIdx["assert:"]=3;
  1688. //>>excludeEnd("ctx");
  1689. $8=false._or_((function(){
  1690. return true;
  1691. }));
  1692. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1693. $ctx1.sendIdx["or:"]=3;
  1694. //>>excludeEnd("ctx");
  1695. self._assert_($8);
  1696. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1697. $ctx1.sendIdx["assert:"]=4;
  1698. //>>excludeEnd("ctx");
  1699. $10=false._or_((function(){
  1700. return false;
  1701. }));
  1702. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1703. $ctx1.sendIdx["or:"]=4;
  1704. //>>excludeEnd("ctx");
  1705. $9=self._deny_($10);
  1706. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1707. $ctx1.sendIdx["deny:"]=4;
  1708. //>>excludeEnd("ctx");
  1709. $11=true._and_((function(){
  1710. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1711. return $core.withContext(function($ctx2) {
  1712. //>>excludeEnd("ctx");
  1713. return (1).__gt((0));
  1714. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1715. $ctx2.sendIdx[">"]=1;
  1716. //>>excludeEnd("ctx");
  1717. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1718. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,9)});
  1719. //>>excludeEnd("ctx");
  1720. }));
  1721. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1722. $ctx1.sendIdx["and:"]=5;
  1723. //>>excludeEnd("ctx");
  1724. self._assert_($11);
  1725. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1726. $ctx1.sendIdx["assert:"]=5;
  1727. //>>excludeEnd("ctx");
  1728. $13=(1).__gt((0));
  1729. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1730. $ctx1.sendIdx[">"]=2;
  1731. //>>excludeEnd("ctx");
  1732. $12=$recv($13)._and_((function(){
  1733. return false;
  1734. }));
  1735. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1736. $ctx1.sendIdx["and:"]=6;
  1737. //>>excludeEnd("ctx");
  1738. self._deny_($12);
  1739. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1740. $ctx1.sendIdx["deny:"]=5;
  1741. //>>excludeEnd("ctx");
  1742. $15=(1).__gt((0));
  1743. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1744. $ctx1.sendIdx[">"]=3;
  1745. //>>excludeEnd("ctx");
  1746. $14=$recv($15)._and_((function(){
  1747. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1748. return $core.withContext(function($ctx2) {
  1749. //>>excludeEnd("ctx");
  1750. return (1).__gt((2));
  1751. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1752. $ctx2.sendIdx[">"]=4;
  1753. //>>excludeEnd("ctx");
  1754. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1755. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,11)});
  1756. //>>excludeEnd("ctx");
  1757. }));
  1758. self._deny_($14);
  1759. $16=false._or_((function(){
  1760. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1761. return $core.withContext(function($ctx2) {
  1762. //>>excludeEnd("ctx");
  1763. return (1).__gt((0));
  1764. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1765. $ctx2.sendIdx[">"]=5;
  1766. //>>excludeEnd("ctx");
  1767. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1768. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,12)});
  1769. //>>excludeEnd("ctx");
  1770. }));
  1771. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1772. $ctx1.sendIdx["or:"]=5;
  1773. //>>excludeEnd("ctx");
  1774. self._assert_($16);
  1775. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1776. $ctx1.sendIdx["assert:"]=6;
  1777. //>>excludeEnd("ctx");
  1778. $18=(1).__gt((0));
  1779. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1780. $ctx1.sendIdx[">"]=6;
  1781. //>>excludeEnd("ctx");
  1782. $17=$recv($18)._or_((function(){
  1783. return false;
  1784. }));
  1785. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1786. $ctx1.sendIdx["or:"]=6;
  1787. //>>excludeEnd("ctx");
  1788. self._assert_($17);
  1789. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1790. $ctx1.sendIdx["assert:"]=7;
  1791. //>>excludeEnd("ctx");
  1792. $20=(1).__gt((0));
  1793. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1794. $ctx1.sendIdx[">"]=7;
  1795. //>>excludeEnd("ctx");
  1796. $19=$recv($20)._or_((function(){
  1797. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1798. return $core.withContext(function($ctx2) {
  1799. //>>excludeEnd("ctx");
  1800. return (1).__gt((2));
  1801. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1802. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,14)});
  1803. //>>excludeEnd("ctx");
  1804. }));
  1805. self._assert_($19);
  1806. return self;
  1807. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1808. }, function($ctx1) {$ctx1.fill(self,"testLogicKeywords",{},$globals.BooleanTest)});
  1809. //>>excludeEnd("ctx");
  1810. },
  1811. //>>excludeStart("ide", pragmas.excludeIdeData);
  1812. args: [],
  1813. 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 ])",
  1814. referencedClasses: [],
  1815. //>>excludeEnd("ide");
  1816. messageSends: ["assert:", "and:", "deny:", "or:", ">"]
  1817. }),
  1818. $globals.BooleanTest);
  1819. $core.addMethod(
  1820. $core.method({
  1821. selector: "testNonBooleanError",
  1822. protocol: 'tests',
  1823. fn: function (){
  1824. var self=this;
  1825. function $NonBooleanReceiver(){return $globals.NonBooleanReceiver||(typeof NonBooleanReceiver=="undefined"?nil:NonBooleanReceiver)}
  1826. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1827. return $core.withContext(function($ctx1) {
  1828. //>>excludeEnd("ctx");
  1829. self._should_raise_((function(){
  1830. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1831. return $core.withContext(function($ctx2) {
  1832. //>>excludeEnd("ctx");
  1833. if($core.assert("")){
  1834. } else {
  1835. };
  1836. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1837. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  1838. //>>excludeEnd("ctx");
  1839. }),$NonBooleanReceiver());
  1840. return self;
  1841. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1842. }, function($ctx1) {$ctx1.fill(self,"testNonBooleanError",{},$globals.BooleanTest)});
  1843. //>>excludeEnd("ctx");
  1844. },
  1845. //>>excludeStart("ide", pragmas.excludeIdeData);
  1846. args: [],
  1847. source: "testNonBooleanError\x0a\x09self should: [ '' ifTrue: [] ifFalse: [] ] raise: NonBooleanReceiver",
  1848. referencedClasses: ["NonBooleanReceiver"],
  1849. //>>excludeEnd("ide");
  1850. messageSends: ["should:raise:", "ifTrue:ifFalse:"]
  1851. }),
  1852. $globals.BooleanTest);
  1853. $core.addClass('ClassBuilderTest', $globals.TestCase, ['builder', 'theClass'], 'Kernel-Tests');
  1854. $core.addMethod(
  1855. $core.method({
  1856. selector: "setUp",
  1857. protocol: 'running',
  1858. fn: function (){
  1859. var self=this;
  1860. function $ClassBuilder(){return $globals.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  1861. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1862. return $core.withContext(function($ctx1) {
  1863. //>>excludeEnd("ctx");
  1864. self["@builder"]=$recv($ClassBuilder())._new();
  1865. return self;
  1866. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1867. }, function($ctx1) {$ctx1.fill(self,"setUp",{},$globals.ClassBuilderTest)});
  1868. //>>excludeEnd("ctx");
  1869. },
  1870. //>>excludeStart("ide", pragmas.excludeIdeData);
  1871. args: [],
  1872. source: "setUp\x0a\x09builder := ClassBuilder new",
  1873. referencedClasses: ["ClassBuilder"],
  1874. //>>excludeEnd("ide");
  1875. messageSends: ["new"]
  1876. }),
  1877. $globals.ClassBuilderTest);
  1878. $core.addMethod(
  1879. $core.method({
  1880. selector: "tearDown",
  1881. protocol: 'running',
  1882. fn: function (){
  1883. var self=this;
  1884. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1885. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1886. return $core.withContext(function($ctx1) {
  1887. //>>excludeEnd("ctx");
  1888. var $1,$receiver;
  1889. $1=self["@theClass"];
  1890. if(($receiver = $1) == null || $receiver.isNil){
  1891. $1;
  1892. } else {
  1893. $recv($Smalltalk())._removeClass_(self["@theClass"]);
  1894. self["@theClass"]=nil;
  1895. self["@theClass"];
  1896. };
  1897. return self;
  1898. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1899. }, function($ctx1) {$ctx1.fill(self,"tearDown",{},$globals.ClassBuilderTest)});
  1900. //>>excludeEnd("ctx");
  1901. },
  1902. //>>excludeStart("ide", pragmas.excludeIdeData);
  1903. args: [],
  1904. source: "tearDown\x0a\x09theClass ifNotNil: [ Smalltalk removeClass: theClass. theClass := nil ]",
  1905. referencedClasses: ["Smalltalk"],
  1906. //>>excludeEnd("ide");
  1907. messageSends: ["ifNotNil:", "removeClass:"]
  1908. }),
  1909. $globals.ClassBuilderTest);
  1910. $core.addMethod(
  1911. $core.method({
  1912. selector: "testClassCopy",
  1913. protocol: 'tests',
  1914. fn: function (){
  1915. var self=this;
  1916. function $ObjectMock(){return $globals.ObjectMock||(typeof ObjectMock=="undefined"?nil:ObjectMock)}
  1917. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1918. return $core.withContext(function($ctx1) {
  1919. //>>excludeEnd("ctx");
  1920. var $2,$1,$4,$3,$6,$5,$8,$7;
  1921. self["@theClass"]=$recv(self["@builder"])._copyClass_named_($ObjectMock(),"ObjectMock2");
  1922. $2=$recv(self["@theClass"])._superclass();
  1923. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1924. $ctx1.sendIdx["superclass"]=1;
  1925. //>>excludeEnd("ctx");
  1926. $1=$recv($2).__eq_eq($recv($ObjectMock())._superclass());
  1927. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1928. $ctx1.sendIdx["=="]=1;
  1929. //>>excludeEnd("ctx");
  1930. self._assert_($1);
  1931. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1932. $ctx1.sendIdx["assert:"]=1;
  1933. //>>excludeEnd("ctx");
  1934. $4=$recv(self["@theClass"])._instanceVariableNames();
  1935. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1936. $ctx1.sendIdx["instanceVariableNames"]=1;
  1937. //>>excludeEnd("ctx");
  1938. $3=$recv($4).__eq_eq($recv($ObjectMock())._instanceVariableNames());
  1939. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1940. $ctx1.sendIdx["=="]=2;
  1941. //>>excludeEnd("ctx");
  1942. self._assert_($3);
  1943. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1944. $ctx1.sendIdx["assert:"]=2;
  1945. //>>excludeEnd("ctx");
  1946. self._assert_equals_($recv(self["@theClass"])._name(),"ObjectMock2");
  1947. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1948. $ctx1.sendIdx["assert:equals:"]=1;
  1949. //>>excludeEnd("ctx");
  1950. $6=$recv(self["@theClass"])._package();
  1951. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1952. $ctx1.sendIdx["package"]=1;
  1953. //>>excludeEnd("ctx");
  1954. $5=$recv($6).__eq_eq($recv($ObjectMock())._package());
  1955. self._assert_($5);
  1956. $8=$recv(self["@theClass"])._methodDictionary();
  1957. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1958. $ctx1.sendIdx["methodDictionary"]=1;
  1959. //>>excludeEnd("ctx");
  1960. $7=$recv($8)._keys();
  1961. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1962. $ctx1.sendIdx["keys"]=1;
  1963. //>>excludeEnd("ctx");
  1964. self._assert_equals_($7,$recv($recv($ObjectMock())._methodDictionary())._keys());
  1965. return self;
  1966. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1967. }, function($ctx1) {$ctx1.fill(self,"testClassCopy",{},$globals.ClassBuilderTest)});
  1968. //>>excludeEnd("ctx");
  1969. },
  1970. //>>excludeStart("ide", pragmas.excludeIdeData);
  1971. args: [],
  1972. 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",
  1973. referencedClasses: ["ObjectMock"],
  1974. //>>excludeEnd("ide");
  1975. messageSends: ["copyClass:named:", "assert:", "==", "superclass", "instanceVariableNames", "assert:equals:", "name", "package", "keys", "methodDictionary"]
  1976. }),
  1977. $globals.ClassBuilderTest);
  1978. $core.addMethod(
  1979. $core.method({
  1980. selector: "testClassMigration",
  1981. protocol: 'tests',
  1982. fn: function (){
  1983. var self=this;
  1984. var instance,oldClass;
  1985. function $ObjectMock(){return $globals.ObjectMock||(typeof ObjectMock=="undefined"?nil:ObjectMock)}
  1986. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1987. function $ObjectMock2(){return $globals.ObjectMock2||(typeof ObjectMock2=="undefined"?nil:ObjectMock2)}
  1988. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1989. return $core.withContext(function($ctx1) {
  1990. //>>excludeEnd("ctx");
  1991. var $2,$1,$4,$3,$5,$6,$7,$8,$9,$11,$10;
  1992. oldClass=$recv(self["@builder"])._copyClass_named_($ObjectMock(),"ObjectMock2");
  1993. $2=$recv($Smalltalk())._globals();
  1994. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1995. $ctx1.sendIdx["globals"]=1;
  1996. //>>excludeEnd("ctx");
  1997. $1=$recv($2)._at_("ObjectMock2");
  1998. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1999. $ctx1.sendIdx["at:"]=1;
  2000. //>>excludeEnd("ctx");
  2001. instance=$recv($1)._new();
  2002. $4=$recv($Smalltalk())._globals();
  2003. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2004. $ctx1.sendIdx["globals"]=2;
  2005. //>>excludeEnd("ctx");
  2006. $3=$recv($4)._at_("ObjectMock2");
  2007. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2008. $ctx1.sendIdx["at:"]=2;
  2009. //>>excludeEnd("ctx");
  2010. $recv($ObjectMock())._subclass_instanceVariableNames_package_($3,"","Kernel-Tests");
  2011. $5=$recv(oldClass).__eq_eq($ObjectMock2());
  2012. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2013. $ctx1.sendIdx["=="]=1;
  2014. //>>excludeEnd("ctx");
  2015. self._deny_($5);
  2016. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2017. $ctx1.sendIdx["deny:"]=1;
  2018. //>>excludeEnd("ctx");
  2019. $6=$recv($recv($ObjectMock2())._superclass()).__eq_eq($ObjectMock());
  2020. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2021. $ctx1.sendIdx["=="]=2;
  2022. //>>excludeEnd("ctx");
  2023. self._assert_($6);
  2024. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2025. $ctx1.sendIdx["assert:"]=1;
  2026. //>>excludeEnd("ctx");
  2027. self._assert_($recv($recv($ObjectMock2())._instanceVariableNames())._isEmpty());
  2028. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2029. $ctx1.sendIdx["assert:"]=2;
  2030. //>>excludeEnd("ctx");
  2031. $7=$recv($ObjectMock2())._selectors();
  2032. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2033. $ctx1.sendIdx["selectors"]=1;
  2034. //>>excludeEnd("ctx");
  2035. self._assert_equals_($7,$recv(oldClass)._selectors());
  2036. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2037. $ctx1.sendIdx["assert:equals:"]=1;
  2038. //>>excludeEnd("ctx");
  2039. $8=$recv($ObjectMock2())._comment();
  2040. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2041. $ctx1.sendIdx["comment"]=1;
  2042. //>>excludeEnd("ctx");
  2043. self._assert_equals_($8,$recv(oldClass)._comment());
  2044. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2045. $ctx1.sendIdx["assert:equals:"]=2;
  2046. //>>excludeEnd("ctx");
  2047. $9=$recv($recv($ObjectMock2())._package())._name();
  2048. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2049. $ctx1.sendIdx["name"]=1;
  2050. //>>excludeEnd("ctx");
  2051. self._assert_equals_($9,"Kernel-Tests");
  2052. $11=$recv(instance)._class();
  2053. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2054. $ctx1.sendIdx["class"]=1;
  2055. //>>excludeEnd("ctx");
  2056. $10=$recv($11).__eq_eq($ObjectMock2());
  2057. self._deny_($10);
  2058. self._assert_($recv($recv($recv($Smalltalk())._globals())._at_($recv($recv(instance)._class())._name()))._isNil());
  2059. $recv($Smalltalk())._removeClass_($ObjectMock2());
  2060. return self;
  2061. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2062. }, function($ctx1) {$ctx1.fill(self,"testClassMigration",{instance:instance,oldClass:oldClass},$globals.ClassBuilderTest)});
  2063. //>>excludeEnd("ctx");
  2064. },
  2065. //>>excludeStart("ide", pragmas.excludeIdeData);
  2066. args: [],
  2067. 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",
  2068. referencedClasses: ["ObjectMock", "Smalltalk", "ObjectMock2"],
  2069. //>>excludeEnd("ide");
  2070. messageSends: ["copyClass:named:", "new", "at:", "globals", "subclass:instanceVariableNames:package:", "deny:", "==", "assert:", "superclass", "isEmpty", "instanceVariableNames", "assert:equals:", "selectors", "comment", "name", "package", "class", "isNil", "removeClass:"]
  2071. }),
  2072. $globals.ClassBuilderTest);
  2073. $core.addMethod(
  2074. $core.method({
  2075. selector: "testClassMigrationWithClassInstanceVariables",
  2076. protocol: 'tests',
  2077. fn: function (){
  2078. var self=this;
  2079. function $ObjectMock(){return $globals.ObjectMock||(typeof ObjectMock=="undefined"?nil:ObjectMock)}
  2080. function $ObjectMock2(){return $globals.ObjectMock2||(typeof ObjectMock2=="undefined"?nil:ObjectMock2)}
  2081. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  2082. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2083. return $core.withContext(function($ctx1) {
  2084. //>>excludeEnd("ctx");
  2085. var $1;
  2086. $recv(self["@builder"])._copyClass_named_($ObjectMock(),"ObjectMock2");
  2087. $1=$recv($ObjectMock2())._class();
  2088. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2089. $ctx1.sendIdx["class"]=1;
  2090. //>>excludeEnd("ctx");
  2091. $recv($1)._instanceVariableNames_("foo bar");
  2092. $recv($ObjectMock())._subclass_instanceVariableNames_package_($recv($recv($Smalltalk())._globals())._at_("ObjectMock2"),"","Kernel-Tests");
  2093. self._assert_equals_($recv($recv($ObjectMock2())._class())._instanceVariableNames(),["foo", "bar"]);
  2094. $recv($Smalltalk())._removeClass_($ObjectMock2());
  2095. return self;
  2096. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2097. }, function($ctx1) {$ctx1.fill(self,"testClassMigrationWithClassInstanceVariables",{},$globals.ClassBuilderTest)});
  2098. //>>excludeEnd("ctx");
  2099. },
  2100. //>>excludeStart("ide", pragmas.excludeIdeData);
  2101. args: [],
  2102. 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",
  2103. referencedClasses: ["ObjectMock", "ObjectMock2", "Smalltalk"],
  2104. //>>excludeEnd("ide");
  2105. messageSends: ["copyClass:named:", "instanceVariableNames:", "class", "subclass:instanceVariableNames:package:", "at:", "globals", "assert:equals:", "instanceVariableNames", "removeClass:"]
  2106. }),
  2107. $globals.ClassBuilderTest);
  2108. $core.addMethod(
  2109. $core.method({
  2110. selector: "testClassMigrationWithSubclasses",
  2111. protocol: 'tests',
  2112. fn: function (){
  2113. var self=this;
  2114. function $ObjectMock(){return $globals.ObjectMock||(typeof ObjectMock=="undefined"?nil:ObjectMock)}
  2115. function $ObjectMock2(){return $globals.ObjectMock2||(typeof ObjectMock2=="undefined"?nil:ObjectMock2)}
  2116. function $ObjectMock3(){return $globals.ObjectMock3||(typeof ObjectMock3=="undefined"?nil:ObjectMock3)}
  2117. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  2118. function $ObjectMock4(){return $globals.ObjectMock4||(typeof ObjectMock4=="undefined"?nil:ObjectMock4)}
  2119. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2120. return $core.withContext(function($ctx1) {
  2121. //>>excludeEnd("ctx");
  2122. var $2,$1,$4,$3;
  2123. $recv(self["@builder"])._copyClass_named_($ObjectMock(),"ObjectMock2");
  2124. $recv($ObjectMock2())._subclass_instanceVariableNames_package_("ObjectMock3","","Kernel-Tests");
  2125. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2126. $ctx1.sendIdx["subclass:instanceVariableNames:package:"]=1;
  2127. //>>excludeEnd("ctx");
  2128. $recv($ObjectMock3())._subclass_instanceVariableNames_package_("ObjectMock4","","Kernel-Tests");
  2129. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2130. $ctx1.sendIdx["subclass:instanceVariableNames:package:"]=2;
  2131. //>>excludeEnd("ctx");
  2132. $recv($ObjectMock())._subclass_instanceVariableNames_package_($recv($recv($Smalltalk())._globals())._at_("ObjectMock2"),"","Kernel-Tests");
  2133. $2=$recv($ObjectMock())._subclasses();
  2134. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2135. $ctx1.sendIdx["subclasses"]=1;
  2136. //>>excludeEnd("ctx");
  2137. $1=$recv($2)._includes_($ObjectMock2());
  2138. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2139. $ctx1.sendIdx["includes:"]=1;
  2140. //>>excludeEnd("ctx");
  2141. self._assert_($1);
  2142. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2143. $ctx1.sendIdx["assert:"]=1;
  2144. //>>excludeEnd("ctx");
  2145. $4=$recv($ObjectMock2())._subclasses();
  2146. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2147. $ctx1.sendIdx["subclasses"]=2;
  2148. //>>excludeEnd("ctx");
  2149. $3=$recv($4)._includes_($ObjectMock3());
  2150. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2151. $ctx1.sendIdx["includes:"]=2;
  2152. //>>excludeEnd("ctx");
  2153. self._assert_($3);
  2154. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2155. $ctx1.sendIdx["assert:"]=2;
  2156. //>>excludeEnd("ctx");
  2157. self._assert_($recv($recv($ObjectMock3())._subclasses())._includes_($ObjectMock4()));
  2158. $recv($recv($ObjectMock())._allSubclasses())._do_((function(each){
  2159. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2160. return $core.withContext(function($ctx2) {
  2161. //>>excludeEnd("ctx");
  2162. return $recv($Smalltalk())._removeClass_(each);
  2163. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2164. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2165. //>>excludeEnd("ctx");
  2166. }));
  2167. return self;
  2168. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2169. }, function($ctx1) {$ctx1.fill(self,"testClassMigrationWithSubclasses",{},$globals.ClassBuilderTest)});
  2170. //>>excludeEnd("ctx");
  2171. },
  2172. //>>excludeStart("ide", pragmas.excludeIdeData);
  2173. args: [],
  2174. 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 ]",
  2175. referencedClasses: ["ObjectMock", "ObjectMock2", "ObjectMock3", "Smalltalk", "ObjectMock4"],
  2176. //>>excludeEnd("ide");
  2177. messageSends: ["copyClass:named:", "subclass:instanceVariableNames:package:", "at:", "globals", "assert:", "includes:", "subclasses", "do:", "allSubclasses", "removeClass:"]
  2178. }),
  2179. $globals.ClassBuilderTest);
  2180. $core.addMethod(
  2181. $core.method({
  2182. selector: "testInstanceVariableNames",
  2183. protocol: 'tests',
  2184. fn: function (){
  2185. var self=this;
  2186. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2187. return $core.withContext(function($ctx1) {
  2188. //>>excludeEnd("ctx");
  2189. self._assert_equals_($recv(self["@builder"])._instanceVariableNamesFor_(" hello world "),["hello", "world"]);
  2190. return self;
  2191. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2192. }, function($ctx1) {$ctx1.fill(self,"testInstanceVariableNames",{},$globals.ClassBuilderTest)});
  2193. //>>excludeEnd("ctx");
  2194. },
  2195. //>>excludeStart("ide", pragmas.excludeIdeData);
  2196. args: [],
  2197. source: "testInstanceVariableNames\x0a\x09self assert: (builder instanceVariableNamesFor: ' hello world ') equals: #('hello' 'world')",
  2198. referencedClasses: [],
  2199. //>>excludeEnd("ide");
  2200. messageSends: ["assert:equals:", "instanceVariableNamesFor:"]
  2201. }),
  2202. $globals.ClassBuilderTest);
  2203. $core.addClass('ClassTest', $globals.TestCase, ['builder', 'theClass'], 'Kernel-Tests');
  2204. $core.addMethod(
  2205. $core.method({
  2206. selector: "jsConstructor",
  2207. protocol: 'running',
  2208. fn: function (){
  2209. var self=this;
  2210. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2211. return $core.withContext(function($ctx1) {
  2212. //>>excludeEnd("ctx");
  2213. function Foo(){}
  2214. Foo.prototype.valueOf = function () {return 4;};
  2215. return Foo;
  2216. ;
  2217. return self;
  2218. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2219. }, function($ctx1) {$ctx1.fill(self,"jsConstructor",{},$globals.ClassTest)});
  2220. //>>excludeEnd("ctx");
  2221. },
  2222. //>>excludeStart("ide", pragmas.excludeIdeData);
  2223. args: [],
  2224. source: "jsConstructor\x0a\x09<\x0a\x09\x09function Foo(){}\x0a\x09\x09Foo.prototype.valueOf = function () {return 4;};\x0a\x09\x09return Foo;\x0a\x09>",
  2225. referencedClasses: [],
  2226. //>>excludeEnd("ide");
  2227. messageSends: []
  2228. }),
  2229. $globals.ClassTest);
  2230. $core.addMethod(
  2231. $core.method({
  2232. selector: "setUp",
  2233. protocol: 'running',
  2234. fn: function (){
  2235. var self=this;
  2236. function $ClassBuilder(){return $globals.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  2237. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2238. return $core.withContext(function($ctx1) {
  2239. //>>excludeEnd("ctx");
  2240. self["@builder"]=$recv($ClassBuilder())._new();
  2241. return self;
  2242. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2243. }, function($ctx1) {$ctx1.fill(self,"setUp",{},$globals.ClassTest)});
  2244. //>>excludeEnd("ctx");
  2245. },
  2246. //>>excludeStart("ide", pragmas.excludeIdeData);
  2247. args: [],
  2248. source: "setUp\x0a\x09builder := ClassBuilder new",
  2249. referencedClasses: ["ClassBuilder"],
  2250. //>>excludeEnd("ide");
  2251. messageSends: ["new"]
  2252. }),
  2253. $globals.ClassTest);
  2254. $core.addMethod(
  2255. $core.method({
  2256. selector: "tearDown",
  2257. protocol: 'running',
  2258. fn: function (){
  2259. var self=this;
  2260. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  2261. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2262. return $core.withContext(function($ctx1) {
  2263. //>>excludeEnd("ctx");
  2264. var $1,$receiver;
  2265. $1=self["@theClass"];
  2266. if(($receiver = $1) == null || $receiver.isNil){
  2267. $1;
  2268. } else {
  2269. $recv($Smalltalk())._removeClass_(self["@theClass"]);
  2270. self["@theClass"]=nil;
  2271. self["@theClass"];
  2272. };
  2273. return self;
  2274. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2275. }, function($ctx1) {$ctx1.fill(self,"tearDown",{},$globals.ClassTest)});
  2276. //>>excludeEnd("ctx");
  2277. },
  2278. //>>excludeStart("ide", pragmas.excludeIdeData);
  2279. args: [],
  2280. source: "tearDown\x0a\x09theClass ifNotNil: [ Smalltalk removeClass: theClass. theClass := nil ]",
  2281. referencedClasses: ["Smalltalk"],
  2282. //>>excludeEnd("ide");
  2283. messageSends: ["ifNotNil:", "removeClass:"]
  2284. }),
  2285. $globals.ClassTest);
  2286. $core.addMethod(
  2287. $core.method({
  2288. selector: "testSetJavaScriptConstructor",
  2289. protocol: 'tests',
  2290. fn: function (){
  2291. var self=this;
  2292. var instance;
  2293. function $ObjectMock(){return $globals.ObjectMock||(typeof ObjectMock=="undefined"?nil:ObjectMock)}
  2294. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  2295. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2296. return $core.withContext(function($ctx1) {
  2297. //>>excludeEnd("ctx");
  2298. var $2,$1,$4,$3,$6,$5,$8,$7;
  2299. self["@theClass"]=$recv(self["@builder"])._copyClass_named_($ObjectMock(),"ObjectMock2");
  2300. $recv(self["@theClass"])._javascriptConstructor_(self._jsConstructor());
  2301. $2=$recv(self["@theClass"])._superclass();
  2302. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2303. $ctx1.sendIdx["superclass"]=1;
  2304. //>>excludeEnd("ctx");
  2305. $1=$recv($2).__eq_eq($recv($ObjectMock())._superclass());
  2306. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2307. $ctx1.sendIdx["=="]=1;
  2308. //>>excludeEnd("ctx");
  2309. self._assert_($1);
  2310. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2311. $ctx1.sendIdx["assert:"]=1;
  2312. //>>excludeEnd("ctx");
  2313. $4=$recv(self["@theClass"])._instanceVariableNames();
  2314. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2315. $ctx1.sendIdx["instanceVariableNames"]=1;
  2316. //>>excludeEnd("ctx");
  2317. $3=$recv($4).__eq_eq($recv($ObjectMock())._instanceVariableNames());
  2318. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2319. $ctx1.sendIdx["=="]=2;
  2320. //>>excludeEnd("ctx");
  2321. self._assert_($3);
  2322. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2323. $ctx1.sendIdx["assert:"]=2;
  2324. //>>excludeEnd("ctx");
  2325. self._assert_equals_($recv(self["@theClass"])._name(),"ObjectMock2");
  2326. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2327. $ctx1.sendIdx["assert:equals:"]=1;
  2328. //>>excludeEnd("ctx");
  2329. $6=$recv(self["@theClass"])._package();
  2330. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2331. $ctx1.sendIdx["package"]=1;
  2332. //>>excludeEnd("ctx");
  2333. $5=$recv($6).__eq_eq($recv($ObjectMock())._package());
  2334. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2335. $ctx1.sendIdx["=="]=3;
  2336. //>>excludeEnd("ctx");
  2337. self._assert_($5);
  2338. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2339. $ctx1.sendIdx["assert:"]=3;
  2340. //>>excludeEnd("ctx");
  2341. $8=$recv(self["@theClass"])._methodDictionary();
  2342. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2343. $ctx1.sendIdx["methodDictionary"]=1;
  2344. //>>excludeEnd("ctx");
  2345. $7=$recv($8)._keys();
  2346. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2347. $ctx1.sendIdx["keys"]=1;
  2348. //>>excludeEnd("ctx");
  2349. self._assert_equals_($7,$recv($recv($ObjectMock())._methodDictionary())._keys());
  2350. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2351. $ctx1.sendIdx["assert:equals:"]=2;
  2352. //>>excludeEnd("ctx");
  2353. instance=$recv(self["@theClass"])._new();
  2354. self._assert_($recv($recv(instance)._class()).__eq_eq(self["@theClass"]));
  2355. self._assert_equals_($recv(instance)._value(),(4));
  2356. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2357. $ctx1.sendIdx["assert:equals:"]=3;
  2358. //>>excludeEnd("ctx");
  2359. self._shouldnt_raise_((function(){
  2360. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2361. return $core.withContext(function($ctx2) {
  2362. //>>excludeEnd("ctx");
  2363. return $recv(instance)._foo_((9));
  2364. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2365. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  2366. //>>excludeEnd("ctx");
  2367. }),$Error());
  2368. self._assert_equals_($recv(instance)._foo(),(9));
  2369. return self;
  2370. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2371. }, function($ctx1) {$ctx1.fill(self,"testSetJavaScriptConstructor",{instance:instance},$globals.ClassTest)});
  2372. //>>excludeEnd("ctx");
  2373. },
  2374. //>>excludeStart("ide", pragmas.excludeIdeData);
  2375. args: [],
  2376. source: "testSetJavaScriptConstructor\x0a\x09| instance |\x0a\x09theClass := builder copyClass: ObjectMock named: 'ObjectMock2'.\x0a\x09theClass javascriptConstructor: self jsConstructor.\x0a\x09\x22part took from copy class test\x22\x0a\x09self assert: theClass superclass == ObjectMock superclass.\x0a\x09self assert: theClass instanceVariableNames == ObjectMock instanceVariableNames.\x0a\x09self assert: theClass name equals: 'ObjectMock2'.\x0a\x09self assert: theClass package == ObjectMock package.\x0a\x09self assert: theClass methodDictionary keys equals: ObjectMock methodDictionary keys.\x0a\x09\x22testing specific to late-wrapped class\x22\x0a\x09instance := theClass new.\x0a\x09self assert: instance class == theClass.\x0a\x09self assert: instance value equals: 4.\x0a\x09self shouldnt: [ instance foo: 9 ] raise: Error.\x0a\x09self assert: instance foo equals: 9",
  2377. referencedClasses: ["ObjectMock", "Error"],
  2378. //>>excludeEnd("ide");
  2379. messageSends: ["copyClass:named:", "javascriptConstructor:", "jsConstructor", "assert:", "==", "superclass", "instanceVariableNames", "assert:equals:", "name", "package", "keys", "methodDictionary", "new", "class", "value", "shouldnt:raise:", "foo:", "foo"]
  2380. }),
  2381. $globals.ClassTest);
  2382. $core.addClass('CollectionTest', $globals.TestCase, ['sampleBlock'], 'Kernel-Tests');
  2383. $core.addMethod(
  2384. $core.method({
  2385. selector: "assertSameContents:as:",
  2386. protocol: 'convenience',
  2387. fn: function (aCollection,anotherCollection){
  2388. var self=this;
  2389. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2390. return $core.withContext(function($ctx1) {
  2391. //>>excludeEnd("ctx");
  2392. var $2,$1,$4,$3;
  2393. $2=$recv(aCollection)._size();
  2394. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2395. $ctx1.sendIdx["size"]=1;
  2396. //>>excludeEnd("ctx");
  2397. $1=$recv($2).__eq($recv(anotherCollection)._size());
  2398. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2399. $ctx1.sendIdx["="]=1;
  2400. //>>excludeEnd("ctx");
  2401. self._assert_($1);
  2402. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2403. $ctx1.sendIdx["assert:"]=1;
  2404. //>>excludeEnd("ctx");
  2405. $recv(aCollection)._do_((function(each){
  2406. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2407. return $core.withContext(function($ctx2) {
  2408. //>>excludeEnd("ctx");
  2409. $4=$recv(aCollection)._occurrencesOf_(each);
  2410. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2411. $ctx2.sendIdx["occurrencesOf:"]=1;
  2412. //>>excludeEnd("ctx");
  2413. $3=$recv($4).__eq($recv(anotherCollection)._occurrencesOf_(each));
  2414. return self._assert_($3);
  2415. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2416. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2417. //>>excludeEnd("ctx");
  2418. }));
  2419. return self;
  2420. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2421. }, function($ctx1) {$ctx1.fill(self,"assertSameContents:as:",{aCollection:aCollection,anotherCollection:anotherCollection},$globals.CollectionTest)});
  2422. //>>excludeEnd("ctx");
  2423. },
  2424. //>>excludeStart("ide", pragmas.excludeIdeData);
  2425. args: ["aCollection", "anotherCollection"],
  2426. 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)) ]",
  2427. referencedClasses: [],
  2428. //>>excludeEnd("ide");
  2429. messageSends: ["assert:", "=", "size", "do:", "occurrencesOf:"]
  2430. }),
  2431. $globals.CollectionTest);
  2432. $core.addMethod(
  2433. $core.method({
  2434. selector: "collection",
  2435. protocol: 'fixture',
  2436. fn: function (){
  2437. var self=this;
  2438. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2439. return $core.withContext(function($ctx1) {
  2440. //>>excludeEnd("ctx");
  2441. self._subclassResponsibility();
  2442. return self;
  2443. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2444. }, function($ctx1) {$ctx1.fill(self,"collection",{},$globals.CollectionTest)});
  2445. //>>excludeEnd("ctx");
  2446. },
  2447. //>>excludeStart("ide", pragmas.excludeIdeData);
  2448. args: [],
  2449. source: "collection\x0a\x09\x22Answers pre-filled collection of type tested.\x22\x0a\x0a\x09self subclassResponsibility",
  2450. referencedClasses: [],
  2451. //>>excludeEnd("ide");
  2452. messageSends: ["subclassResponsibility"]
  2453. }),
  2454. $globals.CollectionTest);
  2455. $core.addMethod(
  2456. $core.method({
  2457. selector: "collectionClass",
  2458. protocol: 'fixture',
  2459. fn: function (){
  2460. var self=this;
  2461. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2462. return $core.withContext(function($ctx1) {
  2463. //>>excludeEnd("ctx");
  2464. return $recv(self._class())._collectionClass();
  2465. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2466. }, function($ctx1) {$ctx1.fill(self,"collectionClass",{},$globals.CollectionTest)});
  2467. //>>excludeEnd("ctx");
  2468. },
  2469. //>>excludeStart("ide", pragmas.excludeIdeData);
  2470. args: [],
  2471. source: "collectionClass\x0a\x09\x22Answers class of collection type tested\x22\x0a\x0a\x09^ self class collectionClass",
  2472. referencedClasses: [],
  2473. //>>excludeEnd("ide");
  2474. messageSends: ["collectionClass", "class"]
  2475. }),
  2476. $globals.CollectionTest);
  2477. $core.addMethod(
  2478. $core.method({
  2479. selector: "collectionOfPrintStrings",
  2480. protocol: 'fixture',
  2481. fn: function (){
  2482. var self=this;
  2483. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2484. return $core.withContext(function($ctx1) {
  2485. //>>excludeEnd("ctx");
  2486. self._subclassResponsibility();
  2487. return self;
  2488. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2489. }, function($ctx1) {$ctx1.fill(self,"collectionOfPrintStrings",{},$globals.CollectionTest)});
  2490. //>>excludeEnd("ctx");
  2491. },
  2492. //>>excludeStart("ide", pragmas.excludeIdeData);
  2493. args: [],
  2494. source: "collectionOfPrintStrings\x0a\x09\x22Answers self collection but with values\x0a\x09changed to their printStrings\x22\x0a\x0a\x09self subclassResponsibility",
  2495. referencedClasses: [],
  2496. //>>excludeEnd("ide");
  2497. messageSends: ["subclassResponsibility"]
  2498. }),
  2499. $globals.CollectionTest);
  2500. $core.addMethod(
  2501. $core.method({
  2502. selector: "collectionSize",
  2503. protocol: 'fixture',
  2504. fn: function (){
  2505. var self=this;
  2506. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2507. return $core.withContext(function($ctx1) {
  2508. //>>excludeEnd("ctx");
  2509. self._subclassResponsibility();
  2510. return self;
  2511. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2512. }, function($ctx1) {$ctx1.fill(self,"collectionSize",{},$globals.CollectionTest)});
  2513. //>>excludeEnd("ctx");
  2514. },
  2515. //>>excludeStart("ide", pragmas.excludeIdeData);
  2516. args: [],
  2517. source: "collectionSize\x0a\x09\x22Answers size of self collection.\x22\x0a\x0a\x09self subclassResponsibility",
  2518. referencedClasses: [],
  2519. //>>excludeEnd("ide");
  2520. messageSends: ["subclassResponsibility"]
  2521. }),
  2522. $globals.CollectionTest);
  2523. $core.addMethod(
  2524. $core.method({
  2525. selector: "collectionWithDuplicates",
  2526. protocol: 'fixture',
  2527. fn: function (){
  2528. var self=this;
  2529. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2530. return $core.withContext(function($ctx1) {
  2531. //>>excludeEnd("ctx");
  2532. self._subclassResponsibility();
  2533. return self;
  2534. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2535. }, function($ctx1) {$ctx1.fill(self,"collectionWithDuplicates",{},$globals.CollectionTest)});
  2536. //>>excludeEnd("ctx");
  2537. },
  2538. //>>excludeStart("ide", pragmas.excludeIdeData);
  2539. args: [],
  2540. 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",
  2541. referencedClasses: [],
  2542. //>>excludeEnd("ide");
  2543. messageSends: ["subclassResponsibility"]
  2544. }),
  2545. $globals.CollectionTest);
  2546. $core.addMethod(
  2547. $core.method({
  2548. selector: "collectionWithNewValue",
  2549. protocol: 'fixture',
  2550. fn: function (){
  2551. var self=this;
  2552. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2553. return $core.withContext(function($ctx1) {
  2554. //>>excludeEnd("ctx");
  2555. self._subclassResponsibility();
  2556. return self;
  2557. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2558. }, function($ctx1) {$ctx1.fill(self,"collectionWithNewValue",{},$globals.CollectionTest)});
  2559. //>>excludeEnd("ctx");
  2560. },
  2561. //>>excludeStart("ide", pragmas.excludeIdeData);
  2562. args: [],
  2563. 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",
  2564. referencedClasses: [],
  2565. //>>excludeEnd("ide");
  2566. messageSends: ["subclassResponsibility"]
  2567. }),
  2568. $globals.CollectionTest);
  2569. $core.addMethod(
  2570. $core.method({
  2571. selector: "initialize",
  2572. protocol: 'initialization',
  2573. fn: function (){
  2574. var self=this;
  2575. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2576. return $core.withContext(function($ctx1) {
  2577. //>>excludeEnd("ctx");
  2578. (
  2579. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2580. $ctx1.supercall = true,
  2581. //>>excludeEnd("ctx");
  2582. ($globals.CollectionTest.superclass||$boot.dnu).fn.prototype._initialize.apply($recv(self), []));
  2583. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2584. $ctx1.supercall = false;
  2585. //>>excludeEnd("ctx");;
  2586. self["@sampleBlock"]=(function(){
  2587. });
  2588. return self;
  2589. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2590. }, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.CollectionTest)});
  2591. //>>excludeEnd("ctx");
  2592. },
  2593. //>>excludeStart("ide", pragmas.excludeIdeData);
  2594. args: [],
  2595. source: "initialize\x0a\x09super initialize.\x0a\x0a\x09sampleBlock := []",
  2596. referencedClasses: [],
  2597. //>>excludeEnd("ide");
  2598. messageSends: ["initialize"]
  2599. }),
  2600. $globals.CollectionTest);
  2601. $core.addMethod(
  2602. $core.method({
  2603. selector: "isCollectionReadOnly",
  2604. protocol: 'testing',
  2605. fn: function (){
  2606. var self=this;
  2607. return false;
  2608. },
  2609. //>>excludeStart("ide", pragmas.excludeIdeData);
  2610. args: [],
  2611. source: "isCollectionReadOnly\x0a\x09^ false",
  2612. referencedClasses: [],
  2613. //>>excludeEnd("ide");
  2614. messageSends: []
  2615. }),
  2616. $globals.CollectionTest);
  2617. $core.addMethod(
  2618. $core.method({
  2619. selector: "sampleNewValue",
  2620. protocol: 'fixture',
  2621. fn: function (){
  2622. var self=this;
  2623. return "N";
  2624. },
  2625. //>>excludeStart("ide", pragmas.excludeIdeData);
  2626. args: [],
  2627. 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'",
  2628. referencedClasses: [],
  2629. //>>excludeEnd("ide");
  2630. messageSends: []
  2631. }),
  2632. $globals.CollectionTest);
  2633. $core.addMethod(
  2634. $core.method({
  2635. selector: "sampleNewValueAsCollection",
  2636. protocol: 'fixture',
  2637. fn: function (){
  2638. var self=this;
  2639. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2640. return $core.withContext(function($ctx1) {
  2641. //>>excludeEnd("ctx");
  2642. return $recv(self._collectionClass())._with_(self._sampleNewValue());
  2643. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2644. }, function($ctx1) {$ctx1.fill(self,"sampleNewValueAsCollection",{},$globals.CollectionTest)});
  2645. //>>excludeEnd("ctx");
  2646. },
  2647. //>>excludeStart("ide", pragmas.excludeIdeData);
  2648. args: [],
  2649. 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",
  2650. referencedClasses: [],
  2651. //>>excludeEnd("ide");
  2652. messageSends: ["with:", "collectionClass", "sampleNewValue"]
  2653. }),
  2654. $globals.CollectionTest);
  2655. $core.addMethod(
  2656. $core.method({
  2657. selector: "testAddAll",
  2658. protocol: 'tests',
  2659. fn: function (){
  2660. var self=this;
  2661. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2662. return $core.withContext(function($ctx1) {
  2663. //>>excludeEnd("ctx");
  2664. var $2,$4,$3,$5,$1,$6,$9,$8,$10,$11,$7,$12,$15,$14,$17,$16,$18,$13,$20,$21,$22,$19,$23,$25,$24;
  2665. $2=self._collection();
  2666. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2667. $ctx1.sendIdx["collection"]=1;
  2668. //>>excludeEnd("ctx");
  2669. $4=self._collectionClass();
  2670. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2671. $ctx1.sendIdx["collectionClass"]=1;
  2672. //>>excludeEnd("ctx");
  2673. $3=$recv($4)._new();
  2674. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2675. $ctx1.sendIdx["new"]=1;
  2676. //>>excludeEnd("ctx");
  2677. $recv($2)._addAll_($3);
  2678. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2679. $ctx1.sendIdx["addAll:"]=1;
  2680. //>>excludeEnd("ctx");
  2681. $5=$recv($2)._yourself();
  2682. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2683. $ctx1.sendIdx["yourself"]=1;
  2684. //>>excludeEnd("ctx");
  2685. $1=$5;
  2686. $6=self._collection();
  2687. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2688. $ctx1.sendIdx["collection"]=2;
  2689. //>>excludeEnd("ctx");
  2690. self._assert_equals_($1,$6);
  2691. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2692. $ctx1.sendIdx["assert:equals:"]=1;
  2693. //>>excludeEnd("ctx");
  2694. $9=self._collectionClass();
  2695. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2696. $ctx1.sendIdx["collectionClass"]=2;
  2697. //>>excludeEnd("ctx");
  2698. $8=$recv($9)._new();
  2699. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2700. $ctx1.sendIdx["new"]=2;
  2701. //>>excludeEnd("ctx");
  2702. $10=self._collection();
  2703. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2704. $ctx1.sendIdx["collection"]=3;
  2705. //>>excludeEnd("ctx");
  2706. $recv($8)._addAll_($10);
  2707. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2708. $ctx1.sendIdx["addAll:"]=2;
  2709. //>>excludeEnd("ctx");
  2710. $11=$recv($8)._yourself();
  2711. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2712. $ctx1.sendIdx["yourself"]=2;
  2713. //>>excludeEnd("ctx");
  2714. $7=$11;
  2715. $12=self._collection();
  2716. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2717. $ctx1.sendIdx["collection"]=4;
  2718. //>>excludeEnd("ctx");
  2719. self._assert_equals_($7,$12);
  2720. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2721. $ctx1.sendIdx["assert:equals:"]=2;
  2722. //>>excludeEnd("ctx");
  2723. $15=self._collectionClass();
  2724. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2725. $ctx1.sendIdx["collectionClass"]=3;
  2726. //>>excludeEnd("ctx");
  2727. $14=$recv($15)._new();
  2728. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2729. $ctx1.sendIdx["new"]=3;
  2730. //>>excludeEnd("ctx");
  2731. $17=self._collectionClass();
  2732. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2733. $ctx1.sendIdx["collectionClass"]=4;
  2734. //>>excludeEnd("ctx");
  2735. $16=$recv($17)._new();
  2736. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2737. $ctx1.sendIdx["new"]=4;
  2738. //>>excludeEnd("ctx");
  2739. $recv($14)._addAll_($16);
  2740. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2741. $ctx1.sendIdx["addAll:"]=3;
  2742. //>>excludeEnd("ctx");
  2743. $18=$recv($14)._yourself();
  2744. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2745. $ctx1.sendIdx["yourself"]=3;
  2746. //>>excludeEnd("ctx");
  2747. $13=$18;
  2748. self._assert_equals_($13,$recv(self._collectionClass())._new());
  2749. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2750. $ctx1.sendIdx["assert:equals:"]=3;
  2751. //>>excludeEnd("ctx");
  2752. $20=self._collection();
  2753. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2754. $ctx1.sendIdx["collection"]=5;
  2755. //>>excludeEnd("ctx");
  2756. $21=self._sampleNewValueAsCollection();
  2757. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2758. $ctx1.sendIdx["sampleNewValueAsCollection"]=1;
  2759. //>>excludeEnd("ctx");
  2760. $recv($20)._addAll_($21);
  2761. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2762. $ctx1.sendIdx["addAll:"]=4;
  2763. //>>excludeEnd("ctx");
  2764. $22=$recv($20)._yourself();
  2765. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2766. $ctx1.sendIdx["yourself"]=4;
  2767. //>>excludeEnd("ctx");
  2768. $19=$22;
  2769. $23=self._collectionWithNewValue();
  2770. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2771. $ctx1.sendIdx["collectionWithNewValue"]=1;
  2772. //>>excludeEnd("ctx");
  2773. self._assert_equals_($19,$23);
  2774. $25=self._sampleNewValueAsCollection();
  2775. $recv($25)._addAll_(self._collection());
  2776. $24=$recv($25)._yourself();
  2777. self._assertSameContents_as_($24,self._collectionWithNewValue());
  2778. return self;
  2779. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2780. }, function($ctx1) {$ctx1.fill(self,"testAddAll",{},$globals.CollectionTest)});
  2781. //>>excludeEnd("ctx");
  2782. },
  2783. //>>excludeStart("ide", pragmas.excludeIdeData);
  2784. args: [],
  2785. 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",
  2786. referencedClasses: [],
  2787. //>>excludeEnd("ide");
  2788. messageSends: ["assert:equals:", "addAll:", "collection", "new", "collectionClass", "yourself", "sampleNewValueAsCollection", "collectionWithNewValue", "assertSameContents:as:"]
  2789. }),
  2790. $globals.CollectionTest);
  2791. $core.addMethod(
  2792. $core.method({
  2793. selector: "testAllSatisfy",
  2794. protocol: 'tests',
  2795. fn: function (){
  2796. var self=this;
  2797. var collection,anyOne;
  2798. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2799. return $core.withContext(function($ctx1) {
  2800. //>>excludeEnd("ctx");
  2801. var $1;
  2802. collection=self._collection();
  2803. anyOne=$recv(collection)._anyOne();
  2804. $1=$recv(collection)._allSatisfy_((function(each){
  2805. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2806. return $core.withContext(function($ctx2) {
  2807. //>>excludeEnd("ctx");
  2808. return $recv(collection)._includes_(each);
  2809. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2810. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2811. //>>excludeEnd("ctx");
  2812. }));
  2813. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2814. $ctx1.sendIdx["allSatisfy:"]=1;
  2815. //>>excludeEnd("ctx");
  2816. self._assert_($1);
  2817. self._deny_($recv(collection)._allSatisfy_((function(each){
  2818. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2819. return $core.withContext(function($ctx2) {
  2820. //>>excludeEnd("ctx");
  2821. return $recv(each).__tild_eq(anyOne);
  2822. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2823. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
  2824. //>>excludeEnd("ctx");
  2825. })));
  2826. return self;
  2827. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2828. }, function($ctx1) {$ctx1.fill(self,"testAllSatisfy",{collection:collection,anyOne:anyOne},$globals.CollectionTest)});
  2829. //>>excludeEnd("ctx");
  2830. },
  2831. //>>excludeStart("ide", pragmas.excludeIdeData);
  2832. args: [],
  2833. 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 ])",
  2834. referencedClasses: [],
  2835. //>>excludeEnd("ide");
  2836. messageSends: ["collection", "anyOne", "assert:", "allSatisfy:", "includes:", "deny:", "~="]
  2837. }),
  2838. $globals.CollectionTest);
  2839. $core.addMethod(
  2840. $core.method({
  2841. selector: "testAnyOne",
  2842. protocol: 'tests',
  2843. fn: function (){
  2844. var self=this;
  2845. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  2846. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2847. return $core.withContext(function($ctx1) {
  2848. //>>excludeEnd("ctx");
  2849. var $2,$1;
  2850. self._should_raise_((function(){
  2851. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2852. return $core.withContext(function($ctx2) {
  2853. //>>excludeEnd("ctx");
  2854. return $recv($recv(self._collectionClass())._new())._anyOne();
  2855. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2856. $ctx2.sendIdx["anyOne"]=1;
  2857. //>>excludeEnd("ctx");
  2858. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2859. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  2860. //>>excludeEnd("ctx");
  2861. }),$Error());
  2862. $2=self._collection();
  2863. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2864. $ctx1.sendIdx["collection"]=1;
  2865. //>>excludeEnd("ctx");
  2866. $1=$recv($2)._includes_($recv(self._collection())._anyOne());
  2867. self._assert_($1);
  2868. return self;
  2869. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2870. }, function($ctx1) {$ctx1.fill(self,"testAnyOne",{},$globals.CollectionTest)});
  2871. //>>excludeEnd("ctx");
  2872. },
  2873. //>>excludeStart("ide", pragmas.excludeIdeData);
  2874. args: [],
  2875. source: "testAnyOne\x0a\x09self should: [ self collectionClass new anyOne ] raise: Error.\x0a\x09self assert: (self collection includes: self collection anyOne)",
  2876. referencedClasses: ["Error"],
  2877. //>>excludeEnd("ide");
  2878. messageSends: ["should:raise:", "anyOne", "new", "collectionClass", "assert:", "includes:", "collection"]
  2879. }),
  2880. $globals.CollectionTest);
  2881. $core.addMethod(
  2882. $core.method({
  2883. selector: "testAnySatisfy",
  2884. protocol: 'tests',
  2885. fn: function (){
  2886. var self=this;
  2887. var anyOne;
  2888. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  2889. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2890. return $core.withContext(function($ctx1) {
  2891. //>>excludeEnd("ctx");
  2892. var $1,$3,$2;
  2893. $1=self._collection();
  2894. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2895. $ctx1.sendIdx["collection"]=1;
  2896. //>>excludeEnd("ctx");
  2897. anyOne=$recv($1)._anyOne();
  2898. $3=self._collection();
  2899. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2900. $ctx1.sendIdx["collection"]=2;
  2901. //>>excludeEnd("ctx");
  2902. $2=$recv($3)._anySatisfy_((function(each){
  2903. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2904. return $core.withContext(function($ctx2) {
  2905. //>>excludeEnd("ctx");
  2906. return $recv(each).__eq(anyOne);
  2907. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2908. $ctx2.sendIdx["="]=1;
  2909. //>>excludeEnd("ctx");
  2910. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2911. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2912. //>>excludeEnd("ctx");
  2913. }));
  2914. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2915. $ctx1.sendIdx["anySatisfy:"]=1;
  2916. //>>excludeEnd("ctx");
  2917. self._assert_($2);
  2918. self._deny_($recv(self._collection())._anySatisfy_((function(each){
  2919. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2920. return $core.withContext(function($ctx2) {
  2921. //>>excludeEnd("ctx");
  2922. return $recv(each).__eq($recv($Object())._new());
  2923. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2924. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
  2925. //>>excludeEnd("ctx");
  2926. })));
  2927. return self;
  2928. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2929. }, function($ctx1) {$ctx1.fill(self,"testAnySatisfy",{anyOne:anyOne},$globals.CollectionTest)});
  2930. //>>excludeEnd("ctx");
  2931. },
  2932. //>>excludeStart("ide", pragmas.excludeIdeData);
  2933. args: [],
  2934. 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 ])",
  2935. referencedClasses: ["Object"],
  2936. //>>excludeEnd("ide");
  2937. messageSends: ["anyOne", "collection", "assert:", "anySatisfy:", "=", "deny:", "new"]
  2938. }),
  2939. $globals.CollectionTest);
  2940. $core.addMethod(
  2941. $core.method({
  2942. selector: "testAsArray",
  2943. protocol: 'tests',
  2944. fn: function (){
  2945. var self=this;
  2946. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2947. return $core.withContext(function($ctx1) {
  2948. //>>excludeEnd("ctx");
  2949. var $1;
  2950. $1=self._collection();
  2951. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2952. $ctx1.sendIdx["collection"]=1;
  2953. //>>excludeEnd("ctx");
  2954. self._assertSameContents_as_($1,$recv(self._collection())._asArray());
  2955. return self;
  2956. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2957. }, function($ctx1) {$ctx1.fill(self,"testAsArray",{},$globals.CollectionTest)});
  2958. //>>excludeEnd("ctx");
  2959. },
  2960. //>>excludeStart("ide", pragmas.excludeIdeData);
  2961. args: [],
  2962. source: "testAsArray\x0a\x09self\x0a\x09\x09assertSameContents: self collection\x0a\x09\x09as: self collection asArray",
  2963. referencedClasses: [],
  2964. //>>excludeEnd("ide");
  2965. messageSends: ["assertSameContents:as:", "collection", "asArray"]
  2966. }),
  2967. $globals.CollectionTest);
  2968. $core.addMethod(
  2969. $core.method({
  2970. selector: "testAsOrderedCollection",
  2971. protocol: 'tests',
  2972. fn: function (){
  2973. var self=this;
  2974. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2975. return $core.withContext(function($ctx1) {
  2976. //>>excludeEnd("ctx");
  2977. var $1;
  2978. $1=self._collection();
  2979. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2980. $ctx1.sendIdx["collection"]=1;
  2981. //>>excludeEnd("ctx");
  2982. self._assertSameContents_as_($1,$recv(self._collection())._asOrderedCollection());
  2983. return self;
  2984. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2985. }, function($ctx1) {$ctx1.fill(self,"testAsOrderedCollection",{},$globals.CollectionTest)});
  2986. //>>excludeEnd("ctx");
  2987. },
  2988. //>>excludeStart("ide", pragmas.excludeIdeData);
  2989. args: [],
  2990. source: "testAsOrderedCollection\x0a\x09self\x0a\x09\x09assertSameContents: self collection\x0a\x09\x09as: self collection asOrderedCollection",
  2991. referencedClasses: [],
  2992. //>>excludeEnd("ide");
  2993. messageSends: ["assertSameContents:as:", "collection", "asOrderedCollection"]
  2994. }),
  2995. $globals.CollectionTest);
  2996. $core.addMethod(
  2997. $core.method({
  2998. selector: "testAsSet",
  2999. protocol: 'tests',
  3000. fn: function (){
  3001. var self=this;
  3002. var c,set;
  3003. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3004. return $core.withContext(function($ctx1) {
  3005. //>>excludeEnd("ctx");
  3006. c=self._collectionWithDuplicates();
  3007. set=$recv(c)._asSet();
  3008. self._assert_equals_($recv(set)._size(),(6));
  3009. $recv(c)._do_((function(each){
  3010. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3011. return $core.withContext(function($ctx2) {
  3012. //>>excludeEnd("ctx");
  3013. return self._assert_($recv(set)._includes_(each));
  3014. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3015. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  3016. //>>excludeEnd("ctx");
  3017. }));
  3018. return self;
  3019. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3020. }, function($ctx1) {$ctx1.fill(self,"testAsSet",{c:c,set:set},$globals.CollectionTest)});
  3021. //>>excludeEnd("ctx");
  3022. },
  3023. //>>excludeStart("ide", pragmas.excludeIdeData);
  3024. args: [],
  3025. source: "testAsSet\x0a\x09| c set |\x0a\x09c := self collectionWithDuplicates.\x0a\x09set := c asSet.\x0a\x09self assert: set size equals: 6.\x0a\x09c do: [ :each |\x0a\x09\x09self assert: (set includes: each) ]",
  3026. referencedClasses: [],
  3027. //>>excludeEnd("ide");
  3028. messageSends: ["collectionWithDuplicates", "asSet", "assert:equals:", "size", "do:", "assert:", "includes:"]
  3029. }),
  3030. $globals.CollectionTest);
  3031. $core.addMethod(
  3032. $core.method({
  3033. selector: "testCollect",
  3034. protocol: 'tests',
  3035. fn: function (){
  3036. var self=this;
  3037. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3038. return $core.withContext(function($ctx1) {
  3039. //>>excludeEnd("ctx");
  3040. var $2,$1,$3,$5,$4,$8,$7,$6,$11,$10,$9;
  3041. $2=self._collection();
  3042. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3043. $ctx1.sendIdx["collection"]=1;
  3044. //>>excludeEnd("ctx");
  3045. $1=$recv($2)._collect_((function(each){
  3046. return each;
  3047. }));
  3048. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3049. $ctx1.sendIdx["collect:"]=1;
  3050. //>>excludeEnd("ctx");
  3051. $3=self._collection();
  3052. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3053. $ctx1.sendIdx["collection"]=2;
  3054. //>>excludeEnd("ctx");
  3055. self._assert_equals_($1,$3);
  3056. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3057. $ctx1.sendIdx["assert:equals:"]=1;
  3058. //>>excludeEnd("ctx");
  3059. $5=self._collectionWithNewValue();
  3060. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3061. $ctx1.sendIdx["collectionWithNewValue"]=1;
  3062. //>>excludeEnd("ctx");
  3063. $4=$recv($5)._collect_((function(each){
  3064. return each;
  3065. }));
  3066. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3067. $ctx1.sendIdx["collect:"]=2;
  3068. //>>excludeEnd("ctx");
  3069. self._assert_equals_($4,self._collectionWithNewValue());
  3070. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3071. $ctx1.sendIdx["assert:equals:"]=2;
  3072. //>>excludeEnd("ctx");
  3073. $8=self._collectionClass();
  3074. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3075. $ctx1.sendIdx["collectionClass"]=1;
  3076. //>>excludeEnd("ctx");
  3077. $7=$recv($8)._new();
  3078. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3079. $ctx1.sendIdx["new"]=1;
  3080. //>>excludeEnd("ctx");
  3081. $6=$recv($7)._collect_((function(each){
  3082. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3083. return $core.withContext(function($ctx2) {
  3084. //>>excludeEnd("ctx");
  3085. return $recv(each)._printString();
  3086. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3087. $ctx2.sendIdx["printString"]=1;
  3088. //>>excludeEnd("ctx");
  3089. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3090. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,3)});
  3091. //>>excludeEnd("ctx");
  3092. }));
  3093. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3094. $ctx1.sendIdx["collect:"]=3;
  3095. //>>excludeEnd("ctx");
  3096. self._assert_equals_($6,$recv(self._collectionClass())._new());
  3097. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3098. $ctx1.sendIdx["assert:equals:"]=3;
  3099. //>>excludeEnd("ctx");
  3100. $11=self._collection();
  3101. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3102. $ctx1.sendIdx["collection"]=3;
  3103. //>>excludeEnd("ctx");
  3104. $10=$recv($11)._collect_((function(){
  3105. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3106. return $core.withContext(function($ctx2) {
  3107. //>>excludeEnd("ctx");
  3108. return self._sampleNewValue();
  3109. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3110. $ctx2.sendIdx["sampleNewValue"]=1;
  3111. //>>excludeEnd("ctx");
  3112. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3113. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,4)});
  3114. //>>excludeEnd("ctx");
  3115. }));
  3116. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3117. $ctx1.sendIdx["collect:"]=4;
  3118. //>>excludeEnd("ctx");
  3119. $9=$recv($10)._detect_((function(){
  3120. return true;
  3121. }));
  3122. self._assert_equals_($9,self._sampleNewValue());
  3123. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3124. $ctx1.sendIdx["assert:equals:"]=4;
  3125. //>>excludeEnd("ctx");
  3126. self._assert_equals_($recv(self._collection())._collect_((function(each){
  3127. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3128. return $core.withContext(function($ctx2) {
  3129. //>>excludeEnd("ctx");
  3130. return $recv(each)._printString();
  3131. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3132. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,6)});
  3133. //>>excludeEnd("ctx");
  3134. })),self._collectionOfPrintStrings());
  3135. return self;
  3136. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3137. }, function($ctx1) {$ctx1.fill(self,"testCollect",{},$globals.CollectionTest)});
  3138. //>>excludeEnd("ctx");
  3139. },
  3140. //>>excludeStart("ide", pragmas.excludeIdeData);
  3141. args: [],
  3142. 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",
  3143. referencedClasses: [],
  3144. //>>excludeEnd("ide");
  3145. messageSends: ["assert:equals:", "collect:", "collection", "collectionWithNewValue", "new", "collectionClass", "printString", "detect:", "sampleNewValue", "collectionOfPrintStrings"]
  3146. }),
  3147. $globals.CollectionTest);
  3148. $core.addMethod(
  3149. $core.method({
  3150. selector: "testComma",
  3151. protocol: 'tests',
  3152. fn: function (){
  3153. var self=this;
  3154. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3155. return $core.withContext(function($ctx1) {
  3156. //>>excludeEnd("ctx");
  3157. var $2,$4,$3,$1,$5,$8,$7,$9,$6,$10,$13,$12,$15,$14,$11,$17,$18,$16,$19;
  3158. $2=self._collection();
  3159. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3160. $ctx1.sendIdx["collection"]=1;
  3161. //>>excludeEnd("ctx");
  3162. $4=self._collectionClass();
  3163. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3164. $ctx1.sendIdx["collectionClass"]=1;
  3165. //>>excludeEnd("ctx");
  3166. $3=$recv($4)._new();
  3167. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3168. $ctx1.sendIdx["new"]=1;
  3169. //>>excludeEnd("ctx");
  3170. $1=$recv($2).__comma($3);
  3171. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3172. $ctx1.sendIdx[","]=1;
  3173. //>>excludeEnd("ctx");
  3174. $5=self._collection();
  3175. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3176. $ctx1.sendIdx["collection"]=2;
  3177. //>>excludeEnd("ctx");
  3178. self._assert_equals_($1,$5);
  3179. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3180. $ctx1.sendIdx["assert:equals:"]=1;
  3181. //>>excludeEnd("ctx");
  3182. $8=self._collectionClass();
  3183. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3184. $ctx1.sendIdx["collectionClass"]=2;
  3185. //>>excludeEnd("ctx");
  3186. $7=$recv($8)._new();
  3187. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3188. $ctx1.sendIdx["new"]=2;
  3189. //>>excludeEnd("ctx");
  3190. $9=self._collection();
  3191. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3192. $ctx1.sendIdx["collection"]=3;
  3193. //>>excludeEnd("ctx");
  3194. $6=$recv($7).__comma($9);
  3195. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3196. $ctx1.sendIdx[","]=2;
  3197. //>>excludeEnd("ctx");
  3198. $10=self._collection();
  3199. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3200. $ctx1.sendIdx["collection"]=4;
  3201. //>>excludeEnd("ctx");
  3202. self._assert_equals_($6,$10);
  3203. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3204. $ctx1.sendIdx["assert:equals:"]=2;
  3205. //>>excludeEnd("ctx");
  3206. $13=self._collectionClass();
  3207. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3208. $ctx1.sendIdx["collectionClass"]=3;
  3209. //>>excludeEnd("ctx");
  3210. $12=$recv($13)._new();
  3211. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3212. $ctx1.sendIdx["new"]=3;
  3213. //>>excludeEnd("ctx");
  3214. $15=self._collectionClass();
  3215. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3216. $ctx1.sendIdx["collectionClass"]=4;
  3217. //>>excludeEnd("ctx");
  3218. $14=$recv($15)._new();
  3219. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3220. $ctx1.sendIdx["new"]=4;
  3221. //>>excludeEnd("ctx");
  3222. $11=$recv($12).__comma($14);
  3223. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3224. $ctx1.sendIdx[","]=3;
  3225. //>>excludeEnd("ctx");
  3226. self._assert_equals_($11,$recv(self._collectionClass())._new());
  3227. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3228. $ctx1.sendIdx["assert:equals:"]=3;
  3229. //>>excludeEnd("ctx");
  3230. $17=self._collection();
  3231. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3232. $ctx1.sendIdx["collection"]=5;
  3233. //>>excludeEnd("ctx");
  3234. $18=self._sampleNewValueAsCollection();
  3235. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3236. $ctx1.sendIdx["sampleNewValueAsCollection"]=1;
  3237. //>>excludeEnd("ctx");
  3238. $16=$recv($17).__comma($18);
  3239. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3240. $ctx1.sendIdx[","]=4;
  3241. //>>excludeEnd("ctx");
  3242. $19=self._collectionWithNewValue();
  3243. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3244. $ctx1.sendIdx["collectionWithNewValue"]=1;
  3245. //>>excludeEnd("ctx");
  3246. self._assert_equals_($16,$19);
  3247. self._assertSameContents_as_($recv(self._sampleNewValueAsCollection()).__comma(self._collection()),self._collectionWithNewValue());
  3248. return self;
  3249. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3250. }, function($ctx1) {$ctx1.fill(self,"testComma",{},$globals.CollectionTest)});
  3251. //>>excludeEnd("ctx");
  3252. },
  3253. //>>excludeStart("ide", pragmas.excludeIdeData);
  3254. args: [],
  3255. 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",
  3256. referencedClasses: [],
  3257. //>>excludeEnd("ide");
  3258. messageSends: ["assert:equals:", ",", "collection", "new", "collectionClass", "sampleNewValueAsCollection", "collectionWithNewValue", "assertSameContents:as:"]
  3259. }),
  3260. $globals.CollectionTest);
  3261. $core.addMethod(
  3262. $core.method({
  3263. selector: "testCopy",
  3264. protocol: 'tests',
  3265. fn: function (){
  3266. var self=this;
  3267. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3268. return $core.withContext(function($ctx1) {
  3269. //>>excludeEnd("ctx");
  3270. var $3,$2,$1,$5,$4,$7,$6,$8,$10,$9,$11,$15,$14,$13,$16,$12,$19,$18,$17;
  3271. $3=self._collectionClass();
  3272. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3273. $ctx1.sendIdx["collectionClass"]=1;
  3274. //>>excludeEnd("ctx");
  3275. $2=$recv($3)._new();
  3276. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3277. $ctx1.sendIdx["new"]=1;
  3278. //>>excludeEnd("ctx");
  3279. $1=$recv($2)._copy();
  3280. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3281. $ctx1.sendIdx["copy"]=1;
  3282. //>>excludeEnd("ctx");
  3283. $5=self._collectionClass();
  3284. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3285. $ctx1.sendIdx["collectionClass"]=2;
  3286. //>>excludeEnd("ctx");
  3287. $4=$recv($5)._new();
  3288. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3289. $ctx1.sendIdx["new"]=2;
  3290. //>>excludeEnd("ctx");
  3291. self._assert_equals_($1,$4);
  3292. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3293. $ctx1.sendIdx["assert:equals:"]=1;
  3294. //>>excludeEnd("ctx");
  3295. $7=self._collection();
  3296. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3297. $ctx1.sendIdx["collection"]=1;
  3298. //>>excludeEnd("ctx");
  3299. $6=$recv($7)._copy();
  3300. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3301. $ctx1.sendIdx["copy"]=2;
  3302. //>>excludeEnd("ctx");
  3303. $8=self._collection();
  3304. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3305. $ctx1.sendIdx["collection"]=2;
  3306. //>>excludeEnd("ctx");
  3307. self._assert_equals_($6,$8);
  3308. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3309. $ctx1.sendIdx["assert:equals:"]=2;
  3310. //>>excludeEnd("ctx");
  3311. $10=self._collectionWithNewValue();
  3312. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3313. $ctx1.sendIdx["collectionWithNewValue"]=1;
  3314. //>>excludeEnd("ctx");
  3315. $9=$recv($10)._copy();
  3316. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3317. $ctx1.sendIdx["copy"]=3;
  3318. //>>excludeEnd("ctx");
  3319. $11=self._collectionWithNewValue();
  3320. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3321. $ctx1.sendIdx["collectionWithNewValue"]=2;
  3322. //>>excludeEnd("ctx");
  3323. self._assert_equals_($9,$11);
  3324. $15=self._collectionClass();
  3325. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3326. $ctx1.sendIdx["collectionClass"]=3;
  3327. //>>excludeEnd("ctx");
  3328. $14=$recv($15)._new();
  3329. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3330. $ctx1.sendIdx["new"]=3;
  3331. //>>excludeEnd("ctx");
  3332. $13=$recv($14)._copy();
  3333. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3334. $ctx1.sendIdx["copy"]=4;
  3335. //>>excludeEnd("ctx");
  3336. $16=self._collection();
  3337. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3338. $ctx1.sendIdx["collection"]=3;
  3339. //>>excludeEnd("ctx");
  3340. $12=$recv($13).__eq($16);
  3341. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3342. $ctx1.sendIdx["="]=1;
  3343. //>>excludeEnd("ctx");
  3344. self._deny_($12);
  3345. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3346. $ctx1.sendIdx["deny:"]=1;
  3347. //>>excludeEnd("ctx");
  3348. $19=self._collection();
  3349. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3350. $ctx1.sendIdx["collection"]=4;
  3351. //>>excludeEnd("ctx");
  3352. $18=$recv($19)._copy();
  3353. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3354. $ctx1.sendIdx["copy"]=5;
  3355. //>>excludeEnd("ctx");
  3356. $17=$recv($18).__eq($recv(self._collectionClass())._new());
  3357. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3358. $ctx1.sendIdx["="]=2;
  3359. //>>excludeEnd("ctx");
  3360. self._deny_($17);
  3361. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3362. $ctx1.sendIdx["deny:"]=2;
  3363. //>>excludeEnd("ctx");
  3364. self._deny_($recv($recv(self._collection())._copy()).__eq(self._collectionWithNewValue()));
  3365. return self;
  3366. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3367. }, function($ctx1) {$ctx1.fill(self,"testCopy",{},$globals.CollectionTest)});
  3368. //>>excludeEnd("ctx");
  3369. },
  3370. //>>excludeStart("ide", pragmas.excludeIdeData);
  3371. args: [],
  3372. source: "testCopy\x0a\x09self assert: self collectionClass new copy equals: self collectionClass new.\x0a\x09self assert: self collection copy equals: self collection.\x0a\x09self assert: self collectionWithNewValue copy equals: self collectionWithNewValue.\x0a\x09\x0a\x09self deny: self collectionClass new copy = self collection.\x0a\x09self deny: self collection copy = self collectionClass new.\x0a\x09self deny: self collection copy = self collectionWithNewValue",
  3373. referencedClasses: [],
  3374. //>>excludeEnd("ide");
  3375. messageSends: ["assert:equals:", "copy", "new", "collectionClass", "collection", "collectionWithNewValue", "deny:", "="]
  3376. }),
  3377. $globals.CollectionTest);
  3378. $core.addMethod(
  3379. $core.method({
  3380. selector: "testCopySeparates",
  3381. protocol: 'tests',
  3382. fn: function (){
  3383. var self=this;
  3384. var original,copy;
  3385. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3386. return $core.withContext(function($ctx1) {
  3387. //>>excludeEnd("ctx");
  3388. original=self._collection();
  3389. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3390. $ctx1.sendIdx["collection"]=1;
  3391. //>>excludeEnd("ctx");
  3392. copy=$recv(original)._copy();
  3393. $recv(copy)._addAll_(self._sampleNewValueAsCollection());
  3394. self._assert_($recv(original).__eq(self._collection()));
  3395. return self;
  3396. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3397. }, function($ctx1) {$ctx1.fill(self,"testCopySeparates",{original:original,copy:copy},$globals.CollectionTest)});
  3398. //>>excludeEnd("ctx");
  3399. },
  3400. //>>excludeStart("ide", pragmas.excludeIdeData);
  3401. args: [],
  3402. source: "testCopySeparates\x0a\x09| original copy |\x0a\x09original := self collection.\x0a\x09copy := original copy.\x0a\x09copy addAll: self sampleNewValueAsCollection.\x0a\x09self assert: original = self collection",
  3403. referencedClasses: [],
  3404. //>>excludeEnd("ide");
  3405. messageSends: ["collection", "copy", "addAll:", "sampleNewValueAsCollection", "assert:", "="]
  3406. }),
  3407. $globals.CollectionTest);
  3408. $core.addMethod(
  3409. $core.method({
  3410. selector: "testDetect",
  3411. protocol: 'tests',
  3412. fn: function (){
  3413. var self=this;
  3414. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  3415. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3416. return $core.withContext(function($ctx1) {
  3417. //>>excludeEnd("ctx");
  3418. var $1,$2,$3,$4,$6,$5,$7;
  3419. self._shouldnt_raise_((function(){
  3420. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3421. return $core.withContext(function($ctx2) {
  3422. //>>excludeEnd("ctx");
  3423. $1=self._collection();
  3424. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3425. $ctx2.sendIdx["collection"]=1;
  3426. //>>excludeEnd("ctx");
  3427. return $recv($1)._detect_((function(){
  3428. return true;
  3429. }));
  3430. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3431. $ctx2.sendIdx["detect:"]=1;
  3432. //>>excludeEnd("ctx");
  3433. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3434. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  3435. //>>excludeEnd("ctx");
  3436. }),$Error());
  3437. self._should_raise_((function(){
  3438. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3439. return $core.withContext(function($ctx2) {
  3440. //>>excludeEnd("ctx");
  3441. $2=self._collection();
  3442. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3443. $ctx2.sendIdx["collection"]=2;
  3444. //>>excludeEnd("ctx");
  3445. return $recv($2)._detect_((function(){
  3446. return false;
  3447. }));
  3448. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3449. $ctx2.sendIdx["detect:"]=2;
  3450. //>>excludeEnd("ctx");
  3451. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3452. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  3453. //>>excludeEnd("ctx");
  3454. }),$Error());
  3455. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3456. $ctx1.sendIdx["should:raise:"]=1;
  3457. //>>excludeEnd("ctx");
  3458. $3=$recv(self._sampleNewValueAsCollection())._detect_((function(){
  3459. return true;
  3460. }));
  3461. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3462. $ctx1.sendIdx["detect:"]=3;
  3463. //>>excludeEnd("ctx");
  3464. $4=self._sampleNewValue();
  3465. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3466. $ctx1.sendIdx["sampleNewValue"]=1;
  3467. //>>excludeEnd("ctx");
  3468. self._assert_equals_($3,$4);
  3469. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3470. $ctx1.sendIdx["assert:equals:"]=1;
  3471. //>>excludeEnd("ctx");
  3472. $5=$recv(self._collectionWithNewValue())._detect_((function(each){
  3473. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3474. return $core.withContext(function($ctx2) {
  3475. //>>excludeEnd("ctx");
  3476. $6=self._sampleNewValue();
  3477. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3478. $ctx2.sendIdx["sampleNewValue"]=2;
  3479. //>>excludeEnd("ctx");
  3480. return $recv(each).__eq($6);
  3481. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3482. $ctx2.sendIdx["="]=1;
  3483. //>>excludeEnd("ctx");
  3484. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3485. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,6)});
  3486. //>>excludeEnd("ctx");
  3487. }));
  3488. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3489. $ctx1.sendIdx["detect:"]=4;
  3490. //>>excludeEnd("ctx");
  3491. $7=self._sampleNewValue();
  3492. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3493. $ctx1.sendIdx["sampleNewValue"]=3;
  3494. //>>excludeEnd("ctx");
  3495. self._assert_equals_($5,$7);
  3496. self._should_raise_((function(){
  3497. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3498. return $core.withContext(function($ctx2) {
  3499. //>>excludeEnd("ctx");
  3500. return $recv(self._collection())._detect_((function(each){
  3501. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3502. return $core.withContext(function($ctx3) {
  3503. //>>excludeEnd("ctx");
  3504. return $recv(each).__eq(self._sampleNewValue());
  3505. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3506. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,8)});
  3507. //>>excludeEnd("ctx");
  3508. }));
  3509. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3510. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,7)});
  3511. //>>excludeEnd("ctx");
  3512. }),$Error());
  3513. return self;
  3514. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3515. }, function($ctx1) {$ctx1.fill(self,"testDetect",{},$globals.CollectionTest)});
  3516. //>>excludeEnd("ctx");
  3517. },
  3518. //>>excludeStart("ide", pragmas.excludeIdeData);
  3519. args: [],
  3520. 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",
  3521. referencedClasses: ["Error"],
  3522. //>>excludeEnd("ide");
  3523. messageSends: ["shouldnt:raise:", "detect:", "collection", "should:raise:", "assert:equals:", "sampleNewValueAsCollection", "sampleNewValue", "collectionWithNewValue", "="]
  3524. }),
  3525. $globals.CollectionTest);
  3526. $core.addMethod(
  3527. $core.method({
  3528. selector: "testDetectIfNone",
  3529. protocol: 'tests',
  3530. fn: function (){
  3531. var self=this;
  3532. var sentinel;
  3533. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  3534. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3535. return $core.withContext(function($ctx1) {
  3536. //>>excludeEnd("ctx");
  3537. var $3,$2,$1,$5,$4,$6,$7,$9,$8,$10;
  3538. sentinel=$recv($Object())._new();
  3539. $3=self._collection();
  3540. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3541. $ctx1.sendIdx["collection"]=1;
  3542. //>>excludeEnd("ctx");
  3543. $2=$recv($3)._detect_ifNone_((function(){
  3544. return true;
  3545. }),(function(){
  3546. return sentinel;
  3547. }));
  3548. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3549. $ctx1.sendIdx["detect:ifNone:"]=1;
  3550. //>>excludeEnd("ctx");
  3551. $1=$recv($2).__tild_eq(sentinel);
  3552. self._assert_($1);
  3553. $5=self._collection();
  3554. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3555. $ctx1.sendIdx["collection"]=2;
  3556. //>>excludeEnd("ctx");
  3557. $4=$recv($5)._detect_ifNone_((function(){
  3558. return false;
  3559. }),(function(){
  3560. return sentinel;
  3561. }));
  3562. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3563. $ctx1.sendIdx["detect:ifNone:"]=2;
  3564. //>>excludeEnd("ctx");
  3565. self._assert_equals_($4,sentinel);
  3566. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3567. $ctx1.sendIdx["assert:equals:"]=1;
  3568. //>>excludeEnd("ctx");
  3569. $6=$recv(self._sampleNewValueAsCollection())._detect_ifNone_((function(){
  3570. return true;
  3571. }),(function(){
  3572. return sentinel;
  3573. }));
  3574. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3575. $ctx1.sendIdx["detect:ifNone:"]=3;
  3576. //>>excludeEnd("ctx");
  3577. $7=self._sampleNewValue();
  3578. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3579. $ctx1.sendIdx["sampleNewValue"]=1;
  3580. //>>excludeEnd("ctx");
  3581. self._assert_equals_($6,$7);
  3582. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3583. $ctx1.sendIdx["assert:equals:"]=2;
  3584. //>>excludeEnd("ctx");
  3585. $8=$recv(self._collectionWithNewValue())._detect_ifNone_((function(each){
  3586. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3587. return $core.withContext(function($ctx2) {
  3588. //>>excludeEnd("ctx");
  3589. $9=self._sampleNewValue();
  3590. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3591. $ctx2.sendIdx["sampleNewValue"]=2;
  3592. //>>excludeEnd("ctx");
  3593. return $recv(each).__eq($9);
  3594. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3595. $ctx2.sendIdx["="]=1;
  3596. //>>excludeEnd("ctx");
  3597. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3598. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,7)});
  3599. //>>excludeEnd("ctx");
  3600. }),(function(){
  3601. return sentinel;
  3602. }));
  3603. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3604. $ctx1.sendIdx["detect:ifNone:"]=4;
  3605. //>>excludeEnd("ctx");
  3606. $10=self._sampleNewValue();
  3607. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3608. $ctx1.sendIdx["sampleNewValue"]=3;
  3609. //>>excludeEnd("ctx");
  3610. self._assert_equals_($8,$10);
  3611. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3612. $ctx1.sendIdx["assert:equals:"]=3;
  3613. //>>excludeEnd("ctx");
  3614. self._assert_equals_($recv(self._collection())._detect_ifNone_((function(each){
  3615. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3616. return $core.withContext(function($ctx2) {
  3617. //>>excludeEnd("ctx");
  3618. return $recv(each).__eq(self._sampleNewValue());
  3619. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3620. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,9)});
  3621. //>>excludeEnd("ctx");
  3622. }),(function(){
  3623. return sentinel;
  3624. })),sentinel);
  3625. return self;
  3626. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3627. }, function($ctx1) {$ctx1.fill(self,"testDetectIfNone",{sentinel:sentinel},$globals.CollectionTest)});
  3628. //>>excludeEnd("ctx");
  3629. },
  3630. //>>excludeStart("ide", pragmas.excludeIdeData);
  3631. args: [],
  3632. 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",
  3633. referencedClasses: ["Object"],
  3634. //>>excludeEnd("ide");
  3635. messageSends: ["new", "assert:", "~=", "detect:ifNone:", "collection", "assert:equals:", "sampleNewValueAsCollection", "sampleNewValue", "collectionWithNewValue", "="]
  3636. }),
  3637. $globals.CollectionTest);
  3638. $core.addMethod(
  3639. $core.method({
  3640. selector: "testDo",
  3641. protocol: 'tests',
  3642. fn: function (){
  3643. var self=this;
  3644. var newCollection;
  3645. function $OrderedCollection(){return $globals.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  3646. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3647. return $core.withContext(function($ctx1) {
  3648. //>>excludeEnd("ctx");
  3649. var $1,$2;
  3650. newCollection=$recv($OrderedCollection())._new();
  3651. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3652. $ctx1.sendIdx["new"]=1;
  3653. //>>excludeEnd("ctx");
  3654. $1=self._collection();
  3655. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3656. $ctx1.sendIdx["collection"]=1;
  3657. //>>excludeEnd("ctx");
  3658. $recv($1)._do_((function(each){
  3659. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3660. return $core.withContext(function($ctx2) {
  3661. //>>excludeEnd("ctx");
  3662. return $recv(newCollection)._add_(each);
  3663. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3664. $ctx2.sendIdx["add:"]=1;
  3665. //>>excludeEnd("ctx");
  3666. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3667. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  3668. //>>excludeEnd("ctx");
  3669. }));
  3670. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3671. $ctx1.sendIdx["do:"]=1;
  3672. //>>excludeEnd("ctx");
  3673. self._assertSameContents_as_(self._collection(),newCollection);
  3674. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3675. $ctx1.sendIdx["assertSameContents:as:"]=1;
  3676. //>>excludeEnd("ctx");
  3677. newCollection=$recv($OrderedCollection())._new();
  3678. $2=self._collectionWithDuplicates();
  3679. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3680. $ctx1.sendIdx["collectionWithDuplicates"]=1;
  3681. //>>excludeEnd("ctx");
  3682. $recv($2)._do_((function(each){
  3683. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3684. return $core.withContext(function($ctx2) {
  3685. //>>excludeEnd("ctx");
  3686. return $recv(newCollection)._add_(each);
  3687. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3688. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
  3689. //>>excludeEnd("ctx");
  3690. }));
  3691. self._assertSameContents_as_(self._collectionWithDuplicates(),newCollection);
  3692. return self;
  3693. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3694. }, function($ctx1) {$ctx1.fill(self,"testDo",{newCollection:newCollection},$globals.CollectionTest)});
  3695. //>>excludeEnd("ctx");
  3696. },
  3697. //>>excludeStart("ide", pragmas.excludeIdeData);
  3698. args: [],
  3699. 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",
  3700. referencedClasses: ["OrderedCollection"],
  3701. //>>excludeEnd("ide");
  3702. messageSends: ["new", "do:", "collection", "add:", "assertSameContents:as:", "collectionWithDuplicates"]
  3703. }),
  3704. $globals.CollectionTest);
  3705. $core.addMethod(
  3706. $core.method({
  3707. selector: "testEquality",
  3708. protocol: 'tests',
  3709. fn: function (){
  3710. var self=this;
  3711. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3712. return $core.withContext(function($ctx1) {
  3713. //>>excludeEnd("ctx");
  3714. var $2,$1,$4,$3,$5,$6,$7,$8,$11,$10,$12,$9,$14,$13;
  3715. $2=self._collectionClass();
  3716. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3717. $ctx1.sendIdx["collectionClass"]=1;
  3718. //>>excludeEnd("ctx");
  3719. $1=$recv($2)._new();
  3720. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3721. $ctx1.sendIdx["new"]=1;
  3722. //>>excludeEnd("ctx");
  3723. $4=self._collectionClass();
  3724. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3725. $ctx1.sendIdx["collectionClass"]=2;
  3726. //>>excludeEnd("ctx");
  3727. $3=$recv($4)._new();
  3728. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3729. $ctx1.sendIdx["new"]=2;
  3730. //>>excludeEnd("ctx");
  3731. self._assert_equals_($1,$3);
  3732. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3733. $ctx1.sendIdx["assert:equals:"]=1;
  3734. //>>excludeEnd("ctx");
  3735. $5=self._collection();
  3736. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3737. $ctx1.sendIdx["collection"]=1;
  3738. //>>excludeEnd("ctx");
  3739. $6=self._collection();
  3740. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3741. $ctx1.sendIdx["collection"]=2;
  3742. //>>excludeEnd("ctx");
  3743. self._assert_equals_($5,$6);
  3744. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3745. $ctx1.sendIdx["assert:equals:"]=2;
  3746. //>>excludeEnd("ctx");
  3747. $7=self._collectionWithNewValue();
  3748. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3749. $ctx1.sendIdx["collectionWithNewValue"]=1;
  3750. //>>excludeEnd("ctx");
  3751. $8=self._collectionWithNewValue();
  3752. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3753. $ctx1.sendIdx["collectionWithNewValue"]=2;
  3754. //>>excludeEnd("ctx");
  3755. self._assert_equals_($7,$8);
  3756. $11=self._collectionClass();
  3757. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3758. $ctx1.sendIdx["collectionClass"]=3;
  3759. //>>excludeEnd("ctx");
  3760. $10=$recv($11)._new();
  3761. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3762. $ctx1.sendIdx["new"]=3;
  3763. //>>excludeEnd("ctx");
  3764. $12=self._collection();
  3765. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3766. $ctx1.sendIdx["collection"]=3;
  3767. //>>excludeEnd("ctx");
  3768. $9=$recv($10).__eq($12);
  3769. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3770. $ctx1.sendIdx["="]=1;
  3771. //>>excludeEnd("ctx");
  3772. self._deny_($9);
  3773. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3774. $ctx1.sendIdx["deny:"]=1;
  3775. //>>excludeEnd("ctx");
  3776. $14=self._collection();
  3777. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3778. $ctx1.sendIdx["collection"]=4;
  3779. //>>excludeEnd("ctx");
  3780. $13=$recv($14).__eq($recv(self._collectionClass())._new());
  3781. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3782. $ctx1.sendIdx["="]=2;
  3783. //>>excludeEnd("ctx");
  3784. self._deny_($13);
  3785. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3786. $ctx1.sendIdx["deny:"]=2;
  3787. //>>excludeEnd("ctx");
  3788. self._deny_($recv(self._collection()).__eq(self._collectionWithNewValue()));
  3789. return self;
  3790. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3791. }, function($ctx1) {$ctx1.fill(self,"testEquality",{},$globals.CollectionTest)});
  3792. //>>excludeEnd("ctx");
  3793. },
  3794. //>>excludeStart("ide", pragmas.excludeIdeData);
  3795. args: [],
  3796. source: "testEquality\x0a\x09self assert: self collectionClass new equals: self collectionClass new.\x0a\x09self assert: self collection equals: self collection.\x0a\x09self assert: self collectionWithNewValue equals: self collectionWithNewValue.\x0a\x09\x0a\x09self deny: self collectionClass new = self collection.\x0a\x09self deny: self collection = self collectionClass new.\x0a\x09self deny: self collection = self collectionWithNewValue",
  3797. referencedClasses: [],
  3798. //>>excludeEnd("ide");
  3799. messageSends: ["assert:equals:", "new", "collectionClass", "collection", "collectionWithNewValue", "deny:", "="]
  3800. }),
  3801. $globals.CollectionTest);
  3802. $core.addMethod(
  3803. $core.method({
  3804. selector: "testIfEmptyFamily",
  3805. protocol: 'tests',
  3806. fn: function (){
  3807. var self=this;
  3808. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3809. return $core.withContext(function($ctx1) {
  3810. //>>excludeEnd("ctx");
  3811. 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;
  3812. $3=self._collectionClass();
  3813. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3814. $ctx1.sendIdx["collectionClass"]=1;
  3815. //>>excludeEnd("ctx");
  3816. $2=$recv($3)._new();
  3817. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3818. $ctx1.sendIdx["new"]=1;
  3819. //>>excludeEnd("ctx");
  3820. $1=$recv($2)._ifEmpty_((function(){
  3821. return (42);
  3822. }));
  3823. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3824. $ctx1.sendIdx["ifEmpty:"]=1;
  3825. //>>excludeEnd("ctx");
  3826. self._assert_equals_($1,(42));
  3827. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3828. $ctx1.sendIdx["assert:equals:"]=1;
  3829. //>>excludeEnd("ctx");
  3830. $5=self._collection();
  3831. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3832. $ctx1.sendIdx["collection"]=1;
  3833. //>>excludeEnd("ctx");
  3834. $4=$recv($5)._ifEmpty_((function(){
  3835. return (42);
  3836. }));
  3837. $6=self._collection();
  3838. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3839. $ctx1.sendIdx["collection"]=2;
  3840. //>>excludeEnd("ctx");
  3841. self._assert_equals_($4,$6);
  3842. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3843. $ctx1.sendIdx["assert:equals:"]=2;
  3844. //>>excludeEnd("ctx");
  3845. $9=self._collectionClass();
  3846. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3847. $ctx1.sendIdx["collectionClass"]=2;
  3848. //>>excludeEnd("ctx");
  3849. $8=$recv($9)._new();
  3850. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3851. $ctx1.sendIdx["new"]=2;
  3852. //>>excludeEnd("ctx");
  3853. $7=$recv($8)._ifNotEmpty_((function(){
  3854. return (42);
  3855. }));
  3856. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3857. $ctx1.sendIdx["ifNotEmpty:"]=1;
  3858. //>>excludeEnd("ctx");
  3859. $11=self._collectionClass();
  3860. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3861. $ctx1.sendIdx["collectionClass"]=3;
  3862. //>>excludeEnd("ctx");
  3863. $10=$recv($11)._new();
  3864. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3865. $ctx1.sendIdx["new"]=3;
  3866. //>>excludeEnd("ctx");
  3867. self._assert_equals_($7,$10);
  3868. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3869. $ctx1.sendIdx["assert:equals:"]=3;
  3870. //>>excludeEnd("ctx");
  3871. $13=self._collection();
  3872. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3873. $ctx1.sendIdx["collection"]=3;
  3874. //>>excludeEnd("ctx");
  3875. $12=$recv($13)._ifNotEmpty_((function(){
  3876. return (42);
  3877. }));
  3878. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3879. $ctx1.sendIdx["ifNotEmpty:"]=2;
  3880. //>>excludeEnd("ctx");
  3881. self._assert_equals_($12,(42));
  3882. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3883. $ctx1.sendIdx["assert:equals:"]=4;
  3884. //>>excludeEnd("ctx");
  3885. $15=self._collection();
  3886. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3887. $ctx1.sendIdx["collection"]=4;
  3888. //>>excludeEnd("ctx");
  3889. $14=$recv($15)._ifNotEmpty_((function(col){
  3890. return col;
  3891. }));
  3892. $16=self._collection();
  3893. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3894. $ctx1.sendIdx["collection"]=5;
  3895. //>>excludeEnd("ctx");
  3896. self._assert_equals_($14,$16);
  3897. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3898. $ctx1.sendIdx["assert:equals:"]=5;
  3899. //>>excludeEnd("ctx");
  3900. $19=self._collectionClass();
  3901. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3902. $ctx1.sendIdx["collectionClass"]=4;
  3903. //>>excludeEnd("ctx");
  3904. $18=$recv($19)._new();
  3905. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3906. $ctx1.sendIdx["new"]=4;
  3907. //>>excludeEnd("ctx");
  3908. $17=$recv($18)._ifEmpty_ifNotEmpty_((function(){
  3909. return (42);
  3910. }),(function(){
  3911. return (999);
  3912. }));
  3913. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3914. $ctx1.sendIdx["ifEmpty:ifNotEmpty:"]=1;
  3915. //>>excludeEnd("ctx");
  3916. self._assert_equals_($17,(42));
  3917. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3918. $ctx1.sendIdx["assert:equals:"]=6;
  3919. //>>excludeEnd("ctx");
  3920. $21=self._collection();
  3921. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3922. $ctx1.sendIdx["collection"]=6;
  3923. //>>excludeEnd("ctx");
  3924. $20=$recv($21)._ifEmpty_ifNotEmpty_((function(){
  3925. return (42);
  3926. }),(function(){
  3927. return (999);
  3928. }));
  3929. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3930. $ctx1.sendIdx["ifEmpty:ifNotEmpty:"]=2;
  3931. //>>excludeEnd("ctx");
  3932. self._assert_equals_($20,(999));
  3933. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3934. $ctx1.sendIdx["assert:equals:"]=7;
  3935. //>>excludeEnd("ctx");
  3936. $23=self._collection();
  3937. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3938. $ctx1.sendIdx["collection"]=7;
  3939. //>>excludeEnd("ctx");
  3940. $22=$recv($23)._ifEmpty_ifNotEmpty_((function(){
  3941. return (42);
  3942. }),(function(col){
  3943. return col;
  3944. }));
  3945. $24=self._collection();
  3946. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3947. $ctx1.sendIdx["collection"]=8;
  3948. //>>excludeEnd("ctx");
  3949. self._assert_equals_($22,$24);
  3950. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3951. $ctx1.sendIdx["assert:equals:"]=8;
  3952. //>>excludeEnd("ctx");
  3953. $25=$recv($recv(self._collectionClass())._new())._ifNotEmpty_ifEmpty_((function(){
  3954. return (42);
  3955. }),(function(){
  3956. return (999);
  3957. }));
  3958. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3959. $ctx1.sendIdx["ifNotEmpty:ifEmpty:"]=1;
  3960. //>>excludeEnd("ctx");
  3961. self._assert_equals_($25,(999));
  3962. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3963. $ctx1.sendIdx["assert:equals:"]=9;
  3964. //>>excludeEnd("ctx");
  3965. $27=self._collection();
  3966. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3967. $ctx1.sendIdx["collection"]=9;
  3968. //>>excludeEnd("ctx");
  3969. $26=$recv($27)._ifNotEmpty_ifEmpty_((function(){
  3970. return (42);
  3971. }),(function(){
  3972. return (999);
  3973. }));
  3974. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3975. $ctx1.sendIdx["ifNotEmpty:ifEmpty:"]=2;
  3976. //>>excludeEnd("ctx");
  3977. self._assert_equals_($26,(42));
  3978. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3979. $ctx1.sendIdx["assert:equals:"]=10;
  3980. //>>excludeEnd("ctx");
  3981. $29=self._collection();
  3982. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3983. $ctx1.sendIdx["collection"]=10;
  3984. //>>excludeEnd("ctx");
  3985. $28=$recv($29)._ifNotEmpty_ifEmpty_((function(col){
  3986. return col;
  3987. }),(function(){
  3988. return (999);
  3989. }));
  3990. self._assert_equals_($28,self._collection());
  3991. return self;
  3992. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3993. }, function($ctx1) {$ctx1.fill(self,"testIfEmptyFamily",{},$globals.CollectionTest)});
  3994. //>>excludeEnd("ctx");
  3995. },
  3996. //>>excludeStart("ide", pragmas.excludeIdeData);
  3997. args: [],
  3998. 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.",
  3999. referencedClasses: [],
  4000. //>>excludeEnd("ide");
  4001. messageSends: ["assert:equals:", "ifEmpty:", "new", "collectionClass", "collection", "ifNotEmpty:", "ifEmpty:ifNotEmpty:", "ifNotEmpty:ifEmpty:"]
  4002. }),
  4003. $globals.CollectionTest);
  4004. $core.addMethod(
  4005. $core.method({
  4006. selector: "testIsEmpty",
  4007. protocol: 'tests',
  4008. fn: function (){
  4009. var self=this;
  4010. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4011. return $core.withContext(function($ctx1) {
  4012. //>>excludeEnd("ctx");
  4013. var $1;
  4014. $1=$recv($recv(self._collectionClass())._new())._isEmpty();
  4015. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4016. $ctx1.sendIdx["isEmpty"]=1;
  4017. //>>excludeEnd("ctx");
  4018. self._assert_($1);
  4019. self._deny_($recv(self._collection())._isEmpty());
  4020. return self;
  4021. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4022. }, function($ctx1) {$ctx1.fill(self,"testIsEmpty",{},$globals.CollectionTest)});
  4023. //>>excludeEnd("ctx");
  4024. },
  4025. //>>excludeStart("ide", pragmas.excludeIdeData);
  4026. args: [],
  4027. source: "testIsEmpty\x0a\x09self assert: self collectionClass new isEmpty.\x0a\x09self deny: self collection isEmpty",
  4028. referencedClasses: [],
  4029. //>>excludeEnd("ide");
  4030. messageSends: ["assert:", "isEmpty", "new", "collectionClass", "deny:", "collection"]
  4031. }),
  4032. $globals.CollectionTest);
  4033. $core.addMethod(
  4034. $core.method({
  4035. selector: "testNoneSatisfy",
  4036. protocol: 'tests',
  4037. fn: function (){
  4038. var self=this;
  4039. var anyOne;
  4040. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  4041. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4042. return $core.withContext(function($ctx1) {
  4043. //>>excludeEnd("ctx");
  4044. var $1,$3,$2;
  4045. $1=self._collection();
  4046. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4047. $ctx1.sendIdx["collection"]=1;
  4048. //>>excludeEnd("ctx");
  4049. anyOne=$recv($1)._anyOne();
  4050. $3=self._collection();
  4051. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4052. $ctx1.sendIdx["collection"]=2;
  4053. //>>excludeEnd("ctx");
  4054. $2=$recv($3)._noneSatisfy_((function(each){
  4055. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4056. return $core.withContext(function($ctx2) {
  4057. //>>excludeEnd("ctx");
  4058. return $recv(each).__eq(anyOne);
  4059. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4060. $ctx2.sendIdx["="]=1;
  4061. //>>excludeEnd("ctx");
  4062. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4063. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  4064. //>>excludeEnd("ctx");
  4065. }));
  4066. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4067. $ctx1.sendIdx["noneSatisfy:"]=1;
  4068. //>>excludeEnd("ctx");
  4069. self._deny_($2);
  4070. self._assert_($recv(self._collection())._noneSatisfy_((function(each){
  4071. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4072. return $core.withContext(function($ctx2) {
  4073. //>>excludeEnd("ctx");
  4074. return $recv(each).__eq($recv($Object())._new());
  4075. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4076. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
  4077. //>>excludeEnd("ctx");
  4078. })));
  4079. return self;
  4080. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4081. }, function($ctx1) {$ctx1.fill(self,"testNoneSatisfy",{anyOne:anyOne},$globals.CollectionTest)});
  4082. //>>excludeEnd("ctx");
  4083. },
  4084. //>>excludeStart("ide", pragmas.excludeIdeData);
  4085. args: [],
  4086. 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 ])",
  4087. referencedClasses: ["Object"],
  4088. //>>excludeEnd("ide");
  4089. messageSends: ["anyOne", "collection", "deny:", "noneSatisfy:", "=", "assert:", "new"]
  4090. }),
  4091. $globals.CollectionTest);
  4092. $core.addMethod(
  4093. $core.method({
  4094. selector: "testRemoveAll",
  4095. protocol: 'tests',
  4096. fn: function (){
  4097. var self=this;
  4098. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4099. return $core.withContext(function($ctx1) {
  4100. //>>excludeEnd("ctx");
  4101. var $2,$1;
  4102. $2=self._collection();
  4103. $recv($2)._removeAll();
  4104. $1=$recv($2)._yourself();
  4105. self._assert_equals_($1,$recv(self._collectionClass())._new());
  4106. return self;
  4107. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4108. }, function($ctx1) {$ctx1.fill(self,"testRemoveAll",{},$globals.CollectionTest)});
  4109. //>>excludeEnd("ctx");
  4110. },
  4111. //>>excludeStart("ide", pragmas.excludeIdeData);
  4112. args: [],
  4113. source: "testRemoveAll\x0a\x09self assert: (self collection removeAll; yourself) equals: self collectionClass new",
  4114. referencedClasses: [],
  4115. //>>excludeEnd("ide");
  4116. messageSends: ["assert:equals:", "removeAll", "collection", "yourself", "new", "collectionClass"]
  4117. }),
  4118. $globals.CollectionTest);
  4119. $core.addMethod(
  4120. $core.method({
  4121. selector: "testSelect",
  4122. protocol: 'tests',
  4123. fn: function (){
  4124. var self=this;
  4125. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4126. return $core.withContext(function($ctx1) {
  4127. //>>excludeEnd("ctx");
  4128. var $2,$1,$4,$3,$6,$5,$7,$9,$10,$8,$12,$13,$11,$14,$16,$17,$15;
  4129. $2=self._collection();
  4130. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4131. $ctx1.sendIdx["collection"]=1;
  4132. //>>excludeEnd("ctx");
  4133. $1=$recv($2)._select_((function(){
  4134. return false;
  4135. }));
  4136. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4137. $ctx1.sendIdx["select:"]=1;
  4138. //>>excludeEnd("ctx");
  4139. $4=self._collectionClass();
  4140. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4141. $ctx1.sendIdx["collectionClass"]=1;
  4142. //>>excludeEnd("ctx");
  4143. $3=$recv($4)._new();
  4144. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4145. $ctx1.sendIdx["new"]=1;
  4146. //>>excludeEnd("ctx");
  4147. self._assert_equals_($1,$3);
  4148. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4149. $ctx1.sendIdx["assert:equals:"]=1;
  4150. //>>excludeEnd("ctx");
  4151. $6=self._collection();
  4152. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4153. $ctx1.sendIdx["collection"]=2;
  4154. //>>excludeEnd("ctx");
  4155. $5=$recv($6)._select_((function(){
  4156. return true;
  4157. }));
  4158. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4159. $ctx1.sendIdx["select:"]=2;
  4160. //>>excludeEnd("ctx");
  4161. $7=self._collection();
  4162. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4163. $ctx1.sendIdx["collection"]=3;
  4164. //>>excludeEnd("ctx");
  4165. self._assert_equals_($5,$7);
  4166. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4167. $ctx1.sendIdx["assert:equals:"]=2;
  4168. //>>excludeEnd("ctx");
  4169. $9=self._collectionWithNewValue();
  4170. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4171. $ctx1.sendIdx["collectionWithNewValue"]=1;
  4172. //>>excludeEnd("ctx");
  4173. $8=$recv($9)._select_((function(each){
  4174. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4175. return $core.withContext(function($ctx2) {
  4176. //>>excludeEnd("ctx");
  4177. $10=self._sampleNewValue();
  4178. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4179. $ctx2.sendIdx["sampleNewValue"]=1;
  4180. //>>excludeEnd("ctx");
  4181. return $recv(each).__eq($10);
  4182. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4183. $ctx2.sendIdx["="]=1;
  4184. //>>excludeEnd("ctx");
  4185. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4186. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,3)});
  4187. //>>excludeEnd("ctx");
  4188. }));
  4189. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4190. $ctx1.sendIdx["select:"]=3;
  4191. //>>excludeEnd("ctx");
  4192. self._assert_equals_($8,self._sampleNewValueAsCollection());
  4193. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4194. $ctx1.sendIdx["assert:equals:"]=3;
  4195. //>>excludeEnd("ctx");
  4196. $12=self._collectionWithNewValue();
  4197. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4198. $ctx1.sendIdx["collectionWithNewValue"]=2;
  4199. //>>excludeEnd("ctx");
  4200. $11=$recv($12)._select_((function(each){
  4201. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4202. return $core.withContext(function($ctx2) {
  4203. //>>excludeEnd("ctx");
  4204. $13=self._sampleNewValue();
  4205. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4206. $ctx2.sendIdx["sampleNewValue"]=2;
  4207. //>>excludeEnd("ctx");
  4208. return $recv(each).__tild_eq($13);
  4209. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4210. $ctx2.sendIdx["~="]=1;
  4211. //>>excludeEnd("ctx");
  4212. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4213. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,4)});
  4214. //>>excludeEnd("ctx");
  4215. }));
  4216. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4217. $ctx1.sendIdx["select:"]=4;
  4218. //>>excludeEnd("ctx");
  4219. $14=self._collection();
  4220. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4221. $ctx1.sendIdx["collection"]=4;
  4222. //>>excludeEnd("ctx");
  4223. self._assert_equals_($11,$14);
  4224. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4225. $ctx1.sendIdx["assert:equals:"]=4;
  4226. //>>excludeEnd("ctx");
  4227. $16=self._collection();
  4228. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4229. $ctx1.sendIdx["collection"]=5;
  4230. //>>excludeEnd("ctx");
  4231. $15=$recv($16)._select_((function(each){
  4232. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4233. return $core.withContext(function($ctx2) {
  4234. //>>excludeEnd("ctx");
  4235. $17=self._sampleNewValue();
  4236. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4237. $ctx2.sendIdx["sampleNewValue"]=3;
  4238. //>>excludeEnd("ctx");
  4239. return $recv(each).__eq($17);
  4240. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4241. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,5)});
  4242. //>>excludeEnd("ctx");
  4243. }));
  4244. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4245. $ctx1.sendIdx["select:"]=5;
  4246. //>>excludeEnd("ctx");
  4247. self._assert_equals_($15,$recv(self._collectionClass())._new());
  4248. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4249. $ctx1.sendIdx["assert:equals:"]=5;
  4250. //>>excludeEnd("ctx");
  4251. self._assert_equals_($recv(self._collectionWithNewValue())._select_((function(each){
  4252. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4253. return $core.withContext(function($ctx2) {
  4254. //>>excludeEnd("ctx");
  4255. return $recv(each).__tild_eq(self._sampleNewValue());
  4256. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4257. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,6)});
  4258. //>>excludeEnd("ctx");
  4259. })),self._collection());
  4260. return self;
  4261. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4262. }, function($ctx1) {$ctx1.fill(self,"testSelect",{},$globals.CollectionTest)});
  4263. //>>excludeEnd("ctx");
  4264. },
  4265. //>>excludeStart("ide", pragmas.excludeIdeData);
  4266. args: [],
  4267. 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",
  4268. referencedClasses: [],
  4269. //>>excludeEnd("ide");
  4270. messageSends: ["assert:equals:", "select:", "collection", "new", "collectionClass", "collectionWithNewValue", "=", "sampleNewValue", "sampleNewValueAsCollection", "~="]
  4271. }),
  4272. $globals.CollectionTest);
  4273. $core.addMethod(
  4274. $core.method({
  4275. selector: "testSize",
  4276. protocol: 'tests',
  4277. fn: function (){
  4278. var self=this;
  4279. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4280. return $core.withContext(function($ctx1) {
  4281. //>>excludeEnd("ctx");
  4282. var $1,$2;
  4283. $1=$recv($recv(self._collectionClass())._new())._size();
  4284. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4285. $ctx1.sendIdx["size"]=1;
  4286. //>>excludeEnd("ctx");
  4287. self._assert_equals_($1,(0));
  4288. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4289. $ctx1.sendIdx["assert:equals:"]=1;
  4290. //>>excludeEnd("ctx");
  4291. $2=$recv(self._sampleNewValueAsCollection())._size();
  4292. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4293. $ctx1.sendIdx["size"]=2;
  4294. //>>excludeEnd("ctx");
  4295. self._assert_equals_($2,(1));
  4296. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4297. $ctx1.sendIdx["assert:equals:"]=2;
  4298. //>>excludeEnd("ctx");
  4299. self._assert_equals_($recv(self._collection())._size(),self._collectionSize());
  4300. return self;
  4301. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4302. }, function($ctx1) {$ctx1.fill(self,"testSize",{},$globals.CollectionTest)});
  4303. //>>excludeEnd("ctx");
  4304. },
  4305. //>>excludeStart("ide", pragmas.excludeIdeData);
  4306. args: [],
  4307. 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",
  4308. referencedClasses: [],
  4309. //>>excludeEnd("ide");
  4310. messageSends: ["assert:equals:", "size", "new", "collectionClass", "sampleNewValueAsCollection", "collection", "collectionSize"]
  4311. }),
  4312. $globals.CollectionTest);
  4313. $core.addMethod(
  4314. $core.method({
  4315. selector: "collectionClass",
  4316. protocol: 'fixture',
  4317. fn: function (){
  4318. var self=this;
  4319. return nil;
  4320. },
  4321. //>>excludeStart("ide", pragmas.excludeIdeData);
  4322. args: [],
  4323. source: "collectionClass\x0a\x09\x22Answers class of collection type tested,\x0a\x09or nil if test is abstract\x22\x0a\x0a\x09^ nil",
  4324. referencedClasses: [],
  4325. //>>excludeEnd("ide");
  4326. messageSends: []
  4327. }),
  4328. $globals.CollectionTest.klass);
  4329. $core.addMethod(
  4330. $core.method({
  4331. selector: "isAbstract",
  4332. protocol: 'testing',
  4333. fn: function (){
  4334. var self=this;
  4335. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4336. return $core.withContext(function($ctx1) {
  4337. //>>excludeEnd("ctx");
  4338. return $recv(self._collectionClass())._isNil();
  4339. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4340. }, function($ctx1) {$ctx1.fill(self,"isAbstract",{},$globals.CollectionTest.klass)});
  4341. //>>excludeEnd("ctx");
  4342. },
  4343. //>>excludeStart("ide", pragmas.excludeIdeData);
  4344. args: [],
  4345. source: "isAbstract\x0a\x09^ self collectionClass isNil",
  4346. referencedClasses: [],
  4347. //>>excludeEnd("ide");
  4348. messageSends: ["isNil", "collectionClass"]
  4349. }),
  4350. $globals.CollectionTest.klass);
  4351. $core.addClass('IndexableCollectionTest', $globals.CollectionTest, [], 'Kernel-Tests');
  4352. $core.addMethod(
  4353. $core.method({
  4354. selector: "collectionWithNewValue",
  4355. protocol: 'fixture',
  4356. fn: function (){
  4357. var self=this;
  4358. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4359. return $core.withContext(function($ctx1) {
  4360. //>>excludeEnd("ctx");
  4361. self._subclassResponsibility();
  4362. return self;
  4363. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4364. }, function($ctx1) {$ctx1.fill(self,"collectionWithNewValue",{},$globals.IndexableCollectionTest)});
  4365. //>>excludeEnd("ctx");
  4366. },
  4367. //>>excludeStart("ide", pragmas.excludeIdeData);
  4368. args: [],
  4369. 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",
  4370. referencedClasses: [],
  4371. //>>excludeEnd("ide");
  4372. messageSends: ["subclassResponsibility"]
  4373. }),
  4374. $globals.IndexableCollectionTest);
  4375. $core.addMethod(
  4376. $core.method({
  4377. selector: "sampleNewIndex",
  4378. protocol: 'fixture',
  4379. fn: function (){
  4380. var self=this;
  4381. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4382. return $core.withContext(function($ctx1) {
  4383. //>>excludeEnd("ctx");
  4384. self._subclassResponsibility();
  4385. return self;
  4386. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4387. }, function($ctx1) {$ctx1.fill(self,"sampleNewIndex",{},$globals.IndexableCollectionTest)});
  4388. //>>excludeEnd("ctx");
  4389. },
  4390. //>>excludeStart("ide", pragmas.excludeIdeData);
  4391. args: [],
  4392. 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",
  4393. referencedClasses: [],
  4394. //>>excludeEnd("ide");
  4395. messageSends: ["subclassResponsibility"]
  4396. }),
  4397. $globals.IndexableCollectionTest);
  4398. $core.addMethod(
  4399. $core.method({
  4400. selector: "sampleNonIndexesDo:",
  4401. protocol: 'fixture',
  4402. fn: function (aBlock){
  4403. var self=this;
  4404. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4405. return $core.withContext(function($ctx1) {
  4406. //>>excludeEnd("ctx");
  4407. self._subclassResponsibility();
  4408. return self;
  4409. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4410. }, function($ctx1) {$ctx1.fill(self,"sampleNonIndexesDo:",{aBlock:aBlock},$globals.IndexableCollectionTest)});
  4411. //>>excludeEnd("ctx");
  4412. },
  4413. //>>excludeStart("ide", pragmas.excludeIdeData);
  4414. args: ["aBlock"],
  4415. 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",
  4416. referencedClasses: [],
  4417. //>>excludeEnd("ide");
  4418. messageSends: ["subclassResponsibility"]
  4419. }),
  4420. $globals.IndexableCollectionTest);
  4421. $core.addMethod(
  4422. $core.method({
  4423. selector: "samplesDo:",
  4424. protocol: 'fixture',
  4425. fn: function (aBlock){
  4426. var self=this;
  4427. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4428. return $core.withContext(function($ctx1) {
  4429. //>>excludeEnd("ctx");
  4430. self._subclassResponsibility();
  4431. return self;
  4432. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4433. }, function($ctx1) {$ctx1.fill(self,"samplesDo:",{aBlock:aBlock},$globals.IndexableCollectionTest)});
  4434. //>>excludeEnd("ctx");
  4435. },
  4436. //>>excludeStart("ide", pragmas.excludeIdeData);
  4437. args: ["aBlock"],
  4438. 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",
  4439. referencedClasses: [],
  4440. //>>excludeEnd("ide");
  4441. messageSends: ["subclassResponsibility"]
  4442. }),
  4443. $globals.IndexableCollectionTest);
  4444. $core.addMethod(
  4445. $core.method({
  4446. selector: "testAt",
  4447. protocol: 'tests',
  4448. fn: function (){
  4449. var self=this;
  4450. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  4451. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4452. return $core.withContext(function($ctx1) {
  4453. //>>excludeEnd("ctx");
  4454. var $1;
  4455. self._nonIndexesDo_((function(each){
  4456. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4457. return $core.withContext(function($ctx2) {
  4458. //>>excludeEnd("ctx");
  4459. return self._should_raise_((function(){
  4460. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4461. return $core.withContext(function($ctx3) {
  4462. //>>excludeEnd("ctx");
  4463. $1=self._collection();
  4464. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4465. $ctx3.sendIdx["collection"]=1;
  4466. //>>excludeEnd("ctx");
  4467. return $recv($1)._at_(each);
  4468. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4469. $ctx3.sendIdx["at:"]=1;
  4470. //>>excludeEnd("ctx");
  4471. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4472. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  4473. //>>excludeEnd("ctx");
  4474. }),$Error());
  4475. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4476. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  4477. //>>excludeEnd("ctx");
  4478. }));
  4479. self._samplesDo_((function(index,value){
  4480. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4481. return $core.withContext(function($ctx2) {
  4482. //>>excludeEnd("ctx");
  4483. return self._assert_equals_($recv(self._collection())._at_(index),value);
  4484. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4485. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,3)});
  4486. //>>excludeEnd("ctx");
  4487. }));
  4488. return self;
  4489. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4490. }, function($ctx1) {$ctx1.fill(self,"testAt",{},$globals.IndexableCollectionTest)});
  4491. //>>excludeEnd("ctx");
  4492. },
  4493. //>>excludeStart("ide", pragmas.excludeIdeData);
  4494. args: [],
  4495. 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 ]",
  4496. referencedClasses: ["Error"],
  4497. //>>excludeEnd("ide");
  4498. messageSends: ["nonIndexesDo:", "should:raise:", "at:", "collection", "samplesDo:", "assert:equals:"]
  4499. }),
  4500. $globals.IndexableCollectionTest);
  4501. $core.addMethod(
  4502. $core.method({
  4503. selector: "testAtIfAbsent",
  4504. protocol: 'tests',
  4505. fn: function (){
  4506. var self=this;
  4507. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4508. return $core.withContext(function($ctx1) {
  4509. //>>excludeEnd("ctx");
  4510. var $2,$1,$3;
  4511. self._nonIndexesDo_((function(each){
  4512. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4513. return $core.withContext(function($ctx2) {
  4514. //>>excludeEnd("ctx");
  4515. $2=self._collection();
  4516. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4517. $ctx2.sendIdx["collection"]=1;
  4518. //>>excludeEnd("ctx");
  4519. $1=$recv($2)._at_ifAbsent_(each,(function(){
  4520. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4521. return $core.withContext(function($ctx3) {
  4522. //>>excludeEnd("ctx");
  4523. return self._sampleNewValue();
  4524. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4525. $ctx3.sendIdx["sampleNewValue"]=1;
  4526. //>>excludeEnd("ctx");
  4527. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4528. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  4529. //>>excludeEnd("ctx");
  4530. }));
  4531. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4532. $ctx2.sendIdx["at:ifAbsent:"]=1;
  4533. //>>excludeEnd("ctx");
  4534. $3=self._sampleNewValue();
  4535. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4536. $ctx2.sendIdx["sampleNewValue"]=2;
  4537. //>>excludeEnd("ctx");
  4538. return self._assert_equals_($1,$3);
  4539. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4540. $ctx2.sendIdx["assert:equals:"]=1;
  4541. //>>excludeEnd("ctx");
  4542. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4543. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  4544. //>>excludeEnd("ctx");
  4545. }));
  4546. self._samplesDo_((function(index,value){
  4547. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4548. return $core.withContext(function($ctx2) {
  4549. //>>excludeEnd("ctx");
  4550. return self._assert_equals_($recv(self._collection())._at_ifAbsent_(index,(function(){
  4551. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4552. return $core.withContext(function($ctx3) {
  4553. //>>excludeEnd("ctx");
  4554. return self._sampleNewValue();
  4555. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4556. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,4)});
  4557. //>>excludeEnd("ctx");
  4558. })),value);
  4559. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4560. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,3)});
  4561. //>>excludeEnd("ctx");
  4562. }));
  4563. return self;
  4564. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4565. }, function($ctx1) {$ctx1.fill(self,"testAtIfAbsent",{},$globals.IndexableCollectionTest)});
  4566. //>>excludeEnd("ctx");
  4567. },
  4568. //>>excludeStart("ide", pragmas.excludeIdeData);
  4569. args: [],
  4570. 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 ].",
  4571. referencedClasses: [],
  4572. //>>excludeEnd("ide");
  4573. messageSends: ["nonIndexesDo:", "assert:equals:", "at:ifAbsent:", "collection", "sampleNewValue", "samplesDo:"]
  4574. }),
  4575. $globals.IndexableCollectionTest);
  4576. $core.addMethod(
  4577. $core.method({
  4578. selector: "testAtIfAbsentPut",
  4579. protocol: 'tests',
  4580. fn: function (){
  4581. var self=this;
  4582. var newCollection;
  4583. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4584. return $core.withContext(function($ctx1) {
  4585. //>>excludeEnd("ctx");
  4586. var $1;
  4587. newCollection=self._collection();
  4588. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4589. $ctx1.sendIdx["collection"]=1;
  4590. //>>excludeEnd("ctx");
  4591. self._samplesDo_((function(index,value){
  4592. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4593. return $core.withContext(function($ctx2) {
  4594. //>>excludeEnd("ctx");
  4595. $1=$recv(newCollection)._at_ifAbsentPut_(index,(function(){
  4596. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4597. return $core.withContext(function($ctx3) {
  4598. //>>excludeEnd("ctx");
  4599. return self._sampleNewValue();
  4600. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4601. $ctx3.sendIdx["sampleNewValue"]=1;
  4602. //>>excludeEnd("ctx");
  4603. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4604. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  4605. //>>excludeEnd("ctx");
  4606. }));
  4607. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4608. $ctx2.sendIdx["at:ifAbsentPut:"]=1;
  4609. //>>excludeEnd("ctx");
  4610. return self._assert_equals_($1,value);
  4611. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4612. $ctx2.sendIdx["assert:equals:"]=1;
  4613. //>>excludeEnd("ctx");
  4614. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4615. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,1)});
  4616. //>>excludeEnd("ctx");
  4617. }));
  4618. self._assert_equals_(newCollection,self._collection());
  4619. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4620. $ctx1.sendIdx["assert:equals:"]=2;
  4621. //>>excludeEnd("ctx");
  4622. self._assert_equals_($recv(newCollection)._at_ifAbsentPut_(self._sampleNewIndex(),(function(){
  4623. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4624. return $core.withContext(function($ctx2) {
  4625. //>>excludeEnd("ctx");
  4626. return self._sampleNewValue();
  4627. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4628. $ctx2.sendIdx["sampleNewValue"]=2;
  4629. //>>excludeEnd("ctx");
  4630. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4631. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  4632. //>>excludeEnd("ctx");
  4633. })),self._sampleNewValue());
  4634. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4635. $ctx1.sendIdx["assert:equals:"]=3;
  4636. //>>excludeEnd("ctx");
  4637. self._assert_equals_(newCollection,self._collectionWithNewValue());
  4638. return self;
  4639. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4640. }, function($ctx1) {$ctx1.fill(self,"testAtIfAbsentPut",{newCollection:newCollection},$globals.IndexableCollectionTest)});
  4641. //>>excludeEnd("ctx");
  4642. },
  4643. //>>excludeStart("ide", pragmas.excludeIdeData);
  4644. args: [],
  4645. 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",
  4646. referencedClasses: [],
  4647. //>>excludeEnd("ide");
  4648. messageSends: ["collection", "samplesDo:", "assert:equals:", "at:ifAbsentPut:", "sampleNewValue", "sampleNewIndex", "collectionWithNewValue"]
  4649. }),
  4650. $globals.IndexableCollectionTest);
  4651. $core.addMethod(
  4652. $core.method({
  4653. selector: "testAtIfPresent",
  4654. protocol: 'tests',
  4655. fn: function (){
  4656. var self=this;
  4657. var visited,sentinel;
  4658. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  4659. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4660. return $core.withContext(function($ctx1) {
  4661. //>>excludeEnd("ctx");
  4662. var $2,$1,$4,$3;
  4663. sentinel=$recv($Object())._new();
  4664. self._nonIndexesDo_((function(each){
  4665. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4666. return $core.withContext(function($ctx2) {
  4667. //>>excludeEnd("ctx");
  4668. visited=nil;
  4669. visited;
  4670. $2=self._collection();
  4671. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4672. $ctx2.sendIdx["collection"]=1;
  4673. //>>excludeEnd("ctx");
  4674. $1=$recv($2)._at_ifPresent_(each,(function(value1){
  4675. visited=value1;
  4676. visited;
  4677. return sentinel;
  4678. }));
  4679. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4680. $ctx2.sendIdx["at:ifPresent:"]=1;
  4681. //>>excludeEnd("ctx");
  4682. self._assert_equals_($1,nil);
  4683. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4684. $ctx2.sendIdx["assert:equals:"]=1;
  4685. //>>excludeEnd("ctx");
  4686. return self._assert_($recv(visited)._isNil());
  4687. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4688. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  4689. //>>excludeEnd("ctx");
  4690. }));
  4691. self._samplesDo_((function(index,value){
  4692. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4693. return $core.withContext(function($ctx2) {
  4694. //>>excludeEnd("ctx");
  4695. visited=nil;
  4696. visited;
  4697. $4=self._collection();
  4698. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4699. $ctx2.sendIdx["collection"]=2;
  4700. //>>excludeEnd("ctx");
  4701. $3=$recv($4)._at_ifPresent_(index,(function(value2){
  4702. visited=value2;
  4703. visited;
  4704. return sentinel;
  4705. }));
  4706. self._assert_equals_($3,sentinel);
  4707. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4708. $ctx2.sendIdx["assert:equals:"]=2;
  4709. //>>excludeEnd("ctx");
  4710. return self._assert_equals_(visited,$recv(self._collection())._at_(index));
  4711. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4712. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,3)});
  4713. //>>excludeEnd("ctx");
  4714. }));
  4715. return self;
  4716. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4717. }, function($ctx1) {$ctx1.fill(self,"testAtIfPresent",{visited:visited,sentinel:sentinel},$globals.IndexableCollectionTest)});
  4718. //>>excludeEnd("ctx");
  4719. },
  4720. //>>excludeStart("ide", pragmas.excludeIdeData);
  4721. args: [],
  4722. 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) ]",
  4723. referencedClasses: ["Object"],
  4724. //>>excludeEnd("ide");
  4725. messageSends: ["new", "nonIndexesDo:", "assert:equals:", "at:ifPresent:", "collection", "assert:", "isNil", "samplesDo:", "at:"]
  4726. }),
  4727. $globals.IndexableCollectionTest);
  4728. $core.addMethod(
  4729. $core.method({
  4730. selector: "testAtIfPresentIfAbsent",
  4731. protocol: 'tests',
  4732. fn: function (){
  4733. var self=this;
  4734. var visited,sentinel;
  4735. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  4736. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4737. return $core.withContext(function($ctx1) {
  4738. //>>excludeEnd("ctx");
  4739. var $2,$1,$3,$5,$4;
  4740. sentinel=$recv($Object())._new();
  4741. self._nonIndexesDo_((function(each){
  4742. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4743. return $core.withContext(function($ctx2) {
  4744. //>>excludeEnd("ctx");
  4745. visited=nil;
  4746. visited;
  4747. $2=self._collection();
  4748. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4749. $ctx2.sendIdx["collection"]=1;
  4750. //>>excludeEnd("ctx");
  4751. $1=$recv($2)._at_ifPresent_ifAbsent_(each,(function(value1){
  4752. visited=value1;
  4753. visited;
  4754. return sentinel;
  4755. }),(function(){
  4756. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4757. return $core.withContext(function($ctx3) {
  4758. //>>excludeEnd("ctx");
  4759. return self._sampleNewValue();
  4760. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4761. $ctx3.sendIdx["sampleNewValue"]=1;
  4762. //>>excludeEnd("ctx");
  4763. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4764. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)});
  4765. //>>excludeEnd("ctx");
  4766. }));
  4767. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4768. $ctx2.sendIdx["at:ifPresent:ifAbsent:"]=1;
  4769. //>>excludeEnd("ctx");
  4770. $3=self._sampleNewValue();
  4771. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4772. $ctx2.sendIdx["sampleNewValue"]=2;
  4773. //>>excludeEnd("ctx");
  4774. self._assert_equals_($1,$3);
  4775. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4776. $ctx2.sendIdx["assert:equals:"]=1;
  4777. //>>excludeEnd("ctx");
  4778. return self._assert_($recv(visited)._isNil());
  4779. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4780. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  4781. //>>excludeEnd("ctx");
  4782. }));
  4783. self._samplesDo_((function(index,value){
  4784. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4785. return $core.withContext(function($ctx2) {
  4786. //>>excludeEnd("ctx");
  4787. visited=nil;
  4788. visited;
  4789. $5=self._collection();
  4790. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4791. $ctx2.sendIdx["collection"]=2;
  4792. //>>excludeEnd("ctx");
  4793. $4=$recv($5)._at_ifPresent_ifAbsent_(index,(function(value2){
  4794. visited=value2;
  4795. visited;
  4796. return sentinel;
  4797. }),(function(){
  4798. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4799. return $core.withContext(function($ctx3) {
  4800. //>>excludeEnd("ctx");
  4801. return self._sampleNewValue();
  4802. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4803. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,6)});
  4804. //>>excludeEnd("ctx");
  4805. }));
  4806. self._assert_equals_($4,sentinel);
  4807. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4808. $ctx2.sendIdx["assert:equals:"]=2;
  4809. //>>excludeEnd("ctx");
  4810. return self._assert_equals_(visited,$recv(self._collection())._at_(index));
  4811. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4812. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,4)});
  4813. //>>excludeEnd("ctx");
  4814. }));
  4815. return self;
  4816. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4817. }, function($ctx1) {$ctx1.fill(self,"testAtIfPresentIfAbsent",{visited:visited,sentinel:sentinel},$globals.IndexableCollectionTest)});
  4818. //>>excludeEnd("ctx");
  4819. },
  4820. //>>excludeStart("ide", pragmas.excludeIdeData);
  4821. args: [],
  4822. 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) ]",
  4823. referencedClasses: ["Object"],
  4824. //>>excludeEnd("ide");
  4825. messageSends: ["new", "nonIndexesDo:", "assert:equals:", "at:ifPresent:ifAbsent:", "collection", "sampleNewValue", "assert:", "isNil", "samplesDo:", "at:"]
  4826. }),
  4827. $globals.IndexableCollectionTest);
  4828. $core.addMethod(
  4829. $core.method({
  4830. selector: "testAtPut",
  4831. protocol: 'tests',
  4832. fn: function (){
  4833. var self=this;
  4834. var newCollection;
  4835. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4836. return $core.withContext(function($ctx1) {
  4837. //>>excludeEnd("ctx");
  4838. newCollection=self._collection();
  4839. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4840. $ctx1.sendIdx["collection"]=1;
  4841. //>>excludeEnd("ctx");
  4842. self._samplesDo_((function(index,value){
  4843. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4844. return $core.withContext(function($ctx2) {
  4845. //>>excludeEnd("ctx");
  4846. return $recv(newCollection)._at_put_(index,value);
  4847. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4848. $ctx2.sendIdx["at:put:"]=1;
  4849. //>>excludeEnd("ctx");
  4850. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4851. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,1)});
  4852. //>>excludeEnd("ctx");
  4853. }));
  4854. self._assert_equals_(newCollection,self._collection());
  4855. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4856. $ctx1.sendIdx["assert:equals:"]=1;
  4857. //>>excludeEnd("ctx");
  4858. $recv(newCollection)._at_put_(self._sampleNewIndex(),self._sampleNewValue());
  4859. self._assert_equals_(newCollection,self._collectionWithNewValue());
  4860. return self;
  4861. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4862. }, function($ctx1) {$ctx1.fill(self,"testAtPut",{newCollection:newCollection},$globals.IndexableCollectionTest)});
  4863. //>>excludeEnd("ctx");
  4864. },
  4865. //>>excludeStart("ide", pragmas.excludeIdeData);
  4866. args: [],
  4867. 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",
  4868. referencedClasses: [],
  4869. //>>excludeEnd("ide");
  4870. messageSends: ["collection", "samplesDo:", "at:put:", "assert:equals:", "sampleNewIndex", "sampleNewValue", "collectionWithNewValue"]
  4871. }),
  4872. $globals.IndexableCollectionTest);
  4873. $core.addMethod(
  4874. $core.method({
  4875. selector: "testIndexOf",
  4876. protocol: 'tests',
  4877. fn: function (){
  4878. var self=this;
  4879. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  4880. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4881. return $core.withContext(function($ctx1) {
  4882. //>>excludeEnd("ctx");
  4883. var $1;
  4884. self._should_raise_((function(){
  4885. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4886. return $core.withContext(function($ctx2) {
  4887. //>>excludeEnd("ctx");
  4888. $1=self._collection();
  4889. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4890. $ctx2.sendIdx["collection"]=1;
  4891. //>>excludeEnd("ctx");
  4892. return $recv($1)._indexOf_(self._sampleNewValue());
  4893. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4894. $ctx2.sendIdx["indexOf:"]=1;
  4895. //>>excludeEnd("ctx");
  4896. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4897. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  4898. //>>excludeEnd("ctx");
  4899. }),$Error());
  4900. self._samplesDo_((function(index,value){
  4901. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4902. return $core.withContext(function($ctx2) {
  4903. //>>excludeEnd("ctx");
  4904. return self._assert_equals_($recv(self._collection())._indexOf_(value),index);
  4905. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4906. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,2)});
  4907. //>>excludeEnd("ctx");
  4908. }));
  4909. return self;
  4910. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4911. }, function($ctx1) {$ctx1.fill(self,"testIndexOf",{},$globals.IndexableCollectionTest)});
  4912. //>>excludeEnd("ctx");
  4913. },
  4914. //>>excludeStart("ide", pragmas.excludeIdeData);
  4915. args: [],
  4916. 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 ]",
  4917. referencedClasses: ["Error"],
  4918. //>>excludeEnd("ide");
  4919. messageSends: ["should:raise:", "indexOf:", "collection", "sampleNewValue", "samplesDo:", "assert:equals:"]
  4920. }),
  4921. $globals.IndexableCollectionTest);
  4922. $core.addMethod(
  4923. $core.method({
  4924. selector: "testIndexOfWithNull",
  4925. protocol: 'tests',
  4926. fn: function (){
  4927. var self=this;
  4928. var jsNull;
  4929. function $JSON(){return $globals.JSON||(typeof JSON=="undefined"?nil:JSON)}
  4930. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4931. return $core.withContext(function($ctx1) {
  4932. //>>excludeEnd("ctx");
  4933. var $2,$1;
  4934. jsNull=$recv($JSON())._parse_("null");
  4935. self._samplesDo_((function(index,value){
  4936. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4937. return $core.withContext(function($ctx2) {
  4938. //>>excludeEnd("ctx");
  4939. $2=self._collection();
  4940. $recv($2)._at_put_(index,jsNull);
  4941. $1=$recv($2)._indexOf_(jsNull);
  4942. return self._assert_equals_($1,index);
  4943. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4944. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,1)});
  4945. //>>excludeEnd("ctx");
  4946. }));
  4947. return self;
  4948. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4949. }, function($ctx1) {$ctx1.fill(self,"testIndexOfWithNull",{jsNull:jsNull},$globals.IndexableCollectionTest)});
  4950. //>>excludeEnd("ctx");
  4951. },
  4952. //>>excludeStart("ide", pragmas.excludeIdeData);
  4953. args: [],
  4954. 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 ]",
  4955. referencedClasses: ["JSON"],
  4956. //>>excludeEnd("ide");
  4957. messageSends: ["parse:", "samplesDo:", "assert:equals:", "at:put:", "collection", "indexOf:"]
  4958. }),
  4959. $globals.IndexableCollectionTest);
  4960. $core.addMethod(
  4961. $core.method({
  4962. selector: "testWithIndexDo",
  4963. protocol: 'tests',
  4964. fn: function (){
  4965. var self=this;
  4966. var collection;
  4967. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4968. return $core.withContext(function($ctx1) {
  4969. //>>excludeEnd("ctx");
  4970. collection=self._collection();
  4971. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4972. $ctx1.sendIdx["collection"]=1;
  4973. //>>excludeEnd("ctx");
  4974. $recv(self._collection())._withIndexDo_((function(each,index){
  4975. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4976. return $core.withContext(function($ctx2) {
  4977. //>>excludeEnd("ctx");
  4978. return self._assert_equals_($recv(collection)._at_(index),each);
  4979. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4980. }, function($ctx2) {$ctx2.fillBlock({each:each,index:index},$ctx1,1)});
  4981. //>>excludeEnd("ctx");
  4982. }));
  4983. return self;
  4984. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4985. }, function($ctx1) {$ctx1.fill(self,"testWithIndexDo",{collection:collection},$globals.IndexableCollectionTest)});
  4986. //>>excludeEnd("ctx");
  4987. },
  4988. //>>excludeStart("ide", pragmas.excludeIdeData);
  4989. args: [],
  4990. 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 ]",
  4991. referencedClasses: [],
  4992. //>>excludeEnd("ide");
  4993. messageSends: ["collection", "withIndexDo:", "assert:equals:", "at:"]
  4994. }),
  4995. $globals.IndexableCollectionTest);
  4996. $core.addClass('AssociativeCollectionTest', $globals.IndexableCollectionTest, [], 'Kernel-Tests');
  4997. $core.addMethod(
  4998. $core.method({
  4999. selector: "collectionKeys",
  5000. protocol: 'fixture',
  5001. fn: function (){
  5002. var self=this;
  5003. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5004. return $core.withContext(function($ctx1) {
  5005. //>>excludeEnd("ctx");
  5006. self._subclassResponsibility();
  5007. return self;
  5008. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5009. }, function($ctx1) {$ctx1.fill(self,"collectionKeys",{},$globals.AssociativeCollectionTest)});
  5010. //>>excludeEnd("ctx");
  5011. },
  5012. //>>excludeStart("ide", pragmas.excludeIdeData);
  5013. args: [],
  5014. source: "collectionKeys\x0a\x09self subclassResponsibility",
  5015. referencedClasses: [],
  5016. //>>excludeEnd("ide");
  5017. messageSends: ["subclassResponsibility"]
  5018. }),
  5019. $globals.AssociativeCollectionTest);
  5020. $core.addMethod(
  5021. $core.method({
  5022. selector: "collectionValues",
  5023. protocol: 'fixture',
  5024. fn: function (){
  5025. var self=this;
  5026. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5027. return $core.withContext(function($ctx1) {
  5028. //>>excludeEnd("ctx");
  5029. self._subclassResponsibility();
  5030. return self;
  5031. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5032. }, function($ctx1) {$ctx1.fill(self,"collectionValues",{},$globals.AssociativeCollectionTest)});
  5033. //>>excludeEnd("ctx");
  5034. },
  5035. //>>excludeStart("ide", pragmas.excludeIdeData);
  5036. args: [],
  5037. source: "collectionValues\x0a\x09self subclassResponsibility",
  5038. referencedClasses: [],
  5039. //>>excludeEnd("ide");
  5040. messageSends: ["subclassResponsibility"]
  5041. }),
  5042. $globals.AssociativeCollectionTest);
  5043. $core.addMethod(
  5044. $core.method({
  5045. selector: "nonIndexesDo:",
  5046. protocol: 'fixture',
  5047. fn: function (aBlock){
  5048. var self=this;
  5049. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  5050. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5051. return $core.withContext(function($ctx1) {
  5052. //>>excludeEnd("ctx");
  5053. $recv(aBlock)._value_((5));
  5054. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5055. $ctx1.sendIdx["value:"]=1;
  5056. //>>excludeEnd("ctx");
  5057. $recv(aBlock)._value_((function(){
  5058. }));
  5059. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5060. $ctx1.sendIdx["value:"]=2;
  5061. //>>excludeEnd("ctx");
  5062. $recv(aBlock)._value_($recv($Object())._new());
  5063. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5064. $ctx1.sendIdx["value:"]=3;
  5065. //>>excludeEnd("ctx");
  5066. $recv(aBlock)._value_("z");
  5067. return self;
  5068. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5069. }, function($ctx1) {$ctx1.fill(self,"nonIndexesDo:",{aBlock:aBlock},$globals.AssociativeCollectionTest)});
  5070. //>>excludeEnd("ctx");
  5071. },
  5072. //>>excludeStart("ide", pragmas.excludeIdeData);
  5073. args: ["aBlock"],
  5074. source: "nonIndexesDo: aBlock\x0a\x09aBlock value: 5.\x0a\x09aBlock value: [].\x0a\x09aBlock value: Object new.\x0a\x09aBlock value: 'z'",
  5075. referencedClasses: ["Object"],
  5076. //>>excludeEnd("ide");
  5077. messageSends: ["value:", "new"]
  5078. }),
  5079. $globals.AssociativeCollectionTest);
  5080. $core.addMethod(
  5081. $core.method({
  5082. selector: "sampleNewIndex",
  5083. protocol: 'fixture',
  5084. fn: function (){
  5085. var self=this;
  5086. return "new";
  5087. },
  5088. //>>excludeStart("ide", pragmas.excludeIdeData);
  5089. args: [],
  5090. source: "sampleNewIndex\x0a\x09^ 'new'",
  5091. referencedClasses: [],
  5092. //>>excludeEnd("ide");
  5093. messageSends: []
  5094. }),
  5095. $globals.AssociativeCollectionTest);
  5096. $core.addMethod(
  5097. $core.method({
  5098. selector: "samplesDo:",
  5099. protocol: 'fixture',
  5100. fn: function (aBlock){
  5101. var self=this;
  5102. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5103. return $core.withContext(function($ctx1) {
  5104. //>>excludeEnd("ctx");
  5105. $recv(aBlock)._value_value_("a",(2));
  5106. return self;
  5107. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5108. }, function($ctx1) {$ctx1.fill(self,"samplesDo:",{aBlock:aBlock},$globals.AssociativeCollectionTest)});
  5109. //>>excludeEnd("ctx");
  5110. },
  5111. //>>excludeStart("ide", pragmas.excludeIdeData);
  5112. args: ["aBlock"],
  5113. source: "samplesDo: aBlock\x0a\x09aBlock value: 'a' value: 2",
  5114. referencedClasses: [],
  5115. //>>excludeEnd("ide");
  5116. messageSends: ["value:value:"]
  5117. }),
  5118. $globals.AssociativeCollectionTest);
  5119. $core.addMethod(
  5120. $core.method({
  5121. selector: "testAddAll",
  5122. protocol: 'tests',
  5123. fn: function (){
  5124. var self=this;
  5125. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5126. return $core.withContext(function($ctx1) {
  5127. //>>excludeEnd("ctx");
  5128. var $2,$3,$4,$1,$5,$7,$8,$9,$6,$10,$12,$11;
  5129. (
  5130. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5131. $ctx1.supercall = true,
  5132. //>>excludeEnd("ctx");
  5133. ($globals.AssociativeCollectionTest.superclass||$boot.dnu).fn.prototype._testAddAll.apply($recv(self), []));
  5134. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5135. $ctx1.supercall = false;
  5136. //>>excludeEnd("ctx");;
  5137. $2=self._collection();
  5138. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5139. $ctx1.sendIdx["collection"]=1;
  5140. //>>excludeEnd("ctx");
  5141. $3=self._collection();
  5142. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5143. $ctx1.sendIdx["collection"]=2;
  5144. //>>excludeEnd("ctx");
  5145. $recv($2)._addAll_($3);
  5146. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5147. $ctx1.sendIdx["addAll:"]=1;
  5148. //>>excludeEnd("ctx");
  5149. $4=$recv($2)._yourself();
  5150. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5151. $ctx1.sendIdx["yourself"]=1;
  5152. //>>excludeEnd("ctx");
  5153. $1=$4;
  5154. $5=self._collection();
  5155. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5156. $ctx1.sendIdx["collection"]=3;
  5157. //>>excludeEnd("ctx");
  5158. self._assert_equals_($1,$5);
  5159. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5160. $ctx1.sendIdx["assert:equals:"]=1;
  5161. //>>excludeEnd("ctx");
  5162. $7=self._collection();
  5163. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5164. $ctx1.sendIdx["collection"]=4;
  5165. //>>excludeEnd("ctx");
  5166. $8=self._collectionWithNewValue();
  5167. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5168. $ctx1.sendIdx["collectionWithNewValue"]=1;
  5169. //>>excludeEnd("ctx");
  5170. $recv($7)._addAll_($8);
  5171. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5172. $ctx1.sendIdx["addAll:"]=2;
  5173. //>>excludeEnd("ctx");
  5174. $9=$recv($7)._yourself();
  5175. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5176. $ctx1.sendIdx["yourself"]=2;
  5177. //>>excludeEnd("ctx");
  5178. $6=$9;
  5179. $10=self._collectionWithNewValue();
  5180. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5181. $ctx1.sendIdx["collectionWithNewValue"]=2;
  5182. //>>excludeEnd("ctx");
  5183. self._assert_equals_($6,$10);
  5184. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5185. $ctx1.sendIdx["assert:equals:"]=2;
  5186. //>>excludeEnd("ctx");
  5187. $12=self._collectionWithNewValue();
  5188. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5189. $ctx1.sendIdx["collectionWithNewValue"]=3;
  5190. //>>excludeEnd("ctx");
  5191. $recv($12)._addAll_(self._collection());
  5192. $11=$recv($12)._yourself();
  5193. self._assert_equals_($11,self._collectionWithNewValue());
  5194. return self;
  5195. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5196. }, function($ctx1) {$ctx1.fill(self,"testAddAll",{},$globals.AssociativeCollectionTest)});
  5197. //>>excludeEnd("ctx");
  5198. },
  5199. //>>excludeStart("ide", pragmas.excludeIdeData);
  5200. args: [],
  5201. 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",
  5202. referencedClasses: [],
  5203. //>>excludeEnd("ide");
  5204. messageSends: ["testAddAll", "assert:equals:", "addAll:", "collection", "yourself", "collectionWithNewValue"]
  5205. }),
  5206. $globals.AssociativeCollectionTest);
  5207. $core.addMethod(
  5208. $core.method({
  5209. selector: "testAsDictionary",
  5210. protocol: 'tests',
  5211. fn: function (){
  5212. var self=this;
  5213. function $Dictionary(){return $globals.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  5214. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5215. return $core.withContext(function($ctx1) {
  5216. //>>excludeEnd("ctx");
  5217. self._assert_($recv($recv($recv(self._collectionClass())._new())._asDictionary())._isMemberOf_($Dictionary()));
  5218. return self;
  5219. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5220. }, function($ctx1) {$ctx1.fill(self,"testAsDictionary",{},$globals.AssociativeCollectionTest)});
  5221. //>>excludeEnd("ctx");
  5222. },
  5223. //>>excludeStart("ide", pragmas.excludeIdeData);
  5224. args: [],
  5225. source: "testAsDictionary\x0aself assert: ( self collectionClass new asDictionary isMemberOf: Dictionary ).",
  5226. referencedClasses: ["Dictionary"],
  5227. //>>excludeEnd("ide");
  5228. messageSends: ["assert:", "isMemberOf:", "asDictionary", "new", "collectionClass"]
  5229. }),
  5230. $globals.AssociativeCollectionTest);
  5231. $core.addMethod(
  5232. $core.method({
  5233. selector: "testAsHashedCollection",
  5234. protocol: 'tests',
  5235. fn: function (){
  5236. var self=this;
  5237. function $HashedCollection(){return $globals.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
  5238. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5239. return $core.withContext(function($ctx1) {
  5240. //>>excludeEnd("ctx");
  5241. self._assert_($recv($recv($recv(self._collectionClass())._new())._asHashedCollection())._isMemberOf_($HashedCollection()));
  5242. return self;
  5243. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5244. }, function($ctx1) {$ctx1.fill(self,"testAsHashedCollection",{},$globals.AssociativeCollectionTest)});
  5245. //>>excludeEnd("ctx");
  5246. },
  5247. //>>excludeStart("ide", pragmas.excludeIdeData);
  5248. args: [],
  5249. source: "testAsHashedCollection\x0aself assert: ( self collectionClass new asHashedCollection isMemberOf: HashedCollection ).",
  5250. referencedClasses: ["HashedCollection"],
  5251. //>>excludeEnd("ide");
  5252. messageSends: ["assert:", "isMemberOf:", "asHashedCollection", "new", "collectionClass"]
  5253. }),
  5254. $globals.AssociativeCollectionTest);
  5255. $core.addMethod(
  5256. $core.method({
  5257. selector: "testComma",
  5258. protocol: 'tests',
  5259. fn: function (){
  5260. var self=this;
  5261. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5262. return $core.withContext(function($ctx1) {
  5263. //>>excludeEnd("ctx");
  5264. var $2,$3,$1,$4,$6,$7,$5,$8,$10,$9;
  5265. (
  5266. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5267. $ctx1.supercall = true,
  5268. //>>excludeEnd("ctx");
  5269. ($globals.AssociativeCollectionTest.superclass||$boot.dnu).fn.prototype._testComma.apply($recv(self), []));
  5270. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5271. $ctx1.supercall = false;
  5272. //>>excludeEnd("ctx");;
  5273. $2=self._collection();
  5274. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5275. $ctx1.sendIdx["collection"]=1;
  5276. //>>excludeEnd("ctx");
  5277. $3=self._collection();
  5278. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5279. $ctx1.sendIdx["collection"]=2;
  5280. //>>excludeEnd("ctx");
  5281. $1=$recv($2).__comma($3);
  5282. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5283. $ctx1.sendIdx[","]=1;
  5284. //>>excludeEnd("ctx");
  5285. $4=self._collection();
  5286. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5287. $ctx1.sendIdx["collection"]=3;
  5288. //>>excludeEnd("ctx");
  5289. self._assert_equals_($1,$4);
  5290. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5291. $ctx1.sendIdx["assert:equals:"]=1;
  5292. //>>excludeEnd("ctx");
  5293. $6=self._collection();
  5294. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5295. $ctx1.sendIdx["collection"]=4;
  5296. //>>excludeEnd("ctx");
  5297. $7=self._collectionWithNewValue();
  5298. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5299. $ctx1.sendIdx["collectionWithNewValue"]=1;
  5300. //>>excludeEnd("ctx");
  5301. $5=$recv($6).__comma($7);
  5302. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5303. $ctx1.sendIdx[","]=2;
  5304. //>>excludeEnd("ctx");
  5305. $8=self._collectionWithNewValue();
  5306. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5307. $ctx1.sendIdx["collectionWithNewValue"]=2;
  5308. //>>excludeEnd("ctx");
  5309. self._assert_equals_($5,$8);
  5310. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5311. $ctx1.sendIdx["assert:equals:"]=2;
  5312. //>>excludeEnd("ctx");
  5313. $10=self._collectionWithNewValue();
  5314. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5315. $ctx1.sendIdx["collectionWithNewValue"]=3;
  5316. //>>excludeEnd("ctx");
  5317. $9=$recv($10).__comma(self._collection());
  5318. self._assert_equals_($9,self._collectionWithNewValue());
  5319. return self;
  5320. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5321. }, function($ctx1) {$ctx1.fill(self,"testComma",{},$globals.AssociativeCollectionTest)});
  5322. //>>excludeEnd("ctx");
  5323. },
  5324. //>>excludeStart("ide", pragmas.excludeIdeData);
  5325. args: [],
  5326. 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",
  5327. referencedClasses: [],
  5328. //>>excludeEnd("ide");
  5329. messageSends: ["testComma", "assert:equals:", ",", "collection", "collectionWithNewValue"]
  5330. }),
  5331. $globals.AssociativeCollectionTest);
  5332. $core.addMethod(
  5333. $core.method({
  5334. selector: "testFrom",
  5335. protocol: 'tests',
  5336. fn: function (){
  5337. var self=this;
  5338. var associations;
  5339. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5340. return $core.withContext(function($ctx1) {
  5341. //>>excludeEnd("ctx");
  5342. var $1;
  5343. $1="a".__minus_gt((1));
  5344. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5345. $ctx1.sendIdx["->"]=1;
  5346. //>>excludeEnd("ctx");
  5347. associations=[$1,"b".__minus_gt((2))];
  5348. self._assertSameContents_as_($recv($recv(self._class())._collectionClass())._from_(associations),$globals.HashedCollection._newFromPairs_(["a",(1),"b",(2)]));
  5349. return self;
  5350. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5351. }, function($ctx1) {$ctx1.fill(self,"testFrom",{associations:associations},$globals.AssociativeCollectionTest)});
  5352. //>>excludeEnd("ctx");
  5353. },
  5354. //>>excludeStart("ide", pragmas.excludeIdeData);
  5355. args: [],
  5356. 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 }.",
  5357. referencedClasses: [],
  5358. //>>excludeEnd("ide");
  5359. messageSends: ["->", "assertSameContents:as:", "from:", "collectionClass", "class"]
  5360. }),
  5361. $globals.AssociativeCollectionTest);
  5362. $core.addMethod(
  5363. $core.method({
  5364. selector: "testKeys",
  5365. protocol: 'tests',
  5366. fn: function (){
  5367. var self=this;
  5368. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5369. return $core.withContext(function($ctx1) {
  5370. //>>excludeEnd("ctx");
  5371. var $2,$1,$3,$4;
  5372. $2=$recv($recv(self._collectionClass())._new())._keys();
  5373. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5374. $ctx1.sendIdx["keys"]=1;
  5375. //>>excludeEnd("ctx");
  5376. $1=$recv($2)._isEmpty();
  5377. self._assert_($1);
  5378. $3=$recv(self._collection())._keys();
  5379. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5380. $ctx1.sendIdx["keys"]=2;
  5381. //>>excludeEnd("ctx");
  5382. $4=self._collectionKeys();
  5383. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5384. $ctx1.sendIdx["collectionKeys"]=1;
  5385. //>>excludeEnd("ctx");
  5386. self._assertSameContents_as_($3,$4);
  5387. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5388. $ctx1.sendIdx["assertSameContents:as:"]=1;
  5389. //>>excludeEnd("ctx");
  5390. self._assertSameContents_as_($recv(self._collectionWithNewValue())._keys(),$recv(self._collectionKeys()).__comma([self._sampleNewIndex()]));
  5391. return self;
  5392. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5393. }, function($ctx1) {$ctx1.fill(self,"testKeys",{},$globals.AssociativeCollectionTest)});
  5394. //>>excludeEnd("ctx");
  5395. },
  5396. //>>excludeStart("ide", pragmas.excludeIdeData);
  5397. args: [],
  5398. 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 }",
  5399. referencedClasses: [],
  5400. //>>excludeEnd("ide");
  5401. messageSends: ["assert:", "isEmpty", "keys", "new", "collectionClass", "assertSameContents:as:", "collection", "collectionKeys", "collectionWithNewValue", ",", "sampleNewIndex"]
  5402. }),
  5403. $globals.AssociativeCollectionTest);
  5404. $core.addMethod(
  5405. $core.method({
  5406. selector: "testNewFromPairs",
  5407. protocol: 'tests',
  5408. fn: function (){
  5409. var self=this;
  5410. var flattenedAssociations;
  5411. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5412. return $core.withContext(function($ctx1) {
  5413. //>>excludeEnd("ctx");
  5414. flattenedAssociations=["a",(1),"b",(2)];
  5415. self._assertSameContents_as_($recv($recv(self._class())._collectionClass())._newFromPairs_(flattenedAssociations),$globals.HashedCollection._newFromPairs_(["a",(1),"b",(2)]));
  5416. return self;
  5417. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5418. }, function($ctx1) {$ctx1.fill(self,"testNewFromPairs",{flattenedAssociations:flattenedAssociations},$globals.AssociativeCollectionTest)});
  5419. //>>excludeEnd("ctx");
  5420. },
  5421. //>>excludeStart("ide", pragmas.excludeIdeData);
  5422. args: [],
  5423. 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 }.",
  5424. referencedClasses: [],
  5425. //>>excludeEnd("ide");
  5426. messageSends: ["assertSameContents:as:", "newFromPairs:", "collectionClass", "class"]
  5427. }),
  5428. $globals.AssociativeCollectionTest);
  5429. $core.addMethod(
  5430. $core.method({
  5431. selector: "testPrintString",
  5432. protocol: 'tests',
  5433. fn: function (){
  5434. var self=this;
  5435. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5436. return $core.withContext(function($ctx1) {
  5437. //>>excludeEnd("ctx");
  5438. var $3,$2,$1,$4;
  5439. $3=self._collectionClass();
  5440. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5441. $ctx1.sendIdx["collectionClass"]=1;
  5442. //>>excludeEnd("ctx");
  5443. $2=$recv($3)._new();
  5444. $recv($2)._at_put_("firstname","James");
  5445. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5446. $ctx1.sendIdx["at:put:"]=1;
  5447. //>>excludeEnd("ctx");
  5448. $recv($2)._at_put_("lastname","Bond");
  5449. $1=$recv($2)._printString();
  5450. $4=$recv("a ".__comma($recv(self._collectionClass())._name())).__comma(" ('firstname' -> 'James' , 'lastname' -> 'Bond')");
  5451. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5452. $ctx1.sendIdx[","]=1;
  5453. //>>excludeEnd("ctx");
  5454. self._assert_equals_($1,$4);
  5455. return self;
  5456. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5457. }, function($ctx1) {$ctx1.fill(self,"testPrintString",{},$globals.AssociativeCollectionTest)});
  5458. //>>excludeEnd("ctx");
  5459. },
  5460. //>>excludeStart("ide", pragmas.excludeIdeData);
  5461. args: [],
  5462. 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'')'",
  5463. referencedClasses: [],
  5464. //>>excludeEnd("ide");
  5465. messageSends: ["assert:equals:", "at:put:", "new", "collectionClass", "printString", ",", "name"]
  5466. }),
  5467. $globals.AssociativeCollectionTest);
  5468. $core.addMethod(
  5469. $core.method({
  5470. selector: "testRemoveKey",
  5471. protocol: 'tests',
  5472. fn: function (){
  5473. var self=this;
  5474. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  5475. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5476. return $core.withContext(function($ctx1) {
  5477. //>>excludeEnd("ctx");
  5478. var $1,$2,$3,$5,$6,$4,$8,$7;
  5479. self._nonIndexesDo_((function(each){
  5480. var collection;
  5481. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5482. return $core.withContext(function($ctx2) {
  5483. //>>excludeEnd("ctx");
  5484. collection=self._collection();
  5485. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5486. $ctx2.sendIdx["collection"]=1;
  5487. //>>excludeEnd("ctx");
  5488. collection;
  5489. self._should_raise_((function(){
  5490. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5491. return $core.withContext(function($ctx3) {
  5492. //>>excludeEnd("ctx");
  5493. return $recv(collection)._removeKey_(each);
  5494. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5495. $ctx3.sendIdx["removeKey:"]=1;
  5496. //>>excludeEnd("ctx");
  5497. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5498. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  5499. //>>excludeEnd("ctx");
  5500. }),$Error());
  5501. $1=collection;
  5502. $2=self._collection();
  5503. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5504. $ctx2.sendIdx["collection"]=2;
  5505. //>>excludeEnd("ctx");
  5506. return self._assert_equals_($1,$2);
  5507. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5508. $ctx2.sendIdx["assert:equals:"]=1;
  5509. //>>excludeEnd("ctx");
  5510. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5511. }, function($ctx2) {$ctx2.fillBlock({each:each,collection:collection},$ctx1,1)});
  5512. //>>excludeEnd("ctx");
  5513. }));
  5514. self._samplesDo_((function(index,value){
  5515. var collection;
  5516. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5517. return $core.withContext(function($ctx2) {
  5518. //>>excludeEnd("ctx");
  5519. collection=self._collection();
  5520. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5521. $ctx2.sendIdx["collection"]=3;
  5522. //>>excludeEnd("ctx");
  5523. collection;
  5524. $3=$recv(collection)._removeKey_(index);
  5525. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5526. $ctx2.sendIdx["removeKey:"]=2;
  5527. //>>excludeEnd("ctx");
  5528. self._assert_equals_($3,value);
  5529. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5530. $ctx2.sendIdx["assert:equals:"]=2;
  5531. //>>excludeEnd("ctx");
  5532. $5=collection;
  5533. $6=self._collection();
  5534. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5535. $ctx2.sendIdx["collection"]=4;
  5536. //>>excludeEnd("ctx");
  5537. $4=$recv($5).__eq($6);
  5538. return self._deny_($4);
  5539. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5540. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value,collection:collection},$ctx1,3)});
  5541. //>>excludeEnd("ctx");
  5542. }));
  5543. $8=self._collectionWithNewValue();
  5544. $recv($8)._removeKey_(self._sampleNewIndex());
  5545. $7=$recv($8)._yourself();
  5546. self._assert_equals_($7,self._collection());
  5547. return self;
  5548. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5549. }, function($ctx1) {$ctx1.fill(self,"testRemoveKey",{},$globals.AssociativeCollectionTest)});
  5550. //>>excludeEnd("ctx");
  5551. },
  5552. //>>excludeStart("ide", pragmas.excludeIdeData);
  5553. args: [],
  5554. 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",
  5555. referencedClasses: ["Error"],
  5556. //>>excludeEnd("ide");
  5557. messageSends: ["nonIndexesDo:", "collection", "should:raise:", "removeKey:", "assert:equals:", "samplesDo:", "deny:", "=", "collectionWithNewValue", "sampleNewIndex", "yourself"]
  5558. }),
  5559. $globals.AssociativeCollectionTest);
  5560. $core.addMethod(
  5561. $core.method({
  5562. selector: "testRemoveKeyIfAbsent",
  5563. protocol: 'tests',
  5564. fn: function (){
  5565. var self=this;
  5566. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5567. return $core.withContext(function($ctx1) {
  5568. //>>excludeEnd("ctx");
  5569. var $1,$2,$3,$4,$5,$7,$8,$6,$10,$9;
  5570. self._nonIndexesDo_((function(each){
  5571. var collection;
  5572. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5573. return $core.withContext(function($ctx2) {
  5574. //>>excludeEnd("ctx");
  5575. collection=self._collection();
  5576. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5577. $ctx2.sendIdx["collection"]=1;
  5578. //>>excludeEnd("ctx");
  5579. collection;
  5580. $1=$recv(collection)._removeKey_ifAbsent_(each,(function(){
  5581. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5582. return $core.withContext(function($ctx3) {
  5583. //>>excludeEnd("ctx");
  5584. return self._sampleNewValue();
  5585. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5586. $ctx3.sendIdx["sampleNewValue"]=1;
  5587. //>>excludeEnd("ctx");
  5588. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5589. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  5590. //>>excludeEnd("ctx");
  5591. }));
  5592. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5593. $ctx2.sendIdx["removeKey:ifAbsent:"]=1;
  5594. //>>excludeEnd("ctx");
  5595. $2=self._sampleNewValue();
  5596. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5597. $ctx2.sendIdx["sampleNewValue"]=2;
  5598. //>>excludeEnd("ctx");
  5599. self._assert_equals_($1,$2);
  5600. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5601. $ctx2.sendIdx["assert:equals:"]=1;
  5602. //>>excludeEnd("ctx");
  5603. $3=collection;
  5604. $4=self._collection();
  5605. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5606. $ctx2.sendIdx["collection"]=2;
  5607. //>>excludeEnd("ctx");
  5608. return self._assert_equals_($3,$4);
  5609. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5610. $ctx2.sendIdx["assert:equals:"]=2;
  5611. //>>excludeEnd("ctx");
  5612. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5613. }, function($ctx2) {$ctx2.fillBlock({each:each,collection:collection},$ctx1,1)});
  5614. //>>excludeEnd("ctx");
  5615. }));
  5616. self._samplesDo_((function(index,value){
  5617. var collection;
  5618. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5619. return $core.withContext(function($ctx2) {
  5620. //>>excludeEnd("ctx");
  5621. collection=self._collection();
  5622. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5623. $ctx2.sendIdx["collection"]=3;
  5624. //>>excludeEnd("ctx");
  5625. collection;
  5626. $5=$recv(collection)._removeKey_ifAbsent_(index,(function(){
  5627. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5628. return $core.withContext(function($ctx3) {
  5629. //>>excludeEnd("ctx");
  5630. return self._sampleNewValue();
  5631. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5632. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,4)});
  5633. //>>excludeEnd("ctx");
  5634. }));
  5635. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5636. $ctx2.sendIdx["removeKey:ifAbsent:"]=2;
  5637. //>>excludeEnd("ctx");
  5638. self._assert_equals_($5,value);
  5639. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5640. $ctx2.sendIdx["assert:equals:"]=3;
  5641. //>>excludeEnd("ctx");
  5642. $7=collection;
  5643. $8=self._collection();
  5644. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5645. $ctx2.sendIdx["collection"]=4;
  5646. //>>excludeEnd("ctx");
  5647. $6=$recv($7).__eq($8);
  5648. return self._deny_($6);
  5649. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5650. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value,collection:collection},$ctx1,3)});
  5651. //>>excludeEnd("ctx");
  5652. }));
  5653. $10=self._collectionWithNewValue();
  5654. $recv($10)._removeKey_ifAbsent_(self._sampleNewIndex(),(function(){
  5655. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5656. return $core.withContext(function($ctx2) {
  5657. //>>excludeEnd("ctx");
  5658. return self._assert_(false);
  5659. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5660. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,5)});
  5661. //>>excludeEnd("ctx");
  5662. }));
  5663. $9=$recv($10)._yourself();
  5664. self._assert_equals_($9,self._collection());
  5665. return self;
  5666. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5667. }, function($ctx1) {$ctx1.fill(self,"testRemoveKeyIfAbsent",{},$globals.AssociativeCollectionTest)});
  5668. //>>excludeEnd("ctx");
  5669. },
  5670. //>>excludeStart("ide", pragmas.excludeIdeData);
  5671. args: [],
  5672. 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",
  5673. referencedClasses: [],
  5674. //>>excludeEnd("ide");
  5675. messageSends: ["nonIndexesDo:", "collection", "assert:equals:", "removeKey:ifAbsent:", "sampleNewValue", "samplesDo:", "deny:", "=", "collectionWithNewValue", "sampleNewIndex", "assert:", "yourself"]
  5676. }),
  5677. $globals.AssociativeCollectionTest);
  5678. $core.addMethod(
  5679. $core.method({
  5680. selector: "testValues",
  5681. protocol: 'tests',
  5682. fn: function (){
  5683. var self=this;
  5684. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5685. return $core.withContext(function($ctx1) {
  5686. //>>excludeEnd("ctx");
  5687. var $2,$1,$3,$4;
  5688. $2=$recv($recv(self._collectionClass())._new())._values();
  5689. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5690. $ctx1.sendIdx["values"]=1;
  5691. //>>excludeEnd("ctx");
  5692. $1=$recv($2)._isEmpty();
  5693. self._assert_($1);
  5694. $3=$recv(self._collection())._values();
  5695. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5696. $ctx1.sendIdx["values"]=2;
  5697. //>>excludeEnd("ctx");
  5698. $4=self._collectionValues();
  5699. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5700. $ctx1.sendIdx["collectionValues"]=1;
  5701. //>>excludeEnd("ctx");
  5702. self._assertSameContents_as_($3,$4);
  5703. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5704. $ctx1.sendIdx["assertSameContents:as:"]=1;
  5705. //>>excludeEnd("ctx");
  5706. self._assertSameContents_as_($recv(self._collectionWithNewValue())._values(),$recv(self._collectionValues()).__comma([self._sampleNewValue()]));
  5707. return self;
  5708. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5709. }, function($ctx1) {$ctx1.fill(self,"testValues",{},$globals.AssociativeCollectionTest)});
  5710. //>>excludeEnd("ctx");
  5711. },
  5712. //>>excludeStart("ide", pragmas.excludeIdeData);
  5713. args: [],
  5714. 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 }",
  5715. referencedClasses: [],
  5716. //>>excludeEnd("ide");
  5717. messageSends: ["assert:", "isEmpty", "values", "new", "collectionClass", "assertSameContents:as:", "collection", "collectionValues", "collectionWithNewValue", ",", "sampleNewValue"]
  5718. }),
  5719. $globals.AssociativeCollectionTest);
  5720. $core.addClass('DictionaryTest', $globals.AssociativeCollectionTest, [], 'Kernel-Tests');
  5721. $core.addMethod(
  5722. $core.method({
  5723. selector: "collection",
  5724. protocol: 'fixture',
  5725. fn: function (){
  5726. var self=this;
  5727. function $Dictionary(){return $globals.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  5728. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5729. return $core.withContext(function($ctx1) {
  5730. //>>excludeEnd("ctx");
  5731. var $1;
  5732. $1=$recv($Dictionary())._new();
  5733. $recv($1)._at_put_((1),(1));
  5734. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5735. $ctx1.sendIdx["at:put:"]=1;
  5736. //>>excludeEnd("ctx");
  5737. $recv($1)._at_put_("a",(2));
  5738. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5739. $ctx1.sendIdx["at:put:"]=2;
  5740. //>>excludeEnd("ctx");
  5741. $recv($1)._at_put_(true,(3));
  5742. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5743. $ctx1.sendIdx["at:put:"]=3;
  5744. //>>excludeEnd("ctx");
  5745. $recv($1)._at_put_((1).__at((3)),(-4));
  5746. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5747. $ctx1.sendIdx["at:put:"]=4;
  5748. //>>excludeEnd("ctx");
  5749. $recv($1)._at_put_(self["@sampleBlock"],(9));
  5750. return $recv($1)._yourself();
  5751. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5752. }, function($ctx1) {$ctx1.fill(self,"collection",{},$globals.DictionaryTest)});
  5753. //>>excludeEnd("ctx");
  5754. },
  5755. //>>excludeStart("ide", pragmas.excludeIdeData);
  5756. args: [],
  5757. source: "collection\x0a\x09^ Dictionary new\x0a\x09\x09at: 1 put: 1;\x0a\x09\x09at: 'a' put: 2;\x0a\x09\x09at: true put: 3;\x0a\x09\x09at: 1@3 put: -4;\x0a\x09\x09at: sampleBlock put: 9;\x0a\x09\x09yourself",
  5758. referencedClasses: ["Dictionary"],
  5759. //>>excludeEnd("ide");
  5760. messageSends: ["at:put:", "new", "@", "yourself"]
  5761. }),
  5762. $globals.DictionaryTest);
  5763. $core.addMethod(
  5764. $core.method({
  5765. selector: "collectionKeys",
  5766. protocol: 'fixture',
  5767. fn: function (){
  5768. var self=this;
  5769. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5770. return $core.withContext(function($ctx1) {
  5771. //>>excludeEnd("ctx");
  5772. return [(1),"a",true,(1).__at((3)),self["@sampleBlock"]];
  5773. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5774. }, function($ctx1) {$ctx1.fill(self,"collectionKeys",{},$globals.DictionaryTest)});
  5775. //>>excludeEnd("ctx");
  5776. },
  5777. //>>excludeStart("ide", pragmas.excludeIdeData);
  5778. args: [],
  5779. source: "collectionKeys\x0a\x09^ {1. 'a'. true. 1@3. sampleBlock}",
  5780. referencedClasses: [],
  5781. //>>excludeEnd("ide");
  5782. messageSends: ["@"]
  5783. }),
  5784. $globals.DictionaryTest);
  5785. $core.addMethod(
  5786. $core.method({
  5787. selector: "collectionOfPrintStrings",
  5788. protocol: 'fixture',
  5789. fn: function (){
  5790. var self=this;
  5791. function $Dictionary(){return $globals.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  5792. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5793. return $core.withContext(function($ctx1) {
  5794. //>>excludeEnd("ctx");
  5795. var $1;
  5796. $1=$recv($Dictionary())._new();
  5797. $recv($1)._at_put_((1),"1");
  5798. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5799. $ctx1.sendIdx["at:put:"]=1;
  5800. //>>excludeEnd("ctx");
  5801. $recv($1)._at_put_("a","2");
  5802. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5803. $ctx1.sendIdx["at:put:"]=2;
  5804. //>>excludeEnd("ctx");
  5805. $recv($1)._at_put_(true,"3");
  5806. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5807. $ctx1.sendIdx["at:put:"]=3;
  5808. //>>excludeEnd("ctx");
  5809. $recv($1)._at_put_((1).__at((3)),"-4");
  5810. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5811. $ctx1.sendIdx["at:put:"]=4;
  5812. //>>excludeEnd("ctx");
  5813. $recv($1)._at_put_(self["@sampleBlock"],"9");
  5814. return $recv($1)._yourself();
  5815. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5816. }, function($ctx1) {$ctx1.fill(self,"collectionOfPrintStrings",{},$globals.DictionaryTest)});
  5817. //>>excludeEnd("ctx");
  5818. },
  5819. //>>excludeStart("ide", pragmas.excludeIdeData);
  5820. args: [],
  5821. source: "collectionOfPrintStrings\x0a\x09^ Dictionary new\x0a\x09\x09at: 1 put: '1';\x0a\x09\x09at: 'a' put: '2';\x0a\x09\x09at: true put: '3';\x0a\x09\x09at: 1@3 put: '-4';\x0a\x09\x09at: sampleBlock put: '9';\x0a\x09\x09yourself",
  5822. referencedClasses: ["Dictionary"],
  5823. //>>excludeEnd("ide");
  5824. messageSends: ["at:put:", "new", "@", "yourself"]
  5825. }),
  5826. $globals.DictionaryTest);
  5827. $core.addMethod(
  5828. $core.method({
  5829. selector: "collectionSize",
  5830. protocol: 'fixture',
  5831. fn: function (){
  5832. var self=this;
  5833. return (5);
  5834. },
  5835. //>>excludeStart("ide", pragmas.excludeIdeData);
  5836. args: [],
  5837. source: "collectionSize\x0a\x09^ 5",
  5838. referencedClasses: [],
  5839. //>>excludeEnd("ide");
  5840. messageSends: []
  5841. }),
  5842. $globals.DictionaryTest);
  5843. $core.addMethod(
  5844. $core.method({
  5845. selector: "collectionValues",
  5846. protocol: 'fixture',
  5847. fn: function (){
  5848. var self=this;
  5849. return [(1),(2),(3),(-4),(9)];
  5850. },
  5851. //>>excludeStart("ide", pragmas.excludeIdeData);
  5852. args: [],
  5853. source: "collectionValues\x0a\x09^ {1. 2. 3. -4. 9}",
  5854. referencedClasses: [],
  5855. //>>excludeEnd("ide");
  5856. messageSends: []
  5857. }),
  5858. $globals.DictionaryTest);
  5859. $core.addMethod(
  5860. $core.method({
  5861. selector: "collectionWithDuplicates",
  5862. protocol: 'fixture',
  5863. fn: function (){
  5864. var self=this;
  5865. function $Dictionary(){return $globals.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  5866. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5867. return $core.withContext(function($ctx1) {
  5868. //>>excludeEnd("ctx");
  5869. var $1;
  5870. $1=$recv($Dictionary())._new();
  5871. $recv($1)._at_put_((1),(1));
  5872. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5873. $ctx1.sendIdx["at:put:"]=1;
  5874. //>>excludeEnd("ctx");
  5875. $recv($1)._at_put_("a",(2));
  5876. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5877. $ctx1.sendIdx["at:put:"]=2;
  5878. //>>excludeEnd("ctx");
  5879. $recv($1)._at_put_(true,(3));
  5880. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5881. $ctx1.sendIdx["at:put:"]=3;
  5882. //>>excludeEnd("ctx");
  5883. $recv($1)._at_put_((4),(-4));
  5884. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5885. $ctx1.sendIdx["at:put:"]=4;
  5886. //>>excludeEnd("ctx");
  5887. $recv($1)._at_put_(self["@sampleBlock"],(9));
  5888. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5889. $ctx1.sendIdx["at:put:"]=5;
  5890. //>>excludeEnd("ctx");
  5891. $recv($1)._at_put_("b",(1));
  5892. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5893. $ctx1.sendIdx["at:put:"]=6;
  5894. //>>excludeEnd("ctx");
  5895. $recv($1)._at_put_((3),(3));
  5896. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5897. $ctx1.sendIdx["at:put:"]=7;
  5898. //>>excludeEnd("ctx");
  5899. $recv($1)._at_put_(false,(12));
  5900. return $recv($1)._yourself();
  5901. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5902. }, function($ctx1) {$ctx1.fill(self,"collectionWithDuplicates",{},$globals.DictionaryTest)});
  5903. //>>excludeEnd("ctx");
  5904. },
  5905. //>>excludeStart("ide", pragmas.excludeIdeData);
  5906. args: [],
  5907. source: "collectionWithDuplicates\x0a\x09^ Dictionary new\x0a\x09\x09at: 1 put: 1;\x0a\x09\x09at: 'a' put: 2;\x0a\x09\x09at: true put: 3;\x0a\x09\x09at: 4 put: -4;\x0a\x09\x09at: sampleBlock put: 9;\x0a\x09\x09at: 'b' put: 1;\x0a\x09\x09at: 3 put: 3;\x0a\x09\x09at: false put: 12;\x0a\x09\x09yourself",
  5908. referencedClasses: ["Dictionary"],
  5909. //>>excludeEnd("ide");
  5910. messageSends: ["at:put:", "new", "yourself"]
  5911. }),
  5912. $globals.DictionaryTest);
  5913. $core.addMethod(
  5914. $core.method({
  5915. selector: "collectionWithNewValue",
  5916. protocol: 'fixture',
  5917. fn: function (){
  5918. var self=this;
  5919. function $Dictionary(){return $globals.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  5920. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5921. return $core.withContext(function($ctx1) {
  5922. //>>excludeEnd("ctx");
  5923. var $1;
  5924. $1=$recv($Dictionary())._new();
  5925. $recv($1)._at_put_((1),(1));
  5926. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5927. $ctx1.sendIdx["at:put:"]=1;
  5928. //>>excludeEnd("ctx");
  5929. $recv($1)._at_put_("a",(2));
  5930. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5931. $ctx1.sendIdx["at:put:"]=2;
  5932. //>>excludeEnd("ctx");
  5933. $recv($1)._at_put_(true,(3));
  5934. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5935. $ctx1.sendIdx["at:put:"]=3;
  5936. //>>excludeEnd("ctx");
  5937. $recv($1)._at_put_((1).__at((3)),(-4));
  5938. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5939. $ctx1.sendIdx["at:put:"]=4;
  5940. //>>excludeEnd("ctx");
  5941. $recv($1)._at_put_(self["@sampleBlock"],(9));
  5942. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5943. $ctx1.sendIdx["at:put:"]=5;
  5944. //>>excludeEnd("ctx");
  5945. $recv($1)._at_put_("new","N");
  5946. return $recv($1)._yourself();
  5947. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5948. }, function($ctx1) {$ctx1.fill(self,"collectionWithNewValue",{},$globals.DictionaryTest)});
  5949. //>>excludeEnd("ctx");
  5950. },
  5951. //>>excludeStart("ide", pragmas.excludeIdeData);
  5952. args: [],
  5953. source: "collectionWithNewValue\x0a\x09^ Dictionary new\x0a\x09\x09at: 1 put: 1;\x0a\x09\x09at: 'a' put: 2;\x0a\x09\x09at: true put: 3;\x0a\x09\x09at: 1@3 put: -4;\x0a\x09\x09at: sampleBlock put: 9;\x0a\x09\x09at: 'new' put: 'N';\x0a\x09\x09yourself",
  5954. referencedClasses: ["Dictionary"],
  5955. //>>excludeEnd("ide");
  5956. messageSends: ["at:put:", "new", "@", "yourself"]
  5957. }),
  5958. $globals.DictionaryTest);
  5959. $core.addMethod(
  5960. $core.method({
  5961. selector: "sampleNewValueAsCollection",
  5962. protocol: 'fixture',
  5963. fn: function (){
  5964. var self=this;
  5965. function $Dictionary(){return $globals.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  5966. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5967. return $core.withContext(function($ctx1) {
  5968. //>>excludeEnd("ctx");
  5969. var $1;
  5970. $1=$recv($Dictionary())._new();
  5971. $recv($1)._at_put_("new","N");
  5972. return $recv($1)._yourself();
  5973. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5974. }, function($ctx1) {$ctx1.fill(self,"sampleNewValueAsCollection",{},$globals.DictionaryTest)});
  5975. //>>excludeEnd("ctx");
  5976. },
  5977. //>>excludeStart("ide", pragmas.excludeIdeData);
  5978. args: [],
  5979. source: "sampleNewValueAsCollection\x0a\x09^ Dictionary new\x0a\x09\x09at: 'new' put: 'N';\x0a\x09\x09yourself",
  5980. referencedClasses: ["Dictionary"],
  5981. //>>excludeEnd("ide");
  5982. messageSends: ["at:put:", "new", "yourself"]
  5983. }),
  5984. $globals.DictionaryTest);
  5985. $core.addMethod(
  5986. $core.method({
  5987. selector: "samplesDo:",
  5988. protocol: 'fixture',
  5989. fn: function (aBlock){
  5990. var self=this;
  5991. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5992. return $core.withContext(function($ctx1) {
  5993. //>>excludeEnd("ctx");
  5994. (
  5995. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5996. $ctx1.supercall = true,
  5997. //>>excludeEnd("ctx");
  5998. ($globals.DictionaryTest.superclass||$boot.dnu).fn.prototype._samplesDo_.apply($recv(self), [aBlock]));
  5999. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6000. $ctx1.supercall = false;
  6001. //>>excludeEnd("ctx");;
  6002. $recv(aBlock)._value_value_(true,(3));
  6003. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6004. $ctx1.sendIdx["value:value:"]=1;
  6005. //>>excludeEnd("ctx");
  6006. $recv(aBlock)._value_value_((1).__at((3)),(-4));
  6007. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6008. $ctx1.sendIdx["value:value:"]=2;
  6009. //>>excludeEnd("ctx");
  6010. $recv(aBlock)._value_value_(self["@sampleBlock"],(9));
  6011. return self;
  6012. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6013. }, function($ctx1) {$ctx1.fill(self,"samplesDo:",{aBlock:aBlock},$globals.DictionaryTest)});
  6014. //>>excludeEnd("ctx");
  6015. },
  6016. //>>excludeStart("ide", pragmas.excludeIdeData);
  6017. args: ["aBlock"],
  6018. source: "samplesDo: aBlock\x0a\x09super samplesDo: aBlock.\x0a\x09aBlock value: true value: 3.\x0a\x09aBlock value: 1@3 value: -4.\x0a\x09aBlock value: sampleBlock value: 9",
  6019. referencedClasses: [],
  6020. //>>excludeEnd("ide");
  6021. messageSends: ["samplesDo:", "value:value:", "@"]
  6022. }),
  6023. $globals.DictionaryTest);
  6024. $core.addMethod(
  6025. $core.method({
  6026. selector: "testAccessing",
  6027. protocol: 'tests',
  6028. fn: function (){
  6029. var self=this;
  6030. var d;
  6031. function $Dictionary(){return $globals.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  6032. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6033. return $core.withContext(function($ctx1) {
  6034. //>>excludeEnd("ctx");
  6035. var $1,$2,$3,$4,$5,$6,$7,$9,$10,$8,$12,$13,$11;
  6036. d=$recv($Dictionary())._new();
  6037. $recv(d)._at_put_("hello","world");
  6038. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6039. $ctx1.sendIdx["at:put:"]=1;
  6040. //>>excludeEnd("ctx");
  6041. $1=$recv(d)._at_("hello");
  6042. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6043. $ctx1.sendIdx["at:"]=1;
  6044. //>>excludeEnd("ctx");
  6045. self._assert_equals_($1,"world");
  6046. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6047. $ctx1.sendIdx["assert:equals:"]=1;
  6048. //>>excludeEnd("ctx");
  6049. $2=$recv(d)._at_ifAbsent_("hello",(function(){
  6050. return nil;
  6051. }));
  6052. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6053. $ctx1.sendIdx["at:ifAbsent:"]=1;
  6054. //>>excludeEnd("ctx");
  6055. self._assert_equals_($2,"world");
  6056. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6057. $ctx1.sendIdx["assert:equals:"]=2;
  6058. //>>excludeEnd("ctx");
  6059. self._deny_($recv($recv(d)._at_ifAbsent_("foo",(function(){
  6060. return nil;
  6061. }))).__eq("world"));
  6062. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6063. $ctx1.sendIdx["deny:"]=1;
  6064. //>>excludeEnd("ctx");
  6065. $3=$recv(d)._includesKey_("hello");
  6066. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6067. $ctx1.sendIdx["includesKey:"]=1;
  6068. //>>excludeEnd("ctx");
  6069. self._assert_($3);
  6070. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6071. $ctx1.sendIdx["assert:"]=1;
  6072. //>>excludeEnd("ctx");
  6073. $4=$recv(d)._includesKey_("foo");
  6074. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6075. $ctx1.sendIdx["includesKey:"]=2;
  6076. //>>excludeEnd("ctx");
  6077. self._deny_($4);
  6078. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6079. $ctx1.sendIdx["deny:"]=2;
  6080. //>>excludeEnd("ctx");
  6081. $recv(d)._at_put_((1),(2));
  6082. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6083. $ctx1.sendIdx["at:put:"]=2;
  6084. //>>excludeEnd("ctx");
  6085. $5=$recv(d)._at_((1));
  6086. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6087. $ctx1.sendIdx["at:"]=2;
  6088. //>>excludeEnd("ctx");
  6089. self._assert_equals_($5,(2));
  6090. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6091. $ctx1.sendIdx["assert:equals:"]=3;
  6092. //>>excludeEnd("ctx");
  6093. $6=d;
  6094. $7=(1).__at((3));
  6095. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6096. $ctx1.sendIdx["@"]=1;
  6097. //>>excludeEnd("ctx");
  6098. $recv($6)._at_put_($7,(3));
  6099. $9=d;
  6100. $10=(1).__at((3));
  6101. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6102. $ctx1.sendIdx["@"]=2;
  6103. //>>excludeEnd("ctx");
  6104. $8=$recv($9)._at_($10);
  6105. self._assert_equals_($8,(3));
  6106. $12=d;
  6107. $13=(1).__at((3));
  6108. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6109. $ctx1.sendIdx["@"]=3;
  6110. //>>excludeEnd("ctx");
  6111. $11=$recv($12)._includesKey_($13);
  6112. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6113. $ctx1.sendIdx["includesKey:"]=3;
  6114. //>>excludeEnd("ctx");
  6115. self._assert_($11);
  6116. self._deny_($recv(d)._includesKey_((3).__at((1))));
  6117. return self;
  6118. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6119. }, function($ctx1) {$ctx1.fill(self,"testAccessing",{d:d},$globals.DictionaryTest)});
  6120. //>>excludeEnd("ctx");
  6121. },
  6122. //>>excludeStart("ide", pragmas.excludeIdeData);
  6123. args: [],
  6124. 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)",
  6125. referencedClasses: ["Dictionary"],
  6126. //>>excludeEnd("ide");
  6127. messageSends: ["new", "at:put:", "assert:equals:", "at:", "at:ifAbsent:", "deny:", "=", "assert:", "includesKey:", "@"]
  6128. }),
  6129. $globals.DictionaryTest);
  6130. $core.addMethod(
  6131. $core.method({
  6132. selector: "testDynamicDictionaries",
  6133. protocol: 'tests',
  6134. fn: function (){
  6135. var self=this;
  6136. function $Dictionary(){return $globals.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  6137. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6138. return $core.withContext(function($ctx1) {
  6139. //>>excludeEnd("ctx");
  6140. self._assert_equals_($recv($globals.HashedCollection._newFromPairs_(["hello",(1)]))._asDictionary(),$recv($Dictionary())._with_("hello".__minus_gt((1))));
  6141. return self;
  6142. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6143. }, function($ctx1) {$ctx1.fill(self,"testDynamicDictionaries",{},$globals.DictionaryTest)});
  6144. //>>excludeEnd("ctx");
  6145. },
  6146. //>>excludeStart("ide", pragmas.excludeIdeData);
  6147. args: [],
  6148. source: "testDynamicDictionaries\x0a\x09self assert: #{'hello' -> 1} asDictionary equals: (Dictionary with: 'hello' -> 1)",
  6149. referencedClasses: ["Dictionary"],
  6150. //>>excludeEnd("ide");
  6151. messageSends: ["assert:equals:", "asDictionary", "with:", "->"]
  6152. }),
  6153. $globals.DictionaryTest);
  6154. $core.addMethod(
  6155. $core.method({
  6156. selector: "collectionClass",
  6157. protocol: 'fixture',
  6158. fn: function (){
  6159. var self=this;
  6160. function $Dictionary(){return $globals.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  6161. return $Dictionary();
  6162. },
  6163. //>>excludeStart("ide", pragmas.excludeIdeData);
  6164. args: [],
  6165. source: "collectionClass\x0a\x09^ Dictionary",
  6166. referencedClasses: ["Dictionary"],
  6167. //>>excludeEnd("ide");
  6168. messageSends: []
  6169. }),
  6170. $globals.DictionaryTest.klass);
  6171. $core.addClass('HashedCollectionTest', $globals.AssociativeCollectionTest, [], 'Kernel-Tests');
  6172. $core.addMethod(
  6173. $core.method({
  6174. selector: "collection",
  6175. protocol: 'fixture',
  6176. fn: function (){
  6177. var self=this;
  6178. return $globals.HashedCollection._newFromPairs_(["b",(1),"a",(2),"c",(3),"d",(-4)]);
  6179. },
  6180. //>>excludeStart("ide", pragmas.excludeIdeData);
  6181. args: [],
  6182. source: "collection\x0a\x09^ #{ 'b' -> 1. 'a' -> 2. 'c' -> 3. 'd' -> -4 }",
  6183. referencedClasses: [],
  6184. //>>excludeEnd("ide");
  6185. messageSends: []
  6186. }),
  6187. $globals.HashedCollectionTest);
  6188. $core.addMethod(
  6189. $core.method({
  6190. selector: "collectionKeys",
  6191. protocol: 'fixture',
  6192. fn: function (){
  6193. var self=this;
  6194. return ["b","a","c","d"];
  6195. },
  6196. //>>excludeStart("ide", pragmas.excludeIdeData);
  6197. args: [],
  6198. source: "collectionKeys\x0a\x09^ { 'b'. 'a'. 'c'. 'd' }",
  6199. referencedClasses: [],
  6200. //>>excludeEnd("ide");
  6201. messageSends: []
  6202. }),
  6203. $globals.HashedCollectionTest);
  6204. $core.addMethod(
  6205. $core.method({
  6206. selector: "collectionOfPrintStrings",
  6207. protocol: 'fixture',
  6208. fn: function (){
  6209. var self=this;
  6210. return $globals.HashedCollection._newFromPairs_(["b","1","a","2","c","3","d","-4"]);
  6211. },
  6212. //>>excludeStart("ide", pragmas.excludeIdeData);
  6213. args: [],
  6214. source: "collectionOfPrintStrings\x0a\x09^ #{ 'b' -> '1'. 'a' -> '2'. 'c' -> '3'. 'd' -> '-4' }",
  6215. referencedClasses: [],
  6216. //>>excludeEnd("ide");
  6217. messageSends: []
  6218. }),
  6219. $globals.HashedCollectionTest);
  6220. $core.addMethod(
  6221. $core.method({
  6222. selector: "collectionSize",
  6223. protocol: 'fixture',
  6224. fn: function (){
  6225. var self=this;
  6226. return (4);
  6227. },
  6228. //>>excludeStart("ide", pragmas.excludeIdeData);
  6229. args: [],
  6230. source: "collectionSize\x0a\x09^ 4",
  6231. referencedClasses: [],
  6232. //>>excludeEnd("ide");
  6233. messageSends: []
  6234. }),
  6235. $globals.HashedCollectionTest);
  6236. $core.addMethod(
  6237. $core.method({
  6238. selector: "collectionValues",
  6239. protocol: 'fixture',
  6240. fn: function (){
  6241. var self=this;
  6242. return [(1),(2),(3),(-4)];
  6243. },
  6244. //>>excludeStart("ide", pragmas.excludeIdeData);
  6245. args: [],
  6246. source: "collectionValues\x0a\x09^ { 1. 2. 3. -4 }",
  6247. referencedClasses: [],
  6248. //>>excludeEnd("ide");
  6249. messageSends: []
  6250. }),
  6251. $globals.HashedCollectionTest);
  6252. $core.addMethod(
  6253. $core.method({
  6254. selector: "collectionWithDuplicates",
  6255. protocol: 'fixture',
  6256. fn: function (){
  6257. var self=this;
  6258. return $globals.HashedCollection._newFromPairs_(["b",(1),"a",(2),"c",(3),"d",(-4),"e",(1),"f",(2),"g",(10),"h",(0)]);
  6259. },
  6260. //>>excludeStart("ide", pragmas.excludeIdeData);
  6261. args: [],
  6262. source: "collectionWithDuplicates\x0a\x09^ #{ 'b' -> 1. 'a' -> 2. 'c' -> 3. 'd' -> -4. 'e' -> 1. 'f' -> 2. 'g' -> 10. 'h' -> 0 }",
  6263. referencedClasses: [],
  6264. //>>excludeEnd("ide");
  6265. messageSends: []
  6266. }),
  6267. $globals.HashedCollectionTest);
  6268. $core.addMethod(
  6269. $core.method({
  6270. selector: "collectionWithNewValue",
  6271. protocol: 'fixture',
  6272. fn: function (){
  6273. var self=this;
  6274. return $globals.HashedCollection._newFromPairs_(["b",(1),"a",(2),"c",(3),"d",(-4),"new","N"]);
  6275. },
  6276. //>>excludeStart("ide", pragmas.excludeIdeData);
  6277. args: [],
  6278. source: "collectionWithNewValue\x0a\x09^ #{ 'b' -> 1. 'a' -> 2. 'c' -> 3. 'd' -> -4. 'new' -> 'N' }",
  6279. referencedClasses: [],
  6280. //>>excludeEnd("ide");
  6281. messageSends: []
  6282. }),
  6283. $globals.HashedCollectionTest);
  6284. $core.addMethod(
  6285. $core.method({
  6286. selector: "sampleNewValueAsCollection",
  6287. protocol: 'fixture',
  6288. fn: function (){
  6289. var self=this;
  6290. return $globals.HashedCollection._newFromPairs_(["new","N"]);
  6291. },
  6292. //>>excludeStart("ide", pragmas.excludeIdeData);
  6293. args: [],
  6294. source: "sampleNewValueAsCollection\x0a\x09^ #{ 'new' -> 'N' }",
  6295. referencedClasses: [],
  6296. //>>excludeEnd("ide");
  6297. messageSends: []
  6298. }),
  6299. $globals.HashedCollectionTest);
  6300. $core.addMethod(
  6301. $core.method({
  6302. selector: "testDynamicDictionaries",
  6303. protocol: 'tests',
  6304. fn: function (){
  6305. var self=this;
  6306. function $HashedCollection(){return $globals.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
  6307. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6308. return $core.withContext(function($ctx1) {
  6309. //>>excludeEnd("ctx");
  6310. self._assert_equals_($recv($globals.HashedCollection._newFromPairs_(["hello",(1)]))._asHashedCollection(),$recv($HashedCollection())._with_("hello".__minus_gt((1))));
  6311. return self;
  6312. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6313. }, function($ctx1) {$ctx1.fill(self,"testDynamicDictionaries",{},$globals.HashedCollectionTest)});
  6314. //>>excludeEnd("ctx");
  6315. },
  6316. //>>excludeStart("ide", pragmas.excludeIdeData);
  6317. args: [],
  6318. source: "testDynamicDictionaries\x0a\x09self assert: #{'hello' -> 1} asHashedCollection equals: (HashedCollection with: 'hello' -> 1)",
  6319. referencedClasses: ["HashedCollection"],
  6320. //>>excludeEnd("ide");
  6321. messageSends: ["assert:equals:", "asHashedCollection", "with:", "->"]
  6322. }),
  6323. $globals.HashedCollectionTest);
  6324. $core.addMethod(
  6325. $core.method({
  6326. selector: "collectionClass",
  6327. protocol: 'fixture',
  6328. fn: function (){
  6329. var self=this;
  6330. function $HashedCollection(){return $globals.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
  6331. return $HashedCollection();
  6332. },
  6333. //>>excludeStart("ide", pragmas.excludeIdeData);
  6334. args: [],
  6335. source: "collectionClass\x0a\x09^ HashedCollection",
  6336. referencedClasses: ["HashedCollection"],
  6337. //>>excludeEnd("ide");
  6338. messageSends: []
  6339. }),
  6340. $globals.HashedCollectionTest.klass);
  6341. $core.addClass('SequenceableCollectionTest', $globals.IndexableCollectionTest, [], 'Kernel-Tests');
  6342. $core.addMethod(
  6343. $core.method({
  6344. selector: "collectionFirst",
  6345. protocol: 'fixture',
  6346. fn: function (){
  6347. var self=this;
  6348. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6349. return $core.withContext(function($ctx1) {
  6350. //>>excludeEnd("ctx");
  6351. self._subclassResponsibility();
  6352. return self;
  6353. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6354. }, function($ctx1) {$ctx1.fill(self,"collectionFirst",{},$globals.SequenceableCollectionTest)});
  6355. //>>excludeEnd("ctx");
  6356. },
  6357. //>>excludeStart("ide", pragmas.excludeIdeData);
  6358. args: [],
  6359. source: "collectionFirst\x0a\x09self subclassResponsibility",
  6360. referencedClasses: [],
  6361. //>>excludeEnd("ide");
  6362. messageSends: ["subclassResponsibility"]
  6363. }),
  6364. $globals.SequenceableCollectionTest);
  6365. $core.addMethod(
  6366. $core.method({
  6367. selector: "collectionFirstTwo",
  6368. protocol: 'fixture',
  6369. fn: function (){
  6370. var self=this;
  6371. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6372. return $core.withContext(function($ctx1) {
  6373. //>>excludeEnd("ctx");
  6374. self._subclassResponsibility();
  6375. return self;
  6376. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6377. }, function($ctx1) {$ctx1.fill(self,"collectionFirstTwo",{},$globals.SequenceableCollectionTest)});
  6378. //>>excludeEnd("ctx");
  6379. },
  6380. //>>excludeStart("ide", pragmas.excludeIdeData);
  6381. args: [],
  6382. source: "collectionFirstTwo\x0a\x09self subclassResponsibility",
  6383. referencedClasses: [],
  6384. //>>excludeEnd("ide");
  6385. messageSends: ["subclassResponsibility"]
  6386. }),
  6387. $globals.SequenceableCollectionTest);
  6388. $core.addMethod(
  6389. $core.method({
  6390. selector: "collectionLast",
  6391. protocol: 'fixture',
  6392. fn: function (){
  6393. var self=this;
  6394. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6395. return $core.withContext(function($ctx1) {
  6396. //>>excludeEnd("ctx");
  6397. self._subclassResponsibility();
  6398. return self;
  6399. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6400. }, function($ctx1) {$ctx1.fill(self,"collectionLast",{},$globals.SequenceableCollectionTest)});
  6401. //>>excludeEnd("ctx");
  6402. },
  6403. //>>excludeStart("ide", pragmas.excludeIdeData);
  6404. args: [],
  6405. source: "collectionLast\x0a\x09self subclassResponsibility",
  6406. referencedClasses: [],
  6407. //>>excludeEnd("ide");
  6408. messageSends: ["subclassResponsibility"]
  6409. }),
  6410. $globals.SequenceableCollectionTest);
  6411. $core.addMethod(
  6412. $core.method({
  6413. selector: "collectionLastTwo",
  6414. protocol: 'fixture',
  6415. fn: function (){
  6416. var self=this;
  6417. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6418. return $core.withContext(function($ctx1) {
  6419. //>>excludeEnd("ctx");
  6420. self._subclassResponsibility();
  6421. return self;
  6422. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6423. }, function($ctx1) {$ctx1.fill(self,"collectionLastTwo",{},$globals.SequenceableCollectionTest)});
  6424. //>>excludeEnd("ctx");
  6425. },
  6426. //>>excludeStart("ide", pragmas.excludeIdeData);
  6427. args: [],
  6428. source: "collectionLastTwo\x0a\x09self subclassResponsibility",
  6429. referencedClasses: [],
  6430. //>>excludeEnd("ide");
  6431. messageSends: ["subclassResponsibility"]
  6432. }),
  6433. $globals.SequenceableCollectionTest);
  6434. $core.addMethod(
  6435. $core.method({
  6436. selector: "nonIndexesDo:",
  6437. protocol: 'fixture',
  6438. fn: function (aBlock){
  6439. var self=this;
  6440. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6441. return $core.withContext(function($ctx1) {
  6442. //>>excludeEnd("ctx");
  6443. $recv(aBlock)._value_((0));
  6444. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6445. $ctx1.sendIdx["value:"]=1;
  6446. //>>excludeEnd("ctx");
  6447. $recv(aBlock)._value_($recv(self._collectionSize()).__plus((1)));
  6448. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6449. $ctx1.sendIdx["value:"]=2;
  6450. //>>excludeEnd("ctx");
  6451. $recv(aBlock)._value_("z");
  6452. return self;
  6453. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6454. }, function($ctx1) {$ctx1.fill(self,"nonIndexesDo:",{aBlock:aBlock},$globals.SequenceableCollectionTest)});
  6455. //>>excludeEnd("ctx");
  6456. },
  6457. //>>excludeStart("ide", pragmas.excludeIdeData);
  6458. args: ["aBlock"],
  6459. source: "nonIndexesDo: aBlock\x0a\x09aBlock value: 0.\x0a\x09aBlock value: self collectionSize + 1.\x0a\x09aBlock value: 'z'",
  6460. referencedClasses: [],
  6461. //>>excludeEnd("ide");
  6462. messageSends: ["value:", "+", "collectionSize"]
  6463. }),
  6464. $globals.SequenceableCollectionTest);
  6465. $core.addMethod(
  6466. $core.method({
  6467. selector: "samplesDo:",
  6468. protocol: 'fixture',
  6469. fn: function (aBlock){
  6470. var self=this;
  6471. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6472. return $core.withContext(function($ctx1) {
  6473. //>>excludeEnd("ctx");
  6474. $recv(aBlock)._value_value_((1),self._collectionFirst());
  6475. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6476. $ctx1.sendIdx["value:value:"]=1;
  6477. //>>excludeEnd("ctx");
  6478. $recv(aBlock)._value_value_(self._collectionSize(),self._collectionLast());
  6479. return self;
  6480. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6481. }, function($ctx1) {$ctx1.fill(self,"samplesDo:",{aBlock:aBlock},$globals.SequenceableCollectionTest)});
  6482. //>>excludeEnd("ctx");
  6483. },
  6484. //>>excludeStart("ide", pragmas.excludeIdeData);
  6485. args: ["aBlock"],
  6486. source: "samplesDo: aBlock\x0a\x09aBlock value: 1 value: self collectionFirst.\x0a\x09aBlock value: self collectionSize value: self collectionLast",
  6487. referencedClasses: [],
  6488. //>>excludeEnd("ide");
  6489. messageSends: ["value:value:", "collectionFirst", "collectionSize", "collectionLast"]
  6490. }),
  6491. $globals.SequenceableCollectionTest);
  6492. $core.addMethod(
  6493. $core.method({
  6494. selector: "testBeginsWith",
  6495. protocol: 'tests',
  6496. fn: function (){
  6497. var self=this;
  6498. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6499. return $core.withContext(function($ctx1) {
  6500. //>>excludeEnd("ctx");
  6501. var $2,$1,$4,$5,$3,$7,$6;
  6502. $2=self._collection();
  6503. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6504. $ctx1.sendIdx["collection"]=1;
  6505. //>>excludeEnd("ctx");
  6506. $1=$recv($2)._beginsWith_($recv(self._collectionClass())._new());
  6507. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6508. $ctx1.sendIdx["beginsWith:"]=1;
  6509. //>>excludeEnd("ctx");
  6510. self._assert_($1);
  6511. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6512. $ctx1.sendIdx["assert:"]=1;
  6513. //>>excludeEnd("ctx");
  6514. $4=self._collection();
  6515. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6516. $ctx1.sendIdx["collection"]=2;
  6517. //>>excludeEnd("ctx");
  6518. $5=self._collection();
  6519. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6520. $ctx1.sendIdx["collection"]=3;
  6521. //>>excludeEnd("ctx");
  6522. $3=$recv($4)._beginsWith_($5);
  6523. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6524. $ctx1.sendIdx["beginsWith:"]=2;
  6525. //>>excludeEnd("ctx");
  6526. self._assert_($3);
  6527. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6528. $ctx1.sendIdx["assert:"]=2;
  6529. //>>excludeEnd("ctx");
  6530. $7=self._collection();
  6531. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6532. $ctx1.sendIdx["collection"]=4;
  6533. //>>excludeEnd("ctx");
  6534. $6=$recv($7)._beginsWith_(self._collectionFirstTwo());
  6535. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6536. $ctx1.sendIdx["beginsWith:"]=3;
  6537. //>>excludeEnd("ctx");
  6538. self._assert_($6);
  6539. self._deny_($recv(self._collection())._beginsWith_(self._collectionLastTwo()));
  6540. return self;
  6541. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6542. }, function($ctx1) {$ctx1.fill(self,"testBeginsWith",{},$globals.SequenceableCollectionTest)});
  6543. //>>excludeEnd("ctx");
  6544. },
  6545. //>>excludeStart("ide", pragmas.excludeIdeData);
  6546. args: [],
  6547. 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)",
  6548. referencedClasses: [],
  6549. //>>excludeEnd("ide");
  6550. messageSends: ["assert:", "beginsWith:", "collection", "new", "collectionClass", "collectionFirstTwo", "deny:", "collectionLastTwo"]
  6551. }),
  6552. $globals.SequenceableCollectionTest);
  6553. $core.addMethod(
  6554. $core.method({
  6555. selector: "testEndsWith",
  6556. protocol: 'tests',
  6557. fn: function (){
  6558. var self=this;
  6559. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6560. return $core.withContext(function($ctx1) {
  6561. //>>excludeEnd("ctx");
  6562. var $2,$1,$4,$5,$3,$7,$6;
  6563. $2=self._collection();
  6564. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6565. $ctx1.sendIdx["collection"]=1;
  6566. //>>excludeEnd("ctx");
  6567. $1=$recv($2)._endsWith_($recv(self._collectionClass())._new());
  6568. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6569. $ctx1.sendIdx["endsWith:"]=1;
  6570. //>>excludeEnd("ctx");
  6571. self._assert_($1);
  6572. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6573. $ctx1.sendIdx["assert:"]=1;
  6574. //>>excludeEnd("ctx");
  6575. $4=self._collection();
  6576. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6577. $ctx1.sendIdx["collection"]=2;
  6578. //>>excludeEnd("ctx");
  6579. $5=self._collection();
  6580. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6581. $ctx1.sendIdx["collection"]=3;
  6582. //>>excludeEnd("ctx");
  6583. $3=$recv($4)._endsWith_($5);
  6584. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6585. $ctx1.sendIdx["endsWith:"]=2;
  6586. //>>excludeEnd("ctx");
  6587. self._assert_($3);
  6588. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6589. $ctx1.sendIdx["assert:"]=2;
  6590. //>>excludeEnd("ctx");
  6591. $7=self._collection();
  6592. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6593. $ctx1.sendIdx["collection"]=4;
  6594. //>>excludeEnd("ctx");
  6595. $6=$recv($7)._endsWith_(self._collectionLastTwo());
  6596. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6597. $ctx1.sendIdx["endsWith:"]=3;
  6598. //>>excludeEnd("ctx");
  6599. self._assert_($6);
  6600. self._deny_($recv(self._collection())._endsWith_(self._collectionFirstTwo()));
  6601. return self;
  6602. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6603. }, function($ctx1) {$ctx1.fill(self,"testEndsWith",{},$globals.SequenceableCollectionTest)});
  6604. //>>excludeEnd("ctx");
  6605. },
  6606. //>>excludeStart("ide", pragmas.excludeIdeData);
  6607. args: [],
  6608. 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)",
  6609. referencedClasses: [],
  6610. //>>excludeEnd("ide");
  6611. messageSends: ["assert:", "endsWith:", "collection", "new", "collectionClass", "collectionLastTwo", "deny:", "collectionFirstTwo"]
  6612. }),
  6613. $globals.SequenceableCollectionTest);
  6614. $core.addMethod(
  6615. $core.method({
  6616. selector: "testFirst",
  6617. protocol: 'tests',
  6618. fn: function (){
  6619. var self=this;
  6620. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6621. return $core.withContext(function($ctx1) {
  6622. //>>excludeEnd("ctx");
  6623. self._assert_equals_($recv(self._collection())._first(),self._collectionFirst());
  6624. return self;
  6625. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6626. }, function($ctx1) {$ctx1.fill(self,"testFirst",{},$globals.SequenceableCollectionTest)});
  6627. //>>excludeEnd("ctx");
  6628. },
  6629. //>>excludeStart("ide", pragmas.excludeIdeData);
  6630. args: [],
  6631. source: "testFirst\x0a\x09self assert: self collection first equals: self collectionFirst",
  6632. referencedClasses: [],
  6633. //>>excludeEnd("ide");
  6634. messageSends: ["assert:equals:", "first", "collection", "collectionFirst"]
  6635. }),
  6636. $globals.SequenceableCollectionTest);
  6637. $core.addMethod(
  6638. $core.method({
  6639. selector: "testFirstN",
  6640. protocol: 'tests',
  6641. fn: function (){
  6642. var self=this;
  6643. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  6644. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6645. return $core.withContext(function($ctx1) {
  6646. //>>excludeEnd("ctx");
  6647. var $2,$1,$4,$3,$6,$5,$7;
  6648. $2=self._collection();
  6649. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6650. $ctx1.sendIdx["collection"]=1;
  6651. //>>excludeEnd("ctx");
  6652. $1=$recv($2)._first_((2));
  6653. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6654. $ctx1.sendIdx["first:"]=1;
  6655. //>>excludeEnd("ctx");
  6656. self._assert_equals_($1,self._collectionFirstTwo());
  6657. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6658. $ctx1.sendIdx["assert:equals:"]=1;
  6659. //>>excludeEnd("ctx");
  6660. $4=self._collection();
  6661. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6662. $ctx1.sendIdx["collection"]=2;
  6663. //>>excludeEnd("ctx");
  6664. $3=$recv($4)._first_((0));
  6665. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6666. $ctx1.sendIdx["first:"]=2;
  6667. //>>excludeEnd("ctx");
  6668. self._assert_equals_($3,$recv(self._collectionClass())._new());
  6669. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6670. $ctx1.sendIdx["assert:equals:"]=2;
  6671. //>>excludeEnd("ctx");
  6672. $6=self._collection();
  6673. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6674. $ctx1.sendIdx["collection"]=3;
  6675. //>>excludeEnd("ctx");
  6676. $5=$recv($6)._first_(self._collectionSize());
  6677. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6678. $ctx1.sendIdx["first:"]=3;
  6679. //>>excludeEnd("ctx");
  6680. $7=self._collection();
  6681. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6682. $ctx1.sendIdx["collection"]=4;
  6683. //>>excludeEnd("ctx");
  6684. self._assert_equals_($5,$7);
  6685. self._should_raise_((function(){
  6686. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6687. return $core.withContext(function($ctx2) {
  6688. //>>excludeEnd("ctx");
  6689. return $recv(self._collection())._first_((33));
  6690. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6691. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  6692. //>>excludeEnd("ctx");
  6693. }),$Error());
  6694. return self;
  6695. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6696. }, function($ctx1) {$ctx1.fill(self,"testFirstN",{},$globals.SequenceableCollectionTest)});
  6697. //>>excludeEnd("ctx");
  6698. },
  6699. //>>excludeStart("ide", pragmas.excludeIdeData);
  6700. args: [],
  6701. 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",
  6702. referencedClasses: ["Error"],
  6703. //>>excludeEnd("ide");
  6704. messageSends: ["assert:equals:", "first:", "collection", "collectionFirstTwo", "new", "collectionClass", "collectionSize", "should:raise:"]
  6705. }),
  6706. $globals.SequenceableCollectionTest);
  6707. $core.addMethod(
  6708. $core.method({
  6709. selector: "testFourth",
  6710. protocol: 'tests',
  6711. fn: function (){
  6712. var self=this;
  6713. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6714. return $core.withContext(function($ctx1) {
  6715. //>>excludeEnd("ctx");
  6716. var $2,$1;
  6717. $2=self._collection();
  6718. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6719. $ctx1.sendIdx["collection"]=1;
  6720. //>>excludeEnd("ctx");
  6721. $1=$recv($2)._fourth();
  6722. self._assert_equals_($1,$recv(self._collection())._at_((4)));
  6723. return self;
  6724. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6725. }, function($ctx1) {$ctx1.fill(self,"testFourth",{},$globals.SequenceableCollectionTest)});
  6726. //>>excludeEnd("ctx");
  6727. },
  6728. //>>excludeStart("ide", pragmas.excludeIdeData);
  6729. args: [],
  6730. source: "testFourth\x0a\x09self assert: (self collection fourth) equals: (self collection at: 4)",
  6731. referencedClasses: [],
  6732. //>>excludeEnd("ide");
  6733. messageSends: ["assert:equals:", "fourth", "collection", "at:"]
  6734. }),
  6735. $globals.SequenceableCollectionTest);
  6736. $core.addMethod(
  6737. $core.method({
  6738. selector: "testIndexOfStartingAt",
  6739. protocol: 'tests',
  6740. fn: function (){
  6741. var self=this;
  6742. var jsNull;
  6743. function $JSON(){return $globals.JSON||(typeof JSON=="undefined"?nil:JSON)}
  6744. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6745. return $core.withContext(function($ctx1) {
  6746. //>>excludeEnd("ctx");
  6747. var $2,$1,$4,$3;
  6748. jsNull=$recv($JSON())._parse_("null");
  6749. self._samplesDo_((function(index,value){
  6750. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6751. return $core.withContext(function($ctx2) {
  6752. //>>excludeEnd("ctx");
  6753. $2=self._collection();
  6754. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6755. $ctx2.sendIdx["collection"]=1;
  6756. //>>excludeEnd("ctx");
  6757. $1=$recv($2)._indexOf_startingAt_(value,(1));
  6758. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6759. $ctx2.sendIdx["indexOf:startingAt:"]=1;
  6760. //>>excludeEnd("ctx");
  6761. self._assert_equals_($1,index);
  6762. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6763. $ctx2.sendIdx["assert:equals:"]=1;
  6764. //>>excludeEnd("ctx");
  6765. $4=self._collection();
  6766. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6767. $ctx2.sendIdx["collection"]=2;
  6768. //>>excludeEnd("ctx");
  6769. $3=$recv($4)._indexOf_startingAt_(value,index);
  6770. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6771. $ctx2.sendIdx["indexOf:startingAt:"]=2;
  6772. //>>excludeEnd("ctx");
  6773. self._assert_equals_($3,index);
  6774. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6775. $ctx2.sendIdx["assert:equals:"]=2;
  6776. //>>excludeEnd("ctx");
  6777. return self._assert_equals_($recv(self._collection())._indexOf_startingAt_(value,$recv(index).__plus((1))),(0));
  6778. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6779. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,1)});
  6780. //>>excludeEnd("ctx");
  6781. }));
  6782. return self;
  6783. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6784. }, function($ctx1) {$ctx1.fill(self,"testIndexOfStartingAt",{jsNull:jsNull},$globals.SequenceableCollectionTest)});
  6785. //>>excludeEnd("ctx");
  6786. },
  6787. //>>excludeStart("ide", pragmas.excludeIdeData);
  6788. args: [],
  6789. 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 ]",
  6790. referencedClasses: ["JSON"],
  6791. //>>excludeEnd("ide");
  6792. messageSends: ["parse:", "samplesDo:", "assert:equals:", "indexOf:startingAt:", "collection", "+"]
  6793. }),
  6794. $globals.SequenceableCollectionTest);
  6795. $core.addMethod(
  6796. $core.method({
  6797. selector: "testIndexOfStartingAtWithNull",
  6798. protocol: 'tests',
  6799. fn: function (){
  6800. var self=this;
  6801. var jsNull;
  6802. function $JSON(){return $globals.JSON||(typeof JSON=="undefined"?nil:JSON)}
  6803. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6804. return $core.withContext(function($ctx1) {
  6805. //>>excludeEnd("ctx");
  6806. var $1,$2;
  6807. jsNull=$recv($JSON())._parse_("null");
  6808. self._samplesDo_((function(index,value){
  6809. var collection;
  6810. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6811. return $core.withContext(function($ctx2) {
  6812. //>>excludeEnd("ctx");
  6813. collection=self._collection();
  6814. collection;
  6815. $recv(collection)._at_put_(index,jsNull);
  6816. $1=$recv(collection)._indexOf_startingAt_(jsNull,(1));
  6817. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6818. $ctx2.sendIdx["indexOf:startingAt:"]=1;
  6819. //>>excludeEnd("ctx");
  6820. self._assert_equals_($1,index);
  6821. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6822. $ctx2.sendIdx["assert:equals:"]=1;
  6823. //>>excludeEnd("ctx");
  6824. $2=$recv(collection)._indexOf_startingAt_(jsNull,index);
  6825. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6826. $ctx2.sendIdx["indexOf:startingAt:"]=2;
  6827. //>>excludeEnd("ctx");
  6828. self._assert_equals_($2,index);
  6829. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6830. $ctx2.sendIdx["assert:equals:"]=2;
  6831. //>>excludeEnd("ctx");
  6832. return self._assert_equals_($recv(collection)._indexOf_startingAt_(jsNull,$recv(index).__plus((1))),(0));
  6833. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6834. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value,collection:collection},$ctx1,1)});
  6835. //>>excludeEnd("ctx");
  6836. }));
  6837. return self;
  6838. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6839. }, function($ctx1) {$ctx1.fill(self,"testIndexOfStartingAtWithNull",{jsNull:jsNull},$globals.SequenceableCollectionTest)});
  6840. //>>excludeEnd("ctx");
  6841. },
  6842. //>>excludeStart("ide", pragmas.excludeIdeData);
  6843. args: [],
  6844. 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 ]",
  6845. referencedClasses: ["JSON"],
  6846. //>>excludeEnd("ide");
  6847. messageSends: ["parse:", "samplesDo:", "collection", "at:put:", "assert:equals:", "indexOf:startingAt:", "+"]
  6848. }),
  6849. $globals.SequenceableCollectionTest);
  6850. $core.addMethod(
  6851. $core.method({
  6852. selector: "testLast",
  6853. protocol: 'tests',
  6854. fn: function (){
  6855. var self=this;
  6856. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6857. return $core.withContext(function($ctx1) {
  6858. //>>excludeEnd("ctx");
  6859. self._assert_equals_($recv(self._collection())._last(),self._collectionLast());
  6860. return self;
  6861. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6862. }, function($ctx1) {$ctx1.fill(self,"testLast",{},$globals.SequenceableCollectionTest)});
  6863. //>>excludeEnd("ctx");
  6864. },
  6865. //>>excludeStart("ide", pragmas.excludeIdeData);
  6866. args: [],
  6867. source: "testLast\x0a\x09self assert: self collection last equals: self collectionLast",
  6868. referencedClasses: [],
  6869. //>>excludeEnd("ide");
  6870. messageSends: ["assert:equals:", "last", "collection", "collectionLast"]
  6871. }),
  6872. $globals.SequenceableCollectionTest);
  6873. $core.addMethod(
  6874. $core.method({
  6875. selector: "testLastN",
  6876. protocol: 'tests',
  6877. fn: function (){
  6878. var self=this;
  6879. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  6880. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6881. return $core.withContext(function($ctx1) {
  6882. //>>excludeEnd("ctx");
  6883. var $2,$1,$4,$3,$6,$5,$7;
  6884. $2=self._collection();
  6885. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6886. $ctx1.sendIdx["collection"]=1;
  6887. //>>excludeEnd("ctx");
  6888. $1=$recv($2)._last_((2));
  6889. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6890. $ctx1.sendIdx["last:"]=1;
  6891. //>>excludeEnd("ctx");
  6892. self._assert_equals_($1,self._collectionLastTwo());
  6893. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6894. $ctx1.sendIdx["assert:equals:"]=1;
  6895. //>>excludeEnd("ctx");
  6896. $4=self._collection();
  6897. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6898. $ctx1.sendIdx["collection"]=2;
  6899. //>>excludeEnd("ctx");
  6900. $3=$recv($4)._last_((0));
  6901. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6902. $ctx1.sendIdx["last:"]=2;
  6903. //>>excludeEnd("ctx");
  6904. self._assert_equals_($3,$recv(self._collectionClass())._new());
  6905. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6906. $ctx1.sendIdx["assert:equals:"]=2;
  6907. //>>excludeEnd("ctx");
  6908. $6=self._collection();
  6909. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6910. $ctx1.sendIdx["collection"]=3;
  6911. //>>excludeEnd("ctx");
  6912. $5=$recv($6)._last_(self._collectionSize());
  6913. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6914. $ctx1.sendIdx["last:"]=3;
  6915. //>>excludeEnd("ctx");
  6916. $7=self._collection();
  6917. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6918. $ctx1.sendIdx["collection"]=4;
  6919. //>>excludeEnd("ctx");
  6920. self._assert_equals_($5,$7);
  6921. self._should_raise_((function(){
  6922. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6923. return $core.withContext(function($ctx2) {
  6924. //>>excludeEnd("ctx");
  6925. return $recv(self._collection())._last_((33));
  6926. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6927. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  6928. //>>excludeEnd("ctx");
  6929. }),$Error());
  6930. return self;
  6931. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6932. }, function($ctx1) {$ctx1.fill(self,"testLastN",{},$globals.SequenceableCollectionTest)});
  6933. //>>excludeEnd("ctx");
  6934. },
  6935. //>>excludeStart("ide", pragmas.excludeIdeData);
  6936. args: [],
  6937. 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",
  6938. referencedClasses: ["Error"],
  6939. //>>excludeEnd("ide");
  6940. messageSends: ["assert:equals:", "last:", "collection", "collectionLastTwo", "new", "collectionClass", "collectionSize", "should:raise:"]
  6941. }),
  6942. $globals.SequenceableCollectionTest);
  6943. $core.addMethod(
  6944. $core.method({
  6945. selector: "testSecond",
  6946. protocol: 'tests',
  6947. fn: function (){
  6948. var self=this;
  6949. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6950. return $core.withContext(function($ctx1) {
  6951. //>>excludeEnd("ctx");
  6952. var $2,$1;
  6953. $2=self._collection();
  6954. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6955. $ctx1.sendIdx["collection"]=1;
  6956. //>>excludeEnd("ctx");
  6957. $1=$recv($2)._second();
  6958. self._assert_equals_($1,$recv(self._collection())._at_((2)));
  6959. return self;
  6960. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6961. }, function($ctx1) {$ctx1.fill(self,"testSecond",{},$globals.SequenceableCollectionTest)});
  6962. //>>excludeEnd("ctx");
  6963. },
  6964. //>>excludeStart("ide", pragmas.excludeIdeData);
  6965. args: [],
  6966. source: "testSecond\x0a\x09self assert: (self collection second) equals: (self collection at: 2)",
  6967. referencedClasses: [],
  6968. //>>excludeEnd("ide");
  6969. messageSends: ["assert:equals:", "second", "collection", "at:"]
  6970. }),
  6971. $globals.SequenceableCollectionTest);
  6972. $core.addMethod(
  6973. $core.method({
  6974. selector: "testThird",
  6975. protocol: 'tests',
  6976. fn: function (){
  6977. var self=this;
  6978. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6979. return $core.withContext(function($ctx1) {
  6980. //>>excludeEnd("ctx");
  6981. var $2,$1;
  6982. $2=self._collection();
  6983. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6984. $ctx1.sendIdx["collection"]=1;
  6985. //>>excludeEnd("ctx");
  6986. $1=$recv($2)._third();
  6987. self._assert_equals_($1,$recv(self._collection())._at_((3)));
  6988. return self;
  6989. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6990. }, function($ctx1) {$ctx1.fill(self,"testThird",{},$globals.SequenceableCollectionTest)});
  6991. //>>excludeEnd("ctx");
  6992. },
  6993. //>>excludeStart("ide", pragmas.excludeIdeData);
  6994. args: [],
  6995. source: "testThird\x0a\x09self assert: (self collection third) equals: (self collection at: 3)",
  6996. referencedClasses: [],
  6997. //>>excludeEnd("ide");
  6998. messageSends: ["assert:equals:", "third", "collection", "at:"]
  6999. }),
  7000. $globals.SequenceableCollectionTest);
  7001. $core.addClass('ArrayTest', $globals.SequenceableCollectionTest, [], 'Kernel-Tests');
  7002. $core.addMethod(
  7003. $core.method({
  7004. selector: "collection",
  7005. protocol: 'fixture',
  7006. fn: function (){
  7007. var self=this;
  7008. return [(1), (2), (3), (-4)];
  7009. },
  7010. //>>excludeStart("ide", pragmas.excludeIdeData);
  7011. args: [],
  7012. source: "collection\x0a\x09^ #(1 2 3 -4)",
  7013. referencedClasses: [],
  7014. //>>excludeEnd("ide");
  7015. messageSends: []
  7016. }),
  7017. $globals.ArrayTest);
  7018. $core.addMethod(
  7019. $core.method({
  7020. selector: "collectionFirst",
  7021. protocol: 'fixture',
  7022. fn: function (){
  7023. var self=this;
  7024. return (1);
  7025. },
  7026. //>>excludeStart("ide", pragmas.excludeIdeData);
  7027. args: [],
  7028. source: "collectionFirst\x0a\x09^ 1",
  7029. referencedClasses: [],
  7030. //>>excludeEnd("ide");
  7031. messageSends: []
  7032. }),
  7033. $globals.ArrayTest);
  7034. $core.addMethod(
  7035. $core.method({
  7036. selector: "collectionFirstTwo",
  7037. protocol: 'fixture',
  7038. fn: function (){
  7039. var self=this;
  7040. return [(1), (2)];
  7041. },
  7042. //>>excludeStart("ide", pragmas.excludeIdeData);
  7043. args: [],
  7044. source: "collectionFirstTwo\x0a\x09^ #(1 2)",
  7045. referencedClasses: [],
  7046. //>>excludeEnd("ide");
  7047. messageSends: []
  7048. }),
  7049. $globals.ArrayTest);
  7050. $core.addMethod(
  7051. $core.method({
  7052. selector: "collectionLast",
  7053. protocol: 'fixture',
  7054. fn: function (){
  7055. var self=this;
  7056. return (-4);
  7057. },
  7058. //>>excludeStart("ide", pragmas.excludeIdeData);
  7059. args: [],
  7060. source: "collectionLast\x0a\x09^ -4",
  7061. referencedClasses: [],
  7062. //>>excludeEnd("ide");
  7063. messageSends: []
  7064. }),
  7065. $globals.ArrayTest);
  7066. $core.addMethod(
  7067. $core.method({
  7068. selector: "collectionLastTwo",
  7069. protocol: 'fixture',
  7070. fn: function (){
  7071. var self=this;
  7072. return [(3), (-4)];
  7073. },
  7074. //>>excludeStart("ide", pragmas.excludeIdeData);
  7075. args: [],
  7076. source: "collectionLastTwo\x0a\x09^ #(3 -4)",
  7077. referencedClasses: [],
  7078. //>>excludeEnd("ide");
  7079. messageSends: []
  7080. }),
  7081. $globals.ArrayTest);
  7082. $core.addMethod(
  7083. $core.method({
  7084. selector: "collectionOfPrintStrings",
  7085. protocol: 'fixture',
  7086. fn: function (){
  7087. var self=this;
  7088. return ["1", "2", "3", "-4"];
  7089. },
  7090. //>>excludeStart("ide", pragmas.excludeIdeData);
  7091. args: [],
  7092. source: "collectionOfPrintStrings\x0a\x09^ #('1' '2' '3' '-4')",
  7093. referencedClasses: [],
  7094. //>>excludeEnd("ide");
  7095. messageSends: []
  7096. }),
  7097. $globals.ArrayTest);
  7098. $core.addMethod(
  7099. $core.method({
  7100. selector: "collectionSize",
  7101. protocol: 'fixture',
  7102. fn: function (){
  7103. var self=this;
  7104. return (4);
  7105. },
  7106. //>>excludeStart("ide", pragmas.excludeIdeData);
  7107. args: [],
  7108. source: "collectionSize\x0a\x09^ 4",
  7109. referencedClasses: [],
  7110. //>>excludeEnd("ide");
  7111. messageSends: []
  7112. }),
  7113. $globals.ArrayTest);
  7114. $core.addMethod(
  7115. $core.method({
  7116. selector: "collectionWithDuplicates",
  7117. protocol: 'fixture',
  7118. fn: function (){
  7119. var self=this;
  7120. return ["a", "b", "c", (1), (2), (1), "a", []];
  7121. },
  7122. //>>excludeStart("ide", pragmas.excludeIdeData);
  7123. args: [],
  7124. source: "collectionWithDuplicates\x0a\x09^ #('a' 'b' 'c' 1 2 1 'a' ())",
  7125. referencedClasses: [],
  7126. //>>excludeEnd("ide");
  7127. messageSends: []
  7128. }),
  7129. $globals.ArrayTest);
  7130. $core.addMethod(
  7131. $core.method({
  7132. selector: "collectionWithNewValue",
  7133. protocol: 'fixture',
  7134. fn: function (){
  7135. var self=this;
  7136. return [(1), (2), (3), (-4), "N"];
  7137. },
  7138. //>>excludeStart("ide", pragmas.excludeIdeData);
  7139. args: [],
  7140. source: "collectionWithNewValue\x0a\x09^ #(1 2 3 -4 'N')",
  7141. referencedClasses: [],
  7142. //>>excludeEnd("ide");
  7143. messageSends: []
  7144. }),
  7145. $globals.ArrayTest);
  7146. $core.addMethod(
  7147. $core.method({
  7148. selector: "sampleNewIndex",
  7149. protocol: 'fixture',
  7150. fn: function (){
  7151. var self=this;
  7152. return (5);
  7153. },
  7154. //>>excludeStart("ide", pragmas.excludeIdeData);
  7155. args: [],
  7156. source: "sampleNewIndex\x0a\x09^ 5",
  7157. referencedClasses: [],
  7158. //>>excludeEnd("ide");
  7159. messageSends: []
  7160. }),
  7161. $globals.ArrayTest);
  7162. $core.addMethod(
  7163. $core.method({
  7164. selector: "samplesDo:",
  7165. protocol: 'fixture',
  7166. fn: function (aBlock){
  7167. var self=this;
  7168. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7169. return $core.withContext(function($ctx1) {
  7170. //>>excludeEnd("ctx");
  7171. (
  7172. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7173. $ctx1.supercall = true,
  7174. //>>excludeEnd("ctx");
  7175. ($globals.ArrayTest.superclass||$boot.dnu).fn.prototype._samplesDo_.apply($recv(self), [aBlock]));
  7176. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7177. $ctx1.supercall = false;
  7178. //>>excludeEnd("ctx");;
  7179. $recv(aBlock)._value_value_((3),(3));
  7180. return self;
  7181. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7182. }, function($ctx1) {$ctx1.fill(self,"samplesDo:",{aBlock:aBlock},$globals.ArrayTest)});
  7183. //>>excludeEnd("ctx");
  7184. },
  7185. //>>excludeStart("ide", pragmas.excludeIdeData);
  7186. args: ["aBlock"],
  7187. source: "samplesDo: aBlock\x0a\x09super samplesDo: aBlock.\x0a\x09aBlock value: 3 value: 3.",
  7188. referencedClasses: [],
  7189. //>>excludeEnd("ide");
  7190. messageSends: ["samplesDo:", "value:value:"]
  7191. }),
  7192. $globals.ArrayTest);
  7193. $core.addMethod(
  7194. $core.method({
  7195. selector: "testAdd",
  7196. protocol: 'tests',
  7197. fn: function (){
  7198. var self=this;
  7199. var array;
  7200. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7201. return $core.withContext(function($ctx1) {
  7202. //>>excludeEnd("ctx");
  7203. array=self._collection();
  7204. $recv(array)._add_((6));
  7205. self._assert_equals_($recv(array)._last(),(6));
  7206. return self;
  7207. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7208. }, function($ctx1) {$ctx1.fill(self,"testAdd",{array:array},$globals.ArrayTest)});
  7209. //>>excludeEnd("ctx");
  7210. },
  7211. //>>excludeStart("ide", pragmas.excludeIdeData);
  7212. args: [],
  7213. source: "testAdd \x0a\x09| array | \x0a\x09array := self collection. \x0a\x09array add: 6.\x0a\x09\x0a\x09self assert: array last equals: 6",
  7214. referencedClasses: [],
  7215. //>>excludeEnd("ide");
  7216. messageSends: ["collection", "add:", "assert:equals:", "last"]
  7217. }),
  7218. $globals.ArrayTest);
  7219. $core.addMethod(
  7220. $core.method({
  7221. selector: "testAddFirst",
  7222. protocol: 'tests',
  7223. fn: function (){
  7224. var self=this;
  7225. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7226. return $core.withContext(function($ctx1) {
  7227. //>>excludeEnd("ctx");
  7228. var $3,$2,$1;
  7229. $3=self._collection();
  7230. $recv($3)._addFirst_((0));
  7231. $2=$recv($3)._yourself();
  7232. $1=$recv($2)._first();
  7233. self._assert_equals_($1,(0));
  7234. return self;
  7235. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7236. }, function($ctx1) {$ctx1.fill(self,"testAddFirst",{},$globals.ArrayTest)});
  7237. //>>excludeEnd("ctx");
  7238. },
  7239. //>>excludeStart("ide", pragmas.excludeIdeData);
  7240. args: [],
  7241. source: "testAddFirst\x0a\x09self assert: (self collection addFirst: 0; yourself) first equals: 0",
  7242. referencedClasses: [],
  7243. //>>excludeEnd("ide");
  7244. messageSends: ["assert:equals:", "first", "addFirst:", "collection", "yourself"]
  7245. }),
  7246. $globals.ArrayTest);
  7247. $core.addMethod(
  7248. $core.method({
  7249. selector: "testPrintString",
  7250. protocol: 'tests',
  7251. fn: function (){
  7252. var self=this;
  7253. var array;
  7254. function $Array(){return $globals.Array||(typeof Array=="undefined"?nil:Array)}
  7255. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7256. return $core.withContext(function($ctx1) {
  7257. //>>excludeEnd("ctx");
  7258. var $1,$2,$3,$4,$5,$6,$7,$8;
  7259. array=$recv($Array())._new();
  7260. $1=$recv(array)._printString();
  7261. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7262. $ctx1.sendIdx["printString"]=1;
  7263. //>>excludeEnd("ctx");
  7264. self._assert_equals_($1,"an Array ()");
  7265. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7266. $ctx1.sendIdx["assert:equals:"]=1;
  7267. //>>excludeEnd("ctx");
  7268. $2=array;
  7269. $recv($2)._add_((1));
  7270. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7271. $ctx1.sendIdx["add:"]=1;
  7272. //>>excludeEnd("ctx");
  7273. $3=$recv($2)._add_((3));
  7274. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7275. $ctx1.sendIdx["add:"]=2;
  7276. //>>excludeEnd("ctx");
  7277. $4=$recv(array)._printString();
  7278. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7279. $ctx1.sendIdx["printString"]=2;
  7280. //>>excludeEnd("ctx");
  7281. self._assert_equals_($4,"an Array (1 3)");
  7282. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7283. $ctx1.sendIdx["assert:equals:"]=2;
  7284. //>>excludeEnd("ctx");
  7285. $recv(array)._add_("foo");
  7286. $5=$recv(array)._printString();
  7287. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7288. $ctx1.sendIdx["printString"]=3;
  7289. //>>excludeEnd("ctx");
  7290. self._assert_equals_($5,"an Array (1 3 'foo')");
  7291. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7292. $ctx1.sendIdx["assert:equals:"]=3;
  7293. //>>excludeEnd("ctx");
  7294. $6=array;
  7295. $recv($6)._remove_((1));
  7296. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7297. $ctx1.sendIdx["remove:"]=1;
  7298. //>>excludeEnd("ctx");
  7299. $recv($6)._remove_((3));
  7300. $7=$recv(array)._printString();
  7301. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7302. $ctx1.sendIdx["printString"]=4;
  7303. //>>excludeEnd("ctx");
  7304. self._assert_equals_($7,"an Array ('foo')");
  7305. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7306. $ctx1.sendIdx["assert:equals:"]=4;
  7307. //>>excludeEnd("ctx");
  7308. $recv(array)._addLast_((3));
  7309. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7310. $ctx1.sendIdx["addLast:"]=1;
  7311. //>>excludeEnd("ctx");
  7312. $8=$recv(array)._printString();
  7313. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7314. $ctx1.sendIdx["printString"]=5;
  7315. //>>excludeEnd("ctx");
  7316. self._assert_equals_($8,"an Array ('foo' 3)");
  7317. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7318. $ctx1.sendIdx["assert:equals:"]=5;
  7319. //>>excludeEnd("ctx");
  7320. $recv(array)._addLast_((3));
  7321. self._assert_equals_($recv(array)._printString(),"an Array ('foo' 3 3)");
  7322. return self;
  7323. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7324. }, function($ctx1) {$ctx1.fill(self,"testPrintString",{array:array},$globals.ArrayTest)});
  7325. //>>excludeEnd("ctx");
  7326. },
  7327. //>>excludeStart("ide", pragmas.excludeIdeData);
  7328. args: [],
  7329. 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)'.",
  7330. referencedClasses: ["Array"],
  7331. //>>excludeEnd("ide");
  7332. messageSends: ["new", "assert:equals:", "printString", "add:", "remove:", "addLast:"]
  7333. }),
  7334. $globals.ArrayTest);
  7335. $core.addMethod(
  7336. $core.method({
  7337. selector: "testRemove",
  7338. protocol: 'tests',
  7339. fn: function (){
  7340. var self=this;
  7341. var array;
  7342. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  7343. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7344. return $core.withContext(function($ctx1) {
  7345. //>>excludeEnd("ctx");
  7346. array=[(1), (2), (3), (4), (5)];
  7347. $recv(array)._remove_((3));
  7348. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7349. $ctx1.sendIdx["remove:"]=1;
  7350. //>>excludeEnd("ctx");
  7351. self._assert_equals_(array,[(1), (2), (4), (5)]);
  7352. self._should_raise_((function(){
  7353. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7354. return $core.withContext(function($ctx2) {
  7355. //>>excludeEnd("ctx");
  7356. return $recv(array)._remove_((3));
  7357. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7358. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  7359. //>>excludeEnd("ctx");
  7360. }),$Error());
  7361. return self;
  7362. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7363. }, function($ctx1) {$ctx1.fill(self,"testRemove",{array:array},$globals.ArrayTest)});
  7364. //>>excludeEnd("ctx");
  7365. },
  7366. //>>excludeStart("ide", pragmas.excludeIdeData);
  7367. args: [],
  7368. 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",
  7369. referencedClasses: ["Error"],
  7370. //>>excludeEnd("ide");
  7371. messageSends: ["remove:", "assert:equals:", "should:raise:"]
  7372. }),
  7373. $globals.ArrayTest);
  7374. $core.addMethod(
  7375. $core.method({
  7376. selector: "testRemoveFromTo",
  7377. protocol: 'tests',
  7378. fn: function (){
  7379. var self=this;
  7380. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7381. return $core.withContext(function($ctx1) {
  7382. //>>excludeEnd("ctx");
  7383. var $1,$2;
  7384. $1=[(1), (2), (3), (4)]._removeFrom_to_((1),(3));
  7385. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7386. $ctx1.sendIdx["removeFrom:to:"]=1;
  7387. //>>excludeEnd("ctx");
  7388. self._assert_equals_($1,[(4)]);
  7389. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7390. $ctx1.sendIdx["assert:equals:"]=1;
  7391. //>>excludeEnd("ctx");
  7392. $2=[(1), (2), (3), (4)]._removeFrom_to_((2),(3));
  7393. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7394. $ctx1.sendIdx["removeFrom:to:"]=2;
  7395. //>>excludeEnd("ctx");
  7396. self._assert_equals_($2,[(1), (4)]);
  7397. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7398. $ctx1.sendIdx["assert:equals:"]=2;
  7399. //>>excludeEnd("ctx");
  7400. self._assert_equals_([(1), (2), (3), (4)]._removeFrom_to_((2),(4)),[(1)]);
  7401. return self;
  7402. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7403. }, function($ctx1) {$ctx1.fill(self,"testRemoveFromTo",{},$globals.ArrayTest)});
  7404. //>>excludeEnd("ctx");
  7405. },
  7406. //>>excludeStart("ide", pragmas.excludeIdeData);
  7407. args: [],
  7408. 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)",
  7409. referencedClasses: [],
  7410. //>>excludeEnd("ide");
  7411. messageSends: ["assert:equals:", "removeFrom:to:"]
  7412. }),
  7413. $globals.ArrayTest);
  7414. $core.addMethod(
  7415. $core.method({
  7416. selector: "testRemoveIndex",
  7417. protocol: 'tests',
  7418. fn: function (){
  7419. var self=this;
  7420. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7421. return $core.withContext(function($ctx1) {
  7422. //>>excludeEnd("ctx");
  7423. var $1,$2;
  7424. $1=[(1), (2), (3), (4)]._removeIndex_((2));
  7425. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7426. $ctx1.sendIdx["removeIndex:"]=1;
  7427. //>>excludeEnd("ctx");
  7428. self._assert_equals_($1,[(1), (3), (4)]);
  7429. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7430. $ctx1.sendIdx["assert:equals:"]=1;
  7431. //>>excludeEnd("ctx");
  7432. $2=[(1), (2), (3), (4)]._removeIndex_((1));
  7433. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7434. $ctx1.sendIdx["removeIndex:"]=2;
  7435. //>>excludeEnd("ctx");
  7436. self._assert_equals_($2,[(2), (3), (4)]);
  7437. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7438. $ctx1.sendIdx["assert:equals:"]=2;
  7439. //>>excludeEnd("ctx");
  7440. self._assert_equals_(["hello"]._removeIndex_((1)),[]);
  7441. return self;
  7442. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7443. }, function($ctx1) {$ctx1.fill(self,"testRemoveIndex",{},$globals.ArrayTest)});
  7444. //>>excludeEnd("ctx");
  7445. },
  7446. //>>excludeStart("ide", pragmas.excludeIdeData);
  7447. args: [],
  7448. 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: #()",
  7449. referencedClasses: [],
  7450. //>>excludeEnd("ide");
  7451. messageSends: ["assert:equals:", "removeIndex:"]
  7452. }),
  7453. $globals.ArrayTest);
  7454. $core.addMethod(
  7455. $core.method({
  7456. selector: "testRemoveLast",
  7457. protocol: 'tests',
  7458. fn: function (){
  7459. var self=this;
  7460. var array;
  7461. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7462. return $core.withContext(function($ctx1) {
  7463. //>>excludeEnd("ctx");
  7464. array=[(1), (2)];
  7465. $recv(array)._removeLast();
  7466. self._assert_equals_($recv(array)._last(),(1));
  7467. return self;
  7468. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7469. }, function($ctx1) {$ctx1.fill(self,"testRemoveLast",{array:array},$globals.ArrayTest)});
  7470. //>>excludeEnd("ctx");
  7471. },
  7472. //>>excludeStart("ide", pragmas.excludeIdeData);
  7473. args: [],
  7474. source: "testRemoveLast \x0a\x09| array |\x0a\x09array := #(1 2). \x0a\x09array removeLast.\x0a\x09\x0a\x09self assert: array last equals: 1",
  7475. referencedClasses: [],
  7476. //>>excludeEnd("ide");
  7477. messageSends: ["removeLast", "assert:equals:", "last"]
  7478. }),
  7479. $globals.ArrayTest);
  7480. $core.addMethod(
  7481. $core.method({
  7482. selector: "testReversed",
  7483. protocol: 'tests',
  7484. fn: function (){
  7485. var self=this;
  7486. var array;
  7487. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7488. return $core.withContext(function($ctx1) {
  7489. //>>excludeEnd("ctx");
  7490. array=[(5), (4), (3), (2), (1)];
  7491. self._assert_equals_($recv(array)._reversed(),[(1), (2), (3), (4), (5)]);
  7492. return self;
  7493. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7494. }, function($ctx1) {$ctx1.fill(self,"testReversed",{array:array},$globals.ArrayTest)});
  7495. //>>excludeEnd("ctx");
  7496. },
  7497. //>>excludeStart("ide", pragmas.excludeIdeData);
  7498. args: [],
  7499. source: "testReversed\x0a\x09|array|\x0a\x09array := #(5 4 3 2 1). \x0a\x09self assert: (array reversed) equals: #(1 2 3 4 5)",
  7500. referencedClasses: [],
  7501. //>>excludeEnd("ide");
  7502. messageSends: ["assert:equals:", "reversed"]
  7503. }),
  7504. $globals.ArrayTest);
  7505. $core.addMethod(
  7506. $core.method({
  7507. selector: "testSort",
  7508. protocol: 'tests',
  7509. fn: function (){
  7510. var self=this;
  7511. var array;
  7512. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7513. return $core.withContext(function($ctx1) {
  7514. //>>excludeEnd("ctx");
  7515. array=[(10), (1), (5)];
  7516. $recv(array)._sort();
  7517. self._assert_equals_(array,[(1), (5), (10)]);
  7518. return self;
  7519. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7520. }, function($ctx1) {$ctx1.fill(self,"testSort",{array:array},$globals.ArrayTest)});
  7521. //>>excludeEnd("ctx");
  7522. },
  7523. //>>excludeStart("ide", pragmas.excludeIdeData);
  7524. args: [],
  7525. source: "testSort\x0a\x09| array |\x0a\x09array := #(10 1 5). \x0a\x09array sort.\x0a\x09self assert: array equals: #(1 5 10)",
  7526. referencedClasses: [],
  7527. //>>excludeEnd("ide");
  7528. messageSends: ["sort", "assert:equals:"]
  7529. }),
  7530. $globals.ArrayTest);
  7531. $core.addMethod(
  7532. $core.method({
  7533. selector: "collectionClass",
  7534. protocol: 'fixture',
  7535. fn: function (){
  7536. var self=this;
  7537. function $Array(){return $globals.Array||(typeof Array=="undefined"?nil:Array)}
  7538. return $Array();
  7539. },
  7540. //>>excludeStart("ide", pragmas.excludeIdeData);
  7541. args: [],
  7542. source: "collectionClass\x0a\x09^ Array",
  7543. referencedClasses: ["Array"],
  7544. //>>excludeEnd("ide");
  7545. messageSends: []
  7546. }),
  7547. $globals.ArrayTest.klass);
  7548. $core.addClass('StringTest', $globals.SequenceableCollectionTest, [], 'Kernel-Tests');
  7549. $core.addMethod(
  7550. $core.method({
  7551. selector: "collection",
  7552. protocol: 'fixture',
  7553. fn: function (){
  7554. var self=this;
  7555. return "helLo";
  7556. },
  7557. //>>excludeStart("ide", pragmas.excludeIdeData);
  7558. args: [],
  7559. source: "collection\x0a\x09^ 'helLo'",
  7560. referencedClasses: [],
  7561. //>>excludeEnd("ide");
  7562. messageSends: []
  7563. }),
  7564. $globals.StringTest);
  7565. $core.addMethod(
  7566. $core.method({
  7567. selector: "collectionFirst",
  7568. protocol: 'fixture',
  7569. fn: function (){
  7570. var self=this;
  7571. return "h";
  7572. },
  7573. //>>excludeStart("ide", pragmas.excludeIdeData);
  7574. args: [],
  7575. source: "collectionFirst\x0a\x09^ 'h'",
  7576. referencedClasses: [],
  7577. //>>excludeEnd("ide");
  7578. messageSends: []
  7579. }),
  7580. $globals.StringTest);
  7581. $core.addMethod(
  7582. $core.method({
  7583. selector: "collectionFirstTwo",
  7584. protocol: 'fixture',
  7585. fn: function (){
  7586. var self=this;
  7587. return "he";
  7588. },
  7589. //>>excludeStart("ide", pragmas.excludeIdeData);
  7590. args: [],
  7591. source: "collectionFirstTwo\x0a\x09^ 'he'",
  7592. referencedClasses: [],
  7593. //>>excludeEnd("ide");
  7594. messageSends: []
  7595. }),
  7596. $globals.StringTest);
  7597. $core.addMethod(
  7598. $core.method({
  7599. selector: "collectionLast",
  7600. protocol: 'fixture',
  7601. fn: function (){
  7602. var self=this;
  7603. return "o";
  7604. },
  7605. //>>excludeStart("ide", pragmas.excludeIdeData);
  7606. args: [],
  7607. source: "collectionLast\x0a\x09^ 'o'",
  7608. referencedClasses: [],
  7609. //>>excludeEnd("ide");
  7610. messageSends: []
  7611. }),
  7612. $globals.StringTest);
  7613. $core.addMethod(
  7614. $core.method({
  7615. selector: "collectionLastTwo",
  7616. protocol: 'fixture',
  7617. fn: function (){
  7618. var self=this;
  7619. return "Lo";
  7620. },
  7621. //>>excludeStart("ide", pragmas.excludeIdeData);
  7622. args: [],
  7623. source: "collectionLastTwo\x0a\x09^ 'Lo'",
  7624. referencedClasses: [],
  7625. //>>excludeEnd("ide");
  7626. messageSends: []
  7627. }),
  7628. $globals.StringTest);
  7629. $core.addMethod(
  7630. $core.method({
  7631. selector: "collectionOfPrintStrings",
  7632. protocol: 'fixture',
  7633. fn: function (){
  7634. var self=this;
  7635. return "'h''e''l''L''o'";
  7636. },
  7637. //>>excludeStart("ide", pragmas.excludeIdeData);
  7638. args: [],
  7639. source: "collectionOfPrintStrings\x0a\x09^ '''h''''e''''l''''L''''o'''",
  7640. referencedClasses: [],
  7641. //>>excludeEnd("ide");
  7642. messageSends: []
  7643. }),
  7644. $globals.StringTest);
  7645. $core.addMethod(
  7646. $core.method({
  7647. selector: "collectionSize",
  7648. protocol: 'fixture',
  7649. fn: function (){
  7650. var self=this;
  7651. return (5);
  7652. },
  7653. //>>excludeStart("ide", pragmas.excludeIdeData);
  7654. args: [],
  7655. source: "collectionSize\x0a\x09^ 5",
  7656. referencedClasses: [],
  7657. //>>excludeEnd("ide");
  7658. messageSends: []
  7659. }),
  7660. $globals.StringTest);
  7661. $core.addMethod(
  7662. $core.method({
  7663. selector: "collectionWithDuplicates",
  7664. protocol: 'fixture',
  7665. fn: function (){
  7666. var self=this;
  7667. return "abbaerten";
  7668. },
  7669. //>>excludeStart("ide", pragmas.excludeIdeData);
  7670. args: [],
  7671. source: "collectionWithDuplicates\x0a\x09^ 'abbaerten'",
  7672. referencedClasses: [],
  7673. //>>excludeEnd("ide");
  7674. messageSends: []
  7675. }),
  7676. $globals.StringTest);
  7677. $core.addMethod(
  7678. $core.method({
  7679. selector: "collectionWithNewValue",
  7680. protocol: 'fixture',
  7681. fn: function (){
  7682. var self=this;
  7683. return "helLoN";
  7684. },
  7685. //>>excludeStart("ide", pragmas.excludeIdeData);
  7686. args: [],
  7687. source: "collectionWithNewValue\x0a\x09^ 'helLoN'",
  7688. referencedClasses: [],
  7689. //>>excludeEnd("ide");
  7690. messageSends: []
  7691. }),
  7692. $globals.StringTest);
  7693. $core.addMethod(
  7694. $core.method({
  7695. selector: "sampleNewValueAsCollection",
  7696. protocol: 'fixture',
  7697. fn: function (){
  7698. var self=this;
  7699. return "N";
  7700. },
  7701. //>>excludeStart("ide", pragmas.excludeIdeData);
  7702. args: [],
  7703. source: "sampleNewValueAsCollection\x0a\x09^ 'N'",
  7704. referencedClasses: [],
  7705. //>>excludeEnd("ide");
  7706. messageSends: []
  7707. }),
  7708. $globals.StringTest);
  7709. $core.addMethod(
  7710. $core.method({
  7711. selector: "samplesDo:",
  7712. protocol: 'fixture',
  7713. fn: function (aBlock){
  7714. var self=this;
  7715. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7716. return $core.withContext(function($ctx1) {
  7717. //>>excludeEnd("ctx");
  7718. (
  7719. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7720. $ctx1.supercall = true,
  7721. //>>excludeEnd("ctx");
  7722. ($globals.StringTest.superclass||$boot.dnu).fn.prototype._samplesDo_.apply($recv(self), [aBlock]));
  7723. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7724. $ctx1.supercall = false;
  7725. //>>excludeEnd("ctx");;
  7726. $recv(aBlock)._value_value_((3),"l");
  7727. return self;
  7728. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7729. }, function($ctx1) {$ctx1.fill(self,"samplesDo:",{aBlock:aBlock},$globals.StringTest)});
  7730. //>>excludeEnd("ctx");
  7731. },
  7732. //>>excludeStart("ide", pragmas.excludeIdeData);
  7733. args: ["aBlock"],
  7734. source: "samplesDo: aBlock\x0a\x09super samplesDo: aBlock.\x0a\x09aBlock value: 3 value: 'l'",
  7735. referencedClasses: [],
  7736. //>>excludeEnd("ide");
  7737. messageSends: ["samplesDo:", "value:value:"]
  7738. }),
  7739. $globals.StringTest);
  7740. $core.addMethod(
  7741. $core.method({
  7742. selector: "testAddAll",
  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. var $1;
  7751. self._should_raise_((function(){
  7752. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7753. return $core.withContext(function($ctx2) {
  7754. //>>excludeEnd("ctx");
  7755. $1=self._collection();
  7756. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7757. $ctx2.sendIdx["collection"]=1;
  7758. //>>excludeEnd("ctx");
  7759. return $recv($1)._addAll_(self._collection());
  7760. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7761. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  7762. //>>excludeEnd("ctx");
  7763. }),$Error());
  7764. return self;
  7765. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7766. }, function($ctx1) {$ctx1.fill(self,"testAddAll",{},$globals.StringTest)});
  7767. //>>excludeEnd("ctx");
  7768. },
  7769. //>>excludeStart("ide", pragmas.excludeIdeData);
  7770. args: [],
  7771. source: "testAddAll\x0a\x09\x22String instances are read-only\x22\x0a\x09self should: [ self collection addAll: self collection ] raise: Error",
  7772. referencedClasses: ["Error"],
  7773. //>>excludeEnd("ide");
  7774. messageSends: ["should:raise:", "addAll:", "collection"]
  7775. }),
  7776. $globals.StringTest);
  7777. $core.addMethod(
  7778. $core.method({
  7779. selector: "testAddRemove",
  7780. protocol: 'tests',
  7781. fn: function (){
  7782. var self=this;
  7783. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  7784. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7785. return $core.withContext(function($ctx1) {
  7786. //>>excludeEnd("ctx");
  7787. self._should_raise_((function(){
  7788. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7789. return $core.withContext(function($ctx2) {
  7790. //>>excludeEnd("ctx");
  7791. return "hello"._add_("a");
  7792. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7793. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  7794. //>>excludeEnd("ctx");
  7795. }),$Error());
  7796. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7797. $ctx1.sendIdx["should:raise:"]=1;
  7798. //>>excludeEnd("ctx");
  7799. self._should_raise_((function(){
  7800. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7801. return $core.withContext(function($ctx2) {
  7802. //>>excludeEnd("ctx");
  7803. return "hello"._remove_("h");
  7804. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7805. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  7806. //>>excludeEnd("ctx");
  7807. }),$Error());
  7808. return self;
  7809. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7810. }, function($ctx1) {$ctx1.fill(self,"testAddRemove",{},$globals.StringTest)});
  7811. //>>excludeEnd("ctx");
  7812. },
  7813. //>>excludeStart("ide", pragmas.excludeIdeData);
  7814. args: [],
  7815. source: "testAddRemove\x0a\x09self should: [ 'hello' add: 'a' ] raise: Error.\x0a\x09self should: [ 'hello' remove: 'h' ] raise: Error",
  7816. referencedClasses: ["Error"],
  7817. //>>excludeEnd("ide");
  7818. messageSends: ["should:raise:", "add:", "remove:"]
  7819. }),
  7820. $globals.StringTest);
  7821. $core.addMethod(
  7822. $core.method({
  7823. selector: "testAsArray",
  7824. protocol: 'tests',
  7825. fn: function (){
  7826. var self=this;
  7827. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7828. return $core.withContext(function($ctx1) {
  7829. //>>excludeEnd("ctx");
  7830. self._assert_equals_("hello"._asArray(),["h", "e", "l", "l", "o"]);
  7831. return self;
  7832. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7833. }, function($ctx1) {$ctx1.fill(self,"testAsArray",{},$globals.StringTest)});
  7834. //>>excludeEnd("ctx");
  7835. },
  7836. //>>excludeStart("ide", pragmas.excludeIdeData);
  7837. args: [],
  7838. source: "testAsArray\x0a\x09self assert: 'hello' asArray equals: #('h' 'e' 'l' 'l' 'o').",
  7839. referencedClasses: [],
  7840. //>>excludeEnd("ide");
  7841. messageSends: ["assert:equals:", "asArray"]
  7842. }),
  7843. $globals.StringTest);
  7844. $core.addMethod(
  7845. $core.method({
  7846. selector: "testAsLowerCase",
  7847. protocol: 'tests',
  7848. fn: function (){
  7849. var self=this;
  7850. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7851. return $core.withContext(function($ctx1) {
  7852. //>>excludeEnd("ctx");
  7853. self._assert_equals_("JACKIE"._asLowercase(),"jackie");
  7854. return self;
  7855. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7856. }, function($ctx1) {$ctx1.fill(self,"testAsLowerCase",{},$globals.StringTest)});
  7857. //>>excludeEnd("ctx");
  7858. },
  7859. //>>excludeStart("ide", pragmas.excludeIdeData);
  7860. args: [],
  7861. source: "testAsLowerCase\x0a\x09self assert: 'JACKIE' asLowercase equals: 'jackie'.",
  7862. referencedClasses: [],
  7863. //>>excludeEnd("ide");
  7864. messageSends: ["assert:equals:", "asLowercase"]
  7865. }),
  7866. $globals.StringTest);
  7867. $core.addMethod(
  7868. $core.method({
  7869. selector: "testAsNumber",
  7870. protocol: 'tests',
  7871. fn: function (){
  7872. var self=this;
  7873. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7874. return $core.withContext(function($ctx1) {
  7875. //>>excludeEnd("ctx");
  7876. var $1,$2;
  7877. $1="3"._asNumber();
  7878. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7879. $ctx1.sendIdx["asNumber"]=1;
  7880. //>>excludeEnd("ctx");
  7881. self._assert_equals_($1,(3));
  7882. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7883. $ctx1.sendIdx["assert:equals:"]=1;
  7884. //>>excludeEnd("ctx");
  7885. $2="-3"._asNumber();
  7886. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7887. $ctx1.sendIdx["asNumber"]=2;
  7888. //>>excludeEnd("ctx");
  7889. self._assert_equals_($2,(-3));
  7890. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7891. $ctx1.sendIdx["assert:equals:"]=2;
  7892. //>>excludeEnd("ctx");
  7893. self._assert_equals_("-1.5"._asNumber(),(-1.5));
  7894. return self;
  7895. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7896. }, function($ctx1) {$ctx1.fill(self,"testAsNumber",{},$globals.StringTest)});
  7897. //>>excludeEnd("ctx");
  7898. },
  7899. //>>excludeStart("ide", pragmas.excludeIdeData);
  7900. args: [],
  7901. 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.",
  7902. referencedClasses: [],
  7903. //>>excludeEnd("ide");
  7904. messageSends: ["assert:equals:", "asNumber"]
  7905. }),
  7906. $globals.StringTest);
  7907. $core.addMethod(
  7908. $core.method({
  7909. selector: "testAsUpperCase",
  7910. protocol: 'tests',
  7911. fn: function (){
  7912. var self=this;
  7913. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7914. return $core.withContext(function($ctx1) {
  7915. //>>excludeEnd("ctx");
  7916. self._assert_equals_("jackie"._asUppercase(),"JACKIE");
  7917. return self;
  7918. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7919. }, function($ctx1) {$ctx1.fill(self,"testAsUpperCase",{},$globals.StringTest)});
  7920. //>>excludeEnd("ctx");
  7921. },
  7922. //>>excludeStart("ide", pragmas.excludeIdeData);
  7923. args: [],
  7924. source: "testAsUpperCase\x0a\x09self assert: 'jackie' asUppercase equals: 'JACKIE'.",
  7925. referencedClasses: [],
  7926. //>>excludeEnd("ide");
  7927. messageSends: ["assert:equals:", "asUppercase"]
  7928. }),
  7929. $globals.StringTest);
  7930. $core.addMethod(
  7931. $core.method({
  7932. selector: "testAsciiValue",
  7933. protocol: 'tests',
  7934. fn: function (){
  7935. var self=this;
  7936. var characterA,characterU;
  7937. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7938. return $core.withContext(function($ctx1) {
  7939. //>>excludeEnd("ctx");
  7940. var $1;
  7941. characterA="A";
  7942. characterU="U";
  7943. $1=$recv(characterA)._asciiValue();
  7944. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7945. $ctx1.sendIdx["asciiValue"]=1;
  7946. //>>excludeEnd("ctx");
  7947. self._assert_equals_($1,(65));
  7948. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7949. $ctx1.sendIdx["assert:equals:"]=1;
  7950. //>>excludeEnd("ctx");
  7951. self._assert_equals_($recv(characterU)._asciiValue(),(85));
  7952. return self;
  7953. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7954. }, function($ctx1) {$ctx1.fill(self,"testAsciiValue",{characterA:characterA,characterU:characterU},$globals.StringTest)});
  7955. //>>excludeEnd("ctx");
  7956. },
  7957. //>>excludeStart("ide", pragmas.excludeIdeData);
  7958. args: [],
  7959. 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",
  7960. referencedClasses: [],
  7961. //>>excludeEnd("ide");
  7962. messageSends: ["assert:equals:", "asciiValue"]
  7963. }),
  7964. $globals.StringTest);
  7965. $core.addMethod(
  7966. $core.method({
  7967. selector: "testAtIfAbsentPut",
  7968. protocol: 'tests',
  7969. fn: function (){
  7970. var self=this;
  7971. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  7972. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7973. return $core.withContext(function($ctx1) {
  7974. //>>excludeEnd("ctx");
  7975. self._should_raise_((function(){
  7976. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7977. return $core.withContext(function($ctx2) {
  7978. //>>excludeEnd("ctx");
  7979. return "hello"._at_ifAbsentPut_((6),(function(){
  7980. return "a";
  7981. }));
  7982. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7983. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  7984. //>>excludeEnd("ctx");
  7985. }),$Error());
  7986. return self;
  7987. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7988. }, function($ctx1) {$ctx1.fill(self,"testAtIfAbsentPut",{},$globals.StringTest)});
  7989. //>>excludeEnd("ctx");
  7990. },
  7991. //>>excludeStart("ide", pragmas.excludeIdeData);
  7992. args: [],
  7993. source: "testAtIfAbsentPut\x0a\x09\x22String instances are read-only\x22\x0a\x09self should: [ 'hello' at: 6 ifAbsentPut: [ 'a' ] ] raise: Error",
  7994. referencedClasses: ["Error"],
  7995. //>>excludeEnd("ide");
  7996. messageSends: ["should:raise:", "at:ifAbsentPut:"]
  7997. }),
  7998. $globals.StringTest);
  7999. $core.addMethod(
  8000. $core.method({
  8001. selector: "testAtPut",
  8002. protocol: 'tests',
  8003. fn: function (){
  8004. var self=this;
  8005. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  8006. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8007. return $core.withContext(function($ctx1) {
  8008. //>>excludeEnd("ctx");
  8009. self._should_raise_((function(){
  8010. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8011. return $core.withContext(function($ctx2) {
  8012. //>>excludeEnd("ctx");
  8013. return "hello"._at_put_((1),"a");
  8014. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8015. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  8016. //>>excludeEnd("ctx");
  8017. }),$Error());
  8018. return self;
  8019. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8020. }, function($ctx1) {$ctx1.fill(self,"testAtPut",{},$globals.StringTest)});
  8021. //>>excludeEnd("ctx");
  8022. },
  8023. //>>excludeStart("ide", pragmas.excludeIdeData);
  8024. args: [],
  8025. source: "testAtPut\x0a\x09\x22String instances are read-only\x22\x0a\x09self should: [ 'hello' at: 1 put: 'a' ] raise: Error",
  8026. referencedClasses: ["Error"],
  8027. //>>excludeEnd("ide");
  8028. messageSends: ["should:raise:", "at:put:"]
  8029. }),
  8030. $globals.StringTest);
  8031. $core.addMethod(
  8032. $core.method({
  8033. selector: "testCapitalized",
  8034. protocol: 'tests',
  8035. fn: function (){
  8036. var self=this;
  8037. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8038. return $core.withContext(function($ctx1) {
  8039. //>>excludeEnd("ctx");
  8040. var $1,$2,$3;
  8041. $1="test"._capitalized();
  8042. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8043. $ctx1.sendIdx["capitalized"]=1;
  8044. //>>excludeEnd("ctx");
  8045. self._assert_equals_($1,"Test");
  8046. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8047. $ctx1.sendIdx["assert:equals:"]=1;
  8048. //>>excludeEnd("ctx");
  8049. $2="Test"._capitalized();
  8050. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8051. $ctx1.sendIdx["capitalized"]=2;
  8052. //>>excludeEnd("ctx");
  8053. self._assert_equals_($2,"Test");
  8054. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8055. $ctx1.sendIdx["assert:equals:"]=2;
  8056. //>>excludeEnd("ctx");
  8057. self._assert_equals_(""._capitalized(),"");
  8058. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8059. $ctx1.sendIdx["assert:equals:"]=3;
  8060. //>>excludeEnd("ctx");
  8061. $3="Test"._isCapitalized();
  8062. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8063. $ctx1.sendIdx["isCapitalized"]=1;
  8064. //>>excludeEnd("ctx");
  8065. self._assert_equals_($3,true);
  8066. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8067. $ctx1.sendIdx["assert:equals:"]=4;
  8068. //>>excludeEnd("ctx");
  8069. self._assert_equals_("test"._isCapitalized(),false);
  8070. return self;
  8071. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8072. }, function($ctx1) {$ctx1.fill(self,"testCapitalized",{},$globals.StringTest)});
  8073. //>>excludeEnd("ctx");
  8074. },
  8075. //>>excludeStart("ide", pragmas.excludeIdeData);
  8076. args: [],
  8077. 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.",
  8078. referencedClasses: [],
  8079. //>>excludeEnd("ide");
  8080. messageSends: ["assert:equals:", "capitalized", "isCapitalized"]
  8081. }),
  8082. $globals.StringTest);
  8083. $core.addMethod(
  8084. $core.method({
  8085. selector: "testCharCodeAt",
  8086. protocol: 'tests',
  8087. fn: function (){
  8088. var self=this;
  8089. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8090. return $core.withContext(function($ctx1) {
  8091. //>>excludeEnd("ctx");
  8092. var $1,$2,$3,$4,$5;
  8093. $1="jackie"._charCodeAt_((1));
  8094. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8095. $ctx1.sendIdx["charCodeAt:"]=1;
  8096. //>>excludeEnd("ctx");
  8097. self._assert_equals_($1,(106));
  8098. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8099. $ctx1.sendIdx["assert:equals:"]=1;
  8100. //>>excludeEnd("ctx");
  8101. $2="jackie"._charCodeAt_((2));
  8102. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8103. $ctx1.sendIdx["charCodeAt:"]=2;
  8104. //>>excludeEnd("ctx");
  8105. self._assert_equals_($2,(97));
  8106. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8107. $ctx1.sendIdx["assert:equals:"]=2;
  8108. //>>excludeEnd("ctx");
  8109. $3="jackie"._charCodeAt_((3));
  8110. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8111. $ctx1.sendIdx["charCodeAt:"]=3;
  8112. //>>excludeEnd("ctx");
  8113. self._assert_equals_($3,(99));
  8114. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8115. $ctx1.sendIdx["assert:equals:"]=3;
  8116. //>>excludeEnd("ctx");
  8117. $4="jackie"._charCodeAt_((4));
  8118. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8119. $ctx1.sendIdx["charCodeAt:"]=4;
  8120. //>>excludeEnd("ctx");
  8121. self._assert_equals_($4,(107));
  8122. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8123. $ctx1.sendIdx["assert:equals:"]=4;
  8124. //>>excludeEnd("ctx");
  8125. $5="jackie"._charCodeAt_((5));
  8126. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8127. $ctx1.sendIdx["charCodeAt:"]=5;
  8128. //>>excludeEnd("ctx");
  8129. self._assert_equals_($5,(105));
  8130. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8131. $ctx1.sendIdx["assert:equals:"]=5;
  8132. //>>excludeEnd("ctx");
  8133. self._assert_equals_("jackie"._charCodeAt_((6)),(101));
  8134. return self;
  8135. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8136. }, function($ctx1) {$ctx1.fill(self,"testCharCodeAt",{},$globals.StringTest)});
  8137. //>>excludeEnd("ctx");
  8138. },
  8139. //>>excludeStart("ide", pragmas.excludeIdeData);
  8140. args: [],
  8141. 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",
  8142. referencedClasses: [],
  8143. //>>excludeEnd("ide");
  8144. messageSends: ["assert:equals:", "charCodeAt:"]
  8145. }),
  8146. $globals.StringTest);
  8147. $core.addMethod(
  8148. $core.method({
  8149. selector: "testCopyFromTo",
  8150. protocol: 'tests',
  8151. fn: function (){
  8152. var self=this;
  8153. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8154. return $core.withContext(function($ctx1) {
  8155. //>>excludeEnd("ctx");
  8156. var $1;
  8157. $1="jackie"._copyFrom_to_((1),(3));
  8158. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8159. $ctx1.sendIdx["copyFrom:to:"]=1;
  8160. //>>excludeEnd("ctx");
  8161. self._assert_equals_($1,"jac");
  8162. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8163. $ctx1.sendIdx["assert:equals:"]=1;
  8164. //>>excludeEnd("ctx");
  8165. self._assert_equals_("jackie"._copyFrom_to_((4),(6)),"kie");
  8166. return self;
  8167. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8168. }, function($ctx1) {$ctx1.fill(self,"testCopyFromTo",{},$globals.StringTest)});
  8169. //>>excludeEnd("ctx");
  8170. },
  8171. //>>excludeStart("ide", pragmas.excludeIdeData);
  8172. args: [],
  8173. source: "testCopyFromTo\x0a\x09self assert: ('jackie' copyFrom: 1 to: 3) equals: 'jac'.\x0a\x09self assert: ('jackie' copyFrom: 4 to: 6) equals: 'kie'.",
  8174. referencedClasses: [],
  8175. //>>excludeEnd("ide");
  8176. messageSends: ["assert:equals:", "copyFrom:to:"]
  8177. }),
  8178. $globals.StringTest);
  8179. $core.addMethod(
  8180. $core.method({
  8181. selector: "testCopySeparates",
  8182. protocol: 'tests',
  8183. fn: function (){
  8184. var self=this;
  8185. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8186. return $core.withContext(function($ctx1) {
  8187. //>>excludeEnd("ctx");
  8188. var $3,$2,$1;
  8189. $3=self._collection();
  8190. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8191. $ctx1.sendIdx["collection"]=1;
  8192. //>>excludeEnd("ctx");
  8193. $2=$recv($3)._copy();
  8194. $1=$recv($2).__eq_eq(self._collection());
  8195. self._assert_($1);
  8196. return self;
  8197. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8198. }, function($ctx1) {$ctx1.fill(self,"testCopySeparates",{},$globals.StringTest)});
  8199. //>>excludeEnd("ctx");
  8200. },
  8201. //>>excludeStart("ide", pragmas.excludeIdeData);
  8202. args: [],
  8203. source: "testCopySeparates\x0a\x09\x22String instances are immutable\x22\x0a\x09self assert: self collection copy == self collection",
  8204. referencedClasses: [],
  8205. //>>excludeEnd("ide");
  8206. messageSends: ["assert:", "==", "copy", "collection"]
  8207. }),
  8208. $globals.StringTest);
  8209. $core.addMethod(
  8210. $core.method({
  8211. selector: "testCopyWithoutAll",
  8212. protocol: 'tests',
  8213. fn: function (){
  8214. var self=this;
  8215. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8216. return $core.withContext(function($ctx1) {
  8217. //>>excludeEnd("ctx");
  8218. self._assert_equals_("*hello* *world*"._copyWithoutAll_("*"),"hello world");
  8219. return self;
  8220. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8221. }, function($ctx1) {$ctx1.fill(self,"testCopyWithoutAll",{},$globals.StringTest)});
  8222. //>>excludeEnd("ctx");
  8223. },
  8224. //>>excludeStart("ide", pragmas.excludeIdeData);
  8225. args: [],
  8226. source: "testCopyWithoutAll\x0a\x09self\x0a\x09\x09assert: ('*hello* *world*' copyWithoutAll: '*')\x0a\x09\x09equals: 'hello world'",
  8227. referencedClasses: [],
  8228. //>>excludeEnd("ide");
  8229. messageSends: ["assert:equals:", "copyWithoutAll:"]
  8230. }),
  8231. $globals.StringTest);
  8232. $core.addMethod(
  8233. $core.method({
  8234. selector: "testEquality",
  8235. protocol: 'tests',
  8236. fn: function (){
  8237. var self=this;
  8238. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8239. return $core.withContext(function($ctx1) {
  8240. //>>excludeEnd("ctx");
  8241. var $1,$2,$3;
  8242. self._assert_equals_("hello","hello");
  8243. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8244. $ctx1.sendIdx["assert:equals:"]=1;
  8245. //>>excludeEnd("ctx");
  8246. $1="hello".__eq("world");
  8247. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8248. $ctx1.sendIdx["="]=1;
  8249. //>>excludeEnd("ctx");
  8250. self._deny_($1);
  8251. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8252. $ctx1.sendIdx["deny:"]=1;
  8253. //>>excludeEnd("ctx");
  8254. $2="hello".__eq([]._at_ifAbsent_((1),(function(){
  8255. })));
  8256. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8257. $ctx1.sendIdx["="]=2;
  8258. //>>excludeEnd("ctx");
  8259. self._deny_($2);
  8260. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8261. $ctx1.sendIdx["deny:"]=2;
  8262. //>>excludeEnd("ctx");
  8263. $3="hello"._yourself();
  8264. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8265. $ctx1.sendIdx["yourself"]=1;
  8266. //>>excludeEnd("ctx");
  8267. self._assert_equals_("hello",$3);
  8268. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8269. $ctx1.sendIdx["assert:equals:"]=2;
  8270. //>>excludeEnd("ctx");
  8271. self._assert_equals_("hello"._yourself(),"hello");
  8272. self._deny_("".__eq((0)));
  8273. return self;
  8274. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8275. }, function($ctx1) {$ctx1.fill(self,"testEquality",{},$globals.StringTest)});
  8276. //>>excludeEnd("ctx");
  8277. },
  8278. //>>excludeStart("ide", pragmas.excludeIdeData);
  8279. args: [],
  8280. 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",
  8281. referencedClasses: [],
  8282. //>>excludeEnd("ide");
  8283. messageSends: ["assert:equals:", "deny:", "=", "at:ifAbsent:", "yourself"]
  8284. }),
  8285. $globals.StringTest);
  8286. $core.addMethod(
  8287. $core.method({
  8288. selector: "testIdentity",
  8289. protocol: 'tests',
  8290. fn: function (){
  8291. var self=this;
  8292. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8293. return $core.withContext(function($ctx1) {
  8294. //>>excludeEnd("ctx");
  8295. var $1,$2,$4,$3,$5;
  8296. $1="hello".__eq_eq("hello");
  8297. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8298. $ctx1.sendIdx["=="]=1;
  8299. //>>excludeEnd("ctx");
  8300. self._assert_($1);
  8301. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8302. $ctx1.sendIdx["assert:"]=1;
  8303. //>>excludeEnd("ctx");
  8304. $2="hello".__eq_eq("world");
  8305. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8306. $ctx1.sendIdx["=="]=2;
  8307. //>>excludeEnd("ctx");
  8308. self._deny_($2);
  8309. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8310. $ctx1.sendIdx["deny:"]=1;
  8311. //>>excludeEnd("ctx");
  8312. $4="hello"._yourself();
  8313. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8314. $ctx1.sendIdx["yourself"]=1;
  8315. //>>excludeEnd("ctx");
  8316. $3="hello".__eq_eq($4);
  8317. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8318. $ctx1.sendIdx["=="]=3;
  8319. //>>excludeEnd("ctx");
  8320. self._assert_($3);
  8321. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8322. $ctx1.sendIdx["assert:"]=2;
  8323. //>>excludeEnd("ctx");
  8324. $5=$recv("hello"._yourself()).__eq_eq("hello");
  8325. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8326. $ctx1.sendIdx["=="]=4;
  8327. //>>excludeEnd("ctx");
  8328. self._assert_($5);
  8329. self._deny_("".__eq_eq((0)));
  8330. return self;
  8331. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8332. }, function($ctx1) {$ctx1.fill(self,"testIdentity",{},$globals.StringTest)});
  8333. //>>excludeEnd("ctx");
  8334. },
  8335. //>>excludeStart("ide", pragmas.excludeIdeData);
  8336. args: [],
  8337. 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",
  8338. referencedClasses: [],
  8339. //>>excludeEnd("ide");
  8340. messageSends: ["assert:", "==", "deny:", "yourself"]
  8341. }),
  8342. $globals.StringTest);
  8343. $core.addMethod(
  8344. $core.method({
  8345. selector: "testIncludesSubString",
  8346. protocol: 'tests',
  8347. fn: function (){
  8348. var self=this;
  8349. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8350. return $core.withContext(function($ctx1) {
  8351. //>>excludeEnd("ctx");
  8352. var $1;
  8353. $1="amber"._includesSubString_("ber");
  8354. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8355. $ctx1.sendIdx["includesSubString:"]=1;
  8356. //>>excludeEnd("ctx");
  8357. self._assert_($1);
  8358. self._deny_("amber"._includesSubString_("zork"));
  8359. return self;
  8360. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8361. }, function($ctx1) {$ctx1.fill(self,"testIncludesSubString",{},$globals.StringTest)});
  8362. //>>excludeEnd("ctx");
  8363. },
  8364. //>>excludeStart("ide", pragmas.excludeIdeData);
  8365. args: [],
  8366. source: "testIncludesSubString\x0a\x09self assert: ('amber' includesSubString: 'ber').\x0a\x09self deny: ('amber' includesSubString: 'zork').",
  8367. referencedClasses: [],
  8368. //>>excludeEnd("ide");
  8369. messageSends: ["assert:", "includesSubString:", "deny:"]
  8370. }),
  8371. $globals.StringTest);
  8372. $core.addMethod(
  8373. $core.method({
  8374. selector: "testIndexOfStartingAtWithNull",
  8375. protocol: 'tests',
  8376. fn: function (){
  8377. var self=this;
  8378. return self;
  8379. },
  8380. //>>excludeStart("ide", pragmas.excludeIdeData);
  8381. args: [],
  8382. source: "testIndexOfStartingAtWithNull\x0a\x09\x22String cannot hold JS null\x22",
  8383. referencedClasses: [],
  8384. //>>excludeEnd("ide");
  8385. messageSends: []
  8386. }),
  8387. $globals.StringTest);
  8388. $core.addMethod(
  8389. $core.method({
  8390. selector: "testIndexOfWithNull",
  8391. protocol: 'tests',
  8392. fn: function (){
  8393. var self=this;
  8394. return self;
  8395. },
  8396. //>>excludeStart("ide", pragmas.excludeIdeData);
  8397. args: [],
  8398. source: "testIndexOfWithNull\x0a\x09\x22String cannot hold JS null\x22",
  8399. referencedClasses: [],
  8400. //>>excludeEnd("ide");
  8401. messageSends: []
  8402. }),
  8403. $globals.StringTest);
  8404. $core.addMethod(
  8405. $core.method({
  8406. selector: "testIsVowel",
  8407. protocol: 'tests',
  8408. fn: function (){
  8409. var self=this;
  8410. var vowel,consonant;
  8411. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8412. return $core.withContext(function($ctx1) {
  8413. //>>excludeEnd("ctx");
  8414. var $1;
  8415. vowel="u";
  8416. consonant="z";
  8417. $1=$recv(vowel)._isVowel();
  8418. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8419. $ctx1.sendIdx["isVowel"]=1;
  8420. //>>excludeEnd("ctx");
  8421. self._assert_equals_($1,true);
  8422. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8423. $ctx1.sendIdx["assert:equals:"]=1;
  8424. //>>excludeEnd("ctx");
  8425. self._assert_equals_($recv(consonant)._isVowel(),false);
  8426. return self;
  8427. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8428. }, function($ctx1) {$ctx1.fill(self,"testIsVowel",{vowel:vowel,consonant:consonant},$globals.StringTest)});
  8429. //>>excludeEnd("ctx");
  8430. },
  8431. //>>excludeStart("ide", pragmas.excludeIdeData);
  8432. args: [],
  8433. 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",
  8434. referencedClasses: [],
  8435. //>>excludeEnd("ide");
  8436. messageSends: ["assert:equals:", "isVowel"]
  8437. }),
  8438. $globals.StringTest);
  8439. $core.addMethod(
  8440. $core.method({
  8441. selector: "testJoin",
  8442. protocol: 'tests',
  8443. fn: function (){
  8444. var self=this;
  8445. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8446. return $core.withContext(function($ctx1) {
  8447. //>>excludeEnd("ctx");
  8448. self._assert_equals_(","._join_(["hello", "world"]),"hello,world");
  8449. return self;
  8450. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8451. }, function($ctx1) {$ctx1.fill(self,"testJoin",{},$globals.StringTest)});
  8452. //>>excludeEnd("ctx");
  8453. },
  8454. //>>excludeStart("ide", pragmas.excludeIdeData);
  8455. args: [],
  8456. source: "testJoin\x0a\x09self assert: (',' join: #('hello' 'world')) equals: 'hello,world'",
  8457. referencedClasses: [],
  8458. //>>excludeEnd("ide");
  8459. messageSends: ["assert:equals:", "join:"]
  8460. }),
  8461. $globals.StringTest);
  8462. $core.addMethod(
  8463. $core.method({
  8464. selector: "testRemoveAll",
  8465. protocol: 'tests',
  8466. fn: function (){
  8467. var self=this;
  8468. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  8469. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8470. return $core.withContext(function($ctx1) {
  8471. //>>excludeEnd("ctx");
  8472. self._should_raise_((function(){
  8473. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8474. return $core.withContext(function($ctx2) {
  8475. //>>excludeEnd("ctx");
  8476. return $recv(self._collection())._removeAll();
  8477. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8478. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  8479. //>>excludeEnd("ctx");
  8480. }),$Error());
  8481. return self;
  8482. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8483. }, function($ctx1) {$ctx1.fill(self,"testRemoveAll",{},$globals.StringTest)});
  8484. //>>excludeEnd("ctx");
  8485. },
  8486. //>>excludeStart("ide", pragmas.excludeIdeData);
  8487. args: [],
  8488. source: "testRemoveAll\x0a\x09self should: [ self collection removeAll ] raise: Error",
  8489. referencedClasses: ["Error"],
  8490. //>>excludeEnd("ide");
  8491. messageSends: ["should:raise:", "removeAll", "collection"]
  8492. }),
  8493. $globals.StringTest);
  8494. $core.addMethod(
  8495. $core.method({
  8496. selector: "testReversed",
  8497. protocol: 'tests',
  8498. fn: function (){
  8499. var self=this;
  8500. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8501. return $core.withContext(function($ctx1) {
  8502. //>>excludeEnd("ctx");
  8503. self._assert_equals_("jackiechan"._reversed(),"nahceikcaj");
  8504. return self;
  8505. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8506. }, function($ctx1) {$ctx1.fill(self,"testReversed",{},$globals.StringTest)});
  8507. //>>excludeEnd("ctx");
  8508. },
  8509. //>>excludeStart("ide", pragmas.excludeIdeData);
  8510. args: [],
  8511. source: "testReversed\x0a\x09self assert: 'jackiechan' reversed equals: 'nahceikcaj'.",
  8512. referencedClasses: [],
  8513. //>>excludeEnd("ide");
  8514. messageSends: ["assert:equals:", "reversed"]
  8515. }),
  8516. $globals.StringTest);
  8517. $core.addMethod(
  8518. $core.method({
  8519. selector: "testStreamContents",
  8520. protocol: 'tests',
  8521. fn: function (){
  8522. var self=this;
  8523. function $String(){return $globals.String||(typeof String=="undefined"?nil:String)}
  8524. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8525. return $core.withContext(function($ctx1) {
  8526. //>>excludeEnd("ctx");
  8527. self._assert_equals_($recv($String())._streamContents_((function(aStream){
  8528. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8529. return $core.withContext(function($ctx2) {
  8530. //>>excludeEnd("ctx");
  8531. $recv(aStream)._nextPutAll_("hello");
  8532. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8533. $ctx2.sendIdx["nextPutAll:"]=1;
  8534. //>>excludeEnd("ctx");
  8535. $recv(aStream)._space();
  8536. return $recv(aStream)._nextPutAll_("world");
  8537. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8538. }, function($ctx2) {$ctx2.fillBlock({aStream:aStream},$ctx1,1)});
  8539. //>>excludeEnd("ctx");
  8540. })),"hello world");
  8541. return self;
  8542. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8543. }, function($ctx1) {$ctx1.fill(self,"testStreamContents",{},$globals.StringTest)});
  8544. //>>excludeEnd("ctx");
  8545. },
  8546. //>>excludeStart("ide", pragmas.excludeIdeData);
  8547. args: [],
  8548. 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'",
  8549. referencedClasses: ["String"],
  8550. //>>excludeEnd("ide");
  8551. messageSends: ["assert:equals:", "streamContents:", "nextPutAll:", "space"]
  8552. }),
  8553. $globals.StringTest);
  8554. $core.addMethod(
  8555. $core.method({
  8556. selector: "testSubStrings",
  8557. protocol: 'tests',
  8558. fn: function (){
  8559. var self=this;
  8560. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8561. return $core.withContext(function($ctx1) {
  8562. //>>excludeEnd("ctx");
  8563. self._assert_equals_("jackiechan"._subStrings_("ie"),["jack", "chan"]);
  8564. return self;
  8565. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8566. }, function($ctx1) {$ctx1.fill(self,"testSubStrings",{},$globals.StringTest)});
  8567. //>>excludeEnd("ctx");
  8568. },
  8569. //>>excludeStart("ide", pragmas.excludeIdeData);
  8570. args: [],
  8571. source: "testSubStrings\x0a\x09self assert: ('jackiechan' subStrings: 'ie') equals: #( 'jack' 'chan' ).",
  8572. referencedClasses: [],
  8573. //>>excludeEnd("ide");
  8574. messageSends: ["assert:equals:", "subStrings:"]
  8575. }),
  8576. $globals.StringTest);
  8577. $core.addMethod(
  8578. $core.method({
  8579. selector: "testTrim",
  8580. protocol: 'tests',
  8581. fn: function (){
  8582. var self=this;
  8583. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8584. return $core.withContext(function($ctx1) {
  8585. //>>excludeEnd("ctx");
  8586. self._assert_equals_(" jackie"._trimLeft(),"jackie");
  8587. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8588. $ctx1.sendIdx["assert:equals:"]=1;
  8589. //>>excludeEnd("ctx");
  8590. self._assert_equals_("jackie "._trimRight(),"jackie");
  8591. return self;
  8592. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8593. }, function($ctx1) {$ctx1.fill(self,"testTrim",{},$globals.StringTest)});
  8594. //>>excludeEnd("ctx");
  8595. },
  8596. //>>excludeStart("ide", pragmas.excludeIdeData);
  8597. args: [],
  8598. source: "testTrim\x0a\x09self assert: ' jackie' trimLeft equals: 'jackie'.\x0a\x09self assert: 'jackie ' trimRight equals: 'jackie'.",
  8599. referencedClasses: [],
  8600. //>>excludeEnd("ide");
  8601. messageSends: ["assert:equals:", "trimLeft", "trimRight"]
  8602. }),
  8603. $globals.StringTest);
  8604. $core.addMethod(
  8605. $core.method({
  8606. selector: "testValue",
  8607. protocol: 'tests',
  8608. fn: function (){
  8609. var self=this;
  8610. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8611. return $core.withContext(function($ctx1) {
  8612. //>>excludeEnd("ctx");
  8613. self._assert_equals_("asString"._value_((1)),"1");
  8614. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8615. $ctx1.sendIdx["assert:equals:"]=1;
  8616. //>>excludeEnd("ctx");
  8617. self._assert_equals_([(1), (2), (3)]._collect_("asString"),["1", "2", "3"]);
  8618. return self;
  8619. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8620. }, function($ctx1) {$ctx1.fill(self,"testValue",{},$globals.StringTest)});
  8621. //>>excludeEnd("ctx");
  8622. },
  8623. //>>excludeStart("ide", pragmas.excludeIdeData);
  8624. args: [],
  8625. 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')",
  8626. referencedClasses: [],
  8627. //>>excludeEnd("ide");
  8628. messageSends: ["assert:equals:", "value:", "collect:"]
  8629. }),
  8630. $globals.StringTest);
  8631. $core.addMethod(
  8632. $core.method({
  8633. selector: "collectionClass",
  8634. protocol: 'fixture',
  8635. fn: function (){
  8636. var self=this;
  8637. function $String(){return $globals.String||(typeof String=="undefined"?nil:String)}
  8638. return $String();
  8639. },
  8640. //>>excludeStart("ide", pragmas.excludeIdeData);
  8641. args: [],
  8642. source: "collectionClass\x0a\x09^ String",
  8643. referencedClasses: ["String"],
  8644. //>>excludeEnd("ide");
  8645. messageSends: []
  8646. }),
  8647. $globals.StringTest.klass);
  8648. $core.addClass('SetTest', $globals.CollectionTest, [], 'Kernel-Tests');
  8649. $core.addMethod(
  8650. $core.method({
  8651. selector: "collection",
  8652. protocol: 'fixture',
  8653. fn: function (){
  8654. var self=this;
  8655. function $Set(){return $globals.Set||(typeof Set=="undefined"?nil:Set)}
  8656. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  8657. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8658. return $core.withContext(function($ctx1) {
  8659. //>>excludeEnd("ctx");
  8660. var $1;
  8661. $1=$recv($Set())._new();
  8662. $recv($1)._add_($Smalltalk());
  8663. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8664. $ctx1.sendIdx["add:"]=1;
  8665. //>>excludeEnd("ctx");
  8666. $recv($1)._add_(nil);
  8667. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8668. $ctx1.sendIdx["add:"]=2;
  8669. //>>excludeEnd("ctx");
  8670. $recv($1)._add_((3).__at((3)));
  8671. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8672. $ctx1.sendIdx["add:"]=3;
  8673. //>>excludeEnd("ctx");
  8674. $recv($1)._add_(false);
  8675. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8676. $ctx1.sendIdx["add:"]=4;
  8677. //>>excludeEnd("ctx");
  8678. $recv($1)._add_(self["@sampleBlock"]);
  8679. return $recv($1)._yourself();
  8680. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8681. }, function($ctx1) {$ctx1.fill(self,"collection",{},$globals.SetTest)});
  8682. //>>excludeEnd("ctx");
  8683. },
  8684. //>>excludeStart("ide", pragmas.excludeIdeData);
  8685. args: [],
  8686. source: "collection\x0a\x09^ Set new\x0a\x09\x09add: Smalltalk;\x0a\x09\x09add: nil;\x0a\x09\x09add: 3@3;\x0a\x09\x09add: false;\x0a\x09\x09add: sampleBlock;\x0a\x09\x09yourself",
  8687. referencedClasses: ["Set", "Smalltalk"],
  8688. //>>excludeEnd("ide");
  8689. messageSends: ["add:", "new", "@", "yourself"]
  8690. }),
  8691. $globals.SetTest);
  8692. $core.addMethod(
  8693. $core.method({
  8694. selector: "collectionOfPrintStrings",
  8695. protocol: 'fixture',
  8696. fn: function (){
  8697. var self=this;
  8698. function $Set(){return $globals.Set||(typeof Set=="undefined"?nil:Set)}
  8699. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8700. return $core.withContext(function($ctx1) {
  8701. //>>excludeEnd("ctx");
  8702. var $1;
  8703. $1=$recv($Set())._new();
  8704. $recv($1)._add_("a SmalltalkImage");
  8705. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8706. $ctx1.sendIdx["add:"]=1;
  8707. //>>excludeEnd("ctx");
  8708. $recv($1)._add_("nil");
  8709. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8710. $ctx1.sendIdx["add:"]=2;
  8711. //>>excludeEnd("ctx");
  8712. $recv($1)._add_("3@3");
  8713. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8714. $ctx1.sendIdx["add:"]=3;
  8715. //>>excludeEnd("ctx");
  8716. $recv($1)._add_("false");
  8717. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8718. $ctx1.sendIdx["add:"]=4;
  8719. //>>excludeEnd("ctx");
  8720. $recv($1)._add_("a BlockClosure");
  8721. return $recv($1)._yourself();
  8722. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8723. }, function($ctx1) {$ctx1.fill(self,"collectionOfPrintStrings",{},$globals.SetTest)});
  8724. //>>excludeEnd("ctx");
  8725. },
  8726. //>>excludeStart("ide", pragmas.excludeIdeData);
  8727. args: [],
  8728. source: "collectionOfPrintStrings\x0a\x09^ Set new\x0a\x09\x09add: 'a SmalltalkImage';\x0a\x09\x09add: 'nil';\x0a\x09\x09add: '3@3';\x0a\x09\x09add: 'false';\x0a\x09\x09add: 'a BlockClosure';\x0a\x09\x09yourself",
  8729. referencedClasses: ["Set"],
  8730. //>>excludeEnd("ide");
  8731. messageSends: ["add:", "new", "yourself"]
  8732. }),
  8733. $globals.SetTest);
  8734. $core.addMethod(
  8735. $core.method({
  8736. selector: "collectionSize",
  8737. protocol: 'fixture',
  8738. fn: function (){
  8739. var self=this;
  8740. return (5);
  8741. },
  8742. //>>excludeStart("ide", pragmas.excludeIdeData);
  8743. args: [],
  8744. source: "collectionSize\x0a\x09^ 5",
  8745. referencedClasses: [],
  8746. //>>excludeEnd("ide");
  8747. messageSends: []
  8748. }),
  8749. $globals.SetTest);
  8750. $core.addMethod(
  8751. $core.method({
  8752. selector: "collectionWithDuplicates",
  8753. protocol: 'fixture',
  8754. fn: function (){
  8755. var self=this;
  8756. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8757. return $core.withContext(function($ctx1) {
  8758. //>>excludeEnd("ctx");
  8759. var $1;
  8760. $1=self._collection();
  8761. $recv($1)._add_((0));
  8762. return $recv($1)._yourself();
  8763. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8764. }, function($ctx1) {$ctx1.fill(self,"collectionWithDuplicates",{},$globals.SetTest)});
  8765. //>>excludeEnd("ctx");
  8766. },
  8767. //>>excludeStart("ide", pragmas.excludeIdeData);
  8768. args: [],
  8769. source: "collectionWithDuplicates\x0a\x09\x22Set has no duplicates\x22\x0a\x09^ self collection add: 0; yourself",
  8770. referencedClasses: [],
  8771. //>>excludeEnd("ide");
  8772. messageSends: ["add:", "collection", "yourself"]
  8773. }),
  8774. $globals.SetTest);
  8775. $core.addMethod(
  8776. $core.method({
  8777. selector: "collectionWithNewValue",
  8778. protocol: 'fixture',
  8779. fn: function (){
  8780. var self=this;
  8781. function $Set(){return $globals.Set||(typeof Set=="undefined"?nil:Set)}
  8782. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  8783. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8784. return $core.withContext(function($ctx1) {
  8785. //>>excludeEnd("ctx");
  8786. var $1;
  8787. $1=$recv($Set())._new();
  8788. $recv($1)._add_($Smalltalk());
  8789. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8790. $ctx1.sendIdx["add:"]=1;
  8791. //>>excludeEnd("ctx");
  8792. $recv($1)._add_(nil);
  8793. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8794. $ctx1.sendIdx["add:"]=2;
  8795. //>>excludeEnd("ctx");
  8796. $recv($1)._add_((3).__at((3)));
  8797. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8798. $ctx1.sendIdx["add:"]=3;
  8799. //>>excludeEnd("ctx");
  8800. $recv($1)._add_("N");
  8801. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8802. $ctx1.sendIdx["add:"]=4;
  8803. //>>excludeEnd("ctx");
  8804. $recv($1)._add_(false);
  8805. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8806. $ctx1.sendIdx["add:"]=5;
  8807. //>>excludeEnd("ctx");
  8808. $recv($1)._add_(self["@sampleBlock"]);
  8809. return $recv($1)._yourself();
  8810. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8811. }, function($ctx1) {$ctx1.fill(self,"collectionWithNewValue",{},$globals.SetTest)});
  8812. //>>excludeEnd("ctx");
  8813. },
  8814. //>>excludeStart("ide", pragmas.excludeIdeData);
  8815. args: [],
  8816. source: "collectionWithNewValue\x0a\x09^ Set new\x0a\x09\x09add: Smalltalk;\x0a\x09\x09add: nil;\x0a\x09\x09add: 3@3;\x0a\x09\x09add: 'N';\x0a\x09\x09add: false;\x0a\x09\x09add: sampleBlock;\x0a\x09\x09yourself",
  8817. referencedClasses: ["Set", "Smalltalk"],
  8818. //>>excludeEnd("ide");
  8819. messageSends: ["add:", "new", "@", "yourself"]
  8820. }),
  8821. $globals.SetTest);
  8822. $core.addMethod(
  8823. $core.method({
  8824. selector: "testAddAll",
  8825. protocol: 'tests',
  8826. fn: function (){
  8827. var self=this;
  8828. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8829. return $core.withContext(function($ctx1) {
  8830. //>>excludeEnd("ctx");
  8831. var $2,$3,$4,$1,$5,$7,$8,$9,$6,$10,$12,$11;
  8832. (
  8833. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8834. $ctx1.supercall = true,
  8835. //>>excludeEnd("ctx");
  8836. ($globals.SetTest.superclass||$boot.dnu).fn.prototype._testAddAll.apply($recv(self), []));
  8837. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8838. $ctx1.supercall = false;
  8839. //>>excludeEnd("ctx");;
  8840. $2=self._collection();
  8841. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8842. $ctx1.sendIdx["collection"]=1;
  8843. //>>excludeEnd("ctx");
  8844. $3=self._collection();
  8845. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8846. $ctx1.sendIdx["collection"]=2;
  8847. //>>excludeEnd("ctx");
  8848. $recv($2)._addAll_($3);
  8849. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8850. $ctx1.sendIdx["addAll:"]=1;
  8851. //>>excludeEnd("ctx");
  8852. $4=$recv($2)._yourself();
  8853. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8854. $ctx1.sendIdx["yourself"]=1;
  8855. //>>excludeEnd("ctx");
  8856. $1=$4;
  8857. $5=self._collection();
  8858. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8859. $ctx1.sendIdx["collection"]=3;
  8860. //>>excludeEnd("ctx");
  8861. self._assert_equals_($1,$5);
  8862. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8863. $ctx1.sendIdx["assert:equals:"]=1;
  8864. //>>excludeEnd("ctx");
  8865. $7=self._collection();
  8866. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8867. $ctx1.sendIdx["collection"]=4;
  8868. //>>excludeEnd("ctx");
  8869. $8=self._collectionWithNewValue();
  8870. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8871. $ctx1.sendIdx["collectionWithNewValue"]=1;
  8872. //>>excludeEnd("ctx");
  8873. $recv($7)._addAll_($8);
  8874. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8875. $ctx1.sendIdx["addAll:"]=2;
  8876. //>>excludeEnd("ctx");
  8877. $9=$recv($7)._yourself();
  8878. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8879. $ctx1.sendIdx["yourself"]=2;
  8880. //>>excludeEnd("ctx");
  8881. $6=$9;
  8882. $10=self._collectionWithNewValue();
  8883. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8884. $ctx1.sendIdx["collectionWithNewValue"]=2;
  8885. //>>excludeEnd("ctx");
  8886. self._assert_equals_($6,$10);
  8887. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8888. $ctx1.sendIdx["assert:equals:"]=2;
  8889. //>>excludeEnd("ctx");
  8890. $12=self._collectionWithNewValue();
  8891. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8892. $ctx1.sendIdx["collectionWithNewValue"]=3;
  8893. //>>excludeEnd("ctx");
  8894. $recv($12)._addAll_(self._collection());
  8895. $11=$recv($12)._yourself();
  8896. self._assert_equals_($11,self._collectionWithNewValue());
  8897. return self;
  8898. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8899. }, function($ctx1) {$ctx1.fill(self,"testAddAll",{},$globals.SetTest)});
  8900. //>>excludeEnd("ctx");
  8901. },
  8902. //>>excludeStart("ide", pragmas.excludeIdeData);
  8903. args: [],
  8904. 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",
  8905. referencedClasses: [],
  8906. //>>excludeEnd("ide");
  8907. messageSends: ["testAddAll", "assert:equals:", "addAll:", "collection", "yourself", "collectionWithNewValue"]
  8908. }),
  8909. $globals.SetTest);
  8910. $core.addMethod(
  8911. $core.method({
  8912. selector: "testAddRemove",
  8913. protocol: 'tests',
  8914. fn: function (){
  8915. var self=this;
  8916. var set;
  8917. function $Set(){return $globals.Set||(typeof Set=="undefined"?nil:Set)}
  8918. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8919. return $core.withContext(function($ctx1) {
  8920. //>>excludeEnd("ctx");
  8921. var $1,$2;
  8922. set=$recv($Set())._new();
  8923. self._assert_($recv(set)._isEmpty());
  8924. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8925. $ctx1.sendIdx["assert:"]=1;
  8926. //>>excludeEnd("ctx");
  8927. $recv(set)._add_((3));
  8928. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8929. $ctx1.sendIdx["add:"]=1;
  8930. //>>excludeEnd("ctx");
  8931. $1=$recv(set)._includes_((3));
  8932. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8933. $ctx1.sendIdx["includes:"]=1;
  8934. //>>excludeEnd("ctx");
  8935. self._assert_($1);
  8936. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8937. $ctx1.sendIdx["assert:"]=2;
  8938. //>>excludeEnd("ctx");
  8939. $recv(set)._add_((5));
  8940. $2=$recv(set)._includes_((5));
  8941. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8942. $ctx1.sendIdx["includes:"]=2;
  8943. //>>excludeEnd("ctx");
  8944. self._assert_($2);
  8945. $recv(set)._remove_((3));
  8946. self._deny_($recv(set)._includes_((3)));
  8947. return self;
  8948. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8949. }, function($ctx1) {$ctx1.fill(self,"testAddRemove",{set:set},$globals.SetTest)});
  8950. //>>excludeEnd("ctx");
  8951. },
  8952. //>>excludeStart("ide", pragmas.excludeIdeData);
  8953. args: [],
  8954. 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)",
  8955. referencedClasses: ["Set"],
  8956. //>>excludeEnd("ide");
  8957. messageSends: ["new", "assert:", "isEmpty", "add:", "includes:", "remove:", "deny:"]
  8958. }),
  8959. $globals.SetTest);
  8960. $core.addMethod(
  8961. $core.method({
  8962. selector: "testAt",
  8963. protocol: 'tests',
  8964. fn: function (){
  8965. var self=this;
  8966. function $Set(){return $globals.Set||(typeof Set=="undefined"?nil:Set)}
  8967. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  8968. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8969. return $core.withContext(function($ctx1) {
  8970. //>>excludeEnd("ctx");
  8971. self._should_raise_((function(){
  8972. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8973. return $core.withContext(function($ctx2) {
  8974. //>>excludeEnd("ctx");
  8975. return $recv($recv($Set())._new())._at_put_((1),(2));
  8976. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8977. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  8978. //>>excludeEnd("ctx");
  8979. }),$Error());
  8980. return self;
  8981. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8982. }, function($ctx1) {$ctx1.fill(self,"testAt",{},$globals.SetTest)});
  8983. //>>excludeEnd("ctx");
  8984. },
  8985. //>>excludeStart("ide", pragmas.excludeIdeData);
  8986. args: [],
  8987. source: "testAt\x0a\x09self should: [ Set new at: 1 put: 2 ] raise: Error",
  8988. referencedClasses: ["Set", "Error"],
  8989. //>>excludeEnd("ide");
  8990. messageSends: ["should:raise:", "at:put:", "new"]
  8991. }),
  8992. $globals.SetTest);
  8993. $core.addMethod(
  8994. $core.method({
  8995. selector: "testCollect",
  8996. protocol: 'tests',
  8997. fn: function (){
  8998. var self=this;
  8999. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9000. return $core.withContext(function($ctx1) {
  9001. //>>excludeEnd("ctx");
  9002. var $2,$1;
  9003. (
  9004. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9005. $ctx1.supercall = true,
  9006. //>>excludeEnd("ctx");
  9007. ($globals.SetTest.superclass||$boot.dnu).fn.prototype._testCollect.apply($recv(self), []));
  9008. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9009. $ctx1.supercall = false;
  9010. //>>excludeEnd("ctx");;
  9011. $2=[(5), (6), (8)]._asSet();
  9012. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9013. $ctx1.sendIdx["asSet"]=1;
  9014. //>>excludeEnd("ctx");
  9015. $1=$recv($2)._collect_((function(x){
  9016. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9017. return $core.withContext(function($ctx2) {
  9018. //>>excludeEnd("ctx");
  9019. return $recv(x).__backslash_backslash((3));
  9020. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9021. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)});
  9022. //>>excludeEnd("ctx");
  9023. }));
  9024. self._assert_equals_($1,[(0), (2)]._asSet());
  9025. return self;
  9026. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9027. }, function($ctx1) {$ctx1.fill(self,"testCollect",{},$globals.SetTest)});
  9028. //>>excludeEnd("ctx");
  9029. },
  9030. //>>excludeStart("ide", pragmas.excludeIdeData);
  9031. args: [],
  9032. source: "testCollect\x0a\x09super testCollect.\x0a\x09self assert: (#(5 6 8) asSet collect: [ :x | x \x5c\x5c 3 ]) equals: #(0 2) asSet",
  9033. referencedClasses: [],
  9034. //>>excludeEnd("ide");
  9035. messageSends: ["testCollect", "assert:equals:", "collect:", "asSet", "\x5c\x5c"]
  9036. }),
  9037. $globals.SetTest);
  9038. $core.addMethod(
  9039. $core.method({
  9040. selector: "testComma",
  9041. protocol: 'tests',
  9042. fn: function (){
  9043. var self=this;
  9044. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9045. return $core.withContext(function($ctx1) {
  9046. //>>excludeEnd("ctx");
  9047. var $2,$3,$1,$4,$6,$7,$5,$8,$10,$9;
  9048. (
  9049. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9050. $ctx1.supercall = true,
  9051. //>>excludeEnd("ctx");
  9052. ($globals.SetTest.superclass||$boot.dnu).fn.prototype._testComma.apply($recv(self), []));
  9053. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9054. $ctx1.supercall = false;
  9055. //>>excludeEnd("ctx");;
  9056. $2=self._collection();
  9057. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9058. $ctx1.sendIdx["collection"]=1;
  9059. //>>excludeEnd("ctx");
  9060. $3=self._collection();
  9061. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9062. $ctx1.sendIdx["collection"]=2;
  9063. //>>excludeEnd("ctx");
  9064. $1=$recv($2).__comma($3);
  9065. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9066. $ctx1.sendIdx[","]=1;
  9067. //>>excludeEnd("ctx");
  9068. $4=self._collection();
  9069. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9070. $ctx1.sendIdx["collection"]=3;
  9071. //>>excludeEnd("ctx");
  9072. self._assert_equals_($1,$4);
  9073. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9074. $ctx1.sendIdx["assert:equals:"]=1;
  9075. //>>excludeEnd("ctx");
  9076. $6=self._collection();
  9077. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9078. $ctx1.sendIdx["collection"]=4;
  9079. //>>excludeEnd("ctx");
  9080. $7=self._collectionWithNewValue();
  9081. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9082. $ctx1.sendIdx["collectionWithNewValue"]=1;
  9083. //>>excludeEnd("ctx");
  9084. $5=$recv($6).__comma($7);
  9085. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9086. $ctx1.sendIdx[","]=2;
  9087. //>>excludeEnd("ctx");
  9088. $8=self._collectionWithNewValue();
  9089. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9090. $ctx1.sendIdx["collectionWithNewValue"]=2;
  9091. //>>excludeEnd("ctx");
  9092. self._assert_equals_($5,$8);
  9093. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9094. $ctx1.sendIdx["assert:equals:"]=2;
  9095. //>>excludeEnd("ctx");
  9096. $10=self._collectionWithNewValue();
  9097. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9098. $ctx1.sendIdx["collectionWithNewValue"]=3;
  9099. //>>excludeEnd("ctx");
  9100. $9=$recv($10).__comma(self._collection());
  9101. self._assert_equals_($9,self._collectionWithNewValue());
  9102. return self;
  9103. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9104. }, function($ctx1) {$ctx1.fill(self,"testComma",{},$globals.SetTest)});
  9105. //>>excludeEnd("ctx");
  9106. },
  9107. //>>excludeStart("ide", pragmas.excludeIdeData);
  9108. args: [],
  9109. 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",
  9110. referencedClasses: [],
  9111. //>>excludeEnd("ide");
  9112. messageSends: ["testComma", "assert:equals:", ",", "collection", "collectionWithNewValue"]
  9113. }),
  9114. $globals.SetTest);
  9115. $core.addMethod(
  9116. $core.method({
  9117. selector: "testComparing",
  9118. protocol: 'tests',
  9119. fn: function (){
  9120. var self=this;
  9121. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9122. return $core.withContext(function($ctx1) {
  9123. //>>excludeEnd("ctx");
  9124. var $1,$2,$3,$4,$6,$7,$5,$9,$8;
  9125. $1=[(0), (2)]._asSet();
  9126. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9127. $ctx1.sendIdx["asSet"]=1;
  9128. //>>excludeEnd("ctx");
  9129. $2=[(0), (2)]._asSet();
  9130. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9131. $ctx1.sendIdx["asSet"]=2;
  9132. //>>excludeEnd("ctx");
  9133. self._assert_equals_($1,$2);
  9134. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9135. $ctx1.sendIdx["assert:equals:"]=1;
  9136. //>>excludeEnd("ctx");
  9137. $3=[(2), (0)]._asSet();
  9138. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9139. $ctx1.sendIdx["asSet"]=3;
  9140. //>>excludeEnd("ctx");
  9141. $4=[(0), (2)]._asSet();
  9142. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9143. $ctx1.sendIdx["asSet"]=4;
  9144. //>>excludeEnd("ctx");
  9145. self._assert_equals_($3,$4);
  9146. $6=[(0), (2), (3)]._asSet();
  9147. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9148. $ctx1.sendIdx["asSet"]=5;
  9149. //>>excludeEnd("ctx");
  9150. $7=[(0), (2)]._asSet();
  9151. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9152. $ctx1.sendIdx["asSet"]=6;
  9153. //>>excludeEnd("ctx");
  9154. $5=$recv($6).__eq($7);
  9155. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9156. $ctx1.sendIdx["="]=1;
  9157. //>>excludeEnd("ctx");
  9158. self._deny_($5);
  9159. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9160. $ctx1.sendIdx["deny:"]=1;
  9161. //>>excludeEnd("ctx");
  9162. $9=[(1), (2)]._asSet();
  9163. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9164. $ctx1.sendIdx["asSet"]=7;
  9165. //>>excludeEnd("ctx");
  9166. $8=$recv($9).__eq([(0), (2)]._asSet());
  9167. self._deny_($8);
  9168. return self;
  9169. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9170. }, function($ctx1) {$ctx1.fill(self,"testComparing",{},$globals.SetTest)});
  9171. //>>excludeEnd("ctx");
  9172. },
  9173. //>>excludeStart("ide", pragmas.excludeIdeData);
  9174. args: [],
  9175. 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",
  9176. referencedClasses: [],
  9177. //>>excludeEnd("ide");
  9178. messageSends: ["assert:equals:", "asSet", "deny:", "="]
  9179. }),
  9180. $globals.SetTest);
  9181. $core.addMethod(
  9182. $core.method({
  9183. selector: "testPrintString",
  9184. protocol: 'tests',
  9185. fn: function (){
  9186. var self=this;
  9187. var set;
  9188. function $Set(){return $globals.Set||(typeof Set=="undefined"?nil:Set)}
  9189. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9190. return $core.withContext(function($ctx1) {
  9191. //>>excludeEnd("ctx");
  9192. var $1,$2,$3,$4,$5,$6,$7,$8;
  9193. set=$recv($Set())._new();
  9194. $1=$recv(set)._printString();
  9195. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9196. $ctx1.sendIdx["printString"]=1;
  9197. //>>excludeEnd("ctx");
  9198. self._assert_equals_($1,"a Set ()");
  9199. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9200. $ctx1.sendIdx["assert:equals:"]=1;
  9201. //>>excludeEnd("ctx");
  9202. $2=set;
  9203. $recv($2)._add_((1));
  9204. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9205. $ctx1.sendIdx["add:"]=1;
  9206. //>>excludeEnd("ctx");
  9207. $3=$recv($2)._add_((3));
  9208. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9209. $ctx1.sendIdx["add:"]=2;
  9210. //>>excludeEnd("ctx");
  9211. $4=$recv(set)._printString();
  9212. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9213. $ctx1.sendIdx["printString"]=2;
  9214. //>>excludeEnd("ctx");
  9215. self._assert_equals_($4,"a Set (1 3)");
  9216. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9217. $ctx1.sendIdx["assert:equals:"]=2;
  9218. //>>excludeEnd("ctx");
  9219. $recv(set)._add_("foo");
  9220. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9221. $ctx1.sendIdx["add:"]=3;
  9222. //>>excludeEnd("ctx");
  9223. $5=$recv(set)._printString();
  9224. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9225. $ctx1.sendIdx["printString"]=3;
  9226. //>>excludeEnd("ctx");
  9227. self._assert_equals_($5,"a Set (1 3 'foo')");
  9228. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9229. $ctx1.sendIdx["assert:equals:"]=3;
  9230. //>>excludeEnd("ctx");
  9231. $6=set;
  9232. $recv($6)._remove_((1));
  9233. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9234. $ctx1.sendIdx["remove:"]=1;
  9235. //>>excludeEnd("ctx");
  9236. $recv($6)._remove_((3));
  9237. $7=$recv(set)._printString();
  9238. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9239. $ctx1.sendIdx["printString"]=4;
  9240. //>>excludeEnd("ctx");
  9241. self._assert_equals_($7,"a Set ('foo')");
  9242. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9243. $ctx1.sendIdx["assert:equals:"]=4;
  9244. //>>excludeEnd("ctx");
  9245. $recv(set)._add_((3));
  9246. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9247. $ctx1.sendIdx["add:"]=4;
  9248. //>>excludeEnd("ctx");
  9249. $8=$recv(set)._printString();
  9250. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9251. $ctx1.sendIdx["printString"]=5;
  9252. //>>excludeEnd("ctx");
  9253. self._assert_equals_($8,"a Set (3 'foo')");
  9254. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9255. $ctx1.sendIdx["assert:equals:"]=5;
  9256. //>>excludeEnd("ctx");
  9257. $recv(set)._add_((3));
  9258. self._assert_equals_($recv(set)._printString(),"a Set (3 'foo')");
  9259. return self;
  9260. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9261. }, function($ctx1) {$ctx1.fill(self,"testPrintString",{set:set},$globals.SetTest)});
  9262. //>>excludeEnd("ctx");
  9263. },
  9264. //>>excludeStart("ide", pragmas.excludeIdeData);
  9265. args: [],
  9266. 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'')'",
  9267. referencedClasses: ["Set"],
  9268. //>>excludeEnd("ide");
  9269. messageSends: ["new", "assert:equals:", "printString", "add:", "remove:"]
  9270. }),
  9271. $globals.SetTest);
  9272. $core.addMethod(
  9273. $core.method({
  9274. selector: "testUnboxedObjects",
  9275. protocol: 'tests',
  9276. fn: function (){
  9277. var self=this;
  9278. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9279. return $core.withContext(function($ctx1) {
  9280. //>>excludeEnd("ctx");
  9281. var $4,$3,$2,$1;
  9282. $4="foo"._yourself();
  9283. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9284. $ctx1.sendIdx["yourself"]=1;
  9285. //>>excludeEnd("ctx");
  9286. $3=[$4,"foo"._yourself()];
  9287. $2=$recv($3)._asSet();
  9288. $1=$recv($2)._asArray();
  9289. self._assert_equals_($1,["foo"]);
  9290. return self;
  9291. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9292. }, function($ctx1) {$ctx1.fill(self,"testUnboxedObjects",{},$globals.SetTest)});
  9293. //>>excludeEnd("ctx");
  9294. },
  9295. //>>excludeStart("ide", pragmas.excludeIdeData);
  9296. args: [],
  9297. source: "testUnboxedObjects\x0a\x09self assert: {'foo' yourself. 'foo' yourself} asSet asArray equals: #('foo')",
  9298. referencedClasses: [],
  9299. //>>excludeEnd("ide");
  9300. messageSends: ["assert:equals:", "asArray", "asSet", "yourself"]
  9301. }),
  9302. $globals.SetTest);
  9303. $core.addMethod(
  9304. $core.method({
  9305. selector: "testUnicity",
  9306. protocol: 'tests',
  9307. fn: function (){
  9308. var self=this;
  9309. var set;
  9310. function $Set(){return $globals.Set||(typeof Set=="undefined"?nil:Set)}
  9311. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9312. return $core.withContext(function($ctx1) {
  9313. //>>excludeEnd("ctx");
  9314. var $1;
  9315. set=$recv($Set())._new();
  9316. $recv(set)._add_((21));
  9317. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9318. $ctx1.sendIdx["add:"]=1;
  9319. //>>excludeEnd("ctx");
  9320. $recv(set)._add_("hello");
  9321. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9322. $ctx1.sendIdx["add:"]=2;
  9323. //>>excludeEnd("ctx");
  9324. $recv(set)._add_((21));
  9325. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9326. $ctx1.sendIdx["add:"]=3;
  9327. //>>excludeEnd("ctx");
  9328. $1=$recv(set)._size();
  9329. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9330. $ctx1.sendIdx["size"]=1;
  9331. //>>excludeEnd("ctx");
  9332. self._assert_equals_($1,(2));
  9333. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9334. $ctx1.sendIdx["assert:equals:"]=1;
  9335. //>>excludeEnd("ctx");
  9336. $recv(set)._add_("hello");
  9337. self._assert_equals_($recv(set)._size(),(2));
  9338. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9339. $ctx1.sendIdx["assert:equals:"]=2;
  9340. //>>excludeEnd("ctx");
  9341. self._assert_equals_($recv(set)._asArray(),[(21), "hello"]);
  9342. return self;
  9343. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9344. }, function($ctx1) {$ctx1.fill(self,"testUnicity",{set:set},$globals.SetTest)});
  9345. //>>excludeEnd("ctx");
  9346. },
  9347. //>>excludeStart("ide", pragmas.excludeIdeData);
  9348. args: [],
  9349. 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')",
  9350. referencedClasses: ["Set"],
  9351. //>>excludeEnd("ide");
  9352. messageSends: ["new", "add:", "assert:equals:", "size", "asArray"]
  9353. }),
  9354. $globals.SetTest);
  9355. $core.addMethod(
  9356. $core.method({
  9357. selector: "collectionClass",
  9358. protocol: 'fixture',
  9359. fn: function (){
  9360. var self=this;
  9361. function $Set(){return $globals.Set||(typeof Set=="undefined"?nil:Set)}
  9362. return $Set();
  9363. },
  9364. //>>excludeStart("ide", pragmas.excludeIdeData);
  9365. args: [],
  9366. source: "collectionClass\x0a\x09^ Set",
  9367. referencedClasses: ["Set"],
  9368. //>>excludeEnd("ide");
  9369. messageSends: []
  9370. }),
  9371. $globals.SetTest.klass);
  9372. $core.addClass('ConsoleTranscriptTest', $globals.TestCase, [], 'Kernel-Tests');
  9373. $core.addMethod(
  9374. $core.method({
  9375. selector: "testShow",
  9376. protocol: 'tests',
  9377. fn: function (){
  9378. var self=this;
  9379. var originalTranscript;
  9380. function $Transcript(){return $globals.Transcript||(typeof Transcript=="undefined"?nil:Transcript)}
  9381. function $ConsoleTranscript(){return $globals.ConsoleTranscript||(typeof ConsoleTranscript=="undefined"?nil:ConsoleTranscript)}
  9382. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  9383. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9384. return $core.withContext(function($ctx1) {
  9385. //>>excludeEnd("ctx");
  9386. originalTranscript=$recv($Transcript())._current();
  9387. $recv($Transcript())._register_($recv($ConsoleTranscript())._new());
  9388. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9389. $ctx1.sendIdx["register:"]=1;
  9390. //>>excludeEnd("ctx");
  9391. self._shouldnt_raise_((function(){
  9392. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9393. return $core.withContext(function($ctx2) {
  9394. //>>excludeEnd("ctx");
  9395. return $recv($Transcript())._show_("Hello console!");
  9396. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9397. $ctx2.sendIdx["show:"]=1;
  9398. //>>excludeEnd("ctx");
  9399. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9400. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  9401. //>>excludeEnd("ctx");
  9402. }),$Error());
  9403. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9404. $ctx1.sendIdx["shouldnt:raise:"]=1;
  9405. //>>excludeEnd("ctx");
  9406. self._shouldnt_raise_((function(){
  9407. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9408. return $core.withContext(function($ctx2) {
  9409. //>>excludeEnd("ctx");
  9410. return $recv($Transcript())._show_(console);
  9411. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9412. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  9413. //>>excludeEnd("ctx");
  9414. }),$Error());
  9415. $recv($Transcript())._register_(originalTranscript);
  9416. return self;
  9417. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9418. }, function($ctx1) {$ctx1.fill(self,"testShow",{originalTranscript:originalTranscript},$globals.ConsoleTranscriptTest)});
  9419. //>>excludeEnd("ctx");
  9420. },
  9421. //>>excludeStart("ide", pragmas.excludeIdeData);
  9422. args: [],
  9423. 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.",
  9424. referencedClasses: ["Transcript", "ConsoleTranscript", "Error"],
  9425. //>>excludeEnd("ide");
  9426. messageSends: ["current", "register:", "new", "shouldnt:raise:", "show:"]
  9427. }),
  9428. $globals.ConsoleTranscriptTest);
  9429. $core.addClass('DateTest', $globals.TestCase, [], 'Kernel-Tests');
  9430. $core.addMethod(
  9431. $core.method({
  9432. selector: "testEquality",
  9433. protocol: 'tests',
  9434. fn: function (){
  9435. var self=this;
  9436. var now;
  9437. function $Date(){return $globals.Date||(typeof Date=="undefined"?nil:Date)}
  9438. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9439. return $core.withContext(function($ctx1) {
  9440. //>>excludeEnd("ctx");
  9441. var $1,$3,$4,$2,$6,$7,$5,$9,$11,$10,$8;
  9442. now=$recv($Date())._new();
  9443. $1=$recv(now).__eq(now);
  9444. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9445. $ctx1.sendIdx["="]=1;
  9446. //>>excludeEnd("ctx");
  9447. self._assert_($1);
  9448. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9449. $ctx1.sendIdx["assert:"]=1;
  9450. //>>excludeEnd("ctx");
  9451. $3=now;
  9452. $4=$recv($Date())._fromMilliseconds_((0));
  9453. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9454. $ctx1.sendIdx["fromMilliseconds:"]=1;
  9455. //>>excludeEnd("ctx");
  9456. $2=$recv($3).__eq($4);
  9457. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9458. $ctx1.sendIdx["="]=2;
  9459. //>>excludeEnd("ctx");
  9460. self._deny_($2);
  9461. $6=$recv($Date())._fromMilliseconds_((12345678));
  9462. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9463. $ctx1.sendIdx["fromMilliseconds:"]=2;
  9464. //>>excludeEnd("ctx");
  9465. $7=$recv($Date())._fromMilliseconds_((12345678));
  9466. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9467. $ctx1.sendIdx["fromMilliseconds:"]=3;
  9468. //>>excludeEnd("ctx");
  9469. $5=$recv($6).__eq($7);
  9470. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9471. $ctx1.sendIdx["="]=3;
  9472. //>>excludeEnd("ctx");
  9473. self._assert_($5);
  9474. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9475. $ctx1.sendIdx["assert:"]=2;
  9476. //>>excludeEnd("ctx");
  9477. $9=now;
  9478. $11=$recv(now)._asMilliseconds();
  9479. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9480. $ctx1.sendIdx["asMilliseconds"]=1;
  9481. //>>excludeEnd("ctx");
  9482. $10=$recv($Date())._fromMilliseconds_($11);
  9483. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9484. $ctx1.sendIdx["fromMilliseconds:"]=4;
  9485. //>>excludeEnd("ctx");
  9486. $8=$recv($9).__eq($10);
  9487. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9488. $ctx1.sendIdx["="]=4;
  9489. //>>excludeEnd("ctx");
  9490. self._assert_($8);
  9491. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9492. $ctx1.sendIdx["assert:"]=3;
  9493. //>>excludeEnd("ctx");
  9494. self._assert_($recv($recv($Date())._fromMilliseconds_($recv(now)._asMilliseconds())).__eq(now));
  9495. return self;
  9496. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9497. }, function($ctx1) {$ctx1.fill(self,"testEquality",{now:now},$globals.DateTest)});
  9498. //>>excludeEnd("ctx");
  9499. },
  9500. //>>excludeStart("ide", pragmas.excludeIdeData);
  9501. args: [],
  9502. source: "testEquality\x0a\x09| now |\x0a\x09now := Date new.\x0a\x0a\x09self assert: now = now.\x0a\x0a\x09self deny: now = (Date fromMilliseconds: 0).\x0a\x0a\x09self assert: (Date fromMilliseconds: 12345678) = (Date fromMilliseconds: 12345678).\x0a\x09self assert: now = (Date fromMilliseconds: now asMilliseconds).\x0a\x09self assert: (Date fromMilliseconds: now asMilliseconds) = now",
  9503. referencedClasses: ["Date"],
  9504. //>>excludeEnd("ide");
  9505. messageSends: ["new", "assert:", "=", "deny:", "fromMilliseconds:", "asMilliseconds"]
  9506. }),
  9507. $globals.DateTest);
  9508. $core.addMethod(
  9509. $core.method({
  9510. selector: "testIdentity",
  9511. protocol: 'tests',
  9512. fn: function (){
  9513. var self=this;
  9514. var now;
  9515. function $Date(){return $globals.Date||(typeof Date=="undefined"?nil:Date)}
  9516. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9517. return $core.withContext(function($ctx1) {
  9518. //>>excludeEnd("ctx");
  9519. var $1,$3,$4,$2,$6,$7,$5,$9,$11,$10,$8;
  9520. now=$recv($Date())._new();
  9521. $1=$recv(now).__eq_eq(now);
  9522. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9523. $ctx1.sendIdx["=="]=1;
  9524. //>>excludeEnd("ctx");
  9525. self._assert_($1);
  9526. $3=now;
  9527. $4=$recv($Date())._fromMilliseconds_((0));
  9528. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9529. $ctx1.sendIdx["fromMilliseconds:"]=1;
  9530. //>>excludeEnd("ctx");
  9531. $2=$recv($3).__eq_eq($4);
  9532. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9533. $ctx1.sendIdx["=="]=2;
  9534. //>>excludeEnd("ctx");
  9535. self._deny_($2);
  9536. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9537. $ctx1.sendIdx["deny:"]=1;
  9538. //>>excludeEnd("ctx");
  9539. $6=$recv($Date())._fromMilliseconds_((12345678));
  9540. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9541. $ctx1.sendIdx["fromMilliseconds:"]=2;
  9542. //>>excludeEnd("ctx");
  9543. $7=$recv($Date())._fromMilliseconds_((12345678));
  9544. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9545. $ctx1.sendIdx["fromMilliseconds:"]=3;
  9546. //>>excludeEnd("ctx");
  9547. $5=$recv($6).__eq_eq($7);
  9548. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9549. $ctx1.sendIdx["=="]=3;
  9550. //>>excludeEnd("ctx");
  9551. self._deny_($5);
  9552. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9553. $ctx1.sendIdx["deny:"]=2;
  9554. //>>excludeEnd("ctx");
  9555. $9=now;
  9556. $11=$recv(now)._asMilliseconds();
  9557. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9558. $ctx1.sendIdx["asMilliseconds"]=1;
  9559. //>>excludeEnd("ctx");
  9560. $10=$recv($Date())._fromMilliseconds_($11);
  9561. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9562. $ctx1.sendIdx["fromMilliseconds:"]=4;
  9563. //>>excludeEnd("ctx");
  9564. $8=$recv($9).__eq_eq($10);
  9565. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9566. $ctx1.sendIdx["=="]=4;
  9567. //>>excludeEnd("ctx");
  9568. self._deny_($8);
  9569. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9570. $ctx1.sendIdx["deny:"]=3;
  9571. //>>excludeEnd("ctx");
  9572. self._deny_($recv($recv($Date())._fromMilliseconds_($recv(now)._asMilliseconds())).__eq_eq(now));
  9573. return self;
  9574. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9575. }, function($ctx1) {$ctx1.fill(self,"testIdentity",{now:now},$globals.DateTest)});
  9576. //>>excludeEnd("ctx");
  9577. },
  9578. //>>excludeStart("ide", pragmas.excludeIdeData);
  9579. args: [],
  9580. source: "testIdentity\x0a\x09| now |\x0a\x09now := Date new.\x0a\x0a\x09self assert: now == now.\x0a\x0a\x09self deny: now == (Date fromMilliseconds: 0).\x0a\x0a\x09self deny: (Date fromMilliseconds: 12345678) == (Date fromMilliseconds: 12345678).\x0a\x09self deny: now == (Date fromMilliseconds: now asMilliseconds).\x0a\x09self deny: (Date fromMilliseconds: now asMilliseconds) == now",
  9581. referencedClasses: ["Date"],
  9582. //>>excludeEnd("ide");
  9583. messageSends: ["new", "assert:", "==", "deny:", "fromMilliseconds:", "asMilliseconds"]
  9584. }),
  9585. $globals.DateTest);
  9586. $core.addClass('JSObjectProxyTest', $globals.TestCase, [], 'Kernel-Tests');
  9587. $core.addMethod(
  9588. $core.method({
  9589. selector: "jsNull",
  9590. protocol: 'accessing',
  9591. fn: function (){
  9592. var self=this;
  9593. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9594. return $core.withContext(function($ctx1) {
  9595. //>>excludeEnd("ctx");
  9596. return null;
  9597. return self;
  9598. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9599. }, function($ctx1) {$ctx1.fill(self,"jsNull",{},$globals.JSObjectProxyTest)});
  9600. //>>excludeEnd("ctx");
  9601. },
  9602. //>>excludeStart("ide", pragmas.excludeIdeData);
  9603. args: [],
  9604. source: "jsNull\x0a\x09<return null>",
  9605. referencedClasses: [],
  9606. //>>excludeEnd("ide");
  9607. messageSends: []
  9608. }),
  9609. $globals.JSObjectProxyTest);
  9610. $core.addMethod(
  9611. $core.method({
  9612. selector: "jsObject",
  9613. protocol: 'accessing',
  9614. fn: function (){
  9615. var self=this;
  9616. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9617. return $core.withContext(function($ctx1) {
  9618. //>>excludeEnd("ctx");
  9619. return {a: 1, b: function() {return 2;}, c: function(object) {return object;}, d: '', 'e': null, 'f': void 0};
  9620. return self;
  9621. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9622. }, function($ctx1) {$ctx1.fill(self,"jsObject",{},$globals.JSObjectProxyTest)});
  9623. //>>excludeEnd("ctx");
  9624. },
  9625. //>>excludeStart("ide", pragmas.excludeIdeData);
  9626. args: [],
  9627. source: "jsObject\x0a\x09<return {a: 1, b: function() {return 2;}, c: function(object) {return object;}, d: '', 'e': null, 'f': void 0}>",
  9628. referencedClasses: [],
  9629. //>>excludeEnd("ide");
  9630. messageSends: []
  9631. }),
  9632. $globals.JSObjectProxyTest);
  9633. $core.addMethod(
  9634. $core.method({
  9635. selector: "jsUndefined",
  9636. protocol: 'accessing',
  9637. fn: function (){
  9638. var self=this;
  9639. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9640. return $core.withContext(function($ctx1) {
  9641. //>>excludeEnd("ctx");
  9642. return;
  9643. return self;
  9644. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9645. }, function($ctx1) {$ctx1.fill(self,"jsUndefined",{},$globals.JSObjectProxyTest)});
  9646. //>>excludeEnd("ctx");
  9647. },
  9648. //>>excludeStart("ide", pragmas.excludeIdeData);
  9649. args: [],
  9650. source: "jsUndefined\x0a\x09<return>",
  9651. referencedClasses: [],
  9652. //>>excludeEnd("ide");
  9653. messageSends: []
  9654. }),
  9655. $globals.JSObjectProxyTest);
  9656. $core.addMethod(
  9657. $core.method({
  9658. selector: "testAtIfAbsent",
  9659. protocol: 'tests',
  9660. fn: function (){
  9661. var self=this;
  9662. var testObject;
  9663. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9664. return $core.withContext(function($ctx1) {
  9665. //>>excludeEnd("ctx");
  9666. var $1,$2,$3;
  9667. testObject=self._jsObject();
  9668. $1=$recv(testObject)._at_ifAbsent_("abc",(function(){
  9669. return "Property does not exist";
  9670. }));
  9671. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9672. $ctx1.sendIdx["at:ifAbsent:"]=1;
  9673. //>>excludeEnd("ctx");
  9674. self._assert_equals_($1,"Property does not exist");
  9675. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9676. $ctx1.sendIdx["assert:equals:"]=1;
  9677. //>>excludeEnd("ctx");
  9678. $2=$recv(testObject)._at_ifAbsent_("e",(function(){
  9679. return "Property does not exist";
  9680. }));
  9681. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9682. $ctx1.sendIdx["at:ifAbsent:"]=2;
  9683. //>>excludeEnd("ctx");
  9684. self._assert_equals_($2,nil);
  9685. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9686. $ctx1.sendIdx["assert:equals:"]=2;
  9687. //>>excludeEnd("ctx");
  9688. $3=$recv(testObject)._at_ifAbsent_("a",(function(){
  9689. return "Property does not exist";
  9690. }));
  9691. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9692. $ctx1.sendIdx["at:ifAbsent:"]=3;
  9693. //>>excludeEnd("ctx");
  9694. self._assert_equals_($3,(1));
  9695. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9696. $ctx1.sendIdx["assert:equals:"]=3;
  9697. //>>excludeEnd("ctx");
  9698. self._assert_equals_($recv(testObject)._at_ifAbsent_("f",(function(){
  9699. return "Property does not exist";
  9700. })),nil);
  9701. return self;
  9702. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9703. }, function($ctx1) {$ctx1.fill(self,"testAtIfAbsent",{testObject:testObject},$globals.JSObjectProxyTest)});
  9704. //>>excludeEnd("ctx");
  9705. },
  9706. //>>excludeStart("ide", pragmas.excludeIdeData);
  9707. args: [],
  9708. 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.",
  9709. referencedClasses: [],
  9710. //>>excludeEnd("ide");
  9711. messageSends: ["jsObject", "assert:equals:", "at:ifAbsent:"]
  9712. }),
  9713. $globals.JSObjectProxyTest);
  9714. $core.addMethod(
  9715. $core.method({
  9716. selector: "testAtIfPresent",
  9717. protocol: 'tests',
  9718. fn: function (){
  9719. var self=this;
  9720. var testObject;
  9721. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9722. return $core.withContext(function($ctx1) {
  9723. //>>excludeEnd("ctx");
  9724. var $2,$1,$4,$3,$6,$5;
  9725. testObject=self._jsObject();
  9726. $1=$recv(testObject)._at_ifPresent_("abc",(function(x){
  9727. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9728. return $core.withContext(function($ctx2) {
  9729. //>>excludeEnd("ctx");
  9730. $2=$recv(x)._asString();
  9731. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9732. $ctx2.sendIdx["asString"]=1;
  9733. //>>excludeEnd("ctx");
  9734. return "hello ".__comma($2);
  9735. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9736. $ctx2.sendIdx[","]=1;
  9737. //>>excludeEnd("ctx");
  9738. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9739. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)});
  9740. //>>excludeEnd("ctx");
  9741. }));
  9742. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9743. $ctx1.sendIdx["at:ifPresent:"]=1;
  9744. //>>excludeEnd("ctx");
  9745. self._assert_equals_($1,nil);
  9746. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9747. $ctx1.sendIdx["assert:equals:"]=1;
  9748. //>>excludeEnd("ctx");
  9749. $3=$recv(testObject)._at_ifPresent_("e",(function(x){
  9750. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9751. return $core.withContext(function($ctx2) {
  9752. //>>excludeEnd("ctx");
  9753. $4=$recv(x)._asString();
  9754. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9755. $ctx2.sendIdx["asString"]=2;
  9756. //>>excludeEnd("ctx");
  9757. return "hello ".__comma($4);
  9758. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9759. $ctx2.sendIdx[","]=2;
  9760. //>>excludeEnd("ctx");
  9761. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9762. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,2)});
  9763. //>>excludeEnd("ctx");
  9764. }));
  9765. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9766. $ctx1.sendIdx["at:ifPresent:"]=2;
  9767. //>>excludeEnd("ctx");
  9768. self._assert_equals_($3,"hello nil");
  9769. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9770. $ctx1.sendIdx["assert:equals:"]=2;
  9771. //>>excludeEnd("ctx");
  9772. $5=$recv(testObject)._at_ifPresent_("a",(function(x){
  9773. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9774. return $core.withContext(function($ctx2) {
  9775. //>>excludeEnd("ctx");
  9776. $6=$recv(x)._asString();
  9777. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9778. $ctx2.sendIdx["asString"]=3;
  9779. //>>excludeEnd("ctx");
  9780. return "hello ".__comma($6);
  9781. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9782. $ctx2.sendIdx[","]=3;
  9783. //>>excludeEnd("ctx");
  9784. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9785. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,3)});
  9786. //>>excludeEnd("ctx");
  9787. }));
  9788. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9789. $ctx1.sendIdx["at:ifPresent:"]=3;
  9790. //>>excludeEnd("ctx");
  9791. self._assert_equals_($5,"hello 1");
  9792. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9793. $ctx1.sendIdx["assert:equals:"]=3;
  9794. //>>excludeEnd("ctx");
  9795. self._assert_equals_($recv(testObject)._at_ifPresent_("f",(function(x){
  9796. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9797. return $core.withContext(function($ctx2) {
  9798. //>>excludeEnd("ctx");
  9799. return "hello ".__comma($recv(x)._asString());
  9800. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9801. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,4)});
  9802. //>>excludeEnd("ctx");
  9803. })),"hello nil");
  9804. return self;
  9805. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9806. }, function($ctx1) {$ctx1.fill(self,"testAtIfPresent",{testObject:testObject},$globals.JSObjectProxyTest)});
  9807. //>>excludeEnd("ctx");
  9808. },
  9809. //>>excludeStart("ide", pragmas.excludeIdeData);
  9810. args: [],
  9811. 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'.",
  9812. referencedClasses: [],
  9813. //>>excludeEnd("ide");
  9814. messageSends: ["jsObject", "assert:equals:", "at:ifPresent:", ",", "asString"]
  9815. }),
  9816. $globals.JSObjectProxyTest);
  9817. $core.addMethod(
  9818. $core.method({
  9819. selector: "testAtIfPresentIfAbsent",
  9820. protocol: 'tests',
  9821. fn: function (){
  9822. var self=this;
  9823. var testObject;
  9824. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9825. return $core.withContext(function($ctx1) {
  9826. //>>excludeEnd("ctx");
  9827. var $2,$1,$4,$3,$6,$5;
  9828. testObject=self._jsObject();
  9829. $1=$recv(testObject)._at_ifPresent_ifAbsent_("abc",(function(x){
  9830. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9831. return $core.withContext(function($ctx2) {
  9832. //>>excludeEnd("ctx");
  9833. $2=$recv(x)._asString();
  9834. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9835. $ctx2.sendIdx["asString"]=1;
  9836. //>>excludeEnd("ctx");
  9837. return "hello ".__comma($2);
  9838. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9839. $ctx2.sendIdx[","]=1;
  9840. //>>excludeEnd("ctx");
  9841. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9842. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)});
  9843. //>>excludeEnd("ctx");
  9844. }),(function(){
  9845. return "not present";
  9846. }));
  9847. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9848. $ctx1.sendIdx["at:ifPresent:ifAbsent:"]=1;
  9849. //>>excludeEnd("ctx");
  9850. self._assert_equals_($1,"not present");
  9851. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9852. $ctx1.sendIdx["assert:equals:"]=1;
  9853. //>>excludeEnd("ctx");
  9854. $3=$recv(testObject)._at_ifPresent_ifAbsent_("e",(function(x){
  9855. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9856. return $core.withContext(function($ctx2) {
  9857. //>>excludeEnd("ctx");
  9858. $4=$recv(x)._asString();
  9859. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9860. $ctx2.sendIdx["asString"]=2;
  9861. //>>excludeEnd("ctx");
  9862. return "hello ".__comma($4);
  9863. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9864. $ctx2.sendIdx[","]=2;
  9865. //>>excludeEnd("ctx");
  9866. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9867. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,3)});
  9868. //>>excludeEnd("ctx");
  9869. }),(function(){
  9870. return "not present";
  9871. }));
  9872. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9873. $ctx1.sendIdx["at:ifPresent:ifAbsent:"]=2;
  9874. //>>excludeEnd("ctx");
  9875. self._assert_equals_($3,"hello nil");
  9876. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9877. $ctx1.sendIdx["assert:equals:"]=2;
  9878. //>>excludeEnd("ctx");
  9879. $5=$recv(testObject)._at_ifPresent_ifAbsent_("a",(function(x){
  9880. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9881. return $core.withContext(function($ctx2) {
  9882. //>>excludeEnd("ctx");
  9883. $6=$recv(x)._asString();
  9884. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9885. $ctx2.sendIdx["asString"]=3;
  9886. //>>excludeEnd("ctx");
  9887. return "hello ".__comma($6);
  9888. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9889. $ctx2.sendIdx[","]=3;
  9890. //>>excludeEnd("ctx");
  9891. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9892. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,5)});
  9893. //>>excludeEnd("ctx");
  9894. }),(function(){
  9895. return "not present";
  9896. }));
  9897. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9898. $ctx1.sendIdx["at:ifPresent:ifAbsent:"]=3;
  9899. //>>excludeEnd("ctx");
  9900. self._assert_equals_($5,"hello 1");
  9901. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9902. $ctx1.sendIdx["assert:equals:"]=3;
  9903. //>>excludeEnd("ctx");
  9904. self._assert_equals_($recv(testObject)._at_ifPresent_ifAbsent_("f",(function(x){
  9905. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9906. return $core.withContext(function($ctx2) {
  9907. //>>excludeEnd("ctx");
  9908. return "hello ".__comma($recv(x)._asString());
  9909. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9910. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,7)});
  9911. //>>excludeEnd("ctx");
  9912. }),(function(){
  9913. return "not present";
  9914. })),"hello nil");
  9915. return self;
  9916. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9917. }, function($ctx1) {$ctx1.fill(self,"testAtIfPresentIfAbsent",{testObject:testObject},$globals.JSObjectProxyTest)});
  9918. //>>excludeEnd("ctx");
  9919. },
  9920. //>>excludeStart("ide", pragmas.excludeIdeData);
  9921. args: [],
  9922. 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'.",
  9923. referencedClasses: [],
  9924. //>>excludeEnd("ide");
  9925. messageSends: ["jsObject", "assert:equals:", "at:ifPresent:ifAbsent:", ",", "asString"]
  9926. }),
  9927. $globals.JSObjectProxyTest);
  9928. $core.addMethod(
  9929. $core.method({
  9930. selector: "testAtPut",
  9931. protocol: 'tests',
  9932. fn: function (){
  9933. var self=this;
  9934. var testObject;
  9935. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9936. return $core.withContext(function($ctx1) {
  9937. //>>excludeEnd("ctx");
  9938. var $2,$1;
  9939. testObject=self._jsObject();
  9940. $2=$recv(testObject)._at_("abc");
  9941. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9942. $ctx1.sendIdx["at:"]=1;
  9943. //>>excludeEnd("ctx");
  9944. $1=$recv($2).__tild_eq("xyz");
  9945. self._assert_($1);
  9946. self._assert_equals_($recv(testObject)._at_put_("abc","xyz"),"xyz");
  9947. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9948. $ctx1.sendIdx["assert:equals:"]=1;
  9949. //>>excludeEnd("ctx");
  9950. self._assert_equals_($recv(testObject)._at_("abc"),"xyz");
  9951. return self;
  9952. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9953. }, function($ctx1) {$ctx1.fill(self,"testAtPut",{testObject:testObject},$globals.JSObjectProxyTest)});
  9954. //>>excludeEnd("ctx");
  9955. },
  9956. //>>excludeStart("ide", pragmas.excludeIdeData);
  9957. args: [],
  9958. 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'",
  9959. referencedClasses: [],
  9960. //>>excludeEnd("ide");
  9961. messageSends: ["jsObject", "assert:", "~=", "at:", "assert:equals:", "at:put:"]
  9962. }),
  9963. $globals.JSObjectProxyTest);
  9964. $core.addMethod(
  9965. $core.method({
  9966. selector: "testComparison",
  9967. protocol: 'tests',
  9968. fn: function (){
  9969. var self=this;
  9970. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  9971. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9972. return $core.withContext(function($ctx1) {
  9973. //>>excludeEnd("ctx");
  9974. var $1,$2;
  9975. self._assert_equals_($recv([console,(2)])._indexOf_(console),(1));
  9976. $1=$recv(console).__eq(console);
  9977. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9978. $ctx1.sendIdx["="]=1;
  9979. //>>excludeEnd("ctx");
  9980. self._assert_($1);
  9981. $2=$recv(console).__eq($recv($Object())._new());
  9982. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9983. $ctx1.sendIdx["="]=2;
  9984. //>>excludeEnd("ctx");
  9985. self._deny_($2);
  9986. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9987. $ctx1.sendIdx["deny:"]=1;
  9988. //>>excludeEnd("ctx");
  9989. self._deny_($recv(console).__eq(self._jsObject()));
  9990. return self;
  9991. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9992. }, function($ctx1) {$ctx1.fill(self,"testComparison",{},$globals.JSObjectProxyTest)});
  9993. //>>excludeEnd("ctx");
  9994. },
  9995. //>>excludeStart("ide", pragmas.excludeIdeData);
  9996. args: [],
  9997. 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",
  9998. referencedClasses: ["Object"],
  9999. //>>excludeEnd("ide");
  10000. messageSends: ["assert:equals:", "indexOf:", "assert:", "=", "deny:", "new", "jsObject"]
  10001. }),
  10002. $globals.JSObjectProxyTest);
  10003. $core.addMethod(
  10004. $core.method({
  10005. selector: "testDNU",
  10006. protocol: 'tests',
  10007. fn: function (){
  10008. var self=this;
  10009. function $MessageNotUnderstood(){return $globals.MessageNotUnderstood||(typeof MessageNotUnderstood=="undefined"?nil:MessageNotUnderstood)}
  10010. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10011. return $core.withContext(function($ctx1) {
  10012. //>>excludeEnd("ctx");
  10013. self._should_raise_((function(){
  10014. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10015. return $core.withContext(function($ctx2) {
  10016. //>>excludeEnd("ctx");
  10017. return $recv(self._jsObject())._foo();
  10018. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10019. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  10020. //>>excludeEnd("ctx");
  10021. }),$MessageNotUnderstood());
  10022. return self;
  10023. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10024. }, function($ctx1) {$ctx1.fill(self,"testDNU",{},$globals.JSObjectProxyTest)});
  10025. //>>excludeEnd("ctx");
  10026. },
  10027. //>>excludeStart("ide", pragmas.excludeIdeData);
  10028. args: [],
  10029. source: "testDNU\x0a\x09self should: [ self jsObject foo ] raise: MessageNotUnderstood",
  10030. referencedClasses: ["MessageNotUnderstood"],
  10031. //>>excludeEnd("ide");
  10032. messageSends: ["should:raise:", "foo", "jsObject"]
  10033. }),
  10034. $globals.JSObjectProxyTest);
  10035. $core.addMethod(
  10036. $core.method({
  10037. selector: "testDNURegression1057",
  10038. protocol: 'tests',
  10039. fn: function (){
  10040. var self=this;
  10041. var jsObject;
  10042. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  10043. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10044. return $core.withContext(function($ctx1) {
  10045. //>>excludeEnd("ctx");
  10046. var $1;
  10047. jsObject=[];
  10048. $recv(jsObject)._basicAt_put_("allowJavaScriptCalls",true);
  10049. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10050. $ctx1.sendIdx["basicAt:put:"]=1;
  10051. //>>excludeEnd("ctx");
  10052. $recv(jsObject)._basicAt_put_("foo",(3));
  10053. self._shouldnt_raise_((function(){
  10054. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10055. return $core.withContext(function($ctx2) {
  10056. //>>excludeEnd("ctx");
  10057. return $recv(jsObject)._foo();
  10058. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10059. $ctx2.sendIdx["foo"]=1;
  10060. //>>excludeEnd("ctx");
  10061. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10062. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  10063. //>>excludeEnd("ctx");
  10064. }),$Error());
  10065. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10066. $ctx1.sendIdx["shouldnt:raise:"]=1;
  10067. //>>excludeEnd("ctx");
  10068. $1=$recv(jsObject)._foo();
  10069. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10070. $ctx1.sendIdx["foo"]=2;
  10071. //>>excludeEnd("ctx");
  10072. self._assert_equals_($1,(3));
  10073. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10074. $ctx1.sendIdx["assert:equals:"]=1;
  10075. //>>excludeEnd("ctx");
  10076. self._shouldnt_raise_((function(){
  10077. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10078. return $core.withContext(function($ctx2) {
  10079. //>>excludeEnd("ctx");
  10080. return $recv(jsObject)._foo_((4));
  10081. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10082. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  10083. //>>excludeEnd("ctx");
  10084. }),$Error());
  10085. self._assert_equals_($recv(jsObject)._foo(),(4));
  10086. return self;
  10087. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10088. }, function($ctx1) {$ctx1.fill(self,"testDNURegression1057",{jsObject:jsObject},$globals.JSObjectProxyTest)});
  10089. //>>excludeEnd("ctx");
  10090. },
  10091. //>>excludeStart("ide", pragmas.excludeIdeData);
  10092. args: [],
  10093. 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",
  10094. referencedClasses: ["Error"],
  10095. //>>excludeEnd("ide");
  10096. messageSends: ["basicAt:put:", "shouldnt:raise:", "foo", "assert:equals:", "foo:"]
  10097. }),
  10098. $globals.JSObjectProxyTest);
  10099. $core.addMethod(
  10100. $core.method({
  10101. selector: "testDNURegression1059",
  10102. protocol: 'tests',
  10103. fn: function (){
  10104. var self=this;
  10105. var jsObject;
  10106. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  10107. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10108. return $core.withContext(function($ctx1) {
  10109. //>>excludeEnd("ctx");
  10110. jsObject=[];
  10111. $recv(jsObject)._basicAt_put_("allowJavaScriptCalls",true);
  10112. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10113. $ctx1.sendIdx["basicAt:put:"]=1;
  10114. //>>excludeEnd("ctx");
  10115. $recv(jsObject)._basicAt_put_("x",(3));
  10116. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10117. $ctx1.sendIdx["basicAt:put:"]=2;
  10118. //>>excludeEnd("ctx");
  10119. $recv(jsObject)._basicAt_put_("x:",(function(){
  10120. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10121. return $core.withContext(function($ctx2) {
  10122. //>>excludeEnd("ctx");
  10123. return self._error();
  10124. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10125. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  10126. //>>excludeEnd("ctx");
  10127. }));
  10128. self._shouldnt_raise_((function(){
  10129. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10130. return $core.withContext(function($ctx2) {
  10131. //>>excludeEnd("ctx");
  10132. return $recv(jsObject)._x_((4));
  10133. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10134. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  10135. //>>excludeEnd("ctx");
  10136. }),$Error());
  10137. self._assert_equals_($recv(jsObject)._x(),(4));
  10138. return self;
  10139. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10140. }, function($ctx1) {$ctx1.fill(self,"testDNURegression1059",{jsObject:jsObject},$globals.JSObjectProxyTest)});
  10141. //>>excludeEnd("ctx");
  10142. },
  10143. //>>excludeStart("ide", pragmas.excludeIdeData);
  10144. args: [],
  10145. 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",
  10146. referencedClasses: ["Error"],
  10147. //>>excludeEnd("ide");
  10148. messageSends: ["basicAt:put:", "error", "shouldnt:raise:", "x:", "assert:equals:", "x"]
  10149. }),
  10150. $globals.JSObjectProxyTest);
  10151. $core.addMethod(
  10152. $core.method({
  10153. selector: "testDNURegression1062",
  10154. protocol: 'tests',
  10155. fn: function (){
  10156. var self=this;
  10157. var jsObject,stored;
  10158. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  10159. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10160. return $core.withContext(function($ctx1) {
  10161. //>>excludeEnd("ctx");
  10162. jsObject=[];
  10163. $recv(jsObject)._basicAt_put_("allowJavaScriptCalls",true);
  10164. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10165. $ctx1.sendIdx["basicAt:put:"]=1;
  10166. //>>excludeEnd("ctx");
  10167. $recv(jsObject)._basicAt_put_("x",(function(v){
  10168. stored=v;
  10169. return stored;
  10170. }));
  10171. self._shouldnt_raise_((function(){
  10172. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10173. return $core.withContext(function($ctx2) {
  10174. //>>excludeEnd("ctx");
  10175. return $recv(jsObject)._x_((4));
  10176. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10177. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  10178. //>>excludeEnd("ctx");
  10179. }),$Error());
  10180. self._assert_equals_(stored,(4));
  10181. return self;
  10182. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10183. }, function($ctx1) {$ctx1.fill(self,"testDNURegression1062",{jsObject:jsObject,stored:stored},$globals.JSObjectProxyTest)});
  10184. //>>excludeEnd("ctx");
  10185. },
  10186. //>>excludeStart("ide", pragmas.excludeIdeData);
  10187. args: [],
  10188. 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",
  10189. referencedClasses: ["Error"],
  10190. //>>excludeEnd("ide");
  10191. messageSends: ["basicAt:put:", "shouldnt:raise:", "x:", "assert:equals:"]
  10192. }),
  10193. $globals.JSObjectProxyTest);
  10194. $core.addMethod(
  10195. $core.method({
  10196. selector: "testDNUWithAllowJavaScriptCalls",
  10197. protocol: 'tests',
  10198. fn: function (){
  10199. var self=this;
  10200. var jsObject;
  10201. function $MessageNotUnderstood(){return $globals.MessageNotUnderstood||(typeof MessageNotUnderstood=="undefined"?nil:MessageNotUnderstood)}
  10202. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10203. return $core.withContext(function($ctx1) {
  10204. //>>excludeEnd("ctx");
  10205. jsObject=[];
  10206. $recv(jsObject)._basicAt_put_("allowJavaScriptCalls",true);
  10207. self._should_raise_((function(){
  10208. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10209. return $core.withContext(function($ctx2) {
  10210. //>>excludeEnd("ctx");
  10211. return $recv(jsObject)._foo();
  10212. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10213. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  10214. //>>excludeEnd("ctx");
  10215. }),$MessageNotUnderstood());
  10216. return self;
  10217. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10218. }, function($ctx1) {$ctx1.fill(self,"testDNUWithAllowJavaScriptCalls",{jsObject:jsObject},$globals.JSObjectProxyTest)});
  10219. //>>excludeEnd("ctx");
  10220. },
  10221. //>>excludeStart("ide", pragmas.excludeIdeData);
  10222. args: [],
  10223. source: "testDNUWithAllowJavaScriptCalls\x0a\x09| jsObject |\x0a\x09jsObject := #().\x0a\x09jsObject basicAt: 'allowJavaScriptCalls' put: true.\x0a\x09self should: [ jsObject foo ] raise: MessageNotUnderstood",
  10224. referencedClasses: ["MessageNotUnderstood"],
  10225. //>>excludeEnd("ide");
  10226. messageSends: ["basicAt:put:", "should:raise:", "foo"]
  10227. }),
  10228. $globals.JSObjectProxyTest);
  10229. $core.addMethod(
  10230. $core.method({
  10231. selector: "testMessageSend",
  10232. protocol: 'tests',
  10233. fn: function (){
  10234. var self=this;
  10235. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10236. return $core.withContext(function($ctx1) {
  10237. //>>excludeEnd("ctx");
  10238. var $2,$1,$4,$3;
  10239. $2=self._jsObject();
  10240. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10241. $ctx1.sendIdx["jsObject"]=1;
  10242. //>>excludeEnd("ctx");
  10243. $1=$recv($2)._a();
  10244. self._assert_equals_($1,(1));
  10245. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10246. $ctx1.sendIdx["assert:equals:"]=1;
  10247. //>>excludeEnd("ctx");
  10248. $4=self._jsObject();
  10249. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10250. $ctx1.sendIdx["jsObject"]=2;
  10251. //>>excludeEnd("ctx");
  10252. $3=$recv($4)._b();
  10253. self._assert_equals_($3,(2));
  10254. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10255. $ctx1.sendIdx["assert:equals:"]=2;
  10256. //>>excludeEnd("ctx");
  10257. self._assert_equals_($recv(self._jsObject())._c_((3)),(3));
  10258. return self;
  10259. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10260. }, function($ctx1) {$ctx1.fill(self,"testMessageSend",{},$globals.JSObjectProxyTest)});
  10261. //>>excludeEnd("ctx");
  10262. },
  10263. //>>excludeStart("ide", pragmas.excludeIdeData);
  10264. args: [],
  10265. 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",
  10266. referencedClasses: [],
  10267. //>>excludeEnd("ide");
  10268. messageSends: ["assert:equals:", "a", "jsObject", "b", "c:"]
  10269. }),
  10270. $globals.JSObjectProxyTest);
  10271. $core.addMethod(
  10272. $core.method({
  10273. selector: "testMethodWithArguments",
  10274. protocol: 'tests',
  10275. fn: function (){
  10276. var self=this;
  10277. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10278. return $core.withContext(function($ctx1) {
  10279. //>>excludeEnd("ctx");
  10280. self._assert_equals_($recv(self._jsObject())._c_((1)),(1));
  10281. return self;
  10282. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10283. }, function($ctx1) {$ctx1.fill(self,"testMethodWithArguments",{},$globals.JSObjectProxyTest)});
  10284. //>>excludeEnd("ctx");
  10285. },
  10286. //>>excludeStart("ide", pragmas.excludeIdeData);
  10287. args: [],
  10288. source: "testMethodWithArguments\x0a\x09self assert: (self jsObject c: 1) equals: 1",
  10289. referencedClasses: [],
  10290. //>>excludeEnd("ide");
  10291. messageSends: ["assert:equals:", "c:", "jsObject"]
  10292. }),
  10293. $globals.JSObjectProxyTest);
  10294. $core.addMethod(
  10295. $core.method({
  10296. selector: "testPrinting",
  10297. protocol: 'tests',
  10298. fn: function (){
  10299. var self=this;
  10300. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10301. return $core.withContext(function($ctx1) {
  10302. //>>excludeEnd("ctx");
  10303. self._assert_equals_($recv(self._jsObject())._printString(),"[object Object]");
  10304. return self;
  10305. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10306. }, function($ctx1) {$ctx1.fill(self,"testPrinting",{},$globals.JSObjectProxyTest)});
  10307. //>>excludeEnd("ctx");
  10308. },
  10309. //>>excludeStart("ide", pragmas.excludeIdeData);
  10310. args: [],
  10311. source: "testPrinting\x0a\x09self assert: self jsObject printString equals: '[object Object]'",
  10312. referencedClasses: [],
  10313. //>>excludeEnd("ide");
  10314. messageSends: ["assert:equals:", "printString", "jsObject"]
  10315. }),
  10316. $globals.JSObjectProxyTest);
  10317. $core.addMethod(
  10318. $core.method({
  10319. selector: "testPropertyThatReturnsEmptyString",
  10320. protocol: 'tests',
  10321. fn: function (){
  10322. var self=this;
  10323. var object;
  10324. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10325. return $core.withContext(function($ctx1) {
  10326. //>>excludeEnd("ctx");
  10327. var $1;
  10328. object=self._jsObject();
  10329. $1=$recv(object)._d();
  10330. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10331. $ctx1.sendIdx["d"]=1;
  10332. //>>excludeEnd("ctx");
  10333. self._assert_equals_($1,"");
  10334. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10335. $ctx1.sendIdx["assert:equals:"]=1;
  10336. //>>excludeEnd("ctx");
  10337. $recv(object)._d_("hello");
  10338. self._assert_equals_($recv(object)._d(),"hello");
  10339. return self;
  10340. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10341. }, function($ctx1) {$ctx1.fill(self,"testPropertyThatReturnsEmptyString",{object:object},$globals.JSObjectProxyTest)});
  10342. //>>excludeEnd("ctx");
  10343. },
  10344. //>>excludeStart("ide", pragmas.excludeIdeData);
  10345. args: [],
  10346. 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'",
  10347. referencedClasses: [],
  10348. //>>excludeEnd("ide");
  10349. messageSends: ["jsObject", "assert:equals:", "d", "d:"]
  10350. }),
  10351. $globals.JSObjectProxyTest);
  10352. $core.addMethod(
  10353. $core.method({
  10354. selector: "testPropertyThatReturnsUndefined",
  10355. protocol: 'tests',
  10356. fn: function (){
  10357. var self=this;
  10358. var object;
  10359. function $MessageNotUnderstood(){return $globals.MessageNotUnderstood||(typeof MessageNotUnderstood=="undefined"?nil:MessageNotUnderstood)}
  10360. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10361. return $core.withContext(function($ctx1) {
  10362. //>>excludeEnd("ctx");
  10363. object=self._jsObject();
  10364. self._shouldnt_raise_((function(){
  10365. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10366. return $core.withContext(function($ctx2) {
  10367. //>>excludeEnd("ctx");
  10368. return $recv(object)._e();
  10369. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10370. $ctx2.sendIdx["e"]=1;
  10371. //>>excludeEnd("ctx");
  10372. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10373. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  10374. //>>excludeEnd("ctx");
  10375. }),$MessageNotUnderstood());
  10376. self._assert_($recv($recv(object)._e())._isNil());
  10377. return self;
  10378. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10379. }, function($ctx1) {$ctx1.fill(self,"testPropertyThatReturnsUndefined",{object:object},$globals.JSObjectProxyTest)});
  10380. //>>excludeEnd("ctx");
  10381. },
  10382. //>>excludeStart("ide", pragmas.excludeIdeData);
  10383. args: [],
  10384. source: "testPropertyThatReturnsUndefined\x0a\x09| object |\x0a\x0a\x09object := self jsObject.\x0a\x09self shouldnt: [ object e ] raise: MessageNotUnderstood.\x0a\x09self assert: object e isNil",
  10385. referencedClasses: ["MessageNotUnderstood"],
  10386. //>>excludeEnd("ide");
  10387. messageSends: ["jsObject", "shouldnt:raise:", "e", "assert:", "isNil"]
  10388. }),
  10389. $globals.JSObjectProxyTest);
  10390. $core.addMethod(
  10391. $core.method({
  10392. selector: "testSetPropertyWithFalsyValue",
  10393. protocol: 'tests',
  10394. fn: function (){
  10395. var self=this;
  10396. var jsObject;
  10397. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10398. return $core.withContext(function($ctx1) {
  10399. //>>excludeEnd("ctx");
  10400. var $1,$2,$3,$4,$5;
  10401. jsObject=self._jsObject();
  10402. $1=$recv(jsObject)._a();
  10403. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10404. $ctx1.sendIdx["a"]=1;
  10405. //>>excludeEnd("ctx");
  10406. self._assert_equals_($1,(1));
  10407. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10408. $ctx1.sendIdx["assert:equals:"]=1;
  10409. //>>excludeEnd("ctx");
  10410. $recv(jsObject)._a_(self._jsNull());
  10411. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10412. $ctx1.sendIdx["a:"]=1;
  10413. //>>excludeEnd("ctx");
  10414. $2=$recv(jsObject)._a();
  10415. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10416. $ctx1.sendIdx["a"]=2;
  10417. //>>excludeEnd("ctx");
  10418. self._assert_equals_($2,nil);
  10419. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10420. $ctx1.sendIdx["assert:equals:"]=2;
  10421. //>>excludeEnd("ctx");
  10422. $recv(jsObject)._a_((0));
  10423. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10424. $ctx1.sendIdx["a:"]=2;
  10425. //>>excludeEnd("ctx");
  10426. $3=$recv(jsObject)._a();
  10427. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10428. $ctx1.sendIdx["a"]=3;
  10429. //>>excludeEnd("ctx");
  10430. self._assert_equals_($3,(0));
  10431. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10432. $ctx1.sendIdx["assert:equals:"]=3;
  10433. //>>excludeEnd("ctx");
  10434. $recv(jsObject)._a_(self._jsUndefined());
  10435. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10436. $ctx1.sendIdx["a:"]=3;
  10437. //>>excludeEnd("ctx");
  10438. $4=$recv(jsObject)._a();
  10439. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10440. $ctx1.sendIdx["a"]=4;
  10441. //>>excludeEnd("ctx");
  10442. self._assert_equals_($4,nil);
  10443. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10444. $ctx1.sendIdx["assert:equals:"]=4;
  10445. //>>excludeEnd("ctx");
  10446. $recv(jsObject)._a_("");
  10447. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10448. $ctx1.sendIdx["a:"]=4;
  10449. //>>excludeEnd("ctx");
  10450. $5=$recv(jsObject)._a();
  10451. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10452. $ctx1.sendIdx["a"]=5;
  10453. //>>excludeEnd("ctx");
  10454. self._assert_equals_($5,"");
  10455. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10456. $ctx1.sendIdx["assert:equals:"]=5;
  10457. //>>excludeEnd("ctx");
  10458. $recv(jsObject)._a_(false);
  10459. self._assert_equals_($recv(jsObject)._a(),false);
  10460. return self;
  10461. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10462. }, function($ctx1) {$ctx1.fill(self,"testSetPropertyWithFalsyValue",{jsObject:jsObject},$globals.JSObjectProxyTest)});
  10463. //>>excludeEnd("ctx");
  10464. },
  10465. //>>excludeStart("ide", pragmas.excludeIdeData);
  10466. args: [],
  10467. 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",
  10468. referencedClasses: [],
  10469. //>>excludeEnd("ide");
  10470. messageSends: ["jsObject", "assert:equals:", "a", "a:", "jsNull", "jsUndefined"]
  10471. }),
  10472. $globals.JSObjectProxyTest);
  10473. $core.addMethod(
  10474. $core.method({
  10475. selector: "testValue",
  10476. protocol: 'tests',
  10477. fn: function (){
  10478. var self=this;
  10479. var testObject;
  10480. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10481. return $core.withContext(function($ctx1) {
  10482. //>>excludeEnd("ctx");
  10483. testObject=self._jsObject();
  10484. $recv(testObject)._at_put_("value","aValue");
  10485. self._assert_equals_($recv(testObject)._value(),"aValue");
  10486. return self;
  10487. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10488. }, function($ctx1) {$ctx1.fill(self,"testValue",{testObject:testObject},$globals.JSObjectProxyTest)});
  10489. //>>excludeEnd("ctx");
  10490. },
  10491. //>>excludeStart("ide", pragmas.excludeIdeData);
  10492. args: [],
  10493. source: "testValue\x0a\x09| testObject |\x0a\x09testObject := self jsObject.\x0a\x09testObject at: 'value' put: 'aValue'.\x0a\x09self assert: testObject value equals: 'aValue'",
  10494. referencedClasses: [],
  10495. //>>excludeEnd("ide");
  10496. messageSends: ["jsObject", "at:put:", "assert:equals:", "value"]
  10497. }),
  10498. $globals.JSObjectProxyTest);
  10499. $core.addMethod(
  10500. $core.method({
  10501. selector: "testYourself",
  10502. protocol: 'tests',
  10503. fn: function (){
  10504. var self=this;
  10505. var object;
  10506. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10507. return $core.withContext(function($ctx1) {
  10508. //>>excludeEnd("ctx");
  10509. var $1;
  10510. $1=self._jsObject();
  10511. $recv($1)._d_("test");
  10512. object=$recv($1)._yourself();
  10513. self._assert_equals_($recv(object)._d(),"test");
  10514. return self;
  10515. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10516. }, function($ctx1) {$ctx1.fill(self,"testYourself",{object:object},$globals.JSObjectProxyTest)});
  10517. //>>excludeEnd("ctx");
  10518. },
  10519. //>>excludeStart("ide", pragmas.excludeIdeData);
  10520. args: [],
  10521. source: "testYourself\x0a\x09| object |\x0a\x09object := self jsObject\x0a\x09\x09d: 'test';\x0a\x09\x09yourself.\x0a\x0a\x09self assert: object d equals: 'test'",
  10522. referencedClasses: [],
  10523. //>>excludeEnd("ide");
  10524. messageSends: ["d:", "jsObject", "yourself", "assert:equals:", "d"]
  10525. }),
  10526. $globals.JSObjectProxyTest);
  10527. $core.addClass('JavaScriptExceptionTest', $globals.TestCase, [], 'Kernel-Tests');
  10528. $core.addMethod(
  10529. $core.method({
  10530. selector: "testCatchingException",
  10531. protocol: 'tests',
  10532. fn: function (){
  10533. var self=this;
  10534. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  10535. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10536. return $core.withContext(function($ctx1) {
  10537. //>>excludeEnd("ctx");
  10538. $recv((function(){
  10539. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10540. return $core.withContext(function($ctx2) {
  10541. //>>excludeEnd("ctx");
  10542. return self._throwException();
  10543. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10544. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  10545. //>>excludeEnd("ctx");
  10546. }))._on_do_($Error(),(function(error){
  10547. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10548. return $core.withContext(function($ctx2) {
  10549. //>>excludeEnd("ctx");
  10550. return self._assert_($recv($recv(error)._exception()).__eq("test"));
  10551. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10552. }, function($ctx2) {$ctx2.fillBlock({error:error},$ctx1,2)});
  10553. //>>excludeEnd("ctx");
  10554. }));
  10555. return self;
  10556. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10557. }, function($ctx1) {$ctx1.fill(self,"testCatchingException",{},$globals.JavaScriptExceptionTest)});
  10558. //>>excludeEnd("ctx");
  10559. },
  10560. //>>excludeStart("ide", pragmas.excludeIdeData);
  10561. args: [],
  10562. source: "testCatchingException\x0a\x09[ self throwException ]\x0a\x09\x09on: Error\x0a\x09\x09do: [ :error |\x0a\x09\x09\x09self assert: error exception = 'test' ]",
  10563. referencedClasses: ["Error"],
  10564. //>>excludeEnd("ide");
  10565. messageSends: ["on:do:", "throwException", "assert:", "=", "exception"]
  10566. }),
  10567. $globals.JavaScriptExceptionTest);
  10568. $core.addMethod(
  10569. $core.method({
  10570. selector: "testRaisingException",
  10571. protocol: 'tests',
  10572. fn: function (){
  10573. var self=this;
  10574. function $JavaScriptException(){return $globals.JavaScriptException||(typeof JavaScriptException=="undefined"?nil:JavaScriptException)}
  10575. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10576. return $core.withContext(function($ctx1) {
  10577. //>>excludeEnd("ctx");
  10578. self._should_raise_((function(){
  10579. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10580. return $core.withContext(function($ctx2) {
  10581. //>>excludeEnd("ctx");
  10582. return self._throwException();
  10583. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10584. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  10585. //>>excludeEnd("ctx");
  10586. }),$JavaScriptException());
  10587. return self;
  10588. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10589. }, function($ctx1) {$ctx1.fill(self,"testRaisingException",{},$globals.JavaScriptExceptionTest)});
  10590. //>>excludeEnd("ctx");
  10591. },
  10592. //>>excludeStart("ide", pragmas.excludeIdeData);
  10593. args: [],
  10594. source: "testRaisingException\x0a\x09self should: [ self throwException ] raise: JavaScriptException",
  10595. referencedClasses: ["JavaScriptException"],
  10596. //>>excludeEnd("ide");
  10597. messageSends: ["should:raise:", "throwException"]
  10598. }),
  10599. $globals.JavaScriptExceptionTest);
  10600. $core.addMethod(
  10601. $core.method({
  10602. selector: "throwException",
  10603. protocol: 'helpers',
  10604. fn: function (){
  10605. var self=this;
  10606. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10607. return $core.withContext(function($ctx1) {
  10608. //>>excludeEnd("ctx");
  10609. throw 'test';
  10610. return self;
  10611. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10612. }, function($ctx1) {$ctx1.fill(self,"throwException",{},$globals.JavaScriptExceptionTest)});
  10613. //>>excludeEnd("ctx");
  10614. },
  10615. //>>excludeStart("ide", pragmas.excludeIdeData);
  10616. args: [],
  10617. source: "throwException\x0a\x09<throw 'test'>",
  10618. referencedClasses: [],
  10619. //>>excludeEnd("ide");
  10620. messageSends: []
  10621. }),
  10622. $globals.JavaScriptExceptionTest);
  10623. $core.addClass('MessageSendTest', $globals.TestCase, [], 'Kernel-Tests');
  10624. $core.addMethod(
  10625. $core.method({
  10626. selector: "testValue",
  10627. protocol: 'tests',
  10628. fn: function (){
  10629. var self=this;
  10630. var messageSend;
  10631. function $MessageSend(){return $globals.MessageSend||(typeof MessageSend=="undefined"?nil:MessageSend)}
  10632. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  10633. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10634. return $core.withContext(function($ctx1) {
  10635. //>>excludeEnd("ctx");
  10636. var $1;
  10637. $1=$recv($MessageSend())._new();
  10638. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10639. $ctx1.sendIdx["new"]=1;
  10640. //>>excludeEnd("ctx");
  10641. $recv($1)._receiver_($recv($Object())._new());
  10642. $recv($1)._selector_("asString");
  10643. messageSend=$recv($1)._yourself();
  10644. self._assert_equals_($recv(messageSend)._value(),"an Object");
  10645. return self;
  10646. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10647. }, function($ctx1) {$ctx1.fill(self,"testValue",{messageSend:messageSend},$globals.MessageSendTest)});
  10648. //>>excludeEnd("ctx");
  10649. },
  10650. //>>excludeStart("ide", pragmas.excludeIdeData);
  10651. args: [],
  10652. 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'",
  10653. referencedClasses: ["MessageSend", "Object"],
  10654. //>>excludeEnd("ide");
  10655. messageSends: ["receiver:", "new", "selector:", "yourself", "assert:equals:", "value"]
  10656. }),
  10657. $globals.MessageSendTest);
  10658. $core.addMethod(
  10659. $core.method({
  10660. selector: "testValueWithArguments",
  10661. protocol: 'tests',
  10662. fn: function (){
  10663. var self=this;
  10664. var messageSend;
  10665. function $MessageSend(){return $globals.MessageSend||(typeof MessageSend=="undefined"?nil:MessageSend)}
  10666. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10667. return $core.withContext(function($ctx1) {
  10668. //>>excludeEnd("ctx");
  10669. var $1;
  10670. $1=$recv($MessageSend())._new();
  10671. $recv($1)._receiver_((2));
  10672. $recv($1)._selector_("+");
  10673. messageSend=$recv($1)._yourself();
  10674. self._assert_equals_($recv(messageSend)._value_((3)),(5));
  10675. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10676. $ctx1.sendIdx["assert:equals:"]=1;
  10677. //>>excludeEnd("ctx");
  10678. self._assert_equals_($recv(messageSend)._valueWithPossibleArguments_([(4)]),(6));
  10679. return self;
  10680. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10681. }, function($ctx1) {$ctx1.fill(self,"testValueWithArguments",{messageSend:messageSend},$globals.MessageSendTest)});
  10682. //>>excludeEnd("ctx");
  10683. },
  10684. //>>excludeStart("ide", pragmas.excludeIdeData);
  10685. args: [],
  10686. 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",
  10687. referencedClasses: ["MessageSend"],
  10688. //>>excludeEnd("ide");
  10689. messageSends: ["receiver:", "new", "selector:", "yourself", "assert:equals:", "value:", "valueWithPossibleArguments:"]
  10690. }),
  10691. $globals.MessageSendTest);
  10692. $core.addClass('MethodInheritanceTest', $globals.TestCase, ['receiverTop', 'receiverMiddle', 'receiverBottom', 'method', 'performBlock'], 'Kernel-Tests');
  10693. $core.addMethod(
  10694. $core.method({
  10695. selector: "codeGeneratorClass",
  10696. protocol: 'accessing',
  10697. fn: function (){
  10698. var self=this;
  10699. function $CodeGenerator(){return $globals.CodeGenerator||(typeof CodeGenerator=="undefined"?nil:CodeGenerator)}
  10700. return $CodeGenerator();
  10701. },
  10702. //>>excludeStart("ide", pragmas.excludeIdeData);
  10703. args: [],
  10704. source: "codeGeneratorClass\x0a\x09^ CodeGenerator",
  10705. referencedClasses: ["CodeGenerator"],
  10706. //>>excludeEnd("ide");
  10707. messageSends: []
  10708. }),
  10709. $globals.MethodInheritanceTest);
  10710. $core.addMethod(
  10711. $core.method({
  10712. selector: "compiler",
  10713. protocol: 'factory',
  10714. fn: function (){
  10715. var self=this;
  10716. function $Compiler(){return $globals.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
  10717. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10718. return $core.withContext(function($ctx1) {
  10719. //>>excludeEnd("ctx");
  10720. var $1;
  10721. $1=$recv($Compiler())._new();
  10722. $recv($1)._codeGeneratorClass_(self._codeGeneratorClass());
  10723. return $recv($1)._yourself();
  10724. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10725. }, function($ctx1) {$ctx1.fill(self,"compiler",{},$globals.MethodInheritanceTest)});
  10726. //>>excludeEnd("ctx");
  10727. },
  10728. //>>excludeStart("ide", pragmas.excludeIdeData);
  10729. args: [],
  10730. source: "compiler\x0a\x09^ Compiler new\x0a\x09\x09codeGeneratorClass: self codeGeneratorClass;\x0a\x09\x09yourself",
  10731. referencedClasses: ["Compiler"],
  10732. //>>excludeEnd("ide");
  10733. messageSends: ["codeGeneratorClass:", "new", "codeGeneratorClass", "yourself"]
  10734. }),
  10735. $globals.MethodInheritanceTest);
  10736. $core.addMethod(
  10737. $core.method({
  10738. selector: "deinstallBottom",
  10739. protocol: 'testing',
  10740. fn: function (){
  10741. var self=this;
  10742. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10743. return $core.withContext(function($ctx1) {
  10744. //>>excludeEnd("ctx");
  10745. $recv(self._targetClassBottom())._removeCompiledMethod_(self["@method"]);
  10746. return self;
  10747. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10748. }, function($ctx1) {$ctx1.fill(self,"deinstallBottom",{},$globals.MethodInheritanceTest)});
  10749. //>>excludeEnd("ctx");
  10750. },
  10751. //>>excludeStart("ide", pragmas.excludeIdeData);
  10752. args: [],
  10753. source: "deinstallBottom\x0a\x09self targetClassBottom removeCompiledMethod: method",
  10754. referencedClasses: [],
  10755. //>>excludeEnd("ide");
  10756. messageSends: ["removeCompiledMethod:", "targetClassBottom"]
  10757. }),
  10758. $globals.MethodInheritanceTest);
  10759. $core.addMethod(
  10760. $core.method({
  10761. selector: "deinstallMiddle",
  10762. protocol: 'testing',
  10763. fn: function (){
  10764. var self=this;
  10765. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10766. return $core.withContext(function($ctx1) {
  10767. //>>excludeEnd("ctx");
  10768. $recv(self._targetClassMiddle())._removeCompiledMethod_(self["@method"]);
  10769. return self;
  10770. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10771. }, function($ctx1) {$ctx1.fill(self,"deinstallMiddle",{},$globals.MethodInheritanceTest)});
  10772. //>>excludeEnd("ctx");
  10773. },
  10774. //>>excludeStart("ide", pragmas.excludeIdeData);
  10775. args: [],
  10776. source: "deinstallMiddle\x0a\x09self targetClassMiddle removeCompiledMethod: method",
  10777. referencedClasses: [],
  10778. //>>excludeEnd("ide");
  10779. messageSends: ["removeCompiledMethod:", "targetClassMiddle"]
  10780. }),
  10781. $globals.MethodInheritanceTest);
  10782. $core.addMethod(
  10783. $core.method({
  10784. selector: "deinstallTop",
  10785. protocol: 'testing',
  10786. fn: function (){
  10787. var self=this;
  10788. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10789. return $core.withContext(function($ctx1) {
  10790. //>>excludeEnd("ctx");
  10791. $recv(self._targetClassTop())._removeCompiledMethod_(self["@method"]);
  10792. return self;
  10793. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10794. }, function($ctx1) {$ctx1.fill(self,"deinstallTop",{},$globals.MethodInheritanceTest)});
  10795. //>>excludeEnd("ctx");
  10796. },
  10797. //>>excludeStart("ide", pragmas.excludeIdeData);
  10798. args: [],
  10799. source: "deinstallTop\x0a\x09self targetClassTop removeCompiledMethod: method",
  10800. referencedClasses: [],
  10801. //>>excludeEnd("ide");
  10802. messageSends: ["removeCompiledMethod:", "targetClassTop"]
  10803. }),
  10804. $globals.MethodInheritanceTest);
  10805. $core.addMethod(
  10806. $core.method({
  10807. selector: "installBottom:",
  10808. protocol: 'testing',
  10809. fn: function (aString){
  10810. var self=this;
  10811. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10812. return $core.withContext(function($ctx1) {
  10813. //>>excludeEnd("ctx");
  10814. self["@method"]=$recv(self._compiler())._install_forClass_protocol_(aString,self._targetClassBottom(),"tests");
  10815. return self;
  10816. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10817. }, function($ctx1) {$ctx1.fill(self,"installBottom:",{aString:aString},$globals.MethodInheritanceTest)});
  10818. //>>excludeEnd("ctx");
  10819. },
  10820. //>>excludeStart("ide", pragmas.excludeIdeData);
  10821. args: ["aString"],
  10822. source: "installBottom: aString\x0a\x09method := self compiler install: aString forClass: self targetClassBottom protocol: 'tests'",
  10823. referencedClasses: [],
  10824. //>>excludeEnd("ide");
  10825. messageSends: ["install:forClass:protocol:", "compiler", "targetClassBottom"]
  10826. }),
  10827. $globals.MethodInheritanceTest);
  10828. $core.addMethod(
  10829. $core.method({
  10830. selector: "installMiddle:",
  10831. protocol: 'testing',
  10832. fn: function (aString){
  10833. var self=this;
  10834. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10835. return $core.withContext(function($ctx1) {
  10836. //>>excludeEnd("ctx");
  10837. self["@method"]=$recv(self._compiler())._install_forClass_protocol_(aString,self._targetClassMiddle(),"tests");
  10838. return self;
  10839. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10840. }, function($ctx1) {$ctx1.fill(self,"installMiddle:",{aString:aString},$globals.MethodInheritanceTest)});
  10841. //>>excludeEnd("ctx");
  10842. },
  10843. //>>excludeStart("ide", pragmas.excludeIdeData);
  10844. args: ["aString"],
  10845. source: "installMiddle: aString\x0a\x09method := self compiler install: aString forClass: self targetClassMiddle protocol: 'tests'",
  10846. referencedClasses: [],
  10847. //>>excludeEnd("ide");
  10848. messageSends: ["install:forClass:protocol:", "compiler", "targetClassMiddle"]
  10849. }),
  10850. $globals.MethodInheritanceTest);
  10851. $core.addMethod(
  10852. $core.method({
  10853. selector: "installTop:",
  10854. protocol: 'testing',
  10855. fn: function (aString){
  10856. var self=this;
  10857. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10858. return $core.withContext(function($ctx1) {
  10859. //>>excludeEnd("ctx");
  10860. self["@method"]=$recv(self._compiler())._install_forClass_protocol_(aString,self._targetClassTop(),"tests");
  10861. return self;
  10862. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10863. }, function($ctx1) {$ctx1.fill(self,"installTop:",{aString:aString},$globals.MethodInheritanceTest)});
  10864. //>>excludeEnd("ctx");
  10865. },
  10866. //>>excludeStart("ide", pragmas.excludeIdeData);
  10867. args: ["aString"],
  10868. source: "installTop: aString\x0a\x09method := self compiler install: aString forClass: self targetClassTop protocol: 'tests'",
  10869. referencedClasses: [],
  10870. //>>excludeEnd("ide");
  10871. messageSends: ["install:forClass:protocol:", "compiler", "targetClassTop"]
  10872. }),
  10873. $globals.MethodInheritanceTest);
  10874. $core.addMethod(
  10875. $core.method({
  10876. selector: "setUp",
  10877. protocol: 'initialization',
  10878. fn: function (){
  10879. var self=this;
  10880. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10881. return $core.withContext(function($ctx1) {
  10882. //>>excludeEnd("ctx");
  10883. self["@receiverTop"]=$recv(self._targetClassTop())._new();
  10884. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10885. $ctx1.sendIdx["new"]=1;
  10886. //>>excludeEnd("ctx");
  10887. self["@receiverMiddle"]=$recv(self._targetClassMiddle())._new();
  10888. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10889. $ctx1.sendIdx["new"]=2;
  10890. //>>excludeEnd("ctx");
  10891. self["@receiverBottom"]=$recv(self._targetClassBottom())._new();
  10892. self["@method"]=nil;
  10893. self["@performBlock"]=(function(){
  10894. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10895. return $core.withContext(function($ctx2) {
  10896. //>>excludeEnd("ctx");
  10897. return self._error_("performBlock not initialized");
  10898. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10899. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  10900. //>>excludeEnd("ctx");
  10901. });
  10902. return self;
  10903. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10904. }, function($ctx1) {$ctx1.fill(self,"setUp",{},$globals.MethodInheritanceTest)});
  10905. //>>excludeEnd("ctx");
  10906. },
  10907. //>>excludeStart("ide", pragmas.excludeIdeData);
  10908. args: [],
  10909. 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' ]",
  10910. referencedClasses: [],
  10911. //>>excludeEnd("ide");
  10912. messageSends: ["new", "targetClassTop", "targetClassMiddle", "targetClassBottom", "error:"]
  10913. }),
  10914. $globals.MethodInheritanceTest);
  10915. $core.addMethod(
  10916. $core.method({
  10917. selector: "shouldMNU",
  10918. protocol: 'testing',
  10919. fn: function (){
  10920. var self=this;
  10921. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10922. return $core.withContext(function($ctx1) {
  10923. //>>excludeEnd("ctx");
  10924. self._shouldMNUTop();
  10925. self._shouldMNUMiddle();
  10926. self._shouldMNUBottom();
  10927. return self;
  10928. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10929. }, function($ctx1) {$ctx1.fill(self,"shouldMNU",{},$globals.MethodInheritanceTest)});
  10930. //>>excludeEnd("ctx");
  10931. },
  10932. //>>excludeStart("ide", pragmas.excludeIdeData);
  10933. args: [],
  10934. source: "shouldMNU\x0a\x09self shouldMNUTop.\x0a\x09self shouldMNUMiddle.\x0a\x09self shouldMNUBottom",
  10935. referencedClasses: [],
  10936. //>>excludeEnd("ide");
  10937. messageSends: ["shouldMNUTop", "shouldMNUMiddle", "shouldMNUBottom"]
  10938. }),
  10939. $globals.MethodInheritanceTest);
  10940. $core.addMethod(
  10941. $core.method({
  10942. selector: "shouldMNUBottom",
  10943. protocol: 'testing',
  10944. fn: function (){
  10945. var self=this;
  10946. function $MessageNotUnderstood(){return $globals.MessageNotUnderstood||(typeof MessageNotUnderstood=="undefined"?nil:MessageNotUnderstood)}
  10947. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10948. return $core.withContext(function($ctx1) {
  10949. //>>excludeEnd("ctx");
  10950. self._should_raise_((function(){
  10951. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10952. return $core.withContext(function($ctx2) {
  10953. //>>excludeEnd("ctx");
  10954. return $recv(self["@performBlock"])._value_(self["@receiverBottom"]);
  10955. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10956. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  10957. //>>excludeEnd("ctx");
  10958. }),$MessageNotUnderstood());
  10959. return self;
  10960. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10961. }, function($ctx1) {$ctx1.fill(self,"shouldMNUBottom",{},$globals.MethodInheritanceTest)});
  10962. //>>excludeEnd("ctx");
  10963. },
  10964. //>>excludeStart("ide", pragmas.excludeIdeData);
  10965. args: [],
  10966. source: "shouldMNUBottom\x0a\x09self should: [ performBlock value: receiverBottom ] raise: MessageNotUnderstood",
  10967. referencedClasses: ["MessageNotUnderstood"],
  10968. //>>excludeEnd("ide");
  10969. messageSends: ["should:raise:", "value:"]
  10970. }),
  10971. $globals.MethodInheritanceTest);
  10972. $core.addMethod(
  10973. $core.method({
  10974. selector: "shouldMNUMiddle",
  10975. protocol: 'testing',
  10976. fn: function (){
  10977. var self=this;
  10978. function $MessageNotUnderstood(){return $globals.MessageNotUnderstood||(typeof MessageNotUnderstood=="undefined"?nil:MessageNotUnderstood)}
  10979. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10980. return $core.withContext(function($ctx1) {
  10981. //>>excludeEnd("ctx");
  10982. self._should_raise_((function(){
  10983. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10984. return $core.withContext(function($ctx2) {
  10985. //>>excludeEnd("ctx");
  10986. return $recv(self["@performBlock"])._value_(self["@receiverMiddle"]);
  10987. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10988. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  10989. //>>excludeEnd("ctx");
  10990. }),$MessageNotUnderstood());
  10991. return self;
  10992. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10993. }, function($ctx1) {$ctx1.fill(self,"shouldMNUMiddle",{},$globals.MethodInheritanceTest)});
  10994. //>>excludeEnd("ctx");
  10995. },
  10996. //>>excludeStart("ide", pragmas.excludeIdeData);
  10997. args: [],
  10998. source: "shouldMNUMiddle\x0a\x09self should: [ performBlock value: receiverMiddle ] raise: MessageNotUnderstood",
  10999. referencedClasses: ["MessageNotUnderstood"],
  11000. //>>excludeEnd("ide");
  11001. messageSends: ["should:raise:", "value:"]
  11002. }),
  11003. $globals.MethodInheritanceTest);
  11004. $core.addMethod(
  11005. $core.method({
  11006. selector: "shouldMNUTop",
  11007. protocol: 'testing',
  11008. fn: function (){
  11009. var self=this;
  11010. function $MessageNotUnderstood(){return $globals.MessageNotUnderstood||(typeof MessageNotUnderstood=="undefined"?nil:MessageNotUnderstood)}
  11011. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11012. return $core.withContext(function($ctx1) {
  11013. //>>excludeEnd("ctx");
  11014. self._should_raise_((function(){
  11015. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11016. return $core.withContext(function($ctx2) {
  11017. //>>excludeEnd("ctx");
  11018. return $recv(self["@performBlock"])._value_(self["@receiverTop"]);
  11019. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11020. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  11021. //>>excludeEnd("ctx");
  11022. }),$MessageNotUnderstood());
  11023. return self;
  11024. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11025. }, function($ctx1) {$ctx1.fill(self,"shouldMNUTop",{},$globals.MethodInheritanceTest)});
  11026. //>>excludeEnd("ctx");
  11027. },
  11028. //>>excludeStart("ide", pragmas.excludeIdeData);
  11029. args: [],
  11030. source: "shouldMNUTop\x0a\x09self should: [ performBlock value: receiverTop ] raise: MessageNotUnderstood",
  11031. referencedClasses: ["MessageNotUnderstood"],
  11032. //>>excludeEnd("ide");
  11033. messageSends: ["should:raise:", "value:"]
  11034. }),
  11035. $globals.MethodInheritanceTest);
  11036. $core.addMethod(
  11037. $core.method({
  11038. selector: "shouldReturn:",
  11039. protocol: 'testing',
  11040. fn: function (anObject){
  11041. var self=this;
  11042. var result;
  11043. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11044. return $core.withContext(function($ctx1) {
  11045. //>>excludeEnd("ctx");
  11046. result=$recv(self["@performBlock"])._value_(self["@receiverTop"]);
  11047. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11048. $ctx1.sendIdx["value:"]=1;
  11049. //>>excludeEnd("ctx");
  11050. self._assert_equals_(["top",anObject],["top",result]);
  11051. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11052. $ctx1.sendIdx["assert:equals:"]=1;
  11053. //>>excludeEnd("ctx");
  11054. result=$recv(self["@performBlock"])._value_(self["@receiverMiddle"]);
  11055. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11056. $ctx1.sendIdx["value:"]=2;
  11057. //>>excludeEnd("ctx");
  11058. self._assert_equals_(["middle",anObject],["middle",result]);
  11059. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11060. $ctx1.sendIdx["assert:equals:"]=2;
  11061. //>>excludeEnd("ctx");
  11062. result=$recv(self["@performBlock"])._value_(self["@receiverBottom"]);
  11063. self._assert_equals_(["bottom",anObject],["bottom",result]);
  11064. return self;
  11065. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11066. }, function($ctx1) {$ctx1.fill(self,"shouldReturn:",{anObject:anObject,result:result},$globals.MethodInheritanceTest)});
  11067. //>>excludeEnd("ctx");
  11068. },
  11069. //>>excludeStart("ide", pragmas.excludeIdeData);
  11070. args: ["anObject"],
  11071. 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 }",
  11072. referencedClasses: [],
  11073. //>>excludeEnd("ide");
  11074. messageSends: ["value:", "assert:equals:"]
  11075. }),
  11076. $globals.MethodInheritanceTest);
  11077. $core.addMethod(
  11078. $core.method({
  11079. selector: "shouldReturn:and:and:",
  11080. protocol: 'testing',
  11081. fn: function (anObject,anObject2,anObject3){
  11082. var self=this;
  11083. var result;
  11084. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11085. return $core.withContext(function($ctx1) {
  11086. //>>excludeEnd("ctx");
  11087. result=$recv(self["@performBlock"])._value_(self["@receiverTop"]);
  11088. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11089. $ctx1.sendIdx["value:"]=1;
  11090. //>>excludeEnd("ctx");
  11091. self._assert_equals_(["top",anObject],["top",result]);
  11092. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11093. $ctx1.sendIdx["assert:equals:"]=1;
  11094. //>>excludeEnd("ctx");
  11095. result=$recv(self["@performBlock"])._value_(self["@receiverMiddle"]);
  11096. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11097. $ctx1.sendIdx["value:"]=2;
  11098. //>>excludeEnd("ctx");
  11099. self._assert_equals_(["middle",anObject2],["middle",result]);
  11100. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11101. $ctx1.sendIdx["assert:equals:"]=2;
  11102. //>>excludeEnd("ctx");
  11103. result=$recv(self["@performBlock"])._value_(self["@receiverBottom"]);
  11104. self._assert_equals_(["bottom",anObject3],["bottom",result]);
  11105. return self;
  11106. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11107. }, function($ctx1) {$ctx1.fill(self,"shouldReturn:and:and:",{anObject:anObject,anObject2:anObject2,anObject3:anObject3,result:result},$globals.MethodInheritanceTest)});
  11108. //>>excludeEnd("ctx");
  11109. },
  11110. //>>excludeStart("ide", pragmas.excludeIdeData);
  11111. args: ["anObject", "anObject2", "anObject3"],
  11112. 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 }",
  11113. referencedClasses: [],
  11114. //>>excludeEnd("ide");
  11115. messageSends: ["value:", "assert:equals:"]
  11116. }),
  11117. $globals.MethodInheritanceTest);
  11118. $core.addMethod(
  11119. $core.method({
  11120. selector: "targetClassBottom",
  11121. protocol: 'accessing',
  11122. fn: function (){
  11123. var self=this;
  11124. function $JavaScriptException(){return $globals.JavaScriptException||(typeof JavaScriptException=="undefined"?nil:JavaScriptException)}
  11125. return $JavaScriptException();
  11126. },
  11127. //>>excludeStart("ide", pragmas.excludeIdeData);
  11128. args: [],
  11129. source: "targetClassBottom\x0a\x09^ JavaScriptException",
  11130. referencedClasses: ["JavaScriptException"],
  11131. //>>excludeEnd("ide");
  11132. messageSends: []
  11133. }),
  11134. $globals.MethodInheritanceTest);
  11135. $core.addMethod(
  11136. $core.method({
  11137. selector: "targetClassMiddle",
  11138. protocol: 'accessing',
  11139. fn: function (){
  11140. var self=this;
  11141. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  11142. return $Error();
  11143. },
  11144. //>>excludeStart("ide", pragmas.excludeIdeData);
  11145. args: [],
  11146. source: "targetClassMiddle\x0a\x09^ Error",
  11147. referencedClasses: ["Error"],
  11148. //>>excludeEnd("ide");
  11149. messageSends: []
  11150. }),
  11151. $globals.MethodInheritanceTest);
  11152. $core.addMethod(
  11153. $core.method({
  11154. selector: "targetClassTop",
  11155. protocol: 'accessing',
  11156. fn: function (){
  11157. var self=this;
  11158. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  11159. return $Object();
  11160. },
  11161. //>>excludeStart("ide", pragmas.excludeIdeData);
  11162. args: [],
  11163. source: "targetClassTop\x0a\x09^ Object",
  11164. referencedClasses: ["Object"],
  11165. //>>excludeEnd("ide");
  11166. messageSends: []
  11167. }),
  11168. $globals.MethodInheritanceTest);
  11169. $core.addMethod(
  11170. $core.method({
  11171. selector: "tearDown",
  11172. protocol: 'initialization',
  11173. fn: function (){
  11174. var self=this;
  11175. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  11176. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11177. return $core.withContext(function($ctx1) {
  11178. //>>excludeEnd("ctx");
  11179. $recv((function(){
  11180. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11181. return $core.withContext(function($ctx2) {
  11182. //>>excludeEnd("ctx");
  11183. return self._deinstallTop();
  11184. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11185. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  11186. //>>excludeEnd("ctx");
  11187. }))._on_do_($Error(),(function(){
  11188. }));
  11189. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11190. $ctx1.sendIdx["on:do:"]=1;
  11191. //>>excludeEnd("ctx");
  11192. $recv((function(){
  11193. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11194. return $core.withContext(function($ctx2) {
  11195. //>>excludeEnd("ctx");
  11196. return self._deinstallMiddle();
  11197. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11198. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  11199. //>>excludeEnd("ctx");
  11200. }))._on_do_($Error(),(function(){
  11201. }));
  11202. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11203. $ctx1.sendIdx["on:do:"]=2;
  11204. //>>excludeEnd("ctx");
  11205. $recv((function(){
  11206. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11207. return $core.withContext(function($ctx2) {
  11208. //>>excludeEnd("ctx");
  11209. return self._deinstallBottom();
  11210. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11211. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,5)});
  11212. //>>excludeEnd("ctx");
  11213. }))._on_do_($Error(),(function(){
  11214. }));
  11215. return self;
  11216. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11217. }, function($ctx1) {$ctx1.fill(self,"tearDown",{},$globals.MethodInheritanceTest)});
  11218. //>>excludeEnd("ctx");
  11219. },
  11220. //>>excludeStart("ide", pragmas.excludeIdeData);
  11221. args: [],
  11222. source: "tearDown\x0a\x09[ self deinstallTop ] on: Error do: [ ].\x0a\x09[ self deinstallMiddle ] on: Error do: [ ].\x0a\x09[ self deinstallBottom ] on: Error do: [ ]",
  11223. referencedClasses: ["Error"],
  11224. //>>excludeEnd("ide");
  11225. messageSends: ["on:do:", "deinstallTop", "deinstallMiddle", "deinstallBottom"]
  11226. }),
  11227. $globals.MethodInheritanceTest);
  11228. $core.addMethod(
  11229. $core.method({
  11230. selector: "testMNU11",
  11231. protocol: 'tests',
  11232. fn: function (){
  11233. var self=this;
  11234. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11235. return $core.withContext(function($ctx1) {
  11236. //>>excludeEnd("ctx");
  11237. self["@performBlock"]=(function(x){
  11238. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11239. return $core.withContext(function($ctx2) {
  11240. //>>excludeEnd("ctx");
  11241. return $recv(x)._foo();
  11242. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11243. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)});
  11244. //>>excludeEnd("ctx");
  11245. });
  11246. self._shouldMNU();
  11247. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11248. $ctx1.sendIdx["shouldMNU"]=1;
  11249. //>>excludeEnd("ctx");
  11250. self._installTop_("foo ^ false");
  11251. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11252. $ctx1.sendIdx["installTop:"]=1;
  11253. //>>excludeEnd("ctx");
  11254. self._installTop_("foo ^ true");
  11255. self._deinstallTop();
  11256. self._shouldMNU();
  11257. return self;
  11258. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11259. }, function($ctx1) {$ctx1.fill(self,"testMNU11",{},$globals.MethodInheritanceTest)});
  11260. //>>excludeEnd("ctx");
  11261. },
  11262. //>>excludeStart("ide", pragmas.excludeIdeData);
  11263. args: [],
  11264. 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",
  11265. referencedClasses: [],
  11266. //>>excludeEnd("ide");
  11267. messageSends: ["foo", "shouldMNU", "installTop:", "deinstallTop"]
  11268. }),
  11269. $globals.MethodInheritanceTest);
  11270. $core.addMethod(
  11271. $core.method({
  11272. selector: "testMNU22",
  11273. protocol: 'tests',
  11274. fn: function (){
  11275. var self=this;
  11276. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11277. return $core.withContext(function($ctx1) {
  11278. //>>excludeEnd("ctx");
  11279. self["@performBlock"]=(function(x){
  11280. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11281. return $core.withContext(function($ctx2) {
  11282. //>>excludeEnd("ctx");
  11283. return $recv(x)._foo();
  11284. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11285. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)});
  11286. //>>excludeEnd("ctx");
  11287. });
  11288. self._shouldMNU();
  11289. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11290. $ctx1.sendIdx["shouldMNU"]=1;
  11291. //>>excludeEnd("ctx");
  11292. self._installMiddle_("foo ^ false");
  11293. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11294. $ctx1.sendIdx["installMiddle:"]=1;
  11295. //>>excludeEnd("ctx");
  11296. self._installMiddle_("foo ^ true");
  11297. self._deinstallMiddle();
  11298. self._shouldMNU();
  11299. return self;
  11300. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11301. }, function($ctx1) {$ctx1.fill(self,"testMNU22",{},$globals.MethodInheritanceTest)});
  11302. //>>excludeEnd("ctx");
  11303. },
  11304. //>>excludeStart("ide", pragmas.excludeIdeData);
  11305. args: [],
  11306. 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",
  11307. referencedClasses: [],
  11308. //>>excludeEnd("ide");
  11309. messageSends: ["foo", "shouldMNU", "installMiddle:", "deinstallMiddle"]
  11310. }),
  11311. $globals.MethodInheritanceTest);
  11312. $core.addMethod(
  11313. $core.method({
  11314. selector: "testReturns1",
  11315. protocol: 'tests',
  11316. fn: function (){
  11317. var self=this;
  11318. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11319. return $core.withContext(function($ctx1) {
  11320. //>>excludeEnd("ctx");
  11321. self["@performBlock"]=(function(x){
  11322. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11323. return $core.withContext(function($ctx2) {
  11324. //>>excludeEnd("ctx");
  11325. return $recv(x)._foo();
  11326. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11327. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)});
  11328. //>>excludeEnd("ctx");
  11329. });
  11330. self._installTop_("foo ^ false");
  11331. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11332. $ctx1.sendIdx["installTop:"]=1;
  11333. //>>excludeEnd("ctx");
  11334. self._shouldReturn_(false);
  11335. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11336. $ctx1.sendIdx["shouldReturn:"]=1;
  11337. //>>excludeEnd("ctx");
  11338. self._installTop_("foo ^ true");
  11339. self._shouldReturn_(true);
  11340. return self;
  11341. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11342. }, function($ctx1) {$ctx1.fill(self,"testReturns1",{},$globals.MethodInheritanceTest)});
  11343. //>>excludeEnd("ctx");
  11344. },
  11345. //>>excludeStart("ide", pragmas.excludeIdeData);
  11346. args: [],
  11347. 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",
  11348. referencedClasses: [],
  11349. //>>excludeEnd("ide");
  11350. messageSends: ["foo", "installTop:", "shouldReturn:"]
  11351. }),
  11352. $globals.MethodInheritanceTest);
  11353. $core.addClass('NumberTest', $globals.TestCase, [], 'Kernel-Tests');
  11354. $core.addMethod(
  11355. $core.method({
  11356. selector: "testAbs",
  11357. protocol: 'tests',
  11358. fn: function (){
  11359. var self=this;
  11360. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11361. return $core.withContext(function($ctx1) {
  11362. //>>excludeEnd("ctx");
  11363. var $1;
  11364. $1=(4)._abs();
  11365. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11366. $ctx1.sendIdx["abs"]=1;
  11367. //>>excludeEnd("ctx");
  11368. self._assert_equals_($1,(4));
  11369. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11370. $ctx1.sendIdx["assert:equals:"]=1;
  11371. //>>excludeEnd("ctx");
  11372. self._assert_equals_((-4)._abs(),(4));
  11373. return self;
  11374. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11375. }, function($ctx1) {$ctx1.fill(self,"testAbs",{},$globals.NumberTest)});
  11376. //>>excludeEnd("ctx");
  11377. },
  11378. //>>excludeStart("ide", pragmas.excludeIdeData);
  11379. args: [],
  11380. source: "testAbs\x0a\x09self assert: 4 abs equals: 4.\x0a\x09self assert: -4 abs equals: 4",
  11381. referencedClasses: [],
  11382. //>>excludeEnd("ide");
  11383. messageSends: ["assert:equals:", "abs"]
  11384. }),
  11385. $globals.NumberTest);
  11386. $core.addMethod(
  11387. $core.method({
  11388. selector: "testArithmetic",
  11389. protocol: 'tests',
  11390. fn: function (){
  11391. var self=this;
  11392. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11393. return $core.withContext(function($ctx1) {
  11394. //>>excludeEnd("ctx");
  11395. var $1,$2,$3,$5,$4;
  11396. $1=(1.5).__plus((1));
  11397. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11398. $ctx1.sendIdx["+"]=1;
  11399. //>>excludeEnd("ctx");
  11400. self._assert_equals_($1,(2.5));
  11401. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11402. $ctx1.sendIdx["assert:equals:"]=1;
  11403. //>>excludeEnd("ctx");
  11404. $2=(2).__minus((1));
  11405. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11406. $ctx1.sendIdx["-"]=1;
  11407. //>>excludeEnd("ctx");
  11408. self._assert_equals_($2,(1));
  11409. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11410. $ctx1.sendIdx["assert:equals:"]=2;
  11411. //>>excludeEnd("ctx");
  11412. self._assert_equals_((-2).__minus((1)),(-3));
  11413. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11414. $ctx1.sendIdx["assert:equals:"]=3;
  11415. //>>excludeEnd("ctx");
  11416. self._assert_equals_((12).__slash((2)),(6));
  11417. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11418. $ctx1.sendIdx["assert:equals:"]=4;
  11419. //>>excludeEnd("ctx");
  11420. $3=(3).__star((4));
  11421. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11422. $ctx1.sendIdx["*"]=1;
  11423. //>>excludeEnd("ctx");
  11424. self._assert_equals_($3,(12));
  11425. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11426. $ctx1.sendIdx["assert:equals:"]=5;
  11427. //>>excludeEnd("ctx");
  11428. self._assert_equals_((7).__slash_slash((2)),(3));
  11429. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11430. $ctx1.sendIdx["assert:equals:"]=6;
  11431. //>>excludeEnd("ctx");
  11432. self._assert_equals_((7).__backslash_backslash((2)),(1));
  11433. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11434. $ctx1.sendIdx["assert:equals:"]=7;
  11435. //>>excludeEnd("ctx");
  11436. $5=(1).__plus((2));
  11437. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11438. $ctx1.sendIdx["+"]=2;
  11439. //>>excludeEnd("ctx");
  11440. $4=$recv($5).__star((3));
  11441. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11442. $ctx1.sendIdx["*"]=2;
  11443. //>>excludeEnd("ctx");
  11444. self._assert_equals_($4,(9));
  11445. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11446. $ctx1.sendIdx["assert:equals:"]=8;
  11447. //>>excludeEnd("ctx");
  11448. self._assert_equals_((1).__plus((2).__star((3))),(7));
  11449. return self;
  11450. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11451. }, function($ctx1) {$ctx1.fill(self,"testArithmetic",{},$globals.NumberTest)});
  11452. //>>excludeEnd("ctx");
  11453. },
  11454. //>>excludeStart("ide", pragmas.excludeIdeData);
  11455. args: [],
  11456. 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",
  11457. referencedClasses: [],
  11458. //>>excludeEnd("ide");
  11459. messageSends: ["assert:equals:", "+", "-", "/", "*", "//", "\x5c\x5c"]
  11460. }),
  11461. $globals.NumberTest);
  11462. $core.addMethod(
  11463. $core.method({
  11464. selector: "testAsNumber",
  11465. protocol: 'tests',
  11466. fn: function (){
  11467. var self=this;
  11468. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11469. return $core.withContext(function($ctx1) {
  11470. //>>excludeEnd("ctx");
  11471. self._assert_equals_((3)._asNumber(),(3));
  11472. return self;
  11473. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11474. }, function($ctx1) {$ctx1.fill(self,"testAsNumber",{},$globals.NumberTest)});
  11475. //>>excludeEnd("ctx");
  11476. },
  11477. //>>excludeStart("ide", pragmas.excludeIdeData);
  11478. args: [],
  11479. source: "testAsNumber\x0a\x09self assert: 3 asNumber equals: 3.",
  11480. referencedClasses: [],
  11481. //>>excludeEnd("ide");
  11482. messageSends: ["assert:equals:", "asNumber"]
  11483. }),
  11484. $globals.NumberTest);
  11485. $core.addMethod(
  11486. $core.method({
  11487. selector: "testCeiling",
  11488. protocol: 'tests',
  11489. fn: function (){
  11490. var self=this;
  11491. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11492. return $core.withContext(function($ctx1) {
  11493. //>>excludeEnd("ctx");
  11494. var $1,$2;
  11495. $1=(1.2)._ceiling();
  11496. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11497. $ctx1.sendIdx["ceiling"]=1;
  11498. //>>excludeEnd("ctx");
  11499. self._assert_equals_($1,(2));
  11500. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11501. $ctx1.sendIdx["assert:equals:"]=1;
  11502. //>>excludeEnd("ctx");
  11503. $2=(-1.2)._ceiling();
  11504. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11505. $ctx1.sendIdx["ceiling"]=2;
  11506. //>>excludeEnd("ctx");
  11507. self._assert_equals_($2,(-1));
  11508. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11509. $ctx1.sendIdx["assert:equals:"]=2;
  11510. //>>excludeEnd("ctx");
  11511. self._assert_equals_((1)._ceiling(),(1));
  11512. return self;
  11513. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11514. }, function($ctx1) {$ctx1.fill(self,"testCeiling",{},$globals.NumberTest)});
  11515. //>>excludeEnd("ctx");
  11516. },
  11517. //>>excludeStart("ide", pragmas.excludeIdeData);
  11518. args: [],
  11519. 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.",
  11520. referencedClasses: [],
  11521. //>>excludeEnd("ide");
  11522. messageSends: ["assert:equals:", "ceiling"]
  11523. }),
  11524. $globals.NumberTest);
  11525. $core.addMethod(
  11526. $core.method({
  11527. selector: "testComparison",
  11528. protocol: 'tests',
  11529. fn: function (){
  11530. var self=this;
  11531. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11532. return $core.withContext(function($ctx1) {
  11533. //>>excludeEnd("ctx");
  11534. var $1,$2,$3,$4;
  11535. $1=(3).__gt((2));
  11536. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11537. $ctx1.sendIdx[">"]=1;
  11538. //>>excludeEnd("ctx");
  11539. self._assert_($1);
  11540. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11541. $ctx1.sendIdx["assert:"]=1;
  11542. //>>excludeEnd("ctx");
  11543. $2=(2).__lt((3));
  11544. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11545. $ctx1.sendIdx["<"]=1;
  11546. //>>excludeEnd("ctx");
  11547. self._assert_($2);
  11548. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11549. $ctx1.sendIdx["assert:"]=2;
  11550. //>>excludeEnd("ctx");
  11551. self._deny_((3).__lt((2)));
  11552. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11553. $ctx1.sendIdx["deny:"]=1;
  11554. //>>excludeEnd("ctx");
  11555. self._deny_((2).__gt((3)));
  11556. $3=(3).__gt_eq((3));
  11557. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11558. $ctx1.sendIdx[">="]=1;
  11559. //>>excludeEnd("ctx");
  11560. self._assert_($3);
  11561. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11562. $ctx1.sendIdx["assert:"]=3;
  11563. //>>excludeEnd("ctx");
  11564. self._assert_((3.1).__gt_eq((3)));
  11565. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11566. $ctx1.sendIdx["assert:"]=4;
  11567. //>>excludeEnd("ctx");
  11568. $4=(3).__lt_eq((3));
  11569. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11570. $ctx1.sendIdx["<="]=1;
  11571. //>>excludeEnd("ctx");
  11572. self._assert_($4);
  11573. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11574. $ctx1.sendIdx["assert:"]=5;
  11575. //>>excludeEnd("ctx");
  11576. self._assert_((3).__lt_eq((3.1)));
  11577. return self;
  11578. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11579. }, function($ctx1) {$ctx1.fill(self,"testComparison",{},$globals.NumberTest)});
  11580. //>>excludeEnd("ctx");
  11581. },
  11582. //>>excludeStart("ide", pragmas.excludeIdeData);
  11583. args: [],
  11584. 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",
  11585. referencedClasses: [],
  11586. //>>excludeEnd("ide");
  11587. messageSends: ["assert:", ">", "<", "deny:", ">=", "<="]
  11588. }),
  11589. $globals.NumberTest);
  11590. $core.addMethod(
  11591. $core.method({
  11592. selector: "testCopying",
  11593. protocol: 'tests',
  11594. fn: function (){
  11595. var self=this;
  11596. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11597. return $core.withContext(function($ctx1) {
  11598. //>>excludeEnd("ctx");
  11599. var $1;
  11600. $1=$recv((1)._copy()).__eq_eq((1));
  11601. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11602. $ctx1.sendIdx["=="]=1;
  11603. //>>excludeEnd("ctx");
  11604. self._assert_($1);
  11605. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11606. $ctx1.sendIdx["assert:"]=1;
  11607. //>>excludeEnd("ctx");
  11608. self._assert_($recv((1)._deepCopy()).__eq_eq((1)));
  11609. return self;
  11610. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11611. }, function($ctx1) {$ctx1.fill(self,"testCopying",{},$globals.NumberTest)});
  11612. //>>excludeEnd("ctx");
  11613. },
  11614. //>>excludeStart("ide", pragmas.excludeIdeData);
  11615. args: [],
  11616. source: "testCopying\x0a\x09self assert: 1 copy == 1.\x0a\x09self assert: 1 deepCopy == 1",
  11617. referencedClasses: [],
  11618. //>>excludeEnd("ide");
  11619. messageSends: ["assert:", "==", "copy", "deepCopy"]
  11620. }),
  11621. $globals.NumberTest);
  11622. $core.addMethod(
  11623. $core.method({
  11624. selector: "testEquality",
  11625. protocol: 'tests',
  11626. fn: function (){
  11627. var self=this;
  11628. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11629. return $core.withContext(function($ctx1) {
  11630. //>>excludeEnd("ctx");
  11631. var $1,$2,$3,$5,$4,$7,$6,$9,$8,$10,$11,$12;
  11632. $1=(1).__eq((1));
  11633. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11634. $ctx1.sendIdx["="]=1;
  11635. //>>excludeEnd("ctx");
  11636. self._assert_($1);
  11637. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11638. $ctx1.sendIdx["assert:"]=1;
  11639. //>>excludeEnd("ctx");
  11640. $2=(0).__eq((0));
  11641. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11642. $ctx1.sendIdx["="]=2;
  11643. //>>excludeEnd("ctx");
  11644. self._assert_($2);
  11645. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11646. $ctx1.sendIdx["assert:"]=2;
  11647. //>>excludeEnd("ctx");
  11648. $3=(1).__eq((0));
  11649. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11650. $ctx1.sendIdx["="]=3;
  11651. //>>excludeEnd("ctx");
  11652. self._deny_($3);
  11653. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11654. $ctx1.sendIdx["deny:"]=1;
  11655. //>>excludeEnd("ctx");
  11656. $5=(1)._yourself();
  11657. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11658. $ctx1.sendIdx["yourself"]=1;
  11659. //>>excludeEnd("ctx");
  11660. $4=$recv($5).__eq((1));
  11661. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11662. $ctx1.sendIdx["="]=4;
  11663. //>>excludeEnd("ctx");
  11664. self._assert_($4);
  11665. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11666. $ctx1.sendIdx["assert:"]=3;
  11667. //>>excludeEnd("ctx");
  11668. $7=(1)._yourself();
  11669. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11670. $ctx1.sendIdx["yourself"]=2;
  11671. //>>excludeEnd("ctx");
  11672. $6=(1).__eq($7);
  11673. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11674. $ctx1.sendIdx["="]=5;
  11675. //>>excludeEnd("ctx");
  11676. self._assert_($6);
  11677. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11678. $ctx1.sendIdx["assert:"]=4;
  11679. //>>excludeEnd("ctx");
  11680. $9=(1)._yourself();
  11681. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11682. $ctx1.sendIdx["yourself"]=3;
  11683. //>>excludeEnd("ctx");
  11684. $8=$recv($9).__eq((1)._yourself());
  11685. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11686. $ctx1.sendIdx["="]=6;
  11687. //>>excludeEnd("ctx");
  11688. self._assert_($8);
  11689. $10=(0).__eq(false);
  11690. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11691. $ctx1.sendIdx["="]=7;
  11692. //>>excludeEnd("ctx");
  11693. self._deny_($10);
  11694. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11695. $ctx1.sendIdx["deny:"]=2;
  11696. //>>excludeEnd("ctx");
  11697. $11=false.__eq((0));
  11698. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11699. $ctx1.sendIdx["="]=8;
  11700. //>>excludeEnd("ctx");
  11701. self._deny_($11);
  11702. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11703. $ctx1.sendIdx["deny:"]=3;
  11704. //>>excludeEnd("ctx");
  11705. $12="".__eq((0));
  11706. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11707. $ctx1.sendIdx["="]=9;
  11708. //>>excludeEnd("ctx");
  11709. self._deny_($12);
  11710. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11711. $ctx1.sendIdx["deny:"]=4;
  11712. //>>excludeEnd("ctx");
  11713. self._deny_((0).__eq(""));
  11714. return self;
  11715. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11716. }, function($ctx1) {$ctx1.fill(self,"testEquality",{},$globals.NumberTest)});
  11717. //>>excludeEnd("ctx");
  11718. },
  11719. //>>excludeStart("ide", pragmas.excludeIdeData);
  11720. args: [],
  11721. 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 = ''",
  11722. referencedClasses: [],
  11723. //>>excludeEnd("ide");
  11724. messageSends: ["assert:", "=", "deny:", "yourself"]
  11725. }),
  11726. $globals.NumberTest);
  11727. $core.addMethod(
  11728. $core.method({
  11729. selector: "testFloor",
  11730. protocol: 'tests',
  11731. fn: function (){
  11732. var self=this;
  11733. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11734. return $core.withContext(function($ctx1) {
  11735. //>>excludeEnd("ctx");
  11736. var $1,$2;
  11737. $1=(1.2)._floor();
  11738. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11739. $ctx1.sendIdx["floor"]=1;
  11740. //>>excludeEnd("ctx");
  11741. self._assert_equals_($1,(1));
  11742. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11743. $ctx1.sendIdx["assert:equals:"]=1;
  11744. //>>excludeEnd("ctx");
  11745. $2=(-1.2)._floor();
  11746. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11747. $ctx1.sendIdx["floor"]=2;
  11748. //>>excludeEnd("ctx");
  11749. self._assert_equals_($2,(-2));
  11750. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11751. $ctx1.sendIdx["assert:equals:"]=2;
  11752. //>>excludeEnd("ctx");
  11753. self._assert_equals_((1)._floor(),(1));
  11754. return self;
  11755. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11756. }, function($ctx1) {$ctx1.fill(self,"testFloor",{},$globals.NumberTest)});
  11757. //>>excludeEnd("ctx");
  11758. },
  11759. //>>excludeStart("ide", pragmas.excludeIdeData);
  11760. args: [],
  11761. 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.",
  11762. referencedClasses: [],
  11763. //>>excludeEnd("ide");
  11764. messageSends: ["assert:equals:", "floor"]
  11765. }),
  11766. $globals.NumberTest);
  11767. $core.addMethod(
  11768. $core.method({
  11769. selector: "testHexNumbers",
  11770. protocol: 'tests',
  11771. fn: function (){
  11772. var self=this;
  11773. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11774. return $core.withContext(function($ctx1) {
  11775. //>>excludeEnd("ctx");
  11776. var $1,$2,$3,$4,$5;
  11777. self._assert_equals_((9),(9));
  11778. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11779. $ctx1.sendIdx["assert:equals:"]=1;
  11780. //>>excludeEnd("ctx");
  11781. $1=(10)._truncated();
  11782. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11783. $ctx1.sendIdx["truncated"]=1;
  11784. //>>excludeEnd("ctx");
  11785. self._assert_equals_($1,(10));
  11786. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11787. $ctx1.sendIdx["assert:equals:"]=2;
  11788. //>>excludeEnd("ctx");
  11789. $2=(11)._truncated();
  11790. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11791. $ctx1.sendIdx["truncated"]=2;
  11792. //>>excludeEnd("ctx");
  11793. self._assert_equals_($2,(11));
  11794. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11795. $ctx1.sendIdx["assert:equals:"]=3;
  11796. //>>excludeEnd("ctx");
  11797. $3=(12)._truncated();
  11798. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11799. $ctx1.sendIdx["truncated"]=3;
  11800. //>>excludeEnd("ctx");
  11801. self._assert_equals_($3,(12));
  11802. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11803. $ctx1.sendIdx["assert:equals:"]=4;
  11804. //>>excludeEnd("ctx");
  11805. $4=(13)._truncated();
  11806. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11807. $ctx1.sendIdx["truncated"]=4;
  11808. //>>excludeEnd("ctx");
  11809. self._assert_equals_($4,(13));
  11810. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11811. $ctx1.sendIdx["assert:equals:"]=5;
  11812. //>>excludeEnd("ctx");
  11813. $5=(14)._truncated();
  11814. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11815. $ctx1.sendIdx["truncated"]=5;
  11816. //>>excludeEnd("ctx");
  11817. self._assert_equals_($5,(14));
  11818. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11819. $ctx1.sendIdx["assert:equals:"]=6;
  11820. //>>excludeEnd("ctx");
  11821. self._assert_equals_((15)._truncated(),(15));
  11822. return self;
  11823. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11824. }, function($ctx1) {$ctx1.fill(self,"testHexNumbers",{},$globals.NumberTest)});
  11825. //>>excludeEnd("ctx");
  11826. },
  11827. //>>excludeStart("ide", pragmas.excludeIdeData);
  11828. args: [],
  11829. 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",
  11830. referencedClasses: [],
  11831. //>>excludeEnd("ide");
  11832. messageSends: ["assert:equals:", "truncated"]
  11833. }),
  11834. $globals.NumberTest);
  11835. $core.addMethod(
  11836. $core.method({
  11837. selector: "testIdentity",
  11838. protocol: 'tests',
  11839. fn: function (){
  11840. var self=this;
  11841. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11842. return $core.withContext(function($ctx1) {
  11843. //>>excludeEnd("ctx");
  11844. var $1,$2,$3,$5,$4,$7,$6,$9,$8;
  11845. $1=(1).__eq_eq((1));
  11846. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11847. $ctx1.sendIdx["=="]=1;
  11848. //>>excludeEnd("ctx");
  11849. self._assert_($1);
  11850. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11851. $ctx1.sendIdx["assert:"]=1;
  11852. //>>excludeEnd("ctx");
  11853. $2=(0).__eq_eq((0));
  11854. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11855. $ctx1.sendIdx["=="]=2;
  11856. //>>excludeEnd("ctx");
  11857. self._assert_($2);
  11858. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11859. $ctx1.sendIdx["assert:"]=2;
  11860. //>>excludeEnd("ctx");
  11861. $3=(1).__eq_eq((0));
  11862. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11863. $ctx1.sendIdx["=="]=3;
  11864. //>>excludeEnd("ctx");
  11865. self._deny_($3);
  11866. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11867. $ctx1.sendIdx["deny:"]=1;
  11868. //>>excludeEnd("ctx");
  11869. $5=(1)._yourself();
  11870. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11871. $ctx1.sendIdx["yourself"]=1;
  11872. //>>excludeEnd("ctx");
  11873. $4=$recv($5).__eq_eq((1));
  11874. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11875. $ctx1.sendIdx["=="]=4;
  11876. //>>excludeEnd("ctx");
  11877. self._assert_($4);
  11878. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11879. $ctx1.sendIdx["assert:"]=3;
  11880. //>>excludeEnd("ctx");
  11881. $7=(1)._yourself();
  11882. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11883. $ctx1.sendIdx["yourself"]=2;
  11884. //>>excludeEnd("ctx");
  11885. $6=(1).__eq_eq($7);
  11886. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11887. $ctx1.sendIdx["=="]=5;
  11888. //>>excludeEnd("ctx");
  11889. self._assert_($6);
  11890. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11891. $ctx1.sendIdx["assert:"]=4;
  11892. //>>excludeEnd("ctx");
  11893. $9=(1)._yourself();
  11894. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11895. $ctx1.sendIdx["yourself"]=3;
  11896. //>>excludeEnd("ctx");
  11897. $8=$recv($9).__eq_eq((1)._yourself());
  11898. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11899. $ctx1.sendIdx["=="]=6;
  11900. //>>excludeEnd("ctx");
  11901. self._assert_($8);
  11902. self._deny_((1).__eq_eq((2)));
  11903. return self;
  11904. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11905. }, function($ctx1) {$ctx1.fill(self,"testIdentity",{},$globals.NumberTest)});
  11906. //>>excludeEnd("ctx");
  11907. },
  11908. //>>excludeStart("ide", pragmas.excludeIdeData);
  11909. args: [],
  11910. 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",
  11911. referencedClasses: [],
  11912. //>>excludeEnd("ide");
  11913. messageSends: ["assert:", "==", "deny:", "yourself"]
  11914. }),
  11915. $globals.NumberTest);
  11916. $core.addMethod(
  11917. $core.method({
  11918. selector: "testInvalidHexNumbers",
  11919. protocol: 'tests',
  11920. fn: function (){
  11921. var self=this;
  11922. function $MessageNotUnderstood(){return $globals.MessageNotUnderstood||(typeof MessageNotUnderstood=="undefined"?nil:MessageNotUnderstood)}
  11923. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11924. return $core.withContext(function($ctx1) {
  11925. //>>excludeEnd("ctx");
  11926. self._should_raise_((function(){
  11927. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11928. return $core.withContext(function($ctx2) {
  11929. //>>excludeEnd("ctx");
  11930. return (16)._rG();
  11931. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11932. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  11933. //>>excludeEnd("ctx");
  11934. }),$MessageNotUnderstood());
  11935. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11936. $ctx1.sendIdx["should:raise:"]=1;
  11937. //>>excludeEnd("ctx");
  11938. self._should_raise_((function(){
  11939. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11940. return $core.withContext(function($ctx2) {
  11941. //>>excludeEnd("ctx");
  11942. return (16)._rg();
  11943. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11944. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  11945. //>>excludeEnd("ctx");
  11946. }),$MessageNotUnderstood());
  11947. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11948. $ctx1.sendIdx["should:raise:"]=2;
  11949. //>>excludeEnd("ctx");
  11950. self._should_raise_((function(){
  11951. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11952. return $core.withContext(function($ctx2) {
  11953. //>>excludeEnd("ctx");
  11954. return (16)._rH();
  11955. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11956. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  11957. //>>excludeEnd("ctx");
  11958. }),$MessageNotUnderstood());
  11959. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11960. $ctx1.sendIdx["should:raise:"]=3;
  11961. //>>excludeEnd("ctx");
  11962. self._should_raise_((function(){
  11963. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11964. return $core.withContext(function($ctx2) {
  11965. //>>excludeEnd("ctx");
  11966. return (16)._rh();
  11967. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11968. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,4)});
  11969. //>>excludeEnd("ctx");
  11970. }),$MessageNotUnderstood());
  11971. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11972. $ctx1.sendIdx["should:raise:"]=4;
  11973. //>>excludeEnd("ctx");
  11974. self._should_raise_((function(){
  11975. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11976. return $core.withContext(function($ctx2) {
  11977. //>>excludeEnd("ctx");
  11978. return (16)._rI();
  11979. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11980. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,5)});
  11981. //>>excludeEnd("ctx");
  11982. }),$MessageNotUnderstood());
  11983. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11984. $ctx1.sendIdx["should:raise:"]=5;
  11985. //>>excludeEnd("ctx");
  11986. self._should_raise_((function(){
  11987. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11988. return $core.withContext(function($ctx2) {
  11989. //>>excludeEnd("ctx");
  11990. return (16)._ri();
  11991. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11992. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,6)});
  11993. //>>excludeEnd("ctx");
  11994. }),$MessageNotUnderstood());
  11995. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11996. $ctx1.sendIdx["should:raise:"]=6;
  11997. //>>excludeEnd("ctx");
  11998. self._should_raise_((function(){
  11999. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12000. return $core.withContext(function($ctx2) {
  12001. //>>excludeEnd("ctx");
  12002. return (16)._rJ();
  12003. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12004. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,7)});
  12005. //>>excludeEnd("ctx");
  12006. }),$MessageNotUnderstood());
  12007. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12008. $ctx1.sendIdx["should:raise:"]=7;
  12009. //>>excludeEnd("ctx");
  12010. self._should_raise_((function(){
  12011. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12012. return $core.withContext(function($ctx2) {
  12013. //>>excludeEnd("ctx");
  12014. return (16)._rj();
  12015. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12016. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,8)});
  12017. //>>excludeEnd("ctx");
  12018. }),$MessageNotUnderstood());
  12019. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12020. $ctx1.sendIdx["should:raise:"]=8;
  12021. //>>excludeEnd("ctx");
  12022. self._should_raise_((function(){
  12023. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12024. return $core.withContext(function($ctx2) {
  12025. //>>excludeEnd("ctx");
  12026. return (16)._rK();
  12027. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12028. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,9)});
  12029. //>>excludeEnd("ctx");
  12030. }),$MessageNotUnderstood());
  12031. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12032. $ctx1.sendIdx["should:raise:"]=9;
  12033. //>>excludeEnd("ctx");
  12034. self._should_raise_((function(){
  12035. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12036. return $core.withContext(function($ctx2) {
  12037. //>>excludeEnd("ctx");
  12038. return (16)._rk();
  12039. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12040. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,10)});
  12041. //>>excludeEnd("ctx");
  12042. }),$MessageNotUnderstood());
  12043. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12044. $ctx1.sendIdx["should:raise:"]=10;
  12045. //>>excludeEnd("ctx");
  12046. self._should_raise_((function(){
  12047. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12048. return $core.withContext(function($ctx2) {
  12049. //>>excludeEnd("ctx");
  12050. return (16)._rL();
  12051. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12052. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,11)});
  12053. //>>excludeEnd("ctx");
  12054. }),$MessageNotUnderstood());
  12055. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12056. $ctx1.sendIdx["should:raise:"]=11;
  12057. //>>excludeEnd("ctx");
  12058. self._should_raise_((function(){
  12059. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12060. return $core.withContext(function($ctx2) {
  12061. //>>excludeEnd("ctx");
  12062. return (16)._rl();
  12063. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12064. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,12)});
  12065. //>>excludeEnd("ctx");
  12066. }),$MessageNotUnderstood());
  12067. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12068. $ctx1.sendIdx["should:raise:"]=12;
  12069. //>>excludeEnd("ctx");
  12070. self._should_raise_((function(){
  12071. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12072. return $core.withContext(function($ctx2) {
  12073. //>>excludeEnd("ctx");
  12074. return (16)._rM();
  12075. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12076. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,13)});
  12077. //>>excludeEnd("ctx");
  12078. }),$MessageNotUnderstood());
  12079. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12080. $ctx1.sendIdx["should:raise:"]=13;
  12081. //>>excludeEnd("ctx");
  12082. self._should_raise_((function(){
  12083. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12084. return $core.withContext(function($ctx2) {
  12085. //>>excludeEnd("ctx");
  12086. return (16)._rm();
  12087. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12088. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,14)});
  12089. //>>excludeEnd("ctx");
  12090. }),$MessageNotUnderstood());
  12091. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12092. $ctx1.sendIdx["should:raise:"]=14;
  12093. //>>excludeEnd("ctx");
  12094. self._should_raise_((function(){
  12095. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12096. return $core.withContext(function($ctx2) {
  12097. //>>excludeEnd("ctx");
  12098. return (16)._rN();
  12099. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12100. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,15)});
  12101. //>>excludeEnd("ctx");
  12102. }),$MessageNotUnderstood());
  12103. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12104. $ctx1.sendIdx["should:raise:"]=15;
  12105. //>>excludeEnd("ctx");
  12106. self._should_raise_((function(){
  12107. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12108. return $core.withContext(function($ctx2) {
  12109. //>>excludeEnd("ctx");
  12110. return (16)._rn();
  12111. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12112. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,16)});
  12113. //>>excludeEnd("ctx");
  12114. }),$MessageNotUnderstood());
  12115. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12116. $ctx1.sendIdx["should:raise:"]=16;
  12117. //>>excludeEnd("ctx");
  12118. self._should_raise_((function(){
  12119. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12120. return $core.withContext(function($ctx2) {
  12121. //>>excludeEnd("ctx");
  12122. return (16)._rO();
  12123. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12124. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,17)});
  12125. //>>excludeEnd("ctx");
  12126. }),$MessageNotUnderstood());
  12127. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12128. $ctx1.sendIdx["should:raise:"]=17;
  12129. //>>excludeEnd("ctx");
  12130. self._should_raise_((function(){
  12131. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12132. return $core.withContext(function($ctx2) {
  12133. //>>excludeEnd("ctx");
  12134. return (16)._ro();
  12135. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12136. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,18)});
  12137. //>>excludeEnd("ctx");
  12138. }),$MessageNotUnderstood());
  12139. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12140. $ctx1.sendIdx["should:raise:"]=18;
  12141. //>>excludeEnd("ctx");
  12142. self._should_raise_((function(){
  12143. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12144. return $core.withContext(function($ctx2) {
  12145. //>>excludeEnd("ctx");
  12146. return (16)._rP();
  12147. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12148. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,19)});
  12149. //>>excludeEnd("ctx");
  12150. }),$MessageNotUnderstood());
  12151. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12152. $ctx1.sendIdx["should:raise:"]=19;
  12153. //>>excludeEnd("ctx");
  12154. self._should_raise_((function(){
  12155. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12156. return $core.withContext(function($ctx2) {
  12157. //>>excludeEnd("ctx");
  12158. return (16)._rp();
  12159. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12160. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,20)});
  12161. //>>excludeEnd("ctx");
  12162. }),$MessageNotUnderstood());
  12163. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12164. $ctx1.sendIdx["should:raise:"]=20;
  12165. //>>excludeEnd("ctx");
  12166. self._should_raise_((function(){
  12167. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12168. return $core.withContext(function($ctx2) {
  12169. //>>excludeEnd("ctx");
  12170. return (16)._rQ();
  12171. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12172. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,21)});
  12173. //>>excludeEnd("ctx");
  12174. }),$MessageNotUnderstood());
  12175. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12176. $ctx1.sendIdx["should:raise:"]=21;
  12177. //>>excludeEnd("ctx");
  12178. self._should_raise_((function(){
  12179. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12180. return $core.withContext(function($ctx2) {
  12181. //>>excludeEnd("ctx");
  12182. return (16)._rq();
  12183. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12184. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,22)});
  12185. //>>excludeEnd("ctx");
  12186. }),$MessageNotUnderstood());
  12187. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12188. $ctx1.sendIdx["should:raise:"]=22;
  12189. //>>excludeEnd("ctx");
  12190. self._should_raise_((function(){
  12191. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12192. return $core.withContext(function($ctx2) {
  12193. //>>excludeEnd("ctx");
  12194. return (16)._rR();
  12195. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12196. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,23)});
  12197. //>>excludeEnd("ctx");
  12198. }),$MessageNotUnderstood());
  12199. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12200. $ctx1.sendIdx["should:raise:"]=23;
  12201. //>>excludeEnd("ctx");
  12202. self._should_raise_((function(){
  12203. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12204. return $core.withContext(function($ctx2) {
  12205. //>>excludeEnd("ctx");
  12206. return (16)._rr();
  12207. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12208. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,24)});
  12209. //>>excludeEnd("ctx");
  12210. }),$MessageNotUnderstood());
  12211. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12212. $ctx1.sendIdx["should:raise:"]=24;
  12213. //>>excludeEnd("ctx");
  12214. self._should_raise_((function(){
  12215. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12216. return $core.withContext(function($ctx2) {
  12217. //>>excludeEnd("ctx");
  12218. return (16)._rS();
  12219. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12220. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,25)});
  12221. //>>excludeEnd("ctx");
  12222. }),$MessageNotUnderstood());
  12223. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12224. $ctx1.sendIdx["should:raise:"]=25;
  12225. //>>excludeEnd("ctx");
  12226. self._should_raise_((function(){
  12227. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12228. return $core.withContext(function($ctx2) {
  12229. //>>excludeEnd("ctx");
  12230. return (16)._rs();
  12231. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12232. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,26)});
  12233. //>>excludeEnd("ctx");
  12234. }),$MessageNotUnderstood());
  12235. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12236. $ctx1.sendIdx["should:raise:"]=26;
  12237. //>>excludeEnd("ctx");
  12238. self._should_raise_((function(){
  12239. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12240. return $core.withContext(function($ctx2) {
  12241. //>>excludeEnd("ctx");
  12242. return (16)._rT();
  12243. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12244. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,27)});
  12245. //>>excludeEnd("ctx");
  12246. }),$MessageNotUnderstood());
  12247. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12248. $ctx1.sendIdx["should:raise:"]=27;
  12249. //>>excludeEnd("ctx");
  12250. self._should_raise_((function(){
  12251. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12252. return $core.withContext(function($ctx2) {
  12253. //>>excludeEnd("ctx");
  12254. return (16)._rt();
  12255. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12256. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,28)});
  12257. //>>excludeEnd("ctx");
  12258. }),$MessageNotUnderstood());
  12259. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12260. $ctx1.sendIdx["should:raise:"]=28;
  12261. //>>excludeEnd("ctx");
  12262. self._should_raise_((function(){
  12263. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12264. return $core.withContext(function($ctx2) {
  12265. //>>excludeEnd("ctx");
  12266. return (16)._rU();
  12267. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12268. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,29)});
  12269. //>>excludeEnd("ctx");
  12270. }),$MessageNotUnderstood());
  12271. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12272. $ctx1.sendIdx["should:raise:"]=29;
  12273. //>>excludeEnd("ctx");
  12274. self._should_raise_((function(){
  12275. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12276. return $core.withContext(function($ctx2) {
  12277. //>>excludeEnd("ctx");
  12278. return (16)._ru();
  12279. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12280. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,30)});
  12281. //>>excludeEnd("ctx");
  12282. }),$MessageNotUnderstood());
  12283. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12284. $ctx1.sendIdx["should:raise:"]=30;
  12285. //>>excludeEnd("ctx");
  12286. self._should_raise_((function(){
  12287. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12288. return $core.withContext(function($ctx2) {
  12289. //>>excludeEnd("ctx");
  12290. return (16)._rV();
  12291. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12292. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,31)});
  12293. //>>excludeEnd("ctx");
  12294. }),$MessageNotUnderstood());
  12295. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12296. $ctx1.sendIdx["should:raise:"]=31;
  12297. //>>excludeEnd("ctx");
  12298. self._should_raise_((function(){
  12299. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12300. return $core.withContext(function($ctx2) {
  12301. //>>excludeEnd("ctx");
  12302. return (16)._rv();
  12303. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12304. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,32)});
  12305. //>>excludeEnd("ctx");
  12306. }),$MessageNotUnderstood());
  12307. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12308. $ctx1.sendIdx["should:raise:"]=32;
  12309. //>>excludeEnd("ctx");
  12310. self._should_raise_((function(){
  12311. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12312. return $core.withContext(function($ctx2) {
  12313. //>>excludeEnd("ctx");
  12314. return (16)._rW();
  12315. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12316. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,33)});
  12317. //>>excludeEnd("ctx");
  12318. }),$MessageNotUnderstood());
  12319. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12320. $ctx1.sendIdx["should:raise:"]=33;
  12321. //>>excludeEnd("ctx");
  12322. self._should_raise_((function(){
  12323. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12324. return $core.withContext(function($ctx2) {
  12325. //>>excludeEnd("ctx");
  12326. return (16)._rw();
  12327. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12328. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,34)});
  12329. //>>excludeEnd("ctx");
  12330. }),$MessageNotUnderstood());
  12331. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12332. $ctx1.sendIdx["should:raise:"]=34;
  12333. //>>excludeEnd("ctx");
  12334. self._should_raise_((function(){
  12335. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12336. return $core.withContext(function($ctx2) {
  12337. //>>excludeEnd("ctx");
  12338. return (16)._rX();
  12339. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12340. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,35)});
  12341. //>>excludeEnd("ctx");
  12342. }),$MessageNotUnderstood());
  12343. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12344. $ctx1.sendIdx["should:raise:"]=35;
  12345. //>>excludeEnd("ctx");
  12346. self._should_raise_((function(){
  12347. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12348. return $core.withContext(function($ctx2) {
  12349. //>>excludeEnd("ctx");
  12350. return (16)._rx();
  12351. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12352. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,36)});
  12353. //>>excludeEnd("ctx");
  12354. }),$MessageNotUnderstood());
  12355. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12356. $ctx1.sendIdx["should:raise:"]=36;
  12357. //>>excludeEnd("ctx");
  12358. self._should_raise_((function(){
  12359. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12360. return $core.withContext(function($ctx2) {
  12361. //>>excludeEnd("ctx");
  12362. return (16)._rY();
  12363. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12364. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,37)});
  12365. //>>excludeEnd("ctx");
  12366. }),$MessageNotUnderstood());
  12367. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12368. $ctx1.sendIdx["should:raise:"]=37;
  12369. //>>excludeEnd("ctx");
  12370. self._should_raise_((function(){
  12371. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12372. return $core.withContext(function($ctx2) {
  12373. //>>excludeEnd("ctx");
  12374. return (16)._ry();
  12375. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12376. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,38)});
  12377. //>>excludeEnd("ctx");
  12378. }),$MessageNotUnderstood());
  12379. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12380. $ctx1.sendIdx["should:raise:"]=38;
  12381. //>>excludeEnd("ctx");
  12382. self._should_raise_((function(){
  12383. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12384. return $core.withContext(function($ctx2) {
  12385. //>>excludeEnd("ctx");
  12386. return (16)._rZ();
  12387. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12388. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,39)});
  12389. //>>excludeEnd("ctx");
  12390. }),$MessageNotUnderstood());
  12391. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12392. $ctx1.sendIdx["should:raise:"]=39;
  12393. //>>excludeEnd("ctx");
  12394. self._should_raise_((function(){
  12395. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12396. return $core.withContext(function($ctx2) {
  12397. //>>excludeEnd("ctx");
  12398. return (16)._rz();
  12399. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12400. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,40)});
  12401. //>>excludeEnd("ctx");
  12402. }),$MessageNotUnderstood());
  12403. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12404. $ctx1.sendIdx["should:raise:"]=40;
  12405. //>>excludeEnd("ctx");
  12406. self._should_raise_((function(){
  12407. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12408. return $core.withContext(function($ctx2) {
  12409. //>>excludeEnd("ctx");
  12410. return (11259375)._Z();
  12411. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12412. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,41)});
  12413. //>>excludeEnd("ctx");
  12414. }),$MessageNotUnderstood());
  12415. return self;
  12416. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12417. }, function($ctx1) {$ctx1.fill(self,"testInvalidHexNumbers",{},$globals.NumberTest)});
  12418. //>>excludeEnd("ctx");
  12419. },
  12420. //>>excludeStart("ide", pragmas.excludeIdeData);
  12421. args: [],
  12422. 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.",
  12423. referencedClasses: ["MessageNotUnderstood"],
  12424. //>>excludeEnd("ide");
  12425. 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"]
  12426. }),
  12427. $globals.NumberTest);
  12428. $core.addMethod(
  12429. $core.method({
  12430. selector: "testLog",
  12431. protocol: 'tests',
  12432. fn: function (){
  12433. var self=this;
  12434. function $Number(){return $globals.Number||(typeof Number=="undefined"?nil:Number)}
  12435. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12436. return $core.withContext(function($ctx1) {
  12437. //>>excludeEnd("ctx");
  12438. self._assert_equals_((10000)._log(),(4));
  12439. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12440. $ctx1.sendIdx["assert:equals:"]=1;
  12441. //>>excludeEnd("ctx");
  12442. self._assert_equals_((512)._log_((2)),(9));
  12443. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12444. $ctx1.sendIdx["assert:equals:"]=2;
  12445. //>>excludeEnd("ctx");
  12446. self._assert_equals_($recv($recv($Number())._e())._ln(),(1));
  12447. return self;
  12448. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12449. }, function($ctx1) {$ctx1.fill(self,"testLog",{},$globals.NumberTest)});
  12450. //>>excludeEnd("ctx");
  12451. },
  12452. //>>excludeStart("ide", pragmas.excludeIdeData);
  12453. args: [],
  12454. 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.",
  12455. referencedClasses: ["Number"],
  12456. //>>excludeEnd("ide");
  12457. messageSends: ["assert:equals:", "log", "log:", "ln", "e"]
  12458. }),
  12459. $globals.NumberTest);
  12460. $core.addMethod(
  12461. $core.method({
  12462. selector: "testMinMax",
  12463. protocol: 'tests',
  12464. fn: function (){
  12465. var self=this;
  12466. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12467. return $core.withContext(function($ctx1) {
  12468. //>>excludeEnd("ctx");
  12469. self._assert_equals_((2)._max_((5)),(5));
  12470. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12471. $ctx1.sendIdx["assert:equals:"]=1;
  12472. //>>excludeEnd("ctx");
  12473. self._assert_equals_((2)._min_((5)),(2));
  12474. return self;
  12475. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12476. }, function($ctx1) {$ctx1.fill(self,"testMinMax",{},$globals.NumberTest)});
  12477. //>>excludeEnd("ctx");
  12478. },
  12479. //>>excludeStart("ide", pragmas.excludeIdeData);
  12480. args: [],
  12481. source: "testMinMax\x0a\x09\x0a\x09self assert: (2 max: 5) equals: 5.\x0a\x09self assert: (2 min: 5) equals: 2",
  12482. referencedClasses: [],
  12483. //>>excludeEnd("ide");
  12484. messageSends: ["assert:equals:", "max:", "min:"]
  12485. }),
  12486. $globals.NumberTest);
  12487. $core.addMethod(
  12488. $core.method({
  12489. selector: "testNegated",
  12490. protocol: 'tests',
  12491. fn: function (){
  12492. var self=this;
  12493. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12494. return $core.withContext(function($ctx1) {
  12495. //>>excludeEnd("ctx");
  12496. var $1;
  12497. $1=(3)._negated();
  12498. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12499. $ctx1.sendIdx["negated"]=1;
  12500. //>>excludeEnd("ctx");
  12501. self._assert_equals_($1,(-3));
  12502. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12503. $ctx1.sendIdx["assert:equals:"]=1;
  12504. //>>excludeEnd("ctx");
  12505. self._assert_equals_((-3)._negated(),(3));
  12506. return self;
  12507. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12508. }, function($ctx1) {$ctx1.fill(self,"testNegated",{},$globals.NumberTest)});
  12509. //>>excludeEnd("ctx");
  12510. },
  12511. //>>excludeStart("ide", pragmas.excludeIdeData);
  12512. args: [],
  12513. source: "testNegated\x0a\x09self assert: 3 negated equals: -3.\x0a\x09self assert: -3 negated equals: 3",
  12514. referencedClasses: [],
  12515. //>>excludeEnd("ide");
  12516. messageSends: ["assert:equals:", "negated"]
  12517. }),
  12518. $globals.NumberTest);
  12519. $core.addMethod(
  12520. $core.method({
  12521. selector: "testPrintShowingDecimalPlaces",
  12522. protocol: 'tests',
  12523. fn: function (){
  12524. var self=this;
  12525. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12526. return $core.withContext(function($ctx1) {
  12527. //>>excludeEnd("ctx");
  12528. var $1,$2,$4,$3,$5,$6,$8,$7,$10,$9,$11,$12,$13,$14,$15;
  12529. $1=(23)._printShowingDecimalPlaces_((2));
  12530. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12531. $ctx1.sendIdx["printShowingDecimalPlaces:"]=1;
  12532. //>>excludeEnd("ctx");
  12533. self._assert_equals_($1,"23.00");
  12534. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12535. $ctx1.sendIdx["assert:equals:"]=1;
  12536. //>>excludeEnd("ctx");
  12537. $2=(23.5698)._printShowingDecimalPlaces_((2));
  12538. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12539. $ctx1.sendIdx["printShowingDecimalPlaces:"]=2;
  12540. //>>excludeEnd("ctx");
  12541. self._assert_equals_($2,"23.57");
  12542. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12543. $ctx1.sendIdx["assert:equals:"]=2;
  12544. //>>excludeEnd("ctx");
  12545. $4=(234.567)._negated();
  12546. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12547. $ctx1.sendIdx["negated"]=1;
  12548. //>>excludeEnd("ctx");
  12549. $3=$recv($4)._printShowingDecimalPlaces_((5));
  12550. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12551. $ctx1.sendIdx["printShowingDecimalPlaces:"]=3;
  12552. //>>excludeEnd("ctx");
  12553. self._assert_equals_($3,"-234.56700");
  12554. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12555. $ctx1.sendIdx["assert:equals:"]=3;
  12556. //>>excludeEnd("ctx");
  12557. $5=(23.4567)._printShowingDecimalPlaces_((0));
  12558. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12559. $ctx1.sendIdx["printShowingDecimalPlaces:"]=4;
  12560. //>>excludeEnd("ctx");
  12561. self._assert_equals_($5,"23");
  12562. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12563. $ctx1.sendIdx["assert:equals:"]=4;
  12564. //>>excludeEnd("ctx");
  12565. $6=(23.5567)._printShowingDecimalPlaces_((0));
  12566. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12567. $ctx1.sendIdx["printShowingDecimalPlaces:"]=5;
  12568. //>>excludeEnd("ctx");
  12569. self._assert_equals_($6,"24");
  12570. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12571. $ctx1.sendIdx["assert:equals:"]=5;
  12572. //>>excludeEnd("ctx");
  12573. $8=(23.4567)._negated();
  12574. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12575. $ctx1.sendIdx["negated"]=2;
  12576. //>>excludeEnd("ctx");
  12577. $7=$recv($8)._printShowingDecimalPlaces_((0));
  12578. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12579. $ctx1.sendIdx["printShowingDecimalPlaces:"]=6;
  12580. //>>excludeEnd("ctx");
  12581. self._assert_equals_($7,"-23");
  12582. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12583. $ctx1.sendIdx["assert:equals:"]=6;
  12584. //>>excludeEnd("ctx");
  12585. $10=(23.5567)._negated();
  12586. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12587. $ctx1.sendIdx["negated"]=3;
  12588. //>>excludeEnd("ctx");
  12589. $9=$recv($10)._printShowingDecimalPlaces_((0));
  12590. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12591. $ctx1.sendIdx["printShowingDecimalPlaces:"]=7;
  12592. //>>excludeEnd("ctx");
  12593. self._assert_equals_($9,"-24");
  12594. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12595. $ctx1.sendIdx["assert:equals:"]=7;
  12596. //>>excludeEnd("ctx");
  12597. $11=(100000000)._printShowingDecimalPlaces_((1));
  12598. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12599. $ctx1.sendIdx["printShowingDecimalPlaces:"]=8;
  12600. //>>excludeEnd("ctx");
  12601. self._assert_equals_($11,"100000000.0");
  12602. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12603. $ctx1.sendIdx["assert:equals:"]=8;
  12604. //>>excludeEnd("ctx");
  12605. $12=(0.98)._printShowingDecimalPlaces_((5));
  12606. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12607. $ctx1.sendIdx["printShowingDecimalPlaces:"]=9;
  12608. //>>excludeEnd("ctx");
  12609. self._assert_equals_($12,"0.98000");
  12610. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12611. $ctx1.sendIdx["assert:equals:"]=9;
  12612. //>>excludeEnd("ctx");
  12613. $13=$recv((0.98)._negated())._printShowingDecimalPlaces_((2));
  12614. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12615. $ctx1.sendIdx["printShowingDecimalPlaces:"]=10;
  12616. //>>excludeEnd("ctx");
  12617. self._assert_equals_($13,"-0.98");
  12618. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12619. $ctx1.sendIdx["assert:equals:"]=10;
  12620. //>>excludeEnd("ctx");
  12621. $14=(2.567)._printShowingDecimalPlaces_((2));
  12622. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12623. $ctx1.sendIdx["printShowingDecimalPlaces:"]=11;
  12624. //>>excludeEnd("ctx");
  12625. self._assert_equals_($14,"2.57");
  12626. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12627. $ctx1.sendIdx["assert:equals:"]=11;
  12628. //>>excludeEnd("ctx");
  12629. $15=(-2.567)._printShowingDecimalPlaces_((2));
  12630. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12631. $ctx1.sendIdx["printShowingDecimalPlaces:"]=12;
  12632. //>>excludeEnd("ctx");
  12633. self._assert_equals_($15,"-2.57");
  12634. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12635. $ctx1.sendIdx["assert:equals:"]=12;
  12636. //>>excludeEnd("ctx");
  12637. self._assert_equals_((0)._printShowingDecimalPlaces_((2)),"0.00");
  12638. return self;
  12639. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12640. }, function($ctx1) {$ctx1.fill(self,"testPrintShowingDecimalPlaces",{},$globals.NumberTest)});
  12641. //>>excludeEnd("ctx");
  12642. },
  12643. //>>excludeStart("ide", pragmas.excludeIdeData);
  12644. args: [],
  12645. 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'.",
  12646. referencedClasses: [],
  12647. //>>excludeEnd("ide");
  12648. messageSends: ["assert:equals:", "printShowingDecimalPlaces:", "negated"]
  12649. }),
  12650. $globals.NumberTest);
  12651. $core.addMethod(
  12652. $core.method({
  12653. selector: "testRaisedTo",
  12654. protocol: 'tests',
  12655. fn: function (){
  12656. var self=this;
  12657. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12658. return $core.withContext(function($ctx1) {
  12659. //>>excludeEnd("ctx");
  12660. var $1,$2,$3;
  12661. $1=(2)._raisedTo_((4));
  12662. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12663. $ctx1.sendIdx["raisedTo:"]=1;
  12664. //>>excludeEnd("ctx");
  12665. self._assert_equals_($1,(16));
  12666. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12667. $ctx1.sendIdx["assert:equals:"]=1;
  12668. //>>excludeEnd("ctx");
  12669. $2=(2)._raisedTo_((0));
  12670. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12671. $ctx1.sendIdx["raisedTo:"]=2;
  12672. //>>excludeEnd("ctx");
  12673. self._assert_equals_($2,(1));
  12674. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12675. $ctx1.sendIdx["assert:equals:"]=2;
  12676. //>>excludeEnd("ctx");
  12677. $3=(2)._raisedTo_((-3));
  12678. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12679. $ctx1.sendIdx["raisedTo:"]=3;
  12680. //>>excludeEnd("ctx");
  12681. self._assert_equals_($3,(0.125));
  12682. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12683. $ctx1.sendIdx["assert:equals:"]=3;
  12684. //>>excludeEnd("ctx");
  12685. self._assert_equals_((4)._raisedTo_((0.5)),(2));
  12686. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12687. $ctx1.sendIdx["assert:equals:"]=4;
  12688. //>>excludeEnd("ctx");
  12689. self._assert_equals_((2).__star_star((4)),(16));
  12690. return self;
  12691. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12692. }, function($ctx1) {$ctx1.fill(self,"testRaisedTo",{},$globals.NumberTest)});
  12693. //>>excludeEnd("ctx");
  12694. },
  12695. //>>excludeStart("ide", pragmas.excludeIdeData);
  12696. args: [],
  12697. 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.",
  12698. referencedClasses: [],
  12699. //>>excludeEnd("ide");
  12700. messageSends: ["assert:equals:", "raisedTo:", "**"]
  12701. }),
  12702. $globals.NumberTest);
  12703. $core.addMethod(
  12704. $core.method({
  12705. selector: "testRounded",
  12706. protocol: 'tests',
  12707. fn: function (){
  12708. var self=this;
  12709. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12710. return $core.withContext(function($ctx1) {
  12711. //>>excludeEnd("ctx");
  12712. var $1,$2;
  12713. $1=(3)._rounded();
  12714. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12715. $ctx1.sendIdx["rounded"]=1;
  12716. //>>excludeEnd("ctx");
  12717. self._assert_equals_($1,(3));
  12718. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12719. $ctx1.sendIdx["assert:equals:"]=1;
  12720. //>>excludeEnd("ctx");
  12721. $2=(3.212)._rounded();
  12722. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12723. $ctx1.sendIdx["rounded"]=2;
  12724. //>>excludeEnd("ctx");
  12725. self._assert_equals_($2,(3));
  12726. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12727. $ctx1.sendIdx["assert:equals:"]=2;
  12728. //>>excludeEnd("ctx");
  12729. self._assert_equals_((3.51)._rounded(),(4));
  12730. return self;
  12731. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12732. }, function($ctx1) {$ctx1.fill(self,"testRounded",{},$globals.NumberTest)});
  12733. //>>excludeEnd("ctx");
  12734. },
  12735. //>>excludeStart("ide", pragmas.excludeIdeData);
  12736. args: [],
  12737. 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",
  12738. referencedClasses: [],
  12739. //>>excludeEnd("ide");
  12740. messageSends: ["assert:equals:", "rounded"]
  12741. }),
  12742. $globals.NumberTest);
  12743. $core.addMethod(
  12744. $core.method({
  12745. selector: "testSign",
  12746. protocol: 'tests',
  12747. fn: function (){
  12748. var self=this;
  12749. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12750. return $core.withContext(function($ctx1) {
  12751. //>>excludeEnd("ctx");
  12752. var $1,$2;
  12753. $1=(5)._sign();
  12754. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12755. $ctx1.sendIdx["sign"]=1;
  12756. //>>excludeEnd("ctx");
  12757. self._assert_equals_($1,(1));
  12758. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12759. $ctx1.sendIdx["assert:equals:"]=1;
  12760. //>>excludeEnd("ctx");
  12761. $2=(0)._sign();
  12762. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12763. $ctx1.sendIdx["sign"]=2;
  12764. //>>excludeEnd("ctx");
  12765. self._assert_equals_($2,(0));
  12766. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12767. $ctx1.sendIdx["assert:equals:"]=2;
  12768. //>>excludeEnd("ctx");
  12769. self._assert_equals_((-1.4)._sign(),(-1));
  12770. return self;
  12771. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12772. }, function($ctx1) {$ctx1.fill(self,"testSign",{},$globals.NumberTest)});
  12773. //>>excludeEnd("ctx");
  12774. },
  12775. //>>excludeStart("ide", pragmas.excludeIdeData);
  12776. args: [],
  12777. source: "testSign\x0a\x09self assert: 5 sign equals: 1.\x0a\x09self assert: 0 sign equals: 0.\x0a\x09self assert: -1.4 sign equals: -1.",
  12778. referencedClasses: [],
  12779. //>>excludeEnd("ide");
  12780. messageSends: ["assert:equals:", "sign"]
  12781. }),
  12782. $globals.NumberTest);
  12783. $core.addMethod(
  12784. $core.method({
  12785. selector: "testSqrt",
  12786. protocol: 'tests',
  12787. fn: function (){
  12788. var self=this;
  12789. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12790. return $core.withContext(function($ctx1) {
  12791. //>>excludeEnd("ctx");
  12792. var $1;
  12793. $1=(4)._sqrt();
  12794. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12795. $ctx1.sendIdx["sqrt"]=1;
  12796. //>>excludeEnd("ctx");
  12797. self._assert_equals_($1,(2));
  12798. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12799. $ctx1.sendIdx["assert:equals:"]=1;
  12800. //>>excludeEnd("ctx");
  12801. self._assert_equals_((16)._sqrt(),(4));
  12802. return self;
  12803. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12804. }, function($ctx1) {$ctx1.fill(self,"testSqrt",{},$globals.NumberTest)});
  12805. //>>excludeEnd("ctx");
  12806. },
  12807. //>>excludeStart("ide", pragmas.excludeIdeData);
  12808. args: [],
  12809. source: "testSqrt\x0a\x09\x0a\x09self assert: 4 sqrt equals: 2.\x0a\x09self assert: 16 sqrt equals: 4",
  12810. referencedClasses: [],
  12811. //>>excludeEnd("ide");
  12812. messageSends: ["assert:equals:", "sqrt"]
  12813. }),
  12814. $globals.NumberTest);
  12815. $core.addMethod(
  12816. $core.method({
  12817. selector: "testSquared",
  12818. protocol: 'tests',
  12819. fn: function (){
  12820. var self=this;
  12821. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12822. return $core.withContext(function($ctx1) {
  12823. //>>excludeEnd("ctx");
  12824. self._assert_equals_((4)._squared(),(16));
  12825. return self;
  12826. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12827. }, function($ctx1) {$ctx1.fill(self,"testSquared",{},$globals.NumberTest)});
  12828. //>>excludeEnd("ctx");
  12829. },
  12830. //>>excludeStart("ide", pragmas.excludeIdeData);
  12831. args: [],
  12832. source: "testSquared\x0a\x09\x0a\x09self assert: 4 squared equals: 16",
  12833. referencedClasses: [],
  12834. //>>excludeEnd("ide");
  12835. messageSends: ["assert:equals:", "squared"]
  12836. }),
  12837. $globals.NumberTest);
  12838. $core.addMethod(
  12839. $core.method({
  12840. selector: "testTimesRepeat",
  12841. protocol: 'tests',
  12842. fn: function (){
  12843. var self=this;
  12844. var i;
  12845. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12846. return $core.withContext(function($ctx1) {
  12847. //>>excludeEnd("ctx");
  12848. i=(0);
  12849. (0)._timesRepeat_((function(){
  12850. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12851. return $core.withContext(function($ctx2) {
  12852. //>>excludeEnd("ctx");
  12853. i=$recv(i).__plus((1));
  12854. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12855. $ctx2.sendIdx["+"]=1;
  12856. //>>excludeEnd("ctx");
  12857. return i;
  12858. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12859. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  12860. //>>excludeEnd("ctx");
  12861. }));
  12862. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12863. $ctx1.sendIdx["timesRepeat:"]=1;
  12864. //>>excludeEnd("ctx");
  12865. self._assert_equals_(i,(0));
  12866. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12867. $ctx1.sendIdx["assert:equals:"]=1;
  12868. //>>excludeEnd("ctx");
  12869. (5)._timesRepeat_((function(){
  12870. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12871. return $core.withContext(function($ctx2) {
  12872. //>>excludeEnd("ctx");
  12873. i=$recv(i).__plus((1));
  12874. return i;
  12875. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12876. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  12877. //>>excludeEnd("ctx");
  12878. }));
  12879. self._assert_equals_(i,(5));
  12880. return self;
  12881. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12882. }, function($ctx1) {$ctx1.fill(self,"testTimesRepeat",{i:i},$globals.NumberTest)});
  12883. //>>excludeEnd("ctx");
  12884. },
  12885. //>>excludeStart("ide", pragmas.excludeIdeData);
  12886. args: [],
  12887. 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",
  12888. referencedClasses: [],
  12889. //>>excludeEnd("ide");
  12890. messageSends: ["timesRepeat:", "+", "assert:equals:"]
  12891. }),
  12892. $globals.NumberTest);
  12893. $core.addMethod(
  12894. $core.method({
  12895. selector: "testTo",
  12896. protocol: 'tests',
  12897. fn: function (){
  12898. var self=this;
  12899. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12900. return $core.withContext(function($ctx1) {
  12901. //>>excludeEnd("ctx");
  12902. self._assert_equals_((1)._to_((5)),[(1), (2), (3), (4), (5)]);
  12903. return self;
  12904. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12905. }, function($ctx1) {$ctx1.fill(self,"testTo",{},$globals.NumberTest)});
  12906. //>>excludeEnd("ctx");
  12907. },
  12908. //>>excludeStart("ide", pragmas.excludeIdeData);
  12909. args: [],
  12910. source: "testTo\x0a\x09self assert: (1 to: 5) equals: #(1 2 3 4 5)",
  12911. referencedClasses: [],
  12912. //>>excludeEnd("ide");
  12913. messageSends: ["assert:equals:", "to:"]
  12914. }),
  12915. $globals.NumberTest);
  12916. $core.addMethod(
  12917. $core.method({
  12918. selector: "testToBy",
  12919. protocol: 'tests',
  12920. fn: function (){
  12921. var self=this;
  12922. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  12923. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12924. return $core.withContext(function($ctx1) {
  12925. //>>excludeEnd("ctx");
  12926. var $1;
  12927. $1=(0)._to_by_((6),(2));
  12928. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12929. $ctx1.sendIdx["to:by:"]=1;
  12930. //>>excludeEnd("ctx");
  12931. self._assert_equals_($1,[(0), (2), (4), (6)]);
  12932. self._should_raise_((function(){
  12933. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12934. return $core.withContext(function($ctx2) {
  12935. //>>excludeEnd("ctx");
  12936. return (1)._to_by_((4),(0));
  12937. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12938. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  12939. //>>excludeEnd("ctx");
  12940. }),$Error());
  12941. return self;
  12942. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12943. }, function($ctx1) {$ctx1.fill(self,"testToBy",{},$globals.NumberTest)});
  12944. //>>excludeEnd("ctx");
  12945. },
  12946. //>>excludeStart("ide", pragmas.excludeIdeData);
  12947. args: [],
  12948. 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",
  12949. referencedClasses: ["Error"],
  12950. //>>excludeEnd("ide");
  12951. messageSends: ["assert:equals:", "to:by:", "should:raise:"]
  12952. }),
  12953. $globals.NumberTest);
  12954. $core.addMethod(
  12955. $core.method({
  12956. selector: "testTrigonometry",
  12957. protocol: 'tests',
  12958. fn: function (){
  12959. var self=this;
  12960. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12961. return $core.withContext(function($ctx1) {
  12962. //>>excludeEnd("ctx");
  12963. self._assert_equals_((0)._cos(),(1));
  12964. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12965. $ctx1.sendIdx["assert:equals:"]=1;
  12966. //>>excludeEnd("ctx");
  12967. self._assert_equals_((0)._sin(),(0));
  12968. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12969. $ctx1.sendIdx["assert:equals:"]=2;
  12970. //>>excludeEnd("ctx");
  12971. self._assert_equals_((0)._tan(),(0));
  12972. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12973. $ctx1.sendIdx["assert:equals:"]=3;
  12974. //>>excludeEnd("ctx");
  12975. self._assert_equals_((1)._arcCos(),(0));
  12976. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12977. $ctx1.sendIdx["assert:equals:"]=4;
  12978. //>>excludeEnd("ctx");
  12979. self._assert_equals_((0)._arcSin(),(0));
  12980. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12981. $ctx1.sendIdx["assert:equals:"]=5;
  12982. //>>excludeEnd("ctx");
  12983. self._assert_equals_((0)._arcTan(),(0));
  12984. return self;
  12985. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12986. }, function($ctx1) {$ctx1.fill(self,"testTrigonometry",{},$globals.NumberTest)});
  12987. //>>excludeEnd("ctx");
  12988. },
  12989. //>>excludeStart("ide", pragmas.excludeIdeData);
  12990. args: [],
  12991. 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.",
  12992. referencedClasses: [],
  12993. //>>excludeEnd("ide");
  12994. messageSends: ["assert:equals:", "cos", "sin", "tan", "arcCos", "arcSin", "arcTan"]
  12995. }),
  12996. $globals.NumberTest);
  12997. $core.addMethod(
  12998. $core.method({
  12999. selector: "testTruncated",
  13000. protocol: 'tests',
  13001. fn: function (){
  13002. var self=this;
  13003. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13004. return $core.withContext(function($ctx1) {
  13005. //>>excludeEnd("ctx");
  13006. var $1,$2;
  13007. $1=(3)._truncated();
  13008. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13009. $ctx1.sendIdx["truncated"]=1;
  13010. //>>excludeEnd("ctx");
  13011. self._assert_equals_($1,(3));
  13012. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13013. $ctx1.sendIdx["assert:equals:"]=1;
  13014. //>>excludeEnd("ctx");
  13015. $2=(3.212)._truncated();
  13016. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13017. $ctx1.sendIdx["truncated"]=2;
  13018. //>>excludeEnd("ctx");
  13019. self._assert_equals_($2,(3));
  13020. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13021. $ctx1.sendIdx["assert:equals:"]=2;
  13022. //>>excludeEnd("ctx");
  13023. self._assert_equals_((3.51)._truncated(),(3));
  13024. return self;
  13025. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13026. }, function($ctx1) {$ctx1.fill(self,"testTruncated",{},$globals.NumberTest)});
  13027. //>>excludeEnd("ctx");
  13028. },
  13029. //>>excludeStart("ide", pragmas.excludeIdeData);
  13030. args: [],
  13031. 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",
  13032. referencedClasses: [],
  13033. //>>excludeEnd("ide");
  13034. messageSends: ["assert:equals:", "truncated"]
  13035. }),
  13036. $globals.NumberTest);
  13037. $core.addClass('ObjectMock', $globals.Object, ['foo', 'bar'], 'Kernel-Tests');
  13038. //>>excludeStart("ide", pragmas.excludeIdeData);
  13039. $globals.ObjectMock.comment="ObjectMock is there only to perform tests on classes.";
  13040. //>>excludeEnd("ide");
  13041. $core.addMethod(
  13042. $core.method({
  13043. selector: "foo",
  13044. protocol: 'not yet classified',
  13045. fn: function (){
  13046. var self=this;
  13047. return self["@foo"];
  13048. },
  13049. //>>excludeStart("ide", pragmas.excludeIdeData);
  13050. args: [],
  13051. source: "foo\x0a\x09^ foo",
  13052. referencedClasses: [],
  13053. //>>excludeEnd("ide");
  13054. messageSends: []
  13055. }),
  13056. $globals.ObjectMock);
  13057. $core.addMethod(
  13058. $core.method({
  13059. selector: "foo:",
  13060. protocol: 'not yet classified',
  13061. fn: function (anObject){
  13062. var self=this;
  13063. self["@foo"]=anObject;
  13064. return self;
  13065. },
  13066. //>>excludeStart("ide", pragmas.excludeIdeData);
  13067. args: ["anObject"],
  13068. source: "foo: anObject\x0a\x09foo := anObject",
  13069. referencedClasses: [],
  13070. //>>excludeEnd("ide");
  13071. messageSends: []
  13072. }),
  13073. $globals.ObjectMock);
  13074. $core.addClass('ObjectTest', $globals.TestCase, [], 'Kernel-Tests');
  13075. $core.addMethod(
  13076. $core.method({
  13077. selector: "notDefined",
  13078. protocol: 'tests',
  13079. fn: function (){
  13080. var self=this;
  13081. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13082. return $core.withContext(function($ctx1) {
  13083. //>>excludeEnd("ctx");
  13084. return void 0;;
  13085. return self;
  13086. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13087. }, function($ctx1) {$ctx1.fill(self,"notDefined",{},$globals.ObjectTest)});
  13088. //>>excludeEnd("ctx");
  13089. },
  13090. //>>excludeStart("ide", pragmas.excludeIdeData);
  13091. args: [],
  13092. source: "notDefined\x0a\x09<return void 0;>",
  13093. referencedClasses: [],
  13094. //>>excludeEnd("ide");
  13095. messageSends: []
  13096. }),
  13097. $globals.ObjectTest);
  13098. $core.addMethod(
  13099. $core.method({
  13100. selector: "testBasicAccess",
  13101. protocol: 'tests',
  13102. fn: function (){
  13103. var self=this;
  13104. var o;
  13105. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  13106. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13107. return $core.withContext(function($ctx1) {
  13108. //>>excludeEnd("ctx");
  13109. var $1;
  13110. o=$recv($Object())._new();
  13111. $recv(o)._basicAt_put_("a",(1));
  13112. $1=$recv(o)._basicAt_("a");
  13113. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13114. $ctx1.sendIdx["basicAt:"]=1;
  13115. //>>excludeEnd("ctx");
  13116. self._assert_equals_($1,(1));
  13117. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13118. $ctx1.sendIdx["assert:equals:"]=1;
  13119. //>>excludeEnd("ctx");
  13120. self._assert_equals_($recv(o)._basicAt_("b"),nil);
  13121. return self;
  13122. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13123. }, function($ctx1) {$ctx1.fill(self,"testBasicAccess",{o:o},$globals.ObjectTest)});
  13124. //>>excludeEnd("ctx");
  13125. },
  13126. //>>excludeStart("ide", pragmas.excludeIdeData);
  13127. args: [],
  13128. 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",
  13129. referencedClasses: ["Object"],
  13130. //>>excludeEnd("ide");
  13131. messageSends: ["new", "basicAt:put:", "assert:equals:", "basicAt:"]
  13132. }),
  13133. $globals.ObjectTest);
  13134. $core.addMethod(
  13135. $core.method({
  13136. selector: "testBasicPerform",
  13137. protocol: 'tests',
  13138. fn: function (){
  13139. var self=this;
  13140. var o;
  13141. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  13142. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13143. return $core.withContext(function($ctx1) {
  13144. //>>excludeEnd("ctx");
  13145. o=$recv($Object())._new();
  13146. $recv(o)._basicAt_put_("func",(function(){
  13147. return "hello";
  13148. }));
  13149. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13150. $ctx1.sendIdx["basicAt:put:"]=1;
  13151. //>>excludeEnd("ctx");
  13152. $recv(o)._basicAt_put_("func2",(function(a){
  13153. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13154. return $core.withContext(function($ctx2) {
  13155. //>>excludeEnd("ctx");
  13156. return $recv(a).__plus((1));
  13157. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13158. }, function($ctx2) {$ctx2.fillBlock({a:a},$ctx1,2)});
  13159. //>>excludeEnd("ctx");
  13160. }));
  13161. self._assert_equals_($recv(o)._basicPerform_("func"),"hello");
  13162. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13163. $ctx1.sendIdx["assert:equals:"]=1;
  13164. //>>excludeEnd("ctx");
  13165. self._assert_equals_($recv(o)._basicPerform_withArguments_("func2",[(3)]),(4));
  13166. return self;
  13167. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13168. }, function($ctx1) {$ctx1.fill(self,"testBasicPerform",{o:o},$globals.ObjectTest)});
  13169. //>>excludeEnd("ctx");
  13170. },
  13171. //>>excludeStart("ide", pragmas.excludeIdeData);
  13172. args: [],
  13173. 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",
  13174. referencedClasses: ["Object"],
  13175. //>>excludeEnd("ide");
  13176. messageSends: ["new", "basicAt:put:", "+", "assert:equals:", "basicPerform:", "basicPerform:withArguments:"]
  13177. }),
  13178. $globals.ObjectTest);
  13179. $core.addMethod(
  13180. $core.method({
  13181. selector: "testDNU",
  13182. protocol: 'tests',
  13183. fn: function (){
  13184. var self=this;
  13185. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  13186. function $MessageNotUnderstood(){return $globals.MessageNotUnderstood||(typeof MessageNotUnderstood=="undefined"?nil:MessageNotUnderstood)}
  13187. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13188. return $core.withContext(function($ctx1) {
  13189. //>>excludeEnd("ctx");
  13190. self._should_raise_((function(){
  13191. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13192. return $core.withContext(function($ctx2) {
  13193. //>>excludeEnd("ctx");
  13194. return $recv($recv($Object())._new())._foo();
  13195. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13196. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  13197. //>>excludeEnd("ctx");
  13198. }),$MessageNotUnderstood());
  13199. return self;
  13200. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13201. }, function($ctx1) {$ctx1.fill(self,"testDNU",{},$globals.ObjectTest)});
  13202. //>>excludeEnd("ctx");
  13203. },
  13204. //>>excludeStart("ide", pragmas.excludeIdeData);
  13205. args: [],
  13206. source: "testDNU\x0a\x09self should: [ Object new foo ] raise: MessageNotUnderstood",
  13207. referencedClasses: ["Object", "MessageNotUnderstood"],
  13208. //>>excludeEnd("ide");
  13209. messageSends: ["should:raise:", "foo", "new"]
  13210. }),
  13211. $globals.ObjectTest);
  13212. $core.addMethod(
  13213. $core.method({
  13214. selector: "testEquality",
  13215. protocol: 'tests',
  13216. fn: function (){
  13217. var self=this;
  13218. var o;
  13219. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  13220. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13221. return $core.withContext(function($ctx1) {
  13222. //>>excludeEnd("ctx");
  13223. var $1,$2,$4,$3;
  13224. o=$recv($Object())._new();
  13225. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13226. $ctx1.sendIdx["new"]=1;
  13227. //>>excludeEnd("ctx");
  13228. $1=$recv(o).__eq($recv($Object())._new());
  13229. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13230. $ctx1.sendIdx["="]=1;
  13231. //>>excludeEnd("ctx");
  13232. self._deny_($1);
  13233. $2=$recv(o).__eq(o);
  13234. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13235. $ctx1.sendIdx["="]=2;
  13236. //>>excludeEnd("ctx");
  13237. self._assert_($2);
  13238. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13239. $ctx1.sendIdx["assert:"]=1;
  13240. //>>excludeEnd("ctx");
  13241. $4=$recv(o)._yourself();
  13242. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13243. $ctx1.sendIdx["yourself"]=1;
  13244. //>>excludeEnd("ctx");
  13245. $3=$recv($4).__eq(o);
  13246. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13247. $ctx1.sendIdx["="]=3;
  13248. //>>excludeEnd("ctx");
  13249. self._assert_($3);
  13250. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13251. $ctx1.sendIdx["assert:"]=2;
  13252. //>>excludeEnd("ctx");
  13253. self._assert_($recv(o).__eq($recv(o)._yourself()));
  13254. return self;
  13255. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13256. }, function($ctx1) {$ctx1.fill(self,"testEquality",{o:o},$globals.ObjectTest)});
  13257. //>>excludeEnd("ctx");
  13258. },
  13259. //>>excludeStart("ide", pragmas.excludeIdeData);
  13260. args: [],
  13261. 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)",
  13262. referencedClasses: ["Object"],
  13263. //>>excludeEnd("ide");
  13264. messageSends: ["new", "deny:", "=", "assert:", "yourself"]
  13265. }),
  13266. $globals.ObjectTest);
  13267. $core.addMethod(
  13268. $core.method({
  13269. selector: "testHalt",
  13270. protocol: 'tests',
  13271. fn: function (){
  13272. var self=this;
  13273. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  13274. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  13275. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13276. return $core.withContext(function($ctx1) {
  13277. //>>excludeEnd("ctx");
  13278. self._should_raise_((function(){
  13279. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13280. return $core.withContext(function($ctx2) {
  13281. //>>excludeEnd("ctx");
  13282. return $recv($recv($Object())._new())._halt();
  13283. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13284. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  13285. //>>excludeEnd("ctx");
  13286. }),$Error());
  13287. return self;
  13288. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13289. }, function($ctx1) {$ctx1.fill(self,"testHalt",{},$globals.ObjectTest)});
  13290. //>>excludeEnd("ctx");
  13291. },
  13292. //>>excludeStart("ide", pragmas.excludeIdeData);
  13293. args: [],
  13294. source: "testHalt\x0a\x09self should: [ Object new halt ] raise: Error",
  13295. referencedClasses: ["Object", "Error"],
  13296. //>>excludeEnd("ide");
  13297. messageSends: ["should:raise:", "halt", "new"]
  13298. }),
  13299. $globals.ObjectTest);
  13300. $core.addMethod(
  13301. $core.method({
  13302. selector: "testIdentity",
  13303. protocol: 'tests',
  13304. fn: function (){
  13305. var self=this;
  13306. var o;
  13307. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  13308. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13309. return $core.withContext(function($ctx1) {
  13310. //>>excludeEnd("ctx");
  13311. var $1,$2,$4,$3;
  13312. o=$recv($Object())._new();
  13313. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13314. $ctx1.sendIdx["new"]=1;
  13315. //>>excludeEnd("ctx");
  13316. $1=$recv(o).__eq_eq($recv($Object())._new());
  13317. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13318. $ctx1.sendIdx["=="]=1;
  13319. //>>excludeEnd("ctx");
  13320. self._deny_($1);
  13321. $2=$recv(o).__eq_eq(o);
  13322. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13323. $ctx1.sendIdx["=="]=2;
  13324. //>>excludeEnd("ctx");
  13325. self._assert_($2);
  13326. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13327. $ctx1.sendIdx["assert:"]=1;
  13328. //>>excludeEnd("ctx");
  13329. $4=$recv(o)._yourself();
  13330. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13331. $ctx1.sendIdx["yourself"]=1;
  13332. //>>excludeEnd("ctx");
  13333. $3=$recv($4).__eq_eq(o);
  13334. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13335. $ctx1.sendIdx["=="]=3;
  13336. //>>excludeEnd("ctx");
  13337. self._assert_($3);
  13338. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13339. $ctx1.sendIdx["assert:"]=2;
  13340. //>>excludeEnd("ctx");
  13341. self._assert_($recv(o).__eq_eq($recv(o)._yourself()));
  13342. return self;
  13343. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13344. }, function($ctx1) {$ctx1.fill(self,"testIdentity",{o:o},$globals.ObjectTest)});
  13345. //>>excludeEnd("ctx");
  13346. },
  13347. //>>excludeStart("ide", pragmas.excludeIdeData);
  13348. args: [],
  13349. 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",
  13350. referencedClasses: ["Object"],
  13351. //>>excludeEnd("ide");
  13352. messageSends: ["new", "deny:", "==", "assert:", "yourself"]
  13353. }),
  13354. $globals.ObjectTest);
  13355. $core.addMethod(
  13356. $core.method({
  13357. selector: "testIfNil",
  13358. protocol: 'tests',
  13359. fn: function (){
  13360. var self=this;
  13361. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  13362. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13363. return $core.withContext(function($ctx1) {
  13364. //>>excludeEnd("ctx");
  13365. var $2,$1,$5,$4,$3,$7,$6,$9,$8,$11,$10,$receiver;
  13366. $2=$recv($Object())._new();
  13367. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13368. $ctx1.sendIdx["new"]=1;
  13369. //>>excludeEnd("ctx");
  13370. $1=$recv($2)._isNil();
  13371. self._deny_($1);
  13372. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13373. $ctx1.sendIdx["deny:"]=1;
  13374. //>>excludeEnd("ctx");
  13375. $5=$recv($Object())._new();
  13376. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13377. $ctx1.sendIdx["new"]=2;
  13378. //>>excludeEnd("ctx");
  13379. if(($receiver = $5) == null || $receiver.isNil){
  13380. $4=true;
  13381. } else {
  13382. $4=$5;
  13383. };
  13384. $3=$recv($4).__eq(true);
  13385. self._deny_($3);
  13386. $7=$recv($Object())._new();
  13387. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13388. $ctx1.sendIdx["new"]=3;
  13389. //>>excludeEnd("ctx");
  13390. if(($receiver = $7) == null || $receiver.isNil){
  13391. $6=$7;
  13392. } else {
  13393. $6=true;
  13394. };
  13395. self._assert_equals_($6,true);
  13396. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13397. $ctx1.sendIdx["assert:equals:"]=1;
  13398. //>>excludeEnd("ctx");
  13399. $9=$recv($Object())._new();
  13400. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13401. $ctx1.sendIdx["new"]=4;
  13402. //>>excludeEnd("ctx");
  13403. if(($receiver = $9) == null || $receiver.isNil){
  13404. $8=false;
  13405. } else {
  13406. $8=true;
  13407. };
  13408. self._assert_equals_($8,true);
  13409. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13410. $ctx1.sendIdx["assert:equals:"]=2;
  13411. //>>excludeEnd("ctx");
  13412. $11=$recv($Object())._new();
  13413. if(($receiver = $11) == null || $receiver.isNil){
  13414. $10=false;
  13415. } else {
  13416. $10=true;
  13417. };
  13418. self._assert_equals_($10,true);
  13419. return self;
  13420. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13421. }, function($ctx1) {$ctx1.fill(self,"testIfNil",{},$globals.ObjectTest)});
  13422. //>>excludeEnd("ctx");
  13423. },
  13424. //>>excludeStart("ide", pragmas.excludeIdeData);
  13425. args: [],
  13426. 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",
  13427. referencedClasses: ["Object"],
  13428. //>>excludeEnd("ide");
  13429. messageSends: ["deny:", "isNil", "new", "=", "ifNil:", "assert:equals:", "ifNotNil:", "ifNil:ifNotNil:", "ifNotNil:ifNil:"]
  13430. }),
  13431. $globals.ObjectTest);
  13432. $core.addMethod(
  13433. $core.method({
  13434. selector: "testInstVars",
  13435. protocol: 'tests',
  13436. fn: function (){
  13437. var self=this;
  13438. var o;
  13439. function $ObjectMock(){return $globals.ObjectMock||(typeof ObjectMock=="undefined"?nil:ObjectMock)}
  13440. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13441. return $core.withContext(function($ctx1) {
  13442. //>>excludeEnd("ctx");
  13443. var $1,$2;
  13444. o=$recv($ObjectMock())._new();
  13445. $1=$recv(o)._instVarAt_("foo");
  13446. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13447. $ctx1.sendIdx["instVarAt:"]=1;
  13448. //>>excludeEnd("ctx");
  13449. self._assert_equals_($1,nil);
  13450. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13451. $ctx1.sendIdx["assert:equals:"]=1;
  13452. //>>excludeEnd("ctx");
  13453. $recv(o)._instVarAt_put_("foo",(1));
  13454. $2=$recv(o)._instVarAt_("foo");
  13455. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13456. $ctx1.sendIdx["instVarAt:"]=2;
  13457. //>>excludeEnd("ctx");
  13458. self._assert_equals_($2,(1));
  13459. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13460. $ctx1.sendIdx["assert:equals:"]=2;
  13461. //>>excludeEnd("ctx");
  13462. self._assert_equals_($recv(o)._instVarAt_("foo"),(1));
  13463. return self;
  13464. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13465. }, function($ctx1) {$ctx1.fill(self,"testInstVars",{o:o},$globals.ObjectTest)});
  13466. //>>excludeEnd("ctx");
  13467. },
  13468. //>>excludeStart("ide", pragmas.excludeIdeData);
  13469. args: [],
  13470. 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",
  13471. referencedClasses: ["ObjectMock"],
  13472. //>>excludeEnd("ide");
  13473. messageSends: ["new", "assert:equals:", "instVarAt:", "instVarAt:put:"]
  13474. }),
  13475. $globals.ObjectTest);
  13476. $core.addMethod(
  13477. $core.method({
  13478. selector: "testNilUndefined",
  13479. protocol: 'tests',
  13480. fn: function (){
  13481. var self=this;
  13482. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13483. return $core.withContext(function($ctx1) {
  13484. //>>excludeEnd("ctx");
  13485. self._assert_equals_(self._notDefined(),nil);
  13486. return self;
  13487. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13488. }, function($ctx1) {$ctx1.fill(self,"testNilUndefined",{},$globals.ObjectTest)});
  13489. //>>excludeEnd("ctx");
  13490. },
  13491. //>>excludeStart("ide", pragmas.excludeIdeData);
  13492. args: [],
  13493. source: "testNilUndefined\x0a\x09\x22nil in Smalltalk is the undefined object in JS\x22\x0a\x0a\x09self assert: self notDefined equals: nil",
  13494. referencedClasses: [],
  13495. //>>excludeEnd("ide");
  13496. messageSends: ["assert:equals:", "notDefined"]
  13497. }),
  13498. $globals.ObjectTest);
  13499. $core.addMethod(
  13500. $core.method({
  13501. selector: "testYourself",
  13502. protocol: 'tests',
  13503. fn: function (){
  13504. var self=this;
  13505. var o;
  13506. function $ObjectMock(){return $globals.ObjectMock||(typeof ObjectMock=="undefined"?nil:ObjectMock)}
  13507. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13508. return $core.withContext(function($ctx1) {
  13509. //>>excludeEnd("ctx");
  13510. o=$recv($ObjectMock())._new();
  13511. self._assert_($recv($recv(o)._yourself()).__eq_eq(o));
  13512. return self;
  13513. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13514. }, function($ctx1) {$ctx1.fill(self,"testYourself",{o:o},$globals.ObjectTest)});
  13515. //>>excludeEnd("ctx");
  13516. },
  13517. //>>excludeStart("ide", pragmas.excludeIdeData);
  13518. args: [],
  13519. source: "testYourself\x0a\x09| o |\x0a\x09o := ObjectMock new.\x0a\x09self assert: o yourself == o",
  13520. referencedClasses: ["ObjectMock"],
  13521. //>>excludeEnd("ide");
  13522. messageSends: ["new", "assert:", "==", "yourself"]
  13523. }),
  13524. $globals.ObjectTest);
  13525. $core.addMethod(
  13526. $core.method({
  13527. selector: "testidentityHash",
  13528. protocol: 'tests',
  13529. fn: function (){
  13530. var self=this;
  13531. var o1,o2;
  13532. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  13533. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13534. return $core.withContext(function($ctx1) {
  13535. //>>excludeEnd("ctx");
  13536. var $2,$3,$1,$5,$4;
  13537. o1=$recv($Object())._new();
  13538. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13539. $ctx1.sendIdx["new"]=1;
  13540. //>>excludeEnd("ctx");
  13541. o2=$recv($Object())._new();
  13542. $2=$recv(o1)._identityHash();
  13543. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13544. $ctx1.sendIdx["identityHash"]=1;
  13545. //>>excludeEnd("ctx");
  13546. $3=$recv(o1)._identityHash();
  13547. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13548. $ctx1.sendIdx["identityHash"]=2;
  13549. //>>excludeEnd("ctx");
  13550. $1=$recv($2).__eq_eq($3);
  13551. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13552. $ctx1.sendIdx["=="]=1;
  13553. //>>excludeEnd("ctx");
  13554. self._assert_($1);
  13555. $5=$recv(o1)._identityHash();
  13556. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13557. $ctx1.sendIdx["identityHash"]=3;
  13558. //>>excludeEnd("ctx");
  13559. $4=$recv($5).__eq_eq($recv(o2)._identityHash());
  13560. self._deny_($4);
  13561. return self;
  13562. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13563. }, function($ctx1) {$ctx1.fill(self,"testidentityHash",{o1:o1,o2:o2},$globals.ObjectTest)});
  13564. //>>excludeEnd("ctx");
  13565. },
  13566. //>>excludeStart("ide", pragmas.excludeIdeData);
  13567. args: [],
  13568. 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",
  13569. referencedClasses: ["Object"],
  13570. //>>excludeEnd("ide");
  13571. messageSends: ["new", "assert:", "==", "identityHash", "deny:"]
  13572. }),
  13573. $globals.ObjectTest);
  13574. $core.addClass('PointTest', $globals.TestCase, [], 'Kernel-Tests');
  13575. $core.addMethod(
  13576. $core.method({
  13577. selector: "testAccessing",
  13578. protocol: 'tests',
  13579. fn: function (){
  13580. var self=this;
  13581. function $Point(){return $globals.Point||(typeof Point=="undefined"?nil:Point)}
  13582. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13583. return $core.withContext(function($ctx1) {
  13584. //>>excludeEnd("ctx");
  13585. var $2,$1,$3,$6,$5,$4;
  13586. $2=$recv($Point())._x_y_((3),(4));
  13587. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13588. $ctx1.sendIdx["x:y:"]=1;
  13589. //>>excludeEnd("ctx");
  13590. $1=$recv($2)._x();
  13591. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13592. $ctx1.sendIdx["x"]=1;
  13593. //>>excludeEnd("ctx");
  13594. self._assert_equals_($1,(3));
  13595. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13596. $ctx1.sendIdx["assert:equals:"]=1;
  13597. //>>excludeEnd("ctx");
  13598. $3=$recv($recv($Point())._x_y_((3),(4)))._y();
  13599. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13600. $ctx1.sendIdx["y"]=1;
  13601. //>>excludeEnd("ctx");
  13602. self._assert_equals_($3,(4));
  13603. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13604. $ctx1.sendIdx["assert:equals:"]=2;
  13605. //>>excludeEnd("ctx");
  13606. $6=$recv($Point())._new();
  13607. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13608. $ctx1.sendIdx["new"]=1;
  13609. //>>excludeEnd("ctx");
  13610. $5=$recv($6)._x_((3));
  13611. $4=$recv($5)._x();
  13612. self._assert_equals_($4,(3));
  13613. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13614. $ctx1.sendIdx["assert:equals:"]=3;
  13615. //>>excludeEnd("ctx");
  13616. self._assert_equals_($recv($recv($recv($Point())._new())._y_((4)))._y(),(4));
  13617. return self;
  13618. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13619. }, function($ctx1) {$ctx1.fill(self,"testAccessing",{},$globals.PointTest)});
  13620. //>>excludeEnd("ctx");
  13621. },
  13622. //>>excludeStart("ide", pragmas.excludeIdeData);
  13623. args: [],
  13624. 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",
  13625. referencedClasses: ["Point"],
  13626. //>>excludeEnd("ide");
  13627. messageSends: ["assert:equals:", "x", "x:y:", "y", "x:", "new", "y:"]
  13628. }),
  13629. $globals.PointTest);
  13630. $core.addMethod(
  13631. $core.method({
  13632. selector: "testArithmetic",
  13633. protocol: 'tests',
  13634. fn: function (){
  13635. var self=this;
  13636. function $Point(){return $globals.Point||(typeof Point=="undefined"?nil:Point)}
  13637. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13638. return $core.withContext(function($ctx1) {
  13639. //>>excludeEnd("ctx");
  13640. var $2,$3,$1,$4,$6,$7,$5,$8,$10,$11,$9,$12,$14,$13;
  13641. $2=(3).__at((4));
  13642. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13643. $ctx1.sendIdx["@"]=1;
  13644. //>>excludeEnd("ctx");
  13645. $3=(3).__at((4));
  13646. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13647. $ctx1.sendIdx["@"]=2;
  13648. //>>excludeEnd("ctx");
  13649. $1=$recv($2).__star($3);
  13650. $4=$recv($Point())._x_y_((9),(16));
  13651. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13652. $ctx1.sendIdx["x:y:"]=1;
  13653. //>>excludeEnd("ctx");
  13654. self._assert_equals_($1,$4);
  13655. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13656. $ctx1.sendIdx["assert:equals:"]=1;
  13657. //>>excludeEnd("ctx");
  13658. $6=(3).__at((4));
  13659. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13660. $ctx1.sendIdx["@"]=3;
  13661. //>>excludeEnd("ctx");
  13662. $7=(3).__at((4));
  13663. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13664. $ctx1.sendIdx["@"]=4;
  13665. //>>excludeEnd("ctx");
  13666. $5=$recv($6).__plus($7);
  13667. $8=$recv($Point())._x_y_((6),(8));
  13668. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13669. $ctx1.sendIdx["x:y:"]=2;
  13670. //>>excludeEnd("ctx");
  13671. self._assert_equals_($5,$8);
  13672. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13673. $ctx1.sendIdx["assert:equals:"]=2;
  13674. //>>excludeEnd("ctx");
  13675. $10=(3).__at((4));
  13676. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13677. $ctx1.sendIdx["@"]=5;
  13678. //>>excludeEnd("ctx");
  13679. $11=(3).__at((4));
  13680. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13681. $ctx1.sendIdx["@"]=6;
  13682. //>>excludeEnd("ctx");
  13683. $9=$recv($10).__minus($11);
  13684. $12=$recv($Point())._x_y_((0),(0));
  13685. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13686. $ctx1.sendIdx["x:y:"]=3;
  13687. //>>excludeEnd("ctx");
  13688. self._assert_equals_($9,$12);
  13689. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13690. $ctx1.sendIdx["assert:equals:"]=3;
  13691. //>>excludeEnd("ctx");
  13692. $14=(6).__at((8));
  13693. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13694. $ctx1.sendIdx["@"]=7;
  13695. //>>excludeEnd("ctx");
  13696. $13=$recv($14).__slash((3).__at((4)));
  13697. self._assert_equals_($13,$recv($Point())._x_y_((2),(2)));
  13698. return self;
  13699. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13700. }, function($ctx1) {$ctx1.fill(self,"testArithmetic",{},$globals.PointTest)});
  13701. //>>excludeEnd("ctx");
  13702. },
  13703. //>>excludeStart("ide", pragmas.excludeIdeData);
  13704. args: [],
  13705. 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)",
  13706. referencedClasses: ["Point"],
  13707. //>>excludeEnd("ide");
  13708. messageSends: ["assert:equals:", "*", "@", "x:y:", "+", "-", "/"]
  13709. }),
  13710. $globals.PointTest);
  13711. $core.addMethod(
  13712. $core.method({
  13713. selector: "testAt",
  13714. protocol: 'tests',
  13715. fn: function (){
  13716. var self=this;
  13717. function $Point(){return $globals.Point||(typeof Point=="undefined"?nil:Point)}
  13718. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13719. return $core.withContext(function($ctx1) {
  13720. //>>excludeEnd("ctx");
  13721. self._assert_equals_((3).__at((4)),$recv($Point())._x_y_((3),(4)));
  13722. return self;
  13723. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13724. }, function($ctx1) {$ctx1.fill(self,"testAt",{},$globals.PointTest)});
  13725. //>>excludeEnd("ctx");
  13726. },
  13727. //>>excludeStart("ide", pragmas.excludeIdeData);
  13728. args: [],
  13729. source: "testAt\x0a\x09self assert: 3@4 equals: (Point x: 3 y: 4)",
  13730. referencedClasses: ["Point"],
  13731. //>>excludeEnd("ide");
  13732. messageSends: ["assert:equals:", "@", "x:y:"]
  13733. }),
  13734. $globals.PointTest);
  13735. $core.addMethod(
  13736. $core.method({
  13737. selector: "testComparison",
  13738. protocol: 'tests',
  13739. fn: function (){
  13740. var self=this;
  13741. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13742. return $core.withContext(function($ctx1) {
  13743. //>>excludeEnd("ctx");
  13744. var $2,$3,$1,$5,$6,$4,$8,$9,$7,$11,$12,$10,$14,$15,$13,$17,$18,$16,$20,$21,$19,$23,$22;
  13745. $2=(3).__at((4));
  13746. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13747. $ctx1.sendIdx["@"]=1;
  13748. //>>excludeEnd("ctx");
  13749. $3=(4).__at((5));
  13750. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13751. $ctx1.sendIdx["@"]=2;
  13752. //>>excludeEnd("ctx");
  13753. $1=$recv($2).__lt($3);
  13754. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13755. $ctx1.sendIdx["<"]=1;
  13756. //>>excludeEnd("ctx");
  13757. self._assert_($1);
  13758. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13759. $ctx1.sendIdx["assert:"]=1;
  13760. //>>excludeEnd("ctx");
  13761. $5=(3).__at((4));
  13762. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13763. $ctx1.sendIdx["@"]=3;
  13764. //>>excludeEnd("ctx");
  13765. $6=(4).__at((4));
  13766. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13767. $ctx1.sendIdx["@"]=4;
  13768. //>>excludeEnd("ctx");
  13769. $4=$recv($5).__lt($6);
  13770. self._deny_($4);
  13771. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13772. $ctx1.sendIdx["deny:"]=1;
  13773. //>>excludeEnd("ctx");
  13774. $8=(4).__at((5));
  13775. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13776. $ctx1.sendIdx["@"]=5;
  13777. //>>excludeEnd("ctx");
  13778. $9=(4).__at((5));
  13779. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13780. $ctx1.sendIdx["@"]=6;
  13781. //>>excludeEnd("ctx");
  13782. $7=$recv($8).__lt_eq($9);
  13783. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13784. $ctx1.sendIdx["<="]=1;
  13785. //>>excludeEnd("ctx");
  13786. self._assert_($7);
  13787. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13788. $ctx1.sendIdx["assert:"]=2;
  13789. //>>excludeEnd("ctx");
  13790. $11=(4).__at((5));
  13791. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13792. $ctx1.sendIdx["@"]=7;
  13793. //>>excludeEnd("ctx");
  13794. $12=(3).__at((5));
  13795. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13796. $ctx1.sendIdx["@"]=8;
  13797. //>>excludeEnd("ctx");
  13798. $10=$recv($11).__lt_eq($12);
  13799. self._deny_($10);
  13800. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13801. $ctx1.sendIdx["deny:"]=2;
  13802. //>>excludeEnd("ctx");
  13803. $14=(5).__at((6));
  13804. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13805. $ctx1.sendIdx["@"]=9;
  13806. //>>excludeEnd("ctx");
  13807. $15=(4).__at((5));
  13808. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13809. $ctx1.sendIdx["@"]=10;
  13810. //>>excludeEnd("ctx");
  13811. $13=$recv($14).__gt($15);
  13812. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13813. $ctx1.sendIdx[">"]=1;
  13814. //>>excludeEnd("ctx");
  13815. self._assert_($13);
  13816. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13817. $ctx1.sendIdx["assert:"]=3;
  13818. //>>excludeEnd("ctx");
  13819. $17=(5).__at((6));
  13820. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13821. $ctx1.sendIdx["@"]=11;
  13822. //>>excludeEnd("ctx");
  13823. $18=(6).__at((6));
  13824. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13825. $ctx1.sendIdx["@"]=12;
  13826. //>>excludeEnd("ctx");
  13827. $16=$recv($17).__gt($18);
  13828. self._deny_($16);
  13829. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13830. $ctx1.sendIdx["deny:"]=3;
  13831. //>>excludeEnd("ctx");
  13832. $20=(4).__at((5));
  13833. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13834. $ctx1.sendIdx["@"]=13;
  13835. //>>excludeEnd("ctx");
  13836. $21=(4).__at((5));
  13837. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13838. $ctx1.sendIdx["@"]=14;
  13839. //>>excludeEnd("ctx");
  13840. $19=$recv($20).__gt_eq($21);
  13841. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13842. $ctx1.sendIdx[">="]=1;
  13843. //>>excludeEnd("ctx");
  13844. self._assert_($19);
  13845. $23=(4).__at((5));
  13846. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13847. $ctx1.sendIdx["@"]=15;
  13848. //>>excludeEnd("ctx");
  13849. $22=$recv($23).__gt_eq((5).__at((5)));
  13850. self._deny_($22);
  13851. return self;
  13852. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13853. }, function($ctx1) {$ctx1.fill(self,"testComparison",{},$globals.PointTest)});
  13854. //>>excludeEnd("ctx");
  13855. },
  13856. //>>excludeStart("ide", pragmas.excludeIdeData);
  13857. args: [],
  13858. 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)",
  13859. referencedClasses: [],
  13860. //>>excludeEnd("ide");
  13861. messageSends: ["assert:", "<", "@", "deny:", "<=", ">", ">="]
  13862. }),
  13863. $globals.PointTest);
  13864. $core.addMethod(
  13865. $core.method({
  13866. selector: "testEgality",
  13867. protocol: 'tests',
  13868. fn: function (){
  13869. var self=this;
  13870. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13871. return $core.withContext(function($ctx1) {
  13872. //>>excludeEnd("ctx");
  13873. var $2,$3,$1,$5,$4;
  13874. $2=(3).__at((4));
  13875. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13876. $ctx1.sendIdx["@"]=1;
  13877. //>>excludeEnd("ctx");
  13878. $3=(3).__at((4));
  13879. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13880. $ctx1.sendIdx["@"]=2;
  13881. //>>excludeEnd("ctx");
  13882. $1=$recv($2).__eq($3);
  13883. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13884. $ctx1.sendIdx["="]=1;
  13885. //>>excludeEnd("ctx");
  13886. self._assert_($1);
  13887. $5=(3).__at((5));
  13888. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13889. $ctx1.sendIdx["@"]=3;
  13890. //>>excludeEnd("ctx");
  13891. $4=$recv($5).__eq((3).__at((6)));
  13892. self._deny_($4);
  13893. return self;
  13894. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13895. }, function($ctx1) {$ctx1.fill(self,"testEgality",{},$globals.PointTest)});
  13896. //>>excludeEnd("ctx");
  13897. },
  13898. //>>excludeStart("ide", pragmas.excludeIdeData);
  13899. args: [],
  13900. source: "testEgality\x0a\x09self assert: (3@4 = (3@4)).\x0a\x09self deny: 3@5 = (3@6)",
  13901. referencedClasses: [],
  13902. //>>excludeEnd("ide");
  13903. messageSends: ["assert:", "=", "@", "deny:"]
  13904. }),
  13905. $globals.PointTest);
  13906. $core.addMethod(
  13907. $core.method({
  13908. selector: "testNew",
  13909. protocol: 'tests',
  13910. fn: function (){
  13911. var self=this;
  13912. function $Point(){return $globals.Point||(typeof Point=="undefined"?nil:Point)}
  13913. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13914. return $core.withContext(function($ctx1) {
  13915. //>>excludeEnd("ctx");
  13916. var $3,$2,$1,$7,$6,$5,$4,$10,$9,$8;
  13917. $3=$recv($Point())._new();
  13918. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13919. $ctx1.sendIdx["new"]=1;
  13920. //>>excludeEnd("ctx");
  13921. $2=$recv($3)._x_((3));
  13922. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13923. $ctx1.sendIdx["x:"]=1;
  13924. //>>excludeEnd("ctx");
  13925. $1=$recv($2)._y();
  13926. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13927. $ctx1.sendIdx["y"]=1;
  13928. //>>excludeEnd("ctx");
  13929. self._assert_equals_($1,nil);
  13930. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13931. $ctx1.sendIdx["assert:equals:"]=1;
  13932. //>>excludeEnd("ctx");
  13933. $7=$recv($Point())._new();
  13934. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13935. $ctx1.sendIdx["new"]=2;
  13936. //>>excludeEnd("ctx");
  13937. $6=$recv($7)._x_((3));
  13938. $5=$recv($6)._x();
  13939. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13940. $ctx1.sendIdx["x"]=1;
  13941. //>>excludeEnd("ctx");
  13942. $4=$recv($5).__eq((0));
  13943. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13944. $ctx1.sendIdx["="]=1;
  13945. //>>excludeEnd("ctx");
  13946. self._deny_($4);
  13947. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13948. $ctx1.sendIdx["deny:"]=1;
  13949. //>>excludeEnd("ctx");
  13950. $10=$recv($Point())._new();
  13951. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13952. $ctx1.sendIdx["new"]=3;
  13953. //>>excludeEnd("ctx");
  13954. $9=$recv($10)._y_((4));
  13955. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13956. $ctx1.sendIdx["y:"]=1;
  13957. //>>excludeEnd("ctx");
  13958. $8=$recv($9)._x();
  13959. self._assert_equals_($8,nil);
  13960. self._deny_($recv($recv($recv($recv($Point())._new())._y_((4)))._y()).__eq((0)));
  13961. return self;
  13962. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13963. }, function($ctx1) {$ctx1.fill(self,"testNew",{},$globals.PointTest)});
  13964. //>>excludeEnd("ctx");
  13965. },
  13966. //>>excludeStart("ide", pragmas.excludeIdeData);
  13967. args: [],
  13968. 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",
  13969. referencedClasses: ["Point"],
  13970. //>>excludeEnd("ide");
  13971. messageSends: ["assert:equals:", "y", "x:", "new", "deny:", "=", "x", "y:"]
  13972. }),
  13973. $globals.PointTest);
  13974. $core.addMethod(
  13975. $core.method({
  13976. selector: "testTranslateBy",
  13977. protocol: 'tests',
  13978. fn: function (){
  13979. var self=this;
  13980. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13981. return $core.withContext(function($ctx1) {
  13982. //>>excludeEnd("ctx");
  13983. var $2,$3,$1,$4,$6,$8,$7,$5,$9,$11,$12,$10,$13,$15,$16,$14;
  13984. $2=(3).__at((3));
  13985. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13986. $ctx1.sendIdx["@"]=1;
  13987. //>>excludeEnd("ctx");
  13988. $3=(0).__at((1));
  13989. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13990. $ctx1.sendIdx["@"]=2;
  13991. //>>excludeEnd("ctx");
  13992. $1=$recv($2)._translateBy_($3);
  13993. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13994. $ctx1.sendIdx["translateBy:"]=1;
  13995. //>>excludeEnd("ctx");
  13996. $4=(3).__at((4));
  13997. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13998. $ctx1.sendIdx["@"]=3;
  13999. //>>excludeEnd("ctx");
  14000. self._assert_equals_($1,$4);
  14001. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14002. $ctx1.sendIdx["assert:equals:"]=1;
  14003. //>>excludeEnd("ctx");
  14004. $6=(3).__at((3));
  14005. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14006. $ctx1.sendIdx["@"]=4;
  14007. //>>excludeEnd("ctx");
  14008. $8=(1)._negated();
  14009. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14010. $ctx1.sendIdx["negated"]=1;
  14011. //>>excludeEnd("ctx");
  14012. $7=(0).__at($8);
  14013. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14014. $ctx1.sendIdx["@"]=5;
  14015. //>>excludeEnd("ctx");
  14016. $5=$recv($6)._translateBy_($7);
  14017. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14018. $ctx1.sendIdx["translateBy:"]=2;
  14019. //>>excludeEnd("ctx");
  14020. $9=(3).__at((2));
  14021. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14022. $ctx1.sendIdx["@"]=6;
  14023. //>>excludeEnd("ctx");
  14024. self._assert_equals_($5,$9);
  14025. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14026. $ctx1.sendIdx["assert:equals:"]=2;
  14027. //>>excludeEnd("ctx");
  14028. $11=(3).__at((3));
  14029. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14030. $ctx1.sendIdx["@"]=7;
  14031. //>>excludeEnd("ctx");
  14032. $12=(2).__at((3));
  14033. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14034. $ctx1.sendIdx["@"]=8;
  14035. //>>excludeEnd("ctx");
  14036. $10=$recv($11)._translateBy_($12);
  14037. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14038. $ctx1.sendIdx["translateBy:"]=3;
  14039. //>>excludeEnd("ctx");
  14040. $13=(5).__at((6));
  14041. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14042. $ctx1.sendIdx["@"]=9;
  14043. //>>excludeEnd("ctx");
  14044. self._assert_equals_($10,$13);
  14045. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14046. $ctx1.sendIdx["assert:equals:"]=3;
  14047. //>>excludeEnd("ctx");
  14048. $15=(3).__at((3));
  14049. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14050. $ctx1.sendIdx["@"]=10;
  14051. //>>excludeEnd("ctx");
  14052. $16=$recv((3)._negated()).__at((0));
  14053. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14054. $ctx1.sendIdx["@"]=11;
  14055. //>>excludeEnd("ctx");
  14056. $14=$recv($15)._translateBy_($16);
  14057. self._assert_equals_($14,(0).__at((3)));
  14058. return self;
  14059. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14060. }, function($ctx1) {$ctx1.fill(self,"testTranslateBy",{},$globals.PointTest)});
  14061. //>>excludeEnd("ctx");
  14062. },
  14063. //>>excludeStart("ide", pragmas.excludeIdeData);
  14064. args: [],
  14065. 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.",
  14066. referencedClasses: [],
  14067. //>>excludeEnd("ide");
  14068. messageSends: ["assert:equals:", "translateBy:", "@", "negated"]
  14069. }),
  14070. $globals.PointTest);
  14071. $core.addClass('QueueTest', $globals.TestCase, [], 'Kernel-Tests');
  14072. $core.addMethod(
  14073. $core.method({
  14074. selector: "testNextIfAbsent",
  14075. protocol: 'tests',
  14076. fn: function (){
  14077. var self=this;
  14078. var queue;
  14079. function $Queue(){return $globals.Queue||(typeof Queue=="undefined"?nil:Queue)}
  14080. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14081. return $core.withContext(function($ctx1) {
  14082. //>>excludeEnd("ctx");
  14083. var $2,$1;
  14084. queue=$recv($Queue())._new();
  14085. $recv(queue)._nextPut_("index1");
  14086. $2=$recv(queue)._nextIfAbsent_("empty");
  14087. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14088. $ctx1.sendIdx["nextIfAbsent:"]=1;
  14089. //>>excludeEnd("ctx");
  14090. $1=$recv($2).__eq("index1");
  14091. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14092. $ctx1.sendIdx["="]=1;
  14093. //>>excludeEnd("ctx");
  14094. self._assert_($1);
  14095. self._deny_($recv($recv(queue)._nextIfAbsent_("empty")).__eq("index1"));
  14096. return self;
  14097. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14098. }, function($ctx1) {$ctx1.fill(self,"testNextIfAbsent",{queue:queue},$globals.QueueTest)});
  14099. //>>excludeEnd("ctx");
  14100. },
  14101. //>>excludeStart("ide", pragmas.excludeIdeData);
  14102. args: [],
  14103. 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'",
  14104. referencedClasses: ["Queue"],
  14105. //>>excludeEnd("ide");
  14106. messageSends: ["new", "nextPut:", "assert:", "=", "nextIfAbsent:", "deny:"]
  14107. }),
  14108. $globals.QueueTest);
  14109. $core.addMethod(
  14110. $core.method({
  14111. selector: "testQueueNext",
  14112. protocol: 'tests',
  14113. fn: function (){
  14114. var self=this;
  14115. var queue;
  14116. function $Queue(){return $globals.Queue||(typeof Queue=="undefined"?nil:Queue)}
  14117. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  14118. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14119. return $core.withContext(function($ctx1) {
  14120. //>>excludeEnd("ctx");
  14121. var $1,$3,$2,$5,$4;
  14122. queue=$recv($Queue())._new();
  14123. $1=queue;
  14124. $recv($1)._nextPut_("index1");
  14125. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14126. $ctx1.sendIdx["nextPut:"]=1;
  14127. //>>excludeEnd("ctx");
  14128. $recv($1)._nextPut_("index2");
  14129. $3=$recv(queue)._next();
  14130. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14131. $ctx1.sendIdx["next"]=1;
  14132. //>>excludeEnd("ctx");
  14133. $2=$recv($3).__eq("index1");
  14134. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14135. $ctx1.sendIdx["="]=1;
  14136. //>>excludeEnd("ctx");
  14137. self._assert_($2);
  14138. $5=$recv(queue)._next();
  14139. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14140. $ctx1.sendIdx["next"]=2;
  14141. //>>excludeEnd("ctx");
  14142. $4=$recv($5).__eq("index");
  14143. self._deny_($4);
  14144. self._should_raise_((function(){
  14145. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14146. return $core.withContext(function($ctx2) {
  14147. //>>excludeEnd("ctx");
  14148. return $recv(queue)._next();
  14149. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14150. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  14151. //>>excludeEnd("ctx");
  14152. }),$Error());
  14153. return self;
  14154. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14155. }, function($ctx1) {$ctx1.fill(self,"testQueueNext",{queue:queue},$globals.QueueTest)});
  14156. //>>excludeEnd("ctx");
  14157. },
  14158. //>>excludeStart("ide", pragmas.excludeIdeData);
  14159. args: [],
  14160. 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",
  14161. referencedClasses: ["Queue", "Error"],
  14162. //>>excludeEnd("ide");
  14163. messageSends: ["new", "nextPut:", "assert:", "=", "next", "deny:", "should:raise:"]
  14164. }),
  14165. $globals.QueueTest);
  14166. $core.addClass('RandomTest', $globals.TestCase, [], 'Kernel-Tests');
  14167. $core.addMethod(
  14168. $core.method({
  14169. selector: "testAtRandomNumber",
  14170. protocol: 'tests',
  14171. fn: function (){
  14172. var self=this;
  14173. var val;
  14174. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14175. return $core.withContext(function($ctx1) {
  14176. //>>excludeEnd("ctx");
  14177. (100)._timesRepeat_((function(){
  14178. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14179. return $core.withContext(function($ctx2) {
  14180. //>>excludeEnd("ctx");
  14181. val=(10)._atRandom();
  14182. val;
  14183. self._assert_($recv(val).__gt((0)));
  14184. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14185. $ctx2.sendIdx["assert:"]=1;
  14186. //>>excludeEnd("ctx");
  14187. return self._assert_($recv(val).__lt((11)));
  14188. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14189. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  14190. //>>excludeEnd("ctx");
  14191. }));
  14192. return self;
  14193. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14194. }, function($ctx1) {$ctx1.fill(self,"testAtRandomNumber",{val:val},$globals.RandomTest)});
  14195. //>>excludeEnd("ctx");
  14196. },
  14197. //>>excludeStart("ide", pragmas.excludeIdeData);
  14198. args: [],
  14199. 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]",
  14200. referencedClasses: [],
  14201. //>>excludeEnd("ide");
  14202. messageSends: ["timesRepeat:", "atRandom", "assert:", ">", "<"]
  14203. }),
  14204. $globals.RandomTest);
  14205. $core.addMethod(
  14206. $core.method({
  14207. selector: "testAtRandomSequenceableCollection",
  14208. protocol: 'tests',
  14209. fn: function (){
  14210. var self=this;
  14211. var val;
  14212. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14213. return $core.withContext(function($ctx1) {
  14214. //>>excludeEnd("ctx");
  14215. var $3,$4,$2,$1;
  14216. (100)._timesRepeat_((function(){
  14217. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14218. return $core.withContext(function($ctx2) {
  14219. //>>excludeEnd("ctx");
  14220. val="abc"._atRandom();
  14221. val;
  14222. $3=$recv(val).__eq("a");
  14223. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14224. $ctx2.sendIdx["="]=1;
  14225. //>>excludeEnd("ctx");
  14226. $4=$recv(val).__eq("b");
  14227. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14228. $ctx2.sendIdx["="]=2;
  14229. //>>excludeEnd("ctx");
  14230. $2=$recv($3).__or($4);
  14231. $1=$recv($2).__or($recv(val).__eq("c"));
  14232. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14233. $ctx2.sendIdx["|"]=1;
  14234. //>>excludeEnd("ctx");
  14235. return self._assert_($1);
  14236. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14237. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  14238. //>>excludeEnd("ctx");
  14239. }));
  14240. return self;
  14241. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14242. }, function($ctx1) {$ctx1.fill(self,"testAtRandomSequenceableCollection",{val:val},$globals.RandomTest)});
  14243. //>>excludeEnd("ctx");
  14244. },
  14245. //>>excludeStart("ide", pragmas.excludeIdeData);
  14246. args: [],
  14247. 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].",
  14248. referencedClasses: [],
  14249. //>>excludeEnd("ide");
  14250. messageSends: ["timesRepeat:", "atRandom", "assert:", "|", "="]
  14251. }),
  14252. $globals.RandomTest);
  14253. $core.addMethod(
  14254. $core.method({
  14255. selector: "textNext",
  14256. protocol: 'tests',
  14257. fn: function (){
  14258. var self=this;
  14259. function $Random(){return $globals.Random||(typeof Random=="undefined"?nil:Random)}
  14260. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14261. return $core.withContext(function($ctx1) {
  14262. //>>excludeEnd("ctx");
  14263. var $1;
  14264. (10000)._timesRepeat_((function(){
  14265. var current,next;
  14266. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14267. return $core.withContext(function($ctx2) {
  14268. //>>excludeEnd("ctx");
  14269. next=$recv($recv($Random())._new())._next();
  14270. next;
  14271. self._assert_($recv(next).__gt_eq((0)));
  14272. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14273. $ctx2.sendIdx["assert:"]=1;
  14274. //>>excludeEnd("ctx");
  14275. self._assert_($recv(next).__lt((1)));
  14276. $1=$recv(current).__eq(next);
  14277. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14278. $ctx2.sendIdx["="]=1;
  14279. //>>excludeEnd("ctx");
  14280. self._deny_($1);
  14281. return $recv(next).__eq(current);
  14282. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14283. }, function($ctx2) {$ctx2.fillBlock({current:current,next:next},$ctx1,1)});
  14284. //>>excludeEnd("ctx");
  14285. }));
  14286. return self;
  14287. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14288. }, function($ctx1) {$ctx1.fill(self,"textNext",{},$globals.RandomTest)});
  14289. //>>excludeEnd("ctx");
  14290. },
  14291. //>>excludeStart("ide", pragmas.excludeIdeData);
  14292. args: [],
  14293. 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 ]",
  14294. referencedClasses: ["Random"],
  14295. //>>excludeEnd("ide");
  14296. messageSends: ["timesRepeat:", "next", "new", "assert:", ">=", "<", "deny:", "="]
  14297. }),
  14298. $globals.RandomTest);
  14299. $core.addClass('StreamTest', $globals.TestCase, [], 'Kernel-Tests');
  14300. $core.addMethod(
  14301. $core.method({
  14302. selector: "collectionClass",
  14303. protocol: 'accessing',
  14304. fn: function (){
  14305. var self=this;
  14306. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14307. return $core.withContext(function($ctx1) {
  14308. //>>excludeEnd("ctx");
  14309. return $recv(self._class())._collectionClass();
  14310. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14311. }, function($ctx1) {$ctx1.fill(self,"collectionClass",{},$globals.StreamTest)});
  14312. //>>excludeEnd("ctx");
  14313. },
  14314. //>>excludeStart("ide", pragmas.excludeIdeData);
  14315. args: [],
  14316. source: "collectionClass\x0a\x09^ self class collectionClass",
  14317. referencedClasses: [],
  14318. //>>excludeEnd("ide");
  14319. messageSends: ["collectionClass", "class"]
  14320. }),
  14321. $globals.StreamTest);
  14322. $core.addMethod(
  14323. $core.method({
  14324. selector: "newCollection",
  14325. protocol: 'accessing',
  14326. fn: function (){
  14327. var self=this;
  14328. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14329. return $core.withContext(function($ctx1) {
  14330. //>>excludeEnd("ctx");
  14331. return $recv(self._collectionClass())._new();
  14332. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14333. }, function($ctx1) {$ctx1.fill(self,"newCollection",{},$globals.StreamTest)});
  14334. //>>excludeEnd("ctx");
  14335. },
  14336. //>>excludeStart("ide", pragmas.excludeIdeData);
  14337. args: [],
  14338. source: "newCollection\x0a\x09^ self collectionClass new",
  14339. referencedClasses: [],
  14340. //>>excludeEnd("ide");
  14341. messageSends: ["new", "collectionClass"]
  14342. }),
  14343. $globals.StreamTest);
  14344. $core.addMethod(
  14345. $core.method({
  14346. selector: "newStream",
  14347. protocol: 'accessing',
  14348. fn: function (){
  14349. var self=this;
  14350. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14351. return $core.withContext(function($ctx1) {
  14352. //>>excludeEnd("ctx");
  14353. return $recv($recv(self._collectionClass())._new())._stream();
  14354. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14355. }, function($ctx1) {$ctx1.fill(self,"newStream",{},$globals.StreamTest)});
  14356. //>>excludeEnd("ctx");
  14357. },
  14358. //>>excludeStart("ide", pragmas.excludeIdeData);
  14359. args: [],
  14360. source: "newStream\x0a\x09^ self collectionClass new stream",
  14361. referencedClasses: [],
  14362. //>>excludeEnd("ide");
  14363. messageSends: ["stream", "new", "collectionClass"]
  14364. }),
  14365. $globals.StreamTest);
  14366. $core.addMethod(
  14367. $core.method({
  14368. selector: "testAtStartAtEnd",
  14369. protocol: 'tests',
  14370. fn: function (){
  14371. var self=this;
  14372. var stream;
  14373. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14374. return $core.withContext(function($ctx1) {
  14375. //>>excludeEnd("ctx");
  14376. var $1,$2,$3,$4;
  14377. stream=self._newStream();
  14378. $1=$recv(stream)._atStart();
  14379. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14380. $ctx1.sendIdx["atStart"]=1;
  14381. //>>excludeEnd("ctx");
  14382. self._assert_($1);
  14383. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14384. $ctx1.sendIdx["assert:"]=1;
  14385. //>>excludeEnd("ctx");
  14386. $2=$recv(stream)._atEnd();
  14387. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14388. $ctx1.sendIdx["atEnd"]=1;
  14389. //>>excludeEnd("ctx");
  14390. self._assert_($2);
  14391. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14392. $ctx1.sendIdx["assert:"]=2;
  14393. //>>excludeEnd("ctx");
  14394. $recv(stream)._nextPutAll_(self._newCollection());
  14395. $3=$recv(stream)._atEnd();
  14396. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14397. $ctx1.sendIdx["atEnd"]=2;
  14398. //>>excludeEnd("ctx");
  14399. self._assert_($3);
  14400. $4=$recv(stream)._atStart();
  14401. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14402. $ctx1.sendIdx["atStart"]=2;
  14403. //>>excludeEnd("ctx");
  14404. self._deny_($4);
  14405. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14406. $ctx1.sendIdx["deny:"]=1;
  14407. //>>excludeEnd("ctx");
  14408. $recv(stream)._position_((1));
  14409. self._deny_($recv(stream)._atEnd());
  14410. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14411. $ctx1.sendIdx["deny:"]=2;
  14412. //>>excludeEnd("ctx");
  14413. self._deny_($recv(stream)._atStart());
  14414. return self;
  14415. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14416. }, function($ctx1) {$ctx1.fill(self,"testAtStartAtEnd",{stream:stream},$globals.StreamTest)});
  14417. //>>excludeEnd("ctx");
  14418. },
  14419. //>>excludeStart("ide", pragmas.excludeIdeData);
  14420. args: [],
  14421. 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",
  14422. referencedClasses: [],
  14423. //>>excludeEnd("ide");
  14424. messageSends: ["newStream", "assert:", "atStart", "atEnd", "nextPutAll:", "newCollection", "deny:", "position:"]
  14425. }),
  14426. $globals.StreamTest);
  14427. $core.addMethod(
  14428. $core.method({
  14429. selector: "testContents",
  14430. protocol: 'tests',
  14431. fn: function (){
  14432. var self=this;
  14433. var stream;
  14434. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14435. return $core.withContext(function($ctx1) {
  14436. //>>excludeEnd("ctx");
  14437. var $1,$2;
  14438. stream=self._newStream();
  14439. $1=stream;
  14440. $2=self._newCollection();
  14441. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14442. $ctx1.sendIdx["newCollection"]=1;
  14443. //>>excludeEnd("ctx");
  14444. $recv($1)._nextPutAll_($2);
  14445. self._assert_equals_($recv(stream)._contents(),self._newCollection());
  14446. return self;
  14447. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14448. }, function($ctx1) {$ctx1.fill(self,"testContents",{stream:stream},$globals.StreamTest)});
  14449. //>>excludeEnd("ctx");
  14450. },
  14451. //>>excludeStart("ide", pragmas.excludeIdeData);
  14452. args: [],
  14453. 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",
  14454. referencedClasses: [],
  14455. //>>excludeEnd("ide");
  14456. messageSends: ["newStream", "nextPutAll:", "newCollection", "assert:equals:", "contents"]
  14457. }),
  14458. $globals.StreamTest);
  14459. $core.addMethod(
  14460. $core.method({
  14461. selector: "testIsEmpty",
  14462. protocol: 'tests',
  14463. fn: function (){
  14464. var self=this;
  14465. var stream;
  14466. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14467. return $core.withContext(function($ctx1) {
  14468. //>>excludeEnd("ctx");
  14469. var $1;
  14470. stream=self._newStream();
  14471. $1=$recv(stream)._isEmpty();
  14472. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14473. $ctx1.sendIdx["isEmpty"]=1;
  14474. //>>excludeEnd("ctx");
  14475. self._assert_($1);
  14476. $recv(stream)._nextPutAll_(self._newCollection());
  14477. self._deny_($recv(stream)._isEmpty());
  14478. return self;
  14479. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14480. }, function($ctx1) {$ctx1.fill(self,"testIsEmpty",{stream:stream},$globals.StreamTest)});
  14481. //>>excludeEnd("ctx");
  14482. },
  14483. //>>excludeStart("ide", pragmas.excludeIdeData);
  14484. args: [],
  14485. 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",
  14486. referencedClasses: [],
  14487. //>>excludeEnd("ide");
  14488. messageSends: ["newStream", "assert:", "isEmpty", "nextPutAll:", "newCollection", "deny:"]
  14489. }),
  14490. $globals.StreamTest);
  14491. $core.addMethod(
  14492. $core.method({
  14493. selector: "testPosition",
  14494. protocol: 'tests',
  14495. fn: function (){
  14496. var self=this;
  14497. var collection,stream;
  14498. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14499. return $core.withContext(function($ctx1) {
  14500. //>>excludeEnd("ctx");
  14501. var $1,$2,$3;
  14502. collection=self._newCollection();
  14503. stream=self._newStream();
  14504. $recv(stream)._nextPutAll_(collection);
  14505. $1=$recv(stream)._position();
  14506. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14507. $ctx1.sendIdx["position"]=1;
  14508. //>>excludeEnd("ctx");
  14509. self._assert_equals_($1,$recv(collection)._size());
  14510. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14511. $ctx1.sendIdx["assert:equals:"]=1;
  14512. //>>excludeEnd("ctx");
  14513. $recv(stream)._position_((0));
  14514. $2=$recv(stream)._position();
  14515. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14516. $ctx1.sendIdx["position"]=2;
  14517. //>>excludeEnd("ctx");
  14518. self._assert_equals_($2,(0));
  14519. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14520. $ctx1.sendIdx["assert:equals:"]=2;
  14521. //>>excludeEnd("ctx");
  14522. $recv(stream)._next();
  14523. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14524. $ctx1.sendIdx["next"]=1;
  14525. //>>excludeEnd("ctx");
  14526. $3=$recv(stream)._position();
  14527. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14528. $ctx1.sendIdx["position"]=3;
  14529. //>>excludeEnd("ctx");
  14530. self._assert_equals_($3,(1));
  14531. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14532. $ctx1.sendIdx["assert:equals:"]=3;
  14533. //>>excludeEnd("ctx");
  14534. $recv(stream)._next();
  14535. self._assert_equals_($recv(stream)._position(),(2));
  14536. return self;
  14537. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14538. }, function($ctx1) {$ctx1.fill(self,"testPosition",{collection:collection,stream:stream},$globals.StreamTest)});
  14539. //>>excludeEnd("ctx");
  14540. },
  14541. //>>excludeStart("ide", pragmas.excludeIdeData);
  14542. args: [],
  14543. 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",
  14544. referencedClasses: [],
  14545. //>>excludeEnd("ide");
  14546. messageSends: ["newCollection", "newStream", "nextPutAll:", "assert:equals:", "position", "size", "position:", "next"]
  14547. }),
  14548. $globals.StreamTest);
  14549. $core.addMethod(
  14550. $core.method({
  14551. selector: "testReading",
  14552. protocol: 'tests',
  14553. fn: function (){
  14554. var self=this;
  14555. var stream,collection;
  14556. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14557. return $core.withContext(function($ctx1) {
  14558. //>>excludeEnd("ctx");
  14559. var $1,$2;
  14560. collection=self._newCollection();
  14561. stream=self._newStream();
  14562. $1=stream;
  14563. $recv($1)._nextPutAll_(collection);
  14564. $recv($1)._position_((0));
  14565. $recv(collection)._do_((function(each){
  14566. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14567. return $core.withContext(function($ctx2) {
  14568. //>>excludeEnd("ctx");
  14569. $2=$recv(stream)._next();
  14570. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14571. $ctx2.sendIdx["next"]=1;
  14572. //>>excludeEnd("ctx");
  14573. return self._assert_equals_($2,each);
  14574. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14575. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  14576. //>>excludeEnd("ctx");
  14577. }));
  14578. self._assert_($recv($recv(stream)._next())._isNil());
  14579. return self;
  14580. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14581. }, function($ctx1) {$ctx1.fill(self,"testReading",{stream:stream,collection:collection},$globals.StreamTest)});
  14582. //>>excludeEnd("ctx");
  14583. },
  14584. //>>excludeStart("ide", pragmas.excludeIdeData);
  14585. args: [],
  14586. 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",
  14587. referencedClasses: [],
  14588. //>>excludeEnd("ide");
  14589. messageSends: ["newCollection", "newStream", "nextPutAll:", "position:", "do:", "assert:equals:", "next", "assert:", "isNil"]
  14590. }),
  14591. $globals.StreamTest);
  14592. $core.addMethod(
  14593. $core.method({
  14594. selector: "testStreamContents",
  14595. protocol: 'tests',
  14596. fn: function (){
  14597. var self=this;
  14598. return self;
  14599. },
  14600. //>>excludeStart("ide", pragmas.excludeIdeData);
  14601. args: [],
  14602. source: "testStreamContents",
  14603. referencedClasses: [],
  14604. //>>excludeEnd("ide");
  14605. messageSends: []
  14606. }),
  14607. $globals.StreamTest);
  14608. $core.addMethod(
  14609. $core.method({
  14610. selector: "testWrite",
  14611. protocol: 'tests',
  14612. fn: function (){
  14613. var self=this;
  14614. var stream,collection;
  14615. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14616. return $core.withContext(function($ctx1) {
  14617. //>>excludeEnd("ctx");
  14618. collection=self._newCollection();
  14619. stream=self._newStream();
  14620. $recv(collection)._do_((function(each){
  14621. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14622. return $core.withContext(function($ctx2) {
  14623. //>>excludeEnd("ctx");
  14624. return $recv(stream).__lt_lt(each);
  14625. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14626. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  14627. //>>excludeEnd("ctx");
  14628. }));
  14629. self._assert_equals_($recv(stream)._contents(),collection);
  14630. return self;
  14631. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14632. }, function($ctx1) {$ctx1.fill(self,"testWrite",{stream:stream,collection:collection},$globals.StreamTest)});
  14633. //>>excludeEnd("ctx");
  14634. },
  14635. //>>excludeStart("ide", pragmas.excludeIdeData);
  14636. args: [],
  14637. 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",
  14638. referencedClasses: [],
  14639. //>>excludeEnd("ide");
  14640. messageSends: ["newCollection", "newStream", "do:", "<<", "assert:equals:", "contents"]
  14641. }),
  14642. $globals.StreamTest);
  14643. $core.addMethod(
  14644. $core.method({
  14645. selector: "testWriting",
  14646. protocol: 'tests',
  14647. fn: function (){
  14648. var self=this;
  14649. var stream,collection;
  14650. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14651. return $core.withContext(function($ctx1) {
  14652. //>>excludeEnd("ctx");
  14653. var $1;
  14654. collection=self._newCollection();
  14655. stream=self._newStream();
  14656. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14657. $ctx1.sendIdx["newStream"]=1;
  14658. //>>excludeEnd("ctx");
  14659. $recv(collection)._do_((function(each){
  14660. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14661. return $core.withContext(function($ctx2) {
  14662. //>>excludeEnd("ctx");
  14663. return $recv(stream)._nextPut_(each);
  14664. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14665. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  14666. //>>excludeEnd("ctx");
  14667. }));
  14668. $1=$recv(stream)._contents();
  14669. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14670. $ctx1.sendIdx["contents"]=1;
  14671. //>>excludeEnd("ctx");
  14672. self._assert_equals_($1,collection);
  14673. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14674. $ctx1.sendIdx["assert:equals:"]=1;
  14675. //>>excludeEnd("ctx");
  14676. stream=self._newStream();
  14677. $recv(stream)._nextPutAll_(collection);
  14678. self._assert_equals_($recv(stream)._contents(),collection);
  14679. return self;
  14680. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14681. }, function($ctx1) {$ctx1.fill(self,"testWriting",{stream:stream,collection:collection},$globals.StreamTest)});
  14682. //>>excludeEnd("ctx");
  14683. },
  14684. //>>excludeStart("ide", pragmas.excludeIdeData);
  14685. args: [],
  14686. 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",
  14687. referencedClasses: [],
  14688. //>>excludeEnd("ide");
  14689. messageSends: ["newCollection", "newStream", "do:", "nextPut:", "assert:equals:", "contents", "nextPutAll:"]
  14690. }),
  14691. $globals.StreamTest);
  14692. $core.addMethod(
  14693. $core.method({
  14694. selector: "collectionClass",
  14695. protocol: 'accessing',
  14696. fn: function (){
  14697. var self=this;
  14698. return nil;
  14699. },
  14700. //>>excludeStart("ide", pragmas.excludeIdeData);
  14701. args: [],
  14702. source: "collectionClass\x0a\x09^ nil",
  14703. referencedClasses: [],
  14704. //>>excludeEnd("ide");
  14705. messageSends: []
  14706. }),
  14707. $globals.StreamTest.klass);
  14708. $core.addMethod(
  14709. $core.method({
  14710. selector: "isAbstract",
  14711. protocol: 'testing',
  14712. fn: function (){
  14713. var self=this;
  14714. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14715. return $core.withContext(function($ctx1) {
  14716. //>>excludeEnd("ctx");
  14717. return $recv(self._collectionClass())._isNil();
  14718. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14719. }, function($ctx1) {$ctx1.fill(self,"isAbstract",{},$globals.StreamTest.klass)});
  14720. //>>excludeEnd("ctx");
  14721. },
  14722. //>>excludeStart("ide", pragmas.excludeIdeData);
  14723. args: [],
  14724. source: "isAbstract\x0a\x09^ self collectionClass isNil",
  14725. referencedClasses: [],
  14726. //>>excludeEnd("ide");
  14727. messageSends: ["isNil", "collectionClass"]
  14728. }),
  14729. $globals.StreamTest.klass);
  14730. $core.addClass('ArrayStreamTest', $globals.StreamTest, [], 'Kernel-Tests');
  14731. $core.addMethod(
  14732. $core.method({
  14733. selector: "newCollection",
  14734. protocol: 'accessing',
  14735. fn: function (){
  14736. var self=this;
  14737. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14738. return $core.withContext(function($ctx1) {
  14739. //>>excludeEnd("ctx");
  14740. return [true,(1),(3).__at((4)),"foo"];
  14741. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14742. }, function($ctx1) {$ctx1.fill(self,"newCollection",{},$globals.ArrayStreamTest)});
  14743. //>>excludeEnd("ctx");
  14744. },
  14745. //>>excludeStart("ide", pragmas.excludeIdeData);
  14746. args: [],
  14747. source: "newCollection\x0a\x09^ { true. 1. 3@4. 'foo' }",
  14748. referencedClasses: [],
  14749. //>>excludeEnd("ide");
  14750. messageSends: ["@"]
  14751. }),
  14752. $globals.ArrayStreamTest);
  14753. $core.addMethod(
  14754. $core.method({
  14755. selector: "collectionClass",
  14756. protocol: 'accessing',
  14757. fn: function (){
  14758. var self=this;
  14759. function $Array(){return $globals.Array||(typeof Array=="undefined"?nil:Array)}
  14760. return $Array();
  14761. },
  14762. //>>excludeStart("ide", pragmas.excludeIdeData);
  14763. args: [],
  14764. source: "collectionClass\x0a\x09^ Array",
  14765. referencedClasses: ["Array"],
  14766. //>>excludeEnd("ide");
  14767. messageSends: []
  14768. }),
  14769. $globals.ArrayStreamTest.klass);
  14770. $core.addClass('StringStreamTest', $globals.StreamTest, [], 'Kernel-Tests');
  14771. $core.addMethod(
  14772. $core.method({
  14773. selector: "newCollection",
  14774. protocol: 'accessing',
  14775. fn: function (){
  14776. var self=this;
  14777. return "hello world";
  14778. },
  14779. //>>excludeStart("ide", pragmas.excludeIdeData);
  14780. args: [],
  14781. source: "newCollection\x0a\x09^ 'hello world'",
  14782. referencedClasses: [],
  14783. //>>excludeEnd("ide");
  14784. messageSends: []
  14785. }),
  14786. $globals.StringStreamTest);
  14787. $core.addMethod(
  14788. $core.method({
  14789. selector: "collectionClass",
  14790. protocol: 'accessing',
  14791. fn: function (){
  14792. var self=this;
  14793. function $String(){return $globals.String||(typeof String=="undefined"?nil:String)}
  14794. return $String();
  14795. },
  14796. //>>excludeStart("ide", pragmas.excludeIdeData);
  14797. args: [],
  14798. source: "collectionClass\x0a\x09^ String",
  14799. referencedClasses: ["String"],
  14800. //>>excludeEnd("ide");
  14801. messageSends: []
  14802. }),
  14803. $globals.StringStreamTest.klass);
  14804. $core.addClass('UndefinedTest', $globals.TestCase, [], 'Kernel-Tests');
  14805. $core.addMethod(
  14806. $core.method({
  14807. selector: "testCopying",
  14808. protocol: 'tests',
  14809. fn: function (){
  14810. var self=this;
  14811. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14812. return $core.withContext(function($ctx1) {
  14813. //>>excludeEnd("ctx");
  14814. self._assert_equals_(nil._copy(),nil);
  14815. return self;
  14816. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14817. }, function($ctx1) {$ctx1.fill(self,"testCopying",{},$globals.UndefinedTest)});
  14818. //>>excludeEnd("ctx");
  14819. },
  14820. //>>excludeStart("ide", pragmas.excludeIdeData);
  14821. args: [],
  14822. source: "testCopying\x0a\x09self assert: nil copy equals: nil",
  14823. referencedClasses: [],
  14824. //>>excludeEnd("ide");
  14825. messageSends: ["assert:equals:", "copy"]
  14826. }),
  14827. $globals.UndefinedTest);
  14828. $core.addMethod(
  14829. $core.method({
  14830. selector: "testDeepCopy",
  14831. protocol: 'tests',
  14832. fn: function (){
  14833. var self=this;
  14834. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14835. return $core.withContext(function($ctx1) {
  14836. //>>excludeEnd("ctx");
  14837. self._assert_($recv(nil._deepCopy()).__eq(nil));
  14838. return self;
  14839. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14840. }, function($ctx1) {$ctx1.fill(self,"testDeepCopy",{},$globals.UndefinedTest)});
  14841. //>>excludeEnd("ctx");
  14842. },
  14843. //>>excludeStart("ide", pragmas.excludeIdeData);
  14844. args: [],
  14845. source: "testDeepCopy\x0a\x09self assert: nil deepCopy = nil",
  14846. referencedClasses: [],
  14847. //>>excludeEnd("ide");
  14848. messageSends: ["assert:", "=", "deepCopy"]
  14849. }),
  14850. $globals.UndefinedTest);
  14851. $core.addMethod(
  14852. $core.method({
  14853. selector: "testIfNil",
  14854. protocol: 'tests',
  14855. fn: function (){
  14856. var self=this;
  14857. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14858. return $core.withContext(function($ctx1) {
  14859. //>>excludeEnd("ctx");
  14860. var $1,$3,$2,$4,$6,$5,$receiver;
  14861. if(($receiver = nil) == null || $receiver.isNil){
  14862. $1=true;
  14863. } else {
  14864. $1=nil;
  14865. };
  14866. self._assert_equals_($1,true);
  14867. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14868. $ctx1.sendIdx["assert:equals:"]=1;
  14869. //>>excludeEnd("ctx");
  14870. if(($receiver = nil) == null || $receiver.isNil){
  14871. $3=nil;
  14872. } else {
  14873. $3=true;
  14874. };
  14875. $2=$recv($3).__eq(true);
  14876. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14877. $ctx1.sendIdx["="]=1;
  14878. //>>excludeEnd("ctx");
  14879. self._deny_($2);
  14880. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14881. $ctx1.sendIdx["deny:"]=1;
  14882. //>>excludeEnd("ctx");
  14883. if(($receiver = nil) == null || $receiver.isNil){
  14884. $4=true;
  14885. } else {
  14886. $4=false;
  14887. };
  14888. self._assert_equals_($4,true);
  14889. if(($receiver = nil) == null || $receiver.isNil){
  14890. $6=false;
  14891. } else {
  14892. $6=true;
  14893. };
  14894. $5=$recv($6).__eq(true);
  14895. self._deny_($5);
  14896. return self;
  14897. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14898. }, function($ctx1) {$ctx1.fill(self,"testIfNil",{},$globals.UndefinedTest)});
  14899. //>>excludeEnd("ctx");
  14900. },
  14901. //>>excludeStart("ide", pragmas.excludeIdeData);
  14902. args: [],
  14903. 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",
  14904. referencedClasses: [],
  14905. //>>excludeEnd("ide");
  14906. messageSends: ["assert:equals:", "ifNil:", "deny:", "=", "ifNotNil:", "ifNil:ifNotNil:", "ifNotNil:ifNil:"]
  14907. }),
  14908. $globals.UndefinedTest);
  14909. $core.addMethod(
  14910. $core.method({
  14911. selector: "testIsNil",
  14912. protocol: 'tests',
  14913. fn: function (){
  14914. var self=this;
  14915. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14916. return $core.withContext(function($ctx1) {
  14917. //>>excludeEnd("ctx");
  14918. self._assert_(nil._isNil());
  14919. self._deny_(nil._notNil());
  14920. return self;
  14921. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14922. }, function($ctx1) {$ctx1.fill(self,"testIsNil",{},$globals.UndefinedTest)});
  14923. //>>excludeEnd("ctx");
  14924. },
  14925. //>>excludeStart("ide", pragmas.excludeIdeData);
  14926. args: [],
  14927. source: "testIsNil\x0a\x09self assert: nil isNil.\x0a\x09self deny: nil notNil.",
  14928. referencedClasses: [],
  14929. //>>excludeEnd("ide");
  14930. messageSends: ["assert:", "isNil", "deny:", "notNil"]
  14931. }),
  14932. $globals.UndefinedTest);
  14933. });