Tests count calendar months, not 30 days (#257)
This commit is contained in:
parent
3501a642a2
commit
d93d598d01
2 changed files with 4 additions and 4 deletions
|
|
@ -228,9 +228,9 @@ test('payday money floaters fade after a long pause instead of piling up', () =>
|
|||
run(2000);
|
||||
assert.equal(ev('FLOATS.length'), 0, 'floaters from building the network have faded');
|
||||
ev('UI.speed=0;__clk+=600000;frame(__clk)');
|
||||
ev('while(S.day%30!==29)dayTick();UI.speed=1;acc=DAY_MS');
|
||||
ev('while(cal(S.day+1).d!==1)dayTick();UI.speed=1;acc=DAY_MS');
|
||||
run(16);
|
||||
assert.equal(ev('S.day%30'), 0);
|
||||
assert.equal(ev('cal(S.day).d'), 1, 'the first of a month');
|
||||
assert.ok(ev('FLOATS.length') > 0, 'payday shows the money');
|
||||
run(2000);
|
||||
assert.equal(ev('FLOATS.length'), 0, 'and it fades within two seconds of play');
|
||||
|
|
|
|||
|
|
@ -193,7 +193,7 @@ test('the monthly budget cap and the cash floor stop the intern; a new month res
|
|||
shift(ev);
|
||||
assert.equal(cash(ev), c1, 'the same month: nothing more');
|
||||
// The next step (four 100G members to 400G, $16k) never fits a $10k month; the budget still starts again.
|
||||
ev('S.day+=30;S.ops.cap.transit=50000');
|
||||
ev('S.day+=monLen(S.day);S.ops.cap.transit=50000');
|
||||
shift(ev);
|
||||
assert.ok(cash(ev) < c1, 'a new month, a new budget');
|
||||
assert.equal(ev('S.ops.spent.transit'), c1 - cash(ev), 'counted from zero');
|
||||
|
|
@ -545,7 +545,7 @@ test('caches: the cash floor and a running-cost budget hold; the panel and the l
|
|||
assert.match(txt, /each box costs \$400\/mo/);
|
||||
assert.match(txt, /Adds at most: \+\$1\.0k\/mo/);
|
||||
assert.match(txt, /This month: \$0 up front, \+\$800\/mo on the bill/);
|
||||
ev('S.day+=30;S.ops.cap.caches=0'); shift(ev);
|
||||
ev('S.day+=monLen(S.day);S.ops.cap.caches=0'); shift(ev);
|
||||
assert.equal(ev('S.ops.addMo.caches'), (ev('S.caches.length') - 2) * 400, 'a new month counts from zero');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue