mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-28 07:03:17 +08:00
Add more tests
This commit is contained in:
parent
2f7930efb7
commit
39980322bd
@ -137,6 +137,14 @@ describe('class member Renderer, ', function () {
|
|||||||
expect(actual.displayText).toBe('+foo(List<int> ids) : List<Item>');
|
expect(actual.displayText).toBe('+foo(List<int> ids) : List<Item>');
|
||||||
expect(actual.cssStyle).toBe('font-style:italic;');
|
expect(actual.cssStyle).toBe('font-style:italic;');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should handle method declaration with nested markup', function () {
|
||||||
|
const str = '+foo ( List~List~int~~ ids )* List~List~Item~~';
|
||||||
|
let actual = svgDraw.parseMember(str);
|
||||||
|
|
||||||
|
expect(actual.displayText).toBe('+foo(List<List<int>> ids) : List<List<Item>>');
|
||||||
|
expect(actual.cssStyle).toBe('font-style:italic;');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('when parsing text to build field display string', function () {
|
describe('when parsing text to build field display string', function () {
|
||||||
|
@ -108,5 +108,11 @@ describe('generic parser', function () {
|
|||||||
it('should parse generic types', function () {
|
it('should parse generic types', function () {
|
||||||
expect(parseGenericTypes('test~T~')).toEqual('test<T>');
|
expect(parseGenericTypes('test~T~')).toEqual('test<T>');
|
||||||
expect(parseGenericTypes('test~Array~Array~string~~~')).toEqual('test<Array<Array<string>>>');
|
expect(parseGenericTypes('test~Array~Array~string~~~')).toEqual('test<Array<Array<string>>>');
|
||||||
|
expect(parseGenericTypes('test~Array~Array~string[]~~~')).toEqual(
|
||||||
|
'test<Array<Array<string[]>>>'
|
||||||
|
);
|
||||||
|
expect(parseGenericTypes('test ~Array~Array~string[]~~~')).toEqual(
|
||||||
|
'test <Array<Array<string[]>>>'
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user