@@ -4,7 +4,10 @@ import 'package:analyzer/file_system/physical_file_system.dart';
44import 'package:tdesign_flutter_tools/component_rule.dart' ;
55import 'package:test/test.dart' ;
66
7- List <dynamic > _analyse (List <String > names, String path) {
7+ import 'support/component_paths.dart' ;
8+
9+ List <dynamic > _analyse (List <String > names, String relPath) {
10+ final String path = componentSourcePath (relPath);
811 final col = AnalysisContextCollection (
912 includedPaths: [path],
1013 resourceProvider: PhysicalResourceProvider .INSTANCE ,
@@ -16,15 +19,16 @@ List<dynamic> _analyse(List<String> names, String path) {
1619 isGrammarParser: false ,
1720 nameList: names,
1821 folderName: 'popup' ,
19- sourceFileName: path .split ('/' ).last,
22+ sourceFileName: relPath .split ('/' ).last,
2023 ).analyse ();
2124}
2225
2326void main () {
2427 test ('auto includes SlideTransitionFrom when parsing TSlidePopupRoute file' , () {
25- final path =
26- '/Users/rs/Documents/cursor/tdesign-flutter/tdesign-component/lib/src/components/popup/t_popup_route.dart' ;
27- final list = _analyse (['TSlidePopupRoute' ], path);
28+ final list = _analyse (
29+ ['TSlidePopupRoute' ],
30+ 'lib/src/components/popup/t_popup_route.dart' ,
31+ );
2832 final names = list.map ((e) => e.componentInfo! .name).toList ();
2933 expect (names, contains ('SlideTransitionFrom' ));
3034 final enumInfo =
@@ -35,9 +39,10 @@ void main() {
3539 });
3640
3741 test ('auto includes PopupClick when parsing popup panel file' , () {
38- final path =
39- '/Users/rs/Documents/cursor/tdesign-flutter/tdesign-component/lib/src/components/popup/t_popup_panel.dart' ;
40- final list = _analyse (['TPopupBottomDisplayPanel' ], path);
42+ final list = _analyse (
43+ ['TPopupBottomDisplayPanel' ],
44+ 'lib/src/components/popup/t_popup_panel.dart' ,
45+ );
4146 final names = list.map ((e) => e.componentInfo! .name).toList ();
4247 expect (names, contains ('PopupClick' ));
4348 final typedefInfo =
0 commit comments