1
0

Kernel-Tests.js 518 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857
  1. define("amber_core/Kernel-Tests", ["amber/boot", "amber_core/SUnit", "amber_core/Kernel-Objects"], function($boot){
  2. var $core=$boot.api,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
  3. $core.addPackage('Kernel-Tests');
  4. $core.packages["Kernel-Tests"].innerEval = function (expr) { return eval(expr); };
  5. $core.packages["Kernel-Tests"].transport = {"type":"amd","amdNamespace":"amber_core"};
  6. $core.addClass('AnnouncementSubscriptionTest', $globals.TestCase, [], 'Kernel-Tests');
  7. $core.addMethod(
  8. $core.method({
  9. selector: "testAddExtensionMethod",
  10. protocol: 'tests',
  11. fn: function (){
  12. var self=this;
  13. var method,dirty;
  14. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  15. return $core.withContext(function($ctx1) {
  16. //>>excludeEnd("ctx");
  17. var $2,$1,$4,$3,$5,$8,$7,$6,$9,$10;
  18. $2=self._class();
  19. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  20. $ctx1.sendIdx["class"]=1;
  21. //>>excludeEnd("ctx");
  22. $1=$recv($2)._package();
  23. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  24. $ctx1.sendIdx["package"]=1;
  25. //>>excludeEnd("ctx");
  26. dirty=$recv($1)._isDirty();
  27. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  28. $ctx1.sendIdx["isDirty"]=1;
  29. //>>excludeEnd("ctx");
  30. $4=self._class();
  31. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  32. $ctx1.sendIdx["class"]=2;
  33. //>>excludeEnd("ctx");
  34. $3=$recv($4)._package();
  35. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  36. $ctx1.sendIdx["package"]=2;
  37. //>>excludeEnd("ctx");
  38. $recv($3)._beClean();
  39. $5=self._class();
  40. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  41. $ctx1.sendIdx["class"]=3;
  42. //>>excludeEnd("ctx");
  43. method=$recv($5)._compile_protocol_("doNothing","**not-a-package");
  44. $8=self._class();
  45. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  46. $ctx1.sendIdx["class"]=4;
  47. //>>excludeEnd("ctx");
  48. $7=$recv($8)._package();
  49. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  50. $ctx1.sendIdx["package"]=3;
  51. //>>excludeEnd("ctx");
  52. $6=$recv($7)._isDirty();
  53. self._deny_($6);
  54. $9=self._class();
  55. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  56. $ctx1.sendIdx["class"]=5;
  57. //>>excludeEnd("ctx");
  58. $recv($9)._removeCompiledMethod_(method);
  59. $10=dirty;
  60. if($core.assert($10)){
  61. $recv($recv(self._class())._package())._beDirty();
  62. };
  63. return self;
  64. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  65. }, function($ctx1) {$ctx1.fill(self,"testAddExtensionMethod",{method:method,dirty:dirty},$globals.AnnouncementSubscriptionTest)});
  66. //>>excludeEnd("ctx");
  67. },
  68. //>>excludeStart("ide", pragmas.excludeIdeData);
  69. args: [],
  70. source: "testAddExtensionMethod\x0a\x09| method dirty |\x0a\x09dirty := self class package isDirty.\x0a\x09self class package beClean.\x0a\x09method := self class compile: 'doNothing' protocol: '**not-a-package'.\x0a\x09self deny: self class package isDirty.\x0a\x09\x0a\x09self class removeCompiledMethod: method.\x0a\x09dirty ifTrue: [ self class package beDirty ]",
  71. referencedClasses: [],
  72. //>>excludeEnd("ide");
  73. messageSends: ["isDirty", "package", "class", "beClean", "compile:protocol:", "deny:", "removeCompiledMethod:", "ifTrue:", "beDirty"]
  74. }),
  75. $globals.AnnouncementSubscriptionTest);
  76. $core.addMethod(
  77. $core.method({
  78. selector: "testHandlesAnnouncement",
  79. protocol: 'tests',
  80. fn: function (){
  81. var self=this;
  82. var subscription,announcementClass1,announcementClass2,classBuilder;
  83. function $ClassBuilder(){return $globals.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  84. function $SystemAnnouncement(){return $globals.SystemAnnouncement||(typeof SystemAnnouncement=="undefined"?nil:SystemAnnouncement)}
  85. function $AnnouncementSubscription(){return $globals.AnnouncementSubscription||(typeof AnnouncementSubscription=="undefined"?nil:AnnouncementSubscription)}
  86. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  87. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  88. return $core.withContext(function($ctx1) {
  89. //>>excludeEnd("ctx");
  90. var $1,$2;
  91. classBuilder=$recv($ClassBuilder())._new();
  92. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  93. $ctx1.sendIdx["new"]=1;
  94. //>>excludeEnd("ctx");
  95. announcementClass1=$recv(classBuilder)._basicAddSubclassOf_named_instanceVariableNames_package_($SystemAnnouncement(),"TestAnnouncement1",[],"Kernel-Tests");
  96. subscription=$recv($recv($AnnouncementSubscription())._new())._announcementClass_($SystemAnnouncement());
  97. $1=$recv(subscription)._handlesAnnouncement_($SystemAnnouncement());
  98. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  99. $ctx1.sendIdx["handlesAnnouncement:"]=1;
  100. //>>excludeEnd("ctx");
  101. self._assert_equals_($1,true);
  102. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  103. $ctx1.sendIdx["assert:equals:"]=1;
  104. //>>excludeEnd("ctx");
  105. $2=$recv(subscription)._handlesAnnouncement_(announcementClass1);
  106. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  107. $ctx1.sendIdx["handlesAnnouncement:"]=2;
  108. //>>excludeEnd("ctx");
  109. self._assert_equals_($2,true);
  110. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  111. $ctx1.sendIdx["assert:equals:"]=2;
  112. //>>excludeEnd("ctx");
  113. self._assert_equals_($recv(subscription)._handlesAnnouncement_($Object()),false);
  114. $recv(classBuilder)._basicRemoveClass_(announcementClass1);
  115. return self;
  116. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  117. }, function($ctx1) {$ctx1.fill(self,"testHandlesAnnouncement",{subscription:subscription,announcementClass1:announcementClass1,announcementClass2:announcementClass2,classBuilder:classBuilder},$globals.AnnouncementSubscriptionTest)});
  118. //>>excludeEnd("ctx");
  119. },
  120. //>>excludeStart("ide", pragmas.excludeIdeData);
  121. args: [],
  122. source: "testHandlesAnnouncement\x0a\x09| subscription announcementClass1 announcementClass2 classBuilder |\x0a\x09\x0a\x09classBuilder := ClassBuilder new.\x0a\x09announcementClass1 := classBuilder basicAddSubclassOf: SystemAnnouncement named: 'TestAnnouncement1' instanceVariableNames: #() package: 'Kernel-Tests'.\x0a\x09\x0a\x09subscription := AnnouncementSubscription new announcementClass: SystemAnnouncement.\x0a\x09\x22Test whether the same class triggers the announcement\x22\x0a\x09self assert: (subscription handlesAnnouncement: SystemAnnouncement) equals: true.\x0a\x09\x22Test whether a subclass triggers the announcement\x22\x0a\x09self assert: (subscription handlesAnnouncement: announcementClass1) equals: true.\x0a\x09\x22Test whether an unrelated class does not trigger the announcement\x22\x0a\x09self assert: (subscription handlesAnnouncement: Object) equals: false.\x0a\x09\x0a\x09classBuilder basicRemoveClass: announcementClass1.",
  123. referencedClasses: ["ClassBuilder", "SystemAnnouncement", "AnnouncementSubscription", "Object"],
  124. //>>excludeEnd("ide");
  125. messageSends: ["new", "basicAddSubclassOf:named:instanceVariableNames:package:", "announcementClass:", "assert:equals:", "handlesAnnouncement:", "basicRemoveClass:"]
  126. }),
  127. $globals.AnnouncementSubscriptionTest);
  128. $core.addClass('AnnouncerTest', $globals.TestCase, [], 'Kernel-Tests');
  129. $core.addMethod(
  130. $core.method({
  131. selector: "testOnDo",
  132. protocol: 'tests',
  133. fn: function (){
  134. var self=this;
  135. var counter,announcer;
  136. function $Announcer(){return $globals.Announcer||(typeof Announcer=="undefined"?nil:Announcer)}
  137. function $SystemAnnouncement(){return $globals.SystemAnnouncement||(typeof SystemAnnouncement=="undefined"?nil:SystemAnnouncement)}
  138. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  139. return $core.withContext(function($ctx1) {
  140. //>>excludeEnd("ctx");
  141. var $1,$2;
  142. counter=(0);
  143. announcer=$recv($Announcer())._new();
  144. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  145. $ctx1.sendIdx["new"]=1;
  146. //>>excludeEnd("ctx");
  147. $recv(announcer)._on_do_($SystemAnnouncement(),(function(){
  148. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  149. return $core.withContext(function($ctx2) {
  150. //>>excludeEnd("ctx");
  151. counter=$recv(counter).__plus((1));
  152. return counter;
  153. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  154. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  155. //>>excludeEnd("ctx");
  156. }));
  157. $1=announcer;
  158. $2=$recv($SystemAnnouncement())._new();
  159. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  160. $ctx1.sendIdx["new"]=2;
  161. //>>excludeEnd("ctx");
  162. $recv($1)._announce_($2);
  163. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  164. $ctx1.sendIdx["announce:"]=1;
  165. //>>excludeEnd("ctx");
  166. self._assert_equals_(counter,(1));
  167. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  168. $ctx1.sendIdx["assert:equals:"]=1;
  169. //>>excludeEnd("ctx");
  170. $recv(announcer)._announce_($recv($SystemAnnouncement())._new());
  171. self._assert_equals_(counter,(2));
  172. return self;
  173. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  174. }, function($ctx1) {$ctx1.fill(self,"testOnDo",{counter:counter,announcer:announcer},$globals.AnnouncerTest)});
  175. //>>excludeEnd("ctx");
  176. },
  177. //>>excludeStart("ide", pragmas.excludeIdeData);
  178. args: [],
  179. source: "testOnDo\x0a\x09| counter announcer |\x0a\x09\x0a\x09counter := 0.\x0a\x09announcer := Announcer new.\x0a\x09announcer on: SystemAnnouncement do: [ counter := counter + 1 ].\x0a\x0a\x09announcer announce: (SystemAnnouncement new).\x0a\x09self assert: counter equals: 1.\x0a\x0a\x09announcer announce: (SystemAnnouncement new).\x0a\x09self assert: counter equals: 2.",
  180. referencedClasses: ["Announcer", "SystemAnnouncement"],
  181. //>>excludeEnd("ide");
  182. messageSends: ["new", "on:do:", "+", "announce:", "assert:equals:"]
  183. }),
  184. $globals.AnnouncerTest);
  185. $core.addMethod(
  186. $core.method({
  187. selector: "testOnDoFor",
  188. protocol: 'tests',
  189. fn: function (){
  190. var self=this;
  191. var counter,announcer;
  192. function $Announcer(){return $globals.Announcer||(typeof Announcer=="undefined"?nil:Announcer)}
  193. function $SystemAnnouncement(){return $globals.SystemAnnouncement||(typeof SystemAnnouncement=="undefined"?nil:SystemAnnouncement)}
  194. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  195. return $core.withContext(function($ctx1) {
  196. //>>excludeEnd("ctx");
  197. var $1,$2,$3,$4;
  198. counter=(0);
  199. announcer=$recv($Announcer())._new();
  200. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  201. $ctx1.sendIdx["new"]=1;
  202. //>>excludeEnd("ctx");
  203. $recv(announcer)._on_do_for_($SystemAnnouncement(),(function(){
  204. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  205. return $core.withContext(function($ctx2) {
  206. //>>excludeEnd("ctx");
  207. counter=$recv(counter).__plus((1));
  208. return counter;
  209. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  210. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  211. //>>excludeEnd("ctx");
  212. }),self);
  213. $1=announcer;
  214. $2=$recv($SystemAnnouncement())._new();
  215. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  216. $ctx1.sendIdx["new"]=2;
  217. //>>excludeEnd("ctx");
  218. $recv($1)._announce_($2);
  219. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  220. $ctx1.sendIdx["announce:"]=1;
  221. //>>excludeEnd("ctx");
  222. self._assert_equals_(counter,(1));
  223. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  224. $ctx1.sendIdx["assert:equals:"]=1;
  225. //>>excludeEnd("ctx");
  226. $3=announcer;
  227. $4=$recv($SystemAnnouncement())._new();
  228. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  229. $ctx1.sendIdx["new"]=3;
  230. //>>excludeEnd("ctx");
  231. $recv($3)._announce_($4);
  232. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  233. $ctx1.sendIdx["announce:"]=2;
  234. //>>excludeEnd("ctx");
  235. self._assert_equals_(counter,(2));
  236. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  237. $ctx1.sendIdx["assert:equals:"]=2;
  238. //>>excludeEnd("ctx");
  239. $recv(announcer)._unsubscribe_(self);
  240. $recv(announcer)._announce_($recv($SystemAnnouncement())._new());
  241. self._assert_equals_(counter,(2));
  242. return self;
  243. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  244. }, function($ctx1) {$ctx1.fill(self,"testOnDoFor",{counter:counter,announcer:announcer},$globals.AnnouncerTest)});
  245. //>>excludeEnd("ctx");
  246. },
  247. //>>excludeStart("ide", pragmas.excludeIdeData);
  248. args: [],
  249. source: "testOnDoFor\x0a\x09| counter announcer |\x0a\x09\x0a\x09counter := 0.\x0a\x09announcer := Announcer new.\x0a\x09announcer on: SystemAnnouncement do: [ counter := counter + 1 ] for: self.\x0a\x0a\x09announcer announce: (SystemAnnouncement new).\x0a\x09self assert: counter equals: 1.\x0a\x0a\x09announcer announce: (SystemAnnouncement new).\x0a\x09self assert: counter equals: 2.\x0a\x09\x0a\x09announcer unsubscribe: self.\x0a\x09\x0a\x09announcer announce: (SystemAnnouncement new).\x0a\x09self assert: counter equals: 2.",
  250. referencedClasses: ["Announcer", "SystemAnnouncement"],
  251. //>>excludeEnd("ide");
  252. messageSends: ["new", "on:do:for:", "+", "announce:", "assert:equals:", "unsubscribe:"]
  253. }),
  254. $globals.AnnouncerTest);
  255. $core.addMethod(
  256. $core.method({
  257. selector: "testOnDoOnce",
  258. protocol: 'tests',
  259. fn: function (){
  260. var self=this;
  261. var counter,announcer;
  262. function $Announcer(){return $globals.Announcer||(typeof Announcer=="undefined"?nil:Announcer)}
  263. function $SystemAnnouncement(){return $globals.SystemAnnouncement||(typeof SystemAnnouncement=="undefined"?nil:SystemAnnouncement)}
  264. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  265. return $core.withContext(function($ctx1) {
  266. //>>excludeEnd("ctx");
  267. var $1,$2;
  268. counter=(0);
  269. announcer=$recv($Announcer())._new();
  270. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  271. $ctx1.sendIdx["new"]=1;
  272. //>>excludeEnd("ctx");
  273. $recv(announcer)._on_doOnce_($SystemAnnouncement(),(function(){
  274. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  275. return $core.withContext(function($ctx2) {
  276. //>>excludeEnd("ctx");
  277. counter=$recv(counter).__plus((1));
  278. return counter;
  279. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  280. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  281. //>>excludeEnd("ctx");
  282. }));
  283. $1=announcer;
  284. $2=$recv($SystemAnnouncement())._new();
  285. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  286. $ctx1.sendIdx["new"]=2;
  287. //>>excludeEnd("ctx");
  288. $recv($1)._announce_($2);
  289. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  290. $ctx1.sendIdx["announce:"]=1;
  291. //>>excludeEnd("ctx");
  292. self._assert_equals_(counter,(1));
  293. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  294. $ctx1.sendIdx["assert:equals:"]=1;
  295. //>>excludeEnd("ctx");
  296. $recv(announcer)._announce_($recv($SystemAnnouncement())._new());
  297. self._assert_equals_(counter,(1));
  298. return self;
  299. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  300. }, function($ctx1) {$ctx1.fill(self,"testOnDoOnce",{counter:counter,announcer:announcer},$globals.AnnouncerTest)});
  301. //>>excludeEnd("ctx");
  302. },
  303. //>>excludeStart("ide", pragmas.excludeIdeData);
  304. args: [],
  305. source: "testOnDoOnce\x0a\x09| counter announcer |\x0a\x09\x0a\x09counter := 0.\x0a\x09announcer := Announcer new.\x0a\x09announcer on: SystemAnnouncement doOnce: [ counter := counter + 1 ].\x0a\x0a\x09announcer announce: (SystemAnnouncement new).\x0a\x09self assert: counter equals: 1.\x0a\x0a\x09announcer announce: (SystemAnnouncement new).\x0a\x09self assert: counter equals: 1.",
  306. referencedClasses: ["Announcer", "SystemAnnouncement"],
  307. //>>excludeEnd("ide");
  308. messageSends: ["new", "on:doOnce:", "+", "announce:", "assert:equals:"]
  309. }),
  310. $globals.AnnouncerTest);
  311. $core.addClass('BlockClosureTest', $globals.TestCase, [], 'Kernel-Tests');
  312. $core.addMethod(
  313. $core.method({
  314. selector: "testCanClearInterval",
  315. protocol: 'tests',
  316. fn: function (){
  317. var self=this;
  318. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  319. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  320. return $core.withContext(function($ctx1) {
  321. //>>excludeEnd("ctx");
  322. self._shouldnt_raise_((function(){
  323. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  324. return $core.withContext(function($ctx2) {
  325. //>>excludeEnd("ctx");
  326. return $recv($recv((function(){
  327. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  328. return $core.withContext(function($ctx3) {
  329. //>>excludeEnd("ctx");
  330. return $recv($recv($Error())._new())._signal();
  331. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  332. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  333. //>>excludeEnd("ctx");
  334. }))._valueWithInterval_((0)))._clearInterval();
  335. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  336. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  337. //>>excludeEnd("ctx");
  338. }),$Error());
  339. return self;
  340. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  341. }, function($ctx1) {$ctx1.fill(self,"testCanClearInterval",{},$globals.BlockClosureTest)});
  342. //>>excludeEnd("ctx");
  343. },
  344. //>>excludeStart("ide", pragmas.excludeIdeData);
  345. args: [],
  346. source: "testCanClearInterval\x0a\x09self shouldnt: [ ([ Error new signal ] valueWithInterval: 0) clearInterval ] raise: Error",
  347. referencedClasses: ["Error"],
  348. //>>excludeEnd("ide");
  349. messageSends: ["shouldnt:raise:", "clearInterval", "valueWithInterval:", "signal", "new"]
  350. }),
  351. $globals.BlockClosureTest);
  352. $core.addMethod(
  353. $core.method({
  354. selector: "testCanClearTimeout",
  355. protocol: 'tests',
  356. fn: function (){
  357. var self=this;
  358. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  359. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  360. return $core.withContext(function($ctx1) {
  361. //>>excludeEnd("ctx");
  362. self._shouldnt_raise_((function(){
  363. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  364. return $core.withContext(function($ctx2) {
  365. //>>excludeEnd("ctx");
  366. return $recv($recv((function(){
  367. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  368. return $core.withContext(function($ctx3) {
  369. //>>excludeEnd("ctx");
  370. return $recv($recv($Error())._new())._signal();
  371. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  372. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  373. //>>excludeEnd("ctx");
  374. }))._valueWithTimeout_((0)))._clearTimeout();
  375. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  376. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  377. //>>excludeEnd("ctx");
  378. }),$Error());
  379. return self;
  380. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  381. }, function($ctx1) {$ctx1.fill(self,"testCanClearTimeout",{},$globals.BlockClosureTest)});
  382. //>>excludeEnd("ctx");
  383. },
  384. //>>excludeStart("ide", pragmas.excludeIdeData);
  385. args: [],
  386. source: "testCanClearTimeout\x0a\x09self shouldnt: [ ([ Error new signal ] valueWithTimeout: 0) clearTimeout ] raise: Error",
  387. referencedClasses: ["Error"],
  388. //>>excludeEnd("ide");
  389. messageSends: ["shouldnt:raise:", "clearTimeout", "valueWithTimeout:", "signal", "new"]
  390. }),
  391. $globals.BlockClosureTest);
  392. $core.addMethod(
  393. $core.method({
  394. selector: "testCompiledSource",
  395. protocol: 'tests',
  396. fn: function (){
  397. var self=this;
  398. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  399. return $core.withContext(function($ctx1) {
  400. //>>excludeEnd("ctx");
  401. self._assert_($recv($recv((function(){
  402. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  403. return $core.withContext(function($ctx2) {
  404. //>>excludeEnd("ctx");
  405. return (1).__plus((1));
  406. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  407. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  408. //>>excludeEnd("ctx");
  409. }))._compiledSource())._includesSubString_("function"));
  410. return self;
  411. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  412. }, function($ctx1) {$ctx1.fill(self,"testCompiledSource",{},$globals.BlockClosureTest)});
  413. //>>excludeEnd("ctx");
  414. },
  415. //>>excludeStart("ide", pragmas.excludeIdeData);
  416. args: [],
  417. source: "testCompiledSource\x0a\x09self assert: ([ 1+1 ] compiledSource includesSubString: 'function')",
  418. referencedClasses: [],
  419. //>>excludeEnd("ide");
  420. messageSends: ["assert:", "includesSubString:", "compiledSource", "+"]
  421. }),
  422. $globals.BlockClosureTest);
  423. $core.addMethod(
  424. $core.method({
  425. selector: "testCurrySelf",
  426. protocol: 'tests',
  427. fn: function (){
  428. var self=this;
  429. var curriedMethod,array;
  430. function $ClassBuilder(){return $globals.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  431. function $Array(){return $globals.Array||(typeof Array=="undefined"?nil:Array)}
  432. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  433. return $core.withContext(function($ctx1) {
  434. //>>excludeEnd("ctx");
  435. curriedMethod=$recv($recv((function(selfarg,x){
  436. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  437. return $core.withContext(function($ctx2) {
  438. //>>excludeEnd("ctx");
  439. return $recv(selfarg)._at_(x);
  440. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  441. }, function($ctx2) {$ctx2.fillBlock({selfarg:selfarg,x:x},$ctx1,1)});
  442. //>>excludeEnd("ctx");
  443. }))._currySelf())._asCompiledMethod_("foo:");
  444. array=[(3), (1), (4)];
  445. $recv($recv($ClassBuilder())._new())._installMethod_forClass_protocol_(curriedMethod,$Array(),"**test helper");
  446. $recv((function(){
  447. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  448. return $core.withContext(function($ctx2) {
  449. //>>excludeEnd("ctx");
  450. return self._assert_equals_($recv(array)._foo_((2)),(1));
  451. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  452. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  453. //>>excludeEnd("ctx");
  454. }))._ensure_((function(){
  455. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  456. return $core.withContext(function($ctx2) {
  457. //>>excludeEnd("ctx");
  458. return $recv($Array())._removeCompiledMethod_(curriedMethod);
  459. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  460. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  461. //>>excludeEnd("ctx");
  462. }));
  463. return self;
  464. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  465. }, function($ctx1) {$ctx1.fill(self,"testCurrySelf",{curriedMethod:curriedMethod,array:array},$globals.BlockClosureTest)});
  466. //>>excludeEnd("ctx");
  467. },
  468. //>>excludeStart("ide", pragmas.excludeIdeData);
  469. args: [],
  470. source: "testCurrySelf\x0a\x09| curriedMethod array |\x0a\x09curriedMethod := [ :selfarg :x | selfarg at: x ] currySelf asCompiledMethod: 'foo:'.\x0a\x09array := #(3 1 4).\x0a\x09ClassBuilder new installMethod: curriedMethod forClass: Array protocol: '**test helper'.\x0a\x09[ self assert: (array foo: 2) equals: 1 ]\x0a\x09ensure: [ Array removeCompiledMethod: curriedMethod ]",
  471. referencedClasses: ["ClassBuilder", "Array"],
  472. //>>excludeEnd("ide");
  473. messageSends: ["asCompiledMethod:", "currySelf", "at:", "installMethod:forClass:protocol:", "new", "ensure:", "assert:equals:", "foo:", "removeCompiledMethod:"]
  474. }),
  475. $globals.BlockClosureTest);
  476. $core.addMethod(
  477. $core.method({
  478. selector: "testEnsure",
  479. protocol: 'tests',
  480. fn: function (){
  481. var self=this;
  482. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  483. return $core.withContext(function($ctx1) {
  484. //>>excludeEnd("ctx");
  485. self._assert_equals_($recv((function(){
  486. return (3);
  487. }))._ensure_((function(){
  488. return (4);
  489. })),(3));
  490. return self;
  491. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  492. }, function($ctx1) {$ctx1.fill(self,"testEnsure",{},$globals.BlockClosureTest)});
  493. //>>excludeEnd("ctx");
  494. },
  495. //>>excludeStart("ide", pragmas.excludeIdeData);
  496. args: [],
  497. source: "testEnsure\x0a\x09self assert: ([ 3 ] ensure: [ 4 ]) equals: 3",
  498. referencedClasses: [],
  499. //>>excludeEnd("ide");
  500. messageSends: ["assert:equals:", "ensure:"]
  501. }),
  502. $globals.BlockClosureTest);
  503. $core.addMethod(
  504. $core.method({
  505. selector: "testEnsureRaises",
  506. protocol: 'tests',
  507. fn: function (){
  508. var self=this;
  509. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  510. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  511. return $core.withContext(function($ctx1) {
  512. //>>excludeEnd("ctx");
  513. self._should_raise_((function(){
  514. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  515. return $core.withContext(function($ctx2) {
  516. //>>excludeEnd("ctx");
  517. return $recv((function(){
  518. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  519. return $core.withContext(function($ctx3) {
  520. //>>excludeEnd("ctx");
  521. return $recv($recv($Error())._new())._signal();
  522. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  523. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  524. //>>excludeEnd("ctx");
  525. }))._ensure_((function(){
  526. return true;
  527. }));
  528. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  529. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  530. //>>excludeEnd("ctx");
  531. }),$Error());
  532. return self;
  533. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  534. }, function($ctx1) {$ctx1.fill(self,"testEnsureRaises",{},$globals.BlockClosureTest)});
  535. //>>excludeEnd("ctx");
  536. },
  537. //>>excludeStart("ide", pragmas.excludeIdeData);
  538. args: [],
  539. source: "testEnsureRaises\x0a\x09self should: [ [Error new signal ] ensure: [ true ]] raise: Error",
  540. referencedClasses: ["Error"],
  541. //>>excludeEnd("ide");
  542. messageSends: ["should:raise:", "ensure:", "signal", "new"]
  543. }),
  544. $globals.BlockClosureTest);
  545. $core.addMethod(
  546. $core.method({
  547. selector: "testExceptionSemantics",
  548. protocol: 'tests',
  549. fn: function (){
  550. var self=this;
  551. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  552. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  553. return $core.withContext(function($ctx1) {
  554. //>>excludeEnd("ctx");
  555. self._timeout_((100));
  556. $recv(self._async_((function(){
  557. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  558. return $core.withContext(function($ctx2) {
  559. //>>excludeEnd("ctx");
  560. return $recv((function(){
  561. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  562. return $core.withContext(function($ctx3) {
  563. //>>excludeEnd("ctx");
  564. self._assert_(true);
  565. $recv($Error())._signal();
  566. self._deny_(true);
  567. return self._finished();
  568. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  569. $ctx3.sendIdx["finished"]=1;
  570. //>>excludeEnd("ctx");
  571. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  572. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  573. //>>excludeEnd("ctx");
  574. }))._on_do_($Error(),(function(ex){
  575. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  576. return $core.withContext(function($ctx3) {
  577. //>>excludeEnd("ctx");
  578. return self._finished();
  579. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  580. }, function($ctx3) {$ctx3.fillBlock({ex:ex},$ctx2,3)});
  581. //>>excludeEnd("ctx");
  582. }));
  583. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  584. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  585. //>>excludeEnd("ctx");
  586. })))._valueWithTimeout_((0));
  587. return self;
  588. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  589. }, function($ctx1) {$ctx1.fill(self,"testExceptionSemantics",{},$globals.BlockClosureTest)});
  590. //>>excludeEnd("ctx");
  591. },
  592. //>>excludeStart("ide", pragmas.excludeIdeData);
  593. args: [],
  594. source: "testExceptionSemantics\x0a\x09\x22See https://github.com/NicolasPetton/amber/issues/314\x22\x0a\x09self timeout: 100.\x0a\x09\x0a\x09(self async: [\x0a\x09\x09[\x0a\x09\x09\x09self assert: true.\x0a\x09\x09\x09Error signal.\x0a\x09\x09\x09\x22The following should *not* be run\x22\x0a\x09\x09\x09self deny: true.\x0a\x09\x09\x09self finished.\x0a\x09\x09] on: Error do: [ :ex | self finished ]\x0a\x09]) valueWithTimeout: 0",
  595. referencedClasses: ["Error"],
  596. //>>excludeEnd("ide");
  597. messageSends: ["timeout:", "valueWithTimeout:", "async:", "on:do:", "assert:", "signal", "deny:", "finished"]
  598. }),
  599. $globals.BlockClosureTest);
  600. $core.addMethod(
  601. $core.method({
  602. selector: "testNewWithValues",
  603. protocol: 'tests',
  604. fn: function (){
  605. var self=this;
  606. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  607. return $core.withContext(function($ctx1) {
  608. //>>excludeEnd("ctx");
  609. function TestConstructor(arg1, arg2, arg3) {}
  610. TestConstructor.prototype.name = 'theTestPrototype';
  611. var wrappedConstructor = $recv(TestConstructor);
  612. var result = wrappedConstructor._newWithValues_([1, 2, 3 ]);
  613. self._assert_(result instanceof TestConstructor);
  614. self._assert_equals_(result.name, 'theTestPrototype');
  615. "newWithValues: cannot help if the argument list is wrong, and should warn that a mistake was made."
  616. self._should_raise_(function () {wrappedConstructor._newWithValues_('single argument');}, $globals.Error);;
  617. return self;
  618. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  619. }, function($ctx1) {$ctx1.fill(self,"testNewWithValues",{},$globals.BlockClosureTest)});
  620. //>>excludeEnd("ctx");
  621. },
  622. //>>excludeStart("ide", pragmas.excludeIdeData);
  623. args: [],
  624. source: "testNewWithValues\x0a<\x0a\x09function TestConstructor(arg1, arg2, arg3) {}\x0a\x09TestConstructor.prototype.name = 'theTestPrototype';\x0a\x0a\x09var wrappedConstructor = $recv(TestConstructor);\x0a\x09var result = wrappedConstructor._newWithValues_([1, 2, 3 ]);\x0a\x09self._assert_(result instanceof TestConstructor);\x0a\x09self._assert_equals_(result.name, 'theTestPrototype');\x0a\x0a\x09\x22newWithValues: cannot help if the argument list is wrong, and should warn that a mistake was made.\x22\x0a\x09self._should_raise_(function () {wrappedConstructor._newWithValues_('single argument');}, $globals.Error);\x0a>",
  625. referencedClasses: [],
  626. //>>excludeEnd("ide");
  627. messageSends: []
  628. }),
  629. $globals.BlockClosureTest);
  630. $core.addMethod(
  631. $core.method({
  632. selector: "testNumArgs",
  633. protocol: 'tests',
  634. fn: function (){
  635. var self=this;
  636. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  637. return $core.withContext(function($ctx1) {
  638. //>>excludeEnd("ctx");
  639. var $1;
  640. $1=$recv((function(){
  641. }))._numArgs();
  642. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  643. $ctx1.sendIdx["numArgs"]=1;
  644. //>>excludeEnd("ctx");
  645. self._assert_equals_($1,(0));
  646. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  647. $ctx1.sendIdx["assert:equals:"]=1;
  648. //>>excludeEnd("ctx");
  649. self._assert_equals_($recv((function(a,b){
  650. }))._numArgs(),(2));
  651. return self;
  652. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  653. }, function($ctx1) {$ctx1.fill(self,"testNumArgs",{},$globals.BlockClosureTest)});
  654. //>>excludeEnd("ctx");
  655. },
  656. //>>excludeStart("ide", pragmas.excludeIdeData);
  657. args: [],
  658. source: "testNumArgs\x0a\x09self assert: [] numArgs equals: 0.\x0a\x09self assert: [ :a :b | ] numArgs equals: 2",
  659. referencedClasses: [],
  660. //>>excludeEnd("ide");
  661. messageSends: ["assert:equals:", "numArgs"]
  662. }),
  663. $globals.BlockClosureTest);
  664. $core.addMethod(
  665. $core.method({
  666. selector: "testOnDo",
  667. protocol: 'tests',
  668. fn: function (){
  669. var self=this;
  670. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  671. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  672. return $core.withContext(function($ctx1) {
  673. //>>excludeEnd("ctx");
  674. self._assert_($recv((function(){
  675. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  676. return $core.withContext(function($ctx2) {
  677. //>>excludeEnd("ctx");
  678. return $recv($recv($Error())._new())._signal();
  679. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  680. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  681. //>>excludeEnd("ctx");
  682. }))._on_do_($Error(),(function(ex){
  683. return true;
  684. })));
  685. return self;
  686. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  687. }, function($ctx1) {$ctx1.fill(self,"testOnDo",{},$globals.BlockClosureTest)});
  688. //>>excludeEnd("ctx");
  689. },
  690. //>>excludeStart("ide", pragmas.excludeIdeData);
  691. args: [],
  692. source: "testOnDo\x0a\x09self assert: ([ Error new signal ] on: Error do: [ :ex | true ])",
  693. referencedClasses: ["Error"],
  694. //>>excludeEnd("ide");
  695. messageSends: ["assert:", "on:do:", "signal", "new"]
  696. }),
  697. $globals.BlockClosureTest);
  698. $core.addMethod(
  699. $core.method({
  700. selector: "testValue",
  701. protocol: 'tests',
  702. fn: function (){
  703. var self=this;
  704. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  705. return $core.withContext(function($ctx1) {
  706. //>>excludeEnd("ctx");
  707. var $1;
  708. $1=$recv((function(){
  709. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  710. return $core.withContext(function($ctx2) {
  711. //>>excludeEnd("ctx");
  712. return (1).__plus((1));
  713. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  714. $ctx2.sendIdx["+"]=1;
  715. //>>excludeEnd("ctx");
  716. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  717. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  718. //>>excludeEnd("ctx");
  719. }))._value();
  720. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  721. $ctx1.sendIdx["value"]=1;
  722. //>>excludeEnd("ctx");
  723. self._assert_equals_($1,(2));
  724. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  725. $ctx1.sendIdx["assert:equals:"]=1;
  726. //>>excludeEnd("ctx");
  727. self._assert_equals_($recv((function(x){
  728. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  729. return $core.withContext(function($ctx2) {
  730. //>>excludeEnd("ctx");
  731. return $recv(x).__plus((1));
  732. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  733. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,2)});
  734. //>>excludeEnd("ctx");
  735. }))._value_((2)),(3));
  736. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  737. $ctx1.sendIdx["assert:equals:"]=2;
  738. //>>excludeEnd("ctx");
  739. self._assert_equals_($recv((function(x,y){
  740. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  741. return $core.withContext(function($ctx2) {
  742. //>>excludeEnd("ctx");
  743. return $recv(x).__star(y);
  744. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  745. }, function($ctx2) {$ctx2.fillBlock({x:x,y:y},$ctx1,3)});
  746. //>>excludeEnd("ctx");
  747. }))._value_value_((2),(4)),(8));
  748. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  749. $ctx1.sendIdx["assert:equals:"]=3;
  750. //>>excludeEnd("ctx");
  751. self._assert_equals_($recv((function(a,b,c){
  752. return (1);
  753. }))._value(),(1));
  754. return self;
  755. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  756. }, function($ctx1) {$ctx1.fill(self,"testValue",{},$globals.BlockClosureTest)});
  757. //>>excludeEnd("ctx");
  758. },
  759. //>>excludeStart("ide", pragmas.excludeIdeData);
  760. args: [],
  761. source: "testValue\x0a\x09self assert: ([ 1+1 ] value) equals: 2.\x0a\x09self assert: ([ :x | x +1 ] value: 2) equals: 3.\x0a\x09self assert: ([ :x :y | x*y ] value: 2 value: 4) equals: 8.\x0a\x0a\x09\x22Arguments are optional in Amber. This isn't ANSI compliant.\x22\x0a\x0a\x09self assert: ([ :a :b :c | 1 ] value) equals: 1",
  762. referencedClasses: [],
  763. //>>excludeEnd("ide");
  764. messageSends: ["assert:equals:", "value", "+", "value:", "value:value:", "*"]
  765. }),
  766. $globals.BlockClosureTest);
  767. $core.addMethod(
  768. $core.method({
  769. selector: "testValueWithPossibleArguments",
  770. protocol: 'tests',
  771. fn: function (){
  772. var self=this;
  773. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  774. return $core.withContext(function($ctx1) {
  775. //>>excludeEnd("ctx");
  776. var $1,$2;
  777. $1=$recv((function(){
  778. return (1);
  779. }))._valueWithPossibleArguments_([(3), (4)]);
  780. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  781. $ctx1.sendIdx["valueWithPossibleArguments:"]=1;
  782. //>>excludeEnd("ctx");
  783. self._assert_equals_($1,(1));
  784. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  785. $ctx1.sendIdx["assert:equals:"]=1;
  786. //>>excludeEnd("ctx");
  787. $2=$recv((function(a){
  788. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  789. return $core.withContext(function($ctx2) {
  790. //>>excludeEnd("ctx");
  791. return $recv(a).__plus((4));
  792. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  793. $ctx2.sendIdx["+"]=1;
  794. //>>excludeEnd("ctx");
  795. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  796. }, function($ctx2) {$ctx2.fillBlock({a:a},$ctx1,2)});
  797. //>>excludeEnd("ctx");
  798. }))._valueWithPossibleArguments_([(3), (4)]);
  799. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  800. $ctx1.sendIdx["valueWithPossibleArguments:"]=2;
  801. //>>excludeEnd("ctx");
  802. self._assert_equals_($2,(7));
  803. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  804. $ctx1.sendIdx["assert:equals:"]=2;
  805. //>>excludeEnd("ctx");
  806. self._assert_equals_($recv((function(a,b){
  807. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  808. return $core.withContext(function($ctx2) {
  809. //>>excludeEnd("ctx");
  810. return $recv(a).__plus(b);
  811. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  812. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1,3)});
  813. //>>excludeEnd("ctx");
  814. }))._valueWithPossibleArguments_([(3), (4), (5)]),(7));
  815. return self;
  816. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  817. }, function($ctx1) {$ctx1.fill(self,"testValueWithPossibleArguments",{},$globals.BlockClosureTest)});
  818. //>>excludeEnd("ctx");
  819. },
  820. //>>excludeStart("ide", pragmas.excludeIdeData);
  821. args: [],
  822. source: "testValueWithPossibleArguments\x0a\x09self assert: ([ 1 ] valueWithPossibleArguments: #(3 4)) equals: 1.\x0a\x09self assert: ([ :a | a + 4 ] valueWithPossibleArguments: #(3 4)) equals: 7.\x0a\x09self assert: ([ :a :b | a + b ] valueWithPossibleArguments: #(3 4 5)) equals: 7.",
  823. referencedClasses: [],
  824. //>>excludeEnd("ide");
  825. messageSends: ["assert:equals:", "valueWithPossibleArguments:", "+"]
  826. }),
  827. $globals.BlockClosureTest);
  828. $core.addMethod(
  829. $core.method({
  830. selector: "testWhileFalse",
  831. protocol: 'tests',
  832. fn: function (){
  833. var self=this;
  834. var i;
  835. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  836. return $core.withContext(function($ctx1) {
  837. //>>excludeEnd("ctx");
  838. i=(0);
  839. $recv((function(){
  840. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  841. return $core.withContext(function($ctx2) {
  842. //>>excludeEnd("ctx");
  843. return $recv(i).__gt((5));
  844. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  845. $ctx2.sendIdx[">"]=1;
  846. //>>excludeEnd("ctx");
  847. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  848. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  849. //>>excludeEnd("ctx");
  850. }))._whileFalse_((function(){
  851. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  852. return $core.withContext(function($ctx2) {
  853. //>>excludeEnd("ctx");
  854. i=$recv(i).__plus((1));
  855. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  856. $ctx2.sendIdx["+"]=1;
  857. //>>excludeEnd("ctx");
  858. return i;
  859. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  860. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  861. //>>excludeEnd("ctx");
  862. }));
  863. self._assert_equals_(i,(6));
  864. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  865. $ctx1.sendIdx["assert:equals:"]=1;
  866. //>>excludeEnd("ctx");
  867. i=(0);
  868. $recv((function(){
  869. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  870. return $core.withContext(function($ctx2) {
  871. //>>excludeEnd("ctx");
  872. i=$recv(i).__plus((1));
  873. i;
  874. return $recv(i).__gt((5));
  875. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  876. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  877. //>>excludeEnd("ctx");
  878. }))._whileFalse();
  879. self._assert_equals_(i,(6));
  880. return self;
  881. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  882. }, function($ctx1) {$ctx1.fill(self,"testWhileFalse",{i:i},$globals.BlockClosureTest)});
  883. //>>excludeEnd("ctx");
  884. },
  885. //>>excludeStart("ide", pragmas.excludeIdeData);
  886. args: [],
  887. source: "testWhileFalse\x0a\x09| i |\x0a\x09i := 0.\x0a\x09[ i > 5 ] whileFalse: [ i := i + 1 ].\x0a\x09self assert: i equals: 6.\x0a\x0a\x09i := 0.\x0a\x09[ i := i + 1. i > 5 ] whileFalse.\x0a\x09self assert: i equals: 6",
  888. referencedClasses: [],
  889. //>>excludeEnd("ide");
  890. messageSends: ["whileFalse:", ">", "+", "assert:equals:", "whileFalse"]
  891. }),
  892. $globals.BlockClosureTest);
  893. $core.addMethod(
  894. $core.method({
  895. selector: "testWhileTrue",
  896. protocol: 'tests',
  897. fn: function (){
  898. var self=this;
  899. var i;
  900. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  901. return $core.withContext(function($ctx1) {
  902. //>>excludeEnd("ctx");
  903. i=(0);
  904. $recv((function(){
  905. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  906. return $core.withContext(function($ctx2) {
  907. //>>excludeEnd("ctx");
  908. return $recv(i).__lt((5));
  909. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  910. $ctx2.sendIdx["<"]=1;
  911. //>>excludeEnd("ctx");
  912. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  913. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  914. //>>excludeEnd("ctx");
  915. }))._whileTrue_((function(){
  916. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  917. return $core.withContext(function($ctx2) {
  918. //>>excludeEnd("ctx");
  919. i=$recv(i).__plus((1));
  920. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  921. $ctx2.sendIdx["+"]=1;
  922. //>>excludeEnd("ctx");
  923. return i;
  924. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  925. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  926. //>>excludeEnd("ctx");
  927. }));
  928. self._assert_equals_(i,(5));
  929. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  930. $ctx1.sendIdx["assert:equals:"]=1;
  931. //>>excludeEnd("ctx");
  932. i=(0);
  933. $recv((function(){
  934. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  935. return $core.withContext(function($ctx2) {
  936. //>>excludeEnd("ctx");
  937. i=$recv(i).__plus((1));
  938. i;
  939. return $recv(i).__lt((5));
  940. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  941. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  942. //>>excludeEnd("ctx");
  943. }))._whileTrue();
  944. self._assert_equals_(i,(5));
  945. return self;
  946. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  947. }, function($ctx1) {$ctx1.fill(self,"testWhileTrue",{i:i},$globals.BlockClosureTest)});
  948. //>>excludeEnd("ctx");
  949. },
  950. //>>excludeStart("ide", pragmas.excludeIdeData);
  951. args: [],
  952. source: "testWhileTrue\x0a\x09| i |\x0a\x09i := 0.\x0a\x09[ i < 5 ] whileTrue: [ i := i + 1 ].\x0a\x09self assert: i equals: 5.\x0a\x0a\x09i := 0.\x0a\x09[ i := i + 1. i < 5 ] whileTrue.\x0a\x09self assert: i equals: 5",
  953. referencedClasses: [],
  954. //>>excludeEnd("ide");
  955. messageSends: ["whileTrue:", "<", "+", "assert:equals:", "whileTrue"]
  956. }),
  957. $globals.BlockClosureTest);
  958. $core.addClass('BooleanTest', $globals.TestCase, [], 'Kernel-Tests');
  959. $core.addMethod(
  960. $core.method({
  961. selector: "testEquality",
  962. protocol: 'tests',
  963. fn: function (){
  964. var self=this;
  965. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  966. return $core.withContext(function($ctx1) {
  967. //>>excludeEnd("ctx");
  968. var $1,$2,$3,$4,$5,$6,$7,$8,$10,$9,$12,$11;
  969. $1=(0).__eq(false);
  970. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  971. $ctx1.sendIdx["="]=1;
  972. //>>excludeEnd("ctx");
  973. self._deny_($1);
  974. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  975. $ctx1.sendIdx["deny:"]=1;
  976. //>>excludeEnd("ctx");
  977. $2=false.__eq((0));
  978. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  979. $ctx1.sendIdx["="]=2;
  980. //>>excludeEnd("ctx");
  981. self._deny_($2);
  982. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  983. $ctx1.sendIdx["deny:"]=2;
  984. //>>excludeEnd("ctx");
  985. $3="".__eq(false);
  986. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  987. $ctx1.sendIdx["="]=3;
  988. //>>excludeEnd("ctx");
  989. self._deny_($3);
  990. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  991. $ctx1.sendIdx["deny:"]=3;
  992. //>>excludeEnd("ctx");
  993. $4=false.__eq("");
  994. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  995. $ctx1.sendIdx["="]=4;
  996. //>>excludeEnd("ctx");
  997. self._deny_($4);
  998. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  999. $ctx1.sendIdx["deny:"]=4;
  1000. //>>excludeEnd("ctx");
  1001. $5=true.__eq(true);
  1002. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1003. $ctx1.sendIdx["="]=5;
  1004. //>>excludeEnd("ctx");
  1005. self._assert_($5);
  1006. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1007. $ctx1.sendIdx["assert:"]=1;
  1008. //>>excludeEnd("ctx");
  1009. $6=false.__eq(true);
  1010. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1011. $ctx1.sendIdx["="]=6;
  1012. //>>excludeEnd("ctx");
  1013. self._deny_($6);
  1014. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1015. $ctx1.sendIdx["deny:"]=5;
  1016. //>>excludeEnd("ctx");
  1017. $7=true.__eq(false);
  1018. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1019. $ctx1.sendIdx["="]=7;
  1020. //>>excludeEnd("ctx");
  1021. self._deny_($7);
  1022. $8=false.__eq(false);
  1023. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1024. $ctx1.sendIdx["="]=8;
  1025. //>>excludeEnd("ctx");
  1026. self._assert_($8);
  1027. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1028. $ctx1.sendIdx["assert:"]=2;
  1029. //>>excludeEnd("ctx");
  1030. $10=true._yourself();
  1031. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1032. $ctx1.sendIdx["yourself"]=1;
  1033. //>>excludeEnd("ctx");
  1034. $9=$recv($10).__eq(true);
  1035. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1036. $ctx1.sendIdx["="]=9;
  1037. //>>excludeEnd("ctx");
  1038. self._assert_($9);
  1039. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1040. $ctx1.sendIdx["assert:"]=3;
  1041. //>>excludeEnd("ctx");
  1042. $12=true._yourself();
  1043. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1044. $ctx1.sendIdx["yourself"]=2;
  1045. //>>excludeEnd("ctx");
  1046. $11=$recv($12).__eq(true._yourself());
  1047. self._assert_($11);
  1048. return self;
  1049. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1050. }, function($ctx1) {$ctx1.fill(self,"testEquality",{},$globals.BooleanTest)});
  1051. //>>excludeEnd("ctx");
  1052. },
  1053. //>>excludeStart("ide", pragmas.excludeIdeData);
  1054. args: [],
  1055. source: "testEquality\x0a\x09\x22We're on top of JS...just be sure to check the basics!\x22\x0a\x0a\x09self deny: 0 = false.\x0a\x09self deny: false = 0.\x0a\x09self deny: '' = false.\x0a\x09self deny: false = ''.\x0a\x0a\x09self assert: (true = true).\x0a\x09self deny: false = true.\x0a\x09self deny: true = false.\x0a\x09self assert: (false = false).\x0a\x0a\x09\x22JS may do some type coercing after sending a message\x22\x0a\x09self assert: (true yourself = true).\x0a\x09self assert: (true yourself = true yourself)",
  1056. referencedClasses: [],
  1057. //>>excludeEnd("ide");
  1058. messageSends: ["deny:", "=", "assert:", "yourself"]
  1059. }),
  1060. $globals.BooleanTest);
  1061. $core.addMethod(
  1062. $core.method({
  1063. selector: "testIdentity",
  1064. protocol: 'tests',
  1065. fn: function (){
  1066. var self=this;
  1067. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1068. return $core.withContext(function($ctx1) {
  1069. //>>excludeEnd("ctx");
  1070. var $1,$2,$3,$4,$5,$6,$7,$8,$10,$9,$12,$11;
  1071. $1=(0).__eq_eq(false);
  1072. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1073. $ctx1.sendIdx["=="]=1;
  1074. //>>excludeEnd("ctx");
  1075. self._deny_($1);
  1076. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1077. $ctx1.sendIdx["deny:"]=1;
  1078. //>>excludeEnd("ctx");
  1079. $2=false.__eq_eq((0));
  1080. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1081. $ctx1.sendIdx["=="]=2;
  1082. //>>excludeEnd("ctx");
  1083. self._deny_($2);
  1084. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1085. $ctx1.sendIdx["deny:"]=2;
  1086. //>>excludeEnd("ctx");
  1087. $3="".__eq_eq(false);
  1088. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1089. $ctx1.sendIdx["=="]=3;
  1090. //>>excludeEnd("ctx");
  1091. self._deny_($3);
  1092. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1093. $ctx1.sendIdx["deny:"]=3;
  1094. //>>excludeEnd("ctx");
  1095. $4=false.__eq_eq("");
  1096. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1097. $ctx1.sendIdx["=="]=4;
  1098. //>>excludeEnd("ctx");
  1099. self._deny_($4);
  1100. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1101. $ctx1.sendIdx["deny:"]=4;
  1102. //>>excludeEnd("ctx");
  1103. $5=true.__eq_eq(true);
  1104. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1105. $ctx1.sendIdx["=="]=5;
  1106. //>>excludeEnd("ctx");
  1107. self._assert_($5);
  1108. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1109. $ctx1.sendIdx["assert:"]=1;
  1110. //>>excludeEnd("ctx");
  1111. $6=false.__eq_eq(true);
  1112. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1113. $ctx1.sendIdx["=="]=6;
  1114. //>>excludeEnd("ctx");
  1115. self._deny_($6);
  1116. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1117. $ctx1.sendIdx["deny:"]=5;
  1118. //>>excludeEnd("ctx");
  1119. $7=true.__eq_eq(false);
  1120. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1121. $ctx1.sendIdx["=="]=7;
  1122. //>>excludeEnd("ctx");
  1123. self._deny_($7);
  1124. $8=false.__eq_eq(false);
  1125. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1126. $ctx1.sendIdx["=="]=8;
  1127. //>>excludeEnd("ctx");
  1128. self._assert_($8);
  1129. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1130. $ctx1.sendIdx["assert:"]=2;
  1131. //>>excludeEnd("ctx");
  1132. $10=true._yourself();
  1133. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1134. $ctx1.sendIdx["yourself"]=1;
  1135. //>>excludeEnd("ctx");
  1136. $9=$recv($10).__eq_eq(true);
  1137. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1138. $ctx1.sendIdx["=="]=9;
  1139. //>>excludeEnd("ctx");
  1140. self._assert_($9);
  1141. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1142. $ctx1.sendIdx["assert:"]=3;
  1143. //>>excludeEnd("ctx");
  1144. $12=true._yourself();
  1145. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1146. $ctx1.sendIdx["yourself"]=2;
  1147. //>>excludeEnd("ctx");
  1148. $11=$recv($12).__eq_eq(true._yourself());
  1149. self._assert_($11);
  1150. return self;
  1151. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1152. }, function($ctx1) {$ctx1.fill(self,"testIdentity",{},$globals.BooleanTest)});
  1153. //>>excludeEnd("ctx");
  1154. },
  1155. //>>excludeStart("ide", pragmas.excludeIdeData);
  1156. args: [],
  1157. source: "testIdentity\x0a\x09\x22We're on top of JS...just be sure to check the basics!\x22\x0a\x0a\x09self deny: 0 == false.\x0a\x09self deny: false == 0.\x0a\x09self deny: '' == false.\x0a\x09self deny: false == ''.\x0a\x0a\x09self assert: true == true.\x0a\x09self deny: false == true.\x0a\x09self deny: true == false.\x0a\x09self assert: false == false.\x0a\x0a\x09\x22JS may do some type coercing after sending a message\x22\x0a\x09self assert: true yourself == true.\x0a\x09self assert: true yourself == true yourself",
  1158. referencedClasses: [],
  1159. //>>excludeEnd("ide");
  1160. messageSends: ["deny:", "==", "assert:", "yourself"]
  1161. }),
  1162. $globals.BooleanTest);
  1163. $core.addMethod(
  1164. $core.method({
  1165. selector: "testIfTrueIfFalse",
  1166. protocol: 'tests',
  1167. fn: function (){
  1168. var self=this;
  1169. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1170. return $core.withContext(function($ctx1) {
  1171. //>>excludeEnd("ctx");
  1172. var $1,$2,$3,$4,$5,$6,$7,$8;
  1173. if($core.assert(true)){
  1174. $1="alternative block";
  1175. };
  1176. self._assert_equals_($1,"alternative block");
  1177. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1178. $ctx1.sendIdx["assert:equals:"]=1;
  1179. //>>excludeEnd("ctx");
  1180. if(!$core.assert(true)){
  1181. $2="alternative block";
  1182. };
  1183. self._assert_equals_($2,nil);
  1184. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1185. $ctx1.sendIdx["assert:equals:"]=2;
  1186. //>>excludeEnd("ctx");
  1187. if($core.assert(false)){
  1188. $3="alternative block";
  1189. };
  1190. self._assert_equals_($3,nil);
  1191. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1192. $ctx1.sendIdx["assert:equals:"]=3;
  1193. //>>excludeEnd("ctx");
  1194. if(!$core.assert(false)){
  1195. $4="alternative block";
  1196. };
  1197. self._assert_equals_($4,"alternative block");
  1198. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1199. $ctx1.sendIdx["assert:equals:"]=4;
  1200. //>>excludeEnd("ctx");
  1201. if($core.assert(false)){
  1202. $5="alternative block";
  1203. } else {
  1204. $5="alternative block2";
  1205. };
  1206. self._assert_equals_($5,"alternative block2");
  1207. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1208. $ctx1.sendIdx["assert:equals:"]=5;
  1209. //>>excludeEnd("ctx");
  1210. if($core.assert(false)){
  1211. $6="alternative block2";
  1212. } else {
  1213. $6="alternative block";
  1214. };
  1215. self._assert_equals_($6,"alternative block");
  1216. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1217. $ctx1.sendIdx["assert:equals:"]=6;
  1218. //>>excludeEnd("ctx");
  1219. if($core.assert(true)){
  1220. $7="alternative block";
  1221. } else {
  1222. $7="alternative block2";
  1223. };
  1224. self._assert_equals_($7,"alternative block");
  1225. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1226. $ctx1.sendIdx["assert:equals:"]=7;
  1227. //>>excludeEnd("ctx");
  1228. if($core.assert(true)){
  1229. $8="alternative block2";
  1230. } else {
  1231. $8="alternative block";
  1232. };
  1233. self._assert_equals_($8,"alternative block2");
  1234. return self;
  1235. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1236. }, function($ctx1) {$ctx1.fill(self,"testIfTrueIfFalse",{},$globals.BooleanTest)});
  1237. //>>excludeEnd("ctx");
  1238. },
  1239. //>>excludeStart("ide", pragmas.excludeIdeData);
  1240. args: [],
  1241. source: "testIfTrueIfFalse\x0a\x0a\x09self assert: (true ifTrue: [ 'alternative block' ]) equals: 'alternative block'.\x0a\x09self assert: (true ifFalse: [ 'alternative block' ]) equals: nil.\x0a\x0a\x09self assert: (false ifTrue: [ 'alternative block' ]) equals: nil.\x0a\x09self assert: (false ifFalse: [ 'alternative block' ]) equals: 'alternative block'.\x0a\x0a\x09self assert: (false ifTrue: [ 'alternative block' ] ifFalse: [ 'alternative block2' ]) equals: 'alternative block2'.\x0a\x09self assert: (false ifFalse: [ 'alternative block' ] ifTrue: [ 'alternative block2' ]) equals: 'alternative block'.\x0a\x0a\x09self assert: (true ifTrue: [ 'alternative block' ] ifFalse: [ 'alternative block2' ]) equals: 'alternative block'.\x0a\x09self assert: (true ifFalse: [ 'alternative block' ] ifTrue: [ 'alternative block2' ]) equals: 'alternative block2'.",
  1242. referencedClasses: [],
  1243. //>>excludeEnd("ide");
  1244. messageSends: ["assert:equals:", "ifTrue:", "ifFalse:", "ifTrue:ifFalse:", "ifFalse:ifTrue:"]
  1245. }),
  1246. $globals.BooleanTest);
  1247. $core.addMethod(
  1248. $core.method({
  1249. selector: "testIfTrueIfFalseWithBoxing",
  1250. protocol: 'tests',
  1251. fn: function (){
  1252. var self=this;
  1253. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1254. return $core.withContext(function($ctx1) {
  1255. //>>excludeEnd("ctx");
  1256. var $2,$1,$4,$3,$6,$5,$8,$7,$10,$9,$12,$11,$14,$13,$16,$15;
  1257. $2=true._yourself();
  1258. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1259. $ctx1.sendIdx["yourself"]=1;
  1260. //>>excludeEnd("ctx");
  1261. if($core.assert($2)){
  1262. $1="alternative block";
  1263. };
  1264. self._assert_equals_($1,"alternative block");
  1265. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1266. $ctx1.sendIdx["assert:equals:"]=1;
  1267. //>>excludeEnd("ctx");
  1268. $4=true._yourself();
  1269. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1270. $ctx1.sendIdx["yourself"]=2;
  1271. //>>excludeEnd("ctx");
  1272. if(!$core.assert($4)){
  1273. $3="alternative block";
  1274. };
  1275. self._assert_equals_($3,nil);
  1276. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1277. $ctx1.sendIdx["assert:equals:"]=2;
  1278. //>>excludeEnd("ctx");
  1279. $6=false._yourself();
  1280. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1281. $ctx1.sendIdx["yourself"]=3;
  1282. //>>excludeEnd("ctx");
  1283. if($core.assert($6)){
  1284. $5="alternative block";
  1285. };
  1286. self._assert_equals_($5,nil);
  1287. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1288. $ctx1.sendIdx["assert:equals:"]=3;
  1289. //>>excludeEnd("ctx");
  1290. $8=false._yourself();
  1291. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1292. $ctx1.sendIdx["yourself"]=4;
  1293. //>>excludeEnd("ctx");
  1294. if(!$core.assert($8)){
  1295. $7="alternative block";
  1296. };
  1297. self._assert_equals_($7,"alternative block");
  1298. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1299. $ctx1.sendIdx["assert:equals:"]=4;
  1300. //>>excludeEnd("ctx");
  1301. $10=false._yourself();
  1302. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1303. $ctx1.sendIdx["yourself"]=5;
  1304. //>>excludeEnd("ctx");
  1305. if($core.assert($10)){
  1306. $9="alternative block";
  1307. } else {
  1308. $9="alternative block2";
  1309. };
  1310. self._assert_equals_($9,"alternative block2");
  1311. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1312. $ctx1.sendIdx["assert:equals:"]=5;
  1313. //>>excludeEnd("ctx");
  1314. $12=false._yourself();
  1315. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1316. $ctx1.sendIdx["yourself"]=6;
  1317. //>>excludeEnd("ctx");
  1318. if($core.assert($12)){
  1319. $11="alternative block2";
  1320. } else {
  1321. $11="alternative block";
  1322. };
  1323. self._assert_equals_($11,"alternative block");
  1324. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1325. $ctx1.sendIdx["assert:equals:"]=6;
  1326. //>>excludeEnd("ctx");
  1327. $14=true._yourself();
  1328. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1329. $ctx1.sendIdx["yourself"]=7;
  1330. //>>excludeEnd("ctx");
  1331. if($core.assert($14)){
  1332. $13="alternative block";
  1333. } else {
  1334. $13="alternative block2";
  1335. };
  1336. self._assert_equals_($13,"alternative block");
  1337. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1338. $ctx1.sendIdx["assert:equals:"]=7;
  1339. //>>excludeEnd("ctx");
  1340. $16=true._yourself();
  1341. if($core.assert($16)){
  1342. $15="alternative block2";
  1343. } else {
  1344. $15="alternative block";
  1345. };
  1346. self._assert_equals_($15,"alternative block2");
  1347. return self;
  1348. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1349. }, function($ctx1) {$ctx1.fill(self,"testIfTrueIfFalseWithBoxing",{},$globals.BooleanTest)});
  1350. //>>excludeEnd("ctx");
  1351. },
  1352. //>>excludeStart("ide", pragmas.excludeIdeData);
  1353. args: [],
  1354. source: "testIfTrueIfFalseWithBoxing\x0a\x0a\x09self assert: (true yourself ifTrue: [ 'alternative block' ]) equals: 'alternative block'.\x0a\x09self assert: (true yourself ifFalse: [ 'alternative block' ]) equals: nil.\x0a\x0a\x09self assert: (false yourself ifTrue: [ 'alternative block' ]) equals: nil.\x0a\x09self assert: (false yourself ifFalse: [ 'alternative block' ]) equals: 'alternative block'.\x0a\x0a\x09self assert: (false yourself ifTrue: [ 'alternative block' ] ifFalse: [ 'alternative block2' ]) equals: 'alternative block2'.\x0a\x09self assert: (false yourself ifFalse: [ 'alternative block' ] ifTrue: [ 'alternative block2' ]) equals: 'alternative block'.\x0a\x0a\x09self assert: (true yourself ifTrue: [ 'alternative block' ] ifFalse: [ 'alternative block2' ]) equals: 'alternative block'.\x0a\x09self assert: (true yourself ifFalse: [ 'alternative block' ] ifTrue: [ 'alternative block2' ]) equals: 'alternative block2'.",
  1355. referencedClasses: [],
  1356. //>>excludeEnd("ide");
  1357. messageSends: ["assert:equals:", "ifTrue:", "yourself", "ifFalse:", "ifTrue:ifFalse:", "ifFalse:ifTrue:"]
  1358. }),
  1359. $globals.BooleanTest);
  1360. $core.addMethod(
  1361. $core.method({
  1362. selector: "testLogic",
  1363. protocol: 'tests',
  1364. fn: function (){
  1365. var self=this;
  1366. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1367. return $core.withContext(function($ctx1) {
  1368. //>>excludeEnd("ctx");
  1369. var $1,$2,$3,$5,$4,$6,$7,$8,$10,$9,$12,$11,$14,$13,$17,$18,$16,$15,$20,$19,$22,$21,$25,$24,$23;
  1370. $1=true.__and(true);
  1371. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1372. $ctx1.sendIdx["&"]=1;
  1373. //>>excludeEnd("ctx");
  1374. self._assert_($1);
  1375. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1376. $ctx1.sendIdx["assert:"]=1;
  1377. //>>excludeEnd("ctx");
  1378. $2=true.__and(false);
  1379. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1380. $ctx1.sendIdx["&"]=2;
  1381. //>>excludeEnd("ctx");
  1382. self._deny_($2);
  1383. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1384. $ctx1.sendIdx["deny:"]=1;
  1385. //>>excludeEnd("ctx");
  1386. $3=false.__and(true);
  1387. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1388. $ctx1.sendIdx["&"]=3;
  1389. //>>excludeEnd("ctx");
  1390. self._deny_($3);
  1391. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1392. $ctx1.sendIdx["deny:"]=2;
  1393. //>>excludeEnd("ctx");
  1394. $5=false.__and(false);
  1395. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1396. $ctx1.sendIdx["&"]=4;
  1397. //>>excludeEnd("ctx");
  1398. $4=self._deny_($5);
  1399. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1400. $ctx1.sendIdx["deny:"]=3;
  1401. //>>excludeEnd("ctx");
  1402. $6=true.__or(true);
  1403. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1404. $ctx1.sendIdx["|"]=1;
  1405. //>>excludeEnd("ctx");
  1406. self._assert_($6);
  1407. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1408. $ctx1.sendIdx["assert:"]=2;
  1409. //>>excludeEnd("ctx");
  1410. $7=true.__or(false);
  1411. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1412. $ctx1.sendIdx["|"]=2;
  1413. //>>excludeEnd("ctx");
  1414. self._assert_($7);
  1415. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1416. $ctx1.sendIdx["assert:"]=3;
  1417. //>>excludeEnd("ctx");
  1418. $8=false.__or(true);
  1419. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1420. $ctx1.sendIdx["|"]=3;
  1421. //>>excludeEnd("ctx");
  1422. self._assert_($8);
  1423. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1424. $ctx1.sendIdx["assert:"]=4;
  1425. //>>excludeEnd("ctx");
  1426. $10=false.__or(false);
  1427. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1428. $ctx1.sendIdx["|"]=4;
  1429. //>>excludeEnd("ctx");
  1430. $9=self._deny_($10);
  1431. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1432. $ctx1.sendIdx["deny:"]=4;
  1433. //>>excludeEnd("ctx");
  1434. $12=(1).__gt((0));
  1435. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1436. $ctx1.sendIdx[">"]=1;
  1437. //>>excludeEnd("ctx");
  1438. $11=true.__and($12);
  1439. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1440. $ctx1.sendIdx["&"]=5;
  1441. //>>excludeEnd("ctx");
  1442. self._assert_($11);
  1443. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1444. $ctx1.sendIdx["assert:"]=5;
  1445. //>>excludeEnd("ctx");
  1446. $14=(1).__gt((0));
  1447. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1448. $ctx1.sendIdx[">"]=2;
  1449. //>>excludeEnd("ctx");
  1450. $13=$recv($14).__and(false);
  1451. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1452. $ctx1.sendIdx["&"]=6;
  1453. //>>excludeEnd("ctx");
  1454. self._deny_($13);
  1455. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1456. $ctx1.sendIdx["deny:"]=5;
  1457. //>>excludeEnd("ctx");
  1458. $17=(1).__gt((0));
  1459. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1460. $ctx1.sendIdx[">"]=3;
  1461. //>>excludeEnd("ctx");
  1462. $18=(1).__gt((2));
  1463. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1464. $ctx1.sendIdx[">"]=4;
  1465. //>>excludeEnd("ctx");
  1466. $16=$recv($17).__and($18);
  1467. $15=self._deny_($16);
  1468. $20=(1).__gt((0));
  1469. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1470. $ctx1.sendIdx[">"]=5;
  1471. //>>excludeEnd("ctx");
  1472. $19=false.__or($20);
  1473. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1474. $ctx1.sendIdx["|"]=5;
  1475. //>>excludeEnd("ctx");
  1476. self._assert_($19);
  1477. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1478. $ctx1.sendIdx["assert:"]=6;
  1479. //>>excludeEnd("ctx");
  1480. $22=(1).__gt((0));
  1481. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1482. $ctx1.sendIdx[">"]=6;
  1483. //>>excludeEnd("ctx");
  1484. $21=$recv($22).__or(false);
  1485. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1486. $ctx1.sendIdx["|"]=6;
  1487. //>>excludeEnd("ctx");
  1488. self._assert_($21);
  1489. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1490. $ctx1.sendIdx["assert:"]=7;
  1491. //>>excludeEnd("ctx");
  1492. $25=(1).__gt((0));
  1493. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1494. $ctx1.sendIdx[">"]=7;
  1495. //>>excludeEnd("ctx");
  1496. $24=$recv($25).__or((1).__gt((2)));
  1497. $23=self._assert_($24);
  1498. return self;
  1499. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1500. }, function($ctx1) {$ctx1.fill(self,"testLogic",{},$globals.BooleanTest)});
  1501. //>>excludeEnd("ctx");
  1502. },
  1503. //>>excludeStart("ide", pragmas.excludeIdeData);
  1504. args: [],
  1505. source: "testLogic\x0a\x09\x22Trivial logic table\x22\x0a\x09self assert: (true & true);\x0a\x09\x09deny: (true & false);\x0a\x09\x09deny: (false & true);\x0a\x09\x09deny: (false & false).\x0a\x09self assert: (true | true);\x0a\x09\x09assert: (true | false);\x0a\x09\x09assert: (false | true);\x0a\x09\x09deny: (false | false).\x0a\x09\x22Checking that expressions work fine too\x22\x0a\x09self assert: (true & (1 > 0));\x0a\x09\x09deny: ((1 > 0) & false);\x0a\x09\x09deny: ((1 > 0) & (1 > 2)).\x0a\x09self assert: (false | (1 > 0));\x0a\x09\x09assert: ((1 > 0) | false);\x0a\x09\x09assert: ((1 > 0) | (1 > 2))",
  1506. referencedClasses: [],
  1507. //>>excludeEnd("ide");
  1508. messageSends: ["assert:", "&", "deny:", "|", ">"]
  1509. }),
  1510. $globals.BooleanTest);
  1511. $core.addMethod(
  1512. $core.method({
  1513. selector: "testLogicKeywords",
  1514. protocol: 'tests',
  1515. fn: function (){
  1516. var self=this;
  1517. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1518. return $core.withContext(function($ctx1) {
  1519. //>>excludeEnd("ctx");
  1520. var $1,$2,$3,$5,$4,$6,$7,$8,$10,$9,$11,$13,$12,$16,$15,$14,$17,$19,$18,$22,$21,$20;
  1521. $1=true._and_((function(){
  1522. return true;
  1523. }));
  1524. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1525. $ctx1.sendIdx["and:"]=1;
  1526. //>>excludeEnd("ctx");
  1527. self._assert_($1);
  1528. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1529. $ctx1.sendIdx["assert:"]=1;
  1530. //>>excludeEnd("ctx");
  1531. $2=true._and_((function(){
  1532. return false;
  1533. }));
  1534. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1535. $ctx1.sendIdx["and:"]=2;
  1536. //>>excludeEnd("ctx");
  1537. self._deny_($2);
  1538. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1539. $ctx1.sendIdx["deny:"]=1;
  1540. //>>excludeEnd("ctx");
  1541. $3=false._and_((function(){
  1542. return true;
  1543. }));
  1544. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1545. $ctx1.sendIdx["and:"]=3;
  1546. //>>excludeEnd("ctx");
  1547. self._deny_($3);
  1548. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1549. $ctx1.sendIdx["deny:"]=2;
  1550. //>>excludeEnd("ctx");
  1551. $5=false._and_((function(){
  1552. return false;
  1553. }));
  1554. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1555. $ctx1.sendIdx["and:"]=4;
  1556. //>>excludeEnd("ctx");
  1557. $4=self._deny_($5);
  1558. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1559. $ctx1.sendIdx["deny:"]=3;
  1560. //>>excludeEnd("ctx");
  1561. $6=true._or_((function(){
  1562. return true;
  1563. }));
  1564. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1565. $ctx1.sendIdx["or:"]=1;
  1566. //>>excludeEnd("ctx");
  1567. self._assert_($6);
  1568. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1569. $ctx1.sendIdx["assert:"]=2;
  1570. //>>excludeEnd("ctx");
  1571. $7=true._or_((function(){
  1572. return false;
  1573. }));
  1574. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1575. $ctx1.sendIdx["or:"]=2;
  1576. //>>excludeEnd("ctx");
  1577. self._assert_($7);
  1578. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1579. $ctx1.sendIdx["assert:"]=3;
  1580. //>>excludeEnd("ctx");
  1581. $8=false._or_((function(){
  1582. return true;
  1583. }));
  1584. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1585. $ctx1.sendIdx["or:"]=3;
  1586. //>>excludeEnd("ctx");
  1587. self._assert_($8);
  1588. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1589. $ctx1.sendIdx["assert:"]=4;
  1590. //>>excludeEnd("ctx");
  1591. $10=false._or_((function(){
  1592. return false;
  1593. }));
  1594. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1595. $ctx1.sendIdx["or:"]=4;
  1596. //>>excludeEnd("ctx");
  1597. $9=self._deny_($10);
  1598. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1599. $ctx1.sendIdx["deny:"]=4;
  1600. //>>excludeEnd("ctx");
  1601. $11=true._and_((function(){
  1602. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1603. return $core.withContext(function($ctx2) {
  1604. //>>excludeEnd("ctx");
  1605. return (1).__gt((0));
  1606. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1607. $ctx2.sendIdx[">"]=1;
  1608. //>>excludeEnd("ctx");
  1609. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1610. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,9)});
  1611. //>>excludeEnd("ctx");
  1612. }));
  1613. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1614. $ctx1.sendIdx["and:"]=5;
  1615. //>>excludeEnd("ctx");
  1616. self._assert_($11);
  1617. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1618. $ctx1.sendIdx["assert:"]=5;
  1619. //>>excludeEnd("ctx");
  1620. $13=(1).__gt((0));
  1621. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1622. $ctx1.sendIdx[">"]=2;
  1623. //>>excludeEnd("ctx");
  1624. $12=$recv($13)._and_((function(){
  1625. return false;
  1626. }));
  1627. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1628. $ctx1.sendIdx["and:"]=6;
  1629. //>>excludeEnd("ctx");
  1630. self._deny_($12);
  1631. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1632. $ctx1.sendIdx["deny:"]=5;
  1633. //>>excludeEnd("ctx");
  1634. $16=(1).__gt((0));
  1635. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1636. $ctx1.sendIdx[">"]=3;
  1637. //>>excludeEnd("ctx");
  1638. $15=$recv($16)._and_((function(){
  1639. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1640. return $core.withContext(function($ctx2) {
  1641. //>>excludeEnd("ctx");
  1642. return (1).__gt((2));
  1643. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1644. $ctx2.sendIdx[">"]=4;
  1645. //>>excludeEnd("ctx");
  1646. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1647. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,11)});
  1648. //>>excludeEnd("ctx");
  1649. }));
  1650. $14=self._deny_($15);
  1651. $17=false._or_((function(){
  1652. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1653. return $core.withContext(function($ctx2) {
  1654. //>>excludeEnd("ctx");
  1655. return (1).__gt((0));
  1656. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1657. $ctx2.sendIdx[">"]=5;
  1658. //>>excludeEnd("ctx");
  1659. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1660. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,12)});
  1661. //>>excludeEnd("ctx");
  1662. }));
  1663. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1664. $ctx1.sendIdx["or:"]=5;
  1665. //>>excludeEnd("ctx");
  1666. self._assert_($17);
  1667. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1668. $ctx1.sendIdx["assert:"]=6;
  1669. //>>excludeEnd("ctx");
  1670. $19=(1).__gt((0));
  1671. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1672. $ctx1.sendIdx[">"]=6;
  1673. //>>excludeEnd("ctx");
  1674. $18=$recv($19)._or_((function(){
  1675. return false;
  1676. }));
  1677. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1678. $ctx1.sendIdx["or:"]=6;
  1679. //>>excludeEnd("ctx");
  1680. self._assert_($18);
  1681. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1682. $ctx1.sendIdx["assert:"]=7;
  1683. //>>excludeEnd("ctx");
  1684. $22=(1).__gt((0));
  1685. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1686. $ctx1.sendIdx[">"]=7;
  1687. //>>excludeEnd("ctx");
  1688. $21=$recv($22)._or_((function(){
  1689. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1690. return $core.withContext(function($ctx2) {
  1691. //>>excludeEnd("ctx");
  1692. return (1).__gt((2));
  1693. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1694. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,14)});
  1695. //>>excludeEnd("ctx");
  1696. }));
  1697. $20=self._assert_($21);
  1698. return self;
  1699. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1700. }, function($ctx1) {$ctx1.fill(self,"testLogicKeywords",{},$globals.BooleanTest)});
  1701. //>>excludeEnd("ctx");
  1702. },
  1703. //>>excludeStart("ide", pragmas.excludeIdeData);
  1704. args: [],
  1705. source: "testLogicKeywords\x0a\x09\x22Trivial logic table\x22\x0a\x09self\x0a\x09\x09assert: (true and: [ true ]);\x0a\x09\x09deny: (true and: [ false ]);\x0a\x09\x09deny: (false and: [ true ]);\x0a\x09\x09deny: (false and: [ false ]).\x0a\x09self\x0a\x09\x09assert: (true or: [ true ]);\x0a\x09\x09assert: (true or: [ false ]);\x0a\x09\x09assert: (false or: [ true ]);\x0a\x09\x09deny: (false or: [ false ]).\x0a\x09\x09\x0a\x09\x22Checking that expressions work fine too\x22\x0a\x09self\x0a\x09\x09assert: (true and: [ 1 > 0 ]);\x0a\x09\x09deny: ((1 > 0) and: [ false ]);\x0a\x09\x09deny: ((1 > 0) and: [ 1 > 2 ]).\x0a\x09self\x0a\x09\x09assert: (false or: [ 1 > 0 ]);\x0a\x09\x09assert: ((1 > 0) or: [ false ]);\x0a\x09\x09assert: ((1 > 0) or: [ 1 > 2 ])",
  1706. referencedClasses: [],
  1707. //>>excludeEnd("ide");
  1708. messageSends: ["assert:", "and:", "deny:", "or:", ">"]
  1709. }),
  1710. $globals.BooleanTest);
  1711. $core.addMethod(
  1712. $core.method({
  1713. selector: "testNonBooleanError",
  1714. protocol: 'tests',
  1715. fn: function (){
  1716. var self=this;
  1717. function $NonBooleanReceiver(){return $globals.NonBooleanReceiver||(typeof NonBooleanReceiver=="undefined"?nil:NonBooleanReceiver)}
  1718. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1719. return $core.withContext(function($ctx1) {
  1720. //>>excludeEnd("ctx");
  1721. self._should_raise_((function(){
  1722. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1723. return $core.withContext(function($ctx2) {
  1724. //>>excludeEnd("ctx");
  1725. if($core.assert("")){
  1726. } else {
  1727. };
  1728. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1729. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  1730. //>>excludeEnd("ctx");
  1731. }),$NonBooleanReceiver());
  1732. return self;
  1733. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1734. }, function($ctx1) {$ctx1.fill(self,"testNonBooleanError",{},$globals.BooleanTest)});
  1735. //>>excludeEnd("ctx");
  1736. },
  1737. //>>excludeStart("ide", pragmas.excludeIdeData);
  1738. args: [],
  1739. source: "testNonBooleanError\x0a\x09self should: [ '' ifTrue: [] ifFalse: [] ] raise: NonBooleanReceiver",
  1740. referencedClasses: ["NonBooleanReceiver"],
  1741. //>>excludeEnd("ide");
  1742. messageSends: ["should:raise:", "ifTrue:ifFalse:"]
  1743. }),
  1744. $globals.BooleanTest);
  1745. $core.addClass('ClassBuilderTest', $globals.TestCase, ['builder', 'theClass'], 'Kernel-Tests');
  1746. $core.addMethod(
  1747. $core.method({
  1748. selector: "setUp",
  1749. protocol: 'running',
  1750. fn: function (){
  1751. var self=this;
  1752. function $ClassBuilder(){return $globals.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  1753. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1754. return $core.withContext(function($ctx1) {
  1755. //>>excludeEnd("ctx");
  1756. self["@builder"]=$recv($ClassBuilder())._new();
  1757. return self;
  1758. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1759. }, function($ctx1) {$ctx1.fill(self,"setUp",{},$globals.ClassBuilderTest)});
  1760. //>>excludeEnd("ctx");
  1761. },
  1762. //>>excludeStart("ide", pragmas.excludeIdeData);
  1763. args: [],
  1764. source: "setUp\x0a\x09builder := ClassBuilder new",
  1765. referencedClasses: ["ClassBuilder"],
  1766. //>>excludeEnd("ide");
  1767. messageSends: ["new"]
  1768. }),
  1769. $globals.ClassBuilderTest);
  1770. $core.addMethod(
  1771. $core.method({
  1772. selector: "tearDown",
  1773. protocol: 'running',
  1774. fn: function (){
  1775. var self=this;
  1776. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1777. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1778. return $core.withContext(function($ctx1) {
  1779. //>>excludeEnd("ctx");
  1780. var $1,$receiver;
  1781. $1=self["@theClass"];
  1782. if(($receiver = $1) == null || $receiver.isNil){
  1783. $1;
  1784. } else {
  1785. $recv($Smalltalk())._removeClass_(self["@theClass"]);
  1786. self["@theClass"]=nil;
  1787. self["@theClass"];
  1788. };
  1789. return self;
  1790. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1791. }, function($ctx1) {$ctx1.fill(self,"tearDown",{},$globals.ClassBuilderTest)});
  1792. //>>excludeEnd("ctx");
  1793. },
  1794. //>>excludeStart("ide", pragmas.excludeIdeData);
  1795. args: [],
  1796. source: "tearDown\x0a\x09theClass ifNotNil: [ Smalltalk removeClass: theClass. theClass := nil ]",
  1797. referencedClasses: ["Smalltalk"],
  1798. //>>excludeEnd("ide");
  1799. messageSends: ["ifNotNil:", "removeClass:"]
  1800. }),
  1801. $globals.ClassBuilderTest);
  1802. $core.addMethod(
  1803. $core.method({
  1804. selector: "testClassCopy",
  1805. protocol: 'tests',
  1806. fn: function (){
  1807. var self=this;
  1808. function $ObjectMock(){return $globals.ObjectMock||(typeof ObjectMock=="undefined"?nil:ObjectMock)}
  1809. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1810. return $core.withContext(function($ctx1) {
  1811. //>>excludeEnd("ctx");
  1812. var $2,$1,$4,$3,$6,$5,$8,$7;
  1813. self["@theClass"]=$recv(self["@builder"])._copyClass_named_($ObjectMock(),"ObjectMock2");
  1814. $2=$recv(self["@theClass"])._superclass();
  1815. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1816. $ctx1.sendIdx["superclass"]=1;
  1817. //>>excludeEnd("ctx");
  1818. $1=$recv($2).__eq_eq($recv($ObjectMock())._superclass());
  1819. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1820. $ctx1.sendIdx["=="]=1;
  1821. //>>excludeEnd("ctx");
  1822. self._assert_($1);
  1823. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1824. $ctx1.sendIdx["assert:"]=1;
  1825. //>>excludeEnd("ctx");
  1826. $4=$recv(self["@theClass"])._instanceVariableNames();
  1827. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1828. $ctx1.sendIdx["instanceVariableNames"]=1;
  1829. //>>excludeEnd("ctx");
  1830. $3=$recv($4).__eq_eq($recv($ObjectMock())._instanceVariableNames());
  1831. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1832. $ctx1.sendIdx["=="]=2;
  1833. //>>excludeEnd("ctx");
  1834. self._assert_($3);
  1835. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1836. $ctx1.sendIdx["assert:"]=2;
  1837. //>>excludeEnd("ctx");
  1838. self._assert_equals_($recv(self["@theClass"])._name(),"ObjectMock2");
  1839. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1840. $ctx1.sendIdx["assert:equals:"]=1;
  1841. //>>excludeEnd("ctx");
  1842. $6=$recv(self["@theClass"])._package();
  1843. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1844. $ctx1.sendIdx["package"]=1;
  1845. //>>excludeEnd("ctx");
  1846. $5=$recv($6).__eq_eq($recv($ObjectMock())._package());
  1847. self._assert_($5);
  1848. $8=$recv(self["@theClass"])._methodDictionary();
  1849. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1850. $ctx1.sendIdx["methodDictionary"]=1;
  1851. //>>excludeEnd("ctx");
  1852. $7=$recv($8)._keys();
  1853. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1854. $ctx1.sendIdx["keys"]=1;
  1855. //>>excludeEnd("ctx");
  1856. self._assert_equals_($7,$recv($recv($ObjectMock())._methodDictionary())._keys());
  1857. return self;
  1858. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1859. }, function($ctx1) {$ctx1.fill(self,"testClassCopy",{},$globals.ClassBuilderTest)});
  1860. //>>excludeEnd("ctx");
  1861. },
  1862. //>>excludeStart("ide", pragmas.excludeIdeData);
  1863. args: [],
  1864. source: "testClassCopy\x0a\x09theClass := builder copyClass: ObjectMock named: 'ObjectMock2'.\x0a\x09self assert: theClass superclass == ObjectMock superclass.\x0a\x09self assert: theClass instanceVariableNames == ObjectMock instanceVariableNames.\x0a\x09self assert: theClass name equals: 'ObjectMock2'.\x0a\x09self assert: theClass package == ObjectMock package.\x0a\x09self assert: theClass methodDictionary keys equals: ObjectMock methodDictionary keys",
  1865. referencedClasses: ["ObjectMock"],
  1866. //>>excludeEnd("ide");
  1867. messageSends: ["copyClass:named:", "assert:", "==", "superclass", "instanceVariableNames", "assert:equals:", "name", "package", "keys", "methodDictionary"]
  1868. }),
  1869. $globals.ClassBuilderTest);
  1870. $core.addMethod(
  1871. $core.method({
  1872. selector: "testClassMigration",
  1873. protocol: 'tests',
  1874. fn: function (){
  1875. var self=this;
  1876. var instance,oldClass;
  1877. function $ObjectMock(){return $globals.ObjectMock||(typeof ObjectMock=="undefined"?nil:ObjectMock)}
  1878. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1879. function $ObjectMock2(){return $globals.ObjectMock2||(typeof ObjectMock2=="undefined"?nil:ObjectMock2)}
  1880. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1881. return $core.withContext(function($ctx1) {
  1882. //>>excludeEnd("ctx");
  1883. var $2,$1,$4,$3,$5,$6,$7,$8,$9,$11,$10;
  1884. oldClass=$recv(self["@builder"])._copyClass_named_($ObjectMock(),"ObjectMock2");
  1885. $2=$recv($Smalltalk())._globals();
  1886. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1887. $ctx1.sendIdx["globals"]=1;
  1888. //>>excludeEnd("ctx");
  1889. $1=$recv($2)._at_("ObjectMock2");
  1890. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1891. $ctx1.sendIdx["at:"]=1;
  1892. //>>excludeEnd("ctx");
  1893. instance=$recv($1)._new();
  1894. $4=$recv($Smalltalk())._globals();
  1895. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1896. $ctx1.sendIdx["globals"]=2;
  1897. //>>excludeEnd("ctx");
  1898. $3=$recv($4)._at_("ObjectMock2");
  1899. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1900. $ctx1.sendIdx["at:"]=2;
  1901. //>>excludeEnd("ctx");
  1902. $recv($ObjectMock())._subclass_instanceVariableNames_package_($3,"","Kernel-Tests");
  1903. $5=$recv(oldClass).__eq_eq($ObjectMock2());
  1904. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1905. $ctx1.sendIdx["=="]=1;
  1906. //>>excludeEnd("ctx");
  1907. self._deny_($5);
  1908. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1909. $ctx1.sendIdx["deny:"]=1;
  1910. //>>excludeEnd("ctx");
  1911. $6=$recv($recv($ObjectMock2())._superclass()).__eq_eq($ObjectMock());
  1912. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1913. $ctx1.sendIdx["=="]=2;
  1914. //>>excludeEnd("ctx");
  1915. self._assert_($6);
  1916. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1917. $ctx1.sendIdx["assert:"]=1;
  1918. //>>excludeEnd("ctx");
  1919. self._assert_($recv($recv($ObjectMock2())._instanceVariableNames())._isEmpty());
  1920. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1921. $ctx1.sendIdx["assert:"]=2;
  1922. //>>excludeEnd("ctx");
  1923. $7=$recv($ObjectMock2())._selectors();
  1924. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1925. $ctx1.sendIdx["selectors"]=1;
  1926. //>>excludeEnd("ctx");
  1927. self._assert_equals_($7,$recv(oldClass)._selectors());
  1928. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1929. $ctx1.sendIdx["assert:equals:"]=1;
  1930. //>>excludeEnd("ctx");
  1931. $8=$recv($ObjectMock2())._comment();
  1932. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1933. $ctx1.sendIdx["comment"]=1;
  1934. //>>excludeEnd("ctx");
  1935. self._assert_equals_($8,$recv(oldClass)._comment());
  1936. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1937. $ctx1.sendIdx["assert:equals:"]=2;
  1938. //>>excludeEnd("ctx");
  1939. $9=$recv($recv($ObjectMock2())._package())._name();
  1940. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1941. $ctx1.sendIdx["name"]=1;
  1942. //>>excludeEnd("ctx");
  1943. self._assert_equals_($9,"Kernel-Tests");
  1944. $11=$recv(instance)._class();
  1945. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1946. $ctx1.sendIdx["class"]=1;
  1947. //>>excludeEnd("ctx");
  1948. $10=$recv($11).__eq_eq($ObjectMock2());
  1949. self._deny_($10);
  1950. self._assert_($recv($recv($recv($Smalltalk())._globals())._at_($recv($recv(instance)._class())._name()))._isNil());
  1951. $recv($Smalltalk())._removeClass_($ObjectMock2());
  1952. return self;
  1953. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1954. }, function($ctx1) {$ctx1.fill(self,"testClassMigration",{instance:instance,oldClass:oldClass},$globals.ClassBuilderTest)});
  1955. //>>excludeEnd("ctx");
  1956. },
  1957. //>>excludeStart("ide", pragmas.excludeIdeData);
  1958. args: [],
  1959. source: "testClassMigration\x0a\x09| instance oldClass |\x0a\x09\x0a\x09oldClass := builder copyClass: ObjectMock named: 'ObjectMock2'.\x0a\x09instance := (Smalltalk globals at: 'ObjectMock2') new.\x0a\x09\x0a\x09\x22Change the superclass of ObjectMock2\x22\x0a\x09ObjectMock subclass: (Smalltalk globals at: 'ObjectMock2')\x0a\x09\x09instanceVariableNames: ''\x0a\x09\x09package: 'Kernel-Tests'.\x0a\x09\x0a\x09self deny: oldClass == ObjectMock2.\x0a\x09\x0a\x09self assert: ObjectMock2 superclass == ObjectMock.\x0a\x09self assert: ObjectMock2 instanceVariableNames isEmpty.\x0a\x09self assert: ObjectMock2 selectors equals: oldClass selectors.\x0a\x09self assert: ObjectMock2 comment equals: oldClass comment.\x0a\x09self assert: ObjectMock2 package name equals: 'Kernel-Tests'.\x0a\x09\x0a\x09self deny: instance class == ObjectMock2.\x0a\x09\x22Commeting this out. Tests implementation detail.\x22\x0a\x09\x22self assert: instance class name equals: 'OldObjectMock2'.\x22\x0a\x09\x0a\x09self assert: (Smalltalk globals at: instance class name) isNil.\x0a\x09\x0a\x09Smalltalk removeClass: ObjectMock2",
  1960. referencedClasses: ["ObjectMock", "Smalltalk", "ObjectMock2"],
  1961. //>>excludeEnd("ide");
  1962. messageSends: ["copyClass:named:", "new", "at:", "globals", "subclass:instanceVariableNames:package:", "deny:", "==", "assert:", "superclass", "isEmpty", "instanceVariableNames", "assert:equals:", "selectors", "comment", "name", "package", "class", "isNil", "removeClass:"]
  1963. }),
  1964. $globals.ClassBuilderTest);
  1965. $core.addMethod(
  1966. $core.method({
  1967. selector: "testClassMigrationWithClassInstanceVariables",
  1968. protocol: 'tests',
  1969. fn: function (){
  1970. var self=this;
  1971. function $ObjectMock(){return $globals.ObjectMock||(typeof ObjectMock=="undefined"?nil:ObjectMock)}
  1972. function $ObjectMock2(){return $globals.ObjectMock2||(typeof ObjectMock2=="undefined"?nil:ObjectMock2)}
  1973. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1974. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1975. return $core.withContext(function($ctx1) {
  1976. //>>excludeEnd("ctx");
  1977. var $1;
  1978. $recv(self["@builder"])._copyClass_named_($ObjectMock(),"ObjectMock2");
  1979. $1=$recv($ObjectMock2())._class();
  1980. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1981. $ctx1.sendIdx["class"]=1;
  1982. //>>excludeEnd("ctx");
  1983. $recv($1)._instanceVariableNames_("foo bar");
  1984. $recv($ObjectMock())._subclass_instanceVariableNames_package_($recv($recv($Smalltalk())._globals())._at_("ObjectMock2"),"","Kernel-Tests");
  1985. self._assert_equals_($recv($recv($ObjectMock2())._class())._instanceVariableNames(),["foo", "bar"]);
  1986. $recv($Smalltalk())._removeClass_($ObjectMock2());
  1987. return self;
  1988. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1989. }, function($ctx1) {$ctx1.fill(self,"testClassMigrationWithClassInstanceVariables",{},$globals.ClassBuilderTest)});
  1990. //>>excludeEnd("ctx");
  1991. },
  1992. //>>excludeStart("ide", pragmas.excludeIdeData);
  1993. args: [],
  1994. source: "testClassMigrationWithClassInstanceVariables\x0a\x09\x0a\x09builder copyClass: ObjectMock named: 'ObjectMock2'.\x0a\x09ObjectMock2 class instanceVariableNames: 'foo bar'.\x0a\x09\x0a\x09\x22Change the superclass of ObjectMock2\x22\x0a\x09ObjectMock subclass: (Smalltalk globals at: 'ObjectMock2')\x0a\x09\x09instanceVariableNames: ''\x0a\x09\x09package: 'Kernel-Tests'.\x0a\x09\x0a\x09self assert: ObjectMock2 class instanceVariableNames equals: #('foo' 'bar').\x0a\x09\x0a\x09Smalltalk removeClass: ObjectMock2",
  1995. referencedClasses: ["ObjectMock", "ObjectMock2", "Smalltalk"],
  1996. //>>excludeEnd("ide");
  1997. messageSends: ["copyClass:named:", "instanceVariableNames:", "class", "subclass:instanceVariableNames:package:", "at:", "globals", "assert:equals:", "instanceVariableNames", "removeClass:"]
  1998. }),
  1999. $globals.ClassBuilderTest);
  2000. $core.addMethod(
  2001. $core.method({
  2002. selector: "testClassMigrationWithSubclasses",
  2003. protocol: 'tests',
  2004. fn: function (){
  2005. var self=this;
  2006. function $ObjectMock(){return $globals.ObjectMock||(typeof ObjectMock=="undefined"?nil:ObjectMock)}
  2007. function $ObjectMock2(){return $globals.ObjectMock2||(typeof ObjectMock2=="undefined"?nil:ObjectMock2)}
  2008. function $ObjectMock3(){return $globals.ObjectMock3||(typeof ObjectMock3=="undefined"?nil:ObjectMock3)}
  2009. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  2010. function $ObjectMock4(){return $globals.ObjectMock4||(typeof ObjectMock4=="undefined"?nil:ObjectMock4)}
  2011. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2012. return $core.withContext(function($ctx1) {
  2013. //>>excludeEnd("ctx");
  2014. var $2,$1,$4,$3;
  2015. $recv(self["@builder"])._copyClass_named_($ObjectMock(),"ObjectMock2");
  2016. $recv($ObjectMock2())._subclass_instanceVariableNames_package_("ObjectMock3","","Kernel-Tests");
  2017. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2018. $ctx1.sendIdx["subclass:instanceVariableNames:package:"]=1;
  2019. //>>excludeEnd("ctx");
  2020. $recv($ObjectMock3())._subclass_instanceVariableNames_package_("ObjectMock4","","Kernel-Tests");
  2021. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2022. $ctx1.sendIdx["subclass:instanceVariableNames:package:"]=2;
  2023. //>>excludeEnd("ctx");
  2024. $recv($ObjectMock())._subclass_instanceVariableNames_package_($recv($recv($Smalltalk())._globals())._at_("ObjectMock2"),"","Kernel-Tests");
  2025. $2=$recv($ObjectMock())._subclasses();
  2026. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2027. $ctx1.sendIdx["subclasses"]=1;
  2028. //>>excludeEnd("ctx");
  2029. $1=$recv($2)._includes_($ObjectMock2());
  2030. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2031. $ctx1.sendIdx["includes:"]=1;
  2032. //>>excludeEnd("ctx");
  2033. self._assert_($1);
  2034. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2035. $ctx1.sendIdx["assert:"]=1;
  2036. //>>excludeEnd("ctx");
  2037. $4=$recv($ObjectMock2())._subclasses();
  2038. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2039. $ctx1.sendIdx["subclasses"]=2;
  2040. //>>excludeEnd("ctx");
  2041. $3=$recv($4)._includes_($ObjectMock3());
  2042. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2043. $ctx1.sendIdx["includes:"]=2;
  2044. //>>excludeEnd("ctx");
  2045. self._assert_($3);
  2046. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2047. $ctx1.sendIdx["assert:"]=2;
  2048. //>>excludeEnd("ctx");
  2049. self._assert_($recv($recv($ObjectMock3())._subclasses())._includes_($ObjectMock4()));
  2050. $recv($recv($ObjectMock())._allSubclasses())._do_((function(each){
  2051. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2052. return $core.withContext(function($ctx2) {
  2053. //>>excludeEnd("ctx");
  2054. return $recv($Smalltalk())._removeClass_(each);
  2055. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2056. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2057. //>>excludeEnd("ctx");
  2058. }));
  2059. return self;
  2060. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2061. }, function($ctx1) {$ctx1.fill(self,"testClassMigrationWithSubclasses",{},$globals.ClassBuilderTest)});
  2062. //>>excludeEnd("ctx");
  2063. },
  2064. //>>excludeStart("ide", pragmas.excludeIdeData);
  2065. args: [],
  2066. source: "testClassMigrationWithSubclasses\x0a\x09\x0a\x09builder copyClass: ObjectMock named: 'ObjectMock2'.\x0a\x09ObjectMock2 subclass: 'ObjectMock3' instanceVariableNames: '' package: 'Kernel-Tests'.\x0a\x09ObjectMock3 subclass: 'ObjectMock4' instanceVariableNames: '' package: 'Kernel-Tests'.\x0a\x09\x0a\x09\x22Change the superclass of ObjectMock2\x22\x0a\x09ObjectMock subclass: (Smalltalk globals at: 'ObjectMock2')\x0a\x09\x09instanceVariableNames: ''\x0a\x09\x09package: 'Kernel-Tests'.\x0a\x09\x0a\x09self assert: (ObjectMock subclasses includes: ObjectMock2).\x0a\x09self assert: (ObjectMock2 subclasses includes: ObjectMock3).\x0a\x09self assert: (ObjectMock3 subclasses includes: ObjectMock4).\x0a\x09\x0a\x09ObjectMock allSubclasses do: [ :each | Smalltalk removeClass: each ]",
  2067. referencedClasses: ["ObjectMock", "ObjectMock2", "ObjectMock3", "Smalltalk", "ObjectMock4"],
  2068. //>>excludeEnd("ide");
  2069. messageSends: ["copyClass:named:", "subclass:instanceVariableNames:package:", "at:", "globals", "assert:", "includes:", "subclasses", "do:", "allSubclasses", "removeClass:"]
  2070. }),
  2071. $globals.ClassBuilderTest);
  2072. $core.addMethod(
  2073. $core.method({
  2074. selector: "testInstanceVariableNames",
  2075. protocol: 'tests',
  2076. fn: function (){
  2077. var self=this;
  2078. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2079. return $core.withContext(function($ctx1) {
  2080. //>>excludeEnd("ctx");
  2081. self._assert_equals_($recv(self["@builder"])._instanceVariableNamesFor_(" hello world "),["hello", "world"]);
  2082. return self;
  2083. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2084. }, function($ctx1) {$ctx1.fill(self,"testInstanceVariableNames",{},$globals.ClassBuilderTest)});
  2085. //>>excludeEnd("ctx");
  2086. },
  2087. //>>excludeStart("ide", pragmas.excludeIdeData);
  2088. args: [],
  2089. source: "testInstanceVariableNames\x0a\x09self assert: (builder instanceVariableNamesFor: ' hello world ') equals: #('hello' 'world')",
  2090. referencedClasses: [],
  2091. //>>excludeEnd("ide");
  2092. messageSends: ["assert:equals:", "instanceVariableNamesFor:"]
  2093. }),
  2094. $globals.ClassBuilderTest);
  2095. $core.addClass('CollectionTest', $globals.TestCase, [], 'Kernel-Tests');
  2096. $core.addMethod(
  2097. $core.method({
  2098. selector: "assertSameContents:as:",
  2099. protocol: 'convenience',
  2100. fn: function (aCollection,anotherCollection){
  2101. var self=this;
  2102. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2103. return $core.withContext(function($ctx1) {
  2104. //>>excludeEnd("ctx");
  2105. var $2,$1,$4,$3;
  2106. $2=$recv(aCollection)._size();
  2107. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2108. $ctx1.sendIdx["size"]=1;
  2109. //>>excludeEnd("ctx");
  2110. $1=$recv($2).__eq($recv(anotherCollection)._size());
  2111. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2112. $ctx1.sendIdx["="]=1;
  2113. //>>excludeEnd("ctx");
  2114. self._assert_($1);
  2115. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2116. $ctx1.sendIdx["assert:"]=1;
  2117. //>>excludeEnd("ctx");
  2118. $recv(aCollection)._do_((function(each){
  2119. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2120. return $core.withContext(function($ctx2) {
  2121. //>>excludeEnd("ctx");
  2122. $4=$recv(aCollection)._occurrencesOf_(each);
  2123. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2124. $ctx2.sendIdx["occurrencesOf:"]=1;
  2125. //>>excludeEnd("ctx");
  2126. $3=$recv($4).__eq($recv(anotherCollection)._occurrencesOf_(each));
  2127. return self._assert_($3);
  2128. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2129. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2130. //>>excludeEnd("ctx");
  2131. }));
  2132. return self;
  2133. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2134. }, function($ctx1) {$ctx1.fill(self,"assertSameContents:as:",{aCollection:aCollection,anotherCollection:anotherCollection},$globals.CollectionTest)});
  2135. //>>excludeEnd("ctx");
  2136. },
  2137. //>>excludeStart("ide", pragmas.excludeIdeData);
  2138. args: ["aCollection", "anotherCollection"],
  2139. source: "assertSameContents: aCollection as: anotherCollection\x0a\x09self assert: (aCollection size = anotherCollection size).\x0a\x09aCollection do: [ :each |\x0a\x09\x09self assert: ((aCollection occurrencesOf: each) = (anotherCollection occurrencesOf: each)) ]",
  2140. referencedClasses: [],
  2141. //>>excludeEnd("ide");
  2142. messageSends: ["assert:", "=", "size", "do:", "occurrencesOf:"]
  2143. }),
  2144. $globals.CollectionTest);
  2145. $core.addMethod(
  2146. $core.method({
  2147. selector: "collection",
  2148. protocol: 'fixture',
  2149. fn: function (){
  2150. var self=this;
  2151. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2152. return $core.withContext(function($ctx1) {
  2153. //>>excludeEnd("ctx");
  2154. self._subclassResponsibility();
  2155. return self;
  2156. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2157. }, function($ctx1) {$ctx1.fill(self,"collection",{},$globals.CollectionTest)});
  2158. //>>excludeEnd("ctx");
  2159. },
  2160. //>>excludeStart("ide", pragmas.excludeIdeData);
  2161. args: [],
  2162. source: "collection\x0a\x09\x22Answers pre-filled collection of type tested.\x22\x0a\x0a\x09self subclassResponsibility",
  2163. referencedClasses: [],
  2164. //>>excludeEnd("ide");
  2165. messageSends: ["subclassResponsibility"]
  2166. }),
  2167. $globals.CollectionTest);
  2168. $core.addMethod(
  2169. $core.method({
  2170. selector: "collectionClass",
  2171. protocol: 'fixture',
  2172. fn: function (){
  2173. var self=this;
  2174. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2175. return $core.withContext(function($ctx1) {
  2176. //>>excludeEnd("ctx");
  2177. var $1;
  2178. $1=$recv(self._class())._collectionClass();
  2179. return $1;
  2180. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2181. }, function($ctx1) {$ctx1.fill(self,"collectionClass",{},$globals.CollectionTest)});
  2182. //>>excludeEnd("ctx");
  2183. },
  2184. //>>excludeStart("ide", pragmas.excludeIdeData);
  2185. args: [],
  2186. source: "collectionClass\x0a\x09\x22Answers class of collection type tested\x22\x0a\x0a\x09^ self class collectionClass",
  2187. referencedClasses: [],
  2188. //>>excludeEnd("ide");
  2189. messageSends: ["collectionClass", "class"]
  2190. }),
  2191. $globals.CollectionTest);
  2192. $core.addMethod(
  2193. $core.method({
  2194. selector: "collectionOfPrintStrings",
  2195. protocol: 'fixture',
  2196. fn: function (){
  2197. var self=this;
  2198. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2199. return $core.withContext(function($ctx1) {
  2200. //>>excludeEnd("ctx");
  2201. self._subclassResponsibility();
  2202. return self;
  2203. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2204. }, function($ctx1) {$ctx1.fill(self,"collectionOfPrintStrings",{},$globals.CollectionTest)});
  2205. //>>excludeEnd("ctx");
  2206. },
  2207. //>>excludeStart("ide", pragmas.excludeIdeData);
  2208. args: [],
  2209. source: "collectionOfPrintStrings\x0a\x09\x22Answers self collection but with values\x0a\x09changed to their printStrings\x22\x0a\x0a\x09self subclassResponsibility",
  2210. referencedClasses: [],
  2211. //>>excludeEnd("ide");
  2212. messageSends: ["subclassResponsibility"]
  2213. }),
  2214. $globals.CollectionTest);
  2215. $core.addMethod(
  2216. $core.method({
  2217. selector: "collectionSize",
  2218. protocol: 'fixture',
  2219. fn: function (){
  2220. var self=this;
  2221. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2222. return $core.withContext(function($ctx1) {
  2223. //>>excludeEnd("ctx");
  2224. self._subclassResponsibility();
  2225. return self;
  2226. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2227. }, function($ctx1) {$ctx1.fill(self,"collectionSize",{},$globals.CollectionTest)});
  2228. //>>excludeEnd("ctx");
  2229. },
  2230. //>>excludeStart("ide", pragmas.excludeIdeData);
  2231. args: [],
  2232. source: "collectionSize\x0a\x09\x22Answers size of self collection.\x22\x0a\x0a\x09self subclassResponsibility",
  2233. referencedClasses: [],
  2234. //>>excludeEnd("ide");
  2235. messageSends: ["subclassResponsibility"]
  2236. }),
  2237. $globals.CollectionTest);
  2238. $core.addMethod(
  2239. $core.method({
  2240. selector: "collectionWithDuplicates",
  2241. protocol: 'fixture',
  2242. fn: function (){
  2243. var self=this;
  2244. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2245. return $core.withContext(function($ctx1) {
  2246. //>>excludeEnd("ctx");
  2247. self._subclassResponsibility();
  2248. return self;
  2249. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2250. }, function($ctx1) {$ctx1.fill(self,"collectionWithDuplicates",{},$globals.CollectionTest)});
  2251. //>>excludeEnd("ctx");
  2252. },
  2253. //>>excludeStart("ide", pragmas.excludeIdeData);
  2254. args: [],
  2255. source: "collectionWithDuplicates\x0a\x09\x22Answers pre-filled collection of type tested,\x0a\x09with exactly five distinct elements,\x0a\x09some of them appearing multiple times, if possible.\x22\x0a\x0a\x09self subclassResponsibility",
  2256. referencedClasses: [],
  2257. //>>excludeEnd("ide");
  2258. messageSends: ["subclassResponsibility"]
  2259. }),
  2260. $globals.CollectionTest);
  2261. $core.addMethod(
  2262. $core.method({
  2263. selector: "collectionWithNewValue",
  2264. protocol: 'fixture',
  2265. fn: function (){
  2266. var self=this;
  2267. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2268. return $core.withContext(function($ctx1) {
  2269. //>>excludeEnd("ctx");
  2270. self._subclassResponsibility();
  2271. return self;
  2272. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2273. }, function($ctx1) {$ctx1.fill(self,"collectionWithNewValue",{},$globals.CollectionTest)});
  2274. //>>excludeEnd("ctx");
  2275. },
  2276. //>>excludeStart("ide", pragmas.excludeIdeData);
  2277. args: [],
  2278. source: "collectionWithNewValue\x0a\x09\x22Answers a collection which shows how\x0a\x09self collection would look after adding\x0a\x09self sampleNewValue\x22\x0a\x09\x0a\x09self subclassResponsibility",
  2279. referencedClasses: [],
  2280. //>>excludeEnd("ide");
  2281. messageSends: ["subclassResponsibility"]
  2282. }),
  2283. $globals.CollectionTest);
  2284. $core.addMethod(
  2285. $core.method({
  2286. selector: "isCollectionReadOnly",
  2287. protocol: 'testing',
  2288. fn: function (){
  2289. var self=this;
  2290. return false;
  2291. },
  2292. //>>excludeStart("ide", pragmas.excludeIdeData);
  2293. args: [],
  2294. source: "isCollectionReadOnly\x0a\x09^ false",
  2295. referencedClasses: [],
  2296. //>>excludeEnd("ide");
  2297. messageSends: []
  2298. }),
  2299. $globals.CollectionTest);
  2300. $core.addMethod(
  2301. $core.method({
  2302. selector: "sampleNewValue",
  2303. protocol: 'fixture',
  2304. fn: function (){
  2305. var self=this;
  2306. return "N";
  2307. },
  2308. //>>excludeStart("ide", pragmas.excludeIdeData);
  2309. args: [],
  2310. source: "sampleNewValue\x0a\x09\x22Answers a value that is not yet there\x0a\x09and can be put into a tested collection\x22\x0a\x09\x0a\x09^ 'N'",
  2311. referencedClasses: [],
  2312. //>>excludeEnd("ide");
  2313. messageSends: []
  2314. }),
  2315. $globals.CollectionTest);
  2316. $core.addMethod(
  2317. $core.method({
  2318. selector: "sampleNewValueAsCollection",
  2319. protocol: 'fixture',
  2320. fn: function (){
  2321. var self=this;
  2322. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2323. return $core.withContext(function($ctx1) {
  2324. //>>excludeEnd("ctx");
  2325. var $1;
  2326. $1=$recv(self._collectionClass())._with_(self._sampleNewValue());
  2327. return $1;
  2328. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2329. }, function($ctx1) {$ctx1.fill(self,"sampleNewValueAsCollection",{},$globals.CollectionTest)});
  2330. //>>excludeEnd("ctx");
  2331. },
  2332. //>>excludeStart("ide", pragmas.excludeIdeData);
  2333. args: [],
  2334. source: "sampleNewValueAsCollection\x0a\x09\x22Answers self sampleNewValue\x0a\x09wrapped in single element collection\x0a\x09of tested type\x22\x0a\x09\x0a\x09^ self collectionClass with: self sampleNewValue",
  2335. referencedClasses: [],
  2336. //>>excludeEnd("ide");
  2337. messageSends: ["with:", "collectionClass", "sampleNewValue"]
  2338. }),
  2339. $globals.CollectionTest);
  2340. $core.addMethod(
  2341. $core.method({
  2342. selector: "testAddAll",
  2343. protocol: 'tests',
  2344. fn: function (){
  2345. var self=this;
  2346. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2347. return $core.withContext(function($ctx1) {
  2348. //>>excludeEnd("ctx");
  2349. var $2,$3,$5,$4,$6,$1,$7,$10,$9,$11,$12,$13,$8,$14,$17,$16,$18,$20,$19,$21,$15,$23,$24,$25,$26,$22,$27,$28,$29;
  2350. $2=self._collection();
  2351. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2352. $ctx1.sendIdx["collection"]=1;
  2353. //>>excludeEnd("ctx");
  2354. $3=$2;
  2355. $5=self._collectionClass();
  2356. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2357. $ctx1.sendIdx["collectionClass"]=1;
  2358. //>>excludeEnd("ctx");
  2359. $4=$recv($5)._new();
  2360. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2361. $ctx1.sendIdx["new"]=1;
  2362. //>>excludeEnd("ctx");
  2363. $recv($3)._addAll_($4);
  2364. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2365. $ctx1.sendIdx["addAll:"]=1;
  2366. //>>excludeEnd("ctx");
  2367. $6=$recv($2)._yourself();
  2368. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2369. $ctx1.sendIdx["yourself"]=1;
  2370. //>>excludeEnd("ctx");
  2371. $1=$6;
  2372. $7=self._collection();
  2373. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2374. $ctx1.sendIdx["collection"]=2;
  2375. //>>excludeEnd("ctx");
  2376. self._assert_equals_($1,$7);
  2377. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2378. $ctx1.sendIdx["assert:equals:"]=1;
  2379. //>>excludeEnd("ctx");
  2380. $10=self._collectionClass();
  2381. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2382. $ctx1.sendIdx["collectionClass"]=2;
  2383. //>>excludeEnd("ctx");
  2384. $9=$recv($10)._new();
  2385. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2386. $ctx1.sendIdx["new"]=2;
  2387. //>>excludeEnd("ctx");
  2388. $11=$9;
  2389. $12=self._collection();
  2390. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2391. $ctx1.sendIdx["collection"]=3;
  2392. //>>excludeEnd("ctx");
  2393. $recv($11)._addAll_($12);
  2394. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2395. $ctx1.sendIdx["addAll:"]=2;
  2396. //>>excludeEnd("ctx");
  2397. $13=$recv($9)._yourself();
  2398. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2399. $ctx1.sendIdx["yourself"]=2;
  2400. //>>excludeEnd("ctx");
  2401. $8=$13;
  2402. $14=self._collection();
  2403. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2404. $ctx1.sendIdx["collection"]=4;
  2405. //>>excludeEnd("ctx");
  2406. self._assert_equals_($8,$14);
  2407. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2408. $ctx1.sendIdx["assert:equals:"]=2;
  2409. //>>excludeEnd("ctx");
  2410. $17=self._collectionClass();
  2411. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2412. $ctx1.sendIdx["collectionClass"]=3;
  2413. //>>excludeEnd("ctx");
  2414. $16=$recv($17)._new();
  2415. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2416. $ctx1.sendIdx["new"]=3;
  2417. //>>excludeEnd("ctx");
  2418. $18=$16;
  2419. $20=self._collectionClass();
  2420. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2421. $ctx1.sendIdx["collectionClass"]=4;
  2422. //>>excludeEnd("ctx");
  2423. $19=$recv($20)._new();
  2424. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2425. $ctx1.sendIdx["new"]=4;
  2426. //>>excludeEnd("ctx");
  2427. $recv($18)._addAll_($19);
  2428. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2429. $ctx1.sendIdx["addAll:"]=3;
  2430. //>>excludeEnd("ctx");
  2431. $21=$recv($16)._yourself();
  2432. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2433. $ctx1.sendIdx["yourself"]=3;
  2434. //>>excludeEnd("ctx");
  2435. $15=$21;
  2436. self._assert_equals_($15,$recv(self._collectionClass())._new());
  2437. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2438. $ctx1.sendIdx["assert:equals:"]=3;
  2439. //>>excludeEnd("ctx");
  2440. $23=self._collection();
  2441. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2442. $ctx1.sendIdx["collection"]=5;
  2443. //>>excludeEnd("ctx");
  2444. $24=$23;
  2445. $25=self._sampleNewValueAsCollection();
  2446. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2447. $ctx1.sendIdx["sampleNewValueAsCollection"]=1;
  2448. //>>excludeEnd("ctx");
  2449. $recv($24)._addAll_($25);
  2450. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2451. $ctx1.sendIdx["addAll:"]=4;
  2452. //>>excludeEnd("ctx");
  2453. $26=$recv($23)._yourself();
  2454. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2455. $ctx1.sendIdx["yourself"]=4;
  2456. //>>excludeEnd("ctx");
  2457. $22=$26;
  2458. $27=self._collectionWithNewValue();
  2459. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2460. $ctx1.sendIdx["collectionWithNewValue"]=1;
  2461. //>>excludeEnd("ctx");
  2462. self._assert_equals_($22,$27);
  2463. $28=self._sampleNewValueAsCollection();
  2464. $recv($28)._addAll_(self._collection());
  2465. $29=$recv($28)._yourself();
  2466. self._assertSameContents_as_($29,self._collectionWithNewValue());
  2467. return self;
  2468. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2469. }, function($ctx1) {$ctx1.fill(self,"testAddAll",{},$globals.CollectionTest)});
  2470. //>>excludeEnd("ctx");
  2471. },
  2472. //>>excludeStart("ide", pragmas.excludeIdeData);
  2473. args: [],
  2474. source: "testAddAll\x0a\x09self assert: (self collection addAll: self collectionClass new; yourself) equals: self collection.\x0a\x09self assert: (self collectionClass new addAll: self collection; yourself) equals: self collection.\x0a\x09self assert: (self collectionClass new addAll: self collectionClass new; yourself) equals: self collectionClass new.\x0a\x09self assert: (self collection addAll: self sampleNewValueAsCollection; yourself) equals: self collectionWithNewValue.\x0a\x09self assertSameContents: (self sampleNewValueAsCollection addAll: self collection; yourself) as: self collectionWithNewValue",
  2475. referencedClasses: [],
  2476. //>>excludeEnd("ide");
  2477. messageSends: ["assert:equals:", "addAll:", "collection", "new", "collectionClass", "yourself", "sampleNewValueAsCollection", "collectionWithNewValue", "assertSameContents:as:"]
  2478. }),
  2479. $globals.CollectionTest);
  2480. $core.addMethod(
  2481. $core.method({
  2482. selector: "testAllSatisfy",
  2483. protocol: 'tests',
  2484. fn: function (){
  2485. var self=this;
  2486. var collection,anyOne;
  2487. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2488. return $core.withContext(function($ctx1) {
  2489. //>>excludeEnd("ctx");
  2490. var $1;
  2491. collection=self._collection();
  2492. anyOne=$recv(collection)._anyOne();
  2493. $1=$recv(collection)._allSatisfy_((function(each){
  2494. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2495. return $core.withContext(function($ctx2) {
  2496. //>>excludeEnd("ctx");
  2497. return $recv(collection)._includes_(each);
  2498. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2499. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2500. //>>excludeEnd("ctx");
  2501. }));
  2502. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2503. $ctx1.sendIdx["allSatisfy:"]=1;
  2504. //>>excludeEnd("ctx");
  2505. self._assert_($1);
  2506. self._deny_($recv(collection)._allSatisfy_((function(each){
  2507. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2508. return $core.withContext(function($ctx2) {
  2509. //>>excludeEnd("ctx");
  2510. return $recv(each).__tild_eq(anyOne);
  2511. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2512. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
  2513. //>>excludeEnd("ctx");
  2514. })));
  2515. return self;
  2516. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2517. }, function($ctx1) {$ctx1.fill(self,"testAllSatisfy",{collection:collection,anyOne:anyOne},$globals.CollectionTest)});
  2518. //>>excludeEnd("ctx");
  2519. },
  2520. //>>excludeStart("ide", pragmas.excludeIdeData);
  2521. args: [],
  2522. source: "testAllSatisfy\x0a\x09| collection anyOne |\x0a\x09collection := self collection.\x0a\x09anyOne := collection anyOne.\x0a\x09self assert: (collection allSatisfy: [ :each | collection includes: each ]).\x0a\x09self deny: (collection allSatisfy: [ :each | each ~= anyOne ])",
  2523. referencedClasses: [],
  2524. //>>excludeEnd("ide");
  2525. messageSends: ["collection", "anyOne", "assert:", "allSatisfy:", "includes:", "deny:", "~="]
  2526. }),
  2527. $globals.CollectionTest);
  2528. $core.addMethod(
  2529. $core.method({
  2530. selector: "testAnyOne",
  2531. protocol: 'tests',
  2532. fn: function (){
  2533. var self=this;
  2534. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  2535. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2536. return $core.withContext(function($ctx1) {
  2537. //>>excludeEnd("ctx");
  2538. var $2,$1;
  2539. self._should_raise_((function(){
  2540. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2541. return $core.withContext(function($ctx2) {
  2542. //>>excludeEnd("ctx");
  2543. return $recv($recv(self._collectionClass())._new())._anyOne();
  2544. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2545. $ctx2.sendIdx["anyOne"]=1;
  2546. //>>excludeEnd("ctx");
  2547. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2548. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  2549. //>>excludeEnd("ctx");
  2550. }),$Error());
  2551. $2=self._collection();
  2552. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2553. $ctx1.sendIdx["collection"]=1;
  2554. //>>excludeEnd("ctx");
  2555. $1=$recv($2)._includes_($recv(self._collection())._anyOne());
  2556. self._assert_($1);
  2557. return self;
  2558. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2559. }, function($ctx1) {$ctx1.fill(self,"testAnyOne",{},$globals.CollectionTest)});
  2560. //>>excludeEnd("ctx");
  2561. },
  2562. //>>excludeStart("ide", pragmas.excludeIdeData);
  2563. args: [],
  2564. source: "testAnyOne\x0a\x09self should: [ self collectionClass new anyOne ] raise: Error.\x0a\x09self assert: (self collection includes: self collection anyOne)",
  2565. referencedClasses: ["Error"],
  2566. //>>excludeEnd("ide");
  2567. messageSends: ["should:raise:", "anyOne", "new", "collectionClass", "assert:", "includes:", "collection"]
  2568. }),
  2569. $globals.CollectionTest);
  2570. $core.addMethod(
  2571. $core.method({
  2572. selector: "testAnySatisfy",
  2573. protocol: 'tests',
  2574. fn: function (){
  2575. var self=this;
  2576. var anyOne;
  2577. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  2578. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2579. return $core.withContext(function($ctx1) {
  2580. //>>excludeEnd("ctx");
  2581. var $1,$3,$2;
  2582. $1=self._collection();
  2583. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2584. $ctx1.sendIdx["collection"]=1;
  2585. //>>excludeEnd("ctx");
  2586. anyOne=$recv($1)._anyOne();
  2587. $3=self._collection();
  2588. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2589. $ctx1.sendIdx["collection"]=2;
  2590. //>>excludeEnd("ctx");
  2591. $2=$recv($3)._anySatisfy_((function(each){
  2592. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2593. return $core.withContext(function($ctx2) {
  2594. //>>excludeEnd("ctx");
  2595. return $recv(each).__eq(anyOne);
  2596. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2597. $ctx2.sendIdx["="]=1;
  2598. //>>excludeEnd("ctx");
  2599. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2600. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2601. //>>excludeEnd("ctx");
  2602. }));
  2603. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2604. $ctx1.sendIdx["anySatisfy:"]=1;
  2605. //>>excludeEnd("ctx");
  2606. self._assert_($2);
  2607. self._deny_($recv(self._collection())._anySatisfy_((function(each){
  2608. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2609. return $core.withContext(function($ctx2) {
  2610. //>>excludeEnd("ctx");
  2611. return $recv(each).__eq($recv($Object())._new());
  2612. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2613. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
  2614. //>>excludeEnd("ctx");
  2615. })));
  2616. return self;
  2617. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2618. }, function($ctx1) {$ctx1.fill(self,"testAnySatisfy",{anyOne:anyOne},$globals.CollectionTest)});
  2619. //>>excludeEnd("ctx");
  2620. },
  2621. //>>excludeStart("ide", pragmas.excludeIdeData);
  2622. args: [],
  2623. source: "testAnySatisfy\x0a\x09| anyOne |\x0a\x09anyOne := self collection anyOne.\x0a\x09self assert: (self collection anySatisfy: [ :each | each = anyOne ]).\x0a\x09self deny: (self collection anySatisfy: [ :each | each = Object new ])",
  2624. referencedClasses: ["Object"],
  2625. //>>excludeEnd("ide");
  2626. messageSends: ["anyOne", "collection", "assert:", "anySatisfy:", "=", "deny:", "new"]
  2627. }),
  2628. $globals.CollectionTest);
  2629. $core.addMethod(
  2630. $core.method({
  2631. selector: "testAsArray",
  2632. protocol: 'tests',
  2633. fn: function (){
  2634. var self=this;
  2635. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2636. return $core.withContext(function($ctx1) {
  2637. //>>excludeEnd("ctx");
  2638. var $1;
  2639. $1=self._collection();
  2640. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2641. $ctx1.sendIdx["collection"]=1;
  2642. //>>excludeEnd("ctx");
  2643. self._assertSameContents_as_($1,$recv(self._collection())._asArray());
  2644. return self;
  2645. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2646. }, function($ctx1) {$ctx1.fill(self,"testAsArray",{},$globals.CollectionTest)});
  2647. //>>excludeEnd("ctx");
  2648. },
  2649. //>>excludeStart("ide", pragmas.excludeIdeData);
  2650. args: [],
  2651. source: "testAsArray\x0a\x09self\x0a\x09\x09assertSameContents: self collection\x0a\x09\x09as: self collection asArray",
  2652. referencedClasses: [],
  2653. //>>excludeEnd("ide");
  2654. messageSends: ["assertSameContents:as:", "collection", "asArray"]
  2655. }),
  2656. $globals.CollectionTest);
  2657. $core.addMethod(
  2658. $core.method({
  2659. selector: "testAsOrderedCollection",
  2660. protocol: 'tests',
  2661. fn: function (){
  2662. var self=this;
  2663. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2664. return $core.withContext(function($ctx1) {
  2665. //>>excludeEnd("ctx");
  2666. var $1;
  2667. $1=self._collection();
  2668. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2669. $ctx1.sendIdx["collection"]=1;
  2670. //>>excludeEnd("ctx");
  2671. self._assertSameContents_as_($1,$recv(self._collection())._asOrderedCollection());
  2672. return self;
  2673. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2674. }, function($ctx1) {$ctx1.fill(self,"testAsOrderedCollection",{},$globals.CollectionTest)});
  2675. //>>excludeEnd("ctx");
  2676. },
  2677. //>>excludeStart("ide", pragmas.excludeIdeData);
  2678. args: [],
  2679. source: "testAsOrderedCollection\x0a\x09self\x0a\x09\x09assertSameContents: self collection\x0a\x09\x09as: self collection asOrderedCollection",
  2680. referencedClasses: [],
  2681. //>>excludeEnd("ide");
  2682. messageSends: ["assertSameContents:as:", "collection", "asOrderedCollection"]
  2683. }),
  2684. $globals.CollectionTest);
  2685. $core.addMethod(
  2686. $core.method({
  2687. selector: "testAsSet",
  2688. protocol: 'tests',
  2689. fn: function (){
  2690. var self=this;
  2691. var c,set;
  2692. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2693. return $core.withContext(function($ctx1) {
  2694. //>>excludeEnd("ctx");
  2695. c=self._collectionWithDuplicates();
  2696. set=$recv(c)._asSet();
  2697. self._assert_equals_($recv(set)._size(),(5));
  2698. $recv(c)._do_((function(each){
  2699. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2700. return $core.withContext(function($ctx2) {
  2701. //>>excludeEnd("ctx");
  2702. return self._assert_($recv(set)._includes_(each));
  2703. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2704. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2705. //>>excludeEnd("ctx");
  2706. }));
  2707. return self;
  2708. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2709. }, function($ctx1) {$ctx1.fill(self,"testAsSet",{c:c,set:set},$globals.CollectionTest)});
  2710. //>>excludeEnd("ctx");
  2711. },
  2712. //>>excludeStart("ide", pragmas.excludeIdeData);
  2713. args: [],
  2714. source: "testAsSet\x0a\x09| c set |\x0a\x09c := self collectionWithDuplicates.\x0a\x09set := c asSet.\x0a\x09self assert: set size equals: 5.\x0a\x09c do: [ :each |\x0a\x09\x09self assert: (set includes: each) ]",
  2715. referencedClasses: [],
  2716. //>>excludeEnd("ide");
  2717. messageSends: ["collectionWithDuplicates", "asSet", "assert:equals:", "size", "do:", "assert:", "includes:"]
  2718. }),
  2719. $globals.CollectionTest);
  2720. $core.addMethod(
  2721. $core.method({
  2722. selector: "testCollect",
  2723. protocol: 'tests',
  2724. fn: function (){
  2725. var self=this;
  2726. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2727. return $core.withContext(function($ctx1) {
  2728. //>>excludeEnd("ctx");
  2729. var $2,$1,$3,$5,$4,$8,$7,$6,$11,$10,$9;
  2730. $2=self._collection();
  2731. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2732. $ctx1.sendIdx["collection"]=1;
  2733. //>>excludeEnd("ctx");
  2734. $1=$recv($2)._collect_((function(each){
  2735. return each;
  2736. }));
  2737. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2738. $ctx1.sendIdx["collect:"]=1;
  2739. //>>excludeEnd("ctx");
  2740. $3=self._collection();
  2741. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2742. $ctx1.sendIdx["collection"]=2;
  2743. //>>excludeEnd("ctx");
  2744. self._assert_equals_($1,$3);
  2745. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2746. $ctx1.sendIdx["assert:equals:"]=1;
  2747. //>>excludeEnd("ctx");
  2748. $5=self._collectionWithNewValue();
  2749. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2750. $ctx1.sendIdx["collectionWithNewValue"]=1;
  2751. //>>excludeEnd("ctx");
  2752. $4=$recv($5)._collect_((function(each){
  2753. return each;
  2754. }));
  2755. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2756. $ctx1.sendIdx["collect:"]=2;
  2757. //>>excludeEnd("ctx");
  2758. self._assert_equals_($4,self._collectionWithNewValue());
  2759. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2760. $ctx1.sendIdx["assert:equals:"]=2;
  2761. //>>excludeEnd("ctx");
  2762. $8=self._collectionClass();
  2763. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2764. $ctx1.sendIdx["collectionClass"]=1;
  2765. //>>excludeEnd("ctx");
  2766. $7=$recv($8)._new();
  2767. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2768. $ctx1.sendIdx["new"]=1;
  2769. //>>excludeEnd("ctx");
  2770. $6=$recv($7)._collect_((function(each){
  2771. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2772. return $core.withContext(function($ctx2) {
  2773. //>>excludeEnd("ctx");
  2774. return $recv(each)._printString();
  2775. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2776. $ctx2.sendIdx["printString"]=1;
  2777. //>>excludeEnd("ctx");
  2778. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2779. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,3)});
  2780. //>>excludeEnd("ctx");
  2781. }));
  2782. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2783. $ctx1.sendIdx["collect:"]=3;
  2784. //>>excludeEnd("ctx");
  2785. self._assert_equals_($6,$recv(self._collectionClass())._new());
  2786. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2787. $ctx1.sendIdx["assert:equals:"]=3;
  2788. //>>excludeEnd("ctx");
  2789. $11=self._collection();
  2790. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2791. $ctx1.sendIdx["collection"]=3;
  2792. //>>excludeEnd("ctx");
  2793. $10=$recv($11)._collect_((function(){
  2794. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2795. return $core.withContext(function($ctx2) {
  2796. //>>excludeEnd("ctx");
  2797. return self._sampleNewValue();
  2798. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2799. $ctx2.sendIdx["sampleNewValue"]=1;
  2800. //>>excludeEnd("ctx");
  2801. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2802. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,4)});
  2803. //>>excludeEnd("ctx");
  2804. }));
  2805. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2806. $ctx1.sendIdx["collect:"]=4;
  2807. //>>excludeEnd("ctx");
  2808. $9=$recv($10)._detect_((function(){
  2809. return true;
  2810. }));
  2811. self._assert_equals_($9,self._sampleNewValue());
  2812. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2813. $ctx1.sendIdx["assert:equals:"]=4;
  2814. //>>excludeEnd("ctx");
  2815. self._assert_equals_($recv(self._collection())._collect_((function(each){
  2816. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2817. return $core.withContext(function($ctx2) {
  2818. //>>excludeEnd("ctx");
  2819. return $recv(each)._printString();
  2820. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2821. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,6)});
  2822. //>>excludeEnd("ctx");
  2823. })),self._collectionOfPrintStrings());
  2824. return self;
  2825. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2826. }, function($ctx1) {$ctx1.fill(self,"testCollect",{},$globals.CollectionTest)});
  2827. //>>excludeEnd("ctx");
  2828. },
  2829. //>>excludeStart("ide", pragmas.excludeIdeData);
  2830. args: [],
  2831. source: "testCollect\x0a\x09self assert: (self collection collect: [ :each | each ]) equals: self collection.\x0a\x09self assert: (self collectionWithNewValue collect: [ :each | each ]) equals: self collectionWithNewValue.\x0a\x09self assert: (self collectionClass new collect: [ :each | each printString ]) equals: self collectionClass new.\x0a\x09self assert: ((self collection collect: [ self sampleNewValue ]) detect: [ true ]) equals: self sampleNewValue.\x0a\x09self assert: (self collection collect: [ :each | each printString ]) equals: self collectionOfPrintStrings",
  2832. referencedClasses: [],
  2833. //>>excludeEnd("ide");
  2834. messageSends: ["assert:equals:", "collect:", "collection", "collectionWithNewValue", "new", "collectionClass", "printString", "detect:", "sampleNewValue", "collectionOfPrintStrings"]
  2835. }),
  2836. $globals.CollectionTest);
  2837. $core.addMethod(
  2838. $core.method({
  2839. selector: "testComma",
  2840. protocol: 'tests',
  2841. fn: function (){
  2842. var self=this;
  2843. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2844. return $core.withContext(function($ctx1) {
  2845. //>>excludeEnd("ctx");
  2846. var $2,$4,$3,$1,$5,$8,$7,$9,$6,$10,$13,$12,$15,$14,$11,$17,$18,$16,$19;
  2847. $2=self._collection();
  2848. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2849. $ctx1.sendIdx["collection"]=1;
  2850. //>>excludeEnd("ctx");
  2851. $4=self._collectionClass();
  2852. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2853. $ctx1.sendIdx["collectionClass"]=1;
  2854. //>>excludeEnd("ctx");
  2855. $3=$recv($4)._new();
  2856. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2857. $ctx1.sendIdx["new"]=1;
  2858. //>>excludeEnd("ctx");
  2859. $1=$recv($2).__comma($3);
  2860. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2861. $ctx1.sendIdx[","]=1;
  2862. //>>excludeEnd("ctx");
  2863. $5=self._collection();
  2864. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2865. $ctx1.sendIdx["collection"]=2;
  2866. //>>excludeEnd("ctx");
  2867. self._assert_equals_($1,$5);
  2868. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2869. $ctx1.sendIdx["assert:equals:"]=1;
  2870. //>>excludeEnd("ctx");
  2871. $8=self._collectionClass();
  2872. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2873. $ctx1.sendIdx["collectionClass"]=2;
  2874. //>>excludeEnd("ctx");
  2875. $7=$recv($8)._new();
  2876. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2877. $ctx1.sendIdx["new"]=2;
  2878. //>>excludeEnd("ctx");
  2879. $9=self._collection();
  2880. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2881. $ctx1.sendIdx["collection"]=3;
  2882. //>>excludeEnd("ctx");
  2883. $6=$recv($7).__comma($9);
  2884. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2885. $ctx1.sendIdx[","]=2;
  2886. //>>excludeEnd("ctx");
  2887. $10=self._collection();
  2888. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2889. $ctx1.sendIdx["collection"]=4;
  2890. //>>excludeEnd("ctx");
  2891. self._assert_equals_($6,$10);
  2892. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2893. $ctx1.sendIdx["assert:equals:"]=2;
  2894. //>>excludeEnd("ctx");
  2895. $13=self._collectionClass();
  2896. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2897. $ctx1.sendIdx["collectionClass"]=3;
  2898. //>>excludeEnd("ctx");
  2899. $12=$recv($13)._new();
  2900. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2901. $ctx1.sendIdx["new"]=3;
  2902. //>>excludeEnd("ctx");
  2903. $15=self._collectionClass();
  2904. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2905. $ctx1.sendIdx["collectionClass"]=4;
  2906. //>>excludeEnd("ctx");
  2907. $14=$recv($15)._new();
  2908. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2909. $ctx1.sendIdx["new"]=4;
  2910. //>>excludeEnd("ctx");
  2911. $11=$recv($12).__comma($14);
  2912. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2913. $ctx1.sendIdx[","]=3;
  2914. //>>excludeEnd("ctx");
  2915. self._assert_equals_($11,$recv(self._collectionClass())._new());
  2916. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2917. $ctx1.sendIdx["assert:equals:"]=3;
  2918. //>>excludeEnd("ctx");
  2919. $17=self._collection();
  2920. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2921. $ctx1.sendIdx["collection"]=5;
  2922. //>>excludeEnd("ctx");
  2923. $18=self._sampleNewValueAsCollection();
  2924. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2925. $ctx1.sendIdx["sampleNewValueAsCollection"]=1;
  2926. //>>excludeEnd("ctx");
  2927. $16=$recv($17).__comma($18);
  2928. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2929. $ctx1.sendIdx[","]=4;
  2930. //>>excludeEnd("ctx");
  2931. $19=self._collectionWithNewValue();
  2932. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2933. $ctx1.sendIdx["collectionWithNewValue"]=1;
  2934. //>>excludeEnd("ctx");
  2935. self._assert_equals_($16,$19);
  2936. self._assertSameContents_as_($recv(self._sampleNewValueAsCollection()).__comma(self._collection()),self._collectionWithNewValue());
  2937. return self;
  2938. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2939. }, function($ctx1) {$ctx1.fill(self,"testComma",{},$globals.CollectionTest)});
  2940. //>>excludeEnd("ctx");
  2941. },
  2942. //>>excludeStart("ide", pragmas.excludeIdeData);
  2943. args: [],
  2944. source: "testComma\x0a\x09self assert: self collection, self collectionClass new equals: self collection.\x0a\x09self assert: self collectionClass new, self collection equals: self collection.\x0a\x09self assert: self collectionClass new, self collectionClass new equals: self collectionClass new.\x0a\x09self assert: self collection, self sampleNewValueAsCollection equals: self collectionWithNewValue.\x0a\x09self assertSameContents: self sampleNewValueAsCollection, self collection as: self collectionWithNewValue",
  2945. referencedClasses: [],
  2946. //>>excludeEnd("ide");
  2947. messageSends: ["assert:equals:", ",", "collection", "new", "collectionClass", "sampleNewValueAsCollection", "collectionWithNewValue", "assertSameContents:as:"]
  2948. }),
  2949. $globals.CollectionTest);
  2950. $core.addMethod(
  2951. $core.method({
  2952. selector: "testDetect",
  2953. protocol: 'tests',
  2954. fn: function (){
  2955. var self=this;
  2956. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  2957. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2958. return $core.withContext(function($ctx1) {
  2959. //>>excludeEnd("ctx");
  2960. var $1,$2,$3,$4,$6,$5,$7;
  2961. self._shouldnt_raise_((function(){
  2962. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2963. return $core.withContext(function($ctx2) {
  2964. //>>excludeEnd("ctx");
  2965. $1=self._collection();
  2966. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2967. $ctx2.sendIdx["collection"]=1;
  2968. //>>excludeEnd("ctx");
  2969. return $recv($1)._detect_((function(){
  2970. return true;
  2971. }));
  2972. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2973. $ctx2.sendIdx["detect:"]=1;
  2974. //>>excludeEnd("ctx");
  2975. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2976. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  2977. //>>excludeEnd("ctx");
  2978. }),$Error());
  2979. self._should_raise_((function(){
  2980. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2981. return $core.withContext(function($ctx2) {
  2982. //>>excludeEnd("ctx");
  2983. $2=self._collection();
  2984. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2985. $ctx2.sendIdx["collection"]=2;
  2986. //>>excludeEnd("ctx");
  2987. return $recv($2)._detect_((function(){
  2988. return false;
  2989. }));
  2990. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2991. $ctx2.sendIdx["detect:"]=2;
  2992. //>>excludeEnd("ctx");
  2993. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2994. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  2995. //>>excludeEnd("ctx");
  2996. }),$Error());
  2997. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2998. $ctx1.sendIdx["should:raise:"]=1;
  2999. //>>excludeEnd("ctx");
  3000. $3=$recv(self._sampleNewValueAsCollection())._detect_((function(){
  3001. return true;
  3002. }));
  3003. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3004. $ctx1.sendIdx["detect:"]=3;
  3005. //>>excludeEnd("ctx");
  3006. $4=self._sampleNewValue();
  3007. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3008. $ctx1.sendIdx["sampleNewValue"]=1;
  3009. //>>excludeEnd("ctx");
  3010. self._assert_equals_($3,$4);
  3011. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3012. $ctx1.sendIdx["assert:equals:"]=1;
  3013. //>>excludeEnd("ctx");
  3014. $5=$recv(self._collectionWithNewValue())._detect_((function(each){
  3015. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3016. return $core.withContext(function($ctx2) {
  3017. //>>excludeEnd("ctx");
  3018. $6=self._sampleNewValue();
  3019. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3020. $ctx2.sendIdx["sampleNewValue"]=2;
  3021. //>>excludeEnd("ctx");
  3022. return $recv(each).__eq($6);
  3023. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3024. $ctx2.sendIdx["="]=1;
  3025. //>>excludeEnd("ctx");
  3026. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3027. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,6)});
  3028. //>>excludeEnd("ctx");
  3029. }));
  3030. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3031. $ctx1.sendIdx["detect:"]=4;
  3032. //>>excludeEnd("ctx");
  3033. $7=self._sampleNewValue();
  3034. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3035. $ctx1.sendIdx["sampleNewValue"]=3;
  3036. //>>excludeEnd("ctx");
  3037. self._assert_equals_($5,$7);
  3038. self._should_raise_((function(){
  3039. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3040. return $core.withContext(function($ctx2) {
  3041. //>>excludeEnd("ctx");
  3042. return $recv(self._collection())._detect_((function(each){
  3043. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3044. return $core.withContext(function($ctx3) {
  3045. //>>excludeEnd("ctx");
  3046. return $recv(each).__eq(self._sampleNewValue());
  3047. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3048. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,8)});
  3049. //>>excludeEnd("ctx");
  3050. }));
  3051. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3052. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,7)});
  3053. //>>excludeEnd("ctx");
  3054. }),$Error());
  3055. return self;
  3056. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3057. }, function($ctx1) {$ctx1.fill(self,"testDetect",{},$globals.CollectionTest)});
  3058. //>>excludeEnd("ctx");
  3059. },
  3060. //>>excludeStart("ide", pragmas.excludeIdeData);
  3061. args: [],
  3062. source: "testDetect\x0a\x09self\x0a\x09\x09shouldnt: [ self collection detect: [ true ] ]\x0a\x09\x09raise: Error.\x0a\x09self\x0a\x09\x09should: [ self collection detect: [ false ] ]\x0a\x09\x09raise: Error.\x0a\x09self assert: (self sampleNewValueAsCollection detect: [ true ]) equals: self sampleNewValue.\x0a\x09self assert: (self collectionWithNewValue detect: [ :each | each = self sampleNewValue ]) equals: self sampleNewValue.\x0a\x09self\x0a\x09\x09should: [ self collection detect: [ :each | each = self sampleNewValue ] ]\x0a\x09\x09raise: Error",
  3063. referencedClasses: ["Error"],
  3064. //>>excludeEnd("ide");
  3065. messageSends: ["shouldnt:raise:", "detect:", "collection", "should:raise:", "assert:equals:", "sampleNewValueAsCollection", "sampleNewValue", "collectionWithNewValue", "="]
  3066. }),
  3067. $globals.CollectionTest);
  3068. $core.addMethod(
  3069. $core.method({
  3070. selector: "testDetectIfNone",
  3071. protocol: 'tests',
  3072. fn: function (){
  3073. var self=this;
  3074. var sentinel;
  3075. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  3076. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3077. return $core.withContext(function($ctx1) {
  3078. //>>excludeEnd("ctx");
  3079. var $3,$2,$1,$5,$4,$6,$7,$9,$8,$10;
  3080. sentinel=$recv($Object())._new();
  3081. $3=self._collection();
  3082. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3083. $ctx1.sendIdx["collection"]=1;
  3084. //>>excludeEnd("ctx");
  3085. $2=$recv($3)._detect_ifNone_((function(){
  3086. return true;
  3087. }),(function(){
  3088. return sentinel;
  3089. }));
  3090. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3091. $ctx1.sendIdx["detect:ifNone:"]=1;
  3092. //>>excludeEnd("ctx");
  3093. $1=$recv($2).__tild_eq(sentinel);
  3094. self._assert_($1);
  3095. $5=self._collection();
  3096. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3097. $ctx1.sendIdx["collection"]=2;
  3098. //>>excludeEnd("ctx");
  3099. $4=$recv($5)._detect_ifNone_((function(){
  3100. return false;
  3101. }),(function(){
  3102. return sentinel;
  3103. }));
  3104. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3105. $ctx1.sendIdx["detect:ifNone:"]=2;
  3106. //>>excludeEnd("ctx");
  3107. self._assert_equals_($4,sentinel);
  3108. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3109. $ctx1.sendIdx["assert:equals:"]=1;
  3110. //>>excludeEnd("ctx");
  3111. $6=$recv(self._sampleNewValueAsCollection())._detect_ifNone_((function(){
  3112. return true;
  3113. }),(function(){
  3114. return sentinel;
  3115. }));
  3116. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3117. $ctx1.sendIdx["detect:ifNone:"]=3;
  3118. //>>excludeEnd("ctx");
  3119. $7=self._sampleNewValue();
  3120. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3121. $ctx1.sendIdx["sampleNewValue"]=1;
  3122. //>>excludeEnd("ctx");
  3123. self._assert_equals_($6,$7);
  3124. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3125. $ctx1.sendIdx["assert:equals:"]=2;
  3126. //>>excludeEnd("ctx");
  3127. $8=$recv(self._collectionWithNewValue())._detect_ifNone_((function(each){
  3128. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3129. return $core.withContext(function($ctx2) {
  3130. //>>excludeEnd("ctx");
  3131. $9=self._sampleNewValue();
  3132. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3133. $ctx2.sendIdx["sampleNewValue"]=2;
  3134. //>>excludeEnd("ctx");
  3135. return $recv(each).__eq($9);
  3136. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3137. $ctx2.sendIdx["="]=1;
  3138. //>>excludeEnd("ctx");
  3139. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3140. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,7)});
  3141. //>>excludeEnd("ctx");
  3142. }),(function(){
  3143. return sentinel;
  3144. }));
  3145. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3146. $ctx1.sendIdx["detect:ifNone:"]=4;
  3147. //>>excludeEnd("ctx");
  3148. $10=self._sampleNewValue();
  3149. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3150. $ctx1.sendIdx["sampleNewValue"]=3;
  3151. //>>excludeEnd("ctx");
  3152. self._assert_equals_($8,$10);
  3153. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3154. $ctx1.sendIdx["assert:equals:"]=3;
  3155. //>>excludeEnd("ctx");
  3156. self._assert_equals_($recv(self._collection())._detect_ifNone_((function(each){
  3157. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3158. return $core.withContext(function($ctx2) {
  3159. //>>excludeEnd("ctx");
  3160. return $recv(each).__eq(self._sampleNewValue());
  3161. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3162. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,9)});
  3163. //>>excludeEnd("ctx");
  3164. }),(function(){
  3165. return sentinel;
  3166. })),sentinel);
  3167. return self;
  3168. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3169. }, function($ctx1) {$ctx1.fill(self,"testDetectIfNone",{sentinel:sentinel},$globals.CollectionTest)});
  3170. //>>excludeEnd("ctx");
  3171. },
  3172. //>>excludeStart("ide", pragmas.excludeIdeData);
  3173. args: [],
  3174. source: "testDetectIfNone\x0a\x09| sentinel |\x0a\x09sentinel := Object new.\x0a\x09self assert: (self collection detect: [ true ] ifNone: [ sentinel ]) ~= sentinel.\x0a\x09self assert: (self collection detect: [ false ] ifNone: [ sentinel ]) equals: sentinel.\x0a\x09self assert: (self sampleNewValueAsCollection detect: [ true ] ifNone: [ sentinel ]) equals: self sampleNewValue.\x0a\x09self assert: (self collectionWithNewValue detect: [ :each | each = self sampleNewValue ] ifNone: [ sentinel ]) equals: self sampleNewValue.\x0a\x09self assert: (self collection detect: [ :each | each = self sampleNewValue ] ifNone: [ sentinel ]) equals: sentinel",
  3175. referencedClasses: ["Object"],
  3176. //>>excludeEnd("ide");
  3177. messageSends: ["new", "assert:", "~=", "detect:ifNone:", "collection", "assert:equals:", "sampleNewValueAsCollection", "sampleNewValue", "collectionWithNewValue", "="]
  3178. }),
  3179. $globals.CollectionTest);
  3180. $core.addMethod(
  3181. $core.method({
  3182. selector: "testDo",
  3183. protocol: 'tests',
  3184. fn: function (){
  3185. var self=this;
  3186. var newCollection;
  3187. function $OrderedCollection(){return $globals.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  3188. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3189. return $core.withContext(function($ctx1) {
  3190. //>>excludeEnd("ctx");
  3191. var $1,$2;
  3192. newCollection=$recv($OrderedCollection())._new();
  3193. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3194. $ctx1.sendIdx["new"]=1;
  3195. //>>excludeEnd("ctx");
  3196. $1=self._collection();
  3197. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3198. $ctx1.sendIdx["collection"]=1;
  3199. //>>excludeEnd("ctx");
  3200. $recv($1)._do_((function(each){
  3201. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3202. return $core.withContext(function($ctx2) {
  3203. //>>excludeEnd("ctx");
  3204. return $recv(newCollection)._add_(each);
  3205. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3206. $ctx2.sendIdx["add:"]=1;
  3207. //>>excludeEnd("ctx");
  3208. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3209. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  3210. //>>excludeEnd("ctx");
  3211. }));
  3212. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3213. $ctx1.sendIdx["do:"]=1;
  3214. //>>excludeEnd("ctx");
  3215. self._assertSameContents_as_(self._collection(),newCollection);
  3216. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3217. $ctx1.sendIdx["assertSameContents:as:"]=1;
  3218. //>>excludeEnd("ctx");
  3219. newCollection=$recv($OrderedCollection())._new();
  3220. $2=self._collectionWithDuplicates();
  3221. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3222. $ctx1.sendIdx["collectionWithDuplicates"]=1;
  3223. //>>excludeEnd("ctx");
  3224. $recv($2)._do_((function(each){
  3225. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3226. return $core.withContext(function($ctx2) {
  3227. //>>excludeEnd("ctx");
  3228. return $recv(newCollection)._add_(each);
  3229. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3230. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
  3231. //>>excludeEnd("ctx");
  3232. }));
  3233. self._assertSameContents_as_(self._collectionWithDuplicates(),newCollection);
  3234. return self;
  3235. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3236. }, function($ctx1) {$ctx1.fill(self,"testDo",{newCollection:newCollection},$globals.CollectionTest)});
  3237. //>>excludeEnd("ctx");
  3238. },
  3239. //>>excludeStart("ide", pragmas.excludeIdeData);
  3240. args: [],
  3241. source: "testDo\x0a\x09| newCollection |\x0a\x09newCollection := OrderedCollection new.\x0a\x09self collection do: [ :each |\x0a\x09\x09newCollection add: each ].\x0a\x09self\x0a\x09\x09assertSameContents: self collection\x0a\x09\x09as: newCollection.\x0a\x09newCollection := OrderedCollection new.\x0a\x09self collectionWithDuplicates do: [ :each |\x0a\x09\x09newCollection add: each ].\x0a\x09self\x0a\x09\x09assertSameContents: self collectionWithDuplicates\x0a\x09\x09as: newCollection",
  3242. referencedClasses: ["OrderedCollection"],
  3243. //>>excludeEnd("ide");
  3244. messageSends: ["new", "do:", "collection", "add:", "assertSameContents:as:", "collectionWithDuplicates"]
  3245. }),
  3246. $globals.CollectionTest);
  3247. $core.addMethod(
  3248. $core.method({
  3249. selector: "testIfEmptyFamily",
  3250. protocol: 'tests',
  3251. fn: function (){
  3252. var self=this;
  3253. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3254. return $core.withContext(function($ctx1) {
  3255. //>>excludeEnd("ctx");
  3256. var $3,$2,$1,$5,$4,$6,$9,$8,$7,$11,$10,$13,$12,$15,$14,$16,$19,$18,$17,$21,$20,$23,$22,$24,$25,$27,$26,$29,$28;
  3257. $3=self._collectionClass();
  3258. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3259. $ctx1.sendIdx["collectionClass"]=1;
  3260. //>>excludeEnd("ctx");
  3261. $2=$recv($3)._new();
  3262. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3263. $ctx1.sendIdx["new"]=1;
  3264. //>>excludeEnd("ctx");
  3265. $1=$recv($2)._ifEmpty_((function(){
  3266. return (42);
  3267. }));
  3268. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3269. $ctx1.sendIdx["ifEmpty:"]=1;
  3270. //>>excludeEnd("ctx");
  3271. self._assert_equals_($1,(42));
  3272. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3273. $ctx1.sendIdx["assert:equals:"]=1;
  3274. //>>excludeEnd("ctx");
  3275. $5=self._collection();
  3276. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3277. $ctx1.sendIdx["collection"]=1;
  3278. //>>excludeEnd("ctx");
  3279. $4=$recv($5)._ifEmpty_((function(){
  3280. return (42);
  3281. }));
  3282. $6=self._collection();
  3283. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3284. $ctx1.sendIdx["collection"]=2;
  3285. //>>excludeEnd("ctx");
  3286. self._assert_equals_($4,$6);
  3287. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3288. $ctx1.sendIdx["assert:equals:"]=2;
  3289. //>>excludeEnd("ctx");
  3290. $9=self._collectionClass();
  3291. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3292. $ctx1.sendIdx["collectionClass"]=2;
  3293. //>>excludeEnd("ctx");
  3294. $8=$recv($9)._new();
  3295. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3296. $ctx1.sendIdx["new"]=2;
  3297. //>>excludeEnd("ctx");
  3298. $7=$recv($8)._ifNotEmpty_((function(){
  3299. return (42);
  3300. }));
  3301. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3302. $ctx1.sendIdx["ifNotEmpty:"]=1;
  3303. //>>excludeEnd("ctx");
  3304. $11=self._collectionClass();
  3305. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3306. $ctx1.sendIdx["collectionClass"]=3;
  3307. //>>excludeEnd("ctx");
  3308. $10=$recv($11)._new();
  3309. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3310. $ctx1.sendIdx["new"]=3;
  3311. //>>excludeEnd("ctx");
  3312. self._assert_equals_($7,$10);
  3313. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3314. $ctx1.sendIdx["assert:equals:"]=3;
  3315. //>>excludeEnd("ctx");
  3316. $13=self._collection();
  3317. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3318. $ctx1.sendIdx["collection"]=3;
  3319. //>>excludeEnd("ctx");
  3320. $12=$recv($13)._ifNotEmpty_((function(){
  3321. return (42);
  3322. }));
  3323. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3324. $ctx1.sendIdx["ifNotEmpty:"]=2;
  3325. //>>excludeEnd("ctx");
  3326. self._assert_equals_($12,(42));
  3327. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3328. $ctx1.sendIdx["assert:equals:"]=4;
  3329. //>>excludeEnd("ctx");
  3330. $15=self._collection();
  3331. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3332. $ctx1.sendIdx["collection"]=4;
  3333. //>>excludeEnd("ctx");
  3334. $14=$recv($15)._ifNotEmpty_((function(col){
  3335. return col;
  3336. }));
  3337. $16=self._collection();
  3338. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3339. $ctx1.sendIdx["collection"]=5;
  3340. //>>excludeEnd("ctx");
  3341. self._assert_equals_($14,$16);
  3342. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3343. $ctx1.sendIdx["assert:equals:"]=5;
  3344. //>>excludeEnd("ctx");
  3345. $19=self._collectionClass();
  3346. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3347. $ctx1.sendIdx["collectionClass"]=4;
  3348. //>>excludeEnd("ctx");
  3349. $18=$recv($19)._new();
  3350. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3351. $ctx1.sendIdx["new"]=4;
  3352. //>>excludeEnd("ctx");
  3353. $17=$recv($18)._ifEmpty_ifNotEmpty_((function(){
  3354. return (42);
  3355. }),(function(){
  3356. return (999);
  3357. }));
  3358. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3359. $ctx1.sendIdx["ifEmpty:ifNotEmpty:"]=1;
  3360. //>>excludeEnd("ctx");
  3361. self._assert_equals_($17,(42));
  3362. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3363. $ctx1.sendIdx["assert:equals:"]=6;
  3364. //>>excludeEnd("ctx");
  3365. $21=self._collection();
  3366. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3367. $ctx1.sendIdx["collection"]=6;
  3368. //>>excludeEnd("ctx");
  3369. $20=$recv($21)._ifEmpty_ifNotEmpty_((function(){
  3370. return (42);
  3371. }),(function(){
  3372. return (999);
  3373. }));
  3374. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3375. $ctx1.sendIdx["ifEmpty:ifNotEmpty:"]=2;
  3376. //>>excludeEnd("ctx");
  3377. self._assert_equals_($20,(999));
  3378. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3379. $ctx1.sendIdx["assert:equals:"]=7;
  3380. //>>excludeEnd("ctx");
  3381. $23=self._collection();
  3382. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3383. $ctx1.sendIdx["collection"]=7;
  3384. //>>excludeEnd("ctx");
  3385. $22=$recv($23)._ifEmpty_ifNotEmpty_((function(){
  3386. return (42);
  3387. }),(function(col){
  3388. return col;
  3389. }));
  3390. $24=self._collection();
  3391. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3392. $ctx1.sendIdx["collection"]=8;
  3393. //>>excludeEnd("ctx");
  3394. self._assert_equals_($22,$24);
  3395. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3396. $ctx1.sendIdx["assert:equals:"]=8;
  3397. //>>excludeEnd("ctx");
  3398. $25=$recv($recv(self._collectionClass())._new())._ifNotEmpty_ifEmpty_((function(){
  3399. return (42);
  3400. }),(function(){
  3401. return (999);
  3402. }));
  3403. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3404. $ctx1.sendIdx["ifNotEmpty:ifEmpty:"]=1;
  3405. //>>excludeEnd("ctx");
  3406. self._assert_equals_($25,(999));
  3407. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3408. $ctx1.sendIdx["assert:equals:"]=9;
  3409. //>>excludeEnd("ctx");
  3410. $27=self._collection();
  3411. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3412. $ctx1.sendIdx["collection"]=9;
  3413. //>>excludeEnd("ctx");
  3414. $26=$recv($27)._ifNotEmpty_ifEmpty_((function(){
  3415. return (42);
  3416. }),(function(){
  3417. return (999);
  3418. }));
  3419. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3420. $ctx1.sendIdx["ifNotEmpty:ifEmpty:"]=2;
  3421. //>>excludeEnd("ctx");
  3422. self._assert_equals_($26,(42));
  3423. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3424. $ctx1.sendIdx["assert:equals:"]=10;
  3425. //>>excludeEnd("ctx");
  3426. $29=self._collection();
  3427. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3428. $ctx1.sendIdx["collection"]=10;
  3429. //>>excludeEnd("ctx");
  3430. $28=$recv($29)._ifNotEmpty_ifEmpty_((function(col){
  3431. return col;
  3432. }),(function(){
  3433. return (999);
  3434. }));
  3435. self._assert_equals_($28,self._collection());
  3436. return self;
  3437. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3438. }, function($ctx1) {$ctx1.fill(self,"testIfEmptyFamily",{},$globals.CollectionTest)});
  3439. //>>excludeEnd("ctx");
  3440. },
  3441. //>>excludeStart("ide", pragmas.excludeIdeData);
  3442. args: [],
  3443. source: "testIfEmptyFamily\x0a\x09self assert: (self collectionClass new ifEmpty: [ 42 ]) equals: 42.\x0a\x09self assert: (self collection ifEmpty: [ 42 ]) equals: self collection.\x0a\x0a\x09self assert: (self collectionClass new ifNotEmpty: [ 42 ]) equals: self collectionClass new.\x0a\x09self assert: (self collection ifNotEmpty: [ 42 ]) equals: 42.\x0a\x09self assert: (self collection ifNotEmpty: [ :col | col ]) equals: self collection.\x0a\x09\x0a\x09self assert: (self collectionClass new ifEmpty: [ 42 ] ifNotEmpty: [ 999 ]) equals: 42.\x0a\x09self assert: (self collection ifEmpty: [ 42 ] ifNotEmpty: [ 999 ]) equals: 999.\x0a\x09self assert: (self collection ifEmpty: [ 42 ] ifNotEmpty: [ :col | col ]) equals: self collection.\x0a\x0a\x09self assert: (self collectionClass new ifNotEmpty: [ 42 ] ifEmpty: [ 999 ]) equals: 999.\x0a\x09self assert: (self collection ifNotEmpty: [ 42 ] ifEmpty: [ 999 ]) equals: 42.\x0a\x09self assert: (self collection ifNotEmpty: [ :col | col ] ifEmpty: [ 999 ]) equals: self collection.",
  3444. referencedClasses: [],
  3445. //>>excludeEnd("ide");
  3446. messageSends: ["assert:equals:", "ifEmpty:", "new", "collectionClass", "collection", "ifNotEmpty:", "ifEmpty:ifNotEmpty:", "ifNotEmpty:ifEmpty:"]
  3447. }),
  3448. $globals.CollectionTest);
  3449. $core.addMethod(
  3450. $core.method({
  3451. selector: "testIsEmpty",
  3452. protocol: 'tests',
  3453. fn: function (){
  3454. var self=this;
  3455. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3456. return $core.withContext(function($ctx1) {
  3457. //>>excludeEnd("ctx");
  3458. var $1;
  3459. $1=$recv($recv(self._collectionClass())._new())._isEmpty();
  3460. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3461. $ctx1.sendIdx["isEmpty"]=1;
  3462. //>>excludeEnd("ctx");
  3463. self._assert_($1);
  3464. self._deny_($recv(self._collection())._isEmpty());
  3465. return self;
  3466. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3467. }, function($ctx1) {$ctx1.fill(self,"testIsEmpty",{},$globals.CollectionTest)});
  3468. //>>excludeEnd("ctx");
  3469. },
  3470. //>>excludeStart("ide", pragmas.excludeIdeData);
  3471. args: [],
  3472. source: "testIsEmpty\x0a\x09self assert: self collectionClass new isEmpty.\x0a\x09self deny: self collection isEmpty",
  3473. referencedClasses: [],
  3474. //>>excludeEnd("ide");
  3475. messageSends: ["assert:", "isEmpty", "new", "collectionClass", "deny:", "collection"]
  3476. }),
  3477. $globals.CollectionTest);
  3478. $core.addMethod(
  3479. $core.method({
  3480. selector: "testNoneSatisfy",
  3481. protocol: 'tests',
  3482. fn: function (){
  3483. var self=this;
  3484. var anyOne;
  3485. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  3486. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3487. return $core.withContext(function($ctx1) {
  3488. //>>excludeEnd("ctx");
  3489. var $1,$3,$2;
  3490. $1=self._collection();
  3491. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3492. $ctx1.sendIdx["collection"]=1;
  3493. //>>excludeEnd("ctx");
  3494. anyOne=$recv($1)._anyOne();
  3495. $3=self._collection();
  3496. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3497. $ctx1.sendIdx["collection"]=2;
  3498. //>>excludeEnd("ctx");
  3499. $2=$recv($3)._noneSatisfy_((function(each){
  3500. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3501. return $core.withContext(function($ctx2) {
  3502. //>>excludeEnd("ctx");
  3503. return $recv(each).__eq(anyOne);
  3504. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3505. $ctx2.sendIdx["="]=1;
  3506. //>>excludeEnd("ctx");
  3507. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3508. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  3509. //>>excludeEnd("ctx");
  3510. }));
  3511. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3512. $ctx1.sendIdx["noneSatisfy:"]=1;
  3513. //>>excludeEnd("ctx");
  3514. self._deny_($2);
  3515. self._assert_($recv(self._collection())._noneSatisfy_((function(each){
  3516. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3517. return $core.withContext(function($ctx2) {
  3518. //>>excludeEnd("ctx");
  3519. return $recv(each).__eq($recv($Object())._new());
  3520. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3521. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
  3522. //>>excludeEnd("ctx");
  3523. })));
  3524. return self;
  3525. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3526. }, function($ctx1) {$ctx1.fill(self,"testNoneSatisfy",{anyOne:anyOne},$globals.CollectionTest)});
  3527. //>>excludeEnd("ctx");
  3528. },
  3529. //>>excludeStart("ide", pragmas.excludeIdeData);
  3530. args: [],
  3531. source: "testNoneSatisfy\x0a\x09| anyOne |\x0a\x09anyOne := self collection anyOne.\x0a\x09self deny: (self collection noneSatisfy: [ :each | each = anyOne ]).\x0a\x09self assert: (self collection noneSatisfy: [ :each | each = Object new ])",
  3532. referencedClasses: ["Object"],
  3533. //>>excludeEnd("ide");
  3534. messageSends: ["anyOne", "collection", "deny:", "noneSatisfy:", "=", "assert:", "new"]
  3535. }),
  3536. $globals.CollectionTest);
  3537. $core.addMethod(
  3538. $core.method({
  3539. selector: "testRemoveAll",
  3540. protocol: 'tests',
  3541. fn: function (){
  3542. var self=this;
  3543. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3544. return $core.withContext(function($ctx1) {
  3545. //>>excludeEnd("ctx");
  3546. var $1,$2;
  3547. $1=self._collection();
  3548. $recv($1)._removeAll();
  3549. $2=$recv($1)._yourself();
  3550. self._assert_equals_($2,$recv(self._collectionClass())._new());
  3551. return self;
  3552. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3553. }, function($ctx1) {$ctx1.fill(self,"testRemoveAll",{},$globals.CollectionTest)});
  3554. //>>excludeEnd("ctx");
  3555. },
  3556. //>>excludeStart("ide", pragmas.excludeIdeData);
  3557. args: [],
  3558. source: "testRemoveAll\x0a\x09self assert: (self collection removeAll; yourself) equals: self collectionClass new",
  3559. referencedClasses: [],
  3560. //>>excludeEnd("ide");
  3561. messageSends: ["assert:equals:", "removeAll", "collection", "yourself", "new", "collectionClass"]
  3562. }),
  3563. $globals.CollectionTest);
  3564. $core.addMethod(
  3565. $core.method({
  3566. selector: "testSelect",
  3567. protocol: 'tests',
  3568. fn: function (){
  3569. var self=this;
  3570. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3571. return $core.withContext(function($ctx1) {
  3572. //>>excludeEnd("ctx");
  3573. var $2,$1,$4,$3,$6,$5,$7,$9,$10,$8,$12,$13,$11,$14,$16,$17,$15;
  3574. $2=self._collection();
  3575. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3576. $ctx1.sendIdx["collection"]=1;
  3577. //>>excludeEnd("ctx");
  3578. $1=$recv($2)._select_((function(){
  3579. return false;
  3580. }));
  3581. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3582. $ctx1.sendIdx["select:"]=1;
  3583. //>>excludeEnd("ctx");
  3584. $4=self._collectionClass();
  3585. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3586. $ctx1.sendIdx["collectionClass"]=1;
  3587. //>>excludeEnd("ctx");
  3588. $3=$recv($4)._new();
  3589. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3590. $ctx1.sendIdx["new"]=1;
  3591. //>>excludeEnd("ctx");
  3592. self._assert_equals_($1,$3);
  3593. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3594. $ctx1.sendIdx["assert:equals:"]=1;
  3595. //>>excludeEnd("ctx");
  3596. $6=self._collection();
  3597. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3598. $ctx1.sendIdx["collection"]=2;
  3599. //>>excludeEnd("ctx");
  3600. $5=$recv($6)._select_((function(){
  3601. return true;
  3602. }));
  3603. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3604. $ctx1.sendIdx["select:"]=2;
  3605. //>>excludeEnd("ctx");
  3606. $7=self._collection();
  3607. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3608. $ctx1.sendIdx["collection"]=3;
  3609. //>>excludeEnd("ctx");
  3610. self._assert_equals_($5,$7);
  3611. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3612. $ctx1.sendIdx["assert:equals:"]=2;
  3613. //>>excludeEnd("ctx");
  3614. $9=self._collectionWithNewValue();
  3615. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3616. $ctx1.sendIdx["collectionWithNewValue"]=1;
  3617. //>>excludeEnd("ctx");
  3618. $8=$recv($9)._select_((function(each){
  3619. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3620. return $core.withContext(function($ctx2) {
  3621. //>>excludeEnd("ctx");
  3622. $10=self._sampleNewValue();
  3623. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3624. $ctx2.sendIdx["sampleNewValue"]=1;
  3625. //>>excludeEnd("ctx");
  3626. return $recv(each).__eq($10);
  3627. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3628. $ctx2.sendIdx["="]=1;
  3629. //>>excludeEnd("ctx");
  3630. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3631. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,3)});
  3632. //>>excludeEnd("ctx");
  3633. }));
  3634. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3635. $ctx1.sendIdx["select:"]=3;
  3636. //>>excludeEnd("ctx");
  3637. self._assert_equals_($8,self._sampleNewValueAsCollection());
  3638. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3639. $ctx1.sendIdx["assert:equals:"]=3;
  3640. //>>excludeEnd("ctx");
  3641. $12=self._collectionWithNewValue();
  3642. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3643. $ctx1.sendIdx["collectionWithNewValue"]=2;
  3644. //>>excludeEnd("ctx");
  3645. $11=$recv($12)._select_((function(each){
  3646. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3647. return $core.withContext(function($ctx2) {
  3648. //>>excludeEnd("ctx");
  3649. $13=self._sampleNewValue();
  3650. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3651. $ctx2.sendIdx["sampleNewValue"]=2;
  3652. //>>excludeEnd("ctx");
  3653. return $recv(each).__tild_eq($13);
  3654. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3655. $ctx2.sendIdx["~="]=1;
  3656. //>>excludeEnd("ctx");
  3657. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3658. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,4)});
  3659. //>>excludeEnd("ctx");
  3660. }));
  3661. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3662. $ctx1.sendIdx["select:"]=4;
  3663. //>>excludeEnd("ctx");
  3664. $14=self._collection();
  3665. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3666. $ctx1.sendIdx["collection"]=4;
  3667. //>>excludeEnd("ctx");
  3668. self._assert_equals_($11,$14);
  3669. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3670. $ctx1.sendIdx["assert:equals:"]=4;
  3671. //>>excludeEnd("ctx");
  3672. $16=self._collection();
  3673. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3674. $ctx1.sendIdx["collection"]=5;
  3675. //>>excludeEnd("ctx");
  3676. $15=$recv($16)._select_((function(each){
  3677. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3678. return $core.withContext(function($ctx2) {
  3679. //>>excludeEnd("ctx");
  3680. $17=self._sampleNewValue();
  3681. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3682. $ctx2.sendIdx["sampleNewValue"]=3;
  3683. //>>excludeEnd("ctx");
  3684. return $recv(each).__eq($17);
  3685. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3686. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,5)});
  3687. //>>excludeEnd("ctx");
  3688. }));
  3689. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3690. $ctx1.sendIdx["select:"]=5;
  3691. //>>excludeEnd("ctx");
  3692. self._assert_equals_($15,$recv(self._collectionClass())._new());
  3693. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3694. $ctx1.sendIdx["assert:equals:"]=5;
  3695. //>>excludeEnd("ctx");
  3696. self._assert_equals_($recv(self._collectionWithNewValue())._select_((function(each){
  3697. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3698. return $core.withContext(function($ctx2) {
  3699. //>>excludeEnd("ctx");
  3700. return $recv(each).__tild_eq(self._sampleNewValue());
  3701. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3702. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,6)});
  3703. //>>excludeEnd("ctx");
  3704. })),self._collection());
  3705. return self;
  3706. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3707. }, function($ctx1) {$ctx1.fill(self,"testSelect",{},$globals.CollectionTest)});
  3708. //>>excludeEnd("ctx");
  3709. },
  3710. //>>excludeStart("ide", pragmas.excludeIdeData);
  3711. args: [],
  3712. 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",
  3713. referencedClasses: [],
  3714. //>>excludeEnd("ide");
  3715. messageSends: ["assert:equals:", "select:", "collection", "new", "collectionClass", "collectionWithNewValue", "=", "sampleNewValue", "sampleNewValueAsCollection", "~="]
  3716. }),
  3717. $globals.CollectionTest);
  3718. $core.addMethod(
  3719. $core.method({
  3720. selector: "testSize",
  3721. protocol: 'tests',
  3722. fn: function (){
  3723. var self=this;
  3724. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3725. return $core.withContext(function($ctx1) {
  3726. //>>excludeEnd("ctx");
  3727. var $1,$2;
  3728. $1=$recv($recv(self._collectionClass())._new())._size();
  3729. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3730. $ctx1.sendIdx["size"]=1;
  3731. //>>excludeEnd("ctx");
  3732. self._assert_equals_($1,(0));
  3733. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3734. $ctx1.sendIdx["assert:equals:"]=1;
  3735. //>>excludeEnd("ctx");
  3736. $2=$recv(self._sampleNewValueAsCollection())._size();
  3737. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3738. $ctx1.sendIdx["size"]=2;
  3739. //>>excludeEnd("ctx");
  3740. self._assert_equals_($2,(1));
  3741. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3742. $ctx1.sendIdx["assert:equals:"]=2;
  3743. //>>excludeEnd("ctx");
  3744. self._assert_equals_($recv(self._collection())._size(),self._collectionSize());
  3745. return self;
  3746. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3747. }, function($ctx1) {$ctx1.fill(self,"testSize",{},$globals.CollectionTest)});
  3748. //>>excludeEnd("ctx");
  3749. },
  3750. //>>excludeStart("ide", pragmas.excludeIdeData);
  3751. args: [],
  3752. 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",
  3753. referencedClasses: [],
  3754. //>>excludeEnd("ide");
  3755. messageSends: ["assert:equals:", "size", "new", "collectionClass", "sampleNewValueAsCollection", "collection", "collectionSize"]
  3756. }),
  3757. $globals.CollectionTest);
  3758. $core.addMethod(
  3759. $core.method({
  3760. selector: "collectionClass",
  3761. protocol: 'fixture',
  3762. fn: function (){
  3763. var self=this;
  3764. return nil;
  3765. },
  3766. //>>excludeStart("ide", pragmas.excludeIdeData);
  3767. args: [],
  3768. source: "collectionClass\x0a\x09\x22Answers class of collection type tested,\x0a\x09or nil if test is abstract\x22\x0a\x0a\x09^ nil",
  3769. referencedClasses: [],
  3770. //>>excludeEnd("ide");
  3771. messageSends: []
  3772. }),
  3773. $globals.CollectionTest.klass);
  3774. $core.addMethod(
  3775. $core.method({
  3776. selector: "isAbstract",
  3777. protocol: 'testing',
  3778. fn: function (){
  3779. var self=this;
  3780. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3781. return $core.withContext(function($ctx1) {
  3782. //>>excludeEnd("ctx");
  3783. var $1;
  3784. $1=$recv(self._collectionClass())._isNil();
  3785. return $1;
  3786. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3787. }, function($ctx1) {$ctx1.fill(self,"isAbstract",{},$globals.CollectionTest.klass)});
  3788. //>>excludeEnd("ctx");
  3789. },
  3790. //>>excludeStart("ide", pragmas.excludeIdeData);
  3791. args: [],
  3792. source: "isAbstract\x0a\x09^ self collectionClass isNil",
  3793. referencedClasses: [],
  3794. //>>excludeEnd("ide");
  3795. messageSends: ["isNil", "collectionClass"]
  3796. }),
  3797. $globals.CollectionTest.klass);
  3798. $core.addClass('IndexableCollectionTest', $globals.CollectionTest, [], 'Kernel-Tests');
  3799. $core.addMethod(
  3800. $core.method({
  3801. selector: "collectionWithNewValue",
  3802. protocol: 'fixture',
  3803. fn: function (){
  3804. var self=this;
  3805. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3806. return $core.withContext(function($ctx1) {
  3807. //>>excludeEnd("ctx");
  3808. self._subclassResponsibility();
  3809. return self;
  3810. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3811. }, function($ctx1) {$ctx1.fill(self,"collectionWithNewValue",{},$globals.IndexableCollectionTest)});
  3812. //>>excludeEnd("ctx");
  3813. },
  3814. //>>excludeStart("ide", pragmas.excludeIdeData);
  3815. args: [],
  3816. 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",
  3817. referencedClasses: [],
  3818. //>>excludeEnd("ide");
  3819. messageSends: ["subclassResponsibility"]
  3820. }),
  3821. $globals.IndexableCollectionTest);
  3822. $core.addMethod(
  3823. $core.method({
  3824. selector: "sampleNewIndex",
  3825. protocol: 'fixture',
  3826. fn: function (){
  3827. var self=this;
  3828. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3829. return $core.withContext(function($ctx1) {
  3830. //>>excludeEnd("ctx");
  3831. self._subclassResponsibility();
  3832. return self;
  3833. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3834. }, function($ctx1) {$ctx1.fill(self,"sampleNewIndex",{},$globals.IndexableCollectionTest)});
  3835. //>>excludeEnd("ctx");
  3836. },
  3837. //>>excludeStart("ide", pragmas.excludeIdeData);
  3838. args: [],
  3839. 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",
  3840. referencedClasses: [],
  3841. //>>excludeEnd("ide");
  3842. messageSends: ["subclassResponsibility"]
  3843. }),
  3844. $globals.IndexableCollectionTest);
  3845. $core.addMethod(
  3846. $core.method({
  3847. selector: "sampleNonIndexesDo:",
  3848. protocol: 'fixture',
  3849. fn: function (aBlock){
  3850. var self=this;
  3851. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3852. return $core.withContext(function($ctx1) {
  3853. //>>excludeEnd("ctx");
  3854. self._subclassResponsibility();
  3855. return self;
  3856. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3857. }, function($ctx1) {$ctx1.fill(self,"sampleNonIndexesDo:",{aBlock:aBlock},$globals.IndexableCollectionTest)});
  3858. //>>excludeEnd("ctx");
  3859. },
  3860. //>>excludeStart("ide", pragmas.excludeIdeData);
  3861. args: ["aBlock"],
  3862. 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",
  3863. referencedClasses: [],
  3864. //>>excludeEnd("ide");
  3865. messageSends: ["subclassResponsibility"]
  3866. }),
  3867. $globals.IndexableCollectionTest);
  3868. $core.addMethod(
  3869. $core.method({
  3870. selector: "samplesDo:",
  3871. protocol: 'fixture',
  3872. fn: function (aBlock){
  3873. var self=this;
  3874. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3875. return $core.withContext(function($ctx1) {
  3876. //>>excludeEnd("ctx");
  3877. self._subclassResponsibility();
  3878. return self;
  3879. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3880. }, function($ctx1) {$ctx1.fill(self,"samplesDo:",{aBlock:aBlock},$globals.IndexableCollectionTest)});
  3881. //>>excludeEnd("ctx");
  3882. },
  3883. //>>excludeStart("ide", pragmas.excludeIdeData);
  3884. args: ["aBlock"],
  3885. 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",
  3886. referencedClasses: [],
  3887. //>>excludeEnd("ide");
  3888. messageSends: ["subclassResponsibility"]
  3889. }),
  3890. $globals.IndexableCollectionTest);
  3891. $core.addMethod(
  3892. $core.method({
  3893. selector: "testAt",
  3894. protocol: 'tests',
  3895. fn: function (){
  3896. var self=this;
  3897. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  3898. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3899. return $core.withContext(function($ctx1) {
  3900. //>>excludeEnd("ctx");
  3901. var $1;
  3902. self._nonIndexesDo_((function(each){
  3903. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3904. return $core.withContext(function($ctx2) {
  3905. //>>excludeEnd("ctx");
  3906. return self._should_raise_((function(){
  3907. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3908. return $core.withContext(function($ctx3) {
  3909. //>>excludeEnd("ctx");
  3910. $1=self._collection();
  3911. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3912. $ctx3.sendIdx["collection"]=1;
  3913. //>>excludeEnd("ctx");
  3914. return $recv($1)._at_(each);
  3915. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3916. $ctx3.sendIdx["at:"]=1;
  3917. //>>excludeEnd("ctx");
  3918. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3919. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  3920. //>>excludeEnd("ctx");
  3921. }),$Error());
  3922. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3923. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  3924. //>>excludeEnd("ctx");
  3925. }));
  3926. self._samplesDo_((function(index,value){
  3927. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3928. return $core.withContext(function($ctx2) {
  3929. //>>excludeEnd("ctx");
  3930. return self._assert_equals_($recv(self._collection())._at_(index),value);
  3931. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3932. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,3)});
  3933. //>>excludeEnd("ctx");
  3934. }));
  3935. return self;
  3936. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3937. }, function($ctx1) {$ctx1.fill(self,"testAt",{},$globals.IndexableCollectionTest)});
  3938. //>>excludeEnd("ctx");
  3939. },
  3940. //>>excludeStart("ide", pragmas.excludeIdeData);
  3941. args: [],
  3942. 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 ]",
  3943. referencedClasses: ["Error"],
  3944. //>>excludeEnd("ide");
  3945. messageSends: ["nonIndexesDo:", "should:raise:", "at:", "collection", "samplesDo:", "assert:equals:"]
  3946. }),
  3947. $globals.IndexableCollectionTest);
  3948. $core.addMethod(
  3949. $core.method({
  3950. selector: "testAtIfAbsent",
  3951. protocol: 'tests',
  3952. fn: function (){
  3953. var self=this;
  3954. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3955. return $core.withContext(function($ctx1) {
  3956. //>>excludeEnd("ctx");
  3957. var $2,$1,$3;
  3958. self._nonIndexesDo_((function(each){
  3959. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3960. return $core.withContext(function($ctx2) {
  3961. //>>excludeEnd("ctx");
  3962. $2=self._collection();
  3963. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3964. $ctx2.sendIdx["collection"]=1;
  3965. //>>excludeEnd("ctx");
  3966. $1=$recv($2)._at_ifAbsent_(each,(function(){
  3967. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3968. return $core.withContext(function($ctx3) {
  3969. //>>excludeEnd("ctx");
  3970. return self._sampleNewValue();
  3971. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3972. $ctx3.sendIdx["sampleNewValue"]=1;
  3973. //>>excludeEnd("ctx");
  3974. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3975. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  3976. //>>excludeEnd("ctx");
  3977. }));
  3978. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3979. $ctx2.sendIdx["at:ifAbsent:"]=1;
  3980. //>>excludeEnd("ctx");
  3981. $3=self._sampleNewValue();
  3982. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3983. $ctx2.sendIdx["sampleNewValue"]=2;
  3984. //>>excludeEnd("ctx");
  3985. return self._assert_equals_($1,$3);
  3986. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3987. $ctx2.sendIdx["assert:equals:"]=1;
  3988. //>>excludeEnd("ctx");
  3989. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3990. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  3991. //>>excludeEnd("ctx");
  3992. }));
  3993. self._samplesDo_((function(index,value){
  3994. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3995. return $core.withContext(function($ctx2) {
  3996. //>>excludeEnd("ctx");
  3997. return self._assert_equals_($recv(self._collection())._at_ifAbsent_(index,(function(){
  3998. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  3999. return $core.withContext(function($ctx3) {
  4000. //>>excludeEnd("ctx");
  4001. return self._sampleNewValue();
  4002. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4003. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,4)});
  4004. //>>excludeEnd("ctx");
  4005. })),value);
  4006. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4007. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,3)});
  4008. //>>excludeEnd("ctx");
  4009. }));
  4010. return self;
  4011. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4012. }, function($ctx1) {$ctx1.fill(self,"testAtIfAbsent",{},$globals.IndexableCollectionTest)});
  4013. //>>excludeEnd("ctx");
  4014. },
  4015. //>>excludeStart("ide", pragmas.excludeIdeData);
  4016. args: [],
  4017. 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 ].",
  4018. referencedClasses: [],
  4019. //>>excludeEnd("ide");
  4020. messageSends: ["nonIndexesDo:", "assert:equals:", "at:ifAbsent:", "collection", "sampleNewValue", "samplesDo:"]
  4021. }),
  4022. $globals.IndexableCollectionTest);
  4023. $core.addMethod(
  4024. $core.method({
  4025. selector: "testAtIfAbsentPut",
  4026. protocol: 'tests',
  4027. fn: function (){
  4028. var self=this;
  4029. var newCollection;
  4030. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4031. return $core.withContext(function($ctx1) {
  4032. //>>excludeEnd("ctx");
  4033. var $1;
  4034. newCollection=self._collection();
  4035. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4036. $ctx1.sendIdx["collection"]=1;
  4037. //>>excludeEnd("ctx");
  4038. self._samplesDo_((function(index,value){
  4039. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4040. return $core.withContext(function($ctx2) {
  4041. //>>excludeEnd("ctx");
  4042. $1=$recv(newCollection)._at_ifAbsentPut_(index,(function(){
  4043. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4044. return $core.withContext(function($ctx3) {
  4045. //>>excludeEnd("ctx");
  4046. return self._sampleNewValue();
  4047. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4048. $ctx3.sendIdx["sampleNewValue"]=1;
  4049. //>>excludeEnd("ctx");
  4050. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4051. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  4052. //>>excludeEnd("ctx");
  4053. }));
  4054. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4055. $ctx2.sendIdx["at:ifAbsentPut:"]=1;
  4056. //>>excludeEnd("ctx");
  4057. return self._assert_equals_($1,value);
  4058. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4059. $ctx2.sendIdx["assert:equals:"]=1;
  4060. //>>excludeEnd("ctx");
  4061. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4062. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,1)});
  4063. //>>excludeEnd("ctx");
  4064. }));
  4065. self._assert_equals_(newCollection,self._collection());
  4066. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4067. $ctx1.sendIdx["assert:equals:"]=2;
  4068. //>>excludeEnd("ctx");
  4069. self._assert_equals_($recv(newCollection)._at_ifAbsentPut_(self._sampleNewIndex(),(function(){
  4070. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4071. return $core.withContext(function($ctx2) {
  4072. //>>excludeEnd("ctx");
  4073. return self._sampleNewValue();
  4074. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4075. $ctx2.sendIdx["sampleNewValue"]=2;
  4076. //>>excludeEnd("ctx");
  4077. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4078. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  4079. //>>excludeEnd("ctx");
  4080. })),self._sampleNewValue());
  4081. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4082. $ctx1.sendIdx["assert:equals:"]=3;
  4083. //>>excludeEnd("ctx");
  4084. self._assert_equals_(newCollection,self._collectionWithNewValue());
  4085. return self;
  4086. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4087. }, function($ctx1) {$ctx1.fill(self,"testAtIfAbsentPut",{newCollection:newCollection},$globals.IndexableCollectionTest)});
  4088. //>>excludeEnd("ctx");
  4089. },
  4090. //>>excludeStart("ide", pragmas.excludeIdeData);
  4091. args: [],
  4092. 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",
  4093. referencedClasses: [],
  4094. //>>excludeEnd("ide");
  4095. messageSends: ["collection", "samplesDo:", "assert:equals:", "at:ifAbsentPut:", "sampleNewValue", "sampleNewIndex", "collectionWithNewValue"]
  4096. }),
  4097. $globals.IndexableCollectionTest);
  4098. $core.addMethod(
  4099. $core.method({
  4100. selector: "testAtIfPresent",
  4101. protocol: 'tests',
  4102. fn: function (){
  4103. var self=this;
  4104. var visited,sentinel;
  4105. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  4106. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4107. return $core.withContext(function($ctx1) {
  4108. //>>excludeEnd("ctx");
  4109. var $2,$1,$4,$3;
  4110. sentinel=$recv($Object())._new();
  4111. self._nonIndexesDo_((function(each){
  4112. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4113. return $core.withContext(function($ctx2) {
  4114. //>>excludeEnd("ctx");
  4115. visited=nil;
  4116. visited;
  4117. $2=self._collection();
  4118. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4119. $ctx2.sendIdx["collection"]=1;
  4120. //>>excludeEnd("ctx");
  4121. $1=$recv($2)._at_ifPresent_(each,(function(value1){
  4122. visited=value1;
  4123. visited;
  4124. return sentinel;
  4125. }));
  4126. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4127. $ctx2.sendIdx["at:ifPresent:"]=1;
  4128. //>>excludeEnd("ctx");
  4129. self._assert_equals_($1,nil);
  4130. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4131. $ctx2.sendIdx["assert:equals:"]=1;
  4132. //>>excludeEnd("ctx");
  4133. return self._assert_($recv(visited)._isNil());
  4134. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4135. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  4136. //>>excludeEnd("ctx");
  4137. }));
  4138. self._samplesDo_((function(index,value){
  4139. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4140. return $core.withContext(function($ctx2) {
  4141. //>>excludeEnd("ctx");
  4142. visited=nil;
  4143. visited;
  4144. $4=self._collection();
  4145. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4146. $ctx2.sendIdx["collection"]=2;
  4147. //>>excludeEnd("ctx");
  4148. $3=$recv($4)._at_ifPresent_(index,(function(value2){
  4149. visited=value2;
  4150. visited;
  4151. return sentinel;
  4152. }));
  4153. self._assert_equals_($3,sentinel);
  4154. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4155. $ctx2.sendIdx["assert:equals:"]=2;
  4156. //>>excludeEnd("ctx");
  4157. return self._assert_equals_(visited,$recv(self._collection())._at_(index));
  4158. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4159. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,3)});
  4160. //>>excludeEnd("ctx");
  4161. }));
  4162. return self;
  4163. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4164. }, function($ctx1) {$ctx1.fill(self,"testAtIfPresent",{visited:visited,sentinel:sentinel},$globals.IndexableCollectionTest)});
  4165. //>>excludeEnd("ctx");
  4166. },
  4167. //>>excludeStart("ide", pragmas.excludeIdeData);
  4168. args: [],
  4169. 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) ]",
  4170. referencedClasses: ["Object"],
  4171. //>>excludeEnd("ide");
  4172. messageSends: ["new", "nonIndexesDo:", "assert:equals:", "at:ifPresent:", "collection", "assert:", "isNil", "samplesDo:", "at:"]
  4173. }),
  4174. $globals.IndexableCollectionTest);
  4175. $core.addMethod(
  4176. $core.method({
  4177. selector: "testAtIfPresentIfAbsent",
  4178. protocol: 'tests',
  4179. fn: function (){
  4180. var self=this;
  4181. var visited,sentinel;
  4182. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  4183. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4184. return $core.withContext(function($ctx1) {
  4185. //>>excludeEnd("ctx");
  4186. var $2,$1,$3,$5,$4;
  4187. sentinel=$recv($Object())._new();
  4188. self._nonIndexesDo_((function(each){
  4189. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4190. return $core.withContext(function($ctx2) {
  4191. //>>excludeEnd("ctx");
  4192. visited=nil;
  4193. visited;
  4194. $2=self._collection();
  4195. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4196. $ctx2.sendIdx["collection"]=1;
  4197. //>>excludeEnd("ctx");
  4198. $1=$recv($2)._at_ifPresent_ifAbsent_(each,(function(value1){
  4199. visited=value1;
  4200. visited;
  4201. return sentinel;
  4202. }),(function(){
  4203. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4204. return $core.withContext(function($ctx3) {
  4205. //>>excludeEnd("ctx");
  4206. return self._sampleNewValue();
  4207. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4208. $ctx3.sendIdx["sampleNewValue"]=1;
  4209. //>>excludeEnd("ctx");
  4210. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4211. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)});
  4212. //>>excludeEnd("ctx");
  4213. }));
  4214. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4215. $ctx2.sendIdx["at:ifPresent:ifAbsent:"]=1;
  4216. //>>excludeEnd("ctx");
  4217. $3=self._sampleNewValue();
  4218. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4219. $ctx2.sendIdx["sampleNewValue"]=2;
  4220. //>>excludeEnd("ctx");
  4221. self._assert_equals_($1,$3);
  4222. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4223. $ctx2.sendIdx["assert:equals:"]=1;
  4224. //>>excludeEnd("ctx");
  4225. return self._assert_($recv(visited)._isNil());
  4226. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4227. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  4228. //>>excludeEnd("ctx");
  4229. }));
  4230. self._samplesDo_((function(index,value){
  4231. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4232. return $core.withContext(function($ctx2) {
  4233. //>>excludeEnd("ctx");
  4234. visited=nil;
  4235. visited;
  4236. $5=self._collection();
  4237. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4238. $ctx2.sendIdx["collection"]=2;
  4239. //>>excludeEnd("ctx");
  4240. $4=$recv($5)._at_ifPresent_ifAbsent_(index,(function(value2){
  4241. visited=value2;
  4242. visited;
  4243. return sentinel;
  4244. }),(function(){
  4245. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4246. return $core.withContext(function($ctx3) {
  4247. //>>excludeEnd("ctx");
  4248. return self._sampleNewValue();
  4249. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4250. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,6)});
  4251. //>>excludeEnd("ctx");
  4252. }));
  4253. self._assert_equals_($4,sentinel);
  4254. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4255. $ctx2.sendIdx["assert:equals:"]=2;
  4256. //>>excludeEnd("ctx");
  4257. return self._assert_equals_(visited,$recv(self._collection())._at_(index));
  4258. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4259. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,4)});
  4260. //>>excludeEnd("ctx");
  4261. }));
  4262. return self;
  4263. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4264. }, function($ctx1) {$ctx1.fill(self,"testAtIfPresentIfAbsent",{visited:visited,sentinel:sentinel},$globals.IndexableCollectionTest)});
  4265. //>>excludeEnd("ctx");
  4266. },
  4267. //>>excludeStart("ide", pragmas.excludeIdeData);
  4268. args: [],
  4269. 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) ]",
  4270. referencedClasses: ["Object"],
  4271. //>>excludeEnd("ide");
  4272. messageSends: ["new", "nonIndexesDo:", "assert:equals:", "at:ifPresent:ifAbsent:", "collection", "sampleNewValue", "assert:", "isNil", "samplesDo:", "at:"]
  4273. }),
  4274. $globals.IndexableCollectionTest);
  4275. $core.addMethod(
  4276. $core.method({
  4277. selector: "testAtPut",
  4278. protocol: 'tests',
  4279. fn: function (){
  4280. var self=this;
  4281. var newCollection;
  4282. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4283. return $core.withContext(function($ctx1) {
  4284. //>>excludeEnd("ctx");
  4285. newCollection=self._collection();
  4286. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4287. $ctx1.sendIdx["collection"]=1;
  4288. //>>excludeEnd("ctx");
  4289. self._samplesDo_((function(index,value){
  4290. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4291. return $core.withContext(function($ctx2) {
  4292. //>>excludeEnd("ctx");
  4293. return $recv(newCollection)._at_put_(index,value);
  4294. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4295. $ctx2.sendIdx["at:put:"]=1;
  4296. //>>excludeEnd("ctx");
  4297. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4298. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,1)});
  4299. //>>excludeEnd("ctx");
  4300. }));
  4301. self._assert_equals_(newCollection,self._collection());
  4302. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4303. $ctx1.sendIdx["assert:equals:"]=1;
  4304. //>>excludeEnd("ctx");
  4305. $recv(newCollection)._at_put_(self._sampleNewIndex(),self._sampleNewValue());
  4306. self._assert_equals_(newCollection,self._collectionWithNewValue());
  4307. return self;
  4308. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4309. }, function($ctx1) {$ctx1.fill(self,"testAtPut",{newCollection:newCollection},$globals.IndexableCollectionTest)});
  4310. //>>excludeEnd("ctx");
  4311. },
  4312. //>>excludeStart("ide", pragmas.excludeIdeData);
  4313. args: [],
  4314. 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",
  4315. referencedClasses: [],
  4316. //>>excludeEnd("ide");
  4317. messageSends: ["collection", "samplesDo:", "at:put:", "assert:equals:", "sampleNewIndex", "sampleNewValue", "collectionWithNewValue"]
  4318. }),
  4319. $globals.IndexableCollectionTest);
  4320. $core.addMethod(
  4321. $core.method({
  4322. selector: "testEquality",
  4323. protocol: 'tests',
  4324. fn: function (){
  4325. var self=this;
  4326. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4327. return $core.withContext(function($ctx1) {
  4328. //>>excludeEnd("ctx");
  4329. var $2,$1,$4,$3,$5,$6,$7,$10,$9,$11,$8;
  4330. $2=self._collectionClass();
  4331. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4332. $ctx1.sendIdx["collectionClass"]=1;
  4333. //>>excludeEnd("ctx");
  4334. $1=$recv($2)._new();
  4335. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4336. $ctx1.sendIdx["new"]=1;
  4337. //>>excludeEnd("ctx");
  4338. $4=self._collectionClass();
  4339. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4340. $ctx1.sendIdx["collectionClass"]=2;
  4341. //>>excludeEnd("ctx");
  4342. $3=$recv($4)._new();
  4343. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4344. $ctx1.sendIdx["new"]=2;
  4345. //>>excludeEnd("ctx");
  4346. self._assert_equals_($1,$3);
  4347. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4348. $ctx1.sendIdx["assert:equals:"]=1;
  4349. //>>excludeEnd("ctx");
  4350. $5=self._collection();
  4351. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4352. $ctx1.sendIdx["collection"]=1;
  4353. //>>excludeEnd("ctx");
  4354. $6=self._collection();
  4355. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4356. $ctx1.sendIdx["collection"]=2;
  4357. //>>excludeEnd("ctx");
  4358. self._assert_equals_($5,$6);
  4359. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4360. $ctx1.sendIdx["assert:equals:"]=2;
  4361. //>>excludeEnd("ctx");
  4362. $7=self._collectionWithNewValue();
  4363. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4364. $ctx1.sendIdx["collectionWithNewValue"]=1;
  4365. //>>excludeEnd("ctx");
  4366. self._assert_equals_($7,self._collectionWithNewValue());
  4367. $10=self._collectionClass();
  4368. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4369. $ctx1.sendIdx["collectionClass"]=3;
  4370. //>>excludeEnd("ctx");
  4371. $9=$recv($10)._new();
  4372. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4373. $ctx1.sendIdx["new"]=3;
  4374. //>>excludeEnd("ctx");
  4375. $11=self._collection();
  4376. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4377. $ctx1.sendIdx["collection"]=3;
  4378. //>>excludeEnd("ctx");
  4379. $8=$recv($9).__eq($11);
  4380. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4381. $ctx1.sendIdx["="]=1;
  4382. //>>excludeEnd("ctx");
  4383. self._deny_($8);
  4384. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4385. $ctx1.sendIdx["deny:"]=1;
  4386. //>>excludeEnd("ctx");
  4387. self._deny_($recv(self._collection()).__eq($recv(self._collectionClass())._new()));
  4388. return self;
  4389. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4390. }, function($ctx1) {$ctx1.fill(self,"testEquality",{},$globals.IndexableCollectionTest)});
  4391. //>>excludeEnd("ctx");
  4392. },
  4393. //>>excludeStart("ide", pragmas.excludeIdeData);
  4394. args: [],
  4395. 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",
  4396. referencedClasses: [],
  4397. //>>excludeEnd("ide");
  4398. messageSends: ["assert:equals:", "new", "collectionClass", "collection", "collectionWithNewValue", "deny:", "="]
  4399. }),
  4400. $globals.IndexableCollectionTest);
  4401. $core.addMethod(
  4402. $core.method({
  4403. selector: "testIndexOf",
  4404. protocol: 'tests',
  4405. fn: function (){
  4406. var self=this;
  4407. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  4408. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4409. return $core.withContext(function($ctx1) {
  4410. //>>excludeEnd("ctx");
  4411. var $1;
  4412. self._should_raise_((function(){
  4413. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4414. return $core.withContext(function($ctx2) {
  4415. //>>excludeEnd("ctx");
  4416. $1=self._collection();
  4417. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4418. $ctx2.sendIdx["collection"]=1;
  4419. //>>excludeEnd("ctx");
  4420. return $recv($1)._indexOf_(self._sampleNewValue());
  4421. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4422. $ctx2.sendIdx["indexOf:"]=1;
  4423. //>>excludeEnd("ctx");
  4424. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4425. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  4426. //>>excludeEnd("ctx");
  4427. }),$Error());
  4428. self._samplesDo_((function(index,value){
  4429. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4430. return $core.withContext(function($ctx2) {
  4431. //>>excludeEnd("ctx");
  4432. return self._assert_equals_($recv(self._collection())._indexOf_(value),index);
  4433. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4434. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,2)});
  4435. //>>excludeEnd("ctx");
  4436. }));
  4437. return self;
  4438. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4439. }, function($ctx1) {$ctx1.fill(self,"testIndexOf",{},$globals.IndexableCollectionTest)});
  4440. //>>excludeEnd("ctx");
  4441. },
  4442. //>>excludeStart("ide", pragmas.excludeIdeData);
  4443. args: [],
  4444. 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 ]",
  4445. referencedClasses: ["Error"],
  4446. //>>excludeEnd("ide");
  4447. messageSends: ["should:raise:", "indexOf:", "collection", "sampleNewValue", "samplesDo:", "assert:equals:"]
  4448. }),
  4449. $globals.IndexableCollectionTest);
  4450. $core.addMethod(
  4451. $core.method({
  4452. selector: "testIndexOfWithNull",
  4453. protocol: 'tests',
  4454. fn: function (){
  4455. var self=this;
  4456. var jsNull;
  4457. function $JSON(){return $globals.JSON||(typeof JSON=="undefined"?nil:JSON)}
  4458. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4459. return $core.withContext(function($ctx1) {
  4460. //>>excludeEnd("ctx");
  4461. var $1,$2;
  4462. jsNull=$recv($JSON())._parse_("null");
  4463. self._samplesDo_((function(index,value){
  4464. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4465. return $core.withContext(function($ctx2) {
  4466. //>>excludeEnd("ctx");
  4467. $1=self._collection();
  4468. $recv($1)._at_put_(index,jsNull);
  4469. $2=$recv($1)._indexOf_(jsNull);
  4470. return self._assert_equals_($2,index);
  4471. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4472. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,1)});
  4473. //>>excludeEnd("ctx");
  4474. }));
  4475. return self;
  4476. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4477. }, function($ctx1) {$ctx1.fill(self,"testIndexOfWithNull",{jsNull:jsNull},$globals.IndexableCollectionTest)});
  4478. //>>excludeEnd("ctx");
  4479. },
  4480. //>>excludeStart("ide", pragmas.excludeIdeData);
  4481. args: [],
  4482. 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 ]",
  4483. referencedClasses: ["JSON"],
  4484. //>>excludeEnd("ide");
  4485. messageSends: ["parse:", "samplesDo:", "assert:equals:", "at:put:", "collection", "indexOf:"]
  4486. }),
  4487. $globals.IndexableCollectionTest);
  4488. $core.addMethod(
  4489. $core.method({
  4490. selector: "testWithIndexDo",
  4491. protocol: 'tests',
  4492. fn: function (){
  4493. var self=this;
  4494. var collection;
  4495. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4496. return $core.withContext(function($ctx1) {
  4497. //>>excludeEnd("ctx");
  4498. collection=self._collection();
  4499. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4500. $ctx1.sendIdx["collection"]=1;
  4501. //>>excludeEnd("ctx");
  4502. $recv(self._collection())._withIndexDo_((function(each,index){
  4503. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4504. return $core.withContext(function($ctx2) {
  4505. //>>excludeEnd("ctx");
  4506. return self._assert_equals_($recv(collection)._at_(index),each);
  4507. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4508. }, function($ctx2) {$ctx2.fillBlock({each:each,index:index},$ctx1,1)});
  4509. //>>excludeEnd("ctx");
  4510. }));
  4511. return self;
  4512. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4513. }, function($ctx1) {$ctx1.fill(self,"testWithIndexDo",{collection:collection},$globals.IndexableCollectionTest)});
  4514. //>>excludeEnd("ctx");
  4515. },
  4516. //>>excludeStart("ide", pragmas.excludeIdeData);
  4517. args: [],
  4518. 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 ]",
  4519. referencedClasses: [],
  4520. //>>excludeEnd("ide");
  4521. messageSends: ["collection", "withIndexDo:", "assert:equals:", "at:"]
  4522. }),
  4523. $globals.IndexableCollectionTest);
  4524. $core.addClass('AssociativeCollectionTest', $globals.IndexableCollectionTest, [], 'Kernel-Tests');
  4525. $core.addMethod(
  4526. $core.method({
  4527. selector: "collectionKeys",
  4528. protocol: 'fixture',
  4529. fn: function (){
  4530. var self=this;
  4531. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4532. return $core.withContext(function($ctx1) {
  4533. //>>excludeEnd("ctx");
  4534. self._subclassResponsibility();
  4535. return self;
  4536. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4537. }, function($ctx1) {$ctx1.fill(self,"collectionKeys",{},$globals.AssociativeCollectionTest)});
  4538. //>>excludeEnd("ctx");
  4539. },
  4540. //>>excludeStart("ide", pragmas.excludeIdeData);
  4541. args: [],
  4542. source: "collectionKeys\x0a\x09self subclassResponsibility",
  4543. referencedClasses: [],
  4544. //>>excludeEnd("ide");
  4545. messageSends: ["subclassResponsibility"]
  4546. }),
  4547. $globals.AssociativeCollectionTest);
  4548. $core.addMethod(
  4549. $core.method({
  4550. selector: "collectionValues",
  4551. protocol: 'fixture',
  4552. fn: function (){
  4553. var self=this;
  4554. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4555. return $core.withContext(function($ctx1) {
  4556. //>>excludeEnd("ctx");
  4557. self._subclassResponsibility();
  4558. return self;
  4559. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4560. }, function($ctx1) {$ctx1.fill(self,"collectionValues",{},$globals.AssociativeCollectionTest)});
  4561. //>>excludeEnd("ctx");
  4562. },
  4563. //>>excludeStart("ide", pragmas.excludeIdeData);
  4564. args: [],
  4565. source: "collectionValues\x0a\x09self subclassResponsibility",
  4566. referencedClasses: [],
  4567. //>>excludeEnd("ide");
  4568. messageSends: ["subclassResponsibility"]
  4569. }),
  4570. $globals.AssociativeCollectionTest);
  4571. $core.addMethod(
  4572. $core.method({
  4573. selector: "nonIndexesDo:",
  4574. protocol: 'fixture',
  4575. fn: function (aBlock){
  4576. var self=this;
  4577. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4578. return $core.withContext(function($ctx1) {
  4579. //>>excludeEnd("ctx");
  4580. $recv(aBlock)._value_((5));
  4581. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4582. $ctx1.sendIdx["value:"]=1;
  4583. //>>excludeEnd("ctx");
  4584. $recv(aBlock)._value_("z");
  4585. return self;
  4586. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4587. }, function($ctx1) {$ctx1.fill(self,"nonIndexesDo:",{aBlock:aBlock},$globals.AssociativeCollectionTest)});
  4588. //>>excludeEnd("ctx");
  4589. },
  4590. //>>excludeStart("ide", pragmas.excludeIdeData);
  4591. args: ["aBlock"],
  4592. source: "nonIndexesDo: aBlock\x0a\x09aBlock value: 5.\x0a\x09aBlock value: 'z'",
  4593. referencedClasses: [],
  4594. //>>excludeEnd("ide");
  4595. messageSends: ["value:"]
  4596. }),
  4597. $globals.AssociativeCollectionTest);
  4598. $core.addMethod(
  4599. $core.method({
  4600. selector: "sampleNewIndex",
  4601. protocol: 'fixture',
  4602. fn: function (){
  4603. var self=this;
  4604. return "new";
  4605. },
  4606. //>>excludeStart("ide", pragmas.excludeIdeData);
  4607. args: [],
  4608. source: "sampleNewIndex\x0a\x09^ 'new'",
  4609. referencedClasses: [],
  4610. //>>excludeEnd("ide");
  4611. messageSends: []
  4612. }),
  4613. $globals.AssociativeCollectionTest);
  4614. $core.addMethod(
  4615. $core.method({
  4616. selector: "samplesDo:",
  4617. protocol: 'fixture',
  4618. fn: function (aBlock){
  4619. var self=this;
  4620. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4621. return $core.withContext(function($ctx1) {
  4622. //>>excludeEnd("ctx");
  4623. $recv(aBlock)._value_value_("a",(2));
  4624. return self;
  4625. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4626. }, function($ctx1) {$ctx1.fill(self,"samplesDo:",{aBlock:aBlock},$globals.AssociativeCollectionTest)});
  4627. //>>excludeEnd("ctx");
  4628. },
  4629. //>>excludeStart("ide", pragmas.excludeIdeData);
  4630. args: ["aBlock"],
  4631. source: "samplesDo: aBlock\x0a\x09aBlock value: 'a' value: 2",
  4632. referencedClasses: [],
  4633. //>>excludeEnd("ide");
  4634. messageSends: ["value:value:"]
  4635. }),
  4636. $globals.AssociativeCollectionTest);
  4637. $core.addMethod(
  4638. $core.method({
  4639. selector: "testAddAll",
  4640. protocol: 'tests',
  4641. fn: function (){
  4642. var self=this;
  4643. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4644. return $core.withContext(function($ctx1) {
  4645. //>>excludeEnd("ctx");
  4646. var $2,$3,$4,$5,$1,$6,$8,$9,$10,$11,$7,$12,$14,$15,$13;
  4647. (
  4648. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4649. $ctx1.supercall = true,
  4650. //>>excludeEnd("ctx");
  4651. $globals.AssociativeCollectionTest.superclass.fn.prototype._testAddAll.apply($recv(self), []));
  4652. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4653. $ctx1.supercall = false;
  4654. //>>excludeEnd("ctx");;
  4655. $2=self._collection();
  4656. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4657. $ctx1.sendIdx["collection"]=1;
  4658. //>>excludeEnd("ctx");
  4659. $3=$2;
  4660. $4=self._collection();
  4661. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4662. $ctx1.sendIdx["collection"]=2;
  4663. //>>excludeEnd("ctx");
  4664. $recv($3)._addAll_($4);
  4665. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4666. $ctx1.sendIdx["addAll:"]=1;
  4667. //>>excludeEnd("ctx");
  4668. $5=$recv($2)._yourself();
  4669. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4670. $ctx1.sendIdx["yourself"]=1;
  4671. //>>excludeEnd("ctx");
  4672. $1=$5;
  4673. $6=self._collection();
  4674. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4675. $ctx1.sendIdx["collection"]=3;
  4676. //>>excludeEnd("ctx");
  4677. self._assert_equals_($1,$6);
  4678. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4679. $ctx1.sendIdx["assert:equals:"]=1;
  4680. //>>excludeEnd("ctx");
  4681. $8=self._collection();
  4682. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4683. $ctx1.sendIdx["collection"]=4;
  4684. //>>excludeEnd("ctx");
  4685. $9=$8;
  4686. $10=self._collectionWithNewValue();
  4687. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4688. $ctx1.sendIdx["collectionWithNewValue"]=1;
  4689. //>>excludeEnd("ctx");
  4690. $recv($9)._addAll_($10);
  4691. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4692. $ctx1.sendIdx["addAll:"]=2;
  4693. //>>excludeEnd("ctx");
  4694. $11=$recv($8)._yourself();
  4695. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4696. $ctx1.sendIdx["yourself"]=2;
  4697. //>>excludeEnd("ctx");
  4698. $7=$11;
  4699. $12=self._collectionWithNewValue();
  4700. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4701. $ctx1.sendIdx["collectionWithNewValue"]=2;
  4702. //>>excludeEnd("ctx");
  4703. self._assert_equals_($7,$12);
  4704. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4705. $ctx1.sendIdx["assert:equals:"]=2;
  4706. //>>excludeEnd("ctx");
  4707. $14=self._collectionWithNewValue();
  4708. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4709. $ctx1.sendIdx["collectionWithNewValue"]=3;
  4710. //>>excludeEnd("ctx");
  4711. $recv($14)._addAll_(self._collection());
  4712. $15=$recv($14)._yourself();
  4713. $13=$15;
  4714. self._assert_equals_($13,self._collectionWithNewValue());
  4715. return self;
  4716. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4717. }, function($ctx1) {$ctx1.fill(self,"testAddAll",{},$globals.AssociativeCollectionTest)});
  4718. //>>excludeEnd("ctx");
  4719. },
  4720. //>>excludeStart("ide", pragmas.excludeIdeData);
  4721. args: [],
  4722. 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",
  4723. referencedClasses: [],
  4724. //>>excludeEnd("ide");
  4725. messageSends: ["testAddAll", "assert:equals:", "addAll:", "collection", "yourself", "collectionWithNewValue"]
  4726. }),
  4727. $globals.AssociativeCollectionTest);
  4728. $core.addMethod(
  4729. $core.method({
  4730. selector: "testAsDictionary",
  4731. protocol: 'tests',
  4732. fn: function (){
  4733. var self=this;
  4734. function $Dictionary(){return $globals.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  4735. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4736. return $core.withContext(function($ctx1) {
  4737. //>>excludeEnd("ctx");
  4738. self._assert_($recv($recv($recv(self._collectionClass())._new())._asDictionary())._isMemberOf_($Dictionary()));
  4739. return self;
  4740. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4741. }, function($ctx1) {$ctx1.fill(self,"testAsDictionary",{},$globals.AssociativeCollectionTest)});
  4742. //>>excludeEnd("ctx");
  4743. },
  4744. //>>excludeStart("ide", pragmas.excludeIdeData);
  4745. args: [],
  4746. source: "testAsDictionary\x0aself assert: ( self collectionClass new asDictionary isMemberOf: Dictionary ).",
  4747. referencedClasses: ["Dictionary"],
  4748. //>>excludeEnd("ide");
  4749. messageSends: ["assert:", "isMemberOf:", "asDictionary", "new", "collectionClass"]
  4750. }),
  4751. $globals.AssociativeCollectionTest);
  4752. $core.addMethod(
  4753. $core.method({
  4754. selector: "testAsHashedCollection",
  4755. protocol: 'tests',
  4756. fn: function (){
  4757. var self=this;
  4758. function $HashedCollection(){return $globals.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
  4759. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4760. return $core.withContext(function($ctx1) {
  4761. //>>excludeEnd("ctx");
  4762. self._assert_($recv($recv($recv(self._collectionClass())._new())._asHashedCollection())._isMemberOf_($HashedCollection()));
  4763. return self;
  4764. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4765. }, function($ctx1) {$ctx1.fill(self,"testAsHashedCollection",{},$globals.AssociativeCollectionTest)});
  4766. //>>excludeEnd("ctx");
  4767. },
  4768. //>>excludeStart("ide", pragmas.excludeIdeData);
  4769. args: [],
  4770. source: "testAsHashedCollection\x0aself assert: ( self collectionClass new asHashedCollection isMemberOf: HashedCollection ).",
  4771. referencedClasses: ["HashedCollection"],
  4772. //>>excludeEnd("ide");
  4773. messageSends: ["assert:", "isMemberOf:", "asHashedCollection", "new", "collectionClass"]
  4774. }),
  4775. $globals.AssociativeCollectionTest);
  4776. $core.addMethod(
  4777. $core.method({
  4778. selector: "testComma",
  4779. protocol: 'tests',
  4780. fn: function (){
  4781. var self=this;
  4782. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4783. return $core.withContext(function($ctx1) {
  4784. //>>excludeEnd("ctx");
  4785. var $2,$3,$1,$4,$6,$7,$5,$8,$10,$9;
  4786. (
  4787. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4788. $ctx1.supercall = true,
  4789. //>>excludeEnd("ctx");
  4790. $globals.AssociativeCollectionTest.superclass.fn.prototype._testComma.apply($recv(self), []));
  4791. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4792. $ctx1.supercall = false;
  4793. //>>excludeEnd("ctx");;
  4794. $2=self._collection();
  4795. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4796. $ctx1.sendIdx["collection"]=1;
  4797. //>>excludeEnd("ctx");
  4798. $3=self._collection();
  4799. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4800. $ctx1.sendIdx["collection"]=2;
  4801. //>>excludeEnd("ctx");
  4802. $1=$recv($2).__comma($3);
  4803. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4804. $ctx1.sendIdx[","]=1;
  4805. //>>excludeEnd("ctx");
  4806. $4=self._collection();
  4807. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4808. $ctx1.sendIdx["collection"]=3;
  4809. //>>excludeEnd("ctx");
  4810. self._assert_equals_($1,$4);
  4811. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4812. $ctx1.sendIdx["assert:equals:"]=1;
  4813. //>>excludeEnd("ctx");
  4814. $6=self._collection();
  4815. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4816. $ctx1.sendIdx["collection"]=4;
  4817. //>>excludeEnd("ctx");
  4818. $7=self._collectionWithNewValue();
  4819. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4820. $ctx1.sendIdx["collectionWithNewValue"]=1;
  4821. //>>excludeEnd("ctx");
  4822. $5=$recv($6).__comma($7);
  4823. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4824. $ctx1.sendIdx[","]=2;
  4825. //>>excludeEnd("ctx");
  4826. $8=self._collectionWithNewValue();
  4827. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4828. $ctx1.sendIdx["collectionWithNewValue"]=2;
  4829. //>>excludeEnd("ctx");
  4830. self._assert_equals_($5,$8);
  4831. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4832. $ctx1.sendIdx["assert:equals:"]=2;
  4833. //>>excludeEnd("ctx");
  4834. $10=self._collectionWithNewValue();
  4835. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4836. $ctx1.sendIdx["collectionWithNewValue"]=3;
  4837. //>>excludeEnd("ctx");
  4838. $9=$recv($10).__comma(self._collection());
  4839. self._assert_equals_($9,self._collectionWithNewValue());
  4840. return self;
  4841. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4842. }, function($ctx1) {$ctx1.fill(self,"testComma",{},$globals.AssociativeCollectionTest)});
  4843. //>>excludeEnd("ctx");
  4844. },
  4845. //>>excludeStart("ide", pragmas.excludeIdeData);
  4846. args: [],
  4847. 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",
  4848. referencedClasses: [],
  4849. //>>excludeEnd("ide");
  4850. messageSends: ["testComma", "assert:equals:", ",", "collection", "collectionWithNewValue"]
  4851. }),
  4852. $globals.AssociativeCollectionTest);
  4853. $core.addMethod(
  4854. $core.method({
  4855. selector: "testFrom",
  4856. protocol: 'tests',
  4857. fn: function (){
  4858. var self=this;
  4859. var associations;
  4860. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4861. return $core.withContext(function($ctx1) {
  4862. //>>excludeEnd("ctx");
  4863. var $1;
  4864. $1="a".__minus_gt((1));
  4865. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4866. $ctx1.sendIdx["->"]=1;
  4867. //>>excludeEnd("ctx");
  4868. associations=[$1,"b".__minus_gt((2))];
  4869. self._assertSameContents_as_($recv($recv(self._class())._collectionClass())._from_(associations),$globals.HashedCollection._newFromPairs_(["a",(1),"b",(2)]));
  4870. return self;
  4871. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4872. }, function($ctx1) {$ctx1.fill(self,"testFrom",{associations:associations},$globals.AssociativeCollectionTest)});
  4873. //>>excludeEnd("ctx");
  4874. },
  4875. //>>excludeStart("ide", pragmas.excludeIdeData);
  4876. args: [],
  4877. 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 }.",
  4878. referencedClasses: [],
  4879. //>>excludeEnd("ide");
  4880. messageSends: ["->", "assertSameContents:as:", "from:", "collectionClass", "class"]
  4881. }),
  4882. $globals.AssociativeCollectionTest);
  4883. $core.addMethod(
  4884. $core.method({
  4885. selector: "testKeys",
  4886. protocol: 'tests',
  4887. fn: function (){
  4888. var self=this;
  4889. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4890. return $core.withContext(function($ctx1) {
  4891. //>>excludeEnd("ctx");
  4892. var $2,$1,$3,$4;
  4893. $2=$recv($recv(self._collectionClass())._new())._keys();
  4894. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4895. $ctx1.sendIdx["keys"]=1;
  4896. //>>excludeEnd("ctx");
  4897. $1=$recv($2)._isEmpty();
  4898. self._assert_($1);
  4899. $3=$recv(self._collection())._keys();
  4900. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4901. $ctx1.sendIdx["keys"]=2;
  4902. //>>excludeEnd("ctx");
  4903. $4=self._collectionKeys();
  4904. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4905. $ctx1.sendIdx["collectionKeys"]=1;
  4906. //>>excludeEnd("ctx");
  4907. self._assertSameContents_as_($3,$4);
  4908. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4909. $ctx1.sendIdx["assertSameContents:as:"]=1;
  4910. //>>excludeEnd("ctx");
  4911. self._assertSameContents_as_($recv(self._collectionWithNewValue())._keys(),$recv(self._collectionKeys()).__comma([self._sampleNewIndex()]));
  4912. return self;
  4913. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4914. }, function($ctx1) {$ctx1.fill(self,"testKeys",{},$globals.AssociativeCollectionTest)});
  4915. //>>excludeEnd("ctx");
  4916. },
  4917. //>>excludeStart("ide", pragmas.excludeIdeData);
  4918. args: [],
  4919. 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 }",
  4920. referencedClasses: [],
  4921. //>>excludeEnd("ide");
  4922. messageSends: ["assert:", "isEmpty", "keys", "new", "collectionClass", "assertSameContents:as:", "collection", "collectionKeys", "collectionWithNewValue", ",", "sampleNewIndex"]
  4923. }),
  4924. $globals.AssociativeCollectionTest);
  4925. $core.addMethod(
  4926. $core.method({
  4927. selector: "testNewFromPairs",
  4928. protocol: 'tests',
  4929. fn: function (){
  4930. var self=this;
  4931. var flattenedAssociations;
  4932. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4933. return $core.withContext(function($ctx1) {
  4934. //>>excludeEnd("ctx");
  4935. flattenedAssociations=["a",(1),"b",(2)];
  4936. self._assertSameContents_as_($recv($recv(self._class())._collectionClass())._newFromPairs_(flattenedAssociations),$globals.HashedCollection._newFromPairs_(["a",(1),"b",(2)]));
  4937. return self;
  4938. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4939. }, function($ctx1) {$ctx1.fill(self,"testNewFromPairs",{flattenedAssociations:flattenedAssociations},$globals.AssociativeCollectionTest)});
  4940. //>>excludeEnd("ctx");
  4941. },
  4942. //>>excludeStart("ide", pragmas.excludeIdeData);
  4943. args: [],
  4944. 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 }.",
  4945. referencedClasses: [],
  4946. //>>excludeEnd("ide");
  4947. messageSends: ["assertSameContents:as:", "newFromPairs:", "collectionClass", "class"]
  4948. }),
  4949. $globals.AssociativeCollectionTest);
  4950. $core.addMethod(
  4951. $core.method({
  4952. selector: "testPrintString",
  4953. protocol: 'tests',
  4954. fn: function (){
  4955. var self=this;
  4956. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4957. return $core.withContext(function($ctx1) {
  4958. //>>excludeEnd("ctx");
  4959. var $3,$2,$4,$1,$5;
  4960. $3=self._collectionClass();
  4961. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4962. $ctx1.sendIdx["collectionClass"]=1;
  4963. //>>excludeEnd("ctx");
  4964. $2=$recv($3)._new();
  4965. $recv($2)._at_put_("firstname","James");
  4966. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4967. $ctx1.sendIdx["at:put:"]=1;
  4968. //>>excludeEnd("ctx");
  4969. $recv($2)._at_put_("lastname","Bond");
  4970. $4=$recv($2)._printString();
  4971. $1=$4;
  4972. $5=$recv("a ".__comma($recv(self._collectionClass())._name())).__comma(" ('firstname' -> 'James' , 'lastname' -> 'Bond')");
  4973. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4974. $ctx1.sendIdx[","]=1;
  4975. //>>excludeEnd("ctx");
  4976. self._assert_equals_($1,$5);
  4977. return self;
  4978. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4979. }, function($ctx1) {$ctx1.fill(self,"testPrintString",{},$globals.AssociativeCollectionTest)});
  4980. //>>excludeEnd("ctx");
  4981. },
  4982. //>>excludeStart("ide", pragmas.excludeIdeData);
  4983. args: [],
  4984. 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'')'",
  4985. referencedClasses: [],
  4986. //>>excludeEnd("ide");
  4987. messageSends: ["assert:equals:", "at:put:", "new", "collectionClass", "printString", ",", "name"]
  4988. }),
  4989. $globals.AssociativeCollectionTest);
  4990. $core.addMethod(
  4991. $core.method({
  4992. selector: "testRemoveKey",
  4993. protocol: 'tests',
  4994. fn: function (){
  4995. var self=this;
  4996. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  4997. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  4998. return $core.withContext(function($ctx1) {
  4999. //>>excludeEnd("ctx");
  5000. var $1,$2,$3,$5,$6,$4,$7,$8;
  5001. self._nonIndexesDo_((function(each){
  5002. var collection;
  5003. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5004. return $core.withContext(function($ctx2) {
  5005. //>>excludeEnd("ctx");
  5006. collection=self._collection();
  5007. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5008. $ctx2.sendIdx["collection"]=1;
  5009. //>>excludeEnd("ctx");
  5010. collection;
  5011. self._should_raise_((function(){
  5012. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5013. return $core.withContext(function($ctx3) {
  5014. //>>excludeEnd("ctx");
  5015. return $recv(collection)._removeKey_(each);
  5016. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5017. $ctx3.sendIdx["removeKey:"]=1;
  5018. //>>excludeEnd("ctx");
  5019. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5020. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  5021. //>>excludeEnd("ctx");
  5022. }),$Error());
  5023. $1=collection;
  5024. $2=self._collection();
  5025. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5026. $ctx2.sendIdx["collection"]=2;
  5027. //>>excludeEnd("ctx");
  5028. return self._assert_equals_($1,$2);
  5029. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5030. $ctx2.sendIdx["assert:equals:"]=1;
  5031. //>>excludeEnd("ctx");
  5032. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5033. }, function($ctx2) {$ctx2.fillBlock({each:each,collection:collection},$ctx1,1)});
  5034. //>>excludeEnd("ctx");
  5035. }));
  5036. self._samplesDo_((function(index,value){
  5037. var collection;
  5038. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5039. return $core.withContext(function($ctx2) {
  5040. //>>excludeEnd("ctx");
  5041. collection=self._collection();
  5042. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5043. $ctx2.sendIdx["collection"]=3;
  5044. //>>excludeEnd("ctx");
  5045. collection;
  5046. $3=$recv(collection)._removeKey_(index);
  5047. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5048. $ctx2.sendIdx["removeKey:"]=2;
  5049. //>>excludeEnd("ctx");
  5050. self._assert_equals_($3,value);
  5051. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5052. $ctx2.sendIdx["assert:equals:"]=2;
  5053. //>>excludeEnd("ctx");
  5054. $5=collection;
  5055. $6=self._collection();
  5056. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5057. $ctx2.sendIdx["collection"]=4;
  5058. //>>excludeEnd("ctx");
  5059. $4=$recv($5).__eq($6);
  5060. return self._deny_($4);
  5061. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5062. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value,collection:collection},$ctx1,3)});
  5063. //>>excludeEnd("ctx");
  5064. }));
  5065. $7=self._collectionWithNewValue();
  5066. $recv($7)._removeKey_(self._sampleNewIndex());
  5067. $8=$recv($7)._yourself();
  5068. self._assert_equals_($8,self._collection());
  5069. return self;
  5070. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5071. }, function($ctx1) {$ctx1.fill(self,"testRemoveKey",{},$globals.AssociativeCollectionTest)});
  5072. //>>excludeEnd("ctx");
  5073. },
  5074. //>>excludeStart("ide", pragmas.excludeIdeData);
  5075. args: [],
  5076. 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",
  5077. referencedClasses: ["Error"],
  5078. //>>excludeEnd("ide");
  5079. messageSends: ["nonIndexesDo:", "collection", "should:raise:", "removeKey:", "assert:equals:", "samplesDo:", "deny:", "=", "collectionWithNewValue", "sampleNewIndex", "yourself"]
  5080. }),
  5081. $globals.AssociativeCollectionTest);
  5082. $core.addMethod(
  5083. $core.method({
  5084. selector: "testRemoveKeyIfAbsent",
  5085. protocol: 'tests',
  5086. fn: function (){
  5087. var self=this;
  5088. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5089. return $core.withContext(function($ctx1) {
  5090. //>>excludeEnd("ctx");
  5091. var $1,$2,$3,$4,$5,$7,$8,$6,$9,$10;
  5092. self._nonIndexesDo_((function(each){
  5093. var collection;
  5094. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5095. return $core.withContext(function($ctx2) {
  5096. //>>excludeEnd("ctx");
  5097. collection=self._collection();
  5098. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5099. $ctx2.sendIdx["collection"]=1;
  5100. //>>excludeEnd("ctx");
  5101. collection;
  5102. $1=$recv(collection)._removeKey_ifAbsent_(each,(function(){
  5103. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5104. return $core.withContext(function($ctx3) {
  5105. //>>excludeEnd("ctx");
  5106. return self._sampleNewValue();
  5107. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5108. $ctx3.sendIdx["sampleNewValue"]=1;
  5109. //>>excludeEnd("ctx");
  5110. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5111. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  5112. //>>excludeEnd("ctx");
  5113. }));
  5114. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5115. $ctx2.sendIdx["removeKey:ifAbsent:"]=1;
  5116. //>>excludeEnd("ctx");
  5117. $2=self._sampleNewValue();
  5118. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5119. $ctx2.sendIdx["sampleNewValue"]=2;
  5120. //>>excludeEnd("ctx");
  5121. self._assert_equals_($1,$2);
  5122. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5123. $ctx2.sendIdx["assert:equals:"]=1;
  5124. //>>excludeEnd("ctx");
  5125. $3=collection;
  5126. $4=self._collection();
  5127. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5128. $ctx2.sendIdx["collection"]=2;
  5129. //>>excludeEnd("ctx");
  5130. return self._assert_equals_($3,$4);
  5131. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5132. $ctx2.sendIdx["assert:equals:"]=2;
  5133. //>>excludeEnd("ctx");
  5134. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5135. }, function($ctx2) {$ctx2.fillBlock({each:each,collection:collection},$ctx1,1)});
  5136. //>>excludeEnd("ctx");
  5137. }));
  5138. self._samplesDo_((function(index,value){
  5139. var collection;
  5140. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5141. return $core.withContext(function($ctx2) {
  5142. //>>excludeEnd("ctx");
  5143. collection=self._collection();
  5144. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5145. $ctx2.sendIdx["collection"]=3;
  5146. //>>excludeEnd("ctx");
  5147. collection;
  5148. $5=$recv(collection)._removeKey_ifAbsent_(index,(function(){
  5149. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5150. return $core.withContext(function($ctx3) {
  5151. //>>excludeEnd("ctx");
  5152. return self._sampleNewValue();
  5153. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5154. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,4)});
  5155. //>>excludeEnd("ctx");
  5156. }));
  5157. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5158. $ctx2.sendIdx["removeKey:ifAbsent:"]=2;
  5159. //>>excludeEnd("ctx");
  5160. self._assert_equals_($5,value);
  5161. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5162. $ctx2.sendIdx["assert:equals:"]=3;
  5163. //>>excludeEnd("ctx");
  5164. $7=collection;
  5165. $8=self._collection();
  5166. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5167. $ctx2.sendIdx["collection"]=4;
  5168. //>>excludeEnd("ctx");
  5169. $6=$recv($7).__eq($8);
  5170. return self._deny_($6);
  5171. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5172. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value,collection:collection},$ctx1,3)});
  5173. //>>excludeEnd("ctx");
  5174. }));
  5175. $9=self._collectionWithNewValue();
  5176. $recv($9)._removeKey_ifAbsent_(self._sampleNewIndex(),(function(){
  5177. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5178. return $core.withContext(function($ctx2) {
  5179. //>>excludeEnd("ctx");
  5180. return self._assert_(false);
  5181. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5182. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,5)});
  5183. //>>excludeEnd("ctx");
  5184. }));
  5185. $10=$recv($9)._yourself();
  5186. self._assert_equals_($10,self._collection());
  5187. return self;
  5188. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5189. }, function($ctx1) {$ctx1.fill(self,"testRemoveKeyIfAbsent",{},$globals.AssociativeCollectionTest)});
  5190. //>>excludeEnd("ctx");
  5191. },
  5192. //>>excludeStart("ide", pragmas.excludeIdeData);
  5193. args: [],
  5194. 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",
  5195. referencedClasses: [],
  5196. //>>excludeEnd("ide");
  5197. messageSends: ["nonIndexesDo:", "collection", "assert:equals:", "removeKey:ifAbsent:", "sampleNewValue", "samplesDo:", "deny:", "=", "collectionWithNewValue", "sampleNewIndex", "assert:", "yourself"]
  5198. }),
  5199. $globals.AssociativeCollectionTest);
  5200. $core.addMethod(
  5201. $core.method({
  5202. selector: "testValues",
  5203. protocol: 'tests',
  5204. fn: function (){
  5205. var self=this;
  5206. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5207. return $core.withContext(function($ctx1) {
  5208. //>>excludeEnd("ctx");
  5209. var $2,$1,$3,$4;
  5210. $2=$recv($recv(self._collectionClass())._new())._values();
  5211. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5212. $ctx1.sendIdx["values"]=1;
  5213. //>>excludeEnd("ctx");
  5214. $1=$recv($2)._isEmpty();
  5215. self._assert_($1);
  5216. $3=$recv(self._collection())._values();
  5217. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5218. $ctx1.sendIdx["values"]=2;
  5219. //>>excludeEnd("ctx");
  5220. $4=self._collectionValues();
  5221. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5222. $ctx1.sendIdx["collectionValues"]=1;
  5223. //>>excludeEnd("ctx");
  5224. self._assertSameContents_as_($3,$4);
  5225. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5226. $ctx1.sendIdx["assertSameContents:as:"]=1;
  5227. //>>excludeEnd("ctx");
  5228. self._assertSameContents_as_($recv(self._collectionWithNewValue())._values(),$recv(self._collectionValues()).__comma([self._sampleNewValue()]));
  5229. return self;
  5230. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5231. }, function($ctx1) {$ctx1.fill(self,"testValues",{},$globals.AssociativeCollectionTest)});
  5232. //>>excludeEnd("ctx");
  5233. },
  5234. //>>excludeStart("ide", pragmas.excludeIdeData);
  5235. args: [],
  5236. 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 }",
  5237. referencedClasses: [],
  5238. //>>excludeEnd("ide");
  5239. messageSends: ["assert:", "isEmpty", "values", "new", "collectionClass", "assertSameContents:as:", "collection", "collectionValues", "collectionWithNewValue", ",", "sampleNewValue"]
  5240. }),
  5241. $globals.AssociativeCollectionTest);
  5242. $core.addClass('DictionaryTest', $globals.AssociativeCollectionTest, [], 'Kernel-Tests');
  5243. $core.addMethod(
  5244. $core.method({
  5245. selector: "collection",
  5246. protocol: 'fixture',
  5247. fn: function (){
  5248. var self=this;
  5249. function $Dictionary(){return $globals.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  5250. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5251. return $core.withContext(function($ctx1) {
  5252. //>>excludeEnd("ctx");
  5253. var $2,$3,$1;
  5254. $2=$recv($Dictionary())._new();
  5255. $recv($2)._at_put_((1),(1));
  5256. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5257. $ctx1.sendIdx["at:put:"]=1;
  5258. //>>excludeEnd("ctx");
  5259. $recv($2)._at_put_("a",(2));
  5260. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5261. $ctx1.sendIdx["at:put:"]=2;
  5262. //>>excludeEnd("ctx");
  5263. $recv($2)._at_put_(true,(3));
  5264. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5265. $ctx1.sendIdx["at:put:"]=3;
  5266. //>>excludeEnd("ctx");
  5267. $recv($2)._at_put_((1).__at((3)),(-4));
  5268. $3=$recv($2)._yourself();
  5269. $1=$3;
  5270. return $1;
  5271. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5272. }, function($ctx1) {$ctx1.fill(self,"collection",{},$globals.DictionaryTest)});
  5273. //>>excludeEnd("ctx");
  5274. },
  5275. //>>excludeStart("ide", pragmas.excludeIdeData);
  5276. args: [],
  5277. source: "collection\x0a\x09^ Dictionary new\x0a\x09\x09at: 1 put: 1;\x0a\x09\x09at: 'a' put: 2;\x0a\x09\x09at: true put: 3;\x0a\x09\x09at: 1@3 put: -4;\x0a\x09\x09yourself",
  5278. referencedClasses: ["Dictionary"],
  5279. //>>excludeEnd("ide");
  5280. messageSends: ["at:put:", "new", "@", "yourself"]
  5281. }),
  5282. $globals.DictionaryTest);
  5283. $core.addMethod(
  5284. $core.method({
  5285. selector: "collectionKeys",
  5286. protocol: 'fixture',
  5287. fn: function (){
  5288. var self=this;
  5289. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5290. return $core.withContext(function($ctx1) {
  5291. //>>excludeEnd("ctx");
  5292. var $1;
  5293. $1=[(1),"a",true,(1).__at((3))];
  5294. return $1;
  5295. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5296. }, function($ctx1) {$ctx1.fill(self,"collectionKeys",{},$globals.DictionaryTest)});
  5297. //>>excludeEnd("ctx");
  5298. },
  5299. //>>excludeStart("ide", pragmas.excludeIdeData);
  5300. args: [],
  5301. source: "collectionKeys\x0a\x09^ {1. 'a'. true. 1@3}",
  5302. referencedClasses: [],
  5303. //>>excludeEnd("ide");
  5304. messageSends: ["@"]
  5305. }),
  5306. $globals.DictionaryTest);
  5307. $core.addMethod(
  5308. $core.method({
  5309. selector: "collectionOfPrintStrings",
  5310. protocol: 'fixture',
  5311. fn: function (){
  5312. var self=this;
  5313. function $Dictionary(){return $globals.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  5314. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5315. return $core.withContext(function($ctx1) {
  5316. //>>excludeEnd("ctx");
  5317. var $2,$3,$1;
  5318. $2=$recv($Dictionary())._new();
  5319. $recv($2)._at_put_((1),"1");
  5320. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5321. $ctx1.sendIdx["at:put:"]=1;
  5322. //>>excludeEnd("ctx");
  5323. $recv($2)._at_put_("a","2");
  5324. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5325. $ctx1.sendIdx["at:put:"]=2;
  5326. //>>excludeEnd("ctx");
  5327. $recv($2)._at_put_(true,"3");
  5328. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5329. $ctx1.sendIdx["at:put:"]=3;
  5330. //>>excludeEnd("ctx");
  5331. $recv($2)._at_put_((1).__at((3)),"-4");
  5332. $3=$recv($2)._yourself();
  5333. $1=$3;
  5334. return $1;
  5335. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5336. }, function($ctx1) {$ctx1.fill(self,"collectionOfPrintStrings",{},$globals.DictionaryTest)});
  5337. //>>excludeEnd("ctx");
  5338. },
  5339. //>>excludeStart("ide", pragmas.excludeIdeData);
  5340. args: [],
  5341. source: "collectionOfPrintStrings\x0a\x09^ Dictionary new\x0a\x09\x09at: 1 put: '1';\x0a\x09\x09at: 'a' put: '2';\x0a\x09\x09at: true put: '3';\x0a\x09\x09at: 1@3 put: '-4';\x0a\x09\x09yourself",
  5342. referencedClasses: ["Dictionary"],
  5343. //>>excludeEnd("ide");
  5344. messageSends: ["at:put:", "new", "@", "yourself"]
  5345. }),
  5346. $globals.DictionaryTest);
  5347. $core.addMethod(
  5348. $core.method({
  5349. selector: "collectionSize",
  5350. protocol: 'fixture',
  5351. fn: function (){
  5352. var self=this;
  5353. return (4);
  5354. },
  5355. //>>excludeStart("ide", pragmas.excludeIdeData);
  5356. args: [],
  5357. source: "collectionSize\x0a\x09^ 4",
  5358. referencedClasses: [],
  5359. //>>excludeEnd("ide");
  5360. messageSends: []
  5361. }),
  5362. $globals.DictionaryTest);
  5363. $core.addMethod(
  5364. $core.method({
  5365. selector: "collectionValues",
  5366. protocol: 'fixture',
  5367. fn: function (){
  5368. var self=this;
  5369. var $1;
  5370. $1=[(1),(2),(3),(-4)];
  5371. return $1;
  5372. },
  5373. //>>excludeStart("ide", pragmas.excludeIdeData);
  5374. args: [],
  5375. source: "collectionValues\x0a\x09^ {1. 2. 3. -4}",
  5376. referencedClasses: [],
  5377. //>>excludeEnd("ide");
  5378. messageSends: []
  5379. }),
  5380. $globals.DictionaryTest);
  5381. $core.addMethod(
  5382. $core.method({
  5383. selector: "collectionWithDuplicates",
  5384. protocol: 'fixture',
  5385. fn: function (){
  5386. var self=this;
  5387. function $Dictionary(){return $globals.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  5388. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5389. return $core.withContext(function($ctx1) {
  5390. //>>excludeEnd("ctx");
  5391. var $2,$3,$1;
  5392. $2=$recv($Dictionary())._new();
  5393. $recv($2)._at_put_((1),(1));
  5394. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5395. $ctx1.sendIdx["at:put:"]=1;
  5396. //>>excludeEnd("ctx");
  5397. $recv($2)._at_put_("a",(2));
  5398. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5399. $ctx1.sendIdx["at:put:"]=2;
  5400. //>>excludeEnd("ctx");
  5401. $recv($2)._at_put_(true,(3));
  5402. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5403. $ctx1.sendIdx["at:put:"]=3;
  5404. //>>excludeEnd("ctx");
  5405. $recv($2)._at_put_((4),(-4));
  5406. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5407. $ctx1.sendIdx["at:put:"]=4;
  5408. //>>excludeEnd("ctx");
  5409. $recv($2)._at_put_("b",(1));
  5410. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5411. $ctx1.sendIdx["at:put:"]=5;
  5412. //>>excludeEnd("ctx");
  5413. $recv($2)._at_put_((3),(3));
  5414. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5415. $ctx1.sendIdx["at:put:"]=6;
  5416. //>>excludeEnd("ctx");
  5417. $recv($2)._at_put_(false,(12));
  5418. $3=$recv($2)._yourself();
  5419. $1=$3;
  5420. return $1;
  5421. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5422. }, function($ctx1) {$ctx1.fill(self,"collectionWithDuplicates",{},$globals.DictionaryTest)});
  5423. //>>excludeEnd("ctx");
  5424. },
  5425. //>>excludeStart("ide", pragmas.excludeIdeData);
  5426. args: [],
  5427. source: "collectionWithDuplicates\x0a\x09^ Dictionary new\x0a\x09\x09at: 1 put: 1;\x0a\x09\x09at: 'a' put: 2;\x0a\x09\x09at: true put: 3;\x0a\x09\x09at: 4 put: -4;\x0a\x09\x09at: 'b' put: 1;\x0a\x09\x09at: 3 put: 3;\x0a\x09\x09at: false put: 12;\x0a\x09\x09yourself",
  5428. referencedClasses: ["Dictionary"],
  5429. //>>excludeEnd("ide");
  5430. messageSends: ["at:put:", "new", "yourself"]
  5431. }),
  5432. $globals.DictionaryTest);
  5433. $core.addMethod(
  5434. $core.method({
  5435. selector: "collectionWithNewValue",
  5436. protocol: 'fixture',
  5437. fn: function (){
  5438. var self=this;
  5439. function $Dictionary(){return $globals.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  5440. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5441. return $core.withContext(function($ctx1) {
  5442. //>>excludeEnd("ctx");
  5443. var $2,$3,$1;
  5444. $2=$recv($Dictionary())._new();
  5445. $recv($2)._at_put_((1),(1));
  5446. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5447. $ctx1.sendIdx["at:put:"]=1;
  5448. //>>excludeEnd("ctx");
  5449. $recv($2)._at_put_("a",(2));
  5450. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5451. $ctx1.sendIdx["at:put:"]=2;
  5452. //>>excludeEnd("ctx");
  5453. $recv($2)._at_put_(true,(3));
  5454. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5455. $ctx1.sendIdx["at:put:"]=3;
  5456. //>>excludeEnd("ctx");
  5457. $recv($2)._at_put_((1).__at((3)),(-4));
  5458. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5459. $ctx1.sendIdx["at:put:"]=4;
  5460. //>>excludeEnd("ctx");
  5461. $recv($2)._at_put_("new","N");
  5462. $3=$recv($2)._yourself();
  5463. $1=$3;
  5464. return $1;
  5465. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5466. }, function($ctx1) {$ctx1.fill(self,"collectionWithNewValue",{},$globals.DictionaryTest)});
  5467. //>>excludeEnd("ctx");
  5468. },
  5469. //>>excludeStart("ide", pragmas.excludeIdeData);
  5470. args: [],
  5471. source: "collectionWithNewValue\x0a\x09^ Dictionary new\x0a\x09\x09at: 1 put: 1;\x0a\x09\x09at: 'a' put: 2;\x0a\x09\x09at: true put: 3;\x0a\x09\x09at: 1@3 put: -4;\x0a\x09\x09at: 'new' put: 'N';\x0a\x09\x09yourself",
  5472. referencedClasses: ["Dictionary"],
  5473. //>>excludeEnd("ide");
  5474. messageSends: ["at:put:", "new", "@", "yourself"]
  5475. }),
  5476. $globals.DictionaryTest);
  5477. $core.addMethod(
  5478. $core.method({
  5479. selector: "sampleNewValueAsCollection",
  5480. protocol: 'fixture',
  5481. fn: function (){
  5482. var self=this;
  5483. function $Dictionary(){return $globals.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  5484. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5485. return $core.withContext(function($ctx1) {
  5486. //>>excludeEnd("ctx");
  5487. var $2,$3,$1;
  5488. $2=$recv($Dictionary())._new();
  5489. $recv($2)._at_put_("new","N");
  5490. $3=$recv($2)._yourself();
  5491. $1=$3;
  5492. return $1;
  5493. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5494. }, function($ctx1) {$ctx1.fill(self,"sampleNewValueAsCollection",{},$globals.DictionaryTest)});
  5495. //>>excludeEnd("ctx");
  5496. },
  5497. //>>excludeStart("ide", pragmas.excludeIdeData);
  5498. args: [],
  5499. source: "sampleNewValueAsCollection\x0a\x09^ Dictionary new\x0a\x09\x09at: 'new' put: 'N';\x0a\x09\x09yourself",
  5500. referencedClasses: ["Dictionary"],
  5501. //>>excludeEnd("ide");
  5502. messageSends: ["at:put:", "new", "yourself"]
  5503. }),
  5504. $globals.DictionaryTest);
  5505. $core.addMethod(
  5506. $core.method({
  5507. selector: "samplesDo:",
  5508. protocol: 'fixture',
  5509. fn: function (aBlock){
  5510. var self=this;
  5511. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5512. return $core.withContext(function($ctx1) {
  5513. //>>excludeEnd("ctx");
  5514. (
  5515. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5516. $ctx1.supercall = true,
  5517. //>>excludeEnd("ctx");
  5518. $globals.DictionaryTest.superclass.fn.prototype._samplesDo_.apply($recv(self), [aBlock]));
  5519. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5520. $ctx1.supercall = false;
  5521. //>>excludeEnd("ctx");;
  5522. $recv(aBlock)._value_value_(true,(3));
  5523. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5524. $ctx1.sendIdx["value:value:"]=1;
  5525. //>>excludeEnd("ctx");
  5526. $recv(aBlock)._value_value_((1).__at((3)),(-4));
  5527. return self;
  5528. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5529. }, function($ctx1) {$ctx1.fill(self,"samplesDo:",{aBlock:aBlock},$globals.DictionaryTest)});
  5530. //>>excludeEnd("ctx");
  5531. },
  5532. //>>excludeStart("ide", pragmas.excludeIdeData);
  5533. args: ["aBlock"],
  5534. source: "samplesDo: aBlock\x0a\x09super samplesDo: aBlock.\x0a\x09aBlock value: true value: 3.\x0a\x09aBlock value: 1@3 value: -4",
  5535. referencedClasses: [],
  5536. //>>excludeEnd("ide");
  5537. messageSends: ["samplesDo:", "value:value:", "@"]
  5538. }),
  5539. $globals.DictionaryTest);
  5540. $core.addMethod(
  5541. $core.method({
  5542. selector: "testAccessing",
  5543. protocol: 'tests',
  5544. fn: function (){
  5545. var self=this;
  5546. var d;
  5547. function $Dictionary(){return $globals.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  5548. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5549. return $core.withContext(function($ctx1) {
  5550. //>>excludeEnd("ctx");
  5551. var $1,$2,$3,$4,$5,$6,$7,$9,$10,$8,$12,$13,$11;
  5552. d=$recv($Dictionary())._new();
  5553. $recv(d)._at_put_("hello","world");
  5554. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5555. $ctx1.sendIdx["at:put:"]=1;
  5556. //>>excludeEnd("ctx");
  5557. $1=$recv(d)._at_("hello");
  5558. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5559. $ctx1.sendIdx["at:"]=1;
  5560. //>>excludeEnd("ctx");
  5561. self._assert_equals_($1,"world");
  5562. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5563. $ctx1.sendIdx["assert:equals:"]=1;
  5564. //>>excludeEnd("ctx");
  5565. $2=$recv(d)._at_ifAbsent_("hello",(function(){
  5566. return nil;
  5567. }));
  5568. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5569. $ctx1.sendIdx["at:ifAbsent:"]=1;
  5570. //>>excludeEnd("ctx");
  5571. self._assert_equals_($2,"world");
  5572. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5573. $ctx1.sendIdx["assert:equals:"]=2;
  5574. //>>excludeEnd("ctx");
  5575. self._deny_($recv($recv(d)._at_ifAbsent_("foo",(function(){
  5576. return nil;
  5577. }))).__eq("world"));
  5578. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5579. $ctx1.sendIdx["deny:"]=1;
  5580. //>>excludeEnd("ctx");
  5581. $3=$recv(d)._includesKey_("hello");
  5582. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5583. $ctx1.sendIdx["includesKey:"]=1;
  5584. //>>excludeEnd("ctx");
  5585. self._assert_($3);
  5586. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5587. $ctx1.sendIdx["assert:"]=1;
  5588. //>>excludeEnd("ctx");
  5589. $4=$recv(d)._includesKey_("foo");
  5590. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5591. $ctx1.sendIdx["includesKey:"]=2;
  5592. //>>excludeEnd("ctx");
  5593. self._deny_($4);
  5594. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5595. $ctx1.sendIdx["deny:"]=2;
  5596. //>>excludeEnd("ctx");
  5597. $recv(d)._at_put_((1),(2));
  5598. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5599. $ctx1.sendIdx["at:put:"]=2;
  5600. //>>excludeEnd("ctx");
  5601. $5=$recv(d)._at_((1));
  5602. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5603. $ctx1.sendIdx["at:"]=2;
  5604. //>>excludeEnd("ctx");
  5605. self._assert_equals_($5,(2));
  5606. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5607. $ctx1.sendIdx["assert:equals:"]=3;
  5608. //>>excludeEnd("ctx");
  5609. $6=d;
  5610. $7=(1).__at((3));
  5611. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5612. $ctx1.sendIdx["@"]=1;
  5613. //>>excludeEnd("ctx");
  5614. $recv($6)._at_put_($7,(3));
  5615. $9=d;
  5616. $10=(1).__at((3));
  5617. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5618. $ctx1.sendIdx["@"]=2;
  5619. //>>excludeEnd("ctx");
  5620. $8=$recv($9)._at_($10);
  5621. self._assert_equals_($8,(3));
  5622. $12=d;
  5623. $13=(1).__at((3));
  5624. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5625. $ctx1.sendIdx["@"]=3;
  5626. //>>excludeEnd("ctx");
  5627. $11=$recv($12)._includesKey_($13);
  5628. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5629. $ctx1.sendIdx["includesKey:"]=3;
  5630. //>>excludeEnd("ctx");
  5631. self._assert_($11);
  5632. self._deny_($recv(d)._includesKey_((3).__at((1))));
  5633. return self;
  5634. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5635. }, function($ctx1) {$ctx1.fill(self,"testAccessing",{d:d},$globals.DictionaryTest)});
  5636. //>>excludeEnd("ctx");
  5637. },
  5638. //>>excludeStart("ide", pragmas.excludeIdeData);
  5639. args: [],
  5640. 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)",
  5641. referencedClasses: ["Dictionary"],
  5642. //>>excludeEnd("ide");
  5643. messageSends: ["new", "at:put:", "assert:equals:", "at:", "at:ifAbsent:", "deny:", "=", "assert:", "includesKey:", "@"]
  5644. }),
  5645. $globals.DictionaryTest);
  5646. $core.addMethod(
  5647. $core.method({
  5648. selector: "testDynamicDictionaries",
  5649. protocol: 'tests',
  5650. fn: function (){
  5651. var self=this;
  5652. function $Dictionary(){return $globals.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  5653. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5654. return $core.withContext(function($ctx1) {
  5655. //>>excludeEnd("ctx");
  5656. self._assert_equals_($recv($globals.HashedCollection._newFromPairs_(["hello",(1)]))._asDictionary(),$recv($Dictionary())._with_("hello".__minus_gt((1))));
  5657. return self;
  5658. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5659. }, function($ctx1) {$ctx1.fill(self,"testDynamicDictionaries",{},$globals.DictionaryTest)});
  5660. //>>excludeEnd("ctx");
  5661. },
  5662. //>>excludeStart("ide", pragmas.excludeIdeData);
  5663. args: [],
  5664. source: "testDynamicDictionaries\x0a\x09self assert: #{'hello' -> 1} asDictionary equals: (Dictionary with: 'hello' -> 1)",
  5665. referencedClasses: ["Dictionary"],
  5666. //>>excludeEnd("ide");
  5667. messageSends: ["assert:equals:", "asDictionary", "with:", "->"]
  5668. }),
  5669. $globals.DictionaryTest);
  5670. $core.addMethod(
  5671. $core.method({
  5672. selector: "collectionClass",
  5673. protocol: 'fixture',
  5674. fn: function (){
  5675. var self=this;
  5676. function $Dictionary(){return $globals.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  5677. return $Dictionary();
  5678. },
  5679. //>>excludeStart("ide", pragmas.excludeIdeData);
  5680. args: [],
  5681. source: "collectionClass\x0a\x09^ Dictionary",
  5682. referencedClasses: ["Dictionary"],
  5683. //>>excludeEnd("ide");
  5684. messageSends: []
  5685. }),
  5686. $globals.DictionaryTest.klass);
  5687. $core.addClass('HashedCollectionTest', $globals.AssociativeCollectionTest, [], 'Kernel-Tests');
  5688. $core.addMethod(
  5689. $core.method({
  5690. selector: "collection",
  5691. protocol: 'fixture',
  5692. fn: function (){
  5693. var self=this;
  5694. var $1;
  5695. $1=$globals.HashedCollection._newFromPairs_(["b",(1),"a",(2),"c",(3),"d",(-4)]);
  5696. return $1;
  5697. },
  5698. //>>excludeStart("ide", pragmas.excludeIdeData);
  5699. args: [],
  5700. source: "collection\x0a\x09^ #{ 'b' -> 1. 'a' -> 2. 'c' -> 3. 'd' -> -4 }",
  5701. referencedClasses: [],
  5702. //>>excludeEnd("ide");
  5703. messageSends: []
  5704. }),
  5705. $globals.HashedCollectionTest);
  5706. $core.addMethod(
  5707. $core.method({
  5708. selector: "collectionKeys",
  5709. protocol: 'fixture',
  5710. fn: function (){
  5711. var self=this;
  5712. var $1;
  5713. $1=["b","a","c","d"];
  5714. return $1;
  5715. },
  5716. //>>excludeStart("ide", pragmas.excludeIdeData);
  5717. args: [],
  5718. source: "collectionKeys\x0a\x09^ { 'b'. 'a'. 'c'. 'd' }",
  5719. referencedClasses: [],
  5720. //>>excludeEnd("ide");
  5721. messageSends: []
  5722. }),
  5723. $globals.HashedCollectionTest);
  5724. $core.addMethod(
  5725. $core.method({
  5726. selector: "collectionOfPrintStrings",
  5727. protocol: 'fixture',
  5728. fn: function (){
  5729. var self=this;
  5730. var $1;
  5731. $1=$globals.HashedCollection._newFromPairs_(["b","1","a","2","c","3","d","-4"]);
  5732. return $1;
  5733. },
  5734. //>>excludeStart("ide", pragmas.excludeIdeData);
  5735. args: [],
  5736. source: "collectionOfPrintStrings\x0a\x09^ #{ 'b' -> '1'. 'a' -> '2'. 'c' -> '3'. 'd' -> '-4' }",
  5737. referencedClasses: [],
  5738. //>>excludeEnd("ide");
  5739. messageSends: []
  5740. }),
  5741. $globals.HashedCollectionTest);
  5742. $core.addMethod(
  5743. $core.method({
  5744. selector: "collectionSize",
  5745. protocol: 'fixture',
  5746. fn: function (){
  5747. var self=this;
  5748. return (4);
  5749. },
  5750. //>>excludeStart("ide", pragmas.excludeIdeData);
  5751. args: [],
  5752. source: "collectionSize\x0a\x09^ 4",
  5753. referencedClasses: [],
  5754. //>>excludeEnd("ide");
  5755. messageSends: []
  5756. }),
  5757. $globals.HashedCollectionTest);
  5758. $core.addMethod(
  5759. $core.method({
  5760. selector: "collectionValues",
  5761. protocol: 'fixture',
  5762. fn: function (){
  5763. var self=this;
  5764. var $1;
  5765. $1=[(1),(2),(3),(-4)];
  5766. return $1;
  5767. },
  5768. //>>excludeStart("ide", pragmas.excludeIdeData);
  5769. args: [],
  5770. source: "collectionValues\x0a\x09^ { 1. 2. 3. -4 }",
  5771. referencedClasses: [],
  5772. //>>excludeEnd("ide");
  5773. messageSends: []
  5774. }),
  5775. $globals.HashedCollectionTest);
  5776. $core.addMethod(
  5777. $core.method({
  5778. selector: "collectionWithDuplicates",
  5779. protocol: 'fixture',
  5780. fn: function (){
  5781. var self=this;
  5782. var $1;
  5783. $1=$globals.HashedCollection._newFromPairs_(["b",(1),"a",(2),"c",(3),"d",(-4),"e",(1),"f",(2),"g",(10)]);
  5784. return $1;
  5785. },
  5786. //>>excludeStart("ide", pragmas.excludeIdeData);
  5787. args: [],
  5788. source: "collectionWithDuplicates\x0a\x09^ #{ 'b' -> 1. 'a' -> 2. 'c' -> 3. 'd' -> -4. 'e' -> 1. 'f' -> 2. 'g' -> 10 }",
  5789. referencedClasses: [],
  5790. //>>excludeEnd("ide");
  5791. messageSends: []
  5792. }),
  5793. $globals.HashedCollectionTest);
  5794. $core.addMethod(
  5795. $core.method({
  5796. selector: "collectionWithNewValue",
  5797. protocol: 'fixture',
  5798. fn: function (){
  5799. var self=this;
  5800. var $1;
  5801. $1=$globals.HashedCollection._newFromPairs_(["b",(1),"a",(2),"c",(3),"d",(-4),"new","N"]);
  5802. return $1;
  5803. },
  5804. //>>excludeStart("ide", pragmas.excludeIdeData);
  5805. args: [],
  5806. source: "collectionWithNewValue\x0a\x09^ #{ 'b' -> 1. 'a' -> 2. 'c' -> 3. 'd' -> -4. 'new' -> 'N' }",
  5807. referencedClasses: [],
  5808. //>>excludeEnd("ide");
  5809. messageSends: []
  5810. }),
  5811. $globals.HashedCollectionTest);
  5812. $core.addMethod(
  5813. $core.method({
  5814. selector: "sampleNewValueAsCollection",
  5815. protocol: 'fixture',
  5816. fn: function (){
  5817. var self=this;
  5818. var $1;
  5819. $1=$globals.HashedCollection._newFromPairs_(["new","N"]);
  5820. return $1;
  5821. },
  5822. //>>excludeStart("ide", pragmas.excludeIdeData);
  5823. args: [],
  5824. source: "sampleNewValueAsCollection\x0a\x09^ #{ 'new' -> 'N' }",
  5825. referencedClasses: [],
  5826. //>>excludeEnd("ide");
  5827. messageSends: []
  5828. }),
  5829. $globals.HashedCollectionTest);
  5830. $core.addMethod(
  5831. $core.method({
  5832. selector: "testDynamicDictionaries",
  5833. protocol: 'tests',
  5834. fn: function (){
  5835. var self=this;
  5836. function $HashedCollection(){return $globals.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
  5837. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5838. return $core.withContext(function($ctx1) {
  5839. //>>excludeEnd("ctx");
  5840. self._assert_equals_($recv($globals.HashedCollection._newFromPairs_(["hello",(1)]))._asHashedCollection(),$recv($HashedCollection())._with_("hello".__minus_gt((1))));
  5841. return self;
  5842. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5843. }, function($ctx1) {$ctx1.fill(self,"testDynamicDictionaries",{},$globals.HashedCollectionTest)});
  5844. //>>excludeEnd("ctx");
  5845. },
  5846. //>>excludeStart("ide", pragmas.excludeIdeData);
  5847. args: [],
  5848. source: "testDynamicDictionaries\x0a\x09self assert: #{'hello' -> 1} asHashedCollection equals: (HashedCollection with: 'hello' -> 1)",
  5849. referencedClasses: ["HashedCollection"],
  5850. //>>excludeEnd("ide");
  5851. messageSends: ["assert:equals:", "asHashedCollection", "with:", "->"]
  5852. }),
  5853. $globals.HashedCollectionTest);
  5854. $core.addMethod(
  5855. $core.method({
  5856. selector: "collectionClass",
  5857. protocol: 'fixture',
  5858. fn: function (){
  5859. var self=this;
  5860. function $HashedCollection(){return $globals.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
  5861. return $HashedCollection();
  5862. },
  5863. //>>excludeStart("ide", pragmas.excludeIdeData);
  5864. args: [],
  5865. source: "collectionClass\x0a\x09^ HashedCollection",
  5866. referencedClasses: ["HashedCollection"],
  5867. //>>excludeEnd("ide");
  5868. messageSends: []
  5869. }),
  5870. $globals.HashedCollectionTest.klass);
  5871. $core.addClass('SequenceableCollectionTest', $globals.IndexableCollectionTest, [], 'Kernel-Tests');
  5872. $core.addMethod(
  5873. $core.method({
  5874. selector: "collectionFirst",
  5875. protocol: 'fixture',
  5876. fn: function (){
  5877. var self=this;
  5878. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5879. return $core.withContext(function($ctx1) {
  5880. //>>excludeEnd("ctx");
  5881. self._subclassResponsibility();
  5882. return self;
  5883. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5884. }, function($ctx1) {$ctx1.fill(self,"collectionFirst",{},$globals.SequenceableCollectionTest)});
  5885. //>>excludeEnd("ctx");
  5886. },
  5887. //>>excludeStart("ide", pragmas.excludeIdeData);
  5888. args: [],
  5889. source: "collectionFirst\x0a\x09self subclassResponsibility",
  5890. referencedClasses: [],
  5891. //>>excludeEnd("ide");
  5892. messageSends: ["subclassResponsibility"]
  5893. }),
  5894. $globals.SequenceableCollectionTest);
  5895. $core.addMethod(
  5896. $core.method({
  5897. selector: "collectionFirstTwo",
  5898. protocol: 'fixture',
  5899. fn: function (){
  5900. var self=this;
  5901. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5902. return $core.withContext(function($ctx1) {
  5903. //>>excludeEnd("ctx");
  5904. self._subclassResponsibility();
  5905. return self;
  5906. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5907. }, function($ctx1) {$ctx1.fill(self,"collectionFirstTwo",{},$globals.SequenceableCollectionTest)});
  5908. //>>excludeEnd("ctx");
  5909. },
  5910. //>>excludeStart("ide", pragmas.excludeIdeData);
  5911. args: [],
  5912. source: "collectionFirstTwo\x0a\x09self subclassResponsibility",
  5913. referencedClasses: [],
  5914. //>>excludeEnd("ide");
  5915. messageSends: ["subclassResponsibility"]
  5916. }),
  5917. $globals.SequenceableCollectionTest);
  5918. $core.addMethod(
  5919. $core.method({
  5920. selector: "collectionLast",
  5921. protocol: 'fixture',
  5922. fn: function (){
  5923. var self=this;
  5924. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5925. return $core.withContext(function($ctx1) {
  5926. //>>excludeEnd("ctx");
  5927. self._subclassResponsibility();
  5928. return self;
  5929. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5930. }, function($ctx1) {$ctx1.fill(self,"collectionLast",{},$globals.SequenceableCollectionTest)});
  5931. //>>excludeEnd("ctx");
  5932. },
  5933. //>>excludeStart("ide", pragmas.excludeIdeData);
  5934. args: [],
  5935. source: "collectionLast\x0a\x09self subclassResponsibility",
  5936. referencedClasses: [],
  5937. //>>excludeEnd("ide");
  5938. messageSends: ["subclassResponsibility"]
  5939. }),
  5940. $globals.SequenceableCollectionTest);
  5941. $core.addMethod(
  5942. $core.method({
  5943. selector: "collectionLastTwo",
  5944. protocol: 'fixture',
  5945. fn: function (){
  5946. var self=this;
  5947. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5948. return $core.withContext(function($ctx1) {
  5949. //>>excludeEnd("ctx");
  5950. self._subclassResponsibility();
  5951. return self;
  5952. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5953. }, function($ctx1) {$ctx1.fill(self,"collectionLastTwo",{},$globals.SequenceableCollectionTest)});
  5954. //>>excludeEnd("ctx");
  5955. },
  5956. //>>excludeStart("ide", pragmas.excludeIdeData);
  5957. args: [],
  5958. source: "collectionLastTwo\x0a\x09self subclassResponsibility",
  5959. referencedClasses: [],
  5960. //>>excludeEnd("ide");
  5961. messageSends: ["subclassResponsibility"]
  5962. }),
  5963. $globals.SequenceableCollectionTest);
  5964. $core.addMethod(
  5965. $core.method({
  5966. selector: "nonIndexesDo:",
  5967. protocol: 'fixture',
  5968. fn: function (aBlock){
  5969. var self=this;
  5970. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5971. return $core.withContext(function($ctx1) {
  5972. //>>excludeEnd("ctx");
  5973. $recv(aBlock)._value_((0));
  5974. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5975. $ctx1.sendIdx["value:"]=1;
  5976. //>>excludeEnd("ctx");
  5977. $recv(aBlock)._value_($recv(self._collectionSize()).__plus((1)));
  5978. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5979. $ctx1.sendIdx["value:"]=2;
  5980. //>>excludeEnd("ctx");
  5981. $recv(aBlock)._value_("z");
  5982. return self;
  5983. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  5984. }, function($ctx1) {$ctx1.fill(self,"nonIndexesDo:",{aBlock:aBlock},$globals.SequenceableCollectionTest)});
  5985. //>>excludeEnd("ctx");
  5986. },
  5987. //>>excludeStart("ide", pragmas.excludeIdeData);
  5988. args: ["aBlock"],
  5989. source: "nonIndexesDo: aBlock\x0a\x09aBlock value: 0.\x0a\x09aBlock value: self collectionSize + 1.\x0a\x09aBlock value: 'z'",
  5990. referencedClasses: [],
  5991. //>>excludeEnd("ide");
  5992. messageSends: ["value:", "+", "collectionSize"]
  5993. }),
  5994. $globals.SequenceableCollectionTest);
  5995. $core.addMethod(
  5996. $core.method({
  5997. selector: "samplesDo:",
  5998. protocol: 'fixture',
  5999. fn: function (aBlock){
  6000. var self=this;
  6001. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6002. return $core.withContext(function($ctx1) {
  6003. //>>excludeEnd("ctx");
  6004. $recv(aBlock)._value_value_((1),self._collectionFirst());
  6005. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6006. $ctx1.sendIdx["value:value:"]=1;
  6007. //>>excludeEnd("ctx");
  6008. $recv(aBlock)._value_value_(self._collectionSize(),self._collectionLast());
  6009. return self;
  6010. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6011. }, function($ctx1) {$ctx1.fill(self,"samplesDo:",{aBlock:aBlock},$globals.SequenceableCollectionTest)});
  6012. //>>excludeEnd("ctx");
  6013. },
  6014. //>>excludeStart("ide", pragmas.excludeIdeData);
  6015. args: ["aBlock"],
  6016. source: "samplesDo: aBlock\x0a\x09aBlock value: 1 value: self collectionFirst.\x0a\x09aBlock value: self collectionSize value: self collectionLast",
  6017. referencedClasses: [],
  6018. //>>excludeEnd("ide");
  6019. messageSends: ["value:value:", "collectionFirst", "collectionSize", "collectionLast"]
  6020. }),
  6021. $globals.SequenceableCollectionTest);
  6022. $core.addMethod(
  6023. $core.method({
  6024. selector: "testBeginsWith",
  6025. protocol: 'tests',
  6026. fn: function (){
  6027. var self=this;
  6028. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6029. return $core.withContext(function($ctx1) {
  6030. //>>excludeEnd("ctx");
  6031. var $2,$1,$4,$5,$3,$7,$6;
  6032. $2=self._collection();
  6033. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6034. $ctx1.sendIdx["collection"]=1;
  6035. //>>excludeEnd("ctx");
  6036. $1=$recv($2)._beginsWith_($recv(self._collectionClass())._new());
  6037. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6038. $ctx1.sendIdx["beginsWith:"]=1;
  6039. //>>excludeEnd("ctx");
  6040. self._assert_($1);
  6041. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6042. $ctx1.sendIdx["assert:"]=1;
  6043. //>>excludeEnd("ctx");
  6044. $4=self._collection();
  6045. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6046. $ctx1.sendIdx["collection"]=2;
  6047. //>>excludeEnd("ctx");
  6048. $5=self._collection();
  6049. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6050. $ctx1.sendIdx["collection"]=3;
  6051. //>>excludeEnd("ctx");
  6052. $3=$recv($4)._beginsWith_($5);
  6053. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6054. $ctx1.sendIdx["beginsWith:"]=2;
  6055. //>>excludeEnd("ctx");
  6056. self._assert_($3);
  6057. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6058. $ctx1.sendIdx["assert:"]=2;
  6059. //>>excludeEnd("ctx");
  6060. $7=self._collection();
  6061. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6062. $ctx1.sendIdx["collection"]=4;
  6063. //>>excludeEnd("ctx");
  6064. $6=$recv($7)._beginsWith_(self._collectionFirstTwo());
  6065. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6066. $ctx1.sendIdx["beginsWith:"]=3;
  6067. //>>excludeEnd("ctx");
  6068. self._assert_($6);
  6069. self._deny_($recv(self._collection())._beginsWith_(self._collectionLastTwo()));
  6070. return self;
  6071. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6072. }, function($ctx1) {$ctx1.fill(self,"testBeginsWith",{},$globals.SequenceableCollectionTest)});
  6073. //>>excludeEnd("ctx");
  6074. },
  6075. //>>excludeStart("ide", pragmas.excludeIdeData);
  6076. args: [],
  6077. 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)",
  6078. referencedClasses: [],
  6079. //>>excludeEnd("ide");
  6080. messageSends: ["assert:", "beginsWith:", "collection", "new", "collectionClass", "collectionFirstTwo", "deny:", "collectionLastTwo"]
  6081. }),
  6082. $globals.SequenceableCollectionTest);
  6083. $core.addMethod(
  6084. $core.method({
  6085. selector: "testEndsWith",
  6086. protocol: 'tests',
  6087. fn: function (){
  6088. var self=this;
  6089. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6090. return $core.withContext(function($ctx1) {
  6091. //>>excludeEnd("ctx");
  6092. var $2,$1,$4,$5,$3,$7,$6;
  6093. $2=self._collection();
  6094. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6095. $ctx1.sendIdx["collection"]=1;
  6096. //>>excludeEnd("ctx");
  6097. $1=$recv($2)._endsWith_($recv(self._collectionClass())._new());
  6098. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6099. $ctx1.sendIdx["endsWith:"]=1;
  6100. //>>excludeEnd("ctx");
  6101. self._assert_($1);
  6102. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6103. $ctx1.sendIdx["assert:"]=1;
  6104. //>>excludeEnd("ctx");
  6105. $4=self._collection();
  6106. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6107. $ctx1.sendIdx["collection"]=2;
  6108. //>>excludeEnd("ctx");
  6109. $5=self._collection();
  6110. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6111. $ctx1.sendIdx["collection"]=3;
  6112. //>>excludeEnd("ctx");
  6113. $3=$recv($4)._endsWith_($5);
  6114. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6115. $ctx1.sendIdx["endsWith:"]=2;
  6116. //>>excludeEnd("ctx");
  6117. self._assert_($3);
  6118. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6119. $ctx1.sendIdx["assert:"]=2;
  6120. //>>excludeEnd("ctx");
  6121. $7=self._collection();
  6122. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6123. $ctx1.sendIdx["collection"]=4;
  6124. //>>excludeEnd("ctx");
  6125. $6=$recv($7)._endsWith_(self._collectionLastTwo());
  6126. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6127. $ctx1.sendIdx["endsWith:"]=3;
  6128. //>>excludeEnd("ctx");
  6129. self._assert_($6);
  6130. self._deny_($recv(self._collection())._endsWith_(self._collectionFirstTwo()));
  6131. return self;
  6132. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6133. }, function($ctx1) {$ctx1.fill(self,"testEndsWith",{},$globals.SequenceableCollectionTest)});
  6134. //>>excludeEnd("ctx");
  6135. },
  6136. //>>excludeStart("ide", pragmas.excludeIdeData);
  6137. args: [],
  6138. 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)",
  6139. referencedClasses: [],
  6140. //>>excludeEnd("ide");
  6141. messageSends: ["assert:", "endsWith:", "collection", "new", "collectionClass", "collectionLastTwo", "deny:", "collectionFirstTwo"]
  6142. }),
  6143. $globals.SequenceableCollectionTest);
  6144. $core.addMethod(
  6145. $core.method({
  6146. selector: "testFirst",
  6147. protocol: 'tests',
  6148. fn: function (){
  6149. var self=this;
  6150. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6151. return $core.withContext(function($ctx1) {
  6152. //>>excludeEnd("ctx");
  6153. self._assert_equals_($recv(self._collection())._first(),self._collectionFirst());
  6154. return self;
  6155. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6156. }, function($ctx1) {$ctx1.fill(self,"testFirst",{},$globals.SequenceableCollectionTest)});
  6157. //>>excludeEnd("ctx");
  6158. },
  6159. //>>excludeStart("ide", pragmas.excludeIdeData);
  6160. args: [],
  6161. source: "testFirst\x0a\x09self assert: self collection first equals: self collectionFirst",
  6162. referencedClasses: [],
  6163. //>>excludeEnd("ide");
  6164. messageSends: ["assert:equals:", "first", "collection", "collectionFirst"]
  6165. }),
  6166. $globals.SequenceableCollectionTest);
  6167. $core.addMethod(
  6168. $core.method({
  6169. selector: "testFirstN",
  6170. protocol: 'tests',
  6171. fn: function (){
  6172. var self=this;
  6173. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  6174. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6175. return $core.withContext(function($ctx1) {
  6176. //>>excludeEnd("ctx");
  6177. var $2,$1,$4,$3,$6,$5,$7;
  6178. $2=self._collection();
  6179. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6180. $ctx1.sendIdx["collection"]=1;
  6181. //>>excludeEnd("ctx");
  6182. $1=$recv($2)._first_((2));
  6183. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6184. $ctx1.sendIdx["first:"]=1;
  6185. //>>excludeEnd("ctx");
  6186. self._assert_equals_($1,self._collectionFirstTwo());
  6187. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6188. $ctx1.sendIdx["assert:equals:"]=1;
  6189. //>>excludeEnd("ctx");
  6190. $4=self._collection();
  6191. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6192. $ctx1.sendIdx["collection"]=2;
  6193. //>>excludeEnd("ctx");
  6194. $3=$recv($4)._first_((0));
  6195. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6196. $ctx1.sendIdx["first:"]=2;
  6197. //>>excludeEnd("ctx");
  6198. self._assert_equals_($3,$recv(self._collectionClass())._new());
  6199. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6200. $ctx1.sendIdx["assert:equals:"]=2;
  6201. //>>excludeEnd("ctx");
  6202. $6=self._collection();
  6203. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6204. $ctx1.sendIdx["collection"]=3;
  6205. //>>excludeEnd("ctx");
  6206. $5=$recv($6)._first_(self._collectionSize());
  6207. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6208. $ctx1.sendIdx["first:"]=3;
  6209. //>>excludeEnd("ctx");
  6210. $7=self._collection();
  6211. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6212. $ctx1.sendIdx["collection"]=4;
  6213. //>>excludeEnd("ctx");
  6214. self._assert_equals_($5,$7);
  6215. self._should_raise_((function(){
  6216. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6217. return $core.withContext(function($ctx2) {
  6218. //>>excludeEnd("ctx");
  6219. return $recv(self._collection())._first_((33));
  6220. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6221. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  6222. //>>excludeEnd("ctx");
  6223. }),$Error());
  6224. return self;
  6225. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6226. }, function($ctx1) {$ctx1.fill(self,"testFirstN",{},$globals.SequenceableCollectionTest)});
  6227. //>>excludeEnd("ctx");
  6228. },
  6229. //>>excludeStart("ide", pragmas.excludeIdeData);
  6230. args: [],
  6231. 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",
  6232. referencedClasses: ["Error"],
  6233. //>>excludeEnd("ide");
  6234. messageSends: ["assert:equals:", "first:", "collection", "collectionFirstTwo", "new", "collectionClass", "collectionSize", "should:raise:"]
  6235. }),
  6236. $globals.SequenceableCollectionTest);
  6237. $core.addMethod(
  6238. $core.method({
  6239. selector: "testFourth",
  6240. protocol: 'tests',
  6241. fn: function (){
  6242. var self=this;
  6243. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6244. return $core.withContext(function($ctx1) {
  6245. //>>excludeEnd("ctx");
  6246. var $2,$1;
  6247. $2=self._collection();
  6248. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6249. $ctx1.sendIdx["collection"]=1;
  6250. //>>excludeEnd("ctx");
  6251. $1=$recv($2)._fourth();
  6252. self._assert_equals_($1,$recv(self._collection())._at_((4)));
  6253. return self;
  6254. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6255. }, function($ctx1) {$ctx1.fill(self,"testFourth",{},$globals.SequenceableCollectionTest)});
  6256. //>>excludeEnd("ctx");
  6257. },
  6258. //>>excludeStart("ide", pragmas.excludeIdeData);
  6259. args: [],
  6260. source: "testFourth\x0a\x09self assert: (self collection fourth) equals: (self collection at: 4)",
  6261. referencedClasses: [],
  6262. //>>excludeEnd("ide");
  6263. messageSends: ["assert:equals:", "fourth", "collection", "at:"]
  6264. }),
  6265. $globals.SequenceableCollectionTest);
  6266. $core.addMethod(
  6267. $core.method({
  6268. selector: "testIndexOfStartingAt",
  6269. protocol: 'tests',
  6270. fn: function (){
  6271. var self=this;
  6272. var jsNull;
  6273. function $JSON(){return $globals.JSON||(typeof JSON=="undefined"?nil:JSON)}
  6274. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6275. return $core.withContext(function($ctx1) {
  6276. //>>excludeEnd("ctx");
  6277. var $2,$1,$4,$3;
  6278. jsNull=$recv($JSON())._parse_("null");
  6279. self._samplesDo_((function(index,value){
  6280. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6281. return $core.withContext(function($ctx2) {
  6282. //>>excludeEnd("ctx");
  6283. $2=self._collection();
  6284. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6285. $ctx2.sendIdx["collection"]=1;
  6286. //>>excludeEnd("ctx");
  6287. $1=$recv($2)._indexOf_startingAt_(value,(1));
  6288. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6289. $ctx2.sendIdx["indexOf:startingAt:"]=1;
  6290. //>>excludeEnd("ctx");
  6291. self._assert_equals_($1,index);
  6292. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6293. $ctx2.sendIdx["assert:equals:"]=1;
  6294. //>>excludeEnd("ctx");
  6295. $4=self._collection();
  6296. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6297. $ctx2.sendIdx["collection"]=2;
  6298. //>>excludeEnd("ctx");
  6299. $3=$recv($4)._indexOf_startingAt_(value,index);
  6300. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6301. $ctx2.sendIdx["indexOf:startingAt:"]=2;
  6302. //>>excludeEnd("ctx");
  6303. self._assert_equals_($3,index);
  6304. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6305. $ctx2.sendIdx["assert:equals:"]=2;
  6306. //>>excludeEnd("ctx");
  6307. return self._assert_equals_($recv(self._collection())._indexOf_startingAt_(value,$recv(index).__plus((1))),(0));
  6308. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6309. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value},$ctx1,1)});
  6310. //>>excludeEnd("ctx");
  6311. }));
  6312. return self;
  6313. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6314. }, function($ctx1) {$ctx1.fill(self,"testIndexOfStartingAt",{jsNull:jsNull},$globals.SequenceableCollectionTest)});
  6315. //>>excludeEnd("ctx");
  6316. },
  6317. //>>excludeStart("ide", pragmas.excludeIdeData);
  6318. args: [],
  6319. 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 ]",
  6320. referencedClasses: ["JSON"],
  6321. //>>excludeEnd("ide");
  6322. messageSends: ["parse:", "samplesDo:", "assert:equals:", "indexOf:startingAt:", "collection", "+"]
  6323. }),
  6324. $globals.SequenceableCollectionTest);
  6325. $core.addMethod(
  6326. $core.method({
  6327. selector: "testIndexOfStartingAtWithNull",
  6328. protocol: 'tests',
  6329. fn: function (){
  6330. var self=this;
  6331. var jsNull;
  6332. function $JSON(){return $globals.JSON||(typeof JSON=="undefined"?nil:JSON)}
  6333. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6334. return $core.withContext(function($ctx1) {
  6335. //>>excludeEnd("ctx");
  6336. var $1,$2;
  6337. jsNull=$recv($JSON())._parse_("null");
  6338. self._samplesDo_((function(index,value){
  6339. var collection;
  6340. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6341. return $core.withContext(function($ctx2) {
  6342. //>>excludeEnd("ctx");
  6343. collection=self._collection();
  6344. collection;
  6345. $recv(collection)._at_put_(index,jsNull);
  6346. $1=$recv(collection)._indexOf_startingAt_(jsNull,(1));
  6347. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6348. $ctx2.sendIdx["indexOf:startingAt:"]=1;
  6349. //>>excludeEnd("ctx");
  6350. self._assert_equals_($1,index);
  6351. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6352. $ctx2.sendIdx["assert:equals:"]=1;
  6353. //>>excludeEnd("ctx");
  6354. $2=$recv(collection)._indexOf_startingAt_(jsNull,index);
  6355. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6356. $ctx2.sendIdx["indexOf:startingAt:"]=2;
  6357. //>>excludeEnd("ctx");
  6358. self._assert_equals_($2,index);
  6359. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6360. $ctx2.sendIdx["assert:equals:"]=2;
  6361. //>>excludeEnd("ctx");
  6362. return self._assert_equals_($recv(collection)._indexOf_startingAt_(jsNull,$recv(index).__plus((1))),(0));
  6363. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6364. }, function($ctx2) {$ctx2.fillBlock({index:index,value:value,collection:collection},$ctx1,1)});
  6365. //>>excludeEnd("ctx");
  6366. }));
  6367. return self;
  6368. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6369. }, function($ctx1) {$ctx1.fill(self,"testIndexOfStartingAtWithNull",{jsNull:jsNull},$globals.SequenceableCollectionTest)});
  6370. //>>excludeEnd("ctx");
  6371. },
  6372. //>>excludeStart("ide", pragmas.excludeIdeData);
  6373. args: [],
  6374. 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 ]",
  6375. referencedClasses: ["JSON"],
  6376. //>>excludeEnd("ide");
  6377. messageSends: ["parse:", "samplesDo:", "collection", "at:put:", "assert:equals:", "indexOf:startingAt:", "+"]
  6378. }),
  6379. $globals.SequenceableCollectionTest);
  6380. $core.addMethod(
  6381. $core.method({
  6382. selector: "testLast",
  6383. protocol: 'tests',
  6384. fn: function (){
  6385. var self=this;
  6386. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6387. return $core.withContext(function($ctx1) {
  6388. //>>excludeEnd("ctx");
  6389. self._assert_equals_($recv(self._collection())._last(),self._collectionLast());
  6390. return self;
  6391. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6392. }, function($ctx1) {$ctx1.fill(self,"testLast",{},$globals.SequenceableCollectionTest)});
  6393. //>>excludeEnd("ctx");
  6394. },
  6395. //>>excludeStart("ide", pragmas.excludeIdeData);
  6396. args: [],
  6397. source: "testLast\x0a\x09self assert: self collection last equals: self collectionLast",
  6398. referencedClasses: [],
  6399. //>>excludeEnd("ide");
  6400. messageSends: ["assert:equals:", "last", "collection", "collectionLast"]
  6401. }),
  6402. $globals.SequenceableCollectionTest);
  6403. $core.addMethod(
  6404. $core.method({
  6405. selector: "testLastN",
  6406. protocol: 'tests',
  6407. fn: function (){
  6408. var self=this;
  6409. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  6410. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6411. return $core.withContext(function($ctx1) {
  6412. //>>excludeEnd("ctx");
  6413. var $2,$1,$4,$3,$6,$5,$7;
  6414. $2=self._collection();
  6415. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6416. $ctx1.sendIdx["collection"]=1;
  6417. //>>excludeEnd("ctx");
  6418. $1=$recv($2)._last_((2));
  6419. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6420. $ctx1.sendIdx["last:"]=1;
  6421. //>>excludeEnd("ctx");
  6422. self._assert_equals_($1,self._collectionLastTwo());
  6423. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6424. $ctx1.sendIdx["assert:equals:"]=1;
  6425. //>>excludeEnd("ctx");
  6426. $4=self._collection();
  6427. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6428. $ctx1.sendIdx["collection"]=2;
  6429. //>>excludeEnd("ctx");
  6430. $3=$recv($4)._last_((0));
  6431. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6432. $ctx1.sendIdx["last:"]=2;
  6433. //>>excludeEnd("ctx");
  6434. self._assert_equals_($3,$recv(self._collectionClass())._new());
  6435. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6436. $ctx1.sendIdx["assert:equals:"]=2;
  6437. //>>excludeEnd("ctx");
  6438. $6=self._collection();
  6439. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6440. $ctx1.sendIdx["collection"]=3;
  6441. //>>excludeEnd("ctx");
  6442. $5=$recv($6)._last_(self._collectionSize());
  6443. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6444. $ctx1.sendIdx["last:"]=3;
  6445. //>>excludeEnd("ctx");
  6446. $7=self._collection();
  6447. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6448. $ctx1.sendIdx["collection"]=4;
  6449. //>>excludeEnd("ctx");
  6450. self._assert_equals_($5,$7);
  6451. self._should_raise_((function(){
  6452. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6453. return $core.withContext(function($ctx2) {
  6454. //>>excludeEnd("ctx");
  6455. return $recv(self._collection())._last_((33));
  6456. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6457. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  6458. //>>excludeEnd("ctx");
  6459. }),$Error());
  6460. return self;
  6461. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6462. }, function($ctx1) {$ctx1.fill(self,"testLastN",{},$globals.SequenceableCollectionTest)});
  6463. //>>excludeEnd("ctx");
  6464. },
  6465. //>>excludeStart("ide", pragmas.excludeIdeData);
  6466. args: [],
  6467. 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",
  6468. referencedClasses: ["Error"],
  6469. //>>excludeEnd("ide");
  6470. messageSends: ["assert:equals:", "last:", "collection", "collectionLastTwo", "new", "collectionClass", "collectionSize", "should:raise:"]
  6471. }),
  6472. $globals.SequenceableCollectionTest);
  6473. $core.addMethod(
  6474. $core.method({
  6475. selector: "testSecond",
  6476. protocol: 'tests',
  6477. fn: function (){
  6478. var self=this;
  6479. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6480. return $core.withContext(function($ctx1) {
  6481. //>>excludeEnd("ctx");
  6482. var $2,$1;
  6483. $2=self._collection();
  6484. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6485. $ctx1.sendIdx["collection"]=1;
  6486. //>>excludeEnd("ctx");
  6487. $1=$recv($2)._second();
  6488. self._assert_equals_($1,$recv(self._collection())._at_((2)));
  6489. return self;
  6490. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6491. }, function($ctx1) {$ctx1.fill(self,"testSecond",{},$globals.SequenceableCollectionTest)});
  6492. //>>excludeEnd("ctx");
  6493. },
  6494. //>>excludeStart("ide", pragmas.excludeIdeData);
  6495. args: [],
  6496. source: "testSecond\x0a\x09self assert: (self collection second) equals: (self collection at: 2)",
  6497. referencedClasses: [],
  6498. //>>excludeEnd("ide");
  6499. messageSends: ["assert:equals:", "second", "collection", "at:"]
  6500. }),
  6501. $globals.SequenceableCollectionTest);
  6502. $core.addMethod(
  6503. $core.method({
  6504. selector: "testThird",
  6505. protocol: 'tests',
  6506. fn: function (){
  6507. var self=this;
  6508. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6509. return $core.withContext(function($ctx1) {
  6510. //>>excludeEnd("ctx");
  6511. var $2,$1;
  6512. $2=self._collection();
  6513. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6514. $ctx1.sendIdx["collection"]=1;
  6515. //>>excludeEnd("ctx");
  6516. $1=$recv($2)._third();
  6517. self._assert_equals_($1,$recv(self._collection())._at_((3)));
  6518. return self;
  6519. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6520. }, function($ctx1) {$ctx1.fill(self,"testThird",{},$globals.SequenceableCollectionTest)});
  6521. //>>excludeEnd("ctx");
  6522. },
  6523. //>>excludeStart("ide", pragmas.excludeIdeData);
  6524. args: [],
  6525. source: "testThird\x0a\x09self assert: (self collection third) equals: (self collection at: 3)",
  6526. referencedClasses: [],
  6527. //>>excludeEnd("ide");
  6528. messageSends: ["assert:equals:", "third", "collection", "at:"]
  6529. }),
  6530. $globals.SequenceableCollectionTest);
  6531. $core.addClass('ArrayTest', $globals.SequenceableCollectionTest, [], 'Kernel-Tests');
  6532. $core.addMethod(
  6533. $core.method({
  6534. selector: "collection",
  6535. protocol: 'fixture',
  6536. fn: function (){
  6537. var self=this;
  6538. var $1;
  6539. $1=[(1), (2), (3), (-4)];
  6540. return $1;
  6541. },
  6542. //>>excludeStart("ide", pragmas.excludeIdeData);
  6543. args: [],
  6544. source: "collection\x0a\x09^ #(1 2 3 -4)",
  6545. referencedClasses: [],
  6546. //>>excludeEnd("ide");
  6547. messageSends: []
  6548. }),
  6549. $globals.ArrayTest);
  6550. $core.addMethod(
  6551. $core.method({
  6552. selector: "collectionFirst",
  6553. protocol: 'fixture',
  6554. fn: function (){
  6555. var self=this;
  6556. return (1);
  6557. },
  6558. //>>excludeStart("ide", pragmas.excludeIdeData);
  6559. args: [],
  6560. source: "collectionFirst\x0a\x09^ 1",
  6561. referencedClasses: [],
  6562. //>>excludeEnd("ide");
  6563. messageSends: []
  6564. }),
  6565. $globals.ArrayTest);
  6566. $core.addMethod(
  6567. $core.method({
  6568. selector: "collectionFirstTwo",
  6569. protocol: 'fixture',
  6570. fn: function (){
  6571. var self=this;
  6572. var $1;
  6573. $1=[(1), (2)];
  6574. return $1;
  6575. },
  6576. //>>excludeStart("ide", pragmas.excludeIdeData);
  6577. args: [],
  6578. source: "collectionFirstTwo\x0a\x09^ #(1 2)",
  6579. referencedClasses: [],
  6580. //>>excludeEnd("ide");
  6581. messageSends: []
  6582. }),
  6583. $globals.ArrayTest);
  6584. $core.addMethod(
  6585. $core.method({
  6586. selector: "collectionLast",
  6587. protocol: 'fixture',
  6588. fn: function (){
  6589. var self=this;
  6590. return (-4);
  6591. },
  6592. //>>excludeStart("ide", pragmas.excludeIdeData);
  6593. args: [],
  6594. source: "collectionLast\x0a\x09^ -4",
  6595. referencedClasses: [],
  6596. //>>excludeEnd("ide");
  6597. messageSends: []
  6598. }),
  6599. $globals.ArrayTest);
  6600. $core.addMethod(
  6601. $core.method({
  6602. selector: "collectionLastTwo",
  6603. protocol: 'fixture',
  6604. fn: function (){
  6605. var self=this;
  6606. var $1;
  6607. $1=[(3), (-4)];
  6608. return $1;
  6609. },
  6610. //>>excludeStart("ide", pragmas.excludeIdeData);
  6611. args: [],
  6612. source: "collectionLastTwo\x0a\x09^ #(3 -4)",
  6613. referencedClasses: [],
  6614. //>>excludeEnd("ide");
  6615. messageSends: []
  6616. }),
  6617. $globals.ArrayTest);
  6618. $core.addMethod(
  6619. $core.method({
  6620. selector: "collectionOfPrintStrings",
  6621. protocol: 'fixture',
  6622. fn: function (){
  6623. var self=this;
  6624. var $1;
  6625. $1=["1", "2", "3", "-4"];
  6626. return $1;
  6627. },
  6628. //>>excludeStart("ide", pragmas.excludeIdeData);
  6629. args: [],
  6630. source: "collectionOfPrintStrings\x0a\x09^ #('1' '2' '3' '-4')",
  6631. referencedClasses: [],
  6632. //>>excludeEnd("ide");
  6633. messageSends: []
  6634. }),
  6635. $globals.ArrayTest);
  6636. $core.addMethod(
  6637. $core.method({
  6638. selector: "collectionSize",
  6639. protocol: 'fixture',
  6640. fn: function (){
  6641. var self=this;
  6642. return (4);
  6643. },
  6644. //>>excludeStart("ide", pragmas.excludeIdeData);
  6645. args: [],
  6646. source: "collectionSize\x0a\x09^ 4",
  6647. referencedClasses: [],
  6648. //>>excludeEnd("ide");
  6649. messageSends: []
  6650. }),
  6651. $globals.ArrayTest);
  6652. $core.addMethod(
  6653. $core.method({
  6654. selector: "collectionWithDuplicates",
  6655. protocol: 'fixture',
  6656. fn: function (){
  6657. var self=this;
  6658. var $1;
  6659. $1=["a", "b", "c", (1), (2), (1), "a"];
  6660. return $1;
  6661. },
  6662. //>>excludeStart("ide", pragmas.excludeIdeData);
  6663. args: [],
  6664. source: "collectionWithDuplicates\x0a\x09^ #('a' 'b' 'c' 1 2 1 'a')",
  6665. referencedClasses: [],
  6666. //>>excludeEnd("ide");
  6667. messageSends: []
  6668. }),
  6669. $globals.ArrayTest);
  6670. $core.addMethod(
  6671. $core.method({
  6672. selector: "collectionWithNewValue",
  6673. protocol: 'fixture',
  6674. fn: function (){
  6675. var self=this;
  6676. var $1;
  6677. $1=[(1), (2), (3), (-4), "N"];
  6678. return $1;
  6679. },
  6680. //>>excludeStart("ide", pragmas.excludeIdeData);
  6681. args: [],
  6682. source: "collectionWithNewValue\x0a\x09^ #(1 2 3 -4 'N')",
  6683. referencedClasses: [],
  6684. //>>excludeEnd("ide");
  6685. messageSends: []
  6686. }),
  6687. $globals.ArrayTest);
  6688. $core.addMethod(
  6689. $core.method({
  6690. selector: "sampleNewIndex",
  6691. protocol: 'fixture',
  6692. fn: function (){
  6693. var self=this;
  6694. return (5);
  6695. },
  6696. //>>excludeStart("ide", pragmas.excludeIdeData);
  6697. args: [],
  6698. source: "sampleNewIndex\x0a\x09^ 5",
  6699. referencedClasses: [],
  6700. //>>excludeEnd("ide");
  6701. messageSends: []
  6702. }),
  6703. $globals.ArrayTest);
  6704. $core.addMethod(
  6705. $core.method({
  6706. selector: "samplesDo:",
  6707. protocol: 'fixture',
  6708. fn: function (aBlock){
  6709. var self=this;
  6710. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6711. return $core.withContext(function($ctx1) {
  6712. //>>excludeEnd("ctx");
  6713. (
  6714. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6715. $ctx1.supercall = true,
  6716. //>>excludeEnd("ctx");
  6717. $globals.ArrayTest.superclass.fn.prototype._samplesDo_.apply($recv(self), [aBlock]));
  6718. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6719. $ctx1.supercall = false;
  6720. //>>excludeEnd("ctx");;
  6721. $recv(aBlock)._value_value_((3),(3));
  6722. return self;
  6723. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6724. }, function($ctx1) {$ctx1.fill(self,"samplesDo:",{aBlock:aBlock},$globals.ArrayTest)});
  6725. //>>excludeEnd("ctx");
  6726. },
  6727. //>>excludeStart("ide", pragmas.excludeIdeData);
  6728. args: ["aBlock"],
  6729. source: "samplesDo: aBlock\x0a\x09super samplesDo: aBlock.\x0a\x09aBlock value: 3 value: 3.",
  6730. referencedClasses: [],
  6731. //>>excludeEnd("ide");
  6732. messageSends: ["samplesDo:", "value:value:"]
  6733. }),
  6734. $globals.ArrayTest);
  6735. $core.addMethod(
  6736. $core.method({
  6737. selector: "testAdd",
  6738. protocol: 'tests',
  6739. fn: function (){
  6740. var self=this;
  6741. var array;
  6742. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6743. return $core.withContext(function($ctx1) {
  6744. //>>excludeEnd("ctx");
  6745. array=self._collection();
  6746. $recv(array)._add_((6));
  6747. self._assert_equals_($recv(array)._last(),(6));
  6748. return self;
  6749. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6750. }, function($ctx1) {$ctx1.fill(self,"testAdd",{array:array},$globals.ArrayTest)});
  6751. //>>excludeEnd("ctx");
  6752. },
  6753. //>>excludeStart("ide", pragmas.excludeIdeData);
  6754. args: [],
  6755. source: "testAdd \x0a\x09| array | \x0a\x09array := self collection. \x0a\x09array add: 6.\x0a\x09\x0a\x09self assert: array last equals: 6",
  6756. referencedClasses: [],
  6757. //>>excludeEnd("ide");
  6758. messageSends: ["collection", "add:", "assert:equals:", "last"]
  6759. }),
  6760. $globals.ArrayTest);
  6761. $core.addMethod(
  6762. $core.method({
  6763. selector: "testAddFirst",
  6764. protocol: 'tests',
  6765. fn: function (){
  6766. var self=this;
  6767. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6768. return $core.withContext(function($ctx1) {
  6769. //>>excludeEnd("ctx");
  6770. var $1,$2;
  6771. $1=self._collection();
  6772. $recv($1)._addFirst_((0));
  6773. $2=$recv($1)._yourself();
  6774. self._assert_equals_($recv($2)._first(),(0));
  6775. return self;
  6776. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6777. }, function($ctx1) {$ctx1.fill(self,"testAddFirst",{},$globals.ArrayTest)});
  6778. //>>excludeEnd("ctx");
  6779. },
  6780. //>>excludeStart("ide", pragmas.excludeIdeData);
  6781. args: [],
  6782. source: "testAddFirst\x0a\x09self assert: (self collection addFirst: 0; yourself) first equals: 0",
  6783. referencedClasses: [],
  6784. //>>excludeEnd("ide");
  6785. messageSends: ["assert:equals:", "first", "addFirst:", "collection", "yourself"]
  6786. }),
  6787. $globals.ArrayTest);
  6788. $core.addMethod(
  6789. $core.method({
  6790. selector: "testPrintString",
  6791. protocol: 'tests',
  6792. fn: function (){
  6793. var self=this;
  6794. var array;
  6795. function $Array(){return $globals.Array||(typeof Array=="undefined"?nil:Array)}
  6796. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6797. return $core.withContext(function($ctx1) {
  6798. //>>excludeEnd("ctx");
  6799. var $1,$2,$3,$4,$5,$6,$7,$8,$9;
  6800. array=$recv($Array())._new();
  6801. $1=$recv(array)._printString();
  6802. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6803. $ctx1.sendIdx["printString"]=1;
  6804. //>>excludeEnd("ctx");
  6805. self._assert_equals_($1,"an Array ()");
  6806. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6807. $ctx1.sendIdx["assert:equals:"]=1;
  6808. //>>excludeEnd("ctx");
  6809. $2=array;
  6810. $recv($2)._add_((1));
  6811. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6812. $ctx1.sendIdx["add:"]=1;
  6813. //>>excludeEnd("ctx");
  6814. $3=$recv($2)._add_((3));
  6815. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6816. $ctx1.sendIdx["add:"]=2;
  6817. //>>excludeEnd("ctx");
  6818. $4=$recv(array)._printString();
  6819. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6820. $ctx1.sendIdx["printString"]=2;
  6821. //>>excludeEnd("ctx");
  6822. self._assert_equals_($4,"an Array (1 3)");
  6823. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6824. $ctx1.sendIdx["assert:equals:"]=2;
  6825. //>>excludeEnd("ctx");
  6826. $recv(array)._add_("foo");
  6827. $5=$recv(array)._printString();
  6828. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6829. $ctx1.sendIdx["printString"]=3;
  6830. //>>excludeEnd("ctx");
  6831. self._assert_equals_($5,"an Array (1 3 'foo')");
  6832. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6833. $ctx1.sendIdx["assert:equals:"]=3;
  6834. //>>excludeEnd("ctx");
  6835. $6=array;
  6836. $recv($6)._remove_((1));
  6837. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6838. $ctx1.sendIdx["remove:"]=1;
  6839. //>>excludeEnd("ctx");
  6840. $7=$recv($6)._remove_((3));
  6841. $8=$recv(array)._printString();
  6842. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6843. $ctx1.sendIdx["printString"]=4;
  6844. //>>excludeEnd("ctx");
  6845. self._assert_equals_($8,"an Array ('foo')");
  6846. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6847. $ctx1.sendIdx["assert:equals:"]=4;
  6848. //>>excludeEnd("ctx");
  6849. $recv(array)._addLast_((3));
  6850. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6851. $ctx1.sendIdx["addLast:"]=1;
  6852. //>>excludeEnd("ctx");
  6853. $9=$recv(array)._printString();
  6854. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6855. $ctx1.sendIdx["printString"]=5;
  6856. //>>excludeEnd("ctx");
  6857. self._assert_equals_($9,"an Array ('foo' 3)");
  6858. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6859. $ctx1.sendIdx["assert:equals:"]=5;
  6860. //>>excludeEnd("ctx");
  6861. $recv(array)._addLast_((3));
  6862. self._assert_equals_($recv(array)._printString(),"an Array ('foo' 3 3)");
  6863. return self;
  6864. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6865. }, function($ctx1) {$ctx1.fill(self,"testPrintString",{array:array},$globals.ArrayTest)});
  6866. //>>excludeEnd("ctx");
  6867. },
  6868. //>>excludeStart("ide", pragmas.excludeIdeData);
  6869. args: [],
  6870. 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)'.",
  6871. referencedClasses: ["Array"],
  6872. //>>excludeEnd("ide");
  6873. messageSends: ["new", "assert:equals:", "printString", "add:", "remove:", "addLast:"]
  6874. }),
  6875. $globals.ArrayTest);
  6876. $core.addMethod(
  6877. $core.method({
  6878. selector: "testRemove",
  6879. protocol: 'tests',
  6880. fn: function (){
  6881. var self=this;
  6882. var array;
  6883. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  6884. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6885. return $core.withContext(function($ctx1) {
  6886. //>>excludeEnd("ctx");
  6887. array=[(1), (2), (3), (4), (5)];
  6888. $recv(array)._remove_((3));
  6889. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6890. $ctx1.sendIdx["remove:"]=1;
  6891. //>>excludeEnd("ctx");
  6892. self._assert_equals_(array,[(1), (2), (4), (5)]);
  6893. self._should_raise_((function(){
  6894. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6895. return $core.withContext(function($ctx2) {
  6896. //>>excludeEnd("ctx");
  6897. return $recv(array)._remove_((3));
  6898. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6899. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  6900. //>>excludeEnd("ctx");
  6901. }),$Error());
  6902. return self;
  6903. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6904. }, function($ctx1) {$ctx1.fill(self,"testRemove",{array:array},$globals.ArrayTest)});
  6905. //>>excludeEnd("ctx");
  6906. },
  6907. //>>excludeStart("ide", pragmas.excludeIdeData);
  6908. args: [],
  6909. 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",
  6910. referencedClasses: ["Error"],
  6911. //>>excludeEnd("ide");
  6912. messageSends: ["remove:", "assert:equals:", "should:raise:"]
  6913. }),
  6914. $globals.ArrayTest);
  6915. $core.addMethod(
  6916. $core.method({
  6917. selector: "testRemoveFromTo",
  6918. protocol: 'tests',
  6919. fn: function (){
  6920. var self=this;
  6921. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6922. return $core.withContext(function($ctx1) {
  6923. //>>excludeEnd("ctx");
  6924. var $1,$2;
  6925. $1=[(1), (2), (3), (4)]._removeFrom_to_((1),(3));
  6926. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6927. $ctx1.sendIdx["removeFrom:to:"]=1;
  6928. //>>excludeEnd("ctx");
  6929. self._assert_equals_($1,[(4)]);
  6930. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6931. $ctx1.sendIdx["assert:equals:"]=1;
  6932. //>>excludeEnd("ctx");
  6933. $2=[(1), (2), (3), (4)]._removeFrom_to_((2),(3));
  6934. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6935. $ctx1.sendIdx["removeFrom:to:"]=2;
  6936. //>>excludeEnd("ctx");
  6937. self._assert_equals_($2,[(1), (4)]);
  6938. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6939. $ctx1.sendIdx["assert:equals:"]=2;
  6940. //>>excludeEnd("ctx");
  6941. self._assert_equals_([(1), (2), (3), (4)]._removeFrom_to_((2),(4)),[(1)]);
  6942. return self;
  6943. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6944. }, function($ctx1) {$ctx1.fill(self,"testRemoveFromTo",{},$globals.ArrayTest)});
  6945. //>>excludeEnd("ctx");
  6946. },
  6947. //>>excludeStart("ide", pragmas.excludeIdeData);
  6948. args: [],
  6949. 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)",
  6950. referencedClasses: [],
  6951. //>>excludeEnd("ide");
  6952. messageSends: ["assert:equals:", "removeFrom:to:"]
  6953. }),
  6954. $globals.ArrayTest);
  6955. $core.addMethod(
  6956. $core.method({
  6957. selector: "testRemoveIndex",
  6958. protocol: 'tests',
  6959. fn: function (){
  6960. var self=this;
  6961. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6962. return $core.withContext(function($ctx1) {
  6963. //>>excludeEnd("ctx");
  6964. var $1,$2;
  6965. $1=[(1), (2), (3), (4)]._removeIndex_((2));
  6966. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6967. $ctx1.sendIdx["removeIndex:"]=1;
  6968. //>>excludeEnd("ctx");
  6969. self._assert_equals_($1,[(1), (3), (4)]);
  6970. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6971. $ctx1.sendIdx["assert:equals:"]=1;
  6972. //>>excludeEnd("ctx");
  6973. $2=[(1), (2), (3), (4)]._removeIndex_((1));
  6974. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6975. $ctx1.sendIdx["removeIndex:"]=2;
  6976. //>>excludeEnd("ctx");
  6977. self._assert_equals_($2,[(2), (3), (4)]);
  6978. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6979. $ctx1.sendIdx["assert:equals:"]=2;
  6980. //>>excludeEnd("ctx");
  6981. self._assert_equals_(["hello"]._removeIndex_((1)),[]);
  6982. return self;
  6983. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  6984. }, function($ctx1) {$ctx1.fill(self,"testRemoveIndex",{},$globals.ArrayTest)});
  6985. //>>excludeEnd("ctx");
  6986. },
  6987. //>>excludeStart("ide", pragmas.excludeIdeData);
  6988. args: [],
  6989. 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: #()",
  6990. referencedClasses: [],
  6991. //>>excludeEnd("ide");
  6992. messageSends: ["assert:equals:", "removeIndex:"]
  6993. }),
  6994. $globals.ArrayTest);
  6995. $core.addMethod(
  6996. $core.method({
  6997. selector: "testRemoveLast",
  6998. protocol: 'tests',
  6999. fn: function (){
  7000. var self=this;
  7001. var array;
  7002. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7003. return $core.withContext(function($ctx1) {
  7004. //>>excludeEnd("ctx");
  7005. array=[(1), (2)];
  7006. $recv(array)._removeLast();
  7007. self._assert_equals_($recv(array)._last(),(1));
  7008. return self;
  7009. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7010. }, function($ctx1) {$ctx1.fill(self,"testRemoveLast",{array:array},$globals.ArrayTest)});
  7011. //>>excludeEnd("ctx");
  7012. },
  7013. //>>excludeStart("ide", pragmas.excludeIdeData);
  7014. args: [],
  7015. source: "testRemoveLast \x0a\x09| array |\x0a\x09array := #(1 2). \x0a\x09array removeLast.\x0a\x09\x0a\x09self assert: array last equals: 1",
  7016. referencedClasses: [],
  7017. //>>excludeEnd("ide");
  7018. messageSends: ["removeLast", "assert:equals:", "last"]
  7019. }),
  7020. $globals.ArrayTest);
  7021. $core.addMethod(
  7022. $core.method({
  7023. selector: "testReversed",
  7024. protocol: 'tests',
  7025. fn: function (){
  7026. var self=this;
  7027. var array;
  7028. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7029. return $core.withContext(function($ctx1) {
  7030. //>>excludeEnd("ctx");
  7031. array=[(5), (4), (3), (2), (1)];
  7032. self._assert_equals_($recv(array)._reversed(),[(1), (2), (3), (4), (5)]);
  7033. return self;
  7034. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7035. }, function($ctx1) {$ctx1.fill(self,"testReversed",{array:array},$globals.ArrayTest)});
  7036. //>>excludeEnd("ctx");
  7037. },
  7038. //>>excludeStart("ide", pragmas.excludeIdeData);
  7039. args: [],
  7040. source: "testReversed\x0a\x09|array|\x0a\x09array := #(5 4 3 2 1). \x0a\x09self assert: (array reversed) equals: #(1 2 3 4 5)",
  7041. referencedClasses: [],
  7042. //>>excludeEnd("ide");
  7043. messageSends: ["assert:equals:", "reversed"]
  7044. }),
  7045. $globals.ArrayTest);
  7046. $core.addMethod(
  7047. $core.method({
  7048. selector: "testSort",
  7049. protocol: 'tests',
  7050. fn: function (){
  7051. var self=this;
  7052. var array;
  7053. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7054. return $core.withContext(function($ctx1) {
  7055. //>>excludeEnd("ctx");
  7056. array=[(10), (1), (5)];
  7057. $recv(array)._sort();
  7058. self._assert_equals_(array,[(1), (5), (10)]);
  7059. return self;
  7060. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7061. }, function($ctx1) {$ctx1.fill(self,"testSort",{array:array},$globals.ArrayTest)});
  7062. //>>excludeEnd("ctx");
  7063. },
  7064. //>>excludeStart("ide", pragmas.excludeIdeData);
  7065. args: [],
  7066. source: "testSort\x0a\x09| array |\x0a\x09array := #(10 1 5). \x0a\x09array sort.\x0a\x09self assert: array equals: #(1 5 10)",
  7067. referencedClasses: [],
  7068. //>>excludeEnd("ide");
  7069. messageSends: ["sort", "assert:equals:"]
  7070. }),
  7071. $globals.ArrayTest);
  7072. $core.addMethod(
  7073. $core.method({
  7074. selector: "collectionClass",
  7075. protocol: 'fixture',
  7076. fn: function (){
  7077. var self=this;
  7078. function $Array(){return $globals.Array||(typeof Array=="undefined"?nil:Array)}
  7079. return $Array();
  7080. },
  7081. //>>excludeStart("ide", pragmas.excludeIdeData);
  7082. args: [],
  7083. source: "collectionClass\x0a\x09^ Array",
  7084. referencedClasses: ["Array"],
  7085. //>>excludeEnd("ide");
  7086. messageSends: []
  7087. }),
  7088. $globals.ArrayTest.klass);
  7089. $core.addClass('StringTest', $globals.SequenceableCollectionTest, [], 'Kernel-Tests');
  7090. $core.addMethod(
  7091. $core.method({
  7092. selector: "collection",
  7093. protocol: 'fixture',
  7094. fn: function (){
  7095. var self=this;
  7096. return "helLo";
  7097. },
  7098. //>>excludeStart("ide", pragmas.excludeIdeData);
  7099. args: [],
  7100. source: "collection\x0a\x09^ 'helLo'",
  7101. referencedClasses: [],
  7102. //>>excludeEnd("ide");
  7103. messageSends: []
  7104. }),
  7105. $globals.StringTest);
  7106. $core.addMethod(
  7107. $core.method({
  7108. selector: "collectionFirst",
  7109. protocol: 'fixture',
  7110. fn: function (){
  7111. var self=this;
  7112. return "h";
  7113. },
  7114. //>>excludeStart("ide", pragmas.excludeIdeData);
  7115. args: [],
  7116. source: "collectionFirst\x0a\x09^ 'h'",
  7117. referencedClasses: [],
  7118. //>>excludeEnd("ide");
  7119. messageSends: []
  7120. }),
  7121. $globals.StringTest);
  7122. $core.addMethod(
  7123. $core.method({
  7124. selector: "collectionFirstTwo",
  7125. protocol: 'fixture',
  7126. fn: function (){
  7127. var self=this;
  7128. return "he";
  7129. },
  7130. //>>excludeStart("ide", pragmas.excludeIdeData);
  7131. args: [],
  7132. source: "collectionFirstTwo\x0a\x09^ 'he'",
  7133. referencedClasses: [],
  7134. //>>excludeEnd("ide");
  7135. messageSends: []
  7136. }),
  7137. $globals.StringTest);
  7138. $core.addMethod(
  7139. $core.method({
  7140. selector: "collectionLast",
  7141. protocol: 'fixture',
  7142. fn: function (){
  7143. var self=this;
  7144. return "o";
  7145. },
  7146. //>>excludeStart("ide", pragmas.excludeIdeData);
  7147. args: [],
  7148. source: "collectionLast\x0a\x09^ 'o'",
  7149. referencedClasses: [],
  7150. //>>excludeEnd("ide");
  7151. messageSends: []
  7152. }),
  7153. $globals.StringTest);
  7154. $core.addMethod(
  7155. $core.method({
  7156. selector: "collectionLastTwo",
  7157. protocol: 'fixture',
  7158. fn: function (){
  7159. var self=this;
  7160. return "Lo";
  7161. },
  7162. //>>excludeStart("ide", pragmas.excludeIdeData);
  7163. args: [],
  7164. source: "collectionLastTwo\x0a\x09^ 'Lo'",
  7165. referencedClasses: [],
  7166. //>>excludeEnd("ide");
  7167. messageSends: []
  7168. }),
  7169. $globals.StringTest);
  7170. $core.addMethod(
  7171. $core.method({
  7172. selector: "collectionOfPrintStrings",
  7173. protocol: 'fixture',
  7174. fn: function (){
  7175. var self=this;
  7176. return "'h''e''l''L''o'";
  7177. },
  7178. //>>excludeStart("ide", pragmas.excludeIdeData);
  7179. args: [],
  7180. source: "collectionOfPrintStrings\x0a\x09^ '''h''''e''''l''''L''''o'''",
  7181. referencedClasses: [],
  7182. //>>excludeEnd("ide");
  7183. messageSends: []
  7184. }),
  7185. $globals.StringTest);
  7186. $core.addMethod(
  7187. $core.method({
  7188. selector: "collectionSize",
  7189. protocol: 'fixture',
  7190. fn: function (){
  7191. var self=this;
  7192. return (5);
  7193. },
  7194. //>>excludeStart("ide", pragmas.excludeIdeData);
  7195. args: [],
  7196. source: "collectionSize\x0a\x09^ 5",
  7197. referencedClasses: [],
  7198. //>>excludeEnd("ide");
  7199. messageSends: []
  7200. }),
  7201. $globals.StringTest);
  7202. $core.addMethod(
  7203. $core.method({
  7204. selector: "collectionWithDuplicates",
  7205. protocol: 'fixture',
  7206. fn: function (){
  7207. var self=this;
  7208. return "abbaerte";
  7209. },
  7210. //>>excludeStart("ide", pragmas.excludeIdeData);
  7211. args: [],
  7212. source: "collectionWithDuplicates\x0a\x09^ 'abbaerte'",
  7213. referencedClasses: [],
  7214. //>>excludeEnd("ide");
  7215. messageSends: []
  7216. }),
  7217. $globals.StringTest);
  7218. $core.addMethod(
  7219. $core.method({
  7220. selector: "collectionWithNewValue",
  7221. protocol: 'fixture',
  7222. fn: function (){
  7223. var self=this;
  7224. return "helLoN";
  7225. },
  7226. //>>excludeStart("ide", pragmas.excludeIdeData);
  7227. args: [],
  7228. source: "collectionWithNewValue\x0a\x09^ 'helLoN'",
  7229. referencedClasses: [],
  7230. //>>excludeEnd("ide");
  7231. messageSends: []
  7232. }),
  7233. $globals.StringTest);
  7234. $core.addMethod(
  7235. $core.method({
  7236. selector: "sampleNewValueAsCollection",
  7237. protocol: 'fixture',
  7238. fn: function (){
  7239. var self=this;
  7240. return "N";
  7241. },
  7242. //>>excludeStart("ide", pragmas.excludeIdeData);
  7243. args: [],
  7244. source: "sampleNewValueAsCollection\x0a\x09^ 'N'",
  7245. referencedClasses: [],
  7246. //>>excludeEnd("ide");
  7247. messageSends: []
  7248. }),
  7249. $globals.StringTest);
  7250. $core.addMethod(
  7251. $core.method({
  7252. selector: "samplesDo:",
  7253. protocol: 'fixture',
  7254. fn: function (aBlock){
  7255. var self=this;
  7256. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7257. return $core.withContext(function($ctx1) {
  7258. //>>excludeEnd("ctx");
  7259. (
  7260. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7261. $ctx1.supercall = true,
  7262. //>>excludeEnd("ctx");
  7263. $globals.StringTest.superclass.fn.prototype._samplesDo_.apply($recv(self), [aBlock]));
  7264. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7265. $ctx1.supercall = false;
  7266. //>>excludeEnd("ctx");;
  7267. $recv(aBlock)._value_value_((3),"l");
  7268. return self;
  7269. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7270. }, function($ctx1) {$ctx1.fill(self,"samplesDo:",{aBlock:aBlock},$globals.StringTest)});
  7271. //>>excludeEnd("ctx");
  7272. },
  7273. //>>excludeStart("ide", pragmas.excludeIdeData);
  7274. args: ["aBlock"],
  7275. source: "samplesDo: aBlock\x0a\x09super samplesDo: aBlock.\x0a\x09aBlock value: 3 value: 'l'",
  7276. referencedClasses: [],
  7277. //>>excludeEnd("ide");
  7278. messageSends: ["samplesDo:", "value:value:"]
  7279. }),
  7280. $globals.StringTest);
  7281. $core.addMethod(
  7282. $core.method({
  7283. selector: "testAddAll",
  7284. protocol: 'tests',
  7285. fn: function (){
  7286. var self=this;
  7287. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  7288. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7289. return $core.withContext(function($ctx1) {
  7290. //>>excludeEnd("ctx");
  7291. var $1;
  7292. self._should_raise_((function(){
  7293. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7294. return $core.withContext(function($ctx2) {
  7295. //>>excludeEnd("ctx");
  7296. $1=self._collection();
  7297. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7298. $ctx2.sendIdx["collection"]=1;
  7299. //>>excludeEnd("ctx");
  7300. return $recv($1)._addAll_(self._collection());
  7301. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7302. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  7303. //>>excludeEnd("ctx");
  7304. }),$Error());
  7305. return self;
  7306. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7307. }, function($ctx1) {$ctx1.fill(self,"testAddAll",{},$globals.StringTest)});
  7308. //>>excludeEnd("ctx");
  7309. },
  7310. //>>excludeStart("ide", pragmas.excludeIdeData);
  7311. args: [],
  7312. source: "testAddAll\x0a\x09\x22String instances are read-only\x22\x0a\x09self should: [ self collection addAll: self collection ] raise: Error",
  7313. referencedClasses: ["Error"],
  7314. //>>excludeEnd("ide");
  7315. messageSends: ["should:raise:", "addAll:", "collection"]
  7316. }),
  7317. $globals.StringTest);
  7318. $core.addMethod(
  7319. $core.method({
  7320. selector: "testAddRemove",
  7321. protocol: 'tests',
  7322. fn: function (){
  7323. var self=this;
  7324. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  7325. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7326. return $core.withContext(function($ctx1) {
  7327. //>>excludeEnd("ctx");
  7328. self._should_raise_((function(){
  7329. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7330. return $core.withContext(function($ctx2) {
  7331. //>>excludeEnd("ctx");
  7332. return "hello"._add_("a");
  7333. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7334. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  7335. //>>excludeEnd("ctx");
  7336. }),$Error());
  7337. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7338. $ctx1.sendIdx["should:raise:"]=1;
  7339. //>>excludeEnd("ctx");
  7340. self._should_raise_((function(){
  7341. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7342. return $core.withContext(function($ctx2) {
  7343. //>>excludeEnd("ctx");
  7344. return "hello"._remove_("h");
  7345. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7346. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  7347. //>>excludeEnd("ctx");
  7348. }),$Error());
  7349. return self;
  7350. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7351. }, function($ctx1) {$ctx1.fill(self,"testAddRemove",{},$globals.StringTest)});
  7352. //>>excludeEnd("ctx");
  7353. },
  7354. //>>excludeStart("ide", pragmas.excludeIdeData);
  7355. args: [],
  7356. source: "testAddRemove\x0a\x09self should: [ 'hello' add: 'a' ] raise: Error.\x0a\x09self should: [ 'hello' remove: 'h' ] raise: Error",
  7357. referencedClasses: ["Error"],
  7358. //>>excludeEnd("ide");
  7359. messageSends: ["should:raise:", "add:", "remove:"]
  7360. }),
  7361. $globals.StringTest);
  7362. $core.addMethod(
  7363. $core.method({
  7364. selector: "testAsArray",
  7365. protocol: 'tests',
  7366. fn: function (){
  7367. var self=this;
  7368. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7369. return $core.withContext(function($ctx1) {
  7370. //>>excludeEnd("ctx");
  7371. self._assert_equals_("hello"._asArray(),["h", "e", "l", "l", "o"]);
  7372. return self;
  7373. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7374. }, function($ctx1) {$ctx1.fill(self,"testAsArray",{},$globals.StringTest)});
  7375. //>>excludeEnd("ctx");
  7376. },
  7377. //>>excludeStart("ide", pragmas.excludeIdeData);
  7378. args: [],
  7379. source: "testAsArray\x0a\x09self assert: 'hello' asArray equals: #('h' 'e' 'l' 'l' 'o').",
  7380. referencedClasses: [],
  7381. //>>excludeEnd("ide");
  7382. messageSends: ["assert:equals:", "asArray"]
  7383. }),
  7384. $globals.StringTest);
  7385. $core.addMethod(
  7386. $core.method({
  7387. selector: "testAsLowerCase",
  7388. protocol: 'tests',
  7389. fn: function (){
  7390. var self=this;
  7391. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7392. return $core.withContext(function($ctx1) {
  7393. //>>excludeEnd("ctx");
  7394. self._assert_equals_("JACKIE"._asLowercase(),"jackie");
  7395. return self;
  7396. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7397. }, function($ctx1) {$ctx1.fill(self,"testAsLowerCase",{},$globals.StringTest)});
  7398. //>>excludeEnd("ctx");
  7399. },
  7400. //>>excludeStart("ide", pragmas.excludeIdeData);
  7401. args: [],
  7402. source: "testAsLowerCase\x0a\x09self assert: 'JACKIE' asLowercase equals: 'jackie'.",
  7403. referencedClasses: [],
  7404. //>>excludeEnd("ide");
  7405. messageSends: ["assert:equals:", "asLowercase"]
  7406. }),
  7407. $globals.StringTest);
  7408. $core.addMethod(
  7409. $core.method({
  7410. selector: "testAsNumber",
  7411. protocol: 'tests',
  7412. fn: function (){
  7413. var self=this;
  7414. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7415. return $core.withContext(function($ctx1) {
  7416. //>>excludeEnd("ctx");
  7417. var $1,$2;
  7418. $1="3"._asNumber();
  7419. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7420. $ctx1.sendIdx["asNumber"]=1;
  7421. //>>excludeEnd("ctx");
  7422. self._assert_equals_($1,(3));
  7423. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7424. $ctx1.sendIdx["assert:equals:"]=1;
  7425. //>>excludeEnd("ctx");
  7426. $2="-3"._asNumber();
  7427. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7428. $ctx1.sendIdx["asNumber"]=2;
  7429. //>>excludeEnd("ctx");
  7430. self._assert_equals_($2,(-3));
  7431. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7432. $ctx1.sendIdx["assert:equals:"]=2;
  7433. //>>excludeEnd("ctx");
  7434. self._assert_equals_("-1.5"._asNumber(),(-1.5));
  7435. return self;
  7436. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7437. }, function($ctx1) {$ctx1.fill(self,"testAsNumber",{},$globals.StringTest)});
  7438. //>>excludeEnd("ctx");
  7439. },
  7440. //>>excludeStart("ide", pragmas.excludeIdeData);
  7441. args: [],
  7442. 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.",
  7443. referencedClasses: [],
  7444. //>>excludeEnd("ide");
  7445. messageSends: ["assert:equals:", "asNumber"]
  7446. }),
  7447. $globals.StringTest);
  7448. $core.addMethod(
  7449. $core.method({
  7450. selector: "testAsUpperCase",
  7451. protocol: 'tests',
  7452. fn: function (){
  7453. var self=this;
  7454. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7455. return $core.withContext(function($ctx1) {
  7456. //>>excludeEnd("ctx");
  7457. self._assert_equals_("jackie"._asUppercase(),"JACKIE");
  7458. return self;
  7459. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7460. }, function($ctx1) {$ctx1.fill(self,"testAsUpperCase",{},$globals.StringTest)});
  7461. //>>excludeEnd("ctx");
  7462. },
  7463. //>>excludeStart("ide", pragmas.excludeIdeData);
  7464. args: [],
  7465. source: "testAsUpperCase\x0a\x09self assert: 'jackie' asUppercase equals: 'JACKIE'.",
  7466. referencedClasses: [],
  7467. //>>excludeEnd("ide");
  7468. messageSends: ["assert:equals:", "asUppercase"]
  7469. }),
  7470. $globals.StringTest);
  7471. $core.addMethod(
  7472. $core.method({
  7473. selector: "testAsciiValue",
  7474. protocol: 'tests',
  7475. fn: function (){
  7476. var self=this;
  7477. var characterA,characterU;
  7478. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7479. return $core.withContext(function($ctx1) {
  7480. //>>excludeEnd("ctx");
  7481. var $1;
  7482. characterA="A";
  7483. characterU="U";
  7484. $1=$recv(characterA)._asciiValue();
  7485. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7486. $ctx1.sendIdx["asciiValue"]=1;
  7487. //>>excludeEnd("ctx");
  7488. self._assert_equals_($1,(65));
  7489. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7490. $ctx1.sendIdx["assert:equals:"]=1;
  7491. //>>excludeEnd("ctx");
  7492. self._assert_equals_($recv(characterU)._asciiValue(),(85));
  7493. return self;
  7494. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7495. }, function($ctx1) {$ctx1.fill(self,"testAsciiValue",{characterA:characterA,characterU:characterU},$globals.StringTest)});
  7496. //>>excludeEnd("ctx");
  7497. },
  7498. //>>excludeStart("ide", pragmas.excludeIdeData);
  7499. args: [],
  7500. 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",
  7501. referencedClasses: [],
  7502. //>>excludeEnd("ide");
  7503. messageSends: ["assert:equals:", "asciiValue"]
  7504. }),
  7505. $globals.StringTest);
  7506. $core.addMethod(
  7507. $core.method({
  7508. selector: "testAtIfAbsentPut",
  7509. protocol: 'tests',
  7510. fn: function (){
  7511. var self=this;
  7512. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  7513. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7514. return $core.withContext(function($ctx1) {
  7515. //>>excludeEnd("ctx");
  7516. self._should_raise_((function(){
  7517. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7518. return $core.withContext(function($ctx2) {
  7519. //>>excludeEnd("ctx");
  7520. return "hello"._at_ifAbsentPut_((6),(function(){
  7521. return "a";
  7522. }));
  7523. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7524. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  7525. //>>excludeEnd("ctx");
  7526. }),$Error());
  7527. return self;
  7528. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7529. }, function($ctx1) {$ctx1.fill(self,"testAtIfAbsentPut",{},$globals.StringTest)});
  7530. //>>excludeEnd("ctx");
  7531. },
  7532. //>>excludeStart("ide", pragmas.excludeIdeData);
  7533. args: [],
  7534. source: "testAtIfAbsentPut\x0a\x09\x22String instances are read-only\x22\x0a\x09self should: [ 'hello' at: 6 ifAbsentPut: [ 'a' ] ] raise: Error",
  7535. referencedClasses: ["Error"],
  7536. //>>excludeEnd("ide");
  7537. messageSends: ["should:raise:", "at:ifAbsentPut:"]
  7538. }),
  7539. $globals.StringTest);
  7540. $core.addMethod(
  7541. $core.method({
  7542. selector: "testAtPut",
  7543. protocol: 'tests',
  7544. fn: function (){
  7545. var self=this;
  7546. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  7547. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7548. return $core.withContext(function($ctx1) {
  7549. //>>excludeEnd("ctx");
  7550. self._should_raise_((function(){
  7551. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7552. return $core.withContext(function($ctx2) {
  7553. //>>excludeEnd("ctx");
  7554. return "hello"._at_put_((1),"a");
  7555. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7556. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  7557. //>>excludeEnd("ctx");
  7558. }),$Error());
  7559. return self;
  7560. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7561. }, function($ctx1) {$ctx1.fill(self,"testAtPut",{},$globals.StringTest)});
  7562. //>>excludeEnd("ctx");
  7563. },
  7564. //>>excludeStart("ide", pragmas.excludeIdeData);
  7565. args: [],
  7566. source: "testAtPut\x0a\x09\x22String instances are read-only\x22\x0a\x09self should: [ 'hello' at: 1 put: 'a' ] raise: Error",
  7567. referencedClasses: ["Error"],
  7568. //>>excludeEnd("ide");
  7569. messageSends: ["should:raise:", "at:put:"]
  7570. }),
  7571. $globals.StringTest);
  7572. $core.addMethod(
  7573. $core.method({
  7574. selector: "testCapitalized",
  7575. protocol: 'tests',
  7576. fn: function (){
  7577. var self=this;
  7578. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7579. return $core.withContext(function($ctx1) {
  7580. //>>excludeEnd("ctx");
  7581. var $1,$2,$3;
  7582. $1="test"._capitalized();
  7583. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7584. $ctx1.sendIdx["capitalized"]=1;
  7585. //>>excludeEnd("ctx");
  7586. self._assert_equals_($1,"Test");
  7587. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7588. $ctx1.sendIdx["assert:equals:"]=1;
  7589. //>>excludeEnd("ctx");
  7590. $2="Test"._capitalized();
  7591. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7592. $ctx1.sendIdx["capitalized"]=2;
  7593. //>>excludeEnd("ctx");
  7594. self._assert_equals_($2,"Test");
  7595. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7596. $ctx1.sendIdx["assert:equals:"]=2;
  7597. //>>excludeEnd("ctx");
  7598. self._assert_equals_(""._capitalized(),"");
  7599. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7600. $ctx1.sendIdx["assert:equals:"]=3;
  7601. //>>excludeEnd("ctx");
  7602. $3="Test"._isCapitalized();
  7603. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7604. $ctx1.sendIdx["isCapitalized"]=1;
  7605. //>>excludeEnd("ctx");
  7606. self._assert_equals_($3,true);
  7607. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7608. $ctx1.sendIdx["assert:equals:"]=4;
  7609. //>>excludeEnd("ctx");
  7610. self._assert_equals_("test"._isCapitalized(),false);
  7611. return self;
  7612. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7613. }, function($ctx1) {$ctx1.fill(self,"testCapitalized",{},$globals.StringTest)});
  7614. //>>excludeEnd("ctx");
  7615. },
  7616. //>>excludeStart("ide", pragmas.excludeIdeData);
  7617. args: [],
  7618. 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.",
  7619. referencedClasses: [],
  7620. //>>excludeEnd("ide");
  7621. messageSends: ["assert:equals:", "capitalized", "isCapitalized"]
  7622. }),
  7623. $globals.StringTest);
  7624. $core.addMethod(
  7625. $core.method({
  7626. selector: "testCharCodeAt",
  7627. protocol: 'tests',
  7628. fn: function (){
  7629. var self=this;
  7630. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7631. return $core.withContext(function($ctx1) {
  7632. //>>excludeEnd("ctx");
  7633. var $1,$2,$3,$4,$5;
  7634. $1="jackie"._charCodeAt_((1));
  7635. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7636. $ctx1.sendIdx["charCodeAt:"]=1;
  7637. //>>excludeEnd("ctx");
  7638. self._assert_equals_($1,(106));
  7639. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7640. $ctx1.sendIdx["assert:equals:"]=1;
  7641. //>>excludeEnd("ctx");
  7642. $2="jackie"._charCodeAt_((2));
  7643. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7644. $ctx1.sendIdx["charCodeAt:"]=2;
  7645. //>>excludeEnd("ctx");
  7646. self._assert_equals_($2,(97));
  7647. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7648. $ctx1.sendIdx["assert:equals:"]=2;
  7649. //>>excludeEnd("ctx");
  7650. $3="jackie"._charCodeAt_((3));
  7651. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7652. $ctx1.sendIdx["charCodeAt:"]=3;
  7653. //>>excludeEnd("ctx");
  7654. self._assert_equals_($3,(99));
  7655. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7656. $ctx1.sendIdx["assert:equals:"]=3;
  7657. //>>excludeEnd("ctx");
  7658. $4="jackie"._charCodeAt_((4));
  7659. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7660. $ctx1.sendIdx["charCodeAt:"]=4;
  7661. //>>excludeEnd("ctx");
  7662. self._assert_equals_($4,(107));
  7663. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7664. $ctx1.sendIdx["assert:equals:"]=4;
  7665. //>>excludeEnd("ctx");
  7666. $5="jackie"._charCodeAt_((5));
  7667. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7668. $ctx1.sendIdx["charCodeAt:"]=5;
  7669. //>>excludeEnd("ctx");
  7670. self._assert_equals_($5,(105));
  7671. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7672. $ctx1.sendIdx["assert:equals:"]=5;
  7673. //>>excludeEnd("ctx");
  7674. self._assert_equals_("jackie"._charCodeAt_((6)),(101));
  7675. return self;
  7676. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7677. }, function($ctx1) {$ctx1.fill(self,"testCharCodeAt",{},$globals.StringTest)});
  7678. //>>excludeEnd("ctx");
  7679. },
  7680. //>>excludeStart("ide", pragmas.excludeIdeData);
  7681. args: [],
  7682. 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",
  7683. referencedClasses: [],
  7684. //>>excludeEnd("ide");
  7685. messageSends: ["assert:equals:", "charCodeAt:"]
  7686. }),
  7687. $globals.StringTest);
  7688. $core.addMethod(
  7689. $core.method({
  7690. selector: "testCopyFromTo",
  7691. protocol: 'tests',
  7692. fn: function (){
  7693. var self=this;
  7694. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7695. return $core.withContext(function($ctx1) {
  7696. //>>excludeEnd("ctx");
  7697. var $1;
  7698. $1="jackie"._copyFrom_to_((1),(3));
  7699. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7700. $ctx1.sendIdx["copyFrom:to:"]=1;
  7701. //>>excludeEnd("ctx");
  7702. self._assert_equals_($1,"jac");
  7703. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7704. $ctx1.sendIdx["assert:equals:"]=1;
  7705. //>>excludeEnd("ctx");
  7706. self._assert_equals_("jackie"._copyFrom_to_((4),(6)),"kie");
  7707. return self;
  7708. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7709. }, function($ctx1) {$ctx1.fill(self,"testCopyFromTo",{},$globals.StringTest)});
  7710. //>>excludeEnd("ctx");
  7711. },
  7712. //>>excludeStart("ide", pragmas.excludeIdeData);
  7713. args: [],
  7714. source: "testCopyFromTo\x0a\x09self assert: ('jackie' copyFrom: 1 to: 3) equals: 'jac'.\x0a\x09self assert: ('jackie' copyFrom: 4 to: 6) equals: 'kie'.",
  7715. referencedClasses: [],
  7716. //>>excludeEnd("ide");
  7717. messageSends: ["assert:equals:", "copyFrom:to:"]
  7718. }),
  7719. $globals.StringTest);
  7720. $core.addMethod(
  7721. $core.method({
  7722. selector: "testCopyWithoutAll",
  7723. protocol: 'tests',
  7724. fn: function (){
  7725. var self=this;
  7726. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7727. return $core.withContext(function($ctx1) {
  7728. //>>excludeEnd("ctx");
  7729. self._assert_equals_("*hello* *world*"._copyWithoutAll_("*"),"hello world");
  7730. return self;
  7731. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7732. }, function($ctx1) {$ctx1.fill(self,"testCopyWithoutAll",{},$globals.StringTest)});
  7733. //>>excludeEnd("ctx");
  7734. },
  7735. //>>excludeStart("ide", pragmas.excludeIdeData);
  7736. args: [],
  7737. source: "testCopyWithoutAll\x0a\x09self\x0a\x09\x09assert: ('*hello* *world*' copyWithoutAll: '*')\x0a\x09\x09equals: 'hello world'",
  7738. referencedClasses: [],
  7739. //>>excludeEnd("ide");
  7740. messageSends: ["assert:equals:", "copyWithoutAll:"]
  7741. }),
  7742. $globals.StringTest);
  7743. $core.addMethod(
  7744. $core.method({
  7745. selector: "testEquality",
  7746. protocol: 'tests',
  7747. fn: function (){
  7748. var self=this;
  7749. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7750. return $core.withContext(function($ctx1) {
  7751. //>>excludeEnd("ctx");
  7752. var $1,$2,$3;
  7753. self._assert_equals_("hello","hello");
  7754. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7755. $ctx1.sendIdx["assert:equals:"]=1;
  7756. //>>excludeEnd("ctx");
  7757. $1="hello".__eq("world");
  7758. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7759. $ctx1.sendIdx["="]=1;
  7760. //>>excludeEnd("ctx");
  7761. self._deny_($1);
  7762. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7763. $ctx1.sendIdx["deny:"]=1;
  7764. //>>excludeEnd("ctx");
  7765. $2="hello".__eq([]._at_ifAbsent_((1),(function(){
  7766. })));
  7767. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7768. $ctx1.sendIdx["="]=2;
  7769. //>>excludeEnd("ctx");
  7770. self._deny_($2);
  7771. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7772. $ctx1.sendIdx["deny:"]=2;
  7773. //>>excludeEnd("ctx");
  7774. $3="hello"._yourself();
  7775. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7776. $ctx1.sendIdx["yourself"]=1;
  7777. //>>excludeEnd("ctx");
  7778. self._assert_equals_("hello",$3);
  7779. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7780. $ctx1.sendIdx["assert:equals:"]=2;
  7781. //>>excludeEnd("ctx");
  7782. self._assert_equals_("hello"._yourself(),"hello");
  7783. self._deny_("".__eq((0)));
  7784. return self;
  7785. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7786. }, function($ctx1) {$ctx1.fill(self,"testEquality",{},$globals.StringTest)});
  7787. //>>excludeEnd("ctx");
  7788. },
  7789. //>>excludeStart("ide", pragmas.excludeIdeData);
  7790. args: [],
  7791. 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",
  7792. referencedClasses: [],
  7793. //>>excludeEnd("ide");
  7794. messageSends: ["assert:equals:", "deny:", "=", "at:ifAbsent:", "yourself"]
  7795. }),
  7796. $globals.StringTest);
  7797. $core.addMethod(
  7798. $core.method({
  7799. selector: "testIdentity",
  7800. protocol: 'tests',
  7801. fn: function (){
  7802. var self=this;
  7803. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7804. return $core.withContext(function($ctx1) {
  7805. //>>excludeEnd("ctx");
  7806. var $1,$2,$4,$3,$5;
  7807. $1="hello".__eq_eq("hello");
  7808. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7809. $ctx1.sendIdx["=="]=1;
  7810. //>>excludeEnd("ctx");
  7811. self._assert_($1);
  7812. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7813. $ctx1.sendIdx["assert:"]=1;
  7814. //>>excludeEnd("ctx");
  7815. $2="hello".__eq_eq("world");
  7816. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7817. $ctx1.sendIdx["=="]=2;
  7818. //>>excludeEnd("ctx");
  7819. self._deny_($2);
  7820. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7821. $ctx1.sendIdx["deny:"]=1;
  7822. //>>excludeEnd("ctx");
  7823. $4="hello"._yourself();
  7824. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7825. $ctx1.sendIdx["yourself"]=1;
  7826. //>>excludeEnd("ctx");
  7827. $3="hello".__eq_eq($4);
  7828. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7829. $ctx1.sendIdx["=="]=3;
  7830. //>>excludeEnd("ctx");
  7831. self._assert_($3);
  7832. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7833. $ctx1.sendIdx["assert:"]=2;
  7834. //>>excludeEnd("ctx");
  7835. $5=$recv("hello"._yourself()).__eq_eq("hello");
  7836. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7837. $ctx1.sendIdx["=="]=4;
  7838. //>>excludeEnd("ctx");
  7839. self._assert_($5);
  7840. self._deny_("".__eq_eq((0)));
  7841. return self;
  7842. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7843. }, function($ctx1) {$ctx1.fill(self,"testIdentity",{},$globals.StringTest)});
  7844. //>>excludeEnd("ctx");
  7845. },
  7846. //>>excludeStart("ide", pragmas.excludeIdeData);
  7847. args: [],
  7848. 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",
  7849. referencedClasses: [],
  7850. //>>excludeEnd("ide");
  7851. messageSends: ["assert:", "==", "deny:", "yourself"]
  7852. }),
  7853. $globals.StringTest);
  7854. $core.addMethod(
  7855. $core.method({
  7856. selector: "testIdentityHash",
  7857. protocol: 'tests',
  7858. fn: function (){
  7859. var self=this;
  7860. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7861. return $core.withContext(function($ctx1) {
  7862. //>>excludeEnd("ctx");
  7863. var $1,$2,$4,$3;
  7864. $1="foo"._identityHash();
  7865. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7866. $ctx1.sendIdx["identityHash"]=1;
  7867. //>>excludeEnd("ctx");
  7868. $2="foo"._identityHash();
  7869. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7870. $ctx1.sendIdx["identityHash"]=2;
  7871. //>>excludeEnd("ctx");
  7872. self._assert_equals_($1,$2);
  7873. $4="foo"._identityHash();
  7874. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7875. $ctx1.sendIdx["identityHash"]=3;
  7876. //>>excludeEnd("ctx");
  7877. $3=$recv($4).__eq("bar"._identityHash());
  7878. self._deny_($3);
  7879. return self;
  7880. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7881. }, function($ctx1) {$ctx1.fill(self,"testIdentityHash",{},$globals.StringTest)});
  7882. //>>excludeEnd("ctx");
  7883. },
  7884. //>>excludeStart("ide", pragmas.excludeIdeData);
  7885. args: [],
  7886. source: "testIdentityHash\x0a\x09self assert: 'foo' identityHash equals: 'foo' identityHash.\x0a\x09self deny: ('foo' identityHash = 'bar' identityHash)",
  7887. referencedClasses: [],
  7888. //>>excludeEnd("ide");
  7889. messageSends: ["assert:equals:", "identityHash", "deny:", "="]
  7890. }),
  7891. $globals.StringTest);
  7892. $core.addMethod(
  7893. $core.method({
  7894. selector: "testIncludesSubString",
  7895. protocol: 'tests',
  7896. fn: function (){
  7897. var self=this;
  7898. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7899. return $core.withContext(function($ctx1) {
  7900. //>>excludeEnd("ctx");
  7901. var $1;
  7902. $1="amber"._includesSubString_("ber");
  7903. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7904. $ctx1.sendIdx["includesSubString:"]=1;
  7905. //>>excludeEnd("ctx");
  7906. self._assert_($1);
  7907. self._deny_("amber"._includesSubString_("zork"));
  7908. return self;
  7909. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7910. }, function($ctx1) {$ctx1.fill(self,"testIncludesSubString",{},$globals.StringTest)});
  7911. //>>excludeEnd("ctx");
  7912. },
  7913. //>>excludeStart("ide", pragmas.excludeIdeData);
  7914. args: [],
  7915. source: "testIncludesSubString\x0a\x09self assert: ('amber' includesSubString: 'ber').\x0a\x09self deny: ('amber' includesSubString: 'zork').",
  7916. referencedClasses: [],
  7917. //>>excludeEnd("ide");
  7918. messageSends: ["assert:", "includesSubString:", "deny:"]
  7919. }),
  7920. $globals.StringTest);
  7921. $core.addMethod(
  7922. $core.method({
  7923. selector: "testIndexOfStartingAtWithNull",
  7924. protocol: 'tests',
  7925. fn: function (){
  7926. var self=this;
  7927. return self;
  7928. },
  7929. //>>excludeStart("ide", pragmas.excludeIdeData);
  7930. args: [],
  7931. source: "testIndexOfStartingAtWithNull\x0a\x09\x22String cannot hold JS null\x22",
  7932. referencedClasses: [],
  7933. //>>excludeEnd("ide");
  7934. messageSends: []
  7935. }),
  7936. $globals.StringTest);
  7937. $core.addMethod(
  7938. $core.method({
  7939. selector: "testIndexOfWithNull",
  7940. protocol: 'tests',
  7941. fn: function (){
  7942. var self=this;
  7943. return self;
  7944. },
  7945. //>>excludeStart("ide", pragmas.excludeIdeData);
  7946. args: [],
  7947. source: "testIndexOfWithNull\x0a\x09\x22String cannot hold JS null\x22",
  7948. referencedClasses: [],
  7949. //>>excludeEnd("ide");
  7950. messageSends: []
  7951. }),
  7952. $globals.StringTest);
  7953. $core.addMethod(
  7954. $core.method({
  7955. selector: "testIsVowel",
  7956. protocol: 'tests',
  7957. fn: function (){
  7958. var self=this;
  7959. var vowel,consonant;
  7960. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7961. return $core.withContext(function($ctx1) {
  7962. //>>excludeEnd("ctx");
  7963. var $1;
  7964. vowel="u";
  7965. consonant="z";
  7966. $1=$recv(vowel)._isVowel();
  7967. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7968. $ctx1.sendIdx["isVowel"]=1;
  7969. //>>excludeEnd("ctx");
  7970. self._assert_equals_($1,true);
  7971. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7972. $ctx1.sendIdx["assert:equals:"]=1;
  7973. //>>excludeEnd("ctx");
  7974. self._assert_equals_($recv(consonant)._isVowel(),false);
  7975. return self;
  7976. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7977. }, function($ctx1) {$ctx1.fill(self,"testIsVowel",{vowel:vowel,consonant:consonant},$globals.StringTest)});
  7978. //>>excludeEnd("ctx");
  7979. },
  7980. //>>excludeStart("ide", pragmas.excludeIdeData);
  7981. args: [],
  7982. 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",
  7983. referencedClasses: [],
  7984. //>>excludeEnd("ide");
  7985. messageSends: ["assert:equals:", "isVowel"]
  7986. }),
  7987. $globals.StringTest);
  7988. $core.addMethod(
  7989. $core.method({
  7990. selector: "testJoin",
  7991. protocol: 'tests',
  7992. fn: function (){
  7993. var self=this;
  7994. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  7995. return $core.withContext(function($ctx1) {
  7996. //>>excludeEnd("ctx");
  7997. self._assert_equals_(","._join_(["hello", "world"]),"hello,world");
  7998. return self;
  7999. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8000. }, function($ctx1) {$ctx1.fill(self,"testJoin",{},$globals.StringTest)});
  8001. //>>excludeEnd("ctx");
  8002. },
  8003. //>>excludeStart("ide", pragmas.excludeIdeData);
  8004. args: [],
  8005. source: "testJoin\x0a\x09self assert: (',' join: #('hello' 'world')) equals: 'hello,world'",
  8006. referencedClasses: [],
  8007. //>>excludeEnd("ide");
  8008. messageSends: ["assert:equals:", "join:"]
  8009. }),
  8010. $globals.StringTest);
  8011. $core.addMethod(
  8012. $core.method({
  8013. selector: "testRemoveAll",
  8014. protocol: 'tests',
  8015. fn: function (){
  8016. var self=this;
  8017. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  8018. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8019. return $core.withContext(function($ctx1) {
  8020. //>>excludeEnd("ctx");
  8021. self._should_raise_((function(){
  8022. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8023. return $core.withContext(function($ctx2) {
  8024. //>>excludeEnd("ctx");
  8025. return $recv(self._collection())._removeAll();
  8026. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8027. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  8028. //>>excludeEnd("ctx");
  8029. }),$Error());
  8030. return self;
  8031. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8032. }, function($ctx1) {$ctx1.fill(self,"testRemoveAll",{},$globals.StringTest)});
  8033. //>>excludeEnd("ctx");
  8034. },
  8035. //>>excludeStart("ide", pragmas.excludeIdeData);
  8036. args: [],
  8037. source: "testRemoveAll\x0a\x09self should: [ self collection removeAll ] raise: Error",
  8038. referencedClasses: ["Error"],
  8039. //>>excludeEnd("ide");
  8040. messageSends: ["should:raise:", "removeAll", "collection"]
  8041. }),
  8042. $globals.StringTest);
  8043. $core.addMethod(
  8044. $core.method({
  8045. selector: "testReversed",
  8046. protocol: 'tests',
  8047. fn: function (){
  8048. var self=this;
  8049. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8050. return $core.withContext(function($ctx1) {
  8051. //>>excludeEnd("ctx");
  8052. self._assert_equals_("jackiechan"._reversed(),"nahceikcaj");
  8053. return self;
  8054. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8055. }, function($ctx1) {$ctx1.fill(self,"testReversed",{},$globals.StringTest)});
  8056. //>>excludeEnd("ctx");
  8057. },
  8058. //>>excludeStart("ide", pragmas.excludeIdeData);
  8059. args: [],
  8060. source: "testReversed\x0a\x09self assert: 'jackiechan' reversed equals: 'nahceikcaj'.",
  8061. referencedClasses: [],
  8062. //>>excludeEnd("ide");
  8063. messageSends: ["assert:equals:", "reversed"]
  8064. }),
  8065. $globals.StringTest);
  8066. $core.addMethod(
  8067. $core.method({
  8068. selector: "testStreamContents",
  8069. protocol: 'tests',
  8070. fn: function (){
  8071. var self=this;
  8072. function $String(){return $globals.String||(typeof String=="undefined"?nil:String)}
  8073. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8074. return $core.withContext(function($ctx1) {
  8075. //>>excludeEnd("ctx");
  8076. var $1;
  8077. self._assert_equals_($recv($String())._streamContents_((function(aStream){
  8078. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8079. return $core.withContext(function($ctx2) {
  8080. //>>excludeEnd("ctx");
  8081. $recv(aStream)._nextPutAll_("hello");
  8082. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8083. $ctx2.sendIdx["nextPutAll:"]=1;
  8084. //>>excludeEnd("ctx");
  8085. $recv(aStream)._space();
  8086. $1=$recv(aStream)._nextPutAll_("world");
  8087. return $1;
  8088. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8089. }, function($ctx2) {$ctx2.fillBlock({aStream:aStream},$ctx1,1)});
  8090. //>>excludeEnd("ctx");
  8091. })),"hello world");
  8092. return self;
  8093. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8094. }, function($ctx1) {$ctx1.fill(self,"testStreamContents",{},$globals.StringTest)});
  8095. //>>excludeEnd("ctx");
  8096. },
  8097. //>>excludeStart("ide", pragmas.excludeIdeData);
  8098. args: [],
  8099. 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'",
  8100. referencedClasses: ["String"],
  8101. //>>excludeEnd("ide");
  8102. messageSends: ["assert:equals:", "streamContents:", "nextPutAll:", "space"]
  8103. }),
  8104. $globals.StringTest);
  8105. $core.addMethod(
  8106. $core.method({
  8107. selector: "testSubStrings",
  8108. protocol: 'tests',
  8109. fn: function (){
  8110. var self=this;
  8111. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8112. return $core.withContext(function($ctx1) {
  8113. //>>excludeEnd("ctx");
  8114. self._assert_equals_("jackiechan"._subStrings_("ie"),["jack", "chan"]);
  8115. return self;
  8116. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8117. }, function($ctx1) {$ctx1.fill(self,"testSubStrings",{},$globals.StringTest)});
  8118. //>>excludeEnd("ctx");
  8119. },
  8120. //>>excludeStart("ide", pragmas.excludeIdeData);
  8121. args: [],
  8122. source: "testSubStrings\x0a\x09self assert: ('jackiechan' subStrings: 'ie') equals: #( 'jack' 'chan' ).",
  8123. referencedClasses: [],
  8124. //>>excludeEnd("ide");
  8125. messageSends: ["assert:equals:", "subStrings:"]
  8126. }),
  8127. $globals.StringTest);
  8128. $core.addMethod(
  8129. $core.method({
  8130. selector: "testTrim",
  8131. protocol: 'tests',
  8132. fn: function (){
  8133. var self=this;
  8134. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8135. return $core.withContext(function($ctx1) {
  8136. //>>excludeEnd("ctx");
  8137. self._assert_equals_(" jackie"._trimLeft(),"jackie");
  8138. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8139. $ctx1.sendIdx["assert:equals:"]=1;
  8140. //>>excludeEnd("ctx");
  8141. self._assert_equals_("jackie "._trimRight(),"jackie");
  8142. return self;
  8143. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8144. }, function($ctx1) {$ctx1.fill(self,"testTrim",{},$globals.StringTest)});
  8145. //>>excludeEnd("ctx");
  8146. },
  8147. //>>excludeStart("ide", pragmas.excludeIdeData);
  8148. args: [],
  8149. source: "testTrim\x0a\x09self assert: ' jackie' trimLeft equals: 'jackie'.\x0a\x09self assert: 'jackie ' trimRight equals: 'jackie'.",
  8150. referencedClasses: [],
  8151. //>>excludeEnd("ide");
  8152. messageSends: ["assert:equals:", "trimLeft", "trimRight"]
  8153. }),
  8154. $globals.StringTest);
  8155. $core.addMethod(
  8156. $core.method({
  8157. selector: "testValue",
  8158. protocol: 'tests',
  8159. fn: function (){
  8160. var self=this;
  8161. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8162. return $core.withContext(function($ctx1) {
  8163. //>>excludeEnd("ctx");
  8164. self._assert_equals_("asString"._value_((1)),"1");
  8165. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8166. $ctx1.sendIdx["assert:equals:"]=1;
  8167. //>>excludeEnd("ctx");
  8168. self._assert_equals_([(1), (2), (3)]._collect_("asString"),["1", "2", "3"]);
  8169. return self;
  8170. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8171. }, function($ctx1) {$ctx1.fill(self,"testValue",{},$globals.StringTest)});
  8172. //>>excludeEnd("ctx");
  8173. },
  8174. //>>excludeStart("ide", pragmas.excludeIdeData);
  8175. args: [],
  8176. 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')",
  8177. referencedClasses: [],
  8178. //>>excludeEnd("ide");
  8179. messageSends: ["assert:equals:", "value:", "collect:"]
  8180. }),
  8181. $globals.StringTest);
  8182. $core.addMethod(
  8183. $core.method({
  8184. selector: "collectionClass",
  8185. protocol: 'fixture',
  8186. fn: function (){
  8187. var self=this;
  8188. function $String(){return $globals.String||(typeof String=="undefined"?nil:String)}
  8189. return $String();
  8190. },
  8191. //>>excludeStart("ide", pragmas.excludeIdeData);
  8192. args: [],
  8193. source: "collectionClass\x0a\x09^ String",
  8194. referencedClasses: ["String"],
  8195. //>>excludeEnd("ide");
  8196. messageSends: []
  8197. }),
  8198. $globals.StringTest.klass);
  8199. $core.addClass('SetTest', $globals.CollectionTest, [], 'Kernel-Tests');
  8200. $core.addMethod(
  8201. $core.method({
  8202. selector: "collection",
  8203. protocol: 'fixture',
  8204. fn: function (){
  8205. var self=this;
  8206. function $Set(){return $globals.Set||(typeof Set=="undefined"?nil:Set)}
  8207. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  8208. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8209. return $core.withContext(function($ctx1) {
  8210. //>>excludeEnd("ctx");
  8211. var $2,$3,$1;
  8212. $2=$recv($Set())._new();
  8213. $recv($2)._add_($Smalltalk());
  8214. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8215. $ctx1.sendIdx["add:"]=1;
  8216. //>>excludeEnd("ctx");
  8217. $recv($2)._add_(nil);
  8218. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8219. $ctx1.sendIdx["add:"]=2;
  8220. //>>excludeEnd("ctx");
  8221. $recv($2)._add_((3).__at((3)));
  8222. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8223. $ctx1.sendIdx["add:"]=3;
  8224. //>>excludeEnd("ctx");
  8225. $recv($2)._add_(false);
  8226. $3=$recv($2)._yourself();
  8227. $1=$3;
  8228. return $1;
  8229. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8230. }, function($ctx1) {$ctx1.fill(self,"collection",{},$globals.SetTest)});
  8231. //>>excludeEnd("ctx");
  8232. },
  8233. //>>excludeStart("ide", pragmas.excludeIdeData);
  8234. args: [],
  8235. source: "collection\x0a\x09^ Set new\x0a\x09\x09add: Smalltalk;\x0a\x09\x09add: nil;\x0a\x09\x09add: 3@3;\x0a\x09\x09add: false;\x0a\x09\x09yourself",
  8236. referencedClasses: ["Set", "Smalltalk"],
  8237. //>>excludeEnd("ide");
  8238. messageSends: ["add:", "new", "@", "yourself"]
  8239. }),
  8240. $globals.SetTest);
  8241. $core.addMethod(
  8242. $core.method({
  8243. selector: "collectionOfPrintStrings",
  8244. protocol: 'fixture',
  8245. fn: function (){
  8246. var self=this;
  8247. function $Set(){return $globals.Set||(typeof Set=="undefined"?nil:Set)}
  8248. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8249. return $core.withContext(function($ctx1) {
  8250. //>>excludeEnd("ctx");
  8251. var $2,$3,$1;
  8252. $2=$recv($Set())._new();
  8253. $recv($2)._add_("a SmalltalkImage");
  8254. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8255. $ctx1.sendIdx["add:"]=1;
  8256. //>>excludeEnd("ctx");
  8257. $recv($2)._add_("nil");
  8258. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8259. $ctx1.sendIdx["add:"]=2;
  8260. //>>excludeEnd("ctx");
  8261. $recv($2)._add_("3@3");
  8262. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8263. $ctx1.sendIdx["add:"]=3;
  8264. //>>excludeEnd("ctx");
  8265. $recv($2)._add_("false");
  8266. $3=$recv($2)._yourself();
  8267. $1=$3;
  8268. return $1;
  8269. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8270. }, function($ctx1) {$ctx1.fill(self,"collectionOfPrintStrings",{},$globals.SetTest)});
  8271. //>>excludeEnd("ctx");
  8272. },
  8273. //>>excludeStart("ide", pragmas.excludeIdeData);
  8274. args: [],
  8275. source: "collectionOfPrintStrings\x0a\x09^ Set new\x0a\x09\x09add: 'a SmalltalkImage';\x0a\x09\x09add: 'nil';\x0a\x09\x09add: '3@3';\x0a\x09\x09add: 'false';\x0a\x09\x09yourself",
  8276. referencedClasses: ["Set"],
  8277. //>>excludeEnd("ide");
  8278. messageSends: ["add:", "new", "yourself"]
  8279. }),
  8280. $globals.SetTest);
  8281. $core.addMethod(
  8282. $core.method({
  8283. selector: "collectionSize",
  8284. protocol: 'fixture',
  8285. fn: function (){
  8286. var self=this;
  8287. return (4);
  8288. },
  8289. //>>excludeStart("ide", pragmas.excludeIdeData);
  8290. args: [],
  8291. source: "collectionSize\x0a\x09^ 4",
  8292. referencedClasses: [],
  8293. //>>excludeEnd("ide");
  8294. messageSends: []
  8295. }),
  8296. $globals.SetTest);
  8297. $core.addMethod(
  8298. $core.method({
  8299. selector: "collectionWithDuplicates",
  8300. protocol: 'fixture',
  8301. fn: function (){
  8302. var self=this;
  8303. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8304. return $core.withContext(function($ctx1) {
  8305. //>>excludeEnd("ctx");
  8306. var $2,$3,$1;
  8307. $2=self._collection();
  8308. $recv($2)._add_((0));
  8309. $3=$recv($2)._yourself();
  8310. $1=$3;
  8311. return $1;
  8312. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8313. }, function($ctx1) {$ctx1.fill(self,"collectionWithDuplicates",{},$globals.SetTest)});
  8314. //>>excludeEnd("ctx");
  8315. },
  8316. //>>excludeStart("ide", pragmas.excludeIdeData);
  8317. args: [],
  8318. source: "collectionWithDuplicates\x0a\x09\x22Set has no duplicates\x22\x0a\x09^ self collection add: 0; yourself",
  8319. referencedClasses: [],
  8320. //>>excludeEnd("ide");
  8321. messageSends: ["add:", "collection", "yourself"]
  8322. }),
  8323. $globals.SetTest);
  8324. $core.addMethod(
  8325. $core.method({
  8326. selector: "collectionWithNewValue",
  8327. protocol: 'fixture',
  8328. fn: function (){
  8329. var self=this;
  8330. function $Set(){return $globals.Set||(typeof Set=="undefined"?nil:Set)}
  8331. function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  8332. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8333. return $core.withContext(function($ctx1) {
  8334. //>>excludeEnd("ctx");
  8335. var $2,$3,$1;
  8336. $2=$recv($Set())._new();
  8337. $recv($2)._add_($Smalltalk());
  8338. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8339. $ctx1.sendIdx["add:"]=1;
  8340. //>>excludeEnd("ctx");
  8341. $recv($2)._add_(nil);
  8342. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8343. $ctx1.sendIdx["add:"]=2;
  8344. //>>excludeEnd("ctx");
  8345. $recv($2)._add_((3).__at((3)));
  8346. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8347. $ctx1.sendIdx["add:"]=3;
  8348. //>>excludeEnd("ctx");
  8349. $recv($2)._add_("N");
  8350. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8351. $ctx1.sendIdx["add:"]=4;
  8352. //>>excludeEnd("ctx");
  8353. $recv($2)._add_(false);
  8354. $3=$recv($2)._yourself();
  8355. $1=$3;
  8356. return $1;
  8357. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8358. }, function($ctx1) {$ctx1.fill(self,"collectionWithNewValue",{},$globals.SetTest)});
  8359. //>>excludeEnd("ctx");
  8360. },
  8361. //>>excludeStart("ide", pragmas.excludeIdeData);
  8362. args: [],
  8363. source: "collectionWithNewValue\x0a\x09^ Set new\x0a\x09\x09add: Smalltalk;\x0a\x09\x09add: nil;\x0a\x09\x09add: 3@3;\x0a\x09\x09add: 'N';\x0a\x09\x09add: false;\x0a\x09\x09yourself",
  8364. referencedClasses: ["Set", "Smalltalk"],
  8365. //>>excludeEnd("ide");
  8366. messageSends: ["add:", "new", "@", "yourself"]
  8367. }),
  8368. $globals.SetTest);
  8369. $core.addMethod(
  8370. $core.method({
  8371. selector: "testAddAll",
  8372. protocol: 'tests',
  8373. fn: function (){
  8374. var self=this;
  8375. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8376. return $core.withContext(function($ctx1) {
  8377. //>>excludeEnd("ctx");
  8378. var $2,$3,$4,$5,$1,$6,$8,$9,$10,$11,$7,$12,$14,$15,$13;
  8379. (
  8380. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8381. $ctx1.supercall = true,
  8382. //>>excludeEnd("ctx");
  8383. $globals.SetTest.superclass.fn.prototype._testAddAll.apply($recv(self), []));
  8384. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8385. $ctx1.supercall = false;
  8386. //>>excludeEnd("ctx");;
  8387. $2=self._collection();
  8388. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8389. $ctx1.sendIdx["collection"]=1;
  8390. //>>excludeEnd("ctx");
  8391. $3=$2;
  8392. $4=self._collection();
  8393. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8394. $ctx1.sendIdx["collection"]=2;
  8395. //>>excludeEnd("ctx");
  8396. $recv($3)._addAll_($4);
  8397. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8398. $ctx1.sendIdx["addAll:"]=1;
  8399. //>>excludeEnd("ctx");
  8400. $5=$recv($2)._yourself();
  8401. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8402. $ctx1.sendIdx["yourself"]=1;
  8403. //>>excludeEnd("ctx");
  8404. $1=$5;
  8405. $6=self._collection();
  8406. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8407. $ctx1.sendIdx["collection"]=3;
  8408. //>>excludeEnd("ctx");
  8409. self._assert_equals_($1,$6);
  8410. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8411. $ctx1.sendIdx["assert:equals:"]=1;
  8412. //>>excludeEnd("ctx");
  8413. $8=self._collection();
  8414. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8415. $ctx1.sendIdx["collection"]=4;
  8416. //>>excludeEnd("ctx");
  8417. $9=$8;
  8418. $10=self._collectionWithNewValue();
  8419. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8420. $ctx1.sendIdx["collectionWithNewValue"]=1;
  8421. //>>excludeEnd("ctx");
  8422. $recv($9)._addAll_($10);
  8423. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8424. $ctx1.sendIdx["addAll:"]=2;
  8425. //>>excludeEnd("ctx");
  8426. $11=$recv($8)._yourself();
  8427. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8428. $ctx1.sendIdx["yourself"]=2;
  8429. //>>excludeEnd("ctx");
  8430. $7=$11;
  8431. $12=self._collectionWithNewValue();
  8432. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8433. $ctx1.sendIdx["collectionWithNewValue"]=2;
  8434. //>>excludeEnd("ctx");
  8435. self._assert_equals_($7,$12);
  8436. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8437. $ctx1.sendIdx["assert:equals:"]=2;
  8438. //>>excludeEnd("ctx");
  8439. $14=self._collectionWithNewValue();
  8440. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8441. $ctx1.sendIdx["collectionWithNewValue"]=3;
  8442. //>>excludeEnd("ctx");
  8443. $recv($14)._addAll_(self._collection());
  8444. $15=$recv($14)._yourself();
  8445. $13=$15;
  8446. self._assert_equals_($13,self._collectionWithNewValue());
  8447. return self;
  8448. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8449. }, function($ctx1) {$ctx1.fill(self,"testAddAll",{},$globals.SetTest)});
  8450. //>>excludeEnd("ctx");
  8451. },
  8452. //>>excludeStart("ide", pragmas.excludeIdeData);
  8453. args: [],
  8454. 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",
  8455. referencedClasses: [],
  8456. //>>excludeEnd("ide");
  8457. messageSends: ["testAddAll", "assert:equals:", "addAll:", "collection", "yourself", "collectionWithNewValue"]
  8458. }),
  8459. $globals.SetTest);
  8460. $core.addMethod(
  8461. $core.method({
  8462. selector: "testAddRemove",
  8463. protocol: 'tests',
  8464. fn: function (){
  8465. var self=this;
  8466. var set;
  8467. function $Set(){return $globals.Set||(typeof Set=="undefined"?nil:Set)}
  8468. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8469. return $core.withContext(function($ctx1) {
  8470. //>>excludeEnd("ctx");
  8471. var $1,$2;
  8472. set=$recv($Set())._new();
  8473. self._assert_($recv(set)._isEmpty());
  8474. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8475. $ctx1.sendIdx["assert:"]=1;
  8476. //>>excludeEnd("ctx");
  8477. $recv(set)._add_((3));
  8478. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8479. $ctx1.sendIdx["add:"]=1;
  8480. //>>excludeEnd("ctx");
  8481. $1=$recv(set)._includes_((3));
  8482. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8483. $ctx1.sendIdx["includes:"]=1;
  8484. //>>excludeEnd("ctx");
  8485. self._assert_($1);
  8486. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8487. $ctx1.sendIdx["assert:"]=2;
  8488. //>>excludeEnd("ctx");
  8489. $recv(set)._add_((5));
  8490. $2=$recv(set)._includes_((5));
  8491. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8492. $ctx1.sendIdx["includes:"]=2;
  8493. //>>excludeEnd("ctx");
  8494. self._assert_($2);
  8495. $recv(set)._remove_((3));
  8496. self._deny_($recv(set)._includes_((3)));
  8497. return self;
  8498. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8499. }, function($ctx1) {$ctx1.fill(self,"testAddRemove",{set:set},$globals.SetTest)});
  8500. //>>excludeEnd("ctx");
  8501. },
  8502. //>>excludeStart("ide", pragmas.excludeIdeData);
  8503. args: [],
  8504. 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)",
  8505. referencedClasses: ["Set"],
  8506. //>>excludeEnd("ide");
  8507. messageSends: ["new", "assert:", "isEmpty", "add:", "includes:", "remove:", "deny:"]
  8508. }),
  8509. $globals.SetTest);
  8510. $core.addMethod(
  8511. $core.method({
  8512. selector: "testAt",
  8513. protocol: 'tests',
  8514. fn: function (){
  8515. var self=this;
  8516. function $Set(){return $globals.Set||(typeof Set=="undefined"?nil:Set)}
  8517. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  8518. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8519. return $core.withContext(function($ctx1) {
  8520. //>>excludeEnd("ctx");
  8521. self._should_raise_((function(){
  8522. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8523. return $core.withContext(function($ctx2) {
  8524. //>>excludeEnd("ctx");
  8525. return $recv($recv($Set())._new())._at_put_((1),(2));
  8526. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8527. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  8528. //>>excludeEnd("ctx");
  8529. }),$Error());
  8530. return self;
  8531. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8532. }, function($ctx1) {$ctx1.fill(self,"testAt",{},$globals.SetTest)});
  8533. //>>excludeEnd("ctx");
  8534. },
  8535. //>>excludeStart("ide", pragmas.excludeIdeData);
  8536. args: [],
  8537. source: "testAt\x0a\x09self should: [ Set new at: 1 put: 2 ] raise: Error",
  8538. referencedClasses: ["Set", "Error"],
  8539. //>>excludeEnd("ide");
  8540. messageSends: ["should:raise:", "at:put:", "new"]
  8541. }),
  8542. $globals.SetTest);
  8543. $core.addMethod(
  8544. $core.method({
  8545. selector: "testCollect",
  8546. protocol: 'tests',
  8547. fn: function (){
  8548. var self=this;
  8549. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8550. return $core.withContext(function($ctx1) {
  8551. //>>excludeEnd("ctx");
  8552. var $2,$1;
  8553. (
  8554. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8555. $ctx1.supercall = true,
  8556. //>>excludeEnd("ctx");
  8557. $globals.SetTest.superclass.fn.prototype._testCollect.apply($recv(self), []));
  8558. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8559. $ctx1.supercall = false;
  8560. //>>excludeEnd("ctx");;
  8561. $2=[(5), (6), (8)]._asSet();
  8562. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8563. $ctx1.sendIdx["asSet"]=1;
  8564. //>>excludeEnd("ctx");
  8565. $1=$recv($2)._collect_((function(x){
  8566. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8567. return $core.withContext(function($ctx2) {
  8568. //>>excludeEnd("ctx");
  8569. return $recv(x).__backslash_backslash((3));
  8570. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8571. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)});
  8572. //>>excludeEnd("ctx");
  8573. }));
  8574. self._assert_equals_($1,[(0), (2)]._asSet());
  8575. return self;
  8576. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8577. }, function($ctx1) {$ctx1.fill(self,"testCollect",{},$globals.SetTest)});
  8578. //>>excludeEnd("ctx");
  8579. },
  8580. //>>excludeStart("ide", pragmas.excludeIdeData);
  8581. args: [],
  8582. source: "testCollect\x0a\x09super testCollect.\x0a\x09self assert: (#(5 6 8) asSet collect: [ :x | x \x5c\x5c 3 ]) equals: #(0 2) asSet",
  8583. referencedClasses: [],
  8584. //>>excludeEnd("ide");
  8585. messageSends: ["testCollect", "assert:equals:", "collect:", "asSet", "\x5c\x5c"]
  8586. }),
  8587. $globals.SetTest);
  8588. $core.addMethod(
  8589. $core.method({
  8590. selector: "testComma",
  8591. protocol: 'tests',
  8592. fn: function (){
  8593. var self=this;
  8594. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8595. return $core.withContext(function($ctx1) {
  8596. //>>excludeEnd("ctx");
  8597. var $2,$3,$1,$4,$6,$7,$5,$8,$10,$9;
  8598. (
  8599. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8600. $ctx1.supercall = true,
  8601. //>>excludeEnd("ctx");
  8602. $globals.SetTest.superclass.fn.prototype._testComma.apply($recv(self), []));
  8603. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8604. $ctx1.supercall = false;
  8605. //>>excludeEnd("ctx");;
  8606. $2=self._collection();
  8607. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8608. $ctx1.sendIdx["collection"]=1;
  8609. //>>excludeEnd("ctx");
  8610. $3=self._collection();
  8611. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8612. $ctx1.sendIdx["collection"]=2;
  8613. //>>excludeEnd("ctx");
  8614. $1=$recv($2).__comma($3);
  8615. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8616. $ctx1.sendIdx[","]=1;
  8617. //>>excludeEnd("ctx");
  8618. $4=self._collection();
  8619. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8620. $ctx1.sendIdx["collection"]=3;
  8621. //>>excludeEnd("ctx");
  8622. self._assert_equals_($1,$4);
  8623. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8624. $ctx1.sendIdx["assert:equals:"]=1;
  8625. //>>excludeEnd("ctx");
  8626. $6=self._collection();
  8627. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8628. $ctx1.sendIdx["collection"]=4;
  8629. //>>excludeEnd("ctx");
  8630. $7=self._collectionWithNewValue();
  8631. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8632. $ctx1.sendIdx["collectionWithNewValue"]=1;
  8633. //>>excludeEnd("ctx");
  8634. $5=$recv($6).__comma($7);
  8635. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8636. $ctx1.sendIdx[","]=2;
  8637. //>>excludeEnd("ctx");
  8638. $8=self._collectionWithNewValue();
  8639. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8640. $ctx1.sendIdx["collectionWithNewValue"]=2;
  8641. //>>excludeEnd("ctx");
  8642. self._assert_equals_($5,$8);
  8643. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8644. $ctx1.sendIdx["assert:equals:"]=2;
  8645. //>>excludeEnd("ctx");
  8646. $10=self._collectionWithNewValue();
  8647. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8648. $ctx1.sendIdx["collectionWithNewValue"]=3;
  8649. //>>excludeEnd("ctx");
  8650. $9=$recv($10).__comma(self._collection());
  8651. self._assert_equals_($9,self._collectionWithNewValue());
  8652. return self;
  8653. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8654. }, function($ctx1) {$ctx1.fill(self,"testComma",{},$globals.SetTest)});
  8655. //>>excludeEnd("ctx");
  8656. },
  8657. //>>excludeStart("ide", pragmas.excludeIdeData);
  8658. args: [],
  8659. 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",
  8660. referencedClasses: [],
  8661. //>>excludeEnd("ide");
  8662. messageSends: ["testComma", "assert:equals:", ",", "collection", "collectionWithNewValue"]
  8663. }),
  8664. $globals.SetTest);
  8665. $core.addMethod(
  8666. $core.method({
  8667. selector: "testComparing",
  8668. protocol: 'tests',
  8669. fn: function (){
  8670. var self=this;
  8671. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8672. return $core.withContext(function($ctx1) {
  8673. //>>excludeEnd("ctx");
  8674. var $1,$2,$3,$4,$6,$7,$5,$9,$8;
  8675. $1=[(0), (2)]._asSet();
  8676. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8677. $ctx1.sendIdx["asSet"]=1;
  8678. //>>excludeEnd("ctx");
  8679. $2=[(0), (2)]._asSet();
  8680. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8681. $ctx1.sendIdx["asSet"]=2;
  8682. //>>excludeEnd("ctx");
  8683. self._assert_equals_($1,$2);
  8684. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8685. $ctx1.sendIdx["assert:equals:"]=1;
  8686. //>>excludeEnd("ctx");
  8687. $3=[(2), (0)]._asSet();
  8688. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8689. $ctx1.sendIdx["asSet"]=3;
  8690. //>>excludeEnd("ctx");
  8691. $4=[(0), (2)]._asSet();
  8692. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8693. $ctx1.sendIdx["asSet"]=4;
  8694. //>>excludeEnd("ctx");
  8695. self._assert_equals_($3,$4);
  8696. $6=[(0), (2), (3)]._asSet();
  8697. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8698. $ctx1.sendIdx["asSet"]=5;
  8699. //>>excludeEnd("ctx");
  8700. $7=[(0), (2)]._asSet();
  8701. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8702. $ctx1.sendIdx["asSet"]=6;
  8703. //>>excludeEnd("ctx");
  8704. $5=$recv($6).__eq($7);
  8705. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8706. $ctx1.sendIdx["="]=1;
  8707. //>>excludeEnd("ctx");
  8708. self._deny_($5);
  8709. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8710. $ctx1.sendIdx["deny:"]=1;
  8711. //>>excludeEnd("ctx");
  8712. $9=[(1), (2)]._asSet();
  8713. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8714. $ctx1.sendIdx["asSet"]=7;
  8715. //>>excludeEnd("ctx");
  8716. $8=$recv($9).__eq([(0), (2)]._asSet());
  8717. self._deny_($8);
  8718. return self;
  8719. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8720. }, function($ctx1) {$ctx1.fill(self,"testComparing",{},$globals.SetTest)});
  8721. //>>excludeEnd("ctx");
  8722. },
  8723. //>>excludeStart("ide", pragmas.excludeIdeData);
  8724. args: [],
  8725. 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",
  8726. referencedClasses: [],
  8727. //>>excludeEnd("ide");
  8728. messageSends: ["assert:equals:", "asSet", "deny:", "="]
  8729. }),
  8730. $globals.SetTest);
  8731. $core.addMethod(
  8732. $core.method({
  8733. selector: "testPrintString",
  8734. protocol: 'tests',
  8735. fn: function (){
  8736. var self=this;
  8737. var set;
  8738. function $Set(){return $globals.Set||(typeof Set=="undefined"?nil:Set)}
  8739. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8740. return $core.withContext(function($ctx1) {
  8741. //>>excludeEnd("ctx");
  8742. var $1,$2,$3,$4,$5,$6,$7,$8,$9;
  8743. set=$recv($Set())._new();
  8744. $1=$recv(set)._printString();
  8745. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8746. $ctx1.sendIdx["printString"]=1;
  8747. //>>excludeEnd("ctx");
  8748. self._assert_equals_($1,"a Set ()");
  8749. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8750. $ctx1.sendIdx["assert:equals:"]=1;
  8751. //>>excludeEnd("ctx");
  8752. $2=set;
  8753. $recv($2)._add_((1));
  8754. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8755. $ctx1.sendIdx["add:"]=1;
  8756. //>>excludeEnd("ctx");
  8757. $3=$recv($2)._add_((3));
  8758. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8759. $ctx1.sendIdx["add:"]=2;
  8760. //>>excludeEnd("ctx");
  8761. $4=$recv(set)._printString();
  8762. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8763. $ctx1.sendIdx["printString"]=2;
  8764. //>>excludeEnd("ctx");
  8765. self._assert_equals_($4,"a Set (1 3)");
  8766. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8767. $ctx1.sendIdx["assert:equals:"]=2;
  8768. //>>excludeEnd("ctx");
  8769. $recv(set)._add_("foo");
  8770. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8771. $ctx1.sendIdx["add:"]=3;
  8772. //>>excludeEnd("ctx");
  8773. $5=$recv(set)._printString();
  8774. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8775. $ctx1.sendIdx["printString"]=3;
  8776. //>>excludeEnd("ctx");
  8777. self._assert_equals_($5,"a Set (1 3 'foo')");
  8778. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8779. $ctx1.sendIdx["assert:equals:"]=3;
  8780. //>>excludeEnd("ctx");
  8781. $6=set;
  8782. $recv($6)._remove_((1));
  8783. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8784. $ctx1.sendIdx["remove:"]=1;
  8785. //>>excludeEnd("ctx");
  8786. $7=$recv($6)._remove_((3));
  8787. $8=$recv(set)._printString();
  8788. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8789. $ctx1.sendIdx["printString"]=4;
  8790. //>>excludeEnd("ctx");
  8791. self._assert_equals_($8,"a Set ('foo')");
  8792. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8793. $ctx1.sendIdx["assert:equals:"]=4;
  8794. //>>excludeEnd("ctx");
  8795. $recv(set)._add_((3));
  8796. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8797. $ctx1.sendIdx["add:"]=4;
  8798. //>>excludeEnd("ctx");
  8799. $9=$recv(set)._printString();
  8800. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8801. $ctx1.sendIdx["printString"]=5;
  8802. //>>excludeEnd("ctx");
  8803. self._assert_equals_($9,"a Set (3 'foo')");
  8804. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8805. $ctx1.sendIdx["assert:equals:"]=5;
  8806. //>>excludeEnd("ctx");
  8807. $recv(set)._add_((3));
  8808. self._assert_equals_($recv(set)._printString(),"a Set (3 'foo')");
  8809. return self;
  8810. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8811. }, function($ctx1) {$ctx1.fill(self,"testPrintString",{set:set},$globals.SetTest)});
  8812. //>>excludeEnd("ctx");
  8813. },
  8814. //>>excludeStart("ide", pragmas.excludeIdeData);
  8815. args: [],
  8816. 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'')'",
  8817. referencedClasses: ["Set"],
  8818. //>>excludeEnd("ide");
  8819. messageSends: ["new", "assert:equals:", "printString", "add:", "remove:"]
  8820. }),
  8821. $globals.SetTest);
  8822. $core.addMethod(
  8823. $core.method({
  8824. selector: "testUnboxedObjects",
  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 $4,$3,$2,$1;
  8832. $4="foo"._yourself();
  8833. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8834. $ctx1.sendIdx["yourself"]=1;
  8835. //>>excludeEnd("ctx");
  8836. $3=[$4,"foo"._yourself()];
  8837. $2=$recv($3)._asSet();
  8838. $1=$recv($2)._asArray();
  8839. self._assert_equals_($1,["foo"]);
  8840. return self;
  8841. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8842. }, function($ctx1) {$ctx1.fill(self,"testUnboxedObjects",{},$globals.SetTest)});
  8843. //>>excludeEnd("ctx");
  8844. },
  8845. //>>excludeStart("ide", pragmas.excludeIdeData);
  8846. args: [],
  8847. source: "testUnboxedObjects\x0a\x09self assert: {'foo' yourself. 'foo' yourself} asSet asArray equals: #('foo')",
  8848. referencedClasses: [],
  8849. //>>excludeEnd("ide");
  8850. messageSends: ["assert:equals:", "asArray", "asSet", "yourself"]
  8851. }),
  8852. $globals.SetTest);
  8853. $core.addMethod(
  8854. $core.method({
  8855. selector: "testUnicity",
  8856. protocol: 'tests',
  8857. fn: function (){
  8858. var self=this;
  8859. var set;
  8860. function $Set(){return $globals.Set||(typeof Set=="undefined"?nil:Set)}
  8861. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8862. return $core.withContext(function($ctx1) {
  8863. //>>excludeEnd("ctx");
  8864. var $1;
  8865. set=$recv($Set())._new();
  8866. $recv(set)._add_((21));
  8867. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8868. $ctx1.sendIdx["add:"]=1;
  8869. //>>excludeEnd("ctx");
  8870. $recv(set)._add_("hello");
  8871. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8872. $ctx1.sendIdx["add:"]=2;
  8873. //>>excludeEnd("ctx");
  8874. $recv(set)._add_((21));
  8875. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8876. $ctx1.sendIdx["add:"]=3;
  8877. //>>excludeEnd("ctx");
  8878. $1=$recv(set)._size();
  8879. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8880. $ctx1.sendIdx["size"]=1;
  8881. //>>excludeEnd("ctx");
  8882. self._assert_equals_($1,(2));
  8883. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8884. $ctx1.sendIdx["assert:equals:"]=1;
  8885. //>>excludeEnd("ctx");
  8886. $recv(set)._add_("hello");
  8887. self._assert_equals_($recv(set)._size(),(2));
  8888. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8889. $ctx1.sendIdx["assert:equals:"]=2;
  8890. //>>excludeEnd("ctx");
  8891. self._assert_equals_($recv(set)._asArray(),[(21), "hello"]);
  8892. return self;
  8893. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8894. }, function($ctx1) {$ctx1.fill(self,"testUnicity",{set:set},$globals.SetTest)});
  8895. //>>excludeEnd("ctx");
  8896. },
  8897. //>>excludeStart("ide", pragmas.excludeIdeData);
  8898. args: [],
  8899. 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')",
  8900. referencedClasses: ["Set"],
  8901. //>>excludeEnd("ide");
  8902. messageSends: ["new", "add:", "assert:equals:", "size", "asArray"]
  8903. }),
  8904. $globals.SetTest);
  8905. $core.addMethod(
  8906. $core.method({
  8907. selector: "collectionClass",
  8908. protocol: 'fixture',
  8909. fn: function (){
  8910. var self=this;
  8911. function $Set(){return $globals.Set||(typeof Set=="undefined"?nil:Set)}
  8912. return $Set();
  8913. },
  8914. //>>excludeStart("ide", pragmas.excludeIdeData);
  8915. args: [],
  8916. source: "collectionClass\x0a\x09^ Set",
  8917. referencedClasses: ["Set"],
  8918. //>>excludeEnd("ide");
  8919. messageSends: []
  8920. }),
  8921. $globals.SetTest.klass);
  8922. $core.addClass('ConsoleTranscriptTest', $globals.TestCase, [], 'Kernel-Tests');
  8923. $core.addMethod(
  8924. $core.method({
  8925. selector: "testShow",
  8926. protocol: 'tests',
  8927. fn: function (){
  8928. var self=this;
  8929. var originalTranscript;
  8930. function $Transcript(){return $globals.Transcript||(typeof Transcript=="undefined"?nil:Transcript)}
  8931. function $ConsoleTranscript(){return $globals.ConsoleTranscript||(typeof ConsoleTranscript=="undefined"?nil:ConsoleTranscript)}
  8932. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  8933. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8934. return $core.withContext(function($ctx1) {
  8935. //>>excludeEnd("ctx");
  8936. originalTranscript=$recv($Transcript())._current();
  8937. $recv($Transcript())._register_($recv($ConsoleTranscript())._new());
  8938. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8939. $ctx1.sendIdx["register:"]=1;
  8940. //>>excludeEnd("ctx");
  8941. self._shouldnt_raise_((function(){
  8942. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8943. return $core.withContext(function($ctx2) {
  8944. //>>excludeEnd("ctx");
  8945. return $recv($Transcript())._show_("Hello console!");
  8946. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8947. $ctx2.sendIdx["show:"]=1;
  8948. //>>excludeEnd("ctx");
  8949. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8950. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  8951. //>>excludeEnd("ctx");
  8952. }),$Error());
  8953. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8954. $ctx1.sendIdx["shouldnt:raise:"]=1;
  8955. //>>excludeEnd("ctx");
  8956. self._shouldnt_raise_((function(){
  8957. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8958. return $core.withContext(function($ctx2) {
  8959. //>>excludeEnd("ctx");
  8960. return $recv($Transcript())._show_(console);
  8961. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8962. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  8963. //>>excludeEnd("ctx");
  8964. }),$Error());
  8965. $recv($Transcript())._register_(originalTranscript);
  8966. return self;
  8967. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8968. }, function($ctx1) {$ctx1.fill(self,"testShow",{originalTranscript:originalTranscript},$globals.ConsoleTranscriptTest)});
  8969. //>>excludeEnd("ctx");
  8970. },
  8971. //>>excludeStart("ide", pragmas.excludeIdeData);
  8972. args: [],
  8973. 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.",
  8974. referencedClasses: ["Transcript", "ConsoleTranscript", "Error"],
  8975. //>>excludeEnd("ide");
  8976. messageSends: ["current", "register:", "new", "shouldnt:raise:", "show:"]
  8977. }),
  8978. $globals.ConsoleTranscriptTest);
  8979. $core.addClass('JSObjectProxyTest', $globals.TestCase, [], 'Kernel-Tests');
  8980. $core.addMethod(
  8981. $core.method({
  8982. selector: "jsNull",
  8983. protocol: 'accessing',
  8984. fn: function (){
  8985. var self=this;
  8986. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8987. return $core.withContext(function($ctx1) {
  8988. //>>excludeEnd("ctx");
  8989. return null;
  8990. return self;
  8991. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  8992. }, function($ctx1) {$ctx1.fill(self,"jsNull",{},$globals.JSObjectProxyTest)});
  8993. //>>excludeEnd("ctx");
  8994. },
  8995. //>>excludeStart("ide", pragmas.excludeIdeData);
  8996. args: [],
  8997. source: "jsNull\x0a\x09<return null>",
  8998. referencedClasses: [],
  8999. //>>excludeEnd("ide");
  9000. messageSends: []
  9001. }),
  9002. $globals.JSObjectProxyTest);
  9003. $core.addMethod(
  9004. $core.method({
  9005. selector: "jsObject",
  9006. protocol: 'accessing',
  9007. fn: function (){
  9008. var self=this;
  9009. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9010. return $core.withContext(function($ctx1) {
  9011. //>>excludeEnd("ctx");
  9012. return {a: 1, b: function() {return 2;}, c: function(object) {return object;}, d: '', 'e': null, 'f': void 0};
  9013. return self;
  9014. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9015. }, function($ctx1) {$ctx1.fill(self,"jsObject",{},$globals.JSObjectProxyTest)});
  9016. //>>excludeEnd("ctx");
  9017. },
  9018. //>>excludeStart("ide", pragmas.excludeIdeData);
  9019. args: [],
  9020. source: "jsObject\x0a\x09<return {a: 1, b: function() {return 2;}, c: function(object) {return object;}, d: '', 'e': null, 'f': void 0}>",
  9021. referencedClasses: [],
  9022. //>>excludeEnd("ide");
  9023. messageSends: []
  9024. }),
  9025. $globals.JSObjectProxyTest);
  9026. $core.addMethod(
  9027. $core.method({
  9028. selector: "jsUndefined",
  9029. protocol: 'accessing',
  9030. fn: function (){
  9031. var self=this;
  9032. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9033. return $core.withContext(function($ctx1) {
  9034. //>>excludeEnd("ctx");
  9035. return;
  9036. return self;
  9037. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9038. }, function($ctx1) {$ctx1.fill(self,"jsUndefined",{},$globals.JSObjectProxyTest)});
  9039. //>>excludeEnd("ctx");
  9040. },
  9041. //>>excludeStart("ide", pragmas.excludeIdeData);
  9042. args: [],
  9043. source: "jsUndefined\x0a\x09<return>",
  9044. referencedClasses: [],
  9045. //>>excludeEnd("ide");
  9046. messageSends: []
  9047. }),
  9048. $globals.JSObjectProxyTest);
  9049. $core.addMethod(
  9050. $core.method({
  9051. selector: "testAtIfAbsent",
  9052. protocol: 'tests',
  9053. fn: function (){
  9054. var self=this;
  9055. var testObject;
  9056. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9057. return $core.withContext(function($ctx1) {
  9058. //>>excludeEnd("ctx");
  9059. var $1,$2,$3;
  9060. testObject=self._jsObject();
  9061. $1=$recv(testObject)._at_ifAbsent_("abc",(function(){
  9062. return "Property does not exist";
  9063. }));
  9064. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9065. $ctx1.sendIdx["at:ifAbsent:"]=1;
  9066. //>>excludeEnd("ctx");
  9067. self._assert_equals_($1,"Property does not exist");
  9068. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9069. $ctx1.sendIdx["assert:equals:"]=1;
  9070. //>>excludeEnd("ctx");
  9071. $2=$recv(testObject)._at_ifAbsent_("e",(function(){
  9072. return "Property does not exist";
  9073. }));
  9074. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9075. $ctx1.sendIdx["at:ifAbsent:"]=2;
  9076. //>>excludeEnd("ctx");
  9077. self._assert_equals_($2,nil);
  9078. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9079. $ctx1.sendIdx["assert:equals:"]=2;
  9080. //>>excludeEnd("ctx");
  9081. $3=$recv(testObject)._at_ifAbsent_("a",(function(){
  9082. return "Property does not exist";
  9083. }));
  9084. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9085. $ctx1.sendIdx["at:ifAbsent:"]=3;
  9086. //>>excludeEnd("ctx");
  9087. self._assert_equals_($3,(1));
  9088. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9089. $ctx1.sendIdx["assert:equals:"]=3;
  9090. //>>excludeEnd("ctx");
  9091. self._assert_equals_($recv(testObject)._at_ifAbsent_("f",(function(){
  9092. return "Property does not exist";
  9093. })),nil);
  9094. return self;
  9095. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9096. }, function($ctx1) {$ctx1.fill(self,"testAtIfAbsent",{testObject:testObject},$globals.JSObjectProxyTest)});
  9097. //>>excludeEnd("ctx");
  9098. },
  9099. //>>excludeStart("ide", pragmas.excludeIdeData);
  9100. args: [],
  9101. 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.",
  9102. referencedClasses: [],
  9103. //>>excludeEnd("ide");
  9104. messageSends: ["jsObject", "assert:equals:", "at:ifAbsent:"]
  9105. }),
  9106. $globals.JSObjectProxyTest);
  9107. $core.addMethod(
  9108. $core.method({
  9109. selector: "testAtIfPresent",
  9110. protocol: 'tests',
  9111. fn: function (){
  9112. var self=this;
  9113. var testObject;
  9114. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9115. return $core.withContext(function($ctx1) {
  9116. //>>excludeEnd("ctx");
  9117. var $2,$1,$4,$3,$6,$5;
  9118. testObject=self._jsObject();
  9119. $1=$recv(testObject)._at_ifPresent_("abc",(function(x){
  9120. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9121. return $core.withContext(function($ctx2) {
  9122. //>>excludeEnd("ctx");
  9123. $2=$recv(x)._asString();
  9124. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9125. $ctx2.sendIdx["asString"]=1;
  9126. //>>excludeEnd("ctx");
  9127. return "hello ".__comma($2);
  9128. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9129. $ctx2.sendIdx[","]=1;
  9130. //>>excludeEnd("ctx");
  9131. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9132. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)});
  9133. //>>excludeEnd("ctx");
  9134. }));
  9135. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9136. $ctx1.sendIdx["at:ifPresent:"]=1;
  9137. //>>excludeEnd("ctx");
  9138. self._assert_equals_($1,nil);
  9139. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9140. $ctx1.sendIdx["assert:equals:"]=1;
  9141. //>>excludeEnd("ctx");
  9142. $3=$recv(testObject)._at_ifPresent_("e",(function(x){
  9143. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9144. return $core.withContext(function($ctx2) {
  9145. //>>excludeEnd("ctx");
  9146. $4=$recv(x)._asString();
  9147. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9148. $ctx2.sendIdx["asString"]=2;
  9149. //>>excludeEnd("ctx");
  9150. return "hello ".__comma($4);
  9151. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9152. $ctx2.sendIdx[","]=2;
  9153. //>>excludeEnd("ctx");
  9154. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9155. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,2)});
  9156. //>>excludeEnd("ctx");
  9157. }));
  9158. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9159. $ctx1.sendIdx["at:ifPresent:"]=2;
  9160. //>>excludeEnd("ctx");
  9161. self._assert_equals_($3,"hello nil");
  9162. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9163. $ctx1.sendIdx["assert:equals:"]=2;
  9164. //>>excludeEnd("ctx");
  9165. $5=$recv(testObject)._at_ifPresent_("a",(function(x){
  9166. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9167. return $core.withContext(function($ctx2) {
  9168. //>>excludeEnd("ctx");
  9169. $6=$recv(x)._asString();
  9170. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9171. $ctx2.sendIdx["asString"]=3;
  9172. //>>excludeEnd("ctx");
  9173. return "hello ".__comma($6);
  9174. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9175. $ctx2.sendIdx[","]=3;
  9176. //>>excludeEnd("ctx");
  9177. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9178. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,3)});
  9179. //>>excludeEnd("ctx");
  9180. }));
  9181. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9182. $ctx1.sendIdx["at:ifPresent:"]=3;
  9183. //>>excludeEnd("ctx");
  9184. self._assert_equals_($5,"hello 1");
  9185. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9186. $ctx1.sendIdx["assert:equals:"]=3;
  9187. //>>excludeEnd("ctx");
  9188. self._assert_equals_($recv(testObject)._at_ifPresent_("f",(function(x){
  9189. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9190. return $core.withContext(function($ctx2) {
  9191. //>>excludeEnd("ctx");
  9192. return "hello ".__comma($recv(x)._asString());
  9193. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9194. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,4)});
  9195. //>>excludeEnd("ctx");
  9196. })),"hello nil");
  9197. return self;
  9198. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9199. }, function($ctx1) {$ctx1.fill(self,"testAtIfPresent",{testObject:testObject},$globals.JSObjectProxyTest)});
  9200. //>>excludeEnd("ctx");
  9201. },
  9202. //>>excludeStart("ide", pragmas.excludeIdeData);
  9203. args: [],
  9204. 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'.",
  9205. referencedClasses: [],
  9206. //>>excludeEnd("ide");
  9207. messageSends: ["jsObject", "assert:equals:", "at:ifPresent:", ",", "asString"]
  9208. }),
  9209. $globals.JSObjectProxyTest);
  9210. $core.addMethod(
  9211. $core.method({
  9212. selector: "testAtIfPresentIfAbsent",
  9213. protocol: 'tests',
  9214. fn: function (){
  9215. var self=this;
  9216. var testObject;
  9217. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9218. return $core.withContext(function($ctx1) {
  9219. //>>excludeEnd("ctx");
  9220. var $2,$1,$4,$3,$6,$5;
  9221. testObject=self._jsObject();
  9222. $1=$recv(testObject)._at_ifPresent_ifAbsent_("abc",(function(x){
  9223. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9224. return $core.withContext(function($ctx2) {
  9225. //>>excludeEnd("ctx");
  9226. $2=$recv(x)._asString();
  9227. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9228. $ctx2.sendIdx["asString"]=1;
  9229. //>>excludeEnd("ctx");
  9230. return "hello ".__comma($2);
  9231. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9232. $ctx2.sendIdx[","]=1;
  9233. //>>excludeEnd("ctx");
  9234. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9235. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)});
  9236. //>>excludeEnd("ctx");
  9237. }),(function(){
  9238. return "not present";
  9239. }));
  9240. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9241. $ctx1.sendIdx["at:ifPresent:ifAbsent:"]=1;
  9242. //>>excludeEnd("ctx");
  9243. self._assert_equals_($1,"not present");
  9244. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9245. $ctx1.sendIdx["assert:equals:"]=1;
  9246. //>>excludeEnd("ctx");
  9247. $3=$recv(testObject)._at_ifPresent_ifAbsent_("e",(function(x){
  9248. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9249. return $core.withContext(function($ctx2) {
  9250. //>>excludeEnd("ctx");
  9251. $4=$recv(x)._asString();
  9252. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9253. $ctx2.sendIdx["asString"]=2;
  9254. //>>excludeEnd("ctx");
  9255. return "hello ".__comma($4);
  9256. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9257. $ctx2.sendIdx[","]=2;
  9258. //>>excludeEnd("ctx");
  9259. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9260. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,3)});
  9261. //>>excludeEnd("ctx");
  9262. }),(function(){
  9263. return "not present";
  9264. }));
  9265. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9266. $ctx1.sendIdx["at:ifPresent:ifAbsent:"]=2;
  9267. //>>excludeEnd("ctx");
  9268. self._assert_equals_($3,"hello nil");
  9269. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9270. $ctx1.sendIdx["assert:equals:"]=2;
  9271. //>>excludeEnd("ctx");
  9272. $5=$recv(testObject)._at_ifPresent_ifAbsent_("a",(function(x){
  9273. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9274. return $core.withContext(function($ctx2) {
  9275. //>>excludeEnd("ctx");
  9276. $6=$recv(x)._asString();
  9277. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9278. $ctx2.sendIdx["asString"]=3;
  9279. //>>excludeEnd("ctx");
  9280. return "hello ".__comma($6);
  9281. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9282. $ctx2.sendIdx[","]=3;
  9283. //>>excludeEnd("ctx");
  9284. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9285. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,5)});
  9286. //>>excludeEnd("ctx");
  9287. }),(function(){
  9288. return "not present";
  9289. }));
  9290. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9291. $ctx1.sendIdx["at:ifPresent:ifAbsent:"]=3;
  9292. //>>excludeEnd("ctx");
  9293. self._assert_equals_($5,"hello 1");
  9294. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9295. $ctx1.sendIdx["assert:equals:"]=3;
  9296. //>>excludeEnd("ctx");
  9297. self._assert_equals_($recv(testObject)._at_ifPresent_ifAbsent_("f",(function(x){
  9298. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9299. return $core.withContext(function($ctx2) {
  9300. //>>excludeEnd("ctx");
  9301. return "hello ".__comma($recv(x)._asString());
  9302. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9303. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,7)});
  9304. //>>excludeEnd("ctx");
  9305. }),(function(){
  9306. return "not present";
  9307. })),"hello nil");
  9308. return self;
  9309. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9310. }, function($ctx1) {$ctx1.fill(self,"testAtIfPresentIfAbsent",{testObject:testObject},$globals.JSObjectProxyTest)});
  9311. //>>excludeEnd("ctx");
  9312. },
  9313. //>>excludeStart("ide", pragmas.excludeIdeData);
  9314. args: [],
  9315. 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'.",
  9316. referencedClasses: [],
  9317. //>>excludeEnd("ide");
  9318. messageSends: ["jsObject", "assert:equals:", "at:ifPresent:ifAbsent:", ",", "asString"]
  9319. }),
  9320. $globals.JSObjectProxyTest);
  9321. $core.addMethod(
  9322. $core.method({
  9323. selector: "testAtPut",
  9324. protocol: 'tests',
  9325. fn: function (){
  9326. var self=this;
  9327. var testObject;
  9328. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9329. return $core.withContext(function($ctx1) {
  9330. //>>excludeEnd("ctx");
  9331. var $2,$1;
  9332. testObject=self._jsObject();
  9333. $2=$recv(testObject)._at_("abc");
  9334. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9335. $ctx1.sendIdx["at:"]=1;
  9336. //>>excludeEnd("ctx");
  9337. $1=$recv($2).__tild_eq("xyz");
  9338. self._assert_($1);
  9339. self._assert_equals_($recv(testObject)._at_put_("abc","xyz"),"xyz");
  9340. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9341. $ctx1.sendIdx["assert:equals:"]=1;
  9342. //>>excludeEnd("ctx");
  9343. self._assert_equals_($recv(testObject)._at_("abc"),"xyz");
  9344. return self;
  9345. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9346. }, function($ctx1) {$ctx1.fill(self,"testAtPut",{testObject:testObject},$globals.JSObjectProxyTest)});
  9347. //>>excludeEnd("ctx");
  9348. },
  9349. //>>excludeStart("ide", pragmas.excludeIdeData);
  9350. args: [],
  9351. 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'",
  9352. referencedClasses: [],
  9353. //>>excludeEnd("ide");
  9354. messageSends: ["jsObject", "assert:", "~=", "at:", "assert:equals:", "at:put:"]
  9355. }),
  9356. $globals.JSObjectProxyTest);
  9357. $core.addMethod(
  9358. $core.method({
  9359. selector: "testComparison",
  9360. protocol: 'tests',
  9361. fn: function (){
  9362. var self=this;
  9363. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  9364. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9365. return $core.withContext(function($ctx1) {
  9366. //>>excludeEnd("ctx");
  9367. var $1,$2;
  9368. self._assert_equals_($recv([console,(2)])._indexOf_(console),(1));
  9369. $1=$recv(console).__eq(console);
  9370. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9371. $ctx1.sendIdx["="]=1;
  9372. //>>excludeEnd("ctx");
  9373. self._assert_($1);
  9374. $2=$recv(console).__eq($recv($Object())._new());
  9375. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9376. $ctx1.sendIdx["="]=2;
  9377. //>>excludeEnd("ctx");
  9378. self._deny_($2);
  9379. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9380. $ctx1.sendIdx["deny:"]=1;
  9381. //>>excludeEnd("ctx");
  9382. self._deny_($recv(console).__eq(self._jsObject()));
  9383. return self;
  9384. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9385. }, function($ctx1) {$ctx1.fill(self,"testComparison",{},$globals.JSObjectProxyTest)});
  9386. //>>excludeEnd("ctx");
  9387. },
  9388. //>>excludeStart("ide", pragmas.excludeIdeData);
  9389. args: [],
  9390. 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",
  9391. referencedClasses: ["Object"],
  9392. //>>excludeEnd("ide");
  9393. messageSends: ["assert:equals:", "indexOf:", "assert:", "=", "deny:", "new", "jsObject"]
  9394. }),
  9395. $globals.JSObjectProxyTest);
  9396. $core.addMethod(
  9397. $core.method({
  9398. selector: "testDNU",
  9399. protocol: 'tests',
  9400. fn: function (){
  9401. var self=this;
  9402. function $MessageNotUnderstood(){return $globals.MessageNotUnderstood||(typeof MessageNotUnderstood=="undefined"?nil:MessageNotUnderstood)}
  9403. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9404. return $core.withContext(function($ctx1) {
  9405. //>>excludeEnd("ctx");
  9406. self._should_raise_((function(){
  9407. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9408. return $core.withContext(function($ctx2) {
  9409. //>>excludeEnd("ctx");
  9410. return $recv(self._jsObject())._foo();
  9411. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9412. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  9413. //>>excludeEnd("ctx");
  9414. }),$MessageNotUnderstood());
  9415. return self;
  9416. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9417. }, function($ctx1) {$ctx1.fill(self,"testDNU",{},$globals.JSObjectProxyTest)});
  9418. //>>excludeEnd("ctx");
  9419. },
  9420. //>>excludeStart("ide", pragmas.excludeIdeData);
  9421. args: [],
  9422. source: "testDNU\x0a\x09self should: [ self jsObject foo ] raise: MessageNotUnderstood",
  9423. referencedClasses: ["MessageNotUnderstood"],
  9424. //>>excludeEnd("ide");
  9425. messageSends: ["should:raise:", "foo", "jsObject"]
  9426. }),
  9427. $globals.JSObjectProxyTest);
  9428. $core.addMethod(
  9429. $core.method({
  9430. selector: "testDNURegression1057",
  9431. protocol: 'tests',
  9432. fn: function (){
  9433. var self=this;
  9434. var jsObject;
  9435. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  9436. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9437. return $core.withContext(function($ctx1) {
  9438. //>>excludeEnd("ctx");
  9439. var $1;
  9440. jsObject=[];
  9441. $recv(jsObject)._basicAt_put_("allowJavaScriptCalls",true);
  9442. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9443. $ctx1.sendIdx["basicAt:put:"]=1;
  9444. //>>excludeEnd("ctx");
  9445. $recv(jsObject)._basicAt_put_("foo",(3));
  9446. self._shouldnt_raise_((function(){
  9447. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9448. return $core.withContext(function($ctx2) {
  9449. //>>excludeEnd("ctx");
  9450. return $recv(jsObject)._foo();
  9451. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9452. $ctx2.sendIdx["foo"]=1;
  9453. //>>excludeEnd("ctx");
  9454. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9455. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  9456. //>>excludeEnd("ctx");
  9457. }),$Error());
  9458. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9459. $ctx1.sendIdx["shouldnt:raise:"]=1;
  9460. //>>excludeEnd("ctx");
  9461. $1=$recv(jsObject)._foo();
  9462. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9463. $ctx1.sendIdx["foo"]=2;
  9464. //>>excludeEnd("ctx");
  9465. self._assert_equals_($1,(3));
  9466. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9467. $ctx1.sendIdx["assert:equals:"]=1;
  9468. //>>excludeEnd("ctx");
  9469. self._shouldnt_raise_((function(){
  9470. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9471. return $core.withContext(function($ctx2) {
  9472. //>>excludeEnd("ctx");
  9473. return $recv(jsObject)._foo_((4));
  9474. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9475. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  9476. //>>excludeEnd("ctx");
  9477. }),$Error());
  9478. self._assert_equals_($recv(jsObject)._foo(),(4));
  9479. return self;
  9480. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9481. }, function($ctx1) {$ctx1.fill(self,"testDNURegression1057",{jsObject:jsObject},$globals.JSObjectProxyTest)});
  9482. //>>excludeEnd("ctx");
  9483. },
  9484. //>>excludeStart("ide", pragmas.excludeIdeData);
  9485. args: [],
  9486. 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",
  9487. referencedClasses: ["Error"],
  9488. //>>excludeEnd("ide");
  9489. messageSends: ["basicAt:put:", "shouldnt:raise:", "foo", "assert:equals:", "foo:"]
  9490. }),
  9491. $globals.JSObjectProxyTest);
  9492. $core.addMethod(
  9493. $core.method({
  9494. selector: "testDNURegression1059",
  9495. protocol: 'tests',
  9496. fn: function (){
  9497. var self=this;
  9498. var jsObject;
  9499. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  9500. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9501. return $core.withContext(function($ctx1) {
  9502. //>>excludeEnd("ctx");
  9503. jsObject=[];
  9504. $recv(jsObject)._basicAt_put_("allowJavaScriptCalls",true);
  9505. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9506. $ctx1.sendIdx["basicAt:put:"]=1;
  9507. //>>excludeEnd("ctx");
  9508. $recv(jsObject)._basicAt_put_("x",(3));
  9509. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9510. $ctx1.sendIdx["basicAt:put:"]=2;
  9511. //>>excludeEnd("ctx");
  9512. $recv(jsObject)._basicAt_put_("x:",(function(){
  9513. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9514. return $core.withContext(function($ctx2) {
  9515. //>>excludeEnd("ctx");
  9516. return self._error();
  9517. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9518. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  9519. //>>excludeEnd("ctx");
  9520. }));
  9521. self._shouldnt_raise_((function(){
  9522. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9523. return $core.withContext(function($ctx2) {
  9524. //>>excludeEnd("ctx");
  9525. return $recv(jsObject)._x_((4));
  9526. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9527. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  9528. //>>excludeEnd("ctx");
  9529. }),$Error());
  9530. self._assert_equals_($recv(jsObject)._x(),(4));
  9531. return self;
  9532. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9533. }, function($ctx1) {$ctx1.fill(self,"testDNURegression1059",{jsObject:jsObject},$globals.JSObjectProxyTest)});
  9534. //>>excludeEnd("ctx");
  9535. },
  9536. //>>excludeStart("ide", pragmas.excludeIdeData);
  9537. args: [],
  9538. 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",
  9539. referencedClasses: ["Error"],
  9540. //>>excludeEnd("ide");
  9541. messageSends: ["basicAt:put:", "error", "shouldnt:raise:", "x:", "assert:equals:", "x"]
  9542. }),
  9543. $globals.JSObjectProxyTest);
  9544. $core.addMethod(
  9545. $core.method({
  9546. selector: "testDNURegression1062",
  9547. protocol: 'tests',
  9548. fn: function (){
  9549. var self=this;
  9550. var jsObject,stored;
  9551. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  9552. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9553. return $core.withContext(function($ctx1) {
  9554. //>>excludeEnd("ctx");
  9555. jsObject=[];
  9556. $recv(jsObject)._basicAt_put_("allowJavaScriptCalls",true);
  9557. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9558. $ctx1.sendIdx["basicAt:put:"]=1;
  9559. //>>excludeEnd("ctx");
  9560. $recv(jsObject)._basicAt_put_("x",(function(v){
  9561. stored=v;
  9562. return stored;
  9563. }));
  9564. self._shouldnt_raise_((function(){
  9565. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9566. return $core.withContext(function($ctx2) {
  9567. //>>excludeEnd("ctx");
  9568. return $recv(jsObject)._x_((4));
  9569. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9570. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  9571. //>>excludeEnd("ctx");
  9572. }),$Error());
  9573. self._assert_equals_(stored,(4));
  9574. return self;
  9575. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9576. }, function($ctx1) {$ctx1.fill(self,"testDNURegression1062",{jsObject:jsObject,stored:stored},$globals.JSObjectProxyTest)});
  9577. //>>excludeEnd("ctx");
  9578. },
  9579. //>>excludeStart("ide", pragmas.excludeIdeData);
  9580. args: [],
  9581. 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",
  9582. referencedClasses: ["Error"],
  9583. //>>excludeEnd("ide");
  9584. messageSends: ["basicAt:put:", "shouldnt:raise:", "x:", "assert:equals:"]
  9585. }),
  9586. $globals.JSObjectProxyTest);
  9587. $core.addMethod(
  9588. $core.method({
  9589. selector: "testDNUWithAllowJavaScriptCalls",
  9590. protocol: 'tests',
  9591. fn: function (){
  9592. var self=this;
  9593. var jsObject;
  9594. function $MessageNotUnderstood(){return $globals.MessageNotUnderstood||(typeof MessageNotUnderstood=="undefined"?nil:MessageNotUnderstood)}
  9595. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9596. return $core.withContext(function($ctx1) {
  9597. //>>excludeEnd("ctx");
  9598. jsObject=[];
  9599. $recv(jsObject)._basicAt_put_("allowJavaScriptCalls",true);
  9600. self._should_raise_((function(){
  9601. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9602. return $core.withContext(function($ctx2) {
  9603. //>>excludeEnd("ctx");
  9604. return $recv(jsObject)._foo();
  9605. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9606. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  9607. //>>excludeEnd("ctx");
  9608. }),$MessageNotUnderstood());
  9609. return self;
  9610. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9611. }, function($ctx1) {$ctx1.fill(self,"testDNUWithAllowJavaScriptCalls",{jsObject:jsObject},$globals.JSObjectProxyTest)});
  9612. //>>excludeEnd("ctx");
  9613. },
  9614. //>>excludeStart("ide", pragmas.excludeIdeData);
  9615. args: [],
  9616. source: "testDNUWithAllowJavaScriptCalls\x0a\x09| jsObject |\x0a\x09jsObject := #().\x0a\x09jsObject basicAt: 'allowJavaScriptCalls' put: true.\x0a\x09self should: [ jsObject foo ] raise: MessageNotUnderstood",
  9617. referencedClasses: ["MessageNotUnderstood"],
  9618. //>>excludeEnd("ide");
  9619. messageSends: ["basicAt:put:", "should:raise:", "foo"]
  9620. }),
  9621. $globals.JSObjectProxyTest);
  9622. $core.addMethod(
  9623. $core.method({
  9624. selector: "testMessageSend",
  9625. protocol: 'tests',
  9626. fn: function (){
  9627. var self=this;
  9628. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9629. return $core.withContext(function($ctx1) {
  9630. //>>excludeEnd("ctx");
  9631. var $2,$1,$4,$3;
  9632. $2=self._jsObject();
  9633. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9634. $ctx1.sendIdx["jsObject"]=1;
  9635. //>>excludeEnd("ctx");
  9636. $1=$recv($2)._a();
  9637. self._assert_equals_($1,(1));
  9638. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9639. $ctx1.sendIdx["assert:equals:"]=1;
  9640. //>>excludeEnd("ctx");
  9641. $4=self._jsObject();
  9642. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9643. $ctx1.sendIdx["jsObject"]=2;
  9644. //>>excludeEnd("ctx");
  9645. $3=$recv($4)._b();
  9646. self._assert_equals_($3,(2));
  9647. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9648. $ctx1.sendIdx["assert:equals:"]=2;
  9649. //>>excludeEnd("ctx");
  9650. self._assert_equals_($recv(self._jsObject())._c_((3)),(3));
  9651. return self;
  9652. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9653. }, function($ctx1) {$ctx1.fill(self,"testMessageSend",{},$globals.JSObjectProxyTest)});
  9654. //>>excludeEnd("ctx");
  9655. },
  9656. //>>excludeStart("ide", pragmas.excludeIdeData);
  9657. args: [],
  9658. 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",
  9659. referencedClasses: [],
  9660. //>>excludeEnd("ide");
  9661. messageSends: ["assert:equals:", "a", "jsObject", "b", "c:"]
  9662. }),
  9663. $globals.JSObjectProxyTest);
  9664. $core.addMethod(
  9665. $core.method({
  9666. selector: "testMethodWithArguments",
  9667. protocol: 'tests',
  9668. fn: function (){
  9669. var self=this;
  9670. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9671. return $core.withContext(function($ctx1) {
  9672. //>>excludeEnd("ctx");
  9673. self._assert_equals_($recv(self._jsObject())._c_((1)),(1));
  9674. return self;
  9675. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9676. }, function($ctx1) {$ctx1.fill(self,"testMethodWithArguments",{},$globals.JSObjectProxyTest)});
  9677. //>>excludeEnd("ctx");
  9678. },
  9679. //>>excludeStart("ide", pragmas.excludeIdeData);
  9680. args: [],
  9681. source: "testMethodWithArguments\x0a\x09self assert: (self jsObject c: 1) equals: 1",
  9682. referencedClasses: [],
  9683. //>>excludeEnd("ide");
  9684. messageSends: ["assert:equals:", "c:", "jsObject"]
  9685. }),
  9686. $globals.JSObjectProxyTest);
  9687. $core.addMethod(
  9688. $core.method({
  9689. selector: "testPrinting",
  9690. protocol: 'tests',
  9691. fn: function (){
  9692. var self=this;
  9693. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9694. return $core.withContext(function($ctx1) {
  9695. //>>excludeEnd("ctx");
  9696. self._assert_equals_($recv(self._jsObject())._printString(),"[object Object]");
  9697. return self;
  9698. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9699. }, function($ctx1) {$ctx1.fill(self,"testPrinting",{},$globals.JSObjectProxyTest)});
  9700. //>>excludeEnd("ctx");
  9701. },
  9702. //>>excludeStart("ide", pragmas.excludeIdeData);
  9703. args: [],
  9704. source: "testPrinting\x0a\x09self assert: self jsObject printString equals: '[object Object]'",
  9705. referencedClasses: [],
  9706. //>>excludeEnd("ide");
  9707. messageSends: ["assert:equals:", "printString", "jsObject"]
  9708. }),
  9709. $globals.JSObjectProxyTest);
  9710. $core.addMethod(
  9711. $core.method({
  9712. selector: "testPropertyThatReturnsEmptyString",
  9713. protocol: 'tests',
  9714. fn: function (){
  9715. var self=this;
  9716. var object;
  9717. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9718. return $core.withContext(function($ctx1) {
  9719. //>>excludeEnd("ctx");
  9720. var $1;
  9721. object=self._jsObject();
  9722. $1=$recv(object)._d();
  9723. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9724. $ctx1.sendIdx["d"]=1;
  9725. //>>excludeEnd("ctx");
  9726. self._assert_equals_($1,"");
  9727. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9728. $ctx1.sendIdx["assert:equals:"]=1;
  9729. //>>excludeEnd("ctx");
  9730. $recv(object)._d_("hello");
  9731. self._assert_equals_($recv(object)._d(),"hello");
  9732. return self;
  9733. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9734. }, function($ctx1) {$ctx1.fill(self,"testPropertyThatReturnsEmptyString",{object:object},$globals.JSObjectProxyTest)});
  9735. //>>excludeEnd("ctx");
  9736. },
  9737. //>>excludeStart("ide", pragmas.excludeIdeData);
  9738. args: [],
  9739. 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'",
  9740. referencedClasses: [],
  9741. //>>excludeEnd("ide");
  9742. messageSends: ["jsObject", "assert:equals:", "d", "d:"]
  9743. }),
  9744. $globals.JSObjectProxyTest);
  9745. $core.addMethod(
  9746. $core.method({
  9747. selector: "testPropertyThatReturnsUndefined",
  9748. protocol: 'tests',
  9749. fn: function (){
  9750. var self=this;
  9751. var object;
  9752. function $MessageNotUnderstood(){return $globals.MessageNotUnderstood||(typeof MessageNotUnderstood=="undefined"?nil:MessageNotUnderstood)}
  9753. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9754. return $core.withContext(function($ctx1) {
  9755. //>>excludeEnd("ctx");
  9756. object=self._jsObject();
  9757. self._shouldnt_raise_((function(){
  9758. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9759. return $core.withContext(function($ctx2) {
  9760. //>>excludeEnd("ctx");
  9761. return $recv(object)._e();
  9762. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9763. $ctx2.sendIdx["e"]=1;
  9764. //>>excludeEnd("ctx");
  9765. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9766. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  9767. //>>excludeEnd("ctx");
  9768. }),$MessageNotUnderstood());
  9769. self._assert_($recv($recv(object)._e())._isNil());
  9770. return self;
  9771. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9772. }, function($ctx1) {$ctx1.fill(self,"testPropertyThatReturnsUndefined",{object:object},$globals.JSObjectProxyTest)});
  9773. //>>excludeEnd("ctx");
  9774. },
  9775. //>>excludeStart("ide", pragmas.excludeIdeData);
  9776. args: [],
  9777. source: "testPropertyThatReturnsUndefined\x0a\x09| object |\x0a\x0a\x09object := self jsObject.\x0a\x09self shouldnt: [ object e ] raise: MessageNotUnderstood.\x0a\x09self assert: object e isNil",
  9778. referencedClasses: ["MessageNotUnderstood"],
  9779. //>>excludeEnd("ide");
  9780. messageSends: ["jsObject", "shouldnt:raise:", "e", "assert:", "isNil"]
  9781. }),
  9782. $globals.JSObjectProxyTest);
  9783. $core.addMethod(
  9784. $core.method({
  9785. selector: "testSetPropertyWithFalsyValue",
  9786. protocol: 'tests',
  9787. fn: function (){
  9788. var self=this;
  9789. var jsObject;
  9790. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9791. return $core.withContext(function($ctx1) {
  9792. //>>excludeEnd("ctx");
  9793. var $1,$2,$3,$4,$5;
  9794. jsObject=self._jsObject();
  9795. $1=$recv(jsObject)._a();
  9796. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9797. $ctx1.sendIdx["a"]=1;
  9798. //>>excludeEnd("ctx");
  9799. self._assert_equals_($1,(1));
  9800. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9801. $ctx1.sendIdx["assert:equals:"]=1;
  9802. //>>excludeEnd("ctx");
  9803. $recv(jsObject)._a_(self._jsNull());
  9804. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9805. $ctx1.sendIdx["a:"]=1;
  9806. //>>excludeEnd("ctx");
  9807. $2=$recv(jsObject)._a();
  9808. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9809. $ctx1.sendIdx["a"]=2;
  9810. //>>excludeEnd("ctx");
  9811. self._assert_equals_($2,nil);
  9812. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9813. $ctx1.sendIdx["assert:equals:"]=2;
  9814. //>>excludeEnd("ctx");
  9815. $recv(jsObject)._a_((0));
  9816. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9817. $ctx1.sendIdx["a:"]=2;
  9818. //>>excludeEnd("ctx");
  9819. $3=$recv(jsObject)._a();
  9820. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9821. $ctx1.sendIdx["a"]=3;
  9822. //>>excludeEnd("ctx");
  9823. self._assert_equals_($3,(0));
  9824. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9825. $ctx1.sendIdx["assert:equals:"]=3;
  9826. //>>excludeEnd("ctx");
  9827. $recv(jsObject)._a_(self._jsUndefined());
  9828. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9829. $ctx1.sendIdx["a:"]=3;
  9830. //>>excludeEnd("ctx");
  9831. $4=$recv(jsObject)._a();
  9832. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9833. $ctx1.sendIdx["a"]=4;
  9834. //>>excludeEnd("ctx");
  9835. self._assert_equals_($4,nil);
  9836. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9837. $ctx1.sendIdx["assert:equals:"]=4;
  9838. //>>excludeEnd("ctx");
  9839. $recv(jsObject)._a_("");
  9840. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9841. $ctx1.sendIdx["a:"]=4;
  9842. //>>excludeEnd("ctx");
  9843. $5=$recv(jsObject)._a();
  9844. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9845. $ctx1.sendIdx["a"]=5;
  9846. //>>excludeEnd("ctx");
  9847. self._assert_equals_($5,"");
  9848. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9849. $ctx1.sendIdx["assert:equals:"]=5;
  9850. //>>excludeEnd("ctx");
  9851. $recv(jsObject)._a_(false);
  9852. self._assert_equals_($recv(jsObject)._a(),false);
  9853. return self;
  9854. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9855. }, function($ctx1) {$ctx1.fill(self,"testSetPropertyWithFalsyValue",{jsObject:jsObject},$globals.JSObjectProxyTest)});
  9856. //>>excludeEnd("ctx");
  9857. },
  9858. //>>excludeStart("ide", pragmas.excludeIdeData);
  9859. args: [],
  9860. 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",
  9861. referencedClasses: [],
  9862. //>>excludeEnd("ide");
  9863. messageSends: ["jsObject", "assert:equals:", "a", "a:", "jsNull", "jsUndefined"]
  9864. }),
  9865. $globals.JSObjectProxyTest);
  9866. $core.addMethod(
  9867. $core.method({
  9868. selector: "testValue",
  9869. protocol: 'tests',
  9870. fn: function (){
  9871. var self=this;
  9872. var testObject;
  9873. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9874. return $core.withContext(function($ctx1) {
  9875. //>>excludeEnd("ctx");
  9876. testObject=self._jsObject();
  9877. $recv(testObject)._at_put_("value","aValue");
  9878. self._assert_equals_($recv(testObject)._value(),"aValue");
  9879. return self;
  9880. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9881. }, function($ctx1) {$ctx1.fill(self,"testValue",{testObject:testObject},$globals.JSObjectProxyTest)});
  9882. //>>excludeEnd("ctx");
  9883. },
  9884. //>>excludeStart("ide", pragmas.excludeIdeData);
  9885. args: [],
  9886. source: "testValue\x0a\x09| testObject |\x0a\x09testObject := self jsObject.\x0a\x09testObject at: 'value' put: 'aValue'.\x0a\x09self assert: testObject value equals: 'aValue'",
  9887. referencedClasses: [],
  9888. //>>excludeEnd("ide");
  9889. messageSends: ["jsObject", "at:put:", "assert:equals:", "value"]
  9890. }),
  9891. $globals.JSObjectProxyTest);
  9892. $core.addMethod(
  9893. $core.method({
  9894. selector: "testYourself",
  9895. protocol: 'tests',
  9896. fn: function (){
  9897. var self=this;
  9898. var object;
  9899. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9900. return $core.withContext(function($ctx1) {
  9901. //>>excludeEnd("ctx");
  9902. var $1,$2;
  9903. $1=self._jsObject();
  9904. $recv($1)._d_("test");
  9905. $2=$recv($1)._yourself();
  9906. object=$2;
  9907. self._assert_equals_($recv(object)._d(),"test");
  9908. return self;
  9909. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9910. }, function($ctx1) {$ctx1.fill(self,"testYourself",{object:object},$globals.JSObjectProxyTest)});
  9911. //>>excludeEnd("ctx");
  9912. },
  9913. //>>excludeStart("ide", pragmas.excludeIdeData);
  9914. args: [],
  9915. source: "testYourself\x0a\x09| object |\x0a\x09object := self jsObject\x0a\x09\x09d: 'test';\x0a\x09\x09yourself.\x0a\x0a\x09self assert: object d equals: 'test'",
  9916. referencedClasses: [],
  9917. //>>excludeEnd("ide");
  9918. messageSends: ["d:", "jsObject", "yourself", "assert:equals:", "d"]
  9919. }),
  9920. $globals.JSObjectProxyTest);
  9921. $core.addClass('JavaScriptExceptionTest', $globals.TestCase, [], 'Kernel-Tests');
  9922. $core.addMethod(
  9923. $core.method({
  9924. selector: "testCatchingException",
  9925. protocol: 'tests',
  9926. fn: function (){
  9927. var self=this;
  9928. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  9929. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9930. return $core.withContext(function($ctx1) {
  9931. //>>excludeEnd("ctx");
  9932. $recv((function(){
  9933. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9934. return $core.withContext(function($ctx2) {
  9935. //>>excludeEnd("ctx");
  9936. return self._throwException();
  9937. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9938. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  9939. //>>excludeEnd("ctx");
  9940. }))._on_do_($Error(),(function(error){
  9941. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9942. return $core.withContext(function($ctx2) {
  9943. //>>excludeEnd("ctx");
  9944. return self._assert_($recv($recv(error)._exception()).__eq("test"));
  9945. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9946. }, function($ctx2) {$ctx2.fillBlock({error:error},$ctx1,2)});
  9947. //>>excludeEnd("ctx");
  9948. }));
  9949. return self;
  9950. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9951. }, function($ctx1) {$ctx1.fill(self,"testCatchingException",{},$globals.JavaScriptExceptionTest)});
  9952. //>>excludeEnd("ctx");
  9953. },
  9954. //>>excludeStart("ide", pragmas.excludeIdeData);
  9955. args: [],
  9956. source: "testCatchingException\x0a\x09[ self throwException ]\x0a\x09\x09on: Error\x0a\x09\x09do: [ :error |\x0a\x09\x09\x09self assert: error exception = 'test' ]",
  9957. referencedClasses: ["Error"],
  9958. //>>excludeEnd("ide");
  9959. messageSends: ["on:do:", "throwException", "assert:", "=", "exception"]
  9960. }),
  9961. $globals.JavaScriptExceptionTest);
  9962. $core.addMethod(
  9963. $core.method({
  9964. selector: "testRaisingException",
  9965. protocol: 'tests',
  9966. fn: function (){
  9967. var self=this;
  9968. function $JavaScriptException(){return $globals.JavaScriptException||(typeof JavaScriptException=="undefined"?nil:JavaScriptException)}
  9969. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9970. return $core.withContext(function($ctx1) {
  9971. //>>excludeEnd("ctx");
  9972. self._should_raise_((function(){
  9973. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9974. return $core.withContext(function($ctx2) {
  9975. //>>excludeEnd("ctx");
  9976. return self._throwException();
  9977. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9978. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  9979. //>>excludeEnd("ctx");
  9980. }),$JavaScriptException());
  9981. return self;
  9982. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  9983. }, function($ctx1) {$ctx1.fill(self,"testRaisingException",{},$globals.JavaScriptExceptionTest)});
  9984. //>>excludeEnd("ctx");
  9985. },
  9986. //>>excludeStart("ide", pragmas.excludeIdeData);
  9987. args: [],
  9988. source: "testRaisingException\x0a\x09self should: [ self throwException ] raise: JavaScriptException",
  9989. referencedClasses: ["JavaScriptException"],
  9990. //>>excludeEnd("ide");
  9991. messageSends: ["should:raise:", "throwException"]
  9992. }),
  9993. $globals.JavaScriptExceptionTest);
  9994. $core.addMethod(
  9995. $core.method({
  9996. selector: "throwException",
  9997. protocol: 'helpers',
  9998. fn: function (){
  9999. var self=this;
  10000. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10001. return $core.withContext(function($ctx1) {
  10002. //>>excludeEnd("ctx");
  10003. throw 'test';
  10004. return self;
  10005. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10006. }, function($ctx1) {$ctx1.fill(self,"throwException",{},$globals.JavaScriptExceptionTest)});
  10007. //>>excludeEnd("ctx");
  10008. },
  10009. //>>excludeStart("ide", pragmas.excludeIdeData);
  10010. args: [],
  10011. source: "throwException\x0a\x09<throw 'test'>",
  10012. referencedClasses: [],
  10013. //>>excludeEnd("ide");
  10014. messageSends: []
  10015. }),
  10016. $globals.JavaScriptExceptionTest);
  10017. $core.addClass('MessageSendTest', $globals.TestCase, [], 'Kernel-Tests');
  10018. $core.addMethod(
  10019. $core.method({
  10020. selector: "testValue",
  10021. protocol: 'tests',
  10022. fn: function (){
  10023. var self=this;
  10024. var messageSend;
  10025. function $MessageSend(){return $globals.MessageSend||(typeof MessageSend=="undefined"?nil:MessageSend)}
  10026. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  10027. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10028. return $core.withContext(function($ctx1) {
  10029. //>>excludeEnd("ctx");
  10030. var $1,$2;
  10031. $1=$recv($MessageSend())._new();
  10032. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10033. $ctx1.sendIdx["new"]=1;
  10034. //>>excludeEnd("ctx");
  10035. $recv($1)._receiver_($recv($Object())._new());
  10036. $recv($1)._selector_("asString");
  10037. $2=$recv($1)._yourself();
  10038. messageSend=$2;
  10039. self._assert_equals_($recv(messageSend)._value(),"an Object");
  10040. return self;
  10041. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10042. }, function($ctx1) {$ctx1.fill(self,"testValue",{messageSend:messageSend},$globals.MessageSendTest)});
  10043. //>>excludeEnd("ctx");
  10044. },
  10045. //>>excludeStart("ide", pragmas.excludeIdeData);
  10046. args: [],
  10047. 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'",
  10048. referencedClasses: ["MessageSend", "Object"],
  10049. //>>excludeEnd("ide");
  10050. messageSends: ["receiver:", "new", "selector:", "yourself", "assert:equals:", "value"]
  10051. }),
  10052. $globals.MessageSendTest);
  10053. $core.addMethod(
  10054. $core.method({
  10055. selector: "testValueWithArguments",
  10056. protocol: 'tests',
  10057. fn: function (){
  10058. var self=this;
  10059. var messageSend;
  10060. function $MessageSend(){return $globals.MessageSend||(typeof MessageSend=="undefined"?nil:MessageSend)}
  10061. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10062. return $core.withContext(function($ctx1) {
  10063. //>>excludeEnd("ctx");
  10064. var $1,$2;
  10065. $1=$recv($MessageSend())._new();
  10066. $recv($1)._receiver_((2));
  10067. $recv($1)._selector_("+");
  10068. $2=$recv($1)._yourself();
  10069. messageSend=$2;
  10070. self._assert_equals_($recv(messageSend)._value_((3)),(5));
  10071. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10072. $ctx1.sendIdx["assert:equals:"]=1;
  10073. //>>excludeEnd("ctx");
  10074. self._assert_equals_($recv(messageSend)._valueWithPossibleArguments_([(4)]),(6));
  10075. return self;
  10076. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10077. }, function($ctx1) {$ctx1.fill(self,"testValueWithArguments",{messageSend:messageSend},$globals.MessageSendTest)});
  10078. //>>excludeEnd("ctx");
  10079. },
  10080. //>>excludeStart("ide", pragmas.excludeIdeData);
  10081. args: [],
  10082. 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",
  10083. referencedClasses: ["MessageSend"],
  10084. //>>excludeEnd("ide");
  10085. messageSends: ["receiver:", "new", "selector:", "yourself", "assert:equals:", "value:", "valueWithPossibleArguments:"]
  10086. }),
  10087. $globals.MessageSendTest);
  10088. $core.addClass('MethodInheritanceTest', $globals.TestCase, ['receiverTop', 'receiverMiddle', 'receiverBottom', 'method', 'performBlock'], 'Kernel-Tests');
  10089. $core.addMethod(
  10090. $core.method({
  10091. selector: "codeGeneratorClass",
  10092. protocol: 'accessing',
  10093. fn: function (){
  10094. var self=this;
  10095. function $CodeGenerator(){return $globals.CodeGenerator||(typeof CodeGenerator=="undefined"?nil:CodeGenerator)}
  10096. return $CodeGenerator();
  10097. },
  10098. //>>excludeStart("ide", pragmas.excludeIdeData);
  10099. args: [],
  10100. source: "codeGeneratorClass\x0a\x09^ CodeGenerator",
  10101. referencedClasses: ["CodeGenerator"],
  10102. //>>excludeEnd("ide");
  10103. messageSends: []
  10104. }),
  10105. $globals.MethodInheritanceTest);
  10106. $core.addMethod(
  10107. $core.method({
  10108. selector: "compiler",
  10109. protocol: 'factory',
  10110. fn: function (){
  10111. var self=this;
  10112. function $Compiler(){return $globals.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
  10113. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10114. return $core.withContext(function($ctx1) {
  10115. //>>excludeEnd("ctx");
  10116. var $2,$3,$1;
  10117. $2=$recv($Compiler())._new();
  10118. $recv($2)._codeGeneratorClass_(self._codeGeneratorClass());
  10119. $3=$recv($2)._yourself();
  10120. $1=$3;
  10121. return $1;
  10122. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10123. }, function($ctx1) {$ctx1.fill(self,"compiler",{},$globals.MethodInheritanceTest)});
  10124. //>>excludeEnd("ctx");
  10125. },
  10126. //>>excludeStart("ide", pragmas.excludeIdeData);
  10127. args: [],
  10128. source: "compiler\x0a\x09^ Compiler new\x0a\x09\x09codeGeneratorClass: self codeGeneratorClass;\x0a\x09\x09yourself",
  10129. referencedClasses: ["Compiler"],
  10130. //>>excludeEnd("ide");
  10131. messageSends: ["codeGeneratorClass:", "new", "codeGeneratorClass", "yourself"]
  10132. }),
  10133. $globals.MethodInheritanceTest);
  10134. $core.addMethod(
  10135. $core.method({
  10136. selector: "deinstallBottom",
  10137. protocol: 'testing',
  10138. fn: function (){
  10139. var self=this;
  10140. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10141. return $core.withContext(function($ctx1) {
  10142. //>>excludeEnd("ctx");
  10143. $recv(self._targetClassBottom())._removeCompiledMethod_(self["@method"]);
  10144. return self;
  10145. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10146. }, function($ctx1) {$ctx1.fill(self,"deinstallBottom",{},$globals.MethodInheritanceTest)});
  10147. //>>excludeEnd("ctx");
  10148. },
  10149. //>>excludeStart("ide", pragmas.excludeIdeData);
  10150. args: [],
  10151. source: "deinstallBottom\x0a\x09self targetClassBottom removeCompiledMethod: method",
  10152. referencedClasses: [],
  10153. //>>excludeEnd("ide");
  10154. messageSends: ["removeCompiledMethod:", "targetClassBottom"]
  10155. }),
  10156. $globals.MethodInheritanceTest);
  10157. $core.addMethod(
  10158. $core.method({
  10159. selector: "deinstallMiddle",
  10160. protocol: 'testing',
  10161. fn: function (){
  10162. var self=this;
  10163. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10164. return $core.withContext(function($ctx1) {
  10165. //>>excludeEnd("ctx");
  10166. $recv(self._targetClassMiddle())._removeCompiledMethod_(self["@method"]);
  10167. return self;
  10168. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10169. }, function($ctx1) {$ctx1.fill(self,"deinstallMiddle",{},$globals.MethodInheritanceTest)});
  10170. //>>excludeEnd("ctx");
  10171. },
  10172. //>>excludeStart("ide", pragmas.excludeIdeData);
  10173. args: [],
  10174. source: "deinstallMiddle\x0a\x09self targetClassMiddle removeCompiledMethod: method",
  10175. referencedClasses: [],
  10176. //>>excludeEnd("ide");
  10177. messageSends: ["removeCompiledMethod:", "targetClassMiddle"]
  10178. }),
  10179. $globals.MethodInheritanceTest);
  10180. $core.addMethod(
  10181. $core.method({
  10182. selector: "deinstallTop",
  10183. protocol: 'testing',
  10184. fn: function (){
  10185. var self=this;
  10186. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10187. return $core.withContext(function($ctx1) {
  10188. //>>excludeEnd("ctx");
  10189. $recv(self._targetClassTop())._removeCompiledMethod_(self["@method"]);
  10190. return self;
  10191. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10192. }, function($ctx1) {$ctx1.fill(self,"deinstallTop",{},$globals.MethodInheritanceTest)});
  10193. //>>excludeEnd("ctx");
  10194. },
  10195. //>>excludeStart("ide", pragmas.excludeIdeData);
  10196. args: [],
  10197. source: "deinstallTop\x0a\x09self targetClassTop removeCompiledMethod: method",
  10198. referencedClasses: [],
  10199. //>>excludeEnd("ide");
  10200. messageSends: ["removeCompiledMethod:", "targetClassTop"]
  10201. }),
  10202. $globals.MethodInheritanceTest);
  10203. $core.addMethod(
  10204. $core.method({
  10205. selector: "installBottom:",
  10206. protocol: 'testing',
  10207. fn: function (aString){
  10208. var self=this;
  10209. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10210. return $core.withContext(function($ctx1) {
  10211. //>>excludeEnd("ctx");
  10212. self["@method"]=$recv(self._compiler())._install_forClass_protocol_(aString,self._targetClassBottom(),"tests");
  10213. return self;
  10214. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10215. }, function($ctx1) {$ctx1.fill(self,"installBottom:",{aString:aString},$globals.MethodInheritanceTest)});
  10216. //>>excludeEnd("ctx");
  10217. },
  10218. //>>excludeStart("ide", pragmas.excludeIdeData);
  10219. args: ["aString"],
  10220. source: "installBottom: aString\x0a\x09method := self compiler install: aString forClass: self targetClassBottom protocol: 'tests'",
  10221. referencedClasses: [],
  10222. //>>excludeEnd("ide");
  10223. messageSends: ["install:forClass:protocol:", "compiler", "targetClassBottom"]
  10224. }),
  10225. $globals.MethodInheritanceTest);
  10226. $core.addMethod(
  10227. $core.method({
  10228. selector: "installMiddle:",
  10229. protocol: 'testing',
  10230. fn: function (aString){
  10231. var self=this;
  10232. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10233. return $core.withContext(function($ctx1) {
  10234. //>>excludeEnd("ctx");
  10235. self["@method"]=$recv(self._compiler())._install_forClass_protocol_(aString,self._targetClassMiddle(),"tests");
  10236. return self;
  10237. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10238. }, function($ctx1) {$ctx1.fill(self,"installMiddle:",{aString:aString},$globals.MethodInheritanceTest)});
  10239. //>>excludeEnd("ctx");
  10240. },
  10241. //>>excludeStart("ide", pragmas.excludeIdeData);
  10242. args: ["aString"],
  10243. source: "installMiddle: aString\x0a\x09method := self compiler install: aString forClass: self targetClassMiddle protocol: 'tests'",
  10244. referencedClasses: [],
  10245. //>>excludeEnd("ide");
  10246. messageSends: ["install:forClass:protocol:", "compiler", "targetClassMiddle"]
  10247. }),
  10248. $globals.MethodInheritanceTest);
  10249. $core.addMethod(
  10250. $core.method({
  10251. selector: "installTop:",
  10252. protocol: 'testing',
  10253. fn: function (aString){
  10254. var self=this;
  10255. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10256. return $core.withContext(function($ctx1) {
  10257. //>>excludeEnd("ctx");
  10258. self["@method"]=$recv(self._compiler())._install_forClass_protocol_(aString,self._targetClassTop(),"tests");
  10259. return self;
  10260. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10261. }, function($ctx1) {$ctx1.fill(self,"installTop:",{aString:aString},$globals.MethodInheritanceTest)});
  10262. //>>excludeEnd("ctx");
  10263. },
  10264. //>>excludeStart("ide", pragmas.excludeIdeData);
  10265. args: ["aString"],
  10266. source: "installTop: aString\x0a\x09method := self compiler install: aString forClass: self targetClassTop protocol: 'tests'",
  10267. referencedClasses: [],
  10268. //>>excludeEnd("ide");
  10269. messageSends: ["install:forClass:protocol:", "compiler", "targetClassTop"]
  10270. }),
  10271. $globals.MethodInheritanceTest);
  10272. $core.addMethod(
  10273. $core.method({
  10274. selector: "setUp",
  10275. protocol: 'initialization',
  10276. fn: function (){
  10277. var self=this;
  10278. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10279. return $core.withContext(function($ctx1) {
  10280. //>>excludeEnd("ctx");
  10281. self["@receiverTop"]=$recv(self._targetClassTop())._new();
  10282. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10283. $ctx1.sendIdx["new"]=1;
  10284. //>>excludeEnd("ctx");
  10285. self["@receiverMiddle"]=$recv(self._targetClassMiddle())._new();
  10286. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10287. $ctx1.sendIdx["new"]=2;
  10288. //>>excludeEnd("ctx");
  10289. self["@receiverBottom"]=$recv(self._targetClassBottom())._new();
  10290. self["@method"]=nil;
  10291. self["@performBlock"]=(function(){
  10292. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10293. return $core.withContext(function($ctx2) {
  10294. //>>excludeEnd("ctx");
  10295. return self._error_("performBlock not initialized");
  10296. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10297. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  10298. //>>excludeEnd("ctx");
  10299. });
  10300. return self;
  10301. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10302. }, function($ctx1) {$ctx1.fill(self,"setUp",{},$globals.MethodInheritanceTest)});
  10303. //>>excludeEnd("ctx");
  10304. },
  10305. //>>excludeStart("ide", pragmas.excludeIdeData);
  10306. args: [],
  10307. 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' ]",
  10308. referencedClasses: [],
  10309. //>>excludeEnd("ide");
  10310. messageSends: ["new", "targetClassTop", "targetClassMiddle", "targetClassBottom", "error:"]
  10311. }),
  10312. $globals.MethodInheritanceTest);
  10313. $core.addMethod(
  10314. $core.method({
  10315. selector: "shouldMNU",
  10316. protocol: 'testing',
  10317. fn: function (){
  10318. var self=this;
  10319. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10320. return $core.withContext(function($ctx1) {
  10321. //>>excludeEnd("ctx");
  10322. self._shouldMNUTop();
  10323. self._shouldMNUMiddle();
  10324. self._shouldMNUBottom();
  10325. return self;
  10326. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10327. }, function($ctx1) {$ctx1.fill(self,"shouldMNU",{},$globals.MethodInheritanceTest)});
  10328. //>>excludeEnd("ctx");
  10329. },
  10330. //>>excludeStart("ide", pragmas.excludeIdeData);
  10331. args: [],
  10332. source: "shouldMNU\x0a\x09self shouldMNUTop.\x0a\x09self shouldMNUMiddle.\x0a\x09self shouldMNUBottom",
  10333. referencedClasses: [],
  10334. //>>excludeEnd("ide");
  10335. messageSends: ["shouldMNUTop", "shouldMNUMiddle", "shouldMNUBottom"]
  10336. }),
  10337. $globals.MethodInheritanceTest);
  10338. $core.addMethod(
  10339. $core.method({
  10340. selector: "shouldMNUBottom",
  10341. protocol: 'testing',
  10342. fn: function (){
  10343. var self=this;
  10344. function $MessageNotUnderstood(){return $globals.MessageNotUnderstood||(typeof MessageNotUnderstood=="undefined"?nil:MessageNotUnderstood)}
  10345. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10346. return $core.withContext(function($ctx1) {
  10347. //>>excludeEnd("ctx");
  10348. self._should_raise_((function(){
  10349. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10350. return $core.withContext(function($ctx2) {
  10351. //>>excludeEnd("ctx");
  10352. return $recv(self["@performBlock"])._value_(self["@receiverBottom"]);
  10353. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10354. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  10355. //>>excludeEnd("ctx");
  10356. }),$MessageNotUnderstood());
  10357. return self;
  10358. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10359. }, function($ctx1) {$ctx1.fill(self,"shouldMNUBottom",{},$globals.MethodInheritanceTest)});
  10360. //>>excludeEnd("ctx");
  10361. },
  10362. //>>excludeStart("ide", pragmas.excludeIdeData);
  10363. args: [],
  10364. source: "shouldMNUBottom\x0a\x09self should: [ performBlock value: receiverBottom ] raise: MessageNotUnderstood",
  10365. referencedClasses: ["MessageNotUnderstood"],
  10366. //>>excludeEnd("ide");
  10367. messageSends: ["should:raise:", "value:"]
  10368. }),
  10369. $globals.MethodInheritanceTest);
  10370. $core.addMethod(
  10371. $core.method({
  10372. selector: "shouldMNUMiddle",
  10373. protocol: 'testing',
  10374. fn: function (){
  10375. var self=this;
  10376. function $MessageNotUnderstood(){return $globals.MessageNotUnderstood||(typeof MessageNotUnderstood=="undefined"?nil:MessageNotUnderstood)}
  10377. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10378. return $core.withContext(function($ctx1) {
  10379. //>>excludeEnd("ctx");
  10380. self._should_raise_((function(){
  10381. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10382. return $core.withContext(function($ctx2) {
  10383. //>>excludeEnd("ctx");
  10384. return $recv(self["@performBlock"])._value_(self["@receiverMiddle"]);
  10385. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10386. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  10387. //>>excludeEnd("ctx");
  10388. }),$MessageNotUnderstood());
  10389. return self;
  10390. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10391. }, function($ctx1) {$ctx1.fill(self,"shouldMNUMiddle",{},$globals.MethodInheritanceTest)});
  10392. //>>excludeEnd("ctx");
  10393. },
  10394. //>>excludeStart("ide", pragmas.excludeIdeData);
  10395. args: [],
  10396. source: "shouldMNUMiddle\x0a\x09self should: [ performBlock value: receiverMiddle ] raise: MessageNotUnderstood",
  10397. referencedClasses: ["MessageNotUnderstood"],
  10398. //>>excludeEnd("ide");
  10399. messageSends: ["should:raise:", "value:"]
  10400. }),
  10401. $globals.MethodInheritanceTest);
  10402. $core.addMethod(
  10403. $core.method({
  10404. selector: "shouldMNUTop",
  10405. protocol: 'testing',
  10406. fn: function (){
  10407. var self=this;
  10408. function $MessageNotUnderstood(){return $globals.MessageNotUnderstood||(typeof MessageNotUnderstood=="undefined"?nil:MessageNotUnderstood)}
  10409. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10410. return $core.withContext(function($ctx1) {
  10411. //>>excludeEnd("ctx");
  10412. self._should_raise_((function(){
  10413. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10414. return $core.withContext(function($ctx2) {
  10415. //>>excludeEnd("ctx");
  10416. return $recv(self["@performBlock"])._value_(self["@receiverTop"]);
  10417. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10418. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  10419. //>>excludeEnd("ctx");
  10420. }),$MessageNotUnderstood());
  10421. return self;
  10422. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10423. }, function($ctx1) {$ctx1.fill(self,"shouldMNUTop",{},$globals.MethodInheritanceTest)});
  10424. //>>excludeEnd("ctx");
  10425. },
  10426. //>>excludeStart("ide", pragmas.excludeIdeData);
  10427. args: [],
  10428. source: "shouldMNUTop\x0a\x09self should: [ performBlock value: receiverTop ] raise: MessageNotUnderstood",
  10429. referencedClasses: ["MessageNotUnderstood"],
  10430. //>>excludeEnd("ide");
  10431. messageSends: ["should:raise:", "value:"]
  10432. }),
  10433. $globals.MethodInheritanceTest);
  10434. $core.addMethod(
  10435. $core.method({
  10436. selector: "shouldReturn:",
  10437. protocol: 'testing',
  10438. fn: function (anObject){
  10439. var self=this;
  10440. var result;
  10441. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10442. return $core.withContext(function($ctx1) {
  10443. //>>excludeEnd("ctx");
  10444. result=$recv(self["@performBlock"])._value_(self["@receiverTop"]);
  10445. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10446. $ctx1.sendIdx["value:"]=1;
  10447. //>>excludeEnd("ctx");
  10448. self._assert_equals_(["top",anObject],["top",result]);
  10449. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10450. $ctx1.sendIdx["assert:equals:"]=1;
  10451. //>>excludeEnd("ctx");
  10452. result=$recv(self["@performBlock"])._value_(self["@receiverMiddle"]);
  10453. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10454. $ctx1.sendIdx["value:"]=2;
  10455. //>>excludeEnd("ctx");
  10456. self._assert_equals_(["middle",anObject],["middle",result]);
  10457. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10458. $ctx1.sendIdx["assert:equals:"]=2;
  10459. //>>excludeEnd("ctx");
  10460. result=$recv(self["@performBlock"])._value_(self["@receiverBottom"]);
  10461. self._assert_equals_(["bottom",anObject],["bottom",result]);
  10462. return self;
  10463. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10464. }, function($ctx1) {$ctx1.fill(self,"shouldReturn:",{anObject:anObject,result:result},$globals.MethodInheritanceTest)});
  10465. //>>excludeEnd("ctx");
  10466. },
  10467. //>>excludeStart("ide", pragmas.excludeIdeData);
  10468. args: ["anObject"],
  10469. 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 }",
  10470. referencedClasses: [],
  10471. //>>excludeEnd("ide");
  10472. messageSends: ["value:", "assert:equals:"]
  10473. }),
  10474. $globals.MethodInheritanceTest);
  10475. $core.addMethod(
  10476. $core.method({
  10477. selector: "shouldReturn:and:and:",
  10478. protocol: 'testing',
  10479. fn: function (anObject,anObject2,anObject3){
  10480. var self=this;
  10481. var result;
  10482. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10483. return $core.withContext(function($ctx1) {
  10484. //>>excludeEnd("ctx");
  10485. result=$recv(self["@performBlock"])._value_(self["@receiverTop"]);
  10486. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10487. $ctx1.sendIdx["value:"]=1;
  10488. //>>excludeEnd("ctx");
  10489. self._assert_equals_(["top",anObject],["top",result]);
  10490. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10491. $ctx1.sendIdx["assert:equals:"]=1;
  10492. //>>excludeEnd("ctx");
  10493. result=$recv(self["@performBlock"])._value_(self["@receiverMiddle"]);
  10494. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10495. $ctx1.sendIdx["value:"]=2;
  10496. //>>excludeEnd("ctx");
  10497. self._assert_equals_(["middle",anObject2],["middle",result]);
  10498. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10499. $ctx1.sendIdx["assert:equals:"]=2;
  10500. //>>excludeEnd("ctx");
  10501. result=$recv(self["@performBlock"])._value_(self["@receiverBottom"]);
  10502. self._assert_equals_(["bottom",anObject3],["bottom",result]);
  10503. return self;
  10504. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10505. }, function($ctx1) {$ctx1.fill(self,"shouldReturn:and:and:",{anObject:anObject,anObject2:anObject2,anObject3:anObject3,result:result},$globals.MethodInheritanceTest)});
  10506. //>>excludeEnd("ctx");
  10507. },
  10508. //>>excludeStart("ide", pragmas.excludeIdeData);
  10509. args: ["anObject", "anObject2", "anObject3"],
  10510. 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 }",
  10511. referencedClasses: [],
  10512. //>>excludeEnd("ide");
  10513. messageSends: ["value:", "assert:equals:"]
  10514. }),
  10515. $globals.MethodInheritanceTest);
  10516. $core.addMethod(
  10517. $core.method({
  10518. selector: "targetClassBottom",
  10519. protocol: 'accessing',
  10520. fn: function (){
  10521. var self=this;
  10522. function $JavaScriptException(){return $globals.JavaScriptException||(typeof JavaScriptException=="undefined"?nil:JavaScriptException)}
  10523. return $JavaScriptException();
  10524. },
  10525. //>>excludeStart("ide", pragmas.excludeIdeData);
  10526. args: [],
  10527. source: "targetClassBottom\x0a\x09^ JavaScriptException",
  10528. referencedClasses: ["JavaScriptException"],
  10529. //>>excludeEnd("ide");
  10530. messageSends: []
  10531. }),
  10532. $globals.MethodInheritanceTest);
  10533. $core.addMethod(
  10534. $core.method({
  10535. selector: "targetClassMiddle",
  10536. protocol: 'accessing',
  10537. fn: function (){
  10538. var self=this;
  10539. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  10540. return $Error();
  10541. },
  10542. //>>excludeStart("ide", pragmas.excludeIdeData);
  10543. args: [],
  10544. source: "targetClassMiddle\x0a\x09^ Error",
  10545. referencedClasses: ["Error"],
  10546. //>>excludeEnd("ide");
  10547. messageSends: []
  10548. }),
  10549. $globals.MethodInheritanceTest);
  10550. $core.addMethod(
  10551. $core.method({
  10552. selector: "targetClassTop",
  10553. protocol: 'accessing',
  10554. fn: function (){
  10555. var self=this;
  10556. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  10557. return $Object();
  10558. },
  10559. //>>excludeStart("ide", pragmas.excludeIdeData);
  10560. args: [],
  10561. source: "targetClassTop\x0a\x09^ Object",
  10562. referencedClasses: ["Object"],
  10563. //>>excludeEnd("ide");
  10564. messageSends: []
  10565. }),
  10566. $globals.MethodInheritanceTest);
  10567. $core.addMethod(
  10568. $core.method({
  10569. selector: "tearDown",
  10570. protocol: 'initialization',
  10571. fn: function (){
  10572. var self=this;
  10573. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  10574. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10575. return $core.withContext(function($ctx1) {
  10576. //>>excludeEnd("ctx");
  10577. $recv((function(){
  10578. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10579. return $core.withContext(function($ctx2) {
  10580. //>>excludeEnd("ctx");
  10581. return self._deinstallTop();
  10582. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10583. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  10584. //>>excludeEnd("ctx");
  10585. }))._on_do_($Error(),(function(){
  10586. }));
  10587. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10588. $ctx1.sendIdx["on:do:"]=1;
  10589. //>>excludeEnd("ctx");
  10590. $recv((function(){
  10591. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10592. return $core.withContext(function($ctx2) {
  10593. //>>excludeEnd("ctx");
  10594. return self._deinstallMiddle();
  10595. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10596. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  10597. //>>excludeEnd("ctx");
  10598. }))._on_do_($Error(),(function(){
  10599. }));
  10600. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10601. $ctx1.sendIdx["on:do:"]=2;
  10602. //>>excludeEnd("ctx");
  10603. $recv((function(){
  10604. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10605. return $core.withContext(function($ctx2) {
  10606. //>>excludeEnd("ctx");
  10607. return self._deinstallBottom();
  10608. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10609. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,5)});
  10610. //>>excludeEnd("ctx");
  10611. }))._on_do_($Error(),(function(){
  10612. }));
  10613. return self;
  10614. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10615. }, function($ctx1) {$ctx1.fill(self,"tearDown",{},$globals.MethodInheritanceTest)});
  10616. //>>excludeEnd("ctx");
  10617. },
  10618. //>>excludeStart("ide", pragmas.excludeIdeData);
  10619. args: [],
  10620. source: "tearDown\x0a\x09[ self deinstallTop ] on: Error do: [ ].\x0a\x09[ self deinstallMiddle ] on: Error do: [ ].\x0a\x09[ self deinstallBottom ] on: Error do: [ ]",
  10621. referencedClasses: ["Error"],
  10622. //>>excludeEnd("ide");
  10623. messageSends: ["on:do:", "deinstallTop", "deinstallMiddle", "deinstallBottom"]
  10624. }),
  10625. $globals.MethodInheritanceTest);
  10626. $core.addMethod(
  10627. $core.method({
  10628. selector: "testMNU11",
  10629. protocol: 'tests',
  10630. fn: function (){
  10631. var self=this;
  10632. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10633. return $core.withContext(function($ctx1) {
  10634. //>>excludeEnd("ctx");
  10635. self["@performBlock"]=(function(x){
  10636. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10637. return $core.withContext(function($ctx2) {
  10638. //>>excludeEnd("ctx");
  10639. return $recv(x)._foo();
  10640. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10641. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)});
  10642. //>>excludeEnd("ctx");
  10643. });
  10644. self._shouldMNU();
  10645. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10646. $ctx1.sendIdx["shouldMNU"]=1;
  10647. //>>excludeEnd("ctx");
  10648. self._installTop_("foo ^ false");
  10649. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10650. $ctx1.sendIdx["installTop:"]=1;
  10651. //>>excludeEnd("ctx");
  10652. self._installTop_("foo ^ true");
  10653. self._deinstallTop();
  10654. self._shouldMNU();
  10655. return self;
  10656. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10657. }, function($ctx1) {$ctx1.fill(self,"testMNU11",{},$globals.MethodInheritanceTest)});
  10658. //>>excludeEnd("ctx");
  10659. },
  10660. //>>excludeStart("ide", pragmas.excludeIdeData);
  10661. args: [],
  10662. 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",
  10663. referencedClasses: [],
  10664. //>>excludeEnd("ide");
  10665. messageSends: ["foo", "shouldMNU", "installTop:", "deinstallTop"]
  10666. }),
  10667. $globals.MethodInheritanceTest);
  10668. $core.addMethod(
  10669. $core.method({
  10670. selector: "testMNU22",
  10671. protocol: 'tests',
  10672. fn: function (){
  10673. var self=this;
  10674. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10675. return $core.withContext(function($ctx1) {
  10676. //>>excludeEnd("ctx");
  10677. self["@performBlock"]=(function(x){
  10678. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10679. return $core.withContext(function($ctx2) {
  10680. //>>excludeEnd("ctx");
  10681. return $recv(x)._foo();
  10682. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10683. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)});
  10684. //>>excludeEnd("ctx");
  10685. });
  10686. self._shouldMNU();
  10687. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10688. $ctx1.sendIdx["shouldMNU"]=1;
  10689. //>>excludeEnd("ctx");
  10690. self._installMiddle_("foo ^ false");
  10691. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10692. $ctx1.sendIdx["installMiddle:"]=1;
  10693. //>>excludeEnd("ctx");
  10694. self._installMiddle_("foo ^ true");
  10695. self._deinstallMiddle();
  10696. self._shouldMNU();
  10697. return self;
  10698. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10699. }, function($ctx1) {$ctx1.fill(self,"testMNU22",{},$globals.MethodInheritanceTest)});
  10700. //>>excludeEnd("ctx");
  10701. },
  10702. //>>excludeStart("ide", pragmas.excludeIdeData);
  10703. args: [],
  10704. 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",
  10705. referencedClasses: [],
  10706. //>>excludeEnd("ide");
  10707. messageSends: ["foo", "shouldMNU", "installMiddle:", "deinstallMiddle"]
  10708. }),
  10709. $globals.MethodInheritanceTest);
  10710. $core.addMethod(
  10711. $core.method({
  10712. selector: "testReturns1",
  10713. protocol: 'tests',
  10714. fn: function (){
  10715. var self=this;
  10716. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10717. return $core.withContext(function($ctx1) {
  10718. //>>excludeEnd("ctx");
  10719. self["@performBlock"]=(function(x){
  10720. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10721. return $core.withContext(function($ctx2) {
  10722. //>>excludeEnd("ctx");
  10723. return $recv(x)._foo();
  10724. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10725. }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)});
  10726. //>>excludeEnd("ctx");
  10727. });
  10728. self._installTop_("foo ^ false");
  10729. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10730. $ctx1.sendIdx["installTop:"]=1;
  10731. //>>excludeEnd("ctx");
  10732. self._shouldReturn_(false);
  10733. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10734. $ctx1.sendIdx["shouldReturn:"]=1;
  10735. //>>excludeEnd("ctx");
  10736. self._installTop_("foo ^ true");
  10737. self._shouldReturn_(true);
  10738. return self;
  10739. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10740. }, function($ctx1) {$ctx1.fill(self,"testReturns1",{},$globals.MethodInheritanceTest)});
  10741. //>>excludeEnd("ctx");
  10742. },
  10743. //>>excludeStart("ide", pragmas.excludeIdeData);
  10744. args: [],
  10745. 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",
  10746. referencedClasses: [],
  10747. //>>excludeEnd("ide");
  10748. messageSends: ["foo", "installTop:", "shouldReturn:"]
  10749. }),
  10750. $globals.MethodInheritanceTest);
  10751. $core.addClass('NumberTest', $globals.TestCase, [], 'Kernel-Tests');
  10752. $core.addMethod(
  10753. $core.method({
  10754. selector: "testAbs",
  10755. protocol: 'tests',
  10756. fn: function (){
  10757. var self=this;
  10758. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10759. return $core.withContext(function($ctx1) {
  10760. //>>excludeEnd("ctx");
  10761. var $1;
  10762. $1=(4)._abs();
  10763. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10764. $ctx1.sendIdx["abs"]=1;
  10765. //>>excludeEnd("ctx");
  10766. self._assert_equals_($1,(4));
  10767. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10768. $ctx1.sendIdx["assert:equals:"]=1;
  10769. //>>excludeEnd("ctx");
  10770. self._assert_equals_((-4)._abs(),(4));
  10771. return self;
  10772. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10773. }, function($ctx1) {$ctx1.fill(self,"testAbs",{},$globals.NumberTest)});
  10774. //>>excludeEnd("ctx");
  10775. },
  10776. //>>excludeStart("ide", pragmas.excludeIdeData);
  10777. args: [],
  10778. source: "testAbs\x0a\x09self assert: 4 abs equals: 4.\x0a\x09self assert: -4 abs equals: 4",
  10779. referencedClasses: [],
  10780. //>>excludeEnd("ide");
  10781. messageSends: ["assert:equals:", "abs"]
  10782. }),
  10783. $globals.NumberTest);
  10784. $core.addMethod(
  10785. $core.method({
  10786. selector: "testArithmetic",
  10787. protocol: 'tests',
  10788. fn: function (){
  10789. var self=this;
  10790. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10791. return $core.withContext(function($ctx1) {
  10792. //>>excludeEnd("ctx");
  10793. var $1,$2,$3,$5,$4;
  10794. $1=(1.5).__plus((1));
  10795. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10796. $ctx1.sendIdx["+"]=1;
  10797. //>>excludeEnd("ctx");
  10798. self._assert_equals_($1,(2.5));
  10799. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10800. $ctx1.sendIdx["assert:equals:"]=1;
  10801. //>>excludeEnd("ctx");
  10802. $2=(2).__minus((1));
  10803. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10804. $ctx1.sendIdx["-"]=1;
  10805. //>>excludeEnd("ctx");
  10806. self._assert_equals_($2,(1));
  10807. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10808. $ctx1.sendIdx["assert:equals:"]=2;
  10809. //>>excludeEnd("ctx");
  10810. self._assert_equals_((-2).__minus((1)),(-3));
  10811. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10812. $ctx1.sendIdx["assert:equals:"]=3;
  10813. //>>excludeEnd("ctx");
  10814. self._assert_equals_((12).__slash((2)),(6));
  10815. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10816. $ctx1.sendIdx["assert:equals:"]=4;
  10817. //>>excludeEnd("ctx");
  10818. $3=(3).__star((4));
  10819. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10820. $ctx1.sendIdx["*"]=1;
  10821. //>>excludeEnd("ctx");
  10822. self._assert_equals_($3,(12));
  10823. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10824. $ctx1.sendIdx["assert:equals:"]=5;
  10825. //>>excludeEnd("ctx");
  10826. self._assert_equals_((7).__slash_slash((2)),(3));
  10827. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10828. $ctx1.sendIdx["assert:equals:"]=6;
  10829. //>>excludeEnd("ctx");
  10830. self._assert_equals_((7).__backslash_backslash((2)),(1));
  10831. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10832. $ctx1.sendIdx["assert:equals:"]=7;
  10833. //>>excludeEnd("ctx");
  10834. $5=(1).__plus((2));
  10835. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10836. $ctx1.sendIdx["+"]=2;
  10837. //>>excludeEnd("ctx");
  10838. $4=$recv($5).__star((3));
  10839. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10840. $ctx1.sendIdx["*"]=2;
  10841. //>>excludeEnd("ctx");
  10842. self._assert_equals_($4,(9));
  10843. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10844. $ctx1.sendIdx["assert:equals:"]=8;
  10845. //>>excludeEnd("ctx");
  10846. self._assert_equals_((1).__plus((2).__star((3))),(7));
  10847. return self;
  10848. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10849. }, function($ctx1) {$ctx1.fill(self,"testArithmetic",{},$globals.NumberTest)});
  10850. //>>excludeEnd("ctx");
  10851. },
  10852. //>>excludeStart("ide", pragmas.excludeIdeData);
  10853. args: [],
  10854. 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",
  10855. referencedClasses: [],
  10856. //>>excludeEnd("ide");
  10857. messageSends: ["assert:equals:", "+", "-", "/", "*", "//", "\x5c\x5c"]
  10858. }),
  10859. $globals.NumberTest);
  10860. $core.addMethod(
  10861. $core.method({
  10862. selector: "testAsNumber",
  10863. protocol: 'tests',
  10864. fn: function (){
  10865. var self=this;
  10866. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10867. return $core.withContext(function($ctx1) {
  10868. //>>excludeEnd("ctx");
  10869. self._assert_equals_((3)._asNumber(),(3));
  10870. return self;
  10871. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10872. }, function($ctx1) {$ctx1.fill(self,"testAsNumber",{},$globals.NumberTest)});
  10873. //>>excludeEnd("ctx");
  10874. },
  10875. //>>excludeStart("ide", pragmas.excludeIdeData);
  10876. args: [],
  10877. source: "testAsNumber\x0a\x09self assert: 3 asNumber equals: 3.",
  10878. referencedClasses: [],
  10879. //>>excludeEnd("ide");
  10880. messageSends: ["assert:equals:", "asNumber"]
  10881. }),
  10882. $globals.NumberTest);
  10883. $core.addMethod(
  10884. $core.method({
  10885. selector: "testCeiling",
  10886. protocol: 'tests',
  10887. fn: function (){
  10888. var self=this;
  10889. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10890. return $core.withContext(function($ctx1) {
  10891. //>>excludeEnd("ctx");
  10892. var $1,$2;
  10893. $1=(1.2)._ceiling();
  10894. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10895. $ctx1.sendIdx["ceiling"]=1;
  10896. //>>excludeEnd("ctx");
  10897. self._assert_equals_($1,(2));
  10898. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10899. $ctx1.sendIdx["assert:equals:"]=1;
  10900. //>>excludeEnd("ctx");
  10901. $2=(-1.2)._ceiling();
  10902. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10903. $ctx1.sendIdx["ceiling"]=2;
  10904. //>>excludeEnd("ctx");
  10905. self._assert_equals_($2,(-1));
  10906. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10907. $ctx1.sendIdx["assert:equals:"]=2;
  10908. //>>excludeEnd("ctx");
  10909. self._assert_equals_((1)._ceiling(),(1));
  10910. return self;
  10911. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10912. }, function($ctx1) {$ctx1.fill(self,"testCeiling",{},$globals.NumberTest)});
  10913. //>>excludeEnd("ctx");
  10914. },
  10915. //>>excludeStart("ide", pragmas.excludeIdeData);
  10916. args: [],
  10917. 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.",
  10918. referencedClasses: [],
  10919. //>>excludeEnd("ide");
  10920. messageSends: ["assert:equals:", "ceiling"]
  10921. }),
  10922. $globals.NumberTest);
  10923. $core.addMethod(
  10924. $core.method({
  10925. selector: "testComparison",
  10926. protocol: 'tests',
  10927. fn: function (){
  10928. var self=this;
  10929. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10930. return $core.withContext(function($ctx1) {
  10931. //>>excludeEnd("ctx");
  10932. var $1,$2,$3,$4;
  10933. $1=(3).__gt((2));
  10934. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10935. $ctx1.sendIdx[">"]=1;
  10936. //>>excludeEnd("ctx");
  10937. self._assert_($1);
  10938. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10939. $ctx1.sendIdx["assert:"]=1;
  10940. //>>excludeEnd("ctx");
  10941. $2=(2).__lt((3));
  10942. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10943. $ctx1.sendIdx["<"]=1;
  10944. //>>excludeEnd("ctx");
  10945. self._assert_($2);
  10946. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10947. $ctx1.sendIdx["assert:"]=2;
  10948. //>>excludeEnd("ctx");
  10949. self._deny_((3).__lt((2)));
  10950. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10951. $ctx1.sendIdx["deny:"]=1;
  10952. //>>excludeEnd("ctx");
  10953. self._deny_((2).__gt((3)));
  10954. $3=(3).__gt_eq((3));
  10955. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10956. $ctx1.sendIdx[">="]=1;
  10957. //>>excludeEnd("ctx");
  10958. self._assert_($3);
  10959. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10960. $ctx1.sendIdx["assert:"]=3;
  10961. //>>excludeEnd("ctx");
  10962. self._assert_((3.1).__gt_eq((3)));
  10963. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10964. $ctx1.sendIdx["assert:"]=4;
  10965. //>>excludeEnd("ctx");
  10966. $4=(3).__lt_eq((3));
  10967. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10968. $ctx1.sendIdx["<="]=1;
  10969. //>>excludeEnd("ctx");
  10970. self._assert_($4);
  10971. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10972. $ctx1.sendIdx["assert:"]=5;
  10973. //>>excludeEnd("ctx");
  10974. self._assert_((3).__lt_eq((3.1)));
  10975. return self;
  10976. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10977. }, function($ctx1) {$ctx1.fill(self,"testComparison",{},$globals.NumberTest)});
  10978. //>>excludeEnd("ctx");
  10979. },
  10980. //>>excludeStart("ide", pragmas.excludeIdeData);
  10981. args: [],
  10982. 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",
  10983. referencedClasses: [],
  10984. //>>excludeEnd("ide");
  10985. messageSends: ["assert:", ">", "<", "deny:", ">=", "<="]
  10986. }),
  10987. $globals.NumberTest);
  10988. $core.addMethod(
  10989. $core.method({
  10990. selector: "testCopying",
  10991. protocol: 'tests',
  10992. fn: function (){
  10993. var self=this;
  10994. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  10995. return $core.withContext(function($ctx1) {
  10996. //>>excludeEnd("ctx");
  10997. var $1;
  10998. $1=$recv((1)._copy()).__eq_eq((1));
  10999. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11000. $ctx1.sendIdx["=="]=1;
  11001. //>>excludeEnd("ctx");
  11002. self._assert_($1);
  11003. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11004. $ctx1.sendIdx["assert:"]=1;
  11005. //>>excludeEnd("ctx");
  11006. self._assert_($recv((1)._deepCopy()).__eq_eq((1)));
  11007. return self;
  11008. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11009. }, function($ctx1) {$ctx1.fill(self,"testCopying",{},$globals.NumberTest)});
  11010. //>>excludeEnd("ctx");
  11011. },
  11012. //>>excludeStart("ide", pragmas.excludeIdeData);
  11013. args: [],
  11014. source: "testCopying\x0a\x09self assert: 1 copy == 1.\x0a\x09self assert: 1 deepCopy == 1",
  11015. referencedClasses: [],
  11016. //>>excludeEnd("ide");
  11017. messageSends: ["assert:", "==", "copy", "deepCopy"]
  11018. }),
  11019. $globals.NumberTest);
  11020. $core.addMethod(
  11021. $core.method({
  11022. selector: "testEquality",
  11023. protocol: 'tests',
  11024. fn: function (){
  11025. var self=this;
  11026. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11027. return $core.withContext(function($ctx1) {
  11028. //>>excludeEnd("ctx");
  11029. var $1,$2,$3,$5,$4,$7,$6,$9,$8,$10,$11,$12;
  11030. $1=(1).__eq((1));
  11031. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11032. $ctx1.sendIdx["="]=1;
  11033. //>>excludeEnd("ctx");
  11034. self._assert_($1);
  11035. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11036. $ctx1.sendIdx["assert:"]=1;
  11037. //>>excludeEnd("ctx");
  11038. $2=(0).__eq((0));
  11039. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11040. $ctx1.sendIdx["="]=2;
  11041. //>>excludeEnd("ctx");
  11042. self._assert_($2);
  11043. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11044. $ctx1.sendIdx["assert:"]=2;
  11045. //>>excludeEnd("ctx");
  11046. $3=(1).__eq((0));
  11047. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11048. $ctx1.sendIdx["="]=3;
  11049. //>>excludeEnd("ctx");
  11050. self._deny_($3);
  11051. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11052. $ctx1.sendIdx["deny:"]=1;
  11053. //>>excludeEnd("ctx");
  11054. $5=(1)._yourself();
  11055. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11056. $ctx1.sendIdx["yourself"]=1;
  11057. //>>excludeEnd("ctx");
  11058. $4=$recv($5).__eq((1));
  11059. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11060. $ctx1.sendIdx["="]=4;
  11061. //>>excludeEnd("ctx");
  11062. self._assert_($4);
  11063. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11064. $ctx1.sendIdx["assert:"]=3;
  11065. //>>excludeEnd("ctx");
  11066. $7=(1)._yourself();
  11067. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11068. $ctx1.sendIdx["yourself"]=2;
  11069. //>>excludeEnd("ctx");
  11070. $6=(1).__eq($7);
  11071. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11072. $ctx1.sendIdx["="]=5;
  11073. //>>excludeEnd("ctx");
  11074. self._assert_($6);
  11075. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11076. $ctx1.sendIdx["assert:"]=4;
  11077. //>>excludeEnd("ctx");
  11078. $9=(1)._yourself();
  11079. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11080. $ctx1.sendIdx["yourself"]=3;
  11081. //>>excludeEnd("ctx");
  11082. $8=$recv($9).__eq((1)._yourself());
  11083. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11084. $ctx1.sendIdx["="]=6;
  11085. //>>excludeEnd("ctx");
  11086. self._assert_($8);
  11087. $10=(0).__eq(false);
  11088. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11089. $ctx1.sendIdx["="]=7;
  11090. //>>excludeEnd("ctx");
  11091. self._deny_($10);
  11092. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11093. $ctx1.sendIdx["deny:"]=2;
  11094. //>>excludeEnd("ctx");
  11095. $11=false.__eq((0));
  11096. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11097. $ctx1.sendIdx["="]=8;
  11098. //>>excludeEnd("ctx");
  11099. self._deny_($11);
  11100. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11101. $ctx1.sendIdx["deny:"]=3;
  11102. //>>excludeEnd("ctx");
  11103. $12="".__eq((0));
  11104. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11105. $ctx1.sendIdx["="]=9;
  11106. //>>excludeEnd("ctx");
  11107. self._deny_($12);
  11108. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11109. $ctx1.sendIdx["deny:"]=4;
  11110. //>>excludeEnd("ctx");
  11111. self._deny_((0).__eq(""));
  11112. return self;
  11113. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11114. }, function($ctx1) {$ctx1.fill(self,"testEquality",{},$globals.NumberTest)});
  11115. //>>excludeEnd("ctx");
  11116. },
  11117. //>>excludeStart("ide", pragmas.excludeIdeData);
  11118. args: [],
  11119. 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 = ''",
  11120. referencedClasses: [],
  11121. //>>excludeEnd("ide");
  11122. messageSends: ["assert:", "=", "deny:", "yourself"]
  11123. }),
  11124. $globals.NumberTest);
  11125. $core.addMethod(
  11126. $core.method({
  11127. selector: "testFloor",
  11128. protocol: 'tests',
  11129. fn: function (){
  11130. var self=this;
  11131. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11132. return $core.withContext(function($ctx1) {
  11133. //>>excludeEnd("ctx");
  11134. var $1,$2;
  11135. $1=(1.2)._floor();
  11136. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11137. $ctx1.sendIdx["floor"]=1;
  11138. //>>excludeEnd("ctx");
  11139. self._assert_equals_($1,(1));
  11140. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11141. $ctx1.sendIdx["assert:equals:"]=1;
  11142. //>>excludeEnd("ctx");
  11143. $2=(-1.2)._floor();
  11144. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11145. $ctx1.sendIdx["floor"]=2;
  11146. //>>excludeEnd("ctx");
  11147. self._assert_equals_($2,(-2));
  11148. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11149. $ctx1.sendIdx["assert:equals:"]=2;
  11150. //>>excludeEnd("ctx");
  11151. self._assert_equals_((1)._floor(),(1));
  11152. return self;
  11153. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11154. }, function($ctx1) {$ctx1.fill(self,"testFloor",{},$globals.NumberTest)});
  11155. //>>excludeEnd("ctx");
  11156. },
  11157. //>>excludeStart("ide", pragmas.excludeIdeData);
  11158. args: [],
  11159. 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.",
  11160. referencedClasses: [],
  11161. //>>excludeEnd("ide");
  11162. messageSends: ["assert:equals:", "floor"]
  11163. }),
  11164. $globals.NumberTest);
  11165. $core.addMethod(
  11166. $core.method({
  11167. selector: "testHexNumbers",
  11168. protocol: 'tests',
  11169. fn: function (){
  11170. var self=this;
  11171. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11172. return $core.withContext(function($ctx1) {
  11173. //>>excludeEnd("ctx");
  11174. var $1,$2,$3,$4,$5;
  11175. self._assert_equals_((9),(9));
  11176. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11177. $ctx1.sendIdx["assert:equals:"]=1;
  11178. //>>excludeEnd("ctx");
  11179. $1=(10)._truncated();
  11180. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11181. $ctx1.sendIdx["truncated"]=1;
  11182. //>>excludeEnd("ctx");
  11183. self._assert_equals_($1,(10));
  11184. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11185. $ctx1.sendIdx["assert:equals:"]=2;
  11186. //>>excludeEnd("ctx");
  11187. $2=(11)._truncated();
  11188. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11189. $ctx1.sendIdx["truncated"]=2;
  11190. //>>excludeEnd("ctx");
  11191. self._assert_equals_($2,(11));
  11192. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11193. $ctx1.sendIdx["assert:equals:"]=3;
  11194. //>>excludeEnd("ctx");
  11195. $3=(12)._truncated();
  11196. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11197. $ctx1.sendIdx["truncated"]=3;
  11198. //>>excludeEnd("ctx");
  11199. self._assert_equals_($3,(12));
  11200. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11201. $ctx1.sendIdx["assert:equals:"]=4;
  11202. //>>excludeEnd("ctx");
  11203. $4=(13)._truncated();
  11204. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11205. $ctx1.sendIdx["truncated"]=4;
  11206. //>>excludeEnd("ctx");
  11207. self._assert_equals_($4,(13));
  11208. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11209. $ctx1.sendIdx["assert:equals:"]=5;
  11210. //>>excludeEnd("ctx");
  11211. $5=(14)._truncated();
  11212. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11213. $ctx1.sendIdx["truncated"]=5;
  11214. //>>excludeEnd("ctx");
  11215. self._assert_equals_($5,(14));
  11216. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11217. $ctx1.sendIdx["assert:equals:"]=6;
  11218. //>>excludeEnd("ctx");
  11219. self._assert_equals_((15)._truncated(),(15));
  11220. return self;
  11221. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11222. }, function($ctx1) {$ctx1.fill(self,"testHexNumbers",{},$globals.NumberTest)});
  11223. //>>excludeEnd("ctx");
  11224. },
  11225. //>>excludeStart("ide", pragmas.excludeIdeData);
  11226. args: [],
  11227. 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",
  11228. referencedClasses: [],
  11229. //>>excludeEnd("ide");
  11230. messageSends: ["assert:equals:", "truncated"]
  11231. }),
  11232. $globals.NumberTest);
  11233. $core.addMethod(
  11234. $core.method({
  11235. selector: "testIdentity",
  11236. protocol: 'tests',
  11237. fn: function (){
  11238. var self=this;
  11239. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11240. return $core.withContext(function($ctx1) {
  11241. //>>excludeEnd("ctx");
  11242. var $1,$2,$3,$5,$4,$7,$6,$9,$8;
  11243. $1=(1).__eq_eq((1));
  11244. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11245. $ctx1.sendIdx["=="]=1;
  11246. //>>excludeEnd("ctx");
  11247. self._assert_($1);
  11248. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11249. $ctx1.sendIdx["assert:"]=1;
  11250. //>>excludeEnd("ctx");
  11251. $2=(0).__eq_eq((0));
  11252. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11253. $ctx1.sendIdx["=="]=2;
  11254. //>>excludeEnd("ctx");
  11255. self._assert_($2);
  11256. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11257. $ctx1.sendIdx["assert:"]=2;
  11258. //>>excludeEnd("ctx");
  11259. $3=(1).__eq_eq((0));
  11260. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11261. $ctx1.sendIdx["=="]=3;
  11262. //>>excludeEnd("ctx");
  11263. self._deny_($3);
  11264. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11265. $ctx1.sendIdx["deny:"]=1;
  11266. //>>excludeEnd("ctx");
  11267. $5=(1)._yourself();
  11268. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11269. $ctx1.sendIdx["yourself"]=1;
  11270. //>>excludeEnd("ctx");
  11271. $4=$recv($5).__eq_eq((1));
  11272. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11273. $ctx1.sendIdx["=="]=4;
  11274. //>>excludeEnd("ctx");
  11275. self._assert_($4);
  11276. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11277. $ctx1.sendIdx["assert:"]=3;
  11278. //>>excludeEnd("ctx");
  11279. $7=(1)._yourself();
  11280. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11281. $ctx1.sendIdx["yourself"]=2;
  11282. //>>excludeEnd("ctx");
  11283. $6=(1).__eq_eq($7);
  11284. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11285. $ctx1.sendIdx["=="]=5;
  11286. //>>excludeEnd("ctx");
  11287. self._assert_($6);
  11288. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11289. $ctx1.sendIdx["assert:"]=4;
  11290. //>>excludeEnd("ctx");
  11291. $9=(1)._yourself();
  11292. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11293. $ctx1.sendIdx["yourself"]=3;
  11294. //>>excludeEnd("ctx");
  11295. $8=$recv($9).__eq_eq((1)._yourself());
  11296. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11297. $ctx1.sendIdx["=="]=6;
  11298. //>>excludeEnd("ctx");
  11299. self._assert_($8);
  11300. self._deny_((1).__eq_eq((2)));
  11301. return self;
  11302. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11303. }, function($ctx1) {$ctx1.fill(self,"testIdentity",{},$globals.NumberTest)});
  11304. //>>excludeEnd("ctx");
  11305. },
  11306. //>>excludeStart("ide", pragmas.excludeIdeData);
  11307. args: [],
  11308. 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",
  11309. referencedClasses: [],
  11310. //>>excludeEnd("ide");
  11311. messageSends: ["assert:", "==", "deny:", "yourself"]
  11312. }),
  11313. $globals.NumberTest);
  11314. $core.addMethod(
  11315. $core.method({
  11316. selector: "testInvalidHexNumbers",
  11317. protocol: 'tests',
  11318. fn: function (){
  11319. var self=this;
  11320. function $MessageNotUnderstood(){return $globals.MessageNotUnderstood||(typeof MessageNotUnderstood=="undefined"?nil:MessageNotUnderstood)}
  11321. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11322. return $core.withContext(function($ctx1) {
  11323. //>>excludeEnd("ctx");
  11324. self._should_raise_((function(){
  11325. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11326. return $core.withContext(function($ctx2) {
  11327. //>>excludeEnd("ctx");
  11328. return (16)._rG();
  11329. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11330. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  11331. //>>excludeEnd("ctx");
  11332. }),$MessageNotUnderstood());
  11333. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11334. $ctx1.sendIdx["should:raise:"]=1;
  11335. //>>excludeEnd("ctx");
  11336. self._should_raise_((function(){
  11337. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11338. return $core.withContext(function($ctx2) {
  11339. //>>excludeEnd("ctx");
  11340. return (16)._rg();
  11341. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11342. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  11343. //>>excludeEnd("ctx");
  11344. }),$MessageNotUnderstood());
  11345. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11346. $ctx1.sendIdx["should:raise:"]=2;
  11347. //>>excludeEnd("ctx");
  11348. self._should_raise_((function(){
  11349. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11350. return $core.withContext(function($ctx2) {
  11351. //>>excludeEnd("ctx");
  11352. return (16)._rH();
  11353. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11354. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  11355. //>>excludeEnd("ctx");
  11356. }),$MessageNotUnderstood());
  11357. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11358. $ctx1.sendIdx["should:raise:"]=3;
  11359. //>>excludeEnd("ctx");
  11360. self._should_raise_((function(){
  11361. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11362. return $core.withContext(function($ctx2) {
  11363. //>>excludeEnd("ctx");
  11364. return (16)._rh();
  11365. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11366. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,4)});
  11367. //>>excludeEnd("ctx");
  11368. }),$MessageNotUnderstood());
  11369. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11370. $ctx1.sendIdx["should:raise:"]=4;
  11371. //>>excludeEnd("ctx");
  11372. self._should_raise_((function(){
  11373. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11374. return $core.withContext(function($ctx2) {
  11375. //>>excludeEnd("ctx");
  11376. return (16)._rI();
  11377. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11378. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,5)});
  11379. //>>excludeEnd("ctx");
  11380. }),$MessageNotUnderstood());
  11381. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11382. $ctx1.sendIdx["should:raise:"]=5;
  11383. //>>excludeEnd("ctx");
  11384. self._should_raise_((function(){
  11385. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11386. return $core.withContext(function($ctx2) {
  11387. //>>excludeEnd("ctx");
  11388. return (16)._ri();
  11389. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11390. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,6)});
  11391. //>>excludeEnd("ctx");
  11392. }),$MessageNotUnderstood());
  11393. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11394. $ctx1.sendIdx["should:raise:"]=6;
  11395. //>>excludeEnd("ctx");
  11396. self._should_raise_((function(){
  11397. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11398. return $core.withContext(function($ctx2) {
  11399. //>>excludeEnd("ctx");
  11400. return (16)._rJ();
  11401. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11402. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,7)});
  11403. //>>excludeEnd("ctx");
  11404. }),$MessageNotUnderstood());
  11405. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11406. $ctx1.sendIdx["should:raise:"]=7;
  11407. //>>excludeEnd("ctx");
  11408. self._should_raise_((function(){
  11409. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11410. return $core.withContext(function($ctx2) {
  11411. //>>excludeEnd("ctx");
  11412. return (16)._rj();
  11413. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11414. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,8)});
  11415. //>>excludeEnd("ctx");
  11416. }),$MessageNotUnderstood());
  11417. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11418. $ctx1.sendIdx["should:raise:"]=8;
  11419. //>>excludeEnd("ctx");
  11420. self._should_raise_((function(){
  11421. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11422. return $core.withContext(function($ctx2) {
  11423. //>>excludeEnd("ctx");
  11424. return (16)._rK();
  11425. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11426. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,9)});
  11427. //>>excludeEnd("ctx");
  11428. }),$MessageNotUnderstood());
  11429. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11430. $ctx1.sendIdx["should:raise:"]=9;
  11431. //>>excludeEnd("ctx");
  11432. self._should_raise_((function(){
  11433. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11434. return $core.withContext(function($ctx2) {
  11435. //>>excludeEnd("ctx");
  11436. return (16)._rk();
  11437. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11438. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,10)});
  11439. //>>excludeEnd("ctx");
  11440. }),$MessageNotUnderstood());
  11441. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11442. $ctx1.sendIdx["should:raise:"]=10;
  11443. //>>excludeEnd("ctx");
  11444. self._should_raise_((function(){
  11445. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11446. return $core.withContext(function($ctx2) {
  11447. //>>excludeEnd("ctx");
  11448. return (16)._rL();
  11449. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11450. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,11)});
  11451. //>>excludeEnd("ctx");
  11452. }),$MessageNotUnderstood());
  11453. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11454. $ctx1.sendIdx["should:raise:"]=11;
  11455. //>>excludeEnd("ctx");
  11456. self._should_raise_((function(){
  11457. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11458. return $core.withContext(function($ctx2) {
  11459. //>>excludeEnd("ctx");
  11460. return (16)._rl();
  11461. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11462. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,12)});
  11463. //>>excludeEnd("ctx");
  11464. }),$MessageNotUnderstood());
  11465. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11466. $ctx1.sendIdx["should:raise:"]=12;
  11467. //>>excludeEnd("ctx");
  11468. self._should_raise_((function(){
  11469. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11470. return $core.withContext(function($ctx2) {
  11471. //>>excludeEnd("ctx");
  11472. return (16)._rM();
  11473. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11474. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,13)});
  11475. //>>excludeEnd("ctx");
  11476. }),$MessageNotUnderstood());
  11477. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11478. $ctx1.sendIdx["should:raise:"]=13;
  11479. //>>excludeEnd("ctx");
  11480. self._should_raise_((function(){
  11481. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11482. return $core.withContext(function($ctx2) {
  11483. //>>excludeEnd("ctx");
  11484. return (16)._rm();
  11485. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11486. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,14)});
  11487. //>>excludeEnd("ctx");
  11488. }),$MessageNotUnderstood());
  11489. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11490. $ctx1.sendIdx["should:raise:"]=14;
  11491. //>>excludeEnd("ctx");
  11492. self._should_raise_((function(){
  11493. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11494. return $core.withContext(function($ctx2) {
  11495. //>>excludeEnd("ctx");
  11496. return (16)._rN();
  11497. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11498. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,15)});
  11499. //>>excludeEnd("ctx");
  11500. }),$MessageNotUnderstood());
  11501. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11502. $ctx1.sendIdx["should:raise:"]=15;
  11503. //>>excludeEnd("ctx");
  11504. self._should_raise_((function(){
  11505. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11506. return $core.withContext(function($ctx2) {
  11507. //>>excludeEnd("ctx");
  11508. return (16)._rn();
  11509. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11510. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,16)});
  11511. //>>excludeEnd("ctx");
  11512. }),$MessageNotUnderstood());
  11513. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11514. $ctx1.sendIdx["should:raise:"]=16;
  11515. //>>excludeEnd("ctx");
  11516. self._should_raise_((function(){
  11517. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11518. return $core.withContext(function($ctx2) {
  11519. //>>excludeEnd("ctx");
  11520. return (16)._rO();
  11521. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11522. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,17)});
  11523. //>>excludeEnd("ctx");
  11524. }),$MessageNotUnderstood());
  11525. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11526. $ctx1.sendIdx["should:raise:"]=17;
  11527. //>>excludeEnd("ctx");
  11528. self._should_raise_((function(){
  11529. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11530. return $core.withContext(function($ctx2) {
  11531. //>>excludeEnd("ctx");
  11532. return (16)._ro();
  11533. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11534. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,18)});
  11535. //>>excludeEnd("ctx");
  11536. }),$MessageNotUnderstood());
  11537. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11538. $ctx1.sendIdx["should:raise:"]=18;
  11539. //>>excludeEnd("ctx");
  11540. self._should_raise_((function(){
  11541. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11542. return $core.withContext(function($ctx2) {
  11543. //>>excludeEnd("ctx");
  11544. return (16)._rP();
  11545. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11546. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,19)});
  11547. //>>excludeEnd("ctx");
  11548. }),$MessageNotUnderstood());
  11549. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11550. $ctx1.sendIdx["should:raise:"]=19;
  11551. //>>excludeEnd("ctx");
  11552. self._should_raise_((function(){
  11553. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11554. return $core.withContext(function($ctx2) {
  11555. //>>excludeEnd("ctx");
  11556. return (16)._rp();
  11557. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11558. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,20)});
  11559. //>>excludeEnd("ctx");
  11560. }),$MessageNotUnderstood());
  11561. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11562. $ctx1.sendIdx["should:raise:"]=20;
  11563. //>>excludeEnd("ctx");
  11564. self._should_raise_((function(){
  11565. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11566. return $core.withContext(function($ctx2) {
  11567. //>>excludeEnd("ctx");
  11568. return (16)._rQ();
  11569. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11570. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,21)});
  11571. //>>excludeEnd("ctx");
  11572. }),$MessageNotUnderstood());
  11573. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11574. $ctx1.sendIdx["should:raise:"]=21;
  11575. //>>excludeEnd("ctx");
  11576. self._should_raise_((function(){
  11577. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11578. return $core.withContext(function($ctx2) {
  11579. //>>excludeEnd("ctx");
  11580. return (16)._rq();
  11581. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11582. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,22)});
  11583. //>>excludeEnd("ctx");
  11584. }),$MessageNotUnderstood());
  11585. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11586. $ctx1.sendIdx["should:raise:"]=22;
  11587. //>>excludeEnd("ctx");
  11588. self._should_raise_((function(){
  11589. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11590. return $core.withContext(function($ctx2) {
  11591. //>>excludeEnd("ctx");
  11592. return (16)._rR();
  11593. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11594. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,23)});
  11595. //>>excludeEnd("ctx");
  11596. }),$MessageNotUnderstood());
  11597. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11598. $ctx1.sendIdx["should:raise:"]=23;
  11599. //>>excludeEnd("ctx");
  11600. self._should_raise_((function(){
  11601. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11602. return $core.withContext(function($ctx2) {
  11603. //>>excludeEnd("ctx");
  11604. return (16)._rr();
  11605. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11606. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,24)});
  11607. //>>excludeEnd("ctx");
  11608. }),$MessageNotUnderstood());
  11609. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11610. $ctx1.sendIdx["should:raise:"]=24;
  11611. //>>excludeEnd("ctx");
  11612. self._should_raise_((function(){
  11613. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11614. return $core.withContext(function($ctx2) {
  11615. //>>excludeEnd("ctx");
  11616. return (16)._rS();
  11617. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11618. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,25)});
  11619. //>>excludeEnd("ctx");
  11620. }),$MessageNotUnderstood());
  11621. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11622. $ctx1.sendIdx["should:raise:"]=25;
  11623. //>>excludeEnd("ctx");
  11624. self._should_raise_((function(){
  11625. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11626. return $core.withContext(function($ctx2) {
  11627. //>>excludeEnd("ctx");
  11628. return (16)._rs();
  11629. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11630. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,26)});
  11631. //>>excludeEnd("ctx");
  11632. }),$MessageNotUnderstood());
  11633. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11634. $ctx1.sendIdx["should:raise:"]=26;
  11635. //>>excludeEnd("ctx");
  11636. self._should_raise_((function(){
  11637. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11638. return $core.withContext(function($ctx2) {
  11639. //>>excludeEnd("ctx");
  11640. return (16)._rT();
  11641. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11642. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,27)});
  11643. //>>excludeEnd("ctx");
  11644. }),$MessageNotUnderstood());
  11645. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11646. $ctx1.sendIdx["should:raise:"]=27;
  11647. //>>excludeEnd("ctx");
  11648. self._should_raise_((function(){
  11649. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11650. return $core.withContext(function($ctx2) {
  11651. //>>excludeEnd("ctx");
  11652. return (16)._rt();
  11653. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11654. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,28)});
  11655. //>>excludeEnd("ctx");
  11656. }),$MessageNotUnderstood());
  11657. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11658. $ctx1.sendIdx["should:raise:"]=28;
  11659. //>>excludeEnd("ctx");
  11660. self._should_raise_((function(){
  11661. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11662. return $core.withContext(function($ctx2) {
  11663. //>>excludeEnd("ctx");
  11664. return (16)._rU();
  11665. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11666. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,29)});
  11667. //>>excludeEnd("ctx");
  11668. }),$MessageNotUnderstood());
  11669. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11670. $ctx1.sendIdx["should:raise:"]=29;
  11671. //>>excludeEnd("ctx");
  11672. self._should_raise_((function(){
  11673. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11674. return $core.withContext(function($ctx2) {
  11675. //>>excludeEnd("ctx");
  11676. return (16)._ru();
  11677. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11678. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,30)});
  11679. //>>excludeEnd("ctx");
  11680. }),$MessageNotUnderstood());
  11681. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11682. $ctx1.sendIdx["should:raise:"]=30;
  11683. //>>excludeEnd("ctx");
  11684. self._should_raise_((function(){
  11685. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11686. return $core.withContext(function($ctx2) {
  11687. //>>excludeEnd("ctx");
  11688. return (16)._rV();
  11689. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11690. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,31)});
  11691. //>>excludeEnd("ctx");
  11692. }),$MessageNotUnderstood());
  11693. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11694. $ctx1.sendIdx["should:raise:"]=31;
  11695. //>>excludeEnd("ctx");
  11696. self._should_raise_((function(){
  11697. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11698. return $core.withContext(function($ctx2) {
  11699. //>>excludeEnd("ctx");
  11700. return (16)._rv();
  11701. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11702. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,32)});
  11703. //>>excludeEnd("ctx");
  11704. }),$MessageNotUnderstood());
  11705. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11706. $ctx1.sendIdx["should:raise:"]=32;
  11707. //>>excludeEnd("ctx");
  11708. self._should_raise_((function(){
  11709. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11710. return $core.withContext(function($ctx2) {
  11711. //>>excludeEnd("ctx");
  11712. return (16)._rW();
  11713. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11714. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,33)});
  11715. //>>excludeEnd("ctx");
  11716. }),$MessageNotUnderstood());
  11717. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11718. $ctx1.sendIdx["should:raise:"]=33;
  11719. //>>excludeEnd("ctx");
  11720. self._should_raise_((function(){
  11721. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11722. return $core.withContext(function($ctx2) {
  11723. //>>excludeEnd("ctx");
  11724. return (16)._rw();
  11725. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11726. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,34)});
  11727. //>>excludeEnd("ctx");
  11728. }),$MessageNotUnderstood());
  11729. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11730. $ctx1.sendIdx["should:raise:"]=34;
  11731. //>>excludeEnd("ctx");
  11732. self._should_raise_((function(){
  11733. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11734. return $core.withContext(function($ctx2) {
  11735. //>>excludeEnd("ctx");
  11736. return (16)._rX();
  11737. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11738. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,35)});
  11739. //>>excludeEnd("ctx");
  11740. }),$MessageNotUnderstood());
  11741. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11742. $ctx1.sendIdx["should:raise:"]=35;
  11743. //>>excludeEnd("ctx");
  11744. self._should_raise_((function(){
  11745. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11746. return $core.withContext(function($ctx2) {
  11747. //>>excludeEnd("ctx");
  11748. return (16)._rx();
  11749. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11750. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,36)});
  11751. //>>excludeEnd("ctx");
  11752. }),$MessageNotUnderstood());
  11753. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11754. $ctx1.sendIdx["should:raise:"]=36;
  11755. //>>excludeEnd("ctx");
  11756. self._should_raise_((function(){
  11757. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11758. return $core.withContext(function($ctx2) {
  11759. //>>excludeEnd("ctx");
  11760. return (16)._rY();
  11761. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11762. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,37)});
  11763. //>>excludeEnd("ctx");
  11764. }),$MessageNotUnderstood());
  11765. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11766. $ctx1.sendIdx["should:raise:"]=37;
  11767. //>>excludeEnd("ctx");
  11768. self._should_raise_((function(){
  11769. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11770. return $core.withContext(function($ctx2) {
  11771. //>>excludeEnd("ctx");
  11772. return (16)._ry();
  11773. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11774. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,38)});
  11775. //>>excludeEnd("ctx");
  11776. }),$MessageNotUnderstood());
  11777. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11778. $ctx1.sendIdx["should:raise:"]=38;
  11779. //>>excludeEnd("ctx");
  11780. self._should_raise_((function(){
  11781. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11782. return $core.withContext(function($ctx2) {
  11783. //>>excludeEnd("ctx");
  11784. return (16)._rZ();
  11785. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11786. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,39)});
  11787. //>>excludeEnd("ctx");
  11788. }),$MessageNotUnderstood());
  11789. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11790. $ctx1.sendIdx["should:raise:"]=39;
  11791. //>>excludeEnd("ctx");
  11792. self._should_raise_((function(){
  11793. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11794. return $core.withContext(function($ctx2) {
  11795. //>>excludeEnd("ctx");
  11796. return (16)._rz();
  11797. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11798. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,40)});
  11799. //>>excludeEnd("ctx");
  11800. }),$MessageNotUnderstood());
  11801. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11802. $ctx1.sendIdx["should:raise:"]=40;
  11803. //>>excludeEnd("ctx");
  11804. self._should_raise_((function(){
  11805. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11806. return $core.withContext(function($ctx2) {
  11807. //>>excludeEnd("ctx");
  11808. return (11259375)._Z();
  11809. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11810. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,41)});
  11811. //>>excludeEnd("ctx");
  11812. }),$MessageNotUnderstood());
  11813. return self;
  11814. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11815. }, function($ctx1) {$ctx1.fill(self,"testInvalidHexNumbers",{},$globals.NumberTest)});
  11816. //>>excludeEnd("ctx");
  11817. },
  11818. //>>excludeStart("ide", pragmas.excludeIdeData);
  11819. args: [],
  11820. 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.",
  11821. referencedClasses: ["MessageNotUnderstood"],
  11822. //>>excludeEnd("ide");
  11823. 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"]
  11824. }),
  11825. $globals.NumberTest);
  11826. $core.addMethod(
  11827. $core.method({
  11828. selector: "testLog",
  11829. protocol: 'tests',
  11830. fn: function (){
  11831. var self=this;
  11832. function $Number(){return $globals.Number||(typeof Number=="undefined"?nil:Number)}
  11833. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11834. return $core.withContext(function($ctx1) {
  11835. //>>excludeEnd("ctx");
  11836. self._assert_equals_((10000)._log(),(4));
  11837. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11838. $ctx1.sendIdx["assert:equals:"]=1;
  11839. //>>excludeEnd("ctx");
  11840. self._assert_equals_((512)._log_((2)),(9));
  11841. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11842. $ctx1.sendIdx["assert:equals:"]=2;
  11843. //>>excludeEnd("ctx");
  11844. self._assert_equals_($recv($recv($Number())._e())._ln(),(1));
  11845. return self;
  11846. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11847. }, function($ctx1) {$ctx1.fill(self,"testLog",{},$globals.NumberTest)});
  11848. //>>excludeEnd("ctx");
  11849. },
  11850. //>>excludeStart("ide", pragmas.excludeIdeData);
  11851. args: [],
  11852. 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.",
  11853. referencedClasses: ["Number"],
  11854. //>>excludeEnd("ide");
  11855. messageSends: ["assert:equals:", "log", "log:", "ln", "e"]
  11856. }),
  11857. $globals.NumberTest);
  11858. $core.addMethod(
  11859. $core.method({
  11860. selector: "testMinMax",
  11861. protocol: 'tests',
  11862. fn: function (){
  11863. var self=this;
  11864. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11865. return $core.withContext(function($ctx1) {
  11866. //>>excludeEnd("ctx");
  11867. self._assert_equals_((2)._max_((5)),(5));
  11868. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11869. $ctx1.sendIdx["assert:equals:"]=1;
  11870. //>>excludeEnd("ctx");
  11871. self._assert_equals_((2)._min_((5)),(2));
  11872. return self;
  11873. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11874. }, function($ctx1) {$ctx1.fill(self,"testMinMax",{},$globals.NumberTest)});
  11875. //>>excludeEnd("ctx");
  11876. },
  11877. //>>excludeStart("ide", pragmas.excludeIdeData);
  11878. args: [],
  11879. source: "testMinMax\x0a\x09\x0a\x09self assert: (2 max: 5) equals: 5.\x0a\x09self assert: (2 min: 5) equals: 2",
  11880. referencedClasses: [],
  11881. //>>excludeEnd("ide");
  11882. messageSends: ["assert:equals:", "max:", "min:"]
  11883. }),
  11884. $globals.NumberTest);
  11885. $core.addMethod(
  11886. $core.method({
  11887. selector: "testNegated",
  11888. protocol: 'tests',
  11889. fn: function (){
  11890. var self=this;
  11891. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11892. return $core.withContext(function($ctx1) {
  11893. //>>excludeEnd("ctx");
  11894. var $1;
  11895. $1=(3)._negated();
  11896. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11897. $ctx1.sendIdx["negated"]=1;
  11898. //>>excludeEnd("ctx");
  11899. self._assert_equals_($1,(-3));
  11900. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11901. $ctx1.sendIdx["assert:equals:"]=1;
  11902. //>>excludeEnd("ctx");
  11903. self._assert_equals_((-3)._negated(),(3));
  11904. return self;
  11905. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11906. }, function($ctx1) {$ctx1.fill(self,"testNegated",{},$globals.NumberTest)});
  11907. //>>excludeEnd("ctx");
  11908. },
  11909. //>>excludeStart("ide", pragmas.excludeIdeData);
  11910. args: [],
  11911. source: "testNegated\x0a\x09self assert: 3 negated equals: -3.\x0a\x09self assert: -3 negated equals: 3",
  11912. referencedClasses: [],
  11913. //>>excludeEnd("ide");
  11914. messageSends: ["assert:equals:", "negated"]
  11915. }),
  11916. $globals.NumberTest);
  11917. $core.addMethod(
  11918. $core.method({
  11919. selector: "testPrintShowingDecimalPlaces",
  11920. protocol: 'tests',
  11921. fn: function (){
  11922. var self=this;
  11923. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11924. return $core.withContext(function($ctx1) {
  11925. //>>excludeEnd("ctx");
  11926. var $1,$2,$4,$3,$5,$6,$8,$7,$10,$9,$11,$12,$13,$14,$15;
  11927. $1=(23)._printShowingDecimalPlaces_((2));
  11928. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11929. $ctx1.sendIdx["printShowingDecimalPlaces:"]=1;
  11930. //>>excludeEnd("ctx");
  11931. self._assert_equals_($1,"23.00");
  11932. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11933. $ctx1.sendIdx["assert:equals:"]=1;
  11934. //>>excludeEnd("ctx");
  11935. $2=(23.5698)._printShowingDecimalPlaces_((2));
  11936. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11937. $ctx1.sendIdx["printShowingDecimalPlaces:"]=2;
  11938. //>>excludeEnd("ctx");
  11939. self._assert_equals_($2,"23.57");
  11940. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11941. $ctx1.sendIdx["assert:equals:"]=2;
  11942. //>>excludeEnd("ctx");
  11943. $4=(234.567)._negated();
  11944. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11945. $ctx1.sendIdx["negated"]=1;
  11946. //>>excludeEnd("ctx");
  11947. $3=$recv($4)._printShowingDecimalPlaces_((5));
  11948. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11949. $ctx1.sendIdx["printShowingDecimalPlaces:"]=3;
  11950. //>>excludeEnd("ctx");
  11951. self._assert_equals_($3,"-234.56700");
  11952. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11953. $ctx1.sendIdx["assert:equals:"]=3;
  11954. //>>excludeEnd("ctx");
  11955. $5=(23.4567)._printShowingDecimalPlaces_((0));
  11956. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11957. $ctx1.sendIdx["printShowingDecimalPlaces:"]=4;
  11958. //>>excludeEnd("ctx");
  11959. self._assert_equals_($5,"23");
  11960. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11961. $ctx1.sendIdx["assert:equals:"]=4;
  11962. //>>excludeEnd("ctx");
  11963. $6=(23.5567)._printShowingDecimalPlaces_((0));
  11964. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11965. $ctx1.sendIdx["printShowingDecimalPlaces:"]=5;
  11966. //>>excludeEnd("ctx");
  11967. self._assert_equals_($6,"24");
  11968. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11969. $ctx1.sendIdx["assert:equals:"]=5;
  11970. //>>excludeEnd("ctx");
  11971. $8=(23.4567)._negated();
  11972. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11973. $ctx1.sendIdx["negated"]=2;
  11974. //>>excludeEnd("ctx");
  11975. $7=$recv($8)._printShowingDecimalPlaces_((0));
  11976. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11977. $ctx1.sendIdx["printShowingDecimalPlaces:"]=6;
  11978. //>>excludeEnd("ctx");
  11979. self._assert_equals_($7,"-23");
  11980. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11981. $ctx1.sendIdx["assert:equals:"]=6;
  11982. //>>excludeEnd("ctx");
  11983. $10=(23.5567)._negated();
  11984. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11985. $ctx1.sendIdx["negated"]=3;
  11986. //>>excludeEnd("ctx");
  11987. $9=$recv($10)._printShowingDecimalPlaces_((0));
  11988. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11989. $ctx1.sendIdx["printShowingDecimalPlaces:"]=7;
  11990. //>>excludeEnd("ctx");
  11991. self._assert_equals_($9,"-24");
  11992. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11993. $ctx1.sendIdx["assert:equals:"]=7;
  11994. //>>excludeEnd("ctx");
  11995. $11=(100000000)._printShowingDecimalPlaces_((1));
  11996. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  11997. $ctx1.sendIdx["printShowingDecimalPlaces:"]=8;
  11998. //>>excludeEnd("ctx");
  11999. self._assert_equals_($11,"100000000.0");
  12000. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12001. $ctx1.sendIdx["assert:equals:"]=8;
  12002. //>>excludeEnd("ctx");
  12003. $12=(0.98)._printShowingDecimalPlaces_((5));
  12004. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12005. $ctx1.sendIdx["printShowingDecimalPlaces:"]=9;
  12006. //>>excludeEnd("ctx");
  12007. self._assert_equals_($12,"0.98000");
  12008. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12009. $ctx1.sendIdx["assert:equals:"]=9;
  12010. //>>excludeEnd("ctx");
  12011. $13=$recv((0.98)._negated())._printShowingDecimalPlaces_((2));
  12012. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12013. $ctx1.sendIdx["printShowingDecimalPlaces:"]=10;
  12014. //>>excludeEnd("ctx");
  12015. self._assert_equals_($13,"-0.98");
  12016. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12017. $ctx1.sendIdx["assert:equals:"]=10;
  12018. //>>excludeEnd("ctx");
  12019. $14=(2.567)._printShowingDecimalPlaces_((2));
  12020. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12021. $ctx1.sendIdx["printShowingDecimalPlaces:"]=11;
  12022. //>>excludeEnd("ctx");
  12023. self._assert_equals_($14,"2.57");
  12024. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12025. $ctx1.sendIdx["assert:equals:"]=11;
  12026. //>>excludeEnd("ctx");
  12027. $15=(-2.567)._printShowingDecimalPlaces_((2));
  12028. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12029. $ctx1.sendIdx["printShowingDecimalPlaces:"]=12;
  12030. //>>excludeEnd("ctx");
  12031. self._assert_equals_($15,"-2.57");
  12032. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12033. $ctx1.sendIdx["assert:equals:"]=12;
  12034. //>>excludeEnd("ctx");
  12035. self._assert_equals_((0)._printShowingDecimalPlaces_((2)),"0.00");
  12036. return self;
  12037. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12038. }, function($ctx1) {$ctx1.fill(self,"testPrintShowingDecimalPlaces",{},$globals.NumberTest)});
  12039. //>>excludeEnd("ctx");
  12040. },
  12041. //>>excludeStart("ide", pragmas.excludeIdeData);
  12042. args: [],
  12043. 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'.",
  12044. referencedClasses: [],
  12045. //>>excludeEnd("ide");
  12046. messageSends: ["assert:equals:", "printShowingDecimalPlaces:", "negated"]
  12047. }),
  12048. $globals.NumberTest);
  12049. $core.addMethod(
  12050. $core.method({
  12051. selector: "testRaisedTo",
  12052. protocol: 'tests',
  12053. fn: function (){
  12054. var self=this;
  12055. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12056. return $core.withContext(function($ctx1) {
  12057. //>>excludeEnd("ctx");
  12058. var $1,$2,$3;
  12059. $1=(2)._raisedTo_((4));
  12060. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12061. $ctx1.sendIdx["raisedTo:"]=1;
  12062. //>>excludeEnd("ctx");
  12063. self._assert_equals_($1,(16));
  12064. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12065. $ctx1.sendIdx["assert:equals:"]=1;
  12066. //>>excludeEnd("ctx");
  12067. $2=(2)._raisedTo_((0));
  12068. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12069. $ctx1.sendIdx["raisedTo:"]=2;
  12070. //>>excludeEnd("ctx");
  12071. self._assert_equals_($2,(1));
  12072. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12073. $ctx1.sendIdx["assert:equals:"]=2;
  12074. //>>excludeEnd("ctx");
  12075. $3=(2)._raisedTo_((-3));
  12076. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12077. $ctx1.sendIdx["raisedTo:"]=3;
  12078. //>>excludeEnd("ctx");
  12079. self._assert_equals_($3,(0.125));
  12080. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12081. $ctx1.sendIdx["assert:equals:"]=3;
  12082. //>>excludeEnd("ctx");
  12083. self._assert_equals_((4)._raisedTo_((0.5)),(2));
  12084. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12085. $ctx1.sendIdx["assert:equals:"]=4;
  12086. //>>excludeEnd("ctx");
  12087. self._assert_equals_((2).__star_star((4)),(16));
  12088. return self;
  12089. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12090. }, function($ctx1) {$ctx1.fill(self,"testRaisedTo",{},$globals.NumberTest)});
  12091. //>>excludeEnd("ctx");
  12092. },
  12093. //>>excludeStart("ide", pragmas.excludeIdeData);
  12094. args: [],
  12095. 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.",
  12096. referencedClasses: [],
  12097. //>>excludeEnd("ide");
  12098. messageSends: ["assert:equals:", "raisedTo:", "**"]
  12099. }),
  12100. $globals.NumberTest);
  12101. $core.addMethod(
  12102. $core.method({
  12103. selector: "testRounded",
  12104. protocol: 'tests',
  12105. fn: function (){
  12106. var self=this;
  12107. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12108. return $core.withContext(function($ctx1) {
  12109. //>>excludeEnd("ctx");
  12110. var $1,$2;
  12111. $1=(3)._rounded();
  12112. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12113. $ctx1.sendIdx["rounded"]=1;
  12114. //>>excludeEnd("ctx");
  12115. self._assert_equals_($1,(3));
  12116. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12117. $ctx1.sendIdx["assert:equals:"]=1;
  12118. //>>excludeEnd("ctx");
  12119. $2=(3.212)._rounded();
  12120. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12121. $ctx1.sendIdx["rounded"]=2;
  12122. //>>excludeEnd("ctx");
  12123. self._assert_equals_($2,(3));
  12124. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12125. $ctx1.sendIdx["assert:equals:"]=2;
  12126. //>>excludeEnd("ctx");
  12127. self._assert_equals_((3.51)._rounded(),(4));
  12128. return self;
  12129. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12130. }, function($ctx1) {$ctx1.fill(self,"testRounded",{},$globals.NumberTest)});
  12131. //>>excludeEnd("ctx");
  12132. },
  12133. //>>excludeStart("ide", pragmas.excludeIdeData);
  12134. args: [],
  12135. 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",
  12136. referencedClasses: [],
  12137. //>>excludeEnd("ide");
  12138. messageSends: ["assert:equals:", "rounded"]
  12139. }),
  12140. $globals.NumberTest);
  12141. $core.addMethod(
  12142. $core.method({
  12143. selector: "testSign",
  12144. protocol: 'tests',
  12145. fn: function (){
  12146. var self=this;
  12147. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12148. return $core.withContext(function($ctx1) {
  12149. //>>excludeEnd("ctx");
  12150. var $1,$2;
  12151. $1=(5)._sign();
  12152. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12153. $ctx1.sendIdx["sign"]=1;
  12154. //>>excludeEnd("ctx");
  12155. self._assert_equals_($1,(1));
  12156. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12157. $ctx1.sendIdx["assert:equals:"]=1;
  12158. //>>excludeEnd("ctx");
  12159. $2=(0)._sign();
  12160. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12161. $ctx1.sendIdx["sign"]=2;
  12162. //>>excludeEnd("ctx");
  12163. self._assert_equals_($2,(0));
  12164. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12165. $ctx1.sendIdx["assert:equals:"]=2;
  12166. //>>excludeEnd("ctx");
  12167. self._assert_equals_((-1.4)._sign(),(-1));
  12168. return self;
  12169. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12170. }, function($ctx1) {$ctx1.fill(self,"testSign",{},$globals.NumberTest)});
  12171. //>>excludeEnd("ctx");
  12172. },
  12173. //>>excludeStart("ide", pragmas.excludeIdeData);
  12174. args: [],
  12175. source: "testSign\x0a\x09self assert: 5 sign equals: 1.\x0a\x09self assert: 0 sign equals: 0.\x0a\x09self assert: -1.4 sign equals: -1.",
  12176. referencedClasses: [],
  12177. //>>excludeEnd("ide");
  12178. messageSends: ["assert:equals:", "sign"]
  12179. }),
  12180. $globals.NumberTest);
  12181. $core.addMethod(
  12182. $core.method({
  12183. selector: "testSqrt",
  12184. protocol: 'tests',
  12185. fn: function (){
  12186. var self=this;
  12187. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12188. return $core.withContext(function($ctx1) {
  12189. //>>excludeEnd("ctx");
  12190. var $1;
  12191. $1=(4)._sqrt();
  12192. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12193. $ctx1.sendIdx["sqrt"]=1;
  12194. //>>excludeEnd("ctx");
  12195. self._assert_equals_($1,(2));
  12196. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12197. $ctx1.sendIdx["assert:equals:"]=1;
  12198. //>>excludeEnd("ctx");
  12199. self._assert_equals_((16)._sqrt(),(4));
  12200. return self;
  12201. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12202. }, function($ctx1) {$ctx1.fill(self,"testSqrt",{},$globals.NumberTest)});
  12203. //>>excludeEnd("ctx");
  12204. },
  12205. //>>excludeStart("ide", pragmas.excludeIdeData);
  12206. args: [],
  12207. source: "testSqrt\x0a\x09\x0a\x09self assert: 4 sqrt equals: 2.\x0a\x09self assert: 16 sqrt equals: 4",
  12208. referencedClasses: [],
  12209. //>>excludeEnd("ide");
  12210. messageSends: ["assert:equals:", "sqrt"]
  12211. }),
  12212. $globals.NumberTest);
  12213. $core.addMethod(
  12214. $core.method({
  12215. selector: "testSquared",
  12216. protocol: 'tests',
  12217. fn: function (){
  12218. var self=this;
  12219. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12220. return $core.withContext(function($ctx1) {
  12221. //>>excludeEnd("ctx");
  12222. self._assert_equals_((4)._squared(),(16));
  12223. return self;
  12224. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12225. }, function($ctx1) {$ctx1.fill(self,"testSquared",{},$globals.NumberTest)});
  12226. //>>excludeEnd("ctx");
  12227. },
  12228. //>>excludeStart("ide", pragmas.excludeIdeData);
  12229. args: [],
  12230. source: "testSquared\x0a\x09\x0a\x09self assert: 4 squared equals: 16",
  12231. referencedClasses: [],
  12232. //>>excludeEnd("ide");
  12233. messageSends: ["assert:equals:", "squared"]
  12234. }),
  12235. $globals.NumberTest);
  12236. $core.addMethod(
  12237. $core.method({
  12238. selector: "testTimesRepeat",
  12239. protocol: 'tests',
  12240. fn: function (){
  12241. var self=this;
  12242. var i;
  12243. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12244. return $core.withContext(function($ctx1) {
  12245. //>>excludeEnd("ctx");
  12246. i=(0);
  12247. (0)._timesRepeat_((function(){
  12248. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12249. return $core.withContext(function($ctx2) {
  12250. //>>excludeEnd("ctx");
  12251. i=$recv(i).__plus((1));
  12252. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12253. $ctx2.sendIdx["+"]=1;
  12254. //>>excludeEnd("ctx");
  12255. return i;
  12256. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12257. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  12258. //>>excludeEnd("ctx");
  12259. }));
  12260. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12261. $ctx1.sendIdx["timesRepeat:"]=1;
  12262. //>>excludeEnd("ctx");
  12263. self._assert_equals_(i,(0));
  12264. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12265. $ctx1.sendIdx["assert:equals:"]=1;
  12266. //>>excludeEnd("ctx");
  12267. (5)._timesRepeat_((function(){
  12268. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12269. return $core.withContext(function($ctx2) {
  12270. //>>excludeEnd("ctx");
  12271. i=$recv(i).__plus((1));
  12272. return i;
  12273. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12274. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  12275. //>>excludeEnd("ctx");
  12276. }));
  12277. self._assert_equals_(i,(5));
  12278. return self;
  12279. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12280. }, function($ctx1) {$ctx1.fill(self,"testTimesRepeat",{i:i},$globals.NumberTest)});
  12281. //>>excludeEnd("ctx");
  12282. },
  12283. //>>excludeStart("ide", pragmas.excludeIdeData);
  12284. args: [],
  12285. 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",
  12286. referencedClasses: [],
  12287. //>>excludeEnd("ide");
  12288. messageSends: ["timesRepeat:", "+", "assert:equals:"]
  12289. }),
  12290. $globals.NumberTest);
  12291. $core.addMethod(
  12292. $core.method({
  12293. selector: "testTo",
  12294. protocol: 'tests',
  12295. fn: function (){
  12296. var self=this;
  12297. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12298. return $core.withContext(function($ctx1) {
  12299. //>>excludeEnd("ctx");
  12300. self._assert_equals_((1)._to_((5)),[(1), (2), (3), (4), (5)]);
  12301. return self;
  12302. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12303. }, function($ctx1) {$ctx1.fill(self,"testTo",{},$globals.NumberTest)});
  12304. //>>excludeEnd("ctx");
  12305. },
  12306. //>>excludeStart("ide", pragmas.excludeIdeData);
  12307. args: [],
  12308. source: "testTo\x0a\x09self assert: (1 to: 5) equals: #(1 2 3 4 5)",
  12309. referencedClasses: [],
  12310. //>>excludeEnd("ide");
  12311. messageSends: ["assert:equals:", "to:"]
  12312. }),
  12313. $globals.NumberTest);
  12314. $core.addMethod(
  12315. $core.method({
  12316. selector: "testToBy",
  12317. protocol: 'tests',
  12318. fn: function (){
  12319. var self=this;
  12320. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  12321. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12322. return $core.withContext(function($ctx1) {
  12323. //>>excludeEnd("ctx");
  12324. var $1;
  12325. $1=(0)._to_by_((6),(2));
  12326. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12327. $ctx1.sendIdx["to:by:"]=1;
  12328. //>>excludeEnd("ctx");
  12329. self._assert_equals_($1,[(0), (2), (4), (6)]);
  12330. self._should_raise_((function(){
  12331. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12332. return $core.withContext(function($ctx2) {
  12333. //>>excludeEnd("ctx");
  12334. return (1)._to_by_((4),(0));
  12335. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12336. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  12337. //>>excludeEnd("ctx");
  12338. }),$Error());
  12339. return self;
  12340. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12341. }, function($ctx1) {$ctx1.fill(self,"testToBy",{},$globals.NumberTest)});
  12342. //>>excludeEnd("ctx");
  12343. },
  12344. //>>excludeStart("ide", pragmas.excludeIdeData);
  12345. args: [],
  12346. 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",
  12347. referencedClasses: ["Error"],
  12348. //>>excludeEnd("ide");
  12349. messageSends: ["assert:equals:", "to:by:", "should:raise:"]
  12350. }),
  12351. $globals.NumberTest);
  12352. $core.addMethod(
  12353. $core.method({
  12354. selector: "testTrigonometry",
  12355. protocol: 'tests',
  12356. fn: function (){
  12357. var self=this;
  12358. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12359. return $core.withContext(function($ctx1) {
  12360. //>>excludeEnd("ctx");
  12361. self._assert_equals_((0)._cos(),(1));
  12362. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12363. $ctx1.sendIdx["assert:equals:"]=1;
  12364. //>>excludeEnd("ctx");
  12365. self._assert_equals_((0)._sin(),(0));
  12366. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12367. $ctx1.sendIdx["assert:equals:"]=2;
  12368. //>>excludeEnd("ctx");
  12369. self._assert_equals_((0)._tan(),(0));
  12370. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12371. $ctx1.sendIdx["assert:equals:"]=3;
  12372. //>>excludeEnd("ctx");
  12373. self._assert_equals_((1)._arcCos(),(0));
  12374. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12375. $ctx1.sendIdx["assert:equals:"]=4;
  12376. //>>excludeEnd("ctx");
  12377. self._assert_equals_((0)._arcSin(),(0));
  12378. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12379. $ctx1.sendIdx["assert:equals:"]=5;
  12380. //>>excludeEnd("ctx");
  12381. self._assert_equals_((0)._arcTan(),(0));
  12382. return self;
  12383. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12384. }, function($ctx1) {$ctx1.fill(self,"testTrigonometry",{},$globals.NumberTest)});
  12385. //>>excludeEnd("ctx");
  12386. },
  12387. //>>excludeStart("ide", pragmas.excludeIdeData);
  12388. args: [],
  12389. 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.",
  12390. referencedClasses: [],
  12391. //>>excludeEnd("ide");
  12392. messageSends: ["assert:equals:", "cos", "sin", "tan", "arcCos", "arcSin", "arcTan"]
  12393. }),
  12394. $globals.NumberTest);
  12395. $core.addMethod(
  12396. $core.method({
  12397. selector: "testTruncated",
  12398. protocol: 'tests',
  12399. fn: function (){
  12400. var self=this;
  12401. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12402. return $core.withContext(function($ctx1) {
  12403. //>>excludeEnd("ctx");
  12404. var $1,$2;
  12405. $1=(3)._truncated();
  12406. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12407. $ctx1.sendIdx["truncated"]=1;
  12408. //>>excludeEnd("ctx");
  12409. self._assert_equals_($1,(3));
  12410. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12411. $ctx1.sendIdx["assert:equals:"]=1;
  12412. //>>excludeEnd("ctx");
  12413. $2=(3.212)._truncated();
  12414. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12415. $ctx1.sendIdx["truncated"]=2;
  12416. //>>excludeEnd("ctx");
  12417. self._assert_equals_($2,(3));
  12418. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12419. $ctx1.sendIdx["assert:equals:"]=2;
  12420. //>>excludeEnd("ctx");
  12421. self._assert_equals_((3.51)._truncated(),(3));
  12422. return self;
  12423. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12424. }, function($ctx1) {$ctx1.fill(self,"testTruncated",{},$globals.NumberTest)});
  12425. //>>excludeEnd("ctx");
  12426. },
  12427. //>>excludeStart("ide", pragmas.excludeIdeData);
  12428. args: [],
  12429. 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",
  12430. referencedClasses: [],
  12431. //>>excludeEnd("ide");
  12432. messageSends: ["assert:equals:", "truncated"]
  12433. }),
  12434. $globals.NumberTest);
  12435. $core.addClass('ObjectMock', $globals.Object, ['foo', 'bar'], 'Kernel-Tests');
  12436. //>>excludeStart("ide", pragmas.excludeIdeData);
  12437. $globals.ObjectMock.comment="ObjectMock is there only to perform tests on classes.";
  12438. //>>excludeEnd("ide");
  12439. $core.addMethod(
  12440. $core.method({
  12441. selector: "foo",
  12442. protocol: 'not yet classified',
  12443. fn: function (){
  12444. var self=this;
  12445. var $1;
  12446. $1=self["@foo"];
  12447. return $1;
  12448. },
  12449. //>>excludeStart("ide", pragmas.excludeIdeData);
  12450. args: [],
  12451. source: "foo\x0a\x09^ foo",
  12452. referencedClasses: [],
  12453. //>>excludeEnd("ide");
  12454. messageSends: []
  12455. }),
  12456. $globals.ObjectMock);
  12457. $core.addMethod(
  12458. $core.method({
  12459. selector: "foo:",
  12460. protocol: 'not yet classified',
  12461. fn: function (anObject){
  12462. var self=this;
  12463. self["@foo"]=anObject;
  12464. return self;
  12465. },
  12466. //>>excludeStart("ide", pragmas.excludeIdeData);
  12467. args: ["anObject"],
  12468. source: "foo: anObject\x0a\x09foo := anObject",
  12469. referencedClasses: [],
  12470. //>>excludeEnd("ide");
  12471. messageSends: []
  12472. }),
  12473. $globals.ObjectMock);
  12474. $core.addClass('ObjectTest', $globals.TestCase, [], 'Kernel-Tests');
  12475. $core.addMethod(
  12476. $core.method({
  12477. selector: "notDefined",
  12478. protocol: 'tests',
  12479. fn: function (){
  12480. var self=this;
  12481. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12482. return $core.withContext(function($ctx1) {
  12483. //>>excludeEnd("ctx");
  12484. return void 0;;
  12485. return self;
  12486. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12487. }, function($ctx1) {$ctx1.fill(self,"notDefined",{},$globals.ObjectTest)});
  12488. //>>excludeEnd("ctx");
  12489. },
  12490. //>>excludeStart("ide", pragmas.excludeIdeData);
  12491. args: [],
  12492. source: "notDefined\x0a\x09<return void 0;>",
  12493. referencedClasses: [],
  12494. //>>excludeEnd("ide");
  12495. messageSends: []
  12496. }),
  12497. $globals.ObjectTest);
  12498. $core.addMethod(
  12499. $core.method({
  12500. selector: "testBasicAccess",
  12501. protocol: 'tests',
  12502. fn: function (){
  12503. var self=this;
  12504. var o;
  12505. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  12506. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12507. return $core.withContext(function($ctx1) {
  12508. //>>excludeEnd("ctx");
  12509. var $1;
  12510. o=$recv($Object())._new();
  12511. $recv(o)._basicAt_put_("a",(1));
  12512. $1=$recv(o)._basicAt_("a");
  12513. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12514. $ctx1.sendIdx["basicAt:"]=1;
  12515. //>>excludeEnd("ctx");
  12516. self._assert_equals_($1,(1));
  12517. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12518. $ctx1.sendIdx["assert:equals:"]=1;
  12519. //>>excludeEnd("ctx");
  12520. self._assert_equals_($recv(o)._basicAt_("b"),nil);
  12521. return self;
  12522. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12523. }, function($ctx1) {$ctx1.fill(self,"testBasicAccess",{o:o},$globals.ObjectTest)});
  12524. //>>excludeEnd("ctx");
  12525. },
  12526. //>>excludeStart("ide", pragmas.excludeIdeData);
  12527. args: [],
  12528. 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",
  12529. referencedClasses: ["Object"],
  12530. //>>excludeEnd("ide");
  12531. messageSends: ["new", "basicAt:put:", "assert:equals:", "basicAt:"]
  12532. }),
  12533. $globals.ObjectTest);
  12534. $core.addMethod(
  12535. $core.method({
  12536. selector: "testBasicPerform",
  12537. protocol: 'tests',
  12538. fn: function (){
  12539. var self=this;
  12540. var o;
  12541. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  12542. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12543. return $core.withContext(function($ctx1) {
  12544. //>>excludeEnd("ctx");
  12545. o=$recv($Object())._new();
  12546. $recv(o)._basicAt_put_("func",(function(){
  12547. return "hello";
  12548. }));
  12549. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12550. $ctx1.sendIdx["basicAt:put:"]=1;
  12551. //>>excludeEnd("ctx");
  12552. $recv(o)._basicAt_put_("func2",(function(a){
  12553. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12554. return $core.withContext(function($ctx2) {
  12555. //>>excludeEnd("ctx");
  12556. return $recv(a).__plus((1));
  12557. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12558. }, function($ctx2) {$ctx2.fillBlock({a:a},$ctx1,2)});
  12559. //>>excludeEnd("ctx");
  12560. }));
  12561. self._assert_equals_($recv(o)._basicPerform_("func"),"hello");
  12562. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12563. $ctx1.sendIdx["assert:equals:"]=1;
  12564. //>>excludeEnd("ctx");
  12565. self._assert_equals_($recv(o)._basicPerform_withArguments_("func2",[(3)]),(4));
  12566. return self;
  12567. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12568. }, function($ctx1) {$ctx1.fill(self,"testBasicPerform",{o:o},$globals.ObjectTest)});
  12569. //>>excludeEnd("ctx");
  12570. },
  12571. //>>excludeStart("ide", pragmas.excludeIdeData);
  12572. args: [],
  12573. 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",
  12574. referencedClasses: ["Object"],
  12575. //>>excludeEnd("ide");
  12576. messageSends: ["new", "basicAt:put:", "+", "assert:equals:", "basicPerform:", "basicPerform:withArguments:"]
  12577. }),
  12578. $globals.ObjectTest);
  12579. $core.addMethod(
  12580. $core.method({
  12581. selector: "testDNU",
  12582. protocol: 'tests',
  12583. fn: function (){
  12584. var self=this;
  12585. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  12586. function $MessageNotUnderstood(){return $globals.MessageNotUnderstood||(typeof MessageNotUnderstood=="undefined"?nil:MessageNotUnderstood)}
  12587. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12588. return $core.withContext(function($ctx1) {
  12589. //>>excludeEnd("ctx");
  12590. self._should_raise_((function(){
  12591. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12592. return $core.withContext(function($ctx2) {
  12593. //>>excludeEnd("ctx");
  12594. return $recv($recv($Object())._new())._foo();
  12595. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12596. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  12597. //>>excludeEnd("ctx");
  12598. }),$MessageNotUnderstood());
  12599. return self;
  12600. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12601. }, function($ctx1) {$ctx1.fill(self,"testDNU",{},$globals.ObjectTest)});
  12602. //>>excludeEnd("ctx");
  12603. },
  12604. //>>excludeStart("ide", pragmas.excludeIdeData);
  12605. args: [],
  12606. source: "testDNU\x0a\x09self should: [ Object new foo ] raise: MessageNotUnderstood",
  12607. referencedClasses: ["Object", "MessageNotUnderstood"],
  12608. //>>excludeEnd("ide");
  12609. messageSends: ["should:raise:", "foo", "new"]
  12610. }),
  12611. $globals.ObjectTest);
  12612. $core.addMethod(
  12613. $core.method({
  12614. selector: "testEquality",
  12615. protocol: 'tests',
  12616. fn: function (){
  12617. var self=this;
  12618. var o;
  12619. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  12620. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12621. return $core.withContext(function($ctx1) {
  12622. //>>excludeEnd("ctx");
  12623. var $1,$2,$4,$3;
  12624. o=$recv($Object())._new();
  12625. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12626. $ctx1.sendIdx["new"]=1;
  12627. //>>excludeEnd("ctx");
  12628. $1=$recv(o).__eq($recv($Object())._new());
  12629. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12630. $ctx1.sendIdx["="]=1;
  12631. //>>excludeEnd("ctx");
  12632. self._deny_($1);
  12633. $2=$recv(o).__eq(o);
  12634. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12635. $ctx1.sendIdx["="]=2;
  12636. //>>excludeEnd("ctx");
  12637. self._assert_($2);
  12638. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12639. $ctx1.sendIdx["assert:"]=1;
  12640. //>>excludeEnd("ctx");
  12641. $4=$recv(o)._yourself();
  12642. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12643. $ctx1.sendIdx["yourself"]=1;
  12644. //>>excludeEnd("ctx");
  12645. $3=$recv($4).__eq(o);
  12646. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12647. $ctx1.sendIdx["="]=3;
  12648. //>>excludeEnd("ctx");
  12649. self._assert_($3);
  12650. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12651. $ctx1.sendIdx["assert:"]=2;
  12652. //>>excludeEnd("ctx");
  12653. self._assert_($recv(o).__eq($recv(o)._yourself()));
  12654. return self;
  12655. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12656. }, function($ctx1) {$ctx1.fill(self,"testEquality",{o:o},$globals.ObjectTest)});
  12657. //>>excludeEnd("ctx");
  12658. },
  12659. //>>excludeStart("ide", pragmas.excludeIdeData);
  12660. args: [],
  12661. 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)",
  12662. referencedClasses: ["Object"],
  12663. //>>excludeEnd("ide");
  12664. messageSends: ["new", "deny:", "=", "assert:", "yourself"]
  12665. }),
  12666. $globals.ObjectTest);
  12667. $core.addMethod(
  12668. $core.method({
  12669. selector: "testHalt",
  12670. protocol: 'tests',
  12671. fn: function (){
  12672. var self=this;
  12673. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  12674. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  12675. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12676. return $core.withContext(function($ctx1) {
  12677. //>>excludeEnd("ctx");
  12678. self._should_raise_((function(){
  12679. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12680. return $core.withContext(function($ctx2) {
  12681. //>>excludeEnd("ctx");
  12682. return $recv($recv($Object())._new())._halt();
  12683. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12684. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  12685. //>>excludeEnd("ctx");
  12686. }),$Error());
  12687. return self;
  12688. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12689. }, function($ctx1) {$ctx1.fill(self,"testHalt",{},$globals.ObjectTest)});
  12690. //>>excludeEnd("ctx");
  12691. },
  12692. //>>excludeStart("ide", pragmas.excludeIdeData);
  12693. args: [],
  12694. source: "testHalt\x0a\x09self should: [ Object new halt ] raise: Error",
  12695. referencedClasses: ["Object", "Error"],
  12696. //>>excludeEnd("ide");
  12697. messageSends: ["should:raise:", "halt", "new"]
  12698. }),
  12699. $globals.ObjectTest);
  12700. $core.addMethod(
  12701. $core.method({
  12702. selector: "testIdentity",
  12703. protocol: 'tests',
  12704. fn: function (){
  12705. var self=this;
  12706. var o;
  12707. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  12708. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12709. return $core.withContext(function($ctx1) {
  12710. //>>excludeEnd("ctx");
  12711. var $1,$2,$4,$3;
  12712. o=$recv($Object())._new();
  12713. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12714. $ctx1.sendIdx["new"]=1;
  12715. //>>excludeEnd("ctx");
  12716. $1=$recv(o).__eq_eq($recv($Object())._new());
  12717. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12718. $ctx1.sendIdx["=="]=1;
  12719. //>>excludeEnd("ctx");
  12720. self._deny_($1);
  12721. $2=$recv(o).__eq_eq(o);
  12722. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12723. $ctx1.sendIdx["=="]=2;
  12724. //>>excludeEnd("ctx");
  12725. self._assert_($2);
  12726. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12727. $ctx1.sendIdx["assert:"]=1;
  12728. //>>excludeEnd("ctx");
  12729. $4=$recv(o)._yourself();
  12730. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12731. $ctx1.sendIdx["yourself"]=1;
  12732. //>>excludeEnd("ctx");
  12733. $3=$recv($4).__eq_eq(o);
  12734. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12735. $ctx1.sendIdx["=="]=3;
  12736. //>>excludeEnd("ctx");
  12737. self._assert_($3);
  12738. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12739. $ctx1.sendIdx["assert:"]=2;
  12740. //>>excludeEnd("ctx");
  12741. self._assert_($recv(o).__eq_eq($recv(o)._yourself()));
  12742. return self;
  12743. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12744. }, function($ctx1) {$ctx1.fill(self,"testIdentity",{o:o},$globals.ObjectTest)});
  12745. //>>excludeEnd("ctx");
  12746. },
  12747. //>>excludeStart("ide", pragmas.excludeIdeData);
  12748. args: [],
  12749. 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",
  12750. referencedClasses: ["Object"],
  12751. //>>excludeEnd("ide");
  12752. messageSends: ["new", "deny:", "==", "assert:", "yourself"]
  12753. }),
  12754. $globals.ObjectTest);
  12755. $core.addMethod(
  12756. $core.method({
  12757. selector: "testIfNil",
  12758. protocol: 'tests',
  12759. fn: function (){
  12760. var self=this;
  12761. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  12762. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12763. return $core.withContext(function($ctx1) {
  12764. //>>excludeEnd("ctx");
  12765. var $2,$1,$5,$4,$3,$7,$6,$9,$8,$11,$10,$receiver;
  12766. $2=$recv($Object())._new();
  12767. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12768. $ctx1.sendIdx["new"]=1;
  12769. //>>excludeEnd("ctx");
  12770. $1=$recv($2)._isNil();
  12771. self._deny_($1);
  12772. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12773. $ctx1.sendIdx["deny:"]=1;
  12774. //>>excludeEnd("ctx");
  12775. $5=$recv($Object())._new();
  12776. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12777. $ctx1.sendIdx["new"]=2;
  12778. //>>excludeEnd("ctx");
  12779. if(($receiver = $5) == null || $receiver.isNil){
  12780. $4=true;
  12781. } else {
  12782. $4=$5;
  12783. };
  12784. $3=$recv($4).__eq(true);
  12785. self._deny_($3);
  12786. $7=$recv($Object())._new();
  12787. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12788. $ctx1.sendIdx["new"]=3;
  12789. //>>excludeEnd("ctx");
  12790. if(($receiver = $7) == null || $receiver.isNil){
  12791. $6=$7;
  12792. } else {
  12793. $6=true;
  12794. };
  12795. self._assert_equals_($6,true);
  12796. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12797. $ctx1.sendIdx["assert:equals:"]=1;
  12798. //>>excludeEnd("ctx");
  12799. $9=$recv($Object())._new();
  12800. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12801. $ctx1.sendIdx["new"]=4;
  12802. //>>excludeEnd("ctx");
  12803. if(($receiver = $9) == null || $receiver.isNil){
  12804. $8=false;
  12805. } else {
  12806. $8=true;
  12807. };
  12808. self._assert_equals_($8,true);
  12809. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12810. $ctx1.sendIdx["assert:equals:"]=2;
  12811. //>>excludeEnd("ctx");
  12812. $11=$recv($Object())._new();
  12813. if(($receiver = $11) == null || $receiver.isNil){
  12814. $10=false;
  12815. } else {
  12816. $10=true;
  12817. };
  12818. self._assert_equals_($10,true);
  12819. return self;
  12820. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12821. }, function($ctx1) {$ctx1.fill(self,"testIfNil",{},$globals.ObjectTest)});
  12822. //>>excludeEnd("ctx");
  12823. },
  12824. //>>excludeStart("ide", pragmas.excludeIdeData);
  12825. args: [],
  12826. 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",
  12827. referencedClasses: ["Object"],
  12828. //>>excludeEnd("ide");
  12829. messageSends: ["deny:", "isNil", "new", "=", "ifNil:", "assert:equals:", "ifNotNil:", "ifNil:ifNotNil:", "ifNotNil:ifNil:"]
  12830. }),
  12831. $globals.ObjectTest);
  12832. $core.addMethod(
  12833. $core.method({
  12834. selector: "testInstVars",
  12835. protocol: 'tests',
  12836. fn: function (){
  12837. var self=this;
  12838. var o;
  12839. function $ObjectMock(){return $globals.ObjectMock||(typeof ObjectMock=="undefined"?nil:ObjectMock)}
  12840. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12841. return $core.withContext(function($ctx1) {
  12842. //>>excludeEnd("ctx");
  12843. var $1,$2;
  12844. o=$recv($ObjectMock())._new();
  12845. $1=$recv(o)._instVarAt_("foo");
  12846. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12847. $ctx1.sendIdx["instVarAt:"]=1;
  12848. //>>excludeEnd("ctx");
  12849. self._assert_equals_($1,nil);
  12850. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12851. $ctx1.sendIdx["assert:equals:"]=1;
  12852. //>>excludeEnd("ctx");
  12853. $recv(o)._instVarAt_put_("foo",(1));
  12854. $2=$recv(o)._instVarAt_("foo");
  12855. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12856. $ctx1.sendIdx["instVarAt:"]=2;
  12857. //>>excludeEnd("ctx");
  12858. self._assert_equals_($2,(1));
  12859. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12860. $ctx1.sendIdx["assert:equals:"]=2;
  12861. //>>excludeEnd("ctx");
  12862. self._assert_equals_($recv(o)._instVarAt_("foo"),(1));
  12863. return self;
  12864. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12865. }, function($ctx1) {$ctx1.fill(self,"testInstVars",{o:o},$globals.ObjectTest)});
  12866. //>>excludeEnd("ctx");
  12867. },
  12868. //>>excludeStart("ide", pragmas.excludeIdeData);
  12869. args: [],
  12870. 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",
  12871. referencedClasses: ["ObjectMock"],
  12872. //>>excludeEnd("ide");
  12873. messageSends: ["new", "assert:equals:", "instVarAt:", "instVarAt:put:"]
  12874. }),
  12875. $globals.ObjectTest);
  12876. $core.addMethod(
  12877. $core.method({
  12878. selector: "testNilUndefined",
  12879. protocol: 'tests',
  12880. fn: function (){
  12881. var self=this;
  12882. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12883. return $core.withContext(function($ctx1) {
  12884. //>>excludeEnd("ctx");
  12885. self._assert_equals_(self._notDefined(),nil);
  12886. return self;
  12887. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12888. }, function($ctx1) {$ctx1.fill(self,"testNilUndefined",{},$globals.ObjectTest)});
  12889. //>>excludeEnd("ctx");
  12890. },
  12891. //>>excludeStart("ide", pragmas.excludeIdeData);
  12892. args: [],
  12893. source: "testNilUndefined\x0a\x09\x22nil in Smalltalk is the undefined object in JS\x22\x0a\x0a\x09self assert: self notDefined equals: nil",
  12894. referencedClasses: [],
  12895. //>>excludeEnd("ide");
  12896. messageSends: ["assert:equals:", "notDefined"]
  12897. }),
  12898. $globals.ObjectTest);
  12899. $core.addMethod(
  12900. $core.method({
  12901. selector: "testYourself",
  12902. protocol: 'tests',
  12903. fn: function (){
  12904. var self=this;
  12905. var o;
  12906. function $ObjectMock(){return $globals.ObjectMock||(typeof ObjectMock=="undefined"?nil:ObjectMock)}
  12907. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12908. return $core.withContext(function($ctx1) {
  12909. //>>excludeEnd("ctx");
  12910. o=$recv($ObjectMock())._new();
  12911. self._assert_($recv($recv(o)._yourself()).__eq_eq(o));
  12912. return self;
  12913. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12914. }, function($ctx1) {$ctx1.fill(self,"testYourself",{o:o},$globals.ObjectTest)});
  12915. //>>excludeEnd("ctx");
  12916. },
  12917. //>>excludeStart("ide", pragmas.excludeIdeData);
  12918. args: [],
  12919. source: "testYourself\x0a\x09| o |\x0a\x09o := ObjectMock new.\x0a\x09self assert: o yourself == o",
  12920. referencedClasses: ["ObjectMock"],
  12921. //>>excludeEnd("ide");
  12922. messageSends: ["new", "assert:", "==", "yourself"]
  12923. }),
  12924. $globals.ObjectTest);
  12925. $core.addMethod(
  12926. $core.method({
  12927. selector: "testidentityHash",
  12928. protocol: 'tests',
  12929. fn: function (){
  12930. var self=this;
  12931. var o1,o2;
  12932. function $Object(){return $globals.Object||(typeof Object=="undefined"?nil:Object)}
  12933. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12934. return $core.withContext(function($ctx1) {
  12935. //>>excludeEnd("ctx");
  12936. var $2,$3,$1,$5,$4;
  12937. o1=$recv($Object())._new();
  12938. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12939. $ctx1.sendIdx["new"]=1;
  12940. //>>excludeEnd("ctx");
  12941. o2=$recv($Object())._new();
  12942. $2=$recv(o1)._identityHash();
  12943. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12944. $ctx1.sendIdx["identityHash"]=1;
  12945. //>>excludeEnd("ctx");
  12946. $3=$recv(o1)._identityHash();
  12947. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12948. $ctx1.sendIdx["identityHash"]=2;
  12949. //>>excludeEnd("ctx");
  12950. $1=$recv($2).__eq_eq($3);
  12951. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12952. $ctx1.sendIdx["=="]=1;
  12953. //>>excludeEnd("ctx");
  12954. self._assert_($1);
  12955. $5=$recv(o1)._identityHash();
  12956. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12957. $ctx1.sendIdx["identityHash"]=3;
  12958. //>>excludeEnd("ctx");
  12959. $4=$recv($5).__eq_eq($recv(o2)._identityHash());
  12960. self._deny_($4);
  12961. return self;
  12962. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12963. }, function($ctx1) {$ctx1.fill(self,"testidentityHash",{o1:o1,o2:o2},$globals.ObjectTest)});
  12964. //>>excludeEnd("ctx");
  12965. },
  12966. //>>excludeStart("ide", pragmas.excludeIdeData);
  12967. args: [],
  12968. 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",
  12969. referencedClasses: ["Object"],
  12970. //>>excludeEnd("ide");
  12971. messageSends: ["new", "assert:", "==", "identityHash", "deny:"]
  12972. }),
  12973. $globals.ObjectTest);
  12974. $core.addClass('PointTest', $globals.TestCase, [], 'Kernel-Tests');
  12975. $core.addMethod(
  12976. $core.method({
  12977. selector: "testAccessing",
  12978. protocol: 'tests',
  12979. fn: function (){
  12980. var self=this;
  12981. function $Point(){return $globals.Point||(typeof Point=="undefined"?nil:Point)}
  12982. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12983. return $core.withContext(function($ctx1) {
  12984. //>>excludeEnd("ctx");
  12985. var $2,$1,$3,$6,$5,$4;
  12986. $2=$recv($Point())._x_y_((3),(4));
  12987. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12988. $ctx1.sendIdx["x:y:"]=1;
  12989. //>>excludeEnd("ctx");
  12990. $1=$recv($2)._x();
  12991. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12992. $ctx1.sendIdx["x"]=1;
  12993. //>>excludeEnd("ctx");
  12994. self._assert_equals_($1,(3));
  12995. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  12996. $ctx1.sendIdx["assert:equals:"]=1;
  12997. //>>excludeEnd("ctx");
  12998. $3=$recv($recv($Point())._x_y_((3),(4)))._y();
  12999. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13000. $ctx1.sendIdx["y"]=1;
  13001. //>>excludeEnd("ctx");
  13002. self._assert_equals_($3,(4));
  13003. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13004. $ctx1.sendIdx["assert:equals:"]=2;
  13005. //>>excludeEnd("ctx");
  13006. $6=$recv($Point())._new();
  13007. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13008. $ctx1.sendIdx["new"]=1;
  13009. //>>excludeEnd("ctx");
  13010. $5=$recv($6)._x_((3));
  13011. $4=$recv($5)._x();
  13012. self._assert_equals_($4,(3));
  13013. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13014. $ctx1.sendIdx["assert:equals:"]=3;
  13015. //>>excludeEnd("ctx");
  13016. self._assert_equals_($recv($recv($recv($Point())._new())._y_((4)))._y(),(4));
  13017. return self;
  13018. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13019. }, function($ctx1) {$ctx1.fill(self,"testAccessing",{},$globals.PointTest)});
  13020. //>>excludeEnd("ctx");
  13021. },
  13022. //>>excludeStart("ide", pragmas.excludeIdeData);
  13023. args: [],
  13024. 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",
  13025. referencedClasses: ["Point"],
  13026. //>>excludeEnd("ide");
  13027. messageSends: ["assert:equals:", "x", "x:y:", "y", "x:", "new", "y:"]
  13028. }),
  13029. $globals.PointTest);
  13030. $core.addMethod(
  13031. $core.method({
  13032. selector: "testArithmetic",
  13033. protocol: 'tests',
  13034. fn: function (){
  13035. var self=this;
  13036. function $Point(){return $globals.Point||(typeof Point=="undefined"?nil:Point)}
  13037. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13038. return $core.withContext(function($ctx1) {
  13039. //>>excludeEnd("ctx");
  13040. var $2,$3,$1,$4,$6,$7,$5,$8,$10,$11,$9,$12,$14,$13;
  13041. $2=(3).__at((4));
  13042. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13043. $ctx1.sendIdx["@"]=1;
  13044. //>>excludeEnd("ctx");
  13045. $3=(3).__at((4));
  13046. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13047. $ctx1.sendIdx["@"]=2;
  13048. //>>excludeEnd("ctx");
  13049. $1=$recv($2).__star($3);
  13050. $4=$recv($Point())._x_y_((9),(16));
  13051. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13052. $ctx1.sendIdx["x:y:"]=1;
  13053. //>>excludeEnd("ctx");
  13054. self._assert_equals_($1,$4);
  13055. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13056. $ctx1.sendIdx["assert:equals:"]=1;
  13057. //>>excludeEnd("ctx");
  13058. $6=(3).__at((4));
  13059. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13060. $ctx1.sendIdx["@"]=3;
  13061. //>>excludeEnd("ctx");
  13062. $7=(3).__at((4));
  13063. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13064. $ctx1.sendIdx["@"]=4;
  13065. //>>excludeEnd("ctx");
  13066. $5=$recv($6).__plus($7);
  13067. $8=$recv($Point())._x_y_((6),(8));
  13068. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13069. $ctx1.sendIdx["x:y:"]=2;
  13070. //>>excludeEnd("ctx");
  13071. self._assert_equals_($5,$8);
  13072. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13073. $ctx1.sendIdx["assert:equals:"]=2;
  13074. //>>excludeEnd("ctx");
  13075. $10=(3).__at((4));
  13076. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13077. $ctx1.sendIdx["@"]=5;
  13078. //>>excludeEnd("ctx");
  13079. $11=(3).__at((4));
  13080. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13081. $ctx1.sendIdx["@"]=6;
  13082. //>>excludeEnd("ctx");
  13083. $9=$recv($10).__minus($11);
  13084. $12=$recv($Point())._x_y_((0),(0));
  13085. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13086. $ctx1.sendIdx["x:y:"]=3;
  13087. //>>excludeEnd("ctx");
  13088. self._assert_equals_($9,$12);
  13089. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13090. $ctx1.sendIdx["assert:equals:"]=3;
  13091. //>>excludeEnd("ctx");
  13092. $14=(6).__at((8));
  13093. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13094. $ctx1.sendIdx["@"]=7;
  13095. //>>excludeEnd("ctx");
  13096. $13=$recv($14).__slash((3).__at((4)));
  13097. self._assert_equals_($13,$recv($Point())._x_y_((2),(2)));
  13098. return self;
  13099. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13100. }, function($ctx1) {$ctx1.fill(self,"testArithmetic",{},$globals.PointTest)});
  13101. //>>excludeEnd("ctx");
  13102. },
  13103. //>>excludeStart("ide", pragmas.excludeIdeData);
  13104. args: [],
  13105. 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)",
  13106. referencedClasses: ["Point"],
  13107. //>>excludeEnd("ide");
  13108. messageSends: ["assert:equals:", "*", "@", "x:y:", "+", "-", "/"]
  13109. }),
  13110. $globals.PointTest);
  13111. $core.addMethod(
  13112. $core.method({
  13113. selector: "testAt",
  13114. protocol: 'tests',
  13115. fn: function (){
  13116. var self=this;
  13117. function $Point(){return $globals.Point||(typeof Point=="undefined"?nil:Point)}
  13118. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13119. return $core.withContext(function($ctx1) {
  13120. //>>excludeEnd("ctx");
  13121. self._assert_equals_((3).__at((4)),$recv($Point())._x_y_((3),(4)));
  13122. return self;
  13123. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13124. }, function($ctx1) {$ctx1.fill(self,"testAt",{},$globals.PointTest)});
  13125. //>>excludeEnd("ctx");
  13126. },
  13127. //>>excludeStart("ide", pragmas.excludeIdeData);
  13128. args: [],
  13129. source: "testAt\x0a\x09self assert: 3@4 equals: (Point x: 3 y: 4)",
  13130. referencedClasses: ["Point"],
  13131. //>>excludeEnd("ide");
  13132. messageSends: ["assert:equals:", "@", "x:y:"]
  13133. }),
  13134. $globals.PointTest);
  13135. $core.addMethod(
  13136. $core.method({
  13137. selector: "testComparison",
  13138. protocol: 'tests',
  13139. fn: function (){
  13140. var self=this;
  13141. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13142. return $core.withContext(function($ctx1) {
  13143. //>>excludeEnd("ctx");
  13144. var $2,$3,$1,$5,$6,$4,$8,$9,$7,$11,$12,$10,$14,$15,$13,$17,$18,$16,$20,$21,$19,$23,$22;
  13145. $2=(3).__at((4));
  13146. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13147. $ctx1.sendIdx["@"]=1;
  13148. //>>excludeEnd("ctx");
  13149. $3=(4).__at((5));
  13150. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13151. $ctx1.sendIdx["@"]=2;
  13152. //>>excludeEnd("ctx");
  13153. $1=$recv($2).__lt($3);
  13154. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13155. $ctx1.sendIdx["<"]=1;
  13156. //>>excludeEnd("ctx");
  13157. self._assert_($1);
  13158. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13159. $ctx1.sendIdx["assert:"]=1;
  13160. //>>excludeEnd("ctx");
  13161. $5=(3).__at((4));
  13162. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13163. $ctx1.sendIdx["@"]=3;
  13164. //>>excludeEnd("ctx");
  13165. $6=(4).__at((4));
  13166. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13167. $ctx1.sendIdx["@"]=4;
  13168. //>>excludeEnd("ctx");
  13169. $4=$recv($5).__lt($6);
  13170. self._deny_($4);
  13171. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13172. $ctx1.sendIdx["deny:"]=1;
  13173. //>>excludeEnd("ctx");
  13174. $8=(4).__at((5));
  13175. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13176. $ctx1.sendIdx["@"]=5;
  13177. //>>excludeEnd("ctx");
  13178. $9=(4).__at((5));
  13179. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13180. $ctx1.sendIdx["@"]=6;
  13181. //>>excludeEnd("ctx");
  13182. $7=$recv($8).__lt_eq($9);
  13183. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13184. $ctx1.sendIdx["<="]=1;
  13185. //>>excludeEnd("ctx");
  13186. self._assert_($7);
  13187. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13188. $ctx1.sendIdx["assert:"]=2;
  13189. //>>excludeEnd("ctx");
  13190. $11=(4).__at((5));
  13191. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13192. $ctx1.sendIdx["@"]=7;
  13193. //>>excludeEnd("ctx");
  13194. $12=(3).__at((5));
  13195. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13196. $ctx1.sendIdx["@"]=8;
  13197. //>>excludeEnd("ctx");
  13198. $10=$recv($11).__lt_eq($12);
  13199. self._deny_($10);
  13200. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13201. $ctx1.sendIdx["deny:"]=2;
  13202. //>>excludeEnd("ctx");
  13203. $14=(5).__at((6));
  13204. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13205. $ctx1.sendIdx["@"]=9;
  13206. //>>excludeEnd("ctx");
  13207. $15=(4).__at((5));
  13208. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13209. $ctx1.sendIdx["@"]=10;
  13210. //>>excludeEnd("ctx");
  13211. $13=$recv($14).__gt($15);
  13212. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13213. $ctx1.sendIdx[">"]=1;
  13214. //>>excludeEnd("ctx");
  13215. self._assert_($13);
  13216. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13217. $ctx1.sendIdx["assert:"]=3;
  13218. //>>excludeEnd("ctx");
  13219. $17=(5).__at((6));
  13220. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13221. $ctx1.sendIdx["@"]=11;
  13222. //>>excludeEnd("ctx");
  13223. $18=(6).__at((6));
  13224. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13225. $ctx1.sendIdx["@"]=12;
  13226. //>>excludeEnd("ctx");
  13227. $16=$recv($17).__gt($18);
  13228. self._deny_($16);
  13229. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13230. $ctx1.sendIdx["deny:"]=3;
  13231. //>>excludeEnd("ctx");
  13232. $20=(4).__at((5));
  13233. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13234. $ctx1.sendIdx["@"]=13;
  13235. //>>excludeEnd("ctx");
  13236. $21=(4).__at((5));
  13237. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13238. $ctx1.sendIdx["@"]=14;
  13239. //>>excludeEnd("ctx");
  13240. $19=$recv($20).__gt_eq($21);
  13241. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13242. $ctx1.sendIdx[">="]=1;
  13243. //>>excludeEnd("ctx");
  13244. self._assert_($19);
  13245. $23=(4).__at((5));
  13246. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13247. $ctx1.sendIdx["@"]=15;
  13248. //>>excludeEnd("ctx");
  13249. $22=$recv($23).__gt_eq((5).__at((5)));
  13250. self._deny_($22);
  13251. return self;
  13252. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13253. }, function($ctx1) {$ctx1.fill(self,"testComparison",{},$globals.PointTest)});
  13254. //>>excludeEnd("ctx");
  13255. },
  13256. //>>excludeStart("ide", pragmas.excludeIdeData);
  13257. args: [],
  13258. 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)",
  13259. referencedClasses: [],
  13260. //>>excludeEnd("ide");
  13261. messageSends: ["assert:", "<", "@", "deny:", "<=", ">", ">="]
  13262. }),
  13263. $globals.PointTest);
  13264. $core.addMethod(
  13265. $core.method({
  13266. selector: "testEgality",
  13267. protocol: 'tests',
  13268. fn: function (){
  13269. var self=this;
  13270. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13271. return $core.withContext(function($ctx1) {
  13272. //>>excludeEnd("ctx");
  13273. var $2,$3,$1,$5,$4;
  13274. $2=(3).__at((4));
  13275. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13276. $ctx1.sendIdx["@"]=1;
  13277. //>>excludeEnd("ctx");
  13278. $3=(3).__at((4));
  13279. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13280. $ctx1.sendIdx["@"]=2;
  13281. //>>excludeEnd("ctx");
  13282. $1=$recv($2).__eq($3);
  13283. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13284. $ctx1.sendIdx["="]=1;
  13285. //>>excludeEnd("ctx");
  13286. self._assert_($1);
  13287. $5=(3).__at((5));
  13288. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13289. $ctx1.sendIdx["@"]=3;
  13290. //>>excludeEnd("ctx");
  13291. $4=$recv($5).__eq((3).__at((6)));
  13292. self._deny_($4);
  13293. return self;
  13294. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13295. }, function($ctx1) {$ctx1.fill(self,"testEgality",{},$globals.PointTest)});
  13296. //>>excludeEnd("ctx");
  13297. },
  13298. //>>excludeStart("ide", pragmas.excludeIdeData);
  13299. args: [],
  13300. source: "testEgality\x0a\x09self assert: (3@4 = (3@4)).\x0a\x09self deny: 3@5 = (3@6)",
  13301. referencedClasses: [],
  13302. //>>excludeEnd("ide");
  13303. messageSends: ["assert:", "=", "@", "deny:"]
  13304. }),
  13305. $globals.PointTest);
  13306. $core.addMethod(
  13307. $core.method({
  13308. selector: "testNew",
  13309. protocol: 'tests',
  13310. fn: function (){
  13311. var self=this;
  13312. function $Point(){return $globals.Point||(typeof Point=="undefined"?nil:Point)}
  13313. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13314. return $core.withContext(function($ctx1) {
  13315. //>>excludeEnd("ctx");
  13316. var $3,$2,$1,$7,$6,$5,$4,$10,$9,$8;
  13317. $3=$recv($Point())._new();
  13318. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13319. $ctx1.sendIdx["new"]=1;
  13320. //>>excludeEnd("ctx");
  13321. $2=$recv($3)._x_((3));
  13322. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13323. $ctx1.sendIdx["x:"]=1;
  13324. //>>excludeEnd("ctx");
  13325. $1=$recv($2)._y();
  13326. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13327. $ctx1.sendIdx["y"]=1;
  13328. //>>excludeEnd("ctx");
  13329. self._assert_equals_($1,nil);
  13330. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13331. $ctx1.sendIdx["assert:equals:"]=1;
  13332. //>>excludeEnd("ctx");
  13333. $7=$recv($Point())._new();
  13334. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13335. $ctx1.sendIdx["new"]=2;
  13336. //>>excludeEnd("ctx");
  13337. $6=$recv($7)._x_((3));
  13338. $5=$recv($6)._x();
  13339. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13340. $ctx1.sendIdx["x"]=1;
  13341. //>>excludeEnd("ctx");
  13342. $4=$recv($5).__eq((0));
  13343. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13344. $ctx1.sendIdx["="]=1;
  13345. //>>excludeEnd("ctx");
  13346. self._deny_($4);
  13347. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13348. $ctx1.sendIdx["deny:"]=1;
  13349. //>>excludeEnd("ctx");
  13350. $10=$recv($Point())._new();
  13351. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13352. $ctx1.sendIdx["new"]=3;
  13353. //>>excludeEnd("ctx");
  13354. $9=$recv($10)._y_((4));
  13355. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13356. $ctx1.sendIdx["y:"]=1;
  13357. //>>excludeEnd("ctx");
  13358. $8=$recv($9)._x();
  13359. self._assert_equals_($8,nil);
  13360. self._deny_($recv($recv($recv($recv($Point())._new())._y_((4)))._y()).__eq((0)));
  13361. return self;
  13362. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13363. }, function($ctx1) {$ctx1.fill(self,"testNew",{},$globals.PointTest)});
  13364. //>>excludeEnd("ctx");
  13365. },
  13366. //>>excludeStart("ide", pragmas.excludeIdeData);
  13367. args: [],
  13368. 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",
  13369. referencedClasses: ["Point"],
  13370. //>>excludeEnd("ide");
  13371. messageSends: ["assert:equals:", "y", "x:", "new", "deny:", "=", "x", "y:"]
  13372. }),
  13373. $globals.PointTest);
  13374. $core.addMethod(
  13375. $core.method({
  13376. selector: "testTranslateBy",
  13377. protocol: 'tests',
  13378. fn: function (){
  13379. var self=this;
  13380. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13381. return $core.withContext(function($ctx1) {
  13382. //>>excludeEnd("ctx");
  13383. var $2,$3,$1,$4,$6,$8,$7,$5,$9,$11,$12,$10,$13,$15,$16,$14;
  13384. $2=(3).__at((3));
  13385. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13386. $ctx1.sendIdx["@"]=1;
  13387. //>>excludeEnd("ctx");
  13388. $3=(0).__at((1));
  13389. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13390. $ctx1.sendIdx["@"]=2;
  13391. //>>excludeEnd("ctx");
  13392. $1=$recv($2)._translateBy_($3);
  13393. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13394. $ctx1.sendIdx["translateBy:"]=1;
  13395. //>>excludeEnd("ctx");
  13396. $4=(3).__at((4));
  13397. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13398. $ctx1.sendIdx["@"]=3;
  13399. //>>excludeEnd("ctx");
  13400. self._assert_equals_($1,$4);
  13401. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13402. $ctx1.sendIdx["assert:equals:"]=1;
  13403. //>>excludeEnd("ctx");
  13404. $6=(3).__at((3));
  13405. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13406. $ctx1.sendIdx["@"]=4;
  13407. //>>excludeEnd("ctx");
  13408. $8=(1)._negated();
  13409. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13410. $ctx1.sendIdx["negated"]=1;
  13411. //>>excludeEnd("ctx");
  13412. $7=(0).__at($8);
  13413. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13414. $ctx1.sendIdx["@"]=5;
  13415. //>>excludeEnd("ctx");
  13416. $5=$recv($6)._translateBy_($7);
  13417. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13418. $ctx1.sendIdx["translateBy:"]=2;
  13419. //>>excludeEnd("ctx");
  13420. $9=(3).__at((2));
  13421. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13422. $ctx1.sendIdx["@"]=6;
  13423. //>>excludeEnd("ctx");
  13424. self._assert_equals_($5,$9);
  13425. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13426. $ctx1.sendIdx["assert:equals:"]=2;
  13427. //>>excludeEnd("ctx");
  13428. $11=(3).__at((3));
  13429. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13430. $ctx1.sendIdx["@"]=7;
  13431. //>>excludeEnd("ctx");
  13432. $12=(2).__at((3));
  13433. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13434. $ctx1.sendIdx["@"]=8;
  13435. //>>excludeEnd("ctx");
  13436. $10=$recv($11)._translateBy_($12);
  13437. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13438. $ctx1.sendIdx["translateBy:"]=3;
  13439. //>>excludeEnd("ctx");
  13440. $13=(5).__at((6));
  13441. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13442. $ctx1.sendIdx["@"]=9;
  13443. //>>excludeEnd("ctx");
  13444. self._assert_equals_($10,$13);
  13445. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13446. $ctx1.sendIdx["assert:equals:"]=3;
  13447. //>>excludeEnd("ctx");
  13448. $15=(3).__at((3));
  13449. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13450. $ctx1.sendIdx["@"]=10;
  13451. //>>excludeEnd("ctx");
  13452. $16=$recv((3)._negated()).__at((0));
  13453. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13454. $ctx1.sendIdx["@"]=11;
  13455. //>>excludeEnd("ctx");
  13456. $14=$recv($15)._translateBy_($16);
  13457. self._assert_equals_($14,(0).__at((3)));
  13458. return self;
  13459. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13460. }, function($ctx1) {$ctx1.fill(self,"testTranslateBy",{},$globals.PointTest)});
  13461. //>>excludeEnd("ctx");
  13462. },
  13463. //>>excludeStart("ide", pragmas.excludeIdeData);
  13464. args: [],
  13465. 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.",
  13466. referencedClasses: [],
  13467. //>>excludeEnd("ide");
  13468. messageSends: ["assert:equals:", "translateBy:", "@", "negated"]
  13469. }),
  13470. $globals.PointTest);
  13471. $core.addClass('QueueTest', $globals.TestCase, [], 'Kernel-Tests');
  13472. $core.addMethod(
  13473. $core.method({
  13474. selector: "testNextIfAbsent",
  13475. protocol: 'tests',
  13476. fn: function (){
  13477. var self=this;
  13478. var queue;
  13479. function $Queue(){return $globals.Queue||(typeof Queue=="undefined"?nil:Queue)}
  13480. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13481. return $core.withContext(function($ctx1) {
  13482. //>>excludeEnd("ctx");
  13483. var $2,$1;
  13484. queue=$recv($Queue())._new();
  13485. $recv(queue)._nextPut_("index1");
  13486. $2=$recv(queue)._nextIfAbsent_("empty");
  13487. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13488. $ctx1.sendIdx["nextIfAbsent:"]=1;
  13489. //>>excludeEnd("ctx");
  13490. $1=$recv($2).__eq("index1");
  13491. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13492. $ctx1.sendIdx["="]=1;
  13493. //>>excludeEnd("ctx");
  13494. self._assert_($1);
  13495. self._deny_($recv($recv(queue)._nextIfAbsent_("empty")).__eq("index1"));
  13496. return self;
  13497. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13498. }, function($ctx1) {$ctx1.fill(self,"testNextIfAbsent",{queue:queue},$globals.QueueTest)});
  13499. //>>excludeEnd("ctx");
  13500. },
  13501. //>>excludeStart("ide", pragmas.excludeIdeData);
  13502. args: [],
  13503. 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'",
  13504. referencedClasses: ["Queue"],
  13505. //>>excludeEnd("ide");
  13506. messageSends: ["new", "nextPut:", "assert:", "=", "nextIfAbsent:", "deny:"]
  13507. }),
  13508. $globals.QueueTest);
  13509. $core.addMethod(
  13510. $core.method({
  13511. selector: "testQueueNext",
  13512. protocol: 'tests',
  13513. fn: function (){
  13514. var self=this;
  13515. var queue;
  13516. function $Queue(){return $globals.Queue||(typeof Queue=="undefined"?nil:Queue)}
  13517. function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
  13518. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13519. return $core.withContext(function($ctx1) {
  13520. //>>excludeEnd("ctx");
  13521. var $1,$2,$4,$3,$6,$5;
  13522. queue=$recv($Queue())._new();
  13523. $1=queue;
  13524. $recv($1)._nextPut_("index1");
  13525. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13526. $ctx1.sendIdx["nextPut:"]=1;
  13527. //>>excludeEnd("ctx");
  13528. $2=$recv($1)._nextPut_("index2");
  13529. $4=$recv(queue)._next();
  13530. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13531. $ctx1.sendIdx["next"]=1;
  13532. //>>excludeEnd("ctx");
  13533. $3=$recv($4).__eq("index1");
  13534. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13535. $ctx1.sendIdx["="]=1;
  13536. //>>excludeEnd("ctx");
  13537. self._assert_($3);
  13538. $6=$recv(queue)._next();
  13539. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13540. $ctx1.sendIdx["next"]=2;
  13541. //>>excludeEnd("ctx");
  13542. $5=$recv($6).__eq("index");
  13543. self._deny_($5);
  13544. self._should_raise_((function(){
  13545. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13546. return $core.withContext(function($ctx2) {
  13547. //>>excludeEnd("ctx");
  13548. return $recv(queue)._next();
  13549. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13550. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  13551. //>>excludeEnd("ctx");
  13552. }),$Error());
  13553. return self;
  13554. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13555. }, function($ctx1) {$ctx1.fill(self,"testQueueNext",{queue:queue},$globals.QueueTest)});
  13556. //>>excludeEnd("ctx");
  13557. },
  13558. //>>excludeStart("ide", pragmas.excludeIdeData);
  13559. args: [],
  13560. 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",
  13561. referencedClasses: ["Queue", "Error"],
  13562. //>>excludeEnd("ide");
  13563. messageSends: ["new", "nextPut:", "assert:", "=", "next", "deny:", "should:raise:"]
  13564. }),
  13565. $globals.QueueTest);
  13566. $core.addClass('RandomTest', $globals.TestCase, [], 'Kernel-Tests');
  13567. $core.addMethod(
  13568. $core.method({
  13569. selector: "testAtRandomNumber",
  13570. protocol: 'tests',
  13571. fn: function (){
  13572. var self=this;
  13573. var val;
  13574. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13575. return $core.withContext(function($ctx1) {
  13576. //>>excludeEnd("ctx");
  13577. (100)._timesRepeat_((function(){
  13578. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13579. return $core.withContext(function($ctx2) {
  13580. //>>excludeEnd("ctx");
  13581. val=(10)._atRandom();
  13582. val;
  13583. self._assert_($recv(val).__gt((0)));
  13584. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13585. $ctx2.sendIdx["assert:"]=1;
  13586. //>>excludeEnd("ctx");
  13587. return self._assert_($recv(val).__lt((11)));
  13588. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13589. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  13590. //>>excludeEnd("ctx");
  13591. }));
  13592. return self;
  13593. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13594. }, function($ctx1) {$ctx1.fill(self,"testAtRandomNumber",{val:val},$globals.RandomTest)});
  13595. //>>excludeEnd("ctx");
  13596. },
  13597. //>>excludeStart("ide", pragmas.excludeIdeData);
  13598. args: [],
  13599. 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]",
  13600. referencedClasses: [],
  13601. //>>excludeEnd("ide");
  13602. messageSends: ["timesRepeat:", "atRandom", "assert:", ">", "<"]
  13603. }),
  13604. $globals.RandomTest);
  13605. $core.addMethod(
  13606. $core.method({
  13607. selector: "testAtRandomSequenceableCollection",
  13608. protocol: 'tests',
  13609. fn: function (){
  13610. var self=this;
  13611. var val;
  13612. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13613. return $core.withContext(function($ctx1) {
  13614. //>>excludeEnd("ctx");
  13615. var $3,$4,$2,$1;
  13616. (100)._timesRepeat_((function(){
  13617. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13618. return $core.withContext(function($ctx2) {
  13619. //>>excludeEnd("ctx");
  13620. val="abc"._atRandom();
  13621. val;
  13622. $3=$recv(val).__eq("a");
  13623. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13624. $ctx2.sendIdx["="]=1;
  13625. //>>excludeEnd("ctx");
  13626. $4=$recv(val).__eq("b");
  13627. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13628. $ctx2.sendIdx["="]=2;
  13629. //>>excludeEnd("ctx");
  13630. $2=$recv($3).__or($4);
  13631. $1=$recv($2).__or($recv(val).__eq("c"));
  13632. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13633. $ctx2.sendIdx["|"]=1;
  13634. //>>excludeEnd("ctx");
  13635. return self._assert_($1);
  13636. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13637. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  13638. //>>excludeEnd("ctx");
  13639. }));
  13640. return self;
  13641. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13642. }, function($ctx1) {$ctx1.fill(self,"testAtRandomSequenceableCollection",{val:val},$globals.RandomTest)});
  13643. //>>excludeEnd("ctx");
  13644. },
  13645. //>>excludeStart("ide", pragmas.excludeIdeData);
  13646. args: [],
  13647. 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].",
  13648. referencedClasses: [],
  13649. //>>excludeEnd("ide");
  13650. messageSends: ["timesRepeat:", "atRandom", "assert:", "|", "="]
  13651. }),
  13652. $globals.RandomTest);
  13653. $core.addMethod(
  13654. $core.method({
  13655. selector: "textNext",
  13656. protocol: 'tests',
  13657. fn: function (){
  13658. var self=this;
  13659. function $Random(){return $globals.Random||(typeof Random=="undefined"?nil:Random)}
  13660. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13661. return $core.withContext(function($ctx1) {
  13662. //>>excludeEnd("ctx");
  13663. var $1;
  13664. (10000)._timesRepeat_((function(){
  13665. var current,next;
  13666. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13667. return $core.withContext(function($ctx2) {
  13668. //>>excludeEnd("ctx");
  13669. next=$recv($recv($Random())._new())._next();
  13670. next;
  13671. self._assert_($recv(next).__gt_eq((0)));
  13672. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13673. $ctx2.sendIdx["assert:"]=1;
  13674. //>>excludeEnd("ctx");
  13675. self._assert_($recv(next).__lt((1)));
  13676. $1=$recv(current).__eq(next);
  13677. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13678. $ctx2.sendIdx["="]=1;
  13679. //>>excludeEnd("ctx");
  13680. self._deny_($1);
  13681. return $recv(next).__eq(current);
  13682. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13683. }, function($ctx2) {$ctx2.fillBlock({current:current,next:next},$ctx1,1)});
  13684. //>>excludeEnd("ctx");
  13685. }));
  13686. return self;
  13687. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13688. }, function($ctx1) {$ctx1.fill(self,"textNext",{},$globals.RandomTest)});
  13689. //>>excludeEnd("ctx");
  13690. },
  13691. //>>excludeStart("ide", pragmas.excludeIdeData);
  13692. args: [],
  13693. 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 ]",
  13694. referencedClasses: ["Random"],
  13695. //>>excludeEnd("ide");
  13696. messageSends: ["timesRepeat:", "next", "new", "assert:", ">=", "<", "deny:", "="]
  13697. }),
  13698. $globals.RandomTest);
  13699. $core.addClass('StreamTest', $globals.TestCase, [], 'Kernel-Tests');
  13700. $core.addMethod(
  13701. $core.method({
  13702. selector: "collectionClass",
  13703. protocol: 'accessing',
  13704. fn: function (){
  13705. var self=this;
  13706. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13707. return $core.withContext(function($ctx1) {
  13708. //>>excludeEnd("ctx");
  13709. var $1;
  13710. $1=$recv(self._class())._collectionClass();
  13711. return $1;
  13712. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13713. }, function($ctx1) {$ctx1.fill(self,"collectionClass",{},$globals.StreamTest)});
  13714. //>>excludeEnd("ctx");
  13715. },
  13716. //>>excludeStart("ide", pragmas.excludeIdeData);
  13717. args: [],
  13718. source: "collectionClass\x0a\x09^ self class collectionClass",
  13719. referencedClasses: [],
  13720. //>>excludeEnd("ide");
  13721. messageSends: ["collectionClass", "class"]
  13722. }),
  13723. $globals.StreamTest);
  13724. $core.addMethod(
  13725. $core.method({
  13726. selector: "newCollection",
  13727. protocol: 'accessing',
  13728. fn: function (){
  13729. var self=this;
  13730. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13731. return $core.withContext(function($ctx1) {
  13732. //>>excludeEnd("ctx");
  13733. var $1;
  13734. $1=$recv(self._collectionClass())._new();
  13735. return $1;
  13736. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13737. }, function($ctx1) {$ctx1.fill(self,"newCollection",{},$globals.StreamTest)});
  13738. //>>excludeEnd("ctx");
  13739. },
  13740. //>>excludeStart("ide", pragmas.excludeIdeData);
  13741. args: [],
  13742. source: "newCollection\x0a\x09^ self collectionClass new",
  13743. referencedClasses: [],
  13744. //>>excludeEnd("ide");
  13745. messageSends: ["new", "collectionClass"]
  13746. }),
  13747. $globals.StreamTest);
  13748. $core.addMethod(
  13749. $core.method({
  13750. selector: "newStream",
  13751. protocol: 'accessing',
  13752. fn: function (){
  13753. var self=this;
  13754. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13755. return $core.withContext(function($ctx1) {
  13756. //>>excludeEnd("ctx");
  13757. var $1;
  13758. $1=$recv($recv(self._collectionClass())._new())._stream();
  13759. return $1;
  13760. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13761. }, function($ctx1) {$ctx1.fill(self,"newStream",{},$globals.StreamTest)});
  13762. //>>excludeEnd("ctx");
  13763. },
  13764. //>>excludeStart("ide", pragmas.excludeIdeData);
  13765. args: [],
  13766. source: "newStream\x0a\x09^ self collectionClass new stream",
  13767. referencedClasses: [],
  13768. //>>excludeEnd("ide");
  13769. messageSends: ["stream", "new", "collectionClass"]
  13770. }),
  13771. $globals.StreamTest);
  13772. $core.addMethod(
  13773. $core.method({
  13774. selector: "testAtStartAtEnd",
  13775. protocol: 'tests',
  13776. fn: function (){
  13777. var self=this;
  13778. var stream;
  13779. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13780. return $core.withContext(function($ctx1) {
  13781. //>>excludeEnd("ctx");
  13782. var $1,$2,$3,$4;
  13783. stream=self._newStream();
  13784. $1=$recv(stream)._atStart();
  13785. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13786. $ctx1.sendIdx["atStart"]=1;
  13787. //>>excludeEnd("ctx");
  13788. self._assert_($1);
  13789. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13790. $ctx1.sendIdx["assert:"]=1;
  13791. //>>excludeEnd("ctx");
  13792. $2=$recv(stream)._atEnd();
  13793. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13794. $ctx1.sendIdx["atEnd"]=1;
  13795. //>>excludeEnd("ctx");
  13796. self._assert_($2);
  13797. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13798. $ctx1.sendIdx["assert:"]=2;
  13799. //>>excludeEnd("ctx");
  13800. $recv(stream)._nextPutAll_(self._newCollection());
  13801. $3=$recv(stream)._atEnd();
  13802. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13803. $ctx1.sendIdx["atEnd"]=2;
  13804. //>>excludeEnd("ctx");
  13805. self._assert_($3);
  13806. $4=$recv(stream)._atStart();
  13807. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13808. $ctx1.sendIdx["atStart"]=2;
  13809. //>>excludeEnd("ctx");
  13810. self._deny_($4);
  13811. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13812. $ctx1.sendIdx["deny:"]=1;
  13813. //>>excludeEnd("ctx");
  13814. $recv(stream)._position_((1));
  13815. self._deny_($recv(stream)._atEnd());
  13816. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13817. $ctx1.sendIdx["deny:"]=2;
  13818. //>>excludeEnd("ctx");
  13819. self._deny_($recv(stream)._atStart());
  13820. return self;
  13821. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13822. }, function($ctx1) {$ctx1.fill(self,"testAtStartAtEnd",{stream:stream},$globals.StreamTest)});
  13823. //>>excludeEnd("ctx");
  13824. },
  13825. //>>excludeStart("ide", pragmas.excludeIdeData);
  13826. args: [],
  13827. 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",
  13828. referencedClasses: [],
  13829. //>>excludeEnd("ide");
  13830. messageSends: ["newStream", "assert:", "atStart", "atEnd", "nextPutAll:", "newCollection", "deny:", "position:"]
  13831. }),
  13832. $globals.StreamTest);
  13833. $core.addMethod(
  13834. $core.method({
  13835. selector: "testContents",
  13836. protocol: 'tests',
  13837. fn: function (){
  13838. var self=this;
  13839. var stream;
  13840. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13841. return $core.withContext(function($ctx1) {
  13842. //>>excludeEnd("ctx");
  13843. var $1,$2;
  13844. stream=self._newStream();
  13845. $1=stream;
  13846. $2=self._newCollection();
  13847. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13848. $ctx1.sendIdx["newCollection"]=1;
  13849. //>>excludeEnd("ctx");
  13850. $recv($1)._nextPutAll_($2);
  13851. self._assert_equals_($recv(stream)._contents(),self._newCollection());
  13852. return self;
  13853. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13854. }, function($ctx1) {$ctx1.fill(self,"testContents",{stream:stream},$globals.StreamTest)});
  13855. //>>excludeEnd("ctx");
  13856. },
  13857. //>>excludeStart("ide", pragmas.excludeIdeData);
  13858. args: [],
  13859. 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",
  13860. referencedClasses: [],
  13861. //>>excludeEnd("ide");
  13862. messageSends: ["newStream", "nextPutAll:", "newCollection", "assert:equals:", "contents"]
  13863. }),
  13864. $globals.StreamTest);
  13865. $core.addMethod(
  13866. $core.method({
  13867. selector: "testIsEmpty",
  13868. protocol: 'tests',
  13869. fn: function (){
  13870. var self=this;
  13871. var stream;
  13872. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13873. return $core.withContext(function($ctx1) {
  13874. //>>excludeEnd("ctx");
  13875. var $1;
  13876. stream=self._newStream();
  13877. $1=$recv(stream)._isEmpty();
  13878. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13879. $ctx1.sendIdx["isEmpty"]=1;
  13880. //>>excludeEnd("ctx");
  13881. self._assert_($1);
  13882. $recv(stream)._nextPutAll_(self._newCollection());
  13883. self._deny_($recv(stream)._isEmpty());
  13884. return self;
  13885. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13886. }, function($ctx1) {$ctx1.fill(self,"testIsEmpty",{stream:stream},$globals.StreamTest)});
  13887. //>>excludeEnd("ctx");
  13888. },
  13889. //>>excludeStart("ide", pragmas.excludeIdeData);
  13890. args: [],
  13891. 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",
  13892. referencedClasses: [],
  13893. //>>excludeEnd("ide");
  13894. messageSends: ["newStream", "assert:", "isEmpty", "nextPutAll:", "newCollection", "deny:"]
  13895. }),
  13896. $globals.StreamTest);
  13897. $core.addMethod(
  13898. $core.method({
  13899. selector: "testPosition",
  13900. protocol: 'tests',
  13901. fn: function (){
  13902. var self=this;
  13903. var collection,stream;
  13904. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13905. return $core.withContext(function($ctx1) {
  13906. //>>excludeEnd("ctx");
  13907. var $1,$2,$3;
  13908. collection=self._newCollection();
  13909. stream=self._newStream();
  13910. $recv(stream)._nextPutAll_(collection);
  13911. $1=$recv(stream)._position();
  13912. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13913. $ctx1.sendIdx["position"]=1;
  13914. //>>excludeEnd("ctx");
  13915. self._assert_equals_($1,$recv(collection)._size());
  13916. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13917. $ctx1.sendIdx["assert:equals:"]=1;
  13918. //>>excludeEnd("ctx");
  13919. $recv(stream)._position_((0));
  13920. $2=$recv(stream)._position();
  13921. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13922. $ctx1.sendIdx["position"]=2;
  13923. //>>excludeEnd("ctx");
  13924. self._assert_equals_($2,(0));
  13925. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13926. $ctx1.sendIdx["assert:equals:"]=2;
  13927. //>>excludeEnd("ctx");
  13928. $recv(stream)._next();
  13929. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13930. $ctx1.sendIdx["next"]=1;
  13931. //>>excludeEnd("ctx");
  13932. $3=$recv(stream)._position();
  13933. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13934. $ctx1.sendIdx["position"]=3;
  13935. //>>excludeEnd("ctx");
  13936. self._assert_equals_($3,(1));
  13937. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13938. $ctx1.sendIdx["assert:equals:"]=3;
  13939. //>>excludeEnd("ctx");
  13940. $recv(stream)._next();
  13941. self._assert_equals_($recv(stream)._position(),(2));
  13942. return self;
  13943. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13944. }, function($ctx1) {$ctx1.fill(self,"testPosition",{collection:collection,stream:stream},$globals.StreamTest)});
  13945. //>>excludeEnd("ctx");
  13946. },
  13947. //>>excludeStart("ide", pragmas.excludeIdeData);
  13948. args: [],
  13949. 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",
  13950. referencedClasses: [],
  13951. //>>excludeEnd("ide");
  13952. messageSends: ["newCollection", "newStream", "nextPutAll:", "assert:equals:", "position", "size", "position:", "next"]
  13953. }),
  13954. $globals.StreamTest);
  13955. $core.addMethod(
  13956. $core.method({
  13957. selector: "testReading",
  13958. protocol: 'tests',
  13959. fn: function (){
  13960. var self=this;
  13961. var stream,collection;
  13962. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13963. return $core.withContext(function($ctx1) {
  13964. //>>excludeEnd("ctx");
  13965. var $1,$2,$3;
  13966. collection=self._newCollection();
  13967. stream=self._newStream();
  13968. $1=stream;
  13969. $recv($1)._nextPutAll_(collection);
  13970. $2=$recv($1)._position_((0));
  13971. $recv(collection)._do_((function(each){
  13972. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13973. return $core.withContext(function($ctx2) {
  13974. //>>excludeEnd("ctx");
  13975. $3=$recv(stream)._next();
  13976. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13977. $ctx2.sendIdx["next"]=1;
  13978. //>>excludeEnd("ctx");
  13979. return self._assert_equals_($3,each);
  13980. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13981. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  13982. //>>excludeEnd("ctx");
  13983. }));
  13984. self._assert_($recv($recv(stream)._next())._isNil());
  13985. return self;
  13986. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  13987. }, function($ctx1) {$ctx1.fill(self,"testReading",{stream:stream,collection:collection},$globals.StreamTest)});
  13988. //>>excludeEnd("ctx");
  13989. },
  13990. //>>excludeStart("ide", pragmas.excludeIdeData);
  13991. args: [],
  13992. 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",
  13993. referencedClasses: [],
  13994. //>>excludeEnd("ide");
  13995. messageSends: ["newCollection", "newStream", "nextPutAll:", "position:", "do:", "assert:equals:", "next", "assert:", "isNil"]
  13996. }),
  13997. $globals.StreamTest);
  13998. $core.addMethod(
  13999. $core.method({
  14000. selector: "testStreamContents",
  14001. protocol: 'tests',
  14002. fn: function (){
  14003. var self=this;
  14004. return self;
  14005. },
  14006. //>>excludeStart("ide", pragmas.excludeIdeData);
  14007. args: [],
  14008. source: "testStreamContents",
  14009. referencedClasses: [],
  14010. //>>excludeEnd("ide");
  14011. messageSends: []
  14012. }),
  14013. $globals.StreamTest);
  14014. $core.addMethod(
  14015. $core.method({
  14016. selector: "testWrite",
  14017. protocol: 'tests',
  14018. fn: function (){
  14019. var self=this;
  14020. var stream,collection;
  14021. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14022. return $core.withContext(function($ctx1) {
  14023. //>>excludeEnd("ctx");
  14024. collection=self._newCollection();
  14025. stream=self._newStream();
  14026. $recv(collection)._do_((function(each){
  14027. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14028. return $core.withContext(function($ctx2) {
  14029. //>>excludeEnd("ctx");
  14030. return $recv(stream).__lt_lt(each);
  14031. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14032. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  14033. //>>excludeEnd("ctx");
  14034. }));
  14035. self._assert_equals_($recv(stream)._contents(),collection);
  14036. return self;
  14037. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14038. }, function($ctx1) {$ctx1.fill(self,"testWrite",{stream:stream,collection:collection},$globals.StreamTest)});
  14039. //>>excludeEnd("ctx");
  14040. },
  14041. //>>excludeStart("ide", pragmas.excludeIdeData);
  14042. args: [],
  14043. 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",
  14044. referencedClasses: [],
  14045. //>>excludeEnd("ide");
  14046. messageSends: ["newCollection", "newStream", "do:", "<<", "assert:equals:", "contents"]
  14047. }),
  14048. $globals.StreamTest);
  14049. $core.addMethod(
  14050. $core.method({
  14051. selector: "testWriting",
  14052. protocol: 'tests',
  14053. fn: function (){
  14054. var self=this;
  14055. var stream,collection;
  14056. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14057. return $core.withContext(function($ctx1) {
  14058. //>>excludeEnd("ctx");
  14059. var $1;
  14060. collection=self._newCollection();
  14061. stream=self._newStream();
  14062. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14063. $ctx1.sendIdx["newStream"]=1;
  14064. //>>excludeEnd("ctx");
  14065. $recv(collection)._do_((function(each){
  14066. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14067. return $core.withContext(function($ctx2) {
  14068. //>>excludeEnd("ctx");
  14069. return $recv(stream)._nextPut_(each);
  14070. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14071. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  14072. //>>excludeEnd("ctx");
  14073. }));
  14074. $1=$recv(stream)._contents();
  14075. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14076. $ctx1.sendIdx["contents"]=1;
  14077. //>>excludeEnd("ctx");
  14078. self._assert_equals_($1,collection);
  14079. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14080. $ctx1.sendIdx["assert:equals:"]=1;
  14081. //>>excludeEnd("ctx");
  14082. stream=self._newStream();
  14083. $recv(stream)._nextPutAll_(collection);
  14084. self._assert_equals_($recv(stream)._contents(),collection);
  14085. return self;
  14086. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14087. }, function($ctx1) {$ctx1.fill(self,"testWriting",{stream:stream,collection:collection},$globals.StreamTest)});
  14088. //>>excludeEnd("ctx");
  14089. },
  14090. //>>excludeStart("ide", pragmas.excludeIdeData);
  14091. args: [],
  14092. 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",
  14093. referencedClasses: [],
  14094. //>>excludeEnd("ide");
  14095. messageSends: ["newCollection", "newStream", "do:", "nextPut:", "assert:equals:", "contents", "nextPutAll:"]
  14096. }),
  14097. $globals.StreamTest);
  14098. $core.addMethod(
  14099. $core.method({
  14100. selector: "collectionClass",
  14101. protocol: 'accessing',
  14102. fn: function (){
  14103. var self=this;
  14104. return nil;
  14105. },
  14106. //>>excludeStart("ide", pragmas.excludeIdeData);
  14107. args: [],
  14108. source: "collectionClass\x0a\x09^ nil",
  14109. referencedClasses: [],
  14110. //>>excludeEnd("ide");
  14111. messageSends: []
  14112. }),
  14113. $globals.StreamTest.klass);
  14114. $core.addMethod(
  14115. $core.method({
  14116. selector: "isAbstract",
  14117. protocol: 'testing',
  14118. fn: function (){
  14119. var self=this;
  14120. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14121. return $core.withContext(function($ctx1) {
  14122. //>>excludeEnd("ctx");
  14123. var $1;
  14124. $1=$recv(self._collectionClass())._isNil();
  14125. return $1;
  14126. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14127. }, function($ctx1) {$ctx1.fill(self,"isAbstract",{},$globals.StreamTest.klass)});
  14128. //>>excludeEnd("ctx");
  14129. },
  14130. //>>excludeStart("ide", pragmas.excludeIdeData);
  14131. args: [],
  14132. source: "isAbstract\x0a\x09^ self collectionClass isNil",
  14133. referencedClasses: [],
  14134. //>>excludeEnd("ide");
  14135. messageSends: ["isNil", "collectionClass"]
  14136. }),
  14137. $globals.StreamTest.klass);
  14138. $core.addClass('ArrayStreamTest', $globals.StreamTest, [], 'Kernel-Tests');
  14139. $core.addMethod(
  14140. $core.method({
  14141. selector: "newCollection",
  14142. protocol: 'accessing',
  14143. fn: function (){
  14144. var self=this;
  14145. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14146. return $core.withContext(function($ctx1) {
  14147. //>>excludeEnd("ctx");
  14148. var $1;
  14149. $1=[true,(1),(3).__at((4)),"foo"];
  14150. return $1;
  14151. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14152. }, function($ctx1) {$ctx1.fill(self,"newCollection",{},$globals.ArrayStreamTest)});
  14153. //>>excludeEnd("ctx");
  14154. },
  14155. //>>excludeStart("ide", pragmas.excludeIdeData);
  14156. args: [],
  14157. source: "newCollection\x0a\x09^ { true. 1. 3@4. 'foo' }",
  14158. referencedClasses: [],
  14159. //>>excludeEnd("ide");
  14160. messageSends: ["@"]
  14161. }),
  14162. $globals.ArrayStreamTest);
  14163. $core.addMethod(
  14164. $core.method({
  14165. selector: "collectionClass",
  14166. protocol: 'accessing',
  14167. fn: function (){
  14168. var self=this;
  14169. function $Array(){return $globals.Array||(typeof Array=="undefined"?nil:Array)}
  14170. return $Array();
  14171. },
  14172. //>>excludeStart("ide", pragmas.excludeIdeData);
  14173. args: [],
  14174. source: "collectionClass\x0a\x09^ Array",
  14175. referencedClasses: ["Array"],
  14176. //>>excludeEnd("ide");
  14177. messageSends: []
  14178. }),
  14179. $globals.ArrayStreamTest.klass);
  14180. $core.addClass('StringStreamTest', $globals.StreamTest, [], 'Kernel-Tests');
  14181. $core.addMethod(
  14182. $core.method({
  14183. selector: "newCollection",
  14184. protocol: 'accessing',
  14185. fn: function (){
  14186. var self=this;
  14187. return "hello world";
  14188. },
  14189. //>>excludeStart("ide", pragmas.excludeIdeData);
  14190. args: [],
  14191. source: "newCollection\x0a\x09^ 'hello world'",
  14192. referencedClasses: [],
  14193. //>>excludeEnd("ide");
  14194. messageSends: []
  14195. }),
  14196. $globals.StringStreamTest);
  14197. $core.addMethod(
  14198. $core.method({
  14199. selector: "collectionClass",
  14200. protocol: 'accessing',
  14201. fn: function (){
  14202. var self=this;
  14203. function $String(){return $globals.String||(typeof String=="undefined"?nil:String)}
  14204. return $String();
  14205. },
  14206. //>>excludeStart("ide", pragmas.excludeIdeData);
  14207. args: [],
  14208. source: "collectionClass\x0a\x09^ String",
  14209. referencedClasses: ["String"],
  14210. //>>excludeEnd("ide");
  14211. messageSends: []
  14212. }),
  14213. $globals.StringStreamTest.klass);
  14214. $core.addClass('UndefinedTest', $globals.TestCase, [], 'Kernel-Tests');
  14215. $core.addMethod(
  14216. $core.method({
  14217. selector: "testCopying",
  14218. protocol: 'tests',
  14219. fn: function (){
  14220. var self=this;
  14221. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14222. return $core.withContext(function($ctx1) {
  14223. //>>excludeEnd("ctx");
  14224. self._assert_equals_(nil._copy(),nil);
  14225. return self;
  14226. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14227. }, function($ctx1) {$ctx1.fill(self,"testCopying",{},$globals.UndefinedTest)});
  14228. //>>excludeEnd("ctx");
  14229. },
  14230. //>>excludeStart("ide", pragmas.excludeIdeData);
  14231. args: [],
  14232. source: "testCopying\x0a\x09self assert: nil copy equals: nil",
  14233. referencedClasses: [],
  14234. //>>excludeEnd("ide");
  14235. messageSends: ["assert:equals:", "copy"]
  14236. }),
  14237. $globals.UndefinedTest);
  14238. $core.addMethod(
  14239. $core.method({
  14240. selector: "testDeepCopy",
  14241. protocol: 'tests',
  14242. fn: function (){
  14243. var self=this;
  14244. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14245. return $core.withContext(function($ctx1) {
  14246. //>>excludeEnd("ctx");
  14247. self._assert_($recv(nil._deepCopy()).__eq(nil));
  14248. return self;
  14249. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14250. }, function($ctx1) {$ctx1.fill(self,"testDeepCopy",{},$globals.UndefinedTest)});
  14251. //>>excludeEnd("ctx");
  14252. },
  14253. //>>excludeStart("ide", pragmas.excludeIdeData);
  14254. args: [],
  14255. source: "testDeepCopy\x0a\x09self assert: nil deepCopy = nil",
  14256. referencedClasses: [],
  14257. //>>excludeEnd("ide");
  14258. messageSends: ["assert:", "=", "deepCopy"]
  14259. }),
  14260. $globals.UndefinedTest);
  14261. $core.addMethod(
  14262. $core.method({
  14263. selector: "testIfNil",
  14264. protocol: 'tests',
  14265. fn: function (){
  14266. var self=this;
  14267. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14268. return $core.withContext(function($ctx1) {
  14269. //>>excludeEnd("ctx");
  14270. var $1,$3,$2,$4,$6,$5,$receiver;
  14271. if(($receiver = nil) == null || $receiver.isNil){
  14272. $1=true;
  14273. } else {
  14274. $1=nil;
  14275. };
  14276. self._assert_equals_($1,true);
  14277. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14278. $ctx1.sendIdx["assert:equals:"]=1;
  14279. //>>excludeEnd("ctx");
  14280. if(($receiver = nil) == null || $receiver.isNil){
  14281. $3=nil;
  14282. } else {
  14283. $3=true;
  14284. };
  14285. $2=$recv($3).__eq(true);
  14286. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14287. $ctx1.sendIdx["="]=1;
  14288. //>>excludeEnd("ctx");
  14289. self._deny_($2);
  14290. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14291. $ctx1.sendIdx["deny:"]=1;
  14292. //>>excludeEnd("ctx");
  14293. if(($receiver = nil) == null || $receiver.isNil){
  14294. $4=true;
  14295. } else {
  14296. $4=false;
  14297. };
  14298. self._assert_equals_($4,true);
  14299. if(($receiver = nil) == null || $receiver.isNil){
  14300. $6=false;
  14301. } else {
  14302. $6=true;
  14303. };
  14304. $5=$recv($6).__eq(true);
  14305. self._deny_($5);
  14306. return self;
  14307. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14308. }, function($ctx1) {$ctx1.fill(self,"testIfNil",{},$globals.UndefinedTest)});
  14309. //>>excludeEnd("ctx");
  14310. },
  14311. //>>excludeStart("ide", pragmas.excludeIdeData);
  14312. args: [],
  14313. 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",
  14314. referencedClasses: [],
  14315. //>>excludeEnd("ide");
  14316. messageSends: ["assert:equals:", "ifNil:", "deny:", "=", "ifNotNil:", "ifNil:ifNotNil:", "ifNotNil:ifNil:"]
  14317. }),
  14318. $globals.UndefinedTest);
  14319. $core.addMethod(
  14320. $core.method({
  14321. selector: "testIsNil",
  14322. protocol: 'tests',
  14323. fn: function (){
  14324. var self=this;
  14325. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14326. return $core.withContext(function($ctx1) {
  14327. //>>excludeEnd("ctx");
  14328. self._assert_(nil._isNil());
  14329. self._deny_(nil._notNil());
  14330. return self;
  14331. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14332. }, function($ctx1) {$ctx1.fill(self,"testIsNil",{},$globals.UndefinedTest)});
  14333. //>>excludeEnd("ctx");
  14334. },
  14335. //>>excludeStart("ide", pragmas.excludeIdeData);
  14336. args: [],
  14337. source: "testIsNil\x0a\x09self assert: nil isNil.\x0a\x09self deny: nil notNil.",
  14338. referencedClasses: [],
  14339. //>>excludeEnd("ide");
  14340. messageSends: ["assert:", "isNil", "deny:", "notNil"]
  14341. }),
  14342. $globals.UndefinedTest);
  14343. });