From 7edad5cefa0f065aa83dffd2d7830aeaf9f38662 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sat, 29 Jan 2022 23:31:16 +0100 Subject: tests: add functional tests for builtin functions Signed-off-by: Jo-Philipp Wich --- tests/custom/03_stdlib/21_uc | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 tests/custom/03_stdlib/21_uc (limited to 'tests/custom/03_stdlib/21_uc') diff --git a/tests/custom/03_stdlib/21_uc b/tests/custom/03_stdlib/21_uc new file mode 100644 index 0000000..a5aeed3 --- /dev/null +++ b/tests/custom/03_stdlib/21_uc @@ -0,0 +1,27 @@ +The `uc()` function turns each lower case character in the source string +into upper case and returns the resulting copy. + +The input argument is converted to a string in case it is not already a +string value. + +-- Testcase -- +{% + printf("%.J\n", [ + uc("This Will Be All Uppercased."), + uc([ "An", "array", "ABC" ]), + uc(123), + uc(false), + uc() + ]); +%} +-- End -- + +-- Expect stdout -- +[ + "THIS WILL BE ALL UPPERCASED.", + "[ \"AN\", \"ARRAY\", \"ABC\" ]", + "123", + "FALSE", + "NULL" +] +-- End -- -- cgit v1.2.3