22// for details. All rights reserved. Use of this source code is governed by a
33// BSD-style license that can be found in the LICENSE file.
44
5+ import 'dart:io' ;
6+
57import 'package:dart_mcp/server.dart' ;
68import 'package:dart_mcp_server/src/mixins/dash_cli.dart' ;
79import 'package:dart_mcp_server/src/utils/constants.dart' ;
@@ -15,6 +17,8 @@ void main() {
1517 late TestProcessManager testProcessManager;
1618 late Root exampleFlutterAppRoot;
1719 late Root dartCliAppRoot;
20+ final dartExecutableName = 'dart${Platform .isWindows ? '.exe' : '' }' ;
21+ final flutterExecutableName = 'flutter${Platform .isWindows ? '.bat' : '' }' ;
1822
1923 // TODO: Use setUpAll, currently this fails due to an apparent TestProcess
2024 // issue.
@@ -76,7 +80,7 @@ dependencies:
7680 expect (result.isError, isNot (true ));
7781 expect (testProcessManager.commandsRan, [
7882 equalsCommand ((
79- command: [endsWith ('dart' ), 'fix' , '--apply' ],
83+ command: [endsWith (dartExecutableName ), 'fix' , '--apply' ],
8084 workingDirectory: exampleFlutterAppRoot.path,
8185 )),
8286 ]);
@@ -98,7 +102,7 @@ dependencies:
98102 expect (result.isError, isNot (true ));
99103 expect (testProcessManager.commandsRan, [
100104 equalsCommand ((
101- command: [endsWith ('dart' ), 'format' , '.' ],
105+ command: [endsWith (dartExecutableName ), 'format' , '.' ],
102106 workingDirectory: exampleFlutterAppRoot.path,
103107 )),
104108 ]);
@@ -123,7 +127,12 @@ dependencies:
123127 expect (result.isError, isNot (true ));
124128 expect (testProcessManager.commandsRan, [
125129 equalsCommand ((
126- command: [endsWith ('dart' ), 'format' , 'foo.dart' , 'bar.dart' ],
130+ command: [
131+ endsWith (dartExecutableName),
132+ 'format' ,
133+ 'foo.dart' ,
134+ 'bar.dart' ,
135+ ],
127136 workingDirectory: exampleFlutterAppRoot.path,
128137 )),
129138 ]);
@@ -155,15 +164,15 @@ dependencies:
155164 expect (testProcessManager.commandsRan, [
156165 equalsCommand ((
157166 command: [
158- endsWith ('flutter' ),
167+ endsWith (flutterExecutableName ),
159168 'test' ,
160169 'foo_test.dart' ,
161170 'bar_test.dart' ,
162171 ],
163172 workingDirectory: exampleFlutterAppRoot.path,
164173 )),
165174 equalsCommand ((
166- command: [endsWith ('dart' ), 'test' , 'zip_test.dart' ],
175+ command: [endsWith (dartExecutableName ), 'test' , 'zip_test.dart' ],
167176 workingDirectory: dartCliAppRoot.path,
168177 )),
169178 ]);
@@ -186,7 +195,7 @@ dependencies:
186195 expect (testProcessManager.commandsRan, [
187196 equalsCommand ((
188197 command: [
189- endsWith ('dart' ),
198+ endsWith (dartExecutableName ),
190199 'create' ,
191200 '--template' ,
192201 'cli' ,
@@ -213,7 +222,7 @@ dependencies:
213222 expect (testProcessManager.commandsRan, [
214223 equalsCommand ((
215224 command: [
216- endsWith ('flutter' ),
225+ endsWith (flutterExecutableName ),
217226 'create' ,
218227 '--template' ,
219228 'app' ,
@@ -243,7 +252,7 @@ dependencies:
243252 expect (testProcessManager.commandsRan, [
244253 equalsCommand ((
245254 command: [
246- endsWith ('flutter' ),
255+ endsWith (flutterExecutableName ),
247256 'create' ,
248257 '--template' ,
249258 'app' ,
0 commit comments