diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cb81d2644..eb0214761 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: @@ -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 diff --git a/Package.swift b/Package.swift index 35292fd26..c566f2b74 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.3 +// swift-tools-version:6.0 import PackageDescription import Foundation @@ -49,11 +49,13 @@ 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", dependencies: [ - .target(name:"\($0.pascalCased)") + .target(name:"\($0.pascalCased)"), + .product(name: "Numerics", package: "swift-numerics") ], path:"./exercises/practice/\($0)/Tests") ] @@ -68,5 +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.2")], targets: allTargets ) diff --git a/exercises/concept/bomb-defuser/.meta/Sources/BombDefuser/BombDefuserExemplar.swift b/exercises/concept/bomb-defuser/.meta/Sources/BombDefuser/BombDefuserExemplar.swift index 63b33268f..c4ab55737 100644 --- a/exercises/concept/bomb-defuser/.meta/Sources/BombDefuser/BombDefuserExemplar.swift +++ b/exercises/concept/bomb-defuser/.meta/Sources/BombDefuser/BombDefuserExemplar.swift @@ -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) } diff --git a/exercises/concept/bomb-defuser/Tests/BombDefuserTests/BombDefuserTests.swift b/exercises/concept/bomb-defuser/Tests/BombDefuserTests/BombDefuserTests.swift index 207d830ad..4a242a8f7 100644 --- a/exercises/concept/bomb-defuser/Tests/BombDefuserTests/BombDefuserTests.swift +++ b/exercises/concept/bomb-defuser/Tests/BombDefuserTests/BombDefuserTests.swift @@ -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), - ] } diff --git a/exercises/concept/bomb-defuser/Tests/BombDefuserTests/XCTestManifests.swift b/exercises/concept/bomb-defuser/Tests/BombDefuserTests/XCTestManifests.swift deleted file mode 100644 index 4f3db4589..000000000 --- a/exercises/concept/bomb-defuser/Tests/BombDefuserTests/XCTestManifests.swift +++ /dev/null @@ -1,9 +0,0 @@ -import XCTest - -#if !canImport(ObjectiveC) - public func allTests() -> [XCTestCaseEntry] { - return [ - testCase(BombDefuserTests.allTests) - ] - } -#endif diff --git a/exercises/concept/bomb-defuser/Tests/LinuxMain.swift b/exercises/concept/bomb-defuser/Tests/LinuxMain.swift deleted file mode 100644 index e46f25037..000000000 --- a/exercises/concept/bomb-defuser/Tests/LinuxMain.swift +++ /dev/null @@ -1,6 +0,0 @@ -import BombDefuserTests -import XCTest - -var tests = [XCTestCaseEntry]() -tests += BombDefuserTests.allTests() -XCTMain(tests) diff --git a/exercises/concept/high-score-board/Tests/HighScoreBoardTests/HighScoreBoardTests.swift b/exercises/concept/high-score-board/Tests/HighScoreBoardTests/HighScoreBoardTests.swift index 041184094..40625c84a 100644 --- a/exercises/concept/high-score-board/Tests/HighScoreBoardTests/HighScoreBoardTests.swift +++ b/exercises/concept/high-score-board/Tests/HighScoreBoardTests/HighScoreBoardTests.swift @@ -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), - ] } diff --git a/exercises/concept/high-score-board/Tests/HighScoreBoardTests/XCTestManifests.swift b/exercises/concept/high-score-board/Tests/HighScoreBoardTests/XCTestManifests.swift deleted file mode 100644 index 27fdffe3a..000000000 --- a/exercises/concept/high-score-board/Tests/HighScoreBoardTests/XCTestManifests.swift +++ /dev/null @@ -1,9 +0,0 @@ -import XCTest - -#if !canImport(ObjectiveC) - public func allTests() -> [XCTestCaseEntry] { - return [ - testCase(HighScoreBoardTests.allTests) - ] - } -#endif diff --git a/exercises/concept/high-score-board/Tests/LinuxMain.swift b/exercises/concept/high-score-board/Tests/LinuxMain.swift deleted file mode 100644 index a05b76cc1..000000000 --- a/exercises/concept/high-score-board/Tests/LinuxMain.swift +++ /dev/null @@ -1,6 +0,0 @@ -import HighScoreBoardTests -import XCTest - -var tests = [XCTestCaseEntry]() -tests += HighScoreBoardTests.allTests() -XCTMain(tests) diff --git a/exercises/concept/lasagna-master/Tests/LasagnaMasterTests/LasagnaMasterTests.swift b/exercises/concept/lasagna-master/Tests/LasagnaMasterTests/LasagnaMasterTests.swift index 30d17de50..d3996f123 100644 --- a/exercises/concept/lasagna-master/Tests/LasagnaMasterTests/LasagnaMasterTests.swift +++ b/exercises/concept/lasagna-master/Tests/LasagnaMasterTests/LasagnaMasterTests.swift @@ -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), - ] } diff --git a/exercises/concept/lasagna-master/Tests/LasagnaMasterTests/XCTestManifests.swift b/exercises/concept/lasagna-master/Tests/LasagnaMasterTests/XCTestManifests.swift deleted file mode 100644 index 86ffcbced..000000000 --- a/exercises/concept/lasagna-master/Tests/LasagnaMasterTests/XCTestManifests.swift +++ /dev/null @@ -1,9 +0,0 @@ -import XCTest - -#if !canImport(ObjectiveC) - public func allTests() -> [XCTestCaseEntry] { - return [ - testCase(LasagnaMasterTests.allTests) - ] - } -#endif diff --git a/exercises/concept/lasagna-master/Tests/LinuxMain.swift b/exercises/concept/lasagna-master/Tests/LinuxMain.swift deleted file mode 100644 index 5b59f7b4d..000000000 --- a/exercises/concept/lasagna-master/Tests/LinuxMain.swift +++ /dev/null @@ -1,6 +0,0 @@ -import LasagnaMasterTests -import XCTest - -var tests = [XCTestCaseEntry]() -tests += LasagnaMasterTests.allTests() -XCTMain(tests) diff --git a/exercises/concept/log-lines/Tests/LinuxMain.swift b/exercises/concept/log-lines/Tests/LinuxMain.swift deleted file mode 100644 index 2c9cdfc78..000000000 --- a/exercises/concept/log-lines/Tests/LinuxMain.swift +++ /dev/null @@ -1,6 +0,0 @@ -import LogLinesTests -import XCTest - -var tests = [XCTestCaseEntry]() -tests += LogLinesTests.allTests() -XCTMain(tests) diff --git a/exercises/concept/log-lines/Tests/LogLinesTests/LogLinesTests.swift b/exercises/concept/log-lines/Tests/LogLinesTests/LogLinesTests.swift index a99521299..0276c4a95 100644 --- a/exercises/concept/log-lines/Tests/LogLinesTests/LogLinesTests.swift +++ b/exercises/concept/log-lines/Tests/LogLinesTests/LogLinesTests.swift @@ -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), - ] } diff --git a/exercises/concept/log-lines/Tests/LogLinesTests/XCTestManifests.swift b/exercises/concept/log-lines/Tests/LogLinesTests/XCTestManifests.swift deleted file mode 100644 index 2b5cb9ee5..000000000 --- a/exercises/concept/log-lines/Tests/LogLinesTests/XCTestManifests.swift +++ /dev/null @@ -1,9 +0,0 @@ -import XCTest - -#if !canImport(ObjectiveC) - public func allTests() -> [XCTestCaseEntry] { - return [ - testCase(LogLinesTests.allTests) - ] - } -#endif diff --git a/exercises/concept/magician-in-training/Tests/LinuxMain.swift b/exercises/concept/magician-in-training/Tests/LinuxMain.swift deleted file mode 100644 index 4e9800ff5..000000000 --- a/exercises/concept/magician-in-training/Tests/LinuxMain.swift +++ /dev/null @@ -1,6 +0,0 @@ -import MagicianInTrainingTests -import XCTest - -var tests = [XCTestCaseEntry]() -tests += MagicianInTrainingTests.allTests() -XCTMain(tests) diff --git a/exercises/concept/magician-in-training/Tests/MagicianInTrainingTests/MagicianInTrainingTests.swift b/exercises/concept/magician-in-training/Tests/MagicianInTrainingTests/MagicianInTrainingTests.swift index fefb02a97..f5bd8d04f 100644 --- a/exercises/concept/magician-in-training/Tests/MagicianInTrainingTests/MagicianInTrainingTests.swift +++ b/exercises/concept/magician-in-training/Tests/MagicianInTrainingTests/MagicianInTrainingTests.swift @@ -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), - ] } diff --git a/exercises/concept/magician-in-training/Tests/MagicianInTrainingTests/XCTestManifests.swift b/exercises/concept/magician-in-training/Tests/MagicianInTrainingTests/XCTestManifests.swift deleted file mode 100644 index b1ebd20f7..000000000 --- a/exercises/concept/magician-in-training/Tests/MagicianInTrainingTests/XCTestManifests.swift +++ /dev/null @@ -1,9 +0,0 @@ -import XCTest - -#if !canImport(ObjectiveC) - public func allTests() -> [XCTestCaseEntry] { - return [ - testCase(MagicianInTrainingTests.allTests) - ] - } -#endif diff --git a/exercises/concept/master-mixologist/Tests/LinuxMain.swift b/exercises/concept/master-mixologist/Tests/LinuxMain.swift deleted file mode 100644 index 038543cb7..000000000 --- a/exercises/concept/master-mixologist/Tests/LinuxMain.swift +++ /dev/null @@ -1,6 +0,0 @@ -import MasterMixologistTests -import XCTest - -var tests = [XCTestCaseEntry]() -tests += MasterMixologistTests.allTests() -XCTMain(tests) diff --git a/exercises/concept/master-mixologist/Tests/MasterMixologistTests/MasterMixologistTests.swift b/exercises/concept/master-mixologist/Tests/MasterMixologistTests/MasterMixologistTests.swift index ef2b59e43..ff87b68ca 100644 --- a/exercises/concept/master-mixologist/Tests/MasterMixologistTests/MasterMixologistTests.swift +++ b/exercises/concept/master-mixologist/Tests/MasterMixologistTests/MasterMixologistTests.swift @@ -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), - ] } diff --git a/exercises/concept/master-mixologist/Tests/MasterMixologistTests/XCTestManifests.swift b/exercises/concept/master-mixologist/Tests/MasterMixologistTests/XCTestManifests.swift deleted file mode 100644 index 5c4947c8d..000000000 --- a/exercises/concept/master-mixologist/Tests/MasterMixologistTests/XCTestManifests.swift +++ /dev/null @@ -1,9 +0,0 @@ -import XCTest - -#if !canImport(ObjectiveC) - public func allTests() -> [XCTestCaseEntry] { - return [ - testCase(MasterMixologistTests.allTests) - ] - } -#endif diff --git a/exercises/concept/pizza-slices/Tests/LinuxMain.swift b/exercises/concept/pizza-slices/Tests/LinuxMain.swift deleted file mode 100644 index 2d46426d6..000000000 --- a/exercises/concept/pizza-slices/Tests/LinuxMain.swift +++ /dev/null @@ -1,6 +0,0 @@ -import PizzaSlicesTests -import XCTest - -var tests = [XCTestCaseEntry]() -tests += PizzaSlicesTests.allTests() -XCTMain(tests) diff --git a/exercises/concept/pizza-slices/Tests/PizzaSlicesTests/PizzaSlicesTests.swift b/exercises/concept/pizza-slices/Tests/PizzaSlicesTests/PizzaSlicesTests.swift index 4f7e918d3..3a0475c2d 100644 --- a/exercises/concept/pizza-slices/Tests/PizzaSlicesTests/PizzaSlicesTests.swift +++ b/exercises/concept/pizza-slices/Tests/PizzaSlicesTests/PizzaSlicesTests.swift @@ -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), - ] } diff --git a/exercises/concept/pizza-slices/Tests/PizzaSlicesTests/XCTestManifests.swift b/exercises/concept/pizza-slices/Tests/PizzaSlicesTests/XCTestManifests.swift deleted file mode 100644 index a37a77a60..000000000 --- a/exercises/concept/pizza-slices/Tests/PizzaSlicesTests/XCTestManifests.swift +++ /dev/null @@ -1,9 +0,0 @@ -import XCTest - -#if !canImport(ObjectiveC) - public func allTests() -> [XCTestCaseEntry] { - return [ - testCase(PizzaSlicesTests.allTests) - ] - } -#endif diff --git a/exercises/concept/poetry-club/Tests/LinuxMain.swift b/exercises/concept/poetry-club/Tests/LinuxMain.swift deleted file mode 100644 index 32c4ce62f..000000000 --- a/exercises/concept/poetry-club/Tests/LinuxMain.swift +++ /dev/null @@ -1,6 +0,0 @@ -import PoetryClubTests -import XCTest - -var tests = [XCTestCaseEntry]() -tests += PoetryClubTests.allTests() -XCTMain(tests) diff --git a/exercises/concept/poetry-club/Tests/PoetryClubTests/PoetryClubTests.swift b/exercises/concept/poetry-club/Tests/PoetryClubTests/PoetryClubTests.swift index e77d69c1c..433168cdb 100644 --- a/exercises/concept/poetry-club/Tests/PoetryClubTests/PoetryClubTests.swift +++ b/exercises/concept/poetry-club/Tests/PoetryClubTests/PoetryClubTests.swift @@ -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), - ] } diff --git a/exercises/concept/poetry-club/Tests/PoetryClubTests/XCTestManifests.swift b/exercises/concept/poetry-club/Tests/PoetryClubTests/XCTestManifests.swift deleted file mode 100644 index 1c316f6b3..000000000 --- a/exercises/concept/poetry-club/Tests/PoetryClubTests/XCTestManifests.swift +++ /dev/null @@ -1,9 +0,0 @@ -import XCTest - -#if !canImport(ObjectiveC) - public func allTests() -> [XCTestCaseEntry] { - return [ - testCase(PoetryClubTests.allTests) - ] - } -#endif diff --git a/exercises/concept/santas-helper/Tests/LinuxMain.swift b/exercises/concept/santas-helper/Tests/LinuxMain.swift deleted file mode 100644 index ea1c942fd..000000000 --- a/exercises/concept/santas-helper/Tests/LinuxMain.swift +++ /dev/null @@ -1,6 +0,0 @@ -import SantasHelperTests -import XCTest - -var tests = [XCTestCaseEntry]() -tests += SantasHelperTests.allTests() -XCTMain(tests) diff --git a/exercises/concept/santas-helper/Tests/SantasHelperTests/SantasHelperTests.swift b/exercises/concept/santas-helper/Tests/SantasHelperTests/SantasHelperTests.swift index d9507134f..1b7f17049 100644 --- a/exercises/concept/santas-helper/Tests/SantasHelperTests/SantasHelperTests.swift +++ b/exercises/concept/santas-helper/Tests/SantasHelperTests/SantasHelperTests.swift @@ -47,9 +47,4 @@ final class SantasHelperTests: XCTestCase { && actual.recipients == recipients ) } - static var allTests = [ - ("testCartesianToPolar", testCartesianToPolar), - ("testCartesianToPolarQ3", testCartesianToPolarQ3), - ("testCombineRecords", testCombineRecords), - ] } diff --git a/exercises/concept/santas-helper/Tests/SantasHelperTests/XCTestManifests.swift b/exercises/concept/santas-helper/Tests/SantasHelperTests/XCTestManifests.swift deleted file mode 100644 index b397e4869..000000000 --- a/exercises/concept/santas-helper/Tests/SantasHelperTests/XCTestManifests.swift +++ /dev/null @@ -1,9 +0,0 @@ -import XCTest - -#if !canImport(ObjectiveC) - public func allTests() -> [XCTestCaseEntry] { - return [ - testCase(SantasHelperTests.allTests) - ] - } -#endif diff --git a/exercises/concept/secret-agent/Tests/LinuxMain.swift b/exercises/concept/secret-agent/Tests/LinuxMain.swift deleted file mode 100644 index 75e8a0f09..000000000 --- a/exercises/concept/secret-agent/Tests/LinuxMain.swift +++ /dev/null @@ -1,6 +0,0 @@ -import SecretAgentTests -import XCTest - -var tests = [XCTestCaseEntry]() -tests += SecretAgentTests.allTests() -XCTMain(tests) diff --git a/exercises/concept/secret-agent/Tests/SecretAgentTests/SecretAgentTests.swift b/exercises/concept/secret-agent/Tests/SecretAgentTests/SecretAgentTests.swift index dd0a25c96..407a962ad 100644 --- a/exercises/concept/secret-agent/Tests/SecretAgentTests/SecretAgentTests.swift +++ b/exercises/concept/secret-agent/Tests/SecretAgentTests/SecretAgentTests.swift @@ -34,11 +34,4 @@ final class SecretAgentTests: XCTestCase { }) XCTAssertTrue(combo == (234, 91, 148)) } - - static var allTests = [ - ("testPasswordSuccess", testPasswordSuccess), - ("testPasswordFail", testPasswordFail), - ("testCombination1", testCombination1), - ("testCombination2", testCombination2), - ] } diff --git a/exercises/concept/secret-agent/Tests/SecretAgentTests/XCTestManifests.swift b/exercises/concept/secret-agent/Tests/SecretAgentTests/XCTestManifests.swift deleted file mode 100644 index 904c816d8..000000000 --- a/exercises/concept/secret-agent/Tests/SecretAgentTests/XCTestManifests.swift +++ /dev/null @@ -1,9 +0,0 @@ -import XCTest - -#if !canImport(ObjectiveC) - public func allTests() -> [XCTestCaseEntry] { - return [ - testCase(SecretAgentTests.allTests) - ] - } -#endif diff --git a/exercises/concept/vehicle-purchase/.docs/instructions.md b/exercises/concept/vehicle-purchase/.docs/instructions.md index f9e937cfa..72605a19d 100644 --- a/exercises/concept/vehicle-purchase/.docs/instructions.md +++ b/exercises/concept/vehicle-purchase/.docs/instructions.md @@ -9,15 +9,17 @@ You have three tasks, one to determine if you will need one to help you choose b The auto dealers in your town are all running a five year, 0% interest promotion that you would like to take advantage of. But you are not sure if you can afford the monthly payments on the car you want. +The monthly payment is the cars total price divided by the number of months under the five year period. + Implement the `canIBuy(vehicle:price:monthlyBudget:)` function that takes the following arguments: - `vehicle` - The name of the vehicle you want to buy. - `price` - The price of the vehicle you want to buy. - `monthlyBudget` - The amount of money you can afford to pay each month. The function should return the following message based on the following conditions: -- If the price of the vehicle is less than or equal to the monthly budget, return the message `"Yes! I'm getting a "`. -- If the price of the vehicle is 10% above your monthly budget, return the message `"I'll have to be frugal if I want a "`. -- If the price of the vehicle is more than 10% above your monthly budget, return the message `"Darn! No for me"`. +- If the monthly payment of the vehicle is less than or equal to the monthly budget, return the message `"Yes! I'm getting a "`. +- If the monthly payment of the vehicle is above your monthly budget by up to 10% (inclusive), return the message `"I'll have to be frugal if I want a "`. +- If the monthly payment of the vehicle is more than 10% above your monthly budget, return the message `"Darn! No for me"`. ```swift canIBuy(vehicle: "1974 Ford Pinto", price: 516.32, monthlyBudget: 100.00) diff --git a/exercises/concept/windowing-system/.meta/Sources/WindowingSystem/WindowingSystemExemplar.swift b/exercises/concept/windowing-system/.meta/Sources/WindowingSystem/WindowingSystemExemplar.swift index fc46fe84b..6cc4a2946 100644 --- a/exercises/concept/windowing-system/.meta/Sources/WindowingSystem/WindowingSystemExemplar.swift +++ b/exercises/concept/windowing-system/.meta/Sources/WindowingSystem/WindowingSystemExemplar.swift @@ -18,7 +18,7 @@ struct Size { } } -class Window { +class Window: @unchecked Sendable { var title = "New Window" let screenSize = Size(width: 800, height: 600) var size = Size() diff --git a/exercises/concept/windowing-system/Tests/LinuxMain.swift b/exercises/concept/windowing-system/Tests/LinuxMain.swift deleted file mode 100644 index d70d97404..000000000 --- a/exercises/concept/windowing-system/Tests/LinuxMain.swift +++ /dev/null @@ -1,6 +0,0 @@ -import WindowingSystemTests -import XCTest - -var tests = [XCTestCaseEntry]() -tests += WindowingSystemTests.allTests() -XCTMain(tests) diff --git a/exercises/concept/windowing-system/Tests/WindowingSystemTests/WindowingSystemTests.swift b/exercises/concept/windowing-system/Tests/WindowingSystemTests/WindowingSystemTests.swift index 2c7c875f3..dc590a428 100644 --- a/exercises/concept/windowing-system/Tests/WindowingSystemTests/WindowingSystemTests.swift +++ b/exercises/concept/windowing-system/Tests/WindowingSystemTests/WindowingSystemTests.swift @@ -158,18 +158,4 @@ final class WindowingSystemTests: XCTestCase { window.display(), "New Window\nPosition: (0, 0), Size: (80 x 60)\n[This window intentionally left blank]\n") } - - static var allTests = [ - ("testNewWindow", testNewWindow), - ("testMainWindow", testMainWindow), - ("testMoveValid", testMoveValid), - ("testMoveTooFar", testMoveTooFar), - ("testMoveNegative", testMoveNegative), - ("testResizeValid", testResizeValid), - ("testResizeTooFar", testResizeTooFar), - ("testResizeNegative", testResizeNegative), - ("testUpdateTitle", testUpdateTitle), - ("testUpdateText", testUpdateText), - ("testUpdateTextNil", testUpdateTextNil), - ] } diff --git a/exercises/concept/windowing-system/Tests/WindowingSystemTests/XCTestManifests.swift b/exercises/concept/windowing-system/Tests/WindowingSystemTests/XCTestManifests.swift deleted file mode 100644 index 73d76229e..000000000 --- a/exercises/concept/windowing-system/Tests/WindowingSystemTests/XCTestManifests.swift +++ /dev/null @@ -1,9 +0,0 @@ -import XCTest - -#if !canImport(ObjectiveC) - public func allTests() -> [XCTestCaseEntry] { - return [ - testCase(WindowingSystemTests.allTests) - ] - } -#endif diff --git a/exercises/practice/matrix/Sources/Matrix/Matrix.swift b/exercises/practice/matrix/Sources/Matrix/Matrix.swift index 78bc9bcf7..0f71a9cbd 100644 --- a/exercises/practice/matrix/Sources/Matrix/Matrix.swift +++ b/exercises/practice/matrix/Sources/Matrix/Matrix.swift @@ -1,27 +1,3 @@ struct Matrix { - - let rows: [[Int]] - let columns: [[Int]] - - init(_ stringRepresentation: String) { - var rows = [[Int]]() - var columns = [[Int]]() - - let rowItems = stringRepresentation.split(separator: "\n") - for item in rowItems { - let elements = item.split(separator: " ").compactMap { Int(String($0)) } - rows.append(elements) - } - for i in 0..