mirror of
https://github.com/typst/typst
synced 2025-08-18 17:08:33 +08:00
Add passing and failing autocomplete test
This commit is contained in:
parent
a2f158c413
commit
6b3c6658e2
@ -1709,6 +1709,27 @@ mod tests {
|
|||||||
.must_exclude(["bib"]);
|
.must_exclude(["bib"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_autocomplete_ref_function() {
|
||||||
|
let mut world = TestWorld::new("x<test>");
|
||||||
|
let doc = typst::compile(&world).output.ok();
|
||||||
|
|
||||||
|
let end = world.main.text().len();
|
||||||
|
world.main.edit(end..end, " #ref(<)");
|
||||||
|
|
||||||
|
test_with_doc(&world, -2, doc.as_ref()).must_include(["test"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_autocomplete_ref_shorthand() {
|
||||||
|
let mut world = TestWorld::new("x<test>");
|
||||||
|
let doc = typst::compile(&world).output.ok();
|
||||||
|
|
||||||
|
let end = world.main.text().len();
|
||||||
|
world.main.edit(end..end, " @");
|
||||||
|
|
||||||
|
test_with_doc(&world, -1, doc.as_ref()).must_include(["test"]);
|
||||||
|
}
|
||||||
/// Test what kind of brackets we autocomplete for function calls depending
|
/// Test what kind of brackets we autocomplete for function calls depending
|
||||||
/// on the function and existing parens.
|
/// on the function and existing parens.
|
||||||
#[test]
|
#[test]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user