test: Add tests for all existing functionality, correcting issues (#9)
All checks were successful
/ test (push) Successful in 11s

Resolves #8.

Reviewed-on: #9
Co-authored-by: Glen Whitney <glen@studioinfinity.org>
Co-committed-by: Glen Whitney <glen@studioinfinity.org>
This commit is contained in:
Glen Whitney 2025-04-08 22:42:53 +00:00 committed by Glen Whitney
parent 64f99c0f2d
commit 1a6890f458
12 changed files with 298 additions and 24 deletions

View file

@ -0,0 +1,8 @@
import assert from 'assert'
import math from '#nanomath'
describe('number type operations', () => {
it('converts to number', () => {
assert.strictEqual(math.number(2.637), 2.637)
})
})

View file

@ -0,0 +1,8 @@
import assert from 'assert'
import math from '#nanomath'
describe('number utilities', () => {
it('clones a number', () => {
assert.strictEqual(math.clone(2.637), 2.637)
})
})

View file

@ -1,5 +1,7 @@
import {Returns, onType} from '#core/helpers.js'
import {Number} from './Number.js'
import {onType} from '#core/helpers.js'
import {Returns} from '#core/Type.js'
export const plain = f => onType(
Array(f.length).fill(Number), Returns(Number, f))