mirror of
https://github.com/photoprism/photoprism.git
synced 2026-01-23 02:24:24 +00:00
CLI: Add "photoprism vision reset" command to reset metadata #5233
Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
parent
114f4033e0
commit
ee46794509
112 changed files with 2939 additions and 2274 deletions
|
|
@ -245,6 +245,7 @@ If anything in this file conflicts with the `Makefile` or the Developer Guide, t
|
|||
- For database updates, prefer the `entity.Values` type alias over raw `map[string]interface{}` so helpers stay type-safe and consistent with existing code.
|
||||
- Reach for `config.NewMinimalTestConfig(t.TempDir())` when a test only needs filesystem/config scaffolding, and use `config.NewMinimalTestConfigWithDb("<name>", t.TempDir())` when you need a fresh SQLite schema without the cached fixture snapshot.
|
||||
- Shared fixtures live under `storage/testdata`; `NewTestConfig("<pkg>")` already calls `InitializeTestData()`, but call `c.InitializeTestData()` (and optionally `c.AssertTestData(t)`) when you construct custom configs so originals/import/cache/temp exist. `InitializeTestData()` clears old data, downloads fixtures if needed, then calls `CreateDirectories()`.
|
||||
- `PhotoFixtures.Get()` and similar helpers return value copies; when a test needs the database-backed row (with associations preloaded), re-query by UID/ID using helpers like `entity.FindPhoto(entity.Photo{PhotoUID: ...})` so updates observe persisted IDs and in-memory caches stay coherent.
|
||||
- For slimmer tests that only need config objects, prefer the new helpers in `internal/config/test.go`: `NewMinimalTestConfig(t.TempDir())` when no database is needed, or `NewMinimalTestConfigWithDb("<pkg>", t.TempDir())` to spin up an isolated SQLite schema without seeding all fixtures.
|
||||
- When you need illustrative credentials (join tokens, client IDs/secrets, etc.), reuse the shared `Example*` constants (see `internal/service/cluster/examples.go`) so tests, docs, and examples stay consistent.
|
||||
|
||||
|
|
|
|||
|
|
@ -69,9 +69,7 @@ func SaveConfigOptions(router *gin.RouterGroup) {
|
|||
return
|
||||
}
|
||||
|
||||
type valueMap map[string]interface{}
|
||||
|
||||
v := make(valueMap)
|
||||
v := make(entity.Values)
|
||||
|
||||
if fs.FileExists(fileName) {
|
||||
yamlData, err := os.ReadFile(fileName)
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ func AddPhotoLabel(router *gin.RouterGroup) {
|
|||
}
|
||||
|
||||
if photoLabel.HasID() && photoLabel.Uncertainty > frm.Uncertainty {
|
||||
if updateErr := photoLabel.Updates(map[string]interface{}{
|
||||
if updateErr := photoLabel.Updates(entity.Values{
|
||||
"Uncertainty": frm.Uncertainty,
|
||||
"LabelSrc": entity.SrcManual,
|
||||
}); updateErr != nil {
|
||||
|
|
|
|||
|
|
@ -28,6 +28,9 @@ func TestMain(m *testing.M) {
|
|||
log.SetLevel(logrus.TraceLevel)
|
||||
event.AuditLog = log
|
||||
|
||||
// Remove temporary SQLite files before running the tests.
|
||||
fs.PurgeTestDbFiles(".", false)
|
||||
|
||||
tempDir, err := os.MkdirTemp("", "commands-test")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ var VisionCommands = &cli.Command{
|
|||
Subcommands: []*cli.Command{
|
||||
VisionListCommand,
|
||||
VisionRunCommand,
|
||||
VisionResetCommand,
|
||||
VisionSourcesCommand,
|
||||
VisionSaveCommand,
|
||||
},
|
||||
|
|
|
|||
116
internal/commands/vision_reset.go
Normal file
116
internal/commands/vision_reset.go
Normal file
|
|
@ -0,0 +1,116 @@
|
|||
package commands
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
"github.com/manifoldco/promptui"
|
||||
"github.com/urfave/cli/v2"
|
||||
|
||||
"github.com/photoprism/photoprism/internal/ai/vision"
|
||||
"github.com/photoprism/photoprism/internal/config"
|
||||
"github.com/photoprism/photoprism/internal/entity"
|
||||
"github.com/photoprism/photoprism/internal/entity/search"
|
||||
"github.com/photoprism/photoprism/internal/workers"
|
||||
)
|
||||
|
||||
// VisionResetCommand configures the command name, flags, and action.
|
||||
var VisionResetCommand = &cli.Command{
|
||||
Name: "reset",
|
||||
Usage: "Resets data generated by computer vision models for pictures that match the specified search filters",
|
||||
ArgsUsage: "[filter]...",
|
||||
Flags: []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "models",
|
||||
Aliases: []string{"m"},
|
||||
Usage: "computer vision `MODELS` to reset, e.g. caption or labels",
|
||||
Value: "",
|
||||
},
|
||||
&cli.IntFlag{
|
||||
Name: "count",
|
||||
Aliases: []string{"n"},
|
||||
Usage: "maximum `NUMBER` of pictures to be processed",
|
||||
Value: search.MaxResults,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "source",
|
||||
Aliases: []string{"s"},
|
||||
Usage: "generated data source `TYPE` to reset, e.g. vision or ollama",
|
||||
Value: entity.SrcVision,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "yes",
|
||||
Aliases: []string{"y"},
|
||||
Usage: "runs the command non-interactively",
|
||||
},
|
||||
},
|
||||
Action: visionResetAction,
|
||||
}
|
||||
|
||||
func visionResetAction(ctx *cli.Context) error {
|
||||
return CallWithDependencies(ctx, func(conf *config.Config) error {
|
||||
models := vision.ParseTypes(ctx.String("models"))
|
||||
resetCaptions := slices.Contains(models, vision.ModelTypeCaption)
|
||||
resetLabels := slices.Contains(models, vision.ModelTypeLabels)
|
||||
|
||||
if !resetCaptions && !resetLabels {
|
||||
log.Warn("vision: no resettable models were specified, nothing to reset")
|
||||
return nil
|
||||
}
|
||||
|
||||
selectedModels := make([]string, 0, 2)
|
||||
if resetCaptions {
|
||||
selectedModels = append(selectedModels, vision.ModelTypeCaption)
|
||||
}
|
||||
if resetLabels {
|
||||
selectedModels = append(selectedModels, vision.ModelTypeLabels)
|
||||
}
|
||||
|
||||
confirmed := RunNonInteractively(ctx.Bool("yes"))
|
||||
|
||||
if !confirmed && len(selectedModels) > 0 {
|
||||
label := fmt.Sprintf("Reset generated %s for matching pictures?", describeVisionModels(selectedModels))
|
||||
prompt := promptui.Prompt{Label: label, IsConfirm: true}
|
||||
if _, err := prompt.Run(); err != nil {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
worker := workers.NewVision(conf)
|
||||
filter := strings.TrimSpace(strings.Join(ctx.Args().Slice(), " "))
|
||||
return worker.Reset(
|
||||
filter,
|
||||
ctx.Int("count"),
|
||||
selectedModels,
|
||||
ctx.String("source"),
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
func describeVisionModels(models []string) string {
|
||||
descriptions := make([]string, 0, len(models))
|
||||
|
||||
for _, m := range models {
|
||||
switch m {
|
||||
case vision.ModelTypeCaption:
|
||||
descriptions = append(descriptions, "captions")
|
||||
case vision.ModelTypeLabels:
|
||||
descriptions = append(descriptions, "labels")
|
||||
default:
|
||||
descriptions = append(descriptions, m)
|
||||
}
|
||||
}
|
||||
|
||||
switch len(descriptions) {
|
||||
case 0:
|
||||
return "metadata"
|
||||
case 1:
|
||||
return descriptions[0]
|
||||
case 2:
|
||||
return descriptions[0] + " and " + descriptions[1]
|
||||
default:
|
||||
head := strings.Join(descriptions[:len(descriptions)-1], ", ")
|
||||
return head + ", and " + descriptions[len(descriptions)-1]
|
||||
}
|
||||
}
|
||||
30
internal/commands/vision_reset_test.go
Normal file
30
internal/commands/vision_reset_test.go
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
package commands
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/photoprism/photoprism/internal/entity"
|
||||
)
|
||||
|
||||
func TestVisionResetCommand(t *testing.T) {
|
||||
t.Run("ResetCaptionAndLabels", func(t *testing.T) {
|
||||
fixture := entity.PhotoFixtures.Get("VisionResetTarget")
|
||||
|
||||
args := []string{
|
||||
"reset",
|
||||
"--models=caption,labels",
|
||||
"--source=ollama",
|
||||
"--yes",
|
||||
fmt.Sprintf("uid:%s", fixture.PhotoUID),
|
||||
}
|
||||
|
||||
if output, err := RunWithTestContext(VisionResetCommand, args); err != nil {
|
||||
t.Fatalf("%T: %v", err, err)
|
||||
} else {
|
||||
assert.Empty(t, output)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
@ -34,7 +34,7 @@ var VisionRunCommand = &cli.Command{
|
|||
Name: "source",
|
||||
Aliases: []string{"s"},
|
||||
Value: entity.SrcImage,
|
||||
Usage: "custom data source `ROLE` e.g. default, image, meta, vision, or admin",
|
||||
Usage: "custom data source `TYPE` e.g. default, image, meta, vision, or admin",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "force",
|
||||
|
|
|
|||
|
|
@ -374,7 +374,7 @@ func (c *Config) SaveClusterUUID(uuid string) error {
|
|||
|
||||
fileName := c.OptionsYaml()
|
||||
|
||||
var m map[string]interface{}
|
||||
var m Map
|
||||
|
||||
if fs.FileExists(fileName) {
|
||||
if b, err := os.ReadFile(fileName); err == nil && len(b) > 0 {
|
||||
|
|
@ -383,7 +383,7 @@ func (c *Config) SaveClusterUUID(uuid string) error {
|
|||
}
|
||||
|
||||
if m == nil {
|
||||
m = map[string]interface{}{}
|
||||
m = Map{}
|
||||
}
|
||||
|
||||
m["ClusterUUID"] = uuid
|
||||
|
|
@ -418,14 +418,14 @@ func (c *Config) SaveNodeUUID(uuid string) error {
|
|||
|
||||
fileName := c.OptionsYaml()
|
||||
|
||||
var m map[string]interface{}
|
||||
var m Map
|
||||
if fs.FileExists(fileName) {
|
||||
if b, err := os.ReadFile(fileName); err == nil && len(b) > 0 {
|
||||
_ = yaml.Unmarshal(b, &m)
|
||||
}
|
||||
}
|
||||
if m == nil {
|
||||
m = map[string]interface{}{}
|
||||
m = Map{}
|
||||
}
|
||||
m["NodeUUID"] = uuid
|
||||
if b, err := yaml.Marshal(m); err != nil {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
package config
|
||||
|
||||
// Map is an alias for map[string]interface{}.
|
||||
type Map map[string]interface{}
|
||||
// Map is a shorthand alias for map[string]interface{}.
|
||||
type Map = map[string]interface{}
|
||||
|
|
|
|||
|
|
@ -338,7 +338,7 @@ func NewTestContext(args []string) *cli.Context {
|
|||
app.Copyright = "(c) 2018-2025 PhotoPrism UG. All rights reserved."
|
||||
app.EnableBashCompletion = true
|
||||
app.Flags = Flags.Cli()
|
||||
app.Metadata = map[string]interface{}{
|
||||
app.Metadata = Map{
|
||||
"Name": "PhotoPrism",
|
||||
"About": "PhotoPrism®",
|
||||
"Edition": "ce",
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ func AddPhotoToUserAlbums(photoUid string, albums []string, sortOrder, userUid s
|
|||
}
|
||||
|
||||
// Refresh updated timestamp.
|
||||
err = UpdateAlbum(albumUid, Map{"updated_at": TimeStamp()})
|
||||
err = UpdateAlbum(albumUid, Values{"updated_at": TimeStamp()})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -567,7 +567,7 @@ func (m *Album) UpdateTitleAndLocation(title, location, state, country, slug str
|
|||
|
||||
// Skip location?
|
||||
if location == "" && state == "" && (country == "" || country == "zz") {
|
||||
return m.Updates(Map{
|
||||
return m.Updates(Values{
|
||||
"album_title": m.AlbumTitle,
|
||||
"album_slug": m.AlbumSlug,
|
||||
})
|
||||
|
|
@ -575,7 +575,7 @@ func (m *Album) UpdateTitleAndLocation(title, location, state, country, slug str
|
|||
|
||||
m.SetLocation(location, state, country)
|
||||
|
||||
return m.Updates(Map{
|
||||
return m.Updates(Values{
|
||||
"album_title": m.AlbumTitle,
|
||||
"album_location": m.AlbumLocation,
|
||||
"album_state": m.AlbumState,
|
||||
|
|
@ -626,7 +626,7 @@ func (m *Album) UpdateTitleAndState(title, slug, stateName, countryCode string)
|
|||
|
||||
m.SetTitle(title)
|
||||
|
||||
return m.Updates(Map{"album_title": m.AlbumTitle, "album_slug": m.AlbumSlug, "album_location": m.AlbumLocation, "album_country": m.AlbumCountry, "album_state": m.AlbumState})
|
||||
return m.Updates(Values{"album_title": m.AlbumTitle, "album_slug": m.AlbumSlug, "album_location": m.AlbumLocation, "album_country": m.AlbumCountry, "album_state": m.AlbumState})
|
||||
}
|
||||
|
||||
// SaveForm updates the entity using form data and stores it in the database.
|
||||
|
|
@ -684,7 +684,7 @@ func (m *Album) UpdateFolder(albumPath, albumFilter string) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
if err := m.Updates(map[string]interface{}{
|
||||
if err := m.Updates(Values{
|
||||
"AlbumPath": albumPath,
|
||||
"AlbumFilter": albumFilter,
|
||||
"AlbumSlug": albumSlug,
|
||||
|
|
@ -747,7 +747,7 @@ func (m *Album) Delete() error {
|
|||
|
||||
now := Now()
|
||||
|
||||
if err := UnscopedDb().Model(m).UpdateColumns(Map{"updated_at": now, "deleted_at": now}).Error; err != nil {
|
||||
if err := UnscopedDb().Model(m).UpdateColumns(Values{"updated_at": now, "deleted_at": now}).Error; err != nil {
|
||||
return err
|
||||
} else {
|
||||
m.UpdatedAt = now
|
||||
|
|
@ -852,7 +852,7 @@ func (m *Album) AddPhotos(photos PhotosInterface) (added PhotoAlbums) {
|
|||
}
|
||||
|
||||
// Refresh updated timestamp.
|
||||
if err := UpdateAlbum(m.AlbumUID, Map{"updated_at": TimeStamp()}); err != nil {
|
||||
if err := UpdateAlbum(m.AlbumUID, Values{"updated_at": TimeStamp()}); err != nil {
|
||||
log.Errorf("album: %s (update %s)", err.Error(), m)
|
||||
}
|
||||
|
||||
|
|
@ -880,7 +880,7 @@ func (m *Album) RemovePhotos(UIDs []string) (removed PhotoAlbums) {
|
|||
}
|
||||
|
||||
// Refresh updated timestamp.
|
||||
if err := UpdateAlbum(m.AlbumUID, Map{"updated_at": TimeStamp()}); err != nil {
|
||||
if err := UpdateAlbum(m.AlbumUID, Values{"updated_at": TimeStamp()}); err != nil {
|
||||
log.Errorf("album: %s (update %s)", err.Error(), m)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import (
|
|||
|
||||
func TestUpdateAlbum(t *testing.T) {
|
||||
t.Run("InvalidUID", func(t *testing.T) {
|
||||
err := UpdateAlbum("xxx", Map{"album_title": "New Title", "album_slug": "new-slug"})
|
||||
err := UpdateAlbum("xxx", Values{"album_title": "New Title", "album_slug": "new-slug"})
|
||||
|
||||
assert.Error(t, err)
|
||||
})
|
||||
|
|
@ -800,7 +800,7 @@ func TestAlbum_Updates(t *testing.T) {
|
|||
|
||||
assert.Equal(t, "test-title", album.AlbumSlug)
|
||||
|
||||
if err := album.Updates(Map{"album_title": "New Title", "album_slug": "new-slug"}); err != nil {
|
||||
if err := album.Updates(Values{"album_title": "New Title", "album_slug": "new-slug"}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
|
|
@ -813,7 +813,7 @@ func TestAlbum_Updates(t *testing.T) {
|
|||
t.Run("NoUID", func(t *testing.T) {
|
||||
album := Album{}
|
||||
|
||||
err := album.Updates(Map{"album_title": "New Title", "album_slug": "new-slug"})
|
||||
err := album.Updates(Values{"album_title": "New Title", "album_slug": "new-slug"})
|
||||
|
||||
assert.Error(t, err)
|
||||
})
|
||||
|
|
|
|||
|
|
@ -629,7 +629,7 @@ func (m *User) SetAuthID(id, issuer string) *User {
|
|||
if m.HasUID() && m.AuthProvider != "" {
|
||||
if err := UnscopedDb().Model(&User{}).
|
||||
Where("user_uid <> ? AND auth_provider = ? AND auth_id = ? AND super_admin = 0", m.UserUID, m.AuthProvider, m.AuthID).
|
||||
Updates(map[string]interface{}{"auth_id": "", "auth_provider": authn.ProviderNone}).Error; err != nil {
|
||||
Updates(Values{"auth_id": "", "auth_provider": authn.ProviderNone}).Error; err != nil {
|
||||
event.AuditErr([]string{"user %s", "failed to resolve auth id conflicts", "%s"}, m.RefID, err)
|
||||
}
|
||||
}
|
||||
|
|
@ -644,7 +644,7 @@ func (m *User) UpdateAuthID(id, issuer string) error {
|
|||
}
|
||||
|
||||
// Update auth id and issuer record.
|
||||
return m.SetAuthID(id, issuer).Updates(Map{
|
||||
return m.SetAuthID(id, issuer).Updates(Values{
|
||||
"AuthID": m.AuthID,
|
||||
"AuthIssuer": m.AuthIssuer,
|
||||
})
|
||||
|
|
@ -721,7 +721,7 @@ func (m *User) UpdateUsername(login string) (err error) {
|
|||
}
|
||||
|
||||
// Save to database.
|
||||
return m.Updates(Map{
|
||||
return m.Updates(Values{
|
||||
"UserName": m.UserName,
|
||||
"DisplayName": m.DisplayName,
|
||||
})
|
||||
|
|
@ -1175,7 +1175,7 @@ func (m *User) RegenerateTokens() error {
|
|||
|
||||
m.GenerateTokens(true)
|
||||
|
||||
return m.Updates(Map{"PreviewToken": m.PreviewToken, "DownloadToken": m.DownloadToken})
|
||||
return m.Updates(Values{"PreviewToken": m.PreviewToken, "DownloadToken": m.DownloadToken})
|
||||
}
|
||||
|
||||
// RefreshShares updates the list of shares.
|
||||
|
|
@ -1440,5 +1440,5 @@ func (m *User) SetAvatar(thumb, thumbSrc string) error {
|
|||
m.Thumb = thumb
|
||||
m.ThumbSrc = thumbSrc
|
||||
|
||||
return m.Updates(Map{"Thumb": m.Thumb, "ThumbSrc": m.ThumbSrc})
|
||||
return m.Updates(Values{"Thumb": m.Thumb, "ThumbSrc": m.ThumbSrc})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ func (m *UserShare) UpdateLink(link Link) error {
|
|||
m.UpdatedAt = Now()
|
||||
m.ExpiresAt = link.ExpiresAt()
|
||||
|
||||
values := Map{
|
||||
values := Values{
|
||||
"link_uid": m.LinkUID,
|
||||
"expires_at": m.ExpiresAt,
|
||||
"comment": m.Comment,
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@ import (
|
|||
"reflect"
|
||||
)
|
||||
|
||||
// Map is an alias for map[string]interface{}.
|
||||
type Map = map[string]interface{}
|
||||
// Values is an shorthand alias for map[string]interface{}.
|
||||
type Values = map[string]interface{}
|
||||
|
||||
// ModelValues extracts Values from an entity model.
|
||||
func ModelValues(m interface{}, omit ...string) (result Map, omitted []interface{}, err error) {
|
||||
func ModelValues(m interface{}, omit ...string) (result Values, omitted []interface{}, err error) {
|
||||
mustOmit := func(name string) bool {
|
||||
for _, s := range omit {
|
||||
if name == s {
|
||||
|
|
@ -36,7 +36,7 @@ func ModelValues(m interface{}, omit ...string) (result Map, omitted []interface
|
|||
num := t.NumField()
|
||||
|
||||
omitted = make([]interface{}, 0, len(omit))
|
||||
result = make(map[string]interface{}, num)
|
||||
result = make(Values, num)
|
||||
|
||||
// Add exported fields to result.
|
||||
for i := 0; i < num; i++ {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ func TestModelValues(t *testing.T) {
|
|||
values, keys, err := ModelValues(m, "ID", "PhotoUID")
|
||||
|
||||
assert.Error(t, err)
|
||||
assert.IsType(t, Map{}, values)
|
||||
assert.IsType(t, Values{}, values)
|
||||
assert.Len(t, keys, 0)
|
||||
})
|
||||
t.Run("NewPhoto", func(t *testing.T) {
|
||||
|
|
@ -25,7 +25,7 @@ func TestModelValues(t *testing.T) {
|
|||
|
||||
assert.Len(t, keys, 0)
|
||||
assert.NotNil(t, values)
|
||||
assert.IsType(t, Map{}, values)
|
||||
assert.IsType(t, Values{}, values)
|
||||
})
|
||||
t.Run("ExistingPhoto", func(t *testing.T) {
|
||||
m := PhotoFixtures.Pointer("Photo01")
|
||||
|
|
@ -37,7 +37,7 @@ func TestModelValues(t *testing.T) {
|
|||
|
||||
assert.Len(t, keys, 2)
|
||||
assert.NotNil(t, values)
|
||||
assert.IsType(t, Map{}, values)
|
||||
assert.IsType(t, Values{}, values)
|
||||
})
|
||||
t.Run("NewFace", func(t *testing.T) {
|
||||
m := &Face{}
|
||||
|
|
@ -49,7 +49,7 @@ func TestModelValues(t *testing.T) {
|
|||
|
||||
assert.Len(t, keys, 0)
|
||||
assert.NotNil(t, values)
|
||||
assert.IsType(t, Map{}, values)
|
||||
assert.IsType(t, Values{}, values)
|
||||
})
|
||||
t.Run("ExistingFace", func(t *testing.T) {
|
||||
m := FaceFixtures.Pointer("john-doe")
|
||||
|
|
@ -61,6 +61,6 @@ func TestModelValues(t *testing.T) {
|
|||
|
||||
assert.Len(t, keys, 1)
|
||||
assert.NotNil(t, values)
|
||||
assert.IsType(t, Map{}, values)
|
||||
assert.IsType(t, Values{}, values)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ func (m *Face) SetEmbeddings(embeddings face.Embeddings) (err error) {
|
|||
// Matched updates the match timestamp.
|
||||
func (m *Face) Matched() error {
|
||||
m.MatchedAt = TimeStamp()
|
||||
return UnscopedDb().Model(m).UpdateColumns(Map{"MatchedAt": m.MatchedAt}).Error
|
||||
return UnscopedDb().Model(m).UpdateColumns(Values{"MatchedAt": m.MatchedAt}).Error
|
||||
}
|
||||
|
||||
// Embedding returns parsed face embedding.
|
||||
|
|
@ -197,7 +197,7 @@ func (m *Face) ResolveCollision(embeddings face.Embeddings) (resolved bool, err
|
|||
m.Collisions++
|
||||
m.CollisionRadius = dist
|
||||
UpdateFaces.Store(true)
|
||||
return true, m.Updates(Map{"Collisions": m.Collisions, "CollisionRadius": m.CollisionRadius, "FaceKind": m.FaceKind, "UpdatedAt": m.UpdatedAt, "MatchedAt": m.MatchedAt})
|
||||
return true, m.Updates(Values{"Collisions": m.Collisions, "CollisionRadius": m.CollisionRadius, "FaceKind": m.FaceKind, "UpdatedAt": m.UpdatedAt, "MatchedAt": m.MatchedAt})
|
||||
} else {
|
||||
m.MatchedAt = nil
|
||||
m.Collisions++
|
||||
|
|
@ -205,7 +205,7 @@ func (m *Face) ResolveCollision(embeddings face.Embeddings) (resolved bool, err
|
|||
UpdateFaces.Store(true)
|
||||
}
|
||||
|
||||
err = m.Updates(Map{"Collisions": m.Collisions, "CollisionRadius": m.CollisionRadius, "MatchedAt": m.MatchedAt})
|
||||
err = m.Updates(Values{"Collisions": m.Collisions, "CollisionRadius": m.CollisionRadius, "MatchedAt": m.MatchedAt})
|
||||
|
||||
if err != nil {
|
||||
return true, err
|
||||
|
|
@ -289,7 +289,7 @@ func (m *Face) SetSubjectUID(subjUid string) (err error) {
|
|||
Where("subj_src = ?", SrcAuto).
|
||||
Where("subj_uid <> ?", m.SubjUID).
|
||||
Where("marker_invalid = 0").
|
||||
UpdateColumns(Map{"subj_uid": m.SubjUID, "marker_review": false}).Error; err != nil {
|
||||
UpdateColumns(Values{"subj_uid": m.SubjUID, "marker_review": false}).Error; err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -354,7 +354,7 @@ func (m *Face) Delete() error {
|
|||
// Remove face id from markers before deleting.
|
||||
if err := Db().Model(&Marker{}).
|
||||
Where("face_id = ?", m.ID).
|
||||
UpdateColumns(Map{"face_id": "", "face_dist": -1}).Error; err != nil {
|
||||
UpdateColumns(Values{"face_id": "", "face_dist": -1}).Error; err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -529,7 +529,7 @@ func (m *File) Rename(fileName, rootName, filePath, fileBase string) error {
|
|||
log.Debugf("file %s: renaming %s to %s", clean.Log(m.FileUID), clean.Log(m.FileName), clean.Log(fileName))
|
||||
|
||||
// Update database row.
|
||||
if err := m.Updates(map[string]interface{}{
|
||||
if err := m.Updates(Values{
|
||||
"FileName": fileName,
|
||||
"FileRoot": rootName,
|
||||
"FileMissing": false,
|
||||
|
|
@ -545,7 +545,7 @@ func (m *File) Rename(fileName, rootName, filePath, fileBase string) error {
|
|||
|
||||
// Update photo path and name if possible.
|
||||
if p := m.RelatedPhoto(); p != nil {
|
||||
return p.Updates(map[string]interface{}{
|
||||
return p.Updates(Values{
|
||||
"PhotoPath": filePath,
|
||||
"PhotoName": fileBase,
|
||||
})
|
||||
|
|
@ -561,7 +561,7 @@ func (m *File) Undelete() error {
|
|||
}
|
||||
|
||||
// Update database row.
|
||||
err := m.Updates(map[string]interface{}{
|
||||
err := m.Updates(Values{
|
||||
"FileMissing": false,
|
||||
"DeletedAt": nil,
|
||||
})
|
||||
|
|
|
|||
|
|
@ -3052,6 +3052,48 @@ var FileFixtures = FileMap{
|
|||
UpdatedIn: 935962,
|
||||
DeletedAt: nil,
|
||||
},
|
||||
"vision-reset-cli.jpg": {
|
||||
ID: 2999500,
|
||||
Photo: PhotoFixtures.Pointer("VisionResetTarget"),
|
||||
PhotoID: PhotoFixtures.Pointer("VisionResetTarget").ID,
|
||||
PhotoUID: PhotoFixtures.Pointer("VisionResetTarget").PhotoUID,
|
||||
InstanceID: "a698ac56-6e7e-42b9-9c3e-visionrst01",
|
||||
FileUID: "ft3cs9f3enhosfcl",
|
||||
FileName: "2025/09/vision-reset-cli.jpg",
|
||||
FileRoot: RootOriginals,
|
||||
OriginalName: "vision-reset-cli.jpg",
|
||||
FileHash: "a0d1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9",
|
||||
FileSize: 512000,
|
||||
FileCodec: "jpeg",
|
||||
FileType: "jpg",
|
||||
MediaType: media.Image.String(),
|
||||
FileMime: "image/jpeg",
|
||||
FilePrimary: true,
|
||||
FileSidecar: false,
|
||||
FileVideo: false,
|
||||
FileMissing: false,
|
||||
FilePortrait: false,
|
||||
FileDuration: 0,
|
||||
FileWidth: 3840,
|
||||
FileHeight: 2160,
|
||||
FileOrientation: 1,
|
||||
FileProjection: "",
|
||||
FileAspectRatio: 1.7778,
|
||||
FileMainColor: "blue",
|
||||
FileColors: "112233445",
|
||||
FileLuminance: "556677889",
|
||||
FileDiff: 512,
|
||||
FileChroma: 18,
|
||||
FileError: "",
|
||||
Share: []FileShare{},
|
||||
Sync: []FileSync{},
|
||||
ModTime: time.Date(2024, 3, 15, 10, 5, 0, 0, time.UTC).Unix(),
|
||||
CreatedAt: time.Date(2024, 3, 15, 10, 0, 0, 0, time.UTC),
|
||||
CreatedIn: 123456,
|
||||
UpdatedAt: time.Date(2024, 3, 15, 10, 5, 0, 0, time.UTC),
|
||||
UpdatedIn: 123789,
|
||||
DeletedAt: nil,
|
||||
},
|
||||
}
|
||||
|
||||
var FileFixturesExampleJPG = FileFixtures["exampleFileName.jpg"]
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ func (m *Marker) UpdateFile(file *File) (updated bool) {
|
|||
|
||||
if !updated || m.MarkerUID == "" {
|
||||
return false
|
||||
} else if err := UnscopedDb().Model(m).UpdateColumns(Map{"file_uid": m.FileUID, "thumb": m.Thumb}).Error; err != nil {
|
||||
} else if err := UnscopedDb().Model(m).UpdateColumns(Values{"file_uid": m.FileUID, "thumb": m.Thumb}).Error; err != nil {
|
||||
log.Errorf("faces: failed assigning marker %s to file %s (%s)", m.MarkerUID, m.FileUID, err)
|
||||
return false
|
||||
} else {
|
||||
|
|
@ -256,7 +256,7 @@ func (m *Marker) SetFace(f *Face, dist float64) (updated bool, err error) {
|
|||
if m.SubjUID == f.SubjUID && m.FaceID == f.ID {
|
||||
// Update matching timestamp.
|
||||
m.MatchedAt = TimeStamp()
|
||||
return false, m.Updates(Map{"MatchedAt": m.MatchedAt})
|
||||
return false, m.Updates(Values{"MatchedAt": m.MatchedAt})
|
||||
}
|
||||
|
||||
// Remember current values for comparison.
|
||||
|
|
@ -302,7 +302,7 @@ func (m *Marker) SetFace(f *Face, dist float64) (updated bool, err error) {
|
|||
// Update matching timestamp.
|
||||
m.MatchedAt = TimeStamp()
|
||||
|
||||
if err := m.Updates(Map{"FaceID": m.FaceID, "FaceDist": m.FaceDist, "SubjUID": m.SubjUID, "SubjSrc": m.SubjSrc, "MarkerReview": false, "MatchedAt": m.MatchedAt}); err != nil {
|
||||
if err := m.Updates(Values{"FaceID": m.FaceID, "FaceDist": m.FaceDist, "SubjUID": m.SubjUID, "SubjSrc": m.SubjSrc, "MarkerReview": false, "MatchedAt": m.MatchedAt}); err != nil {
|
||||
return false, err
|
||||
} else if !updated {
|
||||
return false, nil
|
||||
|
|
@ -355,7 +355,7 @@ func (m *Marker) SyncSubject(updateRelated bool) (err error) {
|
|||
Where("face_id = ?", m.FaceID).
|
||||
Where("subj_src = ?", SrcAuto).
|
||||
Where("subj_uid <> ?", m.SubjUID).
|
||||
UpdateColumns(Map{"subj_uid": m.SubjUID, "subj_src": SrcAuto, "marker_review": false}).Error; err != nil {
|
||||
UpdateColumns(Values{"subj_uid": m.SubjUID, "subj_src": SrcAuto, "marker_review": false}).Error; err != nil {
|
||||
return fmt.Errorf("%s (update related markers)", err)
|
||||
} else if res.RowsAffected > 0 && m.face != nil {
|
||||
log.Debugf("markers: matched %s with %s", subj, m.FaceID)
|
||||
|
|
@ -472,7 +472,7 @@ func (m *Marker) ClearSubject(src string) error {
|
|||
}()
|
||||
|
||||
// Update index & resolve collisions.
|
||||
if err := m.Updates(Map{"MarkerName": "", "FaceID": "", "FaceDist": -1.0, "SubjUID": "", "SubjSrc": src}); err != nil {
|
||||
if err := m.Updates(Values{"MarkerName": "", "FaceID": "", "FaceDist": -1.0, "SubjUID": "", "SubjSrc": src}); err != nil {
|
||||
return err
|
||||
} else if m.face == nil {
|
||||
m.subject = nil
|
||||
|
|
@ -552,9 +552,9 @@ func (m *Marker) ClearFace() (updated bool, err error) {
|
|||
// Remove subject if set automatically.
|
||||
if m.SubjSrc == SrcAuto {
|
||||
m.SubjUID = ""
|
||||
err = m.Updates(Map{"FaceID": "", "FaceDist": -1.0, "SubjUID": "", "MatchedAt": m.MatchedAt})
|
||||
err = m.Updates(Values{"FaceID": "", "FaceDist": -1.0, "SubjUID": "", "MatchedAt": m.MatchedAt})
|
||||
} else {
|
||||
err = m.Updates(Map{"FaceID": "", "FaceDist": -1.0, "MatchedAt": m.MatchedAt})
|
||||
err = m.Updates(Values{"FaceID": "", "FaceDist": -1.0, "MatchedAt": m.MatchedAt})
|
||||
}
|
||||
|
||||
return updated, m.RefreshPhotos()
|
||||
|
|
@ -585,7 +585,7 @@ func (m *Marker) RefreshPhotos() error {
|
|||
// Matched updates the match timestamp.
|
||||
func (m *Marker) Matched() error {
|
||||
m.MatchedAt = TimeStamp()
|
||||
return UnscopedDb().Model(m).UpdateColumns(Map{"MatchedAt": m.MatchedAt}).Error
|
||||
return UnscopedDb().Model(m).UpdateColumns(Values{"MatchedAt": m.MatchedAt}).Error
|
||||
}
|
||||
|
||||
// Top returns the top Y coordinate as float64.
|
||||
|
|
|
|||
|
|
@ -285,7 +285,7 @@ func (m *Passcode) Valid(code string) (valid bool, recovery bool, err error) {
|
|||
// Set verified timestamp if nil.
|
||||
if valid && m.VerifiedAt == nil {
|
||||
m.VerifiedAt = TimeStamp()
|
||||
err = m.Updates(Map{"VerifiedAt": m.VerifiedAt})
|
||||
err = m.Updates(Values{"VerifiedAt": m.VerifiedAt})
|
||||
}
|
||||
|
||||
// Return result.
|
||||
|
|
@ -304,7 +304,7 @@ func (m *Passcode) Activate() (err error) {
|
|||
return authn.ErrPasscodeAlreadyActivated
|
||||
} else {
|
||||
m.ActivatedAt = TimeStamp()
|
||||
err = m.Updates(Map{"ActivatedAt": m.ActivatedAt})
|
||||
err = m.Updates(Values{"ActivatedAt": m.ActivatedAt})
|
||||
}
|
||||
|
||||
return err
|
||||
|
|
|
|||
|
|
@ -786,7 +786,7 @@ func (m *Photo) AddLabels(labels classify.Labels) {
|
|||
}
|
||||
|
||||
if photoLabel.HasID() && photoLabel.Uncertainty > classifyLabel.Uncertainty && photoLabel.Uncertainty < 100 {
|
||||
if err := photoLabel.Updates(map[string]interface{}{
|
||||
if err := photoLabel.Updates(Values{
|
||||
"Uncertainty": classifyLabel.Uncertainty,
|
||||
"LabelSrc": labelSrc,
|
||||
}); err != nil {
|
||||
|
|
@ -944,7 +944,7 @@ func (m *Photo) Delete(permanently bool) (files Files, err error) {
|
|||
}
|
||||
}
|
||||
|
||||
return files, m.Updates(map[string]interface{}{"DeletedAt": Now(), "PhotoQuality": -1})
|
||||
return files, m.Updates(Values{"DeletedAt": Now(), "PhotoQuality": -1})
|
||||
}
|
||||
|
||||
// DeletePermanently permanently removes a photo from the index.
|
||||
|
|
@ -1022,7 +1022,7 @@ func (m *Photo) SetFavorite(favorite bool) error {
|
|||
m.PhotoFavorite = favorite
|
||||
m.PhotoQuality = m.QualityScore()
|
||||
|
||||
if err := m.Updates(map[string]interface{}{"PhotoFavorite": m.PhotoFavorite, "PhotoQuality": m.PhotoQuality}); err != nil {
|
||||
if err := m.Updates(Values{"PhotoFavorite": m.PhotoFavorite, "PhotoQuality": m.PhotoQuality}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3600,6 +3600,66 @@ var PhotoFixtures = PhotoMap{
|
|||
PhotoStack: 0,
|
||||
PhotoFaces: 0,
|
||||
},
|
||||
"VisionResetTarget": {
|
||||
ID: 1999500,
|
||||
PhotoUID: "pt3cs9f5kvfxxvta",
|
||||
TakenAt: time.Date(2024, 3, 14, 15, 9, 26, 0, time.UTC),
|
||||
TakenAtLocal: time.Date(2024, 3, 14, 15, 9, 26, 0, time.UTC),
|
||||
TakenSrc: SrcMeta,
|
||||
PhotoType: MediaImage,
|
||||
TypeSrc: SrcAuto,
|
||||
PhotoTitle: "Vision Reset Fixture",
|
||||
TitleSrc: SrcAuto,
|
||||
PhotoCaption: "Generated caption for reset",
|
||||
CaptionSrc: SrcOllama,
|
||||
PhotoPath: "2025/09",
|
||||
PhotoName: "vision-reset-cli.jpg",
|
||||
OriginalName: "vision-reset-cli.jpg",
|
||||
PhotoFavorite: false,
|
||||
PhotoPrivate: false,
|
||||
PhotoScan: false,
|
||||
PhotoPanorama: false,
|
||||
TimeZone: "Europe/Berlin",
|
||||
Place: &UnknownPlace,
|
||||
PlaceID: UnknownPlace.ID,
|
||||
PlaceSrc: SrcAuto,
|
||||
Cell: &UnknownLocation,
|
||||
CellID: UnknownLocation.ID,
|
||||
CellAccuracy: 0,
|
||||
PhotoAltitude: 0,
|
||||
PhotoLat: 0,
|
||||
PhotoLng: 0,
|
||||
PhotoCountry: UnknownPlace.CountryCode(),
|
||||
PhotoYear: 2024,
|
||||
PhotoMonth: 3,
|
||||
PhotoDay: 14,
|
||||
PhotoIso: 800,
|
||||
PhotoExposure: "1/125",
|
||||
PhotoFocalLength: 35,
|
||||
PhotoFNumber: 11,
|
||||
PhotoQuality: 3,
|
||||
PhotoResolution: 20,
|
||||
Camera: &UnknownCamera,
|
||||
CameraID: UnknownCamera.ID,
|
||||
CameraSerial: "",
|
||||
CameraSrc: SrcAuto,
|
||||
Lens: &UnknownLens,
|
||||
LensID: UnknownLens.ID,
|
||||
Keywords: []Keyword{},
|
||||
Albums: []Album{},
|
||||
Files: []File{},
|
||||
Labels: []PhotoLabel{
|
||||
LabelFixtures.PhotoLabel(1999500, "landscape", 20, SrcOllama),
|
||||
},
|
||||
CreatedAt: time.Date(2024, 3, 15, 10, 0, 0, 0, time.UTC),
|
||||
UpdatedAt: time.Date(2024, 3, 15, 10, 5, 0, 0, time.UTC),
|
||||
EditedAt: nil,
|
||||
CheckedAt: &checkedTime,
|
||||
DeletedAt: nil,
|
||||
PhotoColor: 12,
|
||||
PhotoStack: 0,
|
||||
PhotoFaces: 0,
|
||||
},
|
||||
}
|
||||
|
||||
// CreatePhotoFixtures inserts known entities into the database for testing.
|
||||
|
|
|
|||
97
internal/entity/photo_reset.go
Normal file
97
internal/entity/photo_reset.go
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
package entity
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// ResetCaption clears the caption when it was generated by the specified source.
|
||||
// Returns true if the caption changed.
|
||||
func (m *Photo) ResetCaption(source string) (bool, error) {
|
||||
if m == nil {
|
||||
return false, fmt.Errorf("photo is nil")
|
||||
}
|
||||
|
||||
if !m.HasID() {
|
||||
return false, fmt.Errorf("photo id is missing")
|
||||
}
|
||||
|
||||
if !m.HasCaption() {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
src := strings.TrimSpace(strings.ToLower(source))
|
||||
current := strings.TrimSpace(strings.ToLower(m.CaptionSrc))
|
||||
|
||||
if src != "" && current != src {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
updates := Values{
|
||||
"PhotoCaption": "",
|
||||
"CaptionSrc": "",
|
||||
}
|
||||
|
||||
if err := Db().Model(m).Updates(updates).Error; err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
m.PhotoCaption = ""
|
||||
m.CaptionSrc = ""
|
||||
|
||||
if err := Db().Where("photo_id = ? AND label_src = ?", m.ID, SrcCaption).Delete(&PhotoLabel{}).Error; err != nil {
|
||||
return true, err
|
||||
}
|
||||
|
||||
if len(m.Labels) > 0 {
|
||||
filtered := m.Labels[:0]
|
||||
for _, pl := range m.Labels {
|
||||
if strings.EqualFold(pl.LabelSrc, SrcCaption) {
|
||||
continue
|
||||
}
|
||||
filtered = append(filtered, pl)
|
||||
}
|
||||
m.Labels = filtered
|
||||
}
|
||||
|
||||
FlushPhotoLabelCache()
|
||||
|
||||
return true, nil
|
||||
}
|
||||
|
||||
// ResetLabels removes labels assigned by the specified source and returns the number of labels removed.
|
||||
func (m *Photo) ResetLabels(source string) (int64, error) {
|
||||
if m == nil {
|
||||
return 0, fmt.Errorf("photo is nil")
|
||||
}
|
||||
|
||||
if !m.HasID() {
|
||||
return 0, fmt.Errorf("photo id is missing")
|
||||
}
|
||||
|
||||
src := strings.TrimSpace(strings.ToLower(source))
|
||||
if src == "" {
|
||||
return 0, nil
|
||||
}
|
||||
|
||||
res := Db().Where("photo_id = ? AND label_src = ?", m.ID, src).Delete(&PhotoLabel{})
|
||||
if res.Error != nil {
|
||||
return 0, res.Error
|
||||
}
|
||||
|
||||
if res.RowsAffected > 0 {
|
||||
if len(m.Labels) > 0 {
|
||||
filtered := m.Labels[:0]
|
||||
for _, pl := range m.Labels {
|
||||
if strings.EqualFold(strings.ToLower(pl.LabelSrc), src) {
|
||||
continue
|
||||
}
|
||||
filtered = append(filtered, pl)
|
||||
}
|
||||
m.Labels = filtered
|
||||
}
|
||||
FlushPhotoLabelCache()
|
||||
}
|
||||
|
||||
return res.RowsAffected, nil
|
||||
}
|
||||
95
internal/entity/photo_reset_test.go
Normal file
95
internal/entity/photo_reset_test.go
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
package entity
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/photoprism/photoprism/pkg/rnd"
|
||||
)
|
||||
|
||||
func TestPhotoResetCaption(t *testing.T) {
|
||||
photo := createTestPhoto(t)
|
||||
|
||||
require.NoError(t, Db().Model(&photo).Updates(Values{
|
||||
"PhotoCaption": "Generated caption",
|
||||
"CaptionSrc": SrcOllama,
|
||||
}).Error)
|
||||
|
||||
label := NewLabel(fmt.Sprintf("reset-caption-%s", rnd.GenerateUID(LabelUID)), 10)
|
||||
require.NoError(t, label.Create())
|
||||
|
||||
t.Cleanup(func() {
|
||||
_ = Db().Delete(&PhotoLabel{}, "photo_id = ?", photo.ID).Error
|
||||
_ = Db().Delete(label).Error
|
||||
})
|
||||
|
||||
require.NotNil(t, FirstOrCreatePhotoLabel(NewPhotoLabel(photo.ID, label.ID, 10, SrcCaption)))
|
||||
|
||||
changed, err := photo.ResetCaption(SrcOllama)
|
||||
require.NoError(t, err)
|
||||
assert.True(t, changed)
|
||||
|
||||
var refreshed Photo
|
||||
require.NoError(t, Db().First(&refreshed, photo.ID).Error)
|
||||
assert.Empty(t, refreshed.PhotoCaption)
|
||||
assert.Empty(t, refreshed.CaptionSrc)
|
||||
|
||||
var count int
|
||||
require.NoError(t, Db().Model(&PhotoLabel{}).Where("photo_id = ? AND label_src = ?", photo.ID, SrcCaption).Count(&count).Error)
|
||||
assert.Zero(t, count)
|
||||
|
||||
changed, err = photo.ResetCaption(SrcVision)
|
||||
require.NoError(t, err)
|
||||
assert.False(t, changed)
|
||||
}
|
||||
|
||||
func TestPhotoResetLabels(t *testing.T) {
|
||||
photo := createTestPhoto(t)
|
||||
|
||||
label := NewLabel(fmt.Sprintf("reset-label-%s", rnd.GenerateUID(LabelUID)), 10)
|
||||
require.NoError(t, label.Create())
|
||||
|
||||
t.Cleanup(func() {
|
||||
_ = Db().Delete(&PhotoLabel{}, "photo_id = ?", photo.ID).Error
|
||||
_ = Db().Delete(label).Error
|
||||
})
|
||||
|
||||
require.NotNil(t, FirstOrCreatePhotoLabel(NewPhotoLabel(photo.ID, label.ID, 10, SrcOllama)))
|
||||
|
||||
removed, err := photo.ResetLabels(SrcOllama)
|
||||
require.NoError(t, err)
|
||||
assert.EqualValues(t, 1, removed)
|
||||
|
||||
var count int
|
||||
require.NoError(t, Db().Model(&PhotoLabel{}).Where("photo_id = ? AND label_src = ?", photo.ID, SrcOllama).Count(&count).Error)
|
||||
assert.Zero(t, count)
|
||||
|
||||
removed, err = photo.ResetLabels(SrcVision)
|
||||
require.NoError(t, err)
|
||||
assert.Zero(t, removed)
|
||||
}
|
||||
|
||||
// createTestPhoto builds an isolated photo row so reset tests can mutate captions
|
||||
// and labels without relying on shared fixtures.
|
||||
func createTestPhoto(t *testing.T) Photo {
|
||||
photo := NewUserPhoto(false, "")
|
||||
now := time.Now()
|
||||
photo.TakenAt = now
|
||||
photo.TakenAtLocal = now
|
||||
photo.PhotoPath = "test-reset"
|
||||
photo.PhotoName = fmt.Sprintf("%s.jpg", rnd.GenerateUID(PhotoUID))
|
||||
photo.OriginalName = photo.PhotoName
|
||||
|
||||
require.NoError(t, Db().Create(&photo).Error)
|
||||
|
||||
t.Cleanup(func() {
|
||||
_ = Db().Delete(&PhotoLabel{}, "photo_id = ?", photo.ID).Error
|
||||
_ = Db().Delete(&Photo{}, photo.ID).Error
|
||||
})
|
||||
|
||||
return photo
|
||||
}
|
||||
|
|
@ -359,7 +359,7 @@ func TestPhoto_AddLabels(t *testing.T) {
|
|||
label := LabelFixtures.Get(labelName)
|
||||
assert.NoError(t, UnscopedDb().Model(&PhotoLabel{}).
|
||||
Where("photo_id = ? AND label_id = ?", photo.ID, label.ID).
|
||||
UpdateColumns(map[string]interface{}{"Uncertainty": uncertainty, "LabelSrc": src}).Error)
|
||||
UpdateColumns(Values{"Uncertainty": uncertainty, "LabelSrc": src}).Error)
|
||||
}
|
||||
|
||||
t.Run("OllamaReplacesLowerConfidence", func(t *testing.T) {
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ func MatchFaceMarkers() (affected int64, err error) {
|
|||
Where("face_id = ?", f.ID).
|
||||
Where("subj_src = ?", entity.SrcAuto).
|
||||
Where("subj_uid <> ?", f.SubjUID).
|
||||
UpdateColumns(entity.Map{"subj_uid": f.SubjUID, "marker_review": false}); res.Error != nil {
|
||||
UpdateColumns(entity.Values{"subj_uid": f.SubjUID, "marker_review": false}); res.Error != nil {
|
||||
return affected, err
|
||||
} else if res.RowsAffected > 0 {
|
||||
affected += res.RowsAffected
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ func RemoveInvalidMarkerReferences() (removed int64, err error) {
|
|||
result := Db().
|
||||
Model(&entity.Marker{}).
|
||||
Where("marker_invalid = 1 AND (subj_uid <> '' OR face_id <> '')").
|
||||
UpdateColumns(entity.Map{"subj_uid": "", "face_id": "", "face_dist": -1.0, "matched_at": nil})
|
||||
UpdateColumns(entity.Values{"subj_uid": "", "face_id": "", "face_dist": -1.0, "matched_at": nil})
|
||||
|
||||
return result.RowsAffected, result.Error
|
||||
}
|
||||
|
|
@ -138,7 +138,7 @@ func RemoveNonExistentMarkerFaces() (removed int64, err error) {
|
|||
Model(&entity.Marker{}).
|
||||
Where("marker_type = ?", entity.MarkerFace).
|
||||
Where(fmt.Sprintf("face_id <> '' AND face_id NOT IN (SELECT id FROM %s)", entity.Face{}.TableName())).
|
||||
UpdateColumns(entity.Map{"face_id": "", "face_dist": -1.0, "matched_at": nil})
|
||||
UpdateColumns(entity.Values{"face_id": "", "face_dist": -1.0, "matched_at": nil})
|
||||
|
||||
return result.RowsAffected, result.Error
|
||||
}
|
||||
|
|
@ -148,7 +148,7 @@ func RemoveNonExistentMarkerSubjects() (removed int64, err error) {
|
|||
result := Db().
|
||||
Model(&entity.Marker{}).
|
||||
Where(fmt.Sprintf("subj_uid <> '' AND subj_uid NOT IN (SELECT subj_uid FROM %s)", entity.Subject{}.TableName())).
|
||||
UpdateColumns(entity.Map{"subj_uid": "", "matched_at": nil})
|
||||
UpdateColumns(entity.Values{"subj_uid": "", "matched_at": nil})
|
||||
|
||||
return result.RowsAffected, result.Error
|
||||
}
|
||||
|
|
@ -214,7 +214,7 @@ func MarkersWithSubjectConflict() (results entity.Markers, err error) {
|
|||
func ResetFaceMarkerMatches() (removed int64, err error) {
|
||||
res := Db().Model(&entity.Marker{}).
|
||||
Where("subj_src = ? AND marker_type = ?", entity.SrcAuto, entity.MarkerFace).
|
||||
UpdateColumns(entity.Map{"marker_name": "", "subj_uid": "", "subj_src": "", "face_id": "", "face_dist": -1.0, "matched_at": nil})
|
||||
UpdateColumns(entity.Values{"marker_name": "", "subj_uid": "", "subj_src": "", "face_id": "", "face_dist": -1.0, "matched_at": nil})
|
||||
|
||||
return res.RowsAffected, res.Error
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,9 @@ func TestMain(m *testing.M) {
|
|||
log = logrus.StandardLogger()
|
||||
log.SetLevel(logrus.TraceLevel)
|
||||
|
||||
// Remove temporary SQLite files before running the tests.
|
||||
fs.PurgeTestDbFiles(".", false)
|
||||
|
||||
db := entity.InitTestDb(
|
||||
os.Getenv("PHOTOPRISM_TEST_DRIVER"),
|
||||
os.Getenv("PHOTOPRISM_TEST_DSN"))
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ func CreateMarkerSubjects() (affected int64, err error) {
|
|||
|
||||
name = m.MarkerName
|
||||
|
||||
if err := m.Updates(entity.Map{"SubjUID": subj.SubjUID, "MarkerReview": false}); err != nil {
|
||||
if err := m.Updates(entity.Values{"SubjUID": subj.SubjUID, "MarkerReview": false}); err != nil {
|
||||
return affected, err
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ func (m *Reaction) Save() (err error) {
|
|||
|
||||
reactedAt := TimeStamp()
|
||||
|
||||
values := Map{"reaction": m.Reaction, "reacted": gorm.Expr("reacted + 1"), "reacted_at": reactedAt}
|
||||
values := Values{"reaction": m.Reaction, "reacted": gorm.Expr("reacted + 1"), "reacted_at": reactedAt}
|
||||
|
||||
if err = Db().Model(Reaction{}).
|
||||
Where("uid = ? AND user_uid = ?", m.UID, m.UserUID).
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ func TestUserAlbums(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, 0, len(result))
|
||||
assert.Len(t, result, 0)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -144,7 +144,7 @@ func TestAlbums(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, 1, len(result))
|
||||
assert.Len(t, result, 1)
|
||||
assert.Equal(t, "christmas-2030", result[0].AlbumSlug)
|
||||
})
|
||||
t.Run("SearchWithMultipleFilters", func(t *testing.T) {
|
||||
|
|
@ -165,7 +165,7 @@ func TestAlbums(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, 1, len(result))
|
||||
assert.Len(t, result, 1)
|
||||
assert.Equal(t, "Empty Moment", result[0].AlbumTitle)
|
||||
})
|
||||
t.Run("SearchForYear/Month/Day", func(t *testing.T) {
|
||||
|
|
@ -184,7 +184,7 @@ func TestAlbums(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, 0, len(result))
|
||||
assert.Len(t, result, 0)
|
||||
})
|
||||
t.Run("SearchAlbumForYear", func(t *testing.T) {
|
||||
f := form.SearchAlbums{
|
||||
|
|
@ -203,7 +203,7 @@ func TestAlbums(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, 2, len(result))
|
||||
assert.Len(t, result, 2)
|
||||
})
|
||||
t.Run("Folders", func(t *testing.T) {
|
||||
query := form.NewAlbumSearch("19")
|
||||
|
|
@ -235,7 +235,7 @@ func TestAlbums(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, 2, len(result))
|
||||
assert.Len(t, result, 2)
|
||||
})
|
||||
t.Run("FolderSortNameReverse", func(t *testing.T) {
|
||||
f := form.SearchAlbums{
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ func TestPhotosFilterAlbum(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 4)
|
||||
assert.Len(t, photos, 4)
|
||||
})
|
||||
t.Run("Pet*", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -33,7 +33,7 @@ func TestPhotosFilterAlbum(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -47,7 +47,7 @@ func TestPhotosFilterAlbum(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -168,7 +168,7 @@ func TestPhotosFilterAlbum(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -290,7 +290,7 @@ func TestPhotosQueryAlbum(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 4)
|
||||
assert.Len(t, photos, 4)
|
||||
})
|
||||
t.Run("Pet*", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -303,7 +303,7 @@ func TestPhotosQueryAlbum(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -316,7 +316,7 @@ func TestPhotosQueryAlbum(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -329,7 +329,7 @@ func TestPhotosQueryAlbum(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -436,7 +436,7 @@ func TestPhotosQueryAlbum(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -478,7 +478,7 @@ func TestPhotosQueryAlbum(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ func TestPhotosFilterAlbums(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 4)
|
||||
assert.Len(t, photos, 4)
|
||||
})
|
||||
t.Run("Pet*", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -33,7 +33,7 @@ func TestPhotosFilterAlbums(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("Pet* pipe Berlin 2019", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -46,7 +46,7 @@ func TestPhotosFilterAlbums(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 4)
|
||||
assert.Len(t, photos, 4)
|
||||
})
|
||||
t.Run("Pet* whitespace pipe whitespace Berlin 2019", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -59,7 +59,7 @@ func TestPhotosFilterAlbums(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 4)
|
||||
assert.Len(t, photos, 4)
|
||||
})
|
||||
t.Run("Pet* or Berlin 2019", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -72,7 +72,7 @@ func TestPhotosFilterAlbums(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 4)
|
||||
assert.Len(t, photos, 4)
|
||||
})
|
||||
t.Run("Pet* OR Berlin 2019", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -85,7 +85,7 @@ func TestPhotosFilterAlbums(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 4)
|
||||
assert.Len(t, photos, 4)
|
||||
})
|
||||
t.Run("Pet* Ampersand Berlin 2019", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -98,7 +98,7 @@ func TestPhotosFilterAlbums(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("Pet* whitespace Ampersand whitespace Berlin 2019", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -111,7 +111,7 @@ func TestPhotosFilterAlbums(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("Pet* and Berlin 2019", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -124,7 +124,7 @@ func TestPhotosFilterAlbums(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("Pet* AND Berlin 2019", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -137,7 +137,7 @@ func TestPhotosFilterAlbums(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -150,7 +150,7 @@ func TestPhotosFilterAlbums(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -163,7 +163,7 @@ func TestPhotosFilterAlbums(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -189,7 +189,7 @@ func TestPhotosFilterAlbums(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -202,7 +202,7 @@ func TestPhotosFilterAlbums(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -228,7 +228,7 @@ func TestPhotosFilterAlbums(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -268,7 +268,7 @@ func TestPhotosFilterAlbums(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -307,7 +307,7 @@ func TestPhotosFilterAlbums(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -326,7 +326,7 @@ func TestPhotosFilterAlbums(t *testing.T) {
|
|||
t.Logf("query results: %#v", photos)
|
||||
}
|
||||
|
||||
assert.Equal(t, 1, len(photos))
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -392,7 +392,7 @@ func TestPhotosFilterAlbums(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("OrSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -418,7 +418,7 @@ func TestPhotosFilterAlbums(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("OrSearch2", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -444,7 +444,7 @@ func TestPhotosFilterAlbums(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("OrSearch3", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -473,7 +473,7 @@ func TestPhotosQueryAlbums(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 4)
|
||||
assert.Len(t, photos, 4)
|
||||
})
|
||||
t.Run("Pet*", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -486,7 +486,7 @@ func TestPhotosQueryAlbums(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("Pet* pipe Berlin 2019", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -499,7 +499,7 @@ func TestPhotosQueryAlbums(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 4)
|
||||
assert.Len(t, photos, 4)
|
||||
})
|
||||
t.Run("Pet* whitespace pipe whitespace Berlin 2019", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -512,7 +512,7 @@ func TestPhotosQueryAlbums(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 4)
|
||||
assert.Len(t, photos, 4)
|
||||
})
|
||||
t.Run("Pet* or Berlin 2019", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -525,7 +525,7 @@ func TestPhotosQueryAlbums(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 4)
|
||||
assert.Len(t, photos, 4)
|
||||
})
|
||||
t.Run("Pet* OR Berlin 2019", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -538,7 +538,7 @@ func TestPhotosQueryAlbums(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 4)
|
||||
assert.Len(t, photos, 4)
|
||||
})
|
||||
t.Run("Pet* Ampersand Berlin 2019", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -551,7 +551,7 @@ func TestPhotosQueryAlbums(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("Pet* whitespace Ampersand whitespace Berlin 2019", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -564,7 +564,7 @@ func TestPhotosQueryAlbums(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("Pet* and Berlin 2019", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -577,7 +577,7 @@ func TestPhotosQueryAlbums(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("Pet* AND Berlin 2019", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -590,7 +590,7 @@ func TestPhotosQueryAlbums(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -603,7 +603,7 @@ func TestPhotosQueryAlbums(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -616,7 +616,7 @@ func TestPhotosQueryAlbums(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -642,7 +642,7 @@ func TestPhotosQueryAlbums(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -655,7 +655,7 @@ func TestPhotosQueryAlbums(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -681,7 +681,7 @@ func TestPhotosQueryAlbums(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -721,7 +721,7 @@ func TestPhotosQueryAlbums(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -760,7 +760,7 @@ func TestPhotosQueryAlbums(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -779,7 +779,7 @@ func TestPhotosQueryAlbums(t *testing.T) {
|
|||
t.Logf("query results: %#v", photos)
|
||||
}
|
||||
|
||||
assert.Equal(t, 1, len(photos))
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -844,7 +844,7 @@ func TestPhotosQueryAlbums(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("OrSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -870,7 +870,7 @@ func TestPhotosQueryAlbums(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("OrSearch2", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -896,7 +896,7 @@ func TestPhotosQueryAlbums(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("OrSearch3", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ func TestPhotosFilterAlt(t *testing.T) {
|
|||
assert.GreaterOrEqual(t, -10, r.PhotoAltitude)
|
||||
assert.LessOrEqual(t, -10, r.PhotoAltitude)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("-100--5", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -44,7 +44,7 @@ func TestPhotosFilterAlt(t *testing.T) {
|
|||
assert.LessOrEqual(t, -100, r.PhotoAltitude)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("200-500", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -63,7 +63,7 @@ func TestPhotosFilterAlt(t *testing.T) {
|
|||
assert.LessOrEqual(t, 200, r.PhotoAltitude)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("200", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -77,7 +77,7 @@ func TestPhotosFilterAlt(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("invalid", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -112,7 +112,7 @@ func TestPhotosQueryAlt(t *testing.T) {
|
|||
assert.LessOrEqual(t, -10, r.PhotoAltitude)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("-100--5", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -131,7 +131,7 @@ func TestPhotosQueryAlt(t *testing.T) {
|
|||
assert.LessOrEqual(t, -100, r.PhotoAltitude)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("200-500", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -150,7 +150,7 @@ func TestPhotosQueryAlt(t *testing.T) {
|
|||
assert.LessOrEqual(t, 200, r.PhotoAltitude)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("200", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -163,7 +163,7 @@ func TestPhotosQueryAlt(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("invalid", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ func TestPhotosQueryAnimated(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos0), 1)
|
||||
assert.Len(t, photos0, 1)
|
||||
|
||||
t.Run("animated:yes", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -37,7 +37,7 @@ func TestPhotosQueryAnimated(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("false > yes", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -50,7 +50,7 @@ func TestPhotosQueryAnimated(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
f.Query = "animated:false"
|
||||
f.Merged = true
|
||||
|
||||
|
|
@ -72,7 +72,7 @@ func TestPhotosQueryAnimated(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -85,7 +85,7 @@ func TestPhotosQueryAnimated(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -98,7 +98,7 @@ func TestPhotosQueryAnimated(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -112,7 +112,7 @@ func TestPhotosQueryAnimated(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -125,7 +125,7 @@ func TestPhotosQueryAnimated(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -139,7 +139,7 @@ func TestPhotosQueryAnimated(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -152,7 +152,7 @@ func TestPhotosQueryAnimated(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -166,7 +166,7 @@ func TestPhotosQueryAnimated(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -180,7 +180,7 @@ func TestPhotosQueryAnimated(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -194,7 +194,7 @@ func TestPhotosQueryAnimated(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -208,7 +208,7 @@ func TestPhotosQueryAnimated(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -222,7 +222,7 @@ func TestPhotosQueryAnimated(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -236,7 +236,7 @@ func TestPhotosQueryAnimated(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -250,7 +250,7 @@ func TestPhotosQueryAnimated(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -264,7 +264,7 @@ func TestPhotosQueryAnimated(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -278,7 +278,7 @@ func TestPhotosQueryAnimated(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -292,7 +292,7 @@ func TestPhotosQueryAnimated(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -306,7 +306,7 @@ func TestPhotosQueryAnimated(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("AndSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -320,7 +320,7 @@ func TestPhotosQueryAnimated(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("OrSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -334,6 +334,6 @@ func TestPhotosQueryAnimated(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ func TestPhotosQueryArchived(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
f.Query = "archived:false"
|
||||
f.Merged = true
|
||||
|
||||
|
|
@ -59,7 +59,7 @@ func TestPhotosQueryArchived(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -72,7 +72,7 @@ func TestPhotosQueryArchived(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -85,7 +85,7 @@ func TestPhotosQueryArchived(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -99,7 +99,7 @@ func TestPhotosQueryArchived(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -112,7 +112,7 @@ func TestPhotosQueryArchived(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -126,7 +126,7 @@ func TestPhotosQueryArchived(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -139,7 +139,7 @@ func TestPhotosQueryArchived(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -154,7 +154,7 @@ func TestPhotosQueryArchived(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -168,7 +168,7 @@ func TestPhotosQueryArchived(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -182,7 +182,7 @@ func TestPhotosQueryArchived(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -196,7 +196,7 @@ func TestPhotosQueryArchived(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -210,7 +210,7 @@ func TestPhotosQueryArchived(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -224,7 +224,7 @@ func TestPhotosQueryArchived(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -238,7 +238,7 @@ func TestPhotosQueryArchived(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -252,7 +252,7 @@ func TestPhotosQueryArchived(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -266,7 +266,7 @@ func TestPhotosQueryArchived(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -280,7 +280,7 @@ func TestPhotosQueryArchived(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -294,7 +294,7 @@ func TestPhotosQueryArchived(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("AndSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -308,7 +308,7 @@ func TestPhotosQueryArchived(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("OrSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -322,6 +322,6 @@ func TestPhotosQueryArchived(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ func TestPhotosFilterCamera(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("Apple", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -33,7 +33,7 @@ func TestPhotosFilterCamera(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -46,7 +46,7 @@ func TestPhotosFilterCamera(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -59,7 +59,7 @@ func TestPhotosFilterCamera(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -72,7 +72,7 @@ func TestPhotosFilterCamera(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -85,7 +85,7 @@ func TestPhotosFilterCamera(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -98,7 +98,7 @@ func TestPhotosFilterCamera(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -111,7 +111,7 @@ func TestPhotosFilterCamera(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -124,7 +124,7 @@ func TestPhotosFilterCamera(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -138,7 +138,7 @@ func TestPhotosFilterCamera(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -151,7 +151,7 @@ func TestPhotosFilterCamera(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -164,7 +164,7 @@ func TestPhotosFilterCamera(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -177,7 +177,7 @@ func TestPhotosFilterCamera(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -190,7 +190,7 @@ func TestPhotosFilterCamera(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -203,7 +203,7 @@ func TestPhotosFilterCamera(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -217,7 +217,7 @@ func TestPhotosFilterCamera(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -231,7 +231,7 @@ func TestPhotosFilterCamera(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -244,7 +244,7 @@ func TestPhotosFilterCamera(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -257,7 +257,7 @@ func TestPhotosFilterCamera(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -270,7 +270,7 @@ func TestPhotosFilterCamera(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -286,7 +286,7 @@ func TestPhotosQueryCamera(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("Apple", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -299,7 +299,7 @@ func TestPhotosQueryCamera(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -312,7 +312,7 @@ func TestPhotosQueryCamera(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -325,7 +325,7 @@ func TestPhotosQueryCamera(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -338,7 +338,7 @@ func TestPhotosQueryCamera(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -351,7 +351,7 @@ func TestPhotosQueryCamera(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -364,7 +364,7 @@ func TestPhotosQueryCamera(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -377,7 +377,7 @@ func TestPhotosQueryCamera(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -390,7 +390,7 @@ func TestPhotosQueryCamera(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -404,7 +404,7 @@ func TestPhotosQueryCamera(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -417,7 +417,7 @@ func TestPhotosQueryCamera(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -430,7 +430,7 @@ func TestPhotosQueryCamera(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -443,7 +443,7 @@ func TestPhotosQueryCamera(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -456,7 +456,7 @@ func TestPhotosQueryCamera(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -469,7 +469,7 @@ func TestPhotosQueryCamera(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -483,7 +483,7 @@ func TestPhotosQueryCamera(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -496,7 +496,7 @@ func TestPhotosQueryCamera(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -509,7 +509,7 @@ func TestPhotosQueryCamera(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -522,7 +522,7 @@ func TestPhotosQueryCamera(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -535,6 +535,6 @@ func TestPhotosQueryCamera(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ func TestPhotosFilterCategory(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -33,7 +33,7 @@ func TestPhotosFilterCategory(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -46,7 +46,7 @@ func TestPhotosFilterCategory(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -59,7 +59,7 @@ func TestPhotosFilterCategory(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -72,7 +72,7 @@ func TestPhotosFilterCategory(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -85,7 +85,7 @@ func TestPhotosFilterCategory(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -98,7 +98,7 @@ func TestPhotosFilterCategory(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -112,7 +112,7 @@ func TestPhotosFilterCategory(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -125,7 +125,7 @@ func TestPhotosFilterCategory(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -138,7 +138,7 @@ func TestPhotosFilterCategory(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -151,7 +151,7 @@ func TestPhotosFilterCategory(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -164,7 +164,7 @@ func TestPhotosFilterCategory(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -219,7 +219,7 @@ func TestPhotosFilterCategory(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -232,7 +232,7 @@ func TestPhotosFilterCategory(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -245,7 +245,7 @@ func TestPhotosFilterCategory(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -261,7 +261,7 @@ func TestPhotosQueryCategory(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -274,7 +274,7 @@ func TestPhotosQueryCategory(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -287,7 +287,7 @@ func TestPhotosQueryCategory(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -300,7 +300,7 @@ func TestPhotosQueryCategory(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -313,7 +313,7 @@ func TestPhotosQueryCategory(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -326,7 +326,7 @@ func TestPhotosQueryCategory(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -339,7 +339,7 @@ func TestPhotosQueryCategory(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -353,7 +353,7 @@ func TestPhotosQueryCategory(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -366,7 +366,7 @@ func TestPhotosQueryCategory(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -379,7 +379,7 @@ func TestPhotosQueryCategory(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -392,7 +392,7 @@ func TestPhotosQueryCategory(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -405,7 +405,7 @@ func TestPhotosQueryCategory(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -418,7 +418,7 @@ func TestPhotosQueryCategory(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -432,7 +432,7 @@ func TestPhotosQueryCategory(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -445,7 +445,7 @@ func TestPhotosQueryCategory(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -458,7 +458,7 @@ func TestPhotosQueryCategory(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -471,7 +471,7 @@ func TestPhotosQueryCategory(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -484,6 +484,6 @@ func TestPhotosQueryCategory(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ func TestPhotosFilterCity(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
t.Log(len(photos))
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("Teotihuacán pipe Neustadt an der Weinstraße", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -73,7 +73,7 @@ func TestPhotosFilterCity(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("Teotihuacán OR Neustadt an der Weinstraße", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -86,7 +86,7 @@ func TestPhotosFilterCity(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -99,7 +99,7 @@ func TestPhotosFilterCity(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -112,7 +112,7 @@ func TestPhotosFilterCity(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -125,7 +125,7 @@ func TestPhotosFilterCity(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -138,7 +138,7 @@ func TestPhotosFilterCity(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -151,7 +151,7 @@ func TestPhotosFilterCity(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -164,7 +164,7 @@ func TestPhotosFilterCity(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -177,7 +177,7 @@ func TestPhotosFilterCity(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -191,7 +191,7 @@ func TestPhotosFilterCity(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -204,7 +204,7 @@ func TestPhotosFilterCity(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -217,7 +217,7 @@ func TestPhotosFilterCity(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -230,7 +230,7 @@ func TestPhotosFilterCity(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -243,7 +243,7 @@ func TestPhotosFilterCity(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -257,7 +257,7 @@ func TestPhotosFilterCity(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, 1, len(photos))
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -271,7 +271,7 @@ func TestPhotosFilterCity(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -284,7 +284,7 @@ func TestPhotosFilterCity(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 1, len(photos))
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -297,7 +297,7 @@ func TestPhotosFilterCity(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -310,7 +310,7 @@ func TestPhotosFilterCity(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -323,7 +323,7 @@ func TestPhotosFilterCity(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -352,7 +352,7 @@ func TestPhotosQueryCity(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("Teotihuacán pipe Neustadt an der Weinstraße", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -391,7 +391,7 @@ func TestPhotosQueryCity(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("Teotihuacán OR Neustadt an der Weinstraße", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -404,7 +404,7 @@ func TestPhotosQueryCity(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -417,7 +417,7 @@ func TestPhotosQueryCity(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -430,7 +430,7 @@ func TestPhotosQueryCity(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -443,7 +443,7 @@ func TestPhotosQueryCity(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -456,7 +456,7 @@ func TestPhotosQueryCity(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -469,7 +469,7 @@ func TestPhotosQueryCity(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -482,7 +482,7 @@ func TestPhotosQueryCity(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -495,7 +495,7 @@ func TestPhotosQueryCity(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -509,7 +509,7 @@ func TestPhotosQueryCity(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -522,7 +522,7 @@ func TestPhotosQueryCity(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -535,7 +535,7 @@ func TestPhotosQueryCity(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -548,7 +548,7 @@ func TestPhotosQueryCity(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -561,7 +561,7 @@ func TestPhotosQueryCity(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -574,7 +574,7 @@ func TestPhotosQueryCity(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -588,7 +588,7 @@ func TestPhotosQueryCity(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -601,7 +601,7 @@ func TestPhotosQueryCity(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -614,7 +614,7 @@ func TestPhotosQueryCity(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -627,7 +627,7 @@ func TestPhotosQueryCity(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -640,6 +640,6 @@ func TestPhotosQueryCity(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ func TestPhotosFilterColor(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -47,7 +47,7 @@ func TestPhotosFilterColor(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -60,7 +60,7 @@ func TestPhotosFilterColor(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -73,7 +73,7 @@ func TestPhotosFilterColor(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -86,7 +86,7 @@ func TestPhotosFilterColor(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -99,7 +99,7 @@ func TestPhotosFilterColor(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -112,7 +112,7 @@ func TestPhotosFilterColor(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -126,7 +126,7 @@ func TestPhotosFilterColor(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -139,7 +139,7 @@ func TestPhotosFilterColor(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -152,7 +152,7 @@ func TestPhotosFilterColor(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -165,7 +165,7 @@ func TestPhotosFilterColor(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -178,7 +178,7 @@ func TestPhotosFilterColor(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -191,7 +191,7 @@ func TestPhotosFilterColor(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -205,7 +205,7 @@ func TestPhotosFilterColor(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photosredorgreen), len(photos))
|
||||
assert.Len(t, photosredorgreen, len(photos))
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -219,7 +219,7 @@ func TestPhotosFilterColor(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photosblue))
|
||||
assert.Len(t, photos, len(photosblue))
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -232,7 +232,7 @@ func TestPhotosFilterColor(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -245,7 +245,7 @@ func TestPhotosFilterColor(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -258,7 +258,7 @@ func TestPhotosFilterColor(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -288,7 +288,7 @@ func TestPhotosQueryColor(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -301,7 +301,7 @@ func TestPhotosQueryColor(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -314,7 +314,7 @@ func TestPhotosQueryColor(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -327,7 +327,7 @@ func TestPhotosQueryColor(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -340,7 +340,7 @@ func TestPhotosQueryColor(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -353,7 +353,7 @@ func TestPhotosQueryColor(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -366,7 +366,7 @@ func TestPhotosQueryColor(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -380,7 +380,7 @@ func TestPhotosQueryColor(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -393,7 +393,7 @@ func TestPhotosQueryColor(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -406,7 +406,7 @@ func TestPhotosQueryColor(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -419,7 +419,7 @@ func TestPhotosQueryColor(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -432,7 +432,7 @@ func TestPhotosQueryColor(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -445,7 +445,7 @@ func TestPhotosQueryColor(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -459,7 +459,7 @@ func TestPhotosQueryColor(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photosredorgreen), len(photos))
|
||||
assert.Len(t, photosredorgreen, len(photos))
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -472,7 +472,7 @@ func TestPhotosQueryColor(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photosblue))
|
||||
assert.Len(t, photos, len(photosblue))
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -485,7 +485,7 @@ func TestPhotosQueryColor(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -498,7 +498,7 @@ func TestPhotosQueryColor(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -511,6 +511,6 @@ func TestPhotosQueryColor(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ func TestPhotosFilterCountry(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 7)
|
||||
assert.Len(t, photos, 7)
|
||||
})
|
||||
t.Run("mx", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -72,7 +72,7 @@ func TestPhotosFilterCountry(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -85,7 +85,7 @@ func TestPhotosFilterCountry(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -98,7 +98,7 @@ func TestPhotosFilterCountry(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -111,7 +111,7 @@ func TestPhotosFilterCountry(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -124,7 +124,7 @@ func TestPhotosFilterCountry(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -137,7 +137,7 @@ func TestPhotosFilterCountry(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -150,7 +150,7 @@ func TestPhotosFilterCountry(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -164,7 +164,7 @@ func TestPhotosFilterCountry(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -177,7 +177,7 @@ func TestPhotosFilterCountry(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -190,7 +190,7 @@ func TestPhotosFilterCountry(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -203,7 +203,7 @@ func TestPhotosFilterCountry(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -216,7 +216,7 @@ func TestPhotosFilterCountry(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -229,7 +229,7 @@ func TestPhotosFilterCountry(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -243,7 +243,7 @@ func TestPhotosFilterCountry(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -257,7 +257,7 @@ func TestPhotosFilterCountry(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -270,7 +270,7 @@ func TestPhotosFilterCountry(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -283,7 +283,7 @@ func TestPhotosFilterCountry(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -296,7 +296,7 @@ func TestPhotosFilterCountry(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -312,7 +312,7 @@ func TestPhotosQueryCountry(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 7)
|
||||
assert.Len(t, photos, 7)
|
||||
})
|
||||
t.Run("mx", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -365,7 +365,7 @@ func TestPhotosQueryCountry(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("mx OR de", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -378,7 +378,7 @@ func TestPhotosQueryCountry(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -391,7 +391,7 @@ func TestPhotosQueryCountry(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -404,7 +404,7 @@ func TestPhotosQueryCountry(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -417,7 +417,7 @@ func TestPhotosQueryCountry(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -430,7 +430,7 @@ func TestPhotosQueryCountry(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -443,7 +443,7 @@ func TestPhotosQueryCountry(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -456,7 +456,7 @@ func TestPhotosQueryCountry(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -469,7 +469,7 @@ func TestPhotosQueryCountry(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -483,7 +483,7 @@ func TestPhotosQueryCountry(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -496,7 +496,7 @@ func TestPhotosQueryCountry(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -509,7 +509,7 @@ func TestPhotosQueryCountry(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -522,7 +522,7 @@ func TestPhotosQueryCountry(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -535,7 +535,7 @@ func TestPhotosQueryCountry(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -548,7 +548,7 @@ func TestPhotosQueryCountry(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -562,7 +562,7 @@ func TestPhotosQueryCountry(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -575,7 +575,7 @@ func TestPhotosQueryCountry(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -588,7 +588,7 @@ func TestPhotosQueryCountry(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -601,7 +601,7 @@ func TestPhotosQueryCountry(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -614,6 +614,6 @@ func TestPhotosQueryCountry(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ func TestPhotosFilterDay(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 4)
|
||||
assert.Len(t, photos, 4)
|
||||
})
|
||||
t.Run("17", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -33,7 +33,7 @@ func TestPhotosFilterDay(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("1 pipe 17", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -46,7 +46,7 @@ func TestPhotosFilterDay(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 5)
|
||||
assert.Len(t, photos, 5)
|
||||
})
|
||||
t.Run("1 whitespace pipe whitespace 17", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -59,7 +59,7 @@ func TestPhotosFilterDay(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 5)
|
||||
assert.Len(t, photos, 5)
|
||||
})
|
||||
var f0 form.SearchPhotos
|
||||
|
||||
|
|
@ -77,7 +77,7 @@ func TestPhotosFilterDay(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -90,7 +90,7 @@ func TestPhotosFilterDay(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -103,7 +103,7 @@ func TestPhotosFilterDay(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -116,7 +116,7 @@ func TestPhotosFilterDay(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -129,7 +129,7 @@ func TestPhotosFilterDay(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -142,7 +142,7 @@ func TestPhotosFilterDay(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -155,7 +155,7 @@ func TestPhotosFilterDay(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -169,7 +169,7 @@ func TestPhotosFilterDay(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -182,7 +182,7 @@ func TestPhotosFilterDay(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -195,7 +195,7 @@ func TestPhotosFilterDay(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -208,7 +208,7 @@ func TestPhotosFilterDay(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -221,7 +221,7 @@ func TestPhotosFilterDay(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -234,7 +234,7 @@ func TestPhotosFilterDay(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -248,7 +248,7 @@ func TestPhotosFilterDay(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -262,7 +262,7 @@ func TestPhotosFilterDay(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -275,7 +275,7 @@ func TestPhotosFilterDay(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -288,7 +288,7 @@ func TestPhotosFilterDay(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -301,7 +301,7 @@ func TestPhotosFilterDay(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -317,7 +317,7 @@ func TestPhotosQueryDay(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 4)
|
||||
assert.Len(t, photos, 4)
|
||||
})
|
||||
t.Run("17", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -330,7 +330,7 @@ func TestPhotosQueryDay(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("1 pipe 17", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -343,7 +343,7 @@ func TestPhotosQueryDay(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 5)
|
||||
assert.Len(t, photos, 5)
|
||||
})
|
||||
t.Run("1 whitespace pipe whitespace 17", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -356,7 +356,7 @@ func TestPhotosQueryDay(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 5)
|
||||
assert.Len(t, photos, 5)
|
||||
})
|
||||
|
||||
var f0 form.SearchPhotos
|
||||
|
|
@ -376,7 +376,7 @@ func TestPhotosQueryDay(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -389,7 +389,7 @@ func TestPhotosQueryDay(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -402,7 +402,7 @@ func TestPhotosQueryDay(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -415,7 +415,7 @@ func TestPhotosQueryDay(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -428,7 +428,7 @@ func TestPhotosQueryDay(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -441,7 +441,7 @@ func TestPhotosQueryDay(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -454,7 +454,7 @@ func TestPhotosQueryDay(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -468,7 +468,7 @@ func TestPhotosQueryDay(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -481,7 +481,7 @@ func TestPhotosQueryDay(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -494,7 +494,7 @@ func TestPhotosQueryDay(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -507,7 +507,7 @@ func TestPhotosQueryDay(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -520,7 +520,7 @@ func TestPhotosQueryDay(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -533,7 +533,7 @@ func TestPhotosQueryDay(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -547,7 +547,7 @@ func TestPhotosQueryDay(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -560,7 +560,7 @@ func TestPhotosQueryDay(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -573,7 +573,7 @@ func TestPhotosQueryDay(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -586,7 +586,7 @@ func TestPhotosQueryDay(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -599,6 +599,6 @@ func TestPhotosQueryDay(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ func TestPhotosQueryError(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
f.Query = "error:false"
|
||||
f.Merged = true
|
||||
|
||||
|
|
@ -59,7 +59,7 @@ func TestPhotosQueryError(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -72,7 +72,7 @@ func TestPhotosQueryError(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -85,7 +85,7 @@ func TestPhotosQueryError(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -99,7 +99,7 @@ func TestPhotosQueryError(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -112,7 +112,7 @@ func TestPhotosQueryError(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -126,7 +126,7 @@ func TestPhotosQueryError(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -139,7 +139,7 @@ func TestPhotosQueryError(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -154,7 +154,7 @@ func TestPhotosQueryError(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -168,7 +168,7 @@ func TestPhotosQueryError(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -182,7 +182,7 @@ func TestPhotosQueryError(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -196,7 +196,7 @@ func TestPhotosQueryError(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -210,7 +210,7 @@ func TestPhotosQueryError(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -224,7 +224,7 @@ func TestPhotosQueryError(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -238,7 +238,7 @@ func TestPhotosQueryError(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -252,7 +252,7 @@ func TestPhotosQueryError(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -266,7 +266,7 @@ func TestPhotosQueryError(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -280,7 +280,7 @@ func TestPhotosQueryError(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -294,7 +294,7 @@ func TestPhotosQueryError(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("AndSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -308,7 +308,7 @@ func TestPhotosQueryError(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("OrSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -322,6 +322,6 @@ func TestPhotosQueryError(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ func TestPhotosFilterFNumber(t *testing.T) {
|
|||
assert.GreaterOrEqual(t, float32(3.2), r.PhotoFNumber)
|
||||
assert.LessOrEqual(t, float32(3.2), r.PhotoFNumber)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("3.5-5", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -44,7 +44,7 @@ func TestPhotosFilterFNumber(t *testing.T) {
|
|||
assert.LessOrEqual(t, float32(3.5), r.PhotoFNumber)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 3)
|
||||
assert.Len(t, photos, 3)
|
||||
})
|
||||
t.Run("3-10", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -63,7 +63,7 @@ func TestPhotosFilterFNumber(t *testing.T) {
|
|||
assert.LessOrEqual(t, float32(3), r.PhotoFNumber)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 5)
|
||||
assert.Len(t, photos, 5)
|
||||
})
|
||||
t.Run("8", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -77,7 +77,7 @@ func TestPhotosFilterFNumber(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("-100", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -126,7 +126,7 @@ func TestPhotosQueryFNumber(t *testing.T) {
|
|||
assert.LessOrEqual(t, float32(3.2), r.PhotoFNumber)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("3.5-5", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -144,7 +144,7 @@ func TestPhotosQueryFNumber(t *testing.T) {
|
|||
assert.GreaterOrEqual(t, float32(5), r.PhotoFNumber)
|
||||
assert.LessOrEqual(t, float32(3.5), r.PhotoFNumber)
|
||||
}
|
||||
assert.Equal(t, len(photos), 3)
|
||||
assert.Len(t, photos, 3)
|
||||
})
|
||||
t.Run("3-10", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -163,7 +163,7 @@ func TestPhotosQueryFNumber(t *testing.T) {
|
|||
assert.LessOrEqual(t, float32(3), r.PhotoFNumber)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 5)
|
||||
assert.Len(t, photos, 5)
|
||||
})
|
||||
t.Run("8", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -176,7 +176,7 @@ func TestPhotosQueryFNumber(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("-100", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ func TestPhotosFilterFace(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -38,7 +38,7 @@ func TestPhotosFilterFace(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
//TODO random result
|
||||
/*t.Run("CenterPercent", func(t *testing.T) {
|
||||
|
|
@ -52,7 +52,7 @@ func TestPhotosFilterFace(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})*/
|
||||
//TODO random result
|
||||
/*t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
|
|
@ -66,7 +66,7 @@ func TestPhotosFilterFace(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})*/
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -79,7 +79,7 @@ func TestPhotosFilterFace(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
//TODO random result
|
||||
/*t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
|
|
@ -93,7 +93,7 @@ func TestPhotosFilterFace(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})*/
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -106,7 +106,7 @@ func TestPhotosFilterFace(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -119,7 +119,7 @@ func TestPhotosFilterFace(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
//TODO random result
|
||||
/*t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
|
|
@ -134,7 +134,7 @@ func TestPhotosFilterFace(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})*/
|
||||
//TODO random result
|
||||
/*t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
|
|
@ -148,7 +148,7 @@ func TestPhotosFilterFace(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})*/
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -161,7 +161,7 @@ func TestPhotosFilterFace(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -174,7 +174,7 @@ func TestPhotosFilterFace(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
//TODO random result
|
||||
/*t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
|
|
@ -188,7 +188,7 @@ func TestPhotosFilterFace(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})*/
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -201,7 +201,7 @@ func TestPhotosFilterFace(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -215,7 +215,7 @@ func TestPhotosFilterFace(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -229,7 +229,7 @@ func TestPhotosFilterFace(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -242,7 +242,7 @@ func TestPhotosFilterFace(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
//TODO random result
|
||||
/*t.Run("CenterNumber", func(t *testing.T) {
|
||||
|
|
@ -256,7 +256,7 @@ func TestPhotosFilterFace(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})*/
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -269,7 +269,7 @@ func TestPhotosFilterFace(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -291,7 +291,7 @@ func TestPhotosQueryFace(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -304,7 +304,7 @@ func TestPhotosQueryFace(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
/*t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -318,7 +318,7 @@ func TestPhotosQueryFace(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
//TODO Why does it fail?
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -332,7 +332,7 @@ func TestPhotosQueryFace(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
//TODO Why does it fail?
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})*/
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -345,7 +345,7 @@ func TestPhotosQueryFace(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
/*t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -359,7 +359,7 @@ func TestPhotosQueryFace(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
//TODO Why does it fail?
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})*/
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -372,7 +372,7 @@ func TestPhotosQueryFace(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -385,7 +385,7 @@ func TestPhotosQueryFace(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
/*t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -400,7 +400,7 @@ func TestPhotosQueryFace(t *testing.T) {
|
|||
}
|
||||
//TODO Why does it fail?
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -415,7 +415,7 @@ func TestPhotosQueryFace(t *testing.T) {
|
|||
}
|
||||
//TODO Why does it fail?
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})*/
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -428,7 +428,7 @@ func TestPhotosQueryFace(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -441,7 +441,7 @@ func TestPhotosQueryFace(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
/*t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -456,7 +456,7 @@ func TestPhotosQueryFace(t *testing.T) {
|
|||
}
|
||||
//TODO Why does it fail?
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})*/
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -469,7 +469,7 @@ func TestPhotosQueryFace(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -483,7 +483,7 @@ func TestPhotosQueryFace(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -496,7 +496,7 @@ func TestPhotosQueryFace(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -509,7 +509,7 @@ func TestPhotosQueryFace(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
/*t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -524,7 +524,7 @@ func TestPhotosQueryFace(t *testing.T) {
|
|||
}
|
||||
//TODO Why does it fail?
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})*/
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -537,6 +537,6 @@ func TestPhotosQueryFace(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ func TestPhotosFilterFaces(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 6)
|
||||
assert.Len(t, photos, 6)
|
||||
})
|
||||
t.Run("1", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -38,7 +38,7 @@ func TestPhotosFilterFaces(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 6)
|
||||
assert.Len(t, photos, 6)
|
||||
})
|
||||
t.Run("2", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -51,7 +51,7 @@ func TestPhotosFilterFaces(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 3)
|
||||
assert.Len(t, photos, 3)
|
||||
})
|
||||
t.Run("5", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -64,7 +64,7 @@ func TestPhotosFilterFaces(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -77,7 +77,7 @@ func TestPhotosFilterFaces(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
//TODO random result
|
||||
/*t.Run("CenterPercent", func(t *testing.T) {
|
||||
|
|
@ -91,7 +91,7 @@ func TestPhotosFilterFaces(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})*/
|
||||
//TODO random result
|
||||
/*t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
|
|
@ -105,7 +105,7 @@ func TestPhotosFilterFaces(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})*/
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -118,7 +118,7 @@ func TestPhotosFilterFaces(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
//TODO random result
|
||||
/*t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
|
|
@ -132,7 +132,7 @@ func TestPhotosFilterFaces(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})*/
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -145,7 +145,7 @@ func TestPhotosFilterFaces(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -158,7 +158,7 @@ func TestPhotosFilterFaces(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
//TODO random result
|
||||
/*t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
|
|
@ -173,7 +173,7 @@ func TestPhotosFilterFaces(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})*/
|
||||
//TODO random result
|
||||
/*t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
|
|
@ -187,7 +187,7 @@ func TestPhotosFilterFaces(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})*/
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -200,7 +200,7 @@ func TestPhotosFilterFaces(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -213,7 +213,7 @@ func TestPhotosFilterFaces(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
//TODO random result
|
||||
/*t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
|
|
@ -227,7 +227,7 @@ func TestPhotosFilterFaces(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})*/
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -240,7 +240,7 @@ func TestPhotosFilterFaces(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -254,7 +254,7 @@ func TestPhotosFilterFaces(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -268,7 +268,7 @@ func TestPhotosFilterFaces(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -281,7 +281,7 @@ func TestPhotosFilterFaces(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
//TODO random result
|
||||
/*t.Run("CenterNumber", func(t *testing.T) {
|
||||
|
|
@ -295,7 +295,7 @@ func TestPhotosFilterFaces(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})*/
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -308,7 +308,7 @@ func TestPhotosFilterFaces(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -330,7 +330,7 @@ func TestPhotosQueryFaces(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 6)
|
||||
assert.Len(t, photos, 6)
|
||||
})
|
||||
t.Run("1", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -343,7 +343,7 @@ func TestPhotosQueryFaces(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 6)
|
||||
assert.Len(t, photos, 6)
|
||||
})
|
||||
t.Run("2", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -356,7 +356,7 @@ func TestPhotosQueryFaces(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 3)
|
||||
assert.Len(t, photos, 3)
|
||||
})
|
||||
t.Run("5", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -369,7 +369,7 @@ func TestPhotosQueryFaces(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -382,7 +382,7 @@ func TestPhotosQueryFaces(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
//TODO random result
|
||||
/*t.Run("CenterPercent", func(t *testing.T) {
|
||||
|
|
@ -396,7 +396,7 @@ func TestPhotosQueryFaces(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})*/
|
||||
//TODO random result
|
||||
/*t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
|
|
@ -410,7 +410,7 @@ func TestPhotosQueryFaces(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})*/
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -423,7 +423,7 @@ func TestPhotosQueryFaces(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
//TODO random result
|
||||
/*t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
|
|
@ -437,7 +437,7 @@ func TestPhotosQueryFaces(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})*/
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -450,7 +450,7 @@ func TestPhotosQueryFaces(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -463,7 +463,7 @@ func TestPhotosQueryFaces(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
//TODO random result
|
||||
/*t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
|
|
@ -478,7 +478,7 @@ func TestPhotosQueryFaces(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})*/
|
||||
//TODO random result
|
||||
/*t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
|
|
@ -492,7 +492,7 @@ func TestPhotosQueryFaces(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})*/
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -505,7 +505,7 @@ func TestPhotosQueryFaces(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -518,7 +518,7 @@ func TestPhotosQueryFaces(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
//TODO random result
|
||||
/*t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
|
|
@ -532,7 +532,7 @@ func TestPhotosQueryFaces(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})*/
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -545,7 +545,7 @@ func TestPhotosQueryFaces(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -559,7 +559,7 @@ func TestPhotosQueryFaces(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -572,7 +572,7 @@ func TestPhotosQueryFaces(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -585,7 +585,7 @@ func TestPhotosQueryFaces(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
//TODO random result
|
||||
/*t.Run("CenterNumber", func(t *testing.T) {
|
||||
|
|
@ -599,7 +599,7 @@ func TestPhotosQueryFaces(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})*/
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -612,6 +612,6 @@ func TestPhotosQueryFaces(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ func TestPhotosQueryFavorite(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos0), 6)
|
||||
assert.Len(t, photos0, 6)
|
||||
|
||||
t.Run("false > yes", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -37,7 +37,7 @@ func TestPhotosQueryFavorite(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
f.Query = "favorite:false"
|
||||
f.Merged = true
|
||||
|
||||
|
|
@ -59,7 +59,7 @@ func TestPhotosQueryFavorite(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -72,7 +72,7 @@ func TestPhotosQueryFavorite(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -85,7 +85,7 @@ func TestPhotosQueryFavorite(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -99,7 +99,7 @@ func TestPhotosQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -112,7 +112,7 @@ func TestPhotosQueryFavorite(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -126,7 +126,7 @@ func TestPhotosQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -139,7 +139,7 @@ func TestPhotosQueryFavorite(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -154,7 +154,7 @@ func TestPhotosQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -168,7 +168,7 @@ func TestPhotosQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -182,7 +182,7 @@ func TestPhotosQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -196,7 +196,7 @@ func TestPhotosQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -210,7 +210,7 @@ func TestPhotosQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -224,7 +224,7 @@ func TestPhotosQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -238,7 +238,7 @@ func TestPhotosQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -252,7 +252,7 @@ func TestPhotosQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -266,7 +266,7 @@ func TestPhotosQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -280,7 +280,7 @@ func TestPhotosQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -294,7 +294,7 @@ func TestPhotosQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("AndSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -308,7 +308,7 @@ func TestPhotosQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("OrSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -322,6 +322,6 @@ func TestPhotosQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ func TestPhotosFilterFilename(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("1990*", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -33,7 +33,7 @@ func TestPhotosFilterFilename(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 5)
|
||||
assert.Len(t, photos, 5)
|
||||
})
|
||||
t.Run("1990* pipe 2790/07/27900704_070228_D6D51B6C.jpg", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -46,7 +46,7 @@ func TestPhotosFilterFilename(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 6)
|
||||
assert.Len(t, photos, 6)
|
||||
})
|
||||
t.Run("1990* whitespace pipe whitespace 2790/07/27900704_070228_D6D51B6C.jpg", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -59,7 +59,7 @@ func TestPhotosFilterFilename(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 6, len(photos))
|
||||
assert.Len(t, photos, 6)
|
||||
})
|
||||
t.Run("1990* or 2790/07/27900704_070228_D6D51B6C.jpg", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -72,7 +72,7 @@ func TestPhotosFilterFilename(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -85,7 +85,7 @@ func TestPhotosFilterFilename(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 1, len(photos))
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -98,7 +98,7 @@ func TestPhotosFilterFilename(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -112,7 +112,7 @@ func TestPhotosFilterFilename(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -126,7 +126,7 @@ func TestPhotosFilterFilename(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -140,7 +140,7 @@ func TestPhotosFilterFilename(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -154,7 +154,7 @@ func TestPhotosFilterFilename(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -168,7 +168,7 @@ func TestPhotosFilterFilename(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -182,7 +182,7 @@ func TestPhotosFilterFilename(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -196,7 +196,7 @@ func TestPhotosFilterFilename(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -210,7 +210,7 @@ func TestPhotosFilterFilename(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -224,7 +224,7 @@ func TestPhotosFilterFilename(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -238,7 +238,7 @@ func TestPhotosFilterFilename(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithPipeWildcard", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -252,7 +252,7 @@ func TestPhotosFilterFilename(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterPipeWildcard", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -271,7 +271,7 @@ func TestPhotosFilterFilename(t *testing.T) {
|
|||
t.Logf("query results: %#v", photos)
|
||||
}
|
||||
|
||||
assert.Equal(t, 1, len(photos))
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithPipeWildcard", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -285,7 +285,7 @@ func TestPhotosFilterFilename(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -299,7 +299,7 @@ func TestPhotosFilterFilename(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -313,7 +313,7 @@ func TestPhotosFilterFilename(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, 1, len(photos))
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -327,7 +327,7 @@ func TestPhotosFilterFilename(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -340,7 +340,7 @@ func TestPhotosFilterFilename(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -354,7 +354,7 @@ func TestPhotosFilterFilename(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -368,7 +368,7 @@ func TestPhotosFilterFilename(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithDoubleQuotes", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -382,7 +382,7 @@ func TestPhotosFilterFilename(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterDoubleQuotes", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -396,7 +396,7 @@ func TestPhotosFilterFilename(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithDoubleQuotes", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -410,7 +410,7 @@ func TestPhotosFilterFilename(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithWhitespace", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -423,7 +423,7 @@ func TestPhotosFilterFilename(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterWhitespace", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -437,7 +437,7 @@ func TestPhotosFilterFilename(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithWhitespace", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -451,7 +451,7 @@ func TestPhotosFilterFilename(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("OrSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -464,7 +464,7 @@ func TestPhotosFilterFilename(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("OrSearch2", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -490,7 +490,7 @@ func TestPhotosFilterFilename(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("OrSearch4", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -503,7 +503,7 @@ func TestPhotosFilterFilename(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -519,7 +519,7 @@ func TestPhotosQueryFilename(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("1990*", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -532,7 +532,7 @@ func TestPhotosQueryFilename(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 5)
|
||||
assert.Len(t, photos, 5)
|
||||
})
|
||||
t.Run("1990* pipe 2790/07/27900704_070228_D6D51B6C.jpg", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -545,7 +545,7 @@ func TestPhotosQueryFilename(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 6)
|
||||
assert.Len(t, photos, 6)
|
||||
})
|
||||
t.Run("1990* whitespace pipe whitespace 2790/07/27900704_070228_D6D51B6C.jpg", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -558,7 +558,7 @@ func TestPhotosQueryFilename(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 6)
|
||||
assert.Len(t, photos, 6)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -571,7 +571,7 @@ func TestPhotosQueryFilename(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -584,7 +584,7 @@ func TestPhotosQueryFilename(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -598,7 +598,7 @@ func TestPhotosQueryFilename(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -612,7 +612,7 @@ func TestPhotosQueryFilename(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -626,7 +626,7 @@ func TestPhotosQueryFilename(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -640,7 +640,7 @@ func TestPhotosQueryFilename(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -654,7 +654,7 @@ func TestPhotosQueryFilename(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -668,7 +668,7 @@ func TestPhotosQueryFilename(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -682,7 +682,7 @@ func TestPhotosQueryFilename(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -696,7 +696,7 @@ func TestPhotosQueryFilename(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -710,7 +710,7 @@ func TestPhotosQueryFilename(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -724,7 +724,7 @@ func TestPhotosQueryFilename(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithPipeWildcard", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -738,7 +738,7 @@ func TestPhotosQueryFilename(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterPipeWildcard", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -757,7 +757,7 @@ func TestPhotosQueryFilename(t *testing.T) {
|
|||
t.Logf("query results: %#v", photos)
|
||||
}
|
||||
|
||||
assert.Equal(t, 1, len(photos))
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithPipeWildcard", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -771,7 +771,7 @@ func TestPhotosQueryFilename(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -785,7 +785,7 @@ func TestPhotosQueryFilename(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -799,7 +799,7 @@ func TestPhotosQueryFilename(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, 1, len(photos))
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -813,7 +813,7 @@ func TestPhotosQueryFilename(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -826,7 +826,7 @@ func TestPhotosQueryFilename(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -840,7 +840,7 @@ func TestPhotosQueryFilename(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -854,7 +854,7 @@ func TestPhotosQueryFilename(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithDoubleQuotes", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -912,7 +912,7 @@ func TestPhotosQueryFilename(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterWhitespace", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -926,7 +926,7 @@ func TestPhotosQueryFilename(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithWhitespace", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -940,7 +940,7 @@ func TestPhotosQueryFilename(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("OrSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -953,7 +953,7 @@ func TestPhotosQueryFilename(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("OrSearch2", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -980,7 +980,7 @@ func TestPhotosQueryFilename(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("OrSearch4", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -993,6 +993,6 @@ func TestPhotosQueryFilename(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ func TestPhotosFilterFilter(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 4)
|
||||
assert.Len(t, photos, 4)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -33,7 +33,7 @@ func TestPhotosFilterFilter(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -46,7 +46,7 @@ func TestPhotosFilterFilter(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 1, len(photos))
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -59,7 +59,7 @@ func TestPhotosFilterFilter(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -72,7 +72,7 @@ func TestPhotosFilterFilter(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -85,7 +85,7 @@ func TestPhotosFilterFilter(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -98,7 +98,7 @@ func TestPhotosFilterFilter(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -111,7 +111,7 @@ func TestPhotosFilterFilter(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -125,7 +125,7 @@ func TestPhotosFilterFilter(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -138,7 +138,7 @@ func TestPhotosFilterFilter(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -151,7 +151,7 @@ func TestPhotosFilterFilter(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -164,7 +164,7 @@ func TestPhotosFilterFilter(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -177,7 +177,7 @@ func TestPhotosFilterFilter(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -190,7 +190,7 @@ func TestPhotosFilterFilter(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -204,7 +204,7 @@ func TestPhotosFilterFilter(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -218,7 +218,7 @@ func TestPhotosFilterFilter(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -231,7 +231,7 @@ func TestPhotosFilterFilter(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -244,7 +244,7 @@ func TestPhotosFilterFilter(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -257,7 +257,7 @@ func TestPhotosFilterFilter(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -273,7 +273,7 @@ func TestPhotosQueryFilter(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -286,7 +286,7 @@ func TestPhotosQueryFilter(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 1, len(photos))
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -299,7 +299,7 @@ func TestPhotosQueryFilter(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -312,7 +312,7 @@ func TestPhotosQueryFilter(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -325,7 +325,7 @@ func TestPhotosQueryFilter(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -338,7 +338,7 @@ func TestPhotosQueryFilter(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -351,7 +351,7 @@ func TestPhotosQueryFilter(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -365,7 +365,7 @@ func TestPhotosQueryFilter(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -378,7 +378,7 @@ func TestPhotosQueryFilter(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -391,7 +391,7 @@ func TestPhotosQueryFilter(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -404,7 +404,7 @@ func TestPhotosQueryFilter(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -417,7 +417,7 @@ func TestPhotosQueryFilter(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -430,7 +430,7 @@ func TestPhotosQueryFilter(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -444,7 +444,7 @@ func TestPhotosQueryFilter(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -457,7 +457,7 @@ func TestPhotosQueryFilter(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -470,7 +470,7 @@ func TestPhotosQueryFilter(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -483,7 +483,7 @@ func TestPhotosQueryFilter(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -496,6 +496,6 @@ func TestPhotosQueryFilter(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ func TestPhotosFilterFocalLength(t *testing.T) {
|
|||
assert.GreaterOrEqual(t, 28, r.PhotoFocalLength)
|
||||
assert.LessOrEqual(t, 28, r.PhotoFocalLength)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("28-50", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -44,7 +44,7 @@ func TestPhotosFilterFocalLength(t *testing.T) {
|
|||
assert.LessOrEqual(t, 28, r.PhotoFocalLength)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 3)
|
||||
assert.Len(t, photos, 4)
|
||||
})
|
||||
t.Run("1-400", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -63,7 +63,7 @@ func TestPhotosFilterFocalLength(t *testing.T) {
|
|||
assert.LessOrEqual(t, 1, r.PhotoFocalLength)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 5)
|
||||
assert.Len(t, photos, 6)
|
||||
})
|
||||
t.Run("22", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -77,7 +77,7 @@ func TestPhotosFilterFocalLength(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("-100", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -126,7 +126,7 @@ func TestPhotosQueryFocalLength(t *testing.T) {
|
|||
assert.LessOrEqual(t, 28, r.PhotoFocalLength)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("28-30", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -145,7 +145,7 @@ func TestPhotosQueryFocalLength(t *testing.T) {
|
|||
assert.LessOrEqual(t, 28, r.PhotoFocalLength)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("1-400", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -164,7 +164,7 @@ func TestPhotosQueryFocalLength(t *testing.T) {
|
|||
assert.LessOrEqual(t, 1, r.PhotoFocalLength)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 5)
|
||||
assert.Len(t, photos, 6)
|
||||
})
|
||||
t.Run("18", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -177,7 +177,7 @@ func TestPhotosQueryFocalLength(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("-100", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ func TestPhotosFilterFolder(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("2790*", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -33,7 +33,7 @@ func TestPhotosFilterFolder(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("London", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -46,7 +46,7 @@ func TestPhotosFilterFolder(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("London whitespace pipe whitespace 2790/07", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -59,7 +59,7 @@ func TestPhotosFilterFolder(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("London pipe 2790/07", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -72,7 +72,7 @@ func TestPhotosFilterFolder(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -85,7 +85,7 @@ func TestPhotosFilterFolder(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -98,7 +98,7 @@ func TestPhotosFilterFolder(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -112,7 +112,7 @@ func TestPhotosFilterFolder(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -126,7 +126,7 @@ func TestPhotosFilterFolder(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -140,7 +140,7 @@ func TestPhotosFilterFolder(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -154,7 +154,7 @@ func TestPhotosFilterFolder(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -168,7 +168,7 @@ func TestPhotosFilterFolder(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -182,7 +182,7 @@ func TestPhotosFilterFolder(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -196,7 +196,7 @@ func TestPhotosFilterFolder(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -210,7 +210,7 @@ func TestPhotosFilterFolder(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 4)
|
||||
assert.Len(t, photos, 4)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -224,7 +224,7 @@ func TestPhotosFilterFolder(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -238,7 +238,7 @@ func TestPhotosFilterFolder(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -252,7 +252,7 @@ func TestPhotosFilterFolder(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -266,7 +266,7 @@ func TestPhotosFilterFolder(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -280,7 +280,7 @@ func TestPhotosFilterFolder(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -293,7 +293,7 @@ func TestPhotosFilterFolder(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -307,7 +307,7 @@ func TestPhotosFilterFolder(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -321,7 +321,7 @@ func TestPhotosFilterFolder(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("StartsWithDoubleQuotes", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -335,7 +335,7 @@ func TestPhotosFilterFolder(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterDoubleQuotes", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -349,7 +349,7 @@ func TestPhotosFilterFolder(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithDoubleQuotes", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -363,7 +363,7 @@ func TestPhotosFilterFolder(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithWhitespace", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -376,7 +376,7 @@ func TestPhotosFilterFolder(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterWhitespace", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -390,7 +390,7 @@ func TestPhotosFilterFolder(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithWhitespace", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -404,7 +404,7 @@ func TestPhotosFilterFolder(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("OrSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -417,7 +417,7 @@ func TestPhotosFilterFolder(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("OrSearch2", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -443,7 +443,7 @@ func TestPhotosFilterFolder(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("OrSearch4", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -456,7 +456,7 @@ func TestPhotosFilterFolder(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 5, len(photos))
|
||||
assert.Len(t, photos, 5)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -472,7 +472,7 @@ func TestPhotosQueryFolder(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("2790*", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -485,7 +485,7 @@ func TestPhotosQueryFolder(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("London", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -498,7 +498,7 @@ func TestPhotosQueryFolder(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("London whitespace pipe whitespace 2790/07", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -511,7 +511,7 @@ func TestPhotosQueryFolder(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("London pipe 2790/07", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -524,7 +524,7 @@ func TestPhotosQueryFolder(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -537,7 +537,7 @@ func TestPhotosQueryFolder(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -550,7 +550,7 @@ func TestPhotosQueryFolder(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -564,7 +564,7 @@ func TestPhotosQueryFolder(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -578,7 +578,7 @@ func TestPhotosQueryFolder(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -592,7 +592,7 @@ func TestPhotosQueryFolder(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -606,7 +606,7 @@ func TestPhotosQueryFolder(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -620,7 +620,7 @@ func TestPhotosQueryFolder(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -634,7 +634,7 @@ func TestPhotosQueryFolder(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -648,7 +648,7 @@ func TestPhotosQueryFolder(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -662,7 +662,7 @@ func TestPhotosQueryFolder(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 4)
|
||||
assert.Len(t, photos, 4)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -676,7 +676,7 @@ func TestPhotosQueryFolder(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -690,7 +690,7 @@ func TestPhotosQueryFolder(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -704,7 +704,7 @@ func TestPhotosQueryFolder(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -718,7 +718,7 @@ func TestPhotosQueryFolder(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -732,7 +732,7 @@ func TestPhotosQueryFolder(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -745,7 +745,7 @@ func TestPhotosQueryFolder(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -759,7 +759,7 @@ func TestPhotosQueryFolder(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -773,7 +773,7 @@ func TestPhotosQueryFolder(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("StartsWithDoubleQuotes", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -830,7 +830,7 @@ func TestPhotosQueryFolder(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterWhitespace", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -844,7 +844,7 @@ func TestPhotosQueryFolder(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithWhitespace", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -858,7 +858,7 @@ func TestPhotosQueryFolder(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("OrSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -871,7 +871,7 @@ func TestPhotosQueryFolder(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("OrSearch2", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -897,7 +897,7 @@ func TestPhotosQueryFolder(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("OrSearch4", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -910,6 +910,6 @@ func TestPhotosQueryFolder(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 5, len(photos))
|
||||
assert.Len(t, photos, 5)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ func TestPhotosQueryGeo(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -75,7 +75,7 @@ func TestPhotosQueryGeo(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -88,7 +88,7 @@ func TestPhotosQueryGeo(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -102,7 +102,7 @@ func TestPhotosQueryGeo(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -115,7 +115,7 @@ func TestPhotosQueryGeo(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -129,7 +129,7 @@ func TestPhotosQueryGeo(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -142,7 +142,7 @@ func TestPhotosQueryGeo(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -157,7 +157,7 @@ func TestPhotosQueryGeo(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -171,7 +171,7 @@ func TestPhotosQueryGeo(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -185,7 +185,7 @@ func TestPhotosQueryGeo(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -199,7 +199,7 @@ func TestPhotosQueryGeo(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -213,7 +213,7 @@ func TestPhotosQueryGeo(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -227,7 +227,7 @@ func TestPhotosQueryGeo(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -241,7 +241,7 @@ func TestPhotosQueryGeo(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -255,7 +255,7 @@ func TestPhotosQueryGeo(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -269,7 +269,7 @@ func TestPhotosQueryGeo(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -283,7 +283,7 @@ func TestPhotosQueryGeo(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -297,7 +297,7 @@ func TestPhotosQueryGeo(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("AndSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -311,7 +311,7 @@ func TestPhotosQueryGeo(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("OrSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -325,6 +325,6 @@ func TestPhotosQueryGeo(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ func TestPhotosFilterHash(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("pcad9168fa6acc5c5c2965adf6ec465ca42fd340", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -33,7 +33,7 @@ func TestPhotosFilterHash(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("pcad9168fa6acc5c5c2965adf6ec465ca42fd340 pipe 2cad9168fa6acc5c5c2965ddf6ec465ca42fd818 ", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -46,7 +46,7 @@ func TestPhotosFilterHash(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
/*t.Run("pcad9168fa6acc5c5c2965adf6ec465ca42fd340 whitespace pipe whitespace 2cad9168fa6acc5c5c2965ddf6ec465ca42fd818 ", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -59,7 +59,7 @@ func TestPhotosFilterHash(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("pcad9168fa6acc5c5c2965adf6ec465ca42fd340 or 2cad9168fa6acc5c5c2965ddf6ec465ca42fd818 ", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -72,7 +72,7 @@ func TestPhotosFilterHash(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("pcad9168fa6acc5c5c2965adf6ec465ca42fd340 OR 2cad9168fa6acc5c5c2965ddf6ec465ca42fd818 ", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -85,7 +85,7 @@ func TestPhotosFilterHash(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("pcad9168fa6acc5c5c2965adf6ec465ca42fd34*", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -111,7 +111,7 @@ func TestPhotosFilterHash(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -124,7 +124,7 @@ func TestPhotosFilterHash(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -137,7 +137,7 @@ func TestPhotosFilterHash(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -150,7 +150,7 @@ func TestPhotosFilterHash(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -163,7 +163,7 @@ func TestPhotosFilterHash(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -176,7 +176,7 @@ func TestPhotosFilterHash(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -189,7 +189,7 @@ func TestPhotosFilterHash(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -203,7 +203,7 @@ func TestPhotosFilterHash(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -216,7 +216,7 @@ func TestPhotosFilterHash(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -229,7 +229,7 @@ func TestPhotosFilterHash(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -242,7 +242,7 @@ func TestPhotosFilterHash(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -255,7 +255,7 @@ func TestPhotosFilterHash(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -268,7 +268,7 @@ func TestPhotosFilterHash(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -282,7 +282,7 @@ func TestPhotosFilterHash(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -296,7 +296,7 @@ func TestPhotosFilterHash(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -309,7 +309,7 @@ func TestPhotosFilterHash(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -322,7 +322,7 @@ func TestPhotosFilterHash(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -335,7 +335,7 @@ func TestPhotosFilterHash(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -351,7 +351,7 @@ func TestPhotosQueryHash(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("pcad9168fa6acc5c5c2965adf6ec465ca42fd340", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -364,7 +364,7 @@ func TestPhotosQueryHash(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("pcad9168fa6acc5c5c2965adf6ec465ca42fd340 pipe 2cad9168fa6acc5c5c2965ddf6ec465ca42fd818 ", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -377,7 +377,7 @@ func TestPhotosQueryHash(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
/*t.Run("pcad9168fa6acc5c5c2965adf6ec465ca42fd340 whitespace pipe whitespace 2cad9168fa6acc5c5c2965ddf6ec465ca42fd818 ", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -390,7 +390,7 @@ func TestPhotosQueryHash(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("pcad9168fa6acc5c5c2965adf6ec465ca42fd340 or 2cad9168fa6acc5c5c2965ddf6ec465ca42fd818 ", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -403,7 +403,7 @@ func TestPhotosQueryHash(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("pcad9168fa6acc5c5c2965adf6ec465ca42fd340 OR 2cad9168fa6acc5c5c2965ddf6ec465ca42fd818 ", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -416,7 +416,7 @@ func TestPhotosQueryHash(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("pcad9168fa6acc5c5c2965adf6ec465ca42fd34*", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -442,7 +442,7 @@ func TestPhotosQueryHash(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -455,7 +455,7 @@ func TestPhotosQueryHash(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -468,7 +468,7 @@ func TestPhotosQueryHash(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -481,7 +481,7 @@ func TestPhotosQueryHash(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -494,7 +494,7 @@ func TestPhotosQueryHash(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -507,7 +507,7 @@ func TestPhotosQueryHash(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -520,7 +520,7 @@ func TestPhotosQueryHash(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -534,7 +534,7 @@ func TestPhotosQueryHash(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -547,7 +547,7 @@ func TestPhotosQueryHash(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -560,7 +560,7 @@ func TestPhotosQueryHash(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -573,7 +573,7 @@ func TestPhotosQueryHash(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -586,7 +586,7 @@ func TestPhotosQueryHash(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -599,7 +599,7 @@ func TestPhotosQueryHash(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -613,7 +613,7 @@ func TestPhotosQueryHash(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -626,7 +626,7 @@ func TestPhotosQueryHash(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -639,7 +639,7 @@ func TestPhotosQueryHash(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -652,7 +652,7 @@ func TestPhotosQueryHash(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -665,6 +665,6 @@ func TestPhotosQueryHash(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ func TestPhotosQueryHidden(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
f.Query = "hidden:false"
|
||||
f.Merged = true
|
||||
|
||||
|
|
@ -59,7 +59,7 @@ func TestPhotosQueryHidden(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -72,7 +72,7 @@ func TestPhotosQueryHidden(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -85,7 +85,7 @@ func TestPhotosQueryHidden(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -99,7 +99,7 @@ func TestPhotosQueryHidden(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -112,7 +112,7 @@ func TestPhotosQueryHidden(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -126,7 +126,7 @@ func TestPhotosQueryHidden(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -139,7 +139,7 @@ func TestPhotosQueryHidden(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -154,7 +154,7 @@ func TestPhotosQueryHidden(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -168,7 +168,7 @@ func TestPhotosQueryHidden(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -182,7 +182,7 @@ func TestPhotosQueryHidden(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -196,7 +196,7 @@ func TestPhotosQueryHidden(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -210,7 +210,7 @@ func TestPhotosQueryHidden(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -224,7 +224,7 @@ func TestPhotosQueryHidden(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -238,7 +238,7 @@ func TestPhotosQueryHidden(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -252,7 +252,7 @@ func TestPhotosQueryHidden(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -266,7 +266,7 @@ func TestPhotosQueryHidden(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -280,7 +280,7 @@ func TestPhotosQueryHidden(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -294,7 +294,7 @@ func TestPhotosQueryHidden(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("AndSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -308,7 +308,7 @@ func TestPhotosQueryHidden(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("OrSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -322,6 +322,6 @@ func TestPhotosQueryHidden(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ func TestPhotosFilterId(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("a698ac56-6e7e-42b9-9c3e*", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -34,7 +34,7 @@ func TestPhotosFilterId(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -48,7 +48,7 @@ func TestPhotosFilterId(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -62,7 +62,7 @@ func TestPhotosFilterId(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -76,7 +76,7 @@ func TestPhotosFilterId(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -90,7 +90,7 @@ func TestPhotosFilterId(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -104,7 +104,7 @@ func TestPhotosFilterId(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -118,7 +118,7 @@ func TestPhotosFilterId(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -132,7 +132,7 @@ func TestPhotosFilterId(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -146,7 +146,7 @@ func TestPhotosFilterId(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -160,7 +160,7 @@ func TestPhotosFilterId(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -174,7 +174,7 @@ func TestPhotosFilterId(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -188,7 +188,7 @@ func TestPhotosFilterId(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -202,7 +202,7 @@ func TestPhotosFilterId(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -216,7 +216,7 @@ func TestPhotosFilterId(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -230,7 +230,7 @@ func TestPhotosFilterId(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -244,7 +244,7 @@ func TestPhotosFilterId(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -258,7 +258,7 @@ func TestPhotosFilterId(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -272,7 +272,7 @@ func TestPhotosFilterId(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -286,7 +286,7 @@ func TestPhotosFilterId(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -303,7 +303,7 @@ func TestPhotosQueryId(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("QuotedPhotoUID", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -317,7 +317,7 @@ func TestPhotosQueryId(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("ps6sg6be2lvl0yh*", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -331,7 +331,7 @@ func TestPhotosQueryId(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -345,7 +345,7 @@ func TestPhotosQueryId(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -359,7 +359,7 @@ func TestPhotosQueryId(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -373,7 +373,7 @@ func TestPhotosQueryId(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -387,7 +387,7 @@ func TestPhotosQueryId(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -401,7 +401,7 @@ func TestPhotosQueryId(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -415,7 +415,7 @@ func TestPhotosQueryId(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -429,7 +429,7 @@ func TestPhotosQueryId(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -443,7 +443,7 @@ func TestPhotosQueryId(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -457,7 +457,7 @@ func TestPhotosQueryId(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -471,7 +471,7 @@ func TestPhotosQueryId(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -485,7 +485,7 @@ func TestPhotosQueryId(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -499,7 +499,7 @@ func TestPhotosQueryId(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -513,7 +513,7 @@ func TestPhotosQueryId(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -527,7 +527,7 @@ func TestPhotosQueryId(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -541,7 +541,7 @@ func TestPhotosQueryId(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -555,7 +555,7 @@ func TestPhotosQueryId(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -569,7 +569,7 @@ func TestPhotosQueryId(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -583,6 +583,6 @@ func TestPhotosQueryId(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ func TestPhotosFilterIso(t *testing.T) {
|
|||
assert.GreaterOrEqual(t, 200, r.PhotoIso)
|
||||
assert.LessOrEqual(t, 200, r.PhotoIso)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("200-400", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -44,7 +44,7 @@ func TestPhotosFilterIso(t *testing.T) {
|
|||
assert.LessOrEqual(t, 200, r.PhotoIso)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 4)
|
||||
assert.Len(t, photos, 4)
|
||||
})
|
||||
t.Run("1-400", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -63,7 +63,7 @@ func TestPhotosFilterIso(t *testing.T) {
|
|||
assert.LessOrEqual(t, 1, r.PhotoIso)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 5)
|
||||
assert.Len(t, photos, 5)
|
||||
})
|
||||
t.Run("155", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -77,7 +77,7 @@ func TestPhotosFilterIso(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("-100", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -126,7 +126,7 @@ func TestPhotosQueryIso(t *testing.T) {
|
|||
assert.LessOrEqual(t, 200, r.PhotoIso)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("200-400", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -145,7 +145,7 @@ func TestPhotosQueryIso(t *testing.T) {
|
|||
assert.LessOrEqual(t, 200, r.PhotoIso)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 4)
|
||||
assert.Len(t, photos, 4)
|
||||
})
|
||||
t.Run("1-400", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -164,7 +164,7 @@ func TestPhotosQueryIso(t *testing.T) {
|
|||
assert.LessOrEqual(t, 1, r.PhotoIso)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 5)
|
||||
assert.Len(t, photos, 5)
|
||||
})
|
||||
t.Run("155", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -177,7 +177,7 @@ func TestPhotosQueryIso(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("-100", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ func TestPhotosFilterKeywords(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("b*", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -33,7 +33,7 @@ func TestPhotosFilterKeywords(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 5)
|
||||
assert.Len(t, photos, 5)
|
||||
})
|
||||
t.Run("b* pipe kuh", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -46,7 +46,7 @@ func TestPhotosFilterKeywords(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 6)
|
||||
assert.Len(t, photos, 6)
|
||||
})
|
||||
t.Run("b* whitespace pipe whitespace kuh", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -59,7 +59,7 @@ func TestPhotosFilterKeywords(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 6)
|
||||
assert.Len(t, photos, 6)
|
||||
})
|
||||
t.Run("b* or kuh", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -72,7 +72,7 @@ func TestPhotosFilterKeywords(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 6)
|
||||
assert.Len(t, photos, 6)
|
||||
})
|
||||
t.Run("b* OR kuh", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -85,7 +85,7 @@ func TestPhotosFilterKeywords(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 6)
|
||||
assert.Len(t, photos, 6)
|
||||
})
|
||||
t.Run("b* Ampersand kuh", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -98,7 +98,7 @@ func TestPhotosFilterKeywords(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("b* whitespace Ampersand whitespace kuh", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -111,7 +111,7 @@ func TestPhotosFilterKeywords(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("b* and kuh", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -124,7 +124,7 @@ func TestPhotosFilterKeywords(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("b* AND kuh", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -137,7 +137,7 @@ func TestPhotosFilterKeywords(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -150,7 +150,7 @@ func TestPhotosFilterKeywords(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -163,7 +163,7 @@ func TestPhotosFilterKeywords(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -177,7 +177,7 @@ func TestPhotosFilterKeywords(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -191,7 +191,7 @@ func TestPhotosFilterKeywords(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -205,7 +205,7 @@ func TestPhotosFilterKeywords(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -219,7 +219,7 @@ func TestPhotosFilterKeywords(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -233,7 +233,7 @@ func TestPhotosFilterKeywords(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -247,7 +247,7 @@ func TestPhotosFilterKeywords(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -261,7 +261,7 @@ func TestPhotosFilterKeywords(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -275,7 +275,7 @@ func TestPhotosFilterKeywords(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -289,7 +289,7 @@ func TestPhotosFilterKeywords(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -303,7 +303,7 @@ func TestPhotosFilterKeywords(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -317,7 +317,7 @@ func TestPhotosFilterKeywords(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -331,7 +331,7 @@ func TestPhotosFilterKeywords(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, 2, len(photos))
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -345,7 +345,7 @@ func TestPhotosFilterKeywords(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -358,7 +358,7 @@ func TestPhotosFilterKeywords(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -372,7 +372,7 @@ func TestPhotosFilterKeywords(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -386,7 +386,7 @@ func TestPhotosFilterKeywords(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
//TODO
|
||||
/*t.Run("StartsWithDoubleQuotes", func(t *testing.T) {
|
||||
|
|
@ -401,7 +401,7 @@ func TestPhotosFilterKeywords(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterDoubleQuotes", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -415,7 +415,7 @@ func TestPhotosFilterKeywords(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithDoubleQuotes", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -429,7 +429,7 @@ func TestPhotosFilterKeywords(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})*/
|
||||
t.Run("OrSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -442,7 +442,7 @@ func TestPhotosFilterKeywords(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("OrSearch2", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -481,7 +481,7 @@ func TestPhotosFilterKeywords(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("AndSearch2", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -494,7 +494,7 @@ func TestPhotosFilterKeywords(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("AndSearch3", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -507,7 +507,7 @@ func TestPhotosFilterKeywords(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -523,7 +523,7 @@ func TestPhotosQueryKeywords(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("b*", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -536,7 +536,7 @@ func TestPhotosQueryKeywords(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 5)
|
||||
assert.Len(t, photos, 5)
|
||||
})
|
||||
t.Run("b* pipe kuh", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -549,7 +549,7 @@ func TestPhotosQueryKeywords(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 6)
|
||||
assert.Len(t, photos, 6)
|
||||
})
|
||||
t.Run("b* whitespace pipe whitespace kuh", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -562,7 +562,7 @@ func TestPhotosQueryKeywords(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 6)
|
||||
assert.Len(t, photos, 6)
|
||||
})
|
||||
t.Run("b* or kuh", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -575,7 +575,7 @@ func TestPhotosQueryKeywords(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 6)
|
||||
assert.Len(t, photos, 6)
|
||||
})
|
||||
t.Run("b* OR kuh", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -588,7 +588,7 @@ func TestPhotosQueryKeywords(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 6)
|
||||
assert.Len(t, photos, 6)
|
||||
})
|
||||
t.Run("b* Ampersand kuh", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -601,7 +601,7 @@ func TestPhotosQueryKeywords(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("b* whitespace Ampersand whitespace kuh", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -614,7 +614,7 @@ func TestPhotosQueryKeywords(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("b* and kuh", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -627,7 +627,7 @@ func TestPhotosQueryKeywords(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("b* AND kuh", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -640,7 +640,7 @@ func TestPhotosQueryKeywords(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -653,7 +653,7 @@ func TestPhotosQueryKeywords(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -666,7 +666,7 @@ func TestPhotosQueryKeywords(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -680,7 +680,7 @@ func TestPhotosQueryKeywords(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -694,7 +694,7 @@ func TestPhotosQueryKeywords(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -708,7 +708,7 @@ func TestPhotosQueryKeywords(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -722,7 +722,7 @@ func TestPhotosQueryKeywords(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -736,7 +736,7 @@ func TestPhotosQueryKeywords(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -750,7 +750,7 @@ func TestPhotosQueryKeywords(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -764,7 +764,7 @@ func TestPhotosQueryKeywords(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -778,7 +778,7 @@ func TestPhotosQueryKeywords(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -792,7 +792,7 @@ func TestPhotosQueryKeywords(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -806,7 +806,7 @@ func TestPhotosQueryKeywords(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -820,7 +820,7 @@ func TestPhotosQueryKeywords(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -834,7 +834,7 @@ func TestPhotosQueryKeywords(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, 2, len(photos))
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -848,7 +848,7 @@ func TestPhotosQueryKeywords(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -861,7 +861,7 @@ func TestPhotosQueryKeywords(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -875,7 +875,7 @@ func TestPhotosQueryKeywords(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -889,7 +889,7 @@ func TestPhotosQueryKeywords(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
//TODO
|
||||
/*t.Run("StartsWithDoubleQuotes", func(t *testing.T) {
|
||||
|
|
@ -904,7 +904,7 @@ func TestPhotosQueryKeywords(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterDoubleQuotes", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -918,7 +918,7 @@ func TestPhotosQueryKeywords(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithDoubleQuotes", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -932,7 +932,7 @@ func TestPhotosQueryKeywords(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})*/
|
||||
t.Run("OrSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -945,7 +945,7 @@ func TestPhotosQueryKeywords(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("OrSearch2", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -984,7 +984,7 @@ func TestPhotosQueryKeywords(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("AndSearch2", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -997,7 +997,7 @@ func TestPhotosQueryKeywords(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("AndSearch3", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -1010,6 +1010,6 @@ func TestPhotosQueryKeywords(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ func TestPhotosFilterLabel(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("cake", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -33,7 +33,7 @@ func TestPhotosFilterLabel(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("cake pipe flower", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -46,7 +46,7 @@ func TestPhotosFilterLabel(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("cake whitespace pipe whitespace flower", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -59,7 +59,7 @@ func TestPhotosFilterLabel(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -72,7 +72,7 @@ func TestPhotosFilterLabel(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -85,7 +85,7 @@ func TestPhotosFilterLabel(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -99,7 +99,7 @@ func TestPhotosFilterLabel(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -113,7 +113,7 @@ func TestPhotosFilterLabel(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -127,7 +127,7 @@ func TestPhotosFilterLabel(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -141,7 +141,7 @@ func TestPhotosFilterLabel(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -155,7 +155,7 @@ func TestPhotosFilterLabel(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -169,7 +169,7 @@ func TestPhotosFilterLabel(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -183,7 +183,7 @@ func TestPhotosFilterLabel(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -197,7 +197,7 @@ func TestPhotosFilterLabel(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -211,7 +211,7 @@ func TestPhotosFilterLabel(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -225,7 +225,7 @@ func TestPhotosFilterLabel(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -239,7 +239,7 @@ func TestPhotosFilterLabel(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -253,7 +253,7 @@ func TestPhotosFilterLabel(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -267,7 +267,7 @@ func TestPhotosFilterLabel(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -280,7 +280,7 @@ func TestPhotosFilterLabel(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -294,7 +294,7 @@ func TestPhotosFilterLabel(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -308,7 +308,7 @@ func TestPhotosFilterLabel(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithDoubleQuotes", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -322,7 +322,7 @@ func TestPhotosFilterLabel(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterDoubleQuotes", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -336,7 +336,7 @@ func TestPhotosFilterLabel(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithDoubleQuotes", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -350,7 +350,7 @@ func TestPhotosFilterLabel(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 4)
|
||||
assert.Len(t, photos, 4)
|
||||
})
|
||||
t.Run("OrSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -363,7 +363,7 @@ func TestPhotosFilterLabel(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -379,7 +379,7 @@ func TestPhotosQueryLabel(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("cake", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -392,7 +392,7 @@ func TestPhotosQueryLabel(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("cake pipe flower", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -405,7 +405,7 @@ func TestPhotosQueryLabel(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("cake whitespace pipe whitespace flower", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -418,7 +418,7 @@ func TestPhotosQueryLabel(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -431,7 +431,7 @@ func TestPhotosQueryLabel(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -444,7 +444,7 @@ func TestPhotosQueryLabel(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -458,7 +458,7 @@ func TestPhotosQueryLabel(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -472,7 +472,7 @@ func TestPhotosQueryLabel(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -486,7 +486,7 @@ func TestPhotosQueryLabel(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -500,7 +500,7 @@ func TestPhotosQueryLabel(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -514,7 +514,7 @@ func TestPhotosQueryLabel(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -528,7 +528,7 @@ func TestPhotosQueryLabel(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -542,7 +542,7 @@ func TestPhotosQueryLabel(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -556,7 +556,7 @@ func TestPhotosQueryLabel(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -570,7 +570,7 @@ func TestPhotosQueryLabel(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -584,7 +584,7 @@ func TestPhotosQueryLabel(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -598,7 +598,7 @@ func TestPhotosQueryLabel(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -612,7 +612,7 @@ func TestPhotosQueryLabel(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -626,7 +626,7 @@ func TestPhotosQueryLabel(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -639,7 +639,7 @@ func TestPhotosQueryLabel(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -653,7 +653,7 @@ func TestPhotosQueryLabel(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -667,7 +667,7 @@ func TestPhotosQueryLabel(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithDoubleQuotes", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -722,6 +722,6 @@ func TestPhotosQueryLabel(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ func TestPhotosQueryLandscape(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("false > yes", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -51,7 +51,7 @@ func TestPhotosQueryLandscape(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
f.Query = "landscape:false"
|
||||
f.Merged = true
|
||||
|
||||
|
|
@ -73,7 +73,7 @@ func TestPhotosQueryLandscape(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -86,7 +86,7 @@ func TestPhotosQueryLandscape(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -99,7 +99,7 @@ func TestPhotosQueryLandscape(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -113,7 +113,7 @@ func TestPhotosQueryLandscape(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -126,7 +126,7 @@ func TestPhotosQueryLandscape(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -140,7 +140,7 @@ func TestPhotosQueryLandscape(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -153,7 +153,7 @@ func TestPhotosQueryLandscape(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -167,7 +167,7 @@ func TestPhotosQueryLandscape(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -181,7 +181,7 @@ func TestPhotosQueryLandscape(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -195,7 +195,7 @@ func TestPhotosQueryLandscape(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -209,7 +209,7 @@ func TestPhotosQueryLandscape(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -223,7 +223,7 @@ func TestPhotosQueryLandscape(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -237,7 +237,7 @@ func TestPhotosQueryLandscape(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -251,7 +251,7 @@ func TestPhotosQueryLandscape(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -265,7 +265,7 @@ func TestPhotosQueryLandscape(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -279,7 +279,7 @@ func TestPhotosQueryLandscape(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -293,7 +293,7 @@ func TestPhotosQueryLandscape(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -307,7 +307,7 @@ func TestPhotosQueryLandscape(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("AndSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -321,7 +321,7 @@ func TestPhotosQueryLandscape(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("OrSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -335,6 +335,6 @@ func TestPhotosQueryLandscape(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ func TestPhotosFilterLens(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
//TODO
|
||||
/*t.Run("*4.15mm f/2.2", func(t *testing.T) {
|
||||
|
|
@ -47,7 +47,7 @@ func TestPhotosFilterLens(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})*/
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -60,7 +60,7 @@ func TestPhotosFilterLens(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -73,7 +73,7 @@ func TestPhotosFilterLens(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -86,7 +86,7 @@ func TestPhotosFilterLens(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -99,7 +99,7 @@ func TestPhotosFilterLens(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -112,7 +112,7 @@ func TestPhotosFilterLens(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -125,7 +125,7 @@ func TestPhotosFilterLens(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -138,7 +138,7 @@ func TestPhotosFilterLens(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -152,7 +152,7 @@ func TestPhotosFilterLens(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -165,7 +165,7 @@ func TestPhotosFilterLens(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -178,7 +178,7 @@ func TestPhotosFilterLens(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -191,7 +191,7 @@ func TestPhotosFilterLens(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -204,7 +204,7 @@ func TestPhotosFilterLens(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -217,7 +217,7 @@ func TestPhotosFilterLens(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -231,7 +231,7 @@ func TestPhotosFilterLens(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -245,7 +245,7 @@ func TestPhotosFilterLens(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -258,7 +258,7 @@ func TestPhotosFilterLens(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -271,7 +271,7 @@ func TestPhotosFilterLens(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -284,7 +284,7 @@ func TestPhotosFilterLens(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -313,7 +313,7 @@ func TestPhotosQueryLens(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
//TODO
|
||||
/*t.Run("*4.15mm f/2.2", func(t *testing.T) {
|
||||
|
|
@ -327,7 +327,7 @@ func TestPhotosQueryLens(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})*/
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -340,7 +340,7 @@ func TestPhotosQueryLens(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -353,7 +353,7 @@ func TestPhotosQueryLens(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -366,7 +366,7 @@ func TestPhotosQueryLens(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -379,7 +379,7 @@ func TestPhotosQueryLens(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -392,7 +392,7 @@ func TestPhotosQueryLens(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -405,7 +405,7 @@ func TestPhotosQueryLens(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -418,7 +418,7 @@ func TestPhotosQueryLens(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -432,7 +432,7 @@ func TestPhotosQueryLens(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -445,7 +445,7 @@ func TestPhotosQueryLens(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -458,7 +458,7 @@ func TestPhotosQueryLens(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -471,7 +471,7 @@ func TestPhotosQueryLens(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -484,7 +484,7 @@ func TestPhotosQueryLens(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -497,7 +497,7 @@ func TestPhotosQueryLens(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -511,7 +511,7 @@ func TestPhotosQueryLens(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -524,7 +524,7 @@ func TestPhotosQueryLens(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -537,7 +537,7 @@ func TestPhotosQueryLens(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -550,7 +550,7 @@ func TestPhotosQueryLens(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -563,6 +563,6 @@ func TestPhotosQueryLens(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ func TestPhotosQueryLive(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
f.Query = "live:false"
|
||||
f.Merged = true
|
||||
|
||||
|
|
@ -59,7 +59,7 @@ func TestPhotosQueryLive(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -72,7 +72,7 @@ func TestPhotosQueryLive(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -85,7 +85,7 @@ func TestPhotosQueryLive(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -99,7 +99,7 @@ func TestPhotosQueryLive(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -112,7 +112,7 @@ func TestPhotosQueryLive(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -126,7 +126,7 @@ func TestPhotosQueryLive(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -139,7 +139,7 @@ func TestPhotosQueryLive(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -154,7 +154,7 @@ func TestPhotosQueryLive(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -168,7 +168,7 @@ func TestPhotosQueryLive(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -182,7 +182,7 @@ func TestPhotosQueryLive(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -196,7 +196,7 @@ func TestPhotosQueryLive(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -210,7 +210,7 @@ func TestPhotosQueryLive(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -224,7 +224,7 @@ func TestPhotosQueryLive(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -238,7 +238,7 @@ func TestPhotosQueryLive(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -252,7 +252,7 @@ func TestPhotosQueryLive(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -266,7 +266,7 @@ func TestPhotosQueryLive(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -280,7 +280,7 @@ func TestPhotosQueryLive(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -294,7 +294,7 @@ func TestPhotosQueryLive(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("AndSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -308,7 +308,7 @@ func TestPhotosQueryLive(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("OrSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -322,6 +322,6 @@ func TestPhotosQueryLive(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ func TestPhotosQueryMono(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
f.Query = "mono:false"
|
||||
f.Merged = true
|
||||
|
||||
|
|
@ -59,7 +59,7 @@ func TestPhotosQueryMono(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -72,7 +72,7 @@ func TestPhotosQueryMono(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -85,7 +85,7 @@ func TestPhotosQueryMono(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -99,7 +99,7 @@ func TestPhotosQueryMono(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -112,7 +112,7 @@ func TestPhotosQueryMono(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -126,7 +126,7 @@ func TestPhotosQueryMono(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -139,7 +139,7 @@ func TestPhotosQueryMono(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -154,7 +154,7 @@ func TestPhotosQueryMono(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -168,7 +168,7 @@ func TestPhotosQueryMono(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -182,7 +182,7 @@ func TestPhotosQueryMono(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -196,7 +196,7 @@ func TestPhotosQueryMono(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -210,7 +210,7 @@ func TestPhotosQueryMono(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -224,7 +224,7 @@ func TestPhotosQueryMono(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -238,7 +238,7 @@ func TestPhotosQueryMono(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -252,7 +252,7 @@ func TestPhotosQueryMono(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -266,7 +266,7 @@ func TestPhotosQueryMono(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -280,7 +280,7 @@ func TestPhotosQueryMono(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -294,7 +294,7 @@ func TestPhotosQueryMono(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("AndSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -308,7 +308,7 @@ func TestPhotosQueryMono(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("OrSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -322,6 +322,6 @@ func TestPhotosQueryMono(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ func TestPhotosFilterMonth(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 3)
|
||||
assert.Len(t, photos, 3)
|
||||
})
|
||||
t.Run("1", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -33,7 +33,7 @@ func TestPhotosFilterMonth(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 5)
|
||||
assert.Len(t, photos, 5)
|
||||
})
|
||||
t.Run("12 pipe 1", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -46,7 +46,7 @@ func TestPhotosFilterMonth(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 8)
|
||||
assert.Len(t, photos, 8)
|
||||
})
|
||||
t.Run("12 whitespace pipe whitespace 1", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -59,7 +59,7 @@ func TestPhotosFilterMonth(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 8)
|
||||
assert.Len(t, photos, 8)
|
||||
})
|
||||
var f0 form.SearchPhotos
|
||||
|
||||
|
|
@ -77,7 +77,7 @@ func TestPhotosFilterMonth(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -90,7 +90,7 @@ func TestPhotosFilterMonth(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -103,7 +103,7 @@ func TestPhotosFilterMonth(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -116,7 +116,7 @@ func TestPhotosFilterMonth(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -129,7 +129,7 @@ func TestPhotosFilterMonth(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -142,7 +142,7 @@ func TestPhotosFilterMonth(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -155,7 +155,7 @@ func TestPhotosFilterMonth(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -169,7 +169,7 @@ func TestPhotosFilterMonth(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -182,7 +182,7 @@ func TestPhotosFilterMonth(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -195,7 +195,7 @@ func TestPhotosFilterMonth(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -208,7 +208,7 @@ func TestPhotosFilterMonth(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -221,7 +221,7 @@ func TestPhotosFilterMonth(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -234,7 +234,7 @@ func TestPhotosFilterMonth(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -248,7 +248,7 @@ func TestPhotosFilterMonth(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -262,7 +262,7 @@ func TestPhotosFilterMonth(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -275,7 +275,7 @@ func TestPhotosFilterMonth(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -288,7 +288,7 @@ func TestPhotosFilterMonth(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -301,7 +301,7 @@ func TestPhotosFilterMonth(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -317,7 +317,7 @@ func TestPhotosQueryMonth(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 3)
|
||||
assert.Len(t, photos, 3)
|
||||
})
|
||||
t.Run("1", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -330,7 +330,7 @@ func TestPhotosQueryMonth(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 5)
|
||||
assert.Len(t, photos, 5)
|
||||
})
|
||||
t.Run("12 pipe 1", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -343,7 +343,7 @@ func TestPhotosQueryMonth(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 8)
|
||||
assert.Len(t, photos, 8)
|
||||
})
|
||||
t.Run("12 whitespace pipe whitespace 1", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -356,7 +356,7 @@ func TestPhotosQueryMonth(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 8)
|
||||
assert.Len(t, photos, 8)
|
||||
})
|
||||
var f0 form.SearchPhotos
|
||||
|
||||
|
|
@ -375,7 +375,7 @@ func TestPhotosQueryMonth(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -388,7 +388,7 @@ func TestPhotosQueryMonth(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -401,7 +401,7 @@ func TestPhotosQueryMonth(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -414,7 +414,7 @@ func TestPhotosQueryMonth(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -427,7 +427,7 @@ func TestPhotosQueryMonth(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -440,7 +440,7 @@ func TestPhotosQueryMonth(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -453,7 +453,7 @@ func TestPhotosQueryMonth(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -467,7 +467,7 @@ func TestPhotosQueryMonth(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -480,7 +480,7 @@ func TestPhotosQueryMonth(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -493,7 +493,7 @@ func TestPhotosQueryMonth(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -506,7 +506,7 @@ func TestPhotosQueryMonth(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -519,7 +519,7 @@ func TestPhotosQueryMonth(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -532,7 +532,7 @@ func TestPhotosQueryMonth(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -546,7 +546,7 @@ func TestPhotosQueryMonth(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -559,7 +559,7 @@ func TestPhotosQueryMonth(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -572,7 +572,7 @@ func TestPhotosQueryMonth(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -585,7 +585,7 @@ func TestPhotosQueryMonth(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -598,6 +598,6 @@ func TestPhotosQueryMonth(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ func TestPhotosFilterName(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("*hoto1*", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -33,7 +33,7 @@ func TestPhotosFilterName(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 6)
|
||||
assert.Len(t, photos, 6)
|
||||
})
|
||||
t.Run("*hoto1* pipe 27900704_070228_D6D51B6C", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -46,7 +46,7 @@ func TestPhotosFilterName(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 7)
|
||||
assert.Len(t, photos, 7)
|
||||
})
|
||||
t.Run("*hoto1* whitespace pipe whitespace 27900704_070228_D6D51B6C", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -59,7 +59,7 @@ func TestPhotosFilterName(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 7)
|
||||
assert.Len(t, photos, 7)
|
||||
})
|
||||
t.Run("*hoto1* or 27900704_070228_D6D51B6C", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -72,7 +72,7 @@ func TestPhotosFilterName(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -85,7 +85,7 @@ func TestPhotosFilterName(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -98,7 +98,7 @@ func TestPhotosFilterName(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -112,7 +112,7 @@ func TestPhotosFilterName(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -126,7 +126,7 @@ func TestPhotosFilterName(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -140,7 +140,7 @@ func TestPhotosFilterName(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -154,7 +154,7 @@ func TestPhotosFilterName(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -168,7 +168,7 @@ func TestPhotosFilterName(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -182,7 +182,7 @@ func TestPhotosFilterName(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -196,7 +196,7 @@ func TestPhotosFilterName(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -210,7 +210,7 @@ func TestPhotosFilterName(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -224,7 +224,7 @@ func TestPhotosFilterName(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -238,7 +238,7 @@ func TestPhotosFilterName(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithPipeWildcard", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -252,7 +252,7 @@ func TestPhotosFilterName(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterPipeWildcard", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -271,7 +271,7 @@ func TestPhotosFilterName(t *testing.T) {
|
|||
t.Logf("query results: %#v", photos)
|
||||
}
|
||||
|
||||
assert.Equal(t, 1, len(photos))
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithPipeWildcard", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -285,7 +285,7 @@ func TestPhotosFilterName(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -299,7 +299,7 @@ func TestPhotosFilterName(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -313,7 +313,7 @@ func TestPhotosFilterName(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, 1, len(photos))
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -327,7 +327,7 @@ func TestPhotosFilterName(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -340,7 +340,7 @@ func TestPhotosFilterName(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -354,7 +354,7 @@ func TestPhotosFilterName(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -368,7 +368,7 @@ func TestPhotosFilterName(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithDoubleQuotes", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -382,7 +382,7 @@ func TestPhotosFilterName(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterDoubleQuotes", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -396,7 +396,7 @@ func TestPhotosFilterName(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithDoubleQuotes", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -410,7 +410,7 @@ func TestPhotosFilterName(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithWhitespace", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -423,7 +423,7 @@ func TestPhotosFilterName(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterWhitespace", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -437,7 +437,7 @@ func TestPhotosFilterName(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithWhitespace", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -451,7 +451,7 @@ func TestPhotosFilterName(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("OrSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -464,7 +464,7 @@ func TestPhotosFilterName(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("OrSearch2", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -490,7 +490,7 @@ func TestPhotosFilterName(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 2, len(photos))
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -506,7 +506,7 @@ func TestPhotosQueryName(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("*hoto1*", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -519,7 +519,7 @@ func TestPhotosQueryName(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 6)
|
||||
assert.Len(t, photos, 6)
|
||||
})
|
||||
t.Run("*hoto1* pipe 27900704_070228_D6D51B6C", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -532,7 +532,7 @@ func TestPhotosQueryName(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 7)
|
||||
assert.Len(t, photos, 7)
|
||||
})
|
||||
t.Run("*hoto1* whitespace pipe whitespace 27900704_070228_D6D51B6C", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -545,7 +545,7 @@ func TestPhotosQueryName(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 7)
|
||||
assert.Len(t, photos, 7)
|
||||
})
|
||||
t.Run("*hoto1* or 27900704_070228_D6D51B6C", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -558,7 +558,7 @@ func TestPhotosQueryName(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -571,7 +571,7 @@ func TestPhotosQueryName(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -584,7 +584,7 @@ func TestPhotosQueryName(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -597,7 +597,7 @@ func TestPhotosQueryName(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -610,7 +610,7 @@ func TestPhotosQueryName(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -623,7 +623,7 @@ func TestPhotosQueryName(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -636,7 +636,7 @@ func TestPhotosQueryName(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -649,7 +649,7 @@ func TestPhotosQueryName(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -663,7 +663,7 @@ func TestPhotosQueryName(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -676,7 +676,7 @@ func TestPhotosQueryName(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -689,7 +689,7 @@ func TestPhotosQueryName(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -702,7 +702,7 @@ func TestPhotosQueryName(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -715,7 +715,7 @@ func TestPhotosQueryName(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithPipeWildcard", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -729,7 +729,7 @@ func TestPhotosQueryName(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterPipeWildcard", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -748,7 +748,7 @@ func TestPhotosQueryName(t *testing.T) {
|
|||
t.Logf("query results: %#v", photos)
|
||||
}
|
||||
|
||||
assert.Equal(t, 1, len(photos))
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithPipeWildcard", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -762,7 +762,7 @@ func TestPhotosQueryName(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -776,7 +776,7 @@ func TestPhotosQueryName(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -790,7 +790,7 @@ func TestPhotosQueryName(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, 1, len(photos))
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -804,7 +804,7 @@ func TestPhotosQueryName(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -817,7 +817,7 @@ func TestPhotosQueryName(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -830,7 +830,7 @@ func TestPhotosQueryName(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -843,7 +843,7 @@ func TestPhotosQueryName(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithDoubleQuotes", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -898,7 +898,7 @@ func TestPhotosQueryName(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterWhitespace", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -912,7 +912,7 @@ func TestPhotosQueryName(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithWhitespace", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -926,7 +926,7 @@ func TestPhotosQueryName(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("OrSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -939,7 +939,7 @@ func TestPhotosQueryName(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("OrSearch2", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -965,7 +965,7 @@ func TestPhotosQueryName(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 2, len(photos))
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("OrSearch4", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -978,6 +978,6 @@ func TestPhotosQueryName(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 2, len(photos))
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ func TestPhotosQueryPanorama(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
f.Query = "panorama:false"
|
||||
f.Merged = true
|
||||
|
||||
|
|
@ -59,7 +59,7 @@ func TestPhotosQueryPanorama(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -72,7 +72,7 @@ func TestPhotosQueryPanorama(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -85,7 +85,7 @@ func TestPhotosQueryPanorama(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -99,7 +99,7 @@ func TestPhotosQueryPanorama(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -112,7 +112,7 @@ func TestPhotosQueryPanorama(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -126,7 +126,7 @@ func TestPhotosQueryPanorama(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -139,7 +139,7 @@ func TestPhotosQueryPanorama(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -154,7 +154,7 @@ func TestPhotosQueryPanorama(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -168,7 +168,7 @@ func TestPhotosQueryPanorama(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -182,7 +182,7 @@ func TestPhotosQueryPanorama(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -196,7 +196,7 @@ func TestPhotosQueryPanorama(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -210,7 +210,7 @@ func TestPhotosQueryPanorama(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -224,7 +224,7 @@ func TestPhotosQueryPanorama(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -238,7 +238,7 @@ func TestPhotosQueryPanorama(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -252,7 +252,7 @@ func TestPhotosQueryPanorama(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -266,7 +266,7 @@ func TestPhotosQueryPanorama(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -280,7 +280,7 @@ func TestPhotosQueryPanorama(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -294,7 +294,7 @@ func TestPhotosQueryPanorama(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("AndSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -308,7 +308,7 @@ func TestPhotosQueryPanorama(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("OrSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -322,6 +322,6 @@ func TestPhotosQueryPanorama(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ func TestPhotosFilterPath(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("2790*", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -33,7 +33,7 @@ func TestPhotosFilterPath(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("London", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -46,7 +46,7 @@ func TestPhotosFilterPath(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("London pipe 2790/07", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -59,7 +59,7 @@ func TestPhotosFilterPath(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -72,7 +72,7 @@ func TestPhotosFilterPath(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -85,7 +85,7 @@ func TestPhotosFilterPath(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -99,7 +99,7 @@ func TestPhotosFilterPath(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -113,7 +113,7 @@ func TestPhotosFilterPath(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -127,7 +127,7 @@ func TestPhotosFilterPath(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -141,7 +141,7 @@ func TestPhotosFilterPath(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -155,7 +155,7 @@ func TestPhotosFilterPath(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -169,7 +169,7 @@ func TestPhotosFilterPath(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -183,7 +183,7 @@ func TestPhotosFilterPath(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -197,7 +197,7 @@ func TestPhotosFilterPath(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 4)
|
||||
assert.Len(t, photos, 4)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -211,7 +211,7 @@ func TestPhotosFilterPath(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -225,7 +225,7 @@ func TestPhotosFilterPath(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -239,7 +239,7 @@ func TestPhotosFilterPath(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -253,7 +253,7 @@ func TestPhotosFilterPath(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -267,7 +267,7 @@ func TestPhotosFilterPath(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -280,7 +280,7 @@ func TestPhotosFilterPath(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -294,7 +294,7 @@ func TestPhotosFilterPath(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -308,7 +308,7 @@ func TestPhotosFilterPath(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("StartsWithDoubleQuotes", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -322,7 +322,7 @@ func TestPhotosFilterPath(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterDoubleQuotes", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -336,7 +336,7 @@ func TestPhotosFilterPath(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithDoubleQuotes", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -350,7 +350,7 @@ func TestPhotosFilterPath(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithWhitespace", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -363,7 +363,7 @@ func TestPhotosFilterPath(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterWhitespace", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -377,7 +377,7 @@ func TestPhotosFilterPath(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithWhitespace", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -391,7 +391,7 @@ func TestPhotosFilterPath(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("OrSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -404,7 +404,7 @@ func TestPhotosFilterPath(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("OrSearch2", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -459,7 +459,7 @@ func TestPhotosQueryPath(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("2790*", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -472,7 +472,7 @@ func TestPhotosQueryPath(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("London", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -485,7 +485,7 @@ func TestPhotosQueryPath(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("London pipe 2790/07", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -498,7 +498,7 @@ func TestPhotosQueryPath(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -511,7 +511,7 @@ func TestPhotosQueryPath(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -524,7 +524,7 @@ func TestPhotosQueryPath(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -538,7 +538,7 @@ func TestPhotosQueryPath(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -552,7 +552,7 @@ func TestPhotosQueryPath(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -566,7 +566,7 @@ func TestPhotosQueryPath(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -580,7 +580,7 @@ func TestPhotosQueryPath(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -594,7 +594,7 @@ func TestPhotosQueryPath(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -608,7 +608,7 @@ func TestPhotosQueryPath(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -622,7 +622,7 @@ func TestPhotosQueryPath(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -636,7 +636,7 @@ func TestPhotosQueryPath(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 4)
|
||||
assert.Len(t, photos, 4)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -650,7 +650,7 @@ func TestPhotosQueryPath(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -664,7 +664,7 @@ func TestPhotosQueryPath(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -678,7 +678,7 @@ func TestPhotosQueryPath(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -692,7 +692,7 @@ func TestPhotosQueryPath(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -706,7 +706,7 @@ func TestPhotosQueryPath(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -719,7 +719,7 @@ func TestPhotosQueryPath(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -733,7 +733,7 @@ func TestPhotosQueryPath(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -747,7 +747,7 @@ func TestPhotosQueryPath(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("StartsWithDoubleQuotes", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -804,7 +804,7 @@ func TestPhotosQueryPath(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterWhitespace", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -818,7 +818,7 @@ func TestPhotosQueryPath(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithWhitespace", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -832,7 +832,7 @@ func TestPhotosQueryPath(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("OrSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -845,7 +845,7 @@ func TestPhotosQueryPath(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("OrSearch2", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ func TestPhotosFilterPeople(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 5)
|
||||
assert.Len(t, photos, 5)
|
||||
})
|
||||
t.Run("Actress", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -33,7 +33,7 @@ func TestPhotosFilterPeople(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 3)
|
||||
assert.Len(t, photos, 3)
|
||||
})
|
||||
t.Run("Actress A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -46,7 +46,7 @@ func TestPhotosFilterPeople(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 3)
|
||||
assert.Len(t, photos, 3)
|
||||
})
|
||||
t.Run("Actor A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -59,7 +59,7 @@ func TestPhotosFilterPeople(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 3)
|
||||
assert.Len(t, photos, 3)
|
||||
})
|
||||
t.Run("Actor A pipe Actress A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -72,7 +72,7 @@ func TestPhotosFilterPeople(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 5)
|
||||
assert.Len(t, photos, 5)
|
||||
})
|
||||
t.Run("Actor A whitespace pipe whitespace Actress A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -85,7 +85,7 @@ func TestPhotosFilterPeople(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 5)
|
||||
assert.Len(t, photos, 5)
|
||||
})
|
||||
t.Run("Actor A ampersand Actress A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -98,7 +98,7 @@ func TestPhotosFilterPeople(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("Actor A whitespace ampersand whitespace Actress A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -111,7 +111,7 @@ func TestPhotosFilterPeople(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -124,7 +124,7 @@ func TestPhotosFilterPeople(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -137,7 +137,7 @@ func TestPhotosFilterPeople(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -150,7 +150,7 @@ func TestPhotosFilterPeople(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -163,7 +163,7 @@ func TestPhotosFilterPeople(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -176,7 +176,7 @@ func TestPhotosFilterPeople(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -189,7 +189,7 @@ func TestPhotosFilterPeople(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -202,7 +202,7 @@ func TestPhotosFilterPeople(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -216,7 +216,7 @@ func TestPhotosFilterPeople(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -229,7 +229,7 @@ func TestPhotosFilterPeople(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -242,7 +242,7 @@ func TestPhotosFilterPeople(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -255,7 +255,7 @@ func TestPhotosFilterPeople(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -268,7 +268,7 @@ func TestPhotosFilterPeople(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -281,7 +281,7 @@ func TestPhotosFilterPeople(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -295,7 +295,7 @@ func TestPhotosFilterPeople(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -309,7 +309,7 @@ func TestPhotosFilterPeople(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -322,7 +322,7 @@ func TestPhotosFilterPeople(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -335,7 +335,7 @@ func TestPhotosFilterPeople(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -348,7 +348,7 @@ func TestPhotosFilterPeople(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -364,7 +364,7 @@ func TestPhotosQueryPeople(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 5)
|
||||
assert.Len(t, photos, 5)
|
||||
})
|
||||
t.Run("Actress", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -377,7 +377,7 @@ func TestPhotosQueryPeople(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 3)
|
||||
assert.Len(t, photos, 3)
|
||||
})
|
||||
t.Run("Actress A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -390,7 +390,7 @@ func TestPhotosQueryPeople(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 3)
|
||||
assert.Len(t, photos, 3)
|
||||
})
|
||||
t.Run("Actor A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -403,7 +403,7 @@ func TestPhotosQueryPeople(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 3)
|
||||
assert.Len(t, photos, 3)
|
||||
})
|
||||
t.Run("Actor A pipe Actress A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -416,7 +416,7 @@ func TestPhotosQueryPeople(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 5)
|
||||
assert.Len(t, photos, 5)
|
||||
})
|
||||
t.Run("Actor A whitespace pipe whitespace Actress A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -429,7 +429,7 @@ func TestPhotosQueryPeople(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 5)
|
||||
assert.Len(t, photos, 5)
|
||||
})
|
||||
t.Run("Actor A ampersand Actress A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -442,7 +442,7 @@ func TestPhotosQueryPeople(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("Actor A whitespace ampersand whitespace Actress A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -455,7 +455,7 @@ func TestPhotosQueryPeople(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -468,7 +468,7 @@ func TestPhotosQueryPeople(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -481,7 +481,7 @@ func TestPhotosQueryPeople(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -494,7 +494,7 @@ func TestPhotosQueryPeople(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -507,7 +507,7 @@ func TestPhotosQueryPeople(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -520,7 +520,7 @@ func TestPhotosQueryPeople(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -533,7 +533,7 @@ func TestPhotosQueryPeople(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -546,7 +546,7 @@ func TestPhotosQueryPeople(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -560,7 +560,7 @@ func TestPhotosQueryPeople(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -573,7 +573,7 @@ func TestPhotosQueryPeople(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -586,7 +586,7 @@ func TestPhotosQueryPeople(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -599,7 +599,7 @@ func TestPhotosQueryPeople(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -612,7 +612,7 @@ func TestPhotosQueryPeople(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -625,7 +625,7 @@ func TestPhotosQueryPeople(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -639,7 +639,7 @@ func TestPhotosQueryPeople(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -652,7 +652,7 @@ func TestPhotosQueryPeople(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -665,7 +665,7 @@ func TestPhotosQueryPeople(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -678,7 +678,7 @@ func TestPhotosQueryPeople(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -691,6 +691,6 @@ func TestPhotosQueryPeople(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ func TestPhotosFilterPerson(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("Actress", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -33,7 +33,7 @@ func TestPhotosFilterPerson(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("Actress A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -46,7 +46,7 @@ func TestPhotosFilterPerson(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 3)
|
||||
assert.Len(t, photos, 3)
|
||||
})
|
||||
t.Run("Actor A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -59,7 +59,7 @@ func TestPhotosFilterPerson(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 3)
|
||||
assert.Len(t, photos, 3)
|
||||
})
|
||||
t.Run("Actor A pipe Actress A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -72,7 +72,7 @@ func TestPhotosFilterPerson(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 5)
|
||||
assert.Len(t, photos, 5)
|
||||
})
|
||||
t.Run("Actor A whitespace pipe whitespace Actress A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -85,7 +85,7 @@ func TestPhotosFilterPerson(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 5)
|
||||
assert.Len(t, photos, 5)
|
||||
})
|
||||
t.Run("Actor A ampersand Actress A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -98,7 +98,7 @@ func TestPhotosFilterPerson(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("Actor A whitespace ampersand whitespace Actress A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -111,7 +111,7 @@ func TestPhotosFilterPerson(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -124,7 +124,7 @@ func TestPhotosFilterPerson(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -137,7 +137,7 @@ func TestPhotosFilterPerson(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -150,7 +150,7 @@ func TestPhotosFilterPerson(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
//TODO error
|
||||
/*t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
|
|
@ -164,7 +164,7 @@ func TestPhotosFilterPerson(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})*/
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -177,7 +177,7 @@ func TestPhotosFilterPerson(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
//TODO error
|
||||
/*t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
|
|
@ -191,7 +191,7 @@ func TestPhotosFilterPerson(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})*/
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -204,7 +204,7 @@ func TestPhotosFilterPerson(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -218,7 +218,7 @@ func TestPhotosFilterPerson(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -231,7 +231,7 @@ func TestPhotosFilterPerson(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -244,7 +244,7 @@ func TestPhotosFilterPerson(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -257,7 +257,7 @@ func TestPhotosFilterPerson(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -270,7 +270,7 @@ func TestPhotosFilterPerson(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -283,7 +283,7 @@ func TestPhotosFilterPerson(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -297,7 +297,7 @@ func TestPhotosFilterPerson(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -311,7 +311,7 @@ func TestPhotosFilterPerson(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -324,7 +324,7 @@ func TestPhotosFilterPerson(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -337,7 +337,7 @@ func TestPhotosFilterPerson(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -350,7 +350,7 @@ func TestPhotosFilterPerson(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -366,7 +366,7 @@ func TestPhotosQueryPerson(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("Actress", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -379,7 +379,7 @@ func TestPhotosQueryPerson(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("Actress A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -392,7 +392,7 @@ func TestPhotosQueryPerson(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 3)
|
||||
assert.Len(t, photos, 3)
|
||||
})
|
||||
t.Run("Actor A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -405,7 +405,7 @@ func TestPhotosQueryPerson(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 3)
|
||||
assert.Len(t, photos, 3)
|
||||
})
|
||||
t.Run("Actor A pipe Actress A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -418,7 +418,7 @@ func TestPhotosQueryPerson(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 5)
|
||||
assert.Len(t, photos, 5)
|
||||
})
|
||||
t.Run("Actor A whitespace pipe whitespace Actress A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -431,7 +431,7 @@ func TestPhotosQueryPerson(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 5)
|
||||
assert.Len(t, photos, 5)
|
||||
})
|
||||
t.Run("Actor A ampersand Actress A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -444,7 +444,7 @@ func TestPhotosQueryPerson(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("Actor A whitespace ampersand whitespace Actress A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -457,7 +457,7 @@ func TestPhotosQueryPerson(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -470,7 +470,7 @@ func TestPhotosQueryPerson(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -483,7 +483,7 @@ func TestPhotosQueryPerson(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -496,7 +496,7 @@ func TestPhotosQueryPerson(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
//TODO error
|
||||
/*t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
|
|
@ -510,7 +510,7 @@ func TestPhotosQueryPerson(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})*/
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -523,7 +523,7 @@ func TestPhotosQueryPerson(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
//TODO error
|
||||
/*t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
|
|
@ -537,7 +537,7 @@ func TestPhotosQueryPerson(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})*/
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -550,7 +550,7 @@ func TestPhotosQueryPerson(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -564,7 +564,7 @@ func TestPhotosQueryPerson(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -577,7 +577,7 @@ func TestPhotosQueryPerson(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -590,7 +590,7 @@ func TestPhotosQueryPerson(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -603,7 +603,7 @@ func TestPhotosQueryPerson(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -616,7 +616,7 @@ func TestPhotosQueryPerson(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -629,7 +629,7 @@ func TestPhotosQueryPerson(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -643,7 +643,7 @@ func TestPhotosQueryPerson(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -656,7 +656,7 @@ func TestPhotosQueryPerson(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -669,7 +669,7 @@ func TestPhotosQueryPerson(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -682,7 +682,7 @@ func TestPhotosQueryPerson(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -695,6 +695,6 @@ func TestPhotosQueryPerson(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ func TestPhotosQueryPhoto(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
f.Query = "photo:false"
|
||||
f.Merged = true
|
||||
|
||||
|
|
@ -59,7 +59,7 @@ func TestPhotosQueryPhoto(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -72,7 +72,7 @@ func TestPhotosQueryPhoto(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -85,7 +85,7 @@ func TestPhotosQueryPhoto(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -99,7 +99,7 @@ func TestPhotosQueryPhoto(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -112,7 +112,7 @@ func TestPhotosQueryPhoto(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -126,7 +126,7 @@ func TestPhotosQueryPhoto(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -139,7 +139,7 @@ func TestPhotosQueryPhoto(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -154,7 +154,7 @@ func TestPhotosQueryPhoto(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -168,7 +168,7 @@ func TestPhotosQueryPhoto(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -182,7 +182,7 @@ func TestPhotosQueryPhoto(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -196,7 +196,7 @@ func TestPhotosQueryPhoto(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -210,7 +210,7 @@ func TestPhotosQueryPhoto(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -224,7 +224,7 @@ func TestPhotosQueryPhoto(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -238,7 +238,7 @@ func TestPhotosQueryPhoto(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -252,7 +252,7 @@ func TestPhotosQueryPhoto(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -266,7 +266,7 @@ func TestPhotosQueryPhoto(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -280,7 +280,7 @@ func TestPhotosQueryPhoto(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -294,7 +294,7 @@ func TestPhotosQueryPhoto(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("AndSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -308,7 +308,7 @@ func TestPhotosQueryPhoto(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("OrSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -322,6 +322,6 @@ func TestPhotosQueryPhoto(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ func TestPhotosQueryPortrait(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
f.Query = "portrait:false"
|
||||
f.Merged = true
|
||||
|
||||
|
|
@ -60,7 +60,7 @@ func TestPhotosQueryPortrait(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -73,7 +73,7 @@ func TestPhotosQueryPortrait(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -86,7 +86,7 @@ func TestPhotosQueryPortrait(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -100,7 +100,7 @@ func TestPhotosQueryPortrait(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -113,7 +113,7 @@ func TestPhotosQueryPortrait(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -127,7 +127,7 @@ func TestPhotosQueryPortrait(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -140,7 +140,7 @@ func TestPhotosQueryPortrait(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -155,7 +155,7 @@ func TestPhotosQueryPortrait(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -169,7 +169,7 @@ func TestPhotosQueryPortrait(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -183,7 +183,7 @@ func TestPhotosQueryPortrait(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -197,7 +197,7 @@ func TestPhotosQueryPortrait(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -211,7 +211,7 @@ func TestPhotosQueryPortrait(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -225,7 +225,7 @@ func TestPhotosQueryPortrait(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -239,7 +239,7 @@ func TestPhotosQueryPortrait(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -253,7 +253,7 @@ func TestPhotosQueryPortrait(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -267,7 +267,7 @@ func TestPhotosQueryPortrait(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -281,7 +281,7 @@ func TestPhotosQueryPortrait(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -295,7 +295,7 @@ func TestPhotosQueryPortrait(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("AndSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -309,7 +309,7 @@ func TestPhotosQueryPortrait(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("OrSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -323,7 +323,7 @@ func TestPhotosQueryPortrait(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("Landscape", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -337,7 +337,7 @@ func TestPhotosQueryPortrait(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, 7, len(photos))
|
||||
assert.Len(t, photos, 8)
|
||||
})
|
||||
t.Run("Square", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -351,6 +351,6 @@ func TestPhotosQueryPortrait(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, 1, len(photos))
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ func TestPhotosQueryPrimary(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -70,7 +70,7 @@ func TestPhotosQueryPrimary(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -83,7 +83,7 @@ func TestPhotosQueryPrimary(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -97,7 +97,7 @@ func TestPhotosQueryPrimary(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -110,7 +110,7 @@ func TestPhotosQueryPrimary(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -124,7 +124,7 @@ func TestPhotosQueryPrimary(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -137,7 +137,7 @@ func TestPhotosQueryPrimary(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -152,7 +152,7 @@ func TestPhotosQueryPrimary(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -166,7 +166,7 @@ func TestPhotosQueryPrimary(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -180,7 +180,7 @@ func TestPhotosQueryPrimary(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -194,7 +194,7 @@ func TestPhotosQueryPrimary(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -208,7 +208,7 @@ func TestPhotosQueryPrimary(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -222,7 +222,7 @@ func TestPhotosQueryPrimary(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -236,7 +236,7 @@ func TestPhotosQueryPrimary(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -250,7 +250,7 @@ func TestPhotosQueryPrimary(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -264,7 +264,7 @@ func TestPhotosQueryPrimary(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -278,7 +278,7 @@ func TestPhotosQueryPrimary(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -292,7 +292,7 @@ func TestPhotosQueryPrimary(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("AndSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -306,7 +306,7 @@ func TestPhotosQueryPrimary(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("OrSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -320,6 +320,6 @@ func TestPhotosQueryPrimary(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ func TestPhotosQueryPrivate(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos0), 1)
|
||||
assert.Len(t, photos0, 1)
|
||||
|
||||
t.Run("false > yes", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -37,7 +37,7 @@ func TestPhotosQueryPrivate(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
f.Query = "private:false"
|
||||
f.Merged = true
|
||||
|
||||
|
|
@ -59,7 +59,7 @@ func TestPhotosQueryPrivate(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -72,7 +72,7 @@ func TestPhotosQueryPrivate(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -85,7 +85,7 @@ func TestPhotosQueryPrivate(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -99,7 +99,7 @@ func TestPhotosQueryPrivate(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -112,7 +112,7 @@ func TestPhotosQueryPrivate(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -126,7 +126,7 @@ func TestPhotosQueryPrivate(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -139,7 +139,7 @@ func TestPhotosQueryPrivate(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -154,7 +154,7 @@ func TestPhotosQueryPrivate(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -168,7 +168,7 @@ func TestPhotosQueryPrivate(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -182,7 +182,7 @@ func TestPhotosQueryPrivate(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -196,7 +196,7 @@ func TestPhotosQueryPrivate(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -210,7 +210,7 @@ func TestPhotosQueryPrivate(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -224,7 +224,7 @@ func TestPhotosQueryPrivate(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -238,7 +238,7 @@ func TestPhotosQueryPrivate(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -252,7 +252,7 @@ func TestPhotosQueryPrivate(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -266,7 +266,7 @@ func TestPhotosQueryPrivate(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -280,7 +280,7 @@ func TestPhotosQueryPrivate(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -294,7 +294,7 @@ func TestPhotosQueryPrivate(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("AndSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -308,7 +308,7 @@ func TestPhotosQueryPrivate(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("OrSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -322,6 +322,6 @@ func TestPhotosQueryPrivate(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ func TestPhotosQueryPublic(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
f.Query = "public:false"
|
||||
f.Merged = true
|
||||
|
||||
|
|
@ -59,7 +59,7 @@ func TestPhotosQueryPublic(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -72,7 +72,7 @@ func TestPhotosQueryPublic(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -85,7 +85,7 @@ func TestPhotosQueryPublic(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -99,7 +99,7 @@ func TestPhotosQueryPublic(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -112,7 +112,7 @@ func TestPhotosQueryPublic(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -126,7 +126,7 @@ func TestPhotosQueryPublic(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -139,7 +139,7 @@ func TestPhotosQueryPublic(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -154,7 +154,7 @@ func TestPhotosQueryPublic(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -168,7 +168,7 @@ func TestPhotosQueryPublic(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -182,7 +182,7 @@ func TestPhotosQueryPublic(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -196,7 +196,7 @@ func TestPhotosQueryPublic(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -210,7 +210,7 @@ func TestPhotosQueryPublic(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -224,7 +224,7 @@ func TestPhotosQueryPublic(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -238,7 +238,7 @@ func TestPhotosQueryPublic(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -252,7 +252,7 @@ func TestPhotosQueryPublic(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -266,7 +266,7 @@ func TestPhotosQueryPublic(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -280,7 +280,7 @@ func TestPhotosQueryPublic(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -294,7 +294,7 @@ func TestPhotosQueryPublic(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("AndSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -308,7 +308,7 @@ func TestPhotosQueryPublic(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("OrSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -322,6 +322,6 @@ func TestPhotosQueryPublic(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ func TestPhotosQueryRaw(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
f.Query = "raw:false"
|
||||
f.Merged = true
|
||||
|
||||
|
|
@ -59,7 +59,7 @@ func TestPhotosQueryRaw(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -72,7 +72,7 @@ func TestPhotosQueryRaw(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -85,7 +85,7 @@ func TestPhotosQueryRaw(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -99,7 +99,7 @@ func TestPhotosQueryRaw(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -112,7 +112,7 @@ func TestPhotosQueryRaw(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -126,7 +126,7 @@ func TestPhotosQueryRaw(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -139,7 +139,7 @@ func TestPhotosQueryRaw(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -154,7 +154,7 @@ func TestPhotosQueryRaw(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -168,7 +168,7 @@ func TestPhotosQueryRaw(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -182,7 +182,7 @@ func TestPhotosQueryRaw(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -196,7 +196,7 @@ func TestPhotosQueryRaw(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -210,7 +210,7 @@ func TestPhotosQueryRaw(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -224,7 +224,7 @@ func TestPhotosQueryRaw(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -238,7 +238,7 @@ func TestPhotosQueryRaw(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -252,7 +252,7 @@ func TestPhotosQueryRaw(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -266,7 +266,7 @@ func TestPhotosQueryRaw(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -280,7 +280,7 @@ func TestPhotosQueryRaw(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -294,7 +294,7 @@ func TestPhotosQueryRaw(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("AndSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -308,7 +308,7 @@ func TestPhotosQueryRaw(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("OrSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -322,6 +322,6 @@ func TestPhotosQueryRaw(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ func TestPhotosFilterResolution(t *testing.T) {
|
|||
assert.GreaterOrEqual(t, 2, r.PhotoResolution)
|
||||
assert.LessOrEqual(t, 2, r.PhotoResolution)
|
||||
}
|
||||
assert.Equal(t, len(photos), 8)
|
||||
assert.Len(t, photos, 8)
|
||||
})
|
||||
t.Run("1-50", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -44,7 +44,7 @@ func TestPhotosFilterResolution(t *testing.T) {
|
|||
assert.LessOrEqual(t, 1, r.PhotoResolution)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 9)
|
||||
assert.Len(t, photos, 10)
|
||||
})
|
||||
t.Run("3-150", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -63,7 +63,7 @@ func TestPhotosFilterResolution(t *testing.T) {
|
|||
assert.LessOrEqual(t, 3, r.PhotoResolution)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 3)
|
||||
})
|
||||
t.Run("155", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -77,7 +77,7 @@ func TestPhotosFilterResolution(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("invalid", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -112,7 +112,7 @@ func TestPhotosQueryResolution(t *testing.T) {
|
|||
assert.LessOrEqual(t, 2, r.PhotoResolution)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 8)
|
||||
assert.Len(t, photos, 8)
|
||||
})
|
||||
t.Run("1-50", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -131,7 +131,7 @@ func TestPhotosQueryResolution(t *testing.T) {
|
|||
assert.LessOrEqual(t, 1, r.PhotoResolution)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 9)
|
||||
assert.Len(t, photos, 10)
|
||||
})
|
||||
t.Run("3-150", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -150,7 +150,7 @@ func TestPhotosQueryResolution(t *testing.T) {
|
|||
assert.LessOrEqual(t, 3, r.PhotoResolution)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 3)
|
||||
})
|
||||
t.Run("18", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -163,7 +163,7 @@ func TestPhotosQueryResolution(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("invalid", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ func TestPhotosQueryReview(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
f.Query = "review:false"
|
||||
f.Merged = true
|
||||
|
||||
|
|
@ -59,7 +59,7 @@ func TestPhotosQueryReview(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -72,7 +72,7 @@ func TestPhotosQueryReview(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -85,7 +85,7 @@ func TestPhotosQueryReview(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -99,7 +99,7 @@ func TestPhotosQueryReview(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -112,7 +112,7 @@ func TestPhotosQueryReview(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -126,7 +126,7 @@ func TestPhotosQueryReview(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -139,7 +139,7 @@ func TestPhotosQueryReview(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -154,7 +154,7 @@ func TestPhotosQueryReview(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -168,7 +168,7 @@ func TestPhotosQueryReview(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -182,7 +182,7 @@ func TestPhotosQueryReview(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -196,7 +196,7 @@ func TestPhotosQueryReview(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -210,7 +210,7 @@ func TestPhotosQueryReview(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -224,7 +224,7 @@ func TestPhotosQueryReview(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -238,7 +238,7 @@ func TestPhotosQueryReview(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -252,7 +252,7 @@ func TestPhotosQueryReview(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -266,7 +266,7 @@ func TestPhotosQueryReview(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -280,7 +280,7 @@ func TestPhotosQueryReview(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -294,7 +294,7 @@ func TestPhotosQueryReview(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("AndSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -308,7 +308,7 @@ func TestPhotosQueryReview(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("OrSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -322,6 +322,6 @@ func TestPhotosQueryReview(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ func TestPhotosQueryScan(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
f.Query = "scan:false"
|
||||
f.Merged = true
|
||||
|
||||
|
|
@ -59,7 +59,7 @@ func TestPhotosQueryScan(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -72,7 +72,7 @@ func TestPhotosQueryScan(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -85,7 +85,7 @@ func TestPhotosQueryScan(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -99,7 +99,7 @@ func TestPhotosQueryScan(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -112,7 +112,7 @@ func TestPhotosQueryScan(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -126,7 +126,7 @@ func TestPhotosQueryScan(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -139,7 +139,7 @@ func TestPhotosQueryScan(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -154,7 +154,7 @@ func TestPhotosQueryScan(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -168,7 +168,7 @@ func TestPhotosQueryScan(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -182,7 +182,7 @@ func TestPhotosQueryScan(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -196,7 +196,7 @@ func TestPhotosQueryScan(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -210,7 +210,7 @@ func TestPhotosQueryScan(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -224,7 +224,7 @@ func TestPhotosQueryScan(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -238,7 +238,7 @@ func TestPhotosQueryScan(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -252,7 +252,7 @@ func TestPhotosQueryScan(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -266,7 +266,7 @@ func TestPhotosQueryScan(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -280,7 +280,7 @@ func TestPhotosQueryScan(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -294,7 +294,7 @@ func TestPhotosQueryScan(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("AndSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -308,7 +308,7 @@ func TestPhotosQueryScan(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("OrSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -322,6 +322,6 @@ func TestPhotosQueryScan(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ func TestPhotosQuerySquare(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos0), 1)
|
||||
assert.Len(t, photos0, 1)
|
||||
|
||||
t.Run("square:yes", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -37,7 +37,7 @@ func TestPhotosQuerySquare(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("false > yes", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -50,7 +50,7 @@ func TestPhotosQuerySquare(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
f.Query = "square:false"
|
||||
f.Merged = true
|
||||
|
||||
|
|
@ -72,7 +72,7 @@ func TestPhotosQuerySquare(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -85,7 +85,7 @@ func TestPhotosQuerySquare(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -98,7 +98,7 @@ func TestPhotosQuerySquare(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -112,7 +112,7 @@ func TestPhotosQuerySquare(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -125,7 +125,7 @@ func TestPhotosQuerySquare(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -139,7 +139,7 @@ func TestPhotosQuerySquare(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -152,7 +152,7 @@ func TestPhotosQuerySquare(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -166,7 +166,7 @@ func TestPhotosQuerySquare(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -180,7 +180,7 @@ func TestPhotosQuerySquare(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -194,7 +194,7 @@ func TestPhotosQuerySquare(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -208,7 +208,7 @@ func TestPhotosQuerySquare(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -222,7 +222,7 @@ func TestPhotosQuerySquare(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -236,7 +236,7 @@ func TestPhotosQuerySquare(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -250,7 +250,7 @@ func TestPhotosQuerySquare(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -264,7 +264,7 @@ func TestPhotosQuerySquare(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -278,7 +278,7 @@ func TestPhotosQuerySquare(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -292,7 +292,7 @@ func TestPhotosQuerySquare(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -306,7 +306,7 @@ func TestPhotosQuerySquare(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("AndSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -320,7 +320,7 @@ func TestPhotosQuerySquare(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("OrSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -334,6 +334,6 @@ func TestPhotosQuerySquare(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ func TestPhotosQueryStack(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
f.Query = "stack:false"
|
||||
f.Merged = true
|
||||
|
||||
|
|
@ -59,7 +59,7 @@ func TestPhotosQueryStack(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -72,7 +72,7 @@ func TestPhotosQueryStack(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -85,7 +85,7 @@ func TestPhotosQueryStack(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -99,7 +99,7 @@ func TestPhotosQueryStack(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -112,7 +112,7 @@ func TestPhotosQueryStack(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -126,7 +126,7 @@ func TestPhotosQueryStack(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -139,7 +139,7 @@ func TestPhotosQueryStack(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -154,7 +154,7 @@ func TestPhotosQueryStack(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -168,7 +168,7 @@ func TestPhotosQueryStack(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -182,7 +182,7 @@ func TestPhotosQueryStack(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -196,7 +196,7 @@ func TestPhotosQueryStack(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -210,7 +210,7 @@ func TestPhotosQueryStack(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -224,7 +224,7 @@ func TestPhotosQueryStack(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -238,7 +238,7 @@ func TestPhotosQueryStack(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -252,7 +252,7 @@ func TestPhotosQueryStack(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -266,7 +266,7 @@ func TestPhotosQueryStack(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -280,7 +280,7 @@ func TestPhotosQueryStack(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -294,7 +294,7 @@ func TestPhotosQueryStack(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("AndSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -308,7 +308,7 @@ func TestPhotosQueryStack(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("OrSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -322,6 +322,6 @@ func TestPhotosQueryStack(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ func TestPhotosQueryStackable(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
f.Query = "stackable:false"
|
||||
f.Merged = true
|
||||
|
||||
|
|
@ -59,7 +59,7 @@ func TestPhotosQueryStackable(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -72,7 +72,7 @@ func TestPhotosQueryStackable(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -85,7 +85,7 @@ func TestPhotosQueryStackable(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -99,7 +99,7 @@ func TestPhotosQueryStackable(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -112,7 +112,7 @@ func TestPhotosQueryStackable(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -126,7 +126,7 @@ func TestPhotosQueryStackable(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -139,7 +139,7 @@ func TestPhotosQueryStackable(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -154,7 +154,7 @@ func TestPhotosQueryStackable(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -168,7 +168,7 @@ func TestPhotosQueryStackable(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -182,7 +182,7 @@ func TestPhotosQueryStackable(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -196,7 +196,7 @@ func TestPhotosQueryStackable(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -210,7 +210,7 @@ func TestPhotosQueryStackable(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -224,7 +224,7 @@ func TestPhotosQueryStackable(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -238,7 +238,7 @@ func TestPhotosQueryStackable(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -252,7 +252,7 @@ func TestPhotosQueryStackable(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -266,7 +266,7 @@ func TestPhotosQueryStackable(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -280,7 +280,7 @@ func TestPhotosQueryStackable(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -294,7 +294,7 @@ func TestPhotosQueryStackable(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("AndSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -308,7 +308,7 @@ func TestPhotosQueryStackable(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("OrSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -322,6 +322,6 @@ func TestPhotosQueryStackable(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ func TestPhotosFilterState(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("State of Mexico pipe Rheinland-Pfalz", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -72,7 +72,7 @@ func TestPhotosFilterState(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("State of Mexico OR Rheinland", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -85,7 +85,7 @@ func TestPhotosFilterState(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -98,7 +98,7 @@ func TestPhotosFilterState(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -111,7 +111,7 @@ func TestPhotosFilterState(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -124,7 +124,7 @@ func TestPhotosFilterState(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -137,7 +137,7 @@ func TestPhotosFilterState(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -150,7 +150,7 @@ func TestPhotosFilterState(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -163,7 +163,7 @@ func TestPhotosFilterState(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -176,7 +176,7 @@ func TestPhotosFilterState(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -190,7 +190,7 @@ func TestPhotosFilterState(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -203,7 +203,7 @@ func TestPhotosFilterState(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -216,7 +216,7 @@ func TestPhotosFilterState(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -229,7 +229,7 @@ func TestPhotosFilterState(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -242,7 +242,7 @@ func TestPhotosFilterState(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -256,7 +256,7 @@ func TestPhotosFilterState(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, 1, len(photos))
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -270,7 +270,7 @@ func TestPhotosFilterState(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -283,7 +283,7 @@ func TestPhotosFilterState(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 4, len(photos))
|
||||
assert.Len(t, photos, 4)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -296,7 +296,7 @@ func TestPhotosFilterState(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -309,7 +309,7 @@ func TestPhotosFilterState(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -322,7 +322,7 @@ func TestPhotosFilterState(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -351,7 +351,7 @@ func TestPhotosQueryState(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("State of Mexico pipe Rheinland-Pfalz", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -390,7 +390,7 @@ func TestPhotosQueryState(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("State of Mexico OR Rheinland", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -403,7 +403,7 @@ func TestPhotosQueryState(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -416,7 +416,7 @@ func TestPhotosQueryState(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -429,7 +429,7 @@ func TestPhotosQueryState(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -442,7 +442,7 @@ func TestPhotosQueryState(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -455,7 +455,7 @@ func TestPhotosQueryState(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -468,7 +468,7 @@ func TestPhotosQueryState(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -481,7 +481,7 @@ func TestPhotosQueryState(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -494,7 +494,7 @@ func TestPhotosQueryState(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -508,7 +508,7 @@ func TestPhotosQueryState(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -521,7 +521,7 @@ func TestPhotosQueryState(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -534,7 +534,7 @@ func TestPhotosQueryState(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -547,7 +547,7 @@ func TestPhotosQueryState(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -560,7 +560,7 @@ func TestPhotosQueryState(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -573,7 +573,7 @@ func TestPhotosQueryState(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -587,7 +587,7 @@ func TestPhotosQueryState(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -600,7 +600,7 @@ func TestPhotosQueryState(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -613,7 +613,7 @@ func TestPhotosQueryState(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -626,7 +626,7 @@ func TestPhotosQueryState(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -639,6 +639,6 @@ func TestPhotosQueryState(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ func TestPhotosFilterSubject(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("Actress", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -33,7 +33,7 @@ func TestPhotosFilterSubject(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("Actress A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -46,7 +46,7 @@ func TestPhotosFilterSubject(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 3)
|
||||
assert.Len(t, photos, 3)
|
||||
})
|
||||
t.Run("Actor A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -59,7 +59,7 @@ func TestPhotosFilterSubject(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 3)
|
||||
assert.Len(t, photos, 3)
|
||||
})
|
||||
t.Run("Actor A pipe Actress A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -72,7 +72,7 @@ func TestPhotosFilterSubject(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 5)
|
||||
assert.Len(t, photos, 5)
|
||||
})
|
||||
t.Run("Actor A whitespace pipe whitespace Actress A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -85,7 +85,7 @@ func TestPhotosFilterSubject(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 5)
|
||||
assert.Len(t, photos, 5)
|
||||
})
|
||||
t.Run("Actor A ampersand Actress A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -98,7 +98,7 @@ func TestPhotosFilterSubject(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("Actor A whitespace ampersand whitespace Actress A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -111,7 +111,7 @@ func TestPhotosFilterSubject(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -124,7 +124,7 @@ func TestPhotosFilterSubject(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -137,7 +137,7 @@ func TestPhotosFilterSubject(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -150,7 +150,7 @@ func TestPhotosFilterSubject(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
//TODO error
|
||||
/*t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
|
|
@ -164,7 +164,7 @@ func TestPhotosFilterSubject(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})*/
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -177,7 +177,7 @@ func TestPhotosFilterSubject(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
//TODO error
|
||||
/*t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
|
|
@ -191,7 +191,7 @@ func TestPhotosFilterSubject(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})*/
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -204,7 +204,7 @@ func TestPhotosFilterSubject(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -218,7 +218,7 @@ func TestPhotosFilterSubject(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -231,7 +231,7 @@ func TestPhotosFilterSubject(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -244,7 +244,7 @@ func TestPhotosFilterSubject(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -257,7 +257,7 @@ func TestPhotosFilterSubject(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -270,7 +270,7 @@ func TestPhotosFilterSubject(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -283,7 +283,7 @@ func TestPhotosFilterSubject(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -297,7 +297,7 @@ func TestPhotosFilterSubject(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -311,7 +311,7 @@ func TestPhotosFilterSubject(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -324,7 +324,7 @@ func TestPhotosFilterSubject(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -337,7 +337,7 @@ func TestPhotosFilterSubject(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -350,7 +350,7 @@ func TestPhotosFilterSubject(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -366,7 +366,7 @@ func TestPhotosQuerySubject(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("Actress", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -379,7 +379,7 @@ func TestPhotosQuerySubject(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("Actress A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -392,7 +392,7 @@ func TestPhotosQuerySubject(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 3)
|
||||
assert.Len(t, photos, 3)
|
||||
})
|
||||
t.Run("Actor A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -405,7 +405,7 @@ func TestPhotosQuerySubject(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 3)
|
||||
assert.Len(t, photos, 3)
|
||||
})
|
||||
t.Run("Actor A pipe Actress A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -418,7 +418,7 @@ func TestPhotosQuerySubject(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 5)
|
||||
assert.Len(t, photos, 5)
|
||||
})
|
||||
t.Run("Actor A whitespace pipe whitespace Actress A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -431,7 +431,7 @@ func TestPhotosQuerySubject(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 5)
|
||||
assert.Len(t, photos, 5)
|
||||
})
|
||||
t.Run("Actor A ampersand Actress A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -444,7 +444,7 @@ func TestPhotosQuerySubject(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("Actor A whitespace ampersand whitespace Actress A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -457,7 +457,7 @@ func TestPhotosQuerySubject(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -470,7 +470,7 @@ func TestPhotosQuerySubject(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -483,7 +483,7 @@ func TestPhotosQuerySubject(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -496,7 +496,7 @@ func TestPhotosQuerySubject(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
//TODO error
|
||||
/*t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
|
|
@ -510,7 +510,7 @@ func TestPhotosQuerySubject(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})*/
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -523,7 +523,7 @@ func TestPhotosQuerySubject(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
//TODO error
|
||||
/*t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
|
|
@ -537,7 +537,7 @@ func TestPhotosQuerySubject(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})*/
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -550,7 +550,7 @@ func TestPhotosQuerySubject(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -564,7 +564,7 @@ func TestPhotosQuerySubject(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -577,7 +577,7 @@ func TestPhotosQuerySubject(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -590,7 +590,7 @@ func TestPhotosQuerySubject(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -603,7 +603,7 @@ func TestPhotosQuerySubject(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -616,7 +616,7 @@ func TestPhotosQuerySubject(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -629,7 +629,7 @@ func TestPhotosQuerySubject(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -643,7 +643,7 @@ func TestPhotosQuerySubject(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -656,7 +656,7 @@ func TestPhotosQuerySubject(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -669,7 +669,7 @@ func TestPhotosQuerySubject(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -682,7 +682,7 @@ func TestPhotosQuerySubject(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -695,6 +695,6 @@ func TestPhotosQuerySubject(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ func TestPhotosFilterSubjects(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 5)
|
||||
assert.Len(t, photos, 5)
|
||||
})
|
||||
t.Run("Actress", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -33,7 +33,7 @@ func TestPhotosFilterSubjects(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 3)
|
||||
assert.Len(t, photos, 3)
|
||||
})
|
||||
t.Run("Actress A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -46,7 +46,7 @@ func TestPhotosFilterSubjects(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 3)
|
||||
assert.Len(t, photos, 3)
|
||||
})
|
||||
t.Run("Actor A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -59,7 +59,7 @@ func TestPhotosFilterSubjects(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 3)
|
||||
assert.Len(t, photos, 3)
|
||||
})
|
||||
t.Run("Actor A pipe Actress A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -72,7 +72,7 @@ func TestPhotosFilterSubjects(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 5)
|
||||
assert.Len(t, photos, 5)
|
||||
})
|
||||
t.Run("Actor A whitespace pipe whitespace Actress A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -85,7 +85,7 @@ func TestPhotosFilterSubjects(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 5)
|
||||
assert.Len(t, photos, 5)
|
||||
})
|
||||
t.Run("Actor A ampersand Actress A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -98,7 +98,7 @@ func TestPhotosFilterSubjects(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("Actor A whitespace ampersand whitespace Actress A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -111,7 +111,7 @@ func TestPhotosFilterSubjects(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -124,7 +124,7 @@ func TestPhotosFilterSubjects(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -137,7 +137,7 @@ func TestPhotosFilterSubjects(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -150,7 +150,7 @@ func TestPhotosFilterSubjects(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -163,7 +163,7 @@ func TestPhotosFilterSubjects(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -176,7 +176,7 @@ func TestPhotosFilterSubjects(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -189,7 +189,7 @@ func TestPhotosFilterSubjects(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -202,7 +202,7 @@ func TestPhotosFilterSubjects(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -216,7 +216,7 @@ func TestPhotosFilterSubjects(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -229,7 +229,7 @@ func TestPhotosFilterSubjects(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -242,7 +242,7 @@ func TestPhotosFilterSubjects(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -255,7 +255,7 @@ func TestPhotosFilterSubjects(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -268,7 +268,7 @@ func TestPhotosFilterSubjects(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -281,7 +281,7 @@ func TestPhotosFilterSubjects(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -295,7 +295,7 @@ func TestPhotosFilterSubjects(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -309,7 +309,7 @@ func TestPhotosFilterSubjects(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -322,7 +322,7 @@ func TestPhotosFilterSubjects(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -335,7 +335,7 @@ func TestPhotosFilterSubjects(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -348,7 +348,7 @@ func TestPhotosFilterSubjects(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -364,7 +364,7 @@ func TestPhotosQuerySubjects(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 5)
|
||||
assert.Len(t, photos, 5)
|
||||
})
|
||||
t.Run("Actress", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -377,7 +377,7 @@ func TestPhotosQuerySubjects(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 3)
|
||||
assert.Len(t, photos, 3)
|
||||
})
|
||||
t.Run("Actress A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -390,7 +390,7 @@ func TestPhotosQuerySubjects(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 3)
|
||||
assert.Len(t, photos, 3)
|
||||
})
|
||||
t.Run("Actor A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -403,7 +403,7 @@ func TestPhotosQuerySubjects(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 3)
|
||||
assert.Len(t, photos, 3)
|
||||
})
|
||||
t.Run("Actor A pipe Actress A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -416,7 +416,7 @@ func TestPhotosQuerySubjects(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 5)
|
||||
assert.Len(t, photos, 5)
|
||||
})
|
||||
t.Run("Actor A whitespace pipe whitespace Actress A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -429,7 +429,7 @@ func TestPhotosQuerySubjects(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 5)
|
||||
assert.Len(t, photos, 5)
|
||||
})
|
||||
t.Run("Actor A ampersand Actress A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -442,7 +442,7 @@ func TestPhotosQuerySubjects(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("Actor A whitespace ampersand whitespace Actress A", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -455,7 +455,7 @@ func TestPhotosQuerySubjects(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -468,7 +468,7 @@ func TestPhotosQuerySubjects(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -481,7 +481,7 @@ func TestPhotosQuerySubjects(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -494,7 +494,7 @@ func TestPhotosQuerySubjects(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -507,7 +507,7 @@ func TestPhotosQuerySubjects(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -520,7 +520,7 @@ func TestPhotosQuerySubjects(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -533,7 +533,7 @@ func TestPhotosQuerySubjects(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -546,7 +546,7 @@ func TestPhotosQuerySubjects(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -560,7 +560,7 @@ func TestPhotosQuerySubjects(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -573,7 +573,7 @@ func TestPhotosQuerySubjects(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -586,7 +586,7 @@ func TestPhotosQuerySubjects(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -599,7 +599,7 @@ func TestPhotosQuerySubjects(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -612,7 +612,7 @@ func TestPhotosQuerySubjects(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -625,7 +625,7 @@ func TestPhotosQuerySubjects(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -639,7 +639,7 @@ func TestPhotosQuerySubjects(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -652,7 +652,7 @@ func TestPhotosQuerySubjects(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -665,7 +665,7 @@ func TestPhotosQuerySubjects(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -678,7 +678,7 @@ func TestPhotosQuerySubjects(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -691,6 +691,6 @@ func TestPhotosQuerySubjects(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ func TestPhotosFilterTitle(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("Lake*", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -33,7 +33,7 @@ func TestPhotosFilterTitle(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("true", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -80,7 +80,7 @@ func TestPhotosFilterTitle(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("Neckarbrücke or Lake*", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -93,7 +93,7 @@ func TestPhotosFilterTitle(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("Neckarbrücke whitespace pipe whitespace Lake*", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -106,7 +106,7 @@ func TestPhotosFilterTitle(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 3)
|
||||
assert.Len(t, photos, 3)
|
||||
})
|
||||
t.Run("Neckarbrücke pipe Lake*", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -119,7 +119,7 @@ func TestPhotosFilterTitle(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 3)
|
||||
assert.Len(t, photos, 3)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -132,7 +132,7 @@ func TestPhotosFilterTitle(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -145,7 +145,7 @@ func TestPhotosFilterTitle(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -159,7 +159,7 @@ func TestPhotosFilterTitle(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -173,7 +173,7 @@ func TestPhotosFilterTitle(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -187,7 +187,7 @@ func TestPhotosFilterTitle(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -201,7 +201,7 @@ func TestPhotosFilterTitle(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -215,7 +215,7 @@ func TestPhotosFilterTitle(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -229,7 +229,7 @@ func TestPhotosFilterTitle(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -243,7 +243,7 @@ func TestPhotosFilterTitle(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -257,7 +257,7 @@ func TestPhotosFilterTitle(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -271,7 +271,7 @@ func TestPhotosFilterTitle(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -285,7 +285,7 @@ func TestPhotosFilterTitle(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -313,7 +313,7 @@ func TestPhotosFilterTitle(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -339,7 +339,7 @@ func TestPhotosFilterTitle(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -353,7 +353,7 @@ func TestPhotosFilterTitle(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -367,7 +367,7 @@ func TestPhotosFilterTitle(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithDoubleQuotes", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -381,7 +381,7 @@ func TestPhotosFilterTitle(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterDoubleQuotes", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -395,7 +395,7 @@ func TestPhotosFilterTitle(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithDoubleQuotes", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -409,7 +409,7 @@ func TestPhotosFilterTitle(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("OrSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -422,7 +422,7 @@ func TestPhotosFilterTitle(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("OrSearch2", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -464,7 +464,7 @@ func TestPhotosQueryTitle(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("Lake*", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -477,7 +477,7 @@ func TestPhotosQueryTitle(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("Neckarbrücke", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -490,7 +490,7 @@ func TestPhotosQueryTitle(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("Neckarbrücke or Lake*", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -503,7 +503,7 @@ func TestPhotosQueryTitle(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("Neckarbrücke whitespace pipe whitespace Lake*", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -516,7 +516,7 @@ func TestPhotosQueryTitle(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 3)
|
||||
assert.Len(t, photos, 3)
|
||||
})
|
||||
t.Run("Neckarbrücke pipe Lake*", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -529,7 +529,7 @@ func TestPhotosQueryTitle(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 3)
|
||||
assert.Len(t, photos, 3)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -542,7 +542,7 @@ func TestPhotosQueryTitle(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -555,7 +555,7 @@ func TestPhotosQueryTitle(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -569,7 +569,7 @@ func TestPhotosQueryTitle(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -583,7 +583,7 @@ func TestPhotosQueryTitle(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -597,7 +597,7 @@ func TestPhotosQueryTitle(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -611,7 +611,7 @@ func TestPhotosQueryTitle(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -625,7 +625,7 @@ func TestPhotosQueryTitle(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -639,7 +639,7 @@ func TestPhotosQueryTitle(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -653,7 +653,7 @@ func TestPhotosQueryTitle(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -667,7 +667,7 @@ func TestPhotosQueryTitle(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -681,7 +681,7 @@ func TestPhotosQueryTitle(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -695,7 +695,7 @@ func TestPhotosQueryTitle(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -709,7 +709,7 @@ func TestPhotosQueryTitle(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
//TODO
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -723,7 +723,7 @@ func TestPhotosQueryTitle(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -737,7 +737,7 @@ func TestPhotosQueryTitle(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
//TODO
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -750,7 +750,7 @@ func TestPhotosQueryTitle(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -764,7 +764,7 @@ func TestPhotosQueryTitle(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -778,7 +778,7 @@ func TestPhotosQueryTitle(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("StartsWithDoubleQuotes", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -833,7 +833,7 @@ func TestPhotosQueryTitle(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("OrSearch2", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ func TestPhotosFilterType(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 3)
|
||||
assert.Len(t, photos, 3)
|
||||
})
|
||||
t.Run("raw", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -33,7 +33,7 @@ func TestPhotosFilterType(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("animated", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -46,7 +46,7 @@ func TestPhotosFilterType(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("raw pipe video", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -59,7 +59,7 @@ func TestPhotosFilterType(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 5)
|
||||
assert.Len(t, photos, 5)
|
||||
})
|
||||
t.Run("raw whitespace pipe whitespace video", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -72,7 +72,7 @@ func TestPhotosFilterType(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 5)
|
||||
assert.Len(t, photos, 5)
|
||||
})
|
||||
t.Run("raw or video", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -85,7 +85,7 @@ func TestPhotosFilterType(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("raw OR video", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -98,7 +98,7 @@ func TestPhotosFilterType(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -111,7 +111,7 @@ func TestPhotosFilterType(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -124,7 +124,7 @@ func TestPhotosFilterType(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -137,7 +137,7 @@ func TestPhotosFilterType(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -150,7 +150,7 @@ func TestPhotosFilterType(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -163,7 +163,7 @@ func TestPhotosFilterType(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -176,7 +176,7 @@ func TestPhotosFilterType(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -189,7 +189,7 @@ func TestPhotosFilterType(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -203,7 +203,7 @@ func TestPhotosFilterType(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -216,7 +216,7 @@ func TestPhotosFilterType(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -229,7 +229,7 @@ func TestPhotosFilterType(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -242,7 +242,7 @@ func TestPhotosFilterType(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -255,7 +255,7 @@ func TestPhotosFilterType(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -268,7 +268,7 @@ func TestPhotosFilterType(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -282,7 +282,7 @@ func TestPhotosFilterType(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -296,7 +296,7 @@ func TestPhotosFilterType(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -309,7 +309,7 @@ func TestPhotosFilterType(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -322,7 +322,7 @@ func TestPhotosFilterType(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -335,7 +335,7 @@ func TestPhotosFilterType(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -351,7 +351,7 @@ func TestPhotosQueryType(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 3)
|
||||
assert.Len(t, photos, 3)
|
||||
})
|
||||
t.Run("raw", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -364,7 +364,7 @@ func TestPhotosQueryType(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("animated", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -377,7 +377,7 @@ func TestPhotosQueryType(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("raw pipe video", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -390,7 +390,7 @@ func TestPhotosQueryType(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 5)
|
||||
assert.Len(t, photos, 5)
|
||||
})
|
||||
t.Run("raw whitespace pipe whitespace video", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -403,7 +403,7 @@ func TestPhotosQueryType(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 5)
|
||||
assert.Len(t, photos, 5)
|
||||
})
|
||||
t.Run("raw or video", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -416,7 +416,7 @@ func TestPhotosQueryType(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("raw OR video", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -429,7 +429,7 @@ func TestPhotosQueryType(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -442,7 +442,7 @@ func TestPhotosQueryType(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -455,7 +455,7 @@ func TestPhotosQueryType(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -468,7 +468,7 @@ func TestPhotosQueryType(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -481,7 +481,7 @@ func TestPhotosQueryType(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -494,7 +494,7 @@ func TestPhotosQueryType(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -507,7 +507,7 @@ func TestPhotosQueryType(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -520,7 +520,7 @@ func TestPhotosQueryType(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -534,7 +534,7 @@ func TestPhotosQueryType(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -547,7 +547,7 @@ func TestPhotosQueryType(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -560,7 +560,7 @@ func TestPhotosQueryType(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -573,7 +573,7 @@ func TestPhotosQueryType(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -586,7 +586,7 @@ func TestPhotosQueryType(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -599,7 +599,7 @@ func TestPhotosQueryType(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -613,7 +613,7 @@ func TestPhotosQueryType(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -626,7 +626,7 @@ func TestPhotosQueryType(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -639,7 +639,7 @@ func TestPhotosQueryType(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -652,7 +652,7 @@ func TestPhotosQueryType(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -665,6 +665,6 @@ func TestPhotosQueryType(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ func TestPhotosFilterUid(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("ps6sg6be2lvl0yh*", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -31,7 +31,7 @@ func TestPhotosFilterUid(t *testing.T) {
|
|||
photos, _, err := Photos(f)
|
||||
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -42,7 +42,7 @@ func TestPhotosFilterUid(t *testing.T) {
|
|||
photos, _, err := Photos(f)
|
||||
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -53,7 +53,7 @@ func TestPhotosFilterUid(t *testing.T) {
|
|||
photos, _, err := Photos(f)
|
||||
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -64,7 +64,7 @@ func TestPhotosFilterUid(t *testing.T) {
|
|||
photos, _, err := Photos(f)
|
||||
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -75,7 +75,7 @@ func TestPhotosFilterUid(t *testing.T) {
|
|||
photos, _, err := Photos(f)
|
||||
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -86,7 +86,7 @@ func TestPhotosFilterUid(t *testing.T) {
|
|||
photos, _, err := Photos(f)
|
||||
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -97,7 +97,7 @@ func TestPhotosFilterUid(t *testing.T) {
|
|||
photos, _, err := Photos(f)
|
||||
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -108,7 +108,7 @@ func TestPhotosFilterUid(t *testing.T) {
|
|||
photos, _, err := Photos(f)
|
||||
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -119,7 +119,7 @@ func TestPhotosFilterUid(t *testing.T) {
|
|||
photos, _, err := Photos(f)
|
||||
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -130,7 +130,7 @@ func TestPhotosFilterUid(t *testing.T) {
|
|||
photos, _, err := Photos(f)
|
||||
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -141,7 +141,7 @@ func TestPhotosFilterUid(t *testing.T) {
|
|||
photos, _, err := Photos(f)
|
||||
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -152,7 +152,7 @@ func TestPhotosFilterUid(t *testing.T) {
|
|||
photos, _, err := Photos(f)
|
||||
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -163,7 +163,7 @@ func TestPhotosFilterUid(t *testing.T) {
|
|||
photos, _, err := Photos(f)
|
||||
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -174,7 +174,7 @@ func TestPhotosFilterUid(t *testing.T) {
|
|||
photos, _, err := Photos(f)
|
||||
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -185,7 +185,7 @@ func TestPhotosFilterUid(t *testing.T) {
|
|||
photos, _, err := Photos(f)
|
||||
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -196,7 +196,7 @@ func TestPhotosFilterUid(t *testing.T) {
|
|||
photos, _, err := Photos(f)
|
||||
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -207,7 +207,7 @@ func TestPhotosFilterUid(t *testing.T) {
|
|||
photos, _, err := Photos(f)
|
||||
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -218,7 +218,7 @@ func TestPhotosFilterUid(t *testing.T) {
|
|||
photos, _, err := Photos(f)
|
||||
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -229,7 +229,7 @@ func TestPhotosFilterUid(t *testing.T) {
|
|||
photos, _, err := Photos(f)
|
||||
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -246,7 +246,7 @@ func TestPhotosQueryUid(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("QuotedPhotoUID", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -260,7 +260,7 @@ func TestPhotosQueryUid(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("ps6sg6be2lvl0yh*", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -271,7 +271,7 @@ func TestPhotosQueryUid(t *testing.T) {
|
|||
photos, _, err := Photos(f)
|
||||
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -282,7 +282,7 @@ func TestPhotosQueryUid(t *testing.T) {
|
|||
photos, _, err := Photos(f)
|
||||
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -293,7 +293,7 @@ func TestPhotosQueryUid(t *testing.T) {
|
|||
photos, _, err := Photos(f)
|
||||
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -304,7 +304,7 @@ func TestPhotosQueryUid(t *testing.T) {
|
|||
photos, _, err := Photos(f)
|
||||
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -315,7 +315,7 @@ func TestPhotosQueryUid(t *testing.T) {
|
|||
photos, _, err := Photos(f)
|
||||
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -326,7 +326,7 @@ func TestPhotosQueryUid(t *testing.T) {
|
|||
photos, _, err := Photos(f)
|
||||
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -337,7 +337,7 @@ func TestPhotosQueryUid(t *testing.T) {
|
|||
photos, _, err := Photos(f)
|
||||
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -348,7 +348,7 @@ func TestPhotosQueryUid(t *testing.T) {
|
|||
photos, _, err := Photos(f)
|
||||
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -359,7 +359,7 @@ func TestPhotosQueryUid(t *testing.T) {
|
|||
photos, _, err := Photos(f)
|
||||
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -370,7 +370,7 @@ func TestPhotosQueryUid(t *testing.T) {
|
|||
photos, _, err := Photos(f)
|
||||
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -381,7 +381,7 @@ func TestPhotosQueryUid(t *testing.T) {
|
|||
photos, _, err := Photos(f)
|
||||
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -392,7 +392,7 @@ func TestPhotosQueryUid(t *testing.T) {
|
|||
photos, _, err := Photos(f)
|
||||
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -403,7 +403,7 @@ func TestPhotosQueryUid(t *testing.T) {
|
|||
photos, _, err := Photos(f)
|
||||
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -414,7 +414,7 @@ func TestPhotosQueryUid(t *testing.T) {
|
|||
photos, _, err := Photos(f)
|
||||
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -425,7 +425,7 @@ func TestPhotosQueryUid(t *testing.T) {
|
|||
photos, _, err := Photos(f)
|
||||
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -436,7 +436,7 @@ func TestPhotosQueryUid(t *testing.T) {
|
|||
photos, _, err := Photos(f)
|
||||
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -447,7 +447,7 @@ func TestPhotosQueryUid(t *testing.T) {
|
|||
photos, _, err := Photos(f)
|
||||
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -458,7 +458,7 @@ func TestPhotosQueryUid(t *testing.T) {
|
|||
photos, _, err := Photos(f)
|
||||
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -469,6 +469,6 @@ func TestPhotosQueryUid(t *testing.T) {
|
|||
photos, _, err := Photos(f)
|
||||
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ func TestPhotosQueryUnsorted(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
f.Query = "unsorted:false"
|
||||
f.Merged = true
|
||||
|
||||
|
|
@ -59,7 +59,7 @@ func TestPhotosQueryUnsorted(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -72,7 +72,7 @@ func TestPhotosQueryUnsorted(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -85,7 +85,7 @@ func TestPhotosQueryUnsorted(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -99,7 +99,7 @@ func TestPhotosQueryUnsorted(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -112,7 +112,7 @@ func TestPhotosQueryUnsorted(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -126,7 +126,7 @@ func TestPhotosQueryUnsorted(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -139,7 +139,7 @@ func TestPhotosQueryUnsorted(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -154,7 +154,7 @@ func TestPhotosQueryUnsorted(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -168,7 +168,7 @@ func TestPhotosQueryUnsorted(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -182,7 +182,7 @@ func TestPhotosQueryUnsorted(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -196,7 +196,7 @@ func TestPhotosQueryUnsorted(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -210,7 +210,7 @@ func TestPhotosQueryUnsorted(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -224,7 +224,7 @@ func TestPhotosQueryUnsorted(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -238,7 +238,7 @@ func TestPhotosQueryUnsorted(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -252,7 +252,7 @@ func TestPhotosQueryUnsorted(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -266,7 +266,7 @@ func TestPhotosQueryUnsorted(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -280,7 +280,7 @@ func TestPhotosQueryUnsorted(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -294,7 +294,7 @@ func TestPhotosQueryUnsorted(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("AndSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -308,7 +308,7 @@ func TestPhotosQueryUnsorted(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("OrSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -322,6 +322,6 @@ func TestPhotosQueryUnsorted(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ func TestPhotosQueryUnstacked(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos0), 1)
|
||||
assert.Len(t, photos0, 1)
|
||||
|
||||
t.Run("false > yes", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -37,7 +37,7 @@ func TestPhotosQueryUnstacked(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
f.Query = "unstacked:false"
|
||||
f.Merged = true
|
||||
|
||||
|
|
@ -59,7 +59,7 @@ func TestPhotosQueryUnstacked(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -72,7 +72,7 @@ func TestPhotosQueryUnstacked(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -85,7 +85,7 @@ func TestPhotosQueryUnstacked(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -99,7 +99,7 @@ func TestPhotosQueryUnstacked(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -112,7 +112,7 @@ func TestPhotosQueryUnstacked(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -126,7 +126,7 @@ func TestPhotosQueryUnstacked(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -139,7 +139,7 @@ func TestPhotosQueryUnstacked(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -154,7 +154,7 @@ func TestPhotosQueryUnstacked(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -168,7 +168,7 @@ func TestPhotosQueryUnstacked(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -182,7 +182,7 @@ func TestPhotosQueryUnstacked(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -196,7 +196,7 @@ func TestPhotosQueryUnstacked(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -210,7 +210,7 @@ func TestPhotosQueryUnstacked(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -224,7 +224,7 @@ func TestPhotosQueryUnstacked(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -238,7 +238,7 @@ func TestPhotosQueryUnstacked(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -252,7 +252,7 @@ func TestPhotosQueryUnstacked(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -266,7 +266,7 @@ func TestPhotosQueryUnstacked(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -280,7 +280,7 @@ func TestPhotosQueryUnstacked(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -294,7 +294,7 @@ func TestPhotosQueryUnstacked(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("AndSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -308,7 +308,7 @@ func TestPhotosQueryUnstacked(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("OrSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -322,6 +322,6 @@ func TestPhotosQueryUnstacked(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ func TestPhotosQueryVector(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos0), 0)
|
||||
assert.Len(t, photos0, 0)
|
||||
|
||||
t.Run("yes", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -37,7 +37,7 @@ func TestPhotosQueryVector(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("false > yes", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -50,7 +50,7 @@ func TestPhotosQueryVector(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
f.Query = "vector:false"
|
||||
f.Merged = true
|
||||
|
||||
|
|
@ -72,7 +72,7 @@ func TestPhotosQueryVector(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -85,7 +85,7 @@ func TestPhotosQueryVector(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -98,7 +98,7 @@ func TestPhotosQueryVector(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -112,7 +112,7 @@ func TestPhotosQueryVector(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -125,7 +125,7 @@ func TestPhotosQueryVector(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -139,7 +139,7 @@ func TestPhotosQueryVector(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -152,7 +152,7 @@ func TestPhotosQueryVector(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -166,7 +166,7 @@ func TestPhotosQueryVector(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -180,7 +180,7 @@ func TestPhotosQueryVector(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -194,7 +194,7 @@ func TestPhotosQueryVector(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -208,7 +208,7 @@ func TestPhotosQueryVector(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -222,7 +222,7 @@ func TestPhotosQueryVector(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -236,7 +236,7 @@ func TestPhotosQueryVector(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -250,7 +250,7 @@ func TestPhotosQueryVector(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -264,7 +264,7 @@ func TestPhotosQueryVector(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -278,7 +278,7 @@ func TestPhotosQueryVector(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -292,7 +292,7 @@ func TestPhotosQueryVector(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -306,7 +306,7 @@ func TestPhotosQueryVector(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("AndSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -320,7 +320,7 @@ func TestPhotosQueryVector(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("OrSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -334,6 +334,6 @@ func TestPhotosQueryVector(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ func TestPhotosQueryVideo(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
f.Query = "video:false"
|
||||
f.Merged = true
|
||||
|
||||
|
|
@ -59,7 +59,7 @@ func TestPhotosQueryVideo(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -72,7 +72,7 @@ func TestPhotosQueryVideo(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -85,7 +85,7 @@ func TestPhotosQueryVideo(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -99,7 +99,7 @@ func TestPhotosQueryVideo(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -112,7 +112,7 @@ func TestPhotosQueryVideo(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -126,7 +126,7 @@ func TestPhotosQueryVideo(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -139,7 +139,7 @@ func TestPhotosQueryVideo(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -154,7 +154,7 @@ func TestPhotosQueryVideo(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -168,7 +168,7 @@ func TestPhotosQueryVideo(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -182,7 +182,7 @@ func TestPhotosQueryVideo(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -196,7 +196,7 @@ func TestPhotosQueryVideo(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -210,7 +210,7 @@ func TestPhotosQueryVideo(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -224,7 +224,7 @@ func TestPhotosQueryVideo(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -238,7 +238,7 @@ func TestPhotosQueryVideo(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -252,7 +252,7 @@ func TestPhotosQueryVideo(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -266,7 +266,7 @@ func TestPhotosQueryVideo(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -280,7 +280,7 @@ func TestPhotosQueryVideo(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -294,7 +294,7 @@ func TestPhotosQueryVideo(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("AndSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -308,7 +308,7 @@ func TestPhotosQueryVideo(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("OrSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -322,6 +322,6 @@ func TestPhotosQueryVideo(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ func TestPhotosFilterYear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("2018", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -38,7 +38,7 @@ func TestPhotosFilterYear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("19*", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -51,7 +51,7 @@ func TestPhotosFilterYear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("2018 pipe 2008", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -64,7 +64,7 @@ func TestPhotosFilterYear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 4)
|
||||
assert.Len(t, photos, 4)
|
||||
})
|
||||
t.Run("2018 whitespace pipe whitespace 2008", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -77,7 +77,7 @@ func TestPhotosFilterYear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 4)
|
||||
assert.Len(t, photos, 4)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -90,7 +90,7 @@ func TestPhotosFilterYear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -103,7 +103,7 @@ func TestPhotosFilterYear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -116,7 +116,7 @@ func TestPhotosFilterYear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -129,7 +129,7 @@ func TestPhotosFilterYear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -142,7 +142,7 @@ func TestPhotosFilterYear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -155,7 +155,7 @@ func TestPhotosFilterYear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -168,7 +168,7 @@ func TestPhotosFilterYear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -182,7 +182,7 @@ func TestPhotosFilterYear(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -195,7 +195,7 @@ func TestPhotosFilterYear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -208,7 +208,7 @@ func TestPhotosFilterYear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -221,7 +221,7 @@ func TestPhotosFilterYear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -234,7 +234,7 @@ func TestPhotosFilterYear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -247,7 +247,7 @@ func TestPhotosFilterYear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -261,7 +261,7 @@ func TestPhotosFilterYear(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -275,7 +275,7 @@ func TestPhotosFilterYear(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -288,7 +288,7 @@ func TestPhotosFilterYear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -301,7 +301,7 @@ func TestPhotosFilterYear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -314,7 +314,7 @@ func TestPhotosFilterYear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -336,7 +336,7 @@ func TestPhotosQueryYear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("2018", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -349,7 +349,7 @@ func TestPhotosQueryYear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 2)
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("19*", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -362,7 +362,7 @@ func TestPhotosQueryYear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("2018 pipe 2008", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -375,7 +375,7 @@ func TestPhotosQueryYear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 4)
|
||||
assert.Len(t, photos, 4)
|
||||
})
|
||||
t.Run("2018 whitespace pipe whitespace 2008", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -388,7 +388,7 @@ func TestPhotosQueryYear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 4)
|
||||
assert.Len(t, photos, 4)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -401,7 +401,7 @@ func TestPhotosQueryYear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -414,7 +414,7 @@ func TestPhotosQueryYear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -427,7 +427,7 @@ func TestPhotosQueryYear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -440,7 +440,7 @@ func TestPhotosQueryYear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -453,7 +453,7 @@ func TestPhotosQueryYear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -466,7 +466,7 @@ func TestPhotosQueryYear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -479,7 +479,7 @@ func TestPhotosQueryYear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -493,7 +493,7 @@ func TestPhotosQueryYear(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -506,7 +506,7 @@ func TestPhotosQueryYear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -519,7 +519,7 @@ func TestPhotosQueryYear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -532,7 +532,7 @@ func TestPhotosQueryYear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -545,7 +545,7 @@ func TestPhotosQueryYear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -558,7 +558,7 @@ func TestPhotosQueryYear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -572,7 +572,7 @@ func TestPhotosQueryYear(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -585,7 +585,7 @@ func TestPhotosQueryYear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -598,7 +598,7 @@ func TestPhotosQueryYear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -611,7 +611,7 @@ func TestPhotosQueryYear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -624,6 +624,6 @@ func TestPhotosQueryYear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ func TestPhotosGeoFilterAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("Pet*", func(t *testing.T) {
|
||||
|
|
@ -68,7 +68,7 @@ func TestPhotosGeoFilterAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("Pet* pipe Berlin 2019", func(t *testing.T) {
|
||||
|
|
@ -100,7 +100,7 @@ func TestPhotosGeoFilterAlbums(t *testing.T) {
|
|||
}
|
||||
|
||||
t.Log(photos)
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("Pet* whitespace pipe whitespace Berlin 2019", func(t *testing.T) {
|
||||
|
|
@ -131,7 +131,7 @@ func TestPhotosGeoFilterAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("Pet* or Berlin 2019", func(t *testing.T) {
|
||||
|
|
@ -162,7 +162,7 @@ func TestPhotosGeoFilterAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("Pet* OR Berlin 2019", func(t *testing.T) {
|
||||
|
|
@ -193,7 +193,7 @@ func TestPhotosGeoFilterAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
|
||||
})
|
||||
|
|
@ -225,7 +225,7 @@ func TestPhotosGeoFilterAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("Pet* whitespace Ampersand whitespace Berlin 2019", func(t *testing.T) {
|
||||
|
|
@ -256,7 +256,7 @@ func TestPhotosGeoFilterAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("Pet* and Berlin 2019", func(t *testing.T) {
|
||||
|
|
@ -287,7 +287,7 @@ func TestPhotosGeoFilterAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("Pet* AND Berlin 2019", func(t *testing.T) {
|
||||
|
|
@ -318,7 +318,7 @@ func TestPhotosGeoFilterAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
|
|
@ -333,7 +333,7 @@ func TestPhotosGeoFilterAlbums(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
|
||||
var geo form.SearchPhotosGeo
|
||||
|
||||
|
|
@ -350,7 +350,7 @@ func TestPhotosGeoFilterAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -364,7 +364,7 @@ func TestPhotosGeoFilterAlbums(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
|
||||
var geo form.SearchPhotosGeo
|
||||
|
||||
|
|
@ -381,7 +381,7 @@ func TestPhotosGeoFilterAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -411,7 +411,7 @@ func TestPhotosGeoFilterAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
|
|
@ -426,7 +426,7 @@ func TestPhotosGeoFilterAlbums(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
|
||||
var geo form.SearchPhotosGeo
|
||||
|
||||
|
|
@ -443,7 +443,7 @@ func TestPhotosGeoFilterAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -457,7 +457,7 @@ func TestPhotosGeoFilterAlbums(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
|
||||
var geo form.SearchPhotosGeo
|
||||
|
||||
|
|
@ -474,7 +474,7 @@ func TestPhotosGeoFilterAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -504,7 +504,7 @@ func TestPhotosGeoFilterAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
|
|
@ -519,7 +519,7 @@ func TestPhotosGeoFilterAlbums(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
|
||||
var geo form.SearchPhotosGeo
|
||||
|
||||
|
|
@ -536,7 +536,7 @@ func TestPhotosGeoFilterAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -566,7 +566,7 @@ func TestPhotosGeoFilterAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
|
|
@ -597,7 +597,7 @@ func TestPhotosGeoFilterAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
|
|
@ -612,7 +612,7 @@ func TestPhotosGeoFilterAlbums(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
|
||||
var geo form.SearchPhotosGeo
|
||||
|
||||
|
|
@ -629,7 +629,7 @@ func TestPhotosGeoFilterAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -659,7 +659,7 @@ func TestPhotosGeoFilterAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
|
|
@ -690,7 +690,7 @@ func TestPhotosGeoFilterAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
|
|
@ -705,7 +705,7 @@ func TestPhotosGeoFilterAlbums(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 1)
|
||||
assert.Len(t, photos, 1)
|
||||
|
||||
var geo form.SearchPhotosGeo
|
||||
|
||||
|
|
@ -722,7 +722,7 @@ func TestPhotosGeoFilterAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -757,7 +757,7 @@ func TestPhotosGeoFilterAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
|
|
@ -788,7 +788,7 @@ func TestPhotosGeoFilterAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
|
|
@ -819,7 +819,7 @@ func TestPhotosGeoFilterAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
|
|
@ -850,7 +850,7 @@ func TestPhotosGeoFilterAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
|
|
@ -881,7 +881,7 @@ func TestPhotosGeoFilterAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("AndSearch", func(t *testing.T) {
|
||||
|
|
@ -912,7 +912,7 @@ func TestPhotosGeoFilterAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("OrSearch", func(t *testing.T) {
|
||||
|
|
@ -943,7 +943,7 @@ func TestPhotosGeoFilterAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("AndSearch2", func(t *testing.T) {
|
||||
|
|
@ -974,7 +974,7 @@ func TestPhotosGeoFilterAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("OrSearch2", func(t *testing.T) {
|
||||
|
|
@ -1005,7 +1005,7 @@ func TestPhotosGeoFilterAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("AndSearch3", func(t *testing.T) {
|
||||
|
|
@ -1036,7 +1036,7 @@ func TestPhotosGeoFilterAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("OrSearch3", func(t *testing.T) {
|
||||
|
|
@ -1067,7 +1067,7 @@ func TestPhotosGeoFilterAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
}
|
||||
|
|
@ -1101,7 +1101,7 @@ func TestPhotosGeoQueryAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
|
||||
})
|
||||
|
|
@ -1132,7 +1132,7 @@ func TestPhotosGeoQueryAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("Pet* pipe Berlin 2019", func(t *testing.T) {
|
||||
|
|
@ -1162,7 +1162,7 @@ func TestPhotosGeoQueryAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("Pet* whitespace pipe whitespace Berlin 2019", func(t *testing.T) {
|
||||
|
|
@ -1192,7 +1192,7 @@ func TestPhotosGeoQueryAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("Pet* or Berlin 2019", func(t *testing.T) {
|
||||
|
|
@ -1222,7 +1222,7 @@ func TestPhotosGeoQueryAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("Pet* OR Berlin 2019", func(t *testing.T) {
|
||||
|
|
@ -1252,7 +1252,7 @@ func TestPhotosGeoQueryAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("Pet* Ampersand Berlin 2019", func(t *testing.T) {
|
||||
|
|
@ -1282,7 +1282,7 @@ func TestPhotosGeoQueryAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("Pet* whitespace Ampersand whitespace Berlin 2019", func(t *testing.T) {
|
||||
|
|
@ -1312,7 +1312,7 @@ func TestPhotosGeoQueryAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("Pet* and Berlin 2019", func(t *testing.T) {
|
||||
|
|
@ -1342,7 +1342,7 @@ func TestPhotosGeoQueryAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("Pet* AND Berlin 2019", func(t *testing.T) {
|
||||
|
|
@ -1372,7 +1372,7 @@ func TestPhotosGeoQueryAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
|
|
@ -1402,7 +1402,7 @@ func TestPhotosGeoQueryAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -1431,7 +1431,7 @@ func TestPhotosGeoQueryAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -1460,7 +1460,7 @@ func TestPhotosGeoQueryAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
|
|
@ -1490,7 +1490,7 @@ func TestPhotosGeoQueryAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -1519,7 +1519,7 @@ func TestPhotosGeoQueryAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -1548,7 +1548,7 @@ func TestPhotosGeoQueryAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
|
|
@ -1578,7 +1578,7 @@ func TestPhotosGeoQueryAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -1608,7 +1608,7 @@ func TestPhotosGeoQueryAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
|
|
@ -1638,7 +1638,7 @@ func TestPhotosGeoQueryAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
|
|
@ -1668,7 +1668,7 @@ func TestPhotosGeoQueryAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -1697,7 +1697,7 @@ func TestPhotosGeoQueryAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
|
|
@ -1727,7 +1727,7 @@ func TestPhotosGeoQueryAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
|
|
@ -1757,7 +1757,7 @@ func TestPhotosGeoQueryAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -1792,7 +1792,7 @@ func TestPhotosGeoQueryAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
|
|
@ -1822,7 +1822,7 @@ func TestPhotosGeoQueryAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
|
|
@ -1852,7 +1852,7 @@ func TestPhotosGeoQueryAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
|
|
@ -1882,7 +1882,7 @@ func TestPhotosGeoQueryAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
|
|
@ -1912,7 +1912,7 @@ func TestPhotosGeoQueryAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("AndSearch", func(t *testing.T) {
|
||||
|
|
@ -1942,7 +1942,7 @@ func TestPhotosGeoQueryAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("OrSearch", func(t *testing.T) {
|
||||
|
|
@ -1972,7 +1972,7 @@ func TestPhotosGeoQueryAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("AndSearch2", func(t *testing.T) {
|
||||
|
|
@ -2002,7 +2002,7 @@ func TestPhotosGeoQueryAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("OrSearch2", func(t *testing.T) {
|
||||
|
|
@ -2032,7 +2032,7 @@ func TestPhotosGeoQueryAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("AndSearch3", func(t *testing.T) {
|
||||
|
|
@ -2062,7 +2062,7 @@ func TestPhotosGeoQueryAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
t.Run("OrSearch3", func(t *testing.T) {
|
||||
|
|
@ -2092,7 +2092,7 @@ func TestPhotosGeoQueryAlbums(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
assert.Equal(t, photos[0].PhotoUID, geophotos[0].PhotoUID)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ func TestPhotosGeoQueryFavorite(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos0), 6)
|
||||
assert.Len(t, photos0, 6)
|
||||
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -39,7 +39,7 @@ func TestPhotosGeoQueryFavorite(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
var geo form.SearchPhotosGeo
|
||||
|
||||
geo.Query = "favorite:\"%gold\""
|
||||
|
|
@ -55,7 +55,7 @@ func TestPhotosGeoQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -69,7 +69,7 @@ func TestPhotosGeoQueryFavorite(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
var geo form.SearchPhotosGeo
|
||||
|
||||
geo.Query = "favorite:\"I love % dog\""
|
||||
|
|
@ -85,7 +85,7 @@ func TestPhotosGeoQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -99,7 +99,7 @@ func TestPhotosGeoQueryFavorite(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
var geo form.SearchPhotosGeo
|
||||
|
||||
geo.Query = "favorite:\"sale%\""
|
||||
|
|
@ -115,7 +115,7 @@ func TestPhotosGeoQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -130,7 +130,7 @@ func TestPhotosGeoQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
var geo form.SearchPhotosGeo
|
||||
|
||||
geo.Query = "favorite:\"&IlikeFood\""
|
||||
|
|
@ -146,7 +146,7 @@ func TestPhotosGeoQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -160,7 +160,7 @@ func TestPhotosGeoQueryFavorite(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
var geo form.SearchPhotosGeo
|
||||
|
||||
geo.Query = "favorite:\"Pets & Dogs\""
|
||||
|
|
@ -176,7 +176,7 @@ func TestPhotosGeoQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -191,7 +191,7 @@ func TestPhotosGeoQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
var geo form.SearchPhotosGeo
|
||||
|
||||
geo.Query = "favorite:\"Light&\""
|
||||
|
|
@ -207,7 +207,7 @@ func TestPhotosGeoQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -221,7 +221,7 @@ func TestPhotosGeoQueryFavorite(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
var geo form.SearchPhotosGeo
|
||||
|
||||
geo.Query = "favorite:\"'Family\""
|
||||
|
|
@ -237,7 +237,7 @@ func TestPhotosGeoQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -253,7 +253,7 @@ func TestPhotosGeoQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
var geo form.SearchPhotosGeo
|
||||
|
||||
geo.Query = "favorite:\"Mother's Day\""
|
||||
|
|
@ -269,7 +269,7 @@ func TestPhotosGeoQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -284,7 +284,7 @@ func TestPhotosGeoQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
var geo form.SearchPhotosGeo
|
||||
|
||||
geo.Query = "favorite:\"Ice Cream'\""
|
||||
|
|
@ -300,7 +300,7 @@ func TestPhotosGeoQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -315,7 +315,7 @@ func TestPhotosGeoQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
var geo form.SearchPhotosGeo
|
||||
|
||||
geo.Query = "favorite:\"*Forrest\""
|
||||
|
|
@ -331,7 +331,7 @@ func TestPhotosGeoQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -346,7 +346,7 @@ func TestPhotosGeoQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
var geo form.SearchPhotosGeo
|
||||
|
||||
geo.Query = "favorite:\"My*Kids\""
|
||||
|
|
@ -362,7 +362,7 @@ func TestPhotosGeoQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -377,7 +377,7 @@ func TestPhotosGeoQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
var geo form.SearchPhotosGeo
|
||||
|
||||
geo.Query = "favorite:\"Yoga***\""
|
||||
|
|
@ -393,7 +393,7 @@ func TestPhotosGeoQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -408,7 +408,7 @@ func TestPhotosGeoQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
var geo form.SearchPhotosGeo
|
||||
|
||||
geo.Query = "favorite:\"|Banana\""
|
||||
|
|
@ -424,7 +424,7 @@ func TestPhotosGeoQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -439,7 +439,7 @@ func TestPhotosGeoQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
var geo form.SearchPhotosGeo
|
||||
|
||||
geo.Query = "favorite:\"Red|Green\""
|
||||
|
|
@ -455,7 +455,7 @@ func TestPhotosGeoQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -470,7 +470,7 @@ func TestPhotosGeoQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
var geo form.SearchPhotosGeo
|
||||
|
||||
geo.Query = "favorite:\"Blue|\""
|
||||
|
|
@ -486,7 +486,7 @@ func TestPhotosGeoQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -501,7 +501,7 @@ func TestPhotosGeoQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
var geo form.SearchPhotosGeo
|
||||
|
||||
geo.Query = "favorite:\"345 Shirt\""
|
||||
|
|
@ -517,7 +517,7 @@ func TestPhotosGeoQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -532,7 +532,7 @@ func TestPhotosGeoQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
var geo form.SearchPhotosGeo
|
||||
|
||||
geo.Query = "favorite:\"Color555 Blue\""
|
||||
|
|
@ -548,7 +548,7 @@ func TestPhotosGeoQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -563,7 +563,7 @@ func TestPhotosGeoQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
var geo form.SearchPhotosGeo
|
||||
|
||||
geo.Query = "favorite:\"Route 66\""
|
||||
|
|
@ -579,7 +579,7 @@ func TestPhotosGeoQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
})
|
||||
t.Run("AndSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -594,7 +594,7 @@ func TestPhotosGeoQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
var geo form.SearchPhotosGeo
|
||||
|
||||
geo.Query = "favorite:\"Route 66 & Father's Day\""
|
||||
|
|
@ -610,7 +610,7 @@ func TestPhotosGeoQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
})
|
||||
t.Run("OrSearch", func(t *testing.T) {
|
||||
var f form.SearchPhotos
|
||||
|
|
@ -625,7 +625,7 @@ func TestPhotosGeoQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos0))
|
||||
assert.Len(t, photos, len(photos0))
|
||||
var geo form.SearchPhotosGeo
|
||||
|
||||
geo.Query = "favorite:\"Route %66 | *Father's Day\""
|
||||
|
|
@ -641,6 +641,6 @@ func TestPhotosGeoQueryFavorite(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(geophotos))
|
||||
assert.Len(t, photos, len(geophotos))
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ func TestPhotosGeoFilterNear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 9)
|
||||
assert.Len(t, photos, 9)
|
||||
})
|
||||
t.Run("ps6sg6byk7wrbk30", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -31,7 +31,7 @@ func TestPhotosGeoFilterNear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 26)
|
||||
assert.Len(t, photos, 26)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -60,7 +60,7 @@ func TestPhotosGeoFilterNear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -72,7 +72,7 @@ func TestPhotosGeoFilterNear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -84,7 +84,7 @@ func TestPhotosGeoFilterNear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -96,7 +96,7 @@ func TestPhotosGeoFilterNear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -108,7 +108,7 @@ func TestPhotosGeoFilterNear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -121,7 +121,7 @@ func TestPhotosGeoFilterNear(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -133,7 +133,7 @@ func TestPhotosGeoFilterNear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -145,7 +145,7 @@ func TestPhotosGeoFilterNear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -157,7 +157,7 @@ func TestPhotosGeoFilterNear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -169,7 +169,7 @@ func TestPhotosGeoFilterNear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -181,7 +181,7 @@ func TestPhotosGeoFilterNear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -194,7 +194,7 @@ func TestPhotosGeoFilterNear(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -207,7 +207,7 @@ func TestPhotosGeoFilterNear(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -219,7 +219,7 @@ func TestPhotosGeoFilterNear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -231,7 +231,7 @@ func TestPhotosGeoFilterNear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -243,7 +243,7 @@ func TestPhotosGeoFilterNear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})*/
|
||||
}
|
||||
|
||||
|
|
@ -259,7 +259,7 @@ func TestPhotosGeoQueryNear(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 9)
|
||||
assert.Len(t, photos, 9)
|
||||
})
|
||||
t.Run("ps6sg6byk7wrbk30", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -271,7 +271,7 @@ func TestPhotosGeoQueryNear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 26)
|
||||
assert.Len(t, photos, 26)
|
||||
})
|
||||
//TODO error
|
||||
/*t.Run("ps6sg6be2lvl0y24 pipe ps6sg6byk7wrbk30", func(t *testing.T) {
|
||||
|
|
@ -284,7 +284,7 @@ func TestPhotosGeoQueryNear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -296,7 +296,7 @@ func TestPhotosGeoQueryNear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -308,7 +308,7 @@ func TestPhotosGeoQueryNear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -320,7 +320,7 @@ func TestPhotosGeoQueryNear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -332,7 +332,7 @@ func TestPhotosGeoQueryNear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -344,7 +344,7 @@ func TestPhotosGeoQueryNear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -356,7 +356,7 @@ func TestPhotosGeoQueryNear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -368,7 +368,7 @@ func TestPhotosGeoQueryNear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -381,7 +381,7 @@ func TestPhotosGeoQueryNear(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -393,7 +393,7 @@ func TestPhotosGeoQueryNear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -405,7 +405,7 @@ func TestPhotosGeoQueryNear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -417,7 +417,7 @@ func TestPhotosGeoQueryNear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -429,7 +429,7 @@ func TestPhotosGeoQueryNear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -441,7 +441,7 @@ func TestPhotosGeoQueryNear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -454,7 +454,7 @@ func TestPhotosGeoQueryNear(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -466,7 +466,7 @@ func TestPhotosGeoQueryNear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -478,7 +478,7 @@ func TestPhotosGeoQueryNear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -490,7 +490,7 @@ func TestPhotosGeoQueryNear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -502,6 +502,6 @@ func TestPhotosGeoQueryNear(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 0)
|
||||
assert.Len(t, photos, 0)
|
||||
})*/
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ func TestPhotosGeoFilterS2(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 3)
|
||||
assert.Len(t, photos, 3)
|
||||
})
|
||||
t.Run("85d1ea7d382c", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -33,7 +33,7 @@ func TestPhotosGeoFilterS2(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, len(photos), 9)
|
||||
assert.Len(t, photos, 9)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -46,7 +46,7 @@ func TestPhotosGeoFilterS2(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -59,7 +59,7 @@ func TestPhotosGeoFilterS2(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -71,7 +71,7 @@ func TestPhotosGeoFilterS2(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -83,7 +83,7 @@ func TestPhotosGeoFilterS2(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -95,7 +95,7 @@ func TestPhotosGeoFilterS2(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -107,7 +107,7 @@ func TestPhotosGeoFilterS2(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -119,7 +119,7 @@ func TestPhotosGeoFilterS2(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -132,7 +132,7 @@ func TestPhotosGeoFilterS2(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -144,7 +144,7 @@ func TestPhotosGeoFilterS2(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -156,7 +156,7 @@ func TestPhotosGeoFilterS2(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -168,7 +168,7 @@ func TestPhotosGeoFilterS2(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -180,7 +180,7 @@ func TestPhotosGeoFilterS2(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -192,7 +192,7 @@ func TestPhotosGeoFilterS2(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -205,7 +205,7 @@ func TestPhotosGeoFilterS2(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -218,7 +218,7 @@ func TestPhotosGeoFilterS2(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -230,7 +230,7 @@ func TestPhotosGeoFilterS2(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -242,7 +242,7 @@ func TestPhotosGeoFilterS2(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -254,7 +254,7 @@ func TestPhotosGeoFilterS2(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -270,7 +270,7 @@ func TestPhotosGeoQueryS2(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 3, len(photos))
|
||||
assert.Len(t, photos, 3)
|
||||
})
|
||||
t.Run("s2:85d1ea7d382c", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -282,7 +282,7 @@ func TestPhotosGeoQueryS2(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 9, len(photos))
|
||||
assert.Len(t, photos, 9)
|
||||
})
|
||||
t.Run("85d1ea7d382c pipe 1ef744d1e283", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -294,7 +294,7 @@ func TestPhotosGeoQueryS2(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -306,7 +306,7 @@ func TestPhotosGeoQueryS2(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -318,7 +318,7 @@ func TestPhotosGeoQueryS2(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPercent", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -330,7 +330,7 @@ func TestPhotosGeoQueryS2(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -342,7 +342,7 @@ func TestPhotosGeoQueryS2(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -354,7 +354,7 @@ func TestPhotosGeoQueryS2(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAmpersand", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -366,7 +366,7 @@ func TestPhotosGeoQueryS2(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -378,7 +378,7 @@ func TestPhotosGeoQueryS2(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -391,7 +391,7 @@ func TestPhotosGeoQueryS2(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithSingleQuote", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -403,7 +403,7 @@ func TestPhotosGeoQueryS2(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -415,7 +415,7 @@ func TestPhotosGeoQueryS2(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -427,7 +427,7 @@ func TestPhotosGeoQueryS2(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithAsterisk", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -439,7 +439,7 @@ func TestPhotosGeoQueryS2(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -451,7 +451,7 @@ func TestPhotosGeoQueryS2(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -464,7 +464,7 @@ func TestPhotosGeoQueryS2(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithPipe", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -476,7 +476,7 @@ func TestPhotosGeoQueryS2(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("StartsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -488,7 +488,7 @@ func TestPhotosGeoQueryS2(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("CenterNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -500,7 +500,7 @@ func TestPhotosGeoQueryS2(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
t.Run("EndsWithNumber", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -512,6 +512,6 @@ func TestPhotosGeoQueryS2(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, 0, len(photos))
|
||||
assert.Len(t, photos, 0)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ func TestGeo(t *testing.T) {
|
|||
if result, err := PhotosGeo(query); err != nil {
|
||||
t.Fatal(err)
|
||||
} else {
|
||||
assert.Equal(t, 0, len(result))
|
||||
assert.Len(t, result, 0)
|
||||
}
|
||||
})
|
||||
t.Run("form.keywords", func(t *testing.T) {
|
||||
|
|
@ -426,7 +426,7 @@ func TestGeo(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, 1, len(photos))
|
||||
assert.Len(t, photos, 1)
|
||||
})
|
||||
t.Run("Albums", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -438,7 +438,7 @@ func TestGeo(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, 2, len(photos))
|
||||
assert.Len(t, photos, 2)
|
||||
})
|
||||
t.Run("City", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -450,7 +450,7 @@ func TestGeo(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, 9, len(photos))
|
||||
assert.Len(t, photos, 9)
|
||||
})
|
||||
t.Run("PathOrPath", func(t *testing.T) {
|
||||
var f form.SearchPhotosGeo
|
||||
|
|
@ -745,7 +745,7 @@ func TestGeo(t *testing.T) {
|
|||
t.Fatal(err2)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos), len(photos2))
|
||||
assert.Len(t, photos, len(photos2))
|
||||
|
||||
var f3 form.SearchPhotosGeo
|
||||
|
||||
|
|
@ -776,8 +776,8 @@ func TestGeo(t *testing.T) {
|
|||
t.Fatal(err4)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos3), len(photos4))
|
||||
assert.Equal(t, len(photos), len(photos4))
|
||||
assert.Len(t, photos3, len(photos4))
|
||||
assert.Len(t, photos, len(photos4))
|
||||
|
||||
var f5 form.SearchPhotosGeo
|
||||
f5.Subject = "js6sg6b1h1njaaad"
|
||||
|
|
@ -793,7 +793,7 @@ func TestGeo(t *testing.T) {
|
|||
t.Fatal(err5)
|
||||
}
|
||||
|
||||
assert.Equal(t, len(photos5), len(photos4))
|
||||
assert.Len(t, photos5, len(photos4))
|
||||
})
|
||||
t.Run("f.Scan = true", func(t *testing.T) {
|
||||
var frm form.SearchPhotosGeo
|
||||
|
|
@ -1150,7 +1150,7 @@ func TestGeo(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, 1, len(photos))
|
||||
assert.Len(t, photos, 1)
|
||||
|
||||
for _, r := range photos {
|
||||
assert.IsType(t, GeoResult{}, r)
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ func (m *Photo) Approve() error {
|
|||
if err := UnscopedDb().
|
||||
Table(entity.Photo{}.TableName()).
|
||||
Where("photo_uid = ?", m.GetUID()).
|
||||
UpdateColumns(entity.Map{
|
||||
UpdateColumns(entity.Values{
|
||||
"deleted_at": gorm.Expr("NULL"),
|
||||
"edited_at": &edited,
|
||||
"photo_quality": 3}).Error; err != nil {
|
||||
|
|
|
|||
|
|
@ -391,7 +391,7 @@ func TestPhotoResults_Photos(t *testing.T) {
|
|||
|
||||
r := PhotoResults{photo1, photo2}
|
||||
|
||||
assert.Equal(t, 2, len(r.Photos()))
|
||||
assert.Len(t, r.Photos(), 2)
|
||||
}
|
||||
|
||||
func TestPhotosResults_Merged(t *testing.T) {
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue