diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 45718fc..f0e5a14 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -176,3 +176,13 @@ jobs: - name: Unit Tests if: steps.destnameprep.outcome != 'failure' run: xcodebuild test -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "$SCHEME" -destination "platform=watchOS Simulator,name=$DESTNAME" | xcbeautify --renderer github-actions && exit ${PIPESTATUS[0]} + + linux: + name: Linux + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Build + run: swift build + - name: Unit Tests + run: swift test diff --git a/Sources/SwiftASCII/String.swift b/Sources/SwiftASCII/String.swift index dfff1d2..efa9eae 100644 --- a/Sources/SwiftASCII/String.swift +++ b/Sources/SwiftASCII/String.swift @@ -46,7 +46,12 @@ extension StringProtocol { /// will be substituted. @available(OSX 10.11, iOS 9.0, *) public var asciiStringLossy: ASCIIString { - let transformed = applyingTransform( +#if canImport(Darwin) + let this = self +#else + let this = String(self) as NSString +#endif + let transformed = this.applyingTransform( StringTransform("Latin-ASCII"), reverse: false )