mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-29 02:07:39 +08:00
Add an extra test for txt files and the title
Just to make sure it's never parsed.
This commit is contained in:
@ -199,5 +199,23 @@ Gee
|
||||
var path = note.filePath;
|
||||
expect(path.endsWith('.md'), true);
|
||||
});
|
||||
|
||||
test('Txt files header is not read', () async {
|
||||
var content = """# Hello
|
||||
|
||||
Gee
|
||||
""";
|
||||
var txtNotePath = p.join(tempDir.path, "note163.txt");
|
||||
await File(txtNotePath).writeAsString(content);
|
||||
|
||||
var parentFolder = NotesFolderFS(null, tempDir.path);
|
||||
var txtNote = Note(parentFolder, txtNotePath);
|
||||
await txtNote.load();
|
||||
|
||||
expect(txtNote.fileFormat, NoteFileFormat.Txt);
|
||||
expect(txtNote.canHaveMetadata, false);
|
||||
expect(txtNote.title.isEmpty, true);
|
||||
expect(txtNote.body, content);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user