Skip to content

Commit

Permalink
chore: Add test to catch earlier bug with whitespace in env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
stevensdavid committed Jun 10, 2024
1 parent e3bb29b commit 82315a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ mod config_tests {
#[tokio::test]
async fn test_env_substitution() {
env::set_var("TEST_ENV_VAR", "test_value");
let content = "Environment variable ${{ env.TEST_ENV_VAR }} should be replaced, missing ${{ env.MISSING_VAR }} should be empty";
let content = "Environment variable ${{ env.TEST_ENV_VAR }} should be replaced even with varying whitespace ${{env.TEST_ENV_VAR}}${{ env.TEST_ENV_VAR}} ${{env.TEST_ENV_VAR }}${{ env.TEST_ENV_VAR }}, missing ${{ env.MISSING_VAR }} should be empty";
let replaced = super::replace_env_vars(content);
assert_eq!(
"Environment variable test_value should be replaced, missing should be empty",
"Environment variable test_value should be replaced even with varying whitespace test_valuetest_value test_valuetest_value, missing should be empty",
replaced
);
}
Expand Down

0 comments on commit 82315a0

Please sign in to comment.