lix-installer/tests/plan.rs

36 lines
1.3 KiB
Rust
Raw Normal View History

use nix_installer::InstallPlan;
2022-12-05 17:47:13 +00:00
#[cfg(target_os = "linux")]
2022-12-05 17:47:13 +00:00
const LINUX_MULTI: &str = include_str!("./fixtures/linux/linux-multi.json");
#[cfg(target_os = "linux")]
2022-12-05 17:47:13 +00:00
const STEAM_DECK: &str = include_str!("./fixtures/linux/steam-deck.json");
#[cfg(target_os = "macos")]
2022-12-05 17:47:13 +00:00
const DARWIN_MULTI: &str = include_str!("./fixtures/darwin/darwin-multi.json");
// Ensure existing plans still parse
// If this breaks and you need to update the fixture, disable these tests, bump `nix_installer` to a new version, and update the plans.
#[cfg(target_os = "linux")]
2022-12-05 17:47:13 +00:00
#[test]
fn plan_compat_linux_multi() -> eyre::Result<()> {
let _: InstallPlan = serde_json::from_str(LINUX_MULTI)?;
Ok(())
}
// Ensure existing plans still parse
// If this breaks and you need to update the fixture, disable these tests, bump `nix_installer` to a new version, and update the plans.
#[cfg(target_os = "linux")]
2022-12-05 17:47:13 +00:00
#[test]
fn plan_compat_steam_deck() -> eyre::Result<()> {
let _: InstallPlan = serde_json::from_str(STEAM_DECK)?;
Ok(())
}
// Ensure existing plans still parse
// If this breaks and you need to update the fixture, disable these tests, bump `nix_installer` to a new version, and update the plans.
#[cfg(target_os = "macos")]
2022-12-05 17:47:13 +00:00
#[test]
fn plan_compat_darwin_multi() -> eyre::Result<()> {
let _: InstallPlan = serde_json::from_str(DARWIN_MULTI)?;
Ok(())
}