refactor: simplify flag parsing in TestProdCommandFlagParsing

- Removed unused `--force` and `--domain` flags from the test case to streamline the flag parsing logic.
- Updated the test to focus on essential flags, enhancing clarity and maintainability.
This commit is contained in:
anonpenguin23 2025-11-11 06:52:31 +02:00
parent badaa920d9
commit b1732b2cbe
No known key found for this signature in database
GPG Key ID: 1CBB1FE35AFBEE30

View File

@ -42,14 +42,11 @@ func TestProdCommandFlagParsing(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
// Extract flags manually to verify parsing logic
force := false
isBootstrap := false
var vpsIP, domain, peersStr, bootstrapJoin string
var vpsIP, peersStr, bootstrapJoin string
for i, arg := range tt.args {
switch arg {
case "--force":
force = true
case "--bootstrap":
isBootstrap = true
case "--peers":
@ -60,10 +57,6 @@ func TestProdCommandFlagParsing(t *testing.T) {
if i+1 < len(tt.args) {
vpsIP = tt.args[i+1]
}
case "--domain":
if i+1 < len(tt.args) {
domain = tt.args[i+1]
}
case "--bootstrap-join":
if i+1 < len(tt.args) {
bootstrapJoin = tt.args[i+1]