Skip to content

isbn-verifier 2.3.0.4: Use an otherwise-valid ISBN in invalid char test#670

Merged
petertseng merged 1 commit intoexercism:masterfrom
petertseng:isbn
Mar 31, 2018
Merged

isbn-verifier 2.3.0.4: Use an otherwise-valid ISBN in invalid char test#670
petertseng merged 1 commit intoexercism:masterfrom
petertseng:isbn

Conversation

@petertseng
Copy link
Copy Markdown
Member

Set new test case to be 3-598-P1581-X.
This will actually catch incorrect solutions - when invalid characters (P) are treated as 0.
3 * 10 + 5 * 9 + 9 * 8 + 8 * 7 + 0 * 6 + 1 * 5 + 5 * 4 + 8 * 3 + 1 * 2 + 10 * 1 = 264
264 is divisible by 11.

The previous case did NOT have this property:
3 * 10 + 5 * 9 + 9 * 8 + 8 * 7 + 2 * 6 + 0 * 5 + 5 * 4 + 0 * 3 + 7 * 2 + 0 * 1 = 249
249 is NOT divisible by 11.

exercism/problem-specifications#1212
exercism/problem-specifications#1217

Set new test case to be 3-598-P1581-X.
This will actually catch incorrect solutions - when invalid characters (P) are treated as 0.
3 * 10 + 5 * 9 + 9 * 8 + 8 * 7 + 0 * 6 + 1 * 5 + 5 * 4 + 8 * 3 + 1 * 2 + 10 * 1 = 264
264 is divisible by 11.

The previous case did NOT have this property:
3 * 10 + 5 * 9 + 9 * 8 + 8 * 7 + 2 * 6 + 0 * 5 + 5 * 4 + 0 * 3 + 7 * 2 + 0 * 1 = 249
249 is NOT divisible by 11.

exercism/problem-specifications#1212
exercism/problem-specifications#1217
@petertseng petertseng changed the title isbn-verifier: Use an otherwise-valid ISBN in invalid char test isbn-verifier 2.3.0.4: Use an otherwise-valid ISBN in invalid char test Mar 31, 2018
@petertseng petertseng merged commit 91fd3c7 into exercism:master Mar 31, 2018
@petertseng petertseng deleted the isbn branch March 31, 2018 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant