Add test case for Parser::find_member
This commit is contained in:
parent
229b1bdd5c
commit
77a9163bb1
@ -18,6 +18,8 @@ SPDX-License-Identifier: MIT
|
||||
- Use one snapshot per test case and rustdoc version.
|
||||
- Refactor member lookup for compatibility with Rust 1.46.0.
|
||||
- Add tests for Rust 1.46.0.
|
||||
- Improve test suite:
|
||||
- Add test for `Parser::find_member`.
|
||||
|
||||
## v0.2.0 (2020-08-11)
|
||||
|
||||
|
@ -779,6 +779,19 @@ mod tests {
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_find_member() {
|
||||
with_rustdoc("*", |_, path| {
|
||||
let path = path.join("kuchiki").join("struct.NodeDataRef.html");
|
||||
let name: doc::Fqn = "kuchiki::NodeDataRef::as_node".to_owned().into();
|
||||
let ty = super::Parser::from_file(path)
|
||||
.unwrap()
|
||||
.find_member(&name)
|
||||
.unwrap();
|
||||
assert_eq!(Some(doc::ItemType::Method), ty);
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_parse_member_doc() {
|
||||
with_rustdoc("*", |_, path| {
|
||||
|
Loading…
Reference in New Issue
Block a user