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
e9bd2ef0
Unverified
Commit
e9bd2ef0
authored
Aug 26, 2019
by
Zachary Anderson
Committed by
GitHub
Aug 26, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tool] Some additional input validation for 'version' (#39136)
parent
7f5540fa
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
version.dart
packages/flutter_tools/lib/src/commands/version.dart
+4
-0
version_test.dart
...utter_tools/test/general.shard/commands/version_test.dart
+10
-0
No files found.
packages/flutter_tools/lib/src/commands/version.dart
View file @
e9bd2ef0
...
...
@@ -65,6 +65,10 @@ class VersionCommand extends FlutterCommand {
// check min supported version
final
Version
targetVersion
=
Version
.
parse
(
version
);
if
(
targetVersion
==
null
)
{
throwToolExit
(
'Failed to parse version "
$version
"'
);
}
bool
withForce
=
false
;
if
(
targetVersion
<
minSupportedVersion
)
{
if
(!
argResults
[
'force'
])
{
...
...
packages/flutter_tools/test/general.shard/commands/version_test.dart
View file @
e9bd2ef0
...
...
@@ -62,6 +62,16 @@ void main() {
ProcessManager:
()
=>
MockProcessManager
(),
});
testUsingContext
(
'tool exit on confusing version'
,
()
async
{
const
String
version
=
'master'
;
final
VersionCommand
command
=
VersionCommand
();
final
Future
<
void
>
runCommand
=
createTestCommandRunner
(
command
).
run
(<
String
>[
'version'
,
version
]);
expect
(()
async
=>
await
Future
.
wait
<
void
>(<
Future
<
void
>>[
runCommand
]),
throwsA
(
isInstanceOf
<
ToolExit
>()));
},
overrides:
<
Type
,
Generator
>{
ProcessManager:
()
=>
MockProcessManager
(),
});
testUsingContext
(
'exit tool if can
\'
t get the tags'
,
()
async
{
final
VersionCommand
command
=
VersionCommand
();
...
...
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