/
githubmirror
/
grafana
Обзор
Документация
Войти
/
githubmirror
/
grafana
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
pkg/plugins/backendplugin/grpcplugin/log_wrapper_test.go
29 строк
755 B
Ryan McKinley
Chore: use any rather than interface{} (#74066)
30 авг 2023, 18:46
Не верифицирован
30 авг 2023, 18:46
025b2f3
Код
Авторство
О чём код?
package grpcplugin import ( "fmt" "testing" "time" "github.com/stretchr/testify/assert" ) func TestLogWrapper(t *testing.T) { tcs := []struct { args []any expectedResult []any }{ {args: []any{}, expectedResult: []any{}}, {args: []any{"1", "2", "3"}, expectedResult: []any{"1", "2", "3"}}, {args: []any{"1", "2"}, expectedResult: []any{"1", "2"}}, {args: []any{"1", "2", "timestamp", time.Now()}, expectedResult: []any{"1", "2"}}, {args: []any{"1", "2", "timestamp", time.Now(), "3", "4"}, expectedResult: []any{"1", "2", "3", "4"}}, } for i, tc := range tcs { t.Run(fmt.Sprintf("formatArgs testcase %d", i), func(t *testing.T) { res := formatArgs(tc.args...) assert.Exactly(t, tc.expectedResult, res) }) } }