Trapped-Tests.deploy.js 15 KB

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