forked from free5gc/openapi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
util_test.go
45 lines (39 loc) · 920 Bytes
/
util_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package openapi
import (
"testing"
"github.com/stretchr/testify/require"
"github.com/free5gc/openapi/models"
)
func TestSnssaiEqualFold(t *testing.T) {
testCases := []struct {
name string
s models.Snssai
t models.Snssai
expected bool
}{
{
name: "case insensitive 1",
s: models.Snssai{Sst: 1, Sd: "abcdef"},
t: models.Snssai{Sst: 1, Sd: "ABCDEF"},
expected: true,
},
{
name: "case insensitive 2",
s: models.Snssai{Sst: 1, Sd: "012def"},
t: models.Snssai{Sst: 1, Sd: "012DeF"},
expected: true,
},
{
name: "fail case",
s: models.Snssai{Sst: 1, Sd: "012def"},
t: models.Snssai{Sst: 1, Sd: "012Dee"},
expected: false,
},
}
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
result := SnssaiEqualFold(tc.s, tc.t)
require.Equal(t, tc.expected, result)
})
}
}