Kernel-Tests.deploy.js 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  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.addClass('JSObjectProxyTest', smalltalk.TestCase, [], 'Kernel-Tests');
  273. smalltalk.addMethod(
  274. '_testMethodWithArguments',
  275. smalltalk.method({
  276. selector: 'testMethodWithArguments',
  277. fn: function (){
  278. var self=this;
  279. smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_hasClass_", ["amber"])]);
  280. smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_addClass_", ["amber"]);
  281. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_hasClass_", ["amber"])]);
  282. smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_removeClass_", ["amber"]);
  283. smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_hasClass_", ["amber"])]);
  284. return self;}
  285. }),
  286. smalltalk.JSObjectProxyTest);
  287. smalltalk.addMethod(
  288. '_testYourself',
  289. smalltalk.method({
  290. selector: 'testYourself',
  291. fn: function (){
  292. var self=this;
  293. var body=nil;
  294. body=(function($rec){smalltalk.send($rec, "_addClass_", ["amber"]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send("body", "_asJQuery", []));
  295. smalltalk.send(self, "_assert_", [smalltalk.send(body, "_hasClass_", ["amber"])]);
  296. smalltalk.send(body, "_removeClass_", ["amber"]);
  297. smalltalk.send(self, "_deny_", [smalltalk.send(body, "_hasClass_", ["amber"])]);
  298. return self;}
  299. }),
  300. smalltalk.JSObjectProxyTest);
  301. smalltalk.addMethod(
  302. '_testPropertyThatReturnsEmptyString',
  303. smalltalk.method({
  304. selector: 'testPropertyThatReturnsEmptyString',
  305. fn: function (){
  306. var self=this;
  307. document.location.hash = '';
  308. smalltalk.send(self, "_assert_equals_", ["", smalltalk.send(smalltalk.send((typeof document == 'undefined' ? nil : document), "_location", []), "_hash", [])]);
  309. smalltalk.send(smalltalk.send((typeof document == 'undefined' ? nil : document), "_location", []), "_hash_", ["test"]);
  310. smalltalk.send(self, "_assert_equals_", [unescape("%23test"), smalltalk.send(smalltalk.send((typeof document == 'undefined' ? nil : document), "_location", []), "_hash", [])]);
  311. return self;}
  312. }),
  313. smalltalk.JSObjectProxyTest);