diff --git a/data/autosave_test.go b/data/autosave_test.go index 25c8f9e..9cd7aec 100644 --- a/data/autosave_test.go +++ b/data/autosave_test.go @@ -9,7 +9,7 @@ import ( ) func TestAutoSave_DoesNotStartForEmptyPath(t *testing.T) { - fm, _ := NewEmptyFile() + fm, _ := NewEmptyFile("") auto := NewAutoSave(fm, 100*time.Millisecond) auto.Start() @@ -24,7 +24,7 @@ func TestAutoSave_SavesWhenDirty(t *testing.T) { filePath := filepath.Join(dir, "autosave_test.txt") // Create file with one line - fm, err := NewEmptyFile() + fm, err := NewEmptyFile("") if err != nil { t.Fatalf("failed to create buffer: %v", err) } @@ -56,7 +56,7 @@ func TestAutoSave_Stop(t *testing.T) { dir := t.TempDir() filePath := filepath.Join(dir, "stop_test.txt") - fm, _ := NewEmptyFile() + fm, _ := NewEmptyFile("") fm.FilePath = filePath fm.Buffer.Lines = [][]rune{[]rune("stop test")} fm.Buffer.SetDirty(true) diff --git a/data/fileIO_test.go b/data/fileIO_test.go index adc3b5c..09efb6d 100644 --- a/data/fileIO_test.go +++ b/data/fileIO_test.go @@ -9,7 +9,7 @@ import ( ) func TestNewEmptyFile(t *testing.T) { - fm, _ := NewEmptyFile() + fm, _ := NewEmptyFile("") if fm.FilePath != "" { t.Errorf("expected empty path, got %s", fm.FilePath) } @@ -22,7 +22,7 @@ func TestSaveAsAndLoad(t *testing.T) { tmpDir := t.TempDir() filePath := filepath.Join(tmpDir, "test.txt") - fm, _ := NewEmptyFile() + fm, _ := NewEmptyFile("") fm.Buffer.Lines = [][]rune{ []rune("hello"), []rune("world"), @@ -52,7 +52,7 @@ func TestSaveAsAndLoad(t *testing.T) { } func TestSaveWithoutPath(t *testing.T) { - fm, _ := NewEmptyFile() + fm, _ := NewEmptyFile("") err := fm.Save() if err == nil { t.Errorf("expected error when saving without path")