(t *testing.T)
| 17 | ) |
| 18 | |
| 19 | func TestConfigureCmd_CommandStructure(t *testing.T) { |
| 20 | // Cleanup. |
| 21 | dirs.RemoveAllForTest() |
| 22 | |
| 23 | configCmd := configureCmd{} |
| 24 | celer := configs.NewCeler() |
| 25 | cmd := configCmd.Command(celer) |
| 26 | |
| 27 | // Test command basic properties |
| 28 | if cmd.Use != "configure" { |
| 29 | t.Errorf("Expected Use to be 'configure', got '%s'", cmd.Use) |
| 30 | } |
| 31 | |
| 32 | if cmd.Short == "" { |
| 33 | t.Error("Short description should not be empty") |
| 34 | } |
| 35 | |
| 36 | // Test flags existence |
| 37 | expectedFlags := []struct { |
| 38 | name string |
| 39 | shorthand string |
| 40 | }{ |
| 41 | {"platform", ""}, |
| 42 | {"project", ""}, |
| 43 | {"build-type", ""}, |
| 44 | {"jobs", ""}, |
| 45 | {"offline", ""}, |
| 46 | {"verbose", ""}, |
| 47 | {"downloads", ""}, |
| 48 | {"pkgcache-dir", ""}, |
| 49 | {"pkgcache-writable", ""}, |
| 50 | {"pkgcache-cache-artifacts", ""}, |
| 51 | {"pkgcache-cache-downloads", ""}, |
| 52 | {"proxy-host", ""}, |
| 53 | {"proxy-port", ""}, |
| 54 | {"ccache-enabled", ""}, |
| 55 | {"ccache-dir", ""}, |
| 56 | {"ccache-maxsize", ""}, |
| 57 | {"ccache-remote-storage", ""}, |
| 58 | {"ccache-remote-only", ""}, |
| 59 | {"port", ""}, |
| 60 | {"port-url", ""}, |
| 61 | {"port-ref", ""}, |
| 62 | } |
| 63 | |
| 64 | for _, ef := range expectedFlags { |
| 65 | flag := cmd.Flags().Lookup(ef.name) |
| 66 | if flag == nil { |
| 67 | t.Errorf("--%s flag should be defined", ef.name) |
| 68 | } |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | func TestConfigureCmd_Completion(t *testing.T) { |
| 73 | // Cleanup. |
nothing calls this directly
no test coverage detected