package validate import ( "context" "testing" ) func TestValidate(t *testing.T) { cmd := New() testCases := map[string]bool{ "testdata/warehouse-lock-pass.yaml": true, "testdata/warehouse-lock-fail.yaml": false, } for lockPath, shouldPass := range testCases { err := cmd.ParseAndRun(context.Background(), []string{lockPath}) if err != nil && shouldPass { t.Errorf("tc should have passed for %s", lockPath) } } }