Select Git revision
copyable_test.go
copyable_test.go 489 B
// Copyright 2022 schukai GmbH
// SPDX-License-Identifier: AGPL-3.0
package configuration
import (
"github.com/stretchr/testify/assert"
"testing"
)
func TestCopyable(t *testing.T) {
config := struct {
Host string
Port int
}{
Host: "localhost",
Port: 8080,
}
c := New(config)
assert.Equal(t, c.Config().Host, "localhost")
assert.Equal(t, c.Config().Port, 8080)
m := map[string]any{
"Host": "1.2.3.4",
}
c.Copy(m)
assert.Equal(t, c.Config().Host, "1.2.3.4")
}