summaryrefslogtreecommitdiff
path: root/support/texlab/tests/test_definition_latex_command.rs
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-12-03 03:01:24 +0000
committerNorbert Preining <norbert@preining.info>2019-12-03 03:01:24 +0000
commitb8d4bb76703bcb15578e2b23c5d256532180b894 (patch)
treebedd1df7a00521a2bd986b3c0289d6556a59e39b /support/texlab/tests/test_definition_latex_command.rs
parent02e4625a78a5029e8b5dc2a4ec70193b232f497e (diff)
CTAN sync 201912030301
Diffstat (limited to 'support/texlab/tests/test_definition_latex_command.rs')
-rw-r--r--support/texlab/tests/test_definition_latex_command.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/support/texlab/tests/test_definition_latex_command.rs b/support/texlab/tests/test_definition_latex_command.rs
new file mode 100644
index 0000000000..eba32f9a17
--- /dev/null
+++ b/support/texlab/tests/test_definition_latex_command.rs
@@ -0,0 +1,18 @@
+pub mod support;
+
+use lsp_types::Range;
+use support::definition::*;
+use texlab::range::RangeExt;
+
+const SCENARIO: &str = "latex/command";
+
+#[tokio::test]
+async fn link() {
+ let (scenario, mut links) = run_link(SCENARIO, "foo.tex", 2, 2).await;
+ assert_eq!(links.len(), 1);
+ let link = links.pop().unwrap();
+ verify::origin_selection_range(&link, 2, 0, 2, 4);
+ assert_eq!(link.target_uri, scenario.uri("foo.tex").into());
+ assert_eq!(link.target_range, Range::new_simple(0, 0, 0, 22));
+ assert_eq!(link.target_selection_range, Range::new_simple(0, 0, 0, 22));
+}