serde rename arch_name as archName

This commit is contained in:
锦恢 2024-12-03 17:15:35 +08:00
parent 9c911a28d7
commit 3690d88551
3 changed files with 10 additions and 0 deletions

1
Cargo.lock generated
View File

@ -1416,6 +1416,7 @@ dependencies = [
name = "sv-parser"
version = "0.13.3"
dependencies = [
"log",
"nom",
"nom-greedyerror",
"sv-parser-error",

View File

@ -295,6 +295,7 @@ impl Instance {
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct Module {
pub name: String,
#[serde(rename = "archName")]
pub arch_name: String,
pub params: Vec<Parameter>,
pub ports: Vec<Port>,

View File

@ -271,6 +271,7 @@ mod tests {
const TESTDIR: &str = "primitive_files";
#[test]
fn gen_primitive_bin() {
if let Ok(primitive_info) = init_parse_primitive_files("primitive_files") {
let serialized_data = bincode::serialize(&primitive_info).unwrap();
@ -282,6 +283,13 @@ mod tests {
}
}
#[test]
fn read_primitive_bin() {
let target_path = "target/primitive.bin";
let load = crate::core::primitive_parser::load_primitive_bin(&target_path);
assert!(load.is_some());
}
#[test]
fn test_xml() {
let res = xml_parser(TESTFILE);