feat/e2e-testing (#31)
All checks were successful
🚀 Release / release (push) Successful in 4m7s
All checks were successful
🚀 Release / release (push) Successful in 4m7s
Reviewed-on: #31 Co-authored-by: Max Richter <max@max-richter.dev> Co-committed-by: Max Richter <max@max-richter.dev>
This commit was merged in pull request #31.
This commit is contained in:
@@ -5,7 +5,6 @@ test('encode_float', () => {
|
||||
const input = 1.23;
|
||||
const encoded = encodeFloat(input);
|
||||
const output = decodeFloat(encoded);
|
||||
console.log(input, output);
|
||||
expect(output).toBeCloseTo(input);
|
||||
});
|
||||
|
||||
|
||||
@@ -21,24 +21,6 @@ test('fastHashArray doesnt product collisions', () => {
|
||||
expect(hash_a).not.toEqual(hash_b);
|
||||
});
|
||||
|
||||
test('fastHashArray is fast(ish) < 20ms', () => {
|
||||
const a = new Int32Array(10_000);
|
||||
|
||||
const t0 = performance.now();
|
||||
fastHashArrayBuffer(a);
|
||||
|
||||
const t1 = performance.now();
|
||||
|
||||
a[0] = 1;
|
||||
|
||||
fastHashArrayBuffer(a);
|
||||
|
||||
const t2 = performance.now();
|
||||
|
||||
expect(t1 - t0).toBeLessThan(20);
|
||||
expect(t2 - t1).toBeLessThan(20);
|
||||
});
|
||||
|
||||
// test if the fastHashArray function is deterministic
|
||||
test('fastHashArray is deterministic', () => {
|
||||
const a = new Int32Array(1000);
|
||||
|
||||
@@ -8,8 +8,6 @@ test('it correctly concats nested arrays', () => {
|
||||
|
||||
const output = concatEncodedArrays([input_a, input_b, input_c]);
|
||||
|
||||
console.log('Output', output);
|
||||
|
||||
const decoded = decodeNestedArray(output);
|
||||
|
||||
expect(decoded[0]).toEqual([1, 2, 3]);
|
||||
|
||||
@@ -88,7 +88,7 @@ function decode_recursive(dense: number[] | Int32Array, index = 0) {
|
||||
dense,
|
||||
index
|
||||
);
|
||||
decoded.push(...p);
|
||||
decoded.push(p as number[]);
|
||||
index = nextIndex + 1;
|
||||
nextBracketIndex = _nextBracketIndex;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user