ioss 0.0.3

Io celestial simulation crate for the MilkyWay SolarSystem workspace
Documentation
// ── ExosphereEndpoint ──

#[test]
fn io_exosphere_species_count() {
    let exo = ioss::rendering::volcanic_plumes::ExosphereEndpoint::io();
    assert!(exo.species.len() >= 8);
}

#[test]
fn io_so2_dominant() {
    let exo = ioss::rendering::volcanic_plumes::ExosphereEndpoint::io();
    let so2 = exo.species.iter().find(|s| s.symbol == "SO2").unwrap();
    assert!(so2.column_density_m2 > 1e19);
}

#[test]
fn io_density_at_altitude_decreases() {
    let exo = ioss::rendering::volcanic_plumes::ExosphereEndpoint::io();
    assert!(exo.density_at_altitude("SO2", 50_000.0) < exo.density_at_altitude("SO2", 0.0));
}

#[test]
fn io_total_column_density() {
    let exo = ioss::rendering::volcanic_plumes::ExosphereEndpoint::io();
    assert!(exo.total_column_density() > 1e19);
}

#[test]
fn io_sodium_glow() {
    let exo = ioss::rendering::volcanic_plumes::ExosphereEndpoint::io();
    assert!(exo.sodium_glow_intensity() > 0.0);
}

#[test]
fn io_molar_masses_positive() {
    let exo = ioss::rendering::volcanic_plumes::ExosphereEndpoint::io();
    for sp in &exo.species {
        assert!(
            sp.molar_mass_kg_mol > 0.0,
            "{} has zero molar mass",
            sp.name
        );
    }
}

// ── VolcanicPlumeEndpoint ──

#[test]
fn pele_plume_height() {
    let p = ioss::rendering::volcanic_plumes::VolcanicPlumeEndpoint::pele_type();
    assert!((p.plume_height_m - 300_000.0).abs() < 1.0);
}

#[test]
fn prometheus_plume_shorter() {
    let pele = ioss::rendering::volcanic_plumes::VolcanicPlumeEndpoint::pele_type();
    let prom = ioss::rendering::volcanic_plumes::VolcanicPlumeEndpoint::prometheus_type();
    assert!(prom.plume_height_m < pele.plume_height_m);
}

#[test]
fn plume_density_at_vent() {
    let p = ioss::rendering::volcanic_plumes::VolcanicPlumeEndpoint::pele_type();
    assert!((p.plume_density_at_height(0.0) - p.optical_depth_at_vent).abs() < 0.01);
}

#[test]
fn plume_density_zero_above() {
    let p = ioss::rendering::volcanic_plumes::VolcanicPlumeEndpoint::pele_type();
    assert!((p.plume_density_at_height(400_000.0)).abs() < 1e-9);
}

#[test]
fn thermal_emission_positive() {
    let p = ioss::rendering::volcanic_plumes::VolcanicPlumeEndpoint::pele_type();
    assert!(p.thermal_emission_w_m2() > 0.0);
}

// ── ShaderEndpoint ──

#[test]
fn io_terrain_shader() {
    let s = ioss::rendering::shaders::ShaderEndpoint::terrain();
    assert!(s.uniforms.len() >= 5);
    assert_eq!(s.name, "io_terrain_pbr");
}

#[test]
fn io_volcanic_shader() {
    let s = ioss::rendering::shaders::ShaderEndpoint::volcanic();
    assert!(s.uniforms.len() >= 4);
    assert_eq!(s.name, "io_volcanic_emission");
}

#[test]
fn io_eclipse_shader() {
    let s = ioss::rendering::shaders::ShaderEndpoint::eclipse();
    assert!(s.uniforms.len() >= 3);
}

// ── DustScattering (kept) ──

#[test]
fn volcanic_plume_opacity() {
    let d = ioss::rendering::dust::DustScattering::volcanic_plume();
    assert!(d.opacity_at_height(0.0) > 0.0);
}

#[test]
fn opacity_decreases() {
    let d = ioss::rendering::dust::DustScattering::volcanic_plume();
    assert!(d.opacity_at_height(100_000.0) < d.opacity_at_height(0.0));
}

// ── PbrMaterial (kept) ──

#[test]
fn sulfur_plains_material() {
    let m = ioss::rendering::materials::PbrMaterial::sulfur_plains();
    assert!(m.albedo[0] > 0.5);
}

#[test]
fn lava_flow_dark() {
    let m = ioss::rendering::materials::PbrMaterial::lava_flow();
    assert!(m.albedo[0] < 0.2);
}

#[test]
fn so2_frost_bright() {
    let m = ioss::rendering::materials::PbrMaterial::so2_frost();
    assert!(m.albedo[0] > 0.8);
}