[MM-57963] Log Name and DisplayName of groups (#26836)

Этот коммит содержится в:
Ben Schumacher
2024-07-08 21:25:21 +02:00
коммит произвёл GitHub
родитель 3513d310af
Коммит 0e6bfbdd26
4 изменённых файлов: 171 добавлений и 13 удалений

39
server/public/model/builtin_test.go Обычный файл
Просмотреть файл

@@ -0,0 +1,39 @@
package model
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestSafeDereference(t *testing.T) {
t.Run("any", func(t *testing.T) {
s := SafeDereference[any](nil)
assert.Nil(t, s)
})
t.Run("struct", func(t *testing.T) {
s := SafeDereference[struct{}](nil)
assert.Equal(t, struct{}{}, s)
s = SafeDereference(&struct{}{})
assert.Equal(t, struct{}{}, s)
})
t.Run("string", func(t *testing.T) {
s := SafeDereference[string](nil)
assert.Equal(t, "", s)
s = SafeDereference(NewString("foo"))
assert.Equal(t, "foo", s)
})
t.Run("string pointer", func(t *testing.T) {
s := SafeDereference[*string](nil)
assert.Nil(t, s)
f := NewString("foo")
s = SafeDereference(&f)
assert.Equal(t, f, s)
})
}