File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -19,20 +19,21 @@ extension Package {
19
19
let rootTestFiles = files. filter {
20
20
!$0. hasSuffix ( " LinuxMain.swift " ) && isValidSource ( $0) && !excludes. contains ( $0)
21
21
}
22
-
23
- guard testDirectories. count > 0 && rootTestFiles. count > 0 else {
24
- throw ModuleError . InvalidLayout ( . InvalidLayout)
25
- }
26
22
27
23
if ( testDirectories. count > 0 ) {
24
+ if ( rootTestFiles. count > 0 ) {
25
+ throw ModuleError . InvalidLayout ( . InvalidLayout)
26
+ }
28
27
return try testDirectories. map {
29
28
TestModule ( basename: $0. basename, sources: try self . sourcify ( $0) )
30
29
}
31
- } else {
32
- if ( rootTestFiles. count > 0 ) {
33
- let rootTestSource = Sources ( paths: rootTestFiles, root: path)
34
- return [ TestModule ( basename: name, sources: rootTestSource) ]
30
+ } else if ( rootTestFiles. count > 0 ) {
31
+ if ( testDirectories. count > 0 ) {
32
+ throw ModuleError . InvalidLayout ( . InvalidLayout)
35
33
}
34
+
35
+ let rootTestSource = Sources ( paths: rootTestFiles, root: path)
36
+ return [ TestModule ( basename: name, sources: rootTestSource) ]
36
37
}
37
38
38
39
return [ ]
You can’t perform that action at this time.
0 commit comments