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
afdc4840
Unverified
Commit
afdc4840
authored
Dec 09, 2022
by
Christopher Fujino
Committed by
GitHub
Dec 09, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add test of flutter update-packages --transitive-closure --consumer-only (#116747)
parent
117a83a4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
update_packages_test.dart
...ls/test/commands.shard/hermetic/update_packages_test.dart
+32
-0
No files found.
packages/flutter_tools/test/commands.shard/hermetic/update_packages_test.dart
View file @
afdc4840
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
import
'package:file/file.dart'
;
import
'package:file/file.dart'
;
import
'package:file/memory.dart'
;
import
'package:file/memory.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/base/logger.dart'
;
import
'package:flutter_tools/src/cache.dart'
;
import
'package:flutter_tools/src/cache.dart'
;
import
'package:flutter_tools/src/commands/update_packages.dart'
;
import
'package:flutter_tools/src/commands/update_packages.dart'
;
import
'package:flutter_tools/src/dart/pub.dart'
;
import
'package:flutter_tools/src/dart/pub.dart'
;
...
@@ -88,9 +89,11 @@ void main() {
...
@@ -88,9 +89,11 @@ void main() {
late
Directory
flutter
;
late
Directory
flutter
;
late
FakePub
pub
;
late
FakePub
pub
;
late
FakeProcessManager
processManager
;
late
FakeProcessManager
processManager
;
late
BufferLogger
logger
;
setUpAll
(()
{
setUpAll
(()
{
Cache
.
disableLocking
();
Cache
.
disableLocking
();
logger
=
BufferLogger
.
test
();
});
});
setUp
(()
{
setUp
(()
{
...
@@ -174,6 +177,35 @@ void main() {
...
@@ -174,6 +177,35 @@ void main() {
),
),
});
});
testUsingContext
(
'--transitive-closure --consumer-only'
,
()
async
{
final
UpdatePackagesCommand
command
=
UpdatePackagesCommand
();
await
createTestCommandRunner
(
command
).
run
(<
String
>[
'update-packages'
,
'--transitive-closure'
,
'--consumer-only'
,
]);
expect
(
pub
.
pubGetDirectories
,
equals
(<
String
>[
'/.tmp_rand0/flutter_update_packages.rand0/synthetic_package'
,
]));
expect
(
pub
.
pubBatchDirectories
,
equals
(<
String
>[
'/.tmp_rand0/flutter_update_packages.rand0/synthetic_package'
,
]));
// Expecting a line like:
// 'flutter -> {collection, meta, typed_data, vector_math}'
expect
(
logger
.
statusText
,
contains
(
RegExp
(
r'flutter -> {([a-z_]+, )*([a-z_]+)+}'
)),
);
},
overrides:
<
Type
,
Generator
>{
Pub:
()
=>
pub
,
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
processManager
,
Cache:
()
=>
Cache
.
test
(
processManager:
processManager
,
),
Logger:
()
=>
logger
,
});
testUsingContext
(
'force updates packages --synthetic-package-path'
,
()
async
{
testUsingContext
(
'force updates packages --synthetic-package-path'
,
()
async
{
final
UpdatePackagesCommand
command
=
UpdatePackagesCommand
();
final
UpdatePackagesCommand
command
=
UpdatePackagesCommand
();
const
String
dir
=
'/path/to/synthetic/package'
;
const
String
dir
=
'/path/to/synthetic/package'
;
...
...
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