Pull request 2361: imp-test-file-names

Merge in DNS/adguard-home from imp-test-file-names to master

Squashed commit of the following:

commit a0827efdf633fba012c5eb0e0f69eaabf7629724
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Mon Mar 10 21:41:46 2025 +0300

    all: imp tests

commit 21fc274d9276ce0442572261ea39a1c018490870
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Mon Mar 10 19:40:40 2025 +0300

    all: imp test file names
This commit is contained in:
Stanislav Chzhen
2025-03-11 19:40:14 +03:00
parent ac8a0ec570
commit ee91a6084f
46 changed files with 93 additions and 63 deletions

View File

@@ -1,14 +1,15 @@
package aghalg
package aghalg_test
import (
"strings"
"testing"
"github.com/AdguardTeam/AdGuardHome/internal/aghalg"
"github.com/stretchr/testify/assert"
)
func TestNewSortedMap(t *testing.T) {
var m SortedMap[string, int]
var m aghalg.SortedMap[string, int]
letters := []string{}
for i := range 10 {
@@ -17,7 +18,7 @@ func TestNewSortedMap(t *testing.T) {
}
t.Run("create_and_fill", func(t *testing.T) {
m = NewSortedMap[string, int](strings.Compare)
m = aghalg.NewSortedMap[string, int](strings.Compare)
nums := []int{}
for i, r := range letters {
@@ -68,7 +69,7 @@ func TestNewSortedMap_nil(t *testing.T) {
val = "val"
)
var m SortedMap[string, string]
var m aghalg.SortedMap[string, string]
assert.Panics(t, func() {
m.Set(key, val)