Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Fok <foka@debian.org>2019-10-03 08:40:22 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2019-10-03 17:48:22 +0300
commit298092d516f623cc20051f506d460fb7625cdc84 (patch)
tree9c3761ae80b4727e0ca9c34bef8351bab75ca10e /resources
parent019ae384835446266b951875aa0870d245382cf2 (diff)
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.
Diffstat (limited to 'resources')
-rw-r--r--resources/image_test.go11
1 files changed, 3 insertions, 8 deletions
diff --git a/resources/image_test.go b/resources/image_test.go
index 5fa5021c9..169f19522 100644
--- a/resources/image_test.go
+++ b/resources/image_test.go
@@ -15,6 +15,7 @@ package resources
import (
"fmt"
+ "io/ioutil"
"math/big"
"math/rand"
"os"
@@ -567,15 +568,9 @@ func TestImageOperationsGolden(t *testing.T) {
dir2 := filepath.FromSlash("testdata/golden")
// The two dirs above should now be the same.
- d1, err := os.Open(dir1)
+ dirinfos1, err := ioutil.ReadDir(dir1)
c.Assert(err, qt.IsNil)
- d2, err := os.Open(dir2)
- c.Assert(err, qt.IsNil)
-
- dirinfos1, err := d1.Readdir(-1)
- c.Assert(err, qt.IsNil)
- dirinfos2, err := d2.Readdir(-1)
-
+ dirinfos2, err := ioutil.ReadDir(dir2)
c.Assert(err, qt.IsNil)
c.Assert(len(dirinfos1), qt.Equals, len(dirinfos2))