Skip to content

Commit a60a06f

Browse files
kevmoocommit-bot@chromium.org
authored andcommitted
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 <[email protected]> Auto-Submit: Kevin Moore <[email protected]> Reviewed-by: Nicholas Shahan <[email protected]>
1 parent fafd3d0 commit a60a06f

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

pkg/expect/lib/expect.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
*/
99
library expect;
1010

11+
import 'package:meta/meta.dart';
12+
1113
/**
1214
* Expect is used for tests that do not want to make use of the
1315
* Dart unit test library - for example, the core language tests.
@@ -265,6 +267,7 @@ class Expect {
265267
}
266268

267269
// Unconditional failure.
270+
@alwaysThrows
268271
static void fail(String msg) {
269272
_fail("Expect.fail('$msg')");
270273
}
@@ -647,6 +650,7 @@ class Expect {
647650
static String _getMessage(String reason) =>
648651
(reason == null) ? "" : ", '$reason'";
649652

653+
@alwaysThrows
650654
static void _fail(String message) {
651655
throw new ExpectException(message);
652656
}

pkg/expect/pubspec.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ description: >
88
test assertions.
99
environment:
1010
sdk: ">=0.8.10+6 <3.0.0"
11+
12+
dependencies:
13+
meta: any

0 commit comments

Comments
 (0)