summaryrefslogtreecommitdiffhomepage
path: root/tests/custom/03_stdlib/28_printf
diff options
context:
space:
mode:
Diffstat (limited to 'tests/custom/03_stdlib/28_printf')
-rw-r--r--tests/custom/03_stdlib/28_printf17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/custom/03_stdlib/28_printf b/tests/custom/03_stdlib/28_printf
index a2a6d27..b4556b3 100644
--- a/tests/custom/03_stdlib/28_printf
+++ b/tests/custom/03_stdlib/28_printf
@@ -524,3 +524,20 @@ Supplying a non-string format value will yield an empty string result.
-- Expect stdout --
-- End --
+
+
+Prefixing a format directive with `n$` will select the corresponding argument
+with 1 referring to the first argument. Missing or out-of range arguments will
+be treated as `null`.
+
+-- Testcase --
+{%
+ printf("%2$s\n", "foo", "bar", "baz");
+ printf("%10$s\n", "foo", "bar", "baz");
+%}
+-- End --
+
+-- Expect stdout --
+bar
+(null)
+-- End --