diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-12-20 14:18:29 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-12-21 00:20:24 +0100 |
| commit | 11565a40b315212474f52eb576a9fd92b11f1132 (patch) | |
| tree | c6b7afb35103065bc92b407094ca905bb75cfc73 /tests/typ/style | |
| parent | 958f74f77707340f34ee36d09492bdb74523aa2a (diff) | |
Set Rules Episode IX: The Rise of Testing
Diffstat (limited to 'tests/typ/style')
| -rw-r--r-- | tests/typ/style/set-block.typ | 10 | ||||
| -rw-r--r-- | tests/typ/style/set-site.typ | 30 | ||||
| -rw-r--r-- | tests/typ/style/set-toggle.typ | 10 |
3 files changed, 50 insertions, 0 deletions
diff --git a/tests/typ/style/set-block.typ b/tests/typ/style/set-block.typ new file mode 100644 index 00000000..f260acdc --- /dev/null +++ b/tests/typ/style/set-block.typ @@ -0,0 +1,10 @@ +// Test set in code blocks. + +--- +// Test that template in block is not affected by set +// rule in block ... +A{set text(fill: eastern); [B]}C + +--- +// ... no matter the order. +A{[B]; set text(fill: eastern)}C diff --git a/tests/typ/style/set-site.typ b/tests/typ/style/set-site.typ new file mode 100644 index 00000000..97a5672d --- /dev/null +++ b/tests/typ/style/set-site.typ @@ -0,0 +1,30 @@ +// Test that set affects the instantiation site and not the +// definition site of a template. + +--- +// Test that text is affected by instantion-site bold. +#let x = [World] +Hello *{x}* + +--- +// Test that lists are affected by correct indents. +#set par(spacing: 4pt) +#let fruit = [ + - Apple + - Orange + #set list(body-indent: 10pt) + - Pear +] + +- Fruit +[#set list(label-indent: 10pt) + #fruit] +- No more fruit + +--- +// Test that that par spacing and text style are respected from +// the outside, but the more specific fill is respected. +#set par(spacing: 4pt) +#set text(style: "italic", fill: eastern) +#let x = [And the forest #parbreak() lay silent!] +#text(fill: forest, x) diff --git a/tests/typ/style/set-toggle.typ b/tests/typ/style/set-toggle.typ new file mode 100644 index 00000000..9f26bdf7 --- /dev/null +++ b/tests/typ/style/set-toggle.typ @@ -0,0 +1,10 @@ +// Test set rules for toggleable booleans. + +--- +// Test toggling and untoggling. +*AB_C*DE +*_* + +--- +// Test toggling and nested templates. +*A[B*[_C]]D*E |
