mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-09-28 14:20:46 -05:00
Fix failing test
This commit is contained in:
@@ -39,26 +39,26 @@ test("no window below the kill threshold", () => {
|
||||
assert.deepEqual(scoreWindows(kills(100, 105, 110), []), []);
|
||||
assert.deepEqual(
|
||||
stripped(scoreWindows(kills(100, 105, 110), [], { minKills: 3 })),
|
||||
[windowOf(95, 114, 3, 110)],
|
||||
[windowOf(95, 113, 3, 110)],
|
||||
);
|
||||
});
|
||||
|
||||
test("a run of close kills is one window with lead and tail", () => {
|
||||
assert.deepEqual(stripped(scoreWindows(kills(100, 110, 125, 130), [])), [
|
||||
windowOf(95, 134, 4, 130),
|
||||
windowOf(95, 133, 4, 130),
|
||||
]);
|
||||
});
|
||||
|
||||
test("the clip start clamps to the stream start", () => {
|
||||
assert.deepEqual(stripped(scoreWindows(kills(2, 4, 6, 8), [])), [
|
||||
windowOf(0, 12, 4, 8),
|
||||
windowOf(0, 11, 4, 8),
|
||||
]);
|
||||
});
|
||||
|
||||
test("a long pause splits the streak", () => {
|
||||
assert.deepEqual(
|
||||
stripped(scoreWindows(kills(100, 105, 110, 115, 140, 145, 150, 155), [])),
|
||||
[windowOf(95, 119, 4, 115), windowOf(135, 159, 4, 155)],
|
||||
[windowOf(95, 118, 4, 115), windowOf(135, 158, 4, 155)],
|
||||
);
|
||||
});
|
||||
|
||||
@@ -66,13 +66,13 @@ test("a death between two kills ends the streak", () => {
|
||||
assert.deepEqual(scoreWindows(kills(100, 105, 110, 115), [107.5]), []);
|
||||
assert.deepEqual(
|
||||
stripped(scoreWindows(kills(100, 105, 110, 115, 120), [116])),
|
||||
[windowOf(95, 119, 4, 115)],
|
||||
[windowOf(95, 118, 4, 115)],
|
||||
);
|
||||
});
|
||||
|
||||
test("a death on a kill's second (a trade) counts after that kill", () => {
|
||||
assert.deepEqual(stripped(scoreWindows(kills(100, 105, 110, 115), [115])), [
|
||||
windowOf(95, 119, 4, 115),
|
||||
windowOf(95, 118, 4, 115),
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -83,7 +83,7 @@ test("a streak is cut where its clip would outgrow the cap", () => {
|
||||
maxSeconds: 60,
|
||||
}),
|
||||
),
|
||||
[windowOf(95, 149, 4, 145), windowOf(155, 209, 4, 205)],
|
||||
[windowOf(95, 148, 4, 145), windowOf(155, 208, 4, 205)],
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ describe("montageWindows", () => {
|
||||
{
|
||||
why: "a 3-splat streak within its cap",
|
||||
kills: [100, 110, 120],
|
||||
expected: [[95, 124, 3]],
|
||||
expected: [[95, 123, 3]],
|
||||
},
|
||||
{
|
||||
why: "a 3-splat streak over its cap",
|
||||
@@ -85,12 +85,12 @@ describe("montageWindows", () => {
|
||||
{
|
||||
why: "a 4-splat streak may run longer than a 3-splat one",
|
||||
kills: [100, 112, 124, 136],
|
||||
expected: [[95, 140, 4]],
|
||||
expected: [[95, 139, 4]],
|
||||
},
|
||||
{
|
||||
why: "a streak longer than the last count uses its cap",
|
||||
kills: [100, 108, 116, 124, 132, 140],
|
||||
expected: [[95, 144, 6]],
|
||||
expected: [[95, 143, 6]],
|
||||
},
|
||||
{
|
||||
why: "streaks under the minimum are left out",
|
||||
@@ -105,7 +105,7 @@ describe("montageWindows", () => {
|
||||
// all five fit 60 s; their first three alone would also fit 30 s
|
||||
const windows = montageWindows(game(100, 105, 110, 125, 140), criteria);
|
||||
|
||||
expect(spans(windows)).toEqual([[95, 144, 5]]);
|
||||
expect(spans(windows)).toEqual([[95, 143, 5]]);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user