summaryrefslogtreecommitdiff
path: root/tests/typ/utility
diff options
context:
space:
mode:
authorMartin Haug <mhaug@live.de>2022-04-25 12:58:10 +0200
committerMartin Haug <mhaug@live.de>2022-04-25 14:20:47 +0200
commit649c101f07f6de4791dc9b6091dff4a85112a15c (patch)
treea7abdb603577b0186a801e5728a05d1fc4e373ff /tests/typ/utility
parent7163b4a6c57c99fda085bf9b364c82bdba8ea698 (diff)
Add blind text function
Diffstat (limited to 'tests/typ/utility')
-rw-r--r--tests/typ/utility/blind.typ32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/typ/utility/blind.typ b/tests/typ/utility/blind.typ
new file mode 100644
index 00000000..7d1cb969
--- /dev/null
+++ b/tests/typ/utility/blind.typ
@@ -0,0 +1,32 @@
+// Test blind text.
+
+---
+// Test basic call.
+#lipsum(19)
+
+---
+// Test custom paragraphs with user code.
+#set text(8pt)
+
+{
+ let sentences = lipsum(59)
+ .split(".")
+ .filter(s => s != "")
+ .map(s => s + ".")
+
+ let used = 0
+ for s in sentences {
+ if used < 2 {
+ used += 1
+ } else {
+ parbreak()
+ used = 0
+ }
+ s.trim()
+ [ ]
+ }
+}
+
+---
+// Error: 8-10 missing argument: number of words
+#lipsum()