From 393417fe55fe56d30be8418c79a8d37312d1061a Mon Sep 17 00:00:00 2001 From: YardenCuriel Date: Wed, 25 Feb 2026 15:03:12 +0200 Subject: [PATCH] test: add edge case for config values containing '=' --- src/config.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/config.rs b/src/config.rs index eadbae1..f0e1d9a 100644 --- a/src/config.rs +++ b/src/config.rs @@ -172,4 +172,18 @@ mod tests { fn test_update_config_file_nonexistent_file() { update_config_file("/nonexistent/path/file.cfg", &[("KEY", "value")]); } + + #[test] + fn test_update_config_file_value_contains_equals() { + let tmpfile = NamedTempFile::new().unwrap(); + let path = tmpfile.path().to_str().unwrap(); + + // Values with '=' in them (e.g. base64 encoded) should be preserved + fs::write(path, "TOKEN=abc=def==\n").unwrap(); + + update_config_file(path, &[("TOKEN", "xyz=123==")]); + + let content = fs::read_to_string(path).unwrap(); + assert!(content.contains("TOKEN=xyz=123==")); + } }