Addded tests for begins_with and ends_with and fixed a curious syntax error
ends_with and begins_with should short-circuit on pass, and should not try to pass more than once