summaryrefslogtreecommitdiffhomepage
path: root/tests/custom/03_stdlib/23_values
diff options
context:
space:
mode:
Diffstat (limited to 'tests/custom/03_stdlib/23_values')
-rw-r--r--tests/custom/03_stdlib/23_values35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/custom/03_stdlib/23_values b/tests/custom/03_stdlib/23_values
new file mode 100644
index 0000000..34b600e
--- /dev/null
+++ b/tests/custom/03_stdlib/23_values
@@ -0,0 +1,35 @@
+The `values()` extracts all values of a given dictionary. The values in the
+resulting array are ordered according to the keys which in turn follow
+declaration or assignment order.
+
+Returns an array containg the value of each key within the given dictionary
+value.
+
+Returns `null` if the given dictionary argment is not a valid dictionary.
+
+-- Testcase --
+{%
+ printf("%.J\n", [
+ values({ foo: true, bar: false, baz: null, qrx: 123, xyz: "test" }),
+ values({}),
+ values(true),
+ values()
+ ]);
+%}
+-- End --
+
+-- Expect stdout --
+[
+ [
+ true,
+ false,
+ null,
+ 123,
+ "test"
+ ],
+ [
+ ],
+ null,
+ null
+]
+-- End --