2022-12-19 18:26:58 +00:00
|
|
|
use nix_installer::InstallPlan;
|
2022-12-05 17:47:13 +00:00
|
|
|
|
2023-02-01 20:35:52 +00:00
|
|
|
#[cfg(target_os = "linux")]
|
2023-02-10 20:35:00 +00:00
|
|
|
const LINUX: &str = include_str!("./fixtures/linux/linux.json");
|
2023-02-01 20:35:52 +00:00
|
|
|
#[cfg(target_os = "linux")]
|
2022-12-05 17:47:13 +00:00
|
|
|
const STEAM_DECK: &str = include_str!("./fixtures/linux/steam-deck.json");
|
2023-02-01 20:35:52 +00:00
|
|
|
#[cfg(target_os = "macos")]
|
2023-02-10 20:35:00 +00:00
|
|
|
const MACOS: &str = include_str!("./fixtures/macos/macos.json");
|
2022-12-05 17:47:13 +00:00
|
|
|
|
|
|
|
// Ensure existing plans still parse
|
2022-12-19 18:26:58 +00:00
|
|
|
// If this breaks and you need to update the fixture, disable these tests, bump `nix_installer` to a new version, and update the plans.
|
2023-02-01 20:35:52 +00:00
|
|
|
#[cfg(target_os = "linux")]
|
2022-12-05 17:47:13 +00:00
|
|
|
#[test]
|
2023-02-10 20:35:00 +00:00
|
|
|
fn plan_compat_linux() -> eyre::Result<()> {
|
|
|
|
let _: InstallPlan = serde_json::from_str(LINUX)?;
|
2022-12-05 17:47:13 +00:00
|
|
|
Ok(())
|
|
|
|
}
|
|
|
|
|
|
|
|
// Ensure existing plans still parse
|
2022-12-19 18:26:58 +00:00
|
|
|
// If this breaks and you need to update the fixture, disable these tests, bump `nix_installer` to a new version, and update the plans.
|
2023-02-01 20:35:52 +00:00
|
|
|
#[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
|
2022-12-19 18:26:58 +00:00
|
|
|
// If this breaks and you need to update the fixture, disable these tests, bump `nix_installer` to a new version, and update the plans.
|
2023-02-01 20:35:52 +00:00
|
|
|
#[cfg(target_os = "macos")]
|
2022-12-05 17:47:13 +00:00
|
|
|
#[test]
|
2023-02-10 20:35:00 +00:00
|
|
|
fn plan_compat_macos() -> eyre::Result<()> {
|
|
|
|
let _: InstallPlan = serde_json::from_str(MACOS)?;
|
2022-12-05 17:47:13 +00:00
|
|
|
Ok(())
|
|
|
|
}
|