[
{ "name": "an ISBN-10, converted to its ISBN-13", "args": ["0-306-40615-2"], "expect": { "valid": true, "normalised": "9780306406157", "isbn10": "0306406152", "reason": null } },
{ "name": "the same book as an ISBN-13", "args": ["978-0-306-40615-7"], "expect": { "valid": true, "normalised": "9780306406157", "isbn10": "0306406152", "reason": null } },
{ "name": "an ISBN-10 whose check digit is X (ten)", "args": ["0-8044-2957-X"], "expect": { "valid": true, "normalised": "9780804429573", "isbn10": "080442957X", "reason": null } },
{ "name": "a lower-case x is the same check digit", "args": ["080442957x"], "expect": { "valid": true, "normalised": "9780804429573", "isbn10": "080442957X", "reason": null } },
{ "name": "the ISBN-13 of an X book converts back to the X form", "args": ["9780804429573"], "expect": { "valid": true, "normalised": "9780804429573", "isbn10": "080442957X", "reason": null } },
{ "name": "a 979 ISBN has no ISBN-10", "args": ["979-10-90636-07-1"], "expect": { "valid": true, "normalised": "9791090636071", "isbn10": null, "reason": null } },
{ "name": "an ISBN prefix and spaces are accepted", "args": ["ISBN 978 0 306 40615 7"], "expect": { "valid": true, "normalised": "9780306406157", "isbn10": "0306406152", "reason": null } },
{ "name": "a lower-case prefix with a colon", "args": ["isbn:0306406152"], "expect": { "valid": true, "normalised": "9780306406157", "isbn10": "0306406152", "reason": null } },
{ "name": "copying the ISBN-10 check digit onto the ISBN-13 is wrong", "args": ["9780306406152"], "expect": { "valid": false, "normalised": null, "isbn10": null, "reason": "bad-check-digit" } },
{ "name": "an ISBN-10 with its last digit off by one", "args": ["0306406153"], "expect": { "valid": false, "normalised": null, "isbn10": null, "reason": "bad-check-digit" } },
{ "name": "an ISBN-10 with two digits transposed", "args": ["0306046152"], "expect": { "valid": false, "normalised": null, "isbn10": null, "reason": "bad-check-digit" } },
{ "name": "a valid EAN-13 outside Bookland is not an ISBN", "args": ["4006381333931"], "expect": { "valid": false, "normalised": null, "isbn10": null, "reason": "bad-prefix" } },
{ "name": "X anywhere but the end is a bad format", "args": ["03064X6152"], "expect": { "valid": false, "normalised": null, "isbn10": null, "reason": "bad-format" } },
{ "name": "X is never part of an ISBN-13", "args": ["978030640615X"], "expect": { "valid": false, "normalised": null, "isbn10": null, "reason": "bad-format" } },
{ "name": "twelve digits is neither length", "args": ["978030640615"], "expect": { "valid": false, "normalised": null, "isbn10": null, "reason": "bad-length" } },
{ "name": "a letter other than X is a bad character", "args": ["0-306-4O615-2"], "expect": { "valid": false, "normalised": null, "isbn10": null, "reason": "bad-character" } },
{ "name": "the prefix alone is empty", "args": ["ISBN "], "expect": { "valid": false, "normalised": null, "isbn10": null, "reason": "empty" } },
{ "name": "the empty string", "args": [""], "expect": { "valid": false, "normalised": null, "isbn10": null, "reason": "empty" } },
{ "name": "a non-string is empty, not an exception", "args": [42], "expect": { "valid": false, "normalised": null, "isbn10": null, "reason": "empty" } }
]