- Added the `isLeapYear` extension to the `DateTime` and `int` objects.
- Added the `FixedSizeList` class.
This commit is contained in:
2025-05-16 11:15:08 +02:00
parent bfdba4603b
commit 363fb20665
9 changed files with 188 additions and 5 deletions
+11
View File
@@ -96,5 +96,16 @@ void main() {
DateTime(now.year, now.month, now.day).add(const Duration(days: 1));
expect(DateTime.now().tomorrow, expected);
});
test("leap year calculations work as expected", () {
expect(DateTime(0).isLeapYear, false);
expect(DateTime(2024).isLeapYear, true);
expect(DateTime(2025).isLeapYear, false);
expect((-1).isLeapYear, false);
expect(0.isLeapYear, false);
expect(2024.isLeapYear, true);
expect(2025.isLeapYear, false);
});
});
}