The source tests are completely brok4n :(
Fix at least the fact that URLs are now randomized
This commit is contained in:
parent
53c8e25352
commit
a76ffb0143
|
@ -9,6 +9,7 @@ import (
|
||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
@ -379,6 +380,8 @@ func TestNewSource(t *testing.T) {
|
||||||
} else {
|
} else {
|
||||||
c.Nil(err, "Unexpected error")
|
c.Nil(err, "Unexpected error")
|
||||||
}
|
}
|
||||||
|
sort.SliceStable(got.urls, func(i, j int) bool { return got.urls[i].String() < got.urls[j].String() })
|
||||||
|
sort.SliceStable(e.Source.urls, func(i, j int) bool { return e.Source.urls[i].String() < e.Source.urls[j].String() })
|
||||||
c.DeepEqual(got, e.Source, "Unexpected return")
|
c.DeepEqual(got, e.Source, "Unexpected return")
|
||||||
checkTestServer(c, d)
|
checkTestServer(c, d)
|
||||||
checkSourceCache(c, e)
|
checkSourceCache(c, e)
|
||||||
|
|
Loading…
Reference in New Issue