summaryrefslogtreecommitdiff
path: root/support/texlab/tests/test_hover_bibtex_type.rs
diff options
context:
space:
mode:
Diffstat (limited to 'support/texlab/tests/test_hover_bibtex_type.rs')
-rw-r--r--support/texlab/tests/test_hover_bibtex_type.rs28
1 files changed, 28 insertions, 0 deletions
diff --git a/support/texlab/tests/test_hover_bibtex_type.rs b/support/texlab/tests/test_hover_bibtex_type.rs
new file mode 100644
index 0000000000..23db7084d5
--- /dev/null
+++ b/support/texlab/tests/test_hover_bibtex_type.rs
@@ -0,0 +1,28 @@
+pub mod support;
+
+use lsp_types::*;
+use support::hover::*;
+use texlab::syntax::LANGUAGE_DATA;
+
+const SCENARIO: &str = "bibtex/type";
+
+#[tokio::test]
+async fn known() {
+ let contents = run(SCENARIO, "foo.bib", 0, 5).await.unwrap();
+ assert_eq!(
+ contents,
+ HoverContents::Markup(MarkupContent {
+ kind: MarkupKind::Markdown,
+ value: LANGUAGE_DATA
+ .entry_type_documentation("article")
+ .unwrap()
+ .to_owned()
+ })
+ );
+}
+
+#[tokio::test]
+async fn unknown() {
+ let contents = run(SCENARIO, "foo.bib", 2, 2).await;
+ assert_eq!(contents, None);
+}