mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-07-28 03:02:02 +08:00

- Introduces `Config`, `ConfigFactory`, `ProviderFactory`, and `Service` interfaces in `config.go`, `provider.go`, and `service.go`. - Implements `NamedMap` for managing named factories in `named.go`. - Adds `ProviderSettings` and `ScopedProviderSettings` for managing provider settings in `setting.go`.
21 lines
320 B
Go
21 lines
320 B
Go
package factory
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestName(t *testing.T) {
|
|
assert.Equal(t, Name{name: "c1"}, MustNewName("c1"))
|
|
}
|
|
|
|
func TestNameWithInvalidCharacters(t *testing.T) {
|
|
_, err := NewName("c1%")
|
|
assert.Error(t, err)
|
|
|
|
assert.Panics(t, func() {
|
|
MustNewName("c1%")
|
|
})
|
|
}
|