Comparison

spec/util_async_spec.lua @ 8631:1daabc077393

util.async: tests: remove obsolete code and comments
author Matthew Wild <mwild1@gmail.com>
date Mon, 19 Mar 2018 16:25:02 +0000
parent 8630:deade38ffbbd
child 8632:02b841ed03d1
comparison
equal deleted inserted replaced
8630:deade38ffbbd 8631:1daabc077393
321 r:run(1); 321 r:run(1);
322 assert(r.state == "ready"); 322 assert(r.state == "ready");
323 r:run(2); 323 r:run(2);
324 assert(r.state == "ready"); 324 assert(r.state == "ready");
325 325
326 local dones = {};
327 r:run(3); 326 r:run(3);
328 assert(r.state == "waiting"); 327 assert(r.state == "waiting");
329 r:run(3); 328 r:run(3);
330 assert(r.state == "waiting"); 329 assert(r.state == "waiting");
331 r:run(3); 330 r:run(3);
360 r:run(1); 359 r:run(1);
361 assert(r.state == "ready"); 360 assert(r.state == "ready");
362 r:run(2); 361 r:run(2);
363 assert(r.state == "ready"); 362 assert(r.state == "ready");
364 363
365 local dones = {};
366 r:run(3); 364 r:run(3);
367 assert(r.state == "waiting"); 365 assert(r.state == "waiting");
368 r:run(3); 366 r:run(3);
369 assert(r.state == "waiting"); 367 assert(r.state == "waiting");
370 368
412 r1:run(1); 410 r1:run(1);
413 assert(r1.state == "ready"); 411 assert(r1.state == "ready");
414 r1:run(2); 412 r1:run(2);
415 assert(r1.state == "ready"); 413 assert(r1.state == "ready");
416 414
417 local dones = {};
418 r1:run(3); 415 r1:run(3);
419 assert(r1.state == "waiting"); 416 assert(r1.state == "waiting");
420 r1:run(3); 417 r1:run(3);
421 assert(r1.state == "waiting"); 418 assert(r1.state == "waiting");
422 419
490 assert.equal(r1.state, "ready"); 487 assert.equal(r1.state, "ready");
491 488
492 r1:run(5); 489 r1:run(5);
493 assert.equal(r1.state, "ready"); 490 assert.equal(r1.state, "ready");
494 491
495 local dones = {};
496 r1:run(3); 492 r1:run(3);
497 assert.equal(r1.state, "waiting"); 493 assert.equal(r1.state, "waiting");
498 r1:run(5); -- Will error, when we get to it 494 r1:run(5); -- Will error, when we get to it
499 assert.equal(r1.state, "waiting"); 495 assert.equal(r1.state, "waiting");
500 done1(); 496 done1();
535 assert.equal(r1.state, "ready"); 531 assert.equal(r1.state, "ready");
536 r1:run(4); 532 r1:run(4);
537 assert.equal(r1.state, "ready"); 533 assert.equal(r1.state, "ready");
538 534
539 assert.equal(r1.state, "ready"); 535 assert.equal(r1.state, "ready");
540 --for k, v in ipairs(l1) do print(k,v) end
541 end); 536 end);
542 537
543 it("should support multiple done() calls", function () 538 it("should support multiple done() calls", function ()
544 local processed_item; 539 local processed_item;
545 local wait, done; 540 local wait, done;