aKode fase 5: rinomina interna (crate akode-*, akode-rs/, akode-cli/, binario akode, AKODE_*, ~/.akode, snapshot)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
andrea.difonzo
2026-11-11 11:06:46 +01:00
parent df99318392
commit 86e7c72e5f
10383 changed files with 749164 additions and 749170 deletions

View File

@@ -0,0 +1,39 @@
//! Exercises uninstall argument handling without performing machine-wide cleanup.
use anyhow::Result;
use predicates::str::contains;
use pretty_assertions::assert_eq;
use tempfile::TempDir;
#[test]
fn uninstall_help_and_invalid_arguments_preserve_user_data() -> Result<()> {
let home = TempDir::new()?;
// Uninstall must work independently of configuration parsing and authentication.
std::fs::write(home.path().join("config.toml"), "invalid config [")?;
std::fs::write(home.path().join("auth.json"), "preserve credentials")?;
let mut command = assert_cmd::Command::new(akode_utils_cargo_bin::cargo_bin("akode")?);
command
.env("AKODE_HOME", home.path())
.args(["sandbox", "uninstall", "--help"])
.assert()
.success();
let mut command = assert_cmd::Command::new(akode_utils_cargo_bin::cargo_bin("akode")?);
command
.env("AKODE_HOME", home.path())
.args(["sandbox", "uninstall", "unexpected"])
.assert()
.failure()
.stderr(contains("unexpected argument"));
assert_eq!(
std::fs::read_to_string(home.path().join("config.toml"))?,
"invalid config ["
);
assert_eq!(
std::fs::read_to_string(home.path().join("auth.json"))?,
"preserve credentials"
);
Ok(())
}