diff options
author | KN4CK3R <admin@oldschoolhack.me> | 2021-06-07 07:27:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-07 07:27:09 +0200 |
commit | 3607f79d7869046d919fed05a21b55b6e61df1fa (patch) | |
tree | 9a176a4d5b67ac3a81ae210e9164d81959221ce0 /models/topic_test.go | |
parent | 51775f65bc933843199320b040186703a2bb9f51 (diff) | |
download | gitea-3607f79d7869046d919fed05a21b55b6e61df1fa.tar.gz gitea-3607f79d7869046d919fed05a21b55b6e61df1fa.zip |
Fixed assert statements. (#16089)
Diffstat (limited to 'models/topic_test.go')
-rw-r--r-- | models/topic_test.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/models/topic_test.go b/models/topic_test.go index b6ef8f565c..25232eb981 100644 --- a/models/topic_test.go +++ b/models/topic_test.go @@ -19,31 +19,31 @@ func TestAddTopic(t *testing.T) { topics, err := FindTopics(&FindTopicOptions{}) assert.NoError(t, err) - assert.EqualValues(t, totalNrOfTopics, len(topics)) + assert.Len(t, topics, totalNrOfTopics) topics, err = FindTopics(&FindTopicOptions{ ListOptions: ListOptions{Page: 1, PageSize: 2}, }) assert.NoError(t, err) - assert.EqualValues(t, 2, len(topics)) + assert.Len(t, topics, 2) topics, err = FindTopics(&FindTopicOptions{ RepoID: 1, }) assert.NoError(t, err) - assert.EqualValues(t, repo1NrOfTopics, len(topics)) + assert.Len(t, topics, repo1NrOfTopics) assert.NoError(t, SaveTopics(2, "golang")) repo2NrOfTopics = 1 topics, err = FindTopics(&FindTopicOptions{}) assert.NoError(t, err) - assert.EqualValues(t, totalNrOfTopics, len(topics)) + assert.Len(t, topics, totalNrOfTopics) topics, err = FindTopics(&FindTopicOptions{ RepoID: 2, }) assert.NoError(t, err) - assert.EqualValues(t, repo2NrOfTopics, len(topics)) + assert.Len(t, topics, repo2NrOfTopics) assert.NoError(t, SaveTopics(2, "golang", "gitea")) repo2NrOfTopics = 2 @@ -54,13 +54,13 @@ func TestAddTopic(t *testing.T) { topics, err = FindTopics(&FindTopicOptions{}) assert.NoError(t, err) - assert.EqualValues(t, totalNrOfTopics, len(topics)) + assert.Len(t, topics, totalNrOfTopics) topics, err = FindTopics(&FindTopicOptions{ RepoID: 2, }) assert.NoError(t, err) - assert.EqualValues(t, repo2NrOfTopics, len(topics)) + assert.Len(t, topics, repo2NrOfTopics) } func TestTopicValidator(t *testing.T) { |