summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/suite/foundations/context.typ13
-rw-r--r--tests/suite/introspection/counter.typ2
-rw-r--r--tests/suite/layout/grid/footers.typ6
-rw-r--r--tests/suite/layout/grid/headers.typ4
-rw-r--r--tests/suite/layout/grid/rowspan.typ2
-rw-r--r--tests/suite/layout/spacing.typ2
-rw-r--r--tests/suite/styling/fold.typ5
7 files changed, 26 insertions, 8 deletions
diff --git a/tests/suite/foundations/context.typ b/tests/suite/foundations/context.typ
index fea9f544..0906fb1e 100644
--- a/tests/suite/foundations/context.typ
+++ b/tests/suite/foundations/context.typ
@@ -43,10 +43,16 @@
#s.update(x =>
eval(expr.replace("x", str(x)))
)
+ // Warning: 17-28 `state.display` is deprecated
+ // Hint: 17-28 use `state.get` in a `context` expression instead
New value is #s.display().
]
+// Warning: 1:2-6:3 `locate` with callback function is deprecated
+// Hint: 1:2-6:3 use a `context` expression instead
#locate(loc => {
+ // Warning: 14-32 calling `query` with a location is deprecated
+ // Hint: 14-32 try removing the location argument
let elem = query(<here>, loc).first()
test(s.at(elem.location()), 13)
})
@@ -58,8 +64,15 @@
#compute("x - 5")
--- context-compatibility-styling ---
+// Warning: 2-53 `style` is deprecated
+// Hint: 2-53 use a `context` expression instead
+// Warning: 18-39 calling `measure` with a styles argument is deprecated
+// Hint: 18-39 try removing the styles argument
#style(styles => measure([it], styles).width < 20pt)
--- context-compatibility-counter-display ---
#counter(heading).update(10)
+
+// Warning: 2-44 `counter.display` without context is deprecated
+// Hint: 2-44 use it in a `context` expression instead
#counter(heading).display(n => test(n, 10))
diff --git a/tests/suite/introspection/counter.typ b/tests/suite/introspection/counter.typ
index c0b17921..be17d7e0 100644
--- a/tests/suite/introspection/counter.typ
+++ b/tests/suite/introspection/counter.typ
@@ -79,7 +79,7 @@ At Beta, it was #context {
--- issue-2480-counter-reset ---
#let q = counter("question")
-#let step-show = q.step() + q.display("1")
+#let step-show = q.step() + context q.display("1")
#let g = grid(step-show, step-show, gutter: 2pt)
#g
diff --git a/tests/suite/layout/grid/footers.typ b/tests/suite/layout/grid/footers.typ
index 7cd09003..edbb36fb 100644
--- a/tests/suite/layout/grid/footers.typ
+++ b/tests/suite/layout/grid/footers.typ
@@ -282,17 +282,17 @@
rows: (auto, 2em, auto, auto),
table.header(
[eeec],
- table.cell(rowspan: 2, count.step() + count.display()),
+ table.cell(rowspan: 2, count.step() + context count.display()),
),
[d],
block(width: 5em, fill: yellow, lorem(7)),
[d],
table.footer(
[eeec],
- table.cell(rowspan: 2, count.step() + count.display()),
+ table.cell(rowspan: 2, count.step() + context count.display()),
)
)
-#count.display()
+#context count.display()
--- grid-nested-with-footers ---
// Nested table with footer should repeat both footers
diff --git a/tests/suite/layout/grid/headers.typ b/tests/suite/layout/grid/headers.typ
index 78a2540f..c9c95e13 100644
--- a/tests/suite/layout/grid/headers.typ
+++ b/tests/suite/layout/grid/headers.typ
@@ -265,13 +265,13 @@
rows: (auto, 2em, auto, auto),
table.header(
[eeec],
- table.cell(rowspan: 2, count.step() + count.display()),
+ table.cell(rowspan: 2, count.step() + context count.display()),
),
[d],
block(width: 5em, fill: yellow, lorem(15)),
[d]
)
-#count.display()
+#context count.display()
--- grid-header-expand ---
// Ensure header expands to fit cell placed in it after its declaration
diff --git a/tests/suite/layout/grid/rowspan.typ b/tests/suite/layout/grid/rowspan.typ
index f7a377b6..e5c8bbc8 100644
--- a/tests/suite/layout/grid/rowspan.typ
+++ b/tests/suite/layout/grid/rowspan.typ
@@ -163,7 +163,7 @@
#let count = counter("count")
#show grid.cell: it => {
count.step()
- count.display()
+ context count.display()
}
#grid(
diff --git a/tests/suite/layout/spacing.typ b/tests/suite/layout/spacing.typ
index c32e6c8f..f5938995 100644
--- a/tests/suite/layout/spacing.typ
+++ b/tests/suite/layout/spacing.typ
@@ -34,7 +34,7 @@ Totally #h() ignored
h(1em)
counter(heading).update(4)
[Hello ]
- counter(heading).display()
+ context counter(heading).display()
}
--- trim-weak-space-line-beginning ---
diff --git a/tests/suite/styling/fold.typ b/tests/suite/styling/fold.typ
index 26fe991b..4b77f9d5 100644
--- a/tests/suite/styling/fold.typ
+++ b/tests/suite/styling/fold.typ
@@ -12,8 +12,13 @@ fi
--- fold-vec-order-meta ---
#let c = counter("mycounter")
#c.update(1)
+
+// Warning: 1:2-7:3 `locate` with callback function is deprecated
+// Hint: 1:2-7:3 use a `context` expression instead
#locate(loc => [
#c.update(2)
#c.at(loc) \
+ // Warning: 12-36 `locate` with callback function is deprecated
+ // Hint: 12-36 use a `context` expression instead
Second: #locate(loc => c.at(loc))
])