diff --git a/tests/sequence/comment-align/.gitignore b/tests/sequence/comment-align/.gitignore new file mode 100644 index 0000000..40223be --- /dev/null +++ b/tests/sequence/comment-align/.gitignore @@ -0,0 +1,4 @@ +# generated by tytanic, do not edit + +diff/** +out/** diff --git a/tests/sequence/comment-align/ref/1.png b/tests/sequence/comment-align/ref/1.png new file mode 100644 index 0000000..c3a1f6c Binary files /dev/null and b/tests/sequence/comment-align/ref/1.png differ diff --git a/tests/sequence/comment-align/ref/2.png b/tests/sequence/comment-align/ref/2.png new file mode 100644 index 0000000..9823f8b Binary files /dev/null and b/tests/sequence/comment-align/ref/2.png differ diff --git a/tests/sequence/comment-align/test.typ b/tests/sequence/comment-align/test.typ new file mode 100644 index 0000000..f69d949 --- /dev/null +++ b/tests/sequence/comment-align/test.typ @@ -0,0 +1,57 @@ +#set page(width: auto, height: auto) +#import "/src/lib.typ": * + +#diagram({ + _par("alice", display-name: "Alice") + _par("bob", display-name: "Bob") + _seq("alice", "bob", comment: "This is a very long comment") + + // Left to right + _seq("alice", "bob", comment: "Start aligned", comment-align: "start") + _seq("alice", "bob", comment: "End aligned", comment-align: "end") + _seq("alice", "bob", comment: "Left aligned", comment-align: "left") + _seq("alice", "bob", comment: "Right aligned", comment-align: "right") + _seq("alice", "bob", comment: "Centered", comment-align: "center") + _gap() + + // Right to left + _seq("bob", "alice", comment: "Start aligned", comment-align: "start") + _seq("bob", "alice", comment: "End aligned", comment-align: "end") + _seq("bob", "alice", comment: "Left aligned", comment-align: "left") + _seq("bob", "alice", comment: "Right aligned", comment-align: "right") + _seq("bob", "alice", comment: "Centered", comment-align: "center") + _gap() + + // Slant left to right + _seq("alice", "bob", comment: "Start aligned", comment-align: "start", slant: 10) + _seq("alice", "bob", comment: "End aligned", comment-align: "end", slant: 10) + _seq("alice", "bob", comment: "Left aligned", comment-align: "left", slant: 10) + _seq("alice", "bob", comment: "Right aligned", comment-align: "right", slant: 10) + _seq("alice", "bob", comment: "Centered", comment-align: "center", slant: 10) + _gap() + + // Slant right to left + _seq("bob", "alice", comment: "Start aligned", comment-align: "start", slant: 10) + _seq("bob", "alice", comment: "End aligned", comment-align: "end", slant: 10) + _seq("bob", "alice", comment: "Left aligned", comment-align: "left", slant: 10) + _seq("bob", "alice", comment: "Right aligned", comment-align: "right", slant: 10) + _seq("bob", "alice", comment: "Centered", comment-align: "center", slant: 10) +}) + +#pagebreak() + +#diagram({ + _par("alice", display-name: "Alice") + + _seq("alice", "alice", comment: "Start aligned", comment-align: "start") + _seq("alice", "alice", comment: "End aligned", comment-align: "end") + _seq("alice", "alice", comment: "Left aligned", comment-align: "left") + _seq("alice", "alice", comment: "Right aligned", comment-align: "right") + _seq("alice", "alice", comment: "Centered", comment-align: "center") + + _seq("alice", "alice", comment: "Start aligned", comment-align: "start", flip: true) + _seq("alice", "alice", comment: "End aligned", comment-align: "end", flip: true) + _seq("alice", "alice", comment: "Left aligned", comment-align: "left", flip: true) + _seq("alice", "alice", comment: "Right aligned", comment-align: "right", flip: true) + _seq("alice", "alice", comment: "Centered", comment-align: "center", flip: true) +}) \ No newline at end of file diff --git a/tests/sequence/special-par/.gitignore b/tests/sequence/special-par/.gitignore new file mode 100644 index 0000000..40223be --- /dev/null +++ b/tests/sequence/special-par/.gitignore @@ -0,0 +1,4 @@ +# generated by tytanic, do not edit + +diff/** +out/** diff --git a/tests/sequence/special-par/ref/1.png b/tests/sequence/special-par/ref/1.png new file mode 100644 index 0000000..aa44644 Binary files /dev/null and b/tests/sequence/special-par/ref/1.png differ diff --git a/tests/sequence/special-par/test.typ b/tests/sequence/special-par/test.typ new file mode 100644 index 0000000..2710cb3 --- /dev/null +++ b/tests/sequence/special-par/test.typ @@ -0,0 +1,12 @@ +#set page(width: auto, height: auto) +#import "/src/lib.typ": * + +#diagram({ + _seq("?", "Alice", comment: [?->\ *short* to actor1]) + _seq("[", "Alice", comment: [\[->\ *from start* to actor1]) + _seq("[", "Bob", comment: [\[->\ *from start* to actor2]) + _seq("?", "Bob", comment: [?->\ *short* to actor2]) + _seq("Alice", "]", comment: [->\]\ from actor1 *to end*]) + _seq("Alice", "?", comment: [->?\ *short* from actor1]) + _seq("Alice", "Bob", comment: [->\ from actor1 to actor2]) +}) diff --git a/tests/sequence/tips/.gitignore b/tests/sequence/tips/.gitignore new file mode 100644 index 0000000..40223be --- /dev/null +++ b/tests/sequence/tips/.gitignore @@ -0,0 +1,4 @@ +# generated by tytanic, do not edit + +diff/** +out/** diff --git a/tests/sequence/tips/ref/1.png b/tests/sequence/tips/ref/1.png new file mode 100644 index 0000000..c3753c5 Binary files /dev/null and b/tests/sequence/tips/ref/1.png differ diff --git a/tests/sequence/tips/ref/2.png b/tests/sequence/tips/ref/2.png new file mode 100644 index 0000000..7bba0e4 Binary files /dev/null and b/tests/sequence/tips/ref/2.png differ diff --git a/tests/sequence/tips/ref/3.png b/tests/sequence/tips/ref/3.png new file mode 100644 index 0000000..85bc2c2 Binary files /dev/null and b/tests/sequence/tips/ref/3.png differ diff --git a/tests/sequence/tips/test.typ b/tests/sequence/tips/test.typ new file mode 100644 index 0000000..e3d60bd --- /dev/null +++ b/tests/sequence/tips/test.typ @@ -0,0 +1,84 @@ +#set page(width: auto, height: auto) +#import "/src/lib.typ": * + +#diagram({ + _par("a", display-name: "Alice") + _par("b", display-name: "Bob") + + _seq("a", "b", end-tip: ">", comment: `->`) + _seq("a", "b", end-tip: ">>", comment: `->>`) + _seq("a", "b", end-tip: "\\", comment: `-\`) + _seq("a", "b", end-tip: "\\\\", comment: `-\\`) + _seq("a", "b", end-tip: "/", comment: `-/`) + _seq("a", "b", end-tip: "//", comment: `-//`) + _seq("a", "b", end-tip: "x", comment: `->x`) + _seq("a", "b", start-tip: "x", comment: `x->`) + _seq("a", "b", start-tip: "o", comment: `o->`) + _seq("a", "b", end-tip: ("o", ">"), comment: `->o`) + _seq("a", "b", start-tip: "o", end-tip: ("o", ">"), comment: `o->o`) + _seq("a", "b", start-tip: ">", end-tip: ">", comment: `<->`) + _seq("a", "b", start-tip: ("o", ">"), end-tip: ("o", ">"), comment: `o<->o`) + _seq("a", "b", start-tip: "x", end-tip: "x", comment: `x<->x`) + _seq("a", "b", end-tip: ("o", ">>"), comment: `->>o`) + _seq("a", "b", end-tip: ("o", "\\"), comment: `-\o`) + _seq("a", "b", end-tip: ("o", "\\\\"), comment: `-\\o`) + _seq("a", "b", end-tip: ("o", "/"), comment: `-/o`) + _seq("a", "b", end-tip: ("o", "//"), comment: `-//o`) + _seq("a", "b", start-tip: "x", end-tip: ("o", ">"), comment: `x->o`) +}) + +#pagebreak() + +#diagram({ + _par("a", display-name: "Alice") + _par("b", display-name: "Bob") + + _seq("b", "a", end-tip: ">", comment: `->`) + _seq("b", "a", end-tip: ">>", comment: `->>`) + _seq("b", "a", end-tip: "\\", comment: `-\`) + _seq("b", "a", end-tip: "\\\\", comment: `-\\`) + _seq("b", "a", end-tip: "/", comment: `-/`) + _seq("b", "a", end-tip: "//", comment: `-//`) + _seq("b", "a", end-tip: "x", comment: `->x`) + _seq("b", "a", start-tip: "x", comment: `x->`) + _seq("b", "a", start-tip: "o", comment: `o->`) + _seq("b", "a", end-tip: ("o", ">"), comment: `->o`) + _seq("b", "a", start-tip: "o", end-tip: ("o", ">"), comment: `o->o`) + _seq("b", "a", start-tip: ">", end-tip: ">", comment: `<->`) + _seq("b", "a", start-tip: ("o", ">"), end-tip: ("o", ">"), comment: `o<->o`) + _seq("b", "a", start-tip: "x", end-tip: "x", comment: `x<->x`) + _seq("b", "a", end-tip: ("o", ">>"), comment: `->>o`) + _seq("b", "a", end-tip: ("o", "\\"), comment: `-\o`) + _seq("b", "a", end-tip: ("o", "\\\\"), comment: `-\\o`) + _seq("b", "a", end-tip: ("o", "/"), comment: `-/o`) + _seq("b", "a", end-tip: ("o", "//"), comment: `-//o`) + _seq("b", "a", start-tip: "x", end-tip: ("o", ">"), comment: `x->o`) +}) + +#pagebreak() + +#diagram({ + _par("a", display-name: "Alice") + _par("b", display-name: "Bob") + + _seq("a", "a", end-tip: ">", comment: `->`) + _seq("a", "a", end-tip: ">>", comment: `->>`) + _seq("a", "a", end-tip: "\\", comment: `-\`) + _seq("a", "a", end-tip: "\\\\", comment: `-\\`) + _seq("a", "a", end-tip: "/", comment: `-/`) + _seq("a", "a", end-tip: "//", comment: `-//`) + _seq("a", "a", end-tip: "x", comment: `->x`) + _seq("a", "a", start-tip: "x", comment: `x->`) + _seq("a", "a", start-tip: "o", comment: `o->`) + _seq("a", "a", end-tip: ("o", ">"), comment: `->o`) + _seq("a", "a", start-tip: "o", end-tip: ("o", ">"), comment: `o->o`) + _seq("a", "a", start-tip: ">", end-tip: ">", comment: `<->`) + _seq("a", "a", start-tip: ("o", ">"), end-tip: ("o", ">"), comment: `o<->o`) + _seq("a", "a", start-tip: "x", end-tip: "x", comment: `x<->x`) + _seq("a", "a", end-tip: ("o", ">>"), comment: `->>o`) + _seq("a", "a", end-tip: ("o", "\\"), comment: `-\o`) + _seq("a", "a", end-tip: ("o", "\\\\"), comment: `-\\o`) + _seq("a", "a", end-tip: ("o", "/"), comment: `-/o`) + _seq("a", "a", end-tip: ("o", "//"), comment: `-//o`) + _seq("a", "a", start-tip: "x", end-tip: ("o", ">"), comment: `x->o`) +})