[Robot Name] Add test_many_different_robots_have_different_names()
@@ -41,6 +41,19 @@ fn test_different_robots_have_different_names() {
assert_ne!(r1.name(), r2.name(), "Robot names should be different");
}
+#[test]
+#[ignore]
+fn test_many_different_robots_have_different_names() {
+ use std::collections::HashSet;
+
+ // In 3,529 random robot names, there is ~99.99% chance of a name collision
+ let vec: Vec<_> = (0..3529).map(|_| robot::Robot::new()).collect();
+ let set: HashSet<_> = vec.iter().map(|robot| robot.name()).collect();
+
+ // If the lengths are different, there was a name collision
+ assert_eq!(set.len(), vec.len());
+}
+
#[test]
#[ignore]
fn test_new_name_should_match_expected_pattern() {
