about summary refs log tree commit diff
diff options
context:
space:
mode:
authorWayne Davison <wayned@users.sourceforge.net>2005-07-26 00:28:14 +0000
committerWayne Davison <wayned@users.sourceforge.net>2005-07-26 00:28:14 +0000
commit71c4ea95c6043d70fa396cbb004e5421fae69cf7 (patch)
treefb767ce61e82bc0e1cccb3ef94990b18057f054d
parentb77b51cda827cf6b282911c4e359b69721cba9e6 (diff)
downloadzsh-71c4ea95c6043d70fa396cbb004e5421fae69cf7.tar.gz
zsh-71c4ea95c6043d70fa396cbb004e5421fae69cf7.tar.xz
zsh-71c4ea95c6043d70fa396cbb004e5421fae69cf7.zip
Added tests for \c escape handling.
-rw-r--r--Test/B03print.ztst28
1 files changed, 28 insertions, 0 deletions
diff --git a/Test/B03print.ztst b/Test/B03print.ztst
index 4d21bdc6c..a18a826b3 100644
--- a/Test/B03print.ztst
+++ b/Test/B03print.ztst
@@ -183,6 +183,34 @@
 0:flags mixed with specified argument
 >+003
 
+# Test the parsing of the \c escape.
+
+ echo '1 2!\c3 4' a b c d; echo
+0:Truncating first echo arg using backslash-c
+>1 2!
+
+ echo a b '1 2?\c5 6' c d; echo
+0:Truncating third echo arg using backslash-c
+>a b 1 2?
+
+ printf '1 2!\n\c3 4'
+0:Truncating printf literal using backslash-c
+>1 2!
+
+ printf '%s %b!\n\c%s %s' 1 2 3 4 5 6 7 8 9
+0:Truncating printf format using backslash-c
+>1 2!
+
+ printf '%s %b!\c%s %s' '1\c' '2\n\c' 3 4 5 6 7 8 9
+0:Truncating printf early %b arg using backslash-c
+>1\c 2
+
+ printf '%s %b\n' '1\c' 2 3 4 5 '6\n\c' 7 8 9
+0:Truncating printf late %b arg using backslash-c
+>1\c 2
+>3 4
+>5 6
+
 # The following usage, as stated in the manual, is not recommended and the
 # results are undefined. Tests are here anyway to ensure some form of
 # half-sane behaviour.