mirror of
https://github.com/qdm12/gluetun.git
synced 2026-06-19 18:04:09 +02:00
chore(updater): move updater packages to pkg/updaters/<name>
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
package purevpn
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func Test_comparePlaceNames(t *testing.T) {
|
||||
t.Parallel() // Allow the top-level test to run in parallel
|
||||
|
||||
testCases := map[string]struct {
|
||||
a string
|
||||
b string
|
||||
want bool
|
||||
}{
|
||||
"exact_match": {
|
||||
a: "Paris",
|
||||
b: "Paris",
|
||||
want: true,
|
||||
},
|
||||
"difference_in_casing_and_whitespace": {
|
||||
a: " Montreal",
|
||||
b: "montreal ",
|
||||
want: true,
|
||||
},
|
||||
"accent_normalization": {
|
||||
a: "Montréal",
|
||||
b: "Montreal",
|
||||
want: true,
|
||||
},
|
||||
"single_character_typo": {
|
||||
a: "Lyon",
|
||||
b: "Lyonn",
|
||||
want: true,
|
||||
},
|
||||
"too_many_differences": {
|
||||
a: "London",
|
||||
b: "Londres",
|
||||
want: false,
|
||||
},
|
||||
}
|
||||
|
||||
for name, testCase := range testCases {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
result := comparePlaceNames(testCase.a, testCase.b)
|
||||
assert.Equal(t, testCase.want, result)
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user