fork/gdu
git clone https://git.julia.blue/fork/gdu
9ca5c60
ignore
1//go:build aix || dragonfly || freebsd || linux || netbsd || openbsd || solaris 2 3package remove 4 5import ( 6"path/filepath" 7"syscall" 8"testing" 9"time" 10 11"github.com/stretchr/testify/assert" 12"github.com/stretchr/testify/require" 13) 14 15func TestCopyRecursivelyRejectsFIFOWithoutBlocking (t * testing.T ) { 16root := t .TempDir () 17src := filepath .Join (root ,"fifo" ) 18dst := filepath .Join (root ,"copied-fifo" ) 19require .NoError (t ,syscall .Mkfifo (src ,0o600 )) 20 21done := make (chan error ,1 ) 22go func () { 23done <- copyRecursively (src ,dst ) 24 }() 25 26select { 27case err := <- done : 28require .Error (t ,err ) 29assert .Contains (t ,err .Error (),"unsupported file type" ) 30case <- time .After (500 * time .Millisecond ): 31t .Fatal ("copyRecursively blocked while opening a FIFO" ) 32 } 33}