v0.2.6-pre.004

This commit is contained in:
2026-08-20 23:01:41 +02:00
parent 6eb4d71043
commit 76bfce17c1
22 changed files with 903 additions and 43 deletions

View File

@@ -1,5 +1,5 @@
// file: crates/ksp-app-wallet-desk/unit_tests/wallet_config.rs
// version: 1
// version: 2
#[test]
fn directory_preparation_creates_missing_root_and_nested_profile_path() {
@@ -37,6 +37,30 @@ fn directory_preparation_rejects_existing_non_directory_root() {
cleanup_fixture(root.as_path());
}
#[cfg(unix)]
#[test]
fn global_wallet_root_rejects_symbolic_link() {
let root = fixture_path("root-symlink");
let outside = fixture_path("root-symlink-outside");
cleanup_fixture(root.as_path());
cleanup_fixture(outside.as_path());
let outside_created = std::fs::create_dir_all(outside.as_path());
assert!(outside_created.is_ok());
if outside_created.is_ok() {
let linked = std::os::unix::fs::symlink(outside.as_path(), root.as_path());
assert!(linked.is_ok());
if linked.is_ok() {
let result = super::ensure_global_wallet_root(root.as_path());
assert!(result.is_err());
if let std::result::Result::Err(error) = result {
assert_eq!(error.code(), crate::ERROR_CODE_WALLET_DIRECTORY_INVALID);
}
}
}
cleanup_fixture(root.as_path());
cleanup_fixture(outside.as_path());
}
#[cfg(unix)]
#[test]
fn profile_directory_preparation_rejects_symbolic_link_components() {