Kernel-Tests.js 42 KB

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