From f1b4a885bf553c6fd4620a1113118e9f04ef1213 Mon Sep 17 00:00:00 2001 From: Prachi Gauriar Date: Fri, 29 Aug 2025 10:09:08 -0400 Subject: [PATCH] Update to Swift 6.2 --- .github/workflows/VerifyChanges.yaml | 14 +++++++------- .swift-format | 1 + CLAUDE.md | 4 ++-- Package.swift | 2 +- README.md | 2 +- .../String+RandomTests.swift | 11 +++++++++++ 6 files changed, 23 insertions(+), 11 deletions(-) diff --git a/.github/workflows/VerifyChanges.yaml b/.github/workflows/VerifyChanges.yaml index e5cdae4..94bd1b8 100644 --- a/.github/workflows/VerifyChanges.yaml +++ b/.github/workflows/VerifyChanges.yaml @@ -14,9 +14,9 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Select Xcode 16.4 + - name: Select Xcode 26.0.0 run: | - sudo xcode-select -s /Applications/Xcode_16.4.0.app + sudo xcode-select -s /Applications/Xcode_26.0.0.app - name: Lint run: | Scripts/lint @@ -70,9 +70,9 @@ jobs: sourcepackages-directory: .build/DerivedData/SourcePackages swiftpm-package-resolved-file: Package.resolved verbose: true - - name: Select Xcode 16.4 + - name: Select Xcode 26.0.0 run: | - sudo xcode-select -s /Applications/Xcode_16.4.0.app + sudo xcode-select -s /Applications/Xcode_26.0.0.app - name: Build for Testing run: | "$DEV_BUILDS"/build_and_test.sh --action build-for-testing @@ -118,9 +118,9 @@ jobs: - name: Download xccovPretty output uses: actions/download-artifact@v4 with: - name: xccovPrettyOutput-iOS + name: xccovPrettyOutput-macOS - name: Post Code Coverage Comment uses: thollander/actions-comment-pull-request@v3 with: - file-path: xccovPretty-iOS.output - comment-tag: codeCoverage-iOS + file-path: xccovPretty-macOS.output + comment-tag: codeCoverage-macOS diff --git a/.swift-format b/.swift-format index 6cd31d6..84042b2 100644 --- a/.swift-format +++ b/.swift-format @@ -14,6 +14,7 @@ "lineBreakBetweenDeclarationAttributes": false, "lineLength": 120, "maximumBlankLines": 2, + "multilineTrailingCommaBehavior": "alwaysUsed", "multiElementCollectionTrailingCommas": true, "noAssignmentInExpressions": { "allowedFunctions": [] diff --git a/CLAUDE.md b/CLAUDE.md index 5450c28..8b1644d 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -67,7 +67,7 @@ reproducibility. - **Swift Numerics**: Used for `RealModule` in tests - **Platform Requirements**: iOS 18+, macOS 15+, tvOS 18+, visionOS 2+, watchOS 11+ - - **Swift Version**: Requires Swift 6.1 toolchain + - **Swift Version**: Requires Swift 6.2 toolchain ### Testing Strategy @@ -85,4 +85,4 @@ reproducibility. - 100 character line length - 4-space indented code blocks (no fenced blocks) - 2-space indented bullet lists with alignment - - Consistent terminology (function vs method, type vs class) \ No newline at end of file + - Consistent terminology (function vs method, type vs class) diff --git a/Package.swift b/Package.swift index cb5ac90..96ad1dc 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version: 6.1 +// swift-tools-version: 6.2 import PackageDescription diff --git a/README.md b/README.md index c0e2933..091b8a4 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ View our [changelog](CHANGELOG.md) to see what’s new. ## Development Requirements -DevTesting requires a Swift 6.1 toolchain to build. We only test on Apple platforms. We follow the +DevTesting requires a Swift 6.2+ toolchain to build. We only test on Apple platforms. We follow the [Swift API Design Guidelines][SwiftAPIDesignGuidelines]. We take pride in the fact that our public interfaces are fully documented and tested. We aim for overall test coverage over 99%. diff --git a/Tests/DevTestingTests/Random Value Generation/String+RandomTests.swift b/Tests/DevTestingTests/Random Value Generation/String+RandomTests.swift index 98dac2b..b8a488a 100644 --- a/Tests/DevTestingTests/Random Value Generation/String+RandomTests.swift +++ b/Tests/DevTestingTests/Random Value Generation/String+RandomTests.swift @@ -11,6 +11,17 @@ import Testing @testable import DevTesting struct String_RandomTests { + #if os(macOS) + @Test + func randomWithCharactersHaltsWhenCharactersIsEmptyAndCountIsNonZero() async { + await #expect(processExitsWith: .failure) { + var rng = SystemRandomNumberGenerator() + _ = String.random(withCharactersFrom: "", count: 1, using: &rng) + } + } + #endif + + @Test func randomWithCharactersReturnsEmptyWhenCharactersIsEmptyOrCountIs0() { var rng = SystemRandomNumberGenerator()