[
{ "name": "trims and collapses runs of spaces", "args": [" john smith "], "expect": "John Smith" },
{ "name": "all capitals are title-cased", "args": ["JOHN SMITH"], "expect": "John Smith" },
{ "name": "hyphen and apostrophe restart the capitals", "args": ["mary-jane o'neill"], "expect": "Mary-Jane O'Neill" },
{ "name": "Mc gets a capital after it", "args": ["MCDONALD"], "expect": "McDonald" },
{ "name": "Mc in a lower case full name", "args": ["ronald mcdonald"], "expect": "Ronald McDonald" },
{ "name": "Mac gets a capital after it in a long enough name", "args": ["ian macdonald"], "expect": "Ian MacDonald" },
{ "name": "a listed exception is not treated as Mac plus a name", "args": ["MACEY"], "expect": "Macey" },
{ "name": "a short Mac word is never split", "args": ["mack"], "expect": "Mack" },
{ "name": "O' and Mc across a hyphen", "args": ["o'brien-mcarthur"], "expect": "O'Brien-McArthur" },
{ "name": "a typographic apostrophe works too", "args": ["O’REILLY"], "expect": "O’Reilly" },
{ "name": "a particle in the middle is lower case", "args": ["ludwig van beethoven"], "expect": "Ludwig van Beethoven" },
{ "name": "two particles in a row", "args": ["JUAN DE LA CRUZ"], "expect": "Juan de la Cruz" },
{ "name": "a particle as the first word is capitalised", "args": ["VAN MORRISON"], "expect": "Van Morrison" },
{ "name": "mixed case words are kept as typed, a naive title-case would say Dicaprio", "args": ["leonardo DiCaprio"], "expect": "Leonardo DiCaprio" },
{ "name": "a capitalised particle typed deliberately is kept", "args": ["Dick Van Dyke"], "expect": "Dick Van Dyke" },
{ "name": "full stops restart the capitals so initials survive", "args": ["J.R.R. TOLKIEN"], "expect": "J.R.R. Tolkien" },
{ "name": "an apostrophe after a single letter", "args": ["d'arcy"], "expect": "D'Arcy" },
{ "name": "accented Latin letters are cased", "args": ["ZOË ÇELIK"], "expect": "Zoë Çelik" },
{ "name": "sharp s cannot be upper-cased to one letter so it is left as it is", "args": ["STRAßER"], "expect": "Straßer" },
{ "name": "no-break spaces and tabs collapse to one space", "args": ["anne \t marie"], "expect": "Anne Marie" },
{ "name": "the empty string stays empty", "args": [""], "expect": "" },
{ "name": "only whitespace becomes the empty string", "args": [" \t "], "expect": "" },
{ "name": "a name that is not a string is an error", "args": [42], "expectError": "normaliseName needs a string" }
]