From 8b58171d7ca036d71b32749286c251cc91bdd10e Mon Sep 17 00:00:00 2001 From: Laurenz Date: Tue, 18 May 2021 00:36:11 +0200 Subject: Reorganize test cases --- tests/typ/code/repr.typ | 57 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 tests/typ/code/repr.typ (limited to 'tests/typ/code/repr.typ') diff --git a/tests/typ/code/repr.typ b/tests/typ/code/repr.typ new file mode 100644 index 00000000..f2404510 --- /dev/null +++ b/tests/typ/code/repr.typ @@ -0,0 +1,57 @@ +// 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*]} + +--- +// Functions +#let f(x) = x + +{rect} \ +{f} \ +{() => none} -- cgit v1.2.3