Skip to content

Commit cc40034

Browse files
authored
feat: Parameterize SSH integration test to use PRODUCT_NAME constant (#870)
- Replace hardcoded '# Amazon' regex with dynamic PRODUCT_NAME constant - Ensures test works regardless of product branding - Test now passes with any PRODUCT_NAME value
1 parent 6e25a51 commit cc40034

File tree

1 file changed

+4
-4
lines changed
  • crates/fig_integrations/src/ssh

1 file changed

+4
-4
lines changed

crates/fig_integrations/src/ssh/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,9 @@ mod tests {
290290
let all_count = all_re.find_iter(&replaced_config_text).count();
291291
assert_eq!(all_count, 2);
292292

293-
// count the number of "Amazon" to ensure match is replaced
294-
let amazon_re = Regex::new(r"# Amazon").unwrap();
295-
let amazon_count = amazon_re.find_iter(&replaced_config_text).count();
296-
assert_eq!(amazon_count, 1);
293+
// count the number of product name comments to ensure match is replaced
294+
let product_re = Regex::new(&format!(r"# {}", regex::escape(PRODUCT_NAME))).unwrap();
295+
let product_count = product_re.find_iter(&replaced_config_text).count();
296+
assert_eq!(product_count, 1);
297297
}
298298
}

0 commit comments

Comments
 (0)