TestAtomicWriteFile_CreateTempError tests the error path when os.CreateTemp fails
(t *testing.T)
| 61 | |
| 62 | // TestAtomicWriteFile_CreateTempError tests the error path when os.CreateTemp fails |
| 63 | func TestAtomicWriteFile_CreateTempError(t *testing.T) { |
| 64 | invalidPath := "/invalid/path/that/does/not/exist/testfile" |
| 65 | |
| 66 | reader := bytes.NewReader([]byte("test content")) |
| 67 | mode := os.FileMode(0644) |
| 68 | |
| 69 | err := AtomicWriteFile(invalidPath, reader, mode) |
| 70 | if err == nil { |
| 71 | t.Error("Expected error when CreateTemp fails, but got nil") |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | // TestAtomicWriteFile_EmptyContent tests with empty content |
| 76 | func TestAtomicWriteFile_EmptyContent(t *testing.T) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…