diff --git a/implementations/javascript/packages/schema/src/reader.ts b/implementations/javascript/packages/schema/src/reader.ts index 233b36c..76e05ea 100644 --- a/implementations/javascript/packages/schema/src/reader.ts +++ b/implementations/javascript/packages/schema/src/reader.ts @@ -61,7 +61,7 @@ export function readSchema(source: string, { const checked = checkSchema(parseSchema(_readSchema(source, options), options ?? {})); if (checked.ok) return checked.schema; - throw new Error(`Schema does not specify a bijection:\n` + + throw new Error(`Schema is not invertible:\n` + checked.problems.map(c => ' - ' + c).join('\n')); } diff --git a/implementations/javascript/packages/schema/test/checker.test.ts b/implementations/javascript/packages/schema/test/checker.test.ts index 583355f..35920c5 100644 --- a/implementations/javascript/packages/schema/test/checker.test.ts +++ b/implementations/javascript/packages/schema/test/checker.test.ts @@ -3,17 +3,17 @@ import { Meta, readSchema } from '../src/index'; import './test-utils'; describe('checker', () => { - describe('simplest non-bijection tests', () => { - it('passes simple non-bijection test', () => { + describe('simplest invertibility tests', () => { + it('passes simple invertibility test', () => { expect(readSchema('version 1 . A = .')).not.toBeNull(); }); - it('passes non-bijection check for literal field', () => { + it('passes invertibility check for literal field', () => { expect(readSchema('version 1 . A = .')).not.toBeNull(); }); - it('detects non-bijection for string field', () => { + it('detects non-invertibility for string field', () => { expect(() => readSchema('version 1 . A = .')).toThrow(/item 0 of fields of A/); }); - it('detects non-bijection for symbol field', () => { + it('detects non-invertibility for symbol field', () => { expect(() => readSchema('version 1 . A = .')).toThrow(/item 1 of fields of A/); }); it('is OK with no names in simple seqof', () => { @@ -35,7 +35,7 @@ describe('checker', () => { >, >] >>>}}>`).next()); }); - it('non-bijection tail', () => { + it('non-invertibility tail', () => { expect(() => readSchema( 'version 1 . ExtensibleRecord = .')) .toThrow(/tail of fields of ExtensibleRecord/); diff --git a/implementations/racket/preserves/preserves-schema/checker.rkt b/implementations/racket/preserves/preserves-schema/checker.rkt index 5c92bd5..2065018 100644 --- a/implementations/racket/preserves/preserves-schema/checker.rkt +++ b/implementations/racket/preserves/preserves-schema/checker.rkt @@ -25,7 +25,7 @@ [(SimplePattern-lit _) (void)] [(? SimplePattern?) - (when (not value-available?) (problem! context "non-bijection"))] + (when (not value-available?) (problem! context "necessary information not captured"))] [(CompoundPattern-rec l f) (check-named-pattern (cons "label" context) scope l) (check-named-pattern (cons "fields" context) scope f)]