Skip to content

Commit

Permalink
use Testing instead of XCTest
Browse files Browse the repository at this point in the history
  • Loading branch information
gereons committed Oct 5, 2024
1 parent 4db3c90 commit 4c53a4c
Show file tree
Hide file tree
Showing 28 changed files with 403 additions and 302 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/readme-stars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
update-readme:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: k2bd/advent-readme-stars@v1
with:
year: 2024
Expand Down
2 changes: 1 addition & 1 deletion Package.resolved
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"originHash" : "86f32d693a3544f70992e17fd6b6b41313438f9efe1ae9e13d4347caa1a1dc4a",
"originHash" : "e35d38cbb3e526e985a6a8561499907f5c9b6d2588fe2b144913aaf5e773d327",
"pins" : [
{
"identity" : "aoctools",
Expand Down
1 change: 1 addition & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ let package = Package(
],
dependencies: [
.package(url: "https://github.com/gereons/AoCTools", from: "0.1.0")
// .package(path: "../AoCTools")
],
targets: [
.executableTarget(
Expand Down
28 changes: 16 additions & 12 deletions Tests/Day01Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,35 @@
// Advent of Code 2024 Day 1 Tests
//

import XCTest
import Testing
@testable import AdventOfCode

@MainActor
final class Day01Tests: XCTestCase {
let testInput = """
fileprivate let testInput = """
"""

func testDay01_part1() throws {
@Suite("Day 1 Tests")
struct Day01Tests {
@MainActor @Test("Day 1 Part 1")
func testDay01_part1() {
let day = Day01(input: testInput)
XCTAssertEqual(day.part1(), 0)
#expect(day.part1() == 0)
}

func testDay01_part1_solution() throws {
@MainActor @Test("Day 1 Part 1 Solution")
func testDay01_part1_solution() {
let day = Day01(input: Day01.input)
XCTAssertEqual(day.part1(), 0)
#expect(day.part1() == 0)
}

func testDay01_part2() throws {
@MainActor @Test("Day 1 Part 2")
func testDay01_part2() {
let day = Day01(input: testInput)
XCTAssertEqual(day.part2(), 0)
#expect(day.part2() == 0)
}

func testDay01_part2_solution() throws {
@MainActor @Test("Day 1 Part 2 Solution")
func testDay01_part2_solution() {
let day = Day01(input: Day01.input)
XCTAssertEqual(day.part2(), 0)
#expect(day.part2() == 0)
}
}
28 changes: 16 additions & 12 deletions Tests/Day02Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,35 @@
// Advent of Code 2024 Day 2 Tests
//

import XCTest
import Testing
@testable import AdventOfCode

@MainActor
final class Day02Tests: XCTestCase {
let testInput = """
fileprivate let testInput = """
"""

func testDay02_part1() throws {
@Suite("Day 2 Tests")
struct Day02Tests {
@MainActor @Test("Day 2 Part 1")
func testDay02_part1() {
let day = Day02(input: testInput)
XCTAssertEqual(day.part1(), 0)
#expect(day.part1() == 0)
}

func testDay02_part1_solution() throws {
@MainActor @Test("Day 2 Part 1 Solution")
func testDay02_part1_solution() {
let day = Day02(input: Day02.input)
XCTAssertEqual(day.part1(), 0)
#expect(day.part1() == 0)
}

func testDay02_part2() throws {
@MainActor @Test("Day 2 Part 2")
func testDay02_part2() {
let day = Day02(input: testInput)
XCTAssertEqual(day.part2(), 0)
#expect(day.part2() == 0)
}

func testDay02_part2_solution() throws {
@MainActor @Test("Day 2 Part 2 Solution")
func testDay02_part2_solution() {
let day = Day02(input: Day02.input)
XCTAssertEqual(day.part2(), 0)
#expect(day.part2() == 0)
}
}
28 changes: 16 additions & 12 deletions Tests/Day03Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,35 @@
// Advent of Code 2024 Day 3 Tests
//

import XCTest
import Testing
@testable import AdventOfCode

@MainActor
final class Day03Tests: XCTestCase {
let testInput = """
fileprivate let testInput = """
"""

func testDay03_part1() throws {
@Suite("Day 3 Tests")
struct Day03Tests {
@MainActor @Test("Day 3 Part 1")
func testDay03_part1() {
let day = Day03(input: testInput)
XCTAssertEqual(day.part1(), 0)
#expect(day.part1() == 0)
}

func testDay03_part1_solution() throws {
@MainActor @Test("Day 3 Part 1 Solution")
func testDay03_part1_solution() {
let day = Day03(input: Day03.input)
XCTAssertEqual(day.part1(), 0)
#expect(day.part1() == 0)
}

func testDay03_part2() throws {
@MainActor @Test("Day 3 Part 2")
func testDay03_part2() {
let day = Day03(input: testInput)
XCTAssertEqual(day.part2(), 0)
#expect(day.part2() == 0)
}

func testDay03_part2_solution() throws {
@MainActor @Test("Day 3 Part 2 Solution")
func testDay03_part2_solution() {
let day = Day03(input: Day03.input)
XCTAssertEqual(day.part2(), 0)
#expect(day.part2() == 0)
}
}
28 changes: 16 additions & 12 deletions Tests/Day04Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,35 @@
// Advent of Code 2024 Day 4 Tests
//

import XCTest
import Testing
@testable import AdventOfCode

@MainActor
final class Day04Tests: XCTestCase {
let testInput = """
fileprivate let testInput = """
"""

func testDay04_part1() throws {
@Suite("Day 4 Tests")
struct Day04Tests {
@MainActor @Test("Day 4 Part 1")
func testDay04_part1() {
let day = Day04(input: testInput)
XCTAssertEqual(day.part1(), 0)
#expect(day.part1() == 0)
}

func testDay04_part1_solution() throws {
@MainActor @Test("Day 4 Part 1 Solution")
func testDay04_part1_solution() {
let day = Day04(input: Day04.input)
XCTAssertEqual(day.part1(), 0)
#expect(day.part1() == 0)
}

func testDay04_part2() throws {
@MainActor @Test("Day 4 Part 2")
func testDay04_part2() {
let day = Day04(input: testInput)
XCTAssertEqual(day.part2(), 0)
#expect(day.part2() == 0)
}

func testDay04_part2_solution() throws {
@MainActor @Test("Day 4 Part 2 Solution")
func testDay04_part2_solution() {
let day = Day04(input: Day04.input)
XCTAssertEqual(day.part2(), 0)
#expect(day.part2() == 0)
}
}
28 changes: 16 additions & 12 deletions Tests/Day05Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,35 @@
// Advent of Code 2024 Day 5 Tests
//

import XCTest
import Testing
@testable import AdventOfCode

@MainActor
final class Day05Tests: XCTestCase {
let testInput = """
fileprivate let testInput = """
"""

func testDay05_part1() throws {
@Suite("Day 5 Tests")
struct Day05Tests {
@MainActor @Test("Day 5 Part 1")
func testDay05_part1() {
let day = Day05(input: testInput)
XCTAssertEqual(day.part1(), 0)
#expect(day.part1() == 0)
}

func testDay05_part1_solution() throws {
@MainActor @Test("Day 5 Part 1 Solution")
func testDay05_part1_solution() {
let day = Day05(input: Day05.input)
XCTAssertEqual(day.part1(), 0)
#expect(day.part1() == 0)
}

func testDay05_part2() throws {
@MainActor @Test("Day 5 Part 2")
func testDay05_part2() {
let day = Day05(input: testInput)
XCTAssertEqual(day.part2(), 0)
#expect(day.part2() == 0)
}

func testDay05_part2_solution() throws {
@MainActor @Test("Day 5 Part 2 Solution")
func testDay05_part2_solution() {
let day = Day05(input: Day05.input)
XCTAssertEqual(day.part2(), 0)
#expect(day.part2() == 0)
}
}
28 changes: 16 additions & 12 deletions Tests/Day06Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,35 @@
// Advent of Code 2024 Day 6 Tests
//

import XCTest
import Testing
@testable import AdventOfCode

@MainActor
final class Day06Tests: XCTestCase {
let testInput = """
fileprivate let testInput = """
"""

func testDay06_part1() throws {
@Suite("Day 6 Tests")
struct Day06Tests {
@MainActor @Test("Day 6 Part 1")
func testDay06_part1() {
let day = Day06(input: testInput)
XCTAssertEqual(day.part1(), 0)
#expect(day.part1() == 0)
}

func testDay06_part1_solution() throws {
@MainActor @Test("Day 6 Part 1 Solution")
func testDay06_part1_solution() {
let day = Day06(input: Day06.input)
XCTAssertEqual(day.part1(), 0)
#expect(day.part1() == 0)
}

func testDay06_part2() throws {
@MainActor @Test("Day 6 Part 2")
func testDay06_part2() {
let day = Day06(input: testInput)
XCTAssertEqual(day.part2(), 0)
#expect(day.part2() == 0)
}

func testDay06_part2_solution() throws {
@MainActor @Test("Day 6 Part 2 Solution")
func testDay06_part2_solution() {
let day = Day06(input: Day06.input)
XCTAssertEqual(day.part2(), 0)
#expect(day.part2() == 0)
}
}
28 changes: 16 additions & 12 deletions Tests/Day07Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,35 @@
// Advent of Code 2024 Day 7 Tests
//

import XCTest
import Testing
@testable import AdventOfCode

@MainActor
final class Day07Tests: XCTestCase {
let testInput = """
fileprivate let testInput = """
"""

func testDay07_part1() throws {
@Suite("Day 7 Tests")
struct Day07Tests {
@MainActor @Test("Day 7 Part 1")
func testDay07_part1() {
let day = Day07(input: testInput)
XCTAssertEqual(day.part1(), 0)
#expect(day.part1() == 0)
}

func testDay07_part1_solution() throws {
@MainActor @Test("Day 7 Part 1 Solution")
func testDay07_part1_solution() {
let day = Day07(input: Day07.input)
XCTAssertEqual(day.part1(), 0)
#expect(day.part1() == 0)
}

func testDay07_part2() throws {
@MainActor @Test("Day 7 Part 2")
func testDay07_part2() {
let day = Day07(input: testInput)
XCTAssertEqual(day.part2(), 0)
#expect(day.part2() == 0)
}

func testDay07_part2_solution() throws {
@MainActor @Test("Day 7 Part 2 Solution")
func testDay07_part2_solution() {
let day = Day07(input: Day07.input)
XCTAssertEqual(day.part2(), 0)
#expect(day.part2() == 0)
}
}
Loading

0 comments on commit 4c53a4c

Please sign in to comment.