Kernel-Tests.deploy.js 24 KB

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