From e9a09801d53c8d19f4af17712469744d50ea2e45 Mon Sep 17 00:00:00 2001 From: Dan Field Date: Mon, 22 Apr 2019 13:52:51 -0700 Subject: [PATCH] fix toString --- lib/ui/geometry.dart | 2 +- testing/dart/rect_test.dart | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/ui/geometry.dart b/lib/ui/geometry.dart index 59e5e65c9b03a..b99a01fec44b6 100644 --- a/lib/ui/geometry.dart +++ b/lib/ui/geometry.dart @@ -879,7 +879,7 @@ class Rect { int get hashCode => hashValues(left, top, right, bottom); @override - String toString() => 'Rect.fromLTRB(${left.toStringAsFixed(1)} ${top.toStringAsFixed(1)}, ${right.toStringAsFixed(1)}, ${bottom.toStringAsFixed(1)})'; + String toString() => 'Rect.fromLTRB(${left.toStringAsFixed(1)}, ${top.toStringAsFixed(1)}, ${right.toStringAsFixed(1)}, ${bottom.toStringAsFixed(1)})'; } /// A radius for either circular or elliptical shapes. diff --git a/testing/dart/rect_test.dart b/testing/dart/rect_test.dart index b8b893351c7dd..0248ad6241e13 100644 --- a/testing/dart/rect_test.dart +++ b/testing/dart/rect_test.dart @@ -7,6 +7,11 @@ import 'dart:ui'; import 'package:test/test.dart'; void main() { + test('toString test', () { + const Rect r = Rect.fromLTRB(1.0, 3.0, 5.0, 7.0); + expect(r.toString(), 'Rect.fromLTRB(1.0, 3.0, 5.0, 7.0)'); + }); + test('rect accessors', () { const Rect r = Rect.fromLTRB(1.0, 3.0, 5.0, 7.0); expect(r.left, equals(1.0));