Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,13 @@ func TestGenerateFileDefaultDoesNotPanicOnNonStringValue(t *testing.T) {
}

func TestExistsErrorIncludesFilePath(t *testing.T) {
missingPath := filepath.Join("/proc", "1", "fd", "does-not-exist", "child")
// A path through a regular file fails with ENOTDIR rather than ENOENT,
// regardless of the user running the test.
file := filepath.Join(t.TempDir(), "file")
if err := os.WriteFile(file, nil, 0o600); err != nil {
t.Fatal(err)
}
missingPath := filepath.Join(file, "child")

_, err := exists(missingPath)
if err == nil {
Expand Down
Loading