#1206 Added test case to verify parsing fails to allow another '{' until first one is closed
This commit is contained in:
parent
2a3de1a090
commit
417d2c0336
|
@ -67,6 +67,29 @@ describe('class diagram, ', function () {
|
|||
parser.parse(str);
|
||||
});
|
||||
|
||||
it('should break when double { are encountered while defining generic class with brackets', function() {
|
||||
const str =
|
||||
'classDiagram\n' +
|
||||
'class Dummy_Class~T~ {\n' +
|
||||
'String data\n' +
|
||||
' void methods()\n' +
|
||||
'}\n' +
|
||||
'\n' +
|
||||
'class Dummy_Class {\n' +
|
||||
'class Flight {\n' +
|
||||
' flightNumber : Integer\n' +
|
||||
' departureTime : Date\n' +
|
||||
'}';
|
||||
let testPased =false;
|
||||
try{
|
||||
parser.parse(str);
|
||||
}catch (error){
|
||||
console.log(error.name);
|
||||
testPased = true;
|
||||
}
|
||||
expect(testPased).toBe(true);
|
||||
});
|
||||
|
||||
it('should handle generic class with brackets', function() {
|
||||
const str =
|
||||
'classDiagram\n' +
|
||||
|
@ -79,8 +102,6 @@ describe('class diagram, ', function () {
|
|||
' flightNumber : Integer\n' +
|
||||
' departureTime : Date\n' +
|
||||
'}';
|
||||
|
||||
parser.parse(str);
|
||||
});
|
||||
|
||||
it('should handle class definitions', function() {
|
||||
|
|
Loading…
Reference in New Issue