From b8d4bb76703bcb15578e2b23c5d256532180b894 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Tue, 3 Dec 2019 03:01:24 +0000 Subject: CTAN sync 201912030301 --- support/texlab/tests/test_hover_bibtex_field.rs | 28 +++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 support/texlab/tests/test_hover_bibtex_field.rs (limited to 'support/texlab/tests/test_hover_bibtex_field.rs') diff --git a/support/texlab/tests/test_hover_bibtex_field.rs b/support/texlab/tests/test_hover_bibtex_field.rs new file mode 100644 index 0000000000..06f12349ac --- /dev/null +++ b/support/texlab/tests/test_hover_bibtex_field.rs @@ -0,0 +1,28 @@ +pub mod support; + +use lsp_types::*; +use support::hover::*; +use texlab::syntax::LANGUAGE_DATA; + +const SCENARIO: &str = "bibtex/field"; + +#[tokio::test] +async fn known() { + let contents = run(SCENARIO, "foo.bib", 1, 4).await.unwrap(); + assert_eq!( + contents, + HoverContents::Markup(MarkupContent { + kind: MarkupKind::Markdown, + value: LANGUAGE_DATA + .field_documentation("author") + .unwrap() + .to_owned() + }) + ); +} + +#[tokio::test] +async fn unknown() { + let contents = run(SCENARIO, "foo.bib", 2, 5).await; + assert_eq!(contents, None); +} -- cgit v1.2.3