summaryrefslogtreecommitdiff
path: root/tests/typ/repr.typ
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-02-20 17:53:40 +0100
committerLaurenz <laurmaedje@gmail.com>2021-02-20 23:34:33 +0100
commit05727bfc3a9cfd45a8e2028dfd0806f7a8f88015 (patch)
tree6c0b66eb2a9dff224cb39eb6ccb478656a706c04 /tests/typ/repr.typ
parent927341d93ae29678095e3b874bd68bfc57d4bc05 (diff)
Reorganize tests 🔀
Diffstat (limited to 'tests/typ/repr.typ')
-rw-r--r--tests/typ/repr.typ50
1 files changed, 50 insertions, 0 deletions
diff --git a/tests/typ/repr.typ b/tests/typ/repr.typ
new file mode 100644
index 00000000..666db428
--- /dev/null
+++ b/tests/typ/repr.typ
@@ -0,0 +1,50 @@
+// Test representation of values in the document.
+
+---
+// Variables.
+
+#let name = "Typst"
+#let ke-bab = "Kebab!"
+#let α = "Alpha"
+
+{name} \
+{ke-bab} \
+{α} \
+
+// Error: 2-3 unknown variable
+{_}
+
+---
+// Literal values.
+{none} (empty) \
+{true} \
+{false} \
+
+---
+// Numerical values.
+{1} \
+{1.0e-4} \
+{3.15} \
+{1e-10} \
+{50.368%} \
+{0.0000012345pt} \
+{4.5cm} \
+{12e1pt} \
+{2.5rad} \
+{45deg} \
+
+// Not in monospace via repr.
+#repr(45deg)
+
+---
+// Colors.
+{#f7a20500} \
+
+---
+// Strings and escaping.
+{"hi"} \
+{"a\n[]\"\u{1F680}string"} \
+
+---
+// Templates.
+{[*{"H" + "i"} there*]}