what happens if none of these conditions is true? for example, the first character is a ">" symbol.

This is a good basis for a test. Write a test that ensures there is an error thrown. The error can say something like "bad value"