summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2024-05-22 11:26:03 +0200
committerGitHub <noreply@github.com>2024-05-22 09:26:03 +0000
commita52987a8c26bc13e3db4cc300b8cd9d81eb8a18d (patch)
treeb6eeb1aeb07ead2b60acfcf99562f16dd53ba7b1 /tests
parenta24052cb80e8a86695ac73e00281d5df0b9317c9 (diff)
Refactor frame metadata into tags (#4212)
Diffstat (limited to 'tests')
-rw-r--r--tests/ref/eval-mode.pngbin881 -> 850 bytes
-rw-r--r--tests/ref/issue-785-cite-locate.pngbin15456 -> 15194 bytes
-rw-r--r--tests/ref/link-on-block.pngbin2423 -> 2422 bytes
-rw-r--r--tests/ref/locate-position-trailing-tag.pngbin0 -> 74 bytes
-rw-r--r--tests/ref/quote-cite-format-note.pngbin2943 -> 2941 bytes
-rw-r--r--tests/src/run.rs5
-rw-r--r--tests/suite/introspection/locate.typ7
7 files changed, 9 insertions, 3 deletions
diff --git a/tests/ref/eval-mode.png b/tests/ref/eval-mode.png
index 94357ff4..5edfa62d 100644
--- a/tests/ref/eval-mode.png
+++ b/tests/ref/eval-mode.png
Binary files differ
diff --git a/tests/ref/issue-785-cite-locate.png b/tests/ref/issue-785-cite-locate.png
index 7c2a650a..bcdcc968 100644
--- a/tests/ref/issue-785-cite-locate.png
+++ b/tests/ref/issue-785-cite-locate.png
Binary files differ
diff --git a/tests/ref/link-on-block.png b/tests/ref/link-on-block.png
index 9076983d..ed73b866 100644
--- a/tests/ref/link-on-block.png
+++ b/tests/ref/link-on-block.png
Binary files differ
diff --git a/tests/ref/locate-position-trailing-tag.png b/tests/ref/locate-position-trailing-tag.png
new file mode 100644
index 00000000..b64188a7
--- /dev/null
+++ b/tests/ref/locate-position-trailing-tag.png
Binary files differ
diff --git a/tests/ref/quote-cite-format-note.png b/tests/ref/quote-cite-format-note.png
index 1092ffdb..cb2c4c0a 100644
--- a/tests/ref/quote-cite-format-note.png
+++ b/tests/ref/quote-cite-format-note.png
Binary files differ
diff --git a/tests/src/run.rs b/tests/src/run.rs
index 47760e16..a59ce536 100644
--- a/tests/src/run.rs
+++ b/tests/src/run.rs
@@ -7,7 +7,6 @@ use tiny_skia as sk;
use typst::diag::SourceDiagnostic;
use typst::eval::Tracer;
use typst::foundations::Smart;
-use typst::introspection::Meta;
use typst::layout::{Abs, Frame, FrameItem, Page, Transform};
use typst::model::Document;
use typst::visualize::Color;
@@ -392,7 +391,7 @@ fn render_links(canvas: &mut sk::Pixmap, ts: sk::Transform, frame: &Frame) {
let ts = ts.pre_concat(to_sk_transform(&group.transform));
render_links(canvas, ts, &group.frame);
}
- FrameItem::Meta(Meta::Link(_), size) => {
+ FrameItem::Link(_, size) => {
let w = size.x.to_pt() as f32;
let h = size.y.to_pt() as f32;
let rect = sk::Rect::from_xywh(0.0, 0.0, w, h).unwrap();
@@ -416,7 +415,7 @@ fn skippable(page: &Page) -> bool {
fn skippable_frame(frame: &Frame) -> bool {
frame.items().all(|(_, item)| match item {
FrameItem::Group(group) => skippable_frame(&group.frame),
- FrameItem::Meta(..) => true,
+ FrameItem::Tag(_) => true,
_ => false,
})
}
diff --git a/tests/suite/introspection/locate.typ b/tests/suite/introspection/locate.typ
index 981f8c46..b3a77fde 100644
--- a/tests/suite/introspection/locate.typ
+++ b/tests/suite/introspection/locate.typ
@@ -4,6 +4,13 @@
= Introduction <intro>
#context test(locate(<intro>).position().y, 20pt)
+--- locate-position-trailing-tag ---
+// Test locating the position of a tag with no following content.
+#context test(here().position().y, 10pt)
+#box[]
+#v(10pt)
+#context test(here().position().y, 20pt)
+
--- locate-missing-label ---
// Error: 10-25 label `<intro>` does not exist in the document
#context locate(<intro>)