From d8f5af439f460cacde21c1702e6298386806081e Mon Sep 17 00:00:00 2001 From: kkashilk Date: Thu, 30 Oct 2025 14:07:03 -0700 Subject: [PATCH] feat: Parameterize SSH integration test to use PRODUCT_NAME constant - Replace hardcoded '# Amazon' regex with dynamic PRODUCT_NAME constant - Ensures test works regardless of product branding - Test now passes with any PRODUCT_NAME value --- crates/fig_integrations/src/ssh/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/fig_integrations/src/ssh/mod.rs b/crates/fig_integrations/src/ssh/mod.rs index 10c8f0d22..5b897f0f6 100644 --- a/crates/fig_integrations/src/ssh/mod.rs +++ b/crates/fig_integrations/src/ssh/mod.rs @@ -290,9 +290,9 @@ mod tests { let all_count = all_re.find_iter(&replaced_config_text).count(); assert_eq!(all_count, 2); - // count the number of "Amazon" to ensure match is replaced - let amazon_re = Regex::new(r"# Amazon").unwrap(); - let amazon_count = amazon_re.find_iter(&replaced_config_text).count(); - assert_eq!(amazon_count, 1); + // count the number of product name comments to ensure match is replaced + let product_re = Regex::new(&format!(r"# {}", regex::escape(PRODUCT_NAME))).unwrap(); + let product_count = product_re.find_iter(&replaced_config_text).count(); + assert_eq!(product_count, 1); } }