Kernel-Tests.deploy.js 88 KB

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