11import 'dart:io' ;
22
3+ import 'package:path/path.dart' as path;
34import 'package:petstore_deprecation_api/petstore_deprecation_api.dart' ;
45import 'package:test/test.dart' ;
56
@@ -12,7 +13,7 @@ void main() {
1213 final files = operationDir
1314 .listSync ()
1415 .whereType <File >()
15- .map ((f) => f. path.split ( '/' ).last )
16+ .map ((f) => path.basename (f.path) )
1617 .toList ();
1718
1819 // Verify deprecated operations are NOT generated
@@ -32,7 +33,7 @@ void main() {
3233 final files = operationDir
3334 .listSync ()
3435 .whereType <File >()
35- .map ((f) => f. path.split ( '/' ).last )
36+ .map ((f) => path.basename (f.path) )
3637 .toList ();
3738
3839 expect (
@@ -48,7 +49,7 @@ void main() {
4849 final files = modelDir
4950 .listSync ()
5051 .whereType <File >()
51- .map ((f) => f. path.split ( '/' ).last )
52+ .map ((f) => path.basename (f.path) )
5253 .toList ();
5354
5455 // Verify deprecated schema is NOT generated
@@ -111,7 +112,7 @@ void main() {
111112 final files = operationDir
112113 .listSync ()
113114 .whereType <File >()
114- .map ((f) => f. path.split ( '/' ).last )
115+ .map ((f) => path.basename (f.path) )
115116 .toList ();
116117
117118 // Verify expected non-deprecated operations ARE generated
@@ -129,7 +130,7 @@ void main() {
129130 final files = modelDir
130131 .listSync ()
131132 .whereType <File >()
132- .map ((f) => f. path.split ( '/' ).last )
133+ .map ((f) => path.basename (f.path) )
133134 .toList ();
134135
135136 // Verify non-deprecated models ARE generated
0 commit comments