urbit-ob

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

commit 5611e1716168103af993885d0d307f6773faa1ac
parent 1dd2618d2046474a5e9e322ae07be8ae8d13aaf7
Author: Jared Tobin <jared@jtobin.io>
Date:   Fri, 26 Jun 2020 11:24:50 +0400

tests: add null input test cases

Diffstat:
Mtest/co.test.js | 18++++++++++++++++++
1 file changed, 18 insertions(+), 0 deletions(-)

diff --git a/test/co.test.js b/test/co.test.js @@ -55,6 +55,16 @@ describe('patp, etc.', () => { .to.equal('~divmes-davset-holdet--sallun-salpel-taswet-holtex--watmeb-tarlun-picdet-magmes--holter-dacruc-timdet-divtud--holwet-maldut-padpel-sivtud') }) + it('patp throws on null input', () => { + let input = () => patp(null) + expect(input).to.throw() + }) + + it('hex2patp throws on null input', () => { + let input = () => hex2patp(null) + expect(input).to.throw() + }) + it('patp2hex throws on invalid patp', () => { let input = () => patp2hex('nidsut-tomdun') expect(input).to.throw() @@ -64,6 +74,8 @@ describe('patp, etc.', () => { expect(input).to.throw() input = () => patp2hex('~nidsut-dun') expect(input).to.throw() + input = () => patp2hex(null) + expect(input).to.throw() }) it('patp and patp2dec are inverses', () => { @@ -126,6 +138,8 @@ describe('patq, etc.', () => { expect(input).to.throw() input = () => patq2hex('~nidsut-dun') expect(input).to.throw() + input = () => patq2hex(null) + expect(input).to.throw() }) it('patq and patq2dec are inverses', () => { @@ -174,6 +188,8 @@ describe('clan/sein', () => { expect(input).to.throw() input = () => clan('~nid-tomdun') expect(input).to.throw() + input = () => clan(null) + expect(input).to.throw() }) it('sein works as expected', () => { @@ -194,6 +210,8 @@ describe('clan/sein', () => { expect(input).to.throw() input = () => sein('~nid-tomdun') expect(input).to.throw() + input = () => sein(null) + expect(input).to.throw() }) })