From 9ce8ac503890204f4f86ac434b5d27715a28c9db Mon Sep 17 00:00:00 2001 From: Koji Wakamiya Date: Fri, 12 Dec 2025 12:36:44 +0900 Subject: [PATCH] test: Edge cases --- test/output_resize_test.dart | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/test/output_resize_test.dart b/test/output_resize_test.dart index bfe105b..98f9968 100644 --- a/test/output_resize_test.dart +++ b/test/output_resize_test.dart @@ -94,4 +94,32 @@ void main() { }); }); }); + + group('Edge cases', () { + test('handles 1x1 image', () { + const originalWidth = 1; + const originalHeight = 1; + + const resizeMode = FitResizeMode(width: 10, height: 10); + final (width, height) = resizeMode.calculateSize( + originalWidth, + originalHeight, + ); + expect(width, originalWidth); + expect(height, originalHeight); + }); + + test('nandles very large images', () { + const originalWidth = 10000; + const originalHeight = 5000; + + const resizeMode = FitResizeMode(width: 100,); + final (width, height) = resizeMode.calculateSize( + originalWidth, + originalHeight, + ); + expect(width, 100); + expect(height, 50); + }); + }); }