summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--models/repo_list_test.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/models/repo_list_test.go b/models/repo_list_test.go
index 9c8a526a43..8ac0d80489 100644
--- a/models/repo_list_test.go
+++ b/models/repo_list_test.go
@@ -23,7 +23,9 @@ func TestSearchRepositoryByName(t *testing.T) {
assert.NotNil(t, repos)
assert.NoError(t, err)
- assert.Equal(t, "test_repo_12", repos[0].Name)
+ if assert.Len(t, repos, 1) {
+ assert.Equal(t, "test_repo_12", repos[0].Name)
+ }
assert.Equal(t, int64(1), count)
repos, count, err = SearchRepositoryByName(&SearchRepoOptions{
@@ -48,7 +50,9 @@ func TestSearchRepositoryByName(t *testing.T) {
assert.NotNil(t, repos)
assert.NoError(t, err)
- assert.Equal(t, "test_repo_13", repos[0].Name)
+ if assert.Len(t, repos, 1) {
+ assert.Equal(t, "test_repo_13", repos[0].Name)
+ }
assert.Equal(t, int64(1), count)
repos, count, err = SearchRepositoryByName(&SearchRepoOptions{