diff --git a/pkg/expect/lib/expect.dart b/pkg/expect/lib/expect.dart index 8e2ff95b263..9a59d3dc692 100644 --- a/pkg/expect/lib/expect.dart +++ b/pkg/expect/lib/expect.dart @@ -8,6 +8,8 @@ */ library expect; +import 'package:meta/meta.dart'; + /** * Expect is used for tests that do not want to make use of the * Dart unit test library - for example, the core language tests. @@ -265,6 +267,7 @@ class Expect { } // Unconditional failure. + @alwaysThrows static void fail(String msg) { _fail("Expect.fail('$msg')"); } @@ -647,6 +650,7 @@ class Expect { static String _getMessage(String reason) => (reason == null) ? "" : ", '$reason'"; + @alwaysThrows static void _fail(String message) { throw new ExpectException(message); } diff --git a/pkg/expect/pubspec.yaml b/pkg/expect/pubspec.yaml index d4b48a4b76b..2a7405dbe28 100644 --- a/pkg/expect/pubspec.yaml +++ b/pkg/expect/pubspec.yaml @@ -8,3 +8,6 @@ description: > test assertions. environment: sdk: ">=0.8.10+6 <3.0.0" + +dependencies: + meta: any