/
githubmirror
/
photoprism
Обзор
Документация
Войти
/
githubmirror
/
photoprism
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
internal/entity/search/select_test.go
41 строка
1 KB
Michael Mayer
Backend: Move search package to /internal/entity/search
02 июл 2024, 08:39
02 июл 2024, 08:39
43b2b39
Код
Авторство
О чём код?
package search import ( "testing" "github.com/stretchr/testify/assert" ) func TestSelectString(t *testing.T) { t.Run("PhotoWildcard", func(t *testing.T) { // SelectCols returns a string containing the // comma separated column names. result := SelectString(Photo{}, []string{"*"}) assert.GreaterOrEqual(t, len(result), 1636) }) t.Run("PhotoGeoResult", func(t *testing.T) { // SelectCols returns a string containing // the selected column names. result := SelectString(Photo{}, SelectCols(GeoResult{}, []string{"*"})) t.Logf("PhotoGeoResult: %d cols, %#v", len(result), result) assert.GreaterOrEqual(t, len(result), 245) }) } func TestSelectCols(t *testing.T) { t.Run("PhotoWildcard", func(t *testing.T) { // SelectCols returns a string containing // the selected column names. result := SelectCols(Photo{}, []string{"*"}) assert.GreaterOrEqual(t, len(result), 83) }) t.Run("PhotoGeoResult", func(t *testing.T) { // SelectCols returns a string containing // the selected column names. result := SelectCols(Photo{}, SelectCols(GeoResult{}, []string{"*"})) t.Logf("PhotoGeoResult: %d cols, %#v", len(result), result) assert.GreaterOrEqual(t, len(result), 13) }) }