Kernel-Tests.deploy.js 89 KB

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