Update Bob exercise tests

Hi folks,

I was doing the famous Bob exercise in Swift.
It appears that there’s an issue on the tests.

Here is the actual test

func testForcefulQuestions() {
        let input = "WHAT THE HELL WERE YOU THINKING?"
        let expected = "Whoa, chill out!"
        let result = Bob.hey(input)
        XCTAssertEqual(expected, result)
    }

Since asking a question and yelling are two values we can get from the input.
And not mutually exclusive, because we can shout a question after all.

The instructions are clear about Bob’s response.

He answers 'Calm down, I know what I'm doing!' if you yell a question at him.

So the tests should be updated to this:

func testForcefulQuestions() {
        let input = "WHAT THE HELL WERE YOU THINKING?"
        let expected = "Calm down, I know what I'm doing!"
        let result = Bob.hey(input)
        XCTAssertEqual(expected, result)
    }

I’ve made a PR before seeing that the public PRs are closed for now.

So I reach you through the forum as asked :smiley:

1 Like

Swift tests appear to mostly use the canonical data

They may just need syncing?

    {
      "uuid": "a5193c61-4a92-4f68-93e2-f554eb385ec6",
      "description": "forceful question",
      "property": "response",
      "input": {
        "heyBob": "WHAT'S GOING ON?"
      },
      "expected": "Calm down, I know what I'm doing!"
    }

Sure, I’d be glad to do so.
But is there any manipulation to perform this action?

git clone https://github.com/exercism/swift.git
cd swift
./bin/fetch-configlet
./bin/configlet sync -e bob

That said,

  1. I am not a Swift track maintainer.
  2. I am not even a Swift user.
  3. Changing that test may break existing solutions, which is something the track maintainer needs to consider and pass judgement on.
  4. I have no idea if this track uses auto-test generation or not.
  5. If the track isn’t accepting PRs, then please talk to a track maintainer prior to opening a PR!
1 Like

I have the same issue with Objective-C tests… on the definition of the problem on the web there are 5 types of answers, but on the tests there ought be at least one with <<“Calm down, I know what I’m doing!” This is what he says if you yell a question at him.>>