Skip to content

Commit

Permalink
Merge branch 'exercism:main' into update-armstrongNumber
Browse files Browse the repository at this point in the history
  • Loading branch information
meatball133 authored Jan 3, 2025
2 parents 750fc04 + fa878ba commit 4069528
Show file tree
Hide file tree
Showing 54 changed files with 282 additions and 373 deletions.
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
7 changes: 5 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,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")
]
Expand All @@ -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
)
8 changes: 8 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,14 @@
"transforming"
]
},
{
"slug": "darts",
"name": "Darts",
"uuid": "bdbc6f27-bc98-4edf-9f1d-93dbe49da361",
"practices": [],
"prerequisites": [],
"difficulty": 2
},
{
"slug": "bob",
"name": "Bob",
Expand Down
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),
]
}
Loading

0 comments on commit 4069528

Please sign in to comment.