2022-11-03 13:54:49 +00:00
|
|
|
package e2etests
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"testing"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func testRegression(t *testing.T) {
|
2022-12-05 19:10:45 +00:00
|
|
|
tcs := []testCase{
|
2023-02-27 20:56:04 +00:00
|
|
|
{
|
|
|
|
|
// https://github.com/terrastruct/d2/issues/919
|
|
|
|
|
name: "hex-fill",
|
|
|
|
|
script: `x: {
|
|
|
|
|
style.fill: "#0D32B2"
|
|
|
|
|
}
|
|
|
|
|
`,
|
|
|
|
|
},
|
2022-12-05 19:10:45 +00:00
|
|
|
{
|
2022-12-06 21:44:59 +00:00
|
|
|
name: "dagre_special_ids",
|
2022-12-05 19:40:21 +00:00
|
|
|
script: `
|
|
|
|
|
ninety\nnine
|
|
|
|
|
eighty\reight
|
|
|
|
|
seventy\r\nseven
|
2022-12-06 21:44:59 +00:00
|
|
|
a\\yode -> there
|
|
|
|
|
a\\"ode -> there
|
|
|
|
|
a\\node -> there
|
2022-12-05 22:51:01 +00:00
|
|
|
`,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "empty_sequence",
|
|
|
|
|
script: `
|
|
|
|
|
A: hello {
|
|
|
|
|
shape: sequence_diagram
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
B: goodbye {
|
|
|
|
|
shape: sequence_diagram
|
|
|
|
|
}
|
|
|
|
|
|
2022-12-06 22:19:17 +00:00
|
|
|
A->B`,
|
2023-02-24 07:15:01 +00:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "undeclared_nested_sequence",
|
|
|
|
|
script: `shape: sequence_diagram
|
|
|
|
|
group.nested: {
|
|
|
|
|
a -> b
|
|
|
|
|
}
|
|
|
|
|
`,
|
2023-02-24 07:17:45 +00:00
|
|
|
expErr: "no actors declared in sequence diagram",
|
2023-02-24 01:20:15 +00:00
|
|
|
},
|
2023-02-25 04:17:09 +00:00
|
|
|
{
|
|
|
|
|
name: "class_font_style_sequence",
|
|
|
|
|
script: `shape: sequence_diagram
|
|
|
|
|
a: {
|
|
|
|
|
shape: class
|
|
|
|
|
style: {
|
|
|
|
|
font-color: red
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
`,
|
|
|
|
|
},
|
2023-02-24 01:20:15 +00:00
|
|
|
{
|
|
|
|
|
name: "nested_steps",
|
|
|
|
|
script: `a: {
|
|
|
|
|
a: {
|
|
|
|
|
shape: step
|
|
|
|
|
}
|
|
|
|
|
b: {
|
|
|
|
|
shape: step
|
|
|
|
|
}
|
|
|
|
|
a -> b
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
c: {
|
|
|
|
|
shape: step
|
|
|
|
|
}
|
|
|
|
|
d: {
|
|
|
|
|
shape: step
|
|
|
|
|
}
|
|
|
|
|
c -> d
|
|
|
|
|
`,
|
|
|
|
|
},
|
|
|
|
|
{
|
2022-12-06 22:19:17 +00:00
|
|
|
name: "sequence_diagram_span_cover",
|
|
|
|
|
script: `shape: sequence_diagram
|
|
|
|
|
b.1 -> b.1
|
|
|
|
|
b.1 -> b.1`,
|
2022-12-12 00:28:30 +00:00
|
|
|
}, {
|
|
|
|
|
name: "sequence_diagram_no_message",
|
|
|
|
|
script: `shape: sequence_diagram
|
|
|
|
|
a: A
|
|
|
|
|
b: B`,
|
2023-04-30 03:26:14 +00:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "root-container",
|
|
|
|
|
script: `main: {
|
|
|
|
|
x -> y
|
|
|
|
|
y <- z
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
root: {
|
|
|
|
|
x -> y
|
|
|
|
|
y <- z
|
|
|
|
|
}`,
|
2022-12-05 19:10:45 +00:00
|
|
|
},
|
2022-12-19 04:03:07 +00:00
|
|
|
{
|
|
|
|
|
name: "sequence_diagram_name_crash",
|
|
|
|
|
script: `foo: {
|
|
|
|
|
shape: sequence_diagram
|
|
|
|
|
a -> b
|
|
|
|
|
}
|
|
|
|
|
foobar: {
|
|
|
|
|
shape: sequence_diagram
|
|
|
|
|
c -> d
|
|
|
|
|
}
|
|
|
|
|
foo -> foobar`,
|
|
|
|
|
},
|
2022-12-18 01:46:52 +00:00
|
|
|
{
|
|
|
|
|
name: "sql_table_overflow",
|
|
|
|
|
script: `
|
|
|
|
|
table: sql_table_overflow {
|
|
|
|
|
shape: sql_table
|
|
|
|
|
short: loooooooooooooooooooong
|
|
|
|
|
loooooooooooooooooooong: short
|
|
|
|
|
}
|
|
|
|
|
table_constrained: sql_table_constrained_overflow {
|
|
|
|
|
shape: sql_table
|
|
|
|
|
short: loooooooooooooooooooong {
|
|
|
|
|
constraint: unique
|
|
|
|
|
}
|
|
|
|
|
loooooooooooooooooooong: short {
|
|
|
|
|
constraint: foreign_key
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-12-20 20:54:24 +00:00
|
|
|
`,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "elk_alignment",
|
|
|
|
|
script: `
|
|
|
|
|
direction: down
|
|
|
|
|
|
|
|
|
|
build_workflow: lambda-build.yaml {
|
|
|
|
|
|
|
|
|
|
push: Push to main branch {
|
|
|
|
|
style.font-size: 25
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GHA: GitHub Actions {
|
|
|
|
|
style.font-size: 25
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
S3.style.font-size: 25
|
|
|
|
|
Terraform.style.font-size: 25
|
|
|
|
|
AWS.style.font-size: 25
|
|
|
|
|
|
|
|
|
|
push -> GHA: Triggers {
|
|
|
|
|
style.font-size: 20
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GHA -> S3: Builds zip and pushes it {
|
|
|
|
|
style.font-size: 20
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
S3 <-> Terraform: Pulls zip to deploy {
|
|
|
|
|
style.font-size: 20
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Terraform -> AWS: Changes live lambdas {
|
|
|
|
|
style.font-size: 20
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
deploy_workflow: lambda-deploy.yaml {
|
|
|
|
|
|
|
|
|
|
manual: Manual Trigger {
|
|
|
|
|
style.font-size: 25
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GHA: GitHub Actions {
|
|
|
|
|
style.font-size: 25
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
AWS.style.font-size: 25
|
|
|
|
|
|
|
|
|
|
Manual -> GHA: Launches {
|
|
|
|
|
style.font-size: 20
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GHA -> AWS: Builds zip\npushes them to S3.\n\nDeploys lambdas\nusing Terraform {
|
|
|
|
|
style.font-size: 20
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
apollo_workflow: apollo-deploy.yaml {
|
|
|
|
|
|
|
|
|
|
apollo: Apollo Repo {
|
|
|
|
|
style.font-size: 25
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GHA: GitHub Actions {
|
|
|
|
|
style.font-size: 25
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
AWS.style.font-size: 25
|
|
|
|
|
|
|
|
|
|
apollo -> GHA: Triggered manually/push to master test test test test test test test {
|
|
|
|
|
style.font-size: 20
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GHA -> AWS: test {
|
|
|
|
|
style.font-size: 20
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-12-20 23:50:06 +00:00
|
|
|
`,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "dagre_edge_label_spacing",
|
|
|
|
|
script: `direction: right
|
|
|
|
|
|
|
|
|
|
build_workflow: lambda-build.yaml {
|
|
|
|
|
|
|
|
|
|
push: Push to main branch {
|
|
|
|
|
style.font-size: 25
|
|
|
|
|
}
|
|
|
|
|
GHA: GitHub Actions {
|
|
|
|
|
style.font-size: 25
|
|
|
|
|
}
|
|
|
|
|
S3.style.font-size: 25
|
|
|
|
|
Terraform.style.font-size: 25
|
|
|
|
|
AWS.style.font-size: 25
|
|
|
|
|
|
|
|
|
|
push -> GHA: Triggers
|
|
|
|
|
GHA -> S3: Builds zip & pushes it
|
|
|
|
|
S3 <-> Terraform: Pulls zip to deploy
|
|
|
|
|
Terraform -> AWS: Changes the live lambdas
|
|
|
|
|
}
|
2022-12-24 20:45:12 +00:00
|
|
|
`,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "query_param_escape",
|
|
|
|
|
script: `my network: {
|
|
|
|
|
icon: https://icons.terrastruct.com/infra/019-network.svg?fuga=1&hoge
|
|
|
|
|
}
|
2022-12-24 21:34:23 +00:00
|
|
|
`,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "elk_order",
|
|
|
|
|
script: `queue: {
|
|
|
|
|
shape: queue
|
|
|
|
|
label: ''
|
|
|
|
|
|
|
|
|
|
M0
|
|
|
|
|
M1
|
|
|
|
|
M2
|
|
|
|
|
M3
|
|
|
|
|
M4
|
|
|
|
|
M5
|
|
|
|
|
M6
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m0_desc: |md
|
|
|
|
|
Oldest message
|
|
|
|
|
|
|
|
|
|
|
m0_desc -> queue.M0
|
|
|
|
|
|
|
|
|
|
m2_desc: |md
|
|
|
|
|
Offset
|
|
|
|
|
|
|
|
|
|
|
m2_desc -> queue.M2
|
|
|
|
|
|
|
|
|
|
m5_desc: |md
|
|
|
|
|
Last message
|
|
|
|
|
|
|
|
|
|
|
m5_desc -> queue.M5
|
|
|
|
|
|
|
|
|
|
m6_desc: |md
|
|
|
|
|
Next message will be\
|
|
|
|
|
inserted here
|
|
|
|
|
|
|
|
|
|
|
m6_desc -> queue.M6
|
2022-12-28 22:29:13 +00:00
|
|
|
`,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "unnamed_class_table_code",
|
|
|
|
|
script: `
|
|
|
|
|
|
2023-02-06 21:32:08 +00:00
|
|
|
class2 -> users -> code
|
2022-12-28 22:29:13 +00:00
|
|
|
|
2023-02-06 21:32:08 +00:00
|
|
|
class2: "" {
|
2022-12-28 22:29:13 +00:00
|
|
|
shape: class
|
|
|
|
|
-num: int
|
|
|
|
|
-timeout: int
|
|
|
|
|
-pid
|
|
|
|
|
|
|
|
|
|
+getStatus(): Enum
|
|
|
|
|
+getJobs(): "Job[]"
|
|
|
|
|
+setTimeout(seconds int)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
users: "" {
|
|
|
|
|
shape: sql_table
|
|
|
|
|
id: int
|
|
|
|
|
name: string
|
|
|
|
|
email: string
|
|
|
|
|
password: string
|
|
|
|
|
last_login: datetime
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
code: |go
|
|
|
|
|
a := 5
|
|
|
|
|
b := a + 7
|
|
|
|
|
fmt.Printf("%d", b)
|
|
|
|
|
|
|
2022-12-29 07:46:29 +00:00
|
|
|
`,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "elk_img_empty_label_panic",
|
|
|
|
|
script: `
|
|
|
|
|
img: {
|
|
|
|
|
label: ""
|
|
|
|
|
shape: image
|
|
|
|
|
icon: https://icons.terrastruct.com/infra/019-network.svg
|
|
|
|
|
}
|
|
|
|
|
ico: {
|
|
|
|
|
label: ""
|
|
|
|
|
icon: https://icons.terrastruct.com/infra/019-network.svg
|
|
|
|
|
}
|
2022-12-29 06:51:16 +00:00
|
|
|
`,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "only_header_class_table",
|
|
|
|
|
script: `
|
|
|
|
|
|
2023-02-06 21:32:08 +00:00
|
|
|
class2: RefreshAuthorizationPolicyProtocolServerSideTranslatorProtocolBuffer {
|
2022-12-29 06:51:16 +00:00
|
|
|
shape: class
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
table: RefreshAuthorizationPolicyCache {
|
|
|
|
|
shape: sql_table
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
table with short col: RefreshAuthorizationPolicyCache {
|
|
|
|
|
shape: sql_table
|
|
|
|
|
ok
|
|
|
|
|
}
|
|
|
|
|
|
2023-02-06 21:32:08 +00:00
|
|
|
class2 -> table -> table with short col
|
2023-01-06 20:18:26 +00:00
|
|
|
`,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "overlapping-edge-label",
|
|
|
|
|
script: `k8s: Kubernetes
|
|
|
|
|
k8s.m1: k8s-master1
|
|
|
|
|
k8s.m2: k8s-master2
|
|
|
|
|
k8s.m3: k8s-master3
|
|
|
|
|
k8s.w1: k8s-worker1
|
|
|
|
|
k8s.w2: k8s-worker2
|
|
|
|
|
k8s.w3: k8s-worker3
|
|
|
|
|
|
|
|
|
|
osvc: opensvc
|
|
|
|
|
osvc.vm1: VM1
|
|
|
|
|
osvc.vm2: VM2
|
|
|
|
|
|
|
|
|
|
k8s -> osvc: keycloak
|
|
|
|
|
k8s -> osvc: heptapod
|
|
|
|
|
k8s -> osvc: harbor
|
|
|
|
|
k8s -> osvc: vault
|
2023-01-12 07:53:02 +00:00
|
|
|
`,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "no-lexer",
|
|
|
|
|
script: `x: |d2
|
|
|
|
|
x -> y
|
|
|
|
|
|
|
2022-12-28 20:10:11 +00:00
|
|
|
`,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "dagre_broken_arrowhead",
|
|
|
|
|
script: `
|
|
|
|
|
a.b -> a.c: "line 1\nline 2\nline 3\nline 4" {
|
|
|
|
|
style: {
|
|
|
|
|
font-color: red
|
|
|
|
|
stroke: red
|
|
|
|
|
}
|
|
|
|
|
target-arrowhead: {
|
|
|
|
|
shape: diamond
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
a.1 -> a.c
|
|
|
|
|
a.2 <-> a.c
|
|
|
|
|
a.c {
|
|
|
|
|
style.stroke: white
|
|
|
|
|
d
|
|
|
|
|
}
|
2023-01-14 03:34:27 +00:00
|
|
|
`,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "code_leading_trailing_newlines",
|
|
|
|
|
script: `
|
|
|
|
|
hello world: |python
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 2 leading, 2 trailing
|
|
|
|
|
def hello():
|
|
|
|
|
|
|
|
|
|
print "world"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
no trailing: |python
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 2 leading
|
|
|
|
|
def hello():
|
|
|
|
|
|
|
|
|
|
print "world"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
no leading: |python
|
|
|
|
|
# 2 trailing
|
|
|
|
|
def hello():
|
|
|
|
|
|
|
|
|
|
print "world"
|
|
|
|
|
|
|
|
|
|
|
2023-06-20 00:07:59 +00:00
|
|
|
|
|
|
|
|
|
`,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "code_leading_newlines",
|
|
|
|
|
script: `
|
|
|
|
|
5 leading: |python
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def hello():
|
|
|
|
|
|
|
|
|
|
print "world"
|
|
|
|
|
|
|
|
|
|
|
8 total: |python
|
|
|
|
|
# 1 leading
|
|
|
|
|
# 2 leading
|
|
|
|
|
# 3 leading
|
|
|
|
|
# 4 leading
|
|
|
|
|
# 5 leading
|
|
|
|
|
def hello():
|
|
|
|
|
|
|
|
|
|
print "world"
|
|
|
|
|
|
|
|
|
|
|
1 leading: |python
|
|
|
|
|
|
|
|
|
|
def hello():
|
|
|
|
|
|
|
|
|
|
print "world"
|
|
|
|
|
|
|
|
|
|
|
4 total: |python
|
|
|
|
|
# 1 leading
|
|
|
|
|
def hello():
|
|
|
|
|
|
|
|
|
|
print "world"
|
|
|
|
|
|
|
|
|
|
|
2 leading: |python
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def hello():
|
|
|
|
|
|
|
|
|
|
print "world"
|
|
|
|
|
|
|
|
|
|
|
5 total: |python
|
|
|
|
|
# 1 leading
|
|
|
|
|
# 2 leading
|
|
|
|
|
def hello():
|
|
|
|
|
|
|
|
|
|
print "world"
|
|
|
|
|
|
|
|
|
|
|
`,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "code_trailing_newlines",
|
|
|
|
|
script: `
|
|
|
|
|
5 trailing: |python
|
|
|
|
|
def hello():
|
|
|
|
|
|
|
|
|
|
print "world"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 total: |python
|
|
|
|
|
def hello():
|
|
|
|
|
|
|
|
|
|
print "world"
|
|
|
|
|
# 1 trailing
|
|
|
|
|
# 2 trailing
|
|
|
|
|
# 3 trailing
|
|
|
|
|
# 4 trailing
|
|
|
|
|
# 5 trailing
|
|
|
|
|
|
|
|
|
|
|
1 trailing: |python
|
|
|
|
|
def hello():
|
|
|
|
|
|
|
|
|
|
print "world"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 total: |python
|
|
|
|
|
def hello():
|
|
|
|
|
|
|
|
|
|
print "world"
|
|
|
|
|
# 1 trailing
|
|
|
|
|
|
|
|
|
|
|
2 trailing: |python
|
|
|
|
|
def hello():
|
|
|
|
|
|
|
|
|
|
print "world"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 total: |python
|
|
|
|
|
def hello():
|
|
|
|
|
|
|
|
|
|
print "world"
|
|
|
|
|
# 1 trailing
|
|
|
|
|
# 2 trailing
|
2023-01-14 03:34:27 +00:00
|
|
|
|
|
2022-12-18 01:46:52 +00:00
|
|
|
`,
|
|
|
|
|
},
|
2023-01-14 04:51:11 +00:00
|
|
|
{
|
|
|
|
|
name: "md_h1_li_li",
|
|
|
|
|
script: mdTestScript(`
|
|
|
|
|
# hey
|
|
|
|
|
- they
|
|
|
|
|
1. they
|
|
|
|
|
`),
|
|
|
|
|
},
|
2023-01-18 22:34:14 +00:00
|
|
|
{
|
|
|
|
|
name: "elk_loop_panic",
|
|
|
|
|
script: `x: {
|
|
|
|
|
a
|
|
|
|
|
b
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
x.a -> x.a
|
2023-01-19 08:26:00 +00:00
|
|
|
`,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "opacity-on-label",
|
|
|
|
|
script: `x.style.opacity: 0.4
|
|
|
|
|
y: |md
|
|
|
|
|
linux: because a PC is a terrible thing to waste
|
|
|
|
|
| {
|
|
|
|
|
style.opacity: 0.4
|
|
|
|
|
}
|
2023-01-19 08:46:30 +00:00
|
|
|
x -> a: {
|
|
|
|
|
label: You don't have to know how the computer works,\njust how to work the computer.
|
|
|
|
|
style.opacity: 0.4
|
|
|
|
|
}
|
2023-01-27 00:32:44 +00:00
|
|
|
`,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "sequence_diagram_self_edge_group_overlap",
|
|
|
|
|
script: `
|
|
|
|
|
shape: sequence_diagram
|
|
|
|
|
a: A
|
|
|
|
|
b: B
|
|
|
|
|
c: C
|
|
|
|
|
group 1: {
|
|
|
|
|
a -> a
|
|
|
|
|
}
|
|
|
|
|
group 2: {
|
|
|
|
|
a -> b
|
|
|
|
|
}
|
|
|
|
|
group 3: {
|
|
|
|
|
a -> a.a
|
|
|
|
|
}
|
|
|
|
|
group 4: {
|
|
|
|
|
a.a -> b
|
|
|
|
|
}
|
|
|
|
|
group 5: {
|
|
|
|
|
b -> b
|
|
|
|
|
b -> b
|
|
|
|
|
}
|
|
|
|
|
group 6: {
|
|
|
|
|
b -> a
|
|
|
|
|
}
|
|
|
|
|
group 7: {
|
|
|
|
|
a -> a
|
|
|
|
|
}
|
|
|
|
|
group 8: {
|
|
|
|
|
a -> a
|
|
|
|
|
}
|
|
|
|
|
a -> a
|
|
|
|
|
group 9: {
|
|
|
|
|
a -> a
|
|
|
|
|
}
|
|
|
|
|
a -> a
|
|
|
|
|
|
|
|
|
|
b -> c
|
|
|
|
|
group 10: {
|
|
|
|
|
c -> c
|
|
|
|
|
}
|
|
|
|
|
b -> c
|
|
|
|
|
group 11: {
|
|
|
|
|
c -> c
|
|
|
|
|
}
|
|
|
|
|
b -> c
|
|
|
|
|
|
2023-01-18 22:34:14 +00:00
|
|
|
`,
|
|
|
|
|
},
|
2023-02-04 02:27:38 +00:00
|
|
|
{
|
|
|
|
|
name: "empty_class_height",
|
|
|
|
|
script: `
|
|
|
|
|
class1: class with rows {
|
|
|
|
|
shape: class
|
|
|
|
|
-num: int
|
|
|
|
|
-timeout: int
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class2: class without rows {
|
|
|
|
|
shape: class
|
|
|
|
|
}
|
|
|
|
|
`,
|
|
|
|
|
},
|
2023-02-05 09:56:43 +00:00
|
|
|
{
|
|
|
|
|
name: "just-width",
|
|
|
|
|
script: `x: "teamwork: having someone to blame" {
|
|
|
|
|
width: 100
|
|
|
|
|
}
|
|
|
|
|
`,
|
|
|
|
|
},
|
2023-02-05 09:38:50 +00:00
|
|
|
{
|
|
|
|
|
name: "sequence-panic",
|
|
|
|
|
script: `
|
|
|
|
|
shape: sequence_diagram
|
|
|
|
|
|
2023-02-08 03:53:39 +00:00
|
|
|
a
|
2023-02-05 09:38:50 +00:00
|
|
|
|
2023-02-08 03:53:39 +00:00
|
|
|
group: {
|
|
|
|
|
inner_group: {
|
|
|
|
|
a -> b
|
|
|
|
|
}
|
2023-02-05 09:38:50 +00:00
|
|
|
}
|
|
|
|
|
`,
|
2023-02-08 04:47:12 +00:00
|
|
|
expErr: "could not find center of b. Is it declared as an actor?",
|
2023-02-05 09:38:50 +00:00
|
|
|
},
|
2023-02-12 20:01:33 +00:00
|
|
|
{
|
|
|
|
|
name: "ampersand-escape",
|
2023-07-30 00:15:03 +00:00
|
|
|
script: `hy: &∈ {
|
2023-02-12 20:01:33 +00:00
|
|
|
tooltip: beans & rice
|
|
|
|
|
}
|
2023-02-14 19:34:18 +00:00
|
|
|
`,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "dagre-disconnect",
|
|
|
|
|
script: `a: {
|
|
|
|
|
k.t -> f.i
|
|
|
|
|
f.g -> _.s.n
|
|
|
|
|
}
|
|
|
|
|
k
|
|
|
|
|
k.s <-> u.o
|
|
|
|
|
h.m.s -> a.f.g
|
|
|
|
|
|
|
|
|
|
a.f.j -> u.s.j
|
|
|
|
|
u: {
|
|
|
|
|
c -> _.s.z.c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
s: {
|
|
|
|
|
n: {
|
|
|
|
|
style.stroke: red
|
|
|
|
|
f
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-02-14 19:35:00 +00:00
|
|
|
s.n -> y.r: {style.stroke-width: 8; style.stroke: red}
|
2023-02-14 19:34:18 +00:00
|
|
|
y.r -> a.g.i: 1\n2\n3\n4
|
2023-02-22 21:21:29 +00:00
|
|
|
`,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "sequence-note-escape-group",
|
|
|
|
|
script: `shape: sequence_diagram
|
|
|
|
|
a
|
|
|
|
|
b
|
|
|
|
|
|
|
|
|
|
"04:20,11:20": {
|
|
|
|
|
"loop through each table": {
|
|
|
|
|
a."start_time = datetime.datetime.now"
|
|
|
|
|
a -> b
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-02-12 20:01:33 +00:00
|
|
|
`,
|
|
|
|
|
},
|
2023-02-27 18:31:33 +00:00
|
|
|
loadFromFile(t, "unconnected"),
|
2023-02-27 22:53:45 +00:00
|
|
|
{
|
|
|
|
|
name: "straight_hierarchy_container_direction_right",
|
|
|
|
|
script: `
|
|
|
|
|
direction: right
|
|
|
|
|
a
|
|
|
|
|
c
|
|
|
|
|
b
|
|
|
|
|
|
|
|
|
|
l1: {
|
|
|
|
|
b
|
|
|
|
|
a
|
|
|
|
|
c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
b -> l1.b
|
|
|
|
|
a -> l1.a
|
|
|
|
|
c -> l1.c
|
|
|
|
|
|
|
|
|
|
l2c1: {
|
|
|
|
|
a
|
|
|
|
|
}
|
|
|
|
|
l1.a -> l2c1.a
|
|
|
|
|
|
|
|
|
|
l2c3: {
|
|
|
|
|
c
|
|
|
|
|
}
|
|
|
|
|
l1.c -> l2c3.c
|
|
|
|
|
|
|
|
|
|
l2c2: {
|
|
|
|
|
b
|
|
|
|
|
}
|
|
|
|
|
l1.b -> l2c2.b
|
|
|
|
|
|
|
|
|
|
l3c1: {
|
|
|
|
|
a
|
|
|
|
|
b
|
|
|
|
|
}
|
|
|
|
|
l2c1.a -> l3c1.a
|
|
|
|
|
l2c2.b -> l3c1.b
|
|
|
|
|
|
|
|
|
|
l3c2: {
|
|
|
|
|
c
|
|
|
|
|
}
|
|
|
|
|
l2c3.c -> l3c2.c
|
|
|
|
|
|
|
|
|
|
l4: {
|
|
|
|
|
c1: {
|
|
|
|
|
a
|
|
|
|
|
}
|
|
|
|
|
c2: {
|
|
|
|
|
b
|
|
|
|
|
}
|
|
|
|
|
c3: {
|
|
|
|
|
c
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
l3c1.a -> l4.c1.a
|
|
|
|
|
l3c1.b -> l4.c2.b
|
|
|
|
|
l3c2.c -> l4.c3.c`,
|
|
|
|
|
},
|
2023-03-07 04:06:31 +00:00
|
|
|
{
|
|
|
|
|
name: "link_with_ampersand",
|
|
|
|
|
script: `a.link: https://calendar.google.com/calendar/u/0/r?tab=mc&pli=1`,
|
|
|
|
|
},
|
2023-03-29 23:37:40 +00:00
|
|
|
{
|
|
|
|
|
name: "bold_edge_label",
|
|
|
|
|
script: `
|
|
|
|
|
direction: right
|
|
|
|
|
x -> y: sync
|
|
|
|
|
y -> z: sync {
|
|
|
|
|
style.bold: true
|
|
|
|
|
}
|
2023-04-10 17:33:40 +00:00
|
|
|
`,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "grid_in_constant_near",
|
|
|
|
|
script: `
|
|
|
|
|
a
|
|
|
|
|
b
|
|
|
|
|
c
|
|
|
|
|
x: {
|
|
|
|
|
near: top-right
|
|
|
|
|
grid-columns: 1
|
|
|
|
|
y
|
|
|
|
|
z
|
|
|
|
|
}
|
2023-04-10 18:41:14 +00:00
|
|
|
`,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "md_font_weight",
|
|
|
|
|
script: `
|
|
|
|
|
explanation: |md
|
|
|
|
|
# I can do headers
|
|
|
|
|
|
|
|
|
|
- lists
|
|
|
|
|
- lists
|
|
|
|
|
|
|
|
|
|
And other normal markdown stuff
|
|
|
|
|
|
|
2023-04-12 18:48:52 +00:00
|
|
|
`,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "grid_panic",
|
|
|
|
|
script: `
|
|
|
|
|
2 rows 1 obj: {
|
|
|
|
|
grid-rows: 2
|
|
|
|
|
|
|
|
|
|
one
|
|
|
|
|
}
|
|
|
|
|
3 rows 2 obj: {
|
|
|
|
|
grid-rows: 3
|
|
|
|
|
|
|
|
|
|
one
|
|
|
|
|
two
|
|
|
|
|
}
|
|
|
|
|
4 columns 2 obj: {
|
|
|
|
|
grid-columns: 4
|
|
|
|
|
|
|
|
|
|
one
|
|
|
|
|
two
|
|
|
|
|
}
|
2023-04-13 21:23:50 +00:00
|
|
|
`,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "long_arrowhead_label",
|
|
|
|
|
script: `
|
|
|
|
|
a -> b: {
|
|
|
|
|
target-arrowhead: "a to b with unexpectedly long target arrowhead label"
|
|
|
|
|
}
|
2023-04-17 19:56:14 +00:00
|
|
|
`,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "arrowhead_sizes_with_labels",
|
|
|
|
|
script: `
|
|
|
|
|
triangle: {
|
|
|
|
|
a <-> b: {
|
|
|
|
|
source-arrowhead: 1
|
|
|
|
|
target-arrowhead: 1
|
|
|
|
|
}
|
|
|
|
|
c <-> d: {
|
|
|
|
|
source-arrowhead: 1
|
|
|
|
|
target-arrowhead: 1
|
|
|
|
|
style.stroke-width: 8
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
none: {
|
|
|
|
|
a -- b: {
|
|
|
|
|
source-arrowhead: 1
|
|
|
|
|
target-arrowhead: 1
|
|
|
|
|
}
|
|
|
|
|
c -- d: {
|
|
|
|
|
source-arrowhead: 1
|
|
|
|
|
target-arrowhead: 1
|
|
|
|
|
style.stroke-width: 8
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
arrow: {
|
|
|
|
|
a <-> b: {
|
|
|
|
|
source-arrowhead: 1 {
|
|
|
|
|
shape: arrow
|
|
|
|
|
}
|
|
|
|
|
target-arrowhead: 1 {
|
|
|
|
|
shape: arrow
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
c <-> d: {
|
|
|
|
|
source-arrowhead: 1 {
|
|
|
|
|
shape: arrow
|
|
|
|
|
}
|
|
|
|
|
target-arrowhead: 1 {
|
|
|
|
|
shape: arrow
|
|
|
|
|
}
|
|
|
|
|
style.stroke-width: 8
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
diamond: {
|
|
|
|
|
a <-> b: {
|
|
|
|
|
source-arrowhead: 1 {
|
|
|
|
|
shape: diamond
|
|
|
|
|
}
|
|
|
|
|
target-arrowhead: 1 {
|
|
|
|
|
shape: diamond
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
c <-> d: {
|
|
|
|
|
source-arrowhead: 1 {
|
|
|
|
|
shape: diamond
|
|
|
|
|
}
|
|
|
|
|
target-arrowhead: 1 {
|
|
|
|
|
shape: diamond
|
|
|
|
|
}
|
|
|
|
|
style.stroke-width: 8
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
filled diamond: {
|
|
|
|
|
a <-> b: {
|
|
|
|
|
source-arrowhead: 1 {
|
|
|
|
|
shape: diamond
|
|
|
|
|
style.filled: true
|
|
|
|
|
}
|
|
|
|
|
target-arrowhead: 1 {
|
|
|
|
|
shape: diamond
|
|
|
|
|
style.filled: true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
c <-> d: {
|
|
|
|
|
source-arrowhead: 1 {
|
|
|
|
|
shape: diamond
|
|
|
|
|
style.filled: true
|
|
|
|
|
}
|
|
|
|
|
target-arrowhead: 1 {
|
|
|
|
|
shape: diamond
|
|
|
|
|
style.filled: true
|
|
|
|
|
}
|
|
|
|
|
style.stroke-width: 8
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
circle: {
|
|
|
|
|
a <-> b: {
|
|
|
|
|
source-arrowhead: 1 {
|
|
|
|
|
shape: circle
|
|
|
|
|
}
|
|
|
|
|
target-arrowhead: 1 {
|
|
|
|
|
shape: circle
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
c <-> d: {
|
|
|
|
|
source-arrowhead: 1 {
|
|
|
|
|
shape: circle
|
|
|
|
|
}
|
|
|
|
|
target-arrowhead: 1 {
|
|
|
|
|
shape: circle
|
|
|
|
|
}
|
|
|
|
|
style.stroke-width: 8
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
filled circle: {
|
|
|
|
|
a <-> b: {
|
|
|
|
|
source-arrowhead: 1 {
|
|
|
|
|
shape: circle
|
|
|
|
|
style.filled: true
|
|
|
|
|
}
|
|
|
|
|
target-arrowhead: 1 {
|
|
|
|
|
shape: circle
|
|
|
|
|
style.filled: true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
c <-> d: {
|
|
|
|
|
source-arrowhead: 1 {
|
|
|
|
|
shape: circle
|
|
|
|
|
style.filled: true
|
|
|
|
|
}
|
|
|
|
|
target-arrowhead: 1 {
|
|
|
|
|
shape: circle
|
|
|
|
|
style.filled: true
|
|
|
|
|
}
|
|
|
|
|
style.stroke-width: 8
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
cf one: {
|
|
|
|
|
a <-> b: {
|
|
|
|
|
source-arrowhead: 1 {
|
|
|
|
|
shape: cf-one
|
|
|
|
|
}
|
|
|
|
|
target-arrowhead: 1 {
|
|
|
|
|
shape: cf-one
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
c <-> d: {
|
|
|
|
|
source-arrowhead: 1 {
|
|
|
|
|
shape: cf-one
|
|
|
|
|
}
|
|
|
|
|
target-arrowhead: 1 {
|
|
|
|
|
shape: cf-one
|
|
|
|
|
}
|
|
|
|
|
style.stroke-width: 8
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
cf one required: {
|
|
|
|
|
a <-> b: {
|
|
|
|
|
source-arrowhead: 1 {
|
|
|
|
|
shape: cf-one-required
|
|
|
|
|
}
|
|
|
|
|
target-arrowhead: 1 {
|
|
|
|
|
shape: cf-one-required
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
c <-> d: {
|
|
|
|
|
source-arrowhead: 1 {
|
|
|
|
|
shape: cf-one-required
|
|
|
|
|
}
|
|
|
|
|
target-arrowhead: 1 {
|
|
|
|
|
shape: cf-one-required
|
|
|
|
|
}
|
|
|
|
|
style.stroke-width: 8
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
cf many: {
|
|
|
|
|
a <-> b: {
|
|
|
|
|
source-arrowhead: 1 {
|
|
|
|
|
shape: cf-many
|
|
|
|
|
}
|
|
|
|
|
target-arrowhead: 1 {
|
|
|
|
|
shape: cf-many
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
c <-> d: {
|
|
|
|
|
source-arrowhead: 1 {
|
|
|
|
|
shape: cf-many
|
|
|
|
|
}
|
|
|
|
|
target-arrowhead: 1 {
|
|
|
|
|
shape: cf-many
|
|
|
|
|
}
|
|
|
|
|
style.stroke-width: 8
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
cf many required: {
|
|
|
|
|
a <-> b: {
|
|
|
|
|
source-arrowhead: 1 {
|
|
|
|
|
shape: cf-many-required
|
|
|
|
|
}
|
|
|
|
|
target-arrowhead: 1 {
|
|
|
|
|
shape: cf-many-required
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
c <-> d: {
|
|
|
|
|
source-arrowhead: 1 {
|
|
|
|
|
shape: cf-many-required
|
|
|
|
|
}
|
|
|
|
|
target-arrowhead: 1 {
|
|
|
|
|
shape: cf-many-required
|
|
|
|
|
}
|
|
|
|
|
style.stroke-width: 8
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-03-29 23:37:40 +00:00
|
|
|
`,
|
|
|
|
|
},
|
2023-09-22 17:45:18 +00:00
|
|
|
{
|
|
|
|
|
name: "dagre_child_id_id",
|
|
|
|
|
script: `direction:right; id -> x.id -> y.z.id`,
|
|
|
|
|
},
|
2023-04-25 21:28:16 +00:00
|
|
|
loadFromFile(t, "slow_grid"),
|
|
|
|
|
loadFromFile(t, "grid_oom"),
|
2023-05-04 02:50:52 +00:00
|
|
|
loadFromFile(t, "cylinder_grid_label"),
|
2023-06-08 18:23:10 +00:00
|
|
|
loadFromFile(t, "grid_with_latex"),
|
2023-07-03 23:45:30 +00:00
|
|
|
loadFromFile(t, "icons_on_top"),
|
2023-07-28 08:13:29 +00:00
|
|
|
loadFromFile(t, "dagre_disconnected_edge"),
|
2023-09-05 21:02:50 +00:00
|
|
|
loadFromFile(t, "outside_grid_label_position"),
|
2023-09-11 19:18:06 +00:00
|
|
|
loadFromFile(t, "arrowhead_font_color"),
|
2023-09-19 03:57:35 +00:00
|
|
|
loadFromFile(t, "multiple_constant_nears"),
|
2023-09-20 18:40:48 +00:00
|
|
|
loadFromFile(t, "empty_nested_grid"),
|
2023-09-25 18:52:22 +00:00
|
|
|
loadFromFile(t, "code_font_size"),
|
2023-09-25 23:26:38 +00:00
|
|
|
loadFromFile(t, "disclaimer"),
|
2023-10-06 01:47:57 +00:00
|
|
|
loadFromFile(t, "grid_rows_gap_bug"),
|
2023-10-16 22:44:26 +00:00
|
|
|
loadFromFile(t, "grid_image_label_position"),
|
2023-10-20 21:49:09 +00:00
|
|
|
loadFromFile(t, "glob_dimensions"),
|
2023-11-15 22:11:03 +00:00
|
|
|
loadFromFile(t, "shaped_grid_positioning"),
|
2023-11-17 01:31:23 +00:00
|
|
|
loadFromFile(t, "cloud_shaped_grid"),
|
2023-11-28 16:57:58 +00:00
|
|
|
loadFromFileWithOptions(t, "nested_layout_bug", testCase{testSerialization: true}),
|
2023-12-13 19:04:22 +00:00
|
|
|
loadFromFile(t, "disconnect_direction_right"),
|
2022-12-05 19:10:45 +00:00
|
|
|
}
|
2022-11-03 13:54:49 +00:00
|
|
|
|
|
|
|
|
runa(t, tcs)
|
|
|
|
|
}
|