Skip to content

Commit

Permalink
chore(developer): ldml fix for update 🙀
Browse files Browse the repository at this point in the history
- hardware types isn't a fixed set anymore
- un-mothball the pertinent error type

Related to #9403, exposed during #9515 CLDR update
  • Loading branch information
srl295 committed Sep 15, 2023
1 parent 0265680 commit 28012d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
3 changes: 0 additions & 3 deletions developer/src/kmc-ldml/src/compiler/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,6 @@ export class CompilerMessages {

static Error_InvalidHardware = (o:{form: string}) => m(this.ERROR_InvalidHardware,
`layers has invalid value form=${o.form}`);
/**
* Note: may not hit this due to XML validation.
*/
static ERROR_InvalidHardware = SevError | 0x0013;

static Error_InvalidModifier = (o:{layer: string, modifier: string}) => m(this.ERROR_InvalidModifier,
Expand Down
10 changes: 4 additions & 6 deletions developer/src/kmc-ldml/test/test-layr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { assert } from 'chai';
import { LayrCompiler } from '../src/compiler/layr.js';
import { CompilerMessages } from '../src/compiler/messages.js';
import { compilerTestCallbacks, loadSectionFixture, testCompilationCases } from './helpers/index.js';
import { KMXPlus, CommonTypesMessages } from '@keymanapp/common-types';
import { KMXPlus } from '@keymanapp/common-types';
import { constants } from '@keymanapp/ldml-keyboard-constants';

import Layr = KMXPlus.Layr;
Expand Down Expand Up @@ -106,11 +106,9 @@ describe('layr', function () {
},
{
subpath: 'sections/layr/invalid-invalid-form.xml',
errors: [CommonTypesMessages.Error_SchemaValidationError({
instancePath: '/keyboard/layers/0/form',
keyword: 'enum',
message: 'must be equal to one of the allowed values',
params: `allowedValues="touch,us,iso,jis,abnt2"`}),],
errors: [CompilerMessages.Error_InvalidHardware({
form: 'holographic',
}),],
},
{
// missing layer element
Expand Down

0 comments on commit 28012d1

Please sign in to comment.