(t *testing.T)
| 92 | } |
| 93 | |
| 94 | func TestLogsCommandFlagDefaults(t *testing.T) { |
| 95 | cmd := NewLogsCommand() |
| 96 | flags := cmd.Flags() |
| 97 | |
| 98 | tests := []struct { |
| 99 | flagName string |
| 100 | defaultValue string |
| 101 | }{ |
| 102 | {"start-date", ""}, |
| 103 | {"end-date", ""}, |
| 104 | {"engine", ""}, |
| 105 | {"output", ".github/aw/logs"}, // Updated to match actual default |
| 106 | {"ref", ""}, |
| 107 | {"after-run-id", "0"}, |
| 108 | {"before-run-id", "0"}, |
| 109 | {"repo", ""}, |
| 110 | {"artifacts", "[usage]"}, |
| 111 | } |
| 112 | |
| 113 | for _, tt := range tests { |
| 114 | t.Run(tt.flagName, func(t *testing.T) { |
| 115 | flag := flags.Lookup(tt.flagName) |
| 116 | require.NotNil(t, flag, "Flag should exist: %s", tt.flagName) |
| 117 | assert.Equal(t, tt.defaultValue, flag.DefValue, "Default value should match for flag: %s", tt.flagName) |
| 118 | }) |
| 119 | } |
| 120 | } |
| 121 | |
| 122 | func TestLogsCommandBooleanFlags(t *testing.T) { |
| 123 | cmd := NewLogsCommand() |
nothing calls this directly
no test coverage detected