diff --git a/packages/concerto-cto/test/cto/bad/map.bad.cto b/packages/concerto-cto/test/cto/bad/map.bad.cto new file mode 100644 index 000000000..8d4c164bb --- /dev/null +++ b/packages/concerto-cto/test/cto/bad/map.bad.cto @@ -0,0 +1,11 @@ +namespace com.acme@1.0.0 + +map Library { + o String + o String + o Dictionary +} + +concept Concept { + o Library library +} diff --git a/packages/concerto-cto/test/parserMain.js b/packages/concerto-cto/test/parserMain.js index a0b0c58a2..b7c29560c 100644 --- a/packages/concerto-cto/test/parserMain.js +++ b/packages/concerto-cto/test/parserMain.js @@ -65,6 +65,15 @@ describe('parser', () => { ); }); + describe('maps', () => { + it('Should not parse bad map type', () => { + let content = fs.readFileSync('./test/cto/bad/map.bad.cto', 'utf8'); + (() => { + Parser.parse(content); + }).should.throw(/Expected .+ but /); + }); + }); + describe('identifiers', () => { const acceptedIdentifiers = [