array search with tests