Test that a value containing '=' is not split more than once

This commit is contained in:
Kienan Stewart 2022-09-24 10:23:27 -04:00
parent 17a9445796
commit 6c0e022f7a
1 changed files with 2 additions and 2 deletions

View File

@ -106,14 +106,14 @@ mod tests {
fn test_set_all_values() { fn test_set_all_values() {
let mut conf = Conf::get_default_conf(); let mut conf = Conf::get_default_conf();
let tf = write_conf_to_temp_file(r#" let tf = write_conf_to_temp_file(r#"
job_dir = /value job_dir = /val=ue
output_dir=/var/lib/output output_dir=/var/lib/output
check_interval=3600 check_interval=3600
driver_url = https://example.test:6666 driver_url = https://example.test:6666
"#); "#);
let f = tf.path().to_str().unwrap(); let f = tf.path().to_str().unwrap();
conf.update_from_file(f); conf.update_from_file(f);
assert!(String::from_str("/value").unwrap().eq(&conf.job_dir)); assert!(String::from_str("/val=ue").unwrap().eq(&conf.job_dir));
assert!(String::from_str("/var/lib/output").unwrap().eq(&conf.output_dir)); assert!(String::from_str("/var/lib/output").unwrap().eq(&conf.output_dir));
assert!(String::from_str("https://example.test:6666").unwrap().eq(&conf.driver_url)); assert!(String::from_str("https://example.test:6666").unwrap().eq(&conf.driver_url));
assert_eq!(3600, conf.check_interval.as_secs()); assert_eq!(3600, conf.check_interval.as_secs());