summaryrefslogtreecommitdiffstats
path: root/modules/base/tool_test.go
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2022-10-12 07:18:26 +0200
committerGitHub <noreply@github.com>2022-10-12 13:18:26 +0800
commit0e57ff7eee4ac71d923f970d15889ad4d50f97a9 (patch)
treee5a92c55af5366924bd40ae14b4bf12842239193 /modules/base/tool_test.go
parente84558b0931309cf1f4f2767bc47296483b9b3e1 (diff)
downloadgitea-0e57ff7eee4ac71d923f970d15889ad4d50f97a9.tar.gz
gitea-0e57ff7eee4ac71d923f970d15889ad4d50f97a9.zip
Add generic set type (#21408)
This PR adds a generic set type to get rid of maps used as sets. Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'modules/base/tool_test.go')
-rw-r--r--modules/base/tool_test.go9
1 files changed, 0 insertions, 9 deletions
diff --git a/modules/base/tool_test.go b/modules/base/tool_test.go
index 6685168bac..87de898e0b 100644
--- a/modules/base/tool_test.go
+++ b/modules/base/tool_test.go
@@ -214,16 +214,7 @@ func TestInt64sToStrings(t *testing.T) {
)
}
-func TestInt64sToMap(t *testing.T) {
- assert.Equal(t, map[int64]bool{}, Int64sToMap([]int64{}))
- assert.Equal(t,
- map[int64]bool{1: true, 4: true, 16: true},
- Int64sToMap([]int64{1, 4, 16}),
- )
-}
-
func TestInt64sContains(t *testing.T) {
- assert.Equal(t, map[int64]bool{}, Int64sToMap([]int64{}))
assert.True(t, Int64sContains([]int64{6, 44324, 4324, 32, 1, 2323}, 1))
assert.True(t, Int64sContains([]int64{2323}, 2323))
assert.False(t, Int64sContains([]int64{6, 44324, 4324, 32, 1, 2323}, 232))