1
0

Kernel-Tests.js 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676
  1. smalltalk.addPackage('Kernel-Tests', {});
  2. smalltalk.addClass('StringTest', smalltalk.TestCase, [], 'Kernel-Tests');
  3. smalltalk.addMethod(
  4. unescape('_testJoin'),
  5. smalltalk.method({
  6. selector: unescape('testJoin'),
  7. category: 'tests',
  8. fn: function (){
  9. var self=this;
  10. smalltalk.send(self, "_assert_equals_", [unescape("hello%2Cworld"), smalltalk.send(unescape("%2C"), "_join_", [["hello", "world"]])]);
  11. return self;},
  12. args: [],
  13. source: unescape('testJoin%0A%09self%20assert%3A%20%27hello%2Cworld%27%20equals%3A%20%28%27%2C%27%20join%3A%20%23%28%27hello%27%20%27world%27%29%29'),
  14. messageSends: ["assert:equals:", "join:"],
  15. referencedClasses: []
  16. }),
  17. smalltalk.StringTest);
  18. smalltalk.addMethod(
  19. unescape('_testStreamContents'),
  20. smalltalk.method({
  21. selector: unescape('testStreamContents'),
  22. category: 'tests',
  23. fn: function (){
  24. var self=this;
  25. 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);})])]);
  26. return self;},
  27. args: [],
  28. source: unescape('testStreamContents%0A%09self%20%0A%09%09assert%3A%20%27hello%20world%27%20%0A%09%09equals%3A%20%28String%20streamContents%3A%20%5B%3AaStream%7C%20aStream%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09%09%09%09%09nextPutAll%3A%20%27hello%27%3B%20space%3B%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09%09%09%09%09nextPutAll%3A%20%27world%27%5D%29'),
  29. messageSends: ["assert:equals:", "streamContents:", "nextPutAll:", "space"],
  30. referencedClasses: ["String"]
  31. }),
  32. smalltalk.StringTest);
  33. smalltalk.addMethod(
  34. unescape('_testIncludesSubString'),
  35. smalltalk.method({
  36. selector: unescape('testIncludesSubString'),
  37. category: 'tests',
  38. fn: function (){
  39. var self=this;
  40. smalltalk.send(self, "_assert_", [smalltalk.send("amber", "_includesSubString_", ["ber"])]);
  41. smalltalk.send(self, "_deny_", [smalltalk.send("amber", "_includesSubString_", ["zork"])]);
  42. return self;},
  43. args: [],
  44. source: unescape('testIncludesSubString%0A%09self%20assert%3A%20%28%27amber%27%20includesSubString%3A%20%27ber%27%29.%0A%09self%20deny%3A%20%28%27amber%27%20includesSubString%3A%20%27zork%27%29.'),
  45. messageSends: ["assert:", "includesSubString:", "deny:"],
  46. referencedClasses: []
  47. }),
  48. smalltalk.StringTest);
  49. smalltalk.addMethod(
  50. unescape('_testEquality'),
  51. smalltalk.method({
  52. selector: unescape('testEquality'),
  53. category: 'tests',
  54. fn: function (){
  55. var self=this;
  56. smalltalk.send(self, "_assert_", [smalltalk.send("hello", "__eq", ["hello"])]);
  57. smalltalk.send(self, "_deny_", [smalltalk.send("hello", "__eq", ["world"])]);
  58. smalltalk.send(self, "_assert_", [smalltalk.send("hello", "__eq", [smalltalk.send("hello", "_yourself", [])])]);
  59. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send("hello", "_yourself", []), "__eq", ["hello"])]);
  60. smalltalk.send(self, "_deny_", [smalltalk.send("", "__eq", [(0)])]);
  61. return self;},
  62. args: [],
  63. source: unescape('testEquality%0A%09self%20assert%3A%20%27hello%27%20%3D%20%27hello%27.%0A%09self%20deny%3A%20%27hello%27%20%3D%20%27world%27.%0A%0A%09self%20assert%3A%20%27hello%27%20%20%3D%20%27hello%27%20yourself.%0A%09self%20assert%3A%20%27hello%27%20yourself%20%3D%20%27hello%27.%0A%0A%09%22test%20JS%20falsy%20value%22%0A%09self%20deny%3A%20%27%27%20%3D%200'),
  64. messageSends: ["assert:", unescape("%3D"), "deny:", "yourself"],
  65. referencedClasses: []
  66. }),
  67. smalltalk.StringTest);
  68. smalltalk.addMethod(
  69. unescape('_testCopyWithoutAll'),
  70. smalltalk.method({
  71. selector: unescape('testCopyWithoutAll'),
  72. category: 'tests',
  73. fn: function (){
  74. var self=this;
  75. smalltalk.send(self, "_assert_equals_", ["hello world", smalltalk.send(unescape("*hello*%20*world*"), "_copyWithoutAll_", [unescape("*")])]);
  76. return self;},
  77. args: [],
  78. source: unescape('testCopyWithoutAll%0A%09self%20%0A%09%09assert%3A%20%27hello%20world%27%20%0A%09%09equals%3A%20%28%27*hello*%20*world*%27%20copyWithoutAll%3A%20%27*%27%29'),
  79. messageSends: ["assert:equals:", "copyWithoutAll:"],
  80. referencedClasses: []
  81. }),
  82. smalltalk.StringTest);
  83. smalltalk.addClass('DictionaryTest', smalltalk.TestCase, [], 'Kernel-Tests');
  84. smalltalk.addMethod(
  85. unescape('_testPrintString'),
  86. smalltalk.method({
  87. selector: unescape('testPrintString'),
  88. category: 'tests',
  89. fn: function (){
  90. var self=this;
  91. 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", []))]);
  92. return self;},
  93. args: [],
  94. source: unescape('testPrintString%0A%09self%0A%09%09assert%3A%20%27a%20Dictionary%28%27%27firstname%27%27%20-%3E%20%27%27James%27%27%20%2C%20%27%27lastname%27%27%20-%3E%20%27%27Bond%27%27%29%27%20%0A%09%09equals%3A%20%28Dictionary%20new%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09at%3A%27firstname%27%20put%3A%20%27James%27%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09at%3A%27lastname%27%20put%3A%20%27Bond%27%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09printString%29'),
  95. messageSends: ["assert:equals:", "at:put:", "printString", "new"],
  96. referencedClasses: ["Dictionary"]
  97. }),
  98. smalltalk.DictionaryTest);
  99. smalltalk.addMethod(
  100. unescape('_testEquality'),
  101. smalltalk.method({
  102. selector: unescape('testEquality'),
  103. category: 'tests',
  104. fn: function (){
  105. var self=this;
  106. var d1=nil;
  107. var d2=nil;
  108. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []), "__eq", [smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", [])])]);
  109. d1=(function($rec){smalltalk.send($rec, "_at_put_", [(1), (2)]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
  110. d2=(function($rec){smalltalk.send($rec, "_at_put_", [(1), (2)]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
  111. smalltalk.send(self, "_assert_", [smalltalk.send(d1, "__eq", [d2])]);
  112. d2=(function($rec){smalltalk.send($rec, "_at_put_", [(1), (3)]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
  113. smalltalk.send(self, "_deny_", [smalltalk.send(d1, "__eq", [d2])]);
  114. d2=(function($rec){smalltalk.send($rec, "_at_put_", [(2), (2)]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
  115. smalltalk.send(self, "_deny_", [smalltalk.send(d1, "__eq", [d2])]);
  116. 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", []));
  117. smalltalk.send(self, "_deny_", [smalltalk.send(d1, "__eq", [d2])]);
  118. return self;},
  119. args: [],
  120. source: unescape('testEquality%0A%09%7C%20d1%20d2%20%7C%0A%0A%09self%20assert%3A%20Dictionary%20new%20%3D%20Dictionary%20new.%0A%09%09%0A%09d1%20%3A%3D%20Dictionary%20new%20at%3A%201%20put%3A%202%3B%20yourself.%0A%09d2%20%3A%3D%20Dictionary%20new%20at%3A%201%20put%3A%202%3B%20yourself.%0A%09self%20assert%3A%20d1%20%3D%20d2.%0A%0A%09d2%20%3A%3D%20Dictionary%20new%20at%3A%201%20put%3A%203%3B%20yourself.%0A%09self%20deny%3A%20d1%20%3D%20d2.%0A%0A%09d2%20%3A%3D%20Dictionary%20new%20at%3A%202%20put%3A%202%3B%20yourself.%0A%09self%20deny%3A%20d1%20%3D%20d2.%0A%0A%09d2%20%3A%3D%20Dictionary%20new%20at%3A%201%20put%3A%202%3B%20at%3A%203%20put%3A%204%3B%20yourself.%0A%09self%20deny%3A%20d1%20%3D%20d2.'),
  121. messageSends: ["assert:", unescape("%3D"), "new", "at:put:", "yourself", "deny:"],
  122. referencedClasses: ["Dictionary"]
  123. }),
  124. smalltalk.DictionaryTest);
  125. smalltalk.addMethod(
  126. unescape('_testDynamicDictionaries'),
  127. smalltalk.method({
  128. selector: unescape('testDynamicDictionaries'),
  129. category: 'tests',
  130. fn: function (){
  131. var self=this;
  132. 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"])])])]);
  133. return self;},
  134. args: [],
  135. source: unescape('testDynamicDictionaries%0A%09self%20assert%3A%20%23%7B1%20-%3E%20%27hello%27.%202%20-%3E%20%27world%27%7D%20%3D%20%28Dictionary%20with%3A%201%20-%3E%20%27hello%27%20with%3A%202%20-%3E%20%27world%27%29'),
  136. messageSends: ["assert:", unescape("%3D"), unescape("-%3E"), "with:with:"],
  137. referencedClasses: ["Dictionary"]
  138. }),
  139. smalltalk.DictionaryTest);
  140. smalltalk.addClass('BooleanTest', smalltalk.TestCase, [], 'Kernel-Tests');
  141. smalltalk.addMethod(
  142. unescape('_testLogic'),
  143. smalltalk.method({
  144. selector: unescape('testLogic'),
  145. category: 'not yet classified',
  146. fn: function (){
  147. var self=this;
  148. (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);
  149. (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);
  150. (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);
  151. (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);
  152. return self;},
  153. args: [],
  154. source: unescape('testLogic%0A%20%0A%09%22Trivial%20logic%20table%22%0A%09self%20assert%3A%20%28true%20%26%20true%29%3B%20deny%3A%20%28true%20%26%20false%29%3B%20deny%3A%20%28false%20%26%20true%29%3B%20deny%3A%20%28false%20%26%20false%29.%0A%09self%20assert%3A%20%28true%20%7C%20true%29%3B%20assert%3A%20%28true%20%7C%20false%29%3B%20assert%3A%20%28false%20%7C%20true%29%3B%20deny%3A%20%28false%20%7C%20false%29.%0A%20%20%20%20%20%20%20%20%22Checking%20that%20expressions%20work%20fine%20too%22%0A%09self%20assert%3A%20%28true%20%26%20%281%20%3E%200%29%29%3B%20deny%3A%20%28%281%20%3E%200%29%20%26%20false%29%3B%20deny%3A%20%28%281%20%3E%200%29%20%26%20%281%20%3E%202%29%29.%0A%20%20%20%20%20%20%20%20self%20assert%3A%20%28false%20%7C%20%281%20%3E%200%29%29%3B%20assert%3A%20%28%281%20%3E%200%29%20%7C%20false%29%3B%20assert%3A%20%28%281%20%3E%200%29%20%7C%20%281%20%3E%202%29%29'),
  155. messageSends: ["assert:", unescape("%26"), "deny:", unescape("%7C"), unescape("%3E")],
  156. referencedClasses: []
  157. }),
  158. smalltalk.BooleanTest);
  159. smalltalk.addMethod(
  160. unescape('_testEquality'),
  161. smalltalk.method({
  162. selector: unescape('testEquality'),
  163. category: 'not yet classified',
  164. fn: function (){
  165. var self=this;
  166. smalltalk.send(self, "_deny_", [smalltalk.send((0), "__eq", [false])]);
  167. smalltalk.send(self, "_deny_", [smalltalk.send(false, "__eq", [(0)])]);
  168. smalltalk.send(self, "_deny_", [smalltalk.send("", "__eq", [false])]);
  169. smalltalk.send(self, "_deny_", [smalltalk.send(false, "__eq", [""])]);
  170. smalltalk.send(self, "_assert_", [smalltalk.send(true, "__eq", [true])]);
  171. smalltalk.send(self, "_deny_", [smalltalk.send(false, "__eq", [true])]);
  172. smalltalk.send(self, "_deny_", [smalltalk.send(true, "__eq", [false])]);
  173. smalltalk.send(self, "_assert_", [smalltalk.send(false, "__eq", [false])]);
  174. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(true, "_yourself", []), "__eq", [true])]);
  175. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(true, "_yourself", []), "__eq", [smalltalk.send(true, "_yourself", [])])]);
  176. return self;},
  177. args: [],
  178. source: unescape('testEquality%0A%09%22We%27re%20on%20top%20of%20JS...just%20be%20sure%20to%20check%20the%20basics%21%22%0A%0A%09self%20deny%3A%200%20%3D%20false.%20%0A%09self%20deny%3A%20false%20%3D%200.%0A%09self%20deny%3A%20%27%27%20%3D%20false.%0A%09self%20deny%3A%20false%20%3D%20%27%27.%0A%0A%09self%20assert%3A%20true%20%3D%20true.%0A%09self%20deny%3A%20false%20%3D%20true.%0A%09self%20deny%3A%20true%20%3D%20false.%0A%09self%20assert%3A%20false%20%3D%20false.%0A%0A%09%22JS%20may%20do%20some%20type%20coercing%20after%20sending%20a%20message%22%0A%09self%20assert%3A%20true%20yourself%20%3D%20true.%0A%09self%20assert%3A%20true%20yourself%20%3D%20true%20yourself'),
  179. messageSends: ["deny:", unescape("%3D"), "assert:", "yourself"],
  180. referencedClasses: []
  181. }),
  182. smalltalk.BooleanTest);
  183. smalltalk.addMethod(
  184. unescape('_testLogicKeywords'),
  185. smalltalk.method({
  186. selector: unescape('testLogicKeywords'),
  187. category: 'not yet classified',
  188. fn: function (){
  189. var self=this;
  190. (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);
  191. (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);
  192. (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);
  193. (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);
  194. return self;},
  195. args: [],
  196. source: unescape('testLogicKeywords%0A%20%0A%09%22Trivial%20logic%20table%22%0A%09self%20%0A%09%09assert%3A%20%28true%20and%3A%20%5B%20true%5D%29%3B%20%0A%09%09deny%3A%20%28true%20and%3A%20%5B%20false%20%5D%29%3B%20%0A%09%09deny%3A%20%28false%20and%3A%20%5B%20true%20%5D%29%3B%20%0A%09%09deny%3A%20%28false%20and%3A%20%5B%20false%20%5D%29.%0A%09self%20%0A%09%09assert%3A%20%28true%20or%3A%20%5B%20true%20%5D%29%3B%20%0A%09%09assert%3A%20%28true%20or%3A%20%5B%20false%20%5D%29%3B%20%0A%09%09assert%3A%20%28false%20or%3A%20%5B%20true%20%5D%29%3B%20%0A%09%09deny%3A%20%28false%20or%3A%20%5B%20false%20%5D%29.%0A%20%20%20%20%20%20%20%20%0A%09%22Checking%20that%20expressions%20work%20fine%20too%22%0A%09self%20%0A%09%09assert%3A%20%28true%20and%3A%20%5B%201%20%3E%200%20%5D%29%3B%20%0A%09%09deny%3A%20%28%281%20%3E%200%29%20and%3A%20%5B%20false%20%5D%29%3B%20%0A%09%09deny%3A%20%28%281%20%3E%200%29%20and%3A%20%5B%201%20%3E%202%20%5D%29.%0A%20%20%20%20%20%20%20%20self%20%0A%09%09assert%3A%20%28false%20or%3A%20%5B%201%20%3E%200%20%5D%29%3B%20%0A%09%09assert%3A%20%28%281%20%3E%200%29%20or%3A%20%5B%20false%20%5D%29%3B%20%0A%09%09assert%3A%20%28%281%20%3E%200%29%20or%3A%20%5B%201%20%3E%202%20%5D%29'),
  197. messageSends: ["assert:", "and:", "deny:", "or:", unescape("%3E")],
  198. referencedClasses: []
  199. }),
  200. smalltalk.BooleanTest);
  201. smalltalk.addMethod(
  202. unescape('_testIfTrueIfFalse'),
  203. smalltalk.method({
  204. selector: unescape('testIfTrueIfFalse'),
  205. category: 'not yet classified',
  206. fn: function (){
  207. var self=this;
  208. 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"])]);
  209. 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])]);
  210. 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])]);
  211. 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"])]);
  212. 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"])]);
  213. 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"])]);
  214. 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"])]);
  215. 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"])]);
  216. return self;},
  217. args: [],
  218. source: unescape('testIfTrueIfFalse%0A%20%0A%09self%20assert%3A%20%28true%20ifTrue%3A%20%5B%27alternative%20block%27%5D%29%20%3D%20%27alternative%20block%27.%0A%09self%20assert%3A%20%28true%20ifFalse%3A%20%5B%27alternative%20block%27%5D%29%20%3D%20nil.%0A%0A%09self%20assert%3A%20%28false%20ifTrue%3A%20%5B%27alternative%20block%27%5D%29%20%3D%20nil.%0A%09self%20assert%3A%20%28false%20ifFalse%3A%20%5B%27alternative%20block%27%5D%29%20%3D%20%27alternative%20block%27.%0A%0A%09self%20assert%3A%20%28false%20ifTrue%3A%20%5B%27alternative%20block%27%5D%20ifFalse%3A%20%5B%27alternative%20block2%27%5D%29%20%3D%20%27alternative%20block2%27.%0A%09self%20assert%3A%20%28false%20ifFalse%3A%20%5B%27alternative%20block%27%5D%20ifTrue%3A%20%5B%27alternative%20block2%27%5D%29%20%3D%20%27alternative%20block%27.%0A%0A%09self%20assert%3A%20%28true%20ifTrue%3A%20%5B%27alternative%20block%27%5D%20ifFalse%3A%20%5B%27alternative%20block2%27%5D%29%20%3D%20%27alternative%20block%27.%0A%09self%20assert%3A%20%28true%20ifFalse%3A%20%5B%27alternative%20block%27%5D%20ifTrue%3A%20%5B%27alternative%20block2%27%5D%29%20%3D%20%27alternative%20block2%27.'),
  219. messageSends: ["assert:", unescape("%3D"), "ifTrue:", "ifFalse:", "ifTrue:ifFalse:", "ifFalse:ifTrue:"],
  220. referencedClasses: []
  221. }),
  222. smalltalk.BooleanTest);
  223. smalltalk.addClass('NumberTest', smalltalk.TestCase, [], 'Kernel-Tests');
  224. smalltalk.addMethod(
  225. unescape('_testPrintShowingDecimalPlaces'),
  226. smalltalk.method({
  227. selector: unescape('testPrintShowingDecimalPlaces'),
  228. category: 'tests',
  229. fn: function (){
  230. var self=this;
  231. smalltalk.send(self, "_assert_equals_", ["23.00", smalltalk.send((23), "_printShowingDecimalPlaces_", [(2)])]);
  232. smalltalk.send(self, "_assert_equals_", ["23.57", smalltalk.send((23.5698), "_printShowingDecimalPlaces_", [(2)])]);
  233. smalltalk.send(self, "_assert_equals_", [unescape("-234.56700"), smalltalk.send(smalltalk.send((234.567), "_negated", []), "_printShowingDecimalPlaces_", [(5)])]);
  234. smalltalk.send(self, "_assert_equals_", ["23", smalltalk.send((23.4567), "_printShowingDecimalPlaces_", [(0)])]);
  235. smalltalk.send(self, "_assert_equals_", ["24", smalltalk.send((23.5567), "_printShowingDecimalPlaces_", [(0)])]);
  236. smalltalk.send(self, "_assert_equals_", [unescape("-23"), smalltalk.send(smalltalk.send((23.4567), "_negated", []), "_printShowingDecimalPlaces_", [(0)])]);
  237. smalltalk.send(self, "_assert_equals_", [unescape("-24"), smalltalk.send(smalltalk.send((23.5567), "_negated", []), "_printShowingDecimalPlaces_", [(0)])]);
  238. smalltalk.send(self, "_assert_equals_", ["100000000.0", smalltalk.send((100000000), "_printShowingDecimalPlaces_", [(1)])]);
  239. smalltalk.send(self, "_assert_equals_", ["0.98000", smalltalk.send((0.98), "_printShowingDecimalPlaces_", [(5)])]);
  240. smalltalk.send(self, "_assert_equals_", [unescape("-0.98"), smalltalk.send(smalltalk.send((0.98), "_negated", []), "_printShowingDecimalPlaces_", [(2)])]);
  241. smalltalk.send(self, "_assert_equals_", ["2.57", smalltalk.send((2.567), "_printShowingDecimalPlaces_", [(2)])]);
  242. smalltalk.send(self, "_assert_equals_", [unescape("-2.57"), smalltalk.send((-2.567), "_printShowingDecimalPlaces_", [(2)])]);
  243. smalltalk.send(self, "_assert_equals_", ["0.00", smalltalk.send((0), "_printShowingDecimalPlaces_", [(2)])]);
  244. return self;},
  245. args: [],
  246. source: unescape('testPrintShowingDecimalPlaces%0A%09self%20assert%3A%20%2723.00%27%20equals%3A%20%2823%20printShowingDecimalPlaces%3A%202%29.%0A%09self%20assert%3A%20%2723.57%27%20equals%3A%20%2823.5698%20printShowingDecimalPlaces%3A%202%29.%0A%09self%20assert%3A%20%27-234.56700%27%20equals%3A%28%20234.567%20negated%20printShowingDecimalPlaces%3A%205%29.%0A%09self%20assert%3A%20%2723%27%20equals%3A%20%2823.4567%20printShowingDecimalPlaces%3A%200%29.%0A%09self%20assert%3A%20%2724%27%20equals%3A%20%2823.5567%20printShowingDecimalPlaces%3A%200%29.%0A%09self%20assert%3A%20%27-23%27%20equals%3A%20%2823.4567%20negated%20printShowingDecimalPlaces%3A%200%29.%0A%09self%20assert%3A%20%27-24%27%20equals%3A%20%2823.5567%20negated%20printShowingDecimalPlaces%3A%200%29.%0A%09self%20assert%3A%20%27100000000.0%27%20equals%3A%20%28100000000%20printShowingDecimalPlaces%3A%201%29.%0A%09self%20assert%3A%20%270.98000%27%20equals%3A%20%280.98%20printShowingDecimalPlaces%3A%205%29.%0A%09self%20assert%3A%20%27-0.98%27%20equals%3A%20%280.98%20negated%20printShowingDecimalPlaces%3A%202%29.%0A%09self%20assert%3A%20%272.57%27%20equals%3A%20%282.567%20printShowingDecimalPlaces%3A%202%29.%0A%09self%20assert%3A%20%27-2.57%27%20equals%3A%20%28-2.567%20printShowingDecimalPlaces%3A%202%29.%0A%09self%20assert%3A%20%270.00%27%20equals%3A%20%280%20printShowingDecimalPlaces%3A%202%29.'),
  247. messageSends: ["assert:equals:", "printShowingDecimalPlaces:", "negated"],
  248. referencedClasses: []
  249. }),
  250. smalltalk.NumberTest);
  251. smalltalk.addMethod(
  252. unescape('_testEquality'),
  253. smalltalk.method({
  254. selector: unescape('testEquality'),
  255. category: 'tests',
  256. fn: function (){
  257. var self=this;
  258. smalltalk.send(self, "_assert_", [smalltalk.send((1), "__eq", [(1)])]);
  259. smalltalk.send(self, "_assert_", [smalltalk.send((0), "__eq", [(0)])]);
  260. smalltalk.send(self, "_deny_", [smalltalk.send((1), "__eq", [(0)])]);
  261. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((1), "_yourself", []), "__eq", [(1)])]);
  262. smalltalk.send(self, "_assert_", [smalltalk.send((1), "__eq", [smalltalk.send((1), "_yourself", [])])]);
  263. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((1), "_yourself", []), "__eq", [smalltalk.send((1), "_yourself", [])])]);
  264. smalltalk.send(self, "_deny_", [smalltalk.send((0), "__eq", [false])]);
  265. smalltalk.send(self, "_deny_", [smalltalk.send(false, "__eq", [(0)])]);
  266. smalltalk.send(self, "_deny_", [smalltalk.send("", "__eq", [(0)])]);
  267. smalltalk.send(self, "_deny_", [smalltalk.send((0), "__eq", [""])]);
  268. return self;},
  269. args: [],
  270. source: unescape('testEquality%0A%09self%20assert%3A%201%20%3D%201.%0A%09self%20assert%3A%200%20%3D%200.%0A%09self%20deny%3A%201%20%3D%200.%0A%0A%09self%20assert%3A%201%20yourself%20%3D%201.%0A%09self%20assert%3A%201%20%3D%201%20yourself.%0A%09self%20assert%3A%201%20yourself%20%3D%201%20yourself.%0A%09%0A%09self%20deny%3A%200%20%3D%20false.%0A%09self%20deny%3A%20false%20%3D%200.%0A%09self%20deny%3A%20%27%27%20%3D%200.%0A%09self%20deny%3A%200%20%3D%20%27%27'),
  271. messageSends: ["assert:", unescape("%3D"), "deny:", "yourself"],
  272. referencedClasses: []
  273. }),
  274. smalltalk.NumberTest);
  275. smalltalk.addMethod(
  276. unescape('_testArithmetic'),
  277. smalltalk.method({
  278. selector: unescape('testArithmetic'),
  279. category: 'tests',
  280. fn: function (){
  281. var self=this;
  282. smalltalk.send(self, "_assert_", [smalltalk.send((1.5) + (1), "__eq", [(2.5)])]);
  283. smalltalk.send(self, "_assert_", [smalltalk.send((2) - (1), "__eq", [(1)])]);
  284. smalltalk.send(self, "_assert_", [smalltalk.send((-2) - (1), "__eq", [(-3)])]);
  285. smalltalk.send(self, "_assert_", [smalltalk.send((12) / (2), "__eq", [(6)])]);
  286. smalltalk.send(self, "_assert_", [smalltalk.send((3) * (4), "__eq", [(12)])]);
  287. smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = (1) + (2)).klass === smalltalk.Number) ? $receiver *(3) : smalltalk.send($receiver, "__star", [(3)])), "__eq", [(9)])]);
  288. smalltalk.send(self, "_assert_", [smalltalk.send((1) + (2) * (3), "__eq", [(7)])]);
  289. return self;},
  290. args: [],
  291. source: unescape('testArithmetic%0A%09%0A%09%22We%20rely%20on%20JS%20here%2C%20so%20we%20won%27t%20test%20complex%20behavior%2C%20just%20check%20if%20%0A%09message%20sends%20are%20corrects%22%0A%0A%09self%20assert%3A%201.5%20+%201%20%3D%202.5.%0A%09self%20assert%3A%202%20-%201%20%3D%201.%0A%09self%20assert%3A%20-2%20-%201%20%3D%20-3.%0A%09self%20assert%3A%2012%20/%202%20%3D%206.%0A%09self%20assert%3A%203%20*%204%20%3D%2012.%0A%0A%09%22Simple%20parenthesis%20and%20execution%20order%22%0A%0A%09self%20assert%3A%201%20+%202%20*%203%20%3D%209.%0A%09self%20assert%3A%201%20+%20%282%20*%203%29%20%3D%207'),
  292. messageSends: ["assert:", unescape("%3D"), unescape("+"), unescape("-"), unescape("/"), unescape("*")],
  293. referencedClasses: []
  294. }),
  295. smalltalk.NumberTest);
  296. smalltalk.addMethod(
  297. unescape('_testRounded'),
  298. smalltalk.method({
  299. selector: unescape('testRounded'),
  300. category: 'tests',
  301. fn: function (){
  302. var self=this;
  303. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3), "_rounded", []), "__eq", [(3)])]);
  304. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3.212), "_rounded", []), "__eq", [(3)])]);
  305. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3.51), "_rounded", []), "__eq", [(4)])]);
  306. return self;},
  307. args: [],
  308. source: unescape('testRounded%0A%09%0A%09self%20assert%3A%203%20rounded%20%3D%203.%0A%09self%20assert%3A%203.212%20rounded%20%3D%203.%0A%09self%20assert%3A%203.51%20rounded%20%3D%204'),
  309. messageSends: ["assert:", unescape("%3D"), "rounded"],
  310. referencedClasses: []
  311. }),
  312. smalltalk.NumberTest);
  313. smalltalk.addMethod(
  314. unescape('_testNegated'),
  315. smalltalk.method({
  316. selector: unescape('testNegated'),
  317. category: 'tests',
  318. fn: function (){
  319. var self=this;
  320. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3), "_negated", []), "__eq", [(-3)])]);
  321. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((-3), "_negated", []), "__eq", [(3)])]);
  322. return self;},
  323. args: [],
  324. source: unescape('testNegated%0A%09self%20assert%3A%203%20negated%20%3D%20-3.%0A%09self%20assert%3A%20-3%20negated%20%3D%203'),
  325. messageSends: ["assert:", unescape("%3D"), "negated"],
  326. referencedClasses: []
  327. }),
  328. smalltalk.NumberTest);
  329. smalltalk.addMethod(
  330. unescape('_testComparison'),
  331. smalltalk.method({
  332. selector: unescape('testComparison'),
  333. category: 'tests',
  334. fn: function (){
  335. var self=this;
  336. smalltalk.send(self, "_assert_", [(3) > (2)]);
  337. smalltalk.send(self, "_assert_", [(2) < (3)]);
  338. smalltalk.send(self, "_deny_", [(3) < (2)]);
  339. smalltalk.send(self, "_deny_", [(2) > (3)]);
  340. smalltalk.send(self, "_assert_", [(3) >= (3)]);
  341. smalltalk.send(self, "_assert_", [(3.1) >= (3)]);
  342. smalltalk.send(self, "_assert_", [(3) <= (3)]);
  343. smalltalk.send(self, "_assert_", [(3) <= (3.1)]);
  344. return self;},
  345. args: [],
  346. source: unescape('testComparison%0A%0A%09self%20assert%3A%203%20%3E%202.%0A%09self%20assert%3A%202%20%3C%203.%0A%09%0A%09self%20deny%3A%203%20%3C%202.%0A%09self%20deny%3A%202%20%3E%203.%0A%0A%09self%20assert%3A%203%20%3E%3D%203.%0A%09self%20assert%3A%203.1%20%3E%3D%203.%0A%09self%20assert%3A%203%20%3C%3D%203.%0A%09self%20assert%3A%203%20%3C%3D%203.1'),
  347. messageSends: ["assert:", unescape("%3E"), unescape("%3C"), "deny:", unescape("%3E%3D"), unescape("%3C%3D")],
  348. referencedClasses: []
  349. }),
  350. smalltalk.NumberTest);
  351. smalltalk.addMethod(
  352. unescape('_testTruncated'),
  353. smalltalk.method({
  354. selector: unescape('testTruncated'),
  355. category: 'tests',
  356. fn: function (){
  357. var self=this;
  358. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3), "_truncated", []), "__eq", [(3)])]);
  359. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3.212), "_truncated", []), "__eq", [(3)])]);
  360. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3.51), "_truncated", []), "__eq", [(3)])]);
  361. return self;},
  362. args: [],
  363. source: unescape('testTruncated%0A%09%0A%09self%20assert%3A%203%20truncated%20%3D%203.%0A%09self%20assert%3A%203.212%20truncated%20%3D%203.%0A%09self%20assert%3A%203.51%20truncated%20%3D%203'),
  364. messageSends: ["assert:", unescape("%3D"), "truncated"],
  365. referencedClasses: []
  366. }),
  367. smalltalk.NumberTest);
  368. smalltalk.addMethod(
  369. unescape('_testCopying'),
  370. smalltalk.method({
  371. selector: unescape('testCopying'),
  372. category: 'tests',
  373. fn: function (){
  374. var self=this;
  375. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((1), "_copy", []), "__eq", [(1)])]);
  376. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((1), "_deepCopy", []), "__eq", [(1)])]);
  377. return self;},
  378. args: [],
  379. source: unescape('testCopying%0A%09self%20assert%3A%201%20copy%20%3D%201.%0A%09self%20assert%3A%201%20deepCopy%20%3D%201'),
  380. messageSends: ["assert:", unescape("%3D"), "copy", "deepCopy"],
  381. referencedClasses: []
  382. }),
  383. smalltalk.NumberTest);
  384. smalltalk.addClass('JSObjectProxyTest', smalltalk.TestCase, [], 'Kernel-Tests');
  385. smalltalk.addMethod(
  386. unescape('_testMethodWithArguments'),
  387. smalltalk.method({
  388. selector: unescape('testMethodWithArguments'),
  389. category: 'tests',
  390. fn: function (){
  391. var self=this;
  392. smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_hasClass_", ["amber"])]);
  393. smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_addClass_", ["amber"]);
  394. smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_hasClass_", ["amber"])]);
  395. smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_removeClass_", ["amber"]);
  396. smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_hasClass_", ["amber"])]);
  397. return self;},
  398. args: [],
  399. source: unescape('testMethodWithArguments%0A%09self%20deny%3A%20%28%27body%27%20asJQuery%20hasClass%3A%20%27amber%27%29.%0A%0A%09%27body%27%20asJQuery%20addClass%3A%20%27amber%27.%0A%09self%20assert%3A%20%28%27body%27%20asJQuery%20hasClass%3A%20%27amber%27%29.%0A%0A%09%27body%27%20asJQuery%20removeClass%3A%20%27amber%27.%0A%09self%20deny%3A%20%28%27body%27%20asJQuery%20hasClass%3A%20%27amber%27%29.'),
  400. messageSends: ["deny:", "hasClass:", "asJQuery", "addClass:", "assert:", "removeClass:"],
  401. referencedClasses: []
  402. }),
  403. smalltalk.JSObjectProxyTest);
  404. smalltalk.addMethod(
  405. unescape('_testYourself'),
  406. smalltalk.method({
  407. selector: unescape('testYourself'),
  408. category: 'tests',
  409. fn: function (){
  410. var self=this;
  411. var body=nil;
  412. body=(function($rec){smalltalk.send($rec, "_addClass_", ["amber"]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send("body", "_asJQuery", []));
  413. smalltalk.send(self, "_assert_", [smalltalk.send(body, "_hasClass_", ["amber"])]);
  414. smalltalk.send(body, "_removeClass_", ["amber"]);
  415. smalltalk.send(self, "_deny_", [smalltalk.send(body, "_hasClass_", ["amber"])]);
  416. return self;},
  417. args: [],
  418. source: unescape('testYourself%0A%09%7Cbody%7C%0A%09body%20%3A%3D%20%27body%27%20asJQuery%0A%09%09%09%09addClass%3A%20%27amber%27%3B%0A%09%09%09%09yourself.%0A%0A%09self%20assert%3A%20%28body%20hasClass%3A%20%27amber%27%29.%0A%0A%09body%20removeClass%3A%20%27amber%27.%0A%09self%20deny%3A%20%28body%20hasClass%3A%20%27amber%27%29.'),
  419. messageSends: ["addClass:", "yourself", "asJQuery", "assert:", "hasClass:", "removeClass:", "deny:"],
  420. referencedClasses: []
  421. }),
  422. smalltalk.JSObjectProxyTest);
  423. smalltalk.addMethod(
  424. unescape('_testPropertyThatReturnsEmptyString'),
  425. smalltalk.method({
  426. selector: unescape('testPropertyThatReturnsEmptyString'),
  427. category: 'tests',
  428. fn: function (){
  429. var self=this;
  430. document.location.hash = '';
  431. smalltalk.send(self, "_assert_equals_", ["", smalltalk.send(smalltalk.send((typeof document == 'undefined' ? nil : document), "_location", []), "_hash", [])]);
  432. smalltalk.send(smalltalk.send((typeof document == 'undefined' ? nil : document), "_location", []), "_hash_", ["test"]);
  433. smalltalk.send(self, "_assert_equals_", [unescape("%23test"), smalltalk.send(smalltalk.send((typeof document == 'undefined' ? nil : document), "_location", []), "_hash", [])]);
  434. return self;},
  435. args: [],
  436. source: unescape('testPropertyThatReturnsEmptyString%0A%09%3Cdocument.location.hash%20%3D%20%27%27%3E.%0A%09self%20assert%3A%20%27%27%20equals%3A%20document%20location%20hash.%0A%0A%09document%20location%20hash%3A%20%27test%27.%0A%09self%20assert%3A%20%27%23test%27%20equals%3A%20document%20location%20hash.'),
  437. messageSends: ["assert:equals:", "hash", "location", "hash:"],
  438. referencedClasses: []
  439. }),
  440. smalltalk.JSObjectProxyTest);
  441. smalltalk.addClass('PackageTest', smalltalk.TestCase, ['zorkPackage', 'grulPackage', 'backUpCommitPathJs', 'backUpCommitPathSt'], 'Kernel-Tests');
  442. smalltalk.addMethod(
  443. unescape('_setUp'),
  444. smalltalk.method({
  445. selector: unescape('setUp'),
  446. category: 'running',
  447. fn: function (){
  448. var self=this;
  449. self['@backUpCommitPathJs']=smalltalk.send((smalltalk.Package || Package), "_defaultCommitPathJs", []);
  450. self['@backUpCommitPathSt']=smalltalk.send((smalltalk.Package || Package), "_defaultCommitPathSt", []);
  451. smalltalk.send((smalltalk.Package || Package), "_resetCommitPaths", []);
  452. self['@zorkPackage']=smalltalk.send(smalltalk.send((smalltalk.Package || Package), "_new", []), "_name_", ["Zork"]);
  453. 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", []));
  454. return self;},
  455. args: [],
  456. source: unescape('setUp%0A%09backUpCommitPathJs%20%3A%3D%20Package%20defaultCommitPathJs.%0A%09backUpCommitPathSt%20%3A%3D%20Package%20defaultCommitPathSt.%0A%0A%09Package%20resetCommitPaths.%0A%0A%09zorkPackage%20%3A%3D%20Package%20new%20name%3A%20%27Zork%27.%0A%09grulPackage%20%3A%3D%20Package%20new%20%0A%09%09%09%09%09name%3A%20%27Grul%27%3B%0A%09%09%09%09%09commitPathJs%3A%20%27server/grul/js%27%3B%0A%09%09%09%09%09commitPathSt%3A%20%27grul/st%27%3B%0A%09%09%09%09%09yourself'),
  457. messageSends: ["defaultCommitPathJs", "defaultCommitPathSt", "resetCommitPaths", "name:", "new", "commitPathJs:", "commitPathSt:", "yourself"],
  458. referencedClasses: [smalltalk.Package]
  459. }),
  460. smalltalk.PackageTest);
  461. smalltalk.addMethod(
  462. unescape('_testGrulCommitPathStShouldBeGrulSt'),
  463. smalltalk.method({
  464. selector: unescape('testGrulCommitPathStShouldBeGrulSt'),
  465. category: 'tests',
  466. fn: function (){
  467. var self=this;
  468. smalltalk.send(self, "_assert_equals_", [unescape("grul/st"), smalltalk.send(self['@grulPackage'], "_commitPathSt", [])]);
  469. return self;},
  470. args: [],
  471. source: unescape('testGrulCommitPathStShouldBeGrulSt%0A%09self%20assert%3A%20%27grul/st%27%20equals%3A%20grulPackage%20commitPathSt'),
  472. messageSends: ["assert:equals:", "commitPathSt"],
  473. referencedClasses: []
  474. }),
  475. smalltalk.PackageTest);
  476. smalltalk.addMethod(
  477. unescape('_testZorkCommitPathStShouldBeSt'),
  478. smalltalk.method({
  479. selector: unescape('testZorkCommitPathStShouldBeSt'),
  480. category: 'tests',
  481. fn: function (){
  482. var self=this;
  483. smalltalk.send(self, "_assert_equals_", ["st", smalltalk.send(self['@zorkPackage'], "_commitPathSt", [])]);
  484. return self;},
  485. args: [],
  486. source: unescape('testZorkCommitPathStShouldBeSt%0A%09self%20assert%3A%20%27st%27%20equals%3A%20zorkPackage%20commitPathSt'),
  487. messageSends: ["assert:equals:", "commitPathSt"],
  488. referencedClasses: []
  489. }),
  490. smalltalk.PackageTest);
  491. smalltalk.addMethod(
  492. unescape('_testZorkCommitPathJsShouldBeJs'),
  493. smalltalk.method({
  494. selector: unescape('testZorkCommitPathJsShouldBeJs'),
  495. category: 'tests',
  496. fn: function (){
  497. var self=this;
  498. smalltalk.send(self, "_assert_equals_", ["js", smalltalk.send(self['@zorkPackage'], "_commitPathJs", [])]);
  499. return self;},
  500. args: [],
  501. source: unescape('testZorkCommitPathJsShouldBeJs%0A%09self%20assert%3A%20%27js%27%20equals%3A%20zorkPackage%20commitPathJs'),
  502. messageSends: ["assert:equals:", "commitPathJs"],
  503. referencedClasses: []
  504. }),
  505. smalltalk.PackageTest);
  506. smalltalk.addMethod(
  507. unescape('_testGrulCommitPathJsShouldBeServerGrulJs'),
  508. smalltalk.method({
  509. selector: unescape('testGrulCommitPathJsShouldBeServerGrulJs'),
  510. category: 'tests',
  511. fn: function (){
  512. var self=this;
  513. smalltalk.send(self, "_assert_equals_", [unescape("server/grul/js"), smalltalk.send(self['@grulPackage'], "_commitPathJs", [])]);
  514. return self;},
  515. args: [],
  516. source: unescape('testGrulCommitPathJsShouldBeServerGrulJs%0A%09self%20assert%3A%20%27server/grul/js%27%20equals%3A%20grulPackage%20commitPathJs'),
  517. messageSends: ["assert:equals:", "commitPathJs"],
  518. referencedClasses: []
  519. }),
  520. smalltalk.PackageTest);
  521. smalltalk.addMethod(
  522. unescape('_tearDown'),
  523. smalltalk.method({
  524. selector: unescape('tearDown'),
  525. category: 'running',
  526. fn: function (){
  527. var self=this;
  528. (function($rec){smalltalk.send($rec, "_defaultCommitPathJs_", [self['@backUpCommitPathJs']]);return smalltalk.send($rec, "_defaultCommitPathSt_", [self['@backUpCommitPathSt']]);})((smalltalk.Package || Package));
  529. return self;},
  530. args: [],
  531. source: unescape('tearDown%0A%09%20Package%20%0A%09%09defaultCommitPathJs%3A%20backUpCommitPathJs%3B%0A%09%09defaultCommitPathSt%3A%20backUpCommitPathSt'),
  532. messageSends: ["defaultCommitPathJs:", "defaultCommitPathSt:"],
  533. referencedClasses: [smalltalk.Package]
  534. }),
  535. smalltalk.PackageTest);
  536. smalltalk.addClass('PackageWithDefaultCommitPathChangedTest', smalltalk.PackageTest, [], 'Kernel-Tests');
  537. smalltalk.addMethod(
  538. unescape('_setUp'),
  539. smalltalk.method({
  540. selector: unescape('setUp'),
  541. category: 'running',
  542. fn: function (){
  543. var self=this;
  544. smalltalk.send(self, "_setUp", [], smalltalk.PackageTest);
  545. (function($rec){smalltalk.send($rec, "_defaultCommitPathJs_", [unescape("javascripts/")]);return smalltalk.send($rec, "_defaultCommitPathSt_", [unescape("smalltalk/")]);})((smalltalk.Package || Package));
  546. return self;},
  547. args: [],
  548. source: unescape('setUp%0A%09super%20setUp.%0A%0A%09Package%0A%09%09defaultCommitPathJs%3A%20%27javascripts/%27%3B%0A%09%09defaultCommitPathSt%3A%20%27smalltalk/%27.'),
  549. messageSends: ["setUp", "defaultCommitPathJs:", "defaultCommitPathSt:"],
  550. referencedClasses: [smalltalk.Package]
  551. }),
  552. smalltalk.PackageWithDefaultCommitPathChangedTest);
  553. smalltalk.addMethod(
  554. unescape('_testGrulCommitPathJsShouldBeServerGrulJs'),
  555. smalltalk.method({
  556. selector: unescape('testGrulCommitPathJsShouldBeServerGrulJs'),
  557. category: 'tests',
  558. fn: function (){
  559. var self=this;
  560. smalltalk.send(self, "_assert_equals_", [unescape("server/grul/js"), smalltalk.send(self['@grulPackage'], "_commitPathJs", [])]);
  561. return self;},
  562. args: [],
  563. source: unescape('testGrulCommitPathJsShouldBeServerGrulJs%0A%09self%20assert%3A%20%27server/grul/js%27%20equals%3A%20grulPackage%20commitPathJs'),
  564. messageSends: ["assert:equals:", "commitPathJs"],
  565. referencedClasses: []
  566. }),
  567. smalltalk.PackageWithDefaultCommitPathChangedTest);
  568. smalltalk.addMethod(
  569. unescape('_testGrulCommitPathStShouldBeGrulSt'),
  570. smalltalk.method({
  571. selector: unescape('testGrulCommitPathStShouldBeGrulSt'),
  572. category: 'tests',
  573. fn: function (){
  574. var self=this;
  575. smalltalk.send(self, "_assert_equals_", [unescape("grul/st"), smalltalk.send(self['@grulPackage'], "_commitPathSt", [])]);
  576. return self;},
  577. args: [],
  578. source: unescape('testGrulCommitPathStShouldBeGrulSt%0A%09self%20assert%3A%20%27grul/st%27%20equals%3A%20grulPackage%20commitPathSt'),
  579. messageSends: ["assert:equals:", "commitPathSt"],
  580. referencedClasses: []
  581. }),
  582. smalltalk.PackageWithDefaultCommitPathChangedTest);
  583. smalltalk.addMethod(
  584. unescape('_testZorkCommitPathJsShouldBeJavascript'),
  585. smalltalk.method({
  586. selector: unescape('testZorkCommitPathJsShouldBeJavascript'),
  587. category: 'tests',
  588. fn: function (){
  589. var self=this;
  590. smalltalk.send(self, "_assert_equals_", [unescape("javascripts/"), smalltalk.send(self['@zorkPackage'], "_commitPathJs", [])]);
  591. return self;},
  592. args: [],
  593. source: unescape('testZorkCommitPathJsShouldBeJavascript%0A%09self%20assert%3A%20%27javascripts/%27%20equals%3A%20zorkPackage%20commitPathJs'),
  594. messageSends: ["assert:equals:", "commitPathJs"],
  595. referencedClasses: []
  596. }),
  597. smalltalk.PackageWithDefaultCommitPathChangedTest);
  598. smalltalk.addMethod(
  599. unescape('_testZorkCommitPathStShouldBeSmalltalk'),
  600. smalltalk.method({
  601. selector: unescape('testZorkCommitPathStShouldBeSmalltalk'),
  602. category: 'tests',
  603. fn: function (){
  604. var self=this;
  605. smalltalk.send(self, "_assert_equals_", [unescape("smalltalk/"), smalltalk.send(self['@zorkPackage'], "_commitPathSt", [])]);
  606. return self;},
  607. args: [],
  608. source: unescape('testZorkCommitPathStShouldBeSmalltalk%0A%09self%20assert%3A%20%27smalltalk/%27%20equals%3A%20zorkPackage%20commitPathSt'),
  609. messageSends: ["assert:equals:", "commitPathSt"],
  610. referencedClasses: []
  611. }),
  612. smalltalk.PackageWithDefaultCommitPathChangedTest);
  613. smalltalk.addMethod(
  614. unescape('_shouldInheritSelectors'),
  615. smalltalk.method({
  616. selector: unescape('shouldInheritSelectors'),
  617. category: 'accessing',
  618. fn: function (){
  619. var self=this;
  620. return false;
  621. return self;},
  622. args: [],
  623. source: unescape('shouldInheritSelectors%0A%09%5E%20false'),
  624. messageSends: [],
  625. referencedClasses: []
  626. }),
  627. smalltalk.PackageWithDefaultCommitPathChangedTest.klass);