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
d220631e
Unverified
Commit
d220631e
authored
Aug 14, 2019
by
Zachary Anderson
Committed by
GitHub
Aug 14, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tool] Fix bug in manifest yaml validation (#38472)
parent
9cba33d0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletion
+21
-1
flutter_manifest.dart
packages/flutter_tools/lib/src/flutter_manifest.dart
+2
-1
flutter_manifest_test.dart
...utter_tools/test/general.shard/flutter_manifest_test.dart
+19
-0
No files found.
packages/flutter_tools/lib/src/flutter_manifest.dart
View file @
d220631e
...
...
@@ -355,8 +355,9 @@ void _validateFlutter(YamlMap yaml, List<String> errors) {
case
'fonts'
:
if
(
kvp
.
value
is
!
YamlList
||
kvp
.
value
[
0
]
is
!
YamlMap
)
{
errors
.
add
(
'Expected "
${kvp.key}
" to be a list, but got
${kvp.value}
(
${kvp.value.runtimeType}
).'
);
}
}
else
{
_validateFonts
(
kvp
.
value
,
errors
);
}
break
;
case
'module'
:
if
(
kvp
.
value
is
!
YamlMap
)
{
...
...
packages/flutter_tools/test/general.shard/flutter_manifest_test.dart
View file @
d220631e
...
...
@@ -519,6 +519,25 @@ flutter:
expect
(
logger
.
errorText
,
contains
(
'Expected "fonts" to either be null or a list.'
));
});
testUsingContext
(
'Returns proper error when font is a map instead of a list'
,
()
async
{
final
BufferLogger
logger
=
context
.
get
<
Logger
>();
const
String
manifest
=
'''
name: test
dependencies:
flutter:
sdk: flutter
flutter:
fonts:
family: foo
fonts:
-asset: a/bar
'''
;
final
FlutterManifest
flutterManifest
=
FlutterManifest
.
createFromString
(
manifest
);
expect
(
flutterManifest
,
null
);
expect
(
logger
.
errorText
,
contains
(
'Expected "fonts" to be a list'
));
});
testUsingContext
(
'Returns proper error when second font family is invalid'
,
()
async
{
final
BufferLogger
logger
=
context
.
get
<
Logger
>();
const
String
manifest
=
'''
...
...
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