Skip to content

Commit 3c15cd6

Browse files
committed
Fixed unit tests. They didn't work, because of the structure change for title
1 parent 76d3680 commit 3c15cd6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/grammar-tests.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,12 @@ test( "Dashed Open Arrow", function() {
112112
});
113113

114114
test( "Titles", function() {
115-
equal(Diagram.parse("Title: title").title, "title", "Title");
116-
equal(Diagram.parse("Title: line1\\nline2").title, "line1\nline2", "Multiline Title");
115+
deepEqual(Diagram.parse("Title: title").title, {message:"title", lineno: 0}, "Title");
116+
deepEqual(Diagram.parse("Title: line1\\nline2").title, {message:"line1\nline2", lineno: 0}, "Multiline Title");
117117
});
118118

119119
test( "Unicode", function() {
120-
equal(Diagram.parse("Title: 中国").title, "中国", "Unicode Title");
120+
deepEqual(Diagram.parse("Title: 中国").title, {message:"中国", lineno: 0}, "Unicode Title");
121121
assertEmptyDocument(Diagram.parse("# 中国"));
122122
assertSingleActor(Diagram.parse("Participant 中国"), "中国");
123123
assertSingleActor(Diagram.parse("Participant 中国 as alias"), "alias", "中国");
@@ -149,7 +149,7 @@ test( "Comments", function() {
149149
assertSingleArrow(Diagram.parse("A->B#: Message"), ARROWTYPE.FILLED, LINETYPE.SOLID, "A", "B#");
150150
assertSingleArrow(Diagram.parse("A->B: Message # not a comment"), ARROWTYPE.FILLED, LINETYPE.SOLID, "A", "B", "Message # not a comment");
151151

152-
equal(Diagram.parse("Title: title # not a comment").title, "title # not a comment");
152+
deepEqual(Diagram.parse("Title: title # not a comment").title, {message:"title # not a comment", lineno:0});
153153
assertSingleNote(Diagram.parse("note left of A: Message # not a comment"), PLACEMENT.LEFTOF, "A", "Message # not a comment");
154154
});
155155

@@ -194,4 +194,4 @@ test( "API", function() {
194194
ok(typeof d.getActorWithAlias == "function");
195195
ok(typeof d.setTitle == "function");
196196
ok(typeof d.addSignal == "function");
197-
});
197+
});

0 commit comments

Comments
 (0)