summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ref/issue-4087.pngbin0 -> 2681 bytes
-rw-r--r--tests/ref/math-linebreaking-between-consecutive-relations.pngbin387 -> 387 bytes
-rw-r--r--tests/ref/trim-weak-space-line-beginning.pngbin0 -> 245 bytes
-rw-r--r--tests/ref/trim-weak-space-line-end.pngbin0 -> 246 bytes
-rw-r--r--tests/suite/layout/spacing.typ22
-rw-r--r--tests/suite/math/multiline.typ5
6 files changed, 26 insertions, 1 deletions
diff --git a/tests/ref/issue-4087.png b/tests/ref/issue-4087.png
new file mode 100644
index 00000000..ad5f4d6e
--- /dev/null
+++ b/tests/ref/issue-4087.png
Binary files differ
diff --git a/tests/ref/math-linebreaking-between-consecutive-relations.png b/tests/ref/math-linebreaking-between-consecutive-relations.png
index ba222c57..7231456a 100644
--- a/tests/ref/math-linebreaking-between-consecutive-relations.png
+++ b/tests/ref/math-linebreaking-between-consecutive-relations.png
Binary files differ
diff --git a/tests/ref/trim-weak-space-line-beginning.png b/tests/ref/trim-weak-space-line-beginning.png
new file mode 100644
index 00000000..37e13773
--- /dev/null
+++ b/tests/ref/trim-weak-space-line-beginning.png
Binary files differ
diff --git a/tests/ref/trim-weak-space-line-end.png b/tests/ref/trim-weak-space-line-end.png
new file mode 100644
index 00000000..004bb97a
--- /dev/null
+++ b/tests/ref/trim-weak-space-line-end.png
Binary files differ
diff --git a/tests/suite/layout/spacing.typ b/tests/suite/layout/spacing.typ
index 430e9779..dd0fced5 100644
--- a/tests/suite/layout/spacing.typ
+++ b/tests/suite/layout/spacing.typ
@@ -36,3 +36,25 @@ Totally #h() ignored
[Hello ]
counter(heading).display()
}
+
+--- trim-weak-space-line-beginning ---
+// Weak space at the beginning should be removed.
+#h(2cm, weak: true) Hello
+
+--- trim-weak-space-line-end ---
+// Weak space at the end of the line should be removed.
+#set align(right)
+Hello #h(2cm, weak: true)
+
+--- issue-4087 ---
+// weak space at the end of the line would be removed.
+This is the first line #h(2cm, weak: true) A new line
+
+// non-weak space would be consume a specified width and push next line.
+This is the first line #h(2cm, weak: false) A new line
+
+// similarly weak space at the beginning of the line would be removed.
+This is the first line\ #h(2cm, weak: true) A new line
+
+// non-spacing, on the other hand, is not removed.
+This is the first line\ #h(2cm, weak: false) A new line
diff --git a/tests/suite/math/multiline.typ b/tests/suite/math/multiline.typ
index 85433627..edf974a1 100644
--- a/tests/suite/math/multiline.typ
+++ b/tests/suite/math/multiline.typ
@@ -86,9 +86,12 @@ Multiple trailing line breaks.
--- math-linebreaking-between-consecutive-relations ---
// A relation followed by a relation doesn't linebreak
+// so essentially `a < = b` can be broken to `a` and `< = b`, `a < =` and `b`
+// but never `a <` and `= b` because `< =` are consecutive relation that should
+// be grouped together and no break between them.
#let hrule(x) = box(line(length: x))
#hrule(70pt)$a < = b$\
-#hrule(74pt)$a < = b$
+#hrule(78pt)$a < = b$
--- math-linebreaking-after-relation-without-space ---
// Line breaks can happen after a relation even if there is no