fix: uneeded func + uneeded bogus note creation logic
This commit is contained in:
@ -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)
|
||||
|
||||
Reference in New Issue
Block a user