@@ -963,7 +963,8 @@ void main() {
963963 platform: windowsPlatform,
964964 );
965965
966- const String expectedMessage = 'The flutter tool cannot access the file' ;
966+ const String expectedMessage = 'Flutter failed to run "foo". The flutter tool cannot access the file or directory.\n '
967+ 'Please ensure that the SDK and/or project is installed in a location that has read/write permissions for the current user.' ;
967968 expect (() async => processManager.start (< String > ['foo' ]),
968969 throwsToolExit (message: expectedMessage));
969970 expect (() async => processManager.run (< String > ['foo' ]),
@@ -1021,7 +1022,8 @@ void main() {
10211022 platform: linuxPlatform,
10221023 );
10231024
1024- const String expectedMessage = 'The flutter tool cannot access the file' ;
1025+ const String expectedMessage = 'Flutter failed to run "foo".\n '
1026+ 'Please ensure that the SDK and/or project is installed in a location that has read/write permissions for the current user.' ;
10251027
10261028 expect (() async => processManager.start (< String > ['foo' ]),
10271029 throwsToolExit (message: expectedMessage));
@@ -1085,7 +1087,8 @@ void main() {
10851087 platform: macOSPlatform,
10861088 );
10871089
1088- const String expectedMessage = 'The flutter tool cannot access the file' ;
1090+ const String expectedMessage = 'Flutter failed to run "foo".\n '
1091+ 'Please ensure that the SDK and/or project is installed in a location that has read/write permissions for the current user.' ;
10891092
10901093 expect (() async => processManager.start (< String > ['foo' ]),
10911094 throwsToolExit (message: expectedMessage));
@@ -1113,23 +1116,24 @@ void main() {
11131116
11141117 testWithoutContext ('when bad CPU type' , () async {
11151118 final FakeProcessManager fakeProcessManager = FakeProcessManager .list (< FakeCommand > [
1116- const FakeCommand (command: < String > ['foo' ], exception: ProcessException ('' , < String > [], '' , ebadarch)),
1117- const FakeCommand (command: < String > ['foo' ], exception: ProcessException ('' , < String > [], '' , ebadarch)),
1118- const FakeCommand (command: < String > ['foo' ], exception: ProcessException ('' , < String > [], '' , ebadarch)),
1119+ const FakeCommand (command: < String > ['foo' , '--bar' ], exception: ProcessException ('' , < String > [], '' , ebadarch)),
1120+ const FakeCommand (command: < String > ['foo' , '--bar' ], exception: ProcessException ('' , < String > [], '' , ebadarch)),
1121+ const FakeCommand (command: < String > ['foo' , '--bar' ], exception: ProcessException ('' , < String > [], '' , ebadarch)),
11191122 ]);
11201123
11211124 final ProcessManager processManager = ErrorHandlingProcessManager (
11221125 delegate: fakeProcessManager,
11231126 platform: macOSPlatform,
11241127 );
11251128
1126- const String expectedMessage = 'Flutter requires the Rosetta translation environment' ;
1129+ const String expectedMessage = 'Flutter failed to run "foo --bar".\n '
1130+ 'The binary was built with the incorrect architecture to run on this machine.' ;
11271131
1128- expect (() async => processManager.start (< String > ['foo' ]),
1132+ expect (() async => processManager.start (< String > ['foo' , '--bar' ]),
11291133 throwsToolExit (message: expectedMessage));
1130- expect (() async => processManager.run (< String > ['foo' ]),
1134+ expect (() async => processManager.run (< String > ['foo' , '--bar' ]),
11311135 throwsToolExit (message: expectedMessage));
1132- expect (() => processManager.runSync (< String > ['foo' ]),
1136+ expect (() => processManager.runSync (< String > ['foo' , '--bar' ]),
11331137 throwsToolExit (message: expectedMessage));
11341138 });
11351139 });
0 commit comments