From 90ddb2370bd927a7334a083a62c08501514dcea6 Mon Sep 17 00:00:00 2001 From: Vyacheslav Egorov Date: Thu, 8 Feb 2018 22:10:31 +0100 Subject: [PATCH] Fix text_style_text.dart to be Dart 2 compliant. (#14559) In Dart 2 mode we throw different exception: compiler generates throw of a compilation error instead of runtime throwing noSuchMethod. --- packages/flutter/test/painting/text_style_test.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/flutter/test/painting/text_style_test.dart b/packages/flutter/test/painting/text_style_test.dart index 98a9781f0d..1e20775d1c 100644 --- a/packages/flutter/test/painting/text_style_test.dart +++ b/packages/flutter/test/painting/text_style_test.dart @@ -23,7 +23,7 @@ void main() { fontWeight: FontWeight.w800, height: 123.0, ); - expect(() { s1.fontFamily = 'test'; }, throwsA(isNoSuchMethodError)); // ignore: ASSIGNMENT_TO_FINAL + expect(() { s1.fontFamily = 'test'; }, throwsA(const isInstanceOf())); // ignore: ASSIGNMENT_TO_FINAL expect(s1.fontFamily, isNull); expect(s1.fontSize, 10.0); expect(s1.fontWeight, FontWeight.w800);