From c9392da6a423c7481a752ded7a946b85a65ef323 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Thu, 1 Oct 2020 13:46:17 -0700 Subject: [PATCH] Relax the bounds of some Cupertino text field tests (#67020) SkParagraph may calculate slightly different metrics for text layouts --- packages/flutter/test/cupertino/text_field_test.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/flutter/test/cupertino/text_field_test.dart b/packages/flutter/test/cupertino/text_field_test.dart index 3787420460..46e4162d2c 100644 --- a/packages/flutter/test/cupertino/text_field_test.dart +++ b/packages/flutter/test/cupertino/text_field_test.dart @@ -1988,7 +1988,7 @@ void main() { expect(lastCharEndpoint.length, 1); // Just testing the test and making sure that the last character is off // the right side of the screen. - expect(lastCharEndpoint[0].point.dx, moreOrLessEquals(1094.73486328125)); + expect(lastCharEndpoint[0].point.dx, moreOrLessEquals(1094.73, epsilon: 0.01)); final Offset textfieldStart = tester.getTopLeft(find.byType(CupertinoTextField)); @@ -2041,14 +2041,14 @@ void main() { expect(lastCharEndpoint.length, 1); // The last character is now on screen. - expect(lastCharEndpoint[0].point.dx, moreOrLessEquals(786.73486328125)); + expect(lastCharEndpoint[0].point.dx, moreOrLessEquals(786.73, epsilon: 0.01)); final List firstCharEndpoint = renderEditable.getEndpointsForSelection( const TextSelection.collapsed(offset: 0), // First character's position. ); expect(firstCharEndpoint.length, 1); // The first character is now offscreen to the left. - expect(firstCharEndpoint[0].point.dx, moreOrLessEquals(-308.20499999821186)); + expect(firstCharEndpoint[0].point.dx, moreOrLessEquals(-308.20, epsilon: 0.01)); }); testWidgets(