mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05: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:
parent
e8bbc44ab0
commit
a54ad2bf39
1 changed files with 30 additions and 32 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue