mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-16 20:53:59 +02:00
Fix: Test TestSafeWriteToDisk now works
Oops, my bad. Despite the function intending to test SafeWriteToDisk it was actually calling WriteToDisk. WriteToDisk does not return the file exists error that SafeWriteToDisk does, which the test checks for.
This commit is contained in:
@@ -457,7 +457,6 @@ func TestFindCWD(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSafeWriteToDisk(t *testing.T) {
|
||||
/*
|
||||
emptyFile, _ := createZeroSizedFileInTempDir()
|
||||
defer deleteFileInTempDir(emptyFile)
|
||||
tmpDir, _ := createEmptyTempDir()
|
||||
@@ -479,7 +478,7 @@ func TestSafeWriteToDisk(t *testing.T) {
|
||||
}
|
||||
|
||||
for i, d := range data {
|
||||
e := WriteToDisk(d.filename, reader)
|
||||
e := SafeWriteToDisk(d.filename, reader)
|
||||
t.Errorf("Failed: e is %q %#v", e, e)
|
||||
if d.expectedErr != nil {
|
||||
if d.expectedErr.Error() != e.Error() {
|
||||
@@ -494,7 +493,6 @@ func TestSafeWriteToDisk(t *testing.T) {
|
||||
t.Errorf("Test %d failed. Expected contents %q but got %q", i, randomString, string(contents))
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
func TestWriteToDisk(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user