Add test for handling parameter names that are keywords

This commit is contained in:
Daniel Bartholomae 2022-08-23 16:07:11 +02:00
parent d97ce7eab8
commit 2cf9348f53
1 changed files with 17 additions and 0 deletions

View File

@ -49,4 +49,21 @@ Person(customerA, "Banking Customer A", "A customer of the bank, with personal b
expect(rendered).toBe(true);
});
it('should handle parameter names that are keywords', function () {
flow.parser.parse(`C4Context
title title
Person(Person, "Person", "Person")`);
const yy = flow.parser.yy;
expect(yy.getTitle()).toBe('title');
const shapes = yy.getC4ShapeArray();
expect(shapes.length).toBe(1);
const onlyShape = shapes[0];
expect(onlyShape.alias).toBe('Person');
expect(onlyShape.descr.text).toBe('Person');
expect(onlyShape.label.text).toBe('Person');
});
});