├── .github ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE │ ├── 🇨🇦EN Bug Report.md │ ├── 🇨🇦EN Documentation Correction.md │ ├── 🇨🇦EN Feature Request.md │ └── 🇨🇦EN Question.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ ├── Amazon Linux.yaml │ ├── Android.yaml │ ├── Documentation Deployment.yaml │ ├── Miscellaneous.yaml │ ├── Swift 5.7 (Amazon Linux).yaml │ ├── Swift 5.7 (Android).yaml │ ├── Swift 5.7 (Ubuntu).yaml │ ├── Swift 5.7 (Web).yaml │ ├── Swift 5.7 (Windows).yaml │ ├── Swift 5.7 (iOS).yaml │ ├── Swift 5.7 (macOS).yaml │ ├── Swift 5.7 (tvOS).yaml │ ├── Swift 5.7 (watchOS).yaml │ ├── Ubuntu.yaml │ ├── Web.yaml │ ├── Windows.yaml │ ├── iOS.yaml │ ├── macOS.yaml │ ├── tvOS.yaml │ └── watchOS.yaml ├── .gitignore ├── LICENSE.md ├── Package.resolved ├── Package.swift ├── README.md ├── Refresh (Linux).sh ├── Refresh (macOS).command ├── Sources ├── SDGSwift │ ├── Build.swift │ ├── Git.swift │ ├── PackageRepository.swift │ ├── PackageStructure.swift │ ├── PackageStructureBuildError.swift │ ├── PackageStructureExecutionError.swift │ ├── String │ │ ├── String.ScalarOffset.swift │ │ ├── String.swift │ │ └── URL.swift │ ├── SwiftCompiler.swift │ ├── SwiftCompilerCoverageReportingError.swift │ ├── Test Coverage │ │ ├── CoverageRegion.swift │ │ ├── FileTestCoverage.swift │ │ └── TestCoverageReport.swift │ ├── Version.swift │ ├── VersionedExternalProcess.swift │ ├── VersionedExternalProcessExecutionError.swift │ └── VersionedExternalProcessLocationError.swift ├── SDGSwiftConfiguration │ ├── Configuration.swift │ ├── Context.swift │ └── Export.swift ├── SDGSwiftConfigurationLoading │ ├── Configuration.swift │ ├── ConfigurationError.swift │ ├── LegacyMode.swift │ ├── Package.swift.txt │ ├── Resources.swift │ └── Resources │ │ └── Resources 1.swift ├── SDGSwiftDocumentation │ ├── Additions │ │ ├── LibraryAPI.swift │ │ ├── ModuleAPI.swift │ │ ├── Operator.swift │ │ ├── PackageAPI.swift │ │ ├── PrecedenceGroup.swift │ │ ├── StoredDocumentation.swift │ │ ├── SwiftSyntax │ │ │ ├── OperatorDeclSyntax.swift │ │ │ ├── PrecedenceGroupDeclSyntax.swift │ │ │ ├── SourceLocation.swift │ │ │ ├── Syntax.swift │ │ │ └── SyntaxProtocol.swift │ │ ├── SymbolDocumentation.swift │ │ └── SymbolLike.swift │ ├── LoadedSymbolGraph.swift │ ├── PackageRepository.swift │ ├── SwiftPM │ │ ├── Manifest.swift │ │ └── Package.swift │ ├── SymbolGraph.LoadingError.swift │ └── SymbolKit │ │ ├── SymbolGraph.Symbol.Names.swift │ │ ├── SymbolGraph.Symbol.swift │ │ └── SymbolGraph.swift ├── SDGSwiftLocalizations │ ├── APILocalization.swift │ └── InterfaceLocalization.swift ├── SDGSwiftPackageManager │ ├── Git.swift │ ├── PackageRepository.swift │ ├── PackageRepositoryInitializationError.swift │ └── SwiftCompilerPackageLoadingError.swift ├── SDGSwiftSource │ ├── Callout.swift │ ├── Scanners │ │ ├── ClosureSyntaxScanner.swift │ │ ├── ParentRelationship.swift │ │ ├── ParserCache.swift │ │ ├── ScanContext.swift │ │ └── SyntaxScanner.swift │ ├── String.swift │ ├── SwiftSyntax │ │ ├── FunctionParameterSyntax.swift │ │ └── SyntaxProtocol.swift │ ├── Syntax │ │ ├── Concrete Nodes │ │ │ ├── AnySyntaxNode.swift │ │ │ ├── BlockComment.swift │ │ │ ├── BlockDocumentation.swift │ │ │ ├── CalloutNode.swift │ │ │ ├── CodeBlockNode.swift │ │ │ ├── CodeContent.swift │ │ │ ├── CommentContent.swift │ │ │ ├── DocumentationContentSyntax.swift │ │ │ ├── Fragment.swift │ │ │ ├── LineComment.swift │ │ │ ├── LineDocumentation.swift │ │ │ ├── LineFragment.swift │ │ │ ├── Markdown │ │ │ │ ├── EmphasisNode.swift │ │ │ │ ├── ImageNode.swift │ │ │ │ ├── InlineCodeNode.swift │ │ │ │ ├── LinkContent.swift │ │ │ │ ├── LinkNode.swift │ │ │ │ ├── LinkTarget.swift │ │ │ │ ├── ListItemNode.swift │ │ │ │ ├── ListNode.swift │ │ │ │ ├── MarkdownNode.swift │ │ │ │ ├── NumberedHeading.swift │ │ │ │ ├── ParagraphNode.swift │ │ │ │ ├── Quotation.swift │ │ │ │ ├── StrongNode.swift │ │ │ │ └── UnderlinedHeading.swift │ │ │ ├── ParametersEntry.swift │ │ │ ├── SourceHeading.swift │ │ │ ├── StringLiteral.swift │ │ │ ├── SwiftSyntax │ │ │ │ ├── SwiftSyntaxNode.swift │ │ │ │ ├── TriviaNode.swift │ │ │ │ └── TriviaPieceNode.swift │ │ │ └── Token.swift │ │ ├── Protocols │ │ │ ├── BlockCommentContentProtocol.swift │ │ │ ├── BlockCommentProtocol.swift │ │ │ ├── FontNode.swift │ │ │ ├── FragmentProtocol.swift │ │ │ ├── LineCommentContentProtocol.swift │ │ │ ├── LineCommentProtocol.swift │ │ │ ├── MarkdownHeading.swift │ │ │ ├── StreamedViaChildren.swift │ │ │ └── SyntaxNode.swift │ │ └── Token.Kind.swift │ └── TextFreedom.swift ├── SDGXcode │ ├── PackageRepository.swift │ ├── Xcode.Platform.swift │ ├── Xcode.swift │ ├── XcodeCoverageReportingError.swift │ └── XcodeSchemeError.swift └── SampleConfiguration │ ├── SampleConfiguration.swift │ └── SampleContext.swift ├── Tests ├── Mock Projects │ ├── Dependency │ │ ├── Package.swift │ │ └── Sources │ │ │ └── Dependency │ │ │ └── Dependency.swift │ ├── Dependency2 │ │ ├── Package.swift │ │ └── Sources │ │ │ └── Dependency2 │ │ │ └── Dependency.swift │ ├── DependentOnWarnings │ │ ├── Package.swift │ │ └── Sources │ │ │ └── DependentOnWarnings │ │ │ └── DependentOnWarnings.swift │ ├── DynamicLibraryA │ │ ├── Package.swift │ │ └── Sources │ │ │ └── LibraryA │ │ │ └── LibraryA.swift │ ├── DynamicLibraryB │ │ ├── Package.swift │ │ └── Sources │ │ │ └── LibraryB │ │ │ └── LibraryB.swift │ ├── DynamicallyLinkedTool │ │ ├── Package.swift │ │ └── Sources │ │ │ └── tool │ │ │ └── main.swift │ ├── MultipleArchitectures │ │ ├── Package.swift │ │ └── Sources │ │ │ └── MultipleArchitectures │ │ │ └── MultipleArchitectures.swift │ ├── MultipleSchemes │ │ ├── Package.swift │ │ ├── Sources │ │ │ ├── SomeLibrary │ │ │ │ └── File.swift │ │ │ ├── SomeOtherLibrary │ │ │ │ └── File.swift │ │ │ └── some‐tool │ │ │ │ └── main.swift │ │ └── Tests │ │ │ └── SomeTests │ │ │ └── File.swift │ ├── PackageToDocument │ │ ├── Package.swift │ │ └── Sources │ │ │ ├── Hidden │ │ │ └── Hidden.swift │ │ │ ├── PrimaryModule │ │ │ ├── Bool.swift │ │ │ ├── Class.swift │ │ │ ├── Collection.swift │ │ │ ├── Enumeration.swift │ │ │ ├── ExpressibleByStringInterpolation.swift │ │ │ ├── Function.swift │ │ │ ├── GlobalVariable.swift │ │ │ ├── Inherited.swift │ │ │ ├── Operator.swift │ │ │ ├── Precedence.swift │ │ │ ├── Protocol.swift │ │ │ ├── Structure.swift │ │ │ └── TypeAlias.swift │ │ │ └── executable │ │ │ └── main.swift │ ├── PackageToDocument2 │ │ ├── Package.swift │ │ └── Sources │ │ │ └── PrimaryModule │ │ │ └── Bool.swift │ ├── Tool │ │ ├── Package.swift │ │ └── Sources │ │ │ └── Tool │ │ │ └── main.swift │ ├── Warnings │ │ ├── Package.swift │ │ └── Sources │ │ │ └── Warnings │ │ │ └── Warnings.swift │ └── WithCustomScheme │ │ ├── .swiftpm │ │ └── xcode │ │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── ACustomScheme.xcscheme │ │ ├── Package.swift │ │ └── Sources │ │ └── WithCustomScheme │ │ └── WithCustomScheme.swift ├── SDGSwiftConfigurationTests │ ├── APITests.swift │ ├── InternalTests.swift │ └── LegacyMode.swift ├── SDGSwiftDocumentationExampleTests │ └── ReadMeExampleTests.swift ├── SDGSwiftDocumentationTests │ ├── APITests.swift │ └── InternalTests.swift ├── SDGSwiftPackageManagerTests │ ├── APITests.swift │ └── RegressionTests.swift ├── SDGSwiftSourceTests │ ├── APITests.swift │ ├── Conformances │ │ ├── BlockComment.swift │ │ ├── BlockDocumentation.swift │ │ ├── CodeBlockNode.swift │ │ ├── CodeContent.swift │ │ ├── CommentContent.swift │ │ ├── DocumentationContent.swift │ │ ├── LineComment.swift │ │ ├── LineDocumentation.swift │ │ ├── StringLiteral.swift │ │ └── SwiftSyntaxNode.swift │ └── Scanners │ │ ├── Highlighter.swift │ │ ├── RoundTripSyntaxScanner.swift │ │ ├── RoundTripTestable.swift │ │ ├── TextFreedomHighlighter.swift │ │ └── UnknownHighlighter.swift ├── SDGSwiftTestUtilities │ ├── ProcessInfo.swift │ ├── Repositories.swift │ ├── Repository.swift │ └── TestCase.swift ├── SDGSwiftTests │ ├── APITests.swift │ ├── InternalTests.swift │ └── RegressionTests.swift ├── SDGXcodeTests │ ├── APITests.swift │ └── RegressionTests.swift └── Test Specifications │ ├── Codable │ └── SampleConfiguration │ │ └── Sample Configuration │ │ ├── 2018‐06‐05 (Linux).txt │ │ └── 2018‐06‐05.txt │ ├── Configuration Loading.txt │ ├── Configuration │ ├── Configured │ │ └── SampleConfigurationFile.swift │ ├── Empty │ │ └── SampleConfigurationFile.swift │ └── Legacy │ │ └── SampleConfigurationFile.swift │ ├── Coverage.txt │ ├── CustomStringConvertible │ ├── Build │ │ ├── 1.0.0.txt │ │ └── Development.txt │ ├── BuildError │ │ ├── Foundation.txt │ │ ├── Git Unavailable.txt │ │ └── Swift Unavailable.txt │ ├── CoverageReportingError │ │ ├── Corrupt Test Coverage Report.txt │ │ ├── Corrupt Test Coverage.txt │ │ ├── Foundation.txt │ │ ├── Package Manager.txt │ │ ├── Swift Error.txt │ │ ├── Unavailable.txt │ │ └── Xcode Unavailable.txt │ ├── Error │ │ ├── Corrupt.txt │ │ ├── Empty.txt │ │ ├── Foundation.txt │ │ ├── Git Execution.txt │ │ ├── Git Unavailable.txt │ │ ├── Swift Execution.txt │ │ └── Swift Unavailable.txt │ ├── ExecutionError │ │ ├── Foundation.txt │ │ ├── Git Unavailable.txt │ │ └── No Such Executable.txt │ ├── HostDestinationError │ │ └── Package Manager.txt │ ├── InitializationError │ │ ├── Git Unavailable.txt │ │ └── Package Manager.txt │ ├── LoadingError │ │ ├── Export.txt │ │ ├── Load.txt │ │ └── Manifest Load.txt │ ├── Package │ │ └── Mock Package.txt │ ├── PackageLoadingError │ │ ├── Diagnostics.txt │ │ └── Package Manager.txt │ ├── PackageRepository │ │ └── Mock.txt │ ├── SchemeError │ │ ├── Foundation.txt │ │ └── No Package Scheme.txt │ ├── Version │ │ └── 1.2.3.txt │ ├── VersionedExternalProcessExecutionError⟨Git⟩ │ │ ├── Git Execution.txt │ │ └── Git Unavailable.txt │ ├── VersionedExternalProcessExecutionError⟨SwiftCompiler⟩ │ │ ├── Swift Execution.txt │ │ └── Swift Unavailable.txt │ └── VersionedExternalProcessExecutionError⟨Xcode⟩ │ │ └── Foundation.txt │ ├── Localization │ └── Callouts │ │ ├── 🇨🇦EN.txt │ │ ├── 🇩🇪DE.txt │ │ ├── 🇬🇧EN.txt │ │ └── 🇺🇸EN.txt │ ├── Source │ ├── After │ │ ├── Aliasable Text │ │ │ ├── Attributes.txt │ │ │ ├── BaseClass.txt │ │ │ ├── Class.txt │ │ │ ├── ConditionalCompilation.txt │ │ │ ├── Conformance.txt │ │ │ ├── ControlFlow.txt │ │ │ ├── Documentation.txt │ │ │ ├── DocumentedExtension.txt │ │ │ ├── Enumeration.txt │ │ │ ├── Extensions.txt │ │ │ ├── Functions.txt │ │ │ ├── GenericProperties.txt │ │ │ ├── GenericType.txt │ │ │ ├── Initializers.txt │ │ │ ├── Literals.txt │ │ │ ├── Methods.txt │ │ │ ├── Operators.txt │ │ │ ├── Overloads.txt │ │ │ ├── Package.txt │ │ │ ├── Properties.txt │ │ │ ├── Protocol.txt │ │ │ ├── Shebang.txt │ │ │ ├── Structure.txt │ │ │ ├── Subclass.txt │ │ │ ├── Subscripts.txt │ │ │ ├── Subtype.txt │ │ │ ├── Unicode.txt │ │ │ └── WhereClauses.txt │ │ ├── Arbitrary Text │ │ │ ├── Attributes.txt │ │ │ ├── BaseClass.txt │ │ │ ├── Class.txt │ │ │ ├── ConditionalCompilation.txt │ │ │ ├── Conformance.txt │ │ │ ├── ControlFlow.txt │ │ │ ├── Documentation.txt │ │ │ ├── DocumentedExtension.txt │ │ │ ├── Enumeration.txt │ │ │ ├── Extensions.txt │ │ │ ├── Functions.txt │ │ │ ├── GenericProperties.txt │ │ │ ├── GenericType.txt │ │ │ ├── Initializers.txt │ │ │ ├── Literals.txt │ │ │ ├── Methods.txt │ │ │ ├── Operators.txt │ │ │ ├── Overloads.txt │ │ │ ├── Package.txt │ │ │ ├── Properties.txt │ │ │ ├── Protocol.txt │ │ │ ├── Shebang.txt │ │ │ ├── Structure.txt │ │ │ ├── Subclass.txt │ │ │ ├── Subscripts.txt │ │ │ ├── Subtype.txt │ │ │ ├── Unicode.txt │ │ │ └── WhereClauses.txt │ │ └── Invariable Text │ │ │ ├── Attributes.txt │ │ │ ├── BaseClass.txt │ │ │ ├── Class.txt │ │ │ ├── ConditionalCompilation.txt │ │ │ ├── Conformance.txt │ │ │ ├── ControlFlow.txt │ │ │ ├── Documentation.txt │ │ │ ├── DocumentedExtension.txt │ │ │ ├── Enumeration.txt │ │ │ ├── Extensions.txt │ │ │ ├── Functions.txt │ │ │ ├── GenericProperties.txt │ │ │ ├── GenericType.txt │ │ │ ├── Initializers.txt │ │ │ ├── Literals.txt │ │ │ ├── Methods.txt │ │ │ ├── Operators.txt │ │ │ ├── Overloads.txt │ │ │ ├── Package.txt │ │ │ ├── Properties.txt │ │ │ ├── Protocol.txt │ │ │ ├── Shebang.txt │ │ │ ├── Structure.txt │ │ │ ├── Subclass.txt │ │ │ ├── Subscripts.txt │ │ │ ├── Subtype.txt │ │ │ ├── Unicode.txt │ │ │ └── WhereClauses.txt │ └── Before │ │ ├── Attributes.swift │ │ ├── BaseClass.swift │ │ ├── Class.swift │ │ ├── ConditionalCompilation.swift │ │ ├── Conformance.swift │ │ ├── ControlFlow.swift │ │ ├── Documentation.swift │ │ ├── DocumentedExtension.swift │ │ ├── Enumeration.swift │ │ ├── Extensions.swift │ │ ├── Functions.swift │ │ ├── GenericProperties.swift │ │ ├── GenericType.swift │ │ ├── Initializers.swift │ │ ├── Literals.swift │ │ ├── Methods.swift │ │ ├── Operators.swift │ │ ├── Overloads.swift │ │ ├── Package.swift │ │ ├── Properties.swift │ │ ├── Protocol.swift │ │ ├── Shebang.swift │ │ ├── Structure.swift │ │ ├── Subclass.swift │ │ ├── Subscripts.swift │ │ ├── Subtype.swift │ │ ├── Unicode.swift │ │ └── WhereClauses.swift │ ├── Test Coverage │ ├── Source.swift │ └── Tests.swift │ └── Xcode │ ├── Build │ ├── appletvos.txt │ ├── appletvsimulator.txt │ ├── iphoneos.txt │ ├── iphonesimulator.txt │ ├── macosx.txt │ ├── watchos.txt │ └── watchsimulator.txt │ └── Test │ ├── appletvsimulator.txt │ ├── iphonesimulator.txt │ ├── macosx.txt │ └── watchsimulator.txt └── Workspace.swift /.github/ISSUE_TEMPLATE/🇨🇦EN Bug Report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: '🇨🇦EN Bug Report' 3 | about: 'Report a bug that needs fixing' 4 | title: '' 5 | labels: '🇬🇧🇺🇸🇨🇦EN, Bug, Needs Investigation' 6 | assignees: '' 7 | 8 | --- 9 | 10 | 15 | 16 | ### Description 17 | 18 | Such‐and‐such appears broken. 19 | 20 | ### Demonstration 21 | 22 | ```swift 23 | let thisCode = trigger(theBug) 24 | ``` 25 | 26 | 27 | 28 | ### Availability to Help 29 | 30 | 31 | I **would like to help** fix it, and I think **I know my way around**. 32 | I **would like to help** fix it, but **I would need some guidance**. 33 | I **would not like to help** fix it. 34 | 35 | ### Possible Solution 36 | 37 | It might work to do something like... 38 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/🇨🇦EN Documentation Correction.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: '🇨🇦EN Documentation Correction' 3 | about: 'Report something incorrect or unclear in the documentation' 4 | title: '' 5 | labels: '🇬🇧🇺🇸🇨🇦EN, Documentation, Needs Investigation' 6 | assignees: '' 7 | 8 | --- 9 | 10 | 15 | 16 | ### Description 17 | 18 | There appears to be a mistake in the documentation about such‐and‐such. 19 | 20 | ### Availability to Help 21 | 22 | 23 | I **would like to help** fix it, and I think **I know my way around**. 24 | I **would like to help** fix it, but **I would need some guidance**. 25 | I **would not like to help** fix it. 26 | 27 | ### Recommended Correction 28 | 29 | “It makes more sense written like this.” 30 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/🇨🇦EN Feature Request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: '🇨🇦EN Feature Request' 3 | about: 'Request a new feature that would be helpful' 4 | title: '' 5 | labels: '🇬🇧🇺🇸🇨🇦EN, Enhancement, Needs Investigation' 6 | assignees: '' 7 | 8 | --- 9 | 10 | 15 | 16 | ### Description 17 | 18 | Such‐and‐such would be a nice feature. 19 | 20 | ### Availability to Help 21 | 22 | 23 | I **would like to help** implement it, and I think **I know my way around**. 24 | I **would like to help** implement it, but **I would need some guidance**. 25 | I **would not like to help** implement it. 26 | 27 | ### Design Thoughts 28 | 29 | It might work to do something like... 30 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/🇨🇦EN Question.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: '🇨🇦EN Question' 3 | about: 'Ask a question' 4 | title: '' 5 | labels: '🇬🇧🇺🇸🇨🇦EN, Question' 6 | assignees: '' 7 | 8 | --- 9 | 10 | 15 | 16 | ### Question 17 | 18 | How can I do such‐and‐such? 19 | 20 | ### Documentation Suggestion 21 | 22 | 26 | 27 | I expected to find the answer under such‐and‐such. 28 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | This work was commissioned by an administrator in issue #000. 8 | 9 | 10 | I **am licensing** this under the [project licence](../blob/master/LICENSE.md). 11 | I **refuse to license** this under the [project licence](../blob/master/LICENSE.md). 12 | -------------------------------------------------------------------------------- /.github/workflows/Swift 5.7 (Amazon Linux).yaml: -------------------------------------------------------------------------------- 1 | # Swift 5.7 (Amazon Linux).yaml 2 | # 3 | # This source file is part of the SDGSwift open source project. 4 | # https://sdggiesbrecht.github.io/SDGSwift 5 | # 6 | # Copyright ©2021–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 7 | # 8 | # Soli Deo gloria. 9 | # 10 | # Licensed under the Apache Licence, Version 2.0. 11 | # See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 12 | 13 | name: Swift 5.7 (Amazon Linux) 14 | 15 | on: [push, pull_request] 16 | 17 | jobs: 18 | Swift_5_7_Amazon_Linux: 19 | name: Swift 5.7 (Amazon Linux) 20 | runs-on: ubuntu-20.04 21 | container: swift:5.7.3-amazonlinux2 22 | env: 23 | ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true 24 | steps: 25 | - name: Check out 26 | uses: actions/checkout@v2 27 | - name: Repair Git 28 | shell: bash 29 | run: | 30 | set -x 31 | git config --global --add safe.directory '*' 32 | - name: Install SwiftPM dependencies 33 | shell: bash 34 | run: | 35 | set -x 36 | yum install --assumeyes \ 37 | ncurses-devel \ 38 | sqlite-devel 39 | - name: Validate 40 | shell: bash 41 | run: | 42 | set -x 43 | swift test 44 | -------------------------------------------------------------------------------- /.github/workflows/Swift 5.7 (Ubuntu).yaml: -------------------------------------------------------------------------------- 1 | # Swift 5.7 (Ubuntu).yaml 2 | # 3 | # This source file is part of the SDGSwift open source project. 4 | # https://sdggiesbrecht.github.io/SDGSwift 5 | # 6 | # Copyright ©2021–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 7 | # 8 | # Soli Deo gloria. 9 | # 10 | # Licensed under the Apache Licence, Version 2.0. 11 | # See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 12 | 13 | name: Swift 5.7 (Ubuntu) 14 | 15 | on: [push, pull_request] 16 | 17 | jobs: 18 | Swift_5_7_Ubuntu: 19 | name: Swift 5.7 (Ubuntu) 20 | runs-on: ubuntu-20.04 21 | container: swift:5.7.3-focal 22 | steps: 23 | - name: Check out 24 | uses: actions/checkout@v2 25 | - name: Repair Git 26 | shell: bash 27 | run: | 28 | set -x 29 | git config --global --add safe.directory '*' 30 | - name: Install SwiftPM dependencies 31 | shell: bash 32 | run: | 33 | set -x 34 | apt-get update --assume-yes 35 | UCF_FORCE_CONFOLD=1 DEBIAN_FRONTEND=noninteractive \ 36 | apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" \ 37 | install --assume-yes \ 38 | libncurses-dev \ 39 | libsqlite3-dev 40 | - name: Validate 41 | shell: bash 42 | run: | 43 | set -x 44 | swift test 45 | -------------------------------------------------------------------------------- /.github/workflows/Swift 5.7 (Web).yaml: -------------------------------------------------------------------------------- 1 | # Swift 5.7 (Web).yaml 2 | # 3 | # This source file is part of the SDGSwift open source project. 4 | # https://sdggiesbrecht.github.io/SDGSwift 5 | # 6 | # Copyright ©2021–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 7 | # 8 | # Soli Deo gloria. 9 | # 10 | # Licensed under the Apache Licence, Version 2.0. 11 | # See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 12 | 13 | name: Swift 5.7 (Web) 14 | 15 | on: [push, pull_request] 16 | 17 | jobs: 18 | Swift_5_7_Web: 19 | name: Swift 5.7 (Web) 20 | runs-on: ubuntu-20.04 21 | container: ghcr.io/swiftwasm/carton:0.18.0 22 | steps: 23 | - name: Check out 24 | uses: actions/checkout@v2 25 | - name: Cache Workspace 26 | uses: actions/cache@v2 27 | with: 28 | key: Web‐${{ hashFiles('.github/workflows/**') }} 29 | path: .build/SDG/Workspace 30 | - name: Test 31 | shell: bash 32 | run: | 33 | set -x 34 | export TARGETING_WEB=true 35 | carton test 36 | -------------------------------------------------------------------------------- /.github/workflows/Swift 5.7 (Windows).yaml: -------------------------------------------------------------------------------- 1 | # Swift 5.7 (Windows).yaml 2 | # 3 | # This source file is part of the SDGSwift open source project. 4 | # https://sdggiesbrecht.github.io/SDGSwift 5 | # 6 | # Copyright ©2021–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 7 | # 8 | # Soli Deo gloria. 9 | # 10 | # Licensed under the Apache Licence, Version 2.0. 11 | # See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 12 | 13 | name: Swift 5.7 (Windows) 14 | 15 | on: [push, pull_request] 16 | 17 | jobs: 18 | Swift_5_7_Windows: 19 | name: Swift 5.7 (Windows) 20 | runs-on: windows-2019 21 | steps: 22 | - name: Check out 23 | uses: actions/checkout@v2 24 | - name: Cache Workspace 25 | uses: actions/cache@v2 26 | with: 27 | key: Windows‐${{ hashFiles('.github/workflows/**') }} 28 | path: .build/SDG/Workspace 29 | - name: Install Swift 30 | uses: compnerd/gha-setup-swift@v0.2.3 31 | with: 32 | branch: swift-5.7-release 33 | tag: 5.7-RELEASE 34 | - name: Test 35 | shell: cmd 36 | run: | 37 | echo on 38 | set TARGETING_WINDOWS=true 39 | swift test 40 | -------------------------------------------------------------------------------- /.github/workflows/Swift 5.7 (iOS).yaml: -------------------------------------------------------------------------------- 1 | # Swift 5.7 (iOS).yaml 2 | # 3 | # This source file is part of the SDGSwift open source project. 4 | # https://sdggiesbrecht.github.io/SDGSwift 5 | # 6 | # Copyright ©2021–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 7 | # 8 | # Soli Deo gloria. 9 | # 10 | # Licensed under the Apache Licence, Version 2.0. 11 | # See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 12 | 13 | name: Swift 5.7 (iOS) 14 | 15 | on: [push, pull_request] 16 | 17 | jobs: 18 | Swift_5_7_iOS: 19 | name: Swift 5.7 (iOS) 20 | runs-on: macos-12 21 | steps: 22 | - name: Check out 23 | uses: actions/checkout@v2 24 | - name: Set Xcode up 25 | shell: bash 26 | run: | 27 | set -x 28 | sudo xcode-select -switch /Applications/Xcode_14.0.app 29 | defaults write com.apple.dt.Xcode IDESkipPackagePluginFingerprintValidatation -bool YES 30 | xcodebuild -version 31 | swift --version 32 | - name: Validate 33 | shell: bash 34 | run: | 35 | set -x 36 | xcodebuild -resolvePackageDependencies 37 | xcodebuild build -destination 'generic/platform=iOS' -scheme SDGSwift-Package 38 | xcodebuild test -destination 'platform=iOS Simulator,name=iPhone 14' -scheme SDGSwift-Package 39 | -------------------------------------------------------------------------------- /.github/workflows/Swift 5.7 (macOS).yaml: -------------------------------------------------------------------------------- 1 | # Swift 5.7 (macOS).yaml 2 | # 3 | # This source file is part of the SDGSwift open source project. 4 | # https://sdggiesbrecht.github.io/SDGSwift 5 | # 6 | # Copyright ©2021–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 7 | # 8 | # Soli Deo gloria. 9 | # 10 | # Licensed under the Apache Licence, Version 2.0. 11 | # See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 12 | 13 | name: Swift 5.7 (macOS) 14 | 15 | on: [push, pull_request] 16 | 17 | jobs: 18 | Swift_5_7_macOS: 19 | name: Swift 5.7 (macOS) 20 | runs-on: macos-12 21 | steps: 22 | - name: Check out 23 | uses: actions/checkout@v2 24 | - name: Set Xcode up 25 | shell: bash 26 | run: | 27 | set -x 28 | sudo xcode-select -switch /Applications/Xcode_14.0.app 29 | defaults write com.apple.dt.Xcode IDESkipPackagePluginFingerprintValidatation -bool YES 30 | xcodebuild -version 31 | swift --version 32 | - name: Validate 33 | shell: bash 34 | run: | 35 | set -x 36 | swift test 37 | -------------------------------------------------------------------------------- /.github/workflows/Swift 5.7 (tvOS).yaml: -------------------------------------------------------------------------------- 1 | # Swift 5.7 (tvOS).yaml 2 | # 3 | # This source file is part of the SDGSwift open source project. 4 | # https://sdggiesbrecht.github.io/SDGSwift 5 | # 6 | # Copyright ©2021–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 7 | # 8 | # Soli Deo gloria. 9 | # 10 | # Licensed under the Apache Licence, Version 2.0. 11 | # See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 12 | 13 | name: Swift 5.7 (tvOS) 14 | 15 | on: [push, pull_request] 16 | 17 | jobs: 18 | Swift_5_7_tvOS: 19 | name: Swift 5.7 (tvOS) 20 | runs-on: macos-12 21 | steps: 22 | - name: Check out 23 | uses: actions/checkout@v2 24 | - name: Set Xcode up 25 | shell: bash 26 | run: | 27 | set -x 28 | sudo xcode-select -switch /Applications/Xcode_14.0.app 29 | defaults write com.apple.dt.Xcode IDESkipPackagePluginFingerprintValidatation -bool YES 30 | xcodebuild -version 31 | swift --version 32 | - name: Validate 33 | shell: bash 34 | run: | 35 | set -x 36 | xcodebuild -resolvePackageDependencies 37 | xcodebuild build -destination 'generic/platform=tvOS' -scheme SDGSwift-Package 38 | xcodebuild test -destination 'platform=tvOS Simulator,name=Apple TV 4K (2nd generation)' -scheme SDGSwift-Package 39 | -------------------------------------------------------------------------------- /.github/workflows/Swift 5.7 (watchOS).yaml: -------------------------------------------------------------------------------- 1 | # Swift 5.7 (watchOS).yaml 2 | # 3 | # This source file is part of the SDGSwift open source project. 4 | # https://sdggiesbrecht.github.io/SDGSwift 5 | # 6 | # Copyright ©2021–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 7 | # 8 | # Soli Deo gloria. 9 | # 10 | # Licensed under the Apache Licence, Version 2.0. 11 | # See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 12 | 13 | name: Swift 5.7 (watchOS) 14 | 15 | on: [push, pull_request] 16 | 17 | jobs: 18 | Swift_5_7_watchOS: 19 | name: Swift 5.7 (watchOS) 20 | runs-on: macos-12 21 | steps: 22 | - name: Check out 23 | uses: actions/checkout@v2 24 | - name: Set Xcode up 25 | shell: bash 26 | run: | 27 | set -x 28 | sudo xcode-select -switch /Applications/Xcode_14.0.app 29 | defaults write com.apple.dt.Xcode IDESkipPackagePluginFingerprintValidatation -bool YES 30 | xcodebuild -version 31 | swift --version 32 | - name: Validate 33 | shell: bash 34 | run: | 35 | set -x 36 | xcodebuild -resolvePackageDependencies 37 | xcodebuild build -destination 'generic/platform=watchOS' -scheme SDGSwift-Package 38 | xcodebuild test -destination 'platform=watchOS Simulator,name=Apple Watch Series 8 (41mm)' -scheme SDGSwift-Package 39 | -------------------------------------------------------------------------------- /.github/workflows/Web.yaml: -------------------------------------------------------------------------------- 1 | # Web.yaml 2 | # 3 | # This source file is part of the SDGSwift open source project. 4 | # https://sdggiesbrecht.github.io/SDGSwift 5 | # 6 | # Copyright ©2021–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 7 | # 8 | # Soli Deo gloria. 9 | # 10 | # Licensed under the Apache Licence, Version 2.0. 11 | # See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 12 | 13 | name: Web 14 | 15 | on: [push, pull_request] 16 | 17 | jobs: 18 | Web: 19 | name: Web 20 | runs-on: ubuntu-20.04 21 | container: ghcr.io/swiftwasm/carton:0.19.1 22 | steps: 23 | - name: Check out 24 | uses: actions/checkout@v3 25 | - name: Cache Workspace 26 | uses: actions/cache@v3 27 | with: 28 | key: Web‐${{ hashFiles('.github/workflows/**') }} 29 | path: .build/SDG/Workspace 30 | - name: Test 31 | shell: bash 32 | run: | 33 | set -x 34 | export TARGETING_WEB=true 35 | carton test 36 | -------------------------------------------------------------------------------- /.github/workflows/Windows.yaml: -------------------------------------------------------------------------------- 1 | # Windows.yaml 2 | # 3 | # This source file is part of the SDGSwift open source project. 4 | # https://sdggiesbrecht.github.io/SDGSwift 5 | # 6 | # Copyright ©2021–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 7 | # 8 | # Soli Deo gloria. 9 | # 10 | # Licensed under the Apache Licence, Version 2.0. 11 | # See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 12 | 13 | name: Windows 14 | 15 | on: [push, pull_request] 16 | 17 | jobs: 18 | Windows: 19 | name: Windows 20 | runs-on: windows-2019 21 | steps: 22 | - name: Check out 23 | uses: actions/checkout@v3 24 | - name: Cache Workspace 25 | uses: actions/cache@v3 26 | with: 27 | key: Windows‐${{ hashFiles('.github/workflows/**') }} 28 | path: .build/SDG/Workspace 29 | - name: Install Swift 30 | uses: compnerd/gha-setup-swift@v0.2.3 31 | with: 32 | branch: swift-5.8-release 33 | tag: 5.8-RELEASE 34 | - name: Test 35 | shell: cmd 36 | run: | 37 | echo on 38 | set TARGETING_WINDOWS=true 39 | swift test 40 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # .gitignore 2 | # 3 | # This source file is part of the SDGSwift open source project. 4 | # https://sdggiesbrecht.github.io/SDGSwift 5 | # 6 | # Copyright ©2018–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 7 | # 8 | # Soli Deo gloria. 9 | # 10 | # Licensed under the Apache Licence, Version 2.0. 11 | # See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 12 | 13 | .DS_Store 14 | *~ 15 | .build 16 | Packages 17 | .swiftpm 18 | Pr*fen\ (Linux).sh 19 | Pr*fen\ (macOS).command 20 | Validate\ (Linux).sh 21 | Validate\ (macOS).command 22 | *.xcodeproj 23 | IDEWorkspaceChecks.plist 24 | xcuserdata 25 | *.profraw 26 | -------------------------------------------------------------------------------- /Refresh (Linux).sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | 5 | set -e 6 | REPOSITORY="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 7 | cd "${REPOSITORY}" 8 | gnome-terminal -e "bash --login -c \"source ~/.bashrc; ./Refresh\ \(macOS\).command; exec bash\"" 9 | -------------------------------------------------------------------------------- /Refresh (macOS).command: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | 5 | set -e 6 | REPOSITORY="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 7 | cd "${REPOSITORY}" 8 | if workspace version > /dev/null 2>&1 ; then 9 | echo "Using system install of Workspace..." 10 | workspace refresh $1 $2 $3 $4 •use‐version 0.44.1 11 | elif ~/Library/Caches/ca.solideogloria.Workspace/Versions/0.44.1/workspace version > /dev/null 2>&1 ; then 12 | echo "Using system cache of Workspace..." 13 | ~/Library/Caches/ca.solideogloria.Workspace/Versions/0.44.1/workspace refresh $1 $2 $3 $4 •use‐version 0.44.1 14 | elif ~/.cache/ca.solideogloria.Workspace/Versions/0.44.1/workspace version > /dev/null 2>&1 ; then 15 | echo "Using system cache of Workspace..." 16 | ~/.cache/ca.solideogloria.Workspace/Versions/0.44.1/workspace refresh $1 $2 $3 $4 •use‐version 0.44.1 17 | elif .build/SDG/Workspace/workspace version > /dev/null 2>&1 ; then 18 | echo "Using repository cache of Workspace..." 19 | .build/SDG/Workspace/workspace refresh $1 $2 $3 $4 •use‐version 0.44.1 20 | else 21 | echo "No cached build detected; fetching Workspace..." 22 | export OVERRIDE_INSTALLATION_DIRECTORY=.build/SDG 23 | curl -sL https://gist.github.com/SDGGiesbrecht/4d76ad2f2b9c7bf9072ca1da9815d7e2/raw/update.sh | bash -s Workspace "https://github.com/SDGGiesbrecht/Workspace" 0.44.1 "" workspace 24 | .build/SDG/Workspace/workspace refresh $1 $2 $3 $4 •use‐version 0.44.1 25 | fi 26 | -------------------------------------------------------------------------------- /Sources/SDGSwift/PackageStructureBuildError.swift: -------------------------------------------------------------------------------- 1 | /* 2 | PackageStructureBuildError.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2019–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | import SDGText 16 | import SDGLocalization 17 | 18 | extension Package { 19 | 20 | /// An error encountered while building a Swift package. 21 | public enum BuildError: PresentableError { 22 | 23 | /// Git encountered an error. 24 | case gitError(VersionedExternalProcessExecutionError) 25 | 26 | /// Swift encountered an error. 27 | case swiftError(VersionedExternalProcessExecutionError) 28 | 29 | /// Foundation encountered an error. 30 | case foundationError(Swift.Error) 31 | 32 | // MARK: - PresentableError 33 | 34 | public func presentableDescription() -> StrictString { 35 | switch self { 36 | case .gitError(let error): 37 | return error.presentableDescription() 38 | case .swiftError(let error): 39 | return error.presentableDescription() 40 | case .foundationError(let error): 41 | return StrictString(error.localizedDescription) 42 | } 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Sources/SDGSwift/String/URL.swift: -------------------------------------------------------------------------------- 1 | /* 2 | URL.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2022–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | import Foundation 16 | 17 | extension URL { 18 | 19 | internal init(parsingOutput output: String) { 20 | // Taking only the last line ignores any preceding warnings. 21 | self.init(fileURLWithPath: output.lastLine()) 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Sources/SDGSwift/Test Coverage/FileTestCoverage.swift: -------------------------------------------------------------------------------- 1 | /* 2 | FileTestCoverage.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2018–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | import Foundation 16 | 17 | /// A test coverage report for a single file. 18 | public struct FileTestCoverage { 19 | 20 | // MARK: - Initialization 21 | 22 | /// Creates a test coverage report for a single file. 23 | /// 24 | /// - Parameters: 25 | /// - file: The URL of the corresponding file. 26 | /// - regions: The regions of the file. 27 | public init(file: URL, regions: [CoverageRegion]) { 28 | self.file = file 29 | self.regions = regions 30 | } 31 | 32 | // MARK: - Properties 33 | 34 | /// The URL of the corresponding file. 35 | public let file: URL 36 | 37 | /// The regions of the file. 38 | public let regions: [CoverageRegion] 39 | } 40 | -------------------------------------------------------------------------------- /Sources/SDGSwift/Test Coverage/TestCoverageReport.swift: -------------------------------------------------------------------------------- 1 | /* 2 | TestCoverageReport.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2018–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | /// A test coverage report. 16 | public struct TestCoverageReport { 17 | 18 | // MARK: - Initialization 19 | 20 | /// Creates a test coverage report. 21 | /// 22 | /// - Parameters: 23 | /// - files: The files in the package. 24 | public init(files: [FileTestCoverage]) { 25 | self.files = files 26 | } 27 | 28 | // MARK: - Properties 29 | 30 | /// The files in the package. 31 | public let files: [FileTestCoverage] 32 | } 33 | -------------------------------------------------------------------------------- /Sources/SDGSwift/Version.swift: -------------------------------------------------------------------------------- 1 | /* 2 | Version.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2021–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | import Foundation 16 | 17 | import SDGCollections 18 | 19 | import SDGExternalProcess 20 | import SDGVersioning 21 | 22 | extension Version { 23 | 24 | #if !PLATFORM_LACKS_FOUNDATION_PROCESS 25 | internal init?(inVersionQueryOutput versionQueryOutput: String, of tool: String) { 26 | var output = versionQueryOutput 27 | if tool == "swift" { 28 | if output.hasPrefix("swift\u{2D}driver") { 29 | // @exempt(from: tests) Does not occur on all platforms. 30 | output.drop(upTo: "Apple Swift version") 31 | } 32 | } 33 | self.init(firstIn: output) 34 | } 35 | #endif 36 | } 37 | -------------------------------------------------------------------------------- /Sources/SDGSwift/VersionedExternalProcessExecutionError.swift: -------------------------------------------------------------------------------- 1 | /* 2 | VersionedExternalProcessExecutionError.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2019–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | import SDGControlFlow 16 | import SDGText 17 | import SDGLocalization 18 | import SDGExternalProcess 19 | 20 | import SDGSwiftLocalizations 21 | 22 | /// An error encountered while using Git. 23 | public enum VersionedExternalProcessExecutionError: PresentableError 24 | where Process: VersionedExternalProcess { 25 | 26 | /// Git could not be located. 27 | case locationError(VersionedExternalProcessLocationError) 28 | 29 | /// Git encountered an error during its execution. 30 | case executionError(ExternalProcess.Error) 31 | 32 | // MARK: - PresentableError 33 | 34 | public func presentableDescription() -> StrictString { 35 | switch self { 36 | case .locationError(let error): 37 | return error.presentableDescription() 38 | case .executionError(let error): 39 | return error.presentableDescription() 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Sources/SDGSwiftConfiguration/Configuration.swift: -------------------------------------------------------------------------------- 1 | /* 2 | Configuration.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2018–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | /// An abstract superclass for a type representing an overall configuration. 16 | /// 17 | /// The concrete subclass is comparable to the `Package` type in a package manifest. 18 | open class Configuration: Decodable, Encodable { 19 | 20 | // MARK: - Static Properties 21 | 22 | internal static var registered: Configuration? 23 | 24 | // MARK: - Initialization 25 | 26 | /// Creates a configuration and registers it for export. 27 | /// 28 | /// The result of this initializer represents the default configuration, and will also be used if no configuration file exists. 29 | public required init() { 30 | Configuration.registered = self 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Sources/SDGSwiftConfiguration/Context.swift: -------------------------------------------------------------------------------- 1 | /* 2 | Context.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2018–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | import Foundation 16 | 17 | /// A context provided by the configuration loader. 18 | public protocol Context: Codable {} 19 | 20 | extension Context { 21 | 22 | /// Returns the context provided by the configuration loader. 23 | public static func accept() -> Self? { // @exempt(from: tests) Requires 0.1.10 24 | guard ProcessInfo.processInfo.arguments.count > 1 else { 25 | return nil 26 | } 27 | let json = ProcessInfo.processInfo.arguments[1] 28 | return (try? JSONDecoder().decode([Self].self, from: json.data(using: .utf8)!))?.first 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Sources/SDGSwiftConfiguration/Export.swift: -------------------------------------------------------------------------------- 1 | /* 2 | Export.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2018–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | import Foundation 16 | 17 | public func _exportConfiguration( 18 | file: StaticString = #fileID, 19 | line: UInt = #line 20 | ) { // @exempt(from: tests) 21 | // Testing occurs beyond the reach of coverage tracking. 22 | do { 23 | let json = try JSONEncoder().encode([Configuration.registered]) 24 | print(String(data: json, encoding: .utf8)!) 25 | } catch { 26 | fatalError(error.localizedDescription, file: file, line: line) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Sources/SDGSwiftConfigurationLoading/LegacyMode.swift: -------------------------------------------------------------------------------- 1 | /* 2 | LegacyMode.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2020–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | internal var legacyMode = false 16 | -------------------------------------------------------------------------------- /Sources/SDGSwiftConfigurationLoading/Package.swift.txt: -------------------------------------------------------------------------------- 1 | // swift-tools-version:[*tools version*] 2 | 3 | import PackageDescription 4 | 5 | let package = Package( 6 | name: "configure", 7 | platforms: [ 8 | .macOS(.v[*macOS*]) 9 | ], 10 | dependencies: [ 11 | .package([*package name*]url: "[*URL*]", .exact("[*version*]")), 12 | [*packages*], 13 | ], 14 | targets: [ 15 | .target( 16 | name: "configure", 17 | dependencies: [ 18 | [*product*], 19 | [*products*], 20 | ] 21 | ) 22 | ] 23 | ) 24 | -------------------------------------------------------------------------------- /Sources/SDGSwiftConfigurationLoading/Resources.swift: -------------------------------------------------------------------------------- 1 | /* 2 | Resources.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2018–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | import Foundation 16 | 17 | internal enum Resources {} 18 | internal typealias Ressourcen = Resources 19 | 20 | extension Resources { 21 | #if !os(WASI) 22 | internal static let moduleBundle: Bundle = { 23 | let main = Bundle.main.executableURL?.resolvingSymlinksInPath().deletingLastPathComponent() 24 | let module = main?.appendingPathComponent("SDGSwift_SDGSwiftConfigurationLoading.bundle") 25 | return module.flatMap({ Bundle(url: $0) }) ?? Bundle.module 26 | }() 27 | #endif 28 | 29 | } 30 | -------------------------------------------------------------------------------- /Sources/SDGSwiftDocumentation/Additions/SwiftSyntax/SourceLocation.swift: -------------------------------------------------------------------------------- 1 | /* 2 | SourceLocation.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2022–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | import SDGMathematics 16 | 17 | import SymbolKit 18 | import SwiftSyntax 19 | 20 | extension SourceLocation { 21 | 22 | internal static func convertLine(fromSymbolGraph line: Int) -> Int { 23 | return line + 1 24 | } 25 | internal static func convertColumn(fromSymbolGraphCharacter character: Int) -> Int { 26 | return character + 1 27 | } 28 | 29 | internal var symbolKitPosition: SymbolGraph.LineList.SourceRange.Position? { 30 | guard let line = self.line, 31 | let column = self.column 32 | else { 33 | return nil 34 | } 35 | return SymbolGraph.LineList.SourceRange.Position(line: line − 1, character: column − 1) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Sources/SDGSwiftDocumentation/Additions/SymbolDocumentation.swift: -------------------------------------------------------------------------------- 1 | /* 2 | SymbolDocumentation.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2022–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | import SymbolKit 16 | 17 | /// Symbol documentation. 18 | public struct SymbolDocumentation { 19 | 20 | /// Creates symbol documentation. 21 | /// 22 | /// - Parameters: 23 | /// - developerComments: Any preceding developer comments. 24 | /// - documentationComment: The documentation comment itself. 25 | public init( 26 | developerComments: SymbolGraph.LineList, 27 | documentationComment: SymbolGraph.LineList 28 | ) { 29 | self.developerComments = developerComments 30 | self.documentationComment = documentationComment 31 | } 32 | 33 | // MARK: - Properties 34 | 35 | /// Any developer line comments preceding the documentation. 36 | /// 37 | /// These are included for use by custom tools that wish to extend the documentation functionality directly supported by Swift. 38 | public var developerComments: SymbolGraph.LineList 39 | 40 | /// The documentation itself. 41 | public var documentationComment: SymbolGraph.LineList 42 | } 43 | -------------------------------------------------------------------------------- /Sources/SDGSwiftDocumentation/LoadedSymbolGraph.swift: -------------------------------------------------------------------------------- 1 | /* 2 | LoadedSymbolGraph.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2023–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | import Foundation 16 | 17 | import SymbolKit 18 | 19 | /// A symbol graph loaded from a file system. 20 | public struct LoadedSymbolGraph { 21 | 22 | // MARK: - Initialization 23 | 24 | /// Creates a loaded symbol graph. 25 | /// 26 | /// - Parameters: 27 | /// - graph: The graph. 28 | /// - origin: The URL from which the graph was loaded. 29 | public init(graph: SymbolGraph, origin: URL) { 30 | self.graph = graph 31 | self.origin = origin 32 | } 33 | 34 | // MARK: - Properties 35 | 36 | /// The symbol graph. 37 | public let graph: SymbolGraph 38 | /// The URL from which the graph originated. 39 | public let origin: URL 40 | } 41 | -------------------------------------------------------------------------------- /Sources/SDGSwiftDocumentation/SwiftPM/Package.swift: -------------------------------------------------------------------------------- 1 | /* 2 | Package.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2022–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | import Foundation 16 | 17 | import SDGCollections 18 | 19 | #if !PLATFORM_NOT_SUPPORTED_BY_SWIFT_PM 20 | import PackageModel 21 | 22 | extension Package { 23 | 24 | internal func publicModules() -> [Target] { 25 | let publicModules = manifest.publicModules() 26 | return targets.filter({ $0.name ∈ publicModules }) 27 | } 28 | 29 | internal func publicModuleSources() -> [String: [URL]] { 30 | return Dictionary( 31 | publicModules().map({ module in 32 | return ( 33 | module.name, 34 | module.sources.paths.lazy.map({ URL(fileURLWithPath: $0.pathString) }) 35 | ) 36 | }), 37 | uniquingKeysWith: { first, _ in first } // @exempt(from: tests) 38 | ) 39 | } 40 | } 41 | #endif 42 | -------------------------------------------------------------------------------- /Sources/SDGSwiftDocumentation/SymbolKit/SymbolGraph.Symbol.Names.swift: -------------------------------------------------------------------------------- 1 | /* 2 | SymbolGraph.Symbol.Names.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2022–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | import SDGMathematics 16 | 17 | import SymbolKit 18 | 19 | internal struct ComparableNames: Comparable { 20 | 21 | // MARK: - Properties 22 | 23 | internal var names: SymbolGraph.Symbol.Names 24 | 25 | // MARK: - Comparable 26 | 27 | internal static func < (lhs: ComparableNames, rhs: ComparableNames) -> Bool { 28 | return compare( 29 | lhs, 30 | rhs, 31 | by: { $0.names.title }, 32 | { $0.names.navigator?.map({ $0.spelling }).joined() ?? $0.names.title }, 33 | { $0.names.subHeading?.map({ $0.spelling }).joined() ?? $0.names.title }, 34 | { $0.names.prose ?? $0.names.title } 35 | ) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Sources/SDGSwiftDocumentation/SymbolKit/SymbolGraph.swift: -------------------------------------------------------------------------------- 1 | /* 2 | SymbolGraph.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2022–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | import Foundation 16 | 17 | import SDGPersistence 18 | 19 | import SymbolKit 20 | 21 | extension SymbolGraph: FileConvertible { 22 | 23 | // MARK: - FileConvertible 24 | 25 | public init( 26 | file: Data, 27 | origin: URL? 28 | ) throws { // @exempt(from: tests) Nothing to load on tvOS. 29 | self = try JSONDecoder().decode(Self.self, from: file) 30 | } 31 | 32 | public var file: Data { // @exempt(from: tests) Upstream encoding conformance broken. 33 | return try! JSONEncoder().encode(self) 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Sources/SDGSwiftLocalizations/APILocalization.swift: -------------------------------------------------------------------------------- 1 | /* 2 | APILocalization.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2018–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | import SDGLocalization 16 | 17 | public enum APILocalization: String, CaseIterable, InputLocalization { 18 | 19 | // MARK: - Cases 20 | 21 | case englishCanada = "en\u{2D}CA" 22 | 23 | // MARK: - Localization 24 | 25 | public static let fallbackLocalization: APILocalization = .englishCanada 26 | } 27 | -------------------------------------------------------------------------------- /Sources/SDGSwiftLocalizations/InterfaceLocalization.swift: -------------------------------------------------------------------------------- 1 | /* 2 | InterfaceLocalization.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2018–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | import SDGLocalization 16 | 17 | public enum InterfaceLocalization: String, CaseIterable, InputLocalization { 18 | 19 | // MARK: - Cases 20 | 21 | case englishUnitedKingdom = "en\u{2D}GB" 22 | case englishUnitedStates = "en\u{2D}US" 23 | case englishCanada = "en\u{2D}CA" 24 | 25 | case deutschDeutschland = "de\u{2D}DE" 26 | 27 | // MARK: - Localization 28 | 29 | public static let fallbackLocalization: InterfaceLocalization = .englishUnitedKingdom 30 | } 31 | -------------------------------------------------------------------------------- /Sources/SDGSwiftPackageManager/PackageRepositoryInitializationError.swift: -------------------------------------------------------------------------------- 1 | /* 2 | PackageRepositoryInitializationError.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2019–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | import SDGText 16 | import SDGLocalization 17 | 18 | import SDGSwift 19 | 20 | extension PackageRepository { 21 | 22 | /// An error encountered while initializing a package repository. 23 | public enum InitializationError: PresentableError { 24 | 25 | /// The package manager encountered an error. 26 | case packageManagerError(Swift.Error) 27 | 28 | /// Git encountered an error. 29 | case gitError(VersionedExternalProcessExecutionError) 30 | 31 | // MARK: - PresentableError 32 | 33 | public func presentableDescription() -> StrictString { 34 | switch self { 35 | case .packageManagerError(let error): 36 | return StrictString(error.localizedDescription) 37 | case .gitError(let error): 38 | return error.presentableDescription() 39 | } 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Sources/SDGSwiftSource/Scanners/ClosureSyntaxScanner.swift: -------------------------------------------------------------------------------- 1 | /* 2 | ClosureSyntaxScanner.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2023–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | internal struct ClosureSyntaxScanner: SyntaxScanner { 16 | 17 | // MARK: - Initialization 18 | internal init( 19 | _ visitNode: @escaping (SyntaxNode, ScanContext) -> Bool 20 | ) { 21 | self.visitNode = visitNode 22 | } 23 | 24 | // MARK: - Properties 25 | 26 | private let visitNode: (SyntaxNode, ScanContext) -> Bool 27 | 28 | // MARK: - SyntaxScanner 29 | 30 | internal func visit(_ node: SyntaxNode, context: ScanContext) -> Bool { 31 | return visitNode(node, context) 32 | } 33 | 34 | internal var cache: ParserCache = ParserCache() 35 | } 36 | -------------------------------------------------------------------------------- /Sources/SDGSwiftSource/Scanners/ParentRelationship.swift: -------------------------------------------------------------------------------- 1 | /* 2 | ParentRelationship.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2023–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | /// A relationship between a parent node and one of its child nodes. 16 | public struct ParentRelationship { 17 | 18 | // MARK: - Initialization 19 | 20 | internal init(node: SyntaxNode, childIndex: Int) { 21 | if let any = node as? AnySyntaxNode { 22 | self.node = any.wrapped 23 | } else { 24 | self.node = node 25 | } 26 | self.childIndex = childIndex 27 | } 28 | 29 | // MARK: - Properties 30 | 31 | /// The parent node. 32 | public let node: SyntaxNode 33 | 34 | /// The index of the child among the parent’s children. 35 | public let childIndex: Int 36 | } 37 | -------------------------------------------------------------------------------- /Sources/SDGSwiftSource/SwiftSyntax/FunctionParameterSyntax.swift: -------------------------------------------------------------------------------- 1 | /* 2 | FunctionParameterSyntax.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2023–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | import SwiftSyntax 16 | 17 | extension FunctionParameterSyntax { 18 | 19 | /// The internal name of the parameter. 20 | public var internalName: TokenSyntax? { 21 | if secondName?.presence == .present { 22 | return secondName 23 | } else { 24 | return firstName 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Sources/SDGSwiftSource/Syntax/Concrete Nodes/AnySyntaxNode.swift: -------------------------------------------------------------------------------- 1 | /* 2 | AnySyntaxNode.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2023–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | /// A type‐erased syntax node. 16 | public struct AnySyntaxNode: SyntaxNode { 17 | 18 | // MARK: - Initialization 19 | 20 | /// Creates a type‐erased syntax node. 21 | /// 22 | /// - Parameters: 23 | /// - wrapped: The syntax node to type‐erase. 24 | public init(_ wrapped: SyntaxNode) { 25 | self.wrapped = wrapped 26 | } 27 | 28 | // MARK: - Properties 29 | 30 | /// The wrapped syntax node. 31 | public let wrapped: SyntaxNode 32 | 33 | // MARK: - SyntaxNode 34 | 35 | public func children(cache: inout ParserCache) -> [SyntaxNode] { 36 | return wrapped.children(cache: &cache) 37 | } 38 | 39 | // MARK: - TextOutputStreamable 40 | 41 | public func write(to target: inout Target) where Target: TextOutputStream { 42 | wrapped.write(to: &target) 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Sources/SDGSwiftSource/Syntax/Concrete Nodes/DocumentationContentSyntax.swift: -------------------------------------------------------------------------------- 1 | /* 2 | DocumentationContentSyntax.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2023–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | #if !PLATFORM_NOT_SUPPORTED_BY_SWIFT_MARKDOWN 16 | import Markdown 17 | #endif 18 | 19 | /// Documentation. 20 | public struct DocumentationContent: BlockCommentContentProtocol, LineCommentContentProtocol, 21 | SyntaxNode 22 | { 23 | 24 | // MARK: - Properties 25 | 26 | /// The source of the documentation content. 27 | public let source: String 28 | 29 | // MARK: - LineCommentContentProtocol 30 | 31 | public init(source: String) { 32 | self.source = source 33 | } 34 | 35 | // MARK: - SyntaxNode 36 | 37 | public func children(cache: inout ParserCache) -> [SyntaxNode] { 38 | return [cache.parse(markdown: source)] 39 | } 40 | 41 | // MARK: - TextOutputStreamable 42 | 43 | public func write(to target: inout Target) where Target: TextOutputStream { 44 | source.write(to: &target) 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Sources/SDGSwiftSource/Syntax/Concrete Nodes/LineComment.swift: -------------------------------------------------------------------------------- 1 | /* 2 | LineComment.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2023–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | /// A line comment. 16 | public struct LineComment: LineCommentProtocol, SyntaxNode { 17 | 18 | // MARK: - Initialization 19 | 20 | /// Parses a line comment. 21 | /// 22 | /// - Parameters: 23 | /// - source: The source. 24 | public init?(source: String) { 25 | guard 26 | let parsed = Self.parse( 27 | precedingContentContext: "", 28 | source: source, 29 | followingContentContext: "" 30 | ) 31 | else { 32 | return nil 33 | } 34 | (self.delimiter, self.indent, self.content) = parsed 35 | } 36 | 37 | // MARK: - Properties 38 | 39 | /// The delimiter. 40 | public let delimiter: Token 41 | 42 | /// The indent. 43 | public let indent: Token? 44 | 45 | /// The content. 46 | public let content: Fragment 47 | 48 | // MARK: - LineCommentSyntaxProtocol 49 | 50 | internal static var delimiter: Token.Kind { 51 | return .lineCommentDelimiter 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Sources/SDGSwiftSource/Syntax/Concrete Nodes/Markdown/EmphasisNode.swift: -------------------------------------------------------------------------------- 1 | /* 2 | EmphasisNode.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2023–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | /// The application of an emphatic font to documentation text. 16 | public struct EmphasisNode: FontNodeWithInternals { 17 | 18 | // MARK: - Properties 19 | 20 | public let openingDelimiter: Token 21 | public let contents: [SyntaxNode] 22 | public let closingDelimiter: Token 23 | 24 | // MARK: - FontNodeWithInternals 25 | 26 | internal static func makeDelimiterKind(_ source: String) -> Token.Kind { 27 | return .emphasisDelimiter(source) 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Sources/SDGSwiftSource/Syntax/Concrete Nodes/Markdown/LinkContent.swift: -------------------------------------------------------------------------------- 1 | /* 2 | LinkContent.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2023–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | /// The content portion of link in documentation. 16 | public struct LinkContent: StreamedViaChildren, SyntaxNode { 17 | 18 | // MARK: - Properties 19 | 20 | /// The opening delimiter. 21 | public let openingDelimiter: Token 22 | 23 | /// The content. 24 | public let contents: [SyntaxNode] 25 | 26 | /// The closing delimiter. 27 | public let closingDelimiter: Token 28 | 29 | // MARK: - StreamedViaChildren 30 | 31 | internal var storedChildren: [SyntaxNode] { 32 | var children: [SyntaxNode] = [openingDelimiter] 33 | children.append(contentsOf: contents) 34 | children.append(closingDelimiter) 35 | return children 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Sources/SDGSwiftSource/Syntax/Concrete Nodes/Markdown/LinkTarget.swift: -------------------------------------------------------------------------------- 1 | /* 2 | LinkTarget.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2023–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | /// The target portion of link in documentation. 16 | public struct LinkTarget: StreamedViaChildren, SyntaxNode { 17 | 18 | // MARK: - Properties 19 | 20 | /// The opening delimiter. 21 | public let openingDelimiter: Token 22 | 23 | /// The target URL. 24 | public let target: Token 25 | 26 | /// The closing delimiter. 27 | public let closingDelimiter: Token 28 | 29 | // MARK: - StreamedViaChildren 30 | 31 | internal var storedChildren: [SyntaxNode] { 32 | return [openingDelimiter, target, closingDelimiter] 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Sources/SDGSwiftSource/Syntax/Concrete Nodes/Markdown/ParagraphNode.swift: -------------------------------------------------------------------------------- 1 | /* 2 | ParagraphNode.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2023–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | /// A paragraph in documentation. 16 | public struct ParagraphNode: StreamedViaChildren, SyntaxNode { 17 | 18 | // MARK: - Initialization 19 | 20 | internal init(components: [SyntaxNode]) { 21 | self.contents = components 22 | } 23 | 24 | // MARK: - Properties 25 | 26 | /// The contents of the paragraph. 27 | public let contents: [SyntaxNode] 28 | 29 | // MARK: - StreamedViaChildren 30 | 31 | internal var storedChildren: [SyntaxNode] { 32 | return contents 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Sources/SDGSwiftSource/Syntax/Concrete Nodes/Markdown/StrongNode.swift: -------------------------------------------------------------------------------- 1 | /* 2 | StrongNode.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2023–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | /// The application of a strong font to documentation text. 16 | public struct StrongNode: FontNodeWithInternals { 17 | 18 | // MARK: - Properties 19 | 20 | public let openingDelimiter: Token 21 | public let contents: [SyntaxNode] 22 | public let closingDelimiter: Token 23 | 24 | // MARK: - FontNodeWithInternals 25 | 26 | internal static func makeDelimiterKind(_ source: String) -> Token.Kind { 27 | return .strengthDelimiter(source) 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Sources/SDGSwiftSource/Syntax/Concrete Nodes/SourceHeading.swift: -------------------------------------------------------------------------------- 1 | /* 2 | SourceHeading.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2023–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | /// A heading in source code. 16 | public struct SourceHeading: StreamedViaChildren, SyntaxNode { 17 | 18 | // MARK: - Static Properties 19 | 20 | /// The fullest form of delimiter. 21 | public static let fullDelimiter: String = "MARK: \u{2D} " 22 | internal static let minimalDelimiter: String = "MARK:" 23 | 24 | // MARK: - Initialization 25 | 26 | internal init( 27 | mark: Token, 28 | heading: Token 29 | ) { 30 | self.mark = mark 31 | self.heading = heading 32 | } 33 | 34 | // MARK: - Properties 35 | 36 | /// The delimiter. 37 | public let mark: Token 38 | 39 | /// The heading. 40 | public let heading: Token 41 | 42 | // MARK: - StreamedViaChildren 43 | 44 | internal var storedChildren: [SyntaxNode] { 45 | return [mark, heading] 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Sources/SDGSwiftSource/Syntax/Concrete Nodes/Token.swift: -------------------------------------------------------------------------------- 1 | /* 2 | Token.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2023–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | /// A syntax node representing a single token. 16 | public struct Token: SyntaxNode { 17 | 18 | internal static func unknown(_ source: String) -> Token { 19 | return Token(kind: .swiftSyntax(.unknown(source))) 20 | } 21 | 22 | // MARK: - Initialization 23 | 24 | /// Creates a token. 25 | /// 26 | /// - Parameters: 27 | /// - kind: The kind of token. 28 | public init(kind: Kind) { 29 | self.kind = kind 30 | } 31 | 32 | // MARK: - Properties 33 | 34 | /// The kind of token. 35 | public let kind: Kind 36 | 37 | // MARK: - SyntaxNode 38 | 39 | public func children(cache: inout ParserCache) -> [SyntaxNode] { 40 | return [] 41 | } 42 | 43 | // MARK: - TextOutputStreamable 44 | 45 | public func write( 46 | to target: inout Target 47 | ) where Target: TextOutputStream { 48 | kind.text.write(to: &target) 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Sources/SDGSwiftSource/Syntax/Protocols/BlockCommentContentProtocol.swift: -------------------------------------------------------------------------------- 1 | /* 2 | BlockCommentContentProtocol.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2023–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | /// Functionality shared by line comment content and documentation comment content. 16 | internal protocol BlockCommentContentProtocol: SyntaxNode { 17 | 18 | /// Parses block comment content from source. 19 | /// 20 | /// - Parameters: 21 | /// - source: The source. 22 | init(source: String) 23 | } 24 | -------------------------------------------------------------------------------- /Sources/SDGSwiftSource/Syntax/Protocols/FragmentProtocol.swift: -------------------------------------------------------------------------------- 1 | /* 2 | FragmentProtocol.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2023–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | internal protocol FragmentProtocol { 16 | 17 | func localAncestorsOfChild( 18 | at index: Int, 19 | cache: inout ParserCache 20 | ) -> [ParentRelationship] 21 | } 22 | -------------------------------------------------------------------------------- /Sources/SDGSwiftSource/Syntax/Protocols/LineCommentContentProtocol.swift: -------------------------------------------------------------------------------- 1 | /* 2 | LineCommentContentProtocol.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2023–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | /// Functionality shared by line comment content and documentation comment content. 16 | internal protocol LineCommentContentProtocol: SyntaxNode { 17 | init(source: String) 18 | } 19 | -------------------------------------------------------------------------------- /Sources/SDGSwiftSource/Syntax/Protocols/MarkdownHeading.swift: -------------------------------------------------------------------------------- 1 | /* 2 | MarkdownHeading.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2023–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | /// A Markdown heading. 16 | public protocol MarkdownHeading: SyntaxNode { 17 | 18 | /// The heading text. 19 | var heading: [SyntaxNode] { get } 20 | 21 | /// The heading level. 22 | var level: Int { get } 23 | } 24 | -------------------------------------------------------------------------------- /Sources/SDGSwiftSource/Syntax/Protocols/StreamedViaChildren.swift: -------------------------------------------------------------------------------- 1 | /* 2 | StreamedViaChildren.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2023–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | internal protocol StreamedViaChildren: SyntaxNode { 16 | var storedChildren: [SyntaxNode] { get } 17 | } 18 | 19 | extension StreamedViaChildren { 20 | 21 | // MARK: - SyntaxNode 22 | 23 | public func children(cache: inout ParserCache) -> [SyntaxNode] { 24 | return storedChildren 25 | } 26 | 27 | // MARK: - TextOutputStreamable 28 | 29 | public func write(to target: inout Target) where Target: TextOutputStream { 30 | for child in storedChildren { 31 | child.write(to: &target) 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Sources/SDGSwiftSource/TextFreedom.swift: -------------------------------------------------------------------------------- 1 | /* 2 | TextFreedom.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2018–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | /// How much freedom the user has in choosing the text of the element. 16 | public enum TextFreedom: Sendable { 17 | 18 | // MARK: - Cases 19 | 20 | /// The user can choose any arbitrary text, (but may still be subject to minor syntax restrictions). 21 | /// 22 | /// Examples include comments, documentation or declaration names. 23 | case arbitrary 24 | 25 | /// The user can rename the element using some form of alias. 26 | /// 27 | /// Examples include type references, function calls or variable uses. 28 | case aliasable 29 | 30 | /// The element is invariable. 31 | /// 32 | /// Examples include keywords, the braces around closures or the parentheses around function arguments. 33 | case invariable 34 | } 35 | -------------------------------------------------------------------------------- /Sources/SampleConfiguration/SampleContext.swift: -------------------------------------------------------------------------------- 1 | /* 2 | SampleContext.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2018–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | import SDGSwiftConfiguration 16 | 17 | /// A sample configuration context. 18 | public struct SampleContext: Context { 19 | 20 | // MARK: - Static Properties 21 | 22 | /// The context received from the configuration loader. 23 | public static var context: SampleContext? = SampleContext.accept() 24 | 25 | // MARK: - Initialization 26 | 27 | /// Creates the context. 28 | /// 29 | /// - Parameters: 30 | /// - information: Context information to be supplied. 31 | public init(information: String) { 32 | self.information = information 33 | } 34 | 35 | // MARK: - Properties 36 | 37 | /// Sample context information. 38 | public var information: String 39 | } 40 | -------------------------------------------------------------------------------- /Tests/Mock Projects/Dependency/Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:4.2 2 | 3 | /* 4 | Package.swift 5 | 6 | This source file is part of the SDGSwift open source project. 7 | https://sdggiesbrecht.github.io/SDGSwift 8 | 9 | Copyright ©2019–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 10 | 11 | Soli Deo gloria. 12 | 13 | Licensed under the Apache Licence, Version 2.0. 14 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 15 | */ 16 | 17 | import PackageDescription 18 | 19 | let package = Package( 20 | name: "Dependency", 21 | products: [ 22 | .library(name: "Dependency", targets: ["Dependency"]) 23 | ], 24 | targets: [ 25 | .target(name: "Dependency") 26 | ] 27 | ) 28 | -------------------------------------------------------------------------------- /Tests/Mock Projects/Dependency/Sources/Dependency/Dependency.swift: -------------------------------------------------------------------------------- 1 | /* 2 | Dependency.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2019–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | public protocol SubDependencyProtocol {} 16 | extension SubDependencyProtocol { 17 | public func inherited() {} 18 | } 19 | 20 | public protocol DependencyProtocol: SubDependencyProtocol { 21 | func requirement() 22 | } 23 | extension DependencyProtocol { 24 | public func provision() {} 25 | } 26 | -------------------------------------------------------------------------------- /Tests/Mock Projects/Dependency2/Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:4.2 2 | 3 | /* 4 | Package.swift 5 | 6 | This source file is part of the SDGSwift open source project. 7 | https://sdggiesbrecht.github.io/SDGSwift 8 | 9 | Copyright ©2019–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 10 | 11 | Soli Deo gloria. 12 | 13 | Licensed under the Apache Licence, Version 2.0. 14 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 15 | */ 16 | 17 | import PackageDescription 18 | 19 | let package = Package( 20 | name: "Dependency2", 21 | products: [ 22 | .library(name: "Dependency2", targets: ["Dependency2"]) 23 | ], 24 | targets: [ 25 | .target(name: "Dependency2") 26 | ] 27 | ) 28 | -------------------------------------------------------------------------------- /Tests/Mock Projects/Dependency2/Sources/Dependency2/Dependency.swift: -------------------------------------------------------------------------------- 1 | /* 2 | Dependency.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2019–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | public func irrelevant() {} 16 | -------------------------------------------------------------------------------- /Tests/Mock Projects/DependentOnWarnings/Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:5.0 2 | 3 | /* 4 | Package.swift 5 | 6 | This source file is part of the SDGSwift open source project. 7 | https://sdggiesbrecht.github.io/SDGSwift 8 | 9 | Copyright ©2019–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 10 | 11 | Soli Deo gloria. 12 | 13 | Licensed under the Apache Licence, Version 2.0. 14 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 15 | */ 16 | 17 | import PackageDescription 18 | 19 | let package = Package( 20 | name: "Dependent On Warnings", 21 | products: [ 22 | .library( 23 | name: "DependentOnWarnings", 24 | targets: ["DependentOnWarnings"] 25 | ) 26 | ], 27 | dependencies: [ 28 | .package(url: "/tmp/Warnings", .branch("master")) 29 | ], 30 | targets: [ 31 | .target( 32 | name: "DependentOnWarnings", 33 | dependencies: ["Warnings"] 34 | ) 35 | ] 36 | ) 37 | -------------------------------------------------------------------------------- /Tests/Mock Projects/DependentOnWarnings/Sources/DependentOnWarnings/DependentOnWarnings.swift: -------------------------------------------------------------------------------- 1 | /* 2 | DependentOnWarnings.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2019–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | import Warnings 16 | public struct DependentOnWarnings { 17 | public var text: String = Warnings.text 18 | } 19 | -------------------------------------------------------------------------------- /Tests/Mock Projects/DynamicLibraryA/Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:4.1 2 | 3 | /* 4 | Package.swift 5 | 6 | This source file is part of the SDGSwift open source project. 7 | https://sdggiesbrecht.github.io/SDGSwift 8 | 9 | Copyright ©2018–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 10 | 11 | Soli Deo gloria. 12 | 13 | Licensed under the Apache Licence, Version 2.0. 14 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 15 | */ 16 | 17 | import PackageDescription 18 | 19 | let package = Package( 20 | name: "DynamicLibraryA", 21 | products: [ 22 | .library(name: "LibraryA", type: .dynamic, targets: ["LibraryA"]) 23 | ], 24 | targets: [ 25 | .target( 26 | name: "LibraryA", 27 | dependencies: [] 28 | ) 29 | ] 30 | ) 31 | -------------------------------------------------------------------------------- /Tests/Mock Projects/DynamicLibraryA/Sources/LibraryA/LibraryA.swift: -------------------------------------------------------------------------------- 1 | /* 2 | LibraryA.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2018–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | public func libraryA() -> String { 16 | return "Hello, world!" 17 | } 18 | -------------------------------------------------------------------------------- /Tests/Mock Projects/DynamicLibraryB/Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:4.1 2 | 3 | /* 4 | Package.swift 5 | 6 | This source file is part of the SDGSwift open source project. 7 | https://sdggiesbrecht.github.io/SDGSwift 8 | 9 | Copyright ©2018–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 10 | 11 | Soli Deo gloria. 12 | 13 | Licensed under the Apache Licence, Version 2.0. 14 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 15 | */ 16 | 17 | import PackageDescription 18 | 19 | let package = Package( 20 | name: "DynamicLibraryB", 21 | products: [ 22 | .library(name: "LibraryB", type: .dynamic, targets: ["LibraryB"]) 23 | ], 24 | dependencies: [ 25 | .package(url: "/tmp/DynamicLibraryA", .branch("master")) 26 | ], 27 | targets: [ 28 | .target( 29 | name: "LibraryB", 30 | dependencies: ["LibraryA"] 31 | ) 32 | ] 33 | ) 34 | -------------------------------------------------------------------------------- /Tests/Mock Projects/DynamicLibraryB/Sources/LibraryB/LibraryB.swift: -------------------------------------------------------------------------------- 1 | /* 2 | LibraryB.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2018–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | import LibraryA 16 | 17 | public func libraryB() -> String { 18 | return libraryA() 19 | } 20 | -------------------------------------------------------------------------------- /Tests/Mock Projects/DynamicallyLinkedTool/Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:4.1 2 | 3 | /* 4 | Package.swift 5 | 6 | This source file is part of the SDGSwift open source project. 7 | https://sdggiesbrecht.github.io/SDGSwift 8 | 9 | Copyright ©2018–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 10 | 11 | Soli Deo gloria. 12 | 13 | Licensed under the Apache Licence, Version 2.0. 14 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 15 | */ 16 | 17 | import PackageDescription 18 | 19 | let package = Package( 20 | name: "DynamicallyLinkedTool", 21 | products: [ 22 | .executable(name: "tool", targets: ["tool"]) 23 | ], 24 | dependencies: [ 25 | .package(url: "/tmp/DynamicLibraryB", .branch("master")) 26 | ], 27 | targets: [ 28 | .target( 29 | name: "tool", 30 | dependencies: ["LibraryB"] 31 | ) 32 | ] 33 | ) 34 | -------------------------------------------------------------------------------- /Tests/Mock Projects/DynamicallyLinkedTool/Sources/tool/main.swift: -------------------------------------------------------------------------------- 1 | /* 2 | main.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2018–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | import Foundation 16 | 17 | import LibraryB 18 | 19 | if CommandLine.arguments.contains("fail") { 20 | print("Failed.") 21 | exit(1) 22 | } 23 | 24 | print(libraryB()) 25 | -------------------------------------------------------------------------------- /Tests/Mock Projects/MultipleArchitectures/Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:5.3 2 | 3 | /* 4 | Package.swift 5 | 6 | This source file is part of the SDGSwift open source project. 7 | https://sdggiesbrecht.github.io/SDGSwift 8 | 9 | Copyright ©2021–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 10 | 11 | Soli Deo gloria. 12 | 13 | Licensed under the Apache Licence, Version 2.0. 14 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 15 | */ 16 | 17 | import PackageDescription 18 | 19 | let package = Package( 20 | name: "MultipleArchitectures", 21 | targets: [ 22 | .target(name: "MultipleArchitectures") 23 | ] 24 | ) 25 | -------------------------------------------------------------------------------- /Tests/Mock Projects/MultipleArchitectures/Sources/MultipleArchitectures/MultipleArchitectures.swift: -------------------------------------------------------------------------------- 1 | /* 2 | MultipleArchitectures.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2021–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | let x: Float80 = 0 16 | -------------------------------------------------------------------------------- /Tests/Mock Projects/MultipleSchemes/Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:5.1 2 | 3 | /* 4 | Package.swift 5 | 6 | This source file is part of the SDGSwift open source project. 7 | https://sdggiesbrecht.github.io/SDGSwift 8 | 9 | Copyright ©2019–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 10 | 11 | Soli Deo gloria. 12 | 13 | Licensed under the Apache Licence, Version 2.0. 14 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 15 | */ 16 | 17 | import PackageDescription 18 | 19 | let package = Package( 20 | name: "SomePackage", 21 | products: [ 22 | .library(name: "SomeLibrary", targets: ["SomeLibrary"]), 23 | .library(name: "SomeOtherLibrary", targets: ["SomeOtherLibrary"]), 24 | ], 25 | targets: [ 26 | .target( 27 | name: "SomeLibrary" 28 | ), 29 | .target( 30 | name: "SomeOtherLibrary" 31 | ), 32 | .target( 33 | name: "some‐tool" 34 | ), 35 | .testTarget( 36 | name: "SomeTests", 37 | dependencies: [ 38 | "SomeLibrary" 39 | ] 40 | ), 41 | ] 42 | ) 43 | -------------------------------------------------------------------------------- /Tests/Mock Projects/MultipleSchemes/Sources/SomeLibrary/File.swift: -------------------------------------------------------------------------------- 1 | /* 2 | File.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2019–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | public func someFunction() {} 16 | -------------------------------------------------------------------------------- /Tests/Mock Projects/MultipleSchemes/Sources/SomeOtherLibrary/File.swift: -------------------------------------------------------------------------------- 1 | /* 2 | File.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2019–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | -------------------------------------------------------------------------------- /Tests/Mock Projects/MultipleSchemes/Sources/some‐tool/main.swift: -------------------------------------------------------------------------------- 1 | /* 2 | main.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2019–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | -------------------------------------------------------------------------------- /Tests/Mock Projects/MultipleSchemes/Tests/SomeTests/File.swift: -------------------------------------------------------------------------------- 1 | /* 2 | File.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2019–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | import SomeLibrary 16 | 17 | import XCTest 18 | 19 | final class SomeTests: XCTestCase { 20 | func testLibrary() { 21 | someFunction() 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Tests/Mock Projects/PackageToDocument/Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:4.2 2 | 3 | /* 4 | Package.swift 5 | 6 | This source file is part of the SDGSwift open source project. 7 | https://sdggiesbrecht.github.io/SDGSwift 8 | 9 | Copyright ©2018–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 10 | 11 | Soli Deo gloria. 12 | 13 | Licensed under the Apache Licence, Version 2.0. 14 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 15 | */ 16 | 17 | import PackageDescription 18 | 19 | /// Package documentation. 20 | let package = Package( 21 | name: "PackageToDocument", 22 | products: [ 23 | /// Library documentation. 24 | .library(name: "PrimaryProduct", targets: ["PrimaryModule"]), 25 | 26 | .executable(name: "executable", targets: ["executable"]), 27 | 28 | .library(name: "_Hidden", targets: ["Hidden"]), 29 | ], 30 | dependencies: [ 31 | .package(path: "../Dependency"), 32 | .package(path: "../Dependency2"), 33 | ], 34 | targets: [ 35 | .target(name: "executable"), 36 | 37 | /// Module documentation. 38 | .target(name: "PrimaryModule", dependencies: ["Dependency", "Dependency2", "Hidden"]), 39 | 40 | .target(name: "Hidden"), 41 | ] 42 | ) 43 | -------------------------------------------------------------------------------- /Tests/Mock Projects/PackageToDocument/Sources/Hidden/Hidden.swift: -------------------------------------------------------------------------------- 1 | /* 2 | Hidden.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2018–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | public func hidden() {} 16 | 17 | open class UnknownSuperclass { 18 | init() {} 19 | open func methodOverride() {} 20 | } 21 | -------------------------------------------------------------------------------- /Tests/Mock Projects/PackageToDocument/Sources/PrimaryModule/Bool.swift: -------------------------------------------------------------------------------- 1 | /* 2 | Bool.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2018–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | extension Bool { 16 | 17 | public var extensionProperty: Bool { 18 | return false 19 | } 20 | } 21 | 22 | extension Bool { // Separated 23 | 24 | public var propertyInASeparateExtension: Bool { 25 | return false 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Tests/Mock Projects/PackageToDocument/Sources/PrimaryModule/Class.swift: -------------------------------------------------------------------------------- 1 | /* 2 | Class.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2022–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | /// A class. 16 | public class Class { 17 | /// Deinitializes the instance. 18 | deinit {} 19 | } 20 | -------------------------------------------------------------------------------- /Tests/Mock Projects/PackageToDocument/Sources/PrimaryModule/Collection.swift: -------------------------------------------------------------------------------- 1 | /* 2 | Collection.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2019–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | public struct CollectionType: Collection { 16 | 17 | public typealias Index = Int 18 | public typealias Indices = DefaultIndices 19 | 20 | public var startIndex: Int { 21 | return 0 22 | } 23 | 24 | public var endIndex: Int { 25 | return 10 26 | } 27 | 28 | public func index(after i: Int) -> Int { 29 | return i + 1 30 | } 31 | 32 | public subscript(position: Int) -> Int { 33 | return position 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Tests/Mock Projects/PackageToDocument/Sources/PrimaryModule/Enumeration.swift: -------------------------------------------------------------------------------- 1 | /* 2 | Enumeration.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2018–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | public enum Enumeration { 16 | case _hidden 17 | case visible 18 | } 19 | -------------------------------------------------------------------------------- /Tests/Mock Projects/PackageToDocument/Sources/PrimaryModule/ExpressibleByStringInterpolation.swift: -------------------------------------------------------------------------------- 1 | /* 2 | ExpressibleByStringInterpolation.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2019–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | public struct TypeExpressibleByStringInterpolation: ExpressibleByStringInterpolation { 16 | public init(stringLiteral: String) {} 17 | public init(stringInterpolation: DefaultStringInterpolation) {} 18 | } 19 | -------------------------------------------------------------------------------- /Tests/Mock Projects/PackageToDocument/Sources/PrimaryModule/Function.swift: -------------------------------------------------------------------------------- 1 | /* 2 | Function.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2018–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | public func executeFunction() {} 16 | -------------------------------------------------------------------------------- /Tests/Mock Projects/PackageToDocument/Sources/PrimaryModule/GlobalVariable.swift: -------------------------------------------------------------------------------- 1 | /* 2 | GlobalVariable.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2018–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | public var globalVariable: Bool = false 16 | -------------------------------------------------------------------------------- /Tests/Mock Projects/PackageToDocument/Sources/PrimaryModule/Operator.swift: -------------------------------------------------------------------------------- 1 | /* 2 | Operator.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2018–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | /// These 16 | /// are 17 | /// several 18 | /// line 19 | /// comments 20 | /// describing 21 | /// the 22 | /// operator. 23 | infix operator ≠: Precedence 24 | 25 | // No documentation. 26 | infix operator ≤: Precedence 27 | 28 | /** 29 | This documentation comment is not attached to anything. 30 | */ 31 | /// This documentation comment is just one line. 32 | infix operator ≥: Precedence 33 | -------------------------------------------------------------------------------- /Tests/Mock Projects/PackageToDocument/Sources/PrimaryModule/Precedence.swift: -------------------------------------------------------------------------------- 1 | /* 2 | Precedence.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2018–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | /** 16 | This is a block comment describing the precedence group. 17 | */ 18 | precedencegroup Precedence { 19 | } 20 | -------------------------------------------------------------------------------- /Tests/Mock Projects/PackageToDocument/Sources/PrimaryModule/Protocol.swift: -------------------------------------------------------------------------------- 1 | /* 2 | Protocol.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2018–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | public protocol Protocol { 16 | /// A visible associated type. 17 | associatedtype VisibleAssociatedType 18 | associatedtype _HiddenAssociatedType 19 | } 20 | 21 | public protocol _HiddenProtocol {} 22 | -------------------------------------------------------------------------------- /Tests/Mock Projects/PackageToDocument/Sources/PrimaryModule/Structure.swift: -------------------------------------------------------------------------------- 1 | /* 2 | Structure.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2018–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | public struct Structure: Error { 16 | public static let staticProperty: Bool = false 17 | public static func staticMethod() {} 18 | public init() {} 19 | public let property: Bool = false 20 | public let _hiddenProperty: Int = 0 21 | public subscript(`subscript`: Int) -> Bool { return false } 22 | public func method() {} 23 | } 24 | -------------------------------------------------------------------------------- /Tests/Mock Projects/PackageToDocument/Sources/PrimaryModule/TypeAlias.swift: -------------------------------------------------------------------------------- 1 | /* 2 | TypeAlias.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2022–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | /// A type alias. 16 | public typealias TypeAlias = Bool 17 | -------------------------------------------------------------------------------- /Tests/Mock Projects/PackageToDocument/Sources/executable/main.swift: -------------------------------------------------------------------------------- 1 | /* 2 | main.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2018–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | print("Hello, world!") 16 | -------------------------------------------------------------------------------- /Tests/Mock Projects/PackageToDocument2/Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:4.2 2 | 3 | /* 4 | Package.swift 5 | 6 | This source file is part of the SDGSwift open source project. 7 | https://sdggiesbrecht.github.io/SDGSwift 8 | 9 | Copyright ©2018–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 10 | 11 | Soli Deo gloria. 12 | 13 | Licensed under the Apache Licence, Version 2.0. 14 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 15 | */ 16 | 17 | import PackageDescription 18 | 19 | /// Package documentation. 20 | let package = Package( 21 | name: "PackageToDocument2", 22 | products: [ 23 | /// Library documentation. 24 | .library(name: "PrimaryProduct", targets: ["PrimaryModule"]) 25 | ], 26 | targets: [ 27 | /// Module documentation. 28 | .target(name: "PrimaryModule", dependencies: []) 29 | ] 30 | ) 31 | -------------------------------------------------------------------------------- /Tests/Mock Projects/PackageToDocument2/Sources/PrimaryModule/Bool.swift: -------------------------------------------------------------------------------- 1 | /* 2 | Bool.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2018–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | extension Bool { 16 | 17 | public var extensionProperty: Bool { 18 | return false 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Tests/Mock Projects/Tool/Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:5.1 2 | 3 | /* 4 | Package.swift 5 | 6 | This source file is part of the SDGSwift open source project. 7 | https://sdggiesbrecht.github.io/SDGSwift 8 | 9 | Copyright ©2019–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 10 | 11 | Soli Deo gloria. 12 | 13 | Licensed under the Apache Licence, Version 2.0. 14 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 15 | */ 16 | 17 | import PackageDescription 18 | 19 | let package = Package( 20 | name: "Tool", 21 | targets: [ 22 | .target( 23 | name: "Tool", 24 | dependencies: [] 25 | ) 26 | ] 27 | ) 28 | -------------------------------------------------------------------------------- /Tests/Mock Projects/Tool/Sources/Tool/main.swift: -------------------------------------------------------------------------------- 1 | /* 2 | main.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2019–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | print("Hello, world!") 16 | -------------------------------------------------------------------------------- /Tests/Mock Projects/Warnings/Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:5.0 2 | 3 | /* 4 | Package.swift 5 | 6 | This source file is part of the SDGSwift open source project. 7 | https://sdggiesbrecht.github.io/SDGSwift 8 | 9 | Copyright ©2019–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 10 | 11 | Soli Deo gloria. 12 | 13 | Licensed under the Apache Licence, Version 2.0. 14 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 15 | */ 16 | 17 | import PackageDescription 18 | 19 | let package = Package( 20 | name: "Warnings", 21 | products: [ 22 | .library( 23 | name: "Warnings", 24 | targets: ["Warnings"] 25 | ) 26 | ], 27 | targets: [ 28 | .target( 29 | name: "Warnings", 30 | dependencies: [] 31 | ) 32 | ] 33 | ) 34 | -------------------------------------------------------------------------------- /Tests/Mock Projects/Warnings/Sources/Warnings/Warnings.swift: -------------------------------------------------------------------------------- 1 | /* 2 | Warnings.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2019–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | public enum Warnings { 16 | public static var text: String = "Hello, World!" 17 | } 18 | #warning("Encountered a warning.") // @exempt(from: manualWarnings) 19 | -------------------------------------------------------------------------------- /Tests/Mock Projects/WithCustomScheme/Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:5.3 2 | 3 | /* 4 | Package.swift 5 | 6 | This source file is part of the SDGSwift open source project. 7 | https://sdggiesbrecht.github.io/SDGSwift 8 | 9 | Copyright ©2021–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 10 | 11 | Soli Deo gloria. 12 | 13 | Licensed under the Apache Licence, Version 2.0. 14 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 15 | */ 16 | 17 | import PackageDescription 18 | 19 | let package = Package( 20 | name: "WithCustomScheme", 21 | products: [ 22 | .library( 23 | name: "WithCustomScheme", 24 | targets: ["WithCustomScheme"] 25 | ) 26 | ], 27 | targets: [ 28 | .target( 29 | name: "WithCustomScheme" 30 | ) 31 | ] 32 | ) 33 | -------------------------------------------------------------------------------- /Tests/Mock Projects/WithCustomScheme/Sources/WithCustomScheme/WithCustomScheme.swift: -------------------------------------------------------------------------------- 1 | /* 2 | WithCustomScheme.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2021–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | -------------------------------------------------------------------------------- /Tests/SDGSwiftConfigurationTests/InternalTests.swift: -------------------------------------------------------------------------------- 1 | /* 2 | InternalTests.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2019–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | import Foundation 16 | 17 | import SDGLocalization 18 | 19 | import SDGSwiftConfiguration 20 | @testable import SDGSwiftConfigurationLoading 21 | 22 | import SDGSwiftLocalizations 23 | 24 | import SDGXCTestUtilities 25 | 26 | import SDGSwiftTestUtilities 27 | 28 | class InternalTests: SDGSwiftTestUtilities.TestCase { 29 | 30 | func testLocalization() { 31 | for localization in InterfaceLocalization.allCases { 32 | LocalizationSetting(orderOfPrecedence: [localization.code]).do { 33 | _ = Configuration.reportForNoConfigurationFound().resolved() 34 | _ = Configuration.reportForLoading(file: URL(fileURLWithPath: #filePath)).resolved() 35 | } 36 | } 37 | } 38 | 39 | func testResources() { 40 | _ = Resources.packageSwift 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Tests/SDGSwiftConfigurationTests/LegacyMode.swift: -------------------------------------------------------------------------------- 1 | /* 2 | LegacyMode.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2020–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | @testable import SDGSwiftConfigurationLoading 16 | 17 | func withLegacyMode(_ closure: () throws -> Void) rethrows { 18 | legacyMode = true 19 | defer { legacyMode = false } 20 | 21 | try closure() 22 | } 23 | -------------------------------------------------------------------------------- /Tests/SDGSwiftDocumentationExampleTests/ReadMeExampleTests.swift: -------------------------------------------------------------------------------- 1 | /* 2 | ReadMeExampleTests.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2018–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | import Foundation 16 | 17 | import SDGVersioning 18 | 19 | import SDGSwift 20 | 21 | import SDGXCTestUtilities 22 | 23 | import SDGSwiftTestUtilities 24 | 25 | class ReadMeExampleTests: SDGSwiftTestUtilities.TestCase { 26 | 27 | func testReadMe() throws { 28 | #if !PLATFORM_LACKS_GIT 29 | try FileManager.default.withTemporaryDirectory(appropriateFor: nil) { temporaryDirectory in 30 | #if PLATFORM_NOT_SUPPORTED_BY_SWIFT_PM 31 | // Silence warnings. 32 | func nothing() throws {} 33 | try nothing() 34 | #else 35 | 36 | // @example(readMe🇨🇦EN) 37 | let package = Package( 38 | url: URL(string: "https://github.com/apple/example\u{2D}package\u{2D}dealer")! 39 | ) 40 | try package.build(.version(Version(2, 0, 0)), to: temporaryDirectory).get() 41 | // @endExample 42 | #endif 43 | } 44 | #endif 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Tests/SDGSwiftSourceTests/Conformances/BlockComment.swift: -------------------------------------------------------------------------------- 1 | /* 2 | BlockComment.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2023–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | import SDGSwiftSource 16 | 17 | extension BlockComment: RoundTripTestable {} 18 | -------------------------------------------------------------------------------- /Tests/SDGSwiftSourceTests/Conformances/BlockDocumentation.swift: -------------------------------------------------------------------------------- 1 | /* 2 | BlockDocumentation.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2023–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | import SDGSwiftSource 16 | 17 | extension BlockDocumentation: RoundTripTestable {} 18 | -------------------------------------------------------------------------------- /Tests/SDGSwiftSourceTests/Conformances/CodeBlockNode.swift: -------------------------------------------------------------------------------- 1 | /* 2 | CodeBlockNode.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2023–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | import SDGSwiftSource 16 | 17 | extension CodeBlockNode: RoundTripTestable {} 18 | -------------------------------------------------------------------------------- /Tests/SDGSwiftSourceTests/Conformances/CodeContent.swift: -------------------------------------------------------------------------------- 1 | /* 2 | CodeContent.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2023–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | import SDGSwiftSource 16 | 17 | extension CodeContent: RoundTripTestable { 18 | 19 | init(source: String) throws { 20 | self.init(source: source, isSwift: nil) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Tests/SDGSwiftSourceTests/Conformances/CommentContent.swift: -------------------------------------------------------------------------------- 1 | /* 2 | CommentContent.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2023–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | import SDGSwiftSource 16 | 17 | extension CommentContent: RoundTripTestable {} 18 | -------------------------------------------------------------------------------- /Tests/SDGSwiftSourceTests/Conformances/DocumentationContent.swift: -------------------------------------------------------------------------------- 1 | /* 2 | DocumentationContent.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2023–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | import SDGSwiftSource 16 | 17 | extension DocumentationContent: RoundTripTestable {} 18 | -------------------------------------------------------------------------------- /Tests/SDGSwiftSourceTests/Conformances/LineComment.swift: -------------------------------------------------------------------------------- 1 | /* 2 | LineComment.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2023–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | import SDGSwiftSource 16 | 17 | extension LineComment: RoundTripTestable {} 18 | -------------------------------------------------------------------------------- /Tests/SDGSwiftSourceTests/Conformances/LineDocumentation.swift: -------------------------------------------------------------------------------- 1 | /* 2 | LineDocumentation.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2023–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | import SDGSwiftSource 16 | 17 | extension LineDocumentation: RoundTripTestable { 18 | 19 | init?(source: String) { 20 | self.init(source: source, precedingContentContext: nil, followingContentContext: nil) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Tests/SDGSwiftSourceTests/Conformances/StringLiteral.swift: -------------------------------------------------------------------------------- 1 | /* 2 | StringLiteral.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2023–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | import SDGSwiftSource 16 | 17 | extension StringLiteral: RoundTripTestable {} 18 | -------------------------------------------------------------------------------- /Tests/SDGSwiftSourceTests/Conformances/SwiftSyntaxNode.swift: -------------------------------------------------------------------------------- 1 | /* 2 | SwiftSyntaxNode.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2023–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | import SDGSwiftSource 16 | 17 | #if !PLATFORM_NOT_SUPPORTED_BY_SWIFT_SYNTAX_PARSER 18 | extension SwiftSyntaxNode: RoundTripTestable {} 19 | #endif 20 | -------------------------------------------------------------------------------- /Tests/SDGSwiftSourceTests/Scanners/RoundTripSyntaxScanner.swift: -------------------------------------------------------------------------------- 1 | /* 2 | RoundTripSyntaxScanner.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2023–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | import SDGSwiftSource 16 | 17 | struct RoundTripSyntaxScanner: SyntaxScanner { 18 | 19 | // MARK: - Properties 20 | 21 | var result = "" 22 | 23 | // MARK: - SyntaxScanner 24 | 25 | mutating func visit(_ node: SyntaxNode, context: ScanContext) -> Bool { 26 | if let token = node as? Token { 27 | result.append(contentsOf: token.text()) 28 | } 29 | return true 30 | } 31 | 32 | var cache = ParserCache() 33 | } 34 | -------------------------------------------------------------------------------- /Tests/SDGSwiftSourceTests/Scanners/RoundTripTestable.swift: -------------------------------------------------------------------------------- 1 | /* 2 | RoundTripTestable.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2023–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | import SDGSwiftSource 16 | 17 | import XCTest 18 | 19 | protocol RoundTripTestable: SyntaxNode { 20 | init?(source: String) throws 21 | } 22 | 23 | extension RoundTripTestable { 24 | 25 | static func roundTripTest(_ source: String, file: StaticString = #filePath, line: UInt = #line) { 26 | guard let parsed = try? Self(source: source) else { 27 | XCTFail("“\(Self.self)” failed to parse “\(source)”", file: file, line: line) 28 | return 29 | } 30 | XCTAssertEqual( 31 | parsed.text(), 32 | source, 33 | "Syntax tree source differs from parsed source.", 34 | file: file, 35 | line: line 36 | ) 37 | 38 | var syntaxScanner = RoundTripSyntaxScanner() 39 | syntaxScanner.scan(parsed) 40 | XCTAssertEqual( 41 | syntaxScanner.result, 42 | source, 43 | "Syntax scan produced source that differs from the original.", 44 | file: file, 45 | line: line 46 | ) 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Tests/SDGSwiftSourceTests/Scanners/TextFreedomHighlighter.swift: -------------------------------------------------------------------------------- 1 | /* 2 | TextFreedomHighlighter.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2023–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | import SDGSwiftSource 16 | 17 | struct TextFreedomHighlighter: Highlighter { 18 | 19 | // MARK: - Properties 20 | 21 | let targetTestFreedom: TextFreedom 22 | 23 | // MARK: - Highlighter 24 | 25 | func shouldHighlight(_ token: Token, context: ScanContext) -> Bool { 26 | return token.kind.textFreedom(localAncestors: context.localAncestors) == targetTestFreedom 27 | } 28 | 29 | var highlighted: String = "" 30 | 31 | // MARK: - SyntaxScanner 32 | 33 | var cache = ParserCache() 34 | } 35 | -------------------------------------------------------------------------------- /Tests/SDGSwiftTestUtilities/ProcessInfo.swift: -------------------------------------------------------------------------------- 1 | /* 2 | ProcessInfo.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2019–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | import Foundation 16 | 17 | import SDGLogic 18 | 19 | extension ProcessInfo { 20 | 21 | internal static let isInGitHubAction = 22 | ProcessInfo.processInfo.environment["GITHUB_ACTIONS"] ≠ nil 23 | } 24 | -------------------------------------------------------------------------------- /Tests/SDGSwiftTestUtilities/Repository.swift: -------------------------------------------------------------------------------- 1 | /* 2 | Repository.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2018–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | import Foundation 16 | 17 | import SDGPersistenceTestUtilities 18 | 19 | public let sourceDirectory: URL = testSpecificationDirectory().appendingPathComponent("Source") 20 | public let beforeDirectory: URL = sourceDirectory.appendingPathComponent("Before") 21 | public let afterDirectory: URL = sourceDirectory.appendingPathComponent("After") 22 | -------------------------------------------------------------------------------- /Tests/SDGSwiftTestUtilities/TestCase.swift: -------------------------------------------------------------------------------- 1 | /* 2 | TestCase.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2019–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | import Foundation 16 | 17 | import SDGVersioning 18 | 19 | import SDGSwift 20 | 21 | import XCTest 22 | 23 | import SDGXCTestUtilities 24 | 25 | open class TestCase: SDGXCTestUtilities.TestCase { 26 | 27 | private static let configureGit: Void = { 28 | if ProcessInfo.isInGitHubAction { 29 | // @exempt(from: tests) 30 | #if !PLATFORM_LACKS_FOUNDATION_PROCESS 31 | _ = try? Git.runCustomSubcommand( 32 | ["config", "\u{2D}\u{2D}global", "user.email", "john.doe@example.com"], 33 | versionConstraints: Version(0, 0, 0).. Bool { 16 | return true 17 | } 18 | 19 | func notCovered() -> Bool { 20 | ¡return true! 21 | } 22 | 23 | var `switch` = false 24 | func branching() -> Bool { 25 | if `switch` { 26 | return true 27 | } else { 28 | return true 29 | } 30 | } 31 | 32 | var 😀 = false 33 | func withSupplementalPlaneCharacters() -> Bool { 34 | if 😀 { 35 | ¡return true! 36 | } 37 | return false 38 | } 39 | 40 | func acceptClosure(_ closure: () -> Void) { 41 | closure() 42 | } 43 | func useClosure() { 44 | acceptClosure({ 45 | if `switch` { 46 | return 47 | } else { 48 | return 49 | } 50 | }) 51 | } 52 | 53 | var should = true 54 | func ifElseStatement() -> Bool { 55 | if should { 56 | return true 57 | } else { 58 | ¡return false! 59 | } 60 | } 61 | 62 | func useCompleteRangeOperator() { 63 | let array: [Bool] = [] 64 | _ = array[...] 65 | } 66 | -------------------------------------------------------------------------------- /Tests/Test Specifications/CustomStringConvertible/Build/1.0.0.txt: -------------------------------------------------------------------------------- 1 | 🇬🇧EN 2 | 1.0.0 3 | 4 | 🇺🇸EN 5 | 1.0.0 6 | 7 | 🇨🇦EN 8 | 1.0.0 9 | 10 | 🇩🇪DE 11 | 1.0.0 12 | 13 | -------------------------------------------------------------------------------- /Tests/Test Specifications/CustomStringConvertible/Build/Development.txt: -------------------------------------------------------------------------------- 1 | 🇬🇧EN 2 | development state 3 | 4 | 🇺🇸EN 5 | development state 6 | 7 | 🇨🇦EN 8 | development state 9 | 10 | 🇩🇪DE 11 | Entwicklungsstand 12 | 13 | -------------------------------------------------------------------------------- /Tests/Test Specifications/CustomStringConvertible/BuildError/Foundation.txt: -------------------------------------------------------------------------------- 1 | 🇬🇧EN 2 | [...] 3 | 4 | 🇺🇸EN 5 | [...] 6 | 7 | 🇨🇦EN 8 | [...] 9 | 10 | 🇩🇪DE 11 | [...] 12 | 13 | -------------------------------------------------------------------------------- /Tests/Test Specifications/CustomStringConvertible/BuildError/Git Unavailable.txt: -------------------------------------------------------------------------------- 1 | 🇬🇧EN 2 | No compatible version of Git could be located. (...) 3 | It must be installed and locatable with one of the following commands: 4 | $ which git 5 | 6 | 🇺🇸EN 7 | No compatible version of Git could be located. (...) 8 | It must be installed and locatable with one of the following commands: 9 | $ which git 10 | 11 | 🇨🇦EN 12 | No compatible version of Git could be located. (...) 13 | It must be installed and locatable with one of the following commands: 14 | $ which git 15 | 16 | 🇩🇪DE 17 | Keine passende Version von Git wurde gefunden. (...) 18 | Es muss installiert und unter einem der folgenden Befehle vorhanden sein: 19 | $ which git 20 | 21 | -------------------------------------------------------------------------------- /Tests/Test Specifications/CustomStringConvertible/BuildError/Swift Unavailable.txt: -------------------------------------------------------------------------------- 1 | 🇬🇧EN 2 | No compatible version of Swift could be located. (...) 3 | It must be installed and locatable with one of the following commands: 4 | $ which swift 5 | $ xcrun --find swift 6 | $ swiftenv which swift 7 | 8 | 🇺🇸EN 9 | No compatible version of Swift could be located. (...) 10 | It must be installed and locatable with one of the following commands: 11 | $ which swift 12 | $ xcrun --find swift 13 | $ swiftenv which swift 14 | 15 | 🇨🇦EN 16 | No compatible version of Swift could be located. (...) 17 | It must be installed and locatable with one of the following commands: 18 | $ which swift 19 | $ xcrun --find swift 20 | $ swiftenv which swift 21 | 22 | 🇩🇪DE 23 | Keine passende Version von Swift wurde gefunden. (...) 24 | Es muss installiert und unter einem der folgenden Befehle vorhanden sein: 25 | $ which swift 26 | $ xcrun --find swift 27 | $ swiftenv which swift 28 | 29 | -------------------------------------------------------------------------------- /Tests/Test Specifications/CustomStringConvertible/CoverageReportingError/Corrupt Test Coverage Report.txt: -------------------------------------------------------------------------------- 1 | 🇬🇧EN 2 | The test coverage report could not be parsed. 3 | 4 | 🇺🇸EN 5 | The test coverage report could not be parsed. 6 | 7 | 🇨🇦EN 8 | The test coverage report could not be parsed. 9 | 10 | 🇩🇪DE 11 | Die Testabdeckungsergebnisse konnten nicht zerteilt werden. 12 | 13 | -------------------------------------------------------------------------------- /Tests/Test Specifications/CustomStringConvertible/CoverageReportingError/Corrupt Test Coverage.txt: -------------------------------------------------------------------------------- 1 | 🇬🇧EN 2 | The test coverage report could not be parsed. 3 | 4 | 🇺🇸EN 5 | The test coverage report could not be parsed. 6 | 7 | 🇨🇦EN 8 | The test coverage report could not be parsed. 9 | 10 | 🇩🇪DE 11 | Die Testabdeckungsergebnisse konnten nicht zerteilt werden. 12 | 13 | -------------------------------------------------------------------------------- /Tests/Test Specifications/CustomStringConvertible/CoverageReportingError/Foundation.txt: -------------------------------------------------------------------------------- 1 | 🇬🇧EN 2 | [...] 3 | 4 | 🇺🇸EN 5 | [...] 6 | 7 | 🇨🇦EN 8 | [...] 9 | 10 | 🇩🇪DE 11 | [...] 12 | 13 | -------------------------------------------------------------------------------- /Tests/Test Specifications/CustomStringConvertible/CoverageReportingError/Package Manager.txt: -------------------------------------------------------------------------------- 1 | 🇬🇧EN 2 | [...] 3 | 4 | 🇺🇸EN 5 | [...] 6 | 7 | 🇨🇦EN 8 | [...] 9 | 10 | 🇩🇪DE 11 | [...] 12 | 13 | -------------------------------------------------------------------------------- /Tests/Test Specifications/CustomStringConvertible/CoverageReportingError/Swift Error.txt: -------------------------------------------------------------------------------- 1 | 🇬🇧EN 2 | No compatible version of Swift could be located. (...) 3 | It must be installed and locatable with one of the following commands: 4 | $ which swift 5 | $ xcrun --find swift 6 | $ swiftenv which swift 7 | 8 | 🇺🇸EN 9 | No compatible version of Swift could be located. (...) 10 | It must be installed and locatable with one of the following commands: 11 | $ which swift 12 | $ xcrun --find swift 13 | $ swiftenv which swift 14 | 15 | 🇨🇦EN 16 | No compatible version of Swift could be located. (...) 17 | It must be installed and locatable with one of the following commands: 18 | $ which swift 19 | $ xcrun --find swift 20 | $ swiftenv which swift 21 | 22 | 🇩🇪DE 23 | Keine passende Version von Swift wurde gefunden. (...) 24 | Es muss installiert und unter einem der folgenden Befehle vorhanden sein: 25 | $ which swift 26 | $ xcrun --find swift 27 | $ swiftenv which swift 28 | 29 | -------------------------------------------------------------------------------- /Tests/Test Specifications/CustomStringConvertible/CoverageReportingError/Unavailable.txt: -------------------------------------------------------------------------------- 1 | 🇬🇧EN 2 | No compatible version of Swift could be located. (...) 3 | It must be installed and locatable with one of the following commands: 4 | $ which swift 5 | $ xcrun --find swift 6 | $ swiftenv which swift 7 | 8 | 🇺🇸EN 9 | No compatible version of Swift could be located. (...) 10 | It must be installed and locatable with one of the following commands: 11 | $ which swift 12 | $ xcrun --find swift 13 | $ swiftenv which swift 14 | 15 | 🇨🇦EN 16 | No compatible version of Swift could be located. (...) 17 | It must be installed and locatable with one of the following commands: 18 | $ which swift 19 | $ xcrun --find swift 20 | $ swiftenv which swift 21 | 22 | 🇩🇪DE 23 | Keine passende Version von Swift wurde gefunden. (...) 24 | Es muss installiert und unter einem der folgenden Befehle vorhanden sein: 25 | $ which swift 26 | $ xcrun --find swift 27 | $ swiftenv which swift 28 | 29 | -------------------------------------------------------------------------------- /Tests/Test Specifications/CustomStringConvertible/CoverageReportingError/Xcode Unavailable.txt: -------------------------------------------------------------------------------- 1 | 🇬🇧EN 2 | No compatible version of Xcode could be located. (...) 3 | It must be installed and locatable with one of the following commands: 4 | $ xcrun --find xcodebuild 5 | 6 | 🇺🇸EN 7 | No compatible version of Xcode could be located. (...) 8 | It must be installed and locatable with one of the following commands: 9 | $ xcrun --find xcodebuild 10 | 11 | 🇨🇦EN 12 | No compatible version of Xcode could be located. (...) 13 | It must be installed and locatable with one of the following commands: 14 | $ xcrun --find xcodebuild 15 | 16 | 🇩🇪DE 17 | Keine passende Version von Xcode wurde gefunden. (...) 18 | Es muss installiert und unter einem der folgenden Befehle vorhanden sein: 19 | $ xcrun --find xcodebuild 20 | 21 | -------------------------------------------------------------------------------- /Tests/Test Specifications/CustomStringConvertible/Error/Corrupt.txt: -------------------------------------------------------------------------------- 1 | 🇬🇧EN 2 | The configuration is corrupt. 3 | 4 | 🇺🇸EN 5 | The configuration is corrupt. 6 | 7 | 🇨🇦EN 8 | The configuration is corrupt. 9 | 10 | 🇩🇪DE 11 | Die Konfiguration ist beschädigt. 12 | 13 | -------------------------------------------------------------------------------- /Tests/Test Specifications/CustomStringConvertible/Error/Empty.txt: -------------------------------------------------------------------------------- 1 | 🇬🇧EN 2 | The configuration is empty. 3 | 4 | 🇺🇸EN 5 | The configuration is empty. 6 | 7 | 🇨🇦EN 8 | The configuration is empty. 9 | 10 | 🇩🇪DE 11 | Die Konfiguration ist lehr. 12 | 13 | -------------------------------------------------------------------------------- /Tests/Test Specifications/CustomStringConvertible/Error/Foundation.txt: -------------------------------------------------------------------------------- 1 | 🇬🇧EN 2 | [...] 3 | 4 | 🇺🇸EN 5 | [...] 6 | 7 | 🇨🇦EN 8 | [...] 9 | 10 | 🇩🇪DE 11 | [...] 12 | 13 | -------------------------------------------------------------------------------- /Tests/Test Specifications/CustomStringConvertible/Error/Git Execution.txt: -------------------------------------------------------------------------------- 1 | 🇬🇧EN 2 | git: 'fail' is not a git command. See 'git --help'. 3 | 4 | 🇺🇸EN 5 | git: 'fail' is not a git command. See 'git --help'. 6 | 7 | 🇨🇦EN 8 | git: 'fail' is not a git command. See 'git --help'. 9 | 10 | 🇩🇪DE 11 | git: 'fail' is not a git command. See 'git --help'. 12 | 13 | -------------------------------------------------------------------------------- /Tests/Test Specifications/CustomStringConvertible/Error/Git Unavailable.txt: -------------------------------------------------------------------------------- 1 | 🇬🇧EN 2 | No compatible version of Git could be located. (1.9.0 ≤ x < 3.0.0) 3 | It must be installed and locatable with one of the following commands: 4 | $ which git 5 | 6 | 🇺🇸EN 7 | No compatible version of Git could be located. (1.9.0 ≤ x < 3.0.0) 8 | It must be installed and locatable with one of the following commands: 9 | $ which git 10 | 11 | 🇨🇦EN 12 | No compatible version of Git could be located. (1.9.0 ≤ x < 3.0.0) 13 | It must be installed and locatable with one of the following commands: 14 | $ which git 15 | 16 | 🇩🇪DE 17 | Keine passende Version von Git wurde gefunden. (1.9.0 ≤ x < 3.0.0) 18 | Es muss installiert und unter einem der folgenden Befehle vorhanden sein: 19 | $ which git 20 | 21 | -------------------------------------------------------------------------------- /Tests/Test Specifications/CustomStringConvertible/Error/Swift Execution.txt: -------------------------------------------------------------------------------- 1 | 🇬🇧EN 2 | [...] 3 | 4 | 🇺🇸EN 5 | [...] 6 | 7 | 🇨🇦EN 8 | [...] 9 | 10 | 🇩🇪DE 11 | [...] 12 | 13 | -------------------------------------------------------------------------------- /Tests/Test Specifications/CustomStringConvertible/Error/Swift Unavailable.txt: -------------------------------------------------------------------------------- 1 | 🇬🇧EN 2 | No compatible version of Swift could be located. (...) 3 | It must be installed and locatable with one of the following commands: 4 | $ which swift 5 | $ xcrun --find swift 6 | $ swiftenv which swift 7 | 8 | 🇺🇸EN 9 | No compatible version of Swift could be located. (...) 10 | It must be installed and locatable with one of the following commands: 11 | $ which swift 12 | $ xcrun --find swift 13 | $ swiftenv which swift 14 | 15 | 🇨🇦EN 16 | No compatible version of Swift could be located. (...) 17 | It must be installed and locatable with one of the following commands: 18 | $ which swift 19 | $ xcrun --find swift 20 | $ swiftenv which swift 21 | 22 | 🇩🇪DE 23 | Keine passende Version von Swift wurde gefunden. (...) 24 | Es muss installiert und unter einem der folgenden Befehle vorhanden sein: 25 | $ which swift 26 | $ xcrun --find swift 27 | $ swiftenv which swift 28 | 29 | -------------------------------------------------------------------------------- /Tests/Test Specifications/CustomStringConvertible/ExecutionError/Foundation.txt: -------------------------------------------------------------------------------- 1 | 🇬🇧EN 2 | [...] 3 | 4 | 🇺🇸EN 5 | [...] 6 | 7 | 🇨🇦EN 8 | [...] 9 | 10 | 🇩🇪DE 11 | [...] 12 | 13 | -------------------------------------------------------------------------------- /Tests/Test Specifications/CustomStringConvertible/ExecutionError/Git Unavailable.txt: -------------------------------------------------------------------------------- 1 | 🇬🇧EN 2 | No compatible version of Git could be located. (...) 3 | It must be installed and locatable with one of the following commands: 4 | $ which git 5 | 6 | 🇺🇸EN 7 | No compatible version of Git could be located. (...) 8 | It must be installed and locatable with one of the following commands: 9 | $ which git 10 | 11 | 🇨🇦EN 12 | No compatible version of Git could be located. (...) 13 | It must be installed and locatable with one of the following commands: 14 | $ which git 15 | 16 | 🇩🇪DE 17 | Keine passende Version von Git wurde gefunden. (...) 18 | Es muss installiert und unter einem der folgenden Befehle vorhanden sein: 19 | $ which git 20 | 21 | -------------------------------------------------------------------------------- /Tests/Test Specifications/CustomStringConvertible/ExecutionError/No Such Executable.txt: -------------------------------------------------------------------------------- 1 | 🇬🇧EN 2 | The package did not produce an executable with any of the requested names: 3 | tool 4 | 5 | 🇺🇸EN 6 | The package did not produce an executable with any of the requested names: 7 | tool 8 | 9 | 🇨🇦EN 10 | The package did not produce an executable with any of the requested names: 11 | tool 12 | 13 | 🇩🇪DE 14 | Das Paket hat keine ausführbare Datei erzeugt, die mit einem der angeforderten Namen übereinstimmt: 15 | tool 16 | 17 | -------------------------------------------------------------------------------- /Tests/Test Specifications/CustomStringConvertible/HostDestinationError/Package Manager.txt: -------------------------------------------------------------------------------- 1 | 🇬🇧EN 2 | [...] 3 | 4 | 🇺🇸EN 5 | [...] 6 | 7 | 🇨🇦EN 8 | [...] 9 | 10 | 🇩🇪DE 11 | [...] 12 | 13 | -------------------------------------------------------------------------------- /Tests/Test Specifications/CustomStringConvertible/InitializationError/Git Unavailable.txt: -------------------------------------------------------------------------------- 1 | 🇬🇧EN 2 | No compatible version of Git could be located. (...) 3 | It must be installed and locatable with one of the following commands: 4 | $ which git 5 | 6 | 🇺🇸EN 7 | No compatible version of Git could be located. (...) 8 | It must be installed and locatable with one of the following commands: 9 | $ which git 10 | 11 | 🇨🇦EN 12 | No compatible version of Git could be located. (...) 13 | It must be installed and locatable with one of the following commands: 14 | $ which git 15 | 16 | 🇩🇪DE 17 | Keine passende Version von Git wurde gefunden. (...) 18 | Es muss installiert und unter einem der folgenden Befehle vorhanden sein: 19 | $ which git 20 | 21 | -------------------------------------------------------------------------------- /Tests/Test Specifications/CustomStringConvertible/InitializationError/Package Manager.txt: -------------------------------------------------------------------------------- 1 | 🇬🇧EN 2 | [...] 3 | 4 | 🇺🇸EN 5 | [...] 6 | 7 | 🇨🇦EN 8 | [...] 9 | 10 | 🇩🇪DE 11 | [...] 12 | 13 | -------------------------------------------------------------------------------- /Tests/Test Specifications/CustomStringConvertible/LoadingError/Export.txt: -------------------------------------------------------------------------------- 1 | 🇬🇧EN 2 | ... 3 | 4 | 🇺🇸EN 5 | ... 6 | 7 | 🇨🇦EN 8 | ... 9 | 10 | 🇩🇪DE 11 | ... 12 | 13 | -------------------------------------------------------------------------------- /Tests/Test Specifications/CustomStringConvertible/LoadingError/Load.txt: -------------------------------------------------------------------------------- 1 | 🇬🇧EN 2 | ... 3 | 4 | 🇺🇸EN 5 | ... 6 | 7 | 🇨🇦EN 8 | ... 9 | 10 | 🇩🇪DE 11 | ... 12 | 13 | -------------------------------------------------------------------------------- /Tests/Test Specifications/CustomStringConvertible/LoadingError/Manifest Load.txt: -------------------------------------------------------------------------------- 1 | 🇬🇧EN 2 | ... 3 | 4 | 🇺🇸EN 5 | ... 6 | 7 | 🇨🇦EN 8 | ... 9 | 10 | 🇩🇪DE 11 | ... 12 | 13 | -------------------------------------------------------------------------------- /Tests/Test Specifications/CustomStringConvertible/Package/Mock Package.txt: -------------------------------------------------------------------------------- 1 | 🇬🇧EN 2 | https://domain.tld/Package 3 | 4 | 🇺🇸EN 5 | https://domain.tld/Package 6 | 7 | 🇨🇦EN 8 | https://domain.tld/Package 9 | 10 | 🇩🇪DE 11 | https://domain.tld/Package 12 | 13 | -------------------------------------------------------------------------------- /Tests/Test Specifications/CustomStringConvertible/PackageLoadingError/Diagnostics.txt: -------------------------------------------------------------------------------- 1 | 🇬🇧EN 2 | Source files for target Invalid should be located under 'Sources/Invalid', or a custom sources path can be set with the 'path' property in Package.swift 3 | 4 | 🇺🇸EN 5 | Source files for target Invalid should be located under 'Sources/Invalid', or a custom sources path can be set with the 'path' property in Package.swift 6 | 7 | 🇨🇦EN 8 | Source files for target Invalid should be located under 'Sources/Invalid', or a custom sources path can be set with the 'path' property in Package.swift 9 | 10 | 🇩🇪DE 11 | Source files for target Invalid should be located under 'Sources/Invalid', or a custom sources path can be set with the 'path' property in Package.swift 12 | 13 | -------------------------------------------------------------------------------- /Tests/Test Specifications/CustomStringConvertible/PackageLoadingError/Package Manager.txt: -------------------------------------------------------------------------------- 1 | 🇬🇧EN 2 | [...] 3 | 4 | 🇺🇸EN 5 | [...] 6 | 7 | 🇨🇦EN 8 | [...] 9 | 10 | 🇩🇪DE 11 | [...] 12 | 13 | -------------------------------------------------------------------------------- /Tests/Test Specifications/CustomStringConvertible/PackageRepository/Mock.txt: -------------------------------------------------------------------------------- 1 | 🇬🇧EN 2 | /path/to/Mock Package 3 | 4 | 🇺🇸EN 5 | /path/to/Mock Package 6 | 7 | 🇨🇦EN 8 | /path/to/Mock Package 9 | 10 | 🇩🇪DE 11 | /path/to/Mock Package 12 | 13 | -------------------------------------------------------------------------------- /Tests/Test Specifications/CustomStringConvertible/SchemeError/Foundation.txt: -------------------------------------------------------------------------------- 1 | 🇬🇧EN 2 | [...] 3 | 4 | 🇺🇸EN 5 | [...] 6 | 7 | 🇨🇦EN 8 | [...] 9 | 10 | 🇩🇪DE 11 | [...] 12 | 13 | -------------------------------------------------------------------------------- /Tests/Test Specifications/CustomStringConvertible/SchemeError/No Package Scheme.txt: -------------------------------------------------------------------------------- 1 | 🇬🇧EN 2 | The Xcode project has no package scheme. 3 | 4 | 🇺🇸EN 5 | The Xcode project has no package scheme. 6 | 7 | 🇨🇦EN 8 | The Xcode project has no package scheme. 9 | 10 | 🇩🇪DE 11 | Das Xcode‐Projekt hat kein Paketenschema. 12 | 13 | -------------------------------------------------------------------------------- /Tests/Test Specifications/CustomStringConvertible/Version/1.2.3.txt: -------------------------------------------------------------------------------- 1 | 🇬🇧EN 2 | 1.2.3 3 | 4 | 🇺🇸EN 5 | 1.2.3 6 | 7 | 🇨🇦EN 8 | 1.2.3 9 | 10 | 🇩🇪DE 11 | 1.2.3 12 | 13 | -------------------------------------------------------------------------------- /Tests/Test Specifications/CustomStringConvertible/VersionedExternalProcessExecutionError⟨Git⟩/Git Execution.txt: -------------------------------------------------------------------------------- 1 | 🇬🇧EN 2 | git: 'fail' is not a git command. See 'git --help'. 3 | 4 | 🇺🇸EN 5 | git: 'fail' is not a git command. See 'git --help'. 6 | 7 | 🇨🇦EN 8 | git: 'fail' is not a git command. See 'git --help'. 9 | 10 | 🇩🇪DE 11 | git: 'fail' is not a git command. See 'git --help'. 12 | 13 | -------------------------------------------------------------------------------- /Tests/Test Specifications/CustomStringConvertible/VersionedExternalProcessExecutionError⟨Git⟩/Git Unavailable.txt: -------------------------------------------------------------------------------- 1 | 🇬🇧EN 2 | No compatible version of Git could be located. (...) 3 | It must be installed and locatable with one of the following commands: 4 | $ which git 5 | 6 | 🇺🇸EN 7 | No compatible version of Git could be located. (...) 8 | It must be installed and locatable with one of the following commands: 9 | $ which git 10 | 11 | 🇨🇦EN 12 | No compatible version of Git could be located. (...) 13 | It must be installed and locatable with one of the following commands: 14 | $ which git 15 | 16 | 🇩🇪DE 17 | Keine passende Version von Git wurde gefunden. (...) 18 | Es muss installiert und unter einem der folgenden Befehle vorhanden sein: 19 | $ which git 20 | 21 | -------------------------------------------------------------------------------- /Tests/Test Specifications/CustomStringConvertible/VersionedExternalProcessExecutionError⟨SwiftCompiler⟩/Swift Execution.txt: -------------------------------------------------------------------------------- 1 | 🇬🇧EN 2 | [...] 3 | 4 | 🇺🇸EN 5 | [...] 6 | 7 | 🇨🇦EN 8 | [...] 9 | 10 | 🇩🇪DE 11 | [...] 12 | 13 | -------------------------------------------------------------------------------- /Tests/Test Specifications/CustomStringConvertible/VersionedExternalProcessExecutionError⟨SwiftCompiler⟩/Swift Unavailable.txt: -------------------------------------------------------------------------------- 1 | 🇬🇧EN 2 | No compatible version of Swift could be located. (...) 3 | It must be installed and locatable with one of the following commands: 4 | $ which swift 5 | $ xcrun --find swift 6 | $ swiftenv which swift 7 | 8 | 🇺🇸EN 9 | No compatible version of Swift could be located. (...) 10 | It must be installed and locatable with one of the following commands: 11 | $ which swift 12 | $ xcrun --find swift 13 | $ swiftenv which swift 14 | 15 | 🇨🇦EN 16 | No compatible version of Swift could be located. (...) 17 | It must be installed and locatable with one of the following commands: 18 | $ which swift 19 | $ xcrun --find swift 20 | $ swiftenv which swift 21 | 22 | 🇩🇪DE 23 | Keine passende Version von Swift wurde gefunden. (...) 24 | Es muss installiert und unter einem der folgenden Befehle vorhanden sein: 25 | $ which swift 26 | $ xcrun --find swift 27 | $ swiftenv which swift 28 | 29 | -------------------------------------------------------------------------------- /Tests/Test Specifications/CustomStringConvertible/VersionedExternalProcessExecutionError⟨Xcode⟩/Foundation.txt: -------------------------------------------------------------------------------- 1 | 🇬🇧EN 2 | [...] 3 | 4 | 🇺🇸EN 5 | [...] 6 | 7 | 🇨🇦EN 8 | [...] 9 | 10 | 🇩🇪DE 11 | [...] 12 | 13 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Localization/Callouts/🇨🇦EN.txt: -------------------------------------------------------------------------------- 1 | Parameter 2 | Parameters 3 | Attention 4 | Author 5 | Authors 6 | Bug 7 | Complexity 8 | Copyright 9 | Date 10 | Experiment 11 | Important 12 | Invariant 13 | Localization Key 14 | Mutating Variant 15 | Non‐mutating Variant 16 | Note 17 | Postcondition 18 | Precondition 19 | Remark 20 | Remarks 21 | Returns 22 | Requires 23 | See Also 24 | Since 25 | Tag 26 | To Do 27 | Throws 28 | Version 29 | Warning 30 | Keyword 31 | Recommended 32 | Recommended over -------------------------------------------------------------------------------- /Tests/Test Specifications/Localization/Callouts/🇩🇪DE.txt: -------------------------------------------------------------------------------- 1 | Übergabewert 2 | Übergabewerte 3 | Achtung 4 | Verfasser 5 | Verfasser 6 | Programmfehler 7 | Komplexität 8 | Urheberrecht 9 | Datum 10 | Versuch 11 | Wichtig 12 | Invariante 13 | Lokalisierungsschlüssel 14 | Ändernde Nebenform 15 | Nicht ändernde Nebenform 16 | Hinweis 17 | Nachbedingung 18 | Vorbedingung 19 | Anmerkung 20 | Anmerkungen 21 | Ergibt 22 | Setzt voraus 23 | Siehe auch 24 | Seit 25 | Etikett 26 | Aufgabe 27 | Wirft 28 | Version 29 | Warnung 30 | Schlagwort 31 | Empfohlen 32 | Empfohlen über -------------------------------------------------------------------------------- /Tests/Test Specifications/Localization/Callouts/🇬🇧EN.txt: -------------------------------------------------------------------------------- 1 | Parameter 2 | Parameters 3 | Attention 4 | Author 5 | Authors 6 | Bug 7 | Complexity 8 | Copyright 9 | Date 10 | Experiment 11 | Important 12 | Invariant 13 | Localisation Key 14 | Mutating Variant 15 | Non‐mutating Variant 16 | Note 17 | Postcondition 18 | Precondition 19 | Remark 20 | Remarks 21 | Returns 22 | Requires 23 | See Also 24 | Since 25 | Tag 26 | To Do 27 | Throws 28 | Version 29 | Warning 30 | Keyword 31 | Recommended 32 | Recommended over -------------------------------------------------------------------------------- /Tests/Test Specifications/Localization/Callouts/🇺🇸EN.txt: -------------------------------------------------------------------------------- 1 | Parameter 2 | Parameters 3 | Attention 4 | Author 5 | Authors 6 | Bug 7 | Complexity 8 | Copyright 9 | Date 10 | Experiment 11 | Important 12 | Invariant 13 | Localization Key 14 | Mutating Variant 15 | Non‐mutating Variant 16 | Note 17 | Postcondition 18 | Precondition 19 | Remark 20 | Remarks 21 | Returns 22 | Requires 23 | See Also 24 | Since 25 | Tag 26 | To Do 27 | Throws 28 | Version 29 | Warning 30 | Keyword 31 | Recommended 32 | Recommended over -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Aliasable Text/Attributes.txt: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /// Documentation before hidden attribute. 4 | @_specialize(kind: f̲u̲l̲l̲, where T̲ =̲=̲ I̲n̲t̲) public func withHiddenAttribute(_ parameter: T̲) {} 5 | 6 | @available(*̲, unavailable) public func unavailable() {} 7 | @available(*̲, introduced: 4.2.1) public func introduced() {} 8 | @available(*̲, deprecated: 4.2.1) public func deprecated() {} 9 | @available(*̲, obsoleted: 4.2.1) public func obsoleted() {} 10 | 11 | public class ObjectiveCObject : N̲S̲O̲b̲j̲e̲c̲t̲ { 12 | @objc public func objectiveCMethod() {} 13 | @nonobjc public func swiftOnlyMethod() {} 14 | } 15 | 16 | @inlinable public func inlineable() {} 17 | 18 | public func escaping(closure: @escaping () -> V̲o̲i̲d̲) {} 19 | public func auto(closure: @autoclosure () -> V̲o̲i̲d̲) {} 20 | @discardableResult public func discardableResult() -> B̲o̲o̲l̲ 21 | 22 | extension O̲b̲j̲e̲c̲t̲i̲v̲e̲C̲O̲b̲j̲e̲c̲t̲ { 23 | @available(*̲, introduced: 4.2.1) @objc @discardableResult public func everything(_ closure: @escaping @autoclosure () -> V̲o̲i̲d̲) {} 24 | } 25 | 26 | @available(s̲w̲i̲f̲t̲, introduced: 4.0, message: "Message.") public func introductionMessage() {} 27 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Aliasable Text/BaseClass.txt: -------------------------------------------------------------------------------- 1 | /* 2 | BaseClass.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift/SDGSwift 6 | 7 | Copyright ©2018 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | class BaseClass { 16 | 17 | } 18 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Aliasable Text/Class.txt: -------------------------------------------------------------------------------- 1 | public class Superclass { 2 | 3 | public required init() {} 4 | public convenience init(parameter: B̲o̲o̲l̲) { 5 | self.init() 6 | } 7 | } 8 | 9 | public final class FinalClass {} 10 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Aliasable Text/Conformance.txt: -------------------------------------------------------------------------------- 1 | public struct Conforming : C̲u̲s̲t̲o̲m̲S̲t̲r̲i̲n̲g̲C̲o̲n̲v̲e̲r̲t̲i̲b̲l̲e̲ { 2 | 3 | public var description: S̲t̲r̲i̲n̲g̲ { 4 | return "" 5 | } 6 | } 7 | 8 | public protocol BaseProtocol { 9 | func baseProtocolMethod() 10 | associatedtype AssociatedType 11 | init() 12 | var protocolVariable: I̲n̲t̲ 13 | subscript(protocolSubscript: I̲n̲t̲) -> I̲n̲t̲ { get } 14 | } 15 | public protocol MoreSpecificProtocol : B̲a̲s̲e̲P̲r̲o̲t̲o̲c̲o̲l̲ { 16 | func moreSpecificProtocolMethod() 17 | } 18 | public struct Structure : M̲o̲r̲e̲S̲p̲e̲c̲i̲f̲i̲c̲P̲r̲o̲t̲o̲c̲o̲l̲ { 19 | public func baseProtocolMethod() 20 | public func moreSpecificProtocolMethod() 21 | public typealias AssociatedType = I̲n̲t̲ 22 | public init() {} 23 | public var protocolVariable: I̲n̲t̲ = 0 24 | public subscript(protocolSubscript: I̲n̲t̲) -> I̲n̲t̲ { return 0 } 25 | } 26 | 27 | public class BaseClass { 28 | public func baseClassMethod() {} 29 | } 30 | public class Subclass : B̲a̲s̲e̲C̲l̲a̲s̲s̲ { 31 | public override func baseClassMethod() {} 32 | } 33 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Aliasable Text/ControlFlow.txt: -------------------------------------------------------------------------------- 1 | /* 2 | ControlFlow.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift/SDGSwift 6 | 7 | Copyright ©2018 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | func main() { 16 | 17 | if n̲u̲m̲b̲e̲r̲.i̲s̲I̲r̲r̲a̲t̲i̲o̲n̲a̲l̲ { 18 | n̲u̲m̲b̲e̲r̲.r̲o̲u̲n̲d̲() 19 | } 20 | 21 | for element in [1, 2, 3] { 22 | 23 | } 24 | 25 | let trailingClosure = [1, 2, 3].f̲i̲l̲t̲e̲r̲ { (number: I̲n̲t̲) -> B̲o̲o̲l̲ in 26 | return n̲u̲m̲b̲e̲r̲ =̲=̲ 1 27 | } 28 | 29 | let number = 1 30 | switch n̲u̲m̲b̲e̲r̲ { 31 | case 1: 32 | p̲r̲i̲n̲t̲("one") 33 | default: 34 | p̲r̲i̲n̲t̲("default") 35 | } 36 | 37 | guard b̲o̲o̲l̲e̲a̲n̲ =̲=̲ true else { 38 | p̲r̲e̲c̲o̲n̲d̲i̲t̲i̲o̲n̲F̲a̲i̲l̲u̲r̲e̲() 39 | } 40 | 41 | while s̲o̲m̲e̲t̲h̲i̲n̲g̲ { 42 | // Wait. 43 | } 44 | 45 | repeat { 46 | s̲o̲m̲e̲T̲a̲s̲k̲() 47 | } while t̲i̲m̲e̲ <̲ 10 48 | } 49 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Aliasable Text/DocumentedExtension.txt: -------------------------------------------------------------------------------- 1 | /* 2 | DocumentedExtension.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift/SDGSwift 6 | 7 | Copyright ©2018 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | extension B̲o̲o̲l̲ { 16 | 17 | /// A read‐only computed property. 18 | public var readOnlyComputedProperty: B̲o̲o̲l̲ { 19 | return self 20 | } 21 | 22 | /// A read‐only computed property with an internal setter. 23 | public internal(set) var readOnlyWithInternalSetter: B̲o̲o̲l̲ { 24 | get { 25 | return self 26 | } 27 | set { 28 | self = n̲e̲w̲V̲a̲l̲u̲e̲ 29 | } 30 | } 31 | 32 | /// A read‐write computed property. 33 | public var readWriteComputedProperty: B̲o̲o̲l̲ { 34 | get { 35 | return self 36 | } 37 | set { 38 | self = n̲e̲w̲V̲a̲l̲u̲e̲ 39 | } 40 | } 41 | } 42 | 43 | // Nothing surfaced to the API. 44 | extension A̲n̲y̲S̲e̲q̲u̲e̲n̲c̲e̲ { 45 | 46 | var notPublic: B̲o̲o̲l̲ 47 | } 48 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Aliasable Text/Enumeration.txt: -------------------------------------------------------------------------------- 1 | /* 2 | Enumeration.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift/SDGSwift 6 | 7 | Copyright ©2018 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | enum InternalEnumeration { 16 | case a 17 | case b 18 | case c 19 | } 20 | 21 | public enum Enumeration { 22 | case a 23 | case b 24 | case c, d 25 | } 26 | 27 | public enum RawEnumeration: S̲t̲r̲i̲n̲g̲ { 28 | case a = "A" 29 | case b = "B" 30 | case c = "C" 31 | } 32 | 33 | public enum EnumerationWithAssociatedValues { 34 | case none 35 | case one(B̲o̲o̲l̲) 36 | case two(B̲o̲o̲l̲, B̲o̲o̲l̲) 37 | } 38 | 39 | public enum EnumerationWithAvailablitiyRestrictions { 40 | @available(*̲, unavailable, renamed: "new") case old 41 | case new 42 | } 43 | 44 | public enum IndirectEnumeration { 45 | indirect case indirectCase 46 | } 47 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Aliasable Text/Extensions.txt: -------------------------------------------------------------------------------- 1 | public enum RootType {} 2 | 3 | extension R̲o̲o̲t̲T̲y̲p̲e̲ { 4 | public enum IntermediateType {} 5 | } 6 | 7 | extension R̲o̲o̲t̲T̲y̲p̲e̲.I̲n̲t̲e̲r̲m̲e̲d̲i̲a̲t̲e̲T̲y̲p̲e̲ { 8 | public enum LeafType {} 9 | } 10 | 11 | extension R̲o̲o̲t̲T̲y̲p̲e̲.I̲n̲t̲e̲r̲m̲e̲d̲i̲a̲t̲e̲T̲y̲p̲e̲.L̲e̲a̲f̲T̲y̲p̲e̲ { 12 | public enum NestedAbsurdlyDeep {} 13 | } 14 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Aliasable Text/GenericProperties.txt: -------------------------------------------------------------------------------- 1 | extension I̲n̲t̲e̲g̲e̲r̲ { 2 | 3 | public var singleDigits: R̲a̲n̲g̲e̲ { 4 | return 0 .̲.̲<̲ 9 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Aliasable Text/GenericType.txt: -------------------------------------------------------------------------------- 1 | public struct Generic : D̲e̲c̲l̲a̲r̲e̲d̲C̲o̲n̲f̲o̲r̲m̲a̲n̲c̲e̲O̲n̲e̲, D̲e̲c̲l̲a̲r̲e̲d̲C̲o̲n̲f̲o̲r̲m̲a̲n̲c̲e̲T̲w̲o̲ where T̲h̲i̲n̲g̲ : C̲o̲n̲f̲o̲r̲m̲a̲n̲c̲e̲R̲e̲q̲u̲i̲r̲e̲d̲B̲y̲W̲h̲e̲r̲e̲ { 2 | 3 | } 4 | 5 | public struct DoubleGeneric {} 6 | 7 | public struct StandardFormGeneric where T̲h̲i̲n̲g̲ : E̲q̲u̲a̲t̲a̲b̲l̲e̲ {} 8 | public struct DeprecatedFormGeneric {} 9 | public struct DoubledDeprecatedFormGeneric {} 10 | 11 | public struct NestedGenericConstraint where T̲h̲i̲n̲g̲ : C̲o̲l̲l̲e̲c̲t̲i̲o̲n̲, T̲h̲i̲n̲g̲.E̲l̲e̲m̲e̲n̲t̲ : E̲q̲u̲a̲t̲a̲b̲l̲e̲, T̲h̲i̲n̲g̲.A̲s̲s̲o̲c̲i̲a̲t̲e̲d̲ =̲=̲ T̲h̲i̲n̲g̲.G̲e̲n̲e̲r̲i̲c̲, O̲t̲h̲e̲r̲T̲h̲i̲n̲g̲ =̲=̲ G̲e̲n̲e̲r̲i̲c̲ {} 12 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Aliasable Text/Initializers.txt: -------------------------------------------------------------------------------- 1 | public struct Initializable { 2 | 3 | public init(x: I̲n̲t̲, y: I̲n̲t̲) { 4 | 5 | } 6 | 7 | public init?(string: S̲t̲r̲i̲n̲g̲) { 8 | 9 | } 10 | 11 | public init(throwing: B̲o̲o̲l̲) throws { 12 | 13 | } 14 | 15 | private init(private: U̲I̲n̲t̲) {} 16 | 17 | public init(_hidden: B̲o̲o̲l̲) {} 18 | } 19 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Aliasable Text/Literals.txt: -------------------------------------------------------------------------------- 1 | /* 2 | Literals.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift/SDGSwift 6 | 7 | Copyright ©2018 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | let string = "" 16 | 17 | let interpolated = "\(x̲) + \(y̲)" 18 | 19 | let dictionary = [ 20 | "A" : 1, 21 | "B" : 2 22 | ] 23 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Aliasable Text/Methods.txt: -------------------------------------------------------------------------------- 1 | public struct StructureWithMethods { 2 | 3 | public static func staticMethod() {} 4 | 5 | public mutating func mutateSomething() { 6 | 7 | } 8 | } 9 | 10 | extension S̲t̲r̲u̲c̲t̲u̲r̲e̲W̲i̲t̲h̲M̲e̲t̲h̲o̲d̲s̲ { 11 | public static func extensionStaticMethod() {} 12 | } 13 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Aliasable Text/Operators.txt: -------------------------------------------------------------------------------- 1 | extension B̲o̲o̲l̲ { 2 | 3 | public static func += (precedingValue: inout B̲o̲o̲l̲, followingValue: B̲o̲o̲l̲) {} 4 | public static func − (_ explicitlyUnlabelledParameters: I̲n̲t̲, _ b: I̲n̲t̲) -> I̲n̲t̲ { 5 | return b̲ 6 | } 7 | } 8 | 9 | extension I̲n̲t̲ { 10 | public static prefix func − (operand: I̲n̲t̲) -> I̲n̲t̲ { 11 | return o̲p̲e̲r̲a̲n̲d̲ 12 | } 13 | public static postfix func ! (operand: I̲n̲t̲) -> I̲n̲t̲ { 14 | return o̲p̲e̲r̲a̲n̲d̲ 15 | } 16 | } 17 | 18 | infix operator ≠: C̲o̲m̲p̲a̲r̲i̲s̲o̲n̲P̲r̲e̲c̲e̲d̲e̲n̲c̲e̲ 19 | 20 | precedencegroup LotsOfAttributes { 21 | associativity: r̲i̲g̲h̲t̲ 22 | higherThan: D̲o̲n̲e̲A̲f̲t̲e̲r̲, A̲l̲s̲o̲D̲o̲n̲e̲A̲f̲t̲e̲r̲ 23 | lowerThan: D̲o̲n̲e̲F̲i̲r̲s̲t̲, A̲l̲s̲o̲D̲o̲n̲e̲F̲i̲r̲s̲t̲ 24 | assignment: true 25 | } 26 | 27 | precedencegroup NoAttributes {} 28 | 29 | @available(*̲, unavailable) infix operator ≠≠ 30 | @available(*̲, unavailable) precedencegroup UnavailablePrecedence {} 31 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Aliasable Text/Overloads.txt: -------------------------------------------------------------------------------- 1 | /// Does something with a string. 2 | public func overloadedFunction(_ string: S̲t̲r̲i̲n̲g̲) {} 3 | /// Does something with a string. 4 | public func overloadedFunction(_ string: C̲h̲a̲r̲a̲c̲t̲e̲r̲) {} 5 | 6 | /// Does something with a number. 7 | public func overloadedFunction(_ number: I̲n̲t̲) {} 8 | 9 | extension B̲o̲o̲l̲ { 10 | public func overloadedMethod(_ specific: I̲n̲t̲) {} 11 | /// Does something with a number. 12 | public func overloadedMethod(_ general: T̲) where T̲ : N̲u̲m̲e̲r̲i̲c̲ {} 13 | public func overloadedMethod(_ general: T̲) where T̲ : S̲i̲g̲n̲e̲d̲N̲u̲m̲e̲r̲i̲c̲ {} 14 | } 15 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Aliasable Text/Package.txt: -------------------------------------------------------------------------------- 1 | /* 2 | Package.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift/SDGSwift 6 | 7 | Copyright ©2018 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | import PackageDescription 16 | 17 | let package = P̲a̲c̲k̲a̲g̲e̲( 18 | n̲a̲m̲e̲: "Package", 19 | p̲r̲o̲d̲u̲c̲t̲s̲: [ 20 | /// A library. 21 | /// 22 | /// It does stuff. 23 | .l̲i̲b̲r̲a̲r̲y̲(n̲a̲m̲e̲: "Library", t̲a̲r̲g̲e̲t̲s̲: ["Library"]) 24 | ], 25 | d̲e̲p̲e̲n̲d̲e̲n̲c̲i̲e̲s̲: [ 26 | .p̲a̲c̲k̲a̲g̲e̲(u̲r̲l̲: "https://domain.tld/Package", f̲r̲o̲m̲: V̲e̲r̲s̲i̲o̲n̲(1, 0, 0)) 27 | ], 28 | t̲a̲r̲g̲e̲t̲s̲: [ 29 | 30 | /** 31 | A library. 32 | 33 | It does stuff. 34 | */ 35 | .t̲a̲r̲g̲e̲t̲(n̲a̲m̲e̲: "Library", d̲e̲p̲e̲n̲d̲e̲n̲c̲i̲e̲s̲: [ 36 | "Target" 37 | ]), 38 | /// A target. 39 | .t̲a̲r̲g̲e̲t̲(n̲a̲m̲e̲: "Target", d̲e̲p̲e̲n̲d̲e̲n̲c̲i̲e̲s̲: []), 40 | .t̲e̲s̲t̲T̲a̲r̲g̲e̲t̲(n̲a̲m̲e̲: "Tests", d̲e̲p̲e̲n̲d̲e̲n̲c̲i̲e̲s̲: [ 41 | "Library", 42 | "Target" 43 | ]) 44 | ] 45 | ) 46 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Aliasable Text/Properties.txt: -------------------------------------------------------------------------------- 1 | extension I̲n̲t̲ { 2 | 3 | public let constantWithInferredType = 0 4 | 5 | // Escaped 6 | public let `var`: I̲n̲t̲ = 0 7 | 8 | public static let staticProperty: I̲n̲t̲ = 0 9 | 10 | public weak var optional: S̲o̲m̲e̲T̲y̲p̲e̲? 11 | 12 | public let (groupedInteger, groupedString) : (I̲n̲t̲, S̲t̲r̲i̲n̲g̲) = (0, "") 13 | 14 | public fileprivate(set) var fileprivateSetter = 0 15 | public private(set) var privateSetter = 0 16 | } 17 | 18 | public class ObjectiveCClass : N̲S̲O̲b̲j̲e̲c̲t̲ { 19 | @available(*̲, introduced: 4.2.1) @IBOutlet public weak static var delegate: N̲S̲O̲b̲j̲e̲c̲t̲? 20 | @NSCopying public var copyingProperty: N̲S̲S̲t̲r̲i̲n̲g̲ 21 | } 22 | 23 | @propertyWrapper public struct Wrapper {} 24 | 25 | public struct Structure { 26 | @W̲r̲a̲p̲p̲e̲r̲ public var wrapped: I̲n̲t̲ 27 | } 28 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Aliasable Text/Shebang.txt: -------------------------------------------------------------------------------- 1 | #!/usr/bin/swift 2 | 3 | p̲r̲i̲n̲t̲("Hello, world!") 4 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Aliasable Text/Structure.txt: -------------------------------------------------------------------------------- 1 | /* 2 | Structure.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift/SDGSwift 6 | 7 | Copyright ©2018 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | // This is a line comment. It contains a URL: http://example.com 16 | 17 | /* 18 | This is a multiline comment. 19 | /* 20 | It contains a nested comment. 21 | */ 22 | */ 23 | 24 | import Foundation 25 | 26 | typealias Alias = S̲t̲r̲u̲c̲t̲u̲r̲e̲ 27 | 28 | struct Structure { 29 | 30 | // MARK: - Static Properties 31 | 32 | static var staticProperty = 0 33 | 34 | // MARK: - Initialization 35 | 36 | init(property: B̲o̲o̲l̲) { 37 | self.p̲r̲o̲p̲e̲r̲t̲y̲ = p̲r̲o̲p̲e̲r̲t̲y̲ 38 | } 39 | 40 | // MARK: - Properties 41 | 42 | var property: B̲o̲o̲l̲ 43 | 44 | // MARK: - Methods 45 | 46 | func performAction() { 47 | p̲r̲o̲p̲e̲r̲t̲y̲ = true 48 | } 49 | 50 | subscript(index: I̲n̲t̲) -> I̲n̲t̲ { 51 | get { 52 | return i̲n̲d̲e̲x̲ 53 | } 54 | set { 55 | p̲r̲o̲p̲e̲r̲t̲y̲ = true 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Aliasable Text/Subclass.txt: -------------------------------------------------------------------------------- 1 | /* 2 | Subclass.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift/SDGSwift 6 | 7 | Copyright ©2018 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | class Subclass : B̲a̲s̲e̲C̲l̲a̲s̲s̲ { 16 | 17 | } 18 | 19 | #if canImport(XCTest) && (!(os(iOS) || os(watchOS) || os(tvOS)) || targetEnvironment(simulator)) // ... 20 | // MARK: - ... 21 | import XCTest 22 | 23 | /// ... 24 | open class TestCase : X̲C̲T̲e̲s̲t̲C̲a̲s̲e̲ { 25 | 26 | static var initialized = false 27 | /// ... 28 | open override func setUp() { 29 | super.s̲e̲t̲U̲p̲() 30 | } 31 | 32 | /// :nodoc: 33 | public func testLinuxMainGenerationCompatibility() {} 34 | } 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Aliasable Text/Subscripts.txt: -------------------------------------------------------------------------------- 1 | public struct Subscripted { 2 | 3 | public subscript(readOnly: I̲n̲t̲) -> I̲n̲t̲ { 4 | return r̲e̲a̲d̲O̲n̲l̲y̲ 5 | } 6 | 7 | public subscript(readWrite: S̲t̲r̲i̲n̲g̲) -> S̲t̲r̲i̲n̲g̲ { 8 | get { 9 | return r̲e̲a̲d̲W̲r̲i̲t̲e̲ 10 | } 11 | set { 12 | s̲o̲m̲e̲t̲h̲i̲n̲g̲ = r̲e̲a̲d̲W̲r̲i̲t̲e̲ 13 | } 14 | } 15 | 16 | public subscript(x x: I̲n̲t̲, y y: I̲n̲t̲) -> I̲n̲t̲ { 17 | return x̲ ×̲ y̲ 18 | } 19 | 20 | private subscript(private: U̲I̲n̲t̲) -> U̲I̲n̲t̲ { 21 | return `̲p̲r̲i̲v̲a̲t̲e̲`̲ 22 | } 23 | 24 | public subscript(inOutParameter: inout B̲o̲o̲l̲) -> B̲o̲o̲l̲ { 25 | return false 26 | } 27 | 28 | public subscript(unlabelledIndex: I̲n̲t̲) -> I̲n̲t̲ { 29 | return u̲n̲l̲a̲b̲e̲l̲l̲e̲d̲I̲n̲d̲e̲x̲ 30 | } 31 | } 32 | 33 | public struct AlsoSubscripted { 34 | public subscript(_ explicitlyUnlabelledIndex: I̲n̲t̲) -> I̲n̲t̲ { 35 | return e̲x̲p̲l̲i̲c̲i̲t̲l̲y̲U̲n̲l̲a̲b̲e̲l̲l̲e̲d̲I̲n̲d̲e̲x̲ 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Aliasable Text/Subtype.txt: -------------------------------------------------------------------------------- 1 | extension S̲t̲r̲i̲n̲g̲ { 2 | 3 | public struct Subtype : C̲u̲s̲t̲o̲m̲S̲t̲r̲i̲n̲g̲C̲o̲n̲v̲e̲r̲t̲i̲b̲l̲e̲ { 4 | 5 | internal init() {} 6 | 7 | public var description: S̲t̲r̲i̲n̲g̲ { 8 | return "" 9 | } 10 | } 11 | 12 | public typealias AliasedSubtype = I̲n̲t̲ 13 | } 14 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Aliasable Text/Unicode.txt: -------------------------------------------------------------------------------- 1 | /// Description. 2 | /// 3 | /// Discussion with Unicode in code voice: `©̲`. 4 | public var variable: S̲t̲r̲i̲n̲g̲ { 5 | return "" 6 | } 7 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Aliasable Text/WhereClauses.txt: -------------------------------------------------------------------------------- 1 | extension C̲o̲l̲l̲e̲c̲t̲i̲o̲n̲ where I̲n̲d̲e̲x̲ =̲=̲ E̲l̲e̲m̲e̲n̲t̲, I̲n̲d̲e̲x̲ : S̲i̲g̲n̲e̲d̲N̲u̲m̲e̲r̲i̲c̲, I̲n̲d̲e̲x̲ : C̲u̲s̲t̲o̲m̲S̲t̲r̲i̲n̲g̲C̲o̲n̲v̲e̲r̲t̲i̲b̲l̲e̲ { 2 | public func requiresReorderedConstraints() 3 | } 4 | 5 | extension C̲o̲l̲l̲e̲c̲t̲i̲o̲n̲ : C̲o̲n̲d̲i̲t̲i̲o̲n̲a̲l̲C̲o̲n̲f̲o̲r̲m̲a̲n̲c̲e̲ where I̲n̲d̲e̲x̲ =̲=̲ E̲l̲e̲m̲e̲n̲t̲, I̲n̲d̲e̲x̲ =̲=̲ I̲n̲t̲ {} 6 | 7 | extension B̲i̲d̲i̲r̲e̲c̲t̲i̲o̲n̲a̲l̲C̲o̲l̲l̲e̲c̲t̲i̲o̲n̲ { 8 | public func forward(_ range: R̲) -> R̲a̲n̲g̲e̲ where R̲.B̲o̲u̲n̲d̲ =̲=̲ R̲e̲v̲e̲r̲s̲e̲d̲C̲o̲l̲l̲e̲c̲t̲i̲o̲n̲.I̲n̲d̲e̲x̲ { 9 | f̲a̲t̲a̲l̲E̲r̲r̲o̲r̲() 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Arbitrary Text/BaseClass.txt: -------------------------------------------------------------------------------- 1 | /* 2 | ̲B̲a̲s̲e̲C̲l̲a̲s̲s̲.̲s̲w̲i̲f̲t̲ 3 | 4 | ̲T̲h̲i̲s̲ ̲s̲o̲u̲r̲c̲e̲ ̲f̲i̲l̲e̲ ̲i̲s̲ ̲p̲a̲r̲t̲ ̲o̲f̲ ̲t̲h̲e̲ ̲S̲D̲G̲S̲w̲i̲f̲t̲ ̲o̲p̲e̲n̲ ̲s̲o̲u̲r̲c̲e̲ ̲p̲r̲o̲j̲e̲c̲t̲.̲ 5 | ̲https://sdggiesbrecht.github.io/SDGSwift/SDGSwift 6 | 7 | ̲C̲o̲p̲y̲r̲i̲g̲h̲t̲ ̲©̲2̲0̲1̲8̲ ̲J̲e̲r̲e̲m̲y̲ ̲D̲a̲v̲i̲d̲ ̲G̲i̲e̲s̲b̲r̲e̲c̲h̲t̲ ̲a̲n̲d̲ ̲t̲h̲e̲ ̲S̲D̲G̲S̲w̲i̲f̲t̲ ̲p̲r̲o̲j̲e̲c̲t̲ ̲c̲o̲n̲t̲r̲i̲b̲u̲t̲o̲r̲s̲.̲ 8 | 9 | ̲S̲o̲l̲i̲ ̲D̲e̲o̲ ̲g̲l̲o̲r̲i̲a̲.̲ 10 | 11 | ̲L̲i̲c̲e̲n̲s̲e̲d̲ ̲u̲n̲d̲e̲r̲ ̲t̲h̲e̲ ̲A̲p̲a̲c̲h̲e̲ ̲L̲i̲c̲e̲n̲c̲e̲,̲ ̲V̲e̲r̲s̲i̲o̲n̲ ̲2̲.̲0̲.̲ 12 | ̲S̲e̲e̲ ̲http://www.apache.org/licenses/LICENSE-2.0 ̲f̲o̲r̲ ̲l̲i̲c̲e̲n̲c̲e̲ ̲i̲n̲f̲o̲r̲m̲a̲t̲i̲o̲n̲.̲ 13 | ̲*/ 14 | 15 | class ̲B̲a̲s̲e̲C̲l̲a̲s̲s̲ ̲{ 16 | 17 | } 18 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Arbitrary Text/Class.txt: -------------------------------------------------------------------------------- 1 | public ̲class ̲S̲u̲p̲e̲r̲c̲l̲a̲s̲s̲ ̲{ 2 | 3 | ̲ ̲ ̲ ̲public ̲required ̲init() ̲{} 4 | ̲ ̲ ̲ ̲public ̲convenience ̲init(p̲a̲r̲a̲m̲e̲t̲e̲r̲: ̲Bool) ̲{ 5 | ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲self.init() 6 | ̲ ̲ ̲ ̲} 7 | } 8 | 9 | public ̲final ̲class ̲F̲i̲n̲a̲l̲C̲l̲a̲s̲s̲ ̲{} 10 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Arbitrary Text/Extensions.txt: -------------------------------------------------------------------------------- 1 | public ̲enum ̲R̲o̲o̲t̲T̲y̲p̲e̲ ̲{} 2 | 3 | extension ̲RootType ̲{ 4 | ̲ ̲ ̲ ̲public ̲enum ̲I̲n̲t̲e̲r̲m̲e̲d̲i̲a̲t̲e̲T̲y̲p̲e̲ ̲{} 5 | } 6 | 7 | extension ̲RootType.IntermediateType ̲{ 8 | ̲ ̲ ̲ ̲public ̲enum ̲L̲e̲a̲f̲T̲y̲p̲e̲ ̲{} 9 | } 10 | 11 | extension ̲RootType.IntermediateType.LeafType ̲{ 12 | ̲ ̲ ̲ ̲public ̲enum ̲N̲e̲s̲t̲e̲d̲A̲b̲s̲u̲r̲d̲l̲y̲D̲e̲e̲p̲ ̲{} 13 | } 14 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Arbitrary Text/GenericProperties.txt: -------------------------------------------------------------------------------- 1 | extension ̲Integer ̲{ 2 | 3 | ̲ ̲ ̲ ̲public ̲var ̲s̲i̲n̲g̲l̲e̲D̲i̲g̲i̲t̲s̲: ̲Range ̲{ 4 | ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲return ̲0̲ ̲..< ̲9̲ 5 | ̲ ̲ ̲ ̲} 6 | } 7 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Arbitrary Text/GenericType.txt: -------------------------------------------------------------------------------- 1 | public ̲struct ̲G̲e̲n̲e̲r̲i̲c̲ ̲: ̲DeclaredConformanceOne, ̲DeclaredConformanceTwo ̲where ̲Thing ̲: ̲ConformanceRequiredByWhere ̲{ 2 | 3 | } 4 | 5 | public ̲struct ̲D̲o̲u̲b̲l̲e̲G̲e̲n̲e̲r̲i̲c̲ ̲{} 6 | 7 | public ̲struct ̲S̲t̲a̲n̲d̲a̲r̲d̲F̲o̲r̲m̲G̲e̲n̲e̲r̲i̲c̲ ̲where ̲Thing ̲: ̲Equatable ̲{} 8 | public ̲struct ̲D̲e̲p̲r̲e̲c̲a̲t̲e̲d̲F̲o̲r̲m̲G̲e̲n̲e̲r̲i̲c̲ ̲{} 9 | public ̲struct ̲D̲o̲u̲b̲l̲e̲d̲D̲e̲p̲r̲e̲c̲a̲t̲e̲d̲F̲o̲r̲m̲G̲e̲n̲e̲r̲i̲c̲ ̲{} 10 | 11 | public ̲struct ̲N̲e̲s̲t̲e̲d̲G̲e̲n̲e̲r̲i̲c̲C̲o̲n̲s̲t̲r̲a̲i̲n̲t̲ ̲where ̲Thing ̲: ̲Collection, ̲Thing.Element ̲: ̲Equatable, ̲Thing.Associated ̲== ̲Thing.Generic, ̲OtherThing ̲== ̲Generic ̲{} 12 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Arbitrary Text/Initializers.txt: -------------------------------------------------------------------------------- 1 | public ̲struct ̲I̲n̲i̲t̲i̲a̲l̲i̲z̲a̲b̲l̲e̲ ̲{ 2 | 3 | ̲ ̲ ̲ ̲public ̲init(x̲: ̲Int, ̲y̲: ̲Int) ̲{ 4 | 5 | ̲ ̲ ̲ ̲} 6 | 7 | ̲ ̲ ̲ ̲public ̲init?(s̲t̲r̲i̲n̲g̲: ̲String) ̲{ 8 | 9 | ̲ ̲ ̲ ̲} 10 | 11 | ̲ ̲ ̲ ̲public ̲init(t̲h̲r̲o̲w̲i̲n̲g̲: ̲Bool) ̲throws ̲{ 12 | 13 | ̲ ̲ ̲ ̲} 14 | 15 | ̲ ̲ ̲ ̲private ̲init(p̲r̲i̲v̲a̲t̲e̲: ̲UInt) ̲{} 16 | 17 | ̲ ̲ ̲ ̲public ̲init(_̲h̲i̲d̲d̲e̲n̲: ̲Bool) ̲{} 18 | } 19 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Arbitrary Text/Literals.txt: -------------------------------------------------------------------------------- 1 | /* 2 | ̲L̲i̲t̲e̲r̲a̲l̲s̲.̲s̲w̲i̲f̲t̲ 3 | 4 | ̲T̲h̲i̲s̲ ̲s̲o̲u̲r̲c̲e̲ ̲f̲i̲l̲e̲ ̲i̲s̲ ̲p̲a̲r̲t̲ ̲o̲f̲ ̲t̲h̲e̲ ̲S̲D̲G̲S̲w̲i̲f̲t̲ ̲o̲p̲e̲n̲ ̲s̲o̲u̲r̲c̲e̲ ̲p̲r̲o̲j̲e̲c̲t̲.̲ 5 | ̲https://sdggiesbrecht.github.io/SDGSwift/SDGSwift 6 | 7 | ̲C̲o̲p̲y̲r̲i̲g̲h̲t̲ ̲©̲2̲0̲1̲8̲ ̲J̲e̲r̲e̲m̲y̲ ̲D̲a̲v̲i̲d̲ ̲G̲i̲e̲s̲b̲r̲e̲c̲h̲t̲ ̲a̲n̲d̲ ̲t̲h̲e̲ ̲S̲D̲G̲S̲w̲i̲f̲t̲ ̲p̲r̲o̲j̲e̲c̲t̲ ̲c̲o̲n̲t̲r̲i̲b̲u̲t̲o̲r̲s̲.̲ 8 | 9 | ̲S̲o̲l̲i̲ ̲D̲e̲o̲ ̲g̲l̲o̲r̲i̲a̲.̲ 10 | 11 | ̲L̲i̲c̲e̲n̲s̲e̲d̲ ̲u̲n̲d̲e̲r̲ ̲t̲h̲e̲ ̲A̲p̲a̲c̲h̲e̲ ̲L̲i̲c̲e̲n̲c̲e̲,̲ ̲V̲e̲r̲s̲i̲o̲n̲ ̲2̲.̲0̲.̲ 12 | ̲S̲e̲e̲ ̲http://www.apache.org/licenses/LICENSE-2.0 ̲f̲o̲r̲ ̲l̲i̲c̲e̲n̲c̲e̲ ̲i̲n̲f̲o̲r̲m̲a̲t̲i̲o̲n̲.̲ 13 | ̲*/ 14 | 15 | let ̲s̲t̲r̲i̲n̲g̲ ̲= ̲"" 16 | 17 | let ̲i̲n̲t̲e̲r̲p̲o̲l̲a̲t̲e̲d̲ ̲= ̲"\(x) ̲+̲ ̲\(y)" 18 | 19 | let ̲d̲i̲c̲t̲i̲o̲n̲a̲r̲y̲ ̲= ̲[ 20 | ̲ ̲ ̲ ̲"A̲" ̲: ̲1̲, 21 | ̲ ̲ ̲ ̲"B̲" ̲: ̲2̲ 22 | ] 23 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Arbitrary Text/Methods.txt: -------------------------------------------------------------------------------- 1 | public ̲struct ̲S̲t̲r̲u̲c̲t̲u̲r̲e̲W̲i̲t̲h̲M̲e̲t̲h̲o̲d̲s̲ ̲{ 2 | 3 | ̲ ̲ ̲ ̲public ̲static ̲func ̲s̲t̲a̲t̲i̲c̲M̲e̲t̲h̲o̲d̲() ̲{} 4 | 5 | ̲ ̲ ̲ ̲public ̲mutating ̲func ̲m̲u̲t̲a̲t̲e̲S̲o̲m̲e̲t̲h̲i̲n̲g̲() ̲{ 6 | 7 | ̲ ̲ ̲ ̲} 8 | } 9 | 10 | extension ̲StructureWithMethods ̲{ 11 | ̲ ̲ ̲ ̲public ̲static ̲func ̲e̲x̲t̲e̲n̲s̲i̲o̲n̲S̲t̲a̲t̲i̲c̲M̲e̲t̲h̲o̲d̲() ̲{} 12 | } 13 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Arbitrary Text/Operators.txt: -------------------------------------------------------------------------------- 1 | extension ̲Bool ̲{ 2 | 3 | ̲ ̲ ̲ ̲public ̲static ̲func ̲+̲=̲ ̲(p̲r̲e̲c̲e̲d̲i̲n̲g̲V̲a̲l̲u̲e̲: ̲inout ̲Bool, ̲f̲o̲l̲l̲o̲w̲i̲n̲g̲V̲a̲l̲u̲e̲: ̲Bool) ̲{} 4 | ̲ ̲ ̲ ̲public ̲static ̲func ̲−̲ ̲(_ ̲e̲x̲p̲l̲i̲c̲i̲t̲l̲y̲U̲n̲l̲a̲b̲e̲l̲l̲e̲d̲P̲a̲r̲a̲m̲e̲t̲e̲r̲s̲: ̲Int, ̲_ ̲b̲: ̲Int) ̲-> ̲Int ̲{ 5 | ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲return ̲b 6 | ̲ ̲ ̲ ̲} 7 | } 8 | 9 | extension ̲Int ̲{ 10 | ̲ ̲ ̲ ̲public ̲static ̲prefix ̲func ̲−̲ ̲(o̲p̲e̲r̲a̲n̲d̲: ̲Int) ̲-> ̲Int ̲{ 11 | ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲return ̲operand 12 | ̲ ̲ ̲ ̲} 13 | ̲ ̲ ̲ ̲public ̲static ̲postfix ̲func ̲!̲ ̲(o̲p̲e̲r̲a̲n̲d̲: ̲Int) ̲-> ̲Int ̲{ 14 | ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲return ̲operand 15 | ̲ ̲ ̲ ̲} 16 | } 17 | 18 | infix ̲operator ̲≠̲: ̲ComparisonPrecedence 19 | 20 | precedencegroup ̲L̲o̲t̲s̲O̲f̲A̲t̲t̲r̲i̲b̲u̲t̲e̲s̲ ̲{ 21 | ̲ ̲ ̲ ̲associativity: ̲right 22 | ̲ ̲ ̲ ̲higherThan: ̲DoneAfter, ̲AlsoDoneAfter 23 | ̲ ̲ ̲ ̲lowerThan: ̲DoneFirst, ̲AlsoDoneFirst 24 | ̲ ̲ ̲ ̲assignment: ̲true 25 | } 26 | 27 | precedencegroup ̲N̲o̲A̲t̲t̲r̲i̲b̲u̲t̲e̲s̲ ̲{} 28 | 29 | @available(*, ̲unavailable) ̲infix ̲operator ̲≠̲≠̲ 30 | @available(*, ̲unavailable) ̲precedencegroup ̲U̲n̲a̲v̲a̲i̲l̲a̲b̲l̲e̲P̲r̲e̲c̲e̲d̲e̲n̲c̲e̲ ̲{} 31 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Arbitrary Text/Overloads.txt: -------------------------------------------------------------------------------- 1 | /// ̲D̲o̲e̲s̲ ̲s̲o̲m̲e̲t̲h̲i̲n̲g̲ ̲w̲i̲t̲h̲ ̲a̲ ̲s̲t̲r̲i̲n̲g̲.̲ 2 | public ̲func ̲o̲v̲e̲r̲l̲o̲a̲d̲e̲d̲F̲u̲n̲c̲t̲i̲o̲n̲(_ ̲s̲t̲r̲i̲n̲g̲: ̲String) ̲{} 3 | /// ̲D̲o̲e̲s̲ ̲s̲o̲m̲e̲t̲h̲i̲n̲g̲ ̲w̲i̲t̲h̲ ̲a̲ ̲s̲t̲r̲i̲n̲g̲.̲ 4 | public ̲func ̲o̲v̲e̲r̲l̲o̲a̲d̲e̲d̲F̲u̲n̲c̲t̲i̲o̲n̲(_ ̲s̲t̲r̲i̲n̲g̲: ̲Character) ̲{} 5 | 6 | /// ̲D̲o̲e̲s̲ ̲s̲o̲m̲e̲t̲h̲i̲n̲g̲ ̲w̲i̲t̲h̲ ̲a̲ ̲n̲u̲m̲b̲e̲r̲.̲ 7 | public ̲func ̲o̲v̲e̲r̲l̲o̲a̲d̲e̲d̲F̲u̲n̲c̲t̲i̲o̲n̲(_ ̲n̲u̲m̲b̲e̲r̲: ̲Int) ̲{} 8 | 9 | extension ̲Bool ̲{ 10 | ̲ ̲ ̲ ̲public ̲func ̲o̲v̲e̲r̲l̲o̲a̲d̲e̲d̲M̲e̲t̲h̲o̲d̲(_ ̲s̲p̲e̲c̲i̲f̲i̲c̲: ̲Int) ̲{} 11 | ̲ ̲ ̲ ̲/// ̲D̲o̲e̲s̲ ̲s̲o̲m̲e̲t̲h̲i̲n̲g̲ ̲w̲i̲t̲h̲ ̲a̲ ̲n̲u̲m̲b̲e̲r̲.̲ 12 | ̲ ̲ ̲ ̲public ̲func ̲o̲v̲e̲r̲l̲o̲a̲d̲e̲d̲M̲e̲t̲h̲o̲d̲(_ ̲g̲e̲n̲e̲r̲a̲l̲: ̲T) ̲where ̲T ̲: ̲Numeric ̲{} 13 | ̲ ̲ ̲ ̲public ̲func ̲o̲v̲e̲r̲l̲o̲a̲d̲e̲d̲M̲e̲t̲h̲o̲d̲(_ ̲g̲e̲n̲e̲r̲a̲l̲: ̲T) ̲where ̲T ̲: ̲SignedNumeric ̲{} 14 | } 15 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Arbitrary Text/Properties.txt: -------------------------------------------------------------------------------- 1 | extension ̲Int ̲{ 2 | 3 | ̲ ̲ ̲ ̲public ̲let ̲c̲o̲n̲s̲t̲a̲n̲t̲W̲i̲t̲h̲I̲n̲f̲e̲r̲r̲e̲d̲T̲y̲p̲e̲ ̲= ̲0̲ 4 | 5 | ̲ ̲ ̲ ̲// ̲E̲s̲c̲a̲p̲e̲d̲ 6 | ̲ ̲ ̲ ̲public ̲let ̲`̲v̲a̲r̲`̲: ̲Int ̲= ̲0̲ 7 | 8 | ̲ ̲ ̲ ̲public ̲static ̲let ̲s̲t̲a̲t̲i̲c̲P̲r̲o̲p̲e̲r̲t̲y̲: ̲Int ̲= ̲0̲ 9 | 10 | ̲ ̲ ̲ ̲public ̲weak ̲var ̲o̲p̲t̲i̲o̲n̲a̲l̲: ̲SomeType? 11 | 12 | ̲ ̲ ̲ ̲public ̲let ̲(g̲r̲o̲u̲p̲e̲d̲I̲n̲t̲e̲g̲e̲r̲, ̲g̲r̲o̲u̲p̲e̲d̲S̲t̲r̲i̲n̲g̲) ̲: ̲(Int, ̲String) ̲= ̲(0̲, ̲"") 13 | 14 | ̲ ̲ ̲ ̲public ̲fileprivate(set) ̲var ̲f̲i̲l̲e̲p̲r̲i̲v̲a̲t̲e̲S̲e̲t̲t̲e̲r̲ ̲= ̲0̲ 15 | ̲ ̲ ̲ ̲public ̲private(set) ̲var ̲p̲r̲i̲v̲a̲t̲e̲S̲e̲t̲t̲e̲r̲ ̲= ̲0̲ 16 | } 17 | 18 | public ̲class ̲O̲b̲j̲e̲c̲t̲i̲v̲e̲C̲C̲l̲a̲s̲s̲ ̲: ̲NSObject ̲{ 19 | ̲ ̲ ̲ ̲@available(*, ̲introduced: ̲4̲.̲2̲.1̲) ̲@IBOutlet ̲public ̲weak ̲static ̲var ̲d̲e̲l̲e̲g̲a̲t̲e̲: ̲NSObject? 20 | ̲ ̲ ̲ ̲@NSCopying ̲public ̲var ̲c̲o̲p̲y̲i̲n̲g̲P̲r̲o̲p̲e̲r̲t̲y̲: ̲NSString 21 | } 22 | 23 | @propertyWrapper ̲public ̲struct ̲W̲r̲a̲p̲p̲e̲r̲ ̲{} 24 | 25 | public ̲struct ̲S̲t̲r̲u̲c̲t̲u̲r̲e̲ ̲{ 26 | ̲ ̲@Wrapper ̲public ̲var ̲w̲r̲a̲p̲p̲e̲d̲: ̲Int 27 | } 28 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Arbitrary Text/Shebang.txt: -------------------------------------------------------------------------------- 1 | #!/usr/bin/swift 2 | 3 | print("H̲e̲l̲l̲o̲,̲ ̲w̲o̲r̲l̲d̲!̲") 4 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Arbitrary Text/Subclass.txt: -------------------------------------------------------------------------------- 1 | /* 2 | ̲S̲u̲b̲c̲l̲a̲s̲s̲.̲s̲w̲i̲f̲t̲ 3 | 4 | ̲T̲h̲i̲s̲ ̲s̲o̲u̲r̲c̲e̲ ̲f̲i̲l̲e̲ ̲i̲s̲ ̲p̲a̲r̲t̲ ̲o̲f̲ ̲t̲h̲e̲ ̲S̲D̲G̲S̲w̲i̲f̲t̲ ̲o̲p̲e̲n̲ ̲s̲o̲u̲r̲c̲e̲ ̲p̲r̲o̲j̲e̲c̲t̲.̲ 5 | ̲https://sdggiesbrecht.github.io/SDGSwift/SDGSwift 6 | 7 | ̲C̲o̲p̲y̲r̲i̲g̲h̲t̲ ̲©̲2̲0̲1̲8̲ ̲J̲e̲r̲e̲m̲y̲ ̲D̲a̲v̲i̲d̲ ̲G̲i̲e̲s̲b̲r̲e̲c̲h̲t̲ ̲a̲n̲d̲ ̲t̲h̲e̲ ̲S̲D̲G̲S̲w̲i̲f̲t̲ ̲p̲r̲o̲j̲e̲c̲t̲ ̲c̲o̲n̲t̲r̲i̲b̲u̲t̲o̲r̲s̲.̲ 8 | 9 | ̲S̲o̲l̲i̲ ̲D̲e̲o̲ ̲g̲l̲o̲r̲i̲a̲.̲ 10 | 11 | ̲L̲i̲c̲e̲n̲s̲e̲d̲ ̲u̲n̲d̲e̲r̲ ̲t̲h̲e̲ ̲A̲p̲a̲c̲h̲e̲ ̲L̲i̲c̲e̲n̲c̲e̲,̲ ̲V̲e̲r̲s̲i̲o̲n̲ ̲2̲.̲0̲.̲ 12 | ̲S̲e̲e̲ ̲http://www.apache.org/licenses/LICENSE-2.0 ̲f̲o̲r̲ ̲l̲i̲c̲e̲n̲c̲e̲ ̲i̲n̲f̲o̲r̲m̲a̲t̲i̲o̲n̲.̲ 13 | ̲*/ 14 | 15 | class ̲S̲u̲b̲c̲l̲a̲s̲s̲ ̲: ̲BaseClass ̲{ 16 | 17 | } 18 | 19 | #if ̲canImport(XCTest) ̲&& ̲(!(os(iOS) ̲|| ̲os(watchOS) ̲|| ̲os(tvOS)) ̲|| ̲targetEnvironment(simulator)) ̲// ̲.̲.̲.̲ 20 | // ̲MARK: - .̲.̲.̲ 21 | import ̲XCTest 22 | 23 | /// ̲.̲.̲.̲ 24 | open ̲class ̲T̲e̲s̲t̲C̲a̲s̲e̲ ̲: ̲XCTestCase ̲{ 25 | 26 | ̲ ̲ ̲ ̲static ̲var ̲i̲n̲i̲t̲i̲a̲l̲i̲z̲e̲d̲ ̲= ̲false 27 | ̲ ̲ ̲ ̲/// ̲.̲.̲.̲ 28 | ̲ ̲ ̲ ̲open ̲override ̲func ̲s̲e̲t̲U̲p̲() ̲{ 29 | ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲super.setUp() 30 | ̲ ̲ ̲ ̲} 31 | 32 | ̲ ̲ ̲ ̲/// ̲:̲n̲o̲d̲o̲c̲:̲ 33 | ̲ ̲ ̲ ̲public ̲func ̲t̲e̲s̲t̲L̲i̲n̲u̲x̲M̲a̲i̲n̲G̲e̲n̲e̲r̲a̲t̲i̲o̲n̲C̲o̲m̲p̲a̲t̲i̲b̲i̲l̲i̲t̲y̲() ̲{} 34 | } 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Arbitrary Text/Subscripts.txt: -------------------------------------------------------------------------------- 1 | public ̲struct ̲S̲u̲b̲s̲c̲r̲i̲p̲t̲e̲d̲ ̲{ 2 | 3 | ̲ ̲ ̲ ̲public ̲subscript(r̲e̲a̲d̲O̲n̲l̲y̲: ̲Int) ̲-> ̲Int ̲{ 4 | ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲return ̲readOnly 5 | ̲ ̲ ̲ ̲} 6 | 7 | ̲ ̲ ̲ ̲public ̲subscript(r̲e̲a̲d̲W̲r̲i̲t̲e̲: ̲String) ̲-> ̲String ̲{ 8 | ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲get ̲{ 9 | ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲return ̲readWrite 10 | ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲} 11 | ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲set ̲{ 12 | ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲something ̲= ̲readWrite 13 | ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲} 14 | ̲ ̲ ̲ ̲} 15 | 16 | ̲ ̲ ̲ ̲public ̲subscript(x̲ ̲x̲: ̲Int, ̲y̲ ̲y̲: ̲Int) ̲-> ̲Int ̲{ 17 | ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲return ̲x ̲× ̲y 18 | ̲ ̲ ̲ ̲} 19 | 20 | ̲ ̲ ̲ ̲private ̲subscript(p̲r̲i̲v̲a̲t̲e̲: ̲UInt) ̲-> ̲UInt ̲{ 21 | ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲return ̲`private` 22 | ̲ ̲ ̲ ̲} 23 | 24 | ̲ ̲ ̲ ̲public ̲subscript(i̲n̲O̲u̲t̲P̲a̲r̲a̲m̲e̲t̲e̲r̲: ̲inout ̲Bool) ̲-> ̲Bool ̲{ 25 | ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲return ̲false 26 | ̲ ̲ ̲ ̲} 27 | 28 | ̲ ̲ ̲ ̲public ̲subscript(u̲n̲l̲a̲b̲e̲l̲l̲e̲d̲I̲n̲d̲e̲x̲: ̲Int) ̲-> ̲Int ̲{ 29 | ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲return ̲unlabelledIndex 30 | ̲ ̲ ̲ ̲} 31 | } 32 | 33 | public ̲struct ̲A̲l̲s̲o̲S̲u̲b̲s̲c̲r̲i̲p̲t̲e̲d̲ ̲{ 34 | ̲ ̲ ̲ ̲public ̲subscript(_ ̲e̲x̲p̲l̲i̲c̲i̲t̲l̲y̲U̲n̲l̲a̲b̲e̲l̲l̲e̲d̲I̲n̲d̲e̲x̲: ̲Int) ̲-> ̲Int ̲{ 35 | ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲return ̲explicitlyUnlabelledIndex 36 | ̲ ̲ ̲ ̲} 37 | } 38 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Arbitrary Text/Subtype.txt: -------------------------------------------------------------------------------- 1 | extension ̲String ̲{ 2 | 3 | ̲ ̲ ̲ ̲public ̲struct ̲S̲u̲b̲t̲y̲p̲e̲ ̲: ̲CustomStringConvertible ̲{ 4 | 5 | ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲internal ̲init() ̲{} 6 | 7 | ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲public ̲var ̲d̲e̲s̲c̲r̲i̲p̲t̲i̲o̲n̲: ̲String ̲{ 8 | ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲return ̲"" 9 | ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲} 10 | ̲ ̲ ̲ ̲} 11 | 12 | ̲ ̲ ̲ ̲public ̲typealias ̲A̲l̲i̲a̲s̲e̲d̲S̲u̲b̲t̲y̲p̲e̲ ̲= ̲Int 13 | } 14 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Arbitrary Text/Unicode.txt: -------------------------------------------------------------------------------- 1 | /// ̲D̲e̲s̲c̲r̲i̲p̲t̲i̲o̲n̲.̲ 2 | /// 3 | /// ̲D̲i̲s̲c̲u̲s̲s̲i̲o̲n̲ ̲w̲i̲t̲h̲ ̲U̲n̲i̲c̲o̲d̲e̲ ̲i̲n̲ ̲c̲o̲d̲e̲ ̲v̲o̲i̲c̲e̲:̲ ̲`©`.̲ 4 | public ̲var ̲v̲a̲r̲i̲a̲b̲l̲e̲: ̲String ̲{ 5 | ̲ ̲ ̲ ̲return ̲"" 6 | } 7 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Arbitrary Text/WhereClauses.txt: -------------------------------------------------------------------------------- 1 | extension ̲Collection ̲where ̲Index ̲== ̲Element, ̲Index ̲: ̲SignedNumeric, ̲Index ̲: ̲CustomStringConvertible ̲{ 2 | ̲ ̲ ̲ ̲public ̲func ̲r̲e̲q̲u̲i̲r̲e̲s̲R̲e̲o̲r̲d̲e̲r̲e̲d̲C̲o̲n̲s̲t̲r̲a̲i̲n̲t̲s̲() 3 | } 4 | 5 | extension ̲Collection ̲: ̲ConditionalConformance ̲where ̲Index ̲== ̲Element, ̲Index ̲== ̲Int ̲{} 6 | 7 | extension ̲BidirectionalCollection ̲{ 8 | ̲ ̲ ̲ ̲public ̲func ̲f̲o̲r̲w̲a̲r̲d̲(_ ̲r̲a̲n̲g̲e̲: ̲R) ̲-> ̲Range ̲where ̲R.Bound ̲== ̲ReversedCollection.Index ̲{ 9 | ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲fatalError() 10 | ̲ ̲ ̲ ̲} 11 | } 12 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Invariable Text/BaseClass.txt: -------------------------------------------------------------------------------- 1 | /̲*̲ 2 | ̲ BaseClass.swift 3 | ̲ 4 | ̲ This source file is part of the SDGSwift open source project. 5 | ̲ h̲t̲t̲p̲s̲:̲/̲/̲s̲d̲g̲g̲i̲e̲s̲b̲r̲e̲c̲h̲t̲.̲g̲i̲t̲h̲u̲b̲.̲i̲o̲/̲S̲D̲G̲S̲w̲i̲f̲t̲/̲S̲D̲G̲S̲w̲i̲f̲t̲ 6 | ̲ 7 | ̲ Copyright ©2018 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | ̲ 9 | ̲ Soli Deo gloria. 10 | ̲ 11 | ̲ Licensed under the Apache Licence, Version 2.0. 12 | ̲ See h̲t̲t̲p̲:̲/̲/̲w̲w̲w̲.̲a̲p̲a̲c̲h̲e̲.̲o̲r̲g̲/̲l̲i̲c̲e̲n̲s̲e̲s̲/̲L̲I̲C̲E̲N̲S̲E̲-̲2̲.̲0̲ for licence information. 13 | ̲ *̲/̲ 14 | ̲ 15 | ̲c̲l̲a̲s̲s̲ BaseClass {̲ 16 | ̲ 17 | ̲}̲ 18 | ̲ -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Invariable Text/Class.txt: -------------------------------------------------------------------------------- 1 | p̲u̲b̲l̲i̲c̲ c̲l̲a̲s̲s̲ Superclass {̲ 2 | ̲ 3 | ̲ p̲u̲b̲l̲i̲c̲ r̲e̲q̲u̲i̲r̲e̲d̲ i̲n̲i̲t̲(̲)̲ {̲}̲ 4 | ̲ p̲u̲b̲l̲i̲c̲ c̲o̲n̲v̲e̲n̲i̲e̲n̲c̲e̲ i̲n̲i̲t̲(̲parameter:̲ Bool)̲ {̲ 5 | ̲ s̲e̲l̲f̲.̲i̲n̲i̲t̲(̲)̲ 6 | ̲ }̲ 7 | ̲}̲ 8 | ̲ 9 | ̲p̲u̲b̲l̲i̲c̲ f̲i̲n̲a̲l̲ c̲l̲a̲s̲s̲ FinalClass {̲}̲ 10 | ̲ -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Invariable Text/Conformance.txt: -------------------------------------------------------------------------------- 1 | p̲u̲b̲l̲i̲c̲ s̲t̲r̲u̲c̲t̲ Conforming :̲ CustomStringConvertible {̲ 2 | ̲ 3 | ̲ p̲u̲b̲l̲i̲c̲ v̲a̲r̲ description:̲ String {̲ 4 | ̲ r̲e̲t̲u̲r̲n̲ "̲"̲ 5 | ̲ }̲ 6 | ̲}̲ 7 | ̲ 8 | ̲p̲u̲b̲l̲i̲c̲ p̲r̲o̲t̲o̲c̲o̲l̲ BaseProtocol {̲ 9 | ̲ f̲u̲n̲c̲ baseProtocolMethod(̲)̲ 10 | ̲ a̲s̲s̲o̲c̲i̲a̲t̲e̲d̲t̲y̲p̲e̲ AssociatedType 11 | ̲ i̲n̲i̲t̲(̲)̲ 12 | ̲ v̲a̲r̲ protocolVariable:̲ Int 13 | ̲ s̲u̲b̲s̲c̲r̲i̲p̲t̲(̲protocolSubscript:̲ Int)̲ -̲>̲ Int {̲ g̲e̲t̲ }̲ 14 | ̲}̲ 15 | ̲p̲u̲b̲l̲i̲c̲ p̲r̲o̲t̲o̲c̲o̲l̲ MoreSpecificProtocol :̲ BaseProtocol {̲ 16 | ̲ f̲u̲n̲c̲ moreSpecificProtocolMethod(̲)̲ 17 | ̲}̲ 18 | ̲p̲u̲b̲l̲i̲c̲ s̲t̲r̲u̲c̲t̲ Structure :̲ MoreSpecificProtocol {̲ 19 | ̲ p̲u̲b̲l̲i̲c̲ f̲u̲n̲c̲ baseProtocolMethod(̲)̲ 20 | ̲ p̲u̲b̲l̲i̲c̲ f̲u̲n̲c̲ moreSpecificProtocolMethod(̲)̲ 21 | ̲ p̲u̲b̲l̲i̲c̲ t̲y̲p̲e̲a̲l̲i̲a̲s̲ AssociatedType =̲ Int 22 | ̲ p̲u̲b̲l̲i̲c̲ i̲n̲i̲t̲(̲)̲ {̲}̲ 23 | ̲ p̲u̲b̲l̲i̲c̲ v̲a̲r̲ protocolVariable:̲ Int =̲ 0 24 | ̲ p̲u̲b̲l̲i̲c̲ s̲u̲b̲s̲c̲r̲i̲p̲t̲(̲protocolSubscript:̲ Int)̲ -̲>̲ Int {̲ r̲e̲t̲u̲r̲n̲ 0 }̲ 25 | ̲}̲ 26 | ̲ 27 | ̲p̲u̲b̲l̲i̲c̲ c̲l̲a̲s̲s̲ BaseClass {̲ 28 | ̲ p̲u̲b̲l̲i̲c̲ f̲u̲n̲c̲ baseClassMethod(̲)̲ {̲}̲ 29 | ̲}̲ 30 | ̲p̲u̲b̲l̲i̲c̲ c̲l̲a̲s̲s̲ Subclass :̲ BaseClass {̲ 31 | ̲ p̲u̲b̲l̲i̲c̲ o̲v̲e̲r̲r̲i̲d̲e̲ f̲u̲n̲c̲ baseClassMethod(̲)̲ {̲}̲ 32 | ̲}̲ 33 | ̲ -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Invariable Text/ControlFlow.txt: -------------------------------------------------------------------------------- 1 | /̲*̲ 2 | ̲ ControlFlow.swift 3 | ̲ 4 | ̲ This source file is part of the SDGSwift open source project. 5 | ̲ h̲t̲t̲p̲s̲:̲/̲/̲s̲d̲g̲g̲i̲e̲s̲b̲r̲e̲c̲h̲t̲.̲g̲i̲t̲h̲u̲b̲.̲i̲o̲/̲S̲D̲G̲S̲w̲i̲f̲t̲/̲S̲D̲G̲S̲w̲i̲f̲t̲ 6 | ̲ 7 | ̲ Copyright ©2018 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | ̲ 9 | ̲ Soli Deo gloria. 10 | ̲ 11 | ̲ Licensed under the Apache Licence, Version 2.0. 12 | ̲ See h̲t̲t̲p̲:̲/̲/̲w̲w̲w̲.̲a̲p̲a̲c̲h̲e̲.̲o̲r̲g̲/̲l̲i̲c̲e̲n̲s̲e̲s̲/̲L̲I̲C̲E̲N̲S̲E̲-̲2̲.̲0̲ for licence information. 13 | ̲ *̲/̲ 14 | ̲ 15 | ̲f̲u̲n̲c̲ main(̲)̲ {̲ 16 | ̲ 17 | ̲ i̲f̲ number.̲isIrrational {̲ 18 | ̲ number.̲round(̲)̲ 19 | ̲ }̲ 20 | ̲ 21 | ̲ f̲o̲r̲ element i̲n̲ [̲1,̲ 2,̲ 3]̲ {̲ 22 | ̲ 23 | ̲ }̲ 24 | ̲ 25 | ̲ l̲e̲t̲ trailingClosure =̲ [̲1,̲ 2,̲ 3]̲.̲filter {̲ (̲number:̲ Int)̲ -̲>̲ Bool i̲n̲ 26 | ̲ r̲e̲t̲u̲r̲n̲ number == 1 27 | ̲ }̲ 28 | ̲ 29 | ̲ l̲e̲t̲ number =̲ 1 30 | ̲ s̲w̲i̲t̲c̲h̲ number {̲ 31 | ̲ c̲a̲s̲e̲ 1:̲ 32 | ̲ print(̲"̲one"̲)̲ 33 | ̲ d̲e̲f̲a̲u̲l̲t̲:̲ 34 | ̲ print(̲"̲default"̲)̲ 35 | ̲ }̲ 36 | ̲ 37 | ̲ g̲u̲a̲r̲d̲ boolean == t̲r̲u̲e̲ e̲l̲s̲e̲ {̲ 38 | ̲ preconditionFailure(̲)̲ 39 | ̲ }̲ 40 | ̲ 41 | ̲ w̲h̲i̲l̲e̲ something {̲ 42 | ̲ /̲/̲ Wait. 43 | ̲ }̲ 44 | ̲ 45 | ̲ r̲e̲p̲e̲a̲t̲ {̲ 46 | ̲ someTask(̲)̲ 47 | ̲ }̲ w̲h̲i̲l̲e̲ time < 10 48 | ̲}̲ 49 | ̲ -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Invariable Text/Extensions.txt: -------------------------------------------------------------------------------- 1 | p̲u̲b̲l̲i̲c̲ e̲n̲u̲m̲ RootType {̲}̲ 2 | ̲ 3 | ̲e̲x̲t̲e̲n̲s̲i̲o̲n̲ RootType {̲ 4 | ̲ p̲u̲b̲l̲i̲c̲ e̲n̲u̲m̲ IntermediateType {̲}̲ 5 | ̲}̲ 6 | ̲ 7 | ̲e̲x̲t̲e̲n̲s̲i̲o̲n̲ RootType.̲IntermediateType {̲ 8 | ̲ p̲u̲b̲l̲i̲c̲ e̲n̲u̲m̲ LeafType {̲}̲ 9 | ̲}̲ 10 | ̲ 11 | ̲e̲x̲t̲e̲n̲s̲i̲o̲n̲ RootType.̲IntermediateType.̲LeafType {̲ 12 | ̲ p̲u̲b̲l̲i̲c̲ e̲n̲u̲m̲ NestedAbsurdlyDeep {̲}̲ 13 | ̲}̲ 14 | ̲ -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Invariable Text/GenericProperties.txt: -------------------------------------------------------------------------------- 1 | e̲x̲t̲e̲n̲s̲i̲o̲n̲ Integer {̲ 2 | ̲ 3 | ̲ p̲u̲b̲l̲i̲c̲ v̲a̲r̲ singleDigits:̲ Range<̲S̲e̲l̲f̲>̲ {̲ 4 | ̲ r̲e̲t̲u̲r̲n̲ 0 ..< 9 5 | ̲ }̲ 6 | ̲}̲ 7 | ̲ -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Invariable Text/GenericType.txt: -------------------------------------------------------------------------------- 1 | p̲u̲b̲l̲i̲c̲ s̲t̲r̲u̲c̲t̲ Generic<̲Thing :̲ RequiredConformance>̲ :̲ DeclaredConformanceOne,̲ DeclaredConformanceTwo w̲h̲e̲r̲e̲ Thing :̲ ConformanceRequiredByWhere {̲ 2 | ̲ 3 | ̲}̲ 4 | ̲ 5 | ̲p̲u̲b̲l̲i̲c̲ s̲t̲r̲u̲c̲t̲ DoubleGeneric<̲ThingA,̲ ThingB>̲ {̲}̲ 6 | ̲ 7 | ̲p̲u̲b̲l̲i̲c̲ s̲t̲r̲u̲c̲t̲ StandardFormGeneric<̲Thing>̲ w̲h̲e̲r̲e̲ Thing :̲ Equatable {̲}̲ 8 | ̲p̲u̲b̲l̲i̲c̲ s̲t̲r̲u̲c̲t̲ DeprecatedFormGeneric<̲Thing :̲ Equatable>̲ {̲}̲ 9 | ̲p̲u̲b̲l̲i̲c̲ s̲t̲r̲u̲c̲t̲ DoubledDeprecatedFormGeneric<̲ThingA :̲ Equatable,̲ ThingB :̲ Equatable>̲ {̲}̲ 10 | ̲ 11 | ̲p̲u̲b̲l̲i̲c̲ s̲t̲r̲u̲c̲t̲ NestedGenericConstraint<̲Thing>̲ w̲h̲e̲r̲e̲ Thing :̲ Collection,̲ Thing.̲Element :̲ Equatable,̲ Thing.̲Associated == Thing.̲Generic<̲Int>̲,̲ OtherThing == Generic<̲Int>̲ {̲}̲ 12 | ̲ -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Invariable Text/Initializers.txt: -------------------------------------------------------------------------------- 1 | p̲u̲b̲l̲i̲c̲ s̲t̲r̲u̲c̲t̲ Initializable {̲ 2 | ̲ 3 | ̲ p̲u̲b̲l̲i̲c̲ i̲n̲i̲t̲(̲x:̲ Int,̲ y:̲ Int)̲ {̲ 4 | ̲ 5 | ̲ }̲ 6 | ̲ 7 | ̲ p̲u̲b̲l̲i̲c̲ i̲n̲i̲t̲?̲(̲string:̲ String)̲ {̲ 8 | ̲ 9 | ̲ }̲ 10 | ̲ 11 | ̲ p̲u̲b̲l̲i̲c̲ i̲n̲i̲t̲(̲throwing:̲ Bool)̲ t̲h̲r̲o̲w̲s̲ {̲ 12 | ̲ 13 | ̲ }̲ 14 | ̲ 15 | ̲ p̲r̲i̲v̲a̲t̲e̲ i̲n̲i̲t̲(̲private:̲ UInt)̲ {̲}̲ 16 | ̲ 17 | ̲ p̲u̲b̲l̲i̲c̲ i̲n̲i̲t̲(̲_hidden:̲ Bool)̲ {̲}̲ 18 | ̲}̲ 19 | ̲ -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Invariable Text/Literals.txt: -------------------------------------------------------------------------------- 1 | /̲*̲ 2 | ̲ Literals.swift 3 | ̲ 4 | ̲ This source file is part of the SDGSwift open source project. 5 | ̲ h̲t̲t̲p̲s̲:̲/̲/̲s̲d̲g̲g̲i̲e̲s̲b̲r̲e̲c̲h̲t̲.̲g̲i̲t̲h̲u̲b̲.̲i̲o̲/̲S̲D̲G̲S̲w̲i̲f̲t̲/̲S̲D̲G̲S̲w̲i̲f̲t̲ 6 | ̲ 7 | ̲ Copyright ©2018 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | ̲ 9 | ̲ Soli Deo gloria. 10 | ̲ 11 | ̲ Licensed under the Apache Licence, Version 2.0. 12 | ̲ See h̲t̲t̲p̲:̲/̲/̲w̲w̲w̲.̲a̲p̲a̲c̲h̲e̲.̲o̲r̲g̲/̲l̲i̲c̲e̲n̲s̲e̲s̲/̲L̲I̲C̲E̲N̲S̲E̲-̲2̲.̲0̲ for licence information. 13 | ̲ *̲/̲ 14 | ̲ 15 | ̲l̲e̲t̲ string =̲ "̲"̲ 16 | ̲ 17 | ̲l̲e̲t̲ interpolated =̲ "̲\̲(̲x)̲ + \̲(̲y)̲"̲ 18 | ̲ 19 | ̲l̲e̲t̲ dictionary =̲ [̲ 20 | ̲ "̲A"̲ :̲ 1,̲ 21 | ̲ "̲B"̲ :̲ 2 22 | ̲]̲ 23 | ̲ -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Invariable Text/Methods.txt: -------------------------------------------------------------------------------- 1 | p̲u̲b̲l̲i̲c̲ s̲t̲r̲u̲c̲t̲ StructureWithMethods {̲ 2 | ̲ 3 | ̲ p̲u̲b̲l̲i̲c̲ s̲t̲a̲t̲i̲c̲ f̲u̲n̲c̲ staticMethod(̲)̲ {̲}̲ 4 | ̲ 5 | ̲ p̲u̲b̲l̲i̲c̲ m̲u̲t̲a̲t̲i̲n̲g̲ f̲u̲n̲c̲ mutateSomething(̲)̲ {̲ 6 | ̲ 7 | ̲ }̲ 8 | ̲}̲ 9 | ̲ 10 | ̲e̲x̲t̲e̲n̲s̲i̲o̲n̲ StructureWithMethods {̲ 11 | ̲ p̲u̲b̲l̲i̲c̲ s̲t̲a̲t̲i̲c̲ f̲u̲n̲c̲ extensionStaticMethod(̲)̲ {̲}̲ 12 | ̲}̲ 13 | ̲ -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Invariable Text/Operators.txt: -------------------------------------------------------------------------------- 1 | e̲x̲t̲e̲n̲s̲i̲o̲n̲ Bool {̲ 2 | ̲ 3 | ̲ p̲u̲b̲l̲i̲c̲ s̲t̲a̲t̲i̲c̲ f̲u̲n̲c̲ += (̲precedingValue:̲ i̲n̲o̲u̲t̲ Bool,̲ followingValue:̲ Bool)̲ {̲}̲ 4 | ̲ p̲u̲b̲l̲i̲c̲ s̲t̲a̲t̲i̲c̲ f̲u̲n̲c̲ − (̲_̲ explicitlyUnlabelledParameters:̲ Int,̲ _̲ b:̲ Int)̲ -̲>̲ Int {̲ 5 | ̲ r̲e̲t̲u̲r̲n̲ b 6 | ̲ }̲ 7 | ̲}̲ 8 | ̲ 9 | ̲e̲x̲t̲e̲n̲s̲i̲o̲n̲ Int {̲ 10 | ̲ p̲u̲b̲l̲i̲c̲ s̲t̲a̲t̲i̲c̲ p̲r̲e̲f̲i̲x̲ f̲u̲n̲c̲ − (̲operand:̲ Int)̲ -̲>̲ Int {̲ 11 | ̲ r̲e̲t̲u̲r̲n̲ operand 12 | ̲ }̲ 13 | ̲ p̲u̲b̲l̲i̲c̲ s̲t̲a̲t̲i̲c̲ p̲o̲s̲t̲f̲i̲x̲ f̲u̲n̲c̲ ! (̲operand:̲ Int)̲ -̲>̲ Int {̲ 14 | ̲ r̲e̲t̲u̲r̲n̲ operand 15 | ̲ }̲ 16 | ̲}̲ 17 | ̲ 18 | ̲i̲n̲f̲i̲x̲ o̲p̲e̲r̲a̲t̲o̲r̲ ≠:̲ ComparisonPrecedence 19 | ̲ 20 | ̲p̲r̲e̲c̲e̲d̲e̲n̲c̲e̲g̲r̲o̲u̲p̲ LotsOfAttributes {̲ 21 | ̲ a̲s̲s̲o̲c̲i̲a̲t̲i̲v̲i̲t̲y̲:̲ right 22 | ̲ h̲i̲g̲h̲e̲r̲T̲h̲a̲n̲:̲ DoneAfter,̲ AlsoDoneAfter 23 | ̲ l̲o̲w̲e̲r̲T̲h̲a̲n̲:̲ DoneFirst,̲ AlsoDoneFirst 24 | ̲ a̲s̲s̲i̲g̲n̲m̲e̲n̲t̲:̲ t̲r̲u̲e̲ 25 | ̲}̲ 26 | ̲ 27 | ̲p̲r̲e̲c̲e̲d̲e̲n̲c̲e̲g̲r̲o̲u̲p̲ NoAttributes {̲}̲ 28 | ̲ 29 | ̲@̲a̲v̲a̲i̲l̲a̲b̲l̲e̲(̲*,̲ u̲n̲a̲v̲a̲i̲l̲a̲b̲l̲e̲)̲ i̲n̲f̲i̲x̲ o̲p̲e̲r̲a̲t̲o̲r̲ ≠≠ 30 | ̲@̲a̲v̲a̲i̲l̲a̲b̲l̲e̲(̲*,̲ u̲n̲a̲v̲a̲i̲l̲a̲b̲l̲e̲)̲ p̲r̲e̲c̲e̲d̲e̲n̲c̲e̲g̲r̲o̲u̲p̲ UnavailablePrecedence {̲}̲ 31 | ̲ -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Invariable Text/Overloads.txt: -------------------------------------------------------------------------------- 1 | /̲/̲/̲ Does something with a string. 2 | ̲p̲u̲b̲l̲i̲c̲ f̲u̲n̲c̲ overloadedFunction(̲_̲ string:̲ String)̲ {̲}̲ 3 | ̲/̲/̲/̲ Does something with a string. 4 | ̲p̲u̲b̲l̲i̲c̲ f̲u̲n̲c̲ overloadedFunction(̲_̲ string:̲ Character)̲ {̲}̲ 5 | ̲ 6 | ̲/̲/̲/̲ Does something with a number. 7 | ̲p̲u̲b̲l̲i̲c̲ f̲u̲n̲c̲ overloadedFunction(̲_̲ number:̲ Int)̲ {̲}̲ 8 | ̲ 9 | ̲e̲x̲t̲e̲n̲s̲i̲o̲n̲ Bool {̲ 10 | ̲ p̲u̲b̲l̲i̲c̲ f̲u̲n̲c̲ overloadedMethod(̲_̲ specific:̲ Int)̲ {̲}̲ 11 | ̲ /̲/̲/̲ Does something with a number. 12 | ̲ p̲u̲b̲l̲i̲c̲ f̲u̲n̲c̲ overloadedMethod<̲T>̲(̲_̲ general:̲ T)̲ w̲h̲e̲r̲e̲ T :̲ Numeric {̲}̲ 13 | ̲ p̲u̲b̲l̲i̲c̲ f̲u̲n̲c̲ overloadedMethod<̲T>̲(̲_̲ general:̲ T)̲ w̲h̲e̲r̲e̲ T :̲ SignedNumeric {̲}̲ 14 | ̲}̲ 15 | ̲ -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Invariable Text/Properties.txt: -------------------------------------------------------------------------------- 1 | e̲x̲t̲e̲n̲s̲i̲o̲n̲ Int {̲ 2 | ̲ 3 | ̲ p̲u̲b̲l̲i̲c̲ l̲e̲t̲ constantWithInferredType =̲ 0 4 | ̲ 5 | ̲ /̲/̲ Escaped 6 | ̲ p̲u̲b̲l̲i̲c̲ l̲e̲t̲ `var`:̲ Int =̲ 0 7 | ̲ 8 | ̲ p̲u̲b̲l̲i̲c̲ s̲t̲a̲t̲i̲c̲ l̲e̲t̲ staticProperty:̲ Int =̲ 0 9 | ̲ 10 | ̲ p̲u̲b̲l̲i̲c̲ w̲e̲a̲k̲ v̲a̲r̲ optional:̲ SomeType?̲ 11 | ̲ 12 | ̲ p̲u̲b̲l̲i̲c̲ l̲e̲t̲ (̲groupedInteger,̲ groupedString)̲ :̲ (̲Int,̲ String)̲ =̲ (̲0,̲ "̲"̲)̲ 13 | ̲ 14 | ̲ p̲u̲b̲l̲i̲c̲ f̲i̲l̲e̲p̲r̲i̲v̲a̲t̲e̲(̲s̲e̲t̲)̲ v̲a̲r̲ fileprivateSetter =̲ 0 15 | ̲ p̲u̲b̲l̲i̲c̲ p̲r̲i̲v̲a̲t̲e̲(̲s̲e̲t̲)̲ v̲a̲r̲ privateSetter =̲ 0 16 | ̲}̲ 17 | ̲ 18 | ̲p̲u̲b̲l̲i̲c̲ c̲l̲a̲s̲s̲ ObjectiveCClass :̲ NSObject {̲ 19 | ̲ @̲a̲v̲a̲i̲l̲a̲b̲l̲e̲(̲*,̲ i̲n̲t̲r̲o̲d̲u̲c̲e̲d̲:̲ 4.2.̲1)̲ @̲I̲B̲O̲u̲t̲l̲e̲t̲ p̲u̲b̲l̲i̲c̲ w̲e̲a̲k̲ s̲t̲a̲t̲i̲c̲ v̲a̲r̲ delegate:̲ NSObject?̲ 20 | ̲ @̲N̲S̲C̲o̲p̲y̲i̲n̲g̲ p̲u̲b̲l̲i̲c̲ v̲a̲r̲ copyingProperty:̲ NSString 21 | ̲}̲ 22 | ̲ 23 | ̲@̲p̲r̲o̲p̲e̲r̲t̲y̲W̲r̲a̲p̲p̲e̲r̲ p̲u̲b̲l̲i̲c̲ s̲t̲r̲u̲c̲t̲ Wrapper {̲}̲ 24 | ̲ 25 | ̲p̲u̲b̲l̲i̲c̲ s̲t̲r̲u̲c̲t̲ Structure {̲ 26 | ̲ @̲Wrapper p̲u̲b̲l̲i̲c̲ v̲a̲r̲ wrapped:̲ Int 27 | ̲}̲ 28 | ̲ -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Invariable Text/Shebang.txt: -------------------------------------------------------------------------------- 1 | #̲!̲/̲u̲s̲r̲/̲b̲i̲n̲/̲s̲w̲i̲f̲t̲ 2 | ̲ 3 | ̲print(̲"̲Hello, world!"̲)̲ 4 | ̲ -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Invariable Text/Subclass.txt: -------------------------------------------------------------------------------- 1 | /̲*̲ 2 | ̲ Subclass.swift 3 | ̲ 4 | ̲ This source file is part of the SDGSwift open source project. 5 | ̲ h̲t̲t̲p̲s̲:̲/̲/̲s̲d̲g̲g̲i̲e̲s̲b̲r̲e̲c̲h̲t̲.̲g̲i̲t̲h̲u̲b̲.̲i̲o̲/̲S̲D̲G̲S̲w̲i̲f̲t̲/̲S̲D̲G̲S̲w̲i̲f̲t̲ 6 | ̲ 7 | ̲ Copyright ©2018 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | ̲ 9 | ̲ Soli Deo gloria. 10 | ̲ 11 | ̲ Licensed under the Apache Licence, Version 2.0. 12 | ̲ See h̲t̲t̲p̲:̲/̲/̲w̲w̲w̲.̲a̲p̲a̲c̲h̲e̲.̲o̲r̲g̲/̲l̲i̲c̲e̲n̲s̲e̲s̲/̲L̲I̲C̲E̲N̲S̲E̲-̲2̲.̲0̲ for licence information. 13 | ̲ *̲/̲ 14 | ̲ 15 | ̲c̲l̲a̲s̲s̲ Subclass :̲ BaseClass {̲ 16 | ̲ 17 | ̲}̲ 18 | ̲ 19 | ̲#̲i̲f̲ c̲a̲n̲I̲m̲p̲o̲r̲t̲(̲X̲C̲T̲e̲s̲t̲)̲ &̲&̲ (̲!̲(̲o̲s̲(̲i̲O̲S̲)̲ |̲|̲ o̲s̲(̲w̲a̲t̲c̲h̲O̲S̲)̲ |̲|̲ o̲s̲(̲t̲v̲O̲S̲)̲)̲ |̲|̲ t̲a̲r̲g̲e̲t̲E̲n̲v̲i̲r̲o̲n̲m̲e̲n̲t̲(̲s̲i̲m̲u̲l̲a̲t̲o̲r̲)̲)̲ /̲/̲ ... 20 | ̲/̲/̲ M̲A̲R̲K̲:̲ ̲-̲ ̲... 21 | ̲i̲m̲p̲o̲r̲t̲ X̲C̲T̲e̲s̲t̲ 22 | ̲ 23 | ̲/̲/̲/̲ ... 24 | ̲o̲p̲e̲n̲ c̲l̲a̲s̲s̲ TestCase :̲ XCTestCase {̲ 25 | ̲ 26 | ̲ s̲t̲a̲t̲i̲c̲ v̲a̲r̲ initialized =̲ f̲a̲l̲s̲e̲ 27 | ̲ /̲/̲/̲ ... 28 | ̲ o̲p̲e̲n̲ o̲v̲e̲r̲r̲i̲d̲e̲ f̲u̲n̲c̲ setUp(̲)̲ {̲ 29 | ̲ s̲u̲p̲e̲r̲.̲setUp(̲)̲ 30 | ̲ }̲ 31 | ̲ 32 | ̲ /̲/̲/̲ :nodoc: 33 | ̲ p̲u̲b̲l̲i̲c̲ f̲u̲n̲c̲ testLinuxMainGenerationCompatibility(̲)̲ {̲}̲ 34 | ̲}̲ 35 | ̲ 36 | ̲#̲e̲n̲d̲i̲f̲ 37 | ̲ -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Invariable Text/Subscripts.txt: -------------------------------------------------------------------------------- 1 | p̲u̲b̲l̲i̲c̲ s̲t̲r̲u̲c̲t̲ Subscripted {̲ 2 | ̲ 3 | ̲ p̲u̲b̲l̲i̲c̲ s̲u̲b̲s̲c̲r̲i̲p̲t̲(̲readOnly:̲ Int)̲ -̲>̲ Int {̲ 4 | ̲ r̲e̲t̲u̲r̲n̲ readOnly 5 | ̲ }̲ 6 | ̲ 7 | ̲ p̲u̲b̲l̲i̲c̲ s̲u̲b̲s̲c̲r̲i̲p̲t̲(̲readWrite:̲ String)̲ -̲>̲ String {̲ 8 | ̲ g̲e̲t̲ {̲ 9 | ̲ r̲e̲t̲u̲r̲n̲ readWrite 10 | ̲ }̲ 11 | ̲ s̲e̲t̲ {̲ 12 | ̲ something =̲ readWrite 13 | ̲ }̲ 14 | ̲ }̲ 15 | ̲ 16 | ̲ p̲u̲b̲l̲i̲c̲ s̲u̲b̲s̲c̲r̲i̲p̲t̲(̲x x:̲ Int,̲ y y:̲ Int)̲ -̲>̲ Int {̲ 17 | ̲ r̲e̲t̲u̲r̲n̲ x × y 18 | ̲ }̲ 19 | ̲ 20 | ̲ p̲r̲i̲v̲a̲t̲e̲ s̲u̲b̲s̲c̲r̲i̲p̲t̲(̲private:̲ UInt)̲ -̲>̲ UInt {̲ 21 | ̲ r̲e̲t̲u̲r̲n̲ `private` 22 | ̲ }̲ 23 | ̲ 24 | ̲ p̲u̲b̲l̲i̲c̲ s̲u̲b̲s̲c̲r̲i̲p̲t̲(̲inOutParameter:̲ i̲n̲o̲u̲t̲ Bool)̲ -̲>̲ Bool {̲ 25 | ̲ r̲e̲t̲u̲r̲n̲ f̲a̲l̲s̲e̲ 26 | ̲ }̲ 27 | ̲ 28 | ̲ p̲u̲b̲l̲i̲c̲ s̲u̲b̲s̲c̲r̲i̲p̲t̲(̲unlabelledIndex:̲ Int)̲ -̲>̲ Int {̲ 29 | ̲ r̲e̲t̲u̲r̲n̲ unlabelledIndex 30 | ̲ }̲ 31 | ̲}̲ 32 | ̲ 33 | ̲p̲u̲b̲l̲i̲c̲ s̲t̲r̲u̲c̲t̲ AlsoSubscripted {̲ 34 | ̲ p̲u̲b̲l̲i̲c̲ s̲u̲b̲s̲c̲r̲i̲p̲t̲(̲_̲ explicitlyUnlabelledIndex:̲ Int)̲ -̲>̲ Int {̲ 35 | ̲ r̲e̲t̲u̲r̲n̲ explicitlyUnlabelledIndex 36 | ̲ }̲ 37 | ̲}̲ 38 | ̲ -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Invariable Text/Subtype.txt: -------------------------------------------------------------------------------- 1 | e̲x̲t̲e̲n̲s̲i̲o̲n̲ String {̲ 2 | ̲ 3 | ̲ p̲u̲b̲l̲i̲c̲ s̲t̲r̲u̲c̲t̲ Subtype :̲ CustomStringConvertible {̲ 4 | ̲ 5 | ̲ i̲n̲t̲e̲r̲n̲a̲l̲ i̲n̲i̲t̲(̲)̲ {̲}̲ 6 | ̲ 7 | ̲ p̲u̲b̲l̲i̲c̲ v̲a̲r̲ description:̲ String {̲ 8 | ̲ r̲e̲t̲u̲r̲n̲ "̲"̲ 9 | ̲ }̲ 10 | ̲ }̲ 11 | ̲ 12 | ̲ p̲u̲b̲l̲i̲c̲ t̲y̲p̲e̲a̲l̲i̲a̲s̲ AliasedSubtype =̲ Int 13 | ̲}̲ 14 | ̲ -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Invariable Text/Unicode.txt: -------------------------------------------------------------------------------- 1 | /̲/̲/̲ Description. 2 | ̲/̲/̲/̲ 3 | ̲/̲/̲/̲ Discussion with Unicode in code voice: `̲©`̲. 4 | ̲p̲u̲b̲l̲i̲c̲ v̲a̲r̲ variable:̲ String {̲ 5 | ̲ r̲e̲t̲u̲r̲n̲ "̲"̲ 6 | ̲}̲ 7 | ̲ -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/After/Invariable Text/WhereClauses.txt: -------------------------------------------------------------------------------- 1 | e̲x̲t̲e̲n̲s̲i̲o̲n̲ Collection w̲h̲e̲r̲e̲ Index == Element,̲ Index :̲ SignedNumeric,̲ Index :̲ CustomStringConvertible {̲ 2 | ̲ p̲u̲b̲l̲i̲c̲ f̲u̲n̲c̲ requiresReorderedConstraints(̲)̲ 3 | ̲}̲ 4 | ̲ 5 | ̲e̲x̲t̲e̲n̲s̲i̲o̲n̲ Collection :̲ ConditionalConformance w̲h̲e̲r̲e̲ Index == Element,̲ Index == Int {̲}̲ 6 | ̲ 7 | ̲e̲x̲t̲e̲n̲s̲i̲o̲n̲ BidirectionalCollection {̲ 8 | ̲ p̲u̲b̲l̲i̲c̲ f̲u̲n̲c̲ forward<̲R>̲(̲_̲ range:̲ R)̲ -̲>̲ Range<̲S̲e̲l̲f̲.̲Index>̲ w̲h̲e̲r̲e̲ R.̲Bound == ReversedCollection<̲S̲e̲l̲f̲>̲.̲Index {̲ 9 | ̲ fatalError(̲)̲ 10 | ̲ }̲ 11 | ̲}̲ 12 | ̲ -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/Before/Attributes.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /// Documentation before hidden attribute. 4 | @_specialize(kind: full, where T == Int) public func withHiddenAttribute(_ parameter: T) {} 5 | 6 | @available(*, unavailable) public func unavailable() {} 7 | @available(*, introduced: 4.2.1) public func introduced() {} 8 | @available(*, deprecated: 4.2.1) public func deprecated() {} 9 | @available(*, obsoleted: 4.2.1) public func obsoleted() {} 10 | 11 | public class ObjectiveCObject : NSObject { 12 | @objc public func objectiveCMethod() {} 13 | @nonobjc public func swiftOnlyMethod() {} 14 | } 15 | 16 | @inlinable public func inlineable() {} 17 | 18 | public func escaping(closure: @escaping () -> Void) {} 19 | public func auto(closure: @autoclosure () -> Void) {} 20 | @discardableResult public func discardableResult() -> Bool 21 | 22 | extension ObjectiveCObject { 23 | @available(*, introduced: 4.2.1) @objc @discardableResult public func everything(_ closure: @escaping @autoclosure () -> Void) {} 24 | } 25 | 26 | @available(swift, introduced: 4.0, message: "Message.") public func introductionMessage() {} 27 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/Before/BaseClass.swift: -------------------------------------------------------------------------------- 1 | /* 2 | BaseClass.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift/SDGSwift 6 | 7 | Copyright ©2018 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | class BaseClass { 16 | 17 | } 18 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/Before/Class.swift: -------------------------------------------------------------------------------- 1 | public class Superclass { 2 | 3 | public required init() {} 4 | public convenience init(parameter: Bool) { 5 | self.init() 6 | } 7 | } 8 | 9 | public final class FinalClass {} 10 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/Before/Conformance.swift: -------------------------------------------------------------------------------- 1 | public struct Conforming : CustomStringConvertible { 2 | 3 | public var description: String { 4 | return "" 5 | } 6 | } 7 | 8 | public protocol BaseProtocol { 9 | func baseProtocolMethod() 10 | associatedtype AssociatedType 11 | init() 12 | var protocolVariable: Int 13 | subscript(protocolSubscript: Int) -> Int { get } 14 | } 15 | public protocol MoreSpecificProtocol : BaseProtocol { 16 | func moreSpecificProtocolMethod() 17 | } 18 | public struct Structure : MoreSpecificProtocol { 19 | public func baseProtocolMethod() 20 | public func moreSpecificProtocolMethod() 21 | public typealias AssociatedType = Int 22 | public init() {} 23 | public var protocolVariable: Int = 0 24 | public subscript(protocolSubscript: Int) -> Int { return 0 } 25 | } 26 | 27 | public class BaseClass { 28 | public func baseClassMethod() {} 29 | } 30 | public class Subclass : BaseClass { 31 | public override func baseClassMethod() {} 32 | } 33 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/Before/ControlFlow.swift: -------------------------------------------------------------------------------- 1 | /* 2 | ControlFlow.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift/SDGSwift 6 | 7 | Copyright ©2018 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | func main() { 16 | 17 | if number.isIrrational { 18 | number.round() 19 | } 20 | 21 | for element in [1, 2, 3] { 22 | 23 | } 24 | 25 | let trailingClosure = [1, 2, 3].filter { (number: Int) -> Bool in 26 | return number == 1 27 | } 28 | 29 | let number = 1 30 | switch number { 31 | case 1: 32 | print("one") 33 | default: 34 | print("default") 35 | } 36 | 37 | guard boolean == true else { 38 | preconditionFailure() 39 | } 40 | 41 | while something { 42 | // Wait. 43 | } 44 | 45 | repeat { 46 | someTask() 47 | } while time < 10 48 | } 49 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/Before/DocumentedExtension.swift: -------------------------------------------------------------------------------- 1 | /* 2 | DocumentedExtension.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift/SDGSwift 6 | 7 | Copyright ©2018 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | extension Bool { 16 | 17 | /// A read‐only computed property. 18 | public var readOnlyComputedProperty: Bool { 19 | return self 20 | } 21 | 22 | /// A read‐only computed property with an internal setter. 23 | public internal(set) var readOnlyWithInternalSetter: Bool { 24 | get { 25 | return self 26 | } 27 | set { 28 | self = newValue 29 | } 30 | } 31 | 32 | /// A read‐write computed property. 33 | public var readWriteComputedProperty: Bool { 34 | get { 35 | return self 36 | } 37 | set { 38 | self = newValue 39 | } 40 | } 41 | } 42 | 43 | // Nothing surfaced to the API. 44 | extension AnySequence { 45 | 46 | var notPublic: Bool 47 | } 48 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/Before/Enumeration.swift: -------------------------------------------------------------------------------- 1 | /* 2 | Enumeration.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift/SDGSwift 6 | 7 | Copyright ©2018 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | enum InternalEnumeration { 16 | case a 17 | case b 18 | case c 19 | } 20 | 21 | public enum Enumeration { 22 | case a 23 | case b 24 | case c, d 25 | } 26 | 27 | public enum RawEnumeration: String { 28 | case a = "A" 29 | case b = "B" 30 | case c = "C" 31 | } 32 | 33 | public enum EnumerationWithAssociatedValues { 34 | case none 35 | case one(Bool) 36 | case two(Bool, Bool) 37 | } 38 | 39 | public enum EnumerationWithAvailablitiyRestrictions { 40 | @available(*, unavailable, renamed: "new") case old 41 | case new 42 | } 43 | 44 | public enum IndirectEnumeration { 45 | indirect case indirectCase 46 | } 47 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/Before/Extensions.swift: -------------------------------------------------------------------------------- 1 | public enum RootType {} 2 | 3 | extension RootType { 4 | public enum IntermediateType {} 5 | } 6 | 7 | extension RootType.IntermediateType { 8 | public enum LeafType {} 9 | } 10 | 11 | extension RootType.IntermediateType.LeafType { 12 | public enum NestedAbsurdlyDeep {} 13 | } 14 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/Before/GenericProperties.swift: -------------------------------------------------------------------------------- 1 | extension Integer { 2 | 3 | public var singleDigits: Range { 4 | return 0 ..< 9 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/Before/GenericType.swift: -------------------------------------------------------------------------------- 1 | public struct Generic : DeclaredConformanceOne, DeclaredConformanceTwo where Thing : ConformanceRequiredByWhere { 2 | 3 | } 4 | 5 | public struct DoubleGeneric {} 6 | 7 | public struct StandardFormGeneric where Thing : Equatable {} 8 | public struct DeprecatedFormGeneric {} 9 | public struct DoubledDeprecatedFormGeneric {} 10 | 11 | public struct NestedGenericConstraint where Thing : Collection, Thing.Element : Equatable, Thing.Associated == Thing.Generic, OtherThing == Generic {} 12 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/Before/Initializers.swift: -------------------------------------------------------------------------------- 1 | public struct Initializable { 2 | 3 | public init(x: Int, y: Int) { 4 | 5 | } 6 | 7 | public init?(string: String) { 8 | 9 | } 10 | 11 | public init(throwing: Bool) throws { 12 | 13 | } 14 | 15 | private init(private: UInt) {} 16 | 17 | public init(_hidden: Bool) {} 18 | } 19 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/Before/Literals.swift: -------------------------------------------------------------------------------- 1 | /* 2 | Literals.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift/SDGSwift 6 | 7 | Copyright ©2018 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | let string = "" 16 | 17 | let interpolated = "\(x) + \(y)" 18 | 19 | let dictionary = [ 20 | "A" : 1, 21 | "B" : 2 22 | ] 23 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/Before/Methods.swift: -------------------------------------------------------------------------------- 1 | public struct StructureWithMethods { 2 | 3 | public static func staticMethod() {} 4 | 5 | public mutating func mutateSomething() { 6 | 7 | } 8 | } 9 | 10 | extension StructureWithMethods { 11 | public static func extensionStaticMethod() {} 12 | } 13 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/Before/Operators.swift: -------------------------------------------------------------------------------- 1 | extension Bool { 2 | 3 | public static func += (precedingValue: inout Bool, followingValue: Bool) {} 4 | public static func − (_ explicitlyUnlabelledParameters: Int, _ b: Int) -> Int { 5 | return b 6 | } 7 | } 8 | 9 | extension Int { 10 | public static prefix func − (operand: Int) -> Int { 11 | return operand 12 | } 13 | public static postfix func ! (operand: Int) -> Int { 14 | return operand 15 | } 16 | } 17 | 18 | infix operator ≠: ComparisonPrecedence 19 | 20 | precedencegroup LotsOfAttributes { 21 | associativity: right 22 | higherThan: DoneAfter, AlsoDoneAfter 23 | lowerThan: DoneFirst, AlsoDoneFirst 24 | assignment: true 25 | } 26 | 27 | precedencegroup NoAttributes {} 28 | 29 | @available(*, unavailable) infix operator ≠≠ 30 | @available(*, unavailable) precedencegroup UnavailablePrecedence {} 31 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/Before/Overloads.swift: -------------------------------------------------------------------------------- 1 | /// Does something with a string. 2 | public func overloadedFunction(_ string: String) {} 3 | /// Does something with a string. 4 | public func overloadedFunction(_ string: Character) {} 5 | 6 | /// Does something with a number. 7 | public func overloadedFunction(_ number: Int) {} 8 | 9 | extension Bool { 10 | public func overloadedMethod(_ specific: Int) {} 11 | /// Does something with a number. 12 | public func overloadedMethod(_ general: T) where T : Numeric {} 13 | public func overloadedMethod(_ general: T) where T : SignedNumeric {} 14 | } 15 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/Before/Package.swift: -------------------------------------------------------------------------------- 1 | /* 2 | Package.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift/SDGSwift 6 | 7 | Copyright ©2018 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | import PackageDescription 16 | 17 | let package = Package( 18 | name: "Package", 19 | products: [ 20 | /// A library. 21 | /// 22 | /// It does stuff. 23 | .library(name: "Library", targets: ["Library"]) 24 | ], 25 | dependencies: [ 26 | .package(url: "https://domain.tld/Package", from: Version(1, 0, 0)) 27 | ], 28 | targets: [ 29 | 30 | /** 31 | A library. 32 | 33 | It does stuff. 34 | */ 35 | .target(name: "Library", dependencies: [ 36 | "Target" 37 | ]), 38 | /// A target. 39 | .target(name: "Target", dependencies: []), 40 | .testTarget(name: "Tests", dependencies: [ 41 | "Library", 42 | "Target" 43 | ]) 44 | ] 45 | ) 46 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/Before/Properties.swift: -------------------------------------------------------------------------------- 1 | extension Int { 2 | 3 | public let constantWithInferredType = 0 4 | 5 | // Escaped 6 | public let `var`: Int = 0 7 | 8 | public static let staticProperty: Int = 0 9 | 10 | public weak var optional: SomeType? 11 | 12 | public let (groupedInteger, groupedString) : (Int, String) = (0, "") 13 | 14 | public fileprivate(set) var fileprivateSetter = 0 15 | public private(set) var privateSetter = 0 16 | } 17 | 18 | public class ObjectiveCClass : NSObject { 19 | @available(*, introduced: 4.2.1) @IBOutlet public weak static var delegate: NSObject? 20 | @NSCopying public var copyingProperty: NSString 21 | } 22 | 23 | @propertyWrapper public struct Wrapper {} 24 | 25 | public struct Structure { 26 | @Wrapper public var wrapped: Int 27 | } 28 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/Before/Shebang.swift: -------------------------------------------------------------------------------- 1 | #!/usr/bin/swift 2 | 3 | print("Hello, world!") 4 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/Before/Structure.swift: -------------------------------------------------------------------------------- 1 | /* 2 | Structure.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift/SDGSwift 6 | 7 | Copyright ©2018 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | // This is a line comment. It contains a URL: http://example.com 16 | 17 | /* 18 | This is a multiline comment. 19 | /* 20 | It contains a nested comment. 21 | */ 22 | */ 23 | 24 | import Foundation 25 | 26 | typealias Alias = Structure 27 | 28 | struct Structure { 29 | 30 | // MARK: - Static Properties 31 | 32 | static var staticProperty = 0 33 | 34 | // MARK: - Initialization 35 | 36 | init(property: Bool) { 37 | self.property = property 38 | } 39 | 40 | // MARK: - Properties 41 | 42 | var property: Bool 43 | 44 | // MARK: - Methods 45 | 46 | func performAction() { 47 | property = true 48 | } 49 | 50 | subscript(index: Int) -> Int { 51 | get { 52 | return index 53 | } 54 | set { 55 | property = true 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/Before/Subclass.swift: -------------------------------------------------------------------------------- 1 | /* 2 | Subclass.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift/SDGSwift 6 | 7 | Copyright ©2018 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | class Subclass : BaseClass { 16 | 17 | } 18 | 19 | #if canImport(XCTest) && (!(os(iOS) || os(watchOS) || os(tvOS)) || targetEnvironment(simulator)) // ... 20 | // MARK: - ... 21 | import XCTest 22 | 23 | /// ... 24 | open class TestCase : XCTestCase { 25 | 26 | static var initialized = false 27 | /// ... 28 | open override func setUp() { 29 | super.setUp() 30 | } 31 | 32 | /// :nodoc: 33 | public func testLinuxMainGenerationCompatibility() {} 34 | } 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/Before/Subscripts.swift: -------------------------------------------------------------------------------- 1 | public struct Subscripted { 2 | 3 | public subscript(readOnly: Int) -> Int { 4 | return readOnly 5 | } 6 | 7 | public subscript(readWrite: String) -> String { 8 | get { 9 | return readWrite 10 | } 11 | set { 12 | something = readWrite 13 | } 14 | } 15 | 16 | public subscript(x x: Int, y y: Int) -> Int { 17 | return x × y 18 | } 19 | 20 | private subscript(private: UInt) -> UInt { 21 | return `private` 22 | } 23 | 24 | public subscript(inOutParameter: inout Bool) -> Bool { 25 | return false 26 | } 27 | 28 | public subscript(unlabelledIndex: Int) -> Int { 29 | return unlabelledIndex 30 | } 31 | } 32 | 33 | public struct AlsoSubscripted { 34 | public subscript(_ explicitlyUnlabelledIndex: Int) -> Int { 35 | return explicitlyUnlabelledIndex 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/Before/Subtype.swift: -------------------------------------------------------------------------------- 1 | extension String { 2 | 3 | public struct Subtype : CustomStringConvertible { 4 | 5 | internal init() {} 6 | 7 | public var description: String { 8 | return "" 9 | } 10 | } 11 | 12 | public typealias AliasedSubtype = Int 13 | } 14 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/Before/Unicode.swift: -------------------------------------------------------------------------------- 1 | /// Description. 2 | /// 3 | /// Discussion with Unicode in code voice: `©`. 4 | public var variable: String { 5 | return "" 6 | } 7 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Source/Before/WhereClauses.swift: -------------------------------------------------------------------------------- 1 | extension Collection where Index == Element, Index : SignedNumeric, Index : CustomStringConvertible { 2 | public func requiresReorderedConstraints() 3 | } 4 | 5 | extension Collection : ConditionalConformance where Index == Element, Index == Int {} 6 | 7 | extension BidirectionalCollection { 8 | public func forward(_ range: R) -> Range where R.Bound == ReversedCollection.Index { 9 | fatalError() 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Test Coverage/Source.swift: -------------------------------------------------------------------------------- 1 | /* 2 | Source.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2018–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | func covered() -> Bool { 16 | return true 17 | } 18 | 19 | func notCovered() -> Bool { 20 | return true 21 | } 22 | 23 | var `switch` = false 24 | func branching() -> Bool { 25 | if `switch` { 26 | return true 27 | } else { 28 | return true 29 | } 30 | } 31 | 32 | var 😀 = false 33 | func withSupplementalPlaneCharacters() -> Bool { 34 | if 😀 { 35 | return true 36 | } 37 | return false 38 | } 39 | 40 | func acceptClosure(_ closure: () -> Void) { 41 | closure() 42 | } 43 | func useClosure() { 44 | acceptClosure({ 45 | if `switch` { 46 | return 47 | } else { 48 | return 49 | } 50 | }) 51 | } 52 | 53 | var should = true 54 | func ifElseStatement() -> Bool { 55 | if should { 56 | return true 57 | } else { 58 | return false 59 | } 60 | } 61 | 62 | func useCompleteRangeOperator() { 63 | let array: [Bool] = [] 64 | _ = array[...] 65 | } 66 | -------------------------------------------------------------------------------- /Tests/Test Specifications/Test Coverage/Tests.swift: -------------------------------------------------------------------------------- 1 | /* 2 | Tests.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2018–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | import XCTest 16 | @testable import Mock 17 | 18 | final class MockTests: XCTestCase { 19 | 20 | func testCoverage() { 21 | _ = covered() 22 | 23 | `switch` = false 24 | _ = branching() 25 | useClosure() 26 | `switch` = true 27 | _ = branching() 28 | useClosure() 29 | 30 | _ = withSupplementalPlaneCharacters() 31 | 32 | _ = ifElseStatement() 33 | 34 | _ = useCompleteRangeOperator() 35 | } 36 | 37 | static var allTests = [ 38 | ("testCoverage", testCoverage) 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /Workspace.swift: -------------------------------------------------------------------------------- 1 | /* 2 | Workspace.swift 3 | 4 | This source file is part of the SDGSwift open source project. 5 | https://sdggiesbrecht.github.io/SDGSwift 6 | 7 | Copyright ©2018–2024 Jeremy David Giesbrecht and the SDGSwift project contributors. 8 | 9 | Soli Deo gloria. 10 | 11 | Licensed under the Apache Licence, Version 2.0. 12 | See http://www.apache.org/licenses/LICENSE-2.0 for licence information. 13 | */ 14 | 15 | import WorkspaceConfiguration 16 | 17 | let configuration = WorkspaceConfiguration() 18 | configuration._applySDGDefaults() 19 | 20 | configuration.documentation.currentVersion = Version(14, 0, 0) 21 | 22 | configuration.documentation.projectWebsite = URL( 23 | string: "https://sdggiesbrecht.github.io/SDGSwift" 24 | )! 25 | configuration.documentation.documentationURL = URL( 26 | string: "https://sdggiesbrecht.github.io/SDGSwift" 27 | )! 28 | configuration.documentation.api.yearFirstPublished = 2018 29 | configuration.documentation.repositoryURL = URL( 30 | string: "https://github.com/SDGGiesbrecht/SDGSwift" 31 | )! 32 | 33 | configuration.documentation.localizations = ["🇨🇦EN"] 34 | 35 | configuration._applySDGOverrides() 36 | configuration._validateSDGStandards() 37 | 38 | configuration.repository.ignoredPaths.insert("Tests/Test Specifications/Source") 39 | configuration.testing.exemptPaths.insert("Sources/SampleConfiguration") 40 | --------------------------------------------------------------------------------