(t *testing.T, config string, format, filter string)
| 13 | ) |
| 14 | |
| 15 | func getTablesCommand(t *testing.T, config string, format, filter string) (*cobra.Command, string) { |
| 16 | t.Helper() |
| 17 | |
| 18 | _, filename, _, _ := runtime.Caller(0) |
| 19 | currentDir := path.Dir(filename) |
| 20 | testConfig := path.Join(currentDir, "testdata", config) |
| 21 | tmpDir := t.TempDir() |
| 22 | outputDirectory := path.Join(tmpDir, "cq-docs") |
| 23 | cmd := NewCmdRoot() |
| 24 | args := []string{"tables", testConfig, "--output-dir", outputDirectory} |
| 25 | if format != "" { |
| 26 | args = append(args, "--format", format) |
| 27 | } |
| 28 | if filter != "" { |
| 29 | args = append(args, "--filter", filter) |
| 30 | } |
| 31 | cmd.SetArgs(append(args, testCommandArgs(t)...)) |
| 32 | return cmd, tmpDir |
| 33 | } |
| 34 | |
| 35 | func TestTables(t *testing.T) { |
| 36 | configs := []struct { |
no test coverage detected