mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-28 07:03:17 +08:00
#1206 Added test case to verify parsing fails to allow EOF until first '{' is closed
This commit is contained in:
parent
417d2c0336
commit
99469f8404
@ -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' +
|
||||
|
Loading…
x
Reference in New Issue
Block a user