fix(compiler): allow numbers for ICU message cases in lexer (#18095)

Closes #18095
Fixes #17799
This commit is contained in:
Olivier Combe
2017-07-13 13:55:15 +02:00
committed by Miško Hevery
parent 15a3e2d307
commit a3a54299af
5 changed files with 29 additions and 15 deletions

View File

@ -363,6 +363,11 @@ export function main() {
]);
});
it('should support ICU expressions with cases that contain numbers', () => {
const p = parser.parse(`{sex, select, male {m} female {f} 0 {other}}`, 'TestComp', true);
expect(p.errors.length).toEqual(0);
});
it('should error when expansion case is not closed', () => {
const p = parser.parse(`{messages.length, plural, =0 {one`, 'TestComp', true);
expect(humanizeErrors(p.errors)).toEqual([