Trapped-Tests.js 20 KB

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