Lines Matching refs:parse

94   var d = Diagram.parse('A->B: Message');
99 var d = Diagram.parse('A-->B: Message');
104 var d = Diagram.parse('A->>B: Message');
109 var d = Diagram.parse('A-->>B: Message');
114 equal(Diagram.parse('Title: title').title, 'title', 'Title');
115 equal(Diagram.parse('Title: line1\\nline2').title, 'line1\nline2', 'Multiline Title');
119 equal(Diagram.parse('Title: 中国').title, '中国', 'Unicode Title');
120 assertEmptyDocument(Diagram.parse('# 中国'));
121 assertSingleActor(Diagram.parse('Participant 中国'), '中国');
122 assertSingleActor(Diagram.parse('Participant 中国 as alias'), 'alias', '中国');
123 assertSingleActor(Diagram.parse('中国->中国: Message'), '中国');
127 assertEmptyDocument(Diagram.parse(''));
128 assertEmptyDocument(Diagram.parse(' \t\n'));
129 assertEmptyDocument(Diagram.parse('\r\n\r\n'));
133 assertSingleArrow(Diagram.parse(' A - > B : Message '), ARROWTYPE.FILLED, LINETYPE.SOLID);
134 assertSingleArrow(Diagram.parse('\n\nA->B: Message\n\n'), ARROWTYPE.FILLED, LINETYPE.SOLID);
136 assertSingleActor(Diagram.parse(' A -> A: blah'), 'A');
141 assertEmptyDocument(Diagram.parse('#'));
142 assertEmptyDocument(Diagram.parse('# comment'));
143 assertEmptyDocument(Diagram.parse(' # comment'));
144 assertEmptyDocument(Diagram.parse('# A->B: Title'));
147 assertSingleArrow(Diagram.parse('A#->B: Message'), ARROWTYPE.FILLED, LINETYPE.SOLID, 'A#', 'B');
148 assertSingleArrow(Diagram.parse('A->B#: Message'), ARROWTYPE.FILLED, LINETYPE.SOLID, 'A', 'B#');
149 assertSingleArrow(Diagram.parse('A->B: Message # not a comment'), ARROWTYPE.FILLED,
152 equal(Diagram.parse('Title: title # not a comment').title, 'title # not a comment');
153 assertSingleNote(Diagram.parse('note left of A: Message # not a comment'), PLACEMENT.LEFTOF, 'A',
158 assertSingleNote(Diagram.parse('Note left of A: Message'), PLACEMENT.LEFTOF, 'A');
159 assertSingleNote(Diagram.parse('Note right of A: Message'), PLACEMENT.RIGHTOF, 'A');
160 assertSingleNote(Diagram.parse('Note over A: Message'), PLACEMENT.OVER, 'A');
161 assertSingleNote(Diagram.parse('Note over A,B: Message'), PLACEMENT.OVER, ['A', 'B']);
164 assertSingleNote(Diagram.parse('Note over C as A,B: Message'), PLACEMENT.OVER, ['C as A', 'B']);
168 assertSingleActor(Diagram.parse('Participant Bob'), 'Bob');
169 assertSingleActor(Diagram.parse('Participant Name with spaces'), 'Name with spaces');
170 assertSingleActor(Diagram.parse('Participant Name with spaces as alias'),
172 assertSingleActor(Diagram.parse('Participant Name with \'as\' in it'), 'Name with \'as\' in it');
173 assertSingleActor(Diagram.parse('Participant Double as as alias'), 'alias', 'Double as');
174 assertSingleActor(Diagram.parse('Participant Bob \\n with newline'), 'Bob \n with newline');
175 assertSingleActor(Diagram.parse('Participant Bob \\n with newline as alias'),
177 assertSingleActor(Diagram.parse('Participant Object'), 'Object');
181 assertSingleActor(Diagram.parse('Participant A\nNote left of A: Hello'), 'A');
182 assertSingleActor(Diagram.parse('Participant A\rNote left of A: Hello'), 'A');
183 assertSingleActor(Diagram.parse('Participant A\r\nNote left of A: Hello'), 'A');
187 assertSingleArrow(Diagram.parse('"->:"->B: M'), ARROWTYPE.FILLED, LINETYPE.SOLID,
189 assertSingleArrow(Diagram.parse('A->"->:": M'), ARROWTYPE.FILLED, LINETYPE.SOLID,
191 assertSingleActor(Diagram.parse('Participant "->:"'), '->:');
196 ok(typeof Diagram.parse == 'function');
198 var d = Diagram.parse('Participant A');