mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-08-02 09:22:17 +00:00
test: add test for goto_definition
for label (#510)
* add test for `goto_definition` with label reference * simplify test for `goto_definition` with reference * abstract compile doc for test * add snap for goto_definition label reference
This commit is contained in:
parent
6b8380ade7
commit
0fce237d57
5 changed files with 54 additions and 22 deletions
|
@ -320,16 +320,9 @@ mod tests {
|
|||
let mut includes = HashSet::new();
|
||||
let mut excludes = HashSet::new();
|
||||
|
||||
let must_compile = properties
|
||||
.get("compile")
|
||||
.map(|v| v.trim() == "true")
|
||||
.unwrap_or(false);
|
||||
let must_compile = has_test_property(&properties, "compile");
|
||||
let doc = if must_compile {
|
||||
let doc = typst::compile(ctx.world(), &mut Default::default()).unwrap();
|
||||
Some(VersionedDocument {
|
||||
version: 0,
|
||||
document: Arc::new(doc),
|
||||
})
|
||||
compile_doc_for_test(ctx)
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue