Vehicles are tested for pedestrian crashworthiness. Modern cars are even tested on their ability to detect pedestrians and avoid hitting them.
https://www.euroncap.com/en/vehicle-safety/the-ratings-expla...
https://www.euroncap.com/en/vehicle-safety/the-ratings-expla...