mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-29 02:32:11 -05:00
resources: Ensure same dirinfos sort order in TestImageOperationsGolden
Fix filename mismatch errors on Debian auto-building machines possibly due to different directory order on ext4 vs tmpfs file systems.
This commit is contained in:
parent
019ae38483
commit
298092d516
1 changed files with 3 additions and 8 deletions
|
@ -15,6 +15,7 @@ package resources
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"io/ioutil"
|
||||||
"math/big"
|
"math/big"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"os"
|
"os"
|
||||||
|
@ -567,15 +568,9 @@ func TestImageOperationsGolden(t *testing.T) {
|
||||||
dir2 := filepath.FromSlash("testdata/golden")
|
dir2 := filepath.FromSlash("testdata/golden")
|
||||||
|
|
||||||
// The two dirs above should now be the same.
|
// The two dirs above should now be the same.
|
||||||
d1, err := os.Open(dir1)
|
dirinfos1, err := ioutil.ReadDir(dir1)
|
||||||
c.Assert(err, qt.IsNil)
|
c.Assert(err, qt.IsNil)
|
||||||
d2, err := os.Open(dir2)
|
dirinfos2, err := ioutil.ReadDir(dir2)
|
||||||
c.Assert(err, qt.IsNil)
|
|
||||||
|
|
||||||
dirinfos1, err := d1.Readdir(-1)
|
|
||||||
c.Assert(err, qt.IsNil)
|
|
||||||
dirinfos2, err := d2.Readdir(-1)
|
|
||||||
|
|
||||||
c.Assert(err, qt.IsNil)
|
c.Assert(err, qt.IsNil)
|
||||||
c.Assert(len(dirinfos1), qt.Equals, len(dirinfos2))
|
c.Assert(len(dirinfos1), qt.Equals, len(dirinfos2))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue