test(macos): avoid hardcoded install script app names

- derive optional prefs assertions from crate::get_app_name()\n- keep install script regression coverage compatible with rebranded builds

Signed-off-by: Amirhossein Akhlaghpour <m9.akhlaghpoor@gmail.com>
This commit is contained in:
Amirhossein Akhlaghpour 2026-04-08 19:51:45 +03:30
commit 54dd29d1a6
No known key found for this signature in database
GPG key ID: D7A35F11FB70A961

View file

@ -319,6 +319,7 @@ mod tests {
.and_then(|file| file.contents_utf8())
.map(correct_app_name)
.expect("install.scpt should be embedded");
let app_name = crate::get_app_name();
assert!(
install.contains("launchctl bootstrap gui/$uid")
@ -335,9 +336,13 @@ mod tests {
"install script must quote username-derived paths",
);
assert!(
install.contains("test ! -f \"$user_preferences_dir/RustDesk.toml\" || cp -rf")
&& install
.contains("test ! -f \"$user_preferences_dir/RustDesk2.toml\" || cp -rf"),
install.contains(&format!(
"test ! -f \"$user_preferences_dir/{}.toml\" || cp -rf",
app_name
)) && install.contains(&format!(
"test ! -f \"$user_preferences_dir/{}2.toml\" || cp -rf",
app_name
)),
"install script must treat missing preference files as optional",
);
}