(t *testing.T)
| 180 | } |
| 181 | |
| 182 | func TestStructuredOutputSupportDoesNotInheritFromParent(t *testing.T) { |
| 183 | root := &cobra.Command{} |
| 184 | root.PersistentFlags().String(outputFlag, "json", "") |
| 185 | enableStructuredOutput(root) |
| 186 | |
| 187 | cmd := &cobra.Command{} |
| 188 | root.AddCommand(cmd) |
| 189 | |
| 190 | err := validateOutputFormat(cmd) |
| 191 | if !errors.Is(err, output.ErrStructuredOutputUnsupported) { |
| 192 | t.Fatalf("error = %v, want ErrStructuredOutputUnsupported", err) |
| 193 | } |
| 194 | } |
| 195 | |
| 196 | func TestRootCommandDefinesOutputFlag(t *testing.T) { |
| 197 | flag := RootCmd.PersistentFlags().Lookup(outputFlag) |
nothing calls this directly
no test coverage detected