summaryrefslogtreecommitdiff
path: root/support/texlab/crates/hover/src/tests.rs
diff options
context:
space:
mode:
Diffstat (limited to 'support/texlab/crates/hover/src/tests.rs')
-rw-r--r--support/texlab/crates/hover/src/tests.rs34
1 files changed, 34 insertions, 0 deletions
diff --git a/support/texlab/crates/hover/src/tests.rs b/support/texlab/crates/hover/src/tests.rs
index e6377bb034..4473982645 100644
--- a/support/texlab/crates/hover/src/tests.rs
+++ b/support/texlab/crates/hover/src/tests.rs
@@ -318,3 +318,37 @@ fn test_latex_label_theorem_child_file_mumber() {
"#]],
);
}
+
+#[test]
+fn test_latex_label_ntheorem() {
+ check(
+ r#"
+%! main.tex
+\newtheorem{theorem}[theoremcounter]{Theorem}
+\begin{theorem}%
+\label{thm:test}
+\end{theorem}
+\ref{thm:test}
+ |
+ ^^^^^^^^
+
+%! main.aux
+\newlabel{thm:test}{{1.{1}}{1}}"#,
+ expect![[r#"
+ Some(
+ Label(
+ RenderedLabel {
+ range: 46..93,
+ number: Some(
+ "1.1",
+ ),
+ object: Theorem {
+ kind: "Theorem",
+ description: None,
+ },
+ },
+ ),
+ )
+ "#]],
+ );
+}