mirror of
https://github.com/annoyatron255/yosys4gal.git
synced 2024-12-23 02:52:24 +00:00
27 lines
568 B
Rust
27 lines
568 B
Rust
use ver2gal::yosys_parser::*;
|
|
use std::error::Error;
|
|
use std::fs;
|
|
use serde_json::from_slice;
|
|
|
|
#[test]
|
|
fn test_load() -> Result<(), Box<dyn Error>> {
|
|
let f = fs::read("testcases/json/synth_olmc_test.json")?;
|
|
|
|
let data: YosysDoc = from_slice(f.as_slice())?;
|
|
println!("{:?}", data);
|
|
|
|
Ok(())
|
|
}
|
|
|
|
#[test]
|
|
fn test_graph() -> Result<(), Box<dyn Error>> {
|
|
let f = fs::read("testcases/json/synth_olmc_test.json")?;
|
|
|
|
let data: YosysDoc = from_slice(f.as_slice())?;
|
|
|
|
let g = Graph::from(data);
|
|
println!("{:?}", g);
|
|
g.validate()?;
|
|
Ok(())
|
|
}
|