Kernel-Tests.js 117 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455
  1. smalltalk.addPackage('Kernel-Tests', {});
  2. smalltalk.addClass('ArrayTest', smalltalk.TestCase, [], 'Kernel-Tests');
  3. smalltalk.addMethod(
  4. "_testAtIfAbsent",
  5. smalltalk.method({
  6. selector: "testAtIfAbsent",
  7. category: 'testing',
  8. fn: function (){
  9. var self=this;
  10. var array=nil;
  11. (array=["hello", "world"]);
  12. smalltalk.send(self, "_assert_equals_", [smalltalk.send(array, "_at_", [(1)]), "hello"]);
  13. smalltalk.send(self, "_assert_equals_", [smalltalk.send(array, "_at_", [(2)]), "world"]);
  14. smalltalk.send(self, "_assert_equals_", [smalltalk.send(array, "_at_ifAbsent_", [(2), (function(){return "not found";})]), "world"]);
  15. smalltalk.send(self, "_assert_equals_", [smalltalk.send(array, "_at_ifAbsent_", [(0), (function(){return "not found";})]), "not found"]);
  16. smalltalk.send(self, "_assert_equals_", [smalltalk.send(array, "_at_ifAbsent_", [(-10), (function(){return "not found";})]), "not found"]);
  17. smalltalk.send(self, "_assert_equals_", [smalltalk.send(array, "_at_ifAbsent_", [(3), (function(){return "not found";})]), "not found"]);
  18. return self;},
  19. args: [],
  20. 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'.",
  21. messageSends: ["assert:equals:", "at:", "at:ifAbsent:"],
  22. referencedClasses: []
  23. }),
  24. smalltalk.ArrayTest);
  25. smalltalk.addMethod(
  26. "_testFirstN",
  27. smalltalk.method({
  28. selector: "testFirstN",
  29. category: 'testing',
  30. fn: function (){
  31. var self=this;
  32. smalltalk.send(self, "_assert_equals_", [[(1),(2),(3)], smalltalk.send([(1),(2),(3),(4),(5)], "_first_", [(3)])]);
  33. return self;},
  34. args: [],
  35. source: "testFirstN\x0a\x09self assert: {1. 2. 3} equals: ({1. 2. 3. 4. 5} first: 3).",
  36. messageSends: ["assert:equals:", "first:"],
  37. referencedClasses: []
  38. }),
  39. smalltalk.ArrayTest);
  40. smalltalk.addMethod(
  41. "_testIfEmpty",
  42. smalltalk.method({
  43. selector: "testIfEmpty",
  44. category: 'testing',
  45. fn: function (){
  46. var self=this;
  47. smalltalk.send(self, "_assert_equals_", ["zork", smalltalk.send("", "_ifEmpty_", [(function(){return "zork";})])]);
  48. return self;},
  49. args: [],
  50. source: "testIfEmpty\x0a\x09self assert: 'zork' equals: ( '' ifEmpty: ['zork'] )",
  51. messageSends: ["assert:equals:", "ifEmpty:"],
  52. referencedClasses: []
  53. }),
  54. smalltalk.ArrayTest);
  55. smalltalk.addMethod(
  56. "_testPrintString",
  57. smalltalk.method({
  58. selector: "testPrintString",
  59. category: 'testing',
  60. fn: function (){
  61. var self=this;
  62. var array=nil;
  63. (array=smalltalk.send((smalltalk.Array || Array), "_new", []));
  64. smalltalk.send(self, "_assert_equals_", ["a Array ()", smalltalk.send(array, "_printString", [])]);
  65. (function($rec){smalltalk.send($rec, "_add_", [(1)]);return smalltalk.send($rec, "_add_", [(3)]);})(array);
  66. smalltalk.send(self, "_assert_equals_", ["a Array (1 3)", smalltalk.send(array, "_printString", [])]);
  67. smalltalk.send(array, "_add_", ["foo"]);
  68. smalltalk.send(self, "_assert_equals_", ["a Array (1 3 'foo')", smalltalk.send(array, "_printString", [])]);
  69. (function($rec){smalltalk.send($rec, "_remove_", [(1)]);return smalltalk.send($rec, "_remove_", [(3)]);})(array);
  70. smalltalk.send(self, "_assert_equals_", ["a Array ('foo')", smalltalk.send(array, "_printString", [])]);
  71. smalltalk.send(array, "_addLast_", [(3)]);
  72. smalltalk.send(self, "_assert_equals_", ["a Array ('foo' 3)", smalltalk.send(array, "_printString", [])]);
  73. smalltalk.send(array, "_addLast_", [(3)]);
  74. smalltalk.send(self, "_assert_equals_", ["a Array ('foo' 3 3)", smalltalk.send(array, "_printString", [])]);
  75. return self;},
  76. args: [],
  77. 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 ).",
  78. messageSends: ["new", "assert:equals:", "printString", "add:", "remove:", "addLast:"],
  79. referencedClasses: ["Array"]
  80. }),
  81. smalltalk.ArrayTest);
  82. smalltalk.addClass('AssociationTest', smalltalk.TestCase, [], 'Kernel-Tests');
  83. smalltalk.addMethod(
  84. "_testClassCreation",
  85. smalltalk.method({
  86. selector: "testClassCreation",
  87. category: 'tests',
  88. fn: function (){
  89. var self=this;
  90. var anAssociation=nil;
  91. var key=nil;
  92. var value=nil;
  93. (key="KEY_STRING");
  94. (value="VALUE_STRING");
  95. (anAssociation=smalltalk.send((smalltalk.Association || Association), "_key_value_", [key, value]));
  96. smalltalk.send(self, "_assert_equals_", [key, smalltalk.send(anAssociation, "_key", [])]);
  97. smalltalk.send(self, "_assert_equals_", [value, smalltalk.send(anAssociation, "_value", [])]);
  98. return self;},
  99. args: [],
  100. source: "testClassCreation\x0a\x09\x22Test if Associatin object created via the class method contains correct values\x22\x0a\x09| anAssociation key value|\x0a\x09key := 'KEY_STRING'.\x0a\x09value := 'VALUE_STRING'.\x0a\x09anAssociation := Association key: key value: value.\x0a\x0a\x09self assert: key equals: anAssociation key.\x0a\x09self assert: value equals: anAssociation value.",
  101. messageSends: ["key:value:", "assert:equals:", "key", "value"],
  102. referencedClasses: ["Association"]
  103. }),
  104. smalltalk.AssociationTest);
  105. smalltalk.addMethod(
  106. "_testEqualAssociations",
  107. smalltalk.method({
  108. selector: "testEqualAssociations",
  109. category: 'tests',
  110. fn: function (){
  111. var self=this;
  112. var anAssociation=nil;
  113. var anotherAssociation=nil;
  114. (anAssociation=smalltalk.send((smalltalk.Association || Association), "_key_value_", ["KEY", "VALUE"]));
  115. (anotherAssociation=smalltalk.send((smalltalk.Association || Association), "_key_value_", ["KEY", "VALUE"]));
  116. smalltalk.send(self, "_assert_equals_", [anAssociation, anotherAssociation]);
  117. return self;},
  118. args: [],
  119. source: "testEqualAssociations\x0a\x09\x22Test if two equal Association objects compare to true\x22\x0a\x09| anAssociation anotherAssociation |\x0a\x09anAssociation := Association key: 'KEY' value: 'VALUE'.\x0a\x09anotherAssociation := Association key: 'KEY' value: 'VALUE'.\x0a\x0a\x09self assert: anAssociation equals: anotherAssociation.",
  120. messageSends: ["key:value:", "assert:equals:"],
  121. referencedClasses: ["Association"]
  122. }),
  123. smalltalk.AssociationTest);
  124. smalltalk.addMethod(
  125. "_testKeyAccess",
  126. smalltalk.method({
  127. selector: "testKeyAccess",
  128. category: 'tests',
  129. fn: function (){
  130. var self=this;
  131. var anAssociation=nil;
  132. var key=nil;
  133. (key="KEY_STRING");
  134. (anAssociation=smalltalk.send((smalltalk.Association || Association), "_new", []));
  135. smalltalk.send(anAssociation, "_key_", [key]);
  136. smalltalk.send(self, "_assert_equals_", [key, smalltalk.send(anAssociation, "_key", [])]);
  137. smalltalk.send(self, "_assert_equals_", [nil, smalltalk.send(anAssociation, "_value", [])]);
  138. return self;},
  139. args: [],
  140. source: "testKeyAccess\x0a\x09\x22Test getter and setter messages for Association keys\x22\x0a\x09| anAssociation key |\x0a\x09key := 'KEY_STRING'.\x0a\x09anAssociation := Association new.\x0a\x0a\x09anAssociation key: key.\x0a\x0a\x09self assert: key equals: anAssociation key.\x0a\x09self assert: nil equals: anAssociation value.",
  141. messageSends: ["new", "key:", "assert:equals:", "key", "value"],
  142. referencedClasses: ["Association"]
  143. }),
  144. smalltalk.AssociationTest);
  145. smalltalk.addMethod(
  146. "_testNotEqualAssociations",
  147. smalltalk.method({
  148. selector: "testNotEqualAssociations",
  149. category: 'tests',
  150. fn: function (){
  151. var self=this;
  152. var anAssociation=nil;
  153. var anotherAssociation=nil;
  154. (anAssociation=smalltalk.send((smalltalk.Association || Association), "_key_value_", ["KEY", "VALUE"]));
  155. (anotherAssociation=smalltalk.send((smalltalk.Association || Association), "_key_value_", ["KEY2", "VALUE2"]));
  156. smalltalk.send(self, "_deny_", [smalltalk.send(anAssociation, "__eq", [anotherAssociation])]);
  157. return self;},
  158. args: [],
  159. source: "testNotEqualAssociations\x0a\x09\x22Test if two unequal Association objects compare to false\x22\x0a\x09| anAssociation anotherAssociation |\x0a\x09anAssociation := Association key: 'KEY' value: 'VALUE'.\x0a\x09anotherAssociation := Association key: 'KEY2' value: 'VALUE2'.\x0a\x0a\x09self deny: (anAssociation = anotherAssociation).",
  160. messageSends: ["key:value:", "deny:", "="],
  161. referencedClasses: ["Association"]
  162. }),
  163. smalltalk.AssociationTest);
  164. smalltalk.addMethod(
  165. "_testPrintString",
  166. smalltalk.method({
  167. selector: "testPrintString",
  168. category: 'tests',
  169. fn: function (){
  170. var self=this;
  171. var anAssociation=nil;
  172. var returnString=nil;
  173. (anAssociation=smalltalk.send((smalltalk.Association || Association), "_key_value_", ["KEY", "VALUE"]));
  174. (returnString=smalltalk.send(anAssociation, "_printString", []));
  175. smalltalk.send(self, "_assert_equals_", ["'KEY'->'VALUE'", returnString]);
  176. return self;},
  177. args: [],
  178. source: "testPrintString\x0a\x09\x22Test if the output of the printString message is correct\x22\x0a\x09| anAssociation returnString |\x0a\x09anAssociation := Association key: 'KEY' value: 'VALUE'.\x0a\x09returnString := anAssociation printString.\x0a\x0a\x09self assert: '''KEY''->''VALUE''' equals: returnString.",
  179. messageSends: ["key:value:", "printString", "assert:equals:"],
  180. referencedClasses: ["Association"]
  181. }),
  182. smalltalk.AssociationTest);
  183. smalltalk.addMethod(
  184. "_testUninitializedObject",
  185. smalltalk.method({
  186. selector: "testUninitializedObject",
  187. category: 'tests',
  188. fn: function (){
  189. var self=this;
  190. var anAssociation=nil;
  191. (anAssociation=smalltalk.send((smalltalk.Association || Association), "_new", []));
  192. smalltalk.send(self, "_assert_equals_", [nil, smalltalk.send(anAssociation, "_key", [])]);
  193. smalltalk.send(self, "_assert_equals_", [nil, smalltalk.send(anAssociation, "_value", [])]);
  194. return self;},
  195. args: [],
  196. source: "testUninitializedObject\x0a\x09\x22Test if uninitialized Associatin object contains correct values\x22\x0a\x09| anAssociation |\x0a\x09anAssociation := Association new.\x0a\x0a\x09self assert: nil equals: anAssociation key.\x0a\x09self assert: nil equals: anAssociation value.",
  197. messageSends: ["new", "assert:equals:", "key", "value"],
  198. referencedClasses: ["Association"]
  199. }),
  200. smalltalk.AssociationTest);
  201. smalltalk.addMethod(
  202. "_testValueAccess",
  203. smalltalk.method({
  204. selector: "testValueAccess",
  205. category: 'tests',
  206. fn: function (){
  207. var self=this;
  208. var anAssociation=nil;
  209. var value=nil;
  210. (value="VALUE_STRING");
  211. (anAssociation=smalltalk.send((smalltalk.Association || Association), "_new", []));
  212. smalltalk.send(anAssociation, "_value_", [value]);
  213. smalltalk.send(self, "_assert_equals_", [nil, smalltalk.send(anAssociation, "_key", [])]);
  214. smalltalk.send(self, "_assert_equals_", [value, smalltalk.send(anAssociation, "_value", [])]);
  215. return self;},
  216. args: [],
  217. source: "testValueAccess\x0a\x09\x22Test getter and setter messages for Association values\x22\x0a\x09| anAssociation value |\x0a\x09value := 'VALUE_STRING'.\x0a\x09anAssociation := Association new.\x0a\x0a\x09anAssociation value: value.\x0a\x0a\x09self assert: nil equals: anAssociation key.\x0a\x09self assert: value equals: anAssociation value.",
  218. messageSends: ["new", "value:", "assert:equals:", "key", "value"],
  219. referencedClasses: ["Association"]
  220. }),
  221. smalltalk.AssociationTest);
  222. smalltalk.addClass('BlockClosureTest', smalltalk.TestCase, [], 'Kernel-Tests');
  223. smalltalk.addMethod(
  224. "_testCompiledSource",
  225. smalltalk.method({
  226. selector: "testCompiledSource",
  227. category: 'tests',
  228. fn: function (){
  229. var self=this;
  230. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((function(){return (1) + (1);}), "_compiledSource", []), "_includesSubString_", ["function"])]);
  231. return self;},
  232. args: [],
  233. source: "testCompiledSource\x0a\x09self assert: ([1+1] compiledSource includesSubString: 'function')",
  234. messageSends: ["assert:", "includesSubString:", "compiledSource", "+"],
  235. referencedClasses: []
  236. }),
  237. smalltalk.BlockClosureTest);
  238. smalltalk.addMethod(
  239. "_testEnsure",
  240. smalltalk.method({
  241. selector: "testEnsure",
  242. category: 'tests',
  243. fn: function (){
  244. var self=this;
  245. smalltalk.send(self, "_assert_", [smalltalk.send((function(){return smalltalk.send((smalltalk.Error || Error), "_new", []);}), "_ensure_", [(function(){return true;})])]);
  246. return self;},
  247. args: [],
  248. source: "testEnsure\x0a\x09self assert: ([Error new] ensure: [true])",
  249. messageSends: ["assert:", "ensure:", "new"],
  250. referencedClasses: ["Error"]
  251. }),
  252. smalltalk.BlockClosureTest);
  253. smalltalk.addMethod(
  254. "_testNumArgs",
  255. smalltalk.method({
  256. selector: "testNumArgs",
  257. category: 'tests',
  258. fn: function (){
  259. var self=this;
  260. smalltalk.send(self, "_assert_equals_", [smalltalk.send((function(){return nil;}), "_numArgs", []), (0)]);
  261. smalltalk.send(self, "_assert_equals_", [smalltalk.send((function(a, b){return nil;}), "_numArgs", []), (2)]);
  262. return self;},
  263. args: [],
  264. source: "testNumArgs\x0a\x09self assert: [] numArgs equals: 0.\x0a\x09self assert: [:a :b | ] numArgs equals: 2",
  265. messageSends: ["assert:equals:", "numArgs"],
  266. referencedClasses: []
  267. }),
  268. smalltalk.BlockClosureTest);
  269. smalltalk.addMethod(
  270. "_testOnDo",
  271. smalltalk.method({
  272. selector: "testOnDo",
  273. category: 'tests',
  274. fn: function (){
  275. var self=this;
  276. smalltalk.send(self, "_assert_", [smalltalk.send((function(){return smalltalk.send(smalltalk.send((smalltalk.Error || Error), "_new", []), "_signal", []);}), "_on_do_", [(smalltalk.Error || Error), (function(ex){return true;})])]);
  277. return self;},
  278. args: [],
  279. source: "testOnDo\x0a\x09self assert: ([Error new signal] on: Error do: [:ex | true])",
  280. messageSends: ["assert:", "on:do:", "signal", "new"],
  281. referencedClasses: ["Error"]
  282. }),
  283. smalltalk.BlockClosureTest);
  284. smalltalk.addMethod(
  285. "_testValue",
  286. smalltalk.method({
  287. selector: "testValue",
  288. category: 'tests',
  289. fn: function (){
  290. var self=this;
  291. smalltalk.send(self, "_assert_equals_", [smalltalk.send((function(){return (1) + (1);}), "_value", []), (2)]);
  292. smalltalk.send(self, "_assert_equals_", [smalltalk.send((function(x){return ((($receiver = x).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));}), "_value_", [(2)]), (3)]);
  293. smalltalk.send(self, "_assert_equals_", [smalltalk.send((function(x, y){return ((($receiver = x).klass === smalltalk.Number) ? $receiver *y : smalltalk.send($receiver, "__star", [y]));}), "_value_value_", [(2), (4)]), (8)]);
  294. smalltalk.send(self, "_assert_equals_", [smalltalk.send((function(a, b, c){return (1);}), "_value", []), (1)]);
  295. return self;},
  296. args: [],
  297. 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",
  298. messageSends: ["assert:equals:", "value", "+", "value:", "value:value:", "*"],
  299. referencedClasses: []
  300. }),
  301. smalltalk.BlockClosureTest);
  302. smalltalk.addMethod(
  303. "_testValueWithPossibleArguments",
  304. smalltalk.method({
  305. selector: "testValueWithPossibleArguments",
  306. category: 'tests',
  307. fn: function (){
  308. var self=this;
  309. smalltalk.send(self, "_assert_equals_", [smalltalk.send((function(){return (1);}), "_valueWithPossibleArguments_", [[(3), (4)]]), (1)]);
  310. smalltalk.send(self, "_assert_equals_", [smalltalk.send((function(a){return ((($receiver = a).klass === smalltalk.Number) ? $receiver +(4) : smalltalk.send($receiver, "__plus", [(4)]));}), "_valueWithPossibleArguments_", [[(3), (4)]]), (7)]);
  311. smalltalk.send(self, "_assert_equals_", [smalltalk.send((function(a, b){return ((($receiver = a).klass === smalltalk.Number) ? $receiver +b : smalltalk.send($receiver, "__plus", [b]));}), "_valueWithPossibleArguments_", [[(3), (4), (5)]]), (7)]);
  312. return self;},
  313. args: [],
  314. 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.",
  315. messageSends: ["assert:equals:", "valueWithPossibleArguments:", "+"],
  316. referencedClasses: []
  317. }),
  318. smalltalk.BlockClosureTest);
  319. smalltalk.addMethod(
  320. "_testWhileFalse",
  321. smalltalk.method({
  322. selector: "testWhileFalse",
  323. category: 'tests',
  324. fn: function (){
  325. var self=this;
  326. var i=nil;
  327. (i=(0));
  328. (function(){while(!(function(){return ((($receiver = i).klass === smalltalk.Number) ? $receiver >(5) : smalltalk.send($receiver, "__gt", [(5)]));})()) {(function(){return (i=((($receiver = i).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));})()}})();
  329. smalltalk.send(self, "_assert_equals_", [i, (6)]);
  330. (i=(0));
  331. (function(){while(!(function(){(i=((($receiver = i).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));return ((($receiver = i).klass === smalltalk.Number) ? $receiver >(5) : smalltalk.send($receiver, "__gt", [(5)]));})()) {}})();
  332. smalltalk.send(self, "_assert_equals_", [i, (6)]);
  333. return self;},
  334. args: [],
  335. 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",
  336. messageSends: ["whileFalse:", ">", "+", "assert:equals:", "whileFalse"],
  337. referencedClasses: []
  338. }),
  339. smalltalk.BlockClosureTest);
  340. smalltalk.addMethod(
  341. "_testWhileTrue",
  342. smalltalk.method({
  343. selector: "testWhileTrue",
  344. category: 'tests',
  345. fn: function (){
  346. var self=this;
  347. var i=nil;
  348. (i=(0));
  349. (function(){while((function(){return ((($receiver = i).klass === smalltalk.Number) ? $receiver <(5) : smalltalk.send($receiver, "__lt", [(5)]));})()) {(function(){return (i=((($receiver = i).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));})()}})();
  350. smalltalk.send(self, "_assert_equals_", [i, (5)]);
  351. (i=(0));
  352. (function(){while((function(){(i=((($receiver = i).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));return ((($receiver = i).klass === smalltalk.Number) ? $receiver <(5) : smalltalk.send($receiver, "__lt", [(5)]));})()) {}})();
  353. smalltalk.send(self, "_assert_equals_", [i, (5)]);
  354. return self;},
  355. args: [],
  356. 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",
  357. messageSends: ["whileTrue:", "<", "+", "assert:equals:", "whileTrue"],
  358. referencedClasses: []
  359. }),
  360. smalltalk.BlockClosureTest);
  361. smalltalk.addClass('BooleanTest', smalltalk.TestCase, [], 'Kernel-Tests');
  362. smalltalk.addMethod(
  363. "_testEquality",
  364. smalltalk.method({
  365. selector: "testEquality",
  366. category: 'tests',
  367. fn: function (){
  368. var self=this;
  369. smalltalk.send(self, "_deny_", [smalltalk.send((0), "__eq", [false])]);
  370. smalltalk.send(self, "_deny_", [smalltalk.send(false, "__eq", [(0)])]);
  371. smalltalk.send(self, "_deny_", [smalltalk.send("", "__eq", [false])]);
  372. smalltalk.send(self, "_deny_", [smalltalk.send(false, "__eq", [""])]);
  373. smalltalk.send(self, "_assert_", [smalltalk.send(true, "__eq", [true])]);
  374. smalltalk.send(self, "_deny_", [smalltalk.send(false, "__eq", [true])]);
  375. smalltalk.send(self, "_deny_", [smalltalk.send(true, "__eq", [false])]);
  376. smalltalk.send(self, "_assert_", [smalltalk.send(false, "__eq", [false])]);
  377. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(true, "_yourself", []), "__eq", [true])]);
  378. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(true, "_yourself", []), "__eq", [smalltalk.send(true, "_yourself", [])])]);
  379. return self;},
  380. args: [],
  381. 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",
  382. messageSends: ["deny:", "=", "assert:", "yourself"],
  383. referencedClasses: []
  384. }),
  385. smalltalk.BooleanTest);
  386. smalltalk.addMethod(
  387. "_testIdentity",
  388. smalltalk.method({
  389. selector: "testIdentity",
  390. category: 'tests',
  391. fn: function (){
  392. var self=this;
  393. smalltalk.send(self, "_deny_", [smalltalk.send((0), "__eq_eq", [false])]);
  394. smalltalk.send(self, "_deny_", [smalltalk.send(false, "__eq_eq", [(0)])]);
  395. smalltalk.send(self, "_deny_", [smalltalk.send("", "__eq_eq", [false])]);
  396. smalltalk.send(self, "_deny_", [smalltalk.send(false, "__eq_eq", [""])]);
  397. smalltalk.send(self, "_assert_", [smalltalk.send(true, "__eq_eq", [true])]);
  398. smalltalk.send(self, "_deny_", [smalltalk.send(false, "__eq_eq", [true])]);
  399. smalltalk.send(self, "_deny_", [smalltalk.send(true, "__eq_eq", [false])]);
  400. smalltalk.send(self, "_assert_", [smalltalk.send(false, "__eq_eq", [false])]);
  401. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(true, "_yourself", []), "__eq_eq", [true])]);
  402. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(true, "_yourself", []), "__eq_eq", [smalltalk.send(true, "_yourself", [])])]);
  403. return self;},
  404. args: [],
  405. 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",
  406. messageSends: ["deny:", "==", "assert:", "yourself"],
  407. referencedClasses: []
  408. }),
  409. smalltalk.BooleanTest);
  410. smalltalk.addMethod(
  411. "_testIfTrueIfFalse",
  412. smalltalk.method({
  413. selector: "testIfTrueIfFalse",
  414. category: 'tests',
  415. fn: function (){
  416. var self=this;
  417. smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = true).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "alternative block";})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return "alternative block";})])), "__eq", ["alternative block"])]);
  418. smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = true).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return "alternative block";})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return "alternative block";})])), "__eq", [nil])]);
  419. smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = false).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "alternative block";})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return "alternative block";})])), "__eq", [nil])]);
  420. smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = false).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return "alternative block";})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return "alternative block";})])), "__eq", ["alternative block"])]);
  421. smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = false).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "alternative block";})() : (function(){return "alternative block2";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "alternative block";}), (function(){return "alternative block2";})])), "__eq", ["alternative block2"])]);
  422. smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = false).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return "alternative block";})() : (function(){return "alternative block2";})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){return "alternative block";}), (function(){return "alternative block2";})])), "__eq", ["alternative block"])]);
  423. smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = true).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "alternative block";})() : (function(){return "alternative block2";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "alternative block";}), (function(){return "alternative block2";})])), "__eq", ["alternative block"])]);
  424. smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = true).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return "alternative block";})() : (function(){return "alternative block2";})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){return "alternative block";}), (function(){return "alternative block2";})])), "__eq", ["alternative block2"])]);
  425. return self;},
  426. args: [],
  427. 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'.",
  428. messageSends: ["assert:", "=", "ifTrue:", "ifFalse:", "ifTrue:ifFalse:", "ifFalse:ifTrue:"],
  429. referencedClasses: []
  430. }),
  431. smalltalk.BooleanTest);
  432. smalltalk.addMethod(
  433. "_testLogic",
  434. smalltalk.method({
  435. selector: "testLogic",
  436. category: 'tests',
  437. fn: function (){
  438. var self=this;
  439. (function($rec){smalltalk.send($rec, "_assert_", [smalltalk.send(true, "_&", [true])]);smalltalk.send($rec, "_deny_", [smalltalk.send(true, "_&", [false])]);smalltalk.send($rec, "_deny_", [smalltalk.send(false, "_&", [true])]);return smalltalk.send($rec, "_deny_", [smalltalk.send(false, "_&", [false])]);})(self);
  440. (function($rec){smalltalk.send($rec, "_assert_", [smalltalk.send(true, "_|", [true])]);smalltalk.send($rec, "_assert_", [smalltalk.send(true, "_|", [false])]);smalltalk.send($rec, "_assert_", [smalltalk.send(false, "_|", [true])]);return smalltalk.send($rec, "_deny_", [smalltalk.send(false, "_|", [false])]);})(self);
  441. (function($rec){smalltalk.send($rec, "_assert_", [smalltalk.send(true, "_&", [(1) > (0)])]);smalltalk.send($rec, "_deny_", [smalltalk.send((1) > (0), "_&", [false])]);return smalltalk.send($rec, "_deny_", [smalltalk.send((1) > (0), "_&", [(1) > (2)])]);})(self);
  442. (function($rec){smalltalk.send($rec, "_assert_", [smalltalk.send(false, "_|", [(1) > (0)])]);smalltalk.send($rec, "_assert_", [smalltalk.send((1) > (0), "_|", [false])]);return smalltalk.send($rec, "_assert_", [smalltalk.send((1) > (0), "_|", [(1) > (2)])]);})(self);
  443. return self;},
  444. args: [],
  445. 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))",
  446. messageSends: ["assert:", "&", "deny:", "|", ">"],
  447. referencedClasses: []
  448. }),
  449. smalltalk.BooleanTest);
  450. smalltalk.addMethod(
  451. "_testLogicKeywords",
  452. smalltalk.method({
  453. selector: "testLogicKeywords",
  454. category: 'tests',
  455. fn: function (){
  456. var self=this;
  457. (function($rec){smalltalk.send($rec, "_assert_", [smalltalk.send(true, "_and_", [(function(){return true;})])]);smalltalk.send($rec, "_deny_", [smalltalk.send(true, "_and_", [(function(){return false;})])]);smalltalk.send($rec, "_deny_", [smalltalk.send(false, "_and_", [(function(){return true;})])]);return smalltalk.send($rec, "_deny_", [smalltalk.send(false, "_and_", [(function(){return false;})])]);})(self);
  458. (function($rec){smalltalk.send($rec, "_assert_", [smalltalk.send(true, "_or_", [(function(){return true;})])]);smalltalk.send($rec, "_assert_", [smalltalk.send(true, "_or_", [(function(){return false;})])]);smalltalk.send($rec, "_assert_", [smalltalk.send(false, "_or_", [(function(){return true;})])]);return smalltalk.send($rec, "_deny_", [smalltalk.send(false, "_or_", [(function(){return false;})])]);})(self);
  459. (function($rec){smalltalk.send($rec, "_assert_", [smalltalk.send(true, "_and_", [(function(){return (1) > (0);})])]);smalltalk.send($rec, "_deny_", [smalltalk.send((1) > (0), "_and_", [(function(){return false;})])]);return smalltalk.send($rec, "_deny_", [smalltalk.send((1) > (0), "_and_", [(function(){return (1) > (2);})])]);})(self);
  460. (function($rec){smalltalk.send($rec, "_assert_", [smalltalk.send(false, "_or_", [(function(){return (1) > (0);})])]);smalltalk.send($rec, "_assert_", [smalltalk.send((1) > (0), "_or_", [(function(){return false;})])]);return smalltalk.send($rec, "_assert_", [smalltalk.send((1) > (0), "_or_", [(function(){return (1) > (2);})])]);})(self);
  461. return self;},
  462. args: [],
  463. 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 ])",
  464. messageSends: ["assert:", "and:", "deny:", "or:", ">"],
  465. referencedClasses: []
  466. }),
  467. smalltalk.BooleanTest);
  468. smalltalk.addClass('ClassBuilderTest', smalltalk.TestCase, ['builder', 'theClass'], 'Kernel-Tests');
  469. smalltalk.addMethod(
  470. "_setUp",
  471. smalltalk.method({
  472. selector: "setUp",
  473. category: 'running',
  474. fn: function (){
  475. var self=this;
  476. (self['@builder']=smalltalk.send((smalltalk.ClassBuilder || ClassBuilder), "_new", []));
  477. return self;},
  478. args: [],
  479. source: "setUp\x0a\x09builder := ClassBuilder new",
  480. messageSends: ["new"],
  481. referencedClasses: ["ClassBuilder"]
  482. }),
  483. smalltalk.ClassBuilderTest);
  484. smalltalk.addMethod(
  485. "_tearDown",
  486. smalltalk.method({
  487. selector: "tearDown",
  488. category: 'running',
  489. fn: function (){
  490. var self=this;
  491. (($receiver = self['@theClass']) != nil && $receiver != undefined) ? (function(){smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_removeClass_", [self['@theClass']]);return (self['@theClass']=nil);})() : nil;
  492. return self;},
  493. args: [],
  494. source: "tearDown\x0a\x09theClass ifNotNil: [Smalltalk current removeClass: theClass. theClass := nil]",
  495. messageSends: ["ifNotNil:", "removeClass:", "current"],
  496. referencedClasses: ["Smalltalk"]
  497. }),
  498. smalltalk.ClassBuilderTest);
  499. smalltalk.addMethod(
  500. "_testClassCopy",
  501. smalltalk.method({
  502. selector: "testClassCopy",
  503. category: 'running',
  504. fn: function (){
  505. var self=this;
  506. (self['@theClass']=smalltalk.send(self['@builder'], "_copyClass_named_", [(smalltalk.ObjectMock || ObjectMock), "ObjectMock2"]));
  507. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(self['@theClass'], "_superclass", []), "__eq_eq", [smalltalk.send((smalltalk.ObjectMock || ObjectMock), "_superclass", [])])]);
  508. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(self['@theClass'], "_instanceVariableNames", []), "__eq_eq", [smalltalk.send((smalltalk.ObjectMock || ObjectMock), "_instanceVariableNames", [])])]);
  509. smalltalk.send(self, "_assert_equals_", [smalltalk.send(self['@theClass'], "_name", []), "ObjectMock2"]);
  510. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(self['@theClass'], "_package", []), "__eq_eq", [smalltalk.send((smalltalk.ObjectMock || ObjectMock), "_package", [])])]);
  511. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send(self['@theClass'], "_methodDictionary", []), "_keys", []), smalltalk.send(smalltalk.send((smalltalk.ObjectMock || ObjectMock), "_methodDictionary", []), "_keys", [])]);
  512. return self;},
  513. args: [],
  514. 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",
  515. messageSends: ["copyClass:named:", "assert:", "==", "superclass", "instanceVariableNames", "assert:equals:", "name", "package", "keys", "methodDictionary"],
  516. referencedClasses: ["ObjectMock"]
  517. }),
  518. smalltalk.ClassBuilderTest);
  519. smalltalk.addMethod(
  520. "_testInstanceVariableNames",
  521. smalltalk.method({
  522. selector: "testInstanceVariableNames",
  523. category: 'running',
  524. fn: function (){
  525. var self=this;
  526. smalltalk.send(self, "_assert_equals_", [smalltalk.send(self['@builder'], "_instanceVariableNamesFor_", [" hello world "]), ["hello", "world"]]);
  527. return self;},
  528. args: [],
  529. source: "testInstanceVariableNames\x0a\x09self assert: (builder instanceVariableNamesFor: ' hello world ') equals: #('hello' 'world')",
  530. messageSends: ["assert:equals:", "instanceVariableNamesFor:"],
  531. referencedClasses: []
  532. }),
  533. smalltalk.ClassBuilderTest);
  534. smalltalk.addClass('DictionaryTest', smalltalk.TestCase, [], 'Kernel-Tests');
  535. smalltalk.addMethod(
  536. "_testAccessing",
  537. smalltalk.method({
  538. selector: "testAccessing",
  539. category: 'tests',
  540. fn: function (){
  541. var self=this;
  542. var d=nil;
  543. (d=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
  544. smalltalk.send(d, "_at_put_", ["hello", "world"]);
  545. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_at_", ["hello"]), "__eq", ["world"])]);
  546. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_at_ifAbsent_", ["hello", (function(){return nil;})]), "__eq", ["world"])]);
  547. smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send(d, "_at_ifAbsent_", ["foo", (function(){return nil;})]), "__eq", ["world"])]);
  548. smalltalk.send(d, "_at_put_", [(1), (2)]);
  549. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_at_", [(1)]), "__eq", [(2)])]);
  550. smalltalk.send(d, "_at_put_", [smalltalk.send((1), "__at", [(3)]), (3)]);
  551. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_at_", [smalltalk.send((1), "__at", [(3)])]), "__eq", [(3)])]);
  552. return self;},
  553. args: [],
  554. 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",
  555. messageSends: ["new", "at:put:", "assert:", "=", "at:", "at:ifAbsent:", "deny:", "@"],
  556. referencedClasses: ["Dictionary"]
  557. }),
  558. smalltalk.DictionaryTest);
  559. smalltalk.addMethod(
  560. "_testDynamicDictionaries",
  561. smalltalk.method({
  562. selector: "testDynamicDictionaries",
  563. category: 'tests',
  564. fn: function (){
  565. var self=this;
  566. 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)])])])]);
  567. return self;},
  568. args: [],
  569. source: "testDynamicDictionaries\x0a\x09self assert: #{'hello' -> 1} asDictionary = (Dictionary with: 'hello' -> 1)",
  570. messageSends: ["assert:", "=", "asDictionary", "->", "with:"],
  571. referencedClasses: ["Dictionary"]
  572. }),
  573. smalltalk.DictionaryTest);
  574. smalltalk.addMethod(
  575. "_testEquality",
  576. smalltalk.method({
  577. selector: "testEquality",
  578. category: 'tests',
  579. fn: function (){
  580. var self=this;
  581. var d1=nil;
  582. var d2=nil;
  583. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []), "__eq", [smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", [])])]);
  584. (d1=(function($rec){smalltalk.send($rec, "_at_put_", [(1), (2)]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", [])));
  585. (d2=(function($rec){smalltalk.send($rec, "_at_put_", [(1), (2)]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", [])));
  586. smalltalk.send(self, "_assert_", [smalltalk.send(d1, "__eq", [d2])]);
  587. (d2=(function($rec){smalltalk.send($rec, "_at_put_", [(1), (3)]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", [])));
  588. smalltalk.send(self, "_deny_", [smalltalk.send(d1, "__eq", [d2])]);
  589. (d2=(function($rec){smalltalk.send($rec, "_at_put_", [(2), (2)]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", [])));
  590. smalltalk.send(self, "_deny_", [smalltalk.send(d1, "__eq", [d2])]);
  591. (d2=(function($rec){smalltalk.send($rec, "_at_put_", [(1), (2)]);smalltalk.send($rec, "_at_put_", [(3), (4)]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", [])));
  592. smalltalk.send(self, "_deny_", [smalltalk.send(d1, "__eq", [d2])]);
  593. return self;},
  594. args: [],
  595. 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.",
  596. messageSends: ["assert:", "=", "new", "at:put:", "yourself", "deny:"],
  597. referencedClasses: ["Dictionary"]
  598. }),
  599. smalltalk.DictionaryTest);
  600. smalltalk.addMethod(
  601. "_testIfAbsent",
  602. smalltalk.method({
  603. selector: "testIfAbsent",
  604. category: 'tests',
  605. fn: function (){
  606. var self=this;
  607. var d=nil;
  608. var visited=nil;
  609. (visited=false);
  610. (d=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
  611. smalltalk.send(d, "_at_ifAbsent_", ["hello", (function(){return (visited=true);})]);
  612. smalltalk.send(self, "_assert_", [visited]);
  613. return self;},
  614. args: [],
  615. 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.",
  616. messageSends: ["new", "at:ifAbsent:", "assert:"],
  617. referencedClasses: ["Dictionary"]
  618. }),
  619. smalltalk.DictionaryTest);
  620. smalltalk.addMethod(
  621. "_testIfPresent",
  622. smalltalk.method({
  623. selector: "testIfPresent",
  624. category: 'tests',
  625. fn: function (){
  626. var self=this;
  627. var d=nil;
  628. var visited=nil;
  629. var absent=nil;
  630. (visited=false);
  631. (d=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
  632. smalltalk.send(d, "_at_put_", ["hello", "world"]);
  633. smalltalk.send(d, "_at_ifPresent_", ["hello", (function(value){return (visited=value);})]);
  634. smalltalk.send(self, "_assert_", [smalltalk.send(visited, "__eq", ["world"])]);
  635. (absent=smalltalk.send(d, "_at_ifPresent_", ["bye", (function(value){return (visited=value);})]));
  636. smalltalk.send(self, "_assert_", [smalltalk.send(absent, "_isNil", [])]);
  637. return self;},
  638. args: [],
  639. 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",
  640. messageSends: ["new", "at:put:", "at:ifPresent:", "assert:", "=", "isNil"],
  641. referencedClasses: ["Dictionary"]
  642. }),
  643. smalltalk.DictionaryTest);
  644. smalltalk.addMethod(
  645. "_testIfPresentIfAbsent",
  646. smalltalk.method({
  647. selector: "testIfPresentIfAbsent",
  648. category: 'tests',
  649. fn: function (){
  650. var self=this;
  651. var d=nil;
  652. var visited=nil;
  653. (visited=false);
  654. (d=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
  655. smalltalk.send(d, "_at_put_", ["hello", "world"]);
  656. smalltalk.send(d, "_at_ifPresent_ifAbsent_", ["hello", (function(value){return (visited=value);}), (function(){return (visited=true);})]);
  657. smalltalk.send(self, "_assert_", [smalltalk.send(visited, "__eq", ["world"])]);
  658. smalltalk.send(d, "_at_ifPresent_ifAbsent_", ["buy", (function(value){return (visited=value);}), (function(){return (visited=true);})]);
  659. smalltalk.send(self, "_assert_", [visited]);
  660. return self;},
  661. args: [],
  662. 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.",
  663. messageSends: ["new", "at:put:", "at:ifPresent:ifAbsent:", "assert:", "="],
  664. referencedClasses: ["Dictionary"]
  665. }),
  666. smalltalk.DictionaryTest);
  667. smalltalk.addMethod(
  668. "_testKeys",
  669. smalltalk.method({
  670. selector: "testKeys",
  671. category: 'tests',
  672. fn: function (){
  673. var self=this;
  674. var d=nil;
  675. (d=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
  676. smalltalk.send(d, "_at_put_", [(1), (2)]);
  677. smalltalk.send(d, "_at_put_", [(2), (3)]);
  678. smalltalk.send(d, "_at_put_", [(3), (4)]);
  679. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_keys", []), "__eq", [[(1), (2), (3)]])]);
  680. return self;},
  681. args: [],
  682. 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)",
  683. messageSends: ["new", "at:put:", "assert:", "=", "keys"],
  684. referencedClasses: ["Dictionary"]
  685. }),
  686. smalltalk.DictionaryTest);
  687. smalltalk.addMethod(
  688. "_testPrintString",
  689. smalltalk.method({
  690. selector: "testPrintString",
  691. category: 'tests',
  692. fn: function (){
  693. var self=this;
  694. smalltalk.send(self, "_assert_equals_", ["a Dictionary('firstname' -> 'James' , 'lastname' -> 'Bond')", (function($rec){smalltalk.send($rec, "_at_put_", ["firstname", "James"]);smalltalk.send($rec, "_at_put_", ["lastname", "Bond"]);return smalltalk.send($rec, "_printString", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []))]);
  695. return self;},
  696. args: [],
  697. 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)",
  698. messageSends: ["assert:equals:", "at:put:", "printString", "new"],
  699. referencedClasses: ["Dictionary"]
  700. }),
  701. smalltalk.DictionaryTest);
  702. smalltalk.addMethod(
  703. "_testRemoveKey",
  704. smalltalk.method({
  705. selector: "testRemoveKey",
  706. category: 'tests',
  707. fn: function (){
  708. var self=this;
  709. var d=nil;
  710. var key=nil;
  711. (d=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
  712. smalltalk.send(d, "_at_put_", [(1), (2)]);
  713. smalltalk.send(d, "_at_put_", [(2), (3)]);
  714. smalltalk.send(d, "_at_put_", [(3), (4)]);
  715. (key=(2));
  716. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_keys", []), "__eq", [[(1), (2), (3)]])]);
  717. smalltalk.send(d, "_removeKey_", [key]);
  718. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_keys", []), "__eq", [[(1), (3)]])]);
  719. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_values", []), "__eq", [[(2), (4)]])]);
  720. smalltalk.send(self, "_deny_", [smalltalk.send(d, "_includesKey_", [(2)])]);
  721. return self;},
  722. args: [],
  723. 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)",
  724. messageSends: ["new", "at:put:", "assert:", "=", "keys", "removeKey:", "values", "deny:", "includesKey:"],
  725. referencedClasses: ["Dictionary"]
  726. }),
  727. smalltalk.DictionaryTest);
  728. smalltalk.addMethod(
  729. "_testRemoveKeyIfAbsent",
  730. smalltalk.method({
  731. selector: "testRemoveKeyIfAbsent",
  732. category: 'tests',
  733. fn: function (){
  734. var self=this;
  735. var d=nil;
  736. var key=nil;
  737. (d=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
  738. smalltalk.send(d, "_at_put_", [(1), (2)]);
  739. smalltalk.send(d, "_at_put_", [(2), (3)]);
  740. smalltalk.send(d, "_at_put_", [(3), (4)]);
  741. (key=(2));
  742. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_removeKey_", [key]), "__eq", [(3)])]);
  743. (key=(3));
  744. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_removeKey_ifAbsent_", [key, (function(){return (42);})]), "__eq", [(4)])]);
  745. (key="why");
  746. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_removeKey_ifAbsent_", [key, (function(){return (42);})]), "__eq", [(42)])]);
  747. return self;},
  748. args: [],
  749. 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.",
  750. messageSends: ["new", "at:put:", "assert:", "=", "removeKey:", "removeKey:ifAbsent:"],
  751. referencedClasses: ["Dictionary"]
  752. }),
  753. smalltalk.DictionaryTest);
  754. smalltalk.addMethod(
  755. "_testSize",
  756. smalltalk.method({
  757. selector: "testSize",
  758. category: 'tests',
  759. fn: function (){
  760. var self=this;
  761. var d=nil;
  762. (d=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
  763. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_size", []), "__eq", [(0)])]);
  764. smalltalk.send(d, "_at_put_", [(1), (2)]);
  765. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_size", []), "__eq", [(1)])]);
  766. smalltalk.send(d, "_at_put_", [(2), (3)]);
  767. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_size", []), "__eq", [(2)])]);
  768. return self;},
  769. args: [],
  770. 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.",
  771. messageSends: ["new", "assert:", "=", "size", "at:put:"],
  772. referencedClasses: ["Dictionary"]
  773. }),
  774. smalltalk.DictionaryTest);
  775. smalltalk.addMethod(
  776. "_testValues",
  777. smalltalk.method({
  778. selector: "testValues",
  779. category: 'tests',
  780. fn: function (){
  781. var self=this;
  782. var d=nil;
  783. (d=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
  784. smalltalk.send(d, "_at_put_", [(1), (2)]);
  785. smalltalk.send(d, "_at_put_", [(2), (3)]);
  786. smalltalk.send(d, "_at_put_", [(3), (4)]);
  787. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_values", []), "__eq", [[(2), (3), (4)]])]);
  788. return self;},
  789. args: [],
  790. 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)",
  791. messageSends: ["new", "at:put:", "assert:", "=", "values"],
  792. referencedClasses: ["Dictionary"]
  793. }),
  794. smalltalk.DictionaryTest);
  795. smalltalk.addClass('HashedCollectionTest', smalltalk.TestCase, [], 'Kernel-Tests');
  796. smalltalk.addMethod(
  797. "_testPrintString",
  798. smalltalk.method({
  799. selector: "testPrintString",
  800. category: 'tests',
  801. fn: function (){
  802. var self=this;
  803. var aHashedCollection=nil;
  804. (aHashedCollection=smalltalk.send((smalltalk.HashedCollection || HashedCollection), "_new", []));
  805. smalltalk.send(self, "_assert_equals_", ["a HashedCollection()", smalltalk.send(aHashedCollection, "_printString", [])]);
  806. smalltalk.send(aHashedCollection, "_at_put_", ["key1", (1)]);
  807. smalltalk.send(self, "_assert_equals_", ["a HashedCollection('key1'->1)", smalltalk.send(aHashedCollection, "_printString", [])]);
  808. smalltalk.send(aHashedCollection, "_at_put_", ["key2", (2)]);
  809. smalltalk.send(self, "_assert_equals_", ["a HashedCollection('key1'->1 , 'key2'->2)", smalltalk.send(aHashedCollection, "_printString", [])]);
  810. return self;},
  811. args: [],
  812. source: "testPrintString\x0a\x09\x22test if the printString message returns the correct string representation\x22\x0a\x09| aHashedCollection |\x0a\x09aHashedCollection := HashedCollection new.\x0a\x09self assert: 'a HashedCollection()' equals: aHashedCollection printString.\x0a\x0a\x09aHashedCollection at: 'key1' put: 1.\x0a\x09self assert: 'a HashedCollection(''key1''->1)' equals: aHashedCollection printString.\x0a\x0a\x09aHashedCollection at: 'key2' put: 2.\x0a\x09self assert: 'a HashedCollection(''key1''->1 , ''key2''->2)' equals: aHashedCollection printString.",
  813. messageSends: ["new", "assert:equals:", "printString", "at:put:"],
  814. referencedClasses: ["HashedCollection"]
  815. }),
  816. smalltalk.HashedCollectionTest);
  817. smalltalk.addClass('JSObjectProxyTest', smalltalk.TestCase, [], 'Kernel-Tests');
  818. smalltalk.addMethod(
  819. "_jsObject",
  820. smalltalk.method({
  821. selector: "jsObject",
  822. category: 'accessing',
  823. fn: function (){
  824. var self=this;
  825. return jsObject = {a: 1, b: function() {return 2;}, c: function(object) {return object;}};
  826. return self;},
  827. args: [],
  828. source: "jsObject\x0a\x09<return jsObject = {a: 1, b: function() {return 2;}, c: function(object) {return object;}}>",
  829. messageSends: [],
  830. referencedClasses: []
  831. }),
  832. smalltalk.JSObjectProxyTest);
  833. smalltalk.addMethod(
  834. "_testDNU",
  835. smalltalk.method({
  836. selector: "testDNU",
  837. category: 'tests',
  838. fn: function (){
  839. var self=this;
  840. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send(smalltalk.send(self, "_jsObject", []), "_foo", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  841. return self;},
  842. args: [],
  843. source: "testDNU\x0a\x09self should: [self jsObject foo] raise: MessageNotUnderstood",
  844. messageSends: ["should:raise:", "foo", "jsObject"],
  845. referencedClasses: ["MessageNotUnderstood"]
  846. }),
  847. smalltalk.JSObjectProxyTest);
  848. smalltalk.addMethod(
  849. "_testMessageSend",
  850. smalltalk.method({
  851. selector: "testMessageSend",
  852. category: 'tests',
  853. fn: function (){
  854. var self=this;
  855. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send(self, "_jsObject", []), "_a", []), (1)]);
  856. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send(self, "_jsObject", []), "_b", []), (2)]);
  857. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send(self, "_jsObject", []), "_c_", [(3)]), (3)]);
  858. return self;},
  859. args: [],
  860. 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",
  861. messageSends: ["assert:equals:", "a", "jsObject", "b", "c:"],
  862. referencedClasses: []
  863. }),
  864. smalltalk.JSObjectProxyTest);
  865. smalltalk.addMethod(
  866. "_testMethodWithArguments",
  867. smalltalk.method({
  868. selector: "testMethodWithArguments",
  869. category: 'tests',
  870. fn: function (){
  871. var self=this;
  872. smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_hasClass_", ["amber"])]);
  873. smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_addClass_", ["amber"]);
  874. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_hasClass_", ["amber"])]);
  875. smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_removeClass_", ["amber"]);
  876. smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_hasClass_", ["amber"])]);
  877. return self;},
  878. args: [],
  879. source: "testMethodWithArguments\x0a\x09self deny: ('body' asJQuery hasClass: 'amber').\x0a\x0a\x09'body' asJQuery addClass: 'amber'.\x0a\x09self assert: ('body' asJQuery hasClass: 'amber').\x0a\x0a\x09'body' asJQuery removeClass: 'amber'.\x0a\x09self deny: ('body' asJQuery hasClass: 'amber').",
  880. messageSends: ["deny:", "hasClass:", "asJQuery", "addClass:", "assert:", "removeClass:"],
  881. referencedClasses: []
  882. }),
  883. smalltalk.JSObjectProxyTest);
  884. smalltalk.addMethod(
  885. "_testPrinting",
  886. smalltalk.method({
  887. selector: "testPrinting",
  888. category: 'tests',
  889. fn: function (){
  890. var self=this;
  891. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_jsObject", []), "_printString", []), "__eq", ["[object Object]"])]);
  892. return self;},
  893. args: [],
  894. source: "testPrinting\x0a\x09self assert: self jsObject printString = '[object Object]'",
  895. messageSends: ["assert:", "=", "printString", "jsObject"],
  896. referencedClasses: []
  897. }),
  898. smalltalk.JSObjectProxyTest);
  899. smalltalk.addMethod(
  900. "_testPropertyThatReturnsEmptyString",
  901. smalltalk.method({
  902. selector: "testPropertyThatReturnsEmptyString",
  903. category: 'tests',
  904. fn: function (){
  905. var self=this;
  906. document.location.hash = '';
  907. smalltalk.send(self, "_assert_equals_", ["", smalltalk.send(smalltalk.send((typeof document == 'undefined' ? nil : document), "_location", []), "_hash", [])]);
  908. smalltalk.send(smalltalk.send((typeof document == 'undefined' ? nil : document), "_location", []), "_hash_", ["test"]);
  909. smalltalk.send(self, "_assert_equals_", ["#test", smalltalk.send(smalltalk.send((typeof document == 'undefined' ? nil : document), "_location", []), "_hash", [])]);
  910. return self;},
  911. args: [],
  912. source: "testPropertyThatReturnsEmptyString\x0a\x09<document.location.hash = ''>.\x0a\x09self assert: '' equals: document location hash.\x0a\x0a\x09document location hash: 'test'.\x0a\x09self assert: '#test' equals: document location hash.",
  913. messageSends: ["assert:equals:", "hash", "location", "hash:"],
  914. referencedClasses: []
  915. }),
  916. smalltalk.JSObjectProxyTest);
  917. smalltalk.addMethod(
  918. "_testYourself",
  919. smalltalk.method({
  920. selector: "testYourself",
  921. category: 'tests',
  922. fn: function (){
  923. var self=this;
  924. var body=nil;
  925. (body=(function($rec){smalltalk.send($rec, "_addClass_", ["amber"]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send("body", "_asJQuery", [])));
  926. smalltalk.send(self, "_assert_", [smalltalk.send(body, "_hasClass_", ["amber"])]);
  927. smalltalk.send(body, "_removeClass_", ["amber"]);
  928. smalltalk.send(self, "_deny_", [smalltalk.send(body, "_hasClass_", ["amber"])]);
  929. return self;},
  930. args: [],
  931. source: "testYourself\x0a\x09|body|\x0a\x09body := 'body' asJQuery\x0a\x09\x09\x09\x09addClass: 'amber';\x0a\x09\x09\x09\x09yourself.\x0a\x0a\x09self assert: (body hasClass: 'amber').\x0a\x0a\x09body removeClass: 'amber'.\x0a\x09self deny: (body hasClass: 'amber').",
  932. messageSends: ["addClass:", "yourself", "asJQuery", "assert:", "hasClass:", "removeClass:", "deny:"],
  933. referencedClasses: []
  934. }),
  935. smalltalk.JSObjectProxyTest);
  936. smalltalk.addClass('NumberTest', smalltalk.TestCase, [], 'Kernel-Tests');
  937. smalltalk.addMethod(
  938. "_testArithmetic",
  939. smalltalk.method({
  940. selector: "testArithmetic",
  941. category: 'tests',
  942. fn: function (){
  943. var self=this;
  944. smalltalk.send(self, "_assert_", [smalltalk.send((1.5) + (1), "__eq", [(2.5)])]);
  945. smalltalk.send(self, "_assert_", [smalltalk.send((2) - (1), "__eq", [(1)])]);
  946. smalltalk.send(self, "_assert_", [smalltalk.send((-2) - (1), "__eq", [(-3)])]);
  947. smalltalk.send(self, "_assert_", [smalltalk.send((12) / (2), "__eq", [(6)])]);
  948. smalltalk.send(self, "_assert_", [smalltalk.send((3) * (4), "__eq", [(12)])]);
  949. smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = (1) + (2)).klass === smalltalk.Number) ? $receiver *(3) : smalltalk.send($receiver, "__star", [(3)])), "__eq", [(9)])]);
  950. smalltalk.send(self, "_assert_", [smalltalk.send((1) + (2) * (3), "__eq", [(7)])]);
  951. return self;},
  952. args: [],
  953. 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",
  954. messageSends: ["assert:", "=", "+", "-", "/", "*"],
  955. referencedClasses: []
  956. }),
  957. smalltalk.NumberTest);
  958. smalltalk.addMethod(
  959. "_testComparison",
  960. smalltalk.method({
  961. selector: "testComparison",
  962. category: 'tests',
  963. fn: function (){
  964. var self=this;
  965. smalltalk.send(self, "_assert_", [(3) > (2)]);
  966. smalltalk.send(self, "_assert_", [(2) < (3)]);
  967. smalltalk.send(self, "_deny_", [(3) < (2)]);
  968. smalltalk.send(self, "_deny_", [(2) > (3)]);
  969. smalltalk.send(self, "_assert_", [(3) >= (3)]);
  970. smalltalk.send(self, "_assert_", [(3.1) >= (3)]);
  971. smalltalk.send(self, "_assert_", [(3) <= (3)]);
  972. smalltalk.send(self, "_assert_", [(3) <= (3.1)]);
  973. return self;},
  974. args: [],
  975. 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",
  976. messageSends: ["assert:", ">", "<", "deny:", ">=", "<="],
  977. referencedClasses: []
  978. }),
  979. smalltalk.NumberTest);
  980. smalltalk.addMethod(
  981. "_testCopying",
  982. smalltalk.method({
  983. selector: "testCopying",
  984. category: 'tests',
  985. fn: function (){
  986. var self=this;
  987. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((1), "_copy", []), "__eq_eq", [(1)])]);
  988. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((1), "_deepCopy", []), "__eq_eq", [(1)])]);
  989. return self;},
  990. args: [],
  991. source: "testCopying\x0a\x09self assert: 1 copy == 1.\x0a\x09self assert: 1 deepCopy == 1",
  992. messageSends: ["assert:", "==", "copy", "deepCopy"],
  993. referencedClasses: []
  994. }),
  995. smalltalk.NumberTest);
  996. smalltalk.addMethod(
  997. "_testEquality",
  998. smalltalk.method({
  999. selector: "testEquality",
  1000. category: 'tests',
  1001. fn: function (){
  1002. var self=this;
  1003. smalltalk.send(self, "_assert_", [smalltalk.send((1), "__eq", [(1)])]);
  1004. smalltalk.send(self, "_assert_", [smalltalk.send((0), "__eq", [(0)])]);
  1005. smalltalk.send(self, "_deny_", [smalltalk.send((1), "__eq", [(0)])]);
  1006. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((1), "_yourself", []), "__eq", [(1)])]);
  1007. smalltalk.send(self, "_assert_", [smalltalk.send((1), "__eq", [smalltalk.send((1), "_yourself", [])])]);
  1008. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((1), "_yourself", []), "__eq", [smalltalk.send((1), "_yourself", [])])]);
  1009. smalltalk.send(self, "_deny_", [smalltalk.send((0), "__eq", [false])]);
  1010. smalltalk.send(self, "_deny_", [smalltalk.send(false, "__eq", [(0)])]);
  1011. smalltalk.send(self, "_deny_", [smalltalk.send("", "__eq", [(0)])]);
  1012. smalltalk.send(self, "_deny_", [smalltalk.send((0), "__eq", [""])]);
  1013. return self;},
  1014. args: [],
  1015. 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 = ''",
  1016. messageSends: ["assert:", "=", "deny:", "yourself"],
  1017. referencedClasses: []
  1018. }),
  1019. smalltalk.NumberTest);
  1020. smalltalk.addMethod(
  1021. "_testIdentity",
  1022. smalltalk.method({
  1023. selector: "testIdentity",
  1024. category: 'tests',
  1025. fn: function (){
  1026. var self=this;
  1027. smalltalk.send(self, "_assert_", [smalltalk.send((1), "__eq_eq", [(1)])]);
  1028. smalltalk.send(self, "_assert_", [smalltalk.send((0), "__eq_eq", [(0)])]);
  1029. smalltalk.send(self, "_deny_", [smalltalk.send((1), "__eq_eq", [(0)])]);
  1030. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((1), "_yourself", []), "__eq_eq", [(1)])]);
  1031. smalltalk.send(self, "_assert_", [smalltalk.send((1), "__eq_eq", [smalltalk.send((1), "_yourself", [])])]);
  1032. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((1), "_yourself", []), "__eq_eq", [smalltalk.send((1), "_yourself", [])])]);
  1033. smalltalk.send(self, "_deny_", [smalltalk.send((1), "__eq_eq", [(2)])]);
  1034. return self;},
  1035. args: [],
  1036. 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",
  1037. messageSends: ["assert:", "==", "deny:", "yourself"],
  1038. referencedClasses: []
  1039. }),
  1040. smalltalk.NumberTest);
  1041. smalltalk.addMethod(
  1042. "_testMinMax",
  1043. smalltalk.method({
  1044. selector: "testMinMax",
  1045. category: 'tests',
  1046. fn: function (){
  1047. var self=this;
  1048. smalltalk.send(self, "_assert_equals_", [smalltalk.send((2), "_max_", [(5)]), (5)]);
  1049. smalltalk.send(self, "_assert_equals_", [smalltalk.send((2), "_min_", [(5)]), (2)]);
  1050. return self;},
  1051. args: [],
  1052. source: "testMinMax\x0a\x09\x0a\x09self assert: (2 max: 5) equals: 5.\x0a\x09self assert: (2 min: 5) equals: 2",
  1053. messageSends: ["assert:equals:", "max:", "min:"],
  1054. referencedClasses: []
  1055. }),
  1056. smalltalk.NumberTest);
  1057. smalltalk.addMethod(
  1058. "_testNegated",
  1059. smalltalk.method({
  1060. selector: "testNegated",
  1061. category: 'tests',
  1062. fn: function (){
  1063. var self=this;
  1064. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3), "_negated", []), "__eq", [(-3)])]);
  1065. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((-3), "_negated", []), "__eq", [(3)])]);
  1066. return self;},
  1067. args: [],
  1068. source: "testNegated\x0a\x09self assert: 3 negated = -3.\x0a\x09self assert: -3 negated = 3",
  1069. messageSends: ["assert:", "=", "negated"],
  1070. referencedClasses: []
  1071. }),
  1072. smalltalk.NumberTest);
  1073. smalltalk.addMethod(
  1074. "_testPrintShowingDecimalPlaces",
  1075. smalltalk.method({
  1076. selector: "testPrintShowingDecimalPlaces",
  1077. category: 'tests',
  1078. fn: function (){
  1079. var self=this;
  1080. smalltalk.send(self, "_assert_equals_", ["23.00", smalltalk.send((23), "_printShowingDecimalPlaces_", [(2)])]);
  1081. smalltalk.send(self, "_assert_equals_", ["23.57", smalltalk.send((23.5698), "_printShowingDecimalPlaces_", [(2)])]);
  1082. smalltalk.send(self, "_assert_equals_", ["-234.56700", smalltalk.send(smalltalk.send((234.567), "_negated", []), "_printShowingDecimalPlaces_", [(5)])]);
  1083. smalltalk.send(self, "_assert_equals_", ["23", smalltalk.send((23.4567), "_printShowingDecimalPlaces_", [(0)])]);
  1084. smalltalk.send(self, "_assert_equals_", ["24", smalltalk.send((23.5567), "_printShowingDecimalPlaces_", [(0)])]);
  1085. smalltalk.send(self, "_assert_equals_", ["-23", smalltalk.send(smalltalk.send((23.4567), "_negated", []), "_printShowingDecimalPlaces_", [(0)])]);
  1086. smalltalk.send(self, "_assert_equals_", ["-24", smalltalk.send(smalltalk.send((23.5567), "_negated", []), "_printShowingDecimalPlaces_", [(0)])]);
  1087. smalltalk.send(self, "_assert_equals_", ["100000000.0", smalltalk.send((100000000), "_printShowingDecimalPlaces_", [(1)])]);
  1088. smalltalk.send(self, "_assert_equals_", ["0.98000", smalltalk.send((0.98), "_printShowingDecimalPlaces_", [(5)])]);
  1089. smalltalk.send(self, "_assert_equals_", ["-0.98", smalltalk.send(smalltalk.send((0.98), "_negated", []), "_printShowingDecimalPlaces_", [(2)])]);
  1090. smalltalk.send(self, "_assert_equals_", ["2.57", smalltalk.send((2.567), "_printShowingDecimalPlaces_", [(2)])]);
  1091. smalltalk.send(self, "_assert_equals_", ["-2.57", smalltalk.send((-2.567), "_printShowingDecimalPlaces_", [(2)])]);
  1092. smalltalk.send(self, "_assert_equals_", ["0.00", smalltalk.send((0), "_printShowingDecimalPlaces_", [(2)])]);
  1093. return self;},
  1094. args: [],
  1095. 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).",
  1096. messageSends: ["assert:equals:", "printShowingDecimalPlaces:", "negated"],
  1097. referencedClasses: []
  1098. }),
  1099. smalltalk.NumberTest);
  1100. smalltalk.addMethod(
  1101. "_testRounded",
  1102. smalltalk.method({
  1103. selector: "testRounded",
  1104. category: 'tests',
  1105. fn: function (){
  1106. var self=this;
  1107. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3), "_rounded", []), "__eq", [(3)])]);
  1108. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3.212), "_rounded", []), "__eq", [(3)])]);
  1109. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3.51), "_rounded", []), "__eq", [(4)])]);
  1110. return self;},
  1111. args: [],
  1112. source: "testRounded\x0a\x09\x0a\x09self assert: 3 rounded = 3.\x0a\x09self assert: 3.212 rounded = 3.\x0a\x09self assert: 3.51 rounded = 4",
  1113. messageSends: ["assert:", "=", "rounded"],
  1114. referencedClasses: []
  1115. }),
  1116. smalltalk.NumberTest);
  1117. smalltalk.addMethod(
  1118. "_testSqrt",
  1119. smalltalk.method({
  1120. selector: "testSqrt",
  1121. category: 'tests',
  1122. fn: function (){
  1123. var self=this;
  1124. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((4), "_sqrt", []), "__eq", [(2)])]);
  1125. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((16), "_sqrt", []), "__eq", [(4)])]);
  1126. return self;},
  1127. args: [],
  1128. source: "testSqrt\x0a\x09\x0a\x09self assert: 4 sqrt = 2.\x0a\x09self assert: 16 sqrt = 4",
  1129. messageSends: ["assert:", "=", "sqrt"],
  1130. referencedClasses: []
  1131. }),
  1132. smalltalk.NumberTest);
  1133. smalltalk.addMethod(
  1134. "_testSquared",
  1135. smalltalk.method({
  1136. selector: "testSquared",
  1137. category: 'tests',
  1138. fn: function (){
  1139. var self=this;
  1140. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((4), "_squared", []), "__eq", [(16)])]);
  1141. return self;},
  1142. args: [],
  1143. source: "testSquared\x0a\x09\x0a\x09self assert: 4 squared = 16",
  1144. messageSends: ["assert:", "=", "squared"],
  1145. referencedClasses: []
  1146. }),
  1147. smalltalk.NumberTest);
  1148. smalltalk.addMethod(
  1149. "_testTimesRepeat",
  1150. smalltalk.method({
  1151. selector: "testTimesRepeat",
  1152. category: 'tests',
  1153. fn: function (){
  1154. var self=this;
  1155. var i=nil;
  1156. (i=(0));
  1157. smalltalk.send((0), "_timesRepeat_", [(function(){return (i=((($receiver = i).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));})]);
  1158. smalltalk.send(self, "_assert_equals_", [i, (0)]);
  1159. smalltalk.send((5), "_timesRepeat_", [(function(){return (i=((($receiver = i).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));})]);
  1160. smalltalk.send(self, "_assert_equals_", [i, (5)]);
  1161. return self;},
  1162. args: [],
  1163. 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",
  1164. messageSends: ["timesRepeat:", "+", "assert:equals:"],
  1165. referencedClasses: []
  1166. }),
  1167. smalltalk.NumberTest);
  1168. smalltalk.addMethod(
  1169. "_testTo",
  1170. smalltalk.method({
  1171. selector: "testTo",
  1172. category: 'tests',
  1173. fn: function (){
  1174. var self=this;
  1175. smalltalk.send(self, "_assert_equals_", [smalltalk.send((1), "_to_", [(5)]), [(1), (2), (3), (4), (5)]]);
  1176. return self;},
  1177. args: [],
  1178. source: "testTo\x0a\x09self assert: (1 to: 5) equals: #(1 2 3 4 5)",
  1179. messageSends: ["assert:equals:", "to:"],
  1180. referencedClasses: []
  1181. }),
  1182. smalltalk.NumberTest);
  1183. smalltalk.addMethod(
  1184. "_testToBy",
  1185. smalltalk.method({
  1186. selector: "testToBy",
  1187. category: 'tests',
  1188. fn: function (){
  1189. var self=this;
  1190. smalltalk.send(self, "_assert_equals_", [smalltalk.send((0), "_to_by_", [(6), (2)]), [(0), (2), (4), (6)]]);
  1191. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send((1), "_to_by_", [(4), (0)]);}), (smalltalk.Error || Error)]);
  1192. return self;},
  1193. args: [],
  1194. 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",
  1195. messageSends: ["assert:equals:", "to:by:", "should:raise:"],
  1196. referencedClasses: ["Error"]
  1197. }),
  1198. smalltalk.NumberTest);
  1199. smalltalk.addMethod(
  1200. "_testTruncated",
  1201. smalltalk.method({
  1202. selector: "testTruncated",
  1203. category: 'tests',
  1204. fn: function (){
  1205. var self=this;
  1206. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3), "_truncated", []), "__eq", [(3)])]);
  1207. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3.212), "_truncated", []), "__eq", [(3)])]);
  1208. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3.51), "_truncated", []), "__eq", [(3)])]);
  1209. return self;},
  1210. args: [],
  1211. source: "testTruncated\x0a\x09\x0a\x09self assert: 3 truncated = 3.\x0a\x09self assert: 3.212 truncated = 3.\x0a\x09self assert: 3.51 truncated = 3",
  1212. messageSends: ["assert:", "=", "truncated"],
  1213. referencedClasses: []
  1214. }),
  1215. smalltalk.NumberTest);
  1216. smalltalk.addClass('ObjectMock', smalltalk.Object, ['foo', 'bar'], 'Kernel-Tests');
  1217. smalltalk.addMethod(
  1218. "_foo",
  1219. smalltalk.method({
  1220. selector: "foo",
  1221. category: 'not yet classified',
  1222. fn: function (){
  1223. var self=this;
  1224. return self['@foo'];
  1225. return self;},
  1226. args: [],
  1227. source: "foo\x0a\x09^foo",
  1228. messageSends: [],
  1229. referencedClasses: []
  1230. }),
  1231. smalltalk.ObjectMock);
  1232. smalltalk.addMethod(
  1233. "_foo_",
  1234. smalltalk.method({
  1235. selector: "foo:",
  1236. category: 'not yet classified',
  1237. fn: function (anObject){
  1238. var self=this;
  1239. (self['@foo']=anObject);
  1240. return self;},
  1241. args: ["anObject"],
  1242. source: "foo: anObject\x0a\x09foo := anObject",
  1243. messageSends: [],
  1244. referencedClasses: []
  1245. }),
  1246. smalltalk.ObjectMock);
  1247. smalltalk.addClass('ObjectTest', smalltalk.TestCase, [], 'Kernel-Tests');
  1248. smalltalk.addMethod(
  1249. "_testBasicAccess",
  1250. smalltalk.method({
  1251. selector: "testBasicAccess",
  1252. category: 'tests',
  1253. fn: function (){
  1254. var self=this;
  1255. var o=nil;
  1256. (o=smalltalk.send((smalltalk.Object || Object), "_new", []));
  1257. smalltalk.send(o, "_basicAt_put_", ["a", (1)]);
  1258. smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_basicAt_", ["a"]), (1)]);
  1259. smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_basicAt_", ["b"]), nil]);
  1260. return self;},
  1261. args: [],
  1262. 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",
  1263. messageSends: ["new", "basicAt:put:", "assert:equals:", "basicAt:"],
  1264. referencedClasses: ["Object"]
  1265. }),
  1266. smalltalk.ObjectTest);
  1267. smalltalk.addMethod(
  1268. "_testBasicPerform",
  1269. smalltalk.method({
  1270. selector: "testBasicPerform",
  1271. category: 'tests',
  1272. fn: function (){
  1273. var self=this;
  1274. var o=nil;
  1275. (o=smalltalk.send((smalltalk.Object || Object), "_new", []));
  1276. smalltalk.send(o, "_basicAt_put_", ["func", (function(){return "hello";})]);
  1277. smalltalk.send(o, "_basicAt_put_", ["func2", (function(a){return ((($receiver = a).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));})]);
  1278. smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_basicPerform_", ["func"]), "hello"]);
  1279. smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_basicPerform_withArguments_", ["func2", [(3)]]), (4)]);
  1280. return self;},
  1281. args: [],
  1282. 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",
  1283. messageSends: ["new", "basicAt:put:", "+", "assert:equals:", "basicPerform:", "basicPerform:withArguments:"],
  1284. referencedClasses: ["Object"]
  1285. }),
  1286. smalltalk.ObjectTest);
  1287. smalltalk.addMethod(
  1288. "_testDNU",
  1289. smalltalk.method({
  1290. selector: "testDNU",
  1291. category: 'tests',
  1292. fn: function (){
  1293. var self=this;
  1294. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send(smalltalk.send((smalltalk.Object || Object), "_new", []), "_foo", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
  1295. return self;},
  1296. args: [],
  1297. source: "testDNU\x0a\x09self should: [Object new foo] raise: MessageNotUnderstood",
  1298. messageSends: ["should:raise:", "foo", "new"],
  1299. referencedClasses: ["Object", "MessageNotUnderstood"]
  1300. }),
  1301. smalltalk.ObjectTest);
  1302. smalltalk.addMethod(
  1303. "_testEquality",
  1304. smalltalk.method({
  1305. selector: "testEquality",
  1306. category: 'tests',
  1307. fn: function (){
  1308. var self=this;
  1309. var o=nil;
  1310. (o=smalltalk.send((smalltalk.Object || Object), "_new", []));
  1311. smalltalk.send(self, "_deny_", [smalltalk.send(o, "__eq", [smalltalk.send((smalltalk.Object || Object), "_new", [])])]);
  1312. smalltalk.send(self, "_assert_", [smalltalk.send(o, "__eq", [o])]);
  1313. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(o, "_yourself", []), "__eq", [o])]);
  1314. smalltalk.send(self, "_assert_", [smalltalk.send(o, "__eq", [smalltalk.send(o, "_yourself", [])])]);
  1315. return self;},
  1316. args: [],
  1317. 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",
  1318. messageSends: ["new", "deny:", "=", "assert:", "yourself"],
  1319. referencedClasses: ["Object"]
  1320. }),
  1321. smalltalk.ObjectTest);
  1322. smalltalk.addMethod(
  1323. "_testHalt",
  1324. smalltalk.method({
  1325. selector: "testHalt",
  1326. category: 'tests',
  1327. fn: function (){
  1328. var self=this;
  1329. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send(smalltalk.send((smalltalk.Object || Object), "_new", []), "_halt", []);}), (smalltalk.Error || Error)]);
  1330. return self;},
  1331. args: [],
  1332. source: "testHalt\x0a\x09self should: [Object new halt] raise: Error",
  1333. messageSends: ["should:raise:", "halt", "new"],
  1334. referencedClasses: ["Object", "Error"]
  1335. }),
  1336. smalltalk.ObjectTest);
  1337. smalltalk.addMethod(
  1338. "_testIdentity",
  1339. smalltalk.method({
  1340. selector: "testIdentity",
  1341. category: 'tests',
  1342. fn: function (){
  1343. var self=this;
  1344. var o=nil;
  1345. (o=smalltalk.send((smalltalk.Object || Object), "_new", []));
  1346. smalltalk.send(self, "_deny_", [smalltalk.send(o, "__eq_eq", [smalltalk.send((smalltalk.Object || Object), "_new", [])])]);
  1347. smalltalk.send(self, "_assert_", [smalltalk.send(o, "__eq_eq", [o])]);
  1348. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(o, "_yourself", []), "__eq_eq", [o])]);
  1349. smalltalk.send(self, "_assert_", [smalltalk.send(o, "__eq_eq", [smalltalk.send(o, "_yourself", [])])]);
  1350. return self;},
  1351. args: [],
  1352. 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",
  1353. messageSends: ["new", "deny:", "==", "assert:", "yourself"],
  1354. referencedClasses: ["Object"]
  1355. }),
  1356. smalltalk.ObjectTest);
  1357. smalltalk.addMethod(
  1358. "_testIfNil",
  1359. smalltalk.method({
  1360. selector: "testIfNil",
  1361. category: 'tests',
  1362. fn: function (){
  1363. var self=this;
  1364. smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send((smalltalk.Object || Object), "_new", []), "_isNil", [])]);
  1365. smalltalk.send(self, "_deny_", [smalltalk.send((($receiver = smalltalk.send((smalltalk.Object || Object), "_new", [])) == nil || $receiver == undefined) ? (function(){return true;})() : $receiver, "__eq", [true])]);
  1366. smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = smalltalk.send((smalltalk.Object || Object), "_new", [])) != nil && $receiver != undefined) ? (function(){return true;})() : nil, "__eq", [true])]);
  1367. smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = smalltalk.send((smalltalk.Object || Object), "_new", [])) == nil || $receiver == undefined) ? (function(){return false;})() : (function(){return true;})(), "__eq", [true])]);
  1368. smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = smalltalk.send((smalltalk.Object || Object), "_new", [])) == nil || $receiver == undefined) ? (function(){return false;})() : (function(){return true;})(), "__eq", [true])]);
  1369. return self;},
  1370. args: [],
  1371. 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",
  1372. messageSends: ["deny:", "isNil", "new", "=", "ifNil:", "assert:", "ifNotNil:", "ifNil:ifNotNil:", "ifNotNil:ifNil:"],
  1373. referencedClasses: ["Object"]
  1374. }),
  1375. smalltalk.ObjectTest);
  1376. smalltalk.addMethod(
  1377. "_testInstVars",
  1378. smalltalk.method({
  1379. selector: "testInstVars",
  1380. category: 'tests',
  1381. fn: function (){
  1382. var self=this;
  1383. var o=nil;
  1384. (o=smalltalk.send((smalltalk.ObjectMock || ObjectMock), "_new", []));
  1385. smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_instVarAt_", [smalltalk.symbolFor("foo")]), nil]);
  1386. smalltalk.send(o, "_instVarAt_put_", [smalltalk.symbolFor("foo"), (1)]);
  1387. smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_instVarAt_", [smalltalk.symbolFor("foo")]), (1)]);
  1388. smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_instVarAt_", ["foo"]), (1)]);
  1389. return self;},
  1390. args: [],
  1391. 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",
  1392. messageSends: ["new", "assert:equals:", "instVarAt:", "instVarAt:put:"],
  1393. referencedClasses: ["ObjectMock"]
  1394. }),
  1395. smalltalk.ObjectTest);
  1396. smalltalk.addMethod(
  1397. "_testNilUndefined",
  1398. smalltalk.method({
  1399. selector: "testNilUndefined",
  1400. category: 'tests',
  1401. fn: function (){
  1402. var self=this;
  1403. smalltalk.send(self, "_assert_", [smalltalk.send(nil, "__eq", [(typeof undefined == 'undefined' ? nil : undefined)])]);
  1404. return self;},
  1405. args: [],
  1406. source: "testNilUndefined\x0a\x09\x22nil in Smalltalk is the undefined object in JS\x22\x0a\x0a\x09self assert: nil = undefined",
  1407. messageSends: ["assert:", "="],
  1408. referencedClasses: []
  1409. }),
  1410. smalltalk.ObjectTest);
  1411. smalltalk.addMethod(
  1412. "_testYourself",
  1413. smalltalk.method({
  1414. selector: "testYourself",
  1415. category: 'tests',
  1416. fn: function (){
  1417. var self=this;
  1418. var o=nil;
  1419. (o=smalltalk.send((smalltalk.ObjectMock || ObjectMock), "_new", []));
  1420. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(o, "_yourself", []), "__eq_eq", [o])]);
  1421. return self;},
  1422. args: [],
  1423. source: "testYourself\x0a\x09| o |\x0a\x09o := ObjectMock new.\x0a\x09self assert: o yourself == o",
  1424. messageSends: ["new", "assert:", "==", "yourself"],
  1425. referencedClasses: ["ObjectMock"]
  1426. }),
  1427. smalltalk.ObjectTest);
  1428. smalltalk.addMethod(
  1429. "_testidentityHash",
  1430. smalltalk.method({
  1431. selector: "testidentityHash",
  1432. category: 'tests',
  1433. fn: function (){
  1434. var self=this;
  1435. var o1=nil;
  1436. var o2=nil;
  1437. (o1=smalltalk.send((smalltalk.Object || Object), "_new", []));
  1438. (o2=smalltalk.send((smalltalk.Object || Object), "_new", []));
  1439. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(o1, "_identityHash", []), "__eq_eq", [smalltalk.send(o1, "_identityHash", [])])]);
  1440. smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send(o1, "_identityHash", []), "__eq_eq", [smalltalk.send(o2, "_identityHash", [])])]);
  1441. return self;},
  1442. args: [],
  1443. 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",
  1444. messageSends: ["new", "assert:", "==", "identityHash", "deny:"],
  1445. referencedClasses: ["Object"]
  1446. }),
  1447. smalltalk.ObjectTest);
  1448. smalltalk.addClass('PackageTest', smalltalk.TestCase, ['zorkPackage', 'grulPackage', 'backUpCommitPathJs', 'backUpCommitPathSt'], 'Kernel-Tests');
  1449. smalltalk.addMethod(
  1450. "_setUp",
  1451. smalltalk.method({
  1452. selector: "setUp",
  1453. category: 'running',
  1454. fn: function (){
  1455. var self=this;
  1456. (self['@backUpCommitPathJs']=smalltalk.send((smalltalk.Package || Package), "_defaultCommitPathJs", []));
  1457. (self['@backUpCommitPathSt']=smalltalk.send((smalltalk.Package || Package), "_defaultCommitPathSt", []));
  1458. smalltalk.send((smalltalk.Package || Package), "_resetCommitPaths", []);
  1459. (self['@zorkPackage']=smalltalk.send(smalltalk.send((smalltalk.Package || Package), "_new", []), "_name_", ["Zork"]));
  1460. (self['@grulPackage']=(function($rec){smalltalk.send($rec, "_name_", ["Grul"]);smalltalk.send($rec, "_commitPathJs_", ["server/grul/js"]);smalltalk.send($rec, "_commitPathSt_", ["grul/st"]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Package || Package), "_new", [])));
  1461. return self;},
  1462. args: [],
  1463. 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",
  1464. messageSends: ["defaultCommitPathJs", "defaultCommitPathSt", "resetCommitPaths", "name:", "new", "commitPathJs:", "commitPathSt:", "yourself"],
  1465. referencedClasses: ["Package"]
  1466. }),
  1467. smalltalk.PackageTest);
  1468. smalltalk.addMethod(
  1469. "_tearDown",
  1470. smalltalk.method({
  1471. selector: "tearDown",
  1472. category: 'running',
  1473. fn: function (){
  1474. var self=this;
  1475. (function($rec){smalltalk.send($rec, "_defaultCommitPathJs_", [self['@backUpCommitPathJs']]);return smalltalk.send($rec, "_defaultCommitPathSt_", [self['@backUpCommitPathSt']]);})((smalltalk.Package || Package));
  1476. return self;},
  1477. args: [],
  1478. source: "tearDown\x0a\x09 Package \x0a\x09\x09defaultCommitPathJs: backUpCommitPathJs;\x0a\x09\x09defaultCommitPathSt: backUpCommitPathSt",
  1479. messageSends: ["defaultCommitPathJs:", "defaultCommitPathSt:"],
  1480. referencedClasses: ["Package"]
  1481. }),
  1482. smalltalk.PackageTest);
  1483. smalltalk.addMethod(
  1484. "_testGrulCommitPathJsShouldBeServerGrulJs",
  1485. smalltalk.method({
  1486. selector: "testGrulCommitPathJsShouldBeServerGrulJs",
  1487. category: 'tests',
  1488. fn: function (){
  1489. var self=this;
  1490. smalltalk.send(self, "_assert_equals_", ["server/grul/js", smalltalk.send(self['@grulPackage'], "_commitPathJs", [])]);
  1491. return self;},
  1492. args: [],
  1493. source: "testGrulCommitPathJsShouldBeServerGrulJs\x0a\x09self assert: 'server/grul/js' equals: grulPackage commitPathJs",
  1494. messageSends: ["assert:equals:", "commitPathJs"],
  1495. referencedClasses: []
  1496. }),
  1497. smalltalk.PackageTest);
  1498. smalltalk.addMethod(
  1499. "_testGrulCommitPathStShouldBeGrulSt",
  1500. smalltalk.method({
  1501. selector: "testGrulCommitPathStShouldBeGrulSt",
  1502. category: 'tests',
  1503. fn: function (){
  1504. var self=this;
  1505. smalltalk.send(self, "_assert_equals_", ["grul/st", smalltalk.send(self['@grulPackage'], "_commitPathSt", [])]);
  1506. return self;},
  1507. args: [],
  1508. source: "testGrulCommitPathStShouldBeGrulSt\x0a\x09self assert: 'grul/st' equals: grulPackage commitPathSt",
  1509. messageSends: ["assert:equals:", "commitPathSt"],
  1510. referencedClasses: []
  1511. }),
  1512. smalltalk.PackageTest);
  1513. smalltalk.addMethod(
  1514. "_testZorkCommitPathJsShouldBeJs",
  1515. smalltalk.method({
  1516. selector: "testZorkCommitPathJsShouldBeJs",
  1517. category: 'tests',
  1518. fn: function (){
  1519. var self=this;
  1520. smalltalk.send(self, "_assert_equals_", ["js", smalltalk.send(self['@zorkPackage'], "_commitPathJs", [])]);
  1521. return self;},
  1522. args: [],
  1523. source: "testZorkCommitPathJsShouldBeJs\x0a\x09self assert: 'js' equals: zorkPackage commitPathJs",
  1524. messageSends: ["assert:equals:", "commitPathJs"],
  1525. referencedClasses: []
  1526. }),
  1527. smalltalk.PackageTest);
  1528. smalltalk.addMethod(
  1529. "_testZorkCommitPathStShouldBeSt",
  1530. smalltalk.method({
  1531. selector: "testZorkCommitPathStShouldBeSt",
  1532. category: 'tests',
  1533. fn: function (){
  1534. var self=this;
  1535. smalltalk.send(self, "_assert_equals_", ["st", smalltalk.send(self['@zorkPackage'], "_commitPathSt", [])]);
  1536. return self;},
  1537. args: [],
  1538. source: "testZorkCommitPathStShouldBeSt\x0a\x09self assert: 'st' equals: zorkPackage commitPathSt",
  1539. messageSends: ["assert:equals:", "commitPathSt"],
  1540. referencedClasses: []
  1541. }),
  1542. smalltalk.PackageTest);
  1543. smalltalk.addClass('PackageWithDefaultCommitPathChangedTest', smalltalk.PackageTest, [], 'Kernel-Tests');
  1544. smalltalk.addMethod(
  1545. "_setUp",
  1546. smalltalk.method({
  1547. selector: "setUp",
  1548. category: 'running',
  1549. fn: function (){
  1550. var self=this;
  1551. smalltalk.send(self, "_setUp", [], smalltalk.PackageWithDefaultCommitPathChangedTest.superclass || nil);
  1552. (function($rec){smalltalk.send($rec, "_defaultCommitPathJs_", ["javascripts/"]);return smalltalk.send($rec, "_defaultCommitPathSt_", ["smalltalk/"]);})((smalltalk.Package || Package));
  1553. return self;},
  1554. args: [],
  1555. source: "setUp\x0a\x09super setUp.\x0a\x0a\x09Package\x0a\x09\x09defaultCommitPathJs: 'javascripts/';\x0a\x09\x09defaultCommitPathSt: 'smalltalk/'.",
  1556. messageSends: ["setUp", "defaultCommitPathJs:", "defaultCommitPathSt:"],
  1557. referencedClasses: ["Package"]
  1558. }),
  1559. smalltalk.PackageWithDefaultCommitPathChangedTest);
  1560. smalltalk.addMethod(
  1561. "_testGrulCommitPathJsShouldBeServerGrulJs",
  1562. smalltalk.method({
  1563. selector: "testGrulCommitPathJsShouldBeServerGrulJs",
  1564. category: 'tests',
  1565. fn: function (){
  1566. var self=this;
  1567. smalltalk.send(self, "_assert_equals_", ["server/grul/js", smalltalk.send(self['@grulPackage'], "_commitPathJs", [])]);
  1568. return self;},
  1569. args: [],
  1570. source: "testGrulCommitPathJsShouldBeServerGrulJs\x0a\x09self assert: 'server/grul/js' equals: grulPackage commitPathJs",
  1571. messageSends: ["assert:equals:", "commitPathJs"],
  1572. referencedClasses: []
  1573. }),
  1574. smalltalk.PackageWithDefaultCommitPathChangedTest);
  1575. smalltalk.addMethod(
  1576. "_testGrulCommitPathStShouldBeGrulSt",
  1577. smalltalk.method({
  1578. selector: "testGrulCommitPathStShouldBeGrulSt",
  1579. category: 'tests',
  1580. fn: function (){
  1581. var self=this;
  1582. smalltalk.send(self, "_assert_equals_", ["grul/st", smalltalk.send(self['@grulPackage'], "_commitPathSt", [])]);
  1583. return self;},
  1584. args: [],
  1585. source: "testGrulCommitPathStShouldBeGrulSt\x0a\x09self assert: 'grul/st' equals: grulPackage commitPathSt",
  1586. messageSends: ["assert:equals:", "commitPathSt"],
  1587. referencedClasses: []
  1588. }),
  1589. smalltalk.PackageWithDefaultCommitPathChangedTest);
  1590. smalltalk.addMethod(
  1591. "_testZorkCommitPathJsShouldBeJavascript",
  1592. smalltalk.method({
  1593. selector: "testZorkCommitPathJsShouldBeJavascript",
  1594. category: 'tests',
  1595. fn: function (){
  1596. var self=this;
  1597. smalltalk.send(self, "_assert_equals_", ["javascripts/", smalltalk.send(self['@zorkPackage'], "_commitPathJs", [])]);
  1598. return self;},
  1599. args: [],
  1600. source: "testZorkCommitPathJsShouldBeJavascript\x0a\x09self assert: 'javascripts/' equals: zorkPackage commitPathJs",
  1601. messageSends: ["assert:equals:", "commitPathJs"],
  1602. referencedClasses: []
  1603. }),
  1604. smalltalk.PackageWithDefaultCommitPathChangedTest);
  1605. smalltalk.addMethod(
  1606. "_testZorkCommitPathStShouldBeSmalltalk",
  1607. smalltalk.method({
  1608. selector: "testZorkCommitPathStShouldBeSmalltalk",
  1609. category: 'tests',
  1610. fn: function (){
  1611. var self=this;
  1612. smalltalk.send(self, "_assert_equals_", ["smalltalk/", smalltalk.send(self['@zorkPackage'], "_commitPathSt", [])]);
  1613. return self;},
  1614. args: [],
  1615. source: "testZorkCommitPathStShouldBeSmalltalk\x0a\x09self assert: 'smalltalk/' equals: zorkPackage commitPathSt",
  1616. messageSends: ["assert:equals:", "commitPathSt"],
  1617. referencedClasses: []
  1618. }),
  1619. smalltalk.PackageWithDefaultCommitPathChangedTest);
  1620. smalltalk.addMethod(
  1621. "_shouldInheritSelectors",
  1622. smalltalk.method({
  1623. selector: "shouldInheritSelectors",
  1624. category: 'accessing',
  1625. fn: function (){
  1626. var self=this;
  1627. return false;
  1628. return self;},
  1629. args: [],
  1630. source: "shouldInheritSelectors\x0a\x09^ false",
  1631. messageSends: [],
  1632. referencedClasses: []
  1633. }),
  1634. smalltalk.PackageWithDefaultCommitPathChangedTest.klass);
  1635. smalltalk.addClass('PointTest', smalltalk.TestCase, [], 'Kernel-Tests');
  1636. smalltalk.addMethod(
  1637. "_testAccessing",
  1638. smalltalk.method({
  1639. selector: "testAccessing",
  1640. category: 'tests',
  1641. fn: function (){
  1642. var self=this;
  1643. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send((smalltalk.Point || Point), "_x_y_", [(3), (4)]), "_x", []), (3)]);
  1644. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send((smalltalk.Point || Point), "_x_y_", [(3), (4)]), "_y", []), (4)]);
  1645. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Point || Point), "_new", []), "_x_", [(3)]), "_x", []), (3)]);
  1646. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Point || Point), "_new", []), "_y_", [(4)]), "_y", []), (4)]);
  1647. return self;},
  1648. args: [],
  1649. 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",
  1650. messageSends: ["assert:equals:", "x", "x:y:", "y", "x:", "new", "y:"],
  1651. referencedClasses: ["Point"]
  1652. }),
  1653. smalltalk.PointTest);
  1654. smalltalk.addMethod(
  1655. "_testArithmetic",
  1656. smalltalk.method({
  1657. selector: "testArithmetic",
  1658. category: 'tests',
  1659. fn: function (){
  1660. var self=this;
  1661. smalltalk.send(self, "_assert_equals_", [((($receiver = smalltalk.send((3), "__at", [(4)])).klass === smalltalk.Number) ? $receiver *smalltalk.send((3), "__at", [(4)]) : smalltalk.send($receiver, "__star", [smalltalk.send((3), "__at", [(4)])])), smalltalk.send((smalltalk.Point || Point), "_x_y_", [(9), (16)])]);
  1662. smalltalk.send(self, "_assert_equals_", [((($receiver = smalltalk.send((3), "__at", [(4)])).klass === smalltalk.Number) ? $receiver +smalltalk.send((3), "__at", [(4)]) : smalltalk.send($receiver, "__plus", [smalltalk.send((3), "__at", [(4)])])), smalltalk.send((smalltalk.Point || Point), "_x_y_", [(6), (8)])]);
  1663. smalltalk.send(self, "_assert_equals_", [((($receiver = smalltalk.send((3), "__at", [(4)])).klass === smalltalk.Number) ? $receiver -smalltalk.send((3), "__at", [(4)]) : smalltalk.send($receiver, "__minus", [smalltalk.send((3), "__at", [(4)])])), smalltalk.send((smalltalk.Point || Point), "_x_y_", [(0), (0)])]);
  1664. smalltalk.send(self, "_assert_equals_", [((($receiver = smalltalk.send((6), "__at", [(8)])).klass === smalltalk.Number) ? $receiver /smalltalk.send((3), "__at", [(4)]) : smalltalk.send($receiver, "__slash", [smalltalk.send((3), "__at", [(4)])])), smalltalk.send((smalltalk.Point || Point), "_x_y_", [(2), (2)])]);
  1665. return self;},
  1666. args: [],
  1667. 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)",
  1668. messageSends: ["assert:equals:", "*", "@", "x:y:", "+", "-", "/"],
  1669. referencedClasses: ["Point"]
  1670. }),
  1671. smalltalk.PointTest);
  1672. smalltalk.addMethod(
  1673. "_testAt",
  1674. smalltalk.method({
  1675. selector: "testAt",
  1676. category: 'tests',
  1677. fn: function (){
  1678. var self=this;
  1679. smalltalk.send(self, "_assert_equals_", [smalltalk.send((3), "__at", [(4)]), smalltalk.send((smalltalk.Point || Point), "_x_y_", [(3), (4)])]);
  1680. return self;},
  1681. args: [],
  1682. source: "testAt\x0a\x09self assert: 3@4 equals: (Point x: 3 y: 4)",
  1683. messageSends: ["assert:equals:", "@", "x:y:"],
  1684. referencedClasses: ["Point"]
  1685. }),
  1686. smalltalk.PointTest);
  1687. smalltalk.addMethod(
  1688. "_testEgality",
  1689. smalltalk.method({
  1690. selector: "testEgality",
  1691. category: 'tests',
  1692. fn: function (){
  1693. var self=this;
  1694. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3), "__at", [(4)]), "__eq", [smalltalk.send((3), "__at", [(4)])])]);
  1695. smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send((3), "__at", [(5)]), "__eq", [smalltalk.send((3), "__at", [(6)])])]);
  1696. return self;},
  1697. args: [],
  1698. source: "testEgality\x0a\x09self assert: 3@4 = (3@4).\x0a\x09self deny: 3@5 = (3@6)",
  1699. messageSends: ["assert:", "=", "@", "deny:"],
  1700. referencedClasses: []
  1701. }),
  1702. smalltalk.PointTest);
  1703. smalltalk.addMethod(
  1704. "_testTranslateBy",
  1705. smalltalk.method({
  1706. selector: "testTranslateBy",
  1707. category: 'tests',
  1708. fn: function (){
  1709. var self=this;
  1710. smalltalk.send(self, "_assert_equals_", [smalltalk.send((3), "__at", [(4)]), smalltalk.send(smalltalk.send((3), "__at", [(3)]), "_translateBy_", [smalltalk.send((0), "__at", [(1)])])]);
  1711. 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", [])])])]);
  1712. smalltalk.send(self, "_assert_equals_", [smalltalk.send((5), "__at", [(6)]), smalltalk.send(smalltalk.send((3), "__at", [(3)]), "_translateBy_", [smalltalk.send((2), "__at", [(3)])])]);
  1713. 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)])])]);
  1714. return self;},
  1715. args: [],
  1716. 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).",
  1717. messageSends: ["assert:equals:", "@", "translateBy:", "negated"],
  1718. referencedClasses: []
  1719. }),
  1720. smalltalk.PointTest);
  1721. smalltalk.addClass('RandomTest', smalltalk.TestCase, [], 'Kernel-Tests');
  1722. smalltalk.addMethod(
  1723. "_textNext",
  1724. smalltalk.method({
  1725. selector: "textNext",
  1726. category: 'tests',
  1727. fn: function (){
  1728. var self=this;
  1729. smalltalk.send((10000), "_timesRepeat_", [(function(){var current=nil;
  1730. var next=nil;
  1731. (next=smalltalk.send(smalltalk.send((smalltalk.Random || Random), "_new", []), "_next", []));smalltalk.send(self, "_assert_", [((($receiver = next).klass === smalltalk.Number) ? $receiver >=(0) : smalltalk.send($receiver, "__gt_eq", [(0)]))]);smalltalk.send(self, "_assert_", [((($receiver = next).klass === smalltalk.Number) ? $receiver <(1) : smalltalk.send($receiver, "__lt", [(1)]))]);smalltalk.send(self, "_deny_", [smalltalk.send(current, "__eq", [next])]);return smalltalk.send(next, "__eq", [current]);})]);
  1732. return self;},
  1733. args: [],
  1734. 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]",
  1735. messageSends: ["timesRepeat:", "next", "new", "assert:", ">=", "<", "deny:", "="],
  1736. referencedClasses: ["Random"]
  1737. }),
  1738. smalltalk.RandomTest);
  1739. smalltalk.addClass('SetTest', smalltalk.TestCase, [], 'Kernel-Tests');
  1740. smalltalk.addMethod(
  1741. "_testAddRemove",
  1742. smalltalk.method({
  1743. selector: "testAddRemove",
  1744. category: 'tests',
  1745. fn: function (){
  1746. var self=this;
  1747. var set=nil;
  1748. (set=smalltalk.send((smalltalk.Set || Set), "_new", []));
  1749. smalltalk.send(self, "_assert_", [smalltalk.send(set, "_isEmpty", [])]);
  1750. smalltalk.send(set, "_add_", [(3)]);
  1751. smalltalk.send(self, "_assert_", [smalltalk.send(set, "_includes_", [(3)])]);
  1752. smalltalk.send(set, "_add_", [(5)]);
  1753. smalltalk.send(self, "_assert_", [smalltalk.send(set, "_includes_", [(5)])]);
  1754. smalltalk.send(set, "_remove_", [(3)]);
  1755. smalltalk.send(self, "_deny_", [smalltalk.send(set, "_includes_", [(3)])]);
  1756. return self;},
  1757. args: [],
  1758. 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)",
  1759. messageSends: ["new", "assert:", "isEmpty", "add:", "includes:", "remove:", "deny:"],
  1760. referencedClasses: ["Set"]
  1761. }),
  1762. smalltalk.SetTest);
  1763. smalltalk.addMethod(
  1764. "_testAt",
  1765. smalltalk.method({
  1766. selector: "testAt",
  1767. category: 'tests',
  1768. fn: function (){
  1769. var self=this;
  1770. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send(smalltalk.send((smalltalk.Set || Set), "_new", []), "_at_put_", [(1), (2)]);}), (smalltalk.Error || Error)]);
  1771. return self;},
  1772. args: [],
  1773. source: "testAt\x0a\x09self should: [Set new at: 1 put: 2] raise: Error",
  1774. messageSends: ["should:raise:", "at:put:", "new"],
  1775. referencedClasses: ["Set", "Error"]
  1776. }),
  1777. smalltalk.SetTest);
  1778. smalltalk.addMethod(
  1779. "_testPrintString",
  1780. smalltalk.method({
  1781. selector: "testPrintString",
  1782. category: 'tests',
  1783. fn: function (){
  1784. var self=this;
  1785. var set=nil;
  1786. (set=smalltalk.send((smalltalk.Set || Set), "_new", []));
  1787. smalltalk.send(self, "_assert_equals_", ["a Set ()", smalltalk.send(set, "_printString", [])]);
  1788. (function($rec){smalltalk.send($rec, "_add_", [(1)]);return smalltalk.send($rec, "_add_", [(3)]);})(set);
  1789. smalltalk.send(self, "_assert_equals_", ["a Set (1 3)", smalltalk.send(set, "_printString", [])]);
  1790. smalltalk.send(set, "_add_", ["foo"]);
  1791. smalltalk.send(self, "_assert_equals_", ["a Set (1 3 'foo')", smalltalk.send(set, "_printString", [])]);
  1792. (function($rec){smalltalk.send($rec, "_remove_", [(1)]);return smalltalk.send($rec, "_remove_", [(3)]);})(set);
  1793. smalltalk.send(self, "_assert_equals_", ["a Set ('foo')", smalltalk.send(set, "_printString", [])]);
  1794. smalltalk.send(set, "_add_", [(3)]);
  1795. smalltalk.send(self, "_assert_equals_", ["a Set ('foo' 3)", smalltalk.send(set, "_printString", [])]);
  1796. smalltalk.send(set, "_add_", [(3)]);
  1797. smalltalk.send(self, "_assert_equals_", ["a Set ('foo' 3)", smalltalk.send(set, "_printString", [])]);
  1798. return self;},
  1799. args: [],
  1800. 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 ).",
  1801. messageSends: ["new", "assert:equals:", "printString", "add:", "remove:"],
  1802. referencedClasses: ["Set"]
  1803. }),
  1804. smalltalk.SetTest);
  1805. smalltalk.addMethod(
  1806. "_testSize",
  1807. smalltalk.method({
  1808. selector: "testSize",
  1809. category: 'tests',
  1810. fn: function (){
  1811. var self=this;
  1812. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send((smalltalk.Set || Set), "_new", []), "_size", []), (0)]);
  1813. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send((smalltalk.Set || Set), "_withAll_", [[(1), (2), (3), (4)]]), "_size", []), (4)]);
  1814. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send((smalltalk.Set || Set), "_withAll_", [[(1), (1), (1), (1)]]), "_size", []), (1)]);
  1815. return self;},
  1816. args: [],
  1817. 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",
  1818. messageSends: ["assert:equals:", "size", "new", "withAll:"],
  1819. referencedClasses: ["Set"]
  1820. }),
  1821. smalltalk.SetTest);
  1822. smalltalk.addMethod(
  1823. "_testUnicity",
  1824. smalltalk.method({
  1825. selector: "testUnicity",
  1826. category: 'tests',
  1827. fn: function (){
  1828. var self=this;
  1829. var set=nil;
  1830. (set=smalltalk.send((smalltalk.Set || Set), "_new", []));
  1831. smalltalk.send(set, "_add_", [(21)]);
  1832. smalltalk.send(set, "_add_", ["hello"]);
  1833. smalltalk.send(set, "_add_", [(21)]);
  1834. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(set, "_size", []), "__eq", [(2)])]);
  1835. smalltalk.send(set, "_add_", ["hello"]);
  1836. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(set, "_size", []), "__eq", [(2)])]);
  1837. smalltalk.send(self, "_assert_equals_", [smalltalk.send(set, "_asArray", []), [(21), "hello"]]);
  1838. return self;},
  1839. args: [],
  1840. 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')",
  1841. messageSends: ["new", "add:", "assert:", "=", "size", "assert:equals:", "asArray"],
  1842. referencedClasses: ["Set"]
  1843. }),
  1844. smalltalk.SetTest);
  1845. smalltalk.addClass('StringTest', smalltalk.TestCase, [], 'Kernel-Tests');
  1846. smalltalk.addMethod(
  1847. "_testAddRemove",
  1848. smalltalk.method({
  1849. selector: "testAddRemove",
  1850. category: 'tests',
  1851. fn: function (){
  1852. var self=this;
  1853. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send("hello", "_add_", ["a"]);}), (smalltalk.Error || Error)]);
  1854. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send("hello", "_remove_", ["h"]);}), (smalltalk.Error || Error)]);
  1855. return self;},
  1856. args: [],
  1857. source: "testAddRemove\x0a\x09self should: ['hello' add: 'a'] raise: Error.\x0a\x09self should: ['hello' remove: 'h'] raise: Error",
  1858. messageSends: ["should:raise:", "add:", "remove:"],
  1859. referencedClasses: ["Error"]
  1860. }),
  1861. smalltalk.StringTest);
  1862. smalltalk.addMethod(
  1863. "_testAsArray",
  1864. smalltalk.method({
  1865. selector: "testAsArray",
  1866. category: 'tests',
  1867. fn: function (){
  1868. var self=this;
  1869. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send("hello", "_asArray", []), "__eq", [["h", "e", "l", "l", "o"]])]);
  1870. return self;},
  1871. args: [],
  1872. source: "testAsArray\x0a\x09self assert: 'hello' asArray = #('h' 'e' 'l' 'l' 'o').",
  1873. messageSends: ["assert:", "=", "asArray"],
  1874. referencedClasses: []
  1875. }),
  1876. smalltalk.StringTest);
  1877. smalltalk.addMethod(
  1878. "_testAt",
  1879. smalltalk.method({
  1880. selector: "testAt",
  1881. category: 'tests',
  1882. fn: function (){
  1883. var self=this;
  1884. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send("hello", "_at_", [(1)]), "__eq", ["h"])]);
  1885. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send("hello", "_at_", [(5)]), "__eq", ["o"])]);
  1886. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send("hello", "_at_ifAbsent_", [(6), (function(){return nil;})]), "__eq", [nil])]);
  1887. return self;},
  1888. args: [],
  1889. 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",
  1890. messageSends: ["assert:", "=", "at:", "at:ifAbsent:"],
  1891. referencedClasses: []
  1892. }),
  1893. smalltalk.StringTest);
  1894. smalltalk.addMethod(
  1895. "_testAtPut",
  1896. smalltalk.method({
  1897. selector: "testAtPut",
  1898. category: 'tests',
  1899. fn: function (){
  1900. var self=this;
  1901. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send("hello", "_at_put_", [(1), "a"]);}), (smalltalk.Error || Error)]);
  1902. return self;},
  1903. args: [],
  1904. source: "testAtPut\x0a\x09\x22String instances are read-only\x22\x0a\x09self should: ['hello' at: 1 put: 'a'] raise: Error",
  1905. messageSends: ["should:raise:", "at:put:"],
  1906. referencedClasses: ["Error"]
  1907. }),
  1908. smalltalk.StringTest);
  1909. smalltalk.addMethod(
  1910. "_testCopyWithoutAll",
  1911. smalltalk.method({
  1912. selector: "testCopyWithoutAll",
  1913. category: 'tests',
  1914. fn: function (){
  1915. var self=this;
  1916. smalltalk.send(self, "_assert_equals_", ["hello world", smalltalk.send("*hello* *world*", "_copyWithoutAll_", ["*"])]);
  1917. return self;},
  1918. args: [],
  1919. source: "testCopyWithoutAll\x0a\x09self \x0a\x09\x09assert: 'hello world' \x0a\x09\x09equals: ('*hello* *world*' copyWithoutAll: '*')",
  1920. messageSends: ["assert:equals:", "copyWithoutAll:"],
  1921. referencedClasses: []
  1922. }),
  1923. smalltalk.StringTest);
  1924. smalltalk.addMethod(
  1925. "_testEquality",
  1926. smalltalk.method({
  1927. selector: "testEquality",
  1928. category: 'tests',
  1929. fn: function (){
  1930. var self=this;
  1931. smalltalk.send(self, "_assert_", [smalltalk.send("hello", "__eq", ["hello"])]);
  1932. smalltalk.send(self, "_deny_", [smalltalk.send("hello", "__eq", ["world"])]);
  1933. smalltalk.send(self, "_assert_", [smalltalk.send("hello", "__eq", [smalltalk.send("hello", "_yourself", [])])]);
  1934. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send("hello", "_yourself", []), "__eq", ["hello"])]);
  1935. smalltalk.send(self, "_deny_", [smalltalk.send("", "__eq", [(0)])]);
  1936. return self;},
  1937. args: [],
  1938. 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",
  1939. messageSends: ["assert:", "=", "deny:", "yourself"],
  1940. referencedClasses: []
  1941. }),
  1942. smalltalk.StringTest);
  1943. smalltalk.addMethod(
  1944. "_testIdentity",
  1945. smalltalk.method({
  1946. selector: "testIdentity",
  1947. category: 'tests',
  1948. fn: function (){
  1949. var self=this;
  1950. smalltalk.send(self, "_assert_", [smalltalk.send("hello", "__eq_eq", ["hello"])]);
  1951. smalltalk.send(self, "_deny_", [smalltalk.send("hello", "__eq_eq", ["world"])]);
  1952. smalltalk.send(self, "_assert_", [smalltalk.send("hello", "__eq_eq", [smalltalk.send("hello", "_yourself", [])])]);
  1953. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send("hello", "_yourself", []), "__eq_eq", ["hello"])]);
  1954. smalltalk.send(self, "_deny_", [smalltalk.send("", "__eq_eq", [(0)])]);
  1955. return self;},
  1956. args: [],
  1957. 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",
  1958. messageSends: ["assert:", "==", "deny:", "yourself"],
  1959. referencedClasses: []
  1960. }),
  1961. smalltalk.StringTest);
  1962. smalltalk.addMethod(
  1963. "_testIncludesSubString",
  1964. smalltalk.method({
  1965. selector: "testIncludesSubString",
  1966. category: 'tests',
  1967. fn: function (){
  1968. var self=this;
  1969. smalltalk.send(self, "_assert_", [smalltalk.send("amber", "_includesSubString_", ["ber"])]);
  1970. smalltalk.send(self, "_deny_", [smalltalk.send("amber", "_includesSubString_", ["zork"])]);
  1971. return self;},
  1972. args: [],
  1973. source: "testIncludesSubString\x0a\x09self assert: ('amber' includesSubString: 'ber').\x0a\x09self deny: ('amber' includesSubString: 'zork').",
  1974. messageSends: ["assert:", "includesSubString:", "deny:"],
  1975. referencedClasses: []
  1976. }),
  1977. smalltalk.StringTest);
  1978. smalltalk.addMethod(
  1979. "_testJoin",
  1980. smalltalk.method({
  1981. selector: "testJoin",
  1982. category: 'tests',
  1983. fn: function (){
  1984. var self=this;
  1985. smalltalk.send(self, "_assert_equals_", ["hello,world", smalltalk.send(",", "_join_", [["hello", "world"]])]);
  1986. return self;},
  1987. args: [],
  1988. source: "testJoin\x0a\x09self assert: 'hello,world' equals: (',' join: #('hello' 'world'))",
  1989. messageSends: ["assert:equals:", "join:"],
  1990. referencedClasses: []
  1991. }),
  1992. smalltalk.StringTest);
  1993. smalltalk.addMethod(
  1994. "_testPrintString",
  1995. smalltalk.method({
  1996. selector: "testPrintString",
  1997. category: 'tests',
  1998. fn: function (){
  1999. var self=this;
  2000. smalltalk.send(self, "_assert_equals_", ["'test_string'", smalltalk.send("test_string", "_printString", [])]);
  2001. return self;},
  2002. args: [],
  2003. source: "testPrintString\x0a\x0a\x09self assert: '''test_string''' equals: 'test_string' printString.",
  2004. messageSends: ["assert:equals:", "printString"],
  2005. referencedClasses: []
  2006. }),
  2007. smalltalk.StringTest);
  2008. smalltalk.addMethod(
  2009. "_testSize",
  2010. smalltalk.method({
  2011. selector: "testSize",
  2012. category: 'tests',
  2013. fn: function (){
  2014. var self=this;
  2015. smalltalk.send(self, "_assert_equals_", [smalltalk.send("smalltalk", "_size", []), (9)]);
  2016. smalltalk.send(self, "_assert_equals_", [smalltalk.send("", "_size", []), (0)]);
  2017. return self;},
  2018. args: [],
  2019. source: "testSize\x0a\x09self assert: 'smalltalk' size equals: 9.\x0a\x09self assert: '' size equals: 0",
  2020. messageSends: ["assert:equals:", "size"],
  2021. referencedClasses: []
  2022. }),
  2023. smalltalk.StringTest);
  2024. smalltalk.addMethod(
  2025. "_testStreamContents",
  2026. smalltalk.method({
  2027. selector: "testStreamContents",
  2028. category: 'tests',
  2029. fn: function (){
  2030. var self=this;
  2031. smalltalk.send(self, "_assert_equals_", ["hello world", smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(aStream){return (function($rec){smalltalk.send($rec, "_nextPutAll_", ["hello"]);smalltalk.send($rec, "_space", []);return smalltalk.send($rec, "_nextPutAll_", ["world"]);})(aStream);})])]);
  2032. return self;},
  2033. args: [],
  2034. source: "testStreamContents\x0a\x09self \x0a\x09\x09assert: 'hello world' \x0a\x09\x09equals: (String streamContents: [:aStream| aStream \x0a \x09\x09\x09\x09\x09nextPutAll: 'hello'; space; \x0a \x09\x09\x09\x09\x09nextPutAll: 'world'])",
  2035. messageSends: ["assert:equals:", "streamContents:", "nextPutAll:", "space"],
  2036. referencedClasses: ["String"]
  2037. }),
  2038. smalltalk.StringTest);
  2039. smalltalk.addClass('SymbolTest', smalltalk.TestCase, [], 'Kernel-Tests');
  2040. smalltalk.addMethod(
  2041. "_testAsString",
  2042. smalltalk.method({
  2043. selector: "testAsString",
  2044. category: 'tests',
  2045. fn: function (){
  2046. var self=this;
  2047. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.symbolFor("hello"), "_asString", []), "hello"]);
  2048. return self;},
  2049. args: [],
  2050. source: "testAsString\x0a\x09self assert: #hello asString equals: 'hello'",
  2051. messageSends: ["assert:equals:", "asString"],
  2052. referencedClasses: []
  2053. }),
  2054. smalltalk.SymbolTest);
  2055. smalltalk.addMethod(
  2056. "_testAsSymbol",
  2057. smalltalk.method({
  2058. selector: "testAsSymbol",
  2059. category: 'tests',
  2060. fn: function (){
  2061. var self=this;
  2062. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq_eq", [smalltalk.send(smalltalk.symbolFor("hello"), "_asSymbol", [])])]);
  2063. return self;},
  2064. args: [],
  2065. source: "testAsSymbol\x0a\x09self assert: #hello == #hello asSymbol",
  2066. messageSends: ["assert:", "==", "asSymbol"],
  2067. referencedClasses: []
  2068. }),
  2069. smalltalk.SymbolTest);
  2070. smalltalk.addMethod(
  2071. "_testAt",
  2072. smalltalk.method({
  2073. selector: "testAt",
  2074. category: 'tests',
  2075. fn: function (){
  2076. var self=this;
  2077. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_at_", [(1)]), "__eq", ["h"])]);
  2078. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_at_", [(5)]), "__eq", ["o"])]);
  2079. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_at_ifAbsent_", [(6), (function(){return nil;})]), "__eq", [nil])]);
  2080. return self;},
  2081. args: [],
  2082. 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",
  2083. messageSends: ["assert:", "=", "at:", "at:ifAbsent:"],
  2084. referencedClasses: []
  2085. }),
  2086. smalltalk.SymbolTest);
  2087. smalltalk.addMethod(
  2088. "_testAtPut",
  2089. smalltalk.method({
  2090. selector: "testAtPut",
  2091. category: 'tests',
  2092. fn: function (){
  2093. var self=this;
  2094. smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send("hello", "_at_put_", [(1), "a"]);}), (smalltalk.Error || Error)]);
  2095. return self;},
  2096. args: [],
  2097. source: "testAtPut\x0a\x09\x22Symbol instances are read-only\x22\x0a\x09self should: ['hello' at: 1 put: 'a'] raise: Error",
  2098. messageSends: ["should:raise:", "at:put:"],
  2099. referencedClasses: ["Error"]
  2100. }),
  2101. smalltalk.SymbolTest);
  2102. smalltalk.addMethod(
  2103. "_testComparing",
  2104. smalltalk.method({
  2105. selector: "testComparing",
  2106. category: 'tests',
  2107. fn: function (){
  2108. var self=this;
  2109. smalltalk.send(self, "_assert_", [((($receiver = smalltalk.symbolFor("ab")).klass === smalltalk.Number) ? $receiver >smalltalk.symbolFor("aa") : smalltalk.send($receiver, "__gt", [smalltalk.symbolFor("aa")]))]);
  2110. smalltalk.send(self, "_deny_", [((($receiver = smalltalk.symbolFor("ab")).klass === smalltalk.Number) ? $receiver >smalltalk.symbolFor("ba") : smalltalk.send($receiver, "__gt", [smalltalk.symbolFor("ba")]))]);
  2111. smalltalk.send(self, "_assert_", [((($receiver = smalltalk.symbolFor("ab")).klass === smalltalk.Number) ? $receiver <smalltalk.symbolFor("ba") : smalltalk.send($receiver, "__lt", [smalltalk.symbolFor("ba")]))]);
  2112. smalltalk.send(self, "_deny_", [((($receiver = smalltalk.symbolFor("bb")).klass === smalltalk.Number) ? $receiver <smalltalk.symbolFor("ba") : smalltalk.send($receiver, "__lt", [smalltalk.symbolFor("ba")]))]);
  2113. smalltalk.send(self, "_assert_", [((($receiver = smalltalk.symbolFor("ab")).klass === smalltalk.Number) ? $receiver >=smalltalk.symbolFor("aa") : smalltalk.send($receiver, "__gt_eq", [smalltalk.symbolFor("aa")]))]);
  2114. smalltalk.send(self, "_deny_", [((($receiver = smalltalk.symbolFor("ab")).klass === smalltalk.Number) ? $receiver >=smalltalk.symbolFor("ba") : smalltalk.send($receiver, "__gt_eq", [smalltalk.symbolFor("ba")]))]);
  2115. smalltalk.send(self, "_assert_", [((($receiver = smalltalk.symbolFor("ab")).klass === smalltalk.Number) ? $receiver <=smalltalk.symbolFor("ba") : smalltalk.send($receiver, "__lt_eq", [smalltalk.symbolFor("ba")]))]);
  2116. smalltalk.send(self, "_deny_", [((($receiver = smalltalk.symbolFor("bb")).klass === smalltalk.Number) ? $receiver <=smalltalk.symbolFor("ba") : smalltalk.send($receiver, "__lt_eq", [smalltalk.symbolFor("ba")]))]);
  2117. return self;},
  2118. args: [],
  2119. 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",
  2120. messageSends: ["assert:", ">", "deny:", "<", ">=", "<="],
  2121. referencedClasses: []
  2122. }),
  2123. smalltalk.SymbolTest);
  2124. smalltalk.addMethod(
  2125. "_testCopying",
  2126. smalltalk.method({
  2127. selector: "testCopying",
  2128. category: 'tests',
  2129. fn: function (){
  2130. var self=this;
  2131. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_copy", []), "__eq_eq", [smalltalk.symbolFor("hello")])]);
  2132. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_deepCopy", []), "__eq_eq", [smalltalk.symbolFor("hello")])]);
  2133. return self;},
  2134. args: [],
  2135. source: "testCopying\x0a\x09self assert: #hello copy == #hello.\x0a\x09self assert: #hello deepCopy == #hello",
  2136. messageSends: ["assert:", "==", "copy", "deepCopy"],
  2137. referencedClasses: []
  2138. }),
  2139. smalltalk.SymbolTest);
  2140. smalltalk.addMethod(
  2141. "_testEquality",
  2142. smalltalk.method({
  2143. selector: "testEquality",
  2144. category: 'tests',
  2145. fn: function (){
  2146. var self=this;
  2147. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq", [smalltalk.symbolFor("hello")])]);
  2148. smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq", [smalltalk.symbolFor("world")])]);
  2149. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq", [smalltalk.send(smalltalk.symbolFor("hello"), "_yourself", [])])]);
  2150. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_yourself", []), "__eq", [smalltalk.symbolFor("hello")])]);
  2151. smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq", ["hello"])]);
  2152. smalltalk.send(self, "_deny_", [smalltalk.send("hello", "__eq", [smalltalk.symbolFor("hello")])]);
  2153. return self;},
  2154. args: [],
  2155. 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.",
  2156. messageSends: ["assert:", "=", "deny:", "yourself"],
  2157. referencedClasses: []
  2158. }),
  2159. smalltalk.SymbolTest);
  2160. smalltalk.addMethod(
  2161. "_testIdentity",
  2162. smalltalk.method({
  2163. selector: "testIdentity",
  2164. category: 'tests',
  2165. fn: function (){
  2166. var self=this;
  2167. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq_eq", [smalltalk.symbolFor("hello")])]);
  2168. smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq_eq", [smalltalk.symbolFor("world")])]);
  2169. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq", [smalltalk.send(smalltalk.symbolFor("hello"), "_yourself", [])])]);
  2170. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_yourself", []), "__eq", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_asString", []), "_asSymbol", [])])]);
  2171. return self;},
  2172. args: [],
  2173. 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",
  2174. messageSends: ["assert:", "==", "deny:", "=", "yourself", "asSymbol", "asString"],
  2175. referencedClasses: []
  2176. }),
  2177. smalltalk.SymbolTest);
  2178. smalltalk.addMethod(
  2179. "_testIsSymbolIsString",
  2180. smalltalk.method({
  2181. selector: "testIsSymbolIsString",
  2182. category: 'tests',
  2183. fn: function (){
  2184. var self=this;
  2185. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.symbolFor("hello"), "_isSymbol", [])]);
  2186. smalltalk.send(self, "_deny_", [smalltalk.send("hello", "_isSymbol", [])]);
  2187. smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.symbolFor("hello"), "_isString", [])]);
  2188. smalltalk.send(self, "_assert_", [smalltalk.send("hello", "_isString", [])]);
  2189. return self;},
  2190. args: [],
  2191. source: "testIsSymbolIsString\x0a\x09self assert: #hello isSymbol.\x0a\x09self deny: 'hello' isSymbol.\x0a\x09self deny: #hello isString.\x0a\x09self assert: 'hello' isString",
  2192. messageSends: ["assert:", "isSymbol", "deny:", "isString"],
  2193. referencedClasses: []
  2194. }),
  2195. smalltalk.SymbolTest);
  2196. smalltalk.addMethod(
  2197. "_testPrintString",
  2198. smalltalk.method({
  2199. selector: "testPrintString",
  2200. category: 'tests',
  2201. fn: function (){
  2202. var self=this;
  2203. smalltalk.send(self, "_assert_equals_", ["#symbol", smalltalk.send(smalltalk.symbolFor("symbol"), "_printString", [])]);
  2204. return self;},
  2205. args: [],
  2206. source: "testPrintString\x0a\x0a\x09self assert: '#symbol' equals: #symbol printString.",
  2207. messageSends: ["assert:equals:", "printString"],
  2208. referencedClasses: []
  2209. }),
  2210. smalltalk.SymbolTest);
  2211. smalltalk.addMethod(
  2212. "_testSize",
  2213. smalltalk.method({
  2214. selector: "testSize",
  2215. category: 'tests',
  2216. fn: function (){
  2217. var self=this;
  2218. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.symbolFor("a"), "_size", []), (1)]);
  2219. smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.symbolFor("aaaaa"), "_size", []), (5)]);
  2220. return self;},
  2221. args: [],
  2222. source: "testSize\x0a\x09self assert: #a size equals: 1.\x0a\x09self assert: #aaaaa size equals: 5",
  2223. messageSends: ["assert:equals:", "size"],
  2224. referencedClasses: []
  2225. }),
  2226. smalltalk.SymbolTest);
  2227. smalltalk.addClass('UndefinedTest', smalltalk.TestCase, [], 'Kernel-Tests');
  2228. smalltalk.addMethod(
  2229. "_testCopying",
  2230. smalltalk.method({
  2231. selector: "testCopying",
  2232. category: 'tests',
  2233. fn: function (){
  2234. var self=this;
  2235. smalltalk.send(self, "_assert_equals_", [smalltalk.send(nil, "_copy", []), nil]);
  2236. return self;},
  2237. args: [],
  2238. source: "testCopying\x0a\x09self assert: nil copy equals: nil",
  2239. messageSends: ["assert:equals:", "copy"],
  2240. referencedClasses: []
  2241. }),
  2242. smalltalk.UndefinedTest);
  2243. smalltalk.addMethod(
  2244. "_testDeepCopy",
  2245. smalltalk.method({
  2246. selector: "testDeepCopy",
  2247. category: 'tests',
  2248. fn: function (){
  2249. var self=this;
  2250. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(nil, "_deepCopy", []), "__eq", [nil])]);
  2251. return self;},
  2252. args: [],
  2253. source: "testDeepCopy\x0a\x09self assert: nil deepCopy = nil",
  2254. messageSends: ["assert:", "=", "deepCopy"],
  2255. referencedClasses: []
  2256. }),
  2257. smalltalk.UndefinedTest);
  2258. smalltalk.addMethod(
  2259. "_testIfNil",
  2260. smalltalk.method({
  2261. selector: "testIfNil",
  2262. category: 'tests',
  2263. fn: function (){
  2264. var self=this;
  2265. smalltalk.send(self, "_assert_equals_", [(($receiver = nil) == nil || $receiver == undefined) ? (function(){return true;})() : $receiver, true]);
  2266. smalltalk.send(self, "_deny_", [smalltalk.send((($receiver = nil) != nil && $receiver != undefined) ? (function(){return true;})() : nil, "__eq", [true])]);
  2267. smalltalk.send(self, "_assert_equals_", [(($receiver = nil) == nil || $receiver == undefined) ? (function(){return true;})() : (function(){return false;})(), true]);
  2268. smalltalk.send(self, "_deny_", [smalltalk.send((($receiver = nil) == nil || $receiver == undefined) ? (function(){return false;})() : (function(){return true;})(), "__eq", [true])]);
  2269. return self;},
  2270. args: [],
  2271. 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",
  2272. messageSends: ["assert:equals:", "ifNil:", "deny:", "=", "ifNotNil:", "ifNil:ifNotNil:", "ifNotNil:ifNil:"],
  2273. referencedClasses: []
  2274. }),
  2275. smalltalk.UndefinedTest);
  2276. smalltalk.addMethod(
  2277. "_testIsNil",
  2278. smalltalk.method({
  2279. selector: "testIsNil",
  2280. category: 'tests',
  2281. fn: function (){
  2282. var self=this;
  2283. smalltalk.send(self, "_assert_", [smalltalk.send(nil, "_isNil", [])]);
  2284. smalltalk.send(self, "_deny_", [smalltalk.send(nil, "_notNil", [])]);
  2285. return self;},
  2286. args: [],
  2287. source: "testIsNil\x0a\x09self assert: nil isNil.\x0a\x09self deny: nil notNil.",
  2288. messageSends: ["assert:", "isNil", "deny:", "notNil"],
  2289. referencedClasses: []
  2290. }),
  2291. smalltalk.UndefinedTest);