-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update for Swift6, Swift testing and add editor config (#6)
Co-authored-by: Tim Sneath <[email protected]>
- Loading branch information
Showing
5 changed files
with
53 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# editorconfig.org | ||
|
||
root = true | ||
|
||
[*.swift] | ||
indent_style = space | ||
indent_size = 2 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,39 @@ | ||
// swift-tools-version: 5.9 | ||
// swift-tools-version: 6.0 | ||
import PackageDescription | ||
|
||
let dependencies: [Target.Dependency] = [ | ||
.product(name: "Algorithms", package: "swift-algorithms"), | ||
.product(name: "Collections", package: "swift-collections"), | ||
.product(name: "ArgumentParser", package: "swift-argument-parser"), | ||
.product(name: "Algorithms", package: "swift-algorithms"), | ||
.product(name: "Collections", package: "swift-collections"), | ||
.product(name: "ArgumentParser", package: "swift-argument-parser"), | ||
] | ||
|
||
let package = Package( | ||
name: "AdventOfCode", | ||
platforms: [.macOS(.v13), .iOS(.v16), .watchOS(.v9), .tvOS(.v16)], | ||
dependencies: [ | ||
.package( | ||
url: "https://github.com/apple/swift-algorithms.git", | ||
.upToNextMajor(from: "1.2.0")), | ||
.package( | ||
url: "https://github.com/apple/swift-collections.git", | ||
.upToNextMajor(from: "1.0.0")), | ||
.package( | ||
url: "https://github.com/apple/swift-argument-parser.git", | ||
.upToNextMajor(from: "1.2.0")), | ||
.package( | ||
url: "https://github.com/apple/swift-format.git", | ||
.upToNextMajor(from: "509.0.0")) | ||
], | ||
targets: [ | ||
.executableTarget( | ||
name: "AdventOfCode", | ||
dependencies: dependencies, | ||
resources: [.copy("Data")], | ||
swiftSettings: [.enableUpcomingFeature("BareSlashRegexLiterals")] | ||
), | ||
.testTarget( | ||
name: "AdventOfCodeTests", | ||
dependencies: ["AdventOfCode"] + dependencies, | ||
swiftSettings: [.enableUpcomingFeature("BareSlashRegexLiterals")] | ||
) | ||
] | ||
name: "AdventOfCode", | ||
platforms: [.macOS(.v13), .iOS(.v16), .watchOS(.v9), .tvOS(.v16)], | ||
dependencies: [ | ||
.package( | ||
url: "https://github.com/apple/swift-algorithms.git", | ||
.upToNextMajor(from: "1.2.0")), | ||
.package( | ||
url: "https://github.com/apple/swift-collections.git", | ||
.upToNextMajor(from: "1.1.4")), | ||
.package( | ||
url: "https://github.com/apple/swift-argument-parser.git", | ||
.upToNextMajor(from: "1.5.0")), | ||
.package( | ||
url: "https://github.com/swiftformat/swift-format.git", | ||
.upToNextMajor(from: "600.0.0")) | ||
], | ||
targets: [ | ||
.executableTarget( | ||
name: "AdventOfCode", | ||
dependencies: dependencies, | ||
resources: [.copy("Data")] | ||
), | ||
.testTarget( | ||
name: "AdventOfCodeTests", | ||
dependencies: ["AdventOfCode"] + dependencies | ||
) | ||
], | ||
swiftLanguageModes: [.v6] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
import XCTest | ||
import Testing | ||
|
||
@testable import AdventOfCode | ||
|
||
// One off test to validate that basic data load testing works | ||
final class AdventDayTests: XCTestCase { | ||
func testInitData() throws { | ||
struct AdventDayTests { | ||
|
||
@Test func testInitData() async throws { | ||
let challenge = Day00() | ||
XCTAssertTrue(challenge.data.starts(with: "4514")) | ||
#expect(challenge.data.starts(with: "4514")) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters