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
4b25e80c
Unverified
Commit
4b25e80c
authored
Aug 02, 2022
by
Christopher Fujino
Committed by
GitHub
Aug 02, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] Migrate more tool tests to null-safety (#108639)
parent
fd0da75c
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
35 deletions
+30
-35
update_packages.dart
packages/flutter_tools/lib/src/commands/update_packages.dart
+1
-1
config_test.dart
...utter_tools/test/commands.shard/hermetic/config_test.dart
+5
-7
pub_get_test.dart
...tter_tools/test/commands.shard/hermetic/pub_get_test.dart
+5
-8
update_packages_test.dart
...ls/test/commands.shard/hermetic/update_packages_test.dart
+19
-19
No files found.
packages/flutter_tools/lib/src/commands/update_packages.dart
View file @
4b25e80c
...
@@ -1439,7 +1439,7 @@ String generateFakePubspec(
...
@@ -1439,7 +1439,7 @@ String generateFakePubspec(
/// It ends up holding the full graph of dependencies, and the version number for
/// It ends up holding the full graph of dependencies, and the version number for
/// each one.
/// each one.
class
PubDependencyTree
{
class
PubDependencyTree
{
final
Map
<
String
,
String
?>
_versions
=
<
String
,
String
>{};
final
Map
<
String
,
String
?>
_versions
=
<
String
,
String
?
>{};
final
Map
<
String
,
Set
<
String
>>
_dependencyTree
=
<
String
,
Set
<
String
>>{};
final
Map
<
String
,
Set
<
String
>>
_dependencyTree
=
<
String
,
Set
<
String
>>{};
/// Handles the output from "pub deps --style=compact".
/// Handles the output from "pub deps --style=compact".
...
...
packages/flutter_tools/test/commands.shard/hermetic/config_test.dart
View file @
4b25e80c
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
// @dart = 2.8
import
'dart:convert'
;
import
'dart:convert'
;
import
'package:args/command_runner.dart'
;
import
'package:args/command_runner.dart'
;
...
@@ -23,10 +21,10 @@ import '../../src/context.dart';
...
@@ -23,10 +21,10 @@ import '../../src/context.dart';
import
'../../src/test_flutter_command_runner.dart'
;
import
'../../src/test_flutter_command_runner.dart'
;
void
main
(
)
{
void
main
(
)
{
FakeAndroidStudio
fakeAndroidStudio
;
late
FakeAndroidStudio
fakeAndroidStudio
;
FakeAndroidSdk
fakeAndroidSdk
;
late
FakeAndroidSdk
fakeAndroidSdk
;
FakeFlutterVersion
fakeFlutterVersion
;
late
FakeFlutterVersion
fakeFlutterVersion
;
TestUsage
testUsage
;
late
TestUsage
testUsage
;
setUpAll
(()
{
setUpAll
(()
{
Cache
.
disableLocking
();
Cache
.
disableLocking
();
...
@@ -288,7 +286,7 @@ class FakeAndroidSdk extends Fake implements AndroidSdk {
...
@@ -288,7 +286,7 @@ class FakeAndroidSdk extends Fake implements AndroidSdk {
class
FakeFlutterVersion
extends
Fake
implements
FlutterVersion
{
class
FakeFlutterVersion
extends
Fake
implements
FlutterVersion
{
@override
@override
String
channel
;
late
String
channel
;
@override
@override
void
ensureVersionFile
()
{}
void
ensureVersionFile
()
{}
...
...
packages/flutter_tools/test/commands.shard/hermetic/pub_get_test.dart
View file @
4b25e80c
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
// @dart = 2.8
import
'package:args/command_runner.dart'
;
import
'package:args/command_runner.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'
;
...
@@ -12,15 +10,14 @@ import 'package:flutter_tools/src/commands/packages.dart';
...
@@ -12,15 +10,14 @@ import 'package:flutter_tools/src/commands/packages.dart';
import
'package:flutter_tools/src/dart/pub.dart'
;
import
'package:flutter_tools/src/dart/pub.dart'
;
import
'package:flutter_tools/src/project.dart'
;
import
'package:flutter_tools/src/project.dart'
;
import
'package:flutter_tools/src/reporting/reporting.dart'
;
import
'package:flutter_tools/src/reporting/reporting.dart'
;
import
'package:meta/meta.dart'
;
import
'package:test/fake.dart'
;
import
'package:test/fake.dart'
;
import
'../../src/context.dart'
;
import
'../../src/context.dart'
;
import
'../../src/test_flutter_command_runner.dart'
;
import
'../../src/test_flutter_command_runner.dart'
;
void
main
(
)
{
void
main
(
)
{
FileSystem
fileSystem
;
late
FileSystem
fileSystem
;
FakePub
pub
;
late
FakePub
pub
;
setUp
(()
{
setUp
(()
{
Cache
.
disableLocking
();
Cache
.
disableLocking
();
...
@@ -124,13 +121,13 @@ class FakePub extends Fake implements Pub {
...
@@ -124,13 +121,13 @@ class FakePub extends Fake implements Pub {
@override
@override
Future
<
void
>
get
({
Future
<
void
>
get
({
@
required
PubContext
context
,
required
PubContext
context
,
String
directory
,
String
?
directory
,
bool
skipIfAbsent
=
false
,
bool
skipIfAbsent
=
false
,
bool
upgrade
=
false
,
bool
upgrade
=
false
,
bool
offline
=
false
,
bool
offline
=
false
,
bool
generateSyntheticPackage
=
false
,
bool
generateSyntheticPackage
=
false
,
String
flutterRootOverride
,
String
?
flutterRootOverride
,
bool
checkUpToDate
=
false
,
bool
checkUpToDate
=
false
,
bool
shouldSkipThirdPartyGenerator
=
true
,
bool
shouldSkipThirdPartyGenerator
=
true
,
bool
printProgress
=
true
,
bool
printProgress
=
true
,
...
...
packages/flutter_tools/test/commands.shard/hermetic/update_packages_test.dart
View file @
4b25e80c
...
@@ -2,15 +2,12 @@
...
@@ -2,15 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
// @dart = 2.8
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/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'
;
import
'package:meta/meta.dart'
;
import
'package:test/fake.dart'
;
import
'package:test/fake.dart'
;
import
'package:yaml/yaml.dart'
;
import
'package:yaml/yaml.dart'
;
...
@@ -85,10 +82,10 @@ void main() {
...
@@ -85,10 +82,10 @@ void main() {
});
});
group
(
'update-packages'
,
()
{
group
(
'update-packages'
,
()
{
FileSystem
fileSystem
;
late
FileSystem
fileSystem
;
Directory
flutterSdk
;
late
Directory
flutterSdk
;
Directory
flutter
;
late
Directory
flutter
;
FakePub
pub
;
late
FakePub
pub
;
setUpAll
(()
{
setUpAll
(()
{
Cache
.
disableLocking
();
Cache
.
disableLocking
();
...
@@ -209,7 +206,6 @@ void main() {
...
@@ -209,7 +206,6 @@ void main() {
isTransitive:
false
,
isTransitive:
false
,
),
),
],
],
doUpgrade:
false
,
);
);
final
YamlMap
pubspec
=
loadYaml
(
pubspecSource
)
as
YamlMap
;
final
YamlMap
pubspec
=
loadYaml
(
pubspecSource
)
as
YamlMap
;
expect
((
pubspec
[
'dependencies'
]
as
YamlMap
)[
'foo'
],
prevVersion
);
expect
((
pubspec
[
'dependencies'
]
as
YamlMap
)[
'foo'
],
prevVersion
);
...
@@ -226,18 +222,20 @@ class FakePub extends Fake implements Pub {
...
@@ -226,18 +222,20 @@ class FakePub extends Fake implements Pub {
@override
@override
Future
<
void
>
get
({
Future
<
void
>
get
({
@
required
PubContext
context
,
required
PubContext
context
,
String
directory
,
String
?
directory
,
bool
skipIfAbsent
=
false
,
bool
skipIfAbsent
=
false
,
bool
upgrade
=
false
,
bool
upgrade
=
false
,
bool
offline
=
false
,
bool
offline
=
false
,
bool
generateSyntheticPackage
=
false
,
bool
generateSyntheticPackage
=
false
,
String
flutterRootOverride
,
String
?
flutterRootOverride
,
bool
checkUpToDate
=
false
,
bool
checkUpToDate
=
false
,
bool
shouldSkipThirdPartyGenerator
=
true
,
bool
shouldSkipThirdPartyGenerator
=
true
,
bool
printProgress
=
true
,
bool
printProgress
=
true
,
})
async
{
})
async
{
if
(
directory
!=
null
)
{
pubGetDirectories
.
add
(
directory
);
pubGetDirectories
.
add
(
directory
);
}
fileSystem
.
directory
(
directory
).
childFile
(
'pubspec.lock'
)
fileSystem
.
directory
(
directory
).
childFile
(
'pubspec.lock'
)
..
createSync
(
recursive:
true
)
..
createSync
(
recursive:
true
)
..
writeAsStringSync
(
'''
..
writeAsStringSync
(
'''
...
@@ -264,14 +262,16 @@ sdks:
...
@@ -264,14 +262,16 @@ sdks:
@override
@override
Future
<
void
>
batch
(
Future
<
void
>
batch
(
List
<
String
>
arguments
,
{
List
<
String
>
arguments
,
{
@
required
PubContext
context
,
required
PubContext
context
,
String
directory
,
String
?
directory
,
MessageFilter
filter
,
MessageFilter
?
filter
,
String
failureMessage
=
'pub failed'
,
String
failureMessage
=
'pub failed'
,
@
required
bool
retry
,
required
bool
retry
,
bool
showTraceForErrors
,
bool
?
showTraceForErrors
,
})
async
{
})
async
{
if
(
directory
!=
null
)
{
pubBatchDirectories
.
add
(
directory
);
pubBatchDirectories
.
add
(
directory
);
}
'''
'''
Dart SDK 2.16.0-144.0.dev
Dart SDK 2.16.0-144.0.dev
...
@@ -290,6 +290,6 @@ dev dependencies:
...
@@ -290,6 +290,6 @@ dev dependencies:
transitive dependencies:
transitive dependencies:
- platform 3.1.0
- platform 3.1.0
- process 4.2.4 [file path platform]
- process 4.2.4 [file path platform]
'''
.
split
(
'
\n
'
).
forEach
(
filter
);
'''
.
split
(
'
\n
'
).
forEach
(
filter
!
);
}
}
}
}
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