summaryrefslogtreecommitdiff
path: root/Test/D01prompt.ztst
diff options
context:
space:
mode:
Diffstat (limited to 'Test/D01prompt.ztst')
-rw-r--r--Test/D01prompt.ztst14
1 files changed, 13 insertions, 1 deletions
diff --git a/Test/D01prompt.ztst b/Test/D01prompt.ztst
index 607ffb698..11f18dc71 100644
--- a/Test/D01prompt.ztst
+++ b/Test/D01prompt.ztst
@@ -82,9 +82,12 @@
# We could test for that, but we can't be bothered.
# I hope LC_ALL is enough to make the format what's expected.
+# The $date2 assignment tests that %s is interpreted as a printf format
+# string, rather than as a prompt escape (end standout).
+
LC_ALL=C
date1=$(print -P %w)
- date2=$(print -P %W)
+ date2=$(print -P -f %s %W)
date3=$(print -P %D)
if [[ $date1 != [A-Z][a-z][a-z][[:blank:]]##[0-9]## ]]; then
print "Date \`$date1' is not in the form \`Day DD' (e.g. \`Mon 1'"
@@ -201,3 +204,12 @@
?+zsh_directory_name:14> return 0
?+fn:7> local d='~[<parent>:l]'
?+fn:8> print '~[<parent>:l]'
+
+# Test that format strings are not subject to prompt expansion
+ print -P -f '%%Sfoo%%s\n' bar
+0:print -P -f
+>%Sfoo%s
+
+ print ${(%U)Y-%(v}
+0:Regression test for test on empty psvar
+>