1 package validate 2 3 import ( 4 "context" 5 "testing" 6 ) 7 8 func TestValidate(t *testing.T) { 9 cmd := New() 10 testCases := map[string]bool{ 11 "testdata/warehouse-lock-pass.yaml": true, 12 "testdata/warehouse-lock-fail.yaml": false, 13 } 14 15 for lockPath, shouldPass := range testCases { 16 err := cmd.ParseAndRun(context.Background(), []string{lockPath}) 17 if err != nil && shouldPass { 18 t.Errorf("tc should have passed for %s", lockPath) 19 } 20 } 21 } 22