Skip to content

Commit

Permalink
Merge branch 'main' into jbe/account_id_config
Browse files Browse the repository at this point in the history
  • Loading branch information
jbelkins authored Jan 15, 2025
2 parents 51db47a + 51366e3 commit f4f96a6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion AWSSDKSwiftCLI/Sources/AWSCLIUtils/Version.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public struct Version: Equatable {
}

public init(_ value: String) throws {
let components = value.split(separator: ".")
let components = value.trimmingCharacters(in: .whitespacesAndNewlines).split(separator: ".")
guard components.count == 3 else {
throw Error("Version does not have three components")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@ import AWSCLIUtils
import XCTest

class VersionUtilsTests: XCTestCase {


func testIgnoresLeadingAndTrailingWhitespace() throws {
try XCTAssertEqual(
Version("\r\n\t 1.2.1\r\n\t "),
Version("1.2.1")
)
}

func testIncrementingMajor() throws {
try XCTAssertEqual(
Version("1.2.1").incrementingMajor(),
Expand Down
2 changes: 1 addition & 1 deletion Package.version.next
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.0
1.1.0

0 comments on commit f4f96a6

Please sign in to comment.