                 moduleResult.checkSources(root: "/", paths: "Foo.swift")
             }
         }
+
+        // Single swift module inside Sources.
+        fs = InMemoryFileSystem()
+        try fs.createEmptyFiles("/Sources/Foo.swift",
+                                "/Sources/Bar.swift")
+
+        PackageBuilderTester(name, in: fs) { result in
+            result.checkModule(name) { moduleResult in
+                moduleResult.check(c99name: name, type: .library, isTest: false)
+                moduleResult.checkSources(root: "/Sources", paths: "Foo.swift", "Bar.swift")
+            }
+        }
+
+        // Single swift module inside its own directory.
+        fs = InMemoryFileSystem()
+        try fs.createEmptyFiles("/Sources/lib/Foo.swift",
+                                "/Sources/lib/Bar.swift")
+
+        PackageBuilderTester(name, in: fs) { result in
+            result.checkModule("lib") { moduleResult in
+                moduleResult.check(c99name: "lib", type: .library, isTest: false)
+                moduleResult.checkSources(root: "/Sources/lib", paths: "Foo.swift", "Bar.swift")
+            }
+        }
     }
 
     func testResolvesSystemModulePackage() throws {

    }

    static var allTests = [
        ("testDotFilesAreIgnored", testDotFilesAreIgnored),
        ("testResolvesSingleSwiftModule", testResolvesSingleSwiftModule),
        ("testResolvesSystemModulePackage", testResolvesSystemModulePackage),
        ("testResolvesSingleClangModule", testResolvesSingleClangModule),
        ("testMixedSources", testMixedSources),
        ("testTwoModulesMixedLanguage", testTwoModulesMixedLanguage),
        ("testCInTests", testCInTests),
    ]
}


/// Tests for the handling of source layout conventions.
class ConventionTests: XCTestCase {
    
    // MARK:- Valid Layouts Tests

    func testDotFilesAreIgnored() throws {
        var fs = InMemoryFileSystem()
        try fs.createEmptyFiles("/.Bar.swift",
