test: testcases for resource include (#1082)

This commit is contained in:
Yifan Song 2024-12-28 14:58:06 +08:00 committed by GitHub
parent 98c61d0023
commit 3d805e0511
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 52 additions and 0 deletions

View file

@ -0,0 +1,11 @@
/// path: lib.typ
-----
/// path: bib.yaml
-----
#import "lib.typ"
#include /* position after */ "lib.typ"
#bibliography("bib.yaml")

View file

@ -0,0 +1,10 @@
---
source: crates/tinymist-query/src/prepare_rename.rs
expression: "JsonRepr::new_redacted(result, &REDACT_LOC)"
input_file: crates/tinymist-query/src/fixtures/rename/resources.typ
snapshot_kind: text
---
{
"placeholder": "lib.typ",
"range": "1:30:1:39"
}

View file

@ -0,0 +1,31 @@
---
source: crates/tinymist-query/src/rename.rs
expression: "JsonRepr::new_redacted(result, &REDACT_LOC)"
input_file: crates/tinymist-query/src/fixtures/rename/resources.typ
snapshot_kind: text
---
{
"documentChanges": [
{
"edits": [
{
"newText": "\"new_name.typ\"",
"range": "1:30:1:39"
},
{
"newText": "\"new_name.typ\" as lib",
"range": "0:8:0:17"
}
],
"textDocument": {
"uri": "s2.typ",
"version": null
}
},
{
"kind": "rename",
"newUri": "new_name.typ",
"oldUri": "lib.typ"
}
]
}