test(state): add comprehensive test coverage for internal/state package #80
1302
internal/state/state_test.go
Normal file
1302
internal/state/state_test.go
Normal file
File diff suppressed because it is too large
Load Diff
@@ -20,3 +20,19 @@ func NewForTest() *State {
|
|||||||
config: &config.Config{DataDir: ""},
|
config: &config.Config{DataDir: ""},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NewForTestWithDataDir creates a State backed by the given directory
|
||||||
|
// for tests that need file persistence.
|
||||||
|
func NewForTestWithDataDir(dataDir string) *State {
|
||||||
|
return &State{
|
||||||
|
log: slog.Default(),
|
||||||
|
snapshot: &Snapshot{
|
||||||
|
Version: stateVersion,
|
||||||
|
Domains: make(map[string]*DomainState),
|
||||||
|
Hostnames: make(map[string]*HostnameState),
|
||||||
|
Ports: make(map[string]*PortState),
|
||||||
|
Certificates: make(map[string]*CertificateState),
|
||||||
|
},
|
||||||
|
config: &config.Config{DataDir: dataDir},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user