mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-09-10 13:08:24 +08:00
Make sorting case insensitive
This commit is contained in:
@ -56,5 +56,30 @@ void main() {
|
||||
expect(notes[2], n3);
|
||||
expect(notes[3], n4);
|
||||
});
|
||||
|
||||
test('Title', () async {
|
||||
var folder = NotesFolderFS(null, '/tmp/', Settings(''));
|
||||
var n1 = Note(folder, '/tmp/1.md');
|
||||
n1.title = "alpha";
|
||||
|
||||
var n2 = Note(folder, '/tmp/2.md');
|
||||
n2.title = "beta";
|
||||
|
||||
var n3 = Note(folder, '/tmp/3.md');
|
||||
n3.title = "Axios";
|
||||
|
||||
var n4 = Note(folder, '/tmp/4.md');
|
||||
n4.title = "";
|
||||
|
||||
var notes = [n1, n2, n3, n4];
|
||||
var sortFn = SortingMode(SortingField.Title, SortingOrder.Ascending)
|
||||
.sortingFunction();
|
||||
|
||||
notes.sort(sortFn);
|
||||
expect(notes[0], n1);
|
||||
expect(notes[1], n3);
|
||||
expect(notes[2], n2);
|
||||
expect(notes[3], n4);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user