added e2etests-cli tests

This commit is contained in:
melsonic 2025-03-11 00:49:16 +05:30 committed by melsonic
parent 61ba9132dd
commit 544bf57265
No known key found for this signature in database
GPG key ID: DFA426742F621CD7

View file

@ -1346,6 +1346,22 @@ c
assert.Success(t, err)
},
},
{
name: "validate-against-correct-d2",
run: func(t *testing.T, ctx context.Context, dir string, env *xos.Env) {
writeFile(t, dir, "correct.d2", `x -> y`)
err := runTestMainPersist(t, ctx, dir, env, "validate", "correct.d2")
assert.Success(t, err)
},
},
{
name: "validate-against-incorrect-d2",
run: func(t *testing.T, ctx context.Context, dir string, env *xos.Env) {
writeFile(t, dir, "incorrect.d2", `x > y`)
err := runTestMainPersist(t, ctx, dir, env, "validate", "incorrect.d2")
assert.Error(t, err)
},
},
}
ctx := context.Background()