test: add tests about signature help (#917)

This commit is contained in:
Myriad-Dreamin 2024-11-30 22:50:58 +08:00 committed by GitHub
parent 1a41dfeb2d
commit 982c430338
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 89 additions and 0 deletions

View file

@ -132,3 +132,24 @@ fn markdown_docs(docs: &str) -> Documentation {
value: docs.to_owned(),
})
}
#[cfg(test)]
mod tests {
use super::*;
use crate::tests::*;
#[test]
fn test() {
snapshot_testing("signature_help", &|ctx, path| {
let source = ctx.source_by_path(&path).unwrap();
let request = SignatureHelpRequest {
path: path.clone(),
position: find_test_position(&source),
};
let result = request.request(ctx);
assert_snapshot!(JsonRepr::new_redacted(result, &REDACT_LOC));
});
}
}