add compile test

This commit is contained in:
Gavin Nishizawa 2023-04-10 18:21:26 -07:00
parent c20c122ee4
commit e871cee0bb
No known key found for this signature in database
GPG key ID: AE3B177777CE55CD
2 changed files with 26 additions and 0 deletions

View file

@ -2301,6 +2301,16 @@ obj {
`,
expErr: `d2/testdata/d2compiler/TestCompile/grid_negative.d2:3:16: grid-columns must be a positive integer: "-200"`,
},
{
name: "grid_gap_negative",
text: `hey: {
grid-gap-columns: -200
grid-gap-rows: -30
}
`,
expErr: `d2/testdata/d2compiler/TestCompile/grid_gap_negative.d2:2:20: grid-gap-columns must be a non-negative integer: "-200"
d2/testdata/d2compiler/TestCompile/grid_gap_negative.d2:3:17: grid-gap-rows must be a non-negative integer: "-30"`,
},
{
name: "grid_edge",
text: `hey: {

View file

@ -0,0 +1,16 @@
{
"graph": null,
"err": {
"ioerr": null,
"errs": [
{
"range": "d2/testdata/d2compiler/TestCompile/grid_gap_negative.d2,1:19:26-1:23:30",
"errmsg": "d2/testdata/d2compiler/TestCompile/grid_gap_negative.d2:2:20: grid-gap-columns must be a non-negative integer: \"-200\""
},
{
"range": "d2/testdata/d2compiler/TestCompile/grid_gap_negative.d2,2:16:47-2:19:50",
"errmsg": "d2/testdata/d2compiler/TestCompile/grid_gap_negative.d2:3:17: grid-gap-rows must be a non-negative integer: \"-30\""
}
]
}
}