Update isbn-verifier.spec.js#734
Conversation
Updating 'X is only valid as a check digit' test so if `X` in the middle of ISBN is treated as `10` the test will fail.
Changing check digit to `9` means `checksum('3-598-2X507-9') mod 11 == 0`, so solutions which simply replace `X` with `10` (without checking location) will treat `3-598-2X507-9` as a valid ISBN.
|
@petertseng just tagging you because I want to be certain this can actually be applied and applied everywhere. In that case its a bugfix and we can lift it to problem-spec. |
|
This PR is the correct thing to do; an implementation that treats X as 10 in all positions would still reject 3-598-2X507-0, therefore 3-598-2X507-0 is not a good test case. Such an implementation would declare 3-598-2X507-9 a valid ISBN, so 3-598-2X507-9 is the correct test case. Please see exercism/problem-specifications#993. |
|
Please see the following: 0 * 1 (0) 9 * 1 (9) |
|
Sweet. Thank you for that elaboration @petertseng ❤️ |
Updating X is only valid as a check digit test so if
Xin the middle of ISBN is treated as10the test will fail.Changing check digit to
9meanschecksum('3-598-2X507-9') mod 11 == 0, so solutions which simply replaceXwith10(without checking location) will treat3-598-2X507-9as a valid ISBN.