Incorrect path.join usage might be causing Windows test failures (#64056)

This commit is contained in:
xster
2020-08-18 17:16:04 -07:00
committed by GitHub
parent 734a90eb3a
commit b92f80e22a
2 changed files with 24 additions and 14 deletions

View File

@@ -42,7 +42,8 @@ Future<void> main() async {
final File readonlyTxtAssetFile = await File(path.join(
projectDir.path,
'assets/read-only.txt'
'assets',
'read-only.txt'
))
.create(recursive: true);
@@ -253,7 +254,7 @@ Future<void> main() async {
section('Check file access modes for read-only asset from Flutter module');
final String readonlyDebugAssetFilePath = path.join(
final String readonlyDebugAssetFilePath = path.joinAll(<String>[
hostApp.path,
'SampleApp',
'build',
@@ -261,8 +262,10 @@ Future<void> main() async {
'merged_assets',
'debug',
'out',
'flutter_assets/assets/read-only.txt',
);
'flutter_assets',
'assets',
'read-only.txt',
]);
final File readonlyDebugAssetFile = File(readonlyDebugAssetFilePath);
if (!exists(readonlyDebugAssetFile)) {
return TaskResult.failure('Failed to copy read-only asset file');
@@ -323,7 +326,7 @@ Future<void> main() async {
section('Check file access modes for read-only asset from Flutter module');
final String readonlyReleaseAssetFilePath = path.join(
final String readonlyReleaseAssetFilePath = path.joinAll(<String>[
hostApp.path,
'SampleApp',
'build',
@@ -331,8 +334,10 @@ Future<void> main() async {
'merged_assets',
'release',
'out',
'flutter_assets/assets/read-only.txt',
);
'flutter_assets',
'assets',
'read-only.txt',
]);
final File readonlyReleaseAssetFile = File(readonlyReleaseAssetFilePath);
if (!exists(readonlyReleaseAssetFile)) {
return TaskResult.failure('Failed to copy read-only asset file');

View File

@@ -42,7 +42,8 @@ Future<void> main() async {
final File readonlyTxtAssetFile = await File(path.join(
projectDir.path,
'assets/read-only.txt'
'assets',
'read-only.txt'
))
.create(recursive: true);
@@ -253,7 +254,7 @@ Future<void> main() async {
section('Check file access modes for read-only asset from Flutter module');
final String readonlyDebugAssetFilePath = path.join(
final String readonlyDebugAssetFilePath = path.joinAll(<String>[
hostApp.path,
'app',
'build',
@@ -261,8 +262,10 @@ Future<void> main() async {
'merged_assets',
'debug',
'out',
'flutter_assets/assets/read-only.txt',
);
'flutter_assets',
'assets',
'read-only.txt',
]);
final File readonlyDebugAssetFile = File(readonlyDebugAssetFilePath);
if (!exists(readonlyDebugAssetFile)) {
return TaskResult.failure('Failed to copy read-only asset file');
@@ -323,7 +326,7 @@ Future<void> main() async {
section('Check file access modes for read-only asset from Flutter module');
final String readonlyReleaseAssetFilePath = path.join(
final String readonlyReleaseAssetFilePath = path.joinAll(<String>[
hostApp.path,
'app',
'build',
@@ -331,8 +334,10 @@ Future<void> main() async {
'merged_assets',
'release',
'out',
'flutter_assets/assets/read-only.txt',
);
'flutter_assets',
'assets',
'read-only.txt',
]);
final File readonlyReleaseAssetFile = File(readonlyReleaseAssetFilePath);
if (!exists(readonlyReleaseAssetFile)) {
return TaskResult.failure('Failed to copy read-only asset file');