urbit-ob

JavaScript utilities for phonemic base wrangling.
Log | Files | Refs | README

commit 832edb62b25ca5d1a92b1d197aa1bc2eb33da49b
parent 79841236154daec9f975d595741cc383eca16878
Author: Jared Tobin <jared@jtobin.io>
Date:   Fri, 16 Nov 2018 16:52:34 +1300

Update tests.

Diffstat:
Mtest/co.test.js | 30+++++++++++++++++++++++++++++-
1 file changed, 29 insertions(+), 1 deletion(-)

diff --git a/test/co.test.js b/test/co.test.js @@ -12,7 +12,9 @@ const { patq2dec, clan, sein, - eqPatq + eqPatq, + isValidPatq, + isValidPatp } = require('../src/internal/co') const patps = jsc.uint32.smap( @@ -199,3 +201,29 @@ describe('eqPatq', () => { }) }) +describe('isValidPat{q, p}', () => { + it('isValidPatp returns true for valid @p values', () => { + expect(isValidPatp('~zod')).to.equal(true) + expect(isValidPatp('~marzod')).to.equal(true) + expect(isValidPatp('~nidsut-tomdun')).to.equal(true) + }) + + it('isValidPatp returns false for invalid @p values', () => { + expect(isValidPatp('~hu')).to.equal(false) + expect(isValidPatp('~what')).to.equal(false) + expect(isValidPatp('sudnit-duntom')).to.equal(false) + }) + + it('isValidPatq returns true for valid @p values', () => { + expect(isValidPatq('~zod')).to.equal(true) + expect(isValidPatq('~marzod')).to.equal(true) + expect(isValidPatq('~nidsut-tomdun')).to.equal(true) + expect(isValidPatq('~dozzod-binwes-nidsut-tomdun')).to.equal(true) + }) + + it('isValidPatq returns false for invalid @p values', () => { + expect(isValidPatq('~hu')).to.equal(false) + expect(isValidPatq('~what')).to.equal(false) + expect(isValidPatq('sudnit-duntom')).to.equal(false) + }) +})