node-types: Add test for field merging with aliases
Co-Authored-By: Timothy Clem <timothy.clem@gmail.com>
This commit is contained in:
parent
1d63434664
commit
5a979d1457
1 changed files with 19 additions and 2 deletions
|
|
@ -1210,7 +1210,10 @@ mod tests {
|
|||
Variable {
|
||||
name: "b".to_string(),
|
||||
kind: VariableType::Named,
|
||||
rule: Rule::choice(vec![Rule::seq(vec![Rule::string("B")]), Rule::named("c")]),
|
||||
rule: Rule::choice(vec![
|
||||
Rule::field("f".to_string(), Rule::string("B")),
|
||||
Rule::named("c"),
|
||||
]),
|
||||
},
|
||||
Variable {
|
||||
name: "c".to_string(),
|
||||
|
|
@ -1263,7 +1266,21 @@ mod tests {
|
|||
},
|
||||
]
|
||||
}),
|
||||
fields: Some(BTreeMap::new()),
|
||||
fields: Some(
|
||||
vec![(
|
||||
"f".to_string(),
|
||||
FieldInfoJSON {
|
||||
required: false,
|
||||
multiple: false,
|
||||
types: vec![NodeTypeJSON {
|
||||
named: false,
|
||||
kind: "B".to_string(),
|
||||
}]
|
||||
}
|
||||
)]
|
||||
.into_iter()
|
||||
.collect()
|
||||
),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue