Update pkg:expect to use @alwaysThrows annotation on fail functions

Change-Id: I4e87b2044fe429b42d8e96213f415437a7f2d1da
Reviewed-on: https://dart-review.googlesource.com/c/89421
Commit-Queue: Kevin Moore <kevmoo@google.com>
Auto-Submit: Kevin Moore <kevmoo@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
This commit is contained in:
Kevin Moore
2019-01-14 21:17:38 +00:00
committed by commit-bot@chromium.org
parent fafd3d0f18
commit a60a06ff7d
2 changed files with 7 additions and 0 deletions
+4
View File
@@ -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);
}
+3
View File
@@ -8,3 +8,6 @@ description: >
test assertions.
environment:
sdk: ">=0.8.10+6 <3.0.0"
dependencies:
meta: any