summaryrefslogtreecommitdiff
path: root/support/texlab/crates/completion/src/tests.rs
diff options
context:
space:
mode:
Diffstat (limited to 'support/texlab/crates/completion/src/tests.rs')
-rw-r--r--support/texlab/crates/completion/src/tests.rs57
1 files changed, 38 insertions, 19 deletions
diff --git a/support/texlab/crates/completion/src/tests.rs b/support/texlab/crates/completion/src/tests.rs
index 84cd06447b..f41c9f5e6b 100644
--- a/support/texlab/crates/completion/src/tests.rs
+++ b/support/texlab/crates/completion/src/tests.rs
@@ -726,40 +726,34 @@ fn component_command_simple() {
%! main.tex
\
|"#,
- expect![[r##"
+ expect![[r#"
[
- Command(
- CommandData {
- name: "!",
- package: [],
- },
+ CommandLikeDelimiter(
+ "(",
+ ")",
),
- Command(
- CommandData {
- name: "\"",
- package: [],
- },
+ CommandLikeDelimiter(
+ "[",
+ "]",
),
- Command(
- CommandData {
- name: "#",
- package: [],
- },
+ CommandLikeDelimiter(
+ "{",
+ "\\}",
),
Command(
CommandData {
- name: "$",
+ name: "!",
package: [],
},
),
Command(
CommandData {
- name: "%",
+ name: "\"",
package: [],
},
),
]
- "##]],
+ "#]],
);
}
@@ -1613,6 +1607,31 @@ Lorem ipsum dolor sit amet.
}
#[test]
+fn label_undefined() {
+ check(
+ r#"
+%! foo.tex
+\label{f}
+ |
+ ^
+\ref{foo}"#,
+ expect![[r#"
+ [
+ Label(
+ LabelData {
+ name: "foo",
+ header: None,
+ footer: None,
+ object: None,
+ keywords: "foo",
+ },
+ ),
+ ]
+ "#]],
+ );
+}
+
+#[test]
fn theorem_begin() {
check(
r#"