MM-10189 Fixed inconsistency when using environment variables for MessageExportSettings (#8705)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
ffb834ec3c
Коммит
3b138c8b16
@@ -396,3 +396,25 @@ func sToP(s string) *string {
|
||||
func bToP(b bool) *bool {
|
||||
return &b
|
||||
}
|
||||
|
||||
func TestGetDefaultsFromStruct(t *testing.T) {
|
||||
s := struct {
|
||||
TestSettings struct {
|
||||
IntValue int
|
||||
BoolValue bool
|
||||
StringValue string
|
||||
}
|
||||
PointerToTestSettings *struct {
|
||||
Value int
|
||||
}
|
||||
}{}
|
||||
|
||||
defaults := getDefaultsFromStruct(s)
|
||||
|
||||
assert.Equal(t, defaults["TestSettings.IntValue"], 0)
|
||||
assert.Equal(t, defaults["TestSettings.BoolValue"], false)
|
||||
assert.Equal(t, defaults["TestSettings.StringValue"], "")
|
||||
assert.Equal(t, defaults["PointerToTestSettings.Value"], 0)
|
||||
assert.NotContains(t, defaults, "PointerToTestSettings")
|
||||
assert.Len(t, defaults, 4)
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user