Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
dart.googlesource.com-test
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
fuchsia-mirror
dart.googlesource.com-test
Commits
738d19bd
Commit
738d19bd
authored
8 years ago
by
Natalie Weizenbaum
Committed by
GitHub
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Throw a better error for async groups. (#486)
Closes #485
parent
c97a3b08
No related branches found
Branches containing commit
Tags
0.12.17+3
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
CHANGELOG.md
+4
-0
4 additions, 0 deletions
CHANGELOG.md
lib/src/backend/declarer.dart
+7
-1
7 additions, 1 deletion
lib/src/backend/declarer.dart
pubspec.yaml
+1
-1
1 addition, 1 deletion
pubspec.yaml
test/backend/declarer_test.dart
+6
-0
6 additions, 0 deletions
test/backend/declarer_test.dart
with
18 additions
and
2 deletions
CHANGELOG.md
+
4
−
0
View file @
738d19bd
## 0.12.15+10
*
Throw a better error if a group body is asynchronous.
## 0.12.15+9
*
Widen version constraint on
`analyzer`
.
...
...
This diff is collapsed.
Click to expand it.
lib/src/backend/declarer.dart
+
7
−
1
View file @
738d19bd
...
...
@@ -129,7 +129,13 @@ class Declarer {
var
declarer
=
new
Declarer
.
_
(
this
,
_prefix
(
name
),
metadata
,
_collectTraces
,
trace
);
declarer
.
declare
(
body
);
declarer
.
declare
(()
{
// Cast to dynamic to avoid the analyzer complaining about us using the
// result of a void method.
var
result
=
(
body
as
dynamic
)();
if
(
result
is
!
Future
)
return
;
throw
new
ArgumentError
(
"Groups may not be async."
);
});
_entries
.
add
(
declarer
.
build
());
}
...
...
This diff is collapsed.
Click to expand it.
pubspec.yaml
+
1
−
1
View file @
738d19bd
name
:
test
version
:
0.12.15+
9
version
:
0.12.15+
10
author
:
Dart Team <misc@dartlang.org>
description
:
A library for writing dart unit tests.
homepage
:
https://github.com/dart-lang/test
...
...
This diff is collapsed.
Click to expand it.
test/backend/declarer_test.dart
+
6
−
0
View file @
738d19bd
...
...
@@ -354,6 +354,12 @@ void main() {
equals
(
new
Duration
(
seconds:
15
)));
});
test
(
"disallows asynchronous groups"
,
()
async
{
declare
(()
{
expect
(()
=
>
group
(
"group"
,
()
async
{}),
throwsArgumentError
);
});
});
group
(
".setUp()"
,
()
{
test
(
"is scoped to the group"
,
()
async
{
var
setUpRun
=
false
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment