[#1117] Add new tests and docstring for name_validator()

There are no existing tests for this that I can see.