summaryrefslogtreecommitdiff
path: root/support/texlab/tests/test_completion_latex_citation.rs
diff options
context:
space:
mode:
Diffstat (limited to 'support/texlab/tests/test_completion_latex_citation.rs')
-rw-r--r--support/texlab/tests/test_completion_latex_citation.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/support/texlab/tests/test_completion_latex_citation.rs b/support/texlab/tests/test_completion_latex_citation.rs
new file mode 100644
index 0000000000..07ecd6690f
--- /dev/null
+++ b/support/texlab/tests/test_completion_latex_citation.rs
@@ -0,0 +1,26 @@
+pub mod support;
+
+use lsp_types::*;
+use support::completion::*;
+
+const SCENARIO: &str = "latex/citation";
+
+#[tokio::test]
+async fn valid_citation() {
+ let item = run_item(SCENARIO, "foo.tex", 5, 6, "foo:2019").await;
+ verify::text_edit(&item, 5, 6, 5, 6, "foo:2019");
+ assert_eq!(
+ item.documentation.unwrap(),
+ Documentation::MarkupContent(MarkupContent {
+ kind: MarkupKind::Markdown,
+ value: "Bar, F. (2019). *Baz Qux*.".into()
+ })
+ );
+}
+
+#[tokio::test]
+async fn invalid_citation() {
+ let item = run_item(SCENARIO, "foo.tex", 5, 6, "bar:2005").await;
+ verify::text_edit(&item, 5, 6, 5, 6, "bar:2005");
+ assert_eq!(item.documentation, None);
+}