Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
chromium.googlesource.com-external-github.com-dart-lang-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
chromium.googlesource.com-external-github.com-dart-lang-test
Commits
6de018f9
Commit
6de018f9
authored
9 years ago
by
Jay.Udey
Browse files
Options
Downloads
Patches
Plain Diff
allow object to be passed in as a description
parent
a99ce0f6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/test.dart
+19
-7
19 additions, 7 deletions
lib/test.dart
test/backend/declarer_test.dart
+24
-0
24 additions, 0 deletions
test/backend/declarer_test.dart
with
43 additions
and
7 deletions
lib/test.dart
+
19
−
7
View file @
6de018f9
...
...
@@ -118,9 +118,13 @@ Declarer get _declarer {
///
/// If multiple platforms match, the annotations apply in order as through
/// they were in nested groups.
void
test
(
String
description
,
body
(),
{
String
testOn
,
Timeout
timeout
,
skip
,
tags
,
Map
<
String
,
dynamic
>
onPlatform
})
=
>
_declarer
.
test
(
description
,
body
,
void
test
(
description
,
body
(),
{
String
testOn
,
Timeout
timeout
,
skip
,
tags
,
Map
<
String
,
dynamic
>
onPlatform
})
=
>
_declarer
.
test
(
description
.
toString
(),
body
,
testOn:
testOn
,
timeout:
timeout
,
skip:
skip
,
...
...
@@ -171,10 +175,18 @@ void test(String description, body(), {String testOn, Timeout timeout, skip,
///
/// If multiple platforms match, the annotations apply in order as through
/// they were in nested groups.
void
group
(
String
description
,
body
(),
{
String
testOn
,
Timeout
timeout
,
skip
,
tags
,
Map
<
String
,
dynamic
>
onPlatform
})
=
>
_declarer
.
group
(
description
,
body
,
testOn:
testOn
,
timeout:
timeout
,
skip:
skip
,
tags:
tags
);
void
group
(
description
,
body
(),
{
String
testOn
,
Timeout
timeout
,
skip
,
tags
,
Map
<
String
,
dynamic
>
onPlatform
})
=
>
description
==
null
?
_declarer
.
group
(
description
,
body
,
testOn:
testOn
,
timeout:
timeout
,
skip:
skip
,
tags:
tags
)
:
_declarer
.
group
(
description
.
toString
(),
body
,
testOn:
testOn
,
timeout:
timeout
,
skip:
skip
,
tags:
tags
);
/// Registers a function to be run before tests.
///
...
...
This diff is collapsed.
Click to expand it.
test/backend/declarer_test.dart
+
24
−
0
View file @
6de018f9
...
...
@@ -36,6 +36,15 @@ void main() {
expect
(
bodyRun
,
isTrue
);
});
test
(
"declares a test with an object as the description"
,
()
async
{
var
tests
=
declare
(()
{
test
(
Object
,
()
{
});
});
expect
(
tests
.
single
.
name
,
equals
(
"Object"
));
});
test
(
"declares multiple tests"
,
()
{
var
tests
=
declare
(()
{
test
(
"description 1"
,
()
{});
...
...
@@ -277,6 +286,21 @@ void main() {
expect
(
entries
.
single
.
entries
.
single
.
name
,
"group description"
);
});
test
(
"tests inherit the group's description when it's not a string"
,
()
{
var
entries
=
declare
(()
{
group
(
Object
,
()
{
test
(
"description"
,
()
{});
});
});
expect
(
entries
,
hasLength
(
1
));
expect
(
entries
.
single
,
new
isInstanceOf
<
Group
>());
expect
(
entries
.
single
.
name
,
equals
(
"Object"
));
expect
(
entries
.
single
.
entries
,
hasLength
(
1
));
expect
(
entries
.
single
.
entries
.
single
,
new
isInstanceOf
<
Test
>());
expect
(
entries
.
single
.
entries
.
single
.
name
,
"Object description"
);
});
test
(
"a test's timeout factor is applied to the group's"
,
()
{
var
entries
=
declare
(()
{
group
(
"group"
,
()
{
...
...
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