(t *testing.T)
| 27 | ) |
| 28 | |
| 29 | func Test_ValidatePolicyCmd(t *testing.T) { |
| 30 | validate := func(ctx context.Context, policyConfiguration string) error { |
| 31 | // Mock implementation of the validate function |
| 32 | return nil |
| 33 | } |
| 34 | |
| 35 | cmd := ValidatePolicyCmd(validate) |
| 36 | |
| 37 | t.Run("PreRunE", func(t *testing.T) { |
| 38 | // Test PreRunE function |
| 39 | err := cmd.PreRunE(cmd, []string{}) |
| 40 | assert.NoError(t, err) |
| 41 | }) |
| 42 | |
| 43 | t.Run("RunE", func(t *testing.T) { |
| 44 | // Test RunE function |
| 45 | err := cmd.RunE(cmd, []string{}) |
| 46 | assert.NoError(t, err) |
| 47 | }) |
| 48 | } |
| 49 | |
| 50 | func Test_ValidatePolicyErrors(t *testing.T) { |
| 51 | validate := func(ctx context.Context, policyConfiguration string) error { |
nothing calls this directly
no test coverage detected