diff options
author | Bjørn Erik Pedersen <[email protected]> | 2023-03-01 09:34:13 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2023-03-01 16:28:43 +0100 |
commit | a669467d98f54860fa7f06fbfdd1d8fdc98773fd (patch) | |
tree | 29c6444f8489006af9770e089adec3f1c4a3c081 /watcher | |
parent | d453c12742e992d672fcf3e61b7a5ed35391c4b0 (diff) | |
download | hugo-a669467d98f54860fa7f06fbfdd1d8fdc98773fd.tar.gz hugo-a669467d98f54860fa7f06fbfdd1d8fdc98773fd.zip |
Misc ioutil deprecation adjustments
To make the tests pass.
* Replace io => os.ReadFile in magefile.go
* Adjust failing image test vs fs.DirEntry
* Adjust poller test
See #10732
Diffstat (limited to 'watcher')
-rw-r--r-- | watcher/filenotify/poller_test.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/watcher/filenotify/poller_test.go b/watcher/filenotify/poller_test.go index 336314fff..7416f793a 100644 --- a/watcher/filenotify/poller_test.go +++ b/watcher/filenotify/poller_test.go @@ -34,10 +34,14 @@ func TestPollerAddRemove(t *testing.T) { c.Assert(w.Add("foo"), qt.Not(qt.IsNil)) c.Assert(w.Remove("foo"), qt.Not(qt.IsNil)) - f, err := os.CreateTemp(t.TempDir(), "asdf") + f, err := os.CreateTemp("", "asdf") if err != nil { t.Fatal(err) } + c.Cleanup(func() { + c.Assert(w.Close(), qt.IsNil) + os.Remove(f.Name()) + }) c.Assert(w.Add(f.Name()), qt.IsNil) c.Assert(w.Remove(f.Name()), qt.IsNil) |