about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMikael Magnusson <mikachu@gmail.com>2020-05-12 15:57:38 +0200
committerMikael Magnusson <mikachu@gmail.com>2020-05-12 15:58:41 +0200
commit06c0a39895f7bec31ad947bbce90b35c4a5ba0f5 (patch)
tree068f7036e7df525c043f539a7352a3ae28cd6985
parent817d461932eabff7c1bc950411715ef8ea10c593 (diff)
downloadzsh-06c0a39895f7bec31ad947bbce90b35c4a5ba0f5.tar.gz
zsh-06c0a39895f7bec31ad947bbce90b35c4a5ba0f5.tar.xz
zsh-06c0a39895f7bec31ad947bbce90b35c4a5ba0f5.zip
unposted: Add tests for previous commit
-rw-r--r--ChangeLog4
-rw-r--r--Test/D04parameter.ztst8
2 files changed, 9 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 88c46245e..923913cc9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,7 @@
 2020-05-12  Mikael Magnusson  <mikachu@gmail.com>
 
-	* 45796: Src/subst.c: Support ${name:offset:length} with an
-	empty offset
+	* 45796: Src/subst.c, Test/D04parameter.ztst: Support
+	${name:offset:length} with an empty offset
 
 2020-05-09: Eitan Adler <lists@eitanadler.com>
 
diff --git a/Test/D04parameter.ztst b/Test/D04parameter.ztst
index 76f3e77a1..024de4d2b 100644
--- a/Test/D04parameter.ztst
+++ b/Test/D04parameter.ztst
@@ -1615,6 +1615,8 @@
    print ${foo: -1}
    print ${foo: -10}
    print ${foo:5:-2}
+   print ${foo::3}
+   print ${foo: }
 0:Bash-style offsets, scalar
 >456789
 >56789
@@ -1627,6 +1629,8 @@
 >9
 >123456789
 >67
+>123
+>123456789
 
    foo=(1 2 3 4 5 6 7 8 9)
    print ${foo:3}
@@ -1687,9 +1691,11 @@
 ?(eval):1: not an identifier: [0]
 
    str=rts
+   print ${str:0: }
    print ${str:0:}
 1:Regression test for missing length after offset
-?(eval):2: unrecognized modifier
+>
+?(eval):3: unrecognized modifier
 
    foo="123456789"
    print ${foo:5:-6}