forked from accordproject/concerto
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(parser): throw error when concept is extending itself in JSON met…
…amodel form Signed-off-by: Stefan Blaginov <[email protected]>
- Loading branch information
Stefan Blaginov
authored and
Stefan Blaginov
committed
Nov 22, 2023
1 parent
02da293
commit 7a9d181
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,4 +62,30 @@ describe('parser', () => { | |
declarations: [], | ||
})).should.throw(Error, 'Unrecognized import'); | ||
}); | ||
|
||
it('Should throw error for a self-extending declaration', () => { | ||
(() => Printer.toCTO({ | ||
'$class': '[email protected]', | ||
'namespace': '[email protected]', | ||
'declarations': [ | ||
{ | ||
'$class': '[email protected]', | ||
'name': 'Self_Extending', | ||
'isAbstract': false, | ||
'properties': [ | ||
{ | ||
'$class': '[email protected]', | ||
'name': 'foo', | ||
'isArray': false, | ||
'isOptional': true | ||
} | ||
], | ||
'superType': { | ||
'$class': '[email protected]', | ||
'name': 'Self_Extending' | ||
} | ||
} | ||
] | ||
})).should.throw(Error, 'The declaration "Self_Extending" cannot extend itself.'); | ||
}); | ||
}); |