fork/gdu
git clone https://git.julia.blue/fork/gdu
8b8f1e9
subvolume
1//go:build linux 2 3package remove 4 5import ( 6"os" 7"testing" 8 9"github.com/dundee/gdu/v5/internal/testdir" 10"github.com/dundee/gdu/v5/pkg/analyze" 11"github.com/stretchr/testify/assert" 12) 13 14func TestRemoveFileWithErr (t * testing.T ) { 15fin := testdir .CreateTestDir () 16defer fin () 17 18err := os .Chmod ("test_dir/nested" ,0 ) 19assert .Nil (t ,err ) 20defer func () { 21err = os .Chmod ("test_dir/nested" ,0o755 ) 22assert .Nil (t ,err ) 23 }() 24 25dir := & analyze.Dir { 26File :& analyze.File { 27Name :"test_dir" , 28 }, 29BasePath :"." , 30 } 31 32subdir := & analyze.Dir { 33File :& analyze.File { 34Name :"nested" , 35Parent :dir , 36 }, 37 } 38 39err = ItemFromDir (dir ,subdir ) 40assert .Contains (t ,err .Error (),"permission denied" ) 41}