Skip to content

Commit

Permalink
extra test for Infinity
Browse files Browse the repository at this point in the history
  • Loading branch information
ronjouch committed Feb 22, 2024
1 parent 84201c7 commit c95d61e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/LocalCache_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ describe('LocalCache', () => {
await cache.setValue('numMax', Number.MAX_SAFE_INTEGER);
expect(await cache.getValue('numMax')).to.equal(Number.MAX_SAFE_INTEGER);

await cache.setValue('numInfinity', Infinity);
expect(await cache.getValue('numInfinity')).to.equal(Infinity);

await cache.setValue('numBarf', 0.1 + 0.2); // 0.30000000000000004, IEEE754
expect(await cache.getValue('numBarf')).to.equal(0.1 + 0.2);
});
Expand Down
3 changes: 3 additions & 0 deletions test/RedisCache_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,9 @@ describe('RedisCache', () => {
await cache.setValue('numMax', Number.MAX_SAFE_INTEGER);
expect(await cache.getValue('numMax')).to.equal(Number.MAX_SAFE_INTEGER);

await cache.setValue('numInfinity', Infinity);
expect(await cache.getValue('numInfinity')).to.equal(Infinity);

await cache.setValue('numBarf', 0.1 + 0.2); // 0.30000000000000004, IEEE754
expect(await cache.getValue('numBarf')).to.equal(0.1 + 0.2);
});
Expand Down

0 comments on commit c95d61e

Please sign in to comment.