From ee467945094ec367fcae5a42623a0875c036346d Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Mon, 29 Sep 2025 18:59:52 +0200 Subject: [PATCH] CLI: Add "photoprism vision reset" command to reset metadata #5233 Signed-off-by: Michael Mayer --- AGENTS.md | 1 + internal/api/config_options.go | 4 +- internal/api/photo_label.go | 2 +- internal/commands/commands_test.go | 3 + internal/commands/vision.go | 1 + internal/commands/vision_reset.go | 116 +++++++++++++ internal/commands/vision_reset_test.go | 30 ++++ internal/commands/vision_run.go | 2 +- internal/config/config_cluster.go | 8 +- internal/config/map.go | 4 +- internal/config/test.go | 2 +- internal/entity/album.go | 16 +- internal/entity/album_test.go | 6 +- internal/entity/auth_user.go | 10 +- internal/entity/auth_user_share.go | 2 +- internal/entity/entity_values.go | 8 +- internal/entity/entity_values_test.go | 10 +- internal/entity/face.go | 10 +- internal/entity/file.go | 6 +- internal/entity/file_fixtures.go | 42 +++++ internal/entity/marker.go | 16 +- internal/entity/passcode.go | 4 +- internal/entity/photo.go | 6 +- internal/entity/photo_fixtures.go | 60 +++++++ internal/entity/photo_reset.go | 97 +++++++++++ internal/entity/photo_reset_test.go | 95 +++++++++++ internal/entity/photo_test.go | 2 +- internal/entity/query/faces.go | 2 +- internal/entity/query/markers.go | 8 +- internal/entity/query/query_test.go | 3 + internal/entity/query/subjects.go | 2 +- internal/entity/reaction.go | 2 +- internal/entity/search/albums_test.go | 12 +- .../entity/search/photos_filter_album_test.go | 20 +-- .../search/photos_filter_albums_test.go | 84 +++++----- .../entity/search/photos_filter_alt_test.go | 16 +- .../search/photos_filter_animated_test.go | 46 +++--- .../search/photos_filter_archived_test.go | 42 ++--- .../search/photos_filter_camera_test.go | 80 ++++----- .../search/photos_filter_category_test.go | 66 ++++---- .../entity/search/photos_filter_city_test.go | 84 +++++----- .../entity/search/photos_filter_color_test.go | 72 ++++---- .../search/photos_filter_country_test.go | 80 ++++----- .../entity/search/photos_filter_day_test.go | 88 +++++----- .../entity/search/photos_filter_error_test.go | 42 ++--- .../search/photos_filter_f_number_test.go | 16 +- .../entity/search/photos_filter_face_test.go | 76 ++++----- .../entity/search/photos_filter_faces_test.go | 88 +++++----- .../search/photos_filter_favorite_test.go | 44 ++--- .../search/photos_filter_filename_test.go | 132 +++++++-------- .../search/photos_filter_filter_test.go | 74 ++++----- .../search/photos_filter_focal_length_test.go | 16 +- .../search/photos_filter_folder_test.go | 122 +++++++------- .../entity/search/photos_filter_geo_test.go | 40 ++--- .../entity/search/photos_filter_hash_test.go | 96 +++++------ .../search/photos_filter_hidden_test.go | 42 ++--- .../entity/search/photos_filter_id_test.go | 82 +++++----- .../entity/search/photos_filter_iso_test.go | 16 +- .../search/photos_filter_keywords_test.go | 140 ++++++++-------- .../entity/search/photos_filter_label_test.go | 98 +++++------ .../search/photos_filter_landscape_test.go | 44 ++--- .../entity/search/photos_filter_lens_test.go | 80 ++++----- .../entity/search/photos_filter_live_test.go | 42 ++--- .../entity/search/photos_filter_mono_test.go | 42 ++--- .../entity/search/photos_filter_month_test.go | 88 +++++----- .../entity/search/photos_filter_name_test.go | 132 +++++++-------- .../search/photos_filter_panorama_test.go | 42 ++--- .../entity/search/photos_filter_path_test.go | 110 ++++++------- .../search/photos_filter_people_test.go | 104 ++++++------ .../search/photos_filter_person_test.go | 104 ++++++------ .../entity/search/photos_filter_photo_test.go | 42 ++--- .../search/photos_filter_portrait_test.go | 46 +++--- .../search/photos_filter_primary_test.go | 40 ++--- .../search/photos_filter_private_test.go | 44 ++--- .../search/photos_filter_public_test.go | 42 ++--- .../entity/search/photos_filter_raw_test.go | 42 ++--- .../search/photos_filter_resolution_test.go | 16 +- .../search/photos_filter_review_test.go | 42 ++--- .../entity/search/photos_filter_scan_test.go | 42 ++--- .../search/photos_filter_square_test.go | 46 +++--- .../entity/search/photos_filter_stack_test.go | 42 ++--- .../search/photos_filter_stackable_test.go | 42 ++--- .../entity/search/photos_filter_state_test.go | 84 +++++----- .../search/photos_filter_subject_test.go | 104 ++++++------ .../search/photos_filter_subjects_test.go | 104 ++++++------ .../entity/search/photos_filter_title_test.go | 102 ++++++------ .../entity/search/photos_filter_type_test.go | 100 ++++++------ .../entity/search/photos_filter_uid_test.go | 82 +++++----- .../search/photos_filter_unsorted_test.go | 42 ++--- .../search/photos_filter_unstacked_test.go | 44 ++--- .../search/photos_filter_vector_test.go | 46 +++--- .../entity/search/photos_filter_video_test.go | 42 ++--- .../entity/search/photos_filter_year_test.go | 92 +++++------ .../search/photos_geo_filter_albums_test.go | 150 ++++++++--------- .../search/photos_geo_filter_favorite_test.go | 82 +++++----- .../search/photos_geo_filter_near_test.go | 78 ++++----- .../search/photos_geo_filter_s2_test.go | 82 +++++----- internal/entity/search/photos_geo_test.go | 18 +- internal/entity/search/photos_results.go | 2 +- internal/entity/search/photos_results_test.go | 2 +- internal/entity/search/photos_test.go | 26 +-- internal/entity/search/search_test.go | 3 + internal/entity/search/subjects_test.go | 14 +- internal/entity/service.go | 6 +- internal/entity/subject.go | 8 +- internal/photoprism/faces_cluster.go | 2 +- internal/service/cluster/node/bootstrap.go | 13 +- internal/workers/sync.go | 2 +- internal/workers/sync_refresh.go | 2 +- internal/workers/vision_reset.go | 154 ++++++++++++++++++ internal/workers/vision_reset_test.go | 56 +++++++ internal/workers/workers_test.go | 3 + 112 files changed, 2939 insertions(+), 2274 deletions(-) create mode 100644 internal/commands/vision_reset.go create mode 100644 internal/commands/vision_reset_test.go create mode 100644 internal/entity/photo_reset.go create mode 100644 internal/entity/photo_reset_test.go create mode 100644 internal/workers/vision_reset.go create mode 100644 internal/workers/vision_reset_test.go diff --git a/AGENTS.md b/AGENTS.md index 9efc3f2c7..61f07a695 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -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("", t.TempDir())` when you need a fresh SQLite schema without the cached fixture snapshot. - Shared fixtures live under `storage/testdata`; `NewTestConfig("")` 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("", 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. diff --git a/internal/api/config_options.go b/internal/api/config_options.go index d55a536ec..3b34e906b 100644 --- a/internal/api/config_options.go +++ b/internal/api/config_options.go @@ -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) diff --git a/internal/api/photo_label.go b/internal/api/photo_label.go index 3fff6a4e8..a81382366 100644 --- a/internal/api/photo_label.go +++ b/internal/api/photo_label.go @@ -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 { diff --git a/internal/commands/commands_test.go b/internal/commands/commands_test.go index 283dfe881..104689a4f 100644 --- a/internal/commands/commands_test.go +++ b/internal/commands/commands_test.go @@ -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) diff --git a/internal/commands/vision.go b/internal/commands/vision.go index 143a65f72..531d17b25 100644 --- a/internal/commands/vision.go +++ b/internal/commands/vision.go @@ -13,6 +13,7 @@ var VisionCommands = &cli.Command{ Subcommands: []*cli.Command{ VisionListCommand, VisionRunCommand, + VisionResetCommand, VisionSourcesCommand, VisionSaveCommand, }, diff --git a/internal/commands/vision_reset.go b/internal/commands/vision_reset.go new file mode 100644 index 000000000..d664a82d8 --- /dev/null +++ b/internal/commands/vision_reset.go @@ -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] + } +} diff --git a/internal/commands/vision_reset_test.go b/internal/commands/vision_reset_test.go new file mode 100644 index 000000000..379e3fc07 --- /dev/null +++ b/internal/commands/vision_reset_test.go @@ -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) + } + }) +} diff --git a/internal/commands/vision_run.go b/internal/commands/vision_run.go index 690dadaf5..dde88e5b6 100644 --- a/internal/commands/vision_run.go +++ b/internal/commands/vision_run.go @@ -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", diff --git a/internal/config/config_cluster.go b/internal/config/config_cluster.go index 62c539bd6..e3f9e80e5 100644 --- a/internal/config/config_cluster.go +++ b/internal/config/config_cluster.go @@ -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 { diff --git a/internal/config/map.go b/internal/config/map.go index 3fc3d630b..c52714180 100644 --- a/internal/config/map.go +++ b/internal/config/map.go @@ -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{} diff --git a/internal/config/test.go b/internal/config/test.go index 5a41230cf..4bb7c9a4a 100644 --- a/internal/config/test.go +++ b/internal/config/test.go @@ -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", diff --git a/internal/entity/album.go b/internal/entity/album.go index 8301680ec..526c7f8e7 100644 --- a/internal/entity/album.go +++ b/internal/entity/album.go @@ -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) } diff --git a/internal/entity/album_test.go b/internal/entity/album_test.go index 5cba3011b..96ecd0508 100644 --- a/internal/entity/album_test.go +++ b/internal/entity/album_test.go @@ -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) }) diff --git a/internal/entity/auth_user.go b/internal/entity/auth_user.go index 8a86685a3..9da0acdc4 100644 --- a/internal/entity/auth_user.go +++ b/internal/entity/auth_user.go @@ -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}) } diff --git a/internal/entity/auth_user_share.go b/internal/entity/auth_user_share.go index fe5729db2..7b92668ff 100644 --- a/internal/entity/auth_user_share.go +++ b/internal/entity/auth_user_share.go @@ -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, diff --git a/internal/entity/entity_values.go b/internal/entity/entity_values.go index d8b8af3c2..60504172b 100644 --- a/internal/entity/entity_values.go +++ b/internal/entity/entity_values.go @@ -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++ { diff --git a/internal/entity/entity_values_test.go b/internal/entity/entity_values_test.go index 95cbdf7c6..3b61ab2ba 100644 --- a/internal/entity/entity_values_test.go +++ b/internal/entity/entity_values_test.go @@ -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) }) } diff --git a/internal/entity/face.go b/internal/entity/face.go index e398ec234..41cfffa35 100644 --- a/internal/entity/face.go +++ b/internal/entity/face.go @@ -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 } diff --git a/internal/entity/file.go b/internal/entity/file.go index 652ed03af..74bb4af84 100644 --- a/internal/entity/file.go +++ b/internal/entity/file.go @@ -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, }) diff --git a/internal/entity/file_fixtures.go b/internal/entity/file_fixtures.go index a485f4b69..093166c37 100644 --- a/internal/entity/file_fixtures.go +++ b/internal/entity/file_fixtures.go @@ -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"] diff --git a/internal/entity/marker.go b/internal/entity/marker.go index e968fffb3..c2869d80e 100644 --- a/internal/entity/marker.go +++ b/internal/entity/marker.go @@ -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. diff --git a/internal/entity/passcode.go b/internal/entity/passcode.go index 6283848fb..313f2150b 100644 --- a/internal/entity/passcode.go +++ b/internal/entity/passcode.go @@ -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 diff --git a/internal/entity/photo.go b/internal/entity/photo.go index af08edb01..660a77f9b 100644 --- a/internal/entity/photo.go +++ b/internal/entity/photo.go @@ -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 } diff --git a/internal/entity/photo_fixtures.go b/internal/entity/photo_fixtures.go index 6cfd08a8f..37c1d9411 100644 --- a/internal/entity/photo_fixtures.go +++ b/internal/entity/photo_fixtures.go @@ -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. diff --git a/internal/entity/photo_reset.go b/internal/entity/photo_reset.go new file mode 100644 index 000000000..e7cc0a722 --- /dev/null +++ b/internal/entity/photo_reset.go @@ -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 +} diff --git a/internal/entity/photo_reset_test.go b/internal/entity/photo_reset_test.go new file mode 100644 index 000000000..4a7550424 --- /dev/null +++ b/internal/entity/photo_reset_test.go @@ -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 +} diff --git a/internal/entity/photo_test.go b/internal/entity/photo_test.go index 18eca39c0..c195126df 100644 --- a/internal/entity/photo_test.go +++ b/internal/entity/photo_test.go @@ -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) { diff --git a/internal/entity/query/faces.go b/internal/entity/query/faces.go index 73dbb7bb9..d11dfe714 100644 --- a/internal/entity/query/faces.go +++ b/internal/entity/query/faces.go @@ -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 diff --git a/internal/entity/query/markers.go b/internal/entity/query/markers.go index 2922ac3c3..a389b78bb 100644 --- a/internal/entity/query/markers.go +++ b/internal/entity/query/markers.go @@ -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 } diff --git a/internal/entity/query/query_test.go b/internal/entity/query/query_test.go index d82875732..10fd5b376 100644 --- a/internal/entity/query/query_test.go +++ b/internal/entity/query/query_test.go @@ -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")) diff --git a/internal/entity/query/subjects.go b/internal/entity/query/subjects.go index 5231132bf..16eb7da27 100644 --- a/internal/entity/query/subjects.go +++ b/internal/entity/query/subjects.go @@ -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 } diff --git a/internal/entity/reaction.go b/internal/entity/reaction.go index 0584a12b4..e7ad6ad97 100644 --- a/internal/entity/reaction.go +++ b/internal/entity/reaction.go @@ -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). diff --git a/internal/entity/search/albums_test.go b/internal/entity/search/albums_test.go index daf3e579f..d41c663d8 100644 --- a/internal/entity/search/albums_test.go +++ b/internal/entity/search/albums_test.go @@ -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{ diff --git a/internal/entity/search/photos_filter_album_test.go b/internal/entity/search/photos_filter_album_test.go index 478e3e266..7a809de7e 100644 --- a/internal/entity/search/photos_filter_album_test.go +++ b/internal/entity/search/photos_filter_album_test.go @@ -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 diff --git a/internal/entity/search/photos_filter_albums_test.go b/internal/entity/search/photos_filter_albums_test.go index e595d4436..7cc5ab954 100644 --- a/internal/entity/search/photos_filter_albums_test.go +++ b/internal/entity/search/photos_filter_albums_test.go @@ -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 diff --git a/internal/entity/search/photos_filter_alt_test.go b/internal/entity/search/photos_filter_alt_test.go index 1a67f3295..f026b78fb 100644 --- a/internal/entity/search/photos_filter_alt_test.go +++ b/internal/entity/search/photos_filter_alt_test.go @@ -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 diff --git a/internal/entity/search/photos_filter_animated_test.go b/internal/entity/search/photos_filter_animated_test.go index da9630839..065bd2976 100644 --- a/internal/entity/search/photos_filter_animated_test.go +++ b/internal/entity/search/photos_filter_animated_test.go @@ -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)) }) } diff --git a/internal/entity/search/photos_filter_archived_test.go b/internal/entity/search/photos_filter_archived_test.go index 031051540..49713bbba 100644 --- a/internal/entity/search/photos_filter_archived_test.go +++ b/internal/entity/search/photos_filter_archived_test.go @@ -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)) }) } diff --git a/internal/entity/search/photos_filter_camera_test.go b/internal/entity/search/photos_filter_camera_test.go index 2f6f371c4..543076219 100644 --- a/internal/entity/search/photos_filter_camera_test.go +++ b/internal/entity/search/photos_filter_camera_test.go @@ -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) }) } diff --git a/internal/entity/search/photos_filter_category_test.go b/internal/entity/search/photos_filter_category_test.go index bb690ac19..5f6c17189 100644 --- a/internal/entity/search/photos_filter_category_test.go +++ b/internal/entity/search/photos_filter_category_test.go @@ -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) }) } diff --git a/internal/entity/search/photos_filter_city_test.go b/internal/entity/search/photos_filter_city_test.go index 7d13590e7..b1c43f511 100644 --- a/internal/entity/search/photos_filter_city_test.go +++ b/internal/entity/search/photos_filter_city_test.go @@ -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) }) } diff --git a/internal/entity/search/photos_filter_color_test.go b/internal/entity/search/photos_filter_color_test.go index 890585411..3dbeab2c8 100644 --- a/internal/entity/search/photos_filter_color_test.go +++ b/internal/entity/search/photos_filter_color_test.go @@ -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) }) } diff --git a/internal/entity/search/photos_filter_country_test.go b/internal/entity/search/photos_filter_country_test.go index 86971f038..434280911 100644 --- a/internal/entity/search/photos_filter_country_test.go +++ b/internal/entity/search/photos_filter_country_test.go @@ -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) }) } diff --git a/internal/entity/search/photos_filter_day_test.go b/internal/entity/search/photos_filter_day_test.go index b1da4044e..90ae82099 100644 --- a/internal/entity/search/photos_filter_day_test.go +++ b/internal/entity/search/photos_filter_day_test.go @@ -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)) }) } diff --git a/internal/entity/search/photos_filter_error_test.go b/internal/entity/search/photos_filter_error_test.go index 681422806..4c5cde0c4 100644 --- a/internal/entity/search/photos_filter_error_test.go +++ b/internal/entity/search/photos_filter_error_test.go @@ -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)) }) } diff --git a/internal/entity/search/photos_filter_f_number_test.go b/internal/entity/search/photos_filter_f_number_test.go index 54d353a5a..8f7b80979 100644 --- a/internal/entity/search/photos_filter_f_number_test.go +++ b/internal/entity/search/photos_filter_f_number_test.go @@ -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 diff --git a/internal/entity/search/photos_filter_face_test.go b/internal/entity/search/photos_filter_face_test.go index 692cc0c84..9c762a2c3 100644 --- a/internal/entity/search/photos_filter_face_test.go +++ b/internal/entity/search/photos_filter_face_test.go @@ -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)) }) } diff --git a/internal/entity/search/photos_filter_faces_test.go b/internal/entity/search/photos_filter_faces_test.go index f7fba952d..3a4357a7b 100644 --- a/internal/entity/search/photos_filter_faces_test.go +++ b/internal/entity/search/photos_filter_faces_test.go @@ -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)) }) } diff --git a/internal/entity/search/photos_filter_favorite_test.go b/internal/entity/search/photos_filter_favorite_test.go index 30e66c709..6dd248d91 100644 --- a/internal/entity/search/photos_filter_favorite_test.go +++ b/internal/entity/search/photos_filter_favorite_test.go @@ -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)) }) } diff --git a/internal/entity/search/photos_filter_filename_test.go b/internal/entity/search/photos_filter_filename_test.go index eadfef925..89e07a155 100644 --- a/internal/entity/search/photos_filter_filename_test.go +++ b/internal/entity/search/photos_filter_filename_test.go @@ -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) }) } diff --git a/internal/entity/search/photos_filter_filter_test.go b/internal/entity/search/photos_filter_filter_test.go index 2af3a9cc7..239d17d3e 100644 --- a/internal/entity/search/photos_filter_filter_test.go +++ b/internal/entity/search/photos_filter_filter_test.go @@ -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) }) } diff --git a/internal/entity/search/photos_filter_focal_length_test.go b/internal/entity/search/photos_filter_focal_length_test.go index c24b8e66e..1bcc27ed4 100644 --- a/internal/entity/search/photos_filter_focal_length_test.go +++ b/internal/entity/search/photos_filter_focal_length_test.go @@ -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 diff --git a/internal/entity/search/photos_filter_folder_test.go b/internal/entity/search/photos_filter_folder_test.go index f8a579ee1..090cab52a 100644 --- a/internal/entity/search/photos_filter_folder_test.go +++ b/internal/entity/search/photos_filter_folder_test.go @@ -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) }) } diff --git a/internal/entity/search/photos_filter_geo_test.go b/internal/entity/search/photos_filter_geo_test.go index adadac4d4..c42bea1c6 100644 --- a/internal/entity/search/photos_filter_geo_test.go +++ b/internal/entity/search/photos_filter_geo_test.go @@ -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)) }) } diff --git a/internal/entity/search/photos_filter_hash_test.go b/internal/entity/search/photos_filter_hash_test.go index 9655450dd..67e5d1b39 100644 --- a/internal/entity/search/photos_filter_hash_test.go +++ b/internal/entity/search/photos_filter_hash_test.go @@ -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) }) } diff --git a/internal/entity/search/photos_filter_hidden_test.go b/internal/entity/search/photos_filter_hidden_test.go index 419cc1b83..35001847f 100644 --- a/internal/entity/search/photos_filter_hidden_test.go +++ b/internal/entity/search/photos_filter_hidden_test.go @@ -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)) }) } diff --git a/internal/entity/search/photos_filter_id_test.go b/internal/entity/search/photos_filter_id_test.go index 01bd32dc3..6bd3fad00 100644 --- a/internal/entity/search/photos_filter_id_test.go +++ b/internal/entity/search/photos_filter_id_test.go @@ -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) }) } diff --git a/internal/entity/search/photos_filter_iso_test.go b/internal/entity/search/photos_filter_iso_test.go index e5bdccb08..8a7428a1a 100644 --- a/internal/entity/search/photos_filter_iso_test.go +++ b/internal/entity/search/photos_filter_iso_test.go @@ -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 diff --git a/internal/entity/search/photos_filter_keywords_test.go b/internal/entity/search/photos_filter_keywords_test.go index 84f920dc6..cd0872b1a 100644 --- a/internal/entity/search/photos_filter_keywords_test.go +++ b/internal/entity/search/photos_filter_keywords_test.go @@ -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) }) } diff --git a/internal/entity/search/photos_filter_label_test.go b/internal/entity/search/photos_filter_label_test.go index 3e12d9b3d..9fb0ad71e 100644 --- a/internal/entity/search/photos_filter_label_test.go +++ b/internal/entity/search/photos_filter_label_test.go @@ -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) }) } diff --git a/internal/entity/search/photos_filter_landscape_test.go b/internal/entity/search/photos_filter_landscape_test.go index 0c68dbd27..897ec0a4c 100644 --- a/internal/entity/search/photos_filter_landscape_test.go +++ b/internal/entity/search/photos_filter_landscape_test.go @@ -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)) }) } diff --git a/internal/entity/search/photos_filter_lens_test.go b/internal/entity/search/photos_filter_lens_test.go index 91bff0f08..b021397f2 100644 --- a/internal/entity/search/photos_filter_lens_test.go +++ b/internal/entity/search/photos_filter_lens_test.go @@ -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) }) } diff --git a/internal/entity/search/photos_filter_live_test.go b/internal/entity/search/photos_filter_live_test.go index 0f378a8a7..9409520cb 100644 --- a/internal/entity/search/photos_filter_live_test.go +++ b/internal/entity/search/photos_filter_live_test.go @@ -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)) }) } diff --git a/internal/entity/search/photos_filter_mono_test.go b/internal/entity/search/photos_filter_mono_test.go index b74b4cc4e..699e6e0e8 100644 --- a/internal/entity/search/photos_filter_mono_test.go +++ b/internal/entity/search/photos_filter_mono_test.go @@ -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)) }) } diff --git a/internal/entity/search/photos_filter_month_test.go b/internal/entity/search/photos_filter_month_test.go index d93dd1b24..6ca2360a8 100644 --- a/internal/entity/search/photos_filter_month_test.go +++ b/internal/entity/search/photos_filter_month_test.go @@ -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)) }) } diff --git a/internal/entity/search/photos_filter_name_test.go b/internal/entity/search/photos_filter_name_test.go index af4002514..e9b657aa8 100644 --- a/internal/entity/search/photos_filter_name_test.go +++ b/internal/entity/search/photos_filter_name_test.go @@ -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) }) } diff --git a/internal/entity/search/photos_filter_panorama_test.go b/internal/entity/search/photos_filter_panorama_test.go index 15fbed047..c441c18dc 100644 --- a/internal/entity/search/photos_filter_panorama_test.go +++ b/internal/entity/search/photos_filter_panorama_test.go @@ -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)) }) } diff --git a/internal/entity/search/photos_filter_path_test.go b/internal/entity/search/photos_filter_path_test.go index 13e815783..34c7c5e95 100644 --- a/internal/entity/search/photos_filter_path_test.go +++ b/internal/entity/search/photos_filter_path_test.go @@ -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 diff --git a/internal/entity/search/photos_filter_people_test.go b/internal/entity/search/photos_filter_people_test.go index 21eafef7e..0fb1a5712 100644 --- a/internal/entity/search/photos_filter_people_test.go +++ b/internal/entity/search/photos_filter_people_test.go @@ -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) }) } diff --git a/internal/entity/search/photos_filter_person_test.go b/internal/entity/search/photos_filter_person_test.go index a50cb9513..32ba3d578 100644 --- a/internal/entity/search/photos_filter_person_test.go +++ b/internal/entity/search/photos_filter_person_test.go @@ -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) }) } diff --git a/internal/entity/search/photos_filter_photo_test.go b/internal/entity/search/photos_filter_photo_test.go index 8311e58ed..1294453f5 100644 --- a/internal/entity/search/photos_filter_photo_test.go +++ b/internal/entity/search/photos_filter_photo_test.go @@ -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)) }) } diff --git a/internal/entity/search/photos_filter_portrait_test.go b/internal/entity/search/photos_filter_portrait_test.go index 848771901..b3ee6dbf1 100644 --- a/internal/entity/search/photos_filter_portrait_test.go +++ b/internal/entity/search/photos_filter_portrait_test.go @@ -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) }) } diff --git a/internal/entity/search/photos_filter_primary_test.go b/internal/entity/search/photos_filter_primary_test.go index 3042234bc..a1d7b9f3c 100644 --- a/internal/entity/search/photos_filter_primary_test.go +++ b/internal/entity/search/photos_filter_primary_test.go @@ -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)) }) } diff --git a/internal/entity/search/photos_filter_private_test.go b/internal/entity/search/photos_filter_private_test.go index 5d431817d..c298973c5 100644 --- a/internal/entity/search/photos_filter_private_test.go +++ b/internal/entity/search/photos_filter_private_test.go @@ -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)) }) } diff --git a/internal/entity/search/photos_filter_public_test.go b/internal/entity/search/photos_filter_public_test.go index bc97f50db..24306258d 100644 --- a/internal/entity/search/photos_filter_public_test.go +++ b/internal/entity/search/photos_filter_public_test.go @@ -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)) }) } diff --git a/internal/entity/search/photos_filter_raw_test.go b/internal/entity/search/photos_filter_raw_test.go index 2ec2bb7e4..c47982998 100644 --- a/internal/entity/search/photos_filter_raw_test.go +++ b/internal/entity/search/photos_filter_raw_test.go @@ -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)) }) } diff --git a/internal/entity/search/photos_filter_resolution_test.go b/internal/entity/search/photos_filter_resolution_test.go index f184b955b..7104fd441 100644 --- a/internal/entity/search/photos_filter_resolution_test.go +++ b/internal/entity/search/photos_filter_resolution_test.go @@ -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 diff --git a/internal/entity/search/photos_filter_review_test.go b/internal/entity/search/photos_filter_review_test.go index 6a162e4ee..25ca360f1 100644 --- a/internal/entity/search/photos_filter_review_test.go +++ b/internal/entity/search/photos_filter_review_test.go @@ -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)) }) } diff --git a/internal/entity/search/photos_filter_scan_test.go b/internal/entity/search/photos_filter_scan_test.go index de757241f..330a289fb 100644 --- a/internal/entity/search/photos_filter_scan_test.go +++ b/internal/entity/search/photos_filter_scan_test.go @@ -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)) }) } diff --git a/internal/entity/search/photos_filter_square_test.go b/internal/entity/search/photos_filter_square_test.go index c5b5bd75d..95bfa1e14 100644 --- a/internal/entity/search/photos_filter_square_test.go +++ b/internal/entity/search/photos_filter_square_test.go @@ -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)) }) } diff --git a/internal/entity/search/photos_filter_stack_test.go b/internal/entity/search/photos_filter_stack_test.go index 95a35fdcc..45c7e667f 100644 --- a/internal/entity/search/photos_filter_stack_test.go +++ b/internal/entity/search/photos_filter_stack_test.go @@ -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)) }) } diff --git a/internal/entity/search/photos_filter_stackable_test.go b/internal/entity/search/photos_filter_stackable_test.go index 525831a57..1681dbe0b 100644 --- a/internal/entity/search/photos_filter_stackable_test.go +++ b/internal/entity/search/photos_filter_stackable_test.go @@ -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)) }) } diff --git a/internal/entity/search/photos_filter_state_test.go b/internal/entity/search/photos_filter_state_test.go index 422233175..da1464025 100644 --- a/internal/entity/search/photos_filter_state_test.go +++ b/internal/entity/search/photos_filter_state_test.go @@ -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) }) } diff --git a/internal/entity/search/photos_filter_subject_test.go b/internal/entity/search/photos_filter_subject_test.go index 275b806fe..e8858fd81 100644 --- a/internal/entity/search/photos_filter_subject_test.go +++ b/internal/entity/search/photos_filter_subject_test.go @@ -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) }) } diff --git a/internal/entity/search/photos_filter_subjects_test.go b/internal/entity/search/photos_filter_subjects_test.go index 649c24ab8..665e93544 100644 --- a/internal/entity/search/photos_filter_subjects_test.go +++ b/internal/entity/search/photos_filter_subjects_test.go @@ -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) }) } diff --git a/internal/entity/search/photos_filter_title_test.go b/internal/entity/search/photos_filter_title_test.go index af56f1790..40233b3a3 100644 --- a/internal/entity/search/photos_filter_title_test.go +++ b/internal/entity/search/photos_filter_title_test.go @@ -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 diff --git a/internal/entity/search/photos_filter_type_test.go b/internal/entity/search/photos_filter_type_test.go index 9b62896b1..db64987c9 100644 --- a/internal/entity/search/photos_filter_type_test.go +++ b/internal/entity/search/photos_filter_type_test.go @@ -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) }) } diff --git a/internal/entity/search/photos_filter_uid_test.go b/internal/entity/search/photos_filter_uid_test.go index 1a9ed9ca3..b6c6df80a 100644 --- a/internal/entity/search/photos_filter_uid_test.go +++ b/internal/entity/search/photos_filter_uid_test.go @@ -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) }) } diff --git a/internal/entity/search/photos_filter_unsorted_test.go b/internal/entity/search/photos_filter_unsorted_test.go index a724c9912..be53126b2 100644 --- a/internal/entity/search/photos_filter_unsorted_test.go +++ b/internal/entity/search/photos_filter_unsorted_test.go @@ -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)) }) } diff --git a/internal/entity/search/photos_filter_unstacked_test.go b/internal/entity/search/photos_filter_unstacked_test.go index 50a9325d7..ca5cd528f 100644 --- a/internal/entity/search/photos_filter_unstacked_test.go +++ b/internal/entity/search/photos_filter_unstacked_test.go @@ -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)) }) } diff --git a/internal/entity/search/photos_filter_vector_test.go b/internal/entity/search/photos_filter_vector_test.go index 2f953c440..6e04eb154 100644 --- a/internal/entity/search/photos_filter_vector_test.go +++ b/internal/entity/search/photos_filter_vector_test.go @@ -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)) }) } diff --git a/internal/entity/search/photos_filter_video_test.go b/internal/entity/search/photos_filter_video_test.go index 019016cc4..431871971 100644 --- a/internal/entity/search/photos_filter_video_test.go +++ b/internal/entity/search/photos_filter_video_test.go @@ -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)) }) } diff --git a/internal/entity/search/photos_filter_year_test.go b/internal/entity/search/photos_filter_year_test.go index 22d1adbf8..20dcbfa7a 100644 --- a/internal/entity/search/photos_filter_year_test.go +++ b/internal/entity/search/photos_filter_year_test.go @@ -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)) }) } diff --git a/internal/entity/search/photos_geo_filter_albums_test.go b/internal/entity/search/photos_geo_filter_albums_test.go index f3b8a88bc..e442ec171 100644 --- a/internal/entity/search/photos_geo_filter_albums_test.go +++ b/internal/entity/search/photos_geo_filter_albums_test.go @@ -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) }) } diff --git a/internal/entity/search/photos_geo_filter_favorite_test.go b/internal/entity/search/photos_geo_filter_favorite_test.go index 19ba05a52..567af8e51 100644 --- a/internal/entity/search/photos_geo_filter_favorite_test.go +++ b/internal/entity/search/photos_geo_filter_favorite_test.go @@ -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)) }) } diff --git a/internal/entity/search/photos_geo_filter_near_test.go b/internal/entity/search/photos_geo_filter_near_test.go index 97cb0aa95..36d2e5fc6 100644 --- a/internal/entity/search/photos_geo_filter_near_test.go +++ b/internal/entity/search/photos_geo_filter_near_test.go @@ -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) })*/ } diff --git a/internal/entity/search/photos_geo_filter_s2_test.go b/internal/entity/search/photos_geo_filter_s2_test.go index 30df5fbc8..8cd898d9e 100644 --- a/internal/entity/search/photos_geo_filter_s2_test.go +++ b/internal/entity/search/photos_geo_filter_s2_test.go @@ -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) }) } diff --git a/internal/entity/search/photos_geo_test.go b/internal/entity/search/photos_geo_test.go index 50c4f354a..aae6021e1 100644 --- a/internal/entity/search/photos_geo_test.go +++ b/internal/entity/search/photos_geo_test.go @@ -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) diff --git a/internal/entity/search/photos_results.go b/internal/entity/search/photos_results.go index cfb8ddce4..6b4f0f863 100644 --- a/internal/entity/search/photos_results.go +++ b/internal/entity/search/photos_results.go @@ -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 { diff --git a/internal/entity/search/photos_results_test.go b/internal/entity/search/photos_results_test.go index aecdc9800..2b4a2e9f0 100644 --- a/internal/entity/search/photos_results_test.go +++ b/internal/entity/search/photos_results_test.go @@ -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) { diff --git a/internal/entity/search/photos_test.go b/internal/entity/search/photos_test.go index 34224c388..c515f3aed 100644 --- a/internal/entity/search/photos_test.go +++ b/internal/entity/search/photos_test.go @@ -494,7 +494,7 @@ func TestPhotos(t *testing.T) { } //t.Logf("results: %+v", photos) - assert.Equal(t, 1, len(photos)) + assert.Len(t, photos, 1) }) t.Run("form.subject", func(t *testing.T) { var f form.SearchPhotos @@ -509,7 +509,7 @@ func TestPhotos(t *testing.T) { } //t.Logf("results: %+v", photos) - assert.Equal(t, 1, len(photos)) + assert.Len(t, photos, 1) }) t.Run("form.subjects", func(t *testing.T) { var f form.SearchPhotos @@ -524,7 +524,7 @@ func TestPhotos(t *testing.T) { } //t.Logf("results: %+v", photos) - assert.Equal(t, 1, len(photos)) + assert.Len(t, photos, 1) }) t.Run("form.people", func(t *testing.T) { var f form.SearchPhotos @@ -539,7 +539,7 @@ func TestPhotos(t *testing.T) { } //t.Logf("results: %+v", photos) - assert.Equal(t, 1, len(photos)) + assert.Len(t, photos, 1) }) t.Run("form.hash", func(t *testing.T) { var f form.SearchPhotos @@ -554,7 +554,7 @@ func TestPhotos(t *testing.T) { } //t.Logf("results: %+v", photos) - assert.Equal(t, 1, len(photos)) + assert.Len(t, photos, 1) }) t.Run("form.portrait", func(t *testing.T) { var f form.SearchPhotos @@ -1808,7 +1808,7 @@ func TestPhotos(t *testing.T) { t.Fatal(err2) } - assert.Equal(t, len(photos), len(photos2)) + assert.Len(t, photos, len(photos2)) var f3 form.SearchPhotos @@ -1839,8 +1839,8 @@ func TestPhotos(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)) }) t.Run("Search in Title", func(t *testing.T) { var f form.SearchPhotos @@ -1856,7 +1856,7 @@ func TestPhotos(t *testing.T) { } t.Logf("results: %+v", photos) - assert.Equal(t, 1, len(photos)) + assert.Len(t, photos, 1) assert.Equal(t, photos[0].PhotoTitle, "Neckarbrücke") }) t.Run("SortByFileSize", func(t *testing.T) { @@ -1980,7 +1980,7 @@ func TestPhotos(t *testing.T) { t.Fatal("error expected") } - assert.Equal(t, len(photos), 0) + assert.Len(t, photos, 0) }) t.Run("SearchGif", func(t *testing.T) { var frm form.SearchPhotos @@ -2308,7 +2308,7 @@ func TestPhotos(t *testing.T) { if err != nil { t.Fatal(err) } - assert.Equal(t, len(photos), 1) + assert.Len(t, photos, 1) for _, p := range photos { assert.NotEmpty(t, p.PhotoCaption) @@ -2360,7 +2360,7 @@ func TestPhotos(t *testing.T) { if err != nil { t.Fatal(err) } - assert.Equal(t, 1, len(photos)) + assert.Len(t, photos, 1) for _, p := range photos { assert.NotEmpty(t, p.PhotoName) @@ -2377,7 +2377,7 @@ func TestPhotos(t *testing.T) { if err != nil { t.Fatal(err) } - assert.Equal(t, 1, len(photos)) + assert.Len(t, photos, 1) for _, p := range photos { assert.NotEmpty(t, p.PhotoName) diff --git a/internal/entity/search/search_test.go b/internal/entity/search/search_test.go index b4105932b..f667eb0ec 100644 --- a/internal/entity/search/search_test.go +++ b/internal/entity/search/search_test.go @@ -14,6 +14,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")) diff --git a/internal/entity/search/subjects_test.go b/internal/entity/search/subjects_test.go index eb2a37e4a..a508a9635 100644 --- a/internal/entity/search/subjects_test.go +++ b/internal/entity/search/subjects_test.go @@ -21,7 +21,7 @@ func TestSubjects(t *testing.T) { assert.NoError(t, err) //t.Logf("Subjects: %#v", results) assert.GreaterOrEqual(t, results[0].FileCount, results[1].FileCount) - assert.Equal(t, 2, len(results)) + assert.Len(t, results, 2) }) t.Run("FindAll sort by name", func(t *testing.T) { results, err := Subjects(form.SearchSubjects{Type: entity.SubjPerson, Order: "name"}) @@ -55,13 +55,13 @@ func TestSubjects(t *testing.T) { results, err := Subjects(form.SearchSubjects{Type: entity.SubjPerson, Private: "true"}) assert.NoError(t, err) //t.Logf("Subjects: %#v", results) - assert.Equal(t, 0, len(results)) + assert.Len(t, results, 0) }) t.Run("search excluded", func(t *testing.T) { results, err := Subjects(form.SearchSubjects{Type: entity.SubjPerson, Excluded: "ja"}) assert.NoError(t, err) //t.Logf("Subjects: %#v", results) - assert.Equal(t, 0, len(results)) + assert.Len(t, results, 0) }) t.Run("search file count >2", func(t *testing.T) { results, err := Subjects(form.SearchSubjects{Type: entity.SubjPerson, Files: 2, Excluded: "no"}) @@ -81,7 +81,7 @@ func TestSubjects(t *testing.T) { assert.NoError(t, err) //t.Logf("Subjects: %#v", results) assert.Equal(t, "Joe Biden", results[0].SubjName) - assert.Equal(t, 1, len(results)) + assert.Len(t, results, 1) }) } @@ -90,18 +90,18 @@ func TestSubjectUIDs(t *testing.T) { results, _, _ := SubjectUIDs("Powell") //t.Logf("Subjects: %#v", results) //t.Logf("Names: %#v", names) - assert.Equal(t, 1, len(results)) + assert.Len(t, results, 1) }) t.Run("search for not existing name", func(t *testing.T) { results, _, _ := SubjectUIDs("Anonymous") //t.Logf("Subjects: %#v", results) //t.Logf("Names: %#v", names) - assert.Equal(t, 0, len(results)) + assert.Len(t, results, 0) }) t.Run("search with empty string", func(t *testing.T) { results, _, _ := SubjectUIDs("") //t.Logf("Subjects: %#v", results) //t.Logf("Names: %#v", names) - assert.Equal(t, 0, len(results)) + assert.Len(t, results, 0) }) } diff --git a/internal/entity/service.go b/internal/entity/service.go index edb4a2857..d50cf1b8f 100644 --- a/internal/entity/service.go +++ b/internal/entity/service.go @@ -114,13 +114,13 @@ func (m *Service) ResetErrors(share, sync bool) error { } if share { - if err := Db().Model(FileShare{}).Where("service_id = ?", m.ID).Updates(Map{"error": "", "errors": 0}).Error; err != nil { + if err := Db().Model(FileShare{}).Where("service_id = ?", m.ID).Updates(Values{"error": "", "errors": 0}).Error; err != nil { return err } } if sync { - if err := Db().Model(FileSync{}).Where("service_id = ?", m.ID).Updates(Map{"error": "", "errors": 0}).Error; err != nil { + if err := Db().Model(FileSync{}).Where("service_id = ?", m.ID).Updates(Values{"error": "", "errors": 0}).Error; err != nil { return err } } @@ -128,7 +128,7 @@ func (m *Service) ResetErrors(share, sync bool) error { m.AccError = "" m.AccErrors = 0 - return m.Updates(Map{"acc_error": m.AccError, "acc_errors": m.AccErrors}) + return m.Updates(Values{"acc_error": m.AccError, "acc_errors": m.AccErrors}) } // SaveForm saves the entity using form data and stores it in the database. diff --git a/internal/entity/subject.go b/internal/entity/subject.go index 3b7370e6e..156975d34 100644 --- a/internal/entity/subject.go +++ b/internal/entity/subject.go @@ -150,7 +150,7 @@ func (m *Subject) DeletePermanently() error { // AfterDelete resets file and photo counters when the entity was deleted. func (m *Subject) AfterDelete(tx *gorm.DB) (err error) { - tx.Model(m).Updates(Map{ + tx.Model(m).Updates(Values{ "FileCount": 0, "PhotoCount": 0, }) @@ -368,7 +368,7 @@ func (m *Subject) SaveForm(frm *form.Subject) (changed bool, err error) { // Update index? if changed { - values := Map{ + values := Values{ "SubjFavorite": m.SubjFavorite, "SubjHidden": m.SubjHidden, "SubjPrivate": m.SubjPrivate, @@ -424,7 +424,7 @@ func (m *Subject) UpdateName(name string) (*Subject, error) { // Update subject record. if err := m.SetName(name); err != nil { return m, err - } else if err = m.Updates(Map{"SubjName": m.SubjName, "SubjSlug": m.SubjSlug}); err != nil { + } else if err = m.Updates(Values{"SubjName": m.SubjName, "SubjSlug": m.SubjSlug}); err != nil { return m, err } else { SubjNames.Set(m.SubjUID, m.SubjName) @@ -509,7 +509,7 @@ func (m *Subject) MergeWith(other *Subject) error { } // Updated subject entity values. - updates := Map{ + updates := Values{ "FileCount": other.FileCount + m.FileCount, "PhotoCount": other.PhotoCount + m.PhotoCount, } diff --git a/internal/photoprism/faces_cluster.go b/internal/photoprism/faces_cluster.go index fe2d30b34..cff369285 100644 --- a/internal/photoprism/faces_cluster.go +++ b/internal/photoprism/faces_cluster.go @@ -78,7 +78,7 @@ func (w *Faces) Cluster(opt FacesOptions) (added entity.Faces, err error) { } else if err := f.Create(); err == nil { added = append(added, *f) log.Debugf("faces: added cluster %s based on %s, radius %f", f.ID, english.Plural(f.Samples, "sample", "samples"), f.SampleRadius) - } else if err := f.Updates(entity.Map{"UpdatedAt": entity.Now()}); err != nil { + } else if err := f.Updates(entity.Values{"UpdatedAt": entity.Now()}); err != nil { log.Errorf("faces: %s", err) } else { log.Debugf("faces: updated cluster %s", f.ID) diff --git a/internal/service/cluster/node/bootstrap.go b/internal/service/cluster/node/bootstrap.go index 6aa27e0f9..ae55d740b 100644 --- a/internal/service/cluster/node/bootstrap.go +++ b/internal/service/cluster/node/bootstrap.go @@ -29,6 +29,9 @@ import ( var log = event.Log +// Values is an shorthand alias for map[string]interface{}. +type Values = map[string]interface{} + func init() { // Register early so this can adjust DB settings before connectDb(). config.RegisterEarly("cluster-node", InitConfig, nil) @@ -213,7 +216,7 @@ func isTemporary(err error) bool { } func persistRegistration(c *config.Config, r *cluster.RegisterResponse, wantRotateDatabase bool) error { - updates := map[string]interface{}{} + updates := Values{} // Persist ClusterUUID from portal response if provided. if rnd.IsUUID(r.UUID) { @@ -296,7 +299,7 @@ func primeJWKS(c *config.Config, url string) { } } -func hasDBUpdate(m map[string]interface{}) bool { +func hasDBUpdate(m Values) bool { if _, ok := m["DatabaseDSN"]; ok { return true } @@ -315,20 +318,20 @@ func hasDBUpdate(m map[string]interface{}) bool { return false } -func mergeOptionsYaml(c *config.Config, updates map[string]interface{}) error { +func mergeOptionsYaml(c *config.Config, updates Values) error { if err := fs.MkdirAll(c.ConfigPath()); err != nil { return err } fileName := c.OptionsYaml() - var m map[string]interface{} + var m Values 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 = Values{} } for k, v := range updates { m[k] = v diff --git a/internal/workers/sync.go b/internal/workers/sync.go index d3bbd42ea..aa415a684 100644 --- a/internal/workers/sync.go +++ b/internal/workers/sync.go @@ -146,7 +146,7 @@ func (w *Sync) Start() (err error) { } // Only update the following fields to avoid overwriting other settings - if updateErr := a.Updates(map[string]interface{}{ + if updateErr := a.Updates(entity.Values{ "AccError": accError, "AccErrors": accErrors, "SyncStatus": syncStatus, diff --git a/internal/workers/sync_refresh.go b/internal/workers/sync_refresh.go index c45d6818d..51b108d37 100644 --- a/internal/workers/sync_refresh.go +++ b/internal/workers/sync_refresh.go @@ -80,7 +80,7 @@ func (w *Sync) refresh(a entity.Service) (complete bool, err error) { } if f.Status == entity.FileSyncDownloaded && !f.RemoteDate.Equal(file.Date) { - w.logErr(f.Updates(map[string]interface{}{ + w.logErr(f.Updates(entity.Values{ "Status": entity.FileSyncNew, "RemoteDate": file.Date, "RemoteSize": file.Size, diff --git a/internal/workers/vision_reset.go b/internal/workers/vision_reset.go new file mode 100644 index 000000000..50ffbb0c1 --- /dev/null +++ b/internal/workers/vision_reset.go @@ -0,0 +1,154 @@ +package workers + +import ( + "fmt" + "path" + "runtime/debug" + "slices" + "strings" + "time" + + "github.com/dustin/go-humanize/english" + + "github.com/photoprism/photoprism/internal/ai/vision" + "github.com/photoprism/photoprism/internal/entity" + "github.com/photoprism/photoprism/internal/entity/query" + "github.com/photoprism/photoprism/internal/entity/search" + "github.com/photoprism/photoprism/internal/entity/sortby" + "github.com/photoprism/photoprism/internal/form" + "github.com/photoprism/photoprism/internal/mutex" + "github.com/photoprism/photoprism/internal/photoprism" + "github.com/photoprism/photoprism/pkg/clean" +) + +// Reset removes data generated by the specified model types for photos matching the search filter. +func (w *Vision) Reset(filter string, count int, models []string, provider string) (err error) { + defer func() { + if r := recover(); r != nil { + err = fmt.Errorf("vision: %s (worker panic)\nstack: %s", r, debug.Stack()) + log.Error(err) + } + }() + + if err = mutex.VisionWorker.Start(); err != nil { + return err + } + defer mutex.VisionWorker.Stop() + + resetLabels := slices.Contains(models, vision.ModelTypeLabels) + resetCaptions := slices.Contains(models, vision.ModelTypeCaption) + + if n := len(models); n == 0 { + log.Warnf("vision: no models were specified") + return nil + } else if n == 1 { + log.Infof("vision: resetting %s model data", models[0]) + } else { + log.Infof("vision: resetting %s model data", strings.Join(models, " and ")) + } + + provider = clean.ShortTypeLower(provider) + if provider == "" { + provider = entity.SrcVision + } + + start := time.Now() + done := make(map[string]bool) + + if count < 1 || count > search.MaxResults { + count = search.MaxResults + } + + frm := form.SearchPhotos{ + Query: filter, + Primary: true, + Merged: false, + Count: count, + Offset: 0, + Order: sortby.Added, + } + + photos, _, queryErr := search.Photos(frm) + if queryErr != nil { + return queryErr + } + + if len(photos) == 0 { + log.Info("vision: no pictures to reset") + return nil + } + + var ( + updated int + removedLabels int64 + resetCaptionsCount int + ) + + for _, photo := range photos { + if done[photo.PhotoUID] { + continue + } + done[photo.PhotoUID] = true + + m, loadErr := query.PhotoByUID(photo.PhotoUID) + if loadErr != nil { + log.Errorf("vision: failed to load %s (%s)", photo.PhotoUID, loadErr) + continue + } + + changed := false + + if resetCaptions { + if changedCaption, capErr := m.ResetCaption(provider); capErr != nil { + log.Warnf("vision: %s (reset caption)", clean.Error(capErr)) + } else if changedCaption { + resetCaptionsCount++ + changed = true + } + } + + if resetLabels { + if removed, lblErr := m.ResetLabels(provider); lblErr != nil { + log.Warnf("vision: %s (reset labels)", clean.Error(lblErr)) + } else if removed > 0 { + removedLabels += removed + changed = true + log.Debugf("vision: removed %d labels from %s", removed, clean.Log(path.Join(m.PhotoPath, m.PhotoName))) + } + } + + if !changed { + continue + } + + updated++ + + if err := m.GenerateAndSaveTitle(); err != nil { + log.Warnf("vision: %s (generate title)", clean.Error(err)) + } + } + + if removedLabels > 0 { + entity.FlushPhotoLabelCache() + } + + if updated > 0 { + if moments := photoprism.NewMoments(w.conf); moments == nil { + log.Errorf("vision: failed to update moments") + } else if err = moments.Start(); err != nil { + log.Warnf("moments: %s in optimization worker", err) + } + + if err = entity.UpdateCounts(); err != nil { + log.Warnf("vision: %s in optimization worker", err) + } + + if err = query.UpdateCovers(); err != nil { + log.Warnf("vision: %s in optimization worker", err) + } + } + + log.Infof("vision: reset %s [%s]", english.Plural(updated, "picture", "pictures"), time.Since(start)) + + return nil +} diff --git a/internal/workers/vision_reset_test.go b/internal/workers/vision_reset_test.go new file mode 100644 index 000000000..7e532ebe6 --- /dev/null +++ b/internal/workers/vision_reset_test.go @@ -0,0 +1,56 @@ +package workers + +import ( + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/photoprism/photoprism/internal/ai/vision" + "github.com/photoprism/photoprism/internal/config" + "github.com/photoprism/photoprism/internal/entity" +) + +func TestVisionReset(t *testing.T) { + conf := config.NewMinimalTestConfigWithDb("workers-vision-reset", t.TempDir()) + + worker := NewVision(conf) + fixture := entity.PhotoFixtures.Get("VisionResetTarget") + require.NotEmpty(t, fixture.PhotoUID) + + landscape := entity.LabelFixtures.Get("landscape") + + photo := entity.FindPhoto(fixture) + require.NotNil(t, photo) + + targetID := photo.ID + targetUID := photo.PhotoUID + + t.Cleanup(func() { + entity.FlushPhotoLabelCache() + }) + + require.NotNil(t, entity.FirstOrCreatePhotoLabel(entity.NewPhotoLabel(targetID, landscape.ID, 20, entity.SrcOllama))) + + require.NoError(t, entity.Db().Model(&entity.Photo{}).Where("id = ?", targetID).Updates(entity.Values{ + "PhotoCaption": "Reset caption", + "CaptionSrc": entity.SrcOllama, + }).Error) + + entity.FlushPhotoLabelCache() + + filter := "uid:" + targetUID + + err := worker.Reset(filter, 10, []string{vision.ModelTypeCaption, vision.ModelTypeLabels}, entity.SrcOllama) + require.NoError(t, err) + + refreshed := entity.FindPhoto(fixture) + require.NotNil(t, refreshed) + + assert.Equal(t, "", refreshed.PhotoCaption) + assert.Equal(t, "", refreshed.CaptionSrc) + + var labelCount int + require.NoError(t, entity.Db().Model(&entity.PhotoLabel{}).Where("photo_id = ? AND label_src = ?", targetID, entity.SrcOllama).Count(&labelCount).Error) + assert.Zero(t, labelCount) +} diff --git a/internal/workers/workers_test.go b/internal/workers/workers_test.go index 0cccae4b2..99eaf102a 100644 --- a/internal/workers/workers_test.go +++ b/internal/workers/workers_test.go @@ -18,6 +18,9 @@ func TestMain(m *testing.M) { log.SetLevel(logrus.TraceLevel) event.AuditLog = log + // Remove temporary SQLite files before running the tests. + fs.PurgeTestDbFiles(".", false) + c := config.TestConfig() defer c.CloseDb()