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

minesweeper: remove number from input, add mines #456

Merged
merged 1 commit into from
Nov 29, 2016
Merged

minesweeper: remove number from input, add mines #456

merged 1 commit into from
Nov 29, 2016

Conversation

petertseng
Copy link
Member

an input containing only "8" implies that the student solution is
supposed to read a board with numbers and fill in the mines, which is
contrary to all other tests (read a board with mines, fill in the
numbers)

an input containing only "8" implies that the student solution is
supposed to read a board with numbers and fill in the mines, which is
contrary to all other tests (read a board with mines, fill in the
numbers)
Copy link
Contributor

@rbasso rbasso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

@petertseng petertseng merged commit c59c2c4 into exercism:master Nov 29, 2016
@petertseng petertseng deleted the minesweeper branch November 29, 2016 09:19
@petertseng
Copy link
Member Author

petertseng commented Nov 29, 2016

Found with:

require 'json'

json = JSON.parse(IO.read('canonical-data.json'))

json['cases'].each { |c|
  input = c['input']
  output = c['expected']
  clean = output.map { |l| l.gsub(/\d/, ' ') }

  raise "Nope on #{c}, got #{clean}" if clean != input
}

https://github.com/petertseng/x-common/blob/verify/exercises/minesweeper/verify.rb

@stevejb71
Copy link
Contributor

That was a good catch. Is the verify script something that could be added to the CI build?

emcoding pushed a commit that referenced this pull request Nov 19, 2018
Replace hard-coded Bowling tests with test generator (#456)
Also updated the example solution to address new test case
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