From 544bf5726595e387fcd5649452d6d3f601d47154 Mon Sep 17 00:00:00 2001 From: melsonic Date: Tue, 11 Mar 2025 00:49:16 +0530 Subject: [PATCH] added e2etests-cli tests --- e2etests-cli/main_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/e2etests-cli/main_test.go b/e2etests-cli/main_test.go index dbdcd2833..441fbd986 100644 --- a/e2etests-cli/main_test.go +++ b/e2etests-cli/main_test.go @@ -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()