comline/tests/idl/pest.rs

27 lines
484 B
Rust
Raw Normal View History

2023-06-15 07:10:20 -05:00
// Standard Uses
// Local Uses
// External Uses
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() {
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()),
]
)
)
}