Compare commits
1 Commits
1.5.0
...
3a7b57d10e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3a7b57d10e |
@@ -4,11 +4,11 @@ import PackageDescription
|
||||
let package = Package(
|
||||
name: "swiftpm-pathkit",
|
||||
products: [
|
||||
.library(name: "PathKit", targets: ["PathKit"]),
|
||||
.library(name: "Path", targets: ["Path"]),
|
||||
],
|
||||
targets: [
|
||||
.target(name: "PathKit", path: "Sources"),
|
||||
.testTarget(name: "PathTests", dependencies: ["PathKit"]),
|
||||
.target(name: "Path", path: "Sources"),
|
||||
.testTarget(name: "PathTests", dependencies: ["Path"]),
|
||||
],
|
||||
swiftLanguageVersions: [.v4, .v4_2, .version("5")]
|
||||
)
|
||||
|
||||
@@ -12,7 +12,7 @@ results.
|
||||
## Examples
|
||||
|
||||
```swift
|
||||
import PathKit
|
||||
import Path
|
||||
|
||||
// convenient static members
|
||||
let home = Path.home
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import XCTest
|
||||
import PathKit
|
||||
import Path
|
||||
|
||||
extension PathTests {
|
||||
func testFindMaxDepth1() throws {
|
||||
@@ -148,7 +148,7 @@ extension PathTests {
|
||||
Set(tmpdir.find().hidden(true)),
|
||||
Set([dotFoo,tmpDotA,tmpDotAFoo,tmpB,tmpBFoo]),
|
||||
relativeTo: tmpdir)
|
||||
|
||||
|
||||
#if !os(Linux) || swift(>=5)
|
||||
XCTAssertEqual(
|
||||
Set(tmpdir.find().hidden(false)),
|
||||
@@ -157,7 +157,7 @@ extension PathTests {
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func testFindExtension() throws {
|
||||
try Path.mktemp { tmpdir in
|
||||
try tmpdir.join("foo.json").touch()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@testable import PathKit
|
||||
@testable import Path
|
||||
import func XCTest.XCTAssertEqual
|
||||
import Foundation
|
||||
import XCTest
|
||||
@@ -54,7 +54,7 @@ class PathTests: XCTestCase {
|
||||
XCTAssertEqual(["b.swift"], Set(lsrv.files.filter{ $0.extension == "swift" }.map{ $0.relative(to: tmpdir) }))
|
||||
XCTAssertEqual(["c"], Set(lsrv.files.filter{ $0.extension == "" }.map{ $0.relative(to: tmpdir) }))
|
||||
XCTAssertEqual(paths, ["a", "b.swift", "c", ".d"])
|
||||
|
||||
|
||||
}
|
||||
|
||||
func testEnumerationSkippingHiddenFiles() throws {
|
||||
@@ -64,7 +64,7 @@ class PathTests: XCTestCase {
|
||||
try tmpdir.join("b").touch()
|
||||
try tmpdir.join("c").touch()
|
||||
try tmpdir.join(".d").mkdir().join("e").touch()
|
||||
|
||||
|
||||
var paths = Set<String>()
|
||||
var dirs = 0
|
||||
for path in tmpdir.ls() {
|
||||
@@ -688,7 +688,7 @@ class PathTests: XCTestCase {
|
||||
XCTAssertEqual(bar.type, .symlink)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func testOptionalInitializer() throws {
|
||||
XCTAssertNil(Path(""))
|
||||
XCTAssertNil(Path("./foo"))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@testable import PathKit
|
||||
@testable import Path
|
||||
import Foundation
|
||||
|
||||
class TemporaryDirectory {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import XCTest
|
||||
import PathKit
|
||||
import Path
|
||||
|
||||
#if swift(>=5.3)
|
||||
func XCTAssertEqual<P: Pathish>(_ set1: Set<Path>, _ set2: Set<Path>, _ message: @autoclosure () -> String = "", file: StaticString = #filePath, line: UInt = #line, relativeTo: P) {
|
||||
|
||||
Reference in New Issue
Block a user