about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Test/.distfiles1
-rw-r--r--Test/D09brace.ztst52
3 files changed, 57 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index d3d430d37..f5d5a962a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2010-12-05  Peter Stephenson  <p.w.stephenson@ntlworld.com>
 
+	* 28476: Test/.distfiles, Test/D09brace.ztst: new test of tests
+	for brace expansion.
+
 	* 28475: Test/A05execution.ztst: test that starting a background
 	job resets the status.
 
@@ -13890,5 +13893,5 @@
 
 *****************************************************
 * This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.5136 $
+* $Revision: 1.5137 $
 *****************************************************
diff --git a/Test/.distfiles b/Test/.distfiles
index 7376cec80..0e691743b 100644
--- a/Test/.distfiles
+++ b/Test/.distfiles
@@ -28,6 +28,7 @@ D05array.ztst
 D06subscript.ztst
 D07multibyte.ztst
 D08cmdsubst.ztst
+D09brace.ztst
 E01options.ztst
 E02xtrace.ztst
 Makefile.in
diff --git a/Test/D09brace.ztst b/Test/D09brace.ztst
new file mode 100644
index 000000000..ff2eb522c
--- /dev/null
+++ b/Test/D09brace.ztst
@@ -0,0 +1,52 @@
+# Tests for brace expansion
+
+%prep
+
+  foo=(a b c)
+  arr=(foo bar baz)
+
+%test
+
+  print X{1,2,{3..6},7,8}Y
+0:Basic brace expansion
+>X1Y X2Y X3Y X4Y X5Y X6Y X7Y X8Y
+
+  print ${foo}{one,two,three}$arr
+0:Brace expansion with arrays, no RC_EXPAND_PARAM
+>a b conefoo ctwofoo cthreefoo bar baz
+
+  print ${^foo}{one,two,three}$arr
+0:Brace expansion with arrays, with RC_EXPAND_PARAM (1)
+>aonefoo atwofoo athreefoo bonefoo btwofoo bthreefoo conefoo ctwofoo cthreefoo bar baz
+
+  print ${foo}{one,two,three}$^arr
+0:Brace expansion with arrays, with RC_EXPAND_PARAM (2)
+>a b conefoo ctwofoo cthreefoo conebar ctwobar cthreebar conebaz ctwobaz cthreebaz
+
+  print ${^foo}{one,two,three}$^arr
+0:Brace expansion with arrays, with RC_EXPAND_PARAM (3)
+>aonefoo atwofoo athreefoo aonebar atwobar athreebar aonebaz atwobaz athreebaz bonefoo btwofoo bthreefoo bonebar btwobar bthreebar bonebaz btwobaz bthreebaz conefoo ctwofoo cthreefoo conebar ctwobar cthreebar conebaz ctwobaz cthreebaz
+
+  print X{01..4}Y
+0:Numeric range expansion, padding (1)
+>X01Y X02Y X03Y X04Y
+
+  print X{1..04}Y
+0:Numeric range expansion, padding (2)
+>X01Y X02Y X03Y X04Y
+
+  print X{7..12}Y
+0:Numeric range expansion, padding (or not) (3)
+>X7Y X8Y X9Y X10Y X11Y X12Y
+
+  print X{07..12}Y
+0:Numeric range expansion, padding (4)
+>X07Y X08Y X09Y X10Y X11Y X12Y
+
+  print X{7..012}Y
+0:Numeric range expansion, padding (5)
+>X007Y X008Y X009Y X010Y X011Y X012Y
+
+  print X{4..1}Y
+0:Numeric range expansion, decreasing
+>X4Y X3Y X2Y X1Y