add regression test read from file

This commit is contained in:
Gavin Nishizawa 2023-02-27 10:31:33 -08:00
parent ce19b61584
commit 74dbf60830
No known key found for this signature in database
GPG key ID: AE3B177777CE55CD
7 changed files with 3878 additions and 0 deletions

View file

@ -239,3 +239,16 @@ md: |md
a -> md -> b a -> md -> b
`, md) `, md)
} }
func loadFromFile(t *testing.T, name string) testCase {
fn := filepath.Join("testdata", "files", fmt.Sprintf("%s.d2", name))
d2Text, err := ioutil.ReadFile(fn)
if err != nil {
t.Fatalf("failed to load test from file:%s. %s", name, err.Error())
}
return testCase{
name: name,
script: string(d2Text),
}
}

View file

@ -573,6 +573,7 @@ b
} }
`, `,
}, },
loadFromFile(t, "unconnected"),
} }
runa(t, tcs) runa(t, tcs)

35
e2etests/testdata/files/unconnected.d2 vendored Normal file
View file

@ -0,0 +1,35 @@
title: Workflow-I (Warehousing, Installation) {
near: top-center
shape: text
style: {
font-size: 40
bold: false
underline: false
}
}
OEM Factory
OEM Factory -> OEM Warehouse
OEM Factory -> Distributor Warehouse
OEM Factory -> Gos Warehouse
direction: right
Gos Warehouse.Master -> Gos Warehouse.Regional-1
Gos Warehouse.Master -> Gos Warehouse.Regional-2
Gos Warehouse.Master -> Gos Warehouse.Regional-N
Gos Warehouse.Regional-1 -> Gos Warehouse.Regional-2
Gos Warehouse.Regional-2 -> Gos Warehouse.Regional-N
Gos Warehouse.Regional-N -> Gos Warehouse.Regional-1
Gos Warehouse.explaination: |`md
- Asset Tagging
- Inventory
- Staging
- Dispatch to Site
`|
OEM Warehouse -> Gos Warehouse
Distributor Warehouse -> Gos Warehouse
Customer Site: {
Installation
Support
}

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 669 KiB

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 670 KiB