-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<!-- ELLIPSIS_HIDDEN --> > [!IMPORTANT] > Fix TypeScript errors, add `true-unit-tests.spec.js`, and update `test:node` script in `package.json`. > > - **Tests**: > - Add `true-unit-tests.spec.js` to test `dictionaryFromArrays` function with curried and uncurried inputs. > - **Scripts**: > - Update `test:node` script in `package.json` to include `true-unit-tests.spec.js`. > - **Imports**: > - Remove unused imports in `selection.ts`. > - Add `DataProps` import in `utilityFunctions.ts`. > - **Code Cleanup**: > - Remove unused variable `start` in `regl_rendering.ts`. > - Comment out unused `ffs` function in `utilityFunctions.ts`. > > <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=nomic-ai/deepscatter#150)<sup> for da4b62d. It will automatically update as commits are pushed.</sup> <!-- ELLIPSIS_HIDDEN -->
- Loading branch information
Showing
5 changed files
with
49 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { dictionaryFromArrays } from 'deepscatter'; | ||
|
||
import { test } from 'uvu'; | ||
import * as assert from 'uvu/assert'; | ||
|
||
test('Dictionary from arrays uncurried', async () => { | ||
const vec = dictionaryFromArrays( | ||
['a', 'b', 'c'], | ||
new Int16Array([0, 0, 0, 1]), | ||
); | ||
assert.is(vec.length, 4); | ||
assert.is(vec.get(0), 'a'); | ||
assert.is(vec.get(3), 'b'); | ||
}); | ||
|
||
test('Dictionary from arrays curried', async () => { | ||
const dictionator = dictionaryFromArrays(['a', 'b', 'c']); | ||
const vec = dictionator(new Int16Array([0, 0, 0, 1])); | ||
|
||
const unCurriedVec = dictionaryFromArrays( | ||
['a', 'b', 'c'], | ||
new Int16Array([0, 0, 0, 1]), | ||
); | ||
for (let i = 0; i < 4; i++) { | ||
assert.is(vec.get(i), unCurriedVec.get(i)); | ||
} | ||
}); | ||
|
||
test.run(); |