From 1a5ca2f675e4bca467269269f7a5e8d2bbdc66d3 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Tue, 28 Jun 2016 12:49:11 -0700 Subject: [PATCH] Fix failing tooltip_test.dart by avoiding floating point comparisons. (#4781) --- packages/flutter/test/material/tooltip_test.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/flutter/test/material/tooltip_test.dart b/packages/flutter/test/material/tooltip_test.dart index 484143a31a8..40c0e72243c 100644 --- a/packages/flutter/test/material/tooltip_test.dart +++ b/packages/flutter/test/material/tooltip_test.dart @@ -70,7 +70,11 @@ void main() { *********************/ RenderBox tip = tester.renderObject(find.text('TIP')).parent.parent.parent.parent.parent; - expect(tip.localToGlobal(tip.size.topLeft(Point.origin)), equals(const Point(284.0, 20.0))); + + // See "_applyFloatingPointHack" + Point tipInGlobal = tip.localToGlobal(tip.size.topLeft(Point.origin)); + expect(tipInGlobal.x.floor(), 284); + expect(tipInGlobal.y.floor(), 20); }); testWidgets('Does tooltip end up in the right place - top left', (WidgetTester tester) async {