Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions data/autosave_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

func TestAutoSave_DoesNotStartForEmptyPath(t *testing.T) {
fm, _ := NewEmptyFile()
fm, _ := NewEmptyFile("")
auto := NewAutoSave(fm, 100*time.Millisecond)
auto.Start()

Expand All @@ -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)
}
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions data/fileIO_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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"),
Expand Down Expand Up @@ -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")
Expand Down
Loading