Skip to content

Commit

Permalink
Fixed unit tests. They didn't work, because of the structure change f…
Browse files Browse the repository at this point in the history
…or title
  • Loading branch information
StefRave committed Aug 29, 2015
1 parent 76d3680 commit 3c15cd6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/grammar-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,12 @@ test( "Dashed Open Arrow", function() {
});

test( "Titles", function() {
equal(Diagram.parse("Title: title").title, "title", "Title");
equal(Diagram.parse("Title: line1\\nline2").title, "line1\nline2", "Multiline Title");
deepEqual(Diagram.parse("Title: title").title, {message:"title", lineno: 0}, "Title");
deepEqual(Diagram.parse("Title: line1\\nline2").title, {message:"line1\nline2", lineno: 0}, "Multiline Title");
});

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

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

Expand Down Expand Up @@ -194,4 +194,4 @@ test( "API", function() {
ok(typeof d.getActorWithAlias == "function");
ok(typeof d.setTitle == "function");
ok(typeof d.addSignal == "function");
});
});

0 comments on commit 3c15cd6

Please sign in to comment.