SUnit-Tests.deploy.js 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452
  1. smalltalk.addPackage('SUnit-Tests');
  2. smalltalk.addClass('ExampleSetTest', smalltalk.TestCase, ['empty', 'full'], 'SUnit-Tests');
  3. smalltalk.addMethod(
  4. "_setUp",
  5. smalltalk.method({
  6. selector: "setUp",
  7. fn: function (){
  8. var self=this;
  9. function $Set(){return smalltalk.Set||(typeof Set=="undefined"?nil:Set)}
  10. return smalltalk.withContext(function($ctx1) {
  11. self["@empty"]=_st($Set())._new();
  12. self["@full"]=_st($Set())._with_with_((5),"abc");
  13. return self}, function($ctx1) {$ctx1.fill(self,"setUp",{},smalltalk.ExampleSetTest)})},
  14. messageSends: ["new", "with:with:"]}),
  15. smalltalk.ExampleSetTest);
  16. smalltalk.addMethod(
  17. "_testAdd",
  18. smalltalk.method({
  19. selector: "testAdd",
  20. fn: function (){
  21. var self=this;
  22. return smalltalk.withContext(function($ctx1) {
  23. _st(self["@empty"])._add_((5));
  24. _st(self)._assert_(_st(self["@empty"])._includes_((5)));
  25. return self}, function($ctx1) {$ctx1.fill(self,"testAdd",{},smalltalk.ExampleSetTest)})},
  26. messageSends: ["add:", "assert:", "includes:"]}),
  27. smalltalk.ExampleSetTest);
  28. smalltalk.addMethod(
  29. "_testGrow",
  30. smalltalk.method({
  31. selector: "testGrow",
  32. fn: function (){
  33. var self=this;
  34. return smalltalk.withContext(function($ctx1) {
  35. _st(self["@empty"])._addAll_(_st((1))._to_((100)));
  36. _st(self)._assert_equals_(_st(self["@empty"])._size(),(100));
  37. return self}, function($ctx1) {$ctx1.fill(self,"testGrow",{},smalltalk.ExampleSetTest)})},
  38. messageSends: ["addAll:", "to:", "assert:equals:", "size"]}),
  39. smalltalk.ExampleSetTest);
  40. smalltalk.addMethod(
  41. "_testIllegal",
  42. smalltalk.method({
  43. selector: "testIllegal",
  44. fn: function (){
  45. var self=this;
  46. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  47. return smalltalk.withContext(function($ctx1) {
  48. _st(self)._should_raise_((function(){
  49. return smalltalk.withContext(function($ctx2) {
  50. return _st(self["@empty"])._at_((5));
  51. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$Error());
  52. _st(self)._should_raise_((function(){
  53. return smalltalk.withContext(function($ctx2) {
  54. return _st(self["@empty"])._at_put_((5),"abc");
  55. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$Error());
  56. return self}, function($ctx1) {$ctx1.fill(self,"testIllegal",{},smalltalk.ExampleSetTest)})},
  57. messageSends: ["should:raise:", "at:", "at:put:"]}),
  58. smalltalk.ExampleSetTest);
  59. smalltalk.addMethod(
  60. "_testIncludes",
  61. smalltalk.method({
  62. selector: "testIncludes",
  63. fn: function (){
  64. var self=this;
  65. return smalltalk.withContext(function($ctx1) {
  66. _st(self)._assert_(_st(self["@full"])._includes_((5)));
  67. _st(self)._assert_(_st(self["@full"])._includes_("abc"));
  68. return self}, function($ctx1) {$ctx1.fill(self,"testIncludes",{},smalltalk.ExampleSetTest)})},
  69. messageSends: ["assert:", "includes:"]}),
  70. smalltalk.ExampleSetTest);
  71. smalltalk.addMethod(
  72. "_testOccurrences",
  73. smalltalk.method({
  74. selector: "testOccurrences",
  75. fn: function (){
  76. var self=this;
  77. return smalltalk.withContext(function($ctx1) {
  78. _st(self)._assert_equals_(_st(self["@empty"])._occurrencesOf_((0)),(0));
  79. _st(self)._assert_equals_(_st(self["@full"])._occurrencesOf_((5)),(1));
  80. _st(self["@full"])._add_((5));
  81. _st(self)._assert_equals_(_st(self["@full"])._occurrencesOf_((5)),(1));
  82. return self}, function($ctx1) {$ctx1.fill(self,"testOccurrences",{},smalltalk.ExampleSetTest)})},
  83. messageSends: ["assert:equals:", "occurrencesOf:", "add:"]}),
  84. smalltalk.ExampleSetTest);
  85. smalltalk.addMethod(
  86. "_testRemove",
  87. smalltalk.method({
  88. selector: "testRemove",
  89. fn: function (){
  90. var self=this;
  91. return smalltalk.withContext(function($ctx1) {
  92. _st(self["@full"])._remove_((5));
  93. _st(self)._assert_(_st(self["@full"])._includes_("abc"));
  94. _st(self)._deny_(_st(self["@full"])._includes_((5)));
  95. return self}, function($ctx1) {$ctx1.fill(self,"testRemove",{},smalltalk.ExampleSetTest)})},
  96. messageSends: ["remove:", "assert:", "includes:", "deny:"]}),
  97. smalltalk.ExampleSetTest);
  98. smalltalk.addClass('SUnitAsyncTest', smalltalk.TestCase, ['flag'], 'SUnit-Tests');
  99. smalltalk.addMethod(
  100. "_fakeError",
  101. smalltalk.method({
  102. selector: "fakeError",
  103. fn: function (){
  104. var self=this;
  105. return smalltalk.withContext(function($ctx1) {
  106. self["@flag"]="bad";
  107. _st(self)._timeout_((10));
  108. self["@flag"]=_st(_st(self)._async_((function(){
  109. return smalltalk.withContext(function($ctx2) {
  110. self["@flag"]="ok";
  111. self["@flag"];
  112. return _st(self)._error_("Intentional");
  113. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._valueWithTimeout_((5));
  114. return self}, function($ctx1) {$ctx1.fill(self,"fakeError",{},smalltalk.SUnitAsyncTest)})},
  115. messageSends: ["timeout:", "valueWithTimeout:", "async:", "error:"]}),
  116. smalltalk.SUnitAsyncTest);
  117. smalltalk.addMethod(
  118. "_fakeErrorFailingInTearDown",
  119. smalltalk.method({
  120. selector: "fakeErrorFailingInTearDown",
  121. fn: function (){
  122. var self=this;
  123. return smalltalk.withContext(function($ctx1) {
  124. self["@flag"]="bad";
  125. _st(self)._timeout_((10));
  126. self["@flag"]=_st(_st(self)._async_((function(){
  127. return smalltalk.withContext(function($ctx2) {
  128. return _st(self)._error_("Intentional");
  129. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._valueWithTimeout_((5));
  130. return self}, function($ctx1) {$ctx1.fill(self,"fakeErrorFailingInTearDown",{},smalltalk.SUnitAsyncTest)})},
  131. messageSends: ["timeout:", "valueWithTimeout:", "async:", "error:"]}),
  132. smalltalk.SUnitAsyncTest);
  133. smalltalk.addMethod(
  134. "_fakeFailure",
  135. smalltalk.method({
  136. selector: "fakeFailure",
  137. fn: function (){
  138. var self=this;
  139. return smalltalk.withContext(function($ctx1) {
  140. self["@flag"]="bad";
  141. _st(self)._timeout_((10));
  142. self["@flag"]=_st(_st(self)._async_((function(){
  143. return smalltalk.withContext(function($ctx2) {
  144. self["@flag"]="ok";
  145. self["@flag"];
  146. return _st(self)._assert_(false);
  147. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._valueWithTimeout_((5));
  148. return self}, function($ctx1) {$ctx1.fill(self,"fakeFailure",{},smalltalk.SUnitAsyncTest)})},
  149. messageSends: ["timeout:", "valueWithTimeout:", "async:", "assert:"]}),
  150. smalltalk.SUnitAsyncTest);
  151. smalltalk.addMethod(
  152. "_fakeMultipleTimeoutFailing",
  153. smalltalk.method({
  154. selector: "fakeMultipleTimeoutFailing",
  155. fn: function (){
  156. var self=this;
  157. return smalltalk.withContext(function($ctx1) {
  158. _st(self)._timeout_((100));
  159. _st(_st(self)._async_((function(){
  160. return smalltalk.withContext(function($ctx2) {
  161. _st(self)._timeout_((5));
  162. return _st(_st(self)._async_((function(){
  163. return smalltalk.withContext(function($ctx3) {
  164. return _st(self)._finished();
  165. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})})))._valueWithTimeout_((10));
  166. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._valueWithTimeout_((5));
  167. return self}, function($ctx1) {$ctx1.fill(self,"fakeMultipleTimeoutFailing",{},smalltalk.SUnitAsyncTest)})},
  168. messageSends: ["timeout:", "valueWithTimeout:", "async:", "finished"]}),
  169. smalltalk.SUnitAsyncTest);
  170. smalltalk.addMethod(
  171. "_fakeMultipleTimeoutPassing",
  172. smalltalk.method({
  173. selector: "fakeMultipleTimeoutPassing",
  174. fn: function (){
  175. var self=this;
  176. return smalltalk.withContext(function($ctx1) {
  177. _st(self)._timeout_((10));
  178. _st(_st(self)._async_((function(){
  179. return smalltalk.withContext(function($ctx2) {
  180. _st(self)._timeout_((20));
  181. return _st(_st(self)._async_((function(){
  182. return smalltalk.withContext(function($ctx3) {
  183. return _st(self)._finished();
  184. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})})))._valueWithTimeout_((10));
  185. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._valueWithTimeout_((5));
  186. return self}, function($ctx1) {$ctx1.fill(self,"fakeMultipleTimeoutPassing",{},smalltalk.SUnitAsyncTest)})},
  187. messageSends: ["timeout:", "valueWithTimeout:", "async:", "finished"]}),
  188. smalltalk.SUnitAsyncTest);
  189. smalltalk.addMethod(
  190. "_fakeTimeout",
  191. smalltalk.method({
  192. selector: "fakeTimeout",
  193. fn: function (){
  194. var self=this;
  195. return smalltalk.withContext(function($ctx1) {
  196. _st(self)._timeout_((4));
  197. _st(_st(self)._async_((function(){
  198. return smalltalk.withContext(function($ctx2) {
  199. return _st(self)._finished();
  200. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._valueWithTimeout_((5));
  201. return self}, function($ctx1) {$ctx1.fill(self,"fakeTimeout",{},smalltalk.SUnitAsyncTest)})},
  202. messageSends: ["timeout:", "valueWithTimeout:", "async:", "finished"]}),
  203. smalltalk.SUnitAsyncTest);
  204. smalltalk.addMethod(
  205. "_selectorSetOf_",
  206. smalltalk.method({
  207. selector: "selectorSetOf:",
  208. fn: function (aCollection){
  209. var self=this;
  210. return smalltalk.withContext(function($ctx1) {
  211. var $1;
  212. $1=_st(_st(aCollection)._collect_((function(each){
  213. return smalltalk.withContext(function($ctx2) {
  214. return _st(each)._selector();
  215. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._asSet();
  216. return $1;
  217. }, function($ctx1) {$ctx1.fill(self,"selectorSetOf:",{aCollection:aCollection},smalltalk.SUnitAsyncTest)})},
  218. messageSends: ["asSet", "collect:", "selector"]}),
  219. smalltalk.SUnitAsyncTest);
  220. smalltalk.addMethod(
  221. "_setUp",
  222. smalltalk.method({
  223. selector: "setUp",
  224. fn: function (){
  225. var self=this;
  226. return smalltalk.withContext(function($ctx1) {
  227. self["@flag"]="ok";
  228. return self}, function($ctx1) {$ctx1.fill(self,"setUp",{},smalltalk.SUnitAsyncTest)})},
  229. messageSends: []}),
  230. smalltalk.SUnitAsyncTest);
  231. smalltalk.addMethod(
  232. "_tearDown",
  233. smalltalk.method({
  234. selector: "tearDown",
  235. fn: function (){
  236. var self=this;
  237. return smalltalk.withContext(function($ctx1) {
  238. _st(self)._assert_equals_("ok",self["@flag"]);
  239. return self}, function($ctx1) {$ctx1.fill(self,"tearDown",{},smalltalk.SUnitAsyncTest)})},
  240. messageSends: ["assert:equals:"]}),
  241. smalltalk.SUnitAsyncTest);
  242. smalltalk.addMethod(
  243. "_testAsyncErrorsAndFailures",
  244. smalltalk.method({
  245. selector: "testAsyncErrorsAndFailures",
  246. fn: function (){
  247. var self=this;
  248. var suite,runner,result,assertBlock;
  249. function $TestSuiteRunner(){return smalltalk.TestSuiteRunner||(typeof TestSuiteRunner=="undefined"?nil:TestSuiteRunner)}
  250. function $ResultAnnouncement(){return smalltalk.ResultAnnouncement||(typeof ResultAnnouncement=="undefined"?nil:ResultAnnouncement)}
  251. return smalltalk.withContext(function($ctx1) {
  252. var $1,$2;
  253. suite=_st(["fakeError", "fakeErrorFailingInTearDown", "fakeFailure", "testPass"])._collect_((function(each){
  254. return smalltalk.withContext(function($ctx2) {
  255. return _st(_st(self)._class())._selector_(each);
  256. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  257. runner=_st($TestSuiteRunner())._on_(suite);
  258. _st(self)._timeout_((200));
  259. result=_st(runner)._result();
  260. assertBlock=_st(self)._async_((function(){
  261. return smalltalk.withContext(function($ctx2) {
  262. _st(self)._assert_equals_(_st(self)._selectorSetOf_(_st(result)._errors()),_st(["fakeError"])._asSet());
  263. _st(self)._assert_equals_(_st(self)._selectorSetOf_(_st(result)._failures()),_st(["fakeErrorFailingInTearDown", "fakeFailure"])._asSet());
  264. return _st(self)._finished();
  265. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  266. _st(_st(runner)._announcer())._on_do_($ResultAnnouncement(),(function(ann){
  267. return smalltalk.withContext(function($ctx2) {
  268. $1=_st(_st(ann)._result()).__eq_eq(result);
  269. if(smalltalk.assert($1)){
  270. $2=_st(_st(result)._runs()).__eq(_st(result)._total());
  271. return _st($2)._ifTrue_(assertBlock);
  272. };
  273. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  274. _st(runner)._run();
  275. return self}, function($ctx1) {$ctx1.fill(self,"testAsyncErrorsAndFailures",{suite:suite,runner:runner,result:result,assertBlock:assertBlock},smalltalk.SUnitAsyncTest)})},
  276. messageSends: ["collect:", "selector:", "class", "on:", "timeout:", "result", "async:", "assert:equals:", "selectorSetOf:", "errors", "asSet", "failures", "finished", "on:do:", "ifTrue:", "=", "total", "runs", "==", "announcer", "run"]}),
  277. smalltalk.SUnitAsyncTest);
  278. smalltalk.addMethod(
  279. "_testAsyncNeedsTimeout",
  280. smalltalk.method({
  281. selector: "testAsyncNeedsTimeout",
  282. fn: function (){
  283. var self=this;
  284. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  285. return smalltalk.withContext(function($ctx1) {
  286. _st(self)._should_raise_((function(){
  287. return smalltalk.withContext(function($ctx2) {
  288. return _st(self)._async_((function(){
  289. return smalltalk.withContext(function($ctx3) {
  290. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  291. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$Error());
  292. _st(self)._timeout_((0));
  293. _st(self)._shouldnt_raise_((function(){
  294. return smalltalk.withContext(function($ctx2) {
  295. return _st(self)._async_((function(){
  296. return smalltalk.withContext(function($ctx3) {
  297. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  298. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$Error());
  299. _st(self)._finished();
  300. return self}, function($ctx1) {$ctx1.fill(self,"testAsyncNeedsTimeout",{},smalltalk.SUnitAsyncTest)})},
  301. messageSends: ["should:raise:", "async:", "timeout:", "shouldnt:raise:", "finished"]}),
  302. smalltalk.SUnitAsyncTest);
  303. smalltalk.addMethod(
  304. "_testFinishedNeedsTimeout",
  305. smalltalk.method({
  306. selector: "testFinishedNeedsTimeout",
  307. fn: function (){
  308. var self=this;
  309. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  310. return smalltalk.withContext(function($ctx1) {
  311. _st(self)._should_raise_((function(){
  312. return smalltalk.withContext(function($ctx2) {
  313. return _st(self)._finished();
  314. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$Error());
  315. _st(self)._timeout_((0));
  316. _st(self)._shouldnt_raise_((function(){
  317. return smalltalk.withContext(function($ctx2) {
  318. return _st(self)._finished();
  319. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$Error());
  320. return self}, function($ctx1) {$ctx1.fill(self,"testFinishedNeedsTimeout",{},smalltalk.SUnitAsyncTest)})},
  321. messageSends: ["should:raise:", "finished", "timeout:", "shouldnt:raise:"]}),
  322. smalltalk.SUnitAsyncTest);
  323. smalltalk.addMethod(
  324. "_testIsAsyncReturnsCorrectValues",
  325. smalltalk.method({
  326. selector: "testIsAsyncReturnsCorrectValues",
  327. fn: function (){
  328. var self=this;
  329. return smalltalk.withContext(function($ctx1) {
  330. _st(self)._deny_(_st(self)._isAsync());
  331. _st(self)._timeout_((0));
  332. _st(self)._assert_(_st(self)._isAsync());
  333. _st(self)._finished();
  334. _st(self)._deny_(_st(self)._isAsync());
  335. return self}, function($ctx1) {$ctx1.fill(self,"testIsAsyncReturnsCorrectValues",{},smalltalk.SUnitAsyncTest)})},
  336. messageSends: ["deny:", "isAsync", "timeout:", "assert:", "finished"]}),
  337. smalltalk.SUnitAsyncTest);
  338. smalltalk.addMethod(
  339. "_testPass",
  340. smalltalk.method({
  341. selector: "testPass",
  342. fn: function (){
  343. var self=this;
  344. return smalltalk.withContext(function($ctx1) {
  345. self["@flag"]="bad";
  346. _st(self)._timeout_((10));
  347. self["@flag"]=_st(_st(self)._async_((function(){
  348. return smalltalk.withContext(function($ctx2) {
  349. _st(self)._assert_(true);
  350. _st(self)._finished();
  351. self["@flag"]="ok";
  352. return self["@flag"];
  353. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._valueWithTimeout_((5));
  354. return self}, function($ctx1) {$ctx1.fill(self,"testPass",{},smalltalk.SUnitAsyncTest)})},
  355. messageSends: ["timeout:", "valueWithTimeout:", "async:", "assert:", "finished"]}),
  356. smalltalk.SUnitAsyncTest);
  357. smalltalk.addMethod(
  358. "_testTimeouts",
  359. smalltalk.method({
  360. selector: "testTimeouts",
  361. fn: function (){
  362. var self=this;
  363. var suite,runner,result,assertBlock;
  364. function $TestSuiteRunner(){return smalltalk.TestSuiteRunner||(typeof TestSuiteRunner=="undefined"?nil:TestSuiteRunner)}
  365. function $Set(){return smalltalk.Set||(typeof Set=="undefined"?nil:Set)}
  366. function $ResultAnnouncement(){return smalltalk.ResultAnnouncement||(typeof ResultAnnouncement=="undefined"?nil:ResultAnnouncement)}
  367. return smalltalk.withContext(function($ctx1) {
  368. var $1,$2;
  369. suite=_st(["fakeTimeout", "fakeMultipleTimeoutFailing", "fakeMultipleTimeoutPassing", "testPass"])._collect_((function(each){
  370. return smalltalk.withContext(function($ctx2) {
  371. return _st(_st(self)._class())._selector_(each);
  372. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  373. runner=_st($TestSuiteRunner())._on_(suite);
  374. _st(self)._timeout_((200));
  375. result=_st(runner)._result();
  376. assertBlock=_st(self)._async_((function(){
  377. return smalltalk.withContext(function($ctx2) {
  378. _st(self)._assert_equals_(_st(self)._selectorSetOf_(_st(result)._errors()),_st($Set())._new());
  379. _st(self)._assert_equals_(_st(self)._selectorSetOf_(_st(result)._failures()),_st(["fakeMultipleTimeoutFailing", "fakeTimeout"])._asSet());
  380. return _st(self)._finished();
  381. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  382. _st(_st(runner)._announcer())._on_do_($ResultAnnouncement(),(function(ann){
  383. return smalltalk.withContext(function($ctx2) {
  384. $1=_st(_st(ann)._result()).__eq_eq(result);
  385. if(smalltalk.assert($1)){
  386. $2=_st(_st(result)._runs()).__eq(_st(result)._total());
  387. return _st($2)._ifTrue_(assertBlock);
  388. };
  389. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  390. _st(runner)._run();
  391. return self}, function($ctx1) {$ctx1.fill(self,"testTimeouts",{suite:suite,runner:runner,result:result,assertBlock:assertBlock},smalltalk.SUnitAsyncTest)})},
  392. messageSends: ["collect:", "selector:", "class", "on:", "timeout:", "result", "async:", "assert:equals:", "selectorSetOf:", "errors", "new", "failures", "asSet", "finished", "on:do:", "ifTrue:", "=", "total", "runs", "==", "announcer", "run"]}),
  393. smalltalk.SUnitAsyncTest);
  394. smalltalk.addMethod(
  395. "_testTwoAsyncPassesWithFinishedOnlyOneIsRun",
  396. smalltalk.method({
  397. selector: "testTwoAsyncPassesWithFinishedOnlyOneIsRun",
  398. fn: function (){
  399. var self=this;
  400. var x;
  401. return smalltalk.withContext(function($ctx1) {
  402. self["@flag"]="bad";
  403. _st(self)._timeout_((10));
  404. x=(0);
  405. self["@flag"]=_st(_st(self)._async_((function(){
  406. return smalltalk.withContext(function($ctx2) {
  407. _st(self)._finished();
  408. self["@flag"]="ok";
  409. self["@flag"];
  410. x=_st(x).__plus((1));
  411. x;
  412. return _st(self)._assert_equals_(x,(1));
  413. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._valueWithTimeout_((0));
  414. self["@flag"]=_st(_st(self)._async_((function(){
  415. return smalltalk.withContext(function($ctx2) {
  416. _st(self)._finished();
  417. self["@flag"]="ok";
  418. self["@flag"];
  419. x=_st(x).__plus((1));
  420. x;
  421. return _st(self)._assert_equals_(x,(1));
  422. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._valueWithTimeout_((0));
  423. return self}, function($ctx1) {$ctx1.fill(self,"testTwoAsyncPassesWithFinishedOnlyOneIsRun",{x:x},smalltalk.SUnitAsyncTest)})},
  424. messageSends: ["timeout:", "valueWithTimeout:", "async:", "finished", "+", "assert:equals:"]}),
  425. smalltalk.SUnitAsyncTest);