Skip to content

Commit dc1c21d

Browse files
authored
Update warp tests (#18)
1 parent b6fb08a commit dc1c21d

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

tests/warp.test.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,14 @@ describe('normalizeGamma', () => {
2121
}
2222

2323
it('is periodic with period 2*PI_OVER_5', () => {
24-
const gamma1 = PI_OVER_5 as Radians;
25-
const gamma2 = (gamma1 + 2 * PI_OVER_5) as Radians;
26-
const normalized1 = normalizeGamma(gamma1);
27-
const normalized2 = normalizeGamma(gamma2);
28-
expect(normalized1).toBeCloseTo(normalized2);
24+
const TEST_VALUES = [-0.977, -0.72, 0.3, 0, 0.01, 0.14, 0.333, 0.5, 0.6198123, 0.77, 0.9];
25+
for (const value of TEST_VALUES) {
26+
const gamma1 = (value * PI_OVER_5) as Radians;
27+
const gamma2 = (gamma1 + 2 * PI_OVER_5) as Radians;
28+
const normalized1 = normalizeGamma(gamma1);
29+
const normalized2 = normalizeGamma(gamma2);
30+
expect(normalized1).toBeCloseTo(normalized2);
31+
}
2932
});
3033
});
3134

0 commit comments

Comments
 (0)