fix: abstract field doesnt make any sense

This commit is contained in:
Xavier Stouder
2021-08-26 11:00:39 +02:00
parent c0c978bbdf
commit 8a8f792d4b
2 changed files with 4 additions and 12 deletions

View File

@@ -274,7 +274,7 @@ export const drawClass = function (elem, classDef, conf) {
};
export const parseMember = function (text) {
const fieldRegEx = /^(\+|-|~|#)?(\w+)(~\w+~|\[\])?\s+(\w+) *(\*|\$)?$/;
const fieldRegEx = /^(\+|-|~|#)?(\w+)(~\w+~|\[\])?\s+(\w+) *(\$)?$/;
const methodRegEx = /^([+|\-|~|#])?(\w+) *\( *(.*)\) *(\*|\$)? *(\w*[~|[\]]*\s*\w*~?)$/;
let fieldMatch = text.match(fieldRegEx);

View File

@@ -51,7 +51,7 @@ describe('class member Renderer, ', function () {
expect(actual.cssStyle).toBe('');
});
it('should handle abstract classifier', function () {
it('should handle abstract method classifier', function () {
const str = 'foo()*';
let actual = svgDraw.parseMember(str);
@@ -59,7 +59,7 @@ describe('class member Renderer, ', function () {
expect(actual.cssStyle).toBe('font-style:italic;');
});
it('should handle static classifier', function () {
it('should handle static method classifier', function () {
const str = 'foo()$';
let actual = svgDraw.parseMember(str);
@@ -157,15 +157,7 @@ describe('class member Renderer, ', function () {
expect(actual.cssStyle).toBe('');
});
it('should handle abstract classifier', function () {
const str = 'String foo*';
let actual = svgDraw.parseMember(str);
expect(actual.displayText).toBe('String foo');
expect(actual.cssStyle).toBe('font-style:italic;');
});
it('should handle static classifier', function () {
it('should handle static field classifier', function () {
const str = 'String foo$';
let actual = svgDraw.parseMember(str);