File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -22,19 +22,19 @@ func getSingleSourceLibraries(subDirectory: String) -> [String] {
22
22
let fileURLs = try ! f. contentsOfDirectory ( at: dirURL,
23
23
includingPropertiesForKeys: nil )
24
24
return fileURLs. compactMap { ( path: URL ) -> String ? in
25
- let c = path. lastPathComponent. split ( separator: " . " )
26
- // Too many components. Must be a gyb file.
27
- if c. count > 2 {
28
- return nil
29
- }
30
- if c [ 1 ] != " swift " {
25
+ guard let lastDot = path. lastPathComponent. lastIndex ( of: " . " ) else {
31
26
return nil
32
27
}
28
+ let ext = String ( path. lastPathComponent. suffix ( from: lastDot) )
29
+ guard ext == " .swift " else { return nil }
30
+
31
+ let name = String ( path. lastPathComponent. prefix ( upTo: lastDot) )
33
32
34
- let name = String ( c [ 0 ] )
33
+ // Test names must have a single component.
34
+ if name. contains ( " . " ) { return nil }
35
35
36
- // We do not support this test.
37
36
if unsupportedTests. contains ( name) {
37
+ // We do not support this test.
38
38
return nil
39
39
}
40
40
You can’t perform that action at this time.
0 commit comments