Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
fbd29b88
Unverified
Commit
fbd29b88
authored
Jul 30, 2020
by
Jonah Williams
Committed by
GitHub
Jul 30, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] fix formatting regression in analyze and add full coverage (#62593)
parent
12397fba
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
84 additions
and
1 deletion
+84
-1
analyze_base.dart
packages/flutter_tools/lib/src/commands/analyze_base.dart
+1
-1
analyze_base_test.dart
..._tools/test/general.shard/commands/analyze_base_test.dart
+83
-0
No files found.
packages/flutter_tools/lib/src/commands/analyze_base.dart
View file @
fbd29b88
...
...
@@ -144,7 +144,7 @@ abstract class AnalyzeBase {
if
(
undocumentedMembers
>
0
)
{
errorsMessage
.
write
(
' (ran in
${seconds}
s;
$dartDocMessage
)'
);
}
else
{
errorsMessage
.
write
(
' (ran in
${seconds}
s
;
)'
);
errorsMessage
.
write
(
' (ran in
${seconds}
s)'
);
}
return
errorsMessage
.
toString
();
}
...
...
packages/flutter_tools/test/general.shard/commands/analyze_base_test.dart
0 → 100644
View file @
fbd29b88
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:flutter_tools/src/commands/analyze_base.dart'
;
import
'../../src/common.dart'
;
void
main
(
)
{
testWithoutContext
(
'AnalyzeBase message formatting with zero issues'
,
()
async
{
final
String
message
=
AnalyzeBase
.
generateErrorsMessage
(
issueCount:
0
,
seconds:
'10'
,
undocumentedMembers:
0
,
);
expect
(
message
,
'No issues found! (ran in 10s)'
);
});
testWithoutContext
(
'AnalyzeBase message formatting with undocumented issues'
,
()
async
{
final
String
message
=
AnalyzeBase
.
generateErrorsMessage
(
issueCount:
0
,
seconds:
'10'
,
undocumentedMembers:
1
,
dartDocMessage:
'test'
);
expect
(
message
,
'No issues found! (ran in 10s; test)'
);
});
testWithoutContext
(
'AnalyzeBase message formatting with one issue'
,
()
async
{
final
String
message
=
AnalyzeBase
.
generateErrorsMessage
(
issueCount:
1
,
seconds:
'10'
,
undocumentedMembers:
0
,
);
expect
(
message
,
'1 issue found. (ran in 10s)'
);
});
testWithoutContext
(
'AnalyzeBase message formatting with N issues'
,
()
async
{
final
String
message
=
AnalyzeBase
.
generateErrorsMessage
(
issueCount:
10
,
seconds:
'10'
,
undocumentedMembers:
0
,
);
expect
(
message
,
'10 issues found. (ran in 10s)'
);
});
testWithoutContext
(
'AnalyzeBase message with analyze files'
,
()
async
{
final
String
message
=
AnalyzeBase
.
generateErrorsMessage
(
issueCount:
0
,
seconds:
'10'
,
undocumentedMembers:
0
,
files:
10
,
);
expect
(
message
,
'No issues found! • analyzed 10 files (ran in 10s)'
);
});
testWithoutContext
(
'AnalyzeBase message with positive issue diff'
,
()
async
{
final
String
message
=
AnalyzeBase
.
generateErrorsMessage
(
issueCount:
1
,
seconds:
'10'
,
undocumentedMembers:
0
,
issueDiff:
1
,
);
expect
(
message
,
'1 issue found. (1 new) (ran in 10s)'
);
});
testWithoutContext
(
'AnalyzeBase message with negative issue diff'
,
()
async
{
final
String
message
=
AnalyzeBase
.
generateErrorsMessage
(
issueCount:
0
,
seconds:
'10'
,
undocumentedMembers:
0
,
issueDiff:
-
1
,
);
expect
(
message
,
'No issues found! (1 fixed) (ran in 10s)'
);
});
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment