Skip to content

Commit

Permalink
test(*): negative case for map type - too many properties
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-casey committed Apr 27, 2023
1 parent 526370e commit 4296b3f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/concerto-cto/test/cto/bad/map.bad.cto
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace [email protected]

map Library {
o String
o String
o Dictionary
}

concept Concept {
o Library library
}
9 changes: 9 additions & 0 deletions packages/concerto-cto/test/parserMain.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down

0 comments on commit 4296b3f

Please sign in to comment.