github.com/mutagen-io/mutagen@v0.18.0-rc1/pkg/filesystem/visibility_test.go (about)

     1  package filesystem
     2  
     3  import (
     4  	"os"
     5  	"testing"
     6  )
     7  
     8  func TestMarkHidden(t *testing.T) {
     9  	// Create a temporary file and defer its removal.
    10  	hiddenFile, err := os.CreateTemp("", ".mutagen_filesystem_hidden")
    11  	if err != nil {
    12  		t.Fatal("unable to create temporary hiddenFile file:", err)
    13  	}
    14  	hiddenFile.Close()
    15  	defer os.Remove(hiddenFile.Name())
    16  
    17  	// Ensure that we can mark it as hidden.
    18  	if err := MarkHidden(hiddenFile.Name()); err != nil {
    19  		t.Fatal("unable to mark file as hidden")
    20  	}
    21  
    22  	// TODO: Should we verify hidden attributes on Windows?
    23  }