fix: uneeded func + uneeded bogus note creation logic

This commit is contained in:
2026-02-01 18:26:59 +01:00
parent 4458ba2d15
commit e6923fa4f5
2 changed files with 4 additions and 57 deletions

View File

@ -7,36 +7,6 @@ import (
"time"
)
func TestScanner_FindMarkdownFiles(t *testing.T) {
tmpDir := t.TempDir()
files := map[string]string{
"note1.md": "# Note 1",
"note2.markdown": "# Note 2",
"folder/note3.md": "# Note 3",
"folder/nested/note4.md": "# Note 4",
"readme.txt": "not markdown",
}
for path, content := range files {
fullPath := filepath.Join(tmpDir, path)
os.MkdirAll(filepath.Dir(fullPath), 0755)
os.WriteFile(fullPath, []byte(content), 0644)
}
scanner := NewScanner(tmpDir)
found, err := scanner.FindAll()
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
// Should only return markdown files
if len(found) != 3 {
t.Errorf("expected 4 files, got %d", len(found))
}
}
func TestScanner_DetectsNewFile(t *testing.T) {
tmpDir := t.TempDir()
scanner := NewScanner(tmpDir)