-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain_test.go
More file actions
20 lines (17 loc) · 793 Bytes
/
Copy pathmain_test.go
File metadata and controls
20 lines (17 loc) · 793 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package main
import (
"testing"
)
// Note: Direct testing of run() function is avoided due to flag.Parse() conflicts
// in the test environment (flags can only be defined once globally).
// The run() function logic is thoroughly covered through:
// - main_cli_test.go: Tests CLI struct methods (ParseFlags, ExecuteAction, ShowHelp)
// - integration_test.go: Tests full backup/restore workflows
// - Individual package tests: Test all underlying functionality
// TestMain exists to satisfy go test requirements for this package
func TestMain(m *testing.M) {
// The main() function itself cannot be easily unit tested due to os.Exit()
// and flag parsing constraints. Coverage for main logic is achieved through
// testing the run() function's components and integration tests.
m.Run()
}