Trapped-Tests.deploy.js 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. smalltalk.addPackage('Trapped-Tests', {});
  2. smalltalk.addClass('IsolatorTest', smalltalk.TestCase, ['rootModel'], 'Trapped-Tests');
  3. smalltalk.addMethod(
  4. "_setUp",
  5. smalltalk.method({
  6. selector: "setUp",
  7. fn: function (){
  8. var self=this;
  9. var $1,$2;
  10. $1=smalltalk.send((smalltalk.EavModel || EavModel),"_new",[]);
  11. smalltalk.send($1,"_getBlock_",[(function(x){
  12. return smalltalk.send(x,"_root",[]);
  13. })]);
  14. $2=smalltalk.send($1,"_putBlock_",[(function(x,y){
  15. return smalltalk.send(x,"_root_",[y]);
  16. })]);
  17. self["@rootModel"]=$2;
  18. return self}
  19. }),
  20. smalltalk.IsolatorTest);
  21. smalltalk.addMethod(
  22. "_testNontrivialModelGetsAppropriateValueForModification",
  23. smalltalk.method({
  24. selector: "testNontrivialModelGetsAppropriateValueForModification",
  25. fn: function (){
  26. var self=this;
  27. var $1,$2;
  28. var bb;
  29. var model;
  30. var result;
  31. bb=smalltalk.send((smalltalk.Isolator || Isolator),"_on_",[smalltalk.HashedCollection._fromPairs_([smalltalk.send("foo","__minus_gt",[["bar", [(1), [(2), (5)]], "baz"]]),smalltalk.send("moo","__minus_gt",["zoo"])])]);
  32. $1=smalltalk.send((smalltalk.EavModel || EavModel),"_new",[]);
  33. smalltalk.send($1,"_getBlock_",[(function(x){
  34. return smalltalk.send(smalltalk.send(smalltalk.send(x,"_root",[]),"_at_",["foo"]),"_at_",[(2)]);
  35. })]);
  36. $2=smalltalk.send($1,"_putBlock_",[(function(x,y){
  37. return smalltalk.send(smalltalk.send(smalltalk.send(x,"_root",[]),"_at_",["foo"]),"_at_put_",[(2),y]);
  38. })]);
  39. model=$2;
  40. smalltalk.send(bb,"_model_modify_",[model,(function(r){
  41. result=r;
  42. return result;
  43. })]);
  44. smalltalk.send(self,"_assert_equals_",[[(1), [(2), (5)]],result]);
  45. return self}
  46. }),
  47. smalltalk.IsolatorTest);
  48. smalltalk.addMethod(
  49. "_testNontrivialModelModifiesAppropriateValue",
  50. smalltalk.method({
  51. selector: "testNontrivialModelModifiesAppropriateValue",
  52. fn: function (){
  53. var self=this;
  54. var $1,$2;
  55. var bb;
  56. var model;
  57. var result;
  58. bb=smalltalk.send((smalltalk.Isolator || Isolator),"_on_",[smalltalk.HashedCollection._fromPairs_([smalltalk.send("foo","__minus_gt",[["bar", [(1), [(2), (3)]], "baz"]]),smalltalk.send("moo","__minus_gt",["zoo"])])]);
  59. $1=smalltalk.send((smalltalk.EavModel || EavModel),"_new",[]);
  60. smalltalk.send($1,"_getBlock_",[(function(x){
  61. return smalltalk.send(smalltalk.send(smalltalk.send(x,"_root",[]),"_at_",["foo"]),"_at_",[(2)]);
  62. })]);
  63. $2=smalltalk.send($1,"_putBlock_",[(function(x,y){
  64. return smalltalk.send(smalltalk.send(smalltalk.send(x,"_root",[]),"_at_",["foo"]),"_at_put_",[(2),y]);
  65. })]);
  66. model=$2;
  67. smalltalk.send(bb,"_model_modify_",[model,(function(r){
  68. return smalltalk.symbolFor("new");
  69. })]);
  70. smalltalk.send(bb,"_model_read_",[model,(function(r){
  71. result=r;
  72. return result;
  73. })]);
  74. smalltalk.send(self,"_assert_equals_",[smalltalk.symbolFor("new"),result]);
  75. smalltalk.send(bb,"_model_read_",[self["@rootModel"],(function(r){
  76. result=r;
  77. return result;
  78. })]);
  79. smalltalk.send(self,"_assert_equals_",[smalltalk.HashedCollection._fromPairs_([smalltalk.send("foo","__minus_gt",[["bar", smalltalk.symbolFor("new"), "baz"]]),smalltalk.send("moo","__minus_gt",["zoo"])]),result]);
  80. return self}
  81. }),
  82. smalltalk.IsolatorTest);
  83. smalltalk.addMethod(
  84. "_testNontrivialModelReturnsAppropriateValue",
  85. smalltalk.method({
  86. selector: "testNontrivialModelReturnsAppropriateValue",
  87. fn: function (){
  88. var self=this;
  89. var bb;
  90. var model;
  91. var result;
  92. bb=smalltalk.send((smalltalk.Isolator || Isolator),"_on_",[smalltalk.HashedCollection._fromPairs_([smalltalk.send("foo","__minus_gt",[["bar", [(1), [(2), (3)]], "baz"]]),smalltalk.send("moo","__minus_gt",["zoo"])])]);
  93. model=smalltalk.send(smalltalk.send((smalltalk.EavModel || EavModel),"_new",[]),"_getBlock_",[(function(x){
  94. return smalltalk.send(smalltalk.send(smalltalk.send(x,"_root",[]),"_at_",["foo"]),"_at_",[(2)]);
  95. })]);
  96. smalltalk.send(bb,"_model_read_",[model,(function(r){
  97. result=r;
  98. return result;
  99. })]);
  100. smalltalk.send(self,"_assert_equals_",[[(1), [(2), (3)]],result]);
  101. return self}
  102. }),
  103. smalltalk.IsolatorTest);
  104. smalltalk.addMethod(
  105. "_testRootModelExaminesThenModifiesRoot",
  106. smalltalk.method({
  107. selector: "testRootModelExaminesThenModifiesRoot",
  108. fn: function (){
  109. var self=this;
  110. var bb;
  111. var result;
  112. bb=smalltalk.send((smalltalk.Isolator || Isolator),"_on_",[[(1), [(2), (3)]]]);
  113. smalltalk.send(bb,"_model_modify_",[self["@rootModel"],(function(r){
  114. return smalltalk.send(r,"_second",[]);
  115. })]);
  116. smalltalk.send(bb,"_model_read_",[self["@rootModel"],(function(r){
  117. result=r;
  118. return result;
  119. })]);
  120. smalltalk.send(self,"_assert_equals_",[[(2), (3)],result]);
  121. return self}
  122. }),
  123. smalltalk.IsolatorTest);
  124. smalltalk.addMethod(
  125. "_testRootModelGetsRootForModification",
  126. smalltalk.method({
  127. selector: "testRootModelGetsRootForModification",
  128. fn: function (){
  129. var self=this;
  130. var bb;
  131. var result;
  132. bb=smalltalk.send((smalltalk.Isolator || Isolator),"_on_",[[(2), [(1), (0)]]]);
  133. smalltalk.send(bb,"_model_modify_",[self["@rootModel"],(function(r){
  134. result=r;
  135. return result;
  136. })]);
  137. smalltalk.send(self,"_assert_equals_",[[(2), [(1), (0)]],result]);
  138. return self}
  139. }),
  140. smalltalk.IsolatorTest);
  141. smalltalk.addMethod(
  142. "_testRootModelModifiesAndDeeplyIsolatesInPlaceModifiedRoot",
  143. smalltalk.method({
  144. selector: "testRootModelModifiesAndDeeplyIsolatesInPlaceModifiedRoot",
  145. fn: function (){
  146. var self=this;
  147. var bb;
  148. var result;
  149. var newValue;
  150. bb=smalltalk.send((smalltalk.Isolator || Isolator),"_on_",[[(1), [(2), (3)]]]);
  151. smalltalk.send(bb,"_model_modify_",[self["@rootModel"],(function(r){
  152. newValue=r;
  153. newValue;
  154. smalltalk.send(r,"_at_put_",[(1),(4)]);
  155. return r;
  156. })]);
  157. smalltalk.send(newValue,"_at_put_",[(2),"bar"]);
  158. smalltalk.send(bb,"_model_read_",[self["@rootModel"],(function(r){
  159. result=r;
  160. return result;
  161. })]);
  162. smalltalk.send(newValue,"_at_put_",[(2),"baz"]);
  163. smalltalk.send(self,"_assert_equals_",[[(4), [(2), (3)]],result]);
  164. return self}
  165. }),
  166. smalltalk.IsolatorTest);
  167. smalltalk.addMethod(
  168. "_testRootModelModifiesAndDeeplyIsolatesRoot",
  169. smalltalk.method({
  170. selector: "testRootModelModifiesAndDeeplyIsolatesRoot",
  171. fn: function (){
  172. var self=this;
  173. var bb;
  174. var result;
  175. var newValue;
  176. bb=smalltalk.send((smalltalk.Isolator || Isolator),"_on_",[[(1), [(2), (3)]]]);
  177. newValue=smalltalk.HashedCollection._fromPairs_([smalltalk.send("foo","__minus_gt",[[(4), (5), (6)]])]);
  178. smalltalk.send(bb,"_model_modify_",[self["@rootModel"],(function(r){
  179. return newValue;
  180. })]);
  181. smalltalk.send(smalltalk.send(newValue,"_at_",["foo"]),"_at_put_",[(1),"bar"]);
  182. smalltalk.send(bb,"_model_read_",[self["@rootModel"],(function(r){
  183. result=r;
  184. return result;
  185. })]);
  186. smalltalk.send(smalltalk.send(newValue,"_at_",["foo"]),"_at_put_",[(3),"baz"]);
  187. smalltalk.send(self,"_assert_equals_",[smalltalk.HashedCollection._fromPairs_([smalltalk.send("foo","__minus_gt",[[(4), (5), (6)]])]),result]);
  188. return self}
  189. }),
  190. smalltalk.IsolatorTest);
  191. smalltalk.addMethod(
  192. "_testRootModelModifiesAndIsolatesRoot",
  193. smalltalk.method({
  194. selector: "testRootModelModifiesAndIsolatesRoot",
  195. fn: function (){
  196. var self=this;
  197. var bb;
  198. var result;
  199. var newValue;
  200. bb=smalltalk.send((smalltalk.Isolator || Isolator),"_on_",[[(1), [(2), (3)]]]);
  201. newValue=smalltalk.HashedCollection._fromPairs_([smalltalk.send("foo","__minus_gt",[[(4), (5), (6)]])]);
  202. smalltalk.send(bb,"_model_modify_",[self["@rootModel"],(function(r){
  203. return newValue;
  204. })]);
  205. smalltalk.send(newValue,"_at_put_",["foo","bar"]);
  206. smalltalk.send(bb,"_model_read_",[self["@rootModel"],(function(r){
  207. result=r;
  208. return result;
  209. })]);
  210. smalltalk.send(newValue,"_at_put_",["foo","baz"]);
  211. smalltalk.send(self,"_assert_equals_",[smalltalk.HashedCollection._fromPairs_([smalltalk.send("foo","__minus_gt",[[(4), (5), (6)]])]),result]);
  212. return self}
  213. }),
  214. smalltalk.IsolatorTest);
  215. smalltalk.addMethod(
  216. "_testRootModelModifiesRoot",
  217. smalltalk.method({
  218. selector: "testRootModelModifiesRoot",
  219. fn: function (){
  220. var self=this;
  221. var bb;
  222. var result;
  223. bb=smalltalk.send((smalltalk.Isolator || Isolator),"_on_",[[(1), [(2), (3)]]]);
  224. smalltalk.send(bb,"_model_modify_",[self["@rootModel"],(function(r){
  225. return smalltalk.HashedCollection._fromPairs_([smalltalk.send("foo","__minus_gt",[[(4), (5), (6)]])]);
  226. })]);
  227. smalltalk.send(bb,"_model_read_",[self["@rootModel"],(function(r){
  228. result=r;
  229. return result;
  230. })]);
  231. smalltalk.send(self,"_assert_equals_",[smalltalk.HashedCollection._fromPairs_([smalltalk.send("foo","__minus_gt",[[(4), (5), (6)]])]),result]);
  232. return self}
  233. }),
  234. smalltalk.IsolatorTest);
  235. smalltalk.addMethod(
  236. "_testRootModelReturnsDeeplyIsolatedRoot",
  237. smalltalk.method({
  238. selector: "testRootModelReturnsDeeplyIsolatedRoot",
  239. fn: function (){
  240. var self=this;
  241. var bb;
  242. var result;
  243. bb=smalltalk.send((smalltalk.Isolator || Isolator),"_on_",[[(1), [(2), (3)]]]);
  244. smalltalk.send(bb,"_model_read_",[self["@rootModel"],(function(r){
  245. return smalltalk.send(smalltalk.send(r,"_at_",[(2)]),"_at_put_",[(1),(0)]);
  246. })]);
  247. smalltalk.send(bb,"_model_read_",[self["@rootModel"],(function(r){
  248. result=r;
  249. return result;
  250. })]);
  251. smalltalk.send(self,"_assert_equals_",[[(1), [(2), (3)]],result]);
  252. return self}
  253. }),
  254. smalltalk.IsolatorTest);
  255. smalltalk.addMethod(
  256. "_testRootModelReturnsIsolatedRoot",
  257. smalltalk.method({
  258. selector: "testRootModelReturnsIsolatedRoot",
  259. fn: function (){
  260. var self=this;
  261. var bb;
  262. var result;
  263. bb=smalltalk.send((smalltalk.Isolator || Isolator),"_on_",[[(1), [(2), (4)]]]);
  264. smalltalk.send(bb,"_model_read_",[self["@rootModel"],(function(r){
  265. return smalltalk.send(r,"_at_put_",[(2),nil]);
  266. })]);
  267. smalltalk.send(bb,"_model_read_",[self["@rootModel"],(function(r){
  268. result=r;
  269. return result;
  270. })]);
  271. smalltalk.send(self,"_assert_equals_",[[(1), [(2), (4)]],result]);
  272. return self}
  273. }),
  274. smalltalk.IsolatorTest);
  275. smalltalk.addMethod(
  276. "_testRootModelReturnsRoot",
  277. smalltalk.method({
  278. selector: "testRootModelReturnsRoot",
  279. fn: function (){
  280. var self=this;
  281. var bb;
  282. var result;
  283. bb=smalltalk.send((smalltalk.Isolator || Isolator),"_on_",[[(1), [(2), (3)]]]);
  284. smalltalk.send(bb,"_model_read_",[self["@rootModel"],(function(r){
  285. result=r;
  286. return result;
  287. })]);
  288. smalltalk.send(self,"_assert_equals_",[[(1), [(2), (3)]],result]);
  289. return self}
  290. }),
  291. smalltalk.IsolatorTest);