Kernel-Tests.deploy.js 86 KB

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