summaryrefslogtreecommitdiff
path: root/support/texlab/tests/test_hover_bibtex_string_reference.rs
diff options
context:
space:
mode:
Diffstat (limited to 'support/texlab/tests/test_hover_bibtex_string_reference.rs')
-rw-r--r--support/texlab/tests/test_hover_bibtex_string_reference.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/support/texlab/tests/test_hover_bibtex_string_reference.rs b/support/texlab/tests/test_hover_bibtex_string_reference.rs
new file mode 100644
index 0000000000..d67f028990
--- /dev/null
+++ b/support/texlab/tests/test_hover_bibtex_string_reference.rs
@@ -0,0 +1,24 @@
+pub mod support;
+
+use lsp_types::*;
+use support::hover::*;
+
+const SCENARIO: &str = "bibtex/string_reference";
+
+#[tokio::test]
+async fn valid() {
+ let contents = run(SCENARIO, "foo.bib", 3, 15).await.unwrap();
+ assert_eq!(
+ contents,
+ HoverContents::Markup(MarkupContent {
+ kind: MarkupKind::PlainText,
+ value: "\"foo {bar} baz\"".into(),
+ })
+ );
+}
+
+#[tokio::test]
+async fn invalid() {
+ let contents = run(SCENARIO, "foo.bib", 3, 20).await;
+ assert_eq!(contents, None);
+}