mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
fix(mobile): fix asset removal edge cases (#2251)
Co-authored-by: Fynn Petersen-Frey <zoodyy@users.noreply.github.com> Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
parent
100866be37
commit
1a64075027
3 changed files with 51 additions and 0 deletions
|
|
@ -15,4 +15,35 @@ void main() {
|
|||
expect("a:b:c".toDuration(), null);
|
||||
});
|
||||
});
|
||||
group('Test uniqueConsecutive', () {
|
||||
test('empty', () {
|
||||
final a = [];
|
||||
expect(a.uniqueConsecutive(), []);
|
||||
});
|
||||
|
||||
test('singleElement', () {
|
||||
final a = [5];
|
||||
expect(a.uniqueConsecutive(), [5]);
|
||||
});
|
||||
|
||||
test('noDuplicates', () {
|
||||
final a = [1, 2, 3];
|
||||
expect(a.uniqueConsecutive(), [1, 2, 3]);
|
||||
});
|
||||
|
||||
test('unsortedDuplicates', () {
|
||||
final a = [1, 2, 1, 3];
|
||||
expect(a.uniqueConsecutive(), [1, 2, 1, 3]);
|
||||
});
|
||||
|
||||
test('sortedDuplicates', () {
|
||||
final a = [6, 6, 2, 3, 3, 3, 4, 5, 1, 1];
|
||||
expect(a.uniqueConsecutive(), [6, 2, 3, 4, 5, 1]);
|
||||
});
|
||||
|
||||
test('withKey', () {
|
||||
final a = ["a", "bb", "cc", "ddd"];
|
||||
expect(a.uniqueConsecutive((s) => s.length), ["a", "bb", "ddd"]);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue