Skip to main content

ome_metadata/
lib.rs

1#![allow(non_camel_case_types)]
2pub mod ome;
3
4pub mod error;
5#[cfg(feature = "python")]
6pub mod py;
7
8pub use ome::Ome;
9
10#[cfg(test)]
11mod tests {
12    use crate::Ome;
13    use crate::error::Error;
14    use std::fs::read_to_string;
15
16    macro_rules! test_read {
17        ($($name:ident: $file:expr $(,)?)*) => {
18            $(
19                #[test]
20                fn $name() -> Result<(), Error> {
21                    let file = read_to_string(format!("tests/{}.xml", $file))?;
22                    let ome = Ome::from_xml(file)?;
23                    let _xml = ome.to_xml()?;
24                    Ok(())
25                }
26            )*
27        };
28    }
29
30    test_read!(
31        a: "YTL1849A111_2023_05_04__14_46_19_cellnr_1_track"
32        b: "Experiment-2029"
33        c: "test"
34        d: "4-Pos_001_002"
35        e: "YTL1841B2-2-1_1hr_DMSO_galinduction_1"
36        f: "1xp53-01-AP1"
37        g: "YTL378_JF552"
38        h: "MK022_cE9_1-01-Airyscan Processing-01-Scene-2-P1"
39        i: "beads_2023_05_04__19_00_22"
40        j: "20230511-p53-4x-CMV-1min-4h-01-Airyscan Processing-01"
41        k: "YTL1849A131_2023_05_04__13_36_36"
42        l: "multi-channel.ome"
43    );
44}