summaryrefslogtreecommitdiff
path: root/support/texlab/tests/test_definition_bibtex_string.rs
blob: 99382de53425767fbd0977a75bdf5c56d8429e62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
pub mod support;

use lsp_types::Range;
use support::definition::*;
use texlab::range::RangeExt;

const SCENARIO: &str = "bibtex/string";

#[tokio::test]
async fn link() {
    let (scenario, mut links) = run_link(SCENARIO, "foo.bib", 5, 14).await;
    assert_eq!(links.len(), 1);
    let link = links.pop().unwrap();
    verify::origin_selection_range(&link, 5, 13, 5, 16);
    assert_eq!(link.target_uri, scenario.uri("foo.bib").into());
    assert_eq!(link.target_range, Range::new_simple(2, 0, 2, 20));
    assert_eq!(link.target_selection_range, Range::new_simple(2, 8, 2, 11));
}