From 9617af2219a35d117c34264d60947d0f73c53a5e Mon Sep 17 00:00:00 2001 From: Remo Senekowitsch Date: Fri, 16 Aug 2024 21:18:59 +0200 Subject: [PATCH] robot-name: remove redundant tests (#1983) [no important files changed] part of https://github.com/exercism/rust/issues/1824 This is another case where I think it makes sense to actually keep the util function around. It produces a good error message and in combination with the body of the test function, users should have enough information. As the comment in the diff already states, the removed tests are redundant because the type system prevents such errors anyway. --- .../practice/robot-name/tests/robot-name.rs | 23 ------------------- 1 file changed, 23 deletions(-) diff --git a/exercises/practice/robot-name/tests/robot-name.rs b/exercises/practice/robot-name/tests/robot-name.rs index 011b3c0b2..abfeadd3f 100644 --- a/exercises/practice/robot-name/tests/robot-name.rs +++ b/exercises/practice/robot-name/tests/robot-name.rs @@ -12,27 +12,12 @@ fn assert_name_matches_pattern(n: &str) { ); } -fn assert_name_is_persistent(r: &robot::Robot) { - // The type system already proves this, but why not. - let n1 = r.name(); - let n2 = r.name(); - let n3 = r.name(); - assert_eq!(n1, n2); - assert_eq!(n2, n3); -} - #[test] fn name_should_match_expected_pattern() { let r = robot::Robot::new(); assert_name_matches_pattern(r.name()); } -#[test] -#[ignore] -fn name_is_persistent() { - assert_name_is_persistent(&robot::Robot::new()); -} - #[test] #[ignore] fn different_robots_have_different_names() { @@ -63,14 +48,6 @@ fn new_name_should_match_expected_pattern() { assert_name_matches_pattern(r.name()); } -#[test] -#[ignore] -fn new_name_is_persistent() { - let mut r = robot::Robot::new(); - r.reset_name(); - assert_name_is_persistent(&r); -} - #[test] #[ignore] fn new_name_is_different_from_old_name() {