Lasse R.H. Nielsen
cd0606e425
Simplify asyncExpectThrows and enhance Expect.throws.
...
For `asyncExpectThrows`, instead of taking a function,
then checking if that function can be called with zero arguments,
and then immediately calling it and checking that it returns a future,
just take the future as argument.
Since synchronus errors from calling the function were not caught
anyway, doing the entire `Future` computation directly shouldn't
change behavior.
Also make `asyncExpectThrows` and `Expect.throws` return the caught error,
so that you can use normal `Expect.something` checks on it afterwards,
instead of doing that in the `check` function.
That basically makes the `check` function unnecessary (but hard to remove
with the existing test corpus using it heavily).
This makes some uses of the `asyncExpectThrows` function slightly more
complicated, those that have no other way to create a future than calling
the argument function anyway, but other uses become simpler
when they can avoid adding the function wrapper.
TEST= Refactoring. If the tests keep running, it's successful.
Change-Id: I983eb65ea4805760339073fabc27f78c57f9a471
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/226102
Reviewed-by: Bob Nystrom <rnystrom@google.com >
Commit-Queue: Lasse Nielsen <lrn@google.com >
2022-01-06 17:06:47 +00:00
..
2021-07-26 13:22:31 +00:00
2020-02-04 09:52:03 +00:00
2020-09-10 06:21:13 +00:00
2021-03-05 09:14:37 +00:00
2020-07-31 19:20:58 +00:00
2021-08-24 01:43:48 +00:00
2020-02-12 20:46:37 +00:00
2021-11-05 16:24:27 +00:00
2020-10-07 13:14:55 +00:00
2020-04-01 00:35:37 +00:00
2021-08-25 09:51:54 +00:00
2020-03-31 00:42:49 +00:00
2020-12-05 14:39:03 +00:00
2021-08-25 09:51:54 +00:00
2021-08-06 15:31:19 +00:00
2021-08-25 09:51:54 +00:00
2021-11-11 14:04:43 +00:00
2021-08-24 11:42:53 +00:00
2021-09-28 10:24:05 +00:00
2021-11-11 14:04:43 +00:00
2022-01-06 17:06:47 +00:00
2021-09-01 23:47:47 +00:00
2020-04-02 19:04:39 +00:00
2021-11-24 13:03:52 +00:00
2020-07-26 04:19:25 +00:00
2020-04-04 00:20:37 +00:00
2020-07-26 04:19:25 +00:00
2021-09-22 14:20:16 +00:00
2020-05-05 09:57:23 +00:00
2021-06-30 07:44:52 +00:00
2021-08-25 09:51:54 +00:00
2020-07-20 12:05:54 +00:00
2021-08-25 09:51:54 +00:00
2020-07-27 16:44:15 +00:00
2020-09-09 11:37:47 +00:00
2021-05-19 15:45:21 +00:00
2021-09-21 19:16:37 +00:00
2020-05-05 01:38:43 +00:00
2021-11-04 09:13:03 +00:00
2021-11-11 14:04:43 +00:00
2021-10-17 06:22:30 +00:00
2021-06-18 10:20:32 +00:00
2020-05-15 18:05:02 +00:00
2020-05-15 16:00:12 +00:00
2021-08-25 09:51:54 +00:00
2020-05-20 22:04:05 +00:00
2020-10-07 13:14:55 +00:00
2021-08-25 09:51:54 +00:00
2020-12-09 17:33:20 +00:00
2020-07-27 16:44:15 +00:00
2021-08-25 09:51:54 +00:00
2021-09-15 06:22:23 +00:00
2020-05-26 16:04:15 +00:00
2021-08-25 09:51:54 +00:00
2020-07-27 16:44:15 +00:00
2020-11-05 14:26:53 +00:00
2021-08-30 11:56:30 +00:00
2020-07-17 20:27:07 +00:00
2021-01-21 08:51:53 +00:00
2021-10-19 01:00:08 +00:00
2021-03-25 13:27:03 +00:00
2020-05-29 23:48:57 +00:00
2020-10-05 14:37:33 +00:00
2020-06-03 01:17:26 +00:00
2021-08-25 09:51:54 +00:00
2021-07-16 22:58:02 +00:00
2021-10-05 11:58:04 +00:00
2021-08-25 09:51:54 +00:00
2021-11-12 19:21:52 +00:00
2020-06-12 16:36:40 +00:00
2020-06-10 01:09:45 +00:00
2021-10-28 13:01:38 +00:00
2021-08-25 09:51:54 +00:00
2021-11-11 14:04:43 +00:00
2020-06-03 17:15:10 +00:00
2021-11-11 08:28:31 +00:00
2021-06-03 00:49:54 +00:00
2020-11-05 14:26:53 +00:00
2021-09-30 18:14:44 +00:00
2021-08-25 09:51:54 +00:00
2021-10-19 16:07:52 +00:00
2021-07-26 13:22:31 +00:00
2020-07-27 16:44:15 +00:00
2021-01-11 18:46:26 +00:00
2020-06-08 23:16:55 +00:00
2021-08-25 09:51:54 +00:00
2021-08-25 09:51:54 +00:00
2020-06-08 23:36:46 +00:00
2021-10-01 00:56:14 +00:00
2020-06-09 18:45:33 +00:00
2021-11-09 00:43:02 +00:00
2020-06-09 00:44:05 +00:00
2020-06-09 16:31:44 +00:00
2020-07-27 16:44:15 +00:00
2021-05-19 08:05:05 +00:00
2020-10-20 11:07:23 +00:00
2021-09-08 16:07:13 +00:00
2021-03-04 15:52:57 +00:00
2020-11-18 22:42:31 +00:00
2021-08-25 09:51:54 +00:00
2021-08-25 09:51:54 +00:00
2020-06-15 20:53:55 +00:00
2021-12-02 22:12:57 +00:00
2020-06-25 20:21:42 +00:00
2020-07-26 04:19:25 +00:00
2020-07-27 16:44:15 +00:00
2020-10-27 06:46:27 +00:00
2020-06-18 22:54:13 +00:00
2020-12-05 14:39:03 +00:00
2021-05-19 08:05:05 +00:00
2020-07-26 04:19:25 +00:00
2021-11-11 14:04:43 +00:00
2020-07-27 16:44:15 +00:00
2021-10-05 11:58:04 +00:00
2021-11-11 14:04:43 +00:00
2021-07-26 13:22:31 +00:00
2020-09-07 12:36:13 +00:00
2021-11-08 18:53:42 +00:00
2021-08-25 09:51:54 +00:00
2021-11-11 08:28:31 +00:00
2021-09-15 06:22:23 +00:00
2021-06-03 00:49:54 +00:00
2020-03-16 20:51:26 +00:00
2020-04-25 01:53:20 +00:00
2021-11-11 14:04:43 +00:00
2021-03-31 15:57:29 +00:00
2021-03-19 02:32:34 +00:00
2021-07-02 14:26:46 +00:00
2021-02-04 06:46:13 +00:00
2021-02-04 06:46:13 +00:00
2021-05-26 06:04:01 +00:00
2020-04-25 01:53:20 +00:00
2020-04-25 01:53:20 +00:00
2020-04-25 01:53:20 +00:00
2020-04-25 01:53:20 +00:00
2020-04-25 01:53:20 +00:00
2021-07-23 08:41:09 +00:00
2021-05-18 14:06:13 +00:00