Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SYync #2

Merged
merged 7 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,16 @@ on:

jobs:
test:
runs-on: macos-13
runs-on: macos-15
env:
RUNALL: "true"
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683

- name: Run tests
run: swift test
generator-tests:
runs-on: macos-13
runs-on: macos-15
env:
RUNALL: "true"
steps:
Expand All @@ -29,7 +28,7 @@ jobs:
- name: Run tests
run: swift test --package-path ./generator
generator-template-tests:
runs-on: macos-13
runs-on: macos-15
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
Expand Down
5 changes: 3 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.3
// swift-tools-version:6.0

import PackageDescription
import Foundation
Expand Down Expand Up @@ -49,6 +49,7 @@ let practiceExerciseTargets: [Target] = practiceExercises.flatMap {
return [
.target(
name:"\($0.pascalCased)",
dependencies: [.product(name: "Numerics", package: "swift-numerics")],
path:"./exercises/practice/\($0)/.meta/Sources"),
.testTarget(
name:"\($0.pascalCased)Tests",
Expand All @@ -69,6 +70,6 @@ let package = Package(
name: "xswift",
targets: allTargets.filter { $0.type == .regular }.map { $0.name })
],
dependencies: [.package(url: "https://github.com/apple/swift-numerics", from: "1.0.0"),],
dependencies: [.package(url: "https://github.com/apple/swift-numerics", from: "1.0.2")],
targets: allTargets
)
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
let flip = { (tuple: (String, String, String)) -> (String, String, String) in
typealias RotationClosure = @Sendable ((String, String, String)) -> (String, String, String)

let flip: RotationClosure = { (tuple: (String, String, String)) -> (String, String, String) in
let (a, b, c) = tuple
return (b, a, c)
}

let rotate = { (tuple: (String, String, String)) -> (String, String, String) in
let rotate: RotationClosure = { (tuple: (String, String, String)) -> (String, String, String) in
let (a, b, c) = tuple
return (b, c, a)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,4 @@ final class BombDefuserTests: XCTestCase {
stringify(expected), stringify(got),
"shuffle(0, (\"Brown\", \"Orange\", \"White\")): Expected \(expected), got \(got)")
}

static var allTests = [
("testFlip", testFlip),
("testRotate", testRotate),
("testShuffle1", testShuffle1),
("testShuffle2", testShuffle2),
("testShuffle3", testShuffle3),
]
}

This file was deleted.

6 changes: 0 additions & 6 deletions exercises/concept/bomb-defuser/Tests/LinuxMain.swift

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -140,16 +140,4 @@ final class HighScoreBoardTests: XCTestCase {
"Expected: \(expected)\nGot: \(got)\norderByPlayers should return the key/value pairs odered ascending by the player's score."
)
}

static var allTests = [
("testEmptyScores", testEmptyScores),
("testAddPlayerExplicit", testAddPlayerExplicit),
("testAddPlayerDefault", testAddPlayerDefault),
("testRemovePlayer", testRemovePlayer),
("testRemoveNonexistentPlayer", testRemoveNonexistentPlayer),
("testResetScore", testResetScore),
("testUpdateScore", testUpdateScore),
("testOrderByPlayers", testOrderByPlayers),
("testOrderByScores", testOrderByScores),
]
}

This file was deleted.

6 changes: 0 additions & 6 deletions exercises/concept/high-score-board/Tests/LinuxMain.swift

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,4 @@ final class LasagnaMasterTests: XCTestCase {
layers: "sauce", "noodles", "béchamel", "meat", "mozzarella", "noodles", "sauce", "ricotta",
"eggplant", "mozzarella", "béchamel", "noodles", "meat", "sauce", "mozzarella"))
}

static var allTests = [
("testRemainingMinutesExplicit", testRemainingMinutesExplicit),
("testRemainingMinutesDefault", testRemainingMinutesDefault),
("testPreparationTime", testPreparationTime),
("testPreparationTimeEmpty", testPreparationTimeEmpty),
("testQuantities", testQuantities),
("testQuantitiesNoSauce", testQuantitiesNoSauce),
("testQuantitiesNoNoodles", testQuantitiesNoNoodles),
("testToOz", testToOz),
("testRedWineRedInequalLayerCount", testRedWineRedInequalLayerCount),
("testRedWineRedEqualLayerCount", testRedWineRedEqualLayerCount),
("testRedWineWhite", testRedWineWhite),
]
}

This file was deleted.

6 changes: 0 additions & 6 deletions exercises/concept/lasagna-master/Tests/LinuxMain.swift

This file was deleted.

6 changes: 0 additions & 6 deletions exercises/concept/log-lines/Tests/LinuxMain.swift

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -95,22 +95,4 @@ final class LogLinesTests: XCTestCase {
let message = "Wha happon?"
XCTAssertEqual(LogLevel.unknown.shortFormat(message: message), "42:Wha happon?")
}

static var allTests = [
("testInitTrace", testInitTrace),
("testInitDebug", testInitDebug),
("testInitInfo", testInitInfo),
("testInitWarning", testInitWarning),
("testInitError", testInitError),
("testInitFatal", testInitFatal),
("testInitUnknownEmpty", testInitUnknownEmpty),
("testInitUnknownNonStandard", testInitUnknownNonStandard),
("testShortTrace", testShortTrace),
("testShortDebug", testShortDebug),
("testShortInfo", testShortInfo),
("testShortWarning", testShortWarning),
("testShortError", testShortError),
("testShortFatal", testShortFatal),
("testShortUnknownEmpty", testShortUnknownEmpty),
]
}

This file was deleted.

6 changes: 0 additions & 6 deletions exercises/concept/magician-in-training/Tests/LinuxMain.swift

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -112,24 +112,4 @@ final class MagicianInTrainingTests: XCTestCase {
let stack = [7, 3, 7, 1, 5, 5, 3, 9, 9]
XCTAssertEqual(evenCardCount(stack), 0)
}

static var allTests = [
("testGetCard", testGetCard),
("testSetCard", testSetCard),
("testSetCardIndexTooLow", testSetCardIndexTooLow),
("testSetCardIndexTooHigh", testSetCardIndexTooHigh),
("testInsertAtTop", testInsertAtTop),
("testRemoveCard", testRemoveCard),
("testRemoveCardIndexTooLow", testRemoveCardIndexTooLow),
("testRemoveCardIndexTooHigh", testRemoveCardIndexTooHigh),
("testRemoveTopCard", testRemoveTopCard),
("testRemoveTopCardFromEmptyStack", testRemoveTopCardFromEmptyStack),
("testInsertAtBottom", testInsertAtBottom),
("testRemoveBottomCard", testRemoveBottomCard),
("testRemoveBottomCardFromEmptyStack", testRemoveBottomCardFromEmptyStack),
("testCheckSizeTrue", testCheckSizeTrue),
("testCheckSizeFalse", testCheckSizeFalse),
("testEvenCardCount", testEvenCardCount),
("testEvenCardCountZero", testEvenCardCountZero),
]
}

This file was deleted.

6 changes: 0 additions & 6 deletions exercises/concept/master-mixologist/Tests/LinuxMain.swift

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -153,20 +153,4 @@ final class MasterMixologistTests: XCTestCase {
checkTest(e: expectedBeers, g: got.beer) && checkTest(e: expectedSodas, g: got.soda),
"Expected (beer: nil, soda: nil), got: \(got)")
}

static var allTests = [
("testTimeToPrepare", testTimeToPrepare),
("testMakeWedges", testMakeWedges),
("testMakeWedgesNoNeed", testMakeWedgesNoNeed),
("testMakeWedgesNoLimes", testMakeWedgesNoLimes),
("testMakeWedgesTooFewLimes", testMakeWedgesTooFewLimes),
("testFinishShift", testFinishShift),
("testFinishShiftJustRunOver", testFinishShiftJustRunOver),
("testFinishShiftLeaveEarly", testFinishShiftLeaveEarly),
("testOrderTracker", testOrderTracker),
("testOrderOneEach", testOrderOneEach),
("testOrderTrackerNoBeer", testOrderTrackerNoBeer),
("testOrderTrackerNoSoda", testOrderTrackerNoSoda),
("testOrderTrackerNils", testOrderTrackerNils),
]
}

This file was deleted.

6 changes: 0 additions & 6 deletions exercises/concept/pizza-slices/Tests/LinuxMain.swift

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,4 @@ final class PizzaSlicesTests: XCTestCase {
let biggest = biggestSlice(diameterA: "0", slicesA: "8", diameterB: "16 inches", slicesB: "8")
XCTAssertEqual(biggest, "Slice A is bigger")
}

static var allTests = [
("testSliceNormal", testSliceNormal),
("testSliceNilDiameter", testSliceNilDiameter),
("testSliceNilSlices", testSliceNilSlices),
("testSliceBadDiameter", testSliceBadDiameter),
("testSliceBadSlices", testSliceBadSlices),
("testABiggest", testABiggest),
("testBBiggest", testBBiggest),
("testBothSame", testBothSame),
("testANil", testANil),
("testBNil", testBNil),
("testBothNil", testBothNil),
("testZeroIsValid", testZeroIsValid),
]
}

This file was deleted.

6 changes: 0 additions & 6 deletions exercises/concept/poetry-club/Tests/LinuxMain.swift

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -79,20 +79,4 @@ final class PoetryClubTests: XCTestCase {
try XCTSkipIf(true && !runAll) // change true to false to run this test
XCTAssertEqual(secretRoomPassword("Open Sesame"), "OPEN SESAME!")
}

static var allTests = [
("testSplitNewlines", testSplitNewlines),
("testSplitNoNewlines", testSplitNoNewlines),
("testFirstLetter", testFirstLetter),
("testFirstLetterEmpty", testFirstLetterEmpty),
("testCapitalize", testCapitalize),
("testTrimWithWhitespace", testTrimWithWhitespace),
("testTrimWithoutWhitespace", testTrimWithoutWhitespace),
("testLastLetter", testLastLetter),
("testLastLetterEmpty", testLastLetterEmpty),
("testBackdoorPassword", testBackdoorPassword),
("testIthLetter", testIthLetter),
("testIthLetterInvalid", testIthLetterInvalid),
("testSecretRoomPassword", testSecretRoomPassword),
]
}

This file was deleted.

6 changes: 0 additions & 6 deletions exercises/concept/santas-helper/Tests/LinuxMain.swift

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,4 @@ final class SantasHelperTests: XCTestCase {
&& actual.recipients == recipients
)
}
static var allTests = [
("testCartesianToPolar", testCartesianToPolar),
("testCartesianToPolarQ3", testCartesianToPolarQ3),
("testCombineRecords", testCombineRecords),
]
}

This file was deleted.

6 changes: 0 additions & 6 deletions exercises/concept/secret-agent/Tests/LinuxMain.swift

This file was deleted.

Loading