mirror of
https://github.com/netbirdio/netbird.git
synced 2025-08-16 10:08:12 +02:00
[client] handle order of check when checking order of files in isChecksEqual (#4219)
This commit is contained in:
@ -1270,6 +1270,82 @@ func Test_CheckFilesEqual(t *testing.T) {
|
||||
},
|
||||
expectedBool: false,
|
||||
},
|
||||
{
|
||||
name: "Compared Slices with same files but different order should return true",
|
||||
inputChecks1: []*mgmtProto.Checks{
|
||||
{
|
||||
Files: []string{
|
||||
"testfile1",
|
||||
"testfile2",
|
||||
},
|
||||
},
|
||||
{
|
||||
Files: []string{
|
||||
"testfile4",
|
||||
"testfile3",
|
||||
},
|
||||
},
|
||||
},
|
||||
inputChecks2: []*mgmtProto.Checks{
|
||||
{
|
||||
Files: []string{
|
||||
"testfile3",
|
||||
"testfile4",
|
||||
},
|
||||
},
|
||||
{
|
||||
Files: []string{
|
||||
"testfile2",
|
||||
"testfile1",
|
||||
},
|
||||
},
|
||||
},
|
||||
expectedBool: true,
|
||||
},
|
||||
{
|
||||
name: "Compared Slices with same files but different order while first is equal should return true",
|
||||
inputChecks1: []*mgmtProto.Checks{
|
||||
{
|
||||
Files: []string{
|
||||
"testfile0",
|
||||
"testfile1",
|
||||
},
|
||||
},
|
||||
{
|
||||
Files: []string{
|
||||
"testfile0",
|
||||
"testfile2",
|
||||
},
|
||||
},
|
||||
{
|
||||
Files: []string{
|
||||
"testfile0",
|
||||
"testfile3",
|
||||
},
|
||||
},
|
||||
},
|
||||
inputChecks2: []*mgmtProto.Checks{
|
||||
{
|
||||
Files: []string{
|
||||
"testfile0",
|
||||
"testfile1",
|
||||
},
|
||||
},
|
||||
{
|
||||
Files: []string{
|
||||
"testfile0",
|
||||
"testfile3",
|
||||
},
|
||||
},
|
||||
{
|
||||
Files: []string{
|
||||
"testfile0",
|
||||
"testfile2",
|
||||
},
|
||||
},
|
||||
},
|
||||
expectedBool: true,
|
||||
},
|
||||
}
|
||||
for _, testCase := range testCases {
|
||||
t.Run(testCase.name, func(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user