mirror of
https://github.com/restic/restic.git
synced 2024-12-22 15:57:07 +00:00
23 lines
512 B
Go
23 lines
512 B
Go
|
//go:build unix
|
||
|
|
||
|
package fs
|
||
|
|
||
|
import (
|
||
|
"path/filepath"
|
||
|
"syscall"
|
||
|
"testing"
|
||
|
|
||
|
"github.com/restic/restic/internal/errors"
|
||
|
rtest "github.com/restic/restic/internal/test"
|
||
|
)
|
||
|
|
||
|
func TestReaddirnamesFifo(t *testing.T) {
|
||
|
// should not block when reading from a fifo instead of a directory
|
||
|
tempdir := t.TempDir()
|
||
|
fifoFn := filepath.Join(tempdir, "fifo")
|
||
|
rtest.OK(t, mkfifo(fifoFn, 0o600))
|
||
|
|
||
|
_, err := Readdirnames(&Local{}, fifoFn, 0)
|
||
|
rtest.Assert(t, errors.Is(err, syscall.ENOTDIR), "unexpected error %v", err)
|
||
|
}
|