summaryrefslogtreecommitdiff
path: root/support/texlab/src/features/highlight/label.rs
diff options
context:
space:
mode:
Diffstat (limited to 'support/texlab/src/features/highlight/label.rs')
-rw-r--r--support/texlab/src/features/highlight/label.rs68
1 files changed, 0 insertions, 68 deletions
diff --git a/support/texlab/src/features/highlight/label.rs b/support/texlab/src/features/highlight/label.rs
index 3e8b95eac8..cb51abdd68 100644
--- a/support/texlab/src/features/highlight/label.rs
+++ b/support/texlab/src/features/highlight/label.rs
@@ -77,71 +77,3 @@ pub fn find_label_highlights(
Some(highlights)
}
-
-#[cfg(test)]
-mod tests {
- use lsp_types::Range;
-
- use crate::{features::testing::FeatureTester, RangeExt};
-
- use super::*;
-
- #[test]
- fn test_empty_latex_document() {
- let request = FeatureTester::builder()
- .files(vec![("main.tex", "")])
- .main("main.tex")
- .line(0)
- .character(0)
- .build()
- .highlight();
- let context = CursorContext::new(request);
-
- let actual_links = find_label_highlights(&context);
-
- assert!(actual_links.is_none());
- }
-
- #[test]
- fn test_empty_bibtex_document() {
- let request = FeatureTester::builder()
- .files(vec![("main.bib", "")])
- .main("main.bib")
- .line(0)
- .character(0)
- .build()
- .highlight();
- let context = CursorContext::new(request);
-
- let actual_links = find_label_highlights(&context);
-
- assert!(actual_links.is_none());
- }
-
- #[test]
- fn test_label() {
- let tester = FeatureTester::builder()
- .files(vec![("main.tex", "\\label{foo}\n\\ref{foo}\\label{bar}")])
- .main("main.tex")
- .line(0)
- .character(7)
- .build();
- let request = tester.highlight();
- let context = CursorContext::new(request);
-
- let actual_highlights = find_label_highlights(&context).unwrap();
-
- let expected_highlights = vec![
- DocumentHighlight {
- range: Range::new_simple(0, 7, 0, 10),
- kind: Some(DocumentHighlightKind::WRITE),
- },
- DocumentHighlight {
- range: Range::new_simple(1, 5, 1, 8),
- kind: Some(DocumentHighlightKind::READ),
- },
- ];
-
- assert_eq!(actual_highlights, expected_highlights);
- }
-}