// Tests for mecha10_cli::services::package

use mecha10_cli::services::package::*;

#[test]
fn test_target_arch_conversion() {
    assert_eq!("x86_64".parse::<TargetArch>(), Ok(TargetArch::X8664UnknownLinuxGnu));
    assert_eq!("aarch64".parse::<TargetArch>(), Ok(TargetArch::Aarch64UnknownLinuxGnu));
    assert_eq!("arm64".parse::<TargetArch>(), Ok(TargetArch::Aarch64UnknownLinuxGnu));
    assert!("invalid".parse::<TargetArch>().is_err());
}

#[test]
fn test_target_arch_display() {
    let arch = TargetArch::Aarch64UnknownLinuxGnu;
    assert_eq!(arch.display_name(), "ARM64 (Linux)");
    assert_eq!(arch.as_str(), "aarch64-unknown-linux-gnu");
}

#[test]
fn test_default_config() {
    let config = PackageConfig::default();
    assert_eq!(config.output_dir, PathBuf::from("target/packages"));
    assert_eq!(config.build_profile, "release");
    assert!(config.include_assets);
}

#[test]
fn test_manifest_format_version() {
    assert_eq!(PackageManifest::FORMAT_VERSION, "1.0.0");
}
