2023-06-15 07:10:20 -05:00
|
|
|
// Standard Uses
|
|
|
|
|
|
|
|
// Local Uses
|
|
|
|
|
|
|
|
// External Uses
|
2023-06-23 22:16:35 -05:00
|
|
|
use comline::idl;
|
|
|
|
use comline::idl::constants::SCHEMA_EXTENSION;
|
|
|
|
use comline::ir::unit::Unit;
|
2023-06-15 07:10:20 -05:00
|
|
|
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn from_raw_to_unit() {
|
2023-06-23 22:16:35 -05:00
|
|
|
let raw = std::fs::read_to_string(
|
|
|
|
format!("tests/idl/simple.{}", SCHEMA_EXTENSION)
|
|
|
|
).unwrap();
|
2023-06-15 07:10:20 -05:00
|
|
|
let unit = idl::pest::parse_into_unit(raw.as_str()).unwrap();
|
|
|
|
|
|
|
|
assert_eq!(
|
|
|
|
unit, Unit::Items(vec![
|
|
|
|
Unit::Namespace("".to_string()),
|
|
|
|
|
|
|
|
]
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|