1
0

Kernel-Tests.deploy.js 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501
  1. smalltalk.addPackage('Kernel-Tests', {});
  2. smalltalk.addClass('StringTest', smalltalk.TestCase, [], 'Kernel-Tests');
  3. smalltalk.addMethod(
  4. '_testJoin',
  5. smalltalk.method({
  6. selector: 'testJoin',
  7. fn: function (){
  8. var self=this;
  9. smalltalk.send(self, "_assert_equals_", [unescape("hello%2Cworld"), smalltalk.send(unescape("%2C"), "_join_", [["hello", "world"]])]);
  10. return self;}
  11. }),
  12. smalltalk.StringTest);
  13. smalltalk.addMethod(
  14. '_testStreamContents',
  15. smalltalk.method({
  16. selector: 'testStreamContents',
  17. fn: function (){
  18. var self=this;
  19. smalltalk.send(self, "_assert_equals_", ["hello world", smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(aStream){return (function($rec){smalltalk.send($rec, "_nextPutAll_", ["hello"]);smalltalk.send($rec, "_space", []);return smalltalk.send($rec, "_nextPutAll_", ["world"]);})(aStream);})])]);
  20. return self;}
  21. }),
  22. smalltalk.StringTest);
  23. smalltalk.addMethod(
  24. '_testIncludesSubString',
  25. smalltalk.method({
  26. selector: 'testIncludesSubString',
  27. fn: function (){
  28. var self=this;
  29. smalltalk.send(self, "_assert_", [smalltalk.send("amber", "_includesSubString_", ["ber"])]);
  30. smalltalk.send(self, "_deny_", [smalltalk.send("amber", "_includesSubString_", ["zork"])]);
  31. return self;}
  32. }),
  33. smalltalk.StringTest);
  34. smalltalk.addMethod(
  35. '_testEquality',
  36. smalltalk.method({
  37. selector: 'testEquality',
  38. fn: function (){
  39. var self=this;
  40. smalltalk.send(self, "_assert_", [smalltalk.send("hello", "__eq", ["hello"])]);
  41. smalltalk.send(self, "_deny_", [smalltalk.send("hello", "__eq", ["world"])]);
  42. smalltalk.send(self, "_assert_", [smalltalk.send("hello", "__eq", [smalltalk.send("hello", "_yourself", [])])]);
  43. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send("hello", "_yourself", []), "__eq", ["hello"])]);
  44. smalltalk.send(self, "_deny_", [smalltalk.send("", "__eq", [(0)])]);
  45. return self;}
  46. }),
  47. smalltalk.StringTest);
  48. smalltalk.addMethod(
  49. '_testCopyWithoutAll',
  50. smalltalk.method({
  51. selector: 'testCopyWithoutAll',
  52. fn: function (){
  53. var self=this;
  54. smalltalk.send(self, "_assert_equals_", ["hello world", smalltalk.send(unescape("*hello*%20*world*"), "_copyWithoutAll_", [unescape("*")])]);
  55. return self;}
  56. }),
  57. smalltalk.StringTest);
  58. smalltalk.addClass('DictionaryTest', smalltalk.TestCase, [], 'Kernel-Tests');
  59. smalltalk.addMethod(
  60. '_testPrintString',
  61. smalltalk.method({
  62. selector: 'testPrintString',
  63. fn: function (){
  64. var self=this;
  65. smalltalk.send(self, "_assert_equals_", [unescape("a%20Dictionary%28%27firstname%27%20-%3E%20%27James%27%20%2C%20%27lastname%27%20-%3E%20%27Bond%27%29"), (function($rec){smalltalk.send($rec, "_at_put_", ["firstname", "James"]);smalltalk.send($rec, "_at_put_", ["lastname", "Bond"]);return smalltalk.send($rec, "_printString", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []))]);
  66. return self;}
  67. }),
  68. smalltalk.DictionaryTest);
  69. smalltalk.addMethod(
  70. '_testEquality',
  71. smalltalk.method({
  72. selector: 'testEquality',
  73. fn: function (){
  74. var self=this;
  75. var d1=nil;
  76. var d2=nil;
  77. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []), "__eq", [smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", [])])]);
  78. d1=(function($rec){smalltalk.send($rec, "_at_put_", [(1), (2)]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
  79. d2=(function($rec){smalltalk.send($rec, "_at_put_", [(1), (2)]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
  80. smalltalk.send(self, "_assert_", [smalltalk.send(d1, "__eq", [d2])]);
  81. d2=(function($rec){smalltalk.send($rec, "_at_put_", [(1), (3)]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
  82. smalltalk.send(self, "_deny_", [smalltalk.send(d1, "__eq", [d2])]);
  83. d2=(function($rec){smalltalk.send($rec, "_at_put_", [(2), (2)]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
  84. smalltalk.send(self, "_deny_", [smalltalk.send(d1, "__eq", [d2])]);
  85. d2=(function($rec){smalltalk.send($rec, "_at_put_", [(1), (2)]);smalltalk.send($rec, "_at_put_", [(3), (4)]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
  86. smalltalk.send(self, "_deny_", [smalltalk.send(d1, "__eq", [d2])]);
  87. return self;}
  88. }),
  89. smalltalk.DictionaryTest);
  90. smalltalk.addMethod(
  91. '_testDynamicDictionaries',
  92. smalltalk.method({
  93. selector: 'testDynamicDictionaries',
  94. fn: function (){
  95. var self=this;
  96. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.Dictionary._fromPairs_([smalltalk.send((1), "__minus_gt", ["hello"]),smalltalk.send((2), "__minus_gt", ["world"])]), "__eq", [smalltalk.send((smalltalk.Dictionary || Dictionary), "_with_with_", [smalltalk.send((1), "__minus_gt", ["hello"]), smalltalk.send((2), "__minus_gt", ["world"])])])]);
  97. return self;}
  98. }),
  99. smalltalk.DictionaryTest);
  100. smalltalk.addClass('BooleanTest', smalltalk.TestCase, [], 'Kernel-Tests');
  101. smalltalk.addMethod(
  102. '_testLogic',
  103. smalltalk.method({
  104. selector: 'testLogic',
  105. fn: function (){
  106. var self=this;
  107. (function($rec){smalltalk.send($rec, "_assert_", [smalltalk.send(true, "_&", [true])]);smalltalk.send($rec, "_deny_", [smalltalk.send(true, "_&", [false])]);smalltalk.send($rec, "_deny_", [smalltalk.send(false, "_&", [true])]);return smalltalk.send($rec, "_deny_", [smalltalk.send(false, "_&", [false])]);})(self);
  108. (function($rec){smalltalk.send($rec, "_assert_", [smalltalk.send(true, "_|", [true])]);smalltalk.send($rec, "_assert_", [smalltalk.send(true, "_|", [false])]);smalltalk.send($rec, "_assert_", [smalltalk.send(false, "_|", [true])]);return smalltalk.send($rec, "_deny_", [smalltalk.send(false, "_|", [false])]);})(self);
  109. (function($rec){smalltalk.send($rec, "_assert_", [smalltalk.send(true, "_&", [(1) > (0)])]);smalltalk.send($rec, "_deny_", [smalltalk.send((1) > (0), "_&", [false])]);return smalltalk.send($rec, "_deny_", [smalltalk.send((1) > (0), "_&", [(1) > (2)])]);})(self);
  110. (function($rec){smalltalk.send($rec, "_assert_", [smalltalk.send(false, "_|", [(1) > (0)])]);smalltalk.send($rec, "_assert_", [smalltalk.send((1) > (0), "_|", [false])]);return smalltalk.send($rec, "_assert_", [smalltalk.send((1) > (0), "_|", [(1) > (2)])]);})(self);
  111. return self;}
  112. }),
  113. smalltalk.BooleanTest);
  114. smalltalk.addMethod(
  115. '_testEquality',
  116. smalltalk.method({
  117. selector: 'testEquality',
  118. fn: function (){
  119. var self=this;
  120. smalltalk.send(self, "_deny_", [smalltalk.send((0), "__eq", [false])]);
  121. smalltalk.send(self, "_deny_", [smalltalk.send(false, "__eq", [(0)])]);
  122. smalltalk.send(self, "_deny_", [smalltalk.send("", "__eq", [false])]);
  123. smalltalk.send(self, "_deny_", [smalltalk.send(false, "__eq", [""])]);
  124. smalltalk.send(self, "_assert_", [smalltalk.send(true, "__eq", [true])]);
  125. smalltalk.send(self, "_deny_", [smalltalk.send(false, "__eq", [true])]);
  126. smalltalk.send(self, "_deny_", [smalltalk.send(true, "__eq", [false])]);
  127. smalltalk.send(self, "_assert_", [smalltalk.send(false, "__eq", [false])]);
  128. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(true, "_yourself", []), "__eq", [true])]);
  129. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(true, "_yourself", []), "__eq", [smalltalk.send(true, "_yourself", [])])]);
  130. return self;}
  131. }),
  132. smalltalk.BooleanTest);
  133. smalltalk.addMethod(
  134. '_testLogicKeywords',
  135. smalltalk.method({
  136. selector: 'testLogicKeywords',
  137. fn: function (){
  138. var self=this;
  139. (function($rec){smalltalk.send($rec, "_assert_", [smalltalk.send(true, "_and_", [(function(){return true;})])]);smalltalk.send($rec, "_deny_", [smalltalk.send(true, "_and_", [(function(){return false;})])]);smalltalk.send($rec, "_deny_", [smalltalk.send(false, "_and_", [(function(){return true;})])]);return smalltalk.send($rec, "_deny_", [smalltalk.send(false, "_and_", [(function(){return false;})])]);})(self);
  140. (function($rec){smalltalk.send($rec, "_assert_", [smalltalk.send(true, "_or_", [(function(){return true;})])]);smalltalk.send($rec, "_assert_", [smalltalk.send(true, "_or_", [(function(){return false;})])]);smalltalk.send($rec, "_assert_", [smalltalk.send(false, "_or_", [(function(){return true;})])]);return smalltalk.send($rec, "_deny_", [smalltalk.send(false, "_or_", [(function(){return false;})])]);})(self);
  141. (function($rec){smalltalk.send($rec, "_assert_", [smalltalk.send(true, "_and_", [(function(){return (1) > (0);})])]);smalltalk.send($rec, "_deny_", [smalltalk.send((1) > (0), "_and_", [(function(){return false;})])]);return smalltalk.send($rec, "_deny_", [smalltalk.send((1) > (0), "_and_", [(function(){return (1) > (2);})])]);})(self);
  142. (function($rec){smalltalk.send($rec, "_assert_", [smalltalk.send(false, "_or_", [(function(){return (1) > (0);})])]);smalltalk.send($rec, "_assert_", [smalltalk.send((1) > (0), "_or_", [(function(){return false;})])]);return smalltalk.send($rec, "_assert_", [smalltalk.send((1) > (0), "_or_", [(function(){return (1) > (2);})])]);})(self);
  143. return self;}
  144. }),
  145. smalltalk.BooleanTest);
  146. smalltalk.addMethod(
  147. '_testIfTrueIfFalse',
  148. smalltalk.method({
  149. selector: 'testIfTrueIfFalse',
  150. fn: function (){
  151. var self=this;
  152. smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = true).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "alternative block";})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return "alternative block";})])), "__eq", ["alternative block"])]);
  153. smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = true).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return "alternative block";})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return "alternative block";})])), "__eq", [nil])]);
  154. smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = false).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "alternative block";})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return "alternative block";})])), "__eq", [nil])]);
  155. smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = false).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return "alternative block";})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return "alternative block";})])), "__eq", ["alternative block"])]);
  156. smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = false).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "alternative block";})() : (function(){return "alternative block2";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "alternative block";}), (function(){return "alternative block2";})])), "__eq", ["alternative block2"])]);
  157. smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = false).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return "alternative block";})() : (function(){return "alternative block2";})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){return "alternative block";}), (function(){return "alternative block2";})])), "__eq", ["alternative block"])]);
  158. smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = true).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "alternative block";})() : (function(){return "alternative block2";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "alternative block";}), (function(){return "alternative block2";})])), "__eq", ["alternative block"])]);
  159. smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = true).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return "alternative block";})() : (function(){return "alternative block2";})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){return "alternative block";}), (function(){return "alternative block2";})])), "__eq", ["alternative block2"])]);
  160. return self;}
  161. }),
  162. smalltalk.BooleanTest);
  163. smalltalk.addClass('NumberTest', smalltalk.TestCase, [], 'Kernel-Tests');
  164. smalltalk.addMethod(
  165. '_testPrintShowingDecimalPlaces',
  166. smalltalk.method({
  167. selector: 'testPrintShowingDecimalPlaces',
  168. fn: function (){
  169. var self=this;
  170. smalltalk.send(self, "_assert_equals_", ["23.00", smalltalk.send((23), "_printShowingDecimalPlaces_", [(2)])]);
  171. smalltalk.send(self, "_assert_equals_", ["23.57", smalltalk.send((23.5698), "_printShowingDecimalPlaces_", [(2)])]);
  172. smalltalk.send(self, "_assert_equals_", [unescape("-234.56700"), smalltalk.send(smalltalk.send((234.567), "_negated", []), "_printShowingDecimalPlaces_", [(5)])]);
  173. smalltalk.send(self, "_assert_equals_", ["23", smalltalk.send((23.4567), "_printShowingDecimalPlaces_", [(0)])]);
  174. smalltalk.send(self, "_assert_equals_", ["24", smalltalk.send((23.5567), "_printShowingDecimalPlaces_", [(0)])]);
  175. smalltalk.send(self, "_assert_equals_", [unescape("-23"), smalltalk.send(smalltalk.send((23.4567), "_negated", []), "_printShowingDecimalPlaces_", [(0)])]);
  176. smalltalk.send(self, "_assert_equals_", [unescape("-24"), smalltalk.send(smalltalk.send((23.5567), "_negated", []), "_printShowingDecimalPlaces_", [(0)])]);
  177. smalltalk.send(self, "_assert_equals_", ["100000000.0", smalltalk.send((100000000), "_printShowingDecimalPlaces_", [(1)])]);
  178. smalltalk.send(self, "_assert_equals_", ["0.98000", smalltalk.send((0.98), "_printShowingDecimalPlaces_", [(5)])]);
  179. smalltalk.send(self, "_assert_equals_", [unescape("-0.98"), smalltalk.send(smalltalk.send((0.98), "_negated", []), "_printShowingDecimalPlaces_", [(2)])]);
  180. smalltalk.send(self, "_assert_equals_", ["2.57", smalltalk.send((2.567), "_printShowingDecimalPlaces_", [(2)])]);
  181. smalltalk.send(self, "_assert_equals_", [unescape("-2.57"), smalltalk.send((-2.567), "_printShowingDecimalPlaces_", [(2)])]);
  182. smalltalk.send(self, "_assert_equals_", ["0.00", smalltalk.send((0), "_printShowingDecimalPlaces_", [(2)])]);
  183. return self;}
  184. }),
  185. smalltalk.NumberTest);
  186. smalltalk.addMethod(
  187. '_testEquality',
  188. smalltalk.method({
  189. selector: 'testEquality',
  190. fn: function (){
  191. var self=this;
  192. smalltalk.send(self, "_assert_", [smalltalk.send((1), "__eq", [(1)])]);
  193. smalltalk.send(self, "_assert_", [smalltalk.send((0), "__eq", [(0)])]);
  194. smalltalk.send(self, "_deny_", [smalltalk.send((1), "__eq", [(0)])]);
  195. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((1), "_yourself", []), "__eq", [(1)])]);
  196. smalltalk.send(self, "_assert_", [smalltalk.send((1), "__eq", [smalltalk.send((1), "_yourself", [])])]);
  197. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((1), "_yourself", []), "__eq", [smalltalk.send((1), "_yourself", [])])]);
  198. smalltalk.send(self, "_deny_", [smalltalk.send((0), "__eq", [false])]);
  199. smalltalk.send(self, "_deny_", [smalltalk.send(false, "__eq", [(0)])]);
  200. smalltalk.send(self, "_deny_", [smalltalk.send("", "__eq", [(0)])]);
  201. smalltalk.send(self, "_deny_", [smalltalk.send((0), "__eq", [""])]);
  202. return self;}
  203. }),
  204. smalltalk.NumberTest);
  205. smalltalk.addMethod(
  206. '_testArithmetic',
  207. smalltalk.method({
  208. selector: 'testArithmetic',
  209. fn: function (){
  210. var self=this;
  211. smalltalk.send(self, "_assert_", [smalltalk.send((1.5) + (1), "__eq", [(2.5)])]);
  212. smalltalk.send(self, "_assert_", [smalltalk.send((2) - (1), "__eq", [(1)])]);
  213. smalltalk.send(self, "_assert_", [smalltalk.send((-2) - (1), "__eq", [(-3)])]);
  214. smalltalk.send(self, "_assert_", [smalltalk.send((12) / (2), "__eq", [(6)])]);
  215. smalltalk.send(self, "_assert_", [smalltalk.send((3) * (4), "__eq", [(12)])]);
  216. smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = (1) + (2)).klass === smalltalk.Number) ? $receiver *(3) : smalltalk.send($receiver, "__star", [(3)])), "__eq", [(9)])]);
  217. smalltalk.send(self, "_assert_", [smalltalk.send((1) + (2) * (3), "__eq", [(7)])]);
  218. return self;}
  219. }),
  220. smalltalk.NumberTest);
  221. smalltalk.addMethod(
  222. '_testRounded',
  223. smalltalk.method({
  224. selector: 'testRounded',
  225. fn: function (){
  226. var self=this;
  227. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3), "_rounded", []), "__eq", [(3)])]);
  228. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3.212), "_rounded", []), "__eq", [(3)])]);
  229. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3.51), "_rounded", []), "__eq", [(4)])]);
  230. return self;}
  231. }),
  232. smalltalk.NumberTest);
  233. smalltalk.addMethod(
  234. '_testNegated',
  235. smalltalk.method({
  236. selector: 'testNegated',
  237. fn: function (){
  238. var self=this;
  239. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3), "_negated", []), "__eq", [(-3)])]);
  240. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((-3), "_negated", []), "__eq", [(3)])]);
  241. return self;}
  242. }),
  243. smalltalk.NumberTest);
  244. smalltalk.addMethod(
  245. '_testComparison',
  246. smalltalk.method({
  247. selector: 'testComparison',
  248. fn: function (){
  249. var self=this;
  250. smalltalk.send(self, "_assert_", [(3) > (2)]);
  251. smalltalk.send(self, "_assert_", [(2) < (3)]);
  252. smalltalk.send(self, "_deny_", [(3) < (2)]);
  253. smalltalk.send(self, "_deny_", [(2) > (3)]);
  254. smalltalk.send(self, "_assert_", [(3) >= (3)]);
  255. smalltalk.send(self, "_assert_", [(3.1) >= (3)]);
  256. smalltalk.send(self, "_assert_", [(3) <= (3)]);
  257. smalltalk.send(self, "_assert_", [(3) <= (3.1)]);
  258. return self;}
  259. }),
  260. smalltalk.NumberTest);
  261. smalltalk.addMethod(
  262. '_testTruncated',
  263. smalltalk.method({
  264. selector: 'testTruncated',
  265. fn: function (){
  266. var self=this;
  267. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3), "_truncated", []), "__eq", [(3)])]);
  268. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3.212), "_truncated", []), "__eq", [(3)])]);
  269. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3.51), "_truncated", []), "__eq", [(3)])]);
  270. return self;}
  271. }),
  272. smalltalk.NumberTest);
  273. smalltalk.addMethod(
  274. '_testCopying',
  275. smalltalk.method({
  276. selector: 'testCopying',
  277. fn: function (){
  278. var self=this;
  279. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((1), "_copy", []), "__eq", [(1)])]);
  280. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((1), "_deepCopy", []), "__eq", [(1)])]);
  281. return self;}
  282. }),
  283. smalltalk.NumberTest);
  284. smalltalk.addClass('JSObjectProxyTest', smalltalk.TestCase, [], 'Kernel-Tests');
  285. smalltalk.addMethod(
  286. '_testMethodWithArguments',
  287. smalltalk.method({
  288. selector: 'testMethodWithArguments',
  289. fn: function (){
  290. var self=this;
  291. smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_hasClass_", ["amber"])]);
  292. smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_addClass_", ["amber"]);
  293. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_hasClass_", ["amber"])]);
  294. smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_removeClass_", ["amber"]);
  295. smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_hasClass_", ["amber"])]);
  296. return self;}
  297. }),
  298. smalltalk.JSObjectProxyTest);
  299. smalltalk.addMethod(
  300. '_testYourself',
  301. smalltalk.method({
  302. selector: 'testYourself',
  303. fn: function (){
  304. var self=this;
  305. var body=nil;
  306. body=(function($rec){smalltalk.send($rec, "_addClass_", ["amber"]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send("body", "_asJQuery", []));
  307. smalltalk.send(self, "_assert_", [smalltalk.send(body, "_hasClass_", ["amber"])]);
  308. smalltalk.send(body, "_removeClass_", ["amber"]);
  309. smalltalk.send(self, "_deny_", [smalltalk.send(body, "_hasClass_", ["amber"])]);
  310. return self;}
  311. }),
  312. smalltalk.JSObjectProxyTest);
  313. smalltalk.addMethod(
  314. '_testPropertyThatReturnsEmptyString',
  315. smalltalk.method({
  316. selector: 'testPropertyThatReturnsEmptyString',
  317. fn: function (){
  318. var self=this;
  319. document.location.hash = '';
  320. smalltalk.send(self, "_assert_equals_", ["", smalltalk.send(smalltalk.send((typeof document == 'undefined' ? nil : document), "_location", []), "_hash", [])]);
  321. smalltalk.send(smalltalk.send((typeof document == 'undefined' ? nil : document), "_location", []), "_hash_", ["test"]);
  322. smalltalk.send(self, "_assert_equals_", [unescape("%23test"), smalltalk.send(smalltalk.send((typeof document == 'undefined' ? nil : document), "_location", []), "_hash", [])]);
  323. return self;}
  324. }),
  325. smalltalk.JSObjectProxyTest);
  326. smalltalk.addClass('PackageTest', smalltalk.TestCase, ['zorkPackage', 'grulPackage', 'backUpCommitPathJs', 'backUpCommitPathSt'], 'Kernel-Tests');
  327. smalltalk.addMethod(
  328. '_setUp',
  329. smalltalk.method({
  330. selector: 'setUp',
  331. fn: function (){
  332. var self=this;
  333. self['@backUpCommitPathJs']=smalltalk.send((smalltalk.Package || Package), "_defaultCommitPathJs", []);
  334. self['@backUpCommitPathSt']=smalltalk.send((smalltalk.Package || Package), "_defaultCommitPathSt", []);
  335. smalltalk.send((smalltalk.Package || Package), "_resetCommitPaths", []);
  336. self['@zorkPackage']=smalltalk.send(smalltalk.send((smalltalk.Package || Package), "_new", []), "_name_", ["Zork"]);
  337. self['@grulPackage']=(function($rec){smalltalk.send($rec, "_name_", ["Grul"]);smalltalk.send($rec, "_commitPathJs_", [unescape("server/grul/js")]);smalltalk.send($rec, "_commitPathSt_", [unescape("grul/st")]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Package || Package), "_new", []));
  338. return self;}
  339. }),
  340. smalltalk.PackageTest);
  341. smalltalk.addMethod(
  342. '_testGrulCommitPathStShouldBeGrulSt',
  343. smalltalk.method({
  344. selector: 'testGrulCommitPathStShouldBeGrulSt',
  345. fn: function (){
  346. var self=this;
  347. smalltalk.send(self, "_assert_equals_", [unescape("grul/st"), smalltalk.send(self['@grulPackage'], "_commitPathSt", [])]);
  348. return self;}
  349. }),
  350. smalltalk.PackageTest);
  351. smalltalk.addMethod(
  352. '_testZorkCommitPathStShouldBeSt',
  353. smalltalk.method({
  354. selector: 'testZorkCommitPathStShouldBeSt',
  355. fn: function (){
  356. var self=this;
  357. smalltalk.send(self, "_assert_equals_", ["st", smalltalk.send(self['@zorkPackage'], "_commitPathSt", [])]);
  358. return self;}
  359. }),
  360. smalltalk.PackageTest);
  361. smalltalk.addMethod(
  362. '_testZorkCommitPathJsShouldBeJs',
  363. smalltalk.method({
  364. selector: 'testZorkCommitPathJsShouldBeJs',
  365. fn: function (){
  366. var self=this;
  367. smalltalk.send(self, "_assert_equals_", ["js", smalltalk.send(self['@zorkPackage'], "_commitPathJs", [])]);
  368. return self;}
  369. }),
  370. smalltalk.PackageTest);
  371. smalltalk.addMethod(
  372. '_testGrulCommitPathJsShouldBeServerGrulJs',
  373. smalltalk.method({
  374. selector: 'testGrulCommitPathJsShouldBeServerGrulJs',
  375. fn: function (){
  376. var self=this;
  377. smalltalk.send(self, "_assert_equals_", [unescape("server/grul/js"), smalltalk.send(self['@grulPackage'], "_commitPathJs", [])]);
  378. return self;}
  379. }),
  380. smalltalk.PackageTest);
  381. smalltalk.addMethod(
  382. '_tearDown',
  383. smalltalk.method({
  384. selector: 'tearDown',
  385. fn: function (){
  386. var self=this;
  387. (function($rec){smalltalk.send($rec, "_defaultCommitPathJs_", [self['@backUpCommitPathJs']]);return smalltalk.send($rec, "_defaultCommitPathSt_", [self['@backUpCommitPathSt']]);})((smalltalk.Package || Package));
  388. return self;}
  389. }),
  390. smalltalk.PackageTest);
  391. smalltalk.addClass('PackageWithDefaultCommitPathChangedTest', smalltalk.PackageTest, [], 'Kernel-Tests');
  392. smalltalk.addMethod(
  393. '_setUp',
  394. smalltalk.method({
  395. selector: 'setUp',
  396. fn: function (){
  397. var self=this;
  398. smalltalk.send(self, "_setUp", [], smalltalk.PackageTest);
  399. (function($rec){smalltalk.send($rec, "_defaultCommitPathJs_", [unescape("javascripts/")]);return smalltalk.send($rec, "_defaultCommitPathSt_", [unescape("smalltalk/")]);})((smalltalk.Package || Package));
  400. return self;}
  401. }),
  402. smalltalk.PackageWithDefaultCommitPathChangedTest);
  403. smalltalk.addMethod(
  404. '_testGrulCommitPathJsShouldBeServerGrulJs',
  405. smalltalk.method({
  406. selector: 'testGrulCommitPathJsShouldBeServerGrulJs',
  407. fn: function (){
  408. var self=this;
  409. smalltalk.send(self, "_assert_equals_", [unescape("server/grul/js"), smalltalk.send(self['@grulPackage'], "_commitPathJs", [])]);
  410. return self;}
  411. }),
  412. smalltalk.PackageWithDefaultCommitPathChangedTest);
  413. smalltalk.addMethod(
  414. '_testGrulCommitPathStShouldBeGrulSt',
  415. smalltalk.method({
  416. selector: 'testGrulCommitPathStShouldBeGrulSt',
  417. fn: function (){
  418. var self=this;
  419. smalltalk.send(self, "_assert_equals_", [unescape("grul/st"), smalltalk.send(self['@grulPackage'], "_commitPathSt", [])]);
  420. return self;}
  421. }),
  422. smalltalk.PackageWithDefaultCommitPathChangedTest);
  423. smalltalk.addMethod(
  424. '_testZorkCommitPathJsShouldBeJavascript',
  425. smalltalk.method({
  426. selector: 'testZorkCommitPathJsShouldBeJavascript',
  427. fn: function (){
  428. var self=this;
  429. smalltalk.send(self, "_assert_equals_", [unescape("javascripts/"), smalltalk.send(self['@zorkPackage'], "_commitPathJs", [])]);
  430. return self;}
  431. }),
  432. smalltalk.PackageWithDefaultCommitPathChangedTest);
  433. smalltalk.addMethod(
  434. '_testZorkCommitPathStShouldBeSmalltalk',
  435. smalltalk.method({
  436. selector: 'testZorkCommitPathStShouldBeSmalltalk',
  437. fn: function (){
  438. var self=this;
  439. smalltalk.send(self, "_assert_equals_", [unescape("smalltalk/"), smalltalk.send(self['@zorkPackage'], "_commitPathSt", [])]);
  440. return self;}
  441. }),
  442. smalltalk.PackageWithDefaultCommitPathChangedTest);
  443. smalltalk.addMethod(
  444. '_shouldInheritSelectors',
  445. smalltalk.method({
  446. selector: 'shouldInheritSelectors',
  447. fn: function (){
  448. var self=this;
  449. return false;
  450. return self;}
  451. }),
  452. smalltalk.PackageWithDefaultCommitPathChangedTest.klass);