Skip to content

Commit

Permalink
Support upper case in remote names (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
fkorotkov authored May 16, 2022
1 parent 0fc3d3d commit 63a2793
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions Sources/tart/OCI/RemoteName.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ struct RemoteName: Comparable, CustomStringConvertible {
init(_ name: String) throws {
let csNormal = [
UInt8(ascii: "a")...UInt8(ascii: "z"),
UInt8(ascii: "A")...UInt8(ascii: "Z"),
UInt8(ascii: "0")...UInt8(ascii: "9"),
].asCharacterSet().union(CharacterSet(charactersIn: "_-."))

Expand Down
6 changes: 6 additions & 0 deletions Tests/TartTests/RemoteNameTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ final class RemoteNameTests: XCTestCase {

XCTAssertEqual(expectedRemoteName, try RemoteName("ghcr.io/a/b:latest"))
}

func testComplexTag() throws {
let expectedRemoteName = RemoteName(host: "ghcr.io", namespace: "a/b", reference: "1.2.3-RC-1")

XCTAssertEqual(expectedRemoteName, try RemoteName("ghcr.io/a/b:1.2.3-RC-1"))
}

func testDigest() throws {
let expectedRemoteName = RemoteName(
Expand Down

0 comments on commit 63a2793

Please sign in to comment.