Names with special characters for testing
A name field is usually built for a first name and a surname of plain letters. Real names are not like that. These are the names to test it with, each with what it usually breaks.
Which names should a name field be tested with?
With the names real people have and the form did not expect: an apostrophe, a hyphen, two surnames, a single name, letters outside ASCII, and surnames a program reads as a value. None of them is a trick. A name field that refuses or changes one of them refuses a real person, usually on the day they try to sign up.
What do I check after each name?
The same four things every time:
- Is it stored and shown as typed? Open the record again, and look at the name in a list and in an email the application sends.
- Is it found by search? Type it the same way, and with the apostrophe or the accent left out.
- Is the greeting right? “Dear Mr O’Brien” built from the field, not “Dear Mr O” or “Dear Mr Obrien”.
- Does it survive the next system? The export, the invoice, the courier’s label.
Apostrophes, hyphens and two surnames
Test the punctuation inside real names. The apostrophe is the most common real surname that breaks forms, and a space or a hyphen inside a name breaks every rule that splits a name into words.
The apostrophe breaks query construction, name splitting and sorting; the most common real surname that breaks forms.
names-identity/apostrophe-surname Anna-MariaA hyphenated given name splits into two in systems assuming one word per field.
names-identity/hyphen-first-name GarcíaMárquezTwo surnames without a hyphen; splitting on the space produces a wrong first name.
names-identity/two-surnames vanderBergLowercase particles break capitalisation, sorting and any rule assuming a surname starts with a capital letter.
names-identity/particle-prefixSurnames a program reads as a value
Test the surnames that are also words a program understands. Null and True are real surnames, and a layer that treats text loosely turns them into “nothing” and “yes”.
A real surname that every layer treating text loosely turns into an absent value; the record loses its name on save.
names-identity/surname-null TrueThe same failure as Null in a different form, and one that also breaks configuration files.
names-identity/surname-trueOne name, one letter, a digit, a title
Test the names that break the shape the form assumed: a person with one name, a name of one letter, a digit in a name, and a title typed into the name field.
People with one name exist; a form requiring both parts cannot represent them at all.
names-identity/single-name XA one-letter name is legal in several countries and rejected by nearly every minimum-length rule.
names-identity/single-letter-name John3Digits in a name break validators that allow letters only, and those validators reject legitimate users.
names-identity/digits-in-name DrJanKowalskiTitles typed into a name field break salutations and duplicate detection.
names-identity/title-insideLetters outside ASCII
Test the letters your users have in their names, and two that look the same and are stored differently. An encoding narrower than the full character set turns them into question marks on save.
Encoding narrower than the full character set replaces these with question marks, and the name is corrupted on save.
locale-pl/diacritics-full Kowalska-NowakDouble surnames break name splitting, sorting and the assumption that a surname is one word.
locale-pl/surname-hyphenated pаwelA Cyrillic letter identical in shape to the Latin one; two accounts that look the same to every human.
look-alike-pairs/cyrillic-small-a Jan😀KowalskiA character outside the basic plane in a name field breaks byte-length limits and databases configured for narrow encodings.
unicode-text/emoji-in-nameCapitals, length and spaces
Test a surname written in capitals, as on documents, a name longer than the column and the layout were sized for, and the spaces that arrive with a name copied from somewhere else.
Names written in capitals, common on documents; auto-capitalisation turns them into something else.
names-identity/all-caps-surname 120 × aLong names hit column limits and layouts sized for a typical name.
names-identity/very-long-name JanKowalskiA non-breaking space where an ordinary one is expected; search never matches.
look-alike-pairs/nbsp-name KowalskiLogin and e-mail comparisons differ between browser and server; the account is created but cannot be found.
whitespace/trailing-spaceHow do I go through all of them quickly?
With the palette, one shortcut per name: choose the pack Names and identity, click the field, press AltShiftN , look at the result, and press it again for the next. When a name breaks something, AltShiftB copies a report block for the ticket. Getting started takes about two minutes.
For an automated test, nkb emit prints the pack as JSON, CSV or one value per line:
$ nkb emit names-identity --format json > names.json
Every name is on the page of the pack, with what a correct application does instead. For an email field, see email field test cases.