From 4c92ab4ace41a20ccea59bbdf6917b5dfa29121f Mon Sep 17 00:00:00 2001 From: Laurenz Date: Wed, 21 Dec 2022 23:51:15 +0100 Subject: Rename the `create` category to `construct` --- tests/ref/compute/construct.png | Bin 0 -> 155 bytes tests/ref/compute/create.png | Bin 155 -> 0 bytes tests/typ/compute/construct.typ | 55 ++++++++++++++++++++++++++++++++++++++++ tests/typ/compute/create.typ | 55 ---------------------------------------- 4 files changed, 55 insertions(+), 55 deletions(-) create mode 100644 tests/ref/compute/construct.png delete mode 100644 tests/ref/compute/create.png create mode 100644 tests/typ/compute/construct.typ delete mode 100644 tests/typ/compute/create.typ (limited to 'tests') diff --git a/tests/ref/compute/construct.png b/tests/ref/compute/construct.png new file mode 100644 index 00000000..600e6174 Binary files /dev/null and b/tests/ref/compute/construct.png differ diff --git a/tests/ref/compute/create.png b/tests/ref/compute/create.png deleted file mode 100644 index 600e6174..00000000 Binary files a/tests/ref/compute/create.png and /dev/null differ diff --git a/tests/typ/compute/construct.typ b/tests/typ/compute/construct.typ new file mode 100644 index 00000000..ccb7bd2e --- /dev/null +++ b/tests/typ/compute/construct.typ @@ -0,0 +1,55 @@ +// Test creation and conversion functions. +// Ref: false + +--- +// Compare both ways. +#test(rgb(0%, 30%, 70%), rgb("004db3")) + +// Alpha channel. +#test(rgb(255, 0, 0, 50%), rgb("ff000080")) + +// Test color modification methods. +#test(rgb(25, 35, 45).lighten(10%), rgb(48, 57, 66)) +#test(rgb(40, 30, 20).darken(10%), rgb(36, 27, 18)) +#test(rgb("#133337").negate(), rgb(236, 204, 200)) +#test(white.lighten(100%), white) + +--- +// Test gray color conversion. +// Ref: true +#rect(fill: luma(0)) +#rect(fill: luma(80%)) + +--- +// Error for values that are out of range. +// Error: 11-14 must be between 0 and 255 +#test(rgb(-30, 15, 50)) + +--- +// Error: 6-11 string contains non-hexadecimal letters +#rgb("lol") + +--- +// Error: 5-7 missing argument: red component +#rgb() + +--- +// Error: 5-11 missing argument: blue component +#rgb(0, 1) + +--- +// Error: 21-26 expected integer or ratio, found boolean +#rgb(10%, 20%, 30%, false) + +--- +// Test conversion to string. +#test(str(123), "123") +#test(str(50.14), "50.14") +#test(str(10 / 3).len() > 10, true) + +--- +// Error: 6-8 expected integer, float, label, or string, found content +#str([]) + +--- +#assert(range(2, 5) == (2, 3, 4)) diff --git a/tests/typ/compute/create.typ b/tests/typ/compute/create.typ deleted file mode 100644 index ccb7bd2e..00000000 --- a/tests/typ/compute/create.typ +++ /dev/null @@ -1,55 +0,0 @@ -// Test creation and conversion functions. -// Ref: false - ---- -// Compare both ways. -#test(rgb(0%, 30%, 70%), rgb("004db3")) - -// Alpha channel. -#test(rgb(255, 0, 0, 50%), rgb("ff000080")) - -// Test color modification methods. -#test(rgb(25, 35, 45).lighten(10%), rgb(48, 57, 66)) -#test(rgb(40, 30, 20).darken(10%), rgb(36, 27, 18)) -#test(rgb("#133337").negate(), rgb(236, 204, 200)) -#test(white.lighten(100%), white) - ---- -// Test gray color conversion. -// Ref: true -#rect(fill: luma(0)) -#rect(fill: luma(80%)) - ---- -// Error for values that are out of range. -// Error: 11-14 must be between 0 and 255 -#test(rgb(-30, 15, 50)) - ---- -// Error: 6-11 string contains non-hexadecimal letters -#rgb("lol") - ---- -// Error: 5-7 missing argument: red component -#rgb() - ---- -// Error: 5-11 missing argument: blue component -#rgb(0, 1) - ---- -// Error: 21-26 expected integer or ratio, found boolean -#rgb(10%, 20%, 30%, false) - ---- -// Test conversion to string. -#test(str(123), "123") -#test(str(50.14), "50.14") -#test(str(10 / 3).len() > 10, true) - ---- -// Error: 6-8 expected integer, float, label, or string, found content -#str([]) - ---- -#assert(range(2, 5) == (2, 3, 4)) -- cgit v1.2.3