Skip to content

Rewrote tests to follow canonical data; reworked example to pass tests (fixes #232) #299

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

Merged
merged 1 commit into from
Oct 11, 2017

Conversation

jarhill0
Copy link
Contributor

The canonical data uses strings as input rather than ints, which required a partial rework of the example. Also, the example uses > where it should use >=, leading to a bug whenever a number contained the digit 5. I also removed an unused function from the example.

@pacman-bot
Copy link

pacman-bot commented Oct 10, 2017

3 Warnings
⚠️ /exercises/poker/Sources/PokerExample.swift#L188 - SwiftLint rule ‘cyclomatic_complexity’ did not trigger a violation in the disabled region. Please remove the disable command.
⚠️ /exercises/poker/Sources/PokerExample.swift#L189 - SwiftLint rule ‘empty_enum_arguments’ did not trigger a violation in the disabled region. Please remove the disable command.
⚠️ /exercises/poker/Sources/PokerExample.swift#L245 - SwiftLint rule ‘empty_enum_arguments’ did not trigger a violation in the disabled region. Please remove the disable command.
23 Messages
📖 Package.swift#L11 - Colons should be next to the identifier when specifying a type and next to the key in dictionary literals.
📖 exercises/atbash-cipher/Sources/AtbashExample.swift#L16 - Colons should be next to the identifier when specifying a type and next to the key in dictionary literals.
📖 exercises/bracket-push/Sources/BracketPushExample.swift#L3 - Colons should be next to the identifier when specifying a type and next to the key in dictionary literals.
📖 exercises/dominoes/Sources/DominoesExample.swift#L149 - Prefer != nil over let _ =
📖 exercises/dominoes/Sources/DominoesExample.swift#L152 - Prefer != nil over let _ =
📖 exercises/grains/Tests/GrainsTests/GrainsTests.swift#L11 - An XCTFail call should include a description of the assertion.
📖 exercises/grains/Tests/GrainsTests/GrainsTests.swift#L21 - An XCTFail call should include a description of the assertion.
📖 exercises/grains/Tests/GrainsTests/GrainsTests.swift#L31 - An XCTFail call should include a description of the assertion.
📖 exercises/kindergarten-garden/Sources/KindergartenGardenExample.swift#L13 - Colons should be next to the identifier when specifying a type and next to the key in dictionary literals.
📖 exercises/kindergarten-garden/Sources/KindergartenGardenExample.swift#L26 - Colons should be next to the identifier when specifying a type and next to the key in dictionary literals.
📖 exercises/meetup/Sources/MeetupExample.swift#L61 - Colons should be next to the identifier when specifying a type and next to the key in dictionary literals.
📖 exercises/nucleotide-count/Sources/NucleotideCountExample.swift#L10 - Colons should be next to the identifier when specifying a type and next to the key in dictionary literals.
📖 exercises/nucleotide-count/Sources/NucleotideCountExample.swift#L29 - Colons should be next to the identifier when specifying a type and next to the key in dictionary literals.
📖 exercises/poker/Sources/PokerExample.swift#L147 - Colons should be next to the identifier when specifying a type and next to the key in dictionary literals.
📖 exercises/poker/Sources/PokerExample.swift#L189 - Function should have complexity 10 or less: currently complexity equals 12
📖 exercises/poker/Sources/PokerExample.swift#L265 - Colons should be next to the identifier when specifying a type and next to the key in dictionary literals.
📖 exercises/poker/Sources/PokerExample.swift#L293 - Colons should be next to the identifier when specifying a type and next to the key in dictionary literals.
📖 exercises/poker/Sources/PokerExample.swift#L336 - Colons should be next to the identifier when specifying a type and next to the key in dictionary literals.
📖 exercises/rna-transcription/Sources/RnaTranscriptionExample.swift#L16 - Colons should be next to the identifier when specifying a type and next to the key in dictionary literals.
📖 exercises/rna-transcription/Sources/RnaTranscriptionExample.swift#L18 - Colons should be next to the identifier when specifying a type and next to the key in dictionary literals.
📖 exercises/rotational-cipher/Sources/RotationalCipherExample.swift#L10 - Case statements should vertically align with the enclosing switch statement.
📖 exercises/rotational-cipher/Sources/RotationalCipherExample.swift#L15 - Case statements should vertically align with the enclosing switch statement.
📖 exercises/rotational-cipher/Sources/RotationalCipherExample.swift#L20 - Case statements should vertically align with the enclosing switch statement.

Generated by 🚫 Danger

@masters3d
Copy link
Contributor

Looks great. Swift 4 is so new so we are still supporting swift 3.1. Do you mind taking a look at the CI?

@jarhill0
Copy link
Contributor Author

@masters3d How would you recommend finding the length of a string in swift 3.1 so that the test will pass? The internet has several conflicting answers about what is best.

@masters3d
Copy link
Contributor

mystring.utf16.count should do the trick

range: NSRange(0..<self.utf16.count) )

@jarhill0
Copy link
Contributor Author

Updated.

@masters3d masters3d merged commit 687b363 into exercism:master Oct 11, 2017
@masters3d
Copy link
Contributor

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants