From 9c040a9d2b6aa0400df868c8a8581a9e168b9d14 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Mon, 29 Mar 2021 14:51:54 +0200 Subject: =?UTF-8?q?Move=20around=20test=20cases=20=F0=9F=9A=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/typ/library/basic.typ | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 tests/typ/library/basic.typ (limited to 'tests/typ/library/basic.typ') diff --git a/tests/typ/library/basic.typ b/tests/typ/library/basic.typ new file mode 100644 index 00000000..a16215a7 --- /dev/null +++ b/tests/typ/library/basic.typ @@ -0,0 +1,25 @@ +// Test basic functions. +// Ref: false + +--- +#test(type("hi"), "string") +#test(repr([Hi #rect[there]]), "[Hi []]") + +--- +// Check the output. +#test(rgb(0.0, 0.3, 0.7), #004db3) + +// Alpha channel. +#test(rgb(1.0, 0.0, 0.0, 0.5), #ff000080) + +// Warning: 2:11-2:14 should be between 0.0 and 1.0 +// Warning: 1:16-1:20 should be between 0.0 and 1.0 +#test(rgb(-30, 15.5, 0.5), #00ff80) + +// Error: 11-15 missing argument: blue component +#test(rgb(0, 1), #00ff00) + +// Error: 3:11-3:11 missing argument: red component +// Error: 2:11-2:11 missing argument: green component +// Error: 1:11-1:11 missing argument: blue component +#test(rgb(), #000000) -- cgit v1.2.3