aboutsummaryrefslogtreecommitdiffstats
path: root/services/repository/adopt_test.go
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2023-04-22 23:56:27 +0200
committerGitHub <noreply@github.com>2023-04-22 17:56:27 -0400
commitf1173d6879cb26af21483037fae72542f3088408 (patch)
treea1ed73fb2a42c351005974698076f5ee82489d5d /services/repository/adopt_test.go
parentac384c4e1d207a989d0f646ebc14fd0c26427d4c (diff)
downloadgitea-f1173d6879cb26af21483037fae72542f3088408.tar.gz
gitea-f1173d6879cb26af21483037fae72542f3088408.zip
Use more specific test methods (#24265)
Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Giteabot <teabot@gitea.io>
Diffstat (limited to 'services/repository/adopt_test.go')
-rw-r--r--services/repository/adopt_test.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/services/repository/adopt_test.go b/services/repository/adopt_test.go
index 3f777c425f..c1520e01c9 100644
--- a/services/repository/adopt_test.go
+++ b/services/repository/adopt_test.go
@@ -30,7 +30,7 @@ func TestCheckUnadoptedRepositories_Add(t *testing.T) {
}
assert.Equal(t, total, unadopted.index)
- assert.Equal(t, end-start, len(unadopted.repositories))
+ assert.Len(t, unadopted.repositories, end-start)
}
func TestCheckUnadoptedRepositories(t *testing.T) {
@@ -41,7 +41,7 @@ func TestCheckUnadoptedRepositories(t *testing.T) {
unadopted := &unadoptedRepositories{start: 0, end: 100}
err := checkUnadoptedRepositories(db.DefaultContext, "notauser", []string{"repo"}, unadopted)
assert.NoError(t, err)
- assert.Equal(t, 0, len(unadopted.repositories))
+ assert.Empty(t, unadopted.repositories)
//
// Unadopted repository is returned
// Existing (adopted) repository is not returned
@@ -59,7 +59,7 @@ func TestCheckUnadoptedRepositories(t *testing.T) {
unadopted = &unadoptedRepositories{start: 0, end: 100}
err = checkUnadoptedRepositories(db.DefaultContext, userName, []string{repoName}, unadopted)
assert.NoError(t, err)
- assert.Equal(t, 0, len(unadopted.repositories))
+ assert.Empty(t, unadopted.repositories)
assert.Equal(t, 0, unadopted.index)
}