diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-03-17 22:08:44 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-03-17 22:08:44 +0100 |
| commit | 8cdfc7faafc1d8df60d44e5db9d1c9e26345675b (patch) | |
| tree | 1c499081c972c2fd280a0fc6a820c07caf79c283 /tests/typ/library | |
| parent | 271b0f953b35ab2c0281b5f728798204accc412f (diff) | |
Rename box to rect and color to fill ✏
Diffstat (limited to 'tests/typ/library')
| -rw-r--r-- | tests/typ/library/base.typ | 2 | ||||
| -rw-r--r-- | tests/typ/library/pad.typ | 8 | ||||
| -rw-r--r-- | tests/typ/library/shapes.typ | 26 |
3 files changed, 19 insertions, 17 deletions
diff --git a/tests/typ/library/base.typ b/tests/typ/library/base.typ index 000a80ea..29c976c2 100644 --- a/tests/typ/library/base.typ +++ b/tests/typ/library/base.typ @@ -3,7 +3,7 @@ --- #test(type("hi"), "string") -#test(repr([Hi #box[there]]), "[Hi [<node box>]]") +#test(repr([Hi #rect[there]]), "[Hi [<node box>]]") --- // Check the output. diff --git a/tests/typ/library/pad.typ b/tests/typ/library/pad.typ index c8bfe907..c3d3786b 100644 --- a/tests/typ/library/pad.typ +++ b/tests/typ/library/pad.typ @@ -5,9 +5,9 @@ #pad(left: 10pt, [Indented!]) // All sides together. -#box(color: #9feb52, +#rect(fill: #9feb52, pad(10pt, right: 20pt, - box(color: #eb5278, width: 20pt, height: 20pt))) + rect(width: 20pt, height: 20pt, fill: #eb5278))) -// Error: 13-23 missing argument: body -Hi #box(pad(left: 10pt)) there +// Error: 14-24 missing argument: body +Hi #rect(pad(left: 10pt)) there diff --git a/tests/typ/library/shapes.typ b/tests/typ/library/shapes.typ index efb68edf..c5a8abf9 100644 --- a/tests/typ/library/shapes.typ +++ b/tests/typ/library/shapes.typ @@ -1,31 +1,33 @@ // Test shapes. --- +// Test `rect` function. + #page("a8", flip: true) -// Box with fixed width, should have text height. -#box(width: 2cm, color: #9650D6)[Legal] +// Fixed width, should have text height. +#rect(width: 2cm, fill: #9650D6)[Legal] Sometimes there is no box. -// Box with fixed height, should span line. -#box(height: 1cm, width: 100%, color: #734CED)[B] +// Fixed height, should span line. +#rect(height: 1cm, width: 100%, fill: #734CED)[B] -// Empty box with fixed width and height. -#box(width: 6cm, height: 12pt, color: #CB4CED) +// Empty with fixed width and height. +#rect(width: 6cm, height: 12pt, fill: #CB4CED) // Not visible, but creates a gap between the boxes above and below. -#box(width: 2in, color: #ff0000) +#rect(width: 2in, fill: #ff0000) // These are in a row! -#box(width: 0.5in, height: 10pt, color: #D6CD67) -#box(width: 0.5in, height: 10pt, color: #EDD466) -#box(width: 0.5in, height: 10pt, color: #E3BE62) +#rect(width: 0.5in, height: 10pt, fill: #D6CD67) +#rect(width: 0.5in, height: 10pt, fill: #EDD466) +#rect(width: 0.5in, height: 10pt, fill: #E3BE62) --- -// Make sure that you can't do page related stuff in a box. +// Make sure that you can't do page related stuff in a shape. A -#box[ +#rect[ B // Error: 16 cannot modify page from here #pagebreak() |
