mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-23 22:27:38 -05:00
Sort the resulting slice before the comparison.
This commit is contained in:
parent
8c392a02c8
commit
98c17bcdf2
1 changed files with 7 additions and 3 deletions
|
@ -9,6 +9,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"reflect"
|
"reflect"
|
||||||
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
@ -766,9 +767,12 @@ func TestFiles(t *testing.T) {
|
||||||
if numFiles == 0 && len(actual) != 0 {
|
if numFiles == 0 && len(actual) != 0 {
|
||||||
t.Errorf(testPrefix+"Expected files %v, got: %v",
|
t.Errorf(testPrefix+"Expected files %v, got: %v",
|
||||||
test.fileNames, actual)
|
test.fileNames, actual)
|
||||||
} else if numFiles > 0 && !reflect.DeepEqual(test.fileNames, actual) {
|
} else {
|
||||||
t.Errorf(testPrefix+"Expected files %v, got: %v",
|
sort.Strings(actual)
|
||||||
test.fileNames, actual)
|
if numFiles > 0 && !reflect.DeepEqual(test.fileNames, actual) {
|
||||||
|
t.Errorf(testPrefix+"Expected files %v, got: %v",
|
||||||
|
test.fileNames, actual)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue