#1206 Added test case to verify parsing fails to allow EOF until first '{' is closed

This commit is contained in:
Ashish Jain 2020-01-15 20:34:41 +01:00
parent 417d2c0336
commit 99469f8404

View File

@ -67,7 +67,7 @@ describe('class diagram, ', function () {
parser.parse(str);
});
it('should break when double { are encountered while defining generic class with brackets', function() {
it('should break when another `{`is encountered before closing the first one while defining generic class with brackets', function() {
const str =
'classDiagram\n' +
'class Dummy_Class~T~ {\n' +
@ -90,6 +90,25 @@ describe('class diagram, ', function () {
expect(testPased).toBe(true);
});
it('should break when EOF is encountered before closing the first `{` 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';
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' +