File tree Expand file tree Collapse file tree 2 files changed +1
-26
lines changed
Expand file tree Collapse file tree 2 files changed +1
-26
lines changed Original file line number Diff line number Diff line change @@ -16,13 +16,7 @@ interface class DependencyDiscoverer {
1616 logger.fine ('Discovering dependencies in $dependencyFilePath ' );
1717 return File (dependencyFilePath)
1818 .readAsLinesSync ()
19- .map ((line) {
20- final splitIndex = line.indexOf (':' );
21- if (splitIndex < 0 ) return null ;
22- return line.substring (splitIndex + 1 ).trim ();
23- })
24- .nonNulls
25- .expand ((files) => files.split (' ' ))
19+ .expand ((line) => line.trim ().split (' ' ).skip (1 ))
2620 .followedBy ([dependencyFilePath])
2721 .map (path.toUri);
2822 }
Original file line number Diff line number Diff line change @@ -56,25 +56,6 @@ target/debug/librust_lib.a: /path/to/some/other/file.rs
5656 );
5757 });
5858
59- test ('discover ignores lines without a colon' , () {
60- final dependencyFilePath = path.join (tempDir.path, 'test.d' );
61- File (dependencyFilePath).writeAsStringSync ('''
62- invalid line
63- target/debug/librust_lib.a: src/lib.rs
64- ''' );
65-
66- final dependencies = dependencyDiscoverer.discover (dependencyFilePath);
67-
68- expect (
69- dependencies,
70- containsAll ([
71- path.toUri ('src/lib.rs' ),
72- path.toUri (dependencyFilePath),
73- ]),
74- );
75- expect (dependencies.length, 2 );
76- });
77-
7859 test ('discover handles an empty dependency file' , () {
7960 final dependencyFilePath = path.join (tempDir.path, 'test.d' );
8061 File (dependencyFilePath).writeAsStringSync ('' );
You can’t perform that action at this time.
0 commit comments