1
0

Kernel-Tests.js 141 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649
  1. smalltalk.addPackage('Kernel-Tests', {});
  2. smalltalk.addClass('BlockClosureTest', smalltalk.TestCase, [], 'Kernel-Tests');
  3. smalltalk.addMethod(
  4. "_testCanClearInterval",
  5. smalltalk.method({
  6. selector: "testCanClearInterval",
  7. category: 'tests',
  8. fn: function (){
  9. var self=this;
  10. smalltalk.send(self,"_shouldnt_raise_",[(function(){
  11. return smalltalk.send(smalltalk.send((function(){
  12. return smalltalk.send(smalltalk.send((smalltalk.Error || Error),"_new",[]),"_signal",[]);
  13. }),"_valueWithInterval_",[(0)]),"_clearInterval",[]);
  14. }),(smalltalk.Error || Error)]);
  15. return self},
  16. args: [],
  17. source: "testCanClearInterval\x0a\x09self shouldnt: [([Error new signal] valueWithInterval: 0) clearInterval] raise: Error",
  18. messageSends: ["shouldnt:raise:", "clearInterval", "valueWithInterval:", "signal", "new"],
  19. referencedClasses: ["Error"]
  20. }),
  21. smalltalk.BlockClosureTest);
  22. smalltalk.addMethod(
  23. "_testCanClearTimeout",
  24. smalltalk.method({
  25. selector: "testCanClearTimeout",
  26. category: 'tests',
  27. fn: function (){
  28. var self=this;
  29. smalltalk.send(self,"_shouldnt_raise_",[(function(){
  30. return smalltalk.send(smalltalk.send((function(){
  31. return smalltalk.send(smalltalk.send((smalltalk.Error || Error),"_new",[]),"_signal",[]);
  32. }),"_valueWithTimeout_",[(0)]),"_clearTimeout",[]);
  33. }),(smalltalk.Error || Error)]);
  34. return self},
  35. args: [],
  36. source: "testCanClearTimeout\x0a\x09self shouldnt: [([Error new signal] valueWithTimeout: 0) clearTimeout] raise: Error",
  37. messageSends: ["shouldnt:raise:", "clearTimeout", "valueWithTimeout:", "signal", "new"],
  38. referencedClasses: ["Error"]
  39. }),
  40. smalltalk.BlockClosureTest);
  41. smalltalk.addMethod(
  42. "_testCompiledSource",
  43. smalltalk.method({
  44. selector: "testCompiledSource",
  45. category: 'tests',
  46. fn: function (){
  47. var self=this;
  48. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((function(){
  49. return smalltalk.send((1),"__plus",[(1)]);
  50. }),"_compiledSource",[]),"_includesSubString_",["function"])]);
  51. return self},
  52. args: [],
  53. source: "testCompiledSource\x0a\x09self assert: ([1+1] compiledSource includesSubString: 'function')",
  54. messageSends: ["assert:", "includesSubString:", "compiledSource", "+"],
  55. referencedClasses: []
  56. }),
  57. smalltalk.BlockClosureTest);
  58. smalltalk.addMethod(
  59. "_testEnsure",
  60. smalltalk.method({
  61. selector: "testEnsure",
  62. category: 'tests',
  63. fn: function (){
  64. var self=this;
  65. smalltalk.send(self,"_assert_equals_",[(3),smalltalk.send((function(){
  66. return (3);
  67. }),"_ensure_",[(function(){
  68. return (4);
  69. })])]);
  70. return self},
  71. args: [],
  72. source: "testEnsure\x0a\x09self assert: 3 equals: ([3] ensure: [4])",
  73. messageSends: ["assert:equals:", "ensure:"],
  74. referencedClasses: []
  75. }),
  76. smalltalk.BlockClosureTest);
  77. smalltalk.addMethod(
  78. "_testEnsureRaises",
  79. smalltalk.method({
  80. selector: "testEnsureRaises",
  81. category: 'tests',
  82. fn: function (){
  83. var self=this;
  84. smalltalk.send(self,"_should_raise_",[(function(){
  85. return smalltalk.send((function(){
  86. return smalltalk.send(smalltalk.send((smalltalk.Error || Error),"_new",[]),"_signal",[]);
  87. }),"_ensure_",[(function(){
  88. return true;
  89. })]);
  90. }),(smalltalk.Error || Error)]);
  91. return self},
  92. args: [],
  93. source: "testEnsureRaises\x0a\x09self should: [[Error new signal] ensure: [true]] raise: Error",
  94. messageSends: ["should:raise:", "ensure:", "signal", "new"],
  95. referencedClasses: ["Error"]
  96. }),
  97. smalltalk.BlockClosureTest);
  98. smalltalk.addMethod(
  99. "_testNumArgs",
  100. smalltalk.method({
  101. selector: "testNumArgs",
  102. category: 'tests',
  103. fn: function (){
  104. var self=this;
  105. smalltalk.send(self,"_assert_equals_",[smalltalk.send((function(){
  106. }),"_numArgs",[]),(0)]);
  107. smalltalk.send(self,"_assert_equals_",[smalltalk.send((function(a,b){
  108. }),"_numArgs",[]),(2)]);
  109. return self},
  110. args: [],
  111. source: "testNumArgs\x0a\x09self assert: [] numArgs equals: 0.\x0a\x09self assert: [:a :b | ] numArgs equals: 2",
  112. messageSends: ["assert:equals:", "numArgs"],
  113. referencedClasses: []
  114. }),
  115. smalltalk.BlockClosureTest);
  116. smalltalk.addMethod(
  117. "_testOnDo",
  118. smalltalk.method({
  119. selector: "testOnDo",
  120. category: 'tests',
  121. fn: function (){
  122. var self=this;
  123. smalltalk.send(self,"_assert_",[smalltalk.send((function(){
  124. return smalltalk.send(smalltalk.send((smalltalk.Error || Error),"_new",[]),"_signal",[]);
  125. }),"_on_do_",[(smalltalk.Error || Error),(function(ex){
  126. return true;
  127. })])]);
  128. return self},
  129. args: [],
  130. source: "testOnDo\x0a\x09self assert: ([Error new signal] on: Error do: [:ex | true])",
  131. messageSends: ["assert:", "on:do:", "signal", "new"],
  132. referencedClasses: ["Error"]
  133. }),
  134. smalltalk.BlockClosureTest);
  135. smalltalk.addMethod(
  136. "_testValue",
  137. smalltalk.method({
  138. selector: "testValue",
  139. category: 'tests',
  140. fn: function (){
  141. var self=this;
  142. smalltalk.send(self,"_assert_equals_",[smalltalk.send((function(){
  143. return smalltalk.send((1),"__plus",[(1)]);
  144. }),"_value",[]),(2)]);
  145. smalltalk.send(self,"_assert_equals_",[smalltalk.send((function(x){
  146. return smalltalk.send(x,"__plus",[(1)]);
  147. }),"_value_",[(2)]),(3)]);
  148. smalltalk.send(self,"_assert_equals_",[smalltalk.send((function(x,y){
  149. return smalltalk.send(x,"__star",[y]);
  150. }),"_value_value_",[(2),(4)]),(8)]);
  151. smalltalk.send(self,"_assert_equals_",[smalltalk.send((function(a,b,c){
  152. return (1);
  153. }),"_value",[]),(1)]);
  154. return self},
  155. args: [],
  156. 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",
  157. messageSends: ["assert:equals:", "value", "+", "value:", "value:value:", "*"],
  158. referencedClasses: []
  159. }),
  160. smalltalk.BlockClosureTest);
  161. smalltalk.addMethod(
  162. "_testValueWithPossibleArguments",
  163. smalltalk.method({
  164. selector: "testValueWithPossibleArguments",
  165. category: 'tests',
  166. fn: function (){
  167. var self=this;
  168. smalltalk.send(self,"_assert_equals_",[smalltalk.send((function(){
  169. return (1);
  170. }),"_valueWithPossibleArguments_",[[(3), (4)]]),(1)]);
  171. smalltalk.send(self,"_assert_equals_",[smalltalk.send((function(a){
  172. return smalltalk.send(a,"__plus",[(4)]);
  173. }),"_valueWithPossibleArguments_",[[(3), (4)]]),(7)]);
  174. smalltalk.send(self,"_assert_equals_",[smalltalk.send((function(a,b){
  175. return smalltalk.send(a,"__plus",[b]);
  176. }),"_valueWithPossibleArguments_",[[(3), (4), (5)]]),(7)]);
  177. return self},
  178. args: [],
  179. 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.",
  180. messageSends: ["assert:equals:", "valueWithPossibleArguments:", "+"],
  181. referencedClasses: []
  182. }),
  183. smalltalk.BlockClosureTest);
  184. smalltalk.addMethod(
  185. "_testWhileFalse",
  186. smalltalk.method({
  187. selector: "testWhileFalse",
  188. category: 'tests',
  189. fn: function (){
  190. var self=this;
  191. var i;
  192. i=(0);
  193. smalltalk.send((function(){
  194. return smalltalk.send(i,"__gt",[(5)]);
  195. }),"_whileFalse_",[(function(){
  196. i=smalltalk.send(i,"__plus",[(1)]);
  197. return i;
  198. })]);
  199. smalltalk.send(self,"_assert_equals_",[i,(6)]);
  200. i=(0);
  201. smalltalk.send((function(){
  202. i=smalltalk.send(i,"__plus",[(1)]);
  203. i;
  204. return smalltalk.send(i,"__gt",[(5)]);
  205. }),"_whileFalse",[]);
  206. smalltalk.send(self,"_assert_equals_",[i,(6)]);
  207. return self},
  208. args: [],
  209. 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",
  210. messageSends: ["whileFalse:", "+", ">", "assert:equals:", "whileFalse"],
  211. referencedClasses: []
  212. }),
  213. smalltalk.BlockClosureTest);
  214. smalltalk.addMethod(
  215. "_testWhileTrue",
  216. smalltalk.method({
  217. selector: "testWhileTrue",
  218. category: 'tests',
  219. fn: function (){
  220. var self=this;
  221. var i;
  222. i=(0);
  223. smalltalk.send((function(){
  224. return smalltalk.send(i,"__lt",[(5)]);
  225. }),"_whileTrue_",[(function(){
  226. i=smalltalk.send(i,"__plus",[(1)]);
  227. return i;
  228. })]);
  229. smalltalk.send(self,"_assert_equals_",[i,(5)]);
  230. i=(0);
  231. smalltalk.send((function(){
  232. i=smalltalk.send(i,"__plus",[(1)]);
  233. i;
  234. return smalltalk.send(i,"__lt",[(5)]);
  235. }),"_whileTrue",[]);
  236. smalltalk.send(self,"_assert_equals_",[i,(5)]);
  237. return self},
  238. args: [],
  239. 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",
  240. messageSends: ["whileTrue:", "+", "<", "assert:equals:", "whileTrue"],
  241. referencedClasses: []
  242. }),
  243. smalltalk.BlockClosureTest);
  244. smalltalk.addClass('BooleanTest', smalltalk.TestCase, [], 'Kernel-Tests');
  245. smalltalk.addMethod(
  246. "_testEquality",
  247. smalltalk.method({
  248. selector: "testEquality",
  249. category: 'tests',
  250. fn: function (){
  251. var self=this;
  252. smalltalk.send(self,"_deny_",[smalltalk.send((0),"__eq",[false])]);
  253. smalltalk.send(self,"_deny_",[smalltalk.send(false,"__eq",[(0)])]);
  254. smalltalk.send(self,"_deny_",[smalltalk.send("","__eq",[false])]);
  255. smalltalk.send(self,"_deny_",[smalltalk.send(false,"__eq",[""])]);
  256. smalltalk.send(self,"_assert_",[smalltalk.send(true,"__eq",[true])]);
  257. smalltalk.send(self,"_deny_",[smalltalk.send(false,"__eq",[true])]);
  258. smalltalk.send(self,"_deny_",[smalltalk.send(true,"__eq",[false])]);
  259. smalltalk.send(self,"_assert_",[smalltalk.send(false,"__eq",[false])]);
  260. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(true,"_yourself",[]),"__eq",[true])]);
  261. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(true,"_yourself",[]),"__eq",[smalltalk.send(true,"_yourself",[])])]);
  262. return self},
  263. args: [],
  264. 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",
  265. messageSends: ["deny:", "=", "assert:", "yourself"],
  266. referencedClasses: []
  267. }),
  268. smalltalk.BooleanTest);
  269. smalltalk.addMethod(
  270. "_testIdentity",
  271. smalltalk.method({
  272. selector: "testIdentity",
  273. category: 'tests',
  274. fn: function (){
  275. var self=this;
  276. smalltalk.send(self,"_deny_",[smalltalk.send((0),"__eq_eq",[false])]);
  277. smalltalk.send(self,"_deny_",[smalltalk.send(false,"__eq_eq",[(0)])]);
  278. smalltalk.send(self,"_deny_",[smalltalk.send("","__eq_eq",[false])]);
  279. smalltalk.send(self,"_deny_",[smalltalk.send(false,"__eq_eq",[""])]);
  280. smalltalk.send(self,"_assert_",[smalltalk.send(true,"__eq_eq",[true])]);
  281. smalltalk.send(self,"_deny_",[smalltalk.send(false,"__eq_eq",[true])]);
  282. smalltalk.send(self,"_deny_",[smalltalk.send(true,"__eq_eq",[false])]);
  283. smalltalk.send(self,"_assert_",[smalltalk.send(false,"__eq_eq",[false])]);
  284. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(true,"_yourself",[]),"__eq_eq",[true])]);
  285. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(true,"_yourself",[]),"__eq_eq",[smalltalk.send(true,"_yourself",[])])]);
  286. return self},
  287. args: [],
  288. 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",
  289. messageSends: ["deny:", "==", "assert:", "yourself"],
  290. referencedClasses: []
  291. }),
  292. smalltalk.BooleanTest);
  293. smalltalk.addMethod(
  294. "_testIfTrueIfFalse",
  295. smalltalk.method({
  296. selector: "testIfTrueIfFalse",
  297. category: 'tests',
  298. fn: function (){
  299. var self=this;
  300. var $1,$2,$3,$4,$5,$6,$7,$8;
  301. if(smalltalk.assert(true)){
  302. $1="alternative block";
  303. };
  304. smalltalk.send(self,"_assert_",[smalltalk.send($1,"__eq",["alternative block"])]);
  305. if(! smalltalk.assert(true)){
  306. $2="alternative block";
  307. };
  308. smalltalk.send(self,"_assert_",[smalltalk.send($2,"__eq",[nil])]);
  309. if(smalltalk.assert(false)){
  310. $3="alternative block";
  311. };
  312. smalltalk.send(self,"_assert_",[smalltalk.send($3,"__eq",[nil])]);
  313. if(! smalltalk.assert(false)){
  314. $4="alternative block";
  315. };
  316. smalltalk.send(self,"_assert_",[smalltalk.send($4,"__eq",["alternative block"])]);
  317. if(smalltalk.assert(false)){
  318. $5="alternative block";
  319. } else {
  320. $5="alternative block2";
  321. };
  322. smalltalk.send(self,"_assert_",[smalltalk.send($5,"__eq",["alternative block2"])]);
  323. if(smalltalk.assert(false)){
  324. $6="alternative block2";
  325. } else {
  326. $6="alternative block";
  327. };
  328. smalltalk.send(self,"_assert_",[smalltalk.send($6,"__eq",["alternative block"])]);
  329. if(smalltalk.assert(true)){
  330. $7="alternative block";
  331. } else {
  332. $7="alternative block2";
  333. };
  334. smalltalk.send(self,"_assert_",[smalltalk.send($7,"__eq",["alternative block"])]);
  335. if(smalltalk.assert(true)){
  336. $8="alternative block2";
  337. } else {
  338. $8="alternative block";
  339. };
  340. smalltalk.send(self,"_assert_",[smalltalk.send($8,"__eq",["alternative block2"])]);
  341. return self},
  342. args: [],
  343. source: "testIfTrueIfFalse\x0a \x0a\x09self assert: (true ifTrue: ['alternative block']) = 'alternative block'.\x0a\x09self assert: (true ifFalse: ['alternative block']) = nil.\x0a\x0a\x09self assert: (false ifTrue: ['alternative block']) = nil.\x0a\x09self assert: (false ifFalse: ['alternative block']) = 'alternative block'.\x0a\x0a\x09self assert: (false ifTrue: ['alternative block'] ifFalse: ['alternative block2']) = 'alternative block2'.\x0a\x09self assert: (false ifFalse: ['alternative block'] ifTrue: ['alternative block2']) = 'alternative block'.\x0a\x0a\x09self assert: (true ifTrue: ['alternative block'] ifFalse: ['alternative block2']) = 'alternative block'.\x0a\x09self assert: (true ifFalse: ['alternative block'] ifTrue: ['alternative block2']) = 'alternative block2'.",
  344. messageSends: ["assert:", "=", "ifTrue:", "ifFalse:", "ifTrue:ifFalse:", "ifFalse:ifTrue:"],
  345. referencedClasses: []
  346. }),
  347. smalltalk.BooleanTest);
  348. smalltalk.addMethod(
  349. "_testIfTrueIfFalseWithBoxing",
  350. smalltalk.method({
  351. selector: "testIfTrueIfFalseWithBoxing",
  352. category: 'tests',
  353. fn: function (){
  354. var self=this;
  355. var $2,$1,$4,$3,$6,$5,$8,$7,$10,$9,$12,$11,$14,$13,$16,$15;
  356. $2=smalltalk.send(true,"_boxed",[]);
  357. if(smalltalk.assert($2)){
  358. $1="alternative block";
  359. };
  360. smalltalk.send(self,"_assert_",[smalltalk.send($1,"__eq",["alternative block"])]);
  361. $4=smalltalk.send(true,"_boxed",[]);
  362. if(! smalltalk.assert($4)){
  363. $3="alternative block";
  364. };
  365. smalltalk.send(self,"_assert_",[smalltalk.send($3,"__eq",[nil])]);
  366. $6=smalltalk.send(false,"_boxed",[]);
  367. if(smalltalk.assert($6)){
  368. $5="alternative block";
  369. };
  370. smalltalk.send(self,"_assert_",[smalltalk.send($5,"__eq",[nil])]);
  371. $8=smalltalk.send(false,"_boxed",[]);
  372. if(! smalltalk.assert($8)){
  373. $7="alternative block";
  374. };
  375. smalltalk.send(self,"_assert_",[smalltalk.send($7,"__eq",["alternative block"])]);
  376. $10=smalltalk.send(false,"_boxed",[]);
  377. if(smalltalk.assert($10)){
  378. $9="alternative block";
  379. } else {
  380. $9="alternative block2";
  381. };
  382. smalltalk.send(self,"_assert_",[smalltalk.send($9,"__eq",["alternative block2"])]);
  383. $12=smalltalk.send(false,"_boxed",[]);
  384. if(smalltalk.assert($12)){
  385. $11="alternative block2";
  386. } else {
  387. $11="alternative block";
  388. };
  389. smalltalk.send(self,"_assert_",[smalltalk.send($11,"__eq",["alternative block"])]);
  390. $14=smalltalk.send(true,"_boxed",[]);
  391. if(smalltalk.assert($14)){
  392. $13="alternative block";
  393. } else {
  394. $13="alternative block2";
  395. };
  396. smalltalk.send(self,"_assert_",[smalltalk.send($13,"__eq",["alternative block"])]);
  397. $16=smalltalk.send(true,"_boxed",[]);
  398. if(smalltalk.assert($16)){
  399. $15="alternative block2";
  400. } else {
  401. $15="alternative block";
  402. };
  403. smalltalk.send(self,"_assert_",[smalltalk.send($15,"__eq",["alternative block2"])]);
  404. return self},
  405. args: [],
  406. source: "testIfTrueIfFalseWithBoxing\x0a \x0a\x09self assert: (true boxed ifTrue: ['alternative block']) = 'alternative block'.\x0a\x09self assert: (true boxed ifFalse: ['alternative block']) = nil.\x0a\x0a\x09self assert: (false boxed ifTrue: ['alternative block']) = nil.\x0a\x09self assert: (false boxed ifFalse: ['alternative block']) = 'alternative block'.\x0a\x0a\x09self assert: (false boxed ifTrue: ['alternative block'] ifFalse: ['alternative block2']) = 'alternative block2'.\x0a\x09self assert: (false boxed ifFalse: ['alternative block'] ifTrue: ['alternative block2']) = 'alternative block'.\x0a\x0a\x09self assert: (true boxed ifTrue: ['alternative block'] ifFalse: ['alternative block2']) = 'alternative block'.\x0a\x09self assert: (true boxed ifFalse: ['alternative block'] ifTrue: ['alternative block2']) = 'alternative block2'.",
  407. messageSends: ["assert:", "=", "ifTrue:", "boxed", "ifFalse:", "ifTrue:ifFalse:", "ifFalse:ifTrue:"],
  408. referencedClasses: []
  409. }),
  410. smalltalk.BooleanTest);
  411. smalltalk.addMethod(
  412. "_testLogic",
  413. smalltalk.method({
  414. selector: "testLogic",
  415. category: 'tests',
  416. fn: function (){
  417. var self=this;
  418. var $1,$2,$3,$4;
  419. smalltalk.send(self,"_assert_",[smalltalk.send(true,"_&",[true])]);
  420. smalltalk.send(self,"_deny_",[smalltalk.send(true,"_&",[false])]);
  421. smalltalk.send(self,"_deny_",[smalltalk.send(false,"_&",[true])]);
  422. $1=smalltalk.send(self,"_deny_",[smalltalk.send(false,"_&",[false])]);
  423. smalltalk.send(self,"_assert_",[smalltalk.send(true,"_|",[true])]);
  424. smalltalk.send(self,"_assert_",[smalltalk.send(true,"_|",[false])]);
  425. smalltalk.send(self,"_assert_",[smalltalk.send(false,"_|",[true])]);
  426. $2=smalltalk.send(self,"_deny_",[smalltalk.send(false,"_|",[false])]);
  427. smalltalk.send(self,"_assert_",[smalltalk.send(true,"_&",[smalltalk.send((1),"__gt",[(0)])])]);
  428. smalltalk.send(self,"_deny_",[smalltalk.send(smalltalk.send((1),"__gt",[(0)]),"_&",[false])]);
  429. $3=smalltalk.send(self,"_deny_",[smalltalk.send(smalltalk.send((1),"__gt",[(0)]),"_&",[smalltalk.send((1),"__gt",[(2)])])]);
  430. smalltalk.send(self,"_assert_",[smalltalk.send(false,"_|",[smalltalk.send((1),"__gt",[(0)])])]);
  431. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((1),"__gt",[(0)]),"_|",[false])]);
  432. $4=smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((1),"__gt",[(0)]),"_|",[smalltalk.send((1),"__gt",[(2)])])]);
  433. return self},
  434. args: [],
  435. source: "testLogic\x0a \x0a\x09\x22Trivial logic table\x22\x0a\x09self assert: (true & true); deny: (true & false); deny: (false & true); deny: (false & false).\x0a\x09self assert: (true | true); assert: (true | false); assert: (false | true); deny: (false | false).\x0a \x22Checking that expressions work fine too\x22\x0a\x09self assert: (true & (1 > 0)); deny: ((1 > 0) & false); deny: ((1 > 0) & (1 > 2)).\x0a self assert: (false | (1 > 0)); assert: ((1 > 0) | false); assert: ((1 > 0) | (1 > 2))",
  436. messageSends: ["assert:", "&", "deny:", "|", ">"],
  437. referencedClasses: []
  438. }),
  439. smalltalk.BooleanTest);
  440. smalltalk.addMethod(
  441. "_testLogicKeywords",
  442. smalltalk.method({
  443. selector: "testLogicKeywords",
  444. category: 'tests',
  445. fn: function (){
  446. var self=this;
  447. var $1,$2,$3,$4;
  448. smalltalk.send(self,"_assert_",[smalltalk.send(true,"_and_",[(function(){
  449. return true;
  450. })])]);
  451. smalltalk.send(self,"_deny_",[smalltalk.send(true,"_and_",[(function(){
  452. return false;
  453. })])]);
  454. smalltalk.send(self,"_deny_",[smalltalk.send(false,"_and_",[(function(){
  455. return true;
  456. })])]);
  457. $1=smalltalk.send(self,"_deny_",[smalltalk.send(false,"_and_",[(function(){
  458. return false;
  459. })])]);
  460. smalltalk.send(self,"_assert_",[smalltalk.send(true,"_or_",[(function(){
  461. return true;
  462. })])]);
  463. smalltalk.send(self,"_assert_",[smalltalk.send(true,"_or_",[(function(){
  464. return false;
  465. })])]);
  466. smalltalk.send(self,"_assert_",[smalltalk.send(false,"_or_",[(function(){
  467. return true;
  468. })])]);
  469. $2=smalltalk.send(self,"_deny_",[smalltalk.send(false,"_or_",[(function(){
  470. return false;
  471. })])]);
  472. smalltalk.send(self,"_assert_",[smalltalk.send(true,"_and_",[(function(){
  473. return smalltalk.send((1),"__gt",[(0)]);
  474. })])]);
  475. smalltalk.send(self,"_deny_",[smalltalk.send(smalltalk.send((1),"__gt",[(0)]),"_and_",[(function(){
  476. return false;
  477. })])]);
  478. $3=smalltalk.send(self,"_deny_",[smalltalk.send(smalltalk.send((1),"__gt",[(0)]),"_and_",[(function(){
  479. return smalltalk.send((1),"__gt",[(2)]);
  480. })])]);
  481. smalltalk.send(self,"_assert_",[smalltalk.send(false,"_or_",[(function(){
  482. return smalltalk.send((1),"__gt",[(0)]);
  483. })])]);
  484. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((1),"__gt",[(0)]),"_or_",[(function(){
  485. return false;
  486. })])]);
  487. $4=smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((1),"__gt",[(0)]),"_or_",[(function(){
  488. return smalltalk.send((1),"__gt",[(2)]);
  489. })])]);
  490. return self},
  491. args: [],
  492. source: "testLogicKeywords\x0a \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 \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 self \x0a\x09\x09assert: (false or: [ 1 > 0 ]); \x0a\x09\x09assert: ((1 > 0) or: [ false ]); \x0a\x09\x09assert: ((1 > 0) or: [ 1 > 2 ])",
  493. messageSends: ["assert:", "and:", "deny:", "or:", ">"],
  494. referencedClasses: []
  495. }),
  496. smalltalk.BooleanTest);
  497. smalltalk.addMethod(
  498. "_testNonBooleanError",
  499. smalltalk.method({
  500. selector: "testNonBooleanError",
  501. category: 'tests',
  502. fn: function (){
  503. var self=this;
  504. var b;
  505. b= '' ;
  506. ;
  507. smalltalk.send(self,"_should_raise_",[(function(){
  508. if(smalltalk.assert(self["@nonBoolean"])){
  509. } else {
  510. };
  511. }),(smalltalk.NonBooleanReceiver || NonBooleanReceiver)]);
  512. return self},
  513. args: [],
  514. source: "testNonBooleanError\x0a\x09|b|\x0a b := < '' >.\x0a self should: [nonBoolean ifTrue: [] ifFalse: []] raise: NonBooleanReceiver",
  515. messageSends: ["should:raise:", "ifTrue:ifFalse:"],
  516. referencedClasses: ["NonBooleanReceiver"]
  517. }),
  518. smalltalk.BooleanTest);
  519. smalltalk.addClass('ClassBuilderTest', smalltalk.TestCase, ['builder', 'theClass'], 'Kernel-Tests');
  520. smalltalk.addMethod(
  521. "_setUp",
  522. smalltalk.method({
  523. selector: "setUp",
  524. category: 'running',
  525. fn: function (){
  526. var self=this;
  527. self["@builder"]=smalltalk.send((smalltalk.ClassBuilder || ClassBuilder),"_new",[]);
  528. return self},
  529. args: [],
  530. source: "setUp\x0a\x09builder := ClassBuilder new",
  531. messageSends: ["new"],
  532. referencedClasses: ["ClassBuilder"]
  533. }),
  534. smalltalk.ClassBuilderTest);
  535. smalltalk.addMethod(
  536. "_tearDown",
  537. smalltalk.method({
  538. selector: "tearDown",
  539. category: 'running',
  540. fn: function (){
  541. var self=this;
  542. if(($receiver = self["@theClass"]) == nil || $receiver == undefined){
  543. self["@theClass"];
  544. } else {
  545. smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk),"_current",[]),"_removeClass_",[self["@theClass"]]);
  546. self["@theClass"]=nil;
  547. self["@theClass"];
  548. };
  549. return self},
  550. args: [],
  551. source: "tearDown\x0a\x09theClass ifNotNil: [Smalltalk current removeClass: theClass. theClass := nil]",
  552. messageSends: ["ifNotNil:", "removeClass:", "current"],
  553. referencedClasses: ["Smalltalk"]
  554. }),
  555. smalltalk.ClassBuilderTest);
  556. smalltalk.addMethod(
  557. "_testClassCopy",
  558. smalltalk.method({
  559. selector: "testClassCopy",
  560. category: 'running',
  561. fn: function (){
  562. var self=this;
  563. self["@theClass"]=smalltalk.send(self["@builder"],"_copyClass_named_",[(smalltalk.ObjectMock || ObjectMock),"ObjectMock2"]);
  564. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(self["@theClass"],"_superclass",[]),"__eq_eq",[smalltalk.send((smalltalk.ObjectMock || ObjectMock),"_superclass",[])])]);
  565. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(self["@theClass"],"_instanceVariableNames",[]),"__eq_eq",[smalltalk.send((smalltalk.ObjectMock || ObjectMock),"_instanceVariableNames",[])])]);
  566. smalltalk.send(self,"_assert_equals_",[smalltalk.send(self["@theClass"],"_name",[]),"ObjectMock2"]);
  567. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(self["@theClass"],"_package",[]),"__eq_eq",[smalltalk.send((smalltalk.ObjectMock || ObjectMock),"_package",[])])]);
  568. smalltalk.send(self,"_assert_equals_",[smalltalk.send(smalltalk.send(self["@theClass"],"_methodDictionary",[]),"_keys",[]),smalltalk.send(smalltalk.send((smalltalk.ObjectMock || ObjectMock),"_methodDictionary",[]),"_keys",[])]);
  569. return self},
  570. args: [],
  571. 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",
  572. messageSends: ["copyClass:named:", "assert:", "==", "superclass", "instanceVariableNames", "assert:equals:", "name", "package", "keys", "methodDictionary"],
  573. referencedClasses: ["ObjectMock"]
  574. }),
  575. smalltalk.ClassBuilderTest);
  576. smalltalk.addMethod(
  577. "_testInstanceVariableNames",
  578. smalltalk.method({
  579. selector: "testInstanceVariableNames",
  580. category: 'running',
  581. fn: function (){
  582. var self=this;
  583. smalltalk.send(self,"_assert_equals_",[smalltalk.send(self["@builder"],"_instanceVariableNamesFor_",[" hello world "]),["hello", "world"]]);
  584. return self},
  585. args: [],
  586. source: "testInstanceVariableNames\x0a\x09self assert: (builder instanceVariableNamesFor: ' hello world ') equals: #('hello' 'world')",
  587. messageSends: ["assert:equals:", "instanceVariableNamesFor:"],
  588. referencedClasses: []
  589. }),
  590. smalltalk.ClassBuilderTest);
  591. smalltalk.addClass('CollectionTest', smalltalk.TestCase, [], 'Kernel-Tests');
  592. smalltalk.addMethod(
  593. "_assertSameContents_as_",
  594. smalltalk.method({
  595. selector: "assertSameContents:as:",
  596. category: 'convenience',
  597. fn: function (aCollection,anotherCollection){
  598. var self=this;
  599. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(aCollection,"_size",[]),"__eq",[smalltalk.send(anotherCollection,"_size",[])])]);
  600. smalltalk.send(aCollection,"_do_",[(function(each){
  601. return smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(aCollection,"_occurrencesOf_",[each]),"__eq",[smalltalk.send(anotherCollection,"_occurrencesOf_",[each])])]);
  602. })]);
  603. return self},
  604. args: ["aCollection", "anotherCollection"],
  605. source: "assertSameContents: aCollection \x09as: anotherCollection\x0a\x09self assert: aCollection size = anotherCollection size.\x0a\x09aCollection do: [ :each |\x0a\x09\x09self assert: (aCollection occurrencesOf: each) = (anotherCollection occurrencesOf: each) ]",
  606. messageSends: ["assert:", "=", "size", "do:", "occurrencesOf:"],
  607. referencedClasses: []
  608. }),
  609. smalltalk.CollectionTest);
  610. smalltalk.addMethod(
  611. "_collection",
  612. smalltalk.method({
  613. selector: "collection",
  614. category: 'accessing',
  615. fn: function (){
  616. var self=this;
  617. var $1;
  618. $1=smalltalk.send(smalltalk.send(self,"_collectionClass",[]),"_withAll_",[smalltalk.send(self,"_defaultValues",[])]);
  619. return $1;
  620. },
  621. args: [],
  622. source: "collection\x0a\x09^ self collectionClass withAll: self defaultValues",
  623. messageSends: ["withAll:", "defaultValues", "collectionClass"],
  624. referencedClasses: []
  625. }),
  626. smalltalk.CollectionTest);
  627. smalltalk.addMethod(
  628. "_collectionClass",
  629. smalltalk.method({
  630. selector: "collectionClass",
  631. category: 'accessing',
  632. fn: function (){
  633. var self=this;
  634. var $1;
  635. $1=smalltalk.send(smalltalk.send(self,"_class",[]),"_collectionClass",[]);
  636. return $1;
  637. },
  638. args: [],
  639. source: "collectionClass\x0a\x09^ self class collectionClass",
  640. messageSends: ["collectionClass", "class"],
  641. referencedClasses: []
  642. }),
  643. smalltalk.CollectionTest);
  644. smalltalk.addMethod(
  645. "_collectionWithDuplicates",
  646. smalltalk.method({
  647. selector: "collectionWithDuplicates",
  648. category: 'accessing',
  649. fn: function (){
  650. var self=this;
  651. var $1;
  652. $1=smalltalk.send(smalltalk.send(self,"_collectionClass",[]),"_withAll_",[["a", "b", "c", (1), (2), (1), "a"]]);
  653. return $1;
  654. },
  655. args: [],
  656. source: "collectionWithDuplicates\x0a\x09^ self collectionClass withAll: #('a' 'b' 'c' 1 2 1 'a')",
  657. messageSends: ["withAll:", "collectionClass"],
  658. referencedClasses: []
  659. }),
  660. smalltalk.CollectionTest);
  661. smalltalk.addMethod(
  662. "_defaultValues",
  663. smalltalk.method({
  664. selector: "defaultValues",
  665. category: 'accessing',
  666. fn: function (){
  667. var self=this;
  668. return [(1), (2), (3), (-4)];
  669. },
  670. args: [],
  671. source: "defaultValues\x0a\x09^ #(1 2 3 -4)",
  672. messageSends: [],
  673. referencedClasses: []
  674. }),
  675. smalltalk.CollectionTest);
  676. smalltalk.addMethod(
  677. "_isCollectionReadOnly",
  678. smalltalk.method({
  679. selector: "isCollectionReadOnly",
  680. category: 'testing',
  681. fn: function (){
  682. var self=this;
  683. return false;
  684. },
  685. args: [],
  686. source: "isCollectionReadOnly\x0a\x09^ false",
  687. messageSends: [],
  688. referencedClasses: []
  689. }),
  690. smalltalk.CollectionTest);
  691. smalltalk.addMethod(
  692. "_testAsArray",
  693. smalltalk.method({
  694. selector: "testAsArray",
  695. category: 'tests',
  696. fn: function (){
  697. var self=this;
  698. smalltalk.send(self,"_assertSameContents_as_",[smalltalk.send(self,"_collection",[]),smalltalk.send(smalltalk.send(self,"_collection",[]),"_asArray",[])]);
  699. return self},
  700. args: [],
  701. source: "testAsArray\x0a\x09self \x0a\x09\x09assertSameContents: self collection \x0a\x09\x09as: self collection asArray",
  702. messageSends: ["assertSameContents:as:", "collection", "asArray"],
  703. referencedClasses: []
  704. }),
  705. smalltalk.CollectionTest);
  706. smalltalk.addMethod(
  707. "_testAsOrderedCollection",
  708. smalltalk.method({
  709. selector: "testAsOrderedCollection",
  710. category: 'tests',
  711. fn: function (){
  712. var self=this;
  713. smalltalk.send(self,"_assertSameContents_as_",[smalltalk.send(self,"_collection",[]),smalltalk.send(smalltalk.send(self,"_collection",[]),"_asOrderedCollection",[])]);
  714. return self},
  715. args: [],
  716. source: "testAsOrderedCollection\x0a\x09self \x0a\x09\x09assertSameContents: self collection \x0a\x09\x09as: self collection asOrderedCollection",
  717. messageSends: ["assertSameContents:as:", "collection", "asOrderedCollection"],
  718. referencedClasses: []
  719. }),
  720. smalltalk.CollectionTest);
  721. smalltalk.addMethod(
  722. "_testAsSet",
  723. smalltalk.method({
  724. selector: "testAsSet",
  725. category: 'tests',
  726. fn: function (){
  727. var self=this;
  728. var c;
  729. var set;
  730. c=smalltalk.send(self,"_collectionWithDuplicates",[]);
  731. set=smalltalk.send(c,"_asSet",[]);
  732. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(set,"_size",[]),"__eq",[(5)])]);
  733. smalltalk.send(c,"_do_",[(function(each){
  734. return smalltalk.send(self,"_assert_",[smalltalk.send(set,"_includes_",[each])]);
  735. })]);
  736. return self},
  737. args: [],
  738. source: "testAsSet\x0a\x09| c set |\x0a\x09c := self collectionWithDuplicates.\x0a\x09set := c asSet.\x0a\x09self assert: set size = 5.\x0a\x09c do: [ :each |\x0a\x09\x09self assert: (set includes: each) ]",
  739. messageSends: ["collectionWithDuplicates", "asSet", "assert:", "=", "size", "do:", "includes:"],
  740. referencedClasses: []
  741. }),
  742. smalltalk.CollectionTest);
  743. smalltalk.addMethod(
  744. "_testCollect",
  745. smalltalk.method({
  746. selector: "testCollect",
  747. category: 'tests',
  748. fn: function (){
  749. var self=this;
  750. var newCollection;
  751. newCollection=[(1), (2), (3), (4)];
  752. smalltalk.send(self,"_assertSameContents_as_",[smalltalk.send(smalltalk.send(self,"_collection",[]),"_collect_",[(function(each){
  753. return smalltalk.send(each,"_abs",[]);
  754. })]),newCollection]);
  755. return self},
  756. args: [],
  757. source: "testCollect\x0a\x09| newCollection |\x0a\x09newCollection := #(1 2 3 4).\x0a\x09self \x0a\x09\x09assertSameContents: (self collection collect: [ :each |\x0a\x09\x09\x09each abs ])\x0a\x09\x09as: newCollection",
  758. messageSends: ["assertSameContents:as:", "collect:", "abs", "collection"],
  759. referencedClasses: []
  760. }),
  761. smalltalk.CollectionTest);
  762. smalltalk.addMethod(
  763. "_testDetect",
  764. smalltalk.method({
  765. selector: "testDetect",
  766. category: 'tests',
  767. fn: function (){
  768. var self=this;
  769. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(smalltalk.send(self,"_collection",[]),"_detect_",[(function(each){
  770. return smalltalk.send(each,"__lt",[(0)]);
  771. })]),"__eq",[(-4)])]);
  772. smalltalk.send(self,"_should_raise_",[(function(){
  773. return smalltalk.send(smalltalk.send(self,"_collection",[]),"_detect_",[(function(each){
  774. return smalltalk.send(each,"__eq",[(6)]);
  775. })]);
  776. }),(smalltalk.Error || Error)]);
  777. return self},
  778. args: [],
  779. source: "testDetect\x0a\x09self assert: (self collection detect: [ :each | each < 0 ]) = -4.\x0a\x09self \x0a\x09\x09should: [ self collection detect: [ :each | each = 6 ] ]\x0a\x09\x09raise: Error",
  780. messageSends: ["assert:", "=", "detect:", "<", "collection", "should:raise:"],
  781. referencedClasses: ["Error"]
  782. }),
  783. smalltalk.CollectionTest);
  784. smalltalk.addMethod(
  785. "_testDo",
  786. smalltalk.method({
  787. selector: "testDo",
  788. category: 'tests',
  789. fn: function (){
  790. var self=this;
  791. var newCollection;
  792. newCollection=smalltalk.send((smalltalk.OrderedCollection || OrderedCollection),"_new",[]);
  793. smalltalk.send(smalltalk.send(self,"_collection",[]),"_do_",[(function(each){
  794. return smalltalk.send(newCollection,"_add_",[each]);
  795. })]);
  796. smalltalk.send(self,"_assertSameContents_as_",[smalltalk.send(self,"_collection",[]),newCollection]);
  797. return self},
  798. args: [],
  799. 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",
  800. messageSends: ["new", "do:", "add:", "collection", "assertSameContents:as:"],
  801. referencedClasses: ["OrderedCollection"]
  802. }),
  803. smalltalk.CollectionTest);
  804. smalltalk.addMethod(
  805. "_testIsEmpty",
  806. smalltalk.method({
  807. selector: "testIsEmpty",
  808. category: 'tests',
  809. fn: function (){
  810. var self=this;
  811. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(smalltalk.send(self,"_collectionClass",[]),"_new",[]),"_isEmpty",[])]);
  812. smalltalk.send(self,"_deny_",[smalltalk.send(smalltalk.send(self,"_collection",[]),"_isEmpty",[])]);
  813. return self},
  814. args: [],
  815. source: "testIsEmpty\x0a\x09self assert: self collectionClass new isEmpty.\x0a\x09self deny: self collection isEmpty",
  816. messageSends: ["assert:", "isEmpty", "new", "collectionClass", "deny:", "collection"],
  817. referencedClasses: []
  818. }),
  819. smalltalk.CollectionTest);
  820. smalltalk.addMethod(
  821. "_testSelect",
  822. smalltalk.method({
  823. selector: "testSelect",
  824. category: 'tests',
  825. fn: function (){
  826. var self=this;
  827. var newCollection;
  828. newCollection=[(2), (-4)];
  829. smalltalk.send(self,"_assertSameContents_as_",[smalltalk.send(smalltalk.send(self,"_collection",[]),"_select_",[(function(each){
  830. return smalltalk.send(each,"_even",[]);
  831. })]),newCollection]);
  832. return self},
  833. args: [],
  834. source: "testSelect\x0a\x09| newCollection |\x0a\x09newCollection := #(2 -4).\x0a\x09self \x0a\x09\x09assertSameContents: (self collection select: [ :each |\x0a\x09\x09\x09each even ])\x0a\x09\x09as: newCollection",
  835. messageSends: ["assertSameContents:as:", "select:", "even", "collection"],
  836. referencedClasses: []
  837. }),
  838. smalltalk.CollectionTest);
  839. smalltalk.addMethod(
  840. "_testSize",
  841. smalltalk.method({
  842. selector: "testSize",
  843. category: 'tests',
  844. fn: function (){
  845. var self=this;
  846. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self,"_collectionClass",[]),"_new",[]),"_size",[]),"__eq",[(0)])]);
  847. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(smalltalk.send(self,"_collection",[]),"_size",[]),"__eq",[(4)])]);
  848. return self},
  849. args: [],
  850. source: "testSize\x0a\x09self assert: self collectionClass new size = 0.\x0a\x09self assert: self collection size = 4",
  851. messageSends: ["assert:", "=", "size", "new", "collectionClass", "collection"],
  852. referencedClasses: []
  853. }),
  854. smalltalk.CollectionTest);
  855. smalltalk.addMethod(
  856. "_collectionClass",
  857. smalltalk.method({
  858. selector: "collectionClass",
  859. category: 'accessing',
  860. fn: function (){
  861. var self=this;
  862. return nil;
  863. },
  864. args: [],
  865. source: "collectionClass\x0a\x09^ nil",
  866. messageSends: [],
  867. referencedClasses: []
  868. }),
  869. smalltalk.CollectionTest.klass);
  870. smalltalk.addMethod(
  871. "_isAbstract",
  872. smalltalk.method({
  873. selector: "isAbstract",
  874. category: 'testing',
  875. fn: function (){
  876. var self=this;
  877. var $1;
  878. $1=smalltalk.send(smalltalk.send(self,"_collectionClass",[]),"_isNil",[]);
  879. return $1;
  880. },
  881. args: [],
  882. source: "isAbstract\x0a\x09^ self collectionClass isNil",
  883. messageSends: ["isNil", "collectionClass"],
  884. referencedClasses: []
  885. }),
  886. smalltalk.CollectionTest.klass);
  887. smalltalk.addClass('HashedCollectionTest', smalltalk.CollectionTest, [], 'Kernel-Tests');
  888. smalltalk.addMethod(
  889. "_collection",
  890. smalltalk.method({
  891. selector: "collection",
  892. category: 'accessing',
  893. fn: function (){
  894. var self=this;
  895. var $1;
  896. $1=smalltalk.HashedCollection._fromPairs_([smalltalk.send("a","__minus_gt",[(1)]),smalltalk.send("b","__minus_gt",[(2)]),smalltalk.send("c","__minus_gt",[(3)]),smalltalk.send("d","__minus_gt",[(-4)])]);
  897. return $1;
  898. },
  899. args: [],
  900. source: "collection\x0a\x09^ #{ 'a' -> 1. 'b' -> 2. 'c' -> 3. 'd' -> -4 }",
  901. messageSends: ["->"],
  902. referencedClasses: []
  903. }),
  904. smalltalk.HashedCollectionTest);
  905. smalltalk.addMethod(
  906. "_collectionWithDuplicates",
  907. smalltalk.method({
  908. selector: "collectionWithDuplicates",
  909. category: 'accessing',
  910. fn: function (){
  911. var self=this;
  912. var $1;
  913. $1=smalltalk.HashedCollection._fromPairs_([smalltalk.send("a","__minus_gt",[(1)]),smalltalk.send("b","__minus_gt",[(2)]),smalltalk.send("c","__minus_gt",[(3)]),smalltalk.send("d","__minus_gt",[(-4)]),smalltalk.send("e","__minus_gt",[(1)]),smalltalk.send("f","__minus_gt",[(2)]),smalltalk.send("g","__minus_gt",[(10)])]);
  914. return $1;
  915. },
  916. args: [],
  917. source: "collectionWithDuplicates\x0a\x09^ #{ 'a' -> 1. 'b' -> 2. 'c' -> 3. 'd' -> -4. 'e' -> 1. 'f' -> 2. 'g' -> 10 }",
  918. messageSends: ["->"],
  919. referencedClasses: []
  920. }),
  921. smalltalk.HashedCollectionTest);
  922. smalltalk.addMethod(
  923. "_collectionClass",
  924. smalltalk.method({
  925. selector: "collectionClass",
  926. category: 'accessing',
  927. fn: function (){
  928. var self=this;
  929. return (smalltalk.HashedCollection || HashedCollection);
  930. },
  931. args: [],
  932. source: "collectionClass\x0a\x09^ HashedCollection",
  933. messageSends: [],
  934. referencedClasses: ["HashedCollection"]
  935. }),
  936. smalltalk.HashedCollectionTest.klass);
  937. smalltalk.addClass('DictionaryTest', smalltalk.HashedCollectionTest, [], 'Kernel-Tests');
  938. smalltalk.addMethod(
  939. "_collection",
  940. smalltalk.method({
  941. selector: "collection",
  942. category: 'accessing',
  943. fn: function (){
  944. var self=this;
  945. var $2,$3,$1;
  946. $2=smalltalk.send((smalltalk.Dictionary || Dictionary),"_new",[]);
  947. smalltalk.send($2,"_at_put_",[(1),(1)]);
  948. smalltalk.send($2,"_at_put_",["a",(2)]);
  949. smalltalk.send($2,"_at_put_",[true,(3)]);
  950. smalltalk.send($2,"_at_put_",[(4),(-4)]);
  951. $3=smalltalk.send($2,"_yourself",[]);
  952. $1=$3;
  953. return $1;
  954. },
  955. args: [],
  956. 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: 4 put: -4;\x0a\x09\x09yourself",
  957. messageSends: ["at:put:", "new", "yourself"],
  958. referencedClasses: ["Dictionary"]
  959. }),
  960. smalltalk.DictionaryTest);
  961. smalltalk.addMethod(
  962. "_collectionWithDuplicates",
  963. smalltalk.method({
  964. selector: "collectionWithDuplicates",
  965. category: 'accessing',
  966. fn: function (){
  967. var self=this;
  968. var $2,$3,$1;
  969. $2=smalltalk.send((smalltalk.Dictionary || Dictionary),"_new",[]);
  970. smalltalk.send($2,"_at_put_",[(1),(1)]);
  971. smalltalk.send($2,"_at_put_",["a",(2)]);
  972. smalltalk.send($2,"_at_put_",[true,(3)]);
  973. smalltalk.send($2,"_at_put_",[(4),(-4)]);
  974. smalltalk.send($2,"_at_put_",["b",(1)]);
  975. smalltalk.send($2,"_at_put_",[(3),(3)]);
  976. smalltalk.send($2,"_at_put_",[false,(12)]);
  977. $3=smalltalk.send($2,"_yourself",[]);
  978. $1=$3;
  979. return $1;
  980. },
  981. args: [],
  982. 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",
  983. messageSends: ["at:put:", "new", "yourself"],
  984. referencedClasses: ["Dictionary"]
  985. }),
  986. smalltalk.DictionaryTest);
  987. smalltalk.addMethod(
  988. "_testAccessing",
  989. smalltalk.method({
  990. selector: "testAccessing",
  991. category: 'tests',
  992. fn: function (){
  993. var self=this;
  994. var d;
  995. d=smalltalk.send((smalltalk.Dictionary || Dictionary),"_new",[]);
  996. smalltalk.send(d,"_at_put_",["hello","world"]);
  997. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(d,"_at_",["hello"]),"__eq",["world"])]);
  998. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(d,"_at_ifAbsent_",["hello",(function(){
  999. return nil;
  1000. })]),"__eq",["world"])]);
  1001. smalltalk.send(self,"_deny_",[smalltalk.send(smalltalk.send(d,"_at_ifAbsent_",["foo",(function(){
  1002. return nil;
  1003. })]),"__eq",["world"])]);
  1004. smalltalk.send(d,"_at_put_",[(1),(2)]);
  1005. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(d,"_at_",[(1)]),"__eq",[(2)])]);
  1006. smalltalk.send(d,"_at_put_",[smalltalk.send((1),"__at",[(3)]),(3)]);
  1007. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(d,"_at_",[smalltalk.send((1),"__at",[(3)])]),"__eq",[(3)])]);
  1008. return self},
  1009. args: [],
  1010. source: "testAccessing\x0a\x09| d |\x0a\x0a\x09d := Dictionary new.\x0a\x0a\x09d at: 'hello' put: 'world'.\x0a\x09self assert: (d at: 'hello') = 'world'.\x0a\x09self assert: (d at: 'hello' ifAbsent: [nil]) = 'world'.\x0a\x09self deny: (d at: 'foo' ifAbsent: [nil]) = 'world'.\x0a\x0a\x09d at: 1 put: 2.\x0a\x09self assert: (d at: 1) = 2.\x0a\x0a\x09d at: 1@3 put: 3.\x0a\x09self assert: (d at: 1@3) = 3",
  1011. messageSends: ["new", "at:put:", "assert:", "=", "at:", "at:ifAbsent:", "deny:", "@"],
  1012. referencedClasses: ["Dictionary"]
  1013. }),
  1014. smalltalk.DictionaryTest);
  1015. smalltalk.addMethod(
  1016. "_testDynamicDictionaries",
  1017. smalltalk.method({
  1018. selector: "testDynamicDictionaries",
  1019. category: 'tests',
  1020. fn: function (){
  1021. var self=this;
  1022. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(smalltalk.HashedCollection._fromPairs_([smalltalk.send("hello","__minus_gt",[(1)])]),"_asDictionary",[]),"__eq",[smalltalk.send((smalltalk.Dictionary || Dictionary),"_with_",[smalltalk.send("hello","__minus_gt",[(1)])])])]);
  1023. return self},
  1024. args: [],
  1025. source: "testDynamicDictionaries\x0a\x09self assert: #{'hello' -> 1} asDictionary = (Dictionary with: 'hello' -> 1)",
  1026. messageSends: ["assert:", "=", "with:", "->", "asDictionary"],
  1027. referencedClasses: ["Dictionary"]
  1028. }),
  1029. smalltalk.DictionaryTest);
  1030. smalltalk.addMethod(
  1031. "_testEquality",
  1032. smalltalk.method({
  1033. selector: "testEquality",
  1034. category: 'tests',
  1035. fn: function (){
  1036. var self=this;
  1037. var $1,$2,$3,$4,$5,$6,$7,$8,$9,$10;
  1038. var d1;
  1039. var d2;
  1040. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((smalltalk.Dictionary || Dictionary),"_new",[]),"__eq",[smalltalk.send((smalltalk.Dictionary || Dictionary),"_new",[])])]);
  1041. $1=smalltalk.send((smalltalk.Dictionary || Dictionary),"_new",[]);
  1042. smalltalk.send($1,"_at_put_",[(1),(2)]);
  1043. $2=smalltalk.send($1,"_yourself",[]);
  1044. d1=$2;
  1045. $3=smalltalk.send((smalltalk.Dictionary || Dictionary),"_new",[]);
  1046. smalltalk.send($3,"_at_put_",[(1),(2)]);
  1047. $4=smalltalk.send($3,"_yourself",[]);
  1048. d2=$4;
  1049. smalltalk.send(self,"_assert_",[smalltalk.send(d1,"__eq",[d2])]);
  1050. $5=smalltalk.send((smalltalk.Dictionary || Dictionary),"_new",[]);
  1051. smalltalk.send($5,"_at_put_",[(1),(3)]);
  1052. $6=smalltalk.send($5,"_yourself",[]);
  1053. d2=$6;
  1054. smalltalk.send(self,"_deny_",[smalltalk.send(d1,"__eq",[d2])]);
  1055. $7=smalltalk.send((smalltalk.Dictionary || Dictionary),"_new",[]);
  1056. smalltalk.send($7,"_at_put_",[(2),(2)]);
  1057. $8=smalltalk.send($7,"_yourself",[]);
  1058. d2=$8;
  1059. smalltalk.send(self,"_deny_",[smalltalk.send(d1,"__eq",[d2])]);
  1060. $9=smalltalk.send((smalltalk.Dictionary || Dictionary),"_new",[]);
  1061. smalltalk.send($9,"_at_put_",[(1),(2)]);
  1062. smalltalk.send($9,"_at_put_",[(3),(4)]);
  1063. $10=smalltalk.send($9,"_yourself",[]);
  1064. d2=$10;
  1065. smalltalk.send(self,"_deny_",[smalltalk.send(d1,"__eq",[d2])]);
  1066. return self},
  1067. args: [],
  1068. source: "testEquality\x0a\x09| d1 d2 |\x0a\x0a\x09self assert: Dictionary new = Dictionary new.\x0a\x09\x09\x0a\x09d1 := Dictionary new at: 1 put: 2; yourself.\x0a\x09d2 := Dictionary new at: 1 put: 2; yourself.\x0a\x09self assert: d1 = d2.\x0a\x0a\x09d2 := Dictionary new at: 1 put: 3; yourself.\x0a\x09self deny: d1 = d2.\x0a\x0a\x09d2 := Dictionary new at: 2 put: 2; yourself.\x0a\x09self deny: d1 = d2.\x0a\x0a\x09d2 := Dictionary new at: 1 put: 2; at: 3 put: 4; yourself.\x0a\x09self deny: d1 = d2.",
  1069. messageSends: ["assert:", "=", "new", "at:put:", "yourself", "deny:"],
  1070. referencedClasses: ["Dictionary"]
  1071. }),
  1072. smalltalk.DictionaryTest);
  1073. smalltalk.addMethod(
  1074. "_testIfAbsent",
  1075. smalltalk.method({
  1076. selector: "testIfAbsent",
  1077. category: 'tests',
  1078. fn: function (){
  1079. var self=this;
  1080. var d;
  1081. var visited;
  1082. visited=false;
  1083. d=smalltalk.send((smalltalk.Dictionary || Dictionary),"_new",[]);
  1084. smalltalk.send(d,"_at_ifAbsent_",["hello",(function(){
  1085. visited=true;
  1086. return visited;
  1087. })]);
  1088. smalltalk.send(self,"_assert_",[visited]);
  1089. return self},
  1090. args: [],
  1091. source: "testIfAbsent\x0a\x0a\x09| d visited |\x0a\x09visited := false.\x0a\x09d := Dictionary new.\x0a\x0a\x09d at: 'hello' ifAbsent: [ visited := true ].\x0a\x09self assert: visited.",
  1092. messageSends: ["new", "at:ifAbsent:", "assert:"],
  1093. referencedClasses: ["Dictionary"]
  1094. }),
  1095. smalltalk.DictionaryTest);
  1096. smalltalk.addMethod(
  1097. "_testIfPresent",
  1098. smalltalk.method({
  1099. selector: "testIfPresent",
  1100. category: 'tests',
  1101. fn: function (){
  1102. var self=this;
  1103. var d;
  1104. var visited;
  1105. var absent;
  1106. visited=false;
  1107. d=smalltalk.send((smalltalk.Dictionary || Dictionary),"_new",[]);
  1108. smalltalk.send(d,"_at_put_",["hello","world"]);
  1109. smalltalk.send(d,"_at_ifPresent_",["hello",(function(value){
  1110. visited=value;
  1111. return visited;
  1112. })]);
  1113. smalltalk.send(self,"_assert_",[smalltalk.send(visited,"__eq",["world"])]);
  1114. absent=smalltalk.send(d,"_at_ifPresent_",["bye",(function(value){
  1115. visited=value;
  1116. return visited;
  1117. })]);
  1118. smalltalk.send(self,"_assert_",[smalltalk.send(absent,"_isNil",[])]);
  1119. return self},
  1120. args: [],
  1121. source: "testIfPresent\x0a\x0a\x09| d visited absent |\x0a\x09visited := false.\x0a\x09d := Dictionary new.\x0a\x09d at: 'hello' put: 'world'.\x0a\x0a\x09d at: 'hello' ifPresent: [ :value | visited := value ].\x0a\x09self assert: visited = 'world'.\x0a\x0a\x09absent := d at: 'bye' ifPresent: [ :value | visited := value ].\x0a\x09self assert: absent isNil.\x0a",
  1122. messageSends: ["new", "at:put:", "at:ifPresent:", "assert:", "=", "isNil"],
  1123. referencedClasses: ["Dictionary"]
  1124. }),
  1125. smalltalk.DictionaryTest);
  1126. smalltalk.addMethod(
  1127. "_testIfPresentIfAbsent",
  1128. smalltalk.method({
  1129. selector: "testIfPresentIfAbsent",
  1130. category: 'tests',
  1131. fn: function (){
  1132. var self=this;
  1133. var d;
  1134. var visited;
  1135. visited=false;
  1136. d=smalltalk.send((smalltalk.Dictionary || Dictionary),"_new",[]);
  1137. smalltalk.send(d,"_at_put_",["hello","world"]);
  1138. smalltalk.send(d,"_at_ifPresent_ifAbsent_",["hello",(function(value){
  1139. visited=value;
  1140. return visited;
  1141. }),(function(){
  1142. visited=true;
  1143. return visited;
  1144. })]);
  1145. smalltalk.send(self,"_assert_",[smalltalk.send(visited,"__eq",["world"])]);
  1146. smalltalk.send(d,"_at_ifPresent_ifAbsent_",["buy",(function(value){
  1147. visited=value;
  1148. return visited;
  1149. }),(function(){
  1150. visited=true;
  1151. return visited;
  1152. })]);
  1153. smalltalk.send(self,"_assert_",[visited]);
  1154. return self},
  1155. args: [],
  1156. source: "testIfPresentIfAbsent\x0a\x0a\x09| d visited |\x0a\x09visited := false.\x0a\x09d := Dictionary new.\x0a\x09d at: 'hello' put: 'world'.\x0a\x0a\x09d at: 'hello' ifPresent: [ :value | visited := value ] ifAbsent: [ visited := true ].\x0a\x09self assert: visited = 'world'.\x0a\x0a\x09d at: 'buy' ifPresent: [ :value | visited := value ] ifAbsent: [ visited := true ].\x0a\x09self assert: visited.",
  1157. messageSends: ["new", "at:put:", "at:ifPresent:ifAbsent:", "assert:", "="],
  1158. referencedClasses: ["Dictionary"]
  1159. }),
  1160. smalltalk.DictionaryTest);
  1161. smalltalk.addMethod(
  1162. "_testKeys",
  1163. smalltalk.method({
  1164. selector: "testKeys",
  1165. category: 'tests',
  1166. fn: function (){
  1167. var self=this;
  1168. var d;
  1169. d=smalltalk.send((smalltalk.Dictionary || Dictionary),"_new",[]);
  1170. smalltalk.send(d,"_at_put_",[(1),(2)]);
  1171. smalltalk.send(d,"_at_put_",[(2),(3)]);
  1172. smalltalk.send(d,"_at_put_",[(3),(4)]);
  1173. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(d,"_keys",[]),"__eq",[[(1), (2), (3)]])]);
  1174. return self},
  1175. args: [],
  1176. source: "testKeys\x0a\x09| d |\x0a\x0a\x09d := Dictionary new.\x0a\x09d at: 1 put: 2.\x0a\x09d at: 2 put: 3.\x0a\x09d at: 3 put: 4.\x0a\x0a\x09self assert: d keys = #(1 2 3)",
  1177. messageSends: ["new", "at:put:", "assert:", "=", "keys"],
  1178. referencedClasses: ["Dictionary"]
  1179. }),
  1180. smalltalk.DictionaryTest);
  1181. smalltalk.addMethod(
  1182. "_testPrintString",
  1183. smalltalk.method({
  1184. selector: "testPrintString",
  1185. category: 'tests',
  1186. fn: function (){
  1187. var self=this;
  1188. var $1,$2;
  1189. $1=smalltalk.send((smalltalk.Dictionary || Dictionary),"_new",[]);
  1190. smalltalk.send($1,"_at_put_",["firstname","James"]);
  1191. smalltalk.send($1,"_at_put_",["lastname","Bond"]);
  1192. $2=smalltalk.send($1,"_printString",[]);
  1193. smalltalk.send(self,"_assert_equals_",["a Dictionary('firstname'->'James' , 'lastname'->'Bond')",$2]);
  1194. return self},
  1195. args: [],
  1196. source: "testPrintString\x0a\x09self\x0a\x09\x09assert: 'a Dictionary(''firstname''->''James'' , ''lastname''->''Bond'')' \x0a\x09\x09equals: (Dictionary new \x0a \x09at:'firstname' put: 'James';\x0a \x09at:'lastname' put: 'Bond';\x0a \x09printString)",
  1197. messageSends: ["assert:equals:", "at:put:", "new", "printString"],
  1198. referencedClasses: ["Dictionary"]
  1199. }),
  1200. smalltalk.DictionaryTest);
  1201. smalltalk.addMethod(
  1202. "_testRemoveKey",
  1203. smalltalk.method({
  1204. selector: "testRemoveKey",
  1205. category: 'tests',
  1206. fn: function (){
  1207. var self=this;
  1208. var d;
  1209. var key;
  1210. d=smalltalk.send((smalltalk.Dictionary || Dictionary),"_new",[]);
  1211. smalltalk.send(d,"_at_put_",[(1),(2)]);
  1212. smalltalk.send(d,"_at_put_",[(2),(3)]);
  1213. smalltalk.send(d,"_at_put_",[(3),(4)]);
  1214. key=(2);
  1215. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(d,"_keys",[]),"__eq",[[(1), (2), (3)]])]);
  1216. smalltalk.send(d,"_removeKey_",[key]);
  1217. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(d,"_keys",[]),"__eq",[[(1), (3)]])]);
  1218. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(d,"_values",[]),"__eq",[[(2), (4)]])]);
  1219. smalltalk.send(self,"_deny_",[smalltalk.send(d,"_includesKey_",[(2)])]);
  1220. return self},
  1221. args: [],
  1222. source: "testRemoveKey\x0a | d key |\x0a\x0a d := Dictionary new.\x0a d at: 1 put: 2.\x0a d at: 2 put: 3.\x0a d at: 3 put: 4.\x0a\x0a key := 2.\x0a\x0a self assert: d keys = #(1 2 3).\x0a\x0a d removeKey: key.\x0a self assert: d keys = #(1 3).\x0a self assert: d values = #(2 4).\x0a self deny: (d includesKey: 2)",
  1223. messageSends: ["new", "at:put:", "assert:", "=", "keys", "removeKey:", "values", "deny:", "includesKey:"],
  1224. referencedClasses: ["Dictionary"]
  1225. }),
  1226. smalltalk.DictionaryTest);
  1227. smalltalk.addMethod(
  1228. "_testRemoveKeyIfAbsent",
  1229. smalltalk.method({
  1230. selector: "testRemoveKeyIfAbsent",
  1231. category: 'tests',
  1232. fn: function (){
  1233. var self=this;
  1234. var d;
  1235. var key;
  1236. d=smalltalk.send((smalltalk.Dictionary || Dictionary),"_new",[]);
  1237. smalltalk.send(d,"_at_put_",[(1),(2)]);
  1238. smalltalk.send(d,"_at_put_",[(2),(3)]);
  1239. smalltalk.send(d,"_at_put_",[(3),(4)]);
  1240. key=(2);
  1241. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(d,"_removeKey_",[key]),"__eq",[(3)])]);
  1242. key=(3);
  1243. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(d,"_removeKey_ifAbsent_",[key,(function(){
  1244. return (42);
  1245. })]),"__eq",[(4)])]);
  1246. key="why";
  1247. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(d,"_removeKey_ifAbsent_",[key,(function(){
  1248. return (42);
  1249. })]),"__eq",[(42)])]);
  1250. return self},
  1251. args: [],
  1252. source: "testRemoveKeyIfAbsent\x0a | d key |\x0a\x0a d := Dictionary new.\x0a d at: 1 put: 2.\x0a d at: 2 put: 3.\x0a d at: 3 put: 4.\x0a\x0a key := 2.\x0a self assert: (d removeKey: key) = 3.\x0a\x0a key := 3.\x0a self assert: (d removeKey: key ifAbsent: [42]) = 4.\x0a\x0a key := 'why'.\x0a self assert: (d removeKey: key ifAbsent: [42] ) = 42.",
  1253. messageSends: ["new", "at:put:", "assert:", "=", "removeKey:", "removeKey:ifAbsent:"],
  1254. referencedClasses: ["Dictionary"]
  1255. }),
  1256. smalltalk.DictionaryTest);
  1257. smalltalk.addMethod(
  1258. "_testSize",
  1259. smalltalk.method({
  1260. selector: "testSize",
  1261. category: 'tests',
  1262. fn: function (){
  1263. var self=this;
  1264. var d;
  1265. d=smalltalk.send((smalltalk.Dictionary || Dictionary),"_new",[]);
  1266. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(d,"_size",[]),"__eq",[(0)])]);
  1267. smalltalk.send(d,"_at_put_",[(1),(2)]);
  1268. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(d,"_size",[]),"__eq",[(1)])]);
  1269. smalltalk.send(d,"_at_put_",[(2),(3)]);
  1270. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(d,"_size",[]),"__eq",[(2)])]);
  1271. return self},
  1272. args: [],
  1273. source: "testSize\x0a\x09| d |\x0a\x0a\x09d := Dictionary new.\x0a\x09self assert: d size = 0.\x0a\x0a\x09d at: 1 put: 2.\x0a\x09self assert: d size = 1.\x0a\x0a\x09d at: 2 put: 3.\x0a\x09self assert: d size = 2.",
  1274. messageSends: ["new", "assert:", "=", "size", "at:put:"],
  1275. referencedClasses: ["Dictionary"]
  1276. }),
  1277. smalltalk.DictionaryTest);
  1278. smalltalk.addMethod(
  1279. "_testValues",
  1280. smalltalk.method({
  1281. selector: "testValues",
  1282. category: 'tests',
  1283. fn: function (){
  1284. var self=this;
  1285. var d;
  1286. d=smalltalk.send((smalltalk.Dictionary || Dictionary),"_new",[]);
  1287. smalltalk.send(d,"_at_put_",[(1),(2)]);
  1288. smalltalk.send(d,"_at_put_",[(2),(3)]);
  1289. smalltalk.send(d,"_at_put_",[(3),(4)]);
  1290. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(d,"_values",[]),"__eq",[[(2), (3), (4)]])]);
  1291. return self},
  1292. args: [],
  1293. source: "testValues\x0a\x09| d |\x0a\x0a\x09d := Dictionary new.\x0a\x09d at: 1 put: 2.\x0a\x09d at: 2 put: 3.\x0a\x09d at: 3 put: 4.\x0a\x0a\x09self assert: d values = #(2 3 4)",
  1294. messageSends: ["new", "at:put:", "assert:", "=", "values"],
  1295. referencedClasses: ["Dictionary"]
  1296. }),
  1297. smalltalk.DictionaryTest);
  1298. smalltalk.addMethod(
  1299. "_collectionClass",
  1300. smalltalk.method({
  1301. selector: "collectionClass",
  1302. category: 'accessing',
  1303. fn: function (){
  1304. var self=this;
  1305. return (smalltalk.Dictionary || Dictionary);
  1306. },
  1307. args: [],
  1308. source: "collectionClass\x0a\x09^ Dictionary",
  1309. messageSends: [],
  1310. referencedClasses: ["Dictionary"]
  1311. }),
  1312. smalltalk.DictionaryTest.klass);
  1313. smalltalk.addClass('SequenceableCollectionTest', smalltalk.CollectionTest, [], 'Kernel-Tests');
  1314. smalltalk.addMethod(
  1315. "_testAt",
  1316. smalltalk.method({
  1317. selector: "testAt",
  1318. category: 'tests',
  1319. fn: function (){
  1320. var self=this;
  1321. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(smalltalk.send(self,"_collection",[]),"_at_",[(4)]),"__eq",[(-4)])]);
  1322. smalltalk.send(self,"_should_raise_",[(function(){
  1323. return smalltalk.send(smalltalk.send(self,"_collection",[]),"_at_",[(5)]);
  1324. }),(smalltalk.Error || Error)]);
  1325. return self},
  1326. args: [],
  1327. source: "testAt\x0a\x09self assert: (self collection at: 4) = -4.\x0a\x09self should: [ self collection at: 5 ] raise: Error",
  1328. messageSends: ["assert:", "=", "at:", "collection", "should:raise:"],
  1329. referencedClasses: ["Error"]
  1330. }),
  1331. smalltalk.SequenceableCollectionTest);
  1332. smalltalk.addMethod(
  1333. "_testAtIfAbsent",
  1334. smalltalk.method({
  1335. selector: "testAtIfAbsent",
  1336. category: 'tests',
  1337. fn: function (){
  1338. var self=this;
  1339. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(smalltalk.send(self,"_collection",[]),"_at_ifAbsent_",[smalltalk.send(smalltalk.send(smalltalk.send(self,"_collection",[]),"_size",[]),"__plus",[(1)]),(function(){
  1340. return "none";
  1341. })]),"__eq",["none"])]);
  1342. return self},
  1343. args: [],
  1344. source: "testAtIfAbsent\x0a\x09self assert: (self collection at: (self collection size + 1) ifAbsent: [ 'none' ]) = 'none'",
  1345. messageSends: ["assert:", "=", "at:ifAbsent:", "+", "size", "collection"],
  1346. referencedClasses: []
  1347. }),
  1348. smalltalk.SequenceableCollectionTest);
  1349. smalltalk.addClass('ArrayTest', smalltalk.SequenceableCollectionTest, [], 'Kernel-Tests');
  1350. smalltalk.addMethod(
  1351. "_testAtIfAbsent",
  1352. smalltalk.method({
  1353. selector: "testAtIfAbsent",
  1354. category: 'testing',
  1355. fn: function (){
  1356. var self=this;
  1357. var array;
  1358. array=["hello", "world"];
  1359. smalltalk.send(self,"_assert_equals_",[smalltalk.send(array,"_at_",[(1)]),"hello"]);
  1360. smalltalk.send(self,"_assert_equals_",[smalltalk.send(array,"_at_",[(2)]),"world"]);
  1361. smalltalk.send(self,"_assert_equals_",[smalltalk.send(array,"_at_ifAbsent_",[(2),(function(){
  1362. return "not found";
  1363. })]),"world"]);
  1364. smalltalk.send(self,"_assert_equals_",[smalltalk.send(array,"_at_ifAbsent_",[(0),(function(){
  1365. return "not found";
  1366. })]),"not found"]);
  1367. smalltalk.send(self,"_assert_equals_",[smalltalk.send(array,"_at_ifAbsent_",[(-10),(function(){
  1368. return "not found";
  1369. })]),"not found"]);
  1370. smalltalk.send(self,"_assert_equals_",[smalltalk.send(array,"_at_ifAbsent_",[(3),(function(){
  1371. return "not found";
  1372. })]),"not found"]);
  1373. return self},
  1374. args: [],
  1375. source: "testAtIfAbsent\x0a\x09| array |\x0a\x09array := #('hello' 'world').\x0a\x09self assert: (array at: 1) equals: 'hello'.\x0a\x09self assert: (array at: 2) equals: 'world'.\x0a\x09self assert: (array at: 2 ifAbsent: ['not found']) equals: 'world'.\x0a\x09self assert: (array at: 0 ifAbsent: ['not found']) equals: 'not found'.\x0a\x09self assert: (array at: -10 ifAbsent: ['not found']) equals: 'not found'.\x0a\x09self assert: (array at: 3 ifAbsent: ['not found']) equals: 'not found'.",
  1376. messageSends: ["assert:equals:", "at:", "at:ifAbsent:"],
  1377. referencedClasses: []
  1378. }),
  1379. smalltalk.ArrayTest);
  1380. smalltalk.addMethod(
  1381. "_testFirstN",
  1382. smalltalk.method({
  1383. selector: "testFirstN",
  1384. category: 'testing',
  1385. fn: function (){
  1386. var self=this;
  1387. smalltalk.send(self,"_assert_equals_",[[(1),(2),(3)],smalltalk.send([(1),(2),(3),(4),(5)],"_first_",[(3)])]);
  1388. return self},
  1389. args: [],
  1390. source: "testFirstN\x0a\x09self assert: {1. 2. 3} equals: ({1. 2. 3. 4. 5} first: 3).",
  1391. messageSends: ["assert:equals:", "first:"],
  1392. referencedClasses: []
  1393. }),
  1394. smalltalk.ArrayTest);
  1395. smalltalk.addMethod(
  1396. "_testIfEmpty",
  1397. smalltalk.method({
  1398. selector: "testIfEmpty",
  1399. category: 'testing',
  1400. fn: function (){
  1401. var self=this;
  1402. smalltalk.send(self,"_assert_equals_",["zork",smalltalk.send("","_ifEmpty_",[(function(){
  1403. return "zork";
  1404. })])]);
  1405. return self},
  1406. args: [],
  1407. source: "testIfEmpty\x0a\x09self assert: 'zork' equals: ( '' ifEmpty: ['zork'] )",
  1408. messageSends: ["assert:equals:", "ifEmpty:"],
  1409. referencedClasses: []
  1410. }),
  1411. smalltalk.ArrayTest);
  1412. smalltalk.addMethod(
  1413. "_testPrintString",
  1414. smalltalk.method({
  1415. selector: "testPrintString",
  1416. category: 'testing',
  1417. fn: function (){
  1418. var self=this;
  1419. var $1,$2;
  1420. var array;
  1421. array=smalltalk.send((smalltalk.Array || Array),"_new",[]);
  1422. smalltalk.send(self,"_assert_equals_",["a Array ()",smalltalk.send(array,"_printString",[])]);
  1423. smalltalk.send(array,"_add_",[(1)]);
  1424. $1=smalltalk.send(array,"_add_",[(3)]);
  1425. smalltalk.send(self,"_assert_equals_",["a Array (1 3)",smalltalk.send(array,"_printString",[])]);
  1426. smalltalk.send(array,"_add_",["foo"]);
  1427. smalltalk.send(self,"_assert_equals_",["a Array (1 3 'foo')",smalltalk.send(array,"_printString",[])]);
  1428. smalltalk.send(array,"_remove_",[(1)]);
  1429. $2=smalltalk.send(array,"_remove_",[(3)]);
  1430. smalltalk.send(self,"_assert_equals_",["a Array ('foo')",smalltalk.send(array,"_printString",[])]);
  1431. smalltalk.send(array,"_addLast_",[(3)]);
  1432. smalltalk.send(self,"_assert_equals_",["a Array ('foo' 3)",smalltalk.send(array,"_printString",[])]);
  1433. smalltalk.send(array,"_addLast_",[(3)]);
  1434. smalltalk.send(self,"_assert_equals_",["a Array ('foo' 3 3)",smalltalk.send(array,"_printString",[])]);
  1435. return self},
  1436. args: [],
  1437. source: "testPrintString\x0a\x09| array |\x0a\x09array := Array new.\x0a\x09self assert: 'a Array ()' equals: ( array printString ).\x0a\x09array add: 1; add: 3.\x0a\x09self assert: 'a Array (1 3)' equals: ( array printString ).\x0a\x09array add: 'foo'.\x0a\x09self assert: 'a Array (1 3 ''foo'')' equals: ( array printString ).\x0a\x09array remove: 1; remove: 3.\x0a\x09self assert: 'a Array (''foo'')' equals: ( array printString ).\x0a\x09array addLast: 3.\x0a\x09self assert: 'a Array (''foo'' 3)' equals: ( array printString ).\x0a\x09array addLast: 3.\x0a\x09self assert: 'a Array (''foo'' 3 3)' equals: ( array printString ).",
  1438. messageSends: ["new", "assert:equals:", "printString", "add:", "remove:", "addLast:"],
  1439. referencedClasses: ["Array"]
  1440. }),
  1441. smalltalk.ArrayTest);
  1442. smalltalk.addMethod(
  1443. "_collectionClass",
  1444. smalltalk.method({
  1445. selector: "collectionClass",
  1446. category: 'accessing',
  1447. fn: function (){
  1448. var self=this;
  1449. return (smalltalk.Array || Array);
  1450. },
  1451. args: [],
  1452. source: "collectionClass\x0a\x09^ Array",
  1453. messageSends: [],
  1454. referencedClasses: ["Array"]
  1455. }),
  1456. smalltalk.ArrayTest.klass);
  1457. smalltalk.addClass('StringTest', smalltalk.SequenceableCollectionTest, [], 'Kernel-Tests');
  1458. smalltalk.addMethod(
  1459. "_collection",
  1460. smalltalk.method({
  1461. selector: "collection",
  1462. category: 'accessing',
  1463. fn: function (){
  1464. var self=this;
  1465. return "hello";
  1466. },
  1467. args: [],
  1468. source: "collection\x0a\x09^'hello'",
  1469. messageSends: [],
  1470. referencedClasses: []
  1471. }),
  1472. smalltalk.StringTest);
  1473. smalltalk.addMethod(
  1474. "_collectionWithDuplicates",
  1475. smalltalk.method({
  1476. selector: "collectionWithDuplicates",
  1477. category: 'accessing',
  1478. fn: function (){
  1479. var self=this;
  1480. return "abbaerte";
  1481. },
  1482. args: [],
  1483. source: "collectionWithDuplicates\x0a\x09^ 'abbaerte'",
  1484. messageSends: [],
  1485. referencedClasses: []
  1486. }),
  1487. smalltalk.StringTest);
  1488. smalltalk.addMethod(
  1489. "_testAddRemove",
  1490. smalltalk.method({
  1491. selector: "testAddRemove",
  1492. category: 'tests',
  1493. fn: function (){
  1494. var self=this;
  1495. smalltalk.send(self,"_should_raise_",[(function(){
  1496. return smalltalk.send("hello","_add_",["a"]);
  1497. }),(smalltalk.Error || Error)]);
  1498. smalltalk.send(self,"_should_raise_",[(function(){
  1499. return smalltalk.send("hello","_remove_",["h"]);
  1500. }),(smalltalk.Error || Error)]);
  1501. return self},
  1502. args: [],
  1503. source: "testAddRemove\x0a\x09self should: ['hello' add: 'a'] raise: Error.\x0a\x09self should: ['hello' remove: 'h'] raise: Error",
  1504. messageSends: ["should:raise:", "add:", "remove:"],
  1505. referencedClasses: ["Error"]
  1506. }),
  1507. smalltalk.StringTest);
  1508. smalltalk.addMethod(
  1509. "_testAsArray",
  1510. smalltalk.method({
  1511. selector: "testAsArray",
  1512. category: 'tests',
  1513. fn: function (){
  1514. var self=this;
  1515. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send("hello","_asArray",[]),"__eq",[["h", "e", "l", "l", "o"]])]);
  1516. return self},
  1517. args: [],
  1518. source: "testAsArray\x0a\x09self assert: 'hello' asArray = #('h' 'e' 'l' 'l' 'o').",
  1519. messageSends: ["assert:", "=", "asArray"],
  1520. referencedClasses: []
  1521. }),
  1522. smalltalk.StringTest);
  1523. smalltalk.addMethod(
  1524. "_testAt",
  1525. smalltalk.method({
  1526. selector: "testAt",
  1527. category: 'tests',
  1528. fn: function (){
  1529. var self=this;
  1530. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send("hello","_at_",[(1)]),"__eq",["h"])]);
  1531. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send("hello","_at_",[(5)]),"__eq",["o"])]);
  1532. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send("hello","_at_ifAbsent_",[(6),(function(){
  1533. return nil;
  1534. })]),"__eq",[nil])]);
  1535. return self},
  1536. args: [],
  1537. source: "testAt\x0a\x09self assert: ('hello' at: 1) = 'h'.\x0a\x09self assert: ('hello' at: 5) = 'o'.\x0a\x09self assert: ('hello' at: 6 ifAbsent: [nil]) = nil",
  1538. messageSends: ["assert:", "=", "at:", "at:ifAbsent:"],
  1539. referencedClasses: []
  1540. }),
  1541. smalltalk.StringTest);
  1542. smalltalk.addMethod(
  1543. "_testAtPut",
  1544. smalltalk.method({
  1545. selector: "testAtPut",
  1546. category: 'tests',
  1547. fn: function (){
  1548. var self=this;
  1549. smalltalk.send(self,"_should_raise_",[(function(){
  1550. return smalltalk.send("hello","_at_put_",[(1),"a"]);
  1551. }),(smalltalk.Error || Error)]);
  1552. return self},
  1553. args: [],
  1554. source: "testAtPut\x0a\x09\x22String instances are read-only\x22\x0a\x09self should: ['hello' at: 1 put: 'a'] raise: Error",
  1555. messageSends: ["should:raise:", "at:put:"],
  1556. referencedClasses: ["Error"]
  1557. }),
  1558. smalltalk.StringTest);
  1559. smalltalk.addMethod(
  1560. "_testCollect",
  1561. smalltalk.method({
  1562. selector: "testCollect",
  1563. category: 'tests',
  1564. fn: function (){
  1565. var self=this;
  1566. var newCollection;
  1567. newCollection="hheelllloo";
  1568. smalltalk.send(self,"_assertSameContents_as_",[smalltalk.send(smalltalk.send(self,"_collection",[]),"_collect_",[(function(each){
  1569. return smalltalk.send(each,"__comma",[each]);
  1570. })]),newCollection]);
  1571. return self},
  1572. args: [],
  1573. source: "testCollect\x0a\x09| newCollection |\x0a\x09newCollection := 'hheelllloo'.\x0a\x09self \x0a\x09\x09assertSameContents: (self collection collect: [ :each |\x0a\x09\x09\x09each, each ])\x0a\x09\x09as: newCollection",
  1574. messageSends: ["assertSameContents:as:", "collect:", ",", "collection"],
  1575. referencedClasses: []
  1576. }),
  1577. smalltalk.StringTest);
  1578. smalltalk.addMethod(
  1579. "_testCopyWithoutAll",
  1580. smalltalk.method({
  1581. selector: "testCopyWithoutAll",
  1582. category: 'tests',
  1583. fn: function (){
  1584. var self=this;
  1585. smalltalk.send(self,"_assert_equals_",["hello world",smalltalk.send("*hello* *world*","_copyWithoutAll_",["*"])]);
  1586. return self},
  1587. args: [],
  1588. source: "testCopyWithoutAll\x0a\x09self \x0a\x09\x09assert: 'hello world' \x0a\x09\x09equals: ('*hello* *world*' copyWithoutAll: '*')",
  1589. messageSends: ["assert:equals:", "copyWithoutAll:"],
  1590. referencedClasses: []
  1591. }),
  1592. smalltalk.StringTest);
  1593. smalltalk.addMethod(
  1594. "_testDetect",
  1595. smalltalk.method({
  1596. selector: "testDetect",
  1597. category: 'tests',
  1598. fn: function (){
  1599. var self=this;
  1600. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(smalltalk.send(self,"_collection",[]),"_detect_",[(function(each){
  1601. return smalltalk.send(each,"__eq",["h"]);
  1602. })]),"__eq",["h"])]);
  1603. smalltalk.send(self,"_should_raise_",[(function(){
  1604. return smalltalk.send(smalltalk.send(self,"_collection",[]),"_detect_",[(function(each){
  1605. return smalltalk.send(each,"__eq",[(6)]);
  1606. })]);
  1607. }),(smalltalk.Error || Error)]);
  1608. return self},
  1609. args: [],
  1610. source: "testDetect\x0a\x09self assert: (self collection detect: [ :each | each = 'h' ]) = 'h'.\x0a\x09self \x0a\x09\x09should: [ self collection detect: [ :each | each = 6 ] ]\x0a\x09\x09raise: Error",
  1611. messageSends: ["assert:", "=", "detect:", "collection", "should:raise:"],
  1612. referencedClasses: ["Error"]
  1613. }),
  1614. smalltalk.StringTest);
  1615. smalltalk.addMethod(
  1616. "_testEquality",
  1617. smalltalk.method({
  1618. selector: "testEquality",
  1619. category: 'tests',
  1620. fn: function (){
  1621. var self=this;
  1622. smalltalk.send(self,"_assert_",[smalltalk.send("hello","__eq",["hello"])]);
  1623. smalltalk.send(self,"_deny_",[smalltalk.send("hello","__eq",["world"])]);
  1624. smalltalk.send(self,"_assert_",[smalltalk.send("hello","__eq",[smalltalk.send("hello","_yourself",[])])]);
  1625. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send("hello","_yourself",[]),"__eq",["hello"])]);
  1626. smalltalk.send(self,"_deny_",[smalltalk.send("","__eq",[(0)])]);
  1627. return self},
  1628. args: [],
  1629. source: "testEquality\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",
  1630. messageSends: ["assert:", "=", "deny:", "yourself"],
  1631. referencedClasses: []
  1632. }),
  1633. smalltalk.StringTest);
  1634. smalltalk.addMethod(
  1635. "_testIdentity",
  1636. smalltalk.method({
  1637. selector: "testIdentity",
  1638. category: 'tests',
  1639. fn: function (){
  1640. var self=this;
  1641. smalltalk.send(self,"_assert_",[smalltalk.send("hello","__eq_eq",["hello"])]);
  1642. smalltalk.send(self,"_deny_",[smalltalk.send("hello","__eq_eq",["world"])]);
  1643. smalltalk.send(self,"_assert_",[smalltalk.send("hello","__eq_eq",[smalltalk.send("hello","_yourself",[])])]);
  1644. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send("hello","_yourself",[]),"__eq_eq",["hello"])]);
  1645. smalltalk.send(self,"_deny_",[smalltalk.send("","__eq_eq",[(0)])]);
  1646. return self},
  1647. args: [],
  1648. 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",
  1649. messageSends: ["assert:", "==", "deny:", "yourself"],
  1650. referencedClasses: []
  1651. }),
  1652. smalltalk.StringTest);
  1653. smalltalk.addMethod(
  1654. "_testIncludesSubString",
  1655. smalltalk.method({
  1656. selector: "testIncludesSubString",
  1657. category: 'tests',
  1658. fn: function (){
  1659. var self=this;
  1660. smalltalk.send(self,"_assert_",[smalltalk.send("amber","_includesSubString_",["ber"])]);
  1661. smalltalk.send(self,"_deny_",[smalltalk.send("amber","_includesSubString_",["zork"])]);
  1662. return self},
  1663. args: [],
  1664. source: "testIncludesSubString\x0a\x09self assert: ('amber' includesSubString: 'ber').\x0a\x09self deny: ('amber' includesSubString: 'zork').",
  1665. messageSends: ["assert:", "includesSubString:", "deny:"],
  1666. referencedClasses: []
  1667. }),
  1668. smalltalk.StringTest);
  1669. smalltalk.addMethod(
  1670. "_testJoin",
  1671. smalltalk.method({
  1672. selector: "testJoin",
  1673. category: 'tests',
  1674. fn: function (){
  1675. var self=this;
  1676. smalltalk.send(self,"_assert_equals_",["hello,world",smalltalk.send(",","_join_",[["hello", "world"]])]);
  1677. return self},
  1678. args: [],
  1679. source: "testJoin\x0a\x09self assert: 'hello,world' equals: (',' join: #('hello' 'world'))",
  1680. messageSends: ["assert:equals:", "join:"],
  1681. referencedClasses: []
  1682. }),
  1683. smalltalk.StringTest);
  1684. smalltalk.addMethod(
  1685. "_testSelect",
  1686. smalltalk.method({
  1687. selector: "testSelect",
  1688. category: 'tests',
  1689. fn: function (){
  1690. var self=this;
  1691. var newCollection;
  1692. newCollection="o";
  1693. smalltalk.send(self,"_assertSameContents_as_",[smalltalk.send(smalltalk.send(self,"_collection",[]),"_select_",[(function(each){
  1694. return smalltalk.send(each,"__eq",["o"]);
  1695. })]),newCollection]);
  1696. return self},
  1697. args: [],
  1698. source: "testSelect\x0a\x09| newCollection |\x0a\x09newCollection := 'o'.\x0a\x09self \x0a\x09\x09assertSameContents: (self collection select: [ :each |\x0a\x09\x09\x09each = 'o' ])\x0a\x09\x09as: newCollection",
  1699. messageSends: ["assertSameContents:as:", "select:", "=", "collection"],
  1700. referencedClasses: []
  1701. }),
  1702. smalltalk.StringTest);
  1703. smalltalk.addMethod(
  1704. "_testSize",
  1705. smalltalk.method({
  1706. selector: "testSize",
  1707. category: 'tests',
  1708. fn: function (){
  1709. var self=this;
  1710. smalltalk.send(self,"_assert_equals_",[smalltalk.send("smalltalk","_size",[]),(9)]);
  1711. smalltalk.send(self,"_assert_equals_",[smalltalk.send("","_size",[]),(0)]);
  1712. return self},
  1713. args: [],
  1714. source: "testSize\x0a\x09self assert: 'smalltalk' size equals: 9.\x0a\x09self assert: '' size equals: 0",
  1715. messageSends: ["assert:equals:", "size"],
  1716. referencedClasses: []
  1717. }),
  1718. smalltalk.StringTest);
  1719. smalltalk.addMethod(
  1720. "_testStreamContents",
  1721. smalltalk.method({
  1722. selector: "testStreamContents",
  1723. category: 'tests',
  1724. fn: function (){
  1725. var self=this;
  1726. var $1;
  1727. smalltalk.send(self,"_assert_equals_",["hello world",smalltalk.send((smalltalk.String || String),"_streamContents_",[(function(aStream){
  1728. smalltalk.send(aStream,"_nextPutAll_",["hello"]);
  1729. smalltalk.send(aStream,"_space",[]);
  1730. $1=smalltalk.send(aStream,"_nextPutAll_",["world"]);
  1731. return $1;
  1732. })])]);
  1733. return self},
  1734. args: [],
  1735. source: "testStreamContents\x0a\x09self \x0a\x09\x09assert: 'hello world' \x0a\x09\x09equals: (String streamContents: [ :aStream | \x0a\x09\x09\x09aStream \x0a\x09\x09\x09\x09nextPutAll: 'hello'; space; \x0a\x09\x09\x09\x09nextPutAll: 'world' ])",
  1736. messageSends: ["assert:equals:", "streamContents:", "nextPutAll:", "space"],
  1737. referencedClasses: ["String"]
  1738. }),
  1739. smalltalk.StringTest);
  1740. smalltalk.addMethod(
  1741. "_collectionClass",
  1742. smalltalk.method({
  1743. selector: "collectionClass",
  1744. category: 'accessing',
  1745. fn: function (){
  1746. var self=this;
  1747. return (smalltalk.String || String);
  1748. },
  1749. args: [],
  1750. source: "collectionClass\x0a\x09^ String",
  1751. messageSends: [],
  1752. referencedClasses: ["String"]
  1753. }),
  1754. smalltalk.StringTest.klass);
  1755. smalltalk.addClass('SymbolTest', smalltalk.SequenceableCollectionTest, [], 'Kernel-Tests');
  1756. smalltalk.addMethod(
  1757. "_collection",
  1758. smalltalk.method({
  1759. selector: "collection",
  1760. category: 'accessing',
  1761. fn: function (){
  1762. var self=this;
  1763. return smalltalk.symbolFor("hello");
  1764. },
  1765. args: [],
  1766. source: "collection\x0a\x09^ #hello",
  1767. messageSends: [],
  1768. referencedClasses: []
  1769. }),
  1770. smalltalk.SymbolTest);
  1771. smalltalk.addMethod(
  1772. "_collectionWithDuplicates",
  1773. smalltalk.method({
  1774. selector: "collectionWithDuplicates",
  1775. category: 'accessing',
  1776. fn: function (){
  1777. var self=this;
  1778. return smalltalk.symbolFor("phhaaarorra");
  1779. },
  1780. args: [],
  1781. source: "collectionWithDuplicates\x0a\x09^ #phhaaarorra",
  1782. messageSends: [],
  1783. referencedClasses: []
  1784. }),
  1785. smalltalk.SymbolTest);
  1786. smalltalk.addMethod(
  1787. "_testAsString",
  1788. smalltalk.method({
  1789. selector: "testAsString",
  1790. category: 'tests',
  1791. fn: function (){
  1792. var self=this;
  1793. smalltalk.send(self,"_assert_equals_",[smalltalk.send(smalltalk.symbolFor("hello"),"_asString",[]),"hello"]);
  1794. return self},
  1795. args: [],
  1796. source: "testAsString\x0a\x09self assert: #hello asString equals: 'hello'",
  1797. messageSends: ["assert:equals:", "asString"],
  1798. referencedClasses: []
  1799. }),
  1800. smalltalk.SymbolTest);
  1801. smalltalk.addMethod(
  1802. "_testAsSymbol",
  1803. smalltalk.method({
  1804. selector: "testAsSymbol",
  1805. category: 'tests',
  1806. fn: function (){
  1807. var self=this;
  1808. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.symbolFor("hello"),"__eq_eq",[smalltalk.send(smalltalk.symbolFor("hello"),"_asSymbol",[])])]);
  1809. return self},
  1810. args: [],
  1811. source: "testAsSymbol\x0a\x09self assert: #hello == #hello asSymbol",
  1812. messageSends: ["assert:", "==", "asSymbol"],
  1813. referencedClasses: []
  1814. }),
  1815. smalltalk.SymbolTest);
  1816. smalltalk.addMethod(
  1817. "_testAt",
  1818. smalltalk.method({
  1819. selector: "testAt",
  1820. category: 'tests',
  1821. fn: function (){
  1822. var self=this;
  1823. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"),"_at_",[(1)]),"__eq",["h"])]);
  1824. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"),"_at_",[(5)]),"__eq",["o"])]);
  1825. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"),"_at_ifAbsent_",[(6),(function(){
  1826. return nil;
  1827. })]),"__eq",[nil])]);
  1828. return self},
  1829. args: [],
  1830. source: "testAt\x0a\x09self assert: (#hello at: 1) = 'h'.\x0a\x09self assert: (#hello at: 5) = 'o'.\x0a\x09self assert: (#hello at: 6 ifAbsent: [nil]) = nil",
  1831. messageSends: ["assert:", "=", "at:", "at:ifAbsent:"],
  1832. referencedClasses: []
  1833. }),
  1834. smalltalk.SymbolTest);
  1835. smalltalk.addMethod(
  1836. "_testAtPut",
  1837. smalltalk.method({
  1838. selector: "testAtPut",
  1839. category: 'tests',
  1840. fn: function (){
  1841. var self=this;
  1842. smalltalk.send(self,"_should_raise_",[(function(){
  1843. return smalltalk.send("hello","_at_put_",[(1),"a"]);
  1844. }),(smalltalk.Error || Error)]);
  1845. return self},
  1846. args: [],
  1847. source: "testAtPut\x0a\x09\x22Symbol instances are read-only\x22\x0a\x09self should: ['hello' at: 1 put: 'a'] raise: Error",
  1848. messageSends: ["should:raise:", "at:put:"],
  1849. referencedClasses: ["Error"]
  1850. }),
  1851. smalltalk.SymbolTest);
  1852. smalltalk.addMethod(
  1853. "_testCollect",
  1854. smalltalk.method({
  1855. selector: "testCollect",
  1856. category: 'tests',
  1857. fn: function (){
  1858. var self=this;
  1859. var newCollection;
  1860. newCollection=smalltalk.symbolFor("hheelllloo");
  1861. smalltalk.send(self,"_assertSameContents_as_",[smalltalk.send(smalltalk.send(self,"_collection",[]),"_collect_",[(function(each){
  1862. return smalltalk.send(each,"__comma",[each]);
  1863. })]),newCollection]);
  1864. return self},
  1865. args: [],
  1866. source: "testCollect\x0a\x09| newCollection |\x0a\x09newCollection := #hheelllloo.\x0a\x09self \x0a\x09\x09assertSameContents: (self collection collect: [ :each |\x0a\x09\x09\x09each, each ])\x0a\x09\x09as: newCollection",
  1867. messageSends: ["assertSameContents:as:", "collect:", ",", "collection"],
  1868. referencedClasses: []
  1869. }),
  1870. smalltalk.SymbolTest);
  1871. smalltalk.addMethod(
  1872. "_testComparing",
  1873. smalltalk.method({
  1874. selector: "testComparing",
  1875. category: 'tests',
  1876. fn: function (){
  1877. var self=this;
  1878. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.symbolFor("ab"),"__gt",[smalltalk.symbolFor("aa")])]);
  1879. smalltalk.send(self,"_deny_",[smalltalk.send(smalltalk.symbolFor("ab"),"__gt",[smalltalk.symbolFor("ba")])]);
  1880. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.symbolFor("ab"),"__lt",[smalltalk.symbolFor("ba")])]);
  1881. smalltalk.send(self,"_deny_",[smalltalk.send(smalltalk.symbolFor("bb"),"__lt",[smalltalk.symbolFor("ba")])]);
  1882. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.symbolFor("ab"),"__gt_eq",[smalltalk.symbolFor("aa")])]);
  1883. smalltalk.send(self,"_deny_",[smalltalk.send(smalltalk.symbolFor("ab"),"__gt_eq",[smalltalk.symbolFor("ba")])]);
  1884. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.symbolFor("ab"),"__lt_eq",[smalltalk.symbolFor("ba")])]);
  1885. smalltalk.send(self,"_deny_",[smalltalk.send(smalltalk.symbolFor("bb"),"__lt_eq",[smalltalk.symbolFor("ba")])]);
  1886. return self},
  1887. args: [],
  1888. source: "testComparing\x0a\x09self assert: #ab > #aa.\x0a\x09self deny: #ab > #ba.\x0a\x0a\x09self assert: #ab < #ba.\x0a\x09self deny: #bb < #ba.\x0a\x0a\x09self assert: #ab >= #aa.\x0a\x09self deny: #ab >= #ba.\x0a\x0a\x09self assert: #ab <= #ba.\x0a\x09self deny: #bb <= #ba",
  1889. messageSends: ["assert:", ">", "deny:", "<", ">=", "<="],
  1890. referencedClasses: []
  1891. }),
  1892. smalltalk.SymbolTest);
  1893. smalltalk.addMethod(
  1894. "_testCopying",
  1895. smalltalk.method({
  1896. selector: "testCopying",
  1897. category: 'tests',
  1898. fn: function (){
  1899. var self=this;
  1900. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"),"_copy",[]),"__eq_eq",[smalltalk.symbolFor("hello")])]);
  1901. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"),"_deepCopy",[]),"__eq_eq",[smalltalk.symbolFor("hello")])]);
  1902. return self},
  1903. args: [],
  1904. source: "testCopying\x0a\x09self assert: #hello copy == #hello.\x0a\x09self assert: #hello deepCopy == #hello",
  1905. messageSends: ["assert:", "==", "copy", "deepCopy"],
  1906. referencedClasses: []
  1907. }),
  1908. smalltalk.SymbolTest);
  1909. smalltalk.addMethod(
  1910. "_testDetect",
  1911. smalltalk.method({
  1912. selector: "testDetect",
  1913. category: 'tests',
  1914. fn: function (){
  1915. var self=this;
  1916. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(smalltalk.send(self,"_collection",[]),"_detect_",[(function(each){
  1917. return smalltalk.send(each,"__eq",["h"]);
  1918. })]),"__eq",["h"])]);
  1919. smalltalk.send(self,"_should_raise_",[(function(){
  1920. return smalltalk.send(smalltalk.send(self,"_collection",[]),"_detect_",[(function(each){
  1921. return smalltalk.send(each,"__eq",["z"]);
  1922. })]);
  1923. }),(smalltalk.Error || Error)]);
  1924. return self},
  1925. args: [],
  1926. source: "testDetect\x0a\x09self assert: (self collection detect: [ :each | each = 'h' ]) = 'h'.\x0a\x09self \x0a\x09\x09should: [ self collection detect: [ :each | each = 'z' ] ]\x0a\x09\x09raise: Error",
  1927. messageSends: ["assert:", "=", "detect:", "collection", "should:raise:"],
  1928. referencedClasses: ["Error"]
  1929. }),
  1930. smalltalk.SymbolTest);
  1931. smalltalk.addMethod(
  1932. "_testEquality",
  1933. smalltalk.method({
  1934. selector: "testEquality",
  1935. category: 'tests',
  1936. fn: function (){
  1937. var self=this;
  1938. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.symbolFor("hello"),"__eq",[smalltalk.symbolFor("hello")])]);
  1939. smalltalk.send(self,"_deny_",[smalltalk.send(smalltalk.symbolFor("hello"),"__eq",[smalltalk.symbolFor("world")])]);
  1940. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.symbolFor("hello"),"__eq",[smalltalk.send(smalltalk.symbolFor("hello"),"_yourself",[])])]);
  1941. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"),"_yourself",[]),"__eq",[smalltalk.symbolFor("hello")])]);
  1942. smalltalk.send(self,"_deny_",[smalltalk.send(smalltalk.symbolFor("hello"),"__eq",["hello"])]);
  1943. smalltalk.send(self,"_deny_",[smalltalk.send("hello","__eq",[smalltalk.symbolFor("hello")])]);
  1944. return self},
  1945. args: [],
  1946. source: "testEquality\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\x09self deny: #hello = 'hello'.\x0a\x09self deny: 'hello' = #hello.",
  1947. messageSends: ["assert:", "=", "deny:", "yourself"],
  1948. referencedClasses: []
  1949. }),
  1950. smalltalk.SymbolTest);
  1951. smalltalk.addMethod(
  1952. "_testIdentity",
  1953. smalltalk.method({
  1954. selector: "testIdentity",
  1955. category: 'tests',
  1956. fn: function (){
  1957. var self=this;
  1958. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.symbolFor("hello"),"__eq_eq",[smalltalk.symbolFor("hello")])]);
  1959. smalltalk.send(self,"_deny_",[smalltalk.send(smalltalk.symbolFor("hello"),"__eq_eq",[smalltalk.symbolFor("world")])]);
  1960. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.symbolFor("hello"),"__eq",[smalltalk.send(smalltalk.symbolFor("hello"),"_yourself",[])])]);
  1961. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"),"_yourself",[]),"__eq",[smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"),"_asString",[]),"_asSymbol",[])])]);
  1962. return self},
  1963. args: [],
  1964. 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 asString asSymbol",
  1965. messageSends: ["assert:", "==", "deny:", "=", "yourself", "asSymbol", "asString"],
  1966. referencedClasses: []
  1967. }),
  1968. smalltalk.SymbolTest);
  1969. smalltalk.addMethod(
  1970. "_testIsEmpty",
  1971. smalltalk.method({
  1972. selector: "testIsEmpty",
  1973. category: 'tests',
  1974. fn: function (){
  1975. var self=this;
  1976. smalltalk.send(self,"_deny_",[smalltalk.send(smalltalk.send(self,"_collection",[]),"_isEmpty",[])]);
  1977. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send("","_asSymbol",[]),"_isEmpty",[])]);
  1978. return self},
  1979. args: [],
  1980. source: "testIsEmpty\x0a\x09self deny: self collection isEmpty.\x0a\x09self assert: '' asSymbol isEmpty",
  1981. messageSends: ["deny:", "isEmpty", "collection", "assert:", "asSymbol"],
  1982. referencedClasses: []
  1983. }),
  1984. smalltalk.SymbolTest);
  1985. smalltalk.addMethod(
  1986. "_testIsSymbolIsString",
  1987. smalltalk.method({
  1988. selector: "testIsSymbolIsString",
  1989. category: 'tests',
  1990. fn: function (){
  1991. var self=this;
  1992. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.symbolFor("hello"),"_isSymbol",[])]);
  1993. smalltalk.send(self,"_deny_",[smalltalk.send("hello","_isSymbol",[])]);
  1994. smalltalk.send(self,"_deny_",[smalltalk.send(smalltalk.symbolFor("hello"),"_isString",[])]);
  1995. smalltalk.send(self,"_assert_",[smalltalk.send("hello","_isString",[])]);
  1996. return self},
  1997. args: [],
  1998. source: "testIsSymbolIsString\x0a\x09self assert: #hello isSymbol.\x0a\x09self deny: 'hello' isSymbol.\x0a\x09self deny: #hello isString.\x0a\x09self assert: 'hello' isString",
  1999. messageSends: ["assert:", "isSymbol", "deny:", "isString"],
  2000. referencedClasses: []
  2001. }),
  2002. smalltalk.SymbolTest);
  2003. smalltalk.addMethod(
  2004. "_testSelect",
  2005. smalltalk.method({
  2006. selector: "testSelect",
  2007. category: 'tests',
  2008. fn: function (){
  2009. var self=this;
  2010. var newCollection;
  2011. newCollection="o";
  2012. smalltalk.send(self,"_assertSameContents_as_",[smalltalk.send(smalltalk.send(self,"_collection",[]),"_select_",[(function(each){
  2013. return smalltalk.send(each,"__eq",["o"]);
  2014. })]),newCollection]);
  2015. return self},
  2016. args: [],
  2017. source: "testSelect\x0a\x09| newCollection |\x0a\x09newCollection := 'o'.\x0a\x09self \x0a\x09\x09assertSameContents: (self collection select: [ :each |\x0a\x09\x09\x09each = 'o' ])\x0a\x09\x09as: newCollection",
  2018. messageSends: ["assertSameContents:as:", "select:", "=", "collection"],
  2019. referencedClasses: []
  2020. }),
  2021. smalltalk.SymbolTest);
  2022. smalltalk.addMethod(
  2023. "_testSize",
  2024. smalltalk.method({
  2025. selector: "testSize",
  2026. category: 'tests',
  2027. fn: function (){
  2028. var self=this;
  2029. smalltalk.send(self,"_assert_equals_",[smalltalk.send(smalltalk.symbolFor("a"),"_size",[]),(1)]);
  2030. smalltalk.send(self,"_assert_equals_",[smalltalk.send(smalltalk.symbolFor("aaaaa"),"_size",[]),(5)]);
  2031. return self},
  2032. args: [],
  2033. source: "testSize\x0a\x09self assert: #a size equals: 1.\x0a\x09self assert: #aaaaa size equals: 5",
  2034. messageSends: ["assert:equals:", "size"],
  2035. referencedClasses: []
  2036. }),
  2037. smalltalk.SymbolTest);
  2038. smalltalk.addMethod(
  2039. "_collectionClass",
  2040. smalltalk.method({
  2041. selector: "collectionClass",
  2042. category: 'accessing',
  2043. fn: function (){
  2044. var self=this;
  2045. return (smalltalk.Symbol || Symbol);
  2046. },
  2047. args: [],
  2048. source: "collectionClass\x0a\x09^ Symbol",
  2049. messageSends: [],
  2050. referencedClasses: ["Symbol"]
  2051. }),
  2052. smalltalk.SymbolTest.klass);
  2053. smalltalk.addClass('JSObjectProxyTest', smalltalk.TestCase, [], 'Kernel-Tests');
  2054. smalltalk.addMethod(
  2055. "_jsObject",
  2056. smalltalk.method({
  2057. selector: "jsObject",
  2058. category: 'accessing',
  2059. fn: function (){
  2060. var self=this;
  2061. return jsObject = {a: 1, b: function() {return 2;}, c: function(object) {return object;}, d: '', 'e': null};
  2062. ;
  2063. return self},
  2064. args: [],
  2065. source: "jsObject\x0a\x09<return jsObject = {a: 1, b: function() {return 2;}, c: function(object) {return object;}, d: '', 'e': null}>",
  2066. messageSends: [],
  2067. referencedClasses: []
  2068. }),
  2069. smalltalk.JSObjectProxyTest);
  2070. smalltalk.addMethod(
  2071. "_testDNU",
  2072. smalltalk.method({
  2073. selector: "testDNU",
  2074. category: 'tests',
  2075. fn: function (){
  2076. var self=this;
  2077. smalltalk.send(self,"_should_raise_",[(function(){
  2078. return smalltalk.send(smalltalk.send(self,"_jsObject",[]),"_foo",[]);
  2079. }),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  2080. return self},
  2081. args: [],
  2082. source: "testDNU\x0a\x09self should: [self jsObject foo] raise: MessageNotUnderstood",
  2083. messageSends: ["should:raise:", "foo", "jsObject"],
  2084. referencedClasses: ["MessageNotUnderstood"]
  2085. }),
  2086. smalltalk.JSObjectProxyTest);
  2087. smalltalk.addMethod(
  2088. "_testMessageSend",
  2089. smalltalk.method({
  2090. selector: "testMessageSend",
  2091. category: 'tests',
  2092. fn: function (){
  2093. var self=this;
  2094. smalltalk.send(self,"_assert_equals_",[smalltalk.send(smalltalk.send(self,"_jsObject",[]),"_a",[]),(1)]);
  2095. smalltalk.send(self,"_assert_equals_",[smalltalk.send(smalltalk.send(self,"_jsObject",[]),"_b",[]),(2)]);
  2096. smalltalk.send(self,"_assert_equals_",[smalltalk.send(smalltalk.send(self,"_jsObject",[]),"_c_",[(3)]),(3)]);
  2097. return self},
  2098. args: [],
  2099. 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",
  2100. messageSends: ["assert:equals:", "a", "jsObject", "b", "c:"],
  2101. referencedClasses: []
  2102. }),
  2103. smalltalk.JSObjectProxyTest);
  2104. smalltalk.addMethod(
  2105. "_testMethodWithArguments",
  2106. smalltalk.method({
  2107. selector: "testMethodWithArguments",
  2108. category: 'tests',
  2109. fn: function (){
  2110. var self=this;
  2111. smalltalk.send(self,"_assert_equals_",[smalltalk.send(smalltalk.send(self,"_jsObject",[]),"_c_",[(1)]),(1)]);
  2112. return self},
  2113. args: [],
  2114. source: "testMethodWithArguments\x0a\x09self assert: (self jsObject c: 1) equals: 1",
  2115. messageSends: ["assert:equals:", "c:", "jsObject"],
  2116. referencedClasses: []
  2117. }),
  2118. smalltalk.JSObjectProxyTest);
  2119. smalltalk.addMethod(
  2120. "_testPrinting",
  2121. smalltalk.method({
  2122. selector: "testPrinting",
  2123. category: 'tests',
  2124. fn: function (){
  2125. var self=this;
  2126. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(smalltalk.send(self,"_jsObject",[]),"_printString",[]),"__eq",["[object Object]"])]);
  2127. return self},
  2128. args: [],
  2129. source: "testPrinting\x0a\x09self assert: self jsObject printString = '[object Object]'",
  2130. messageSends: ["assert:", "=", "printString", "jsObject"],
  2131. referencedClasses: []
  2132. }),
  2133. smalltalk.JSObjectProxyTest);
  2134. smalltalk.addMethod(
  2135. "_testPropertyThatReturnsEmptyString",
  2136. smalltalk.method({
  2137. selector: "testPropertyThatReturnsEmptyString",
  2138. category: 'tests',
  2139. fn: function (){
  2140. var self=this;
  2141. var object;
  2142. object=smalltalk.send(self,"_jsObject",[]);
  2143. smalltalk.send(self,"_assert_equals_",["",smalltalk.send(object,"_d",[])]);
  2144. smalltalk.send(object,"_d_",["hello"]);
  2145. smalltalk.send(self,"_assert_equals_",["hello",smalltalk.send(object,"_d",[])]);
  2146. return self},
  2147. args: [],
  2148. source: "testPropertyThatReturnsEmptyString\x0a\x09| object |\x0a\x0a\x09object := self jsObject.\x0a\x09self assert: '' equals: object d.\x0a\x0a\x09object d: 'hello'.\x0a\x09self assert: 'hello' equals: object d",
  2149. messageSends: ["jsObject", "assert:equals:", "d", "d:"],
  2150. referencedClasses: []
  2151. }),
  2152. smalltalk.JSObjectProxyTest);
  2153. smalltalk.addMethod(
  2154. "_testPropertyThatReturnsUndefined",
  2155. smalltalk.method({
  2156. selector: "testPropertyThatReturnsUndefined",
  2157. category: 'tests',
  2158. fn: function (){
  2159. var self=this;
  2160. var object;
  2161. object=smalltalk.send(self,"_jsObject",[]);
  2162. smalltalk.send(self,"_shouldnt_raise_",[(function(){
  2163. return smalltalk.send(object,"_e",[]);
  2164. }),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  2165. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(object,"_e",[]),"_isNil",[])]);
  2166. return self},
  2167. args: [],
  2168. source: "testPropertyThatReturnsUndefined\x0a\x09| object |\x0a\x0a\x09object := self jsObject.\x0a\x09self shouldnt: [ object e ] raise: MessageNotUnderstood.\x0a self assert: object e isNil\x0a",
  2169. messageSends: ["jsObject", "shouldnt:raise:", "e", "assert:", "isNil"],
  2170. referencedClasses: ["MessageNotUnderstood"]
  2171. }),
  2172. smalltalk.JSObjectProxyTest);
  2173. smalltalk.addMethod(
  2174. "_testYourself",
  2175. smalltalk.method({
  2176. selector: "testYourself",
  2177. category: 'tests',
  2178. fn: function (){
  2179. var self=this;
  2180. var $1,$2;
  2181. var object;
  2182. $1=smalltalk.send(self,"_jsObject",[]);
  2183. smalltalk.send($1,"_d_",["test"]);
  2184. $2=smalltalk.send($1,"_yourself",[]);
  2185. object=$2;
  2186. smalltalk.send(self,"_assert_equals_",[smalltalk.send(object,"_d",[]),"test"]);
  2187. return self},
  2188. args: [],
  2189. source: "testYourself\x0a\x09| object |\x0a\x09object := self jsObject\x0a\x09\x09d: 'test';\x0a\x09\x09yourself.\x0a\x0a\x09self assert: object d equals: 'test'",
  2190. messageSends: ["d:", "jsObject", "yourself", "assert:equals:", "d"],
  2191. referencedClasses: []
  2192. }),
  2193. smalltalk.JSObjectProxyTest);
  2194. smalltalk.addClass('NumberTest', smalltalk.TestCase, [], 'Kernel-Tests');
  2195. smalltalk.addMethod(
  2196. "_testAbs",
  2197. smalltalk.method({
  2198. selector: "testAbs",
  2199. category: 'tests',
  2200. fn: function (){
  2201. var self=this;
  2202. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((4),"_abs",[]),"__eq",[(4)])]);
  2203. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((-4),"_abs",[]),"__eq",[(4)])]);
  2204. return self},
  2205. args: [],
  2206. source: "testAbs\x0a\x09self assert: 4 abs = 4.\x0a\x09self assert: -4 abs = 4",
  2207. messageSends: ["assert:", "=", "abs"],
  2208. referencedClasses: []
  2209. }),
  2210. smalltalk.NumberTest);
  2211. smalltalk.addMethod(
  2212. "_testArithmetic",
  2213. smalltalk.method({
  2214. selector: "testArithmetic",
  2215. category: 'tests',
  2216. fn: function (){
  2217. var self=this;
  2218. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((1.5),"__plus",[(1)]),"__eq",[(2.5)])]);
  2219. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((2),"__minus",[(1)]),"__eq",[(1)])]);
  2220. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((-2),"__minus",[(1)]),"__eq",[(-3)])]);
  2221. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((12),"__slash",[(2)]),"__eq",[(6)])]);
  2222. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((3),"__star",[(4)]),"__eq",[(12)])]);
  2223. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(smalltalk.send((1),"__plus",[(2)]),"__star",[(3)]),"__eq",[(9)])]);
  2224. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((1),"__plus",[smalltalk.send((2),"__star",[(3)])]),"__eq",[(7)])]);
  2225. return self},
  2226. args: [],
  2227. 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 = 2.5.\x0a\x09self assert: 2 - 1 = 1.\x0a\x09self assert: -2 - 1 = -3.\x0a\x09self assert: 12 / 2 = 6.\x0a\x09self assert: 3 * 4 = 12.\x0a\x0a\x09\x22Simple parenthesis and execution order\x22\x0a\x0a\x09self assert: 1 + 2 * 3 = 9.\x0a\x09self assert: 1 + (2 * 3) = 7",
  2228. messageSends: ["assert:", "=", "+", "-", "/", "*"],
  2229. referencedClasses: []
  2230. }),
  2231. smalltalk.NumberTest);
  2232. smalltalk.addMethod(
  2233. "_testComparison",
  2234. smalltalk.method({
  2235. selector: "testComparison",
  2236. category: 'tests',
  2237. fn: function (){
  2238. var self=this;
  2239. smalltalk.send(self,"_assert_",[smalltalk.send((3),"__gt",[(2)])]);
  2240. smalltalk.send(self,"_assert_",[smalltalk.send((2),"__lt",[(3)])]);
  2241. smalltalk.send(self,"_deny_",[smalltalk.send((3),"__lt",[(2)])]);
  2242. smalltalk.send(self,"_deny_",[smalltalk.send((2),"__gt",[(3)])]);
  2243. smalltalk.send(self,"_assert_",[smalltalk.send((3),"__gt_eq",[(3)])]);
  2244. smalltalk.send(self,"_assert_",[smalltalk.send((3.1),"__gt_eq",[(3)])]);
  2245. smalltalk.send(self,"_assert_",[smalltalk.send((3),"__lt_eq",[(3)])]);
  2246. smalltalk.send(self,"_assert_",[smalltalk.send((3),"__lt_eq",[(3.1)])]);
  2247. return self},
  2248. args: [],
  2249. 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",
  2250. messageSends: ["assert:", ">", "<", "deny:", ">=", "<="],
  2251. referencedClasses: []
  2252. }),
  2253. smalltalk.NumberTest);
  2254. smalltalk.addMethod(
  2255. "_testCopying",
  2256. smalltalk.method({
  2257. selector: "testCopying",
  2258. category: 'tests',
  2259. fn: function (){
  2260. var self=this;
  2261. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((1),"_copy",[]),"__eq_eq",[(1)])]);
  2262. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((1),"_deepCopy",[]),"__eq_eq",[(1)])]);
  2263. return self},
  2264. args: [],
  2265. source: "testCopying\x0a\x09self assert: 1 copy == 1.\x0a\x09self assert: 1 deepCopy == 1",
  2266. messageSends: ["assert:", "==", "copy", "deepCopy"],
  2267. referencedClasses: []
  2268. }),
  2269. smalltalk.NumberTest);
  2270. smalltalk.addMethod(
  2271. "_testEquality",
  2272. smalltalk.method({
  2273. selector: "testEquality",
  2274. category: 'tests',
  2275. fn: function (){
  2276. var self=this;
  2277. smalltalk.send(self,"_assert_",[smalltalk.send((1),"__eq",[(1)])]);
  2278. smalltalk.send(self,"_assert_",[smalltalk.send((0),"__eq",[(0)])]);
  2279. smalltalk.send(self,"_deny_",[smalltalk.send((1),"__eq",[(0)])]);
  2280. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((1),"_yourself",[]),"__eq",[(1)])]);
  2281. smalltalk.send(self,"_assert_",[smalltalk.send((1),"__eq",[smalltalk.send((1),"_yourself",[])])]);
  2282. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((1),"_yourself",[]),"__eq",[smalltalk.send((1),"_yourself",[])])]);
  2283. smalltalk.send(self,"_deny_",[smalltalk.send((0),"__eq",[false])]);
  2284. smalltalk.send(self,"_deny_",[smalltalk.send(false,"__eq",[(0)])]);
  2285. smalltalk.send(self,"_deny_",[smalltalk.send("","__eq",[(0)])]);
  2286. smalltalk.send(self,"_deny_",[smalltalk.send((0),"__eq",[""])]);
  2287. return self},
  2288. args: [],
  2289. 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 = ''",
  2290. messageSends: ["assert:", "=", "deny:", "yourself"],
  2291. referencedClasses: []
  2292. }),
  2293. smalltalk.NumberTest);
  2294. smalltalk.addMethod(
  2295. "_testHexNumbers",
  2296. smalltalk.method({
  2297. selector: "testHexNumbers",
  2298. category: 'tests',
  2299. fn: function (){
  2300. var self=this;
  2301. smalltalk.send(self,"_assert_",[smalltalk.send((9),"__eq",[(9)])]);
  2302. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((10),"_truncated",[]),"__eq",[(10)])]);
  2303. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((11),"_truncated",[]),"__eq",[(11)])]);
  2304. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((12),"_truncated",[]),"__eq",[(12)])]);
  2305. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((13),"_truncated",[]),"__eq",[(13)])]);
  2306. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((14),"_truncated",[]),"__eq",[(14)])]);
  2307. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((15),"_truncated",[]),"__eq",[(15)])]);
  2308. return self},
  2309. args: [],
  2310. source: "testHexNumbers\x0a\x0a\x09self assert: 16r9 = 9.\x0a\x09self assert: 16rA truncated = 10.\x0a\x09self assert: 16rB truncated = 11.\x0a\x09self assert: 16rC truncated = 12.\x0a\x09self assert: 16rD truncated = 13.\x0a\x09self assert: 16rE truncated = 14.\x0a\x09self assert: 16rF truncated = 15",
  2311. messageSends: ["assert:", "=", "truncated"],
  2312. referencedClasses: []
  2313. }),
  2314. smalltalk.NumberTest);
  2315. smalltalk.addMethod(
  2316. "_testIdentity",
  2317. smalltalk.method({
  2318. selector: "testIdentity",
  2319. category: 'tests',
  2320. fn: function (){
  2321. var self=this;
  2322. smalltalk.send(self,"_assert_",[smalltalk.send((1),"__eq_eq",[(1)])]);
  2323. smalltalk.send(self,"_assert_",[smalltalk.send((0),"__eq_eq",[(0)])]);
  2324. smalltalk.send(self,"_deny_",[smalltalk.send((1),"__eq_eq",[(0)])]);
  2325. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((1),"_yourself",[]),"__eq_eq",[(1)])]);
  2326. smalltalk.send(self,"_assert_",[smalltalk.send((1),"__eq_eq",[smalltalk.send((1),"_yourself",[])])]);
  2327. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((1),"_yourself",[]),"__eq_eq",[smalltalk.send((1),"_yourself",[])])]);
  2328. smalltalk.send(self,"_deny_",[smalltalk.send((1),"__eq_eq",[(2)])]);
  2329. return self},
  2330. args: [],
  2331. 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",
  2332. messageSends: ["assert:", "==", "deny:", "yourself"],
  2333. referencedClasses: []
  2334. }),
  2335. smalltalk.NumberTest);
  2336. smalltalk.addMethod(
  2337. "_testInvalidHexNumbers",
  2338. smalltalk.method({
  2339. selector: "testInvalidHexNumbers",
  2340. category: 'tests',
  2341. fn: function (){
  2342. var self=this;
  2343. smalltalk.send(self,"_should_raise_",[(function(){
  2344. return smalltalk.send((16),"_rG",[]);
  2345. }),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  2346. smalltalk.send(self,"_should_raise_",[(function(){
  2347. return smalltalk.send((16),"_rg",[]);
  2348. }),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  2349. smalltalk.send(self,"_should_raise_",[(function(){
  2350. return smalltalk.send((16),"_rH",[]);
  2351. }),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  2352. smalltalk.send(self,"_should_raise_",[(function(){
  2353. return smalltalk.send((16),"_rh",[]);
  2354. }),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  2355. smalltalk.send(self,"_should_raise_",[(function(){
  2356. return smalltalk.send((16),"_rI",[]);
  2357. }),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  2358. smalltalk.send(self,"_should_raise_",[(function(){
  2359. return smalltalk.send((16),"_ri",[]);
  2360. }),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  2361. smalltalk.send(self,"_should_raise_",[(function(){
  2362. return smalltalk.send((16),"_rJ",[]);
  2363. }),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  2364. smalltalk.send(self,"_should_raise_",[(function(){
  2365. return smalltalk.send((16),"_rj",[]);
  2366. }),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  2367. smalltalk.send(self,"_should_raise_",[(function(){
  2368. return smalltalk.send((16),"_rK",[]);
  2369. }),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  2370. smalltalk.send(self,"_should_raise_",[(function(){
  2371. return smalltalk.send((16),"_rk",[]);
  2372. }),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  2373. smalltalk.send(self,"_should_raise_",[(function(){
  2374. return smalltalk.send((16),"_rL",[]);
  2375. }),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  2376. smalltalk.send(self,"_should_raise_",[(function(){
  2377. return smalltalk.send((16),"_rl",[]);
  2378. }),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  2379. smalltalk.send(self,"_should_raise_",[(function(){
  2380. return smalltalk.send((16),"_rM",[]);
  2381. }),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  2382. smalltalk.send(self,"_should_raise_",[(function(){
  2383. return smalltalk.send((16),"_rm",[]);
  2384. }),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  2385. smalltalk.send(self,"_should_raise_",[(function(){
  2386. return smalltalk.send((16),"_rN",[]);
  2387. }),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  2388. smalltalk.send(self,"_should_raise_",[(function(){
  2389. return smalltalk.send((16),"_rn",[]);
  2390. }),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  2391. smalltalk.send(self,"_should_raise_",[(function(){
  2392. return smalltalk.send((16),"_rO",[]);
  2393. }),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  2394. smalltalk.send(self,"_should_raise_",[(function(){
  2395. return smalltalk.send((16),"_ro",[]);
  2396. }),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  2397. smalltalk.send(self,"_should_raise_",[(function(){
  2398. return smalltalk.send((16),"_rP",[]);
  2399. }),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  2400. smalltalk.send(self,"_should_raise_",[(function(){
  2401. return smalltalk.send((16),"_rp",[]);
  2402. }),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  2403. smalltalk.send(self,"_should_raise_",[(function(){
  2404. return smalltalk.send((16),"_rQ",[]);
  2405. }),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  2406. smalltalk.send(self,"_should_raise_",[(function(){
  2407. return smalltalk.send((16),"_rq",[]);
  2408. }),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  2409. smalltalk.send(self,"_should_raise_",[(function(){
  2410. return smalltalk.send((16),"_rR",[]);
  2411. }),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  2412. smalltalk.send(self,"_should_raise_",[(function(){
  2413. return smalltalk.send((16),"_rr",[]);
  2414. }),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  2415. smalltalk.send(self,"_should_raise_",[(function(){
  2416. return smalltalk.send((16),"_rS",[]);
  2417. }),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  2418. smalltalk.send(self,"_should_raise_",[(function(){
  2419. return smalltalk.send((16),"_rs",[]);
  2420. }),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  2421. smalltalk.send(self,"_should_raise_",[(function(){
  2422. return smalltalk.send((16),"_rT",[]);
  2423. }),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  2424. smalltalk.send(self,"_should_raise_",[(function(){
  2425. return smalltalk.send((16),"_rt",[]);
  2426. }),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  2427. smalltalk.send(self,"_should_raise_",[(function(){
  2428. return smalltalk.send((16),"_rU",[]);
  2429. }),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  2430. smalltalk.send(self,"_should_raise_",[(function(){
  2431. return smalltalk.send((16),"_ru",[]);
  2432. }),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  2433. smalltalk.send(self,"_should_raise_",[(function(){
  2434. return smalltalk.send((16),"_rV",[]);
  2435. }),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  2436. smalltalk.send(self,"_should_raise_",[(function(){
  2437. return smalltalk.send((16),"_rv",[]);
  2438. }),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  2439. smalltalk.send(self,"_should_raise_",[(function(){
  2440. return smalltalk.send((16),"_rW",[]);
  2441. }),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  2442. smalltalk.send(self,"_should_raise_",[(function(){
  2443. return smalltalk.send((16),"_rw",[]);
  2444. }),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  2445. smalltalk.send(self,"_should_raise_",[(function(){
  2446. return smalltalk.send((16),"_rX",[]);
  2447. }),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  2448. smalltalk.send(self,"_should_raise_",[(function(){
  2449. return smalltalk.send((16),"_rx",[]);
  2450. }),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  2451. smalltalk.send(self,"_should_raise_",[(function(){
  2452. return smalltalk.send((16),"_rY",[]);
  2453. }),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  2454. smalltalk.send(self,"_should_raise_",[(function(){
  2455. return smalltalk.send((16),"_ry",[]);
  2456. }),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  2457. smalltalk.send(self,"_should_raise_",[(function(){
  2458. return smalltalk.send((16),"_rZ",[]);
  2459. }),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  2460. smalltalk.send(self,"_should_raise_",[(function(){
  2461. return smalltalk.send((16),"_rz",[]);
  2462. }),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  2463. smalltalk.send(self,"_should_raise_",[(function(){
  2464. return smalltalk.send((11259375),"_Z",[]);
  2465. }),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  2466. return self},
  2467. args: [],
  2468. 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 self should: [16rABcdEfZ] raise: MessageNotUnderstood.",
  2469. 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"],
  2470. referencedClasses: ["MessageNotUnderstood"]
  2471. }),
  2472. smalltalk.NumberTest);
  2473. smalltalk.addMethod(
  2474. "_testMinMax",
  2475. smalltalk.method({
  2476. selector: "testMinMax",
  2477. category: 'tests',
  2478. fn: function (){
  2479. var self=this;
  2480. smalltalk.send(self,"_assert_equals_",[smalltalk.send((2),"_max_",[(5)]),(5)]);
  2481. smalltalk.send(self,"_assert_equals_",[smalltalk.send((2),"_min_",[(5)]),(2)]);
  2482. return self},
  2483. args: [],
  2484. source: "testMinMax\x0a\x09\x0a\x09self assert: (2 max: 5) equals: 5.\x0a\x09self assert: (2 min: 5) equals: 2",
  2485. messageSends: ["assert:equals:", "max:", "min:"],
  2486. referencedClasses: []
  2487. }),
  2488. smalltalk.NumberTest);
  2489. smalltalk.addMethod(
  2490. "_testNegated",
  2491. smalltalk.method({
  2492. selector: "testNegated",
  2493. category: 'tests',
  2494. fn: function (){
  2495. var self=this;
  2496. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((3),"_negated",[]),"__eq",[(-3)])]);
  2497. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((-3),"_negated",[]),"__eq",[(3)])]);
  2498. return self},
  2499. args: [],
  2500. source: "testNegated\x0a\x09self assert: 3 negated = -3.\x0a\x09self assert: -3 negated = 3",
  2501. messageSends: ["assert:", "=", "negated"],
  2502. referencedClasses: []
  2503. }),
  2504. smalltalk.NumberTest);
  2505. smalltalk.addMethod(
  2506. "_testPrintShowingDecimalPlaces",
  2507. smalltalk.method({
  2508. selector: "testPrintShowingDecimalPlaces",
  2509. category: 'tests',
  2510. fn: function (){
  2511. var self=this;
  2512. smalltalk.send(self,"_assert_equals_",["23.00",smalltalk.send((23),"_printShowingDecimalPlaces_",[(2)])]);
  2513. smalltalk.send(self,"_assert_equals_",["23.57",smalltalk.send((23.5698),"_printShowingDecimalPlaces_",[(2)])]);
  2514. smalltalk.send(self,"_assert_equals_",["-234.56700",smalltalk.send(smalltalk.send((234.567),"_negated",[]),"_printShowingDecimalPlaces_",[(5)])]);
  2515. smalltalk.send(self,"_assert_equals_",["23",smalltalk.send((23.4567),"_printShowingDecimalPlaces_",[(0)])]);
  2516. smalltalk.send(self,"_assert_equals_",["24",smalltalk.send((23.5567),"_printShowingDecimalPlaces_",[(0)])]);
  2517. smalltalk.send(self,"_assert_equals_",["-23",smalltalk.send(smalltalk.send((23.4567),"_negated",[]),"_printShowingDecimalPlaces_",[(0)])]);
  2518. smalltalk.send(self,"_assert_equals_",["-24",smalltalk.send(smalltalk.send((23.5567),"_negated",[]),"_printShowingDecimalPlaces_",[(0)])]);
  2519. smalltalk.send(self,"_assert_equals_",["100000000.0",smalltalk.send((100000000),"_printShowingDecimalPlaces_",[(1)])]);
  2520. smalltalk.send(self,"_assert_equals_",["0.98000",smalltalk.send((0.98),"_printShowingDecimalPlaces_",[(5)])]);
  2521. smalltalk.send(self,"_assert_equals_",["-0.98",smalltalk.send(smalltalk.send((0.98),"_negated",[]),"_printShowingDecimalPlaces_",[(2)])]);
  2522. smalltalk.send(self,"_assert_equals_",["2.57",smalltalk.send((2.567),"_printShowingDecimalPlaces_",[(2)])]);
  2523. smalltalk.send(self,"_assert_equals_",["-2.57",smalltalk.send((-2.567),"_printShowingDecimalPlaces_",[(2)])]);
  2524. smalltalk.send(self,"_assert_equals_",["0.00",smalltalk.send((0),"_printShowingDecimalPlaces_",[(2)])]);
  2525. return self},
  2526. args: [],
  2527. source: "testPrintShowingDecimalPlaces\x0a\x09self assert: '23.00' equals: (23 printShowingDecimalPlaces: 2).\x0a\x09self assert: '23.57' equals: (23.5698 printShowingDecimalPlaces: 2).\x0a\x09self assert: '-234.56700' equals:( 234.567 negated printShowingDecimalPlaces: 5).\x0a\x09self assert: '23' equals: (23.4567 printShowingDecimalPlaces: 0).\x0a\x09self assert: '24' equals: (23.5567 printShowingDecimalPlaces: 0).\x0a\x09self assert: '-23' equals: (23.4567 negated printShowingDecimalPlaces: 0).\x0a\x09self assert: '-24' equals: (23.5567 negated printShowingDecimalPlaces: 0).\x0a\x09self assert: '100000000.0' equals: (100000000 printShowingDecimalPlaces: 1).\x0a\x09self assert: '0.98000' equals: (0.98 printShowingDecimalPlaces: 5).\x0a\x09self assert: '-0.98' equals: (0.98 negated printShowingDecimalPlaces: 2).\x0a\x09self assert: '2.57' equals: (2.567 printShowingDecimalPlaces: 2).\x0a\x09self assert: '-2.57' equals: (-2.567 printShowingDecimalPlaces: 2).\x0a\x09self assert: '0.00' equals: (0 printShowingDecimalPlaces: 2).",
  2528. messageSends: ["assert:equals:", "printShowingDecimalPlaces:", "negated"],
  2529. referencedClasses: []
  2530. }),
  2531. smalltalk.NumberTest);
  2532. smalltalk.addMethod(
  2533. "_testRounded",
  2534. smalltalk.method({
  2535. selector: "testRounded",
  2536. category: 'tests',
  2537. fn: function (){
  2538. var self=this;
  2539. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((3),"_rounded",[]),"__eq",[(3)])]);
  2540. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((3.212),"_rounded",[]),"__eq",[(3)])]);
  2541. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((3.51),"_rounded",[]),"__eq",[(4)])]);
  2542. return self},
  2543. args: [],
  2544. source: "testRounded\x0a\x09\x0a\x09self assert: 3 rounded = 3.\x0a\x09self assert: 3.212 rounded = 3.\x0a\x09self assert: 3.51 rounded = 4",
  2545. messageSends: ["assert:", "=", "rounded"],
  2546. referencedClasses: []
  2547. }),
  2548. smalltalk.NumberTest);
  2549. smalltalk.addMethod(
  2550. "_testSqrt",
  2551. smalltalk.method({
  2552. selector: "testSqrt",
  2553. category: 'tests',
  2554. fn: function (){
  2555. var self=this;
  2556. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((4),"_sqrt",[]),"__eq",[(2)])]);
  2557. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((16),"_sqrt",[]),"__eq",[(4)])]);
  2558. return self},
  2559. args: [],
  2560. source: "testSqrt\x0a\x09\x0a\x09self assert: 4 sqrt = 2.\x0a\x09self assert: 16 sqrt = 4",
  2561. messageSends: ["assert:", "=", "sqrt"],
  2562. referencedClasses: []
  2563. }),
  2564. smalltalk.NumberTest);
  2565. smalltalk.addMethod(
  2566. "_testSquared",
  2567. smalltalk.method({
  2568. selector: "testSquared",
  2569. category: 'tests',
  2570. fn: function (){
  2571. var self=this;
  2572. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((4),"_squared",[]),"__eq",[(16)])]);
  2573. return self},
  2574. args: [],
  2575. source: "testSquared\x0a\x09\x0a\x09self assert: 4 squared = 16",
  2576. messageSends: ["assert:", "=", "squared"],
  2577. referencedClasses: []
  2578. }),
  2579. smalltalk.NumberTest);
  2580. smalltalk.addMethod(
  2581. "_testTimesRepeat",
  2582. smalltalk.method({
  2583. selector: "testTimesRepeat",
  2584. category: 'tests',
  2585. fn: function (){
  2586. var self=this;
  2587. var i;
  2588. i=(0);
  2589. smalltalk.send((0),"_timesRepeat_",[(function(){
  2590. i=smalltalk.send(i,"__plus",[(1)]);
  2591. return i;
  2592. })]);
  2593. smalltalk.send(self,"_assert_equals_",[i,(0)]);
  2594. smalltalk.send((5),"_timesRepeat_",[(function(){
  2595. i=smalltalk.send(i,"__plus",[(1)]);
  2596. return i;
  2597. })]);
  2598. smalltalk.send(self,"_assert_equals_",[i,(5)]);
  2599. return self},
  2600. args: [],
  2601. 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",
  2602. messageSends: ["timesRepeat:", "+", "assert:equals:"],
  2603. referencedClasses: []
  2604. }),
  2605. smalltalk.NumberTest);
  2606. smalltalk.addMethod(
  2607. "_testTo",
  2608. smalltalk.method({
  2609. selector: "testTo",
  2610. category: 'tests',
  2611. fn: function (){
  2612. var self=this;
  2613. smalltalk.send(self,"_assert_equals_",[smalltalk.send((1),"_to_",[(5)]),[(1), (2), (3), (4), (5)]]);
  2614. return self},
  2615. args: [],
  2616. source: "testTo\x0a\x09self assert: (1 to: 5) equals: #(1 2 3 4 5)",
  2617. messageSends: ["assert:equals:", "to:"],
  2618. referencedClasses: []
  2619. }),
  2620. smalltalk.NumberTest);
  2621. smalltalk.addMethod(
  2622. "_testToBy",
  2623. smalltalk.method({
  2624. selector: "testToBy",
  2625. category: 'tests',
  2626. fn: function (){
  2627. var self=this;
  2628. smalltalk.send(self,"_assert_equals_",[smalltalk.send((0),"_to_by_",[(6),(2)]),[(0), (2), (4), (6)]]);
  2629. smalltalk.send(self,"_should_raise_",[(function(){
  2630. return smalltalk.send((1),"_to_by_",[(4),(0)]);
  2631. }),(smalltalk.Error || Error)]);
  2632. return self},
  2633. args: [],
  2634. 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",
  2635. messageSends: ["assert:equals:", "to:by:", "should:raise:"],
  2636. referencedClasses: ["Error"]
  2637. }),
  2638. smalltalk.NumberTest);
  2639. smalltalk.addMethod(
  2640. "_testTruncated",
  2641. smalltalk.method({
  2642. selector: "testTruncated",
  2643. category: 'tests',
  2644. fn: function (){
  2645. var self=this;
  2646. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((3),"_truncated",[]),"__eq",[(3)])]);
  2647. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((3.212),"_truncated",[]),"__eq",[(3)])]);
  2648. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((3.51),"_truncated",[]),"__eq",[(3)])]);
  2649. return self},
  2650. args: [],
  2651. source: "testTruncated\x0a\x09\x0a\x09self assert: 3 truncated = 3.\x0a\x09self assert: 3.212 truncated = 3.\x0a\x09self assert: 3.51 truncated = 3",
  2652. messageSends: ["assert:", "=", "truncated"],
  2653. referencedClasses: []
  2654. }),
  2655. smalltalk.NumberTest);
  2656. smalltalk.addClass('ObjectMock', smalltalk.Object, ['foo', 'bar'], 'Kernel-Tests');
  2657. smalltalk.addMethod(
  2658. "_foo",
  2659. smalltalk.method({
  2660. selector: "foo",
  2661. category: 'not yet classified',
  2662. fn: function (){
  2663. var self=this;
  2664. return self["@foo"];
  2665. },
  2666. args: [],
  2667. source: "foo\x0a\x09^foo",
  2668. messageSends: [],
  2669. referencedClasses: []
  2670. }),
  2671. smalltalk.ObjectMock);
  2672. smalltalk.addMethod(
  2673. "_foo_",
  2674. smalltalk.method({
  2675. selector: "foo:",
  2676. category: 'not yet classified',
  2677. fn: function (anObject){
  2678. var self=this;
  2679. self["@foo"]=anObject;
  2680. return self},
  2681. args: ["anObject"],
  2682. source: "foo: anObject\x0a\x09foo := anObject",
  2683. messageSends: [],
  2684. referencedClasses: []
  2685. }),
  2686. smalltalk.ObjectMock);
  2687. smalltalk.addClass('ObjectTest', smalltalk.TestCase, [], 'Kernel-Tests');
  2688. smalltalk.addMethod(
  2689. "_testBasicAccess",
  2690. smalltalk.method({
  2691. selector: "testBasicAccess",
  2692. category: 'tests',
  2693. fn: function (){
  2694. var self=this;
  2695. var o;
  2696. o=smalltalk.send((smalltalk.Object || Object),"_new",[]);
  2697. smalltalk.send(o,"_basicAt_put_",["a",(1)]);
  2698. smalltalk.send(self,"_assert_equals_",[smalltalk.send(o,"_basicAt_",["a"]),(1)]);
  2699. smalltalk.send(self,"_assert_equals_",[smalltalk.send(o,"_basicAt_",["b"]),nil]);
  2700. return self},
  2701. args: [],
  2702. 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",
  2703. messageSends: ["new", "basicAt:put:", "assert:equals:", "basicAt:"],
  2704. referencedClasses: ["Object"]
  2705. }),
  2706. smalltalk.ObjectTest);
  2707. smalltalk.addMethod(
  2708. "_testBasicPerform",
  2709. smalltalk.method({
  2710. selector: "testBasicPerform",
  2711. category: 'tests',
  2712. fn: function (){
  2713. var self=this;
  2714. var o;
  2715. o=smalltalk.send((smalltalk.Object || Object),"_new",[]);
  2716. smalltalk.send(o,"_basicAt_put_",["func",(function(){
  2717. return "hello";
  2718. })]);
  2719. smalltalk.send(o,"_basicAt_put_",["func2",(function(a){
  2720. return smalltalk.send(a,"__plus",[(1)]);
  2721. })]);
  2722. smalltalk.send(self,"_assert_equals_",[smalltalk.send(o,"_basicPerform_",["func"]),"hello"]);
  2723. smalltalk.send(self,"_assert_equals_",[smalltalk.send(o,"_basicPerform_withArguments_",["func2",[(3)]]),(4)]);
  2724. return self},
  2725. args: [],
  2726. source: "testBasicPerform\x0a\x09| o |\x0a\x09o := Object new.\x0a\x09o basicAt: 'func' put: ['hello'].\x09\x0a\x09o basicAt: 'func2' put: [:a | a + 1].\x0a\x0a\x09self assert: (o basicPerform: 'func')\x09 equals: 'hello'.\x0a\x09self assert: (o basicPerform: 'func2' withArguments: #(3)) equals: 4",
  2727. messageSends: ["new", "basicAt:put:", "+", "assert:equals:", "basicPerform:", "basicPerform:withArguments:"],
  2728. referencedClasses: ["Object"]
  2729. }),
  2730. smalltalk.ObjectTest);
  2731. smalltalk.addMethod(
  2732. "_testDNU",
  2733. smalltalk.method({
  2734. selector: "testDNU",
  2735. category: 'tests',
  2736. fn: function (){
  2737. var self=this;
  2738. smalltalk.send(self,"_should_raise_",[(function(){
  2739. return smalltalk.send(smalltalk.send((smalltalk.Object || Object),"_new",[]),"_foo",[]);
  2740. }),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  2741. return self},
  2742. args: [],
  2743. source: "testDNU\x0a\x09self should: [Object new foo] raise: MessageNotUnderstood",
  2744. messageSends: ["should:raise:", "foo", "new"],
  2745. referencedClasses: ["Object", "MessageNotUnderstood"]
  2746. }),
  2747. smalltalk.ObjectTest);
  2748. smalltalk.addMethod(
  2749. "_testEquality",
  2750. smalltalk.method({
  2751. selector: "testEquality",
  2752. category: 'tests',
  2753. fn: function (){
  2754. var self=this;
  2755. var o;
  2756. o=smalltalk.send((smalltalk.Object || Object),"_new",[]);
  2757. smalltalk.send(self,"_deny_",[smalltalk.send(o,"__eq",[smalltalk.send((smalltalk.Object || Object),"_new",[])])]);
  2758. smalltalk.send(self,"_assert_",[smalltalk.send(o,"__eq",[o])]);
  2759. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(o,"_yourself",[]),"__eq",[o])]);
  2760. smalltalk.send(self,"_assert_",[smalltalk.send(o,"__eq",[smalltalk.send(o,"_yourself",[])])]);
  2761. return self},
  2762. args: [],
  2763. 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",
  2764. messageSends: ["new", "deny:", "=", "assert:", "yourself"],
  2765. referencedClasses: ["Object"]
  2766. }),
  2767. smalltalk.ObjectTest);
  2768. smalltalk.addMethod(
  2769. "_testHalt",
  2770. smalltalk.method({
  2771. selector: "testHalt",
  2772. category: 'tests',
  2773. fn: function (){
  2774. var self=this;
  2775. smalltalk.send(self,"_should_raise_",[(function(){
  2776. return smalltalk.send(smalltalk.send((smalltalk.Object || Object),"_new",[]),"_halt",[]);
  2777. }),(smalltalk.Error || Error)]);
  2778. return self},
  2779. args: [],
  2780. source: "testHalt\x0a\x09self should: [Object new halt] raise: Error",
  2781. messageSends: ["should:raise:", "halt", "new"],
  2782. referencedClasses: ["Object", "Error"]
  2783. }),
  2784. smalltalk.ObjectTest);
  2785. smalltalk.addMethod(
  2786. "_testIdentity",
  2787. smalltalk.method({
  2788. selector: "testIdentity",
  2789. category: 'tests',
  2790. fn: function (){
  2791. var self=this;
  2792. var o;
  2793. o=smalltalk.send((smalltalk.Object || Object),"_new",[]);
  2794. smalltalk.send(self,"_deny_",[smalltalk.send(o,"__eq_eq",[smalltalk.send((smalltalk.Object || Object),"_new",[])])]);
  2795. smalltalk.send(self,"_assert_",[smalltalk.send(o,"__eq_eq",[o])]);
  2796. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(o,"_yourself",[]),"__eq_eq",[o])]);
  2797. smalltalk.send(self,"_assert_",[smalltalk.send(o,"__eq_eq",[smalltalk.send(o,"_yourself",[])])]);
  2798. return self},
  2799. args: [],
  2800. 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",
  2801. messageSends: ["new", "deny:", "==", "assert:", "yourself"],
  2802. referencedClasses: ["Object"]
  2803. }),
  2804. smalltalk.ObjectTest);
  2805. smalltalk.addMethod(
  2806. "_testIfNil",
  2807. smalltalk.method({
  2808. selector: "testIfNil",
  2809. category: 'tests',
  2810. fn: function (){
  2811. var self=this;
  2812. var $2,$1,$4,$3,$6,$5;
  2813. smalltalk.send(self,"_deny_",[smalltalk.send(smalltalk.send((smalltalk.Object || Object),"_new",[]),"_isNil",[])]);
  2814. $2=smalltalk.send((smalltalk.Object || Object),"_new",[]);
  2815. if(($receiver = $2) == nil || $receiver == undefined){
  2816. $1=true;
  2817. } else {
  2818. $1=$2;
  2819. };
  2820. smalltalk.send(self,"_deny_",[smalltalk.send($1,"__eq",[true])]);
  2821. $4=smalltalk.send((smalltalk.Object || Object),"_new",[]);
  2822. if(($receiver = $4) == nil || $receiver == undefined){
  2823. $3=$4;
  2824. } else {
  2825. $3=true;
  2826. };
  2827. smalltalk.send(self,"_assert_",[smalltalk.send($3,"__eq",[true])]);
  2828. $6=smalltalk.send((smalltalk.Object || Object),"_new",[]);
  2829. if(($receiver = $6) == nil || $receiver == undefined){
  2830. $5=false;
  2831. } else {
  2832. $5=true;
  2833. };
  2834. smalltalk.send(self,"_assert_",[smalltalk.send($5,"__eq",[true])]);
  2835. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Object || Object),"_new",[]),"_ifNotNil_ifNil_",[(function(){
  2836. return true;
  2837. }),(function(){
  2838. return false;
  2839. })]),"__eq",[true])]);
  2840. return self},
  2841. args: [],
  2842. source: "testIfNil\x0a\x09self deny: Object new isNil.\x0a\x09self deny: (Object new ifNil: [true]) = true.\x0a\x09self assert: (Object new ifNotNil: [true]) = true.\x0a\x0a\x09self assert: (Object new ifNil: [false] ifNotNil: [true]) = true.\x0a\x09self assert: (Object new ifNotNil: [true] ifNil: [false]) = true",
  2843. messageSends: ["deny:", "isNil", "new", "=", "ifNil:", "assert:", "ifNotNil:", "ifNil:ifNotNil:", "ifNotNil:ifNil:"],
  2844. referencedClasses: ["Object"]
  2845. }),
  2846. smalltalk.ObjectTest);
  2847. smalltalk.addMethod(
  2848. "_testInstVars",
  2849. smalltalk.method({
  2850. selector: "testInstVars",
  2851. category: 'tests',
  2852. fn: function (){
  2853. var self=this;
  2854. var o;
  2855. o=smalltalk.send((smalltalk.ObjectMock || ObjectMock),"_new",[]);
  2856. smalltalk.send(self,"_assert_equals_",[smalltalk.send(o,"_instVarAt_",[smalltalk.symbolFor("foo")]),nil]);
  2857. smalltalk.send(o,"_instVarAt_put_",[smalltalk.symbolFor("foo"),(1)]);
  2858. smalltalk.send(self,"_assert_equals_",[smalltalk.send(o,"_instVarAt_",[smalltalk.symbolFor("foo")]),(1)]);
  2859. smalltalk.send(self,"_assert_equals_",[smalltalk.send(o,"_instVarAt_",["foo"]),(1)]);
  2860. return self},
  2861. args: [],
  2862. 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",
  2863. messageSends: ["new", "assert:equals:", "instVarAt:", "instVarAt:put:"],
  2864. referencedClasses: ["ObjectMock"]
  2865. }),
  2866. smalltalk.ObjectTest);
  2867. smalltalk.addMethod(
  2868. "_testNilUndefined",
  2869. smalltalk.method({
  2870. selector: "testNilUndefined",
  2871. category: 'tests',
  2872. fn: function (){
  2873. var self=this;
  2874. var notDefined;
  2875. notDefined = undefined;
  2876. ;
  2877. smalltalk.send(self,"_assert_",[smalltalk.send(nil,"__eq",[notDefined])]);
  2878. return self},
  2879. args: [],
  2880. source: "testNilUndefined\x0a\x09\x22nil in Smalltalk is the undefined object in JS\x22\x0a\x0a\x09| notDefined |\x0a \x0a <notDefined = undefined>.\x0a\x0a\x09self assert: nil = notDefined",
  2881. messageSends: ["assert:", "="],
  2882. referencedClasses: []
  2883. }),
  2884. smalltalk.ObjectTest);
  2885. smalltalk.addMethod(
  2886. "_testYourself",
  2887. smalltalk.method({
  2888. selector: "testYourself",
  2889. category: 'tests',
  2890. fn: function () {
  2891. var self = this;
  2892. var o;
  2893. o = smalltalk.send(smalltalk.ObjectMock || ObjectMock, "_new", []);
  2894. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(o, "_yourself", []), "__eq_eq", [o])]);
  2895. return self;
  2896. },
  2897. args: [],
  2898. source: "testYourself\x0a\x09| o |\x0a\x09o := ObjectMock new.\x0a\x09self assert: o yourself == o",
  2899. messageSends: ["new", "assert:", "==", "yourself"],
  2900. referencedClasses: ["ObjectMock"]
  2901. }),
  2902. smalltalk.ObjectTest);
  2903. smalltalk.addMethod(
  2904. "_testidentityHash",
  2905. smalltalk.method({
  2906. selector: "testidentityHash",
  2907. category: 'tests',
  2908. fn: function () {
  2909. var self = this;
  2910. var o1;
  2911. var o2;
  2912. o1 = smalltalk.send(smalltalk.Object || Object, "_new", []);
  2913. o2 = smalltalk.send(smalltalk.Object || Object, "_new", []);
  2914. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(o1, "_identityHash", []), "__eq_eq", [smalltalk.send(o1, "_identityHash", [])])]);
  2915. smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send(o1, "_identityHash", []), "__eq_eq", [smalltalk.send(o2, "_identityHash", [])])]);
  2916. return self;
  2917. },
  2918. args: [],
  2919. 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",
  2920. messageSends: ["new", "assert:", "==", "identityHash", "deny:"],
  2921. referencedClasses: ["Object"]
  2922. }),
  2923. smalltalk.ObjectTest);
  2924. smalltalk.addClass('PackageTest', smalltalk.TestCase, ['zorkPackage', 'grulPackage', 'backUpCommitPathJs', 'backUpCommitPathSt'], 'Kernel-Tests');
  2925. smalltalk.addMethod(
  2926. "_setUp",
  2927. smalltalk.method({
  2928. selector: "setUp",
  2929. category: 'running',
  2930. fn: function (){
  2931. var self=this;
  2932. var $1,$2;
  2933. self["@backUpCommitPathJs"]=smalltalk.send((smalltalk.Package || Package),"_defaultCommitPathJs",[]);
  2934. self["@backUpCommitPathSt"]=smalltalk.send((smalltalk.Package || Package),"_defaultCommitPathSt",[]);
  2935. smalltalk.send((smalltalk.Package || Package),"_resetCommitPaths",[]);
  2936. self["@zorkPackage"]=smalltalk.send(smalltalk.send((smalltalk.Package || Package),"_new",[]),"_name_",["Zork"]);
  2937. $1=smalltalk.send((smalltalk.Package || Package),"_new",[]);
  2938. smalltalk.send($1,"_name_",["Grul"]);
  2939. smalltalk.send($1,"_commitPathJs_",["server/grul/js"]);
  2940. smalltalk.send($1,"_commitPathSt_",["grul/st"]);
  2941. $2=smalltalk.send($1,"_yourself",[]);
  2942. self["@grulPackage"]=$2;
  2943. return self},
  2944. args: [],
  2945. source: "setUp\x0a\x09backUpCommitPathJs := Package defaultCommitPathJs.\x0a\x09backUpCommitPathSt := Package defaultCommitPathSt.\x0a\x0a\x09Package resetCommitPaths.\x0a\x0a\x09zorkPackage := Package new name: 'Zork'.\x0a\x09grulPackage := Package new \x0a\x09\x09\x09\x09\x09name: 'Grul';\x0a\x09\x09\x09\x09\x09commitPathJs: 'server/grul/js';\x0a\x09\x09\x09\x09\x09commitPathSt: 'grul/st';\x0a\x09\x09\x09\x09\x09yourself",
  2946. messageSends: ["defaultCommitPathJs", "defaultCommitPathSt", "resetCommitPaths", "name:", "new", "commitPathJs:", "commitPathSt:", "yourself"],
  2947. referencedClasses: ["Package"]
  2948. }),
  2949. smalltalk.PackageTest);
  2950. smalltalk.addMethod(
  2951. "_tearDown",
  2952. smalltalk.method({
  2953. selector: "tearDown",
  2954. category: 'running',
  2955. fn: function (){
  2956. var self=this;
  2957. var $1;
  2958. smalltalk.send((smalltalk.Package || Package),"_defaultCommitPathJs_",[self["@backUpCommitPathJs"]]);
  2959. $1=smalltalk.send((smalltalk.Package || Package),"_defaultCommitPathSt_",[self["@backUpCommitPathSt"]]);
  2960. return self},
  2961. args: [],
  2962. source: "tearDown\x0a\x09 Package \x0a\x09\x09defaultCommitPathJs: backUpCommitPathJs;\x0a\x09\x09defaultCommitPathSt: backUpCommitPathSt",
  2963. messageSends: ["defaultCommitPathJs:", "defaultCommitPathSt:"],
  2964. referencedClasses: ["Package"]
  2965. }),
  2966. smalltalk.PackageTest);
  2967. smalltalk.addMethod(
  2968. "_testGrulCommitPathJsShouldBeServerGrulJs",
  2969. smalltalk.method({
  2970. selector: "testGrulCommitPathJsShouldBeServerGrulJs",
  2971. category: 'tests',
  2972. fn: function (){
  2973. var self=this;
  2974. smalltalk.send(self,"_assert_equals_",["server/grul/js",smalltalk.send(self["@grulPackage"],"_commitPathJs",[])]);
  2975. return self},
  2976. args: [],
  2977. source: "testGrulCommitPathJsShouldBeServerGrulJs\x0a\x09self assert: 'server/grul/js' equals: grulPackage commitPathJs",
  2978. messageSends: ["assert:equals:", "commitPathJs"],
  2979. referencedClasses: []
  2980. }),
  2981. smalltalk.PackageTest);
  2982. smalltalk.addMethod(
  2983. "_testGrulCommitPathStShouldBeGrulSt",
  2984. smalltalk.method({
  2985. selector: "testGrulCommitPathStShouldBeGrulSt",
  2986. category: 'tests',
  2987. fn: function (){
  2988. var self=this;
  2989. smalltalk.send(self,"_assert_equals_",["grul/st",smalltalk.send(self["@grulPackage"],"_commitPathSt",[])]);
  2990. return self},
  2991. args: [],
  2992. source: "testGrulCommitPathStShouldBeGrulSt\x0a\x09self assert: 'grul/st' equals: grulPackage commitPathSt",
  2993. messageSends: ["assert:equals:", "commitPathSt"],
  2994. referencedClasses: []
  2995. }),
  2996. smalltalk.PackageTest);
  2997. smalltalk.addMethod(
  2998. "_testZorkCommitPathJsShouldBeJs",
  2999. smalltalk.method({
  3000. selector: "testZorkCommitPathJsShouldBeJs",
  3001. category: 'tests',
  3002. fn: function (){
  3003. var self=this;
  3004. smalltalk.send(self,"_assert_equals_",["js",smalltalk.send(self["@zorkPackage"],"_commitPathJs",[])]);
  3005. return self},
  3006. args: [],
  3007. source: "testZorkCommitPathJsShouldBeJs\x0a\x09self assert: 'js' equals: zorkPackage commitPathJs",
  3008. messageSends: ["assert:equals:", "commitPathJs"],
  3009. referencedClasses: []
  3010. }),
  3011. smalltalk.PackageTest);
  3012. smalltalk.addMethod(
  3013. "_testZorkCommitPathStShouldBeSt",
  3014. smalltalk.method({
  3015. selector: "testZorkCommitPathStShouldBeSt",
  3016. category: 'tests',
  3017. fn: function (){
  3018. var self=this;
  3019. smalltalk.send(self,"_assert_equals_",["st",smalltalk.send(self["@zorkPackage"],"_commitPathSt",[])]);
  3020. return self},
  3021. args: [],
  3022. source: "testZorkCommitPathStShouldBeSt\x0a\x09self assert: 'st' equals: zorkPackage commitPathSt",
  3023. messageSends: ["assert:equals:", "commitPathSt"],
  3024. referencedClasses: []
  3025. }),
  3026. smalltalk.PackageTest);
  3027. smalltalk.addClass('PackageWithDefaultCommitPathChangedTest', smalltalk.PackageTest, [], 'Kernel-Tests');
  3028. smalltalk.addMethod(
  3029. "_setUp",
  3030. smalltalk.method({
  3031. selector: "setUp",
  3032. category: 'running',
  3033. fn: function (){
  3034. var self=this;
  3035. var $1;
  3036. smalltalk.send(self,"_setUp",[],smalltalk.PackageTest);
  3037. smalltalk.send((smalltalk.Package || Package),"_defaultCommitPathJs_",["javascripts/"]);
  3038. $1=smalltalk.send((smalltalk.Package || Package),"_defaultCommitPathSt_",["smalltalk/"]);
  3039. return self},
  3040. args: [],
  3041. source: "setUp\x0a\x09super setUp.\x0a\x0a\x09Package\x0a\x09\x09defaultCommitPathJs: 'javascripts/';\x0a\x09\x09defaultCommitPathSt: 'smalltalk/'.",
  3042. messageSends: ["setUp", "defaultCommitPathJs:", "defaultCommitPathSt:"],
  3043. referencedClasses: ["Package"]
  3044. }),
  3045. smalltalk.PackageWithDefaultCommitPathChangedTest);
  3046. smalltalk.addMethod(
  3047. "_testGrulCommitPathJsShouldBeServerGrulJs",
  3048. smalltalk.method({
  3049. selector: "testGrulCommitPathJsShouldBeServerGrulJs",
  3050. category: 'tests',
  3051. fn: function (){
  3052. var self=this;
  3053. smalltalk.send(self,"_assert_equals_",["server/grul/js",smalltalk.send(self["@grulPackage"],"_commitPathJs",[])]);
  3054. return self},
  3055. args: [],
  3056. source: "testGrulCommitPathJsShouldBeServerGrulJs\x0a\x09self assert: 'server/grul/js' equals: grulPackage commitPathJs",
  3057. messageSends: ["assert:equals:", "commitPathJs"],
  3058. referencedClasses: []
  3059. }),
  3060. smalltalk.PackageWithDefaultCommitPathChangedTest);
  3061. smalltalk.addMethod(
  3062. "_testGrulCommitPathStShouldBeGrulSt",
  3063. smalltalk.method({
  3064. selector: "testGrulCommitPathStShouldBeGrulSt",
  3065. category: 'tests',
  3066. fn: function (){
  3067. var self=this;
  3068. smalltalk.send(self,"_assert_equals_",["grul/st",smalltalk.send(self["@grulPackage"],"_commitPathSt",[])]);
  3069. return self},
  3070. args: [],
  3071. source: "testGrulCommitPathStShouldBeGrulSt\x0a\x09self assert: 'grul/st' equals: grulPackage commitPathSt",
  3072. messageSends: ["assert:equals:", "commitPathSt"],
  3073. referencedClasses: []
  3074. }),
  3075. smalltalk.PackageWithDefaultCommitPathChangedTest);
  3076. smalltalk.addMethod(
  3077. "_testZorkCommitPathJsShouldBeJavascript",
  3078. smalltalk.method({
  3079. selector: "testZorkCommitPathJsShouldBeJavascript",
  3080. category: 'tests',
  3081. fn: function (){
  3082. var self=this;
  3083. smalltalk.send(self,"_assert_equals_",["javascripts/",smalltalk.send(self["@zorkPackage"],"_commitPathJs",[])]);
  3084. return self},
  3085. args: [],
  3086. source: "testZorkCommitPathJsShouldBeJavascript\x0a\x09self assert: 'javascripts/' equals: zorkPackage commitPathJs",
  3087. messageSends: ["assert:equals:", "commitPathJs"],
  3088. referencedClasses: []
  3089. }),
  3090. smalltalk.PackageWithDefaultCommitPathChangedTest);
  3091. smalltalk.addMethod(
  3092. "_testZorkCommitPathStShouldBeSmalltalk",
  3093. smalltalk.method({
  3094. selector: "testZorkCommitPathStShouldBeSmalltalk",
  3095. category: 'tests',
  3096. fn: function (){
  3097. var self=this;
  3098. smalltalk.send(self,"_assert_equals_",["smalltalk/",smalltalk.send(self["@zorkPackage"],"_commitPathSt",[])]);
  3099. return self},
  3100. args: [],
  3101. source: "testZorkCommitPathStShouldBeSmalltalk\x0a\x09self assert: 'smalltalk/' equals: zorkPackage commitPathSt",
  3102. messageSends: ["assert:equals:", "commitPathSt"],
  3103. referencedClasses: []
  3104. }),
  3105. smalltalk.PackageWithDefaultCommitPathChangedTest);
  3106. smalltalk.addMethod(
  3107. "_shouldInheritSelectors",
  3108. smalltalk.method({
  3109. selector: "shouldInheritSelectors",
  3110. category: 'accessing',
  3111. fn: function (){
  3112. var self=this;
  3113. return false;
  3114. },
  3115. args: [],
  3116. source: "shouldInheritSelectors\x0a\x09^ false",
  3117. messageSends: [],
  3118. referencedClasses: []
  3119. }),
  3120. smalltalk.PackageWithDefaultCommitPathChangedTest.klass);
  3121. smalltalk.addClass('PointTest', smalltalk.TestCase, [], 'Kernel-Tests');
  3122. smalltalk.addMethod(
  3123. "_testAccessing",
  3124. smalltalk.method({
  3125. selector: "testAccessing",
  3126. category: 'tests',
  3127. fn: function (){
  3128. var self=this;
  3129. smalltalk.send(self,"_assert_equals_",[smalltalk.send(smalltalk.send((smalltalk.Point || Point),"_x_y_",[(3),(4)]),"_x",[]),(3)]);
  3130. smalltalk.send(self,"_assert_equals_",[smalltalk.send(smalltalk.send((smalltalk.Point || Point),"_x_y_",[(3),(4)]),"_y",[]),(4)]);
  3131. smalltalk.send(self,"_assert_equals_",[smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Point || Point),"_new",[]),"_x_",[(3)]),"_x",[]),(3)]);
  3132. smalltalk.send(self,"_assert_equals_",[smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Point || Point),"_new",[]),"_y_",[(4)]),"_y",[]),(4)]);
  3133. return self},
  3134. args: [],
  3135. 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",
  3136. messageSends: ["assert:equals:", "x", "x:y:", "y", "x:", "new", "y:"],
  3137. referencedClasses: ["Point"]
  3138. }),
  3139. smalltalk.PointTest);
  3140. smalltalk.addMethod(
  3141. "_testArithmetic",
  3142. smalltalk.method({
  3143. selector: "testArithmetic",
  3144. category: 'tests',
  3145. fn: function (){
  3146. var self=this;
  3147. smalltalk.send(self,"_assert_equals_",[smalltalk.send(smalltalk.send((3),"__at",[(4)]),"__star",[smalltalk.send((3),"__at",[(4)])]),smalltalk.send((smalltalk.Point || Point),"_x_y_",[(9),(16)])]);
  3148. smalltalk.send(self,"_assert_equals_",[smalltalk.send(smalltalk.send((3),"__at",[(4)]),"__plus",[smalltalk.send((3),"__at",[(4)])]),smalltalk.send((smalltalk.Point || Point),"_x_y_",[(6),(8)])]);
  3149. smalltalk.send(self,"_assert_equals_",[smalltalk.send(smalltalk.send((3),"__at",[(4)]),"__minus",[smalltalk.send((3),"__at",[(4)])]),smalltalk.send((smalltalk.Point || Point),"_x_y_",[(0),(0)])]);
  3150. smalltalk.send(self,"_assert_equals_",[smalltalk.send(smalltalk.send((6),"__at",[(8)]),"__slash",[smalltalk.send((3),"__at",[(4)])]),smalltalk.send((smalltalk.Point || Point),"_x_y_",[(2),(2)])]);
  3151. return self},
  3152. args: [],
  3153. 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)",
  3154. messageSends: ["assert:equals:", "*", "@", "x:y:", "+", "-", "/"],
  3155. referencedClasses: ["Point"]
  3156. }),
  3157. smalltalk.PointTest);
  3158. smalltalk.addMethod(
  3159. "_testAt",
  3160. smalltalk.method({
  3161. selector: "testAt",
  3162. category: 'tests',
  3163. fn: function (){
  3164. var self=this;
  3165. smalltalk.send(self,"_assert_equals_",[smalltalk.send((3),"__at",[(4)]),smalltalk.send((smalltalk.Point || Point),"_x_y_",[(3),(4)])]);
  3166. return self},
  3167. args: [],
  3168. source: "testAt\x0a\x09self assert: 3@4 equals: (Point x: 3 y: 4)",
  3169. messageSends: ["assert:equals:", "@", "x:y:"],
  3170. referencedClasses: ["Point"]
  3171. }),
  3172. smalltalk.PointTest);
  3173. smalltalk.addMethod(
  3174. "_testEgality",
  3175. smalltalk.method({
  3176. selector: "testEgality",
  3177. category: 'tests',
  3178. fn: function (){
  3179. var self=this;
  3180. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((3),"__at",[(4)]),"__eq",[smalltalk.send((3),"__at",[(4)])])]);
  3181. smalltalk.send(self,"_deny_",[smalltalk.send(smalltalk.send((3),"__at",[(5)]),"__eq",[smalltalk.send((3),"__at",[(6)])])]);
  3182. return self},
  3183. args: [],
  3184. source: "testEgality\x0a\x09self assert: 3@4 = (3@4).\x0a\x09self deny: 3@5 = (3@6)",
  3185. messageSends: ["assert:", "=", "@", "deny:"],
  3186. referencedClasses: []
  3187. }),
  3188. smalltalk.PointTest);
  3189. smalltalk.addMethod(
  3190. "_testTranslateBy",
  3191. smalltalk.method({
  3192. selector: "testTranslateBy",
  3193. category: 'tests',
  3194. fn: function (){
  3195. var self=this;
  3196. smalltalk.send(self,"_assert_equals_",[smalltalk.send((3),"__at",[(4)]),smalltalk.send(smalltalk.send((3),"__at",[(3)]),"_translateBy_",[smalltalk.send((0),"__at",[(1)])])]);
  3197. smalltalk.send(self,"_assert_equals_",[smalltalk.send((3),"__at",[(2)]),smalltalk.send(smalltalk.send((3),"__at",[(3)]),"_translateBy_",[smalltalk.send((0),"__at",[smalltalk.send((1),"_negated",[])])])]);
  3198. smalltalk.send(self,"_assert_equals_",[smalltalk.send((5),"__at",[(6)]),smalltalk.send(smalltalk.send((3),"__at",[(3)]),"_translateBy_",[smalltalk.send((2),"__at",[(3)])])]);
  3199. smalltalk.send(self,"_assert_equals_",[smalltalk.send((0),"__at",[(3)]),smalltalk.send(smalltalk.send((3),"__at",[(3)]),"_translateBy_",[smalltalk.send(smalltalk.send((3),"_negated",[]),"__at",[(0)])])]);
  3200. return self},
  3201. args: [],
  3202. source: "testTranslateBy\x0a\x09self assert: 3@4 equals: (3@3 translateBy: 0@1).\x0a\x09self assert: 3@2 equals: (3@3 translateBy: 0@1 negated).\x0a\x09self assert: 5@6 equals: (3@3 translateBy: 2@3).\x0a\x09self assert: 0@3 equals: (3@3 translateBy: 3 negated @0).",
  3203. messageSends: ["assert:equals:", "@", "translateBy:", "negated"],
  3204. referencedClasses: []
  3205. }),
  3206. smalltalk.PointTest);
  3207. smalltalk.addClass('RandomTest', smalltalk.TestCase, [], 'Kernel-Tests');
  3208. smalltalk.addMethod(
  3209. "_textNext",
  3210. smalltalk.method({
  3211. selector: "textNext",
  3212. category: 'tests',
  3213. fn: function (){
  3214. var self=this;
  3215. smalltalk.send((10000),"_timesRepeat_",[(function(){
  3216. var current;
  3217. var next;
  3218. next=smalltalk.send(smalltalk.send((smalltalk.Random || Random),"_new",[]),"_next",[]);
  3219. next;
  3220. smalltalk.send(self,"_assert_",[smalltalk.send(next,"__gt_eq",[(0)])]);
  3221. smalltalk.send(self,"_assert_",[smalltalk.send(next,"__lt",[(1)])]);
  3222. smalltalk.send(self,"_deny_",[smalltalk.send(current,"__eq",[next])]);
  3223. return smalltalk.send(next,"__eq",[current]);
  3224. })]);
  3225. return self},
  3226. args: [],
  3227. 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]",
  3228. messageSends: ["timesRepeat:", "next", "new", "assert:", ">=", "<", "deny:", "="],
  3229. referencedClasses: ["Random"]
  3230. }),
  3231. smalltalk.RandomTest);
  3232. smalltalk.addClass('SetTest', smalltalk.TestCase, [], 'Kernel-Tests');
  3233. smalltalk.addMethod(
  3234. "_testAddRemove",
  3235. smalltalk.method({
  3236. selector: "testAddRemove",
  3237. category: 'tests',
  3238. fn: function (){
  3239. var self=this;
  3240. var set;
  3241. set=smalltalk.send((smalltalk.Set || Set),"_new",[]);
  3242. smalltalk.send(self,"_assert_",[smalltalk.send(set,"_isEmpty",[])]);
  3243. smalltalk.send(set,"_add_",[(3)]);
  3244. smalltalk.send(self,"_assert_",[smalltalk.send(set,"_includes_",[(3)])]);
  3245. smalltalk.send(set,"_add_",[(5)]);
  3246. smalltalk.send(self,"_assert_",[smalltalk.send(set,"_includes_",[(5)])]);
  3247. smalltalk.send(set,"_remove_",[(3)]);
  3248. smalltalk.send(self,"_deny_",[smalltalk.send(set,"_includes_",[(3)])]);
  3249. return self},
  3250. args: [],
  3251. 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)",
  3252. messageSends: ["new", "assert:", "isEmpty", "add:", "includes:", "remove:", "deny:"],
  3253. referencedClasses: ["Set"]
  3254. }),
  3255. smalltalk.SetTest);
  3256. smalltalk.addMethod(
  3257. "_testAt",
  3258. smalltalk.method({
  3259. selector: "testAt",
  3260. category: 'tests',
  3261. fn: function (){
  3262. var self=this;
  3263. smalltalk.send(self,"_should_raise_",[(function(){
  3264. return smalltalk.send(smalltalk.send((smalltalk.Set || Set),"_new",[]),"_at_put_",[(1),(2)]);
  3265. }),(smalltalk.Error || Error)]);
  3266. return self},
  3267. args: [],
  3268. source: "testAt\x0a\x09self should: [Set new at: 1 put: 2] raise: Error",
  3269. messageSends: ["should:raise:", "at:put:", "new"],
  3270. referencedClasses: ["Set", "Error"]
  3271. }),
  3272. smalltalk.SetTest);
  3273. smalltalk.addMethod(
  3274. "_testPrintString",
  3275. smalltalk.method({
  3276. selector: "testPrintString",
  3277. category: 'tests',
  3278. fn: function (){
  3279. var self=this;
  3280. var $1,$2;
  3281. var set;
  3282. set=smalltalk.send((smalltalk.Set || Set),"_new",[]);
  3283. smalltalk.send(self,"_assert_equals_",["a Set ()",smalltalk.send(set,"_printString",[])]);
  3284. smalltalk.send(set,"_add_",[(1)]);
  3285. $1=smalltalk.send(set,"_add_",[(3)]);
  3286. smalltalk.send(self,"_assert_equals_",["a Set (1 3)",smalltalk.send(set,"_printString",[])]);
  3287. smalltalk.send(set,"_add_",["foo"]);
  3288. smalltalk.send(self,"_assert_equals_",["a Set (1 3 'foo')",smalltalk.send(set,"_printString",[])]);
  3289. smalltalk.send(set,"_remove_",[(1)]);
  3290. $2=smalltalk.send(set,"_remove_",[(3)]);
  3291. smalltalk.send(self,"_assert_equals_",["a Set ('foo')",smalltalk.send(set,"_printString",[])]);
  3292. smalltalk.send(set,"_add_",[(3)]);
  3293. smalltalk.send(self,"_assert_equals_",["a Set ('foo' 3)",smalltalk.send(set,"_printString",[])]);
  3294. smalltalk.send(set,"_add_",[(3)]);
  3295. smalltalk.send(self,"_assert_equals_",["a Set ('foo' 3)",smalltalk.send(set,"_printString",[])]);
  3296. return self},
  3297. args: [],
  3298. source: "testPrintString\x0a\x09| set |\x0a\x09set := Set new.\x0a\x09self assert: 'a Set ()' equals: ( set printString ).\x0a\x09set add: 1; add: 3.\x0a\x09self assert: 'a Set (1 3)' equals: ( set printString ).\x0a\x09set add: 'foo'.\x0a\x09self assert: 'a Set (1 3 ''foo'')' equals: ( set printString ).\x0a\x09set remove: 1; remove: 3.\x0a\x09self assert: 'a Set (''foo'')' equals: ( set printString ).\x0a\x09set add: 3.\x0a\x09self assert: 'a Set (''foo'' 3)' equals: ( set printString ).\x0a\x09set add: 3.\x0a\x09self assert: 'a Set (''foo'' 3)' equals: ( set printString ).",
  3299. messageSends: ["new", "assert:equals:", "printString", "add:", "remove:"],
  3300. referencedClasses: ["Set"]
  3301. }),
  3302. smalltalk.SetTest);
  3303. smalltalk.addMethod(
  3304. "_testSize",
  3305. smalltalk.method({
  3306. selector: "testSize",
  3307. category: 'tests',
  3308. fn: function (){
  3309. var self=this;
  3310. smalltalk.send(self,"_assert_equals_",[smalltalk.send(smalltalk.send((smalltalk.Set || Set),"_new",[]),"_size",[]),(0)]);
  3311. smalltalk.send(self,"_assert_equals_",[smalltalk.send(smalltalk.send((smalltalk.Set || Set),"_withAll_",[[(1), (2), (3), (4)]]),"_size",[]),(4)]);
  3312. smalltalk.send(self,"_assert_equals_",[smalltalk.send(smalltalk.send((smalltalk.Set || Set),"_withAll_",[[(1), (1), (1), (1)]]),"_size",[]),(1)]);
  3313. return self},
  3314. args: [],
  3315. source: "testSize\x0a\x09self assert: Set new size equals: 0.\x0a\x09self assert: (Set withAll: #(1 2 3 4)) size equals: 4.\x0a\x09self assert: (Set withAll: #(1 1 1 1)) size equals: 1",
  3316. messageSends: ["assert:equals:", "size", "new", "withAll:"],
  3317. referencedClasses: ["Set"]
  3318. }),
  3319. smalltalk.SetTest);
  3320. smalltalk.addMethod(
  3321. "_testUnicity",
  3322. smalltalk.method({
  3323. selector: "testUnicity",
  3324. category: 'tests',
  3325. fn: function (){
  3326. var self=this;
  3327. var set;
  3328. set=smalltalk.send((smalltalk.Set || Set),"_new",[]);
  3329. smalltalk.send(set,"_add_",[(21)]);
  3330. smalltalk.send(set,"_add_",["hello"]);
  3331. smalltalk.send(set,"_add_",[(21)]);
  3332. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(set,"_size",[]),"__eq",[(2)])]);
  3333. smalltalk.send(set,"_add_",["hello"]);
  3334. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(set,"_size",[]),"__eq",[(2)])]);
  3335. smalltalk.send(self,"_assert_equals_",[smalltalk.send(set,"_asArray",[]),[(21), "hello"]]);
  3336. return self},
  3337. args: [],
  3338. 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 = 2.\x0a\x09\x0a\x09set add: 'hello'.\x0a\x09self assert: set size = 2.\x0a\x0a\x09self assert: set asArray equals: #(21 'hello')",
  3339. messageSends: ["new", "add:", "assert:", "=", "size", "assert:equals:", "asArray"],
  3340. referencedClasses: ["Set"]
  3341. }),
  3342. smalltalk.SetTest);
  3343. smalltalk.addClass('UndefinedTest', smalltalk.TestCase, [], 'Kernel-Tests');
  3344. smalltalk.addMethod(
  3345. "_testCopying",
  3346. smalltalk.method({
  3347. selector: "testCopying",
  3348. category: 'tests',
  3349. fn: function (){
  3350. var self=this;
  3351. smalltalk.send(self,"_assert_equals_",[smalltalk.send(nil,"_copy",[]),nil]);
  3352. return self},
  3353. args: [],
  3354. source: "testCopying\x0a\x09self assert: nil copy equals: nil",
  3355. messageSends: ["assert:equals:", "copy"],
  3356. referencedClasses: []
  3357. }),
  3358. smalltalk.UndefinedTest);
  3359. smalltalk.addMethod(
  3360. "_testDeepCopy",
  3361. smalltalk.method({
  3362. selector: "testDeepCopy",
  3363. category: 'tests',
  3364. fn: function (){
  3365. var self=this;
  3366. smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(nil,"_deepCopy",[]),"__eq",[nil])]);
  3367. return self},
  3368. args: [],
  3369. source: "testDeepCopy\x0a\x09self assert: nil deepCopy = nil",
  3370. messageSends: ["assert:", "=", "deepCopy"],
  3371. referencedClasses: []
  3372. }),
  3373. smalltalk.UndefinedTest);
  3374. smalltalk.addMethod(
  3375. "_testIfNil",
  3376. smalltalk.method({
  3377. selector: "testIfNil",
  3378. category: 'tests',
  3379. fn: function (){
  3380. var self=this;
  3381. var $1,$2,$3;
  3382. if(($receiver = nil) == nil || $receiver == undefined){
  3383. $1=true;
  3384. } else {
  3385. $1=nil;
  3386. };
  3387. smalltalk.send(self,"_assert_equals_",[$1,true]);
  3388. if(($receiver = nil) == nil || $receiver == undefined){
  3389. $2=nil;
  3390. } else {
  3391. $2=true;
  3392. };
  3393. smalltalk.send(self,"_deny_",[smalltalk.send($2,"__eq",[true])]);
  3394. if(($receiver = nil) == nil || $receiver == undefined){
  3395. $3=true;
  3396. } else {
  3397. $3=false;
  3398. };
  3399. smalltalk.send(self,"_assert_equals_",[$3,true]);
  3400. smalltalk.send(self,"_deny_",[smalltalk.send(smalltalk.send(nil,"_ifNotNil_ifNil_",[(function(){
  3401. return true;
  3402. }),(function(){
  3403. return false;
  3404. })]),"__eq",[true])]);
  3405. return self},
  3406. args: [],
  3407. 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",
  3408. messageSends: ["assert:equals:", "ifNil:", "deny:", "=", "ifNotNil:", "ifNil:ifNotNil:", "ifNotNil:ifNil:"],
  3409. referencedClasses: []
  3410. }),
  3411. smalltalk.UndefinedTest);
  3412. smalltalk.addMethod(
  3413. "_testIsNil",
  3414. smalltalk.method({
  3415. selector: "testIsNil",
  3416. category: 'tests',
  3417. fn: function (){
  3418. var self=this;
  3419. smalltalk.send(self,"_assert_",[smalltalk.send(nil,"_isNil",[])]);
  3420. smalltalk.send(self,"_deny_",[smalltalk.send(nil,"_notNil",[])]);
  3421. return self},
  3422. args: [],
  3423. source: "testIsNil\x0a\x09self assert: nil isNil.\x0a\x09self deny: nil notNil.",
  3424. messageSends: ["assert:", "isNil", "deny:", "notNil"],
  3425. referencedClasses: []
  3426. }),
  3427. smalltalk.UndefinedTest);
  3428. smalltalk.addMethod(
  3429. "_boxed",
  3430. smalltalk.method({
  3431. selector: "boxed",
  3432. category: '*Kernel-Tests',
  3433. fn: function (){
  3434. var self=this;
  3435. var $1;
  3436. $1=self;
  3437. return $1;
  3438. },
  3439. args: [],
  3440. source: "boxed\x0a\x09^self",
  3441. messageSends: [],
  3442. referencedClasses: []
  3443. }),
  3444. smalltalk.Boolean);