SYNTAX CHANGE: remove x=([2]=foo [5]=bar) due to regressions
This commit is contained in:
parent
30bbb90f75
commit
2f620132af
35
check.t
35
check.t
@ -1,4 +1,4 @@
|
|||||||
# $MirOS: src/bin/mksh/check.t,v 1.648 2014/06/09 10:41:01 tg Exp $
|
# $MirOS: src/bin/mksh/check.t,v 1.649 2014/06/09 11:13:17 tg Exp $
|
||||||
# OpenBSD src/regress/bin/ksh updated: 2013/12/02 20:39:44
|
# OpenBSD src/regress/bin/ksh updated: 2013/12/02 20:39:44
|
||||||
#-
|
#-
|
||||||
# Copyright © 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
|
# Copyright © 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
|
||||||
@ -7067,24 +7067,19 @@ stdin:
|
|||||||
v="c d"
|
v="c d"
|
||||||
set -A foo -- [1]=\$v [2]="$v" [4]='$v' [0]=a [5]=b
|
set -A foo -- [1]=\$v [2]="$v" [4]='$v' [0]=a [5]=b
|
||||||
echo "${#foo[*]}|${foo[0]}|${foo[1]}|${foo[2]}|${foo[3]}|${foo[4]}|${foo[5]}|"
|
echo "${#foo[*]}|${foo[0]}|${foo[1]}|${foo[2]}|${foo[3]}|${foo[4]}|${foo[5]}|"
|
||||||
expected-stdout:
|
# we don't want this at all:
|
||||||
5|a|$v|c d||$v|b|
|
# 5|a|$v|c d||$v|b|
|
||||||
---
|
|
||||||
name: arrays-4-nopos
|
|
||||||
description:
|
|
||||||
Check that we do not break assignment
|
|
||||||
This is a regression against R20
|
|
||||||
Possibly take out specified indicēs until resolved!
|
|
||||||
expected-fail: yes
|
|
||||||
stdin:
|
|
||||||
set -A arr "[5]=meh"
|
set -A arr "[5]=meh"
|
||||||
echo "<${arr[0]}><${arr[5]}>"
|
echo "<${arr[0]}><${arr[5]}>"
|
||||||
expected-stdout:
|
expected-stdout:
|
||||||
|
5|[1]=$v|[2]=c d|[4]=$v|[0]=a|[5]=b||
|
||||||
<[5]=meh><>
|
<[5]=meh><>
|
||||||
---
|
---
|
||||||
name: arrays-5
|
name: arrays-5
|
||||||
description:
|
description:
|
||||||
Check if bash-style arrays with specified indices work as expected
|
Check if bash-style arrays with specified indices work as expected
|
||||||
|
(taken out temporarily to fix arrays-4; see also arrays-9a comment)
|
||||||
|
category: disabled
|
||||||
stdin:
|
stdin:
|
||||||
v="c d"
|
v="c d"
|
||||||
foo=([1]=\$v [2]="$v" [4]='$v' [0]=a [5]=b)
|
foo=([1]=\$v [2]="$v" [4]='$v' [0]=a [5]=b)
|
||||||
@ -7092,22 +7087,16 @@ stdin:
|
|||||||
x=([128]=foo bar baz)
|
x=([128]=foo bar baz)
|
||||||
echo k= ${!x[*]} .
|
echo k= ${!x[*]} .
|
||||||
echo v= ${x[*]} .
|
echo v= ${x[*]} .
|
||||||
expected-stdout:
|
# Check that we do not break this by globbing
|
||||||
5|a|$v|c d||$v|b|
|
|
||||||
k= 128 129 130 .
|
|
||||||
v= foo bar baz .
|
|
||||||
---
|
|
||||||
name: arrays-5-glob
|
|
||||||
description:
|
|
||||||
Check that we do not break this by globbing
|
|
||||||
expected-fail: yes
|
|
||||||
stdin:
|
|
||||||
:>b=blah
|
:>b=blah
|
||||||
bleh=5
|
bleh=5
|
||||||
typeset -a arr
|
typeset -a arr
|
||||||
arr+=([bleh]=blah)
|
arr+=([bleh]=blah)
|
||||||
echo "<${arr[0]}><${arr[5]}>"
|
echo "<${arr[0]}><${arr[5]}>"
|
||||||
expected-stdout:
|
expected-stdout:
|
||||||
|
5|a|$v|c d||$v|b|
|
||||||
|
k= 128 129 130 .
|
||||||
|
v= foo bar baz .
|
||||||
<><blah>
|
<><blah>
|
||||||
---
|
---
|
||||||
name: arrays-6
|
name: arrays-6
|
||||||
@ -7269,11 +7258,11 @@ description:
|
|||||||
stdin:
|
stdin:
|
||||||
unset foo; foo=(bar); foo+=(baz); echo 1 ${!foo[*]} : ${foo[*]} .
|
unset foo; foo=(bar); foo+=(baz); echo 1 ${!foo[*]} : ${foo[*]} .
|
||||||
unset foo; foo=(foo bar); foo+=(baz); echo 2 ${!foo[*]} : ${foo[*]} .
|
unset foo; foo=(foo bar); foo+=(baz); echo 2 ${!foo[*]} : ${foo[*]} .
|
||||||
unset foo; foo=([2]=foo [0]=bar); foo+=(baz [5]=quux); echo 3 ${!foo[*]} : ${foo[*]} .
|
# unset foo; foo=([2]=foo [0]=bar); foo+=(baz [5]=quux); echo 3 ${!foo[*]} : ${foo[*]} .
|
||||||
expected-stdout:
|
expected-stdout:
|
||||||
1 0 1 : bar baz .
|
1 0 1 : bar baz .
|
||||||
2 0 1 2 : foo bar baz .
|
2 0 1 2 : foo bar baz .
|
||||||
3 0 2 3 5 : bar foo baz quux .
|
# 3 0 2 3 5 : bar foo baz quux .
|
||||||
---
|
---
|
||||||
name: arrays-9b
|
name: arrays-9b
|
||||||
description:
|
description:
|
||||||
|
4
var.c
4
var.c
@ -28,7 +28,7 @@
|
|||||||
#include <sys/sysctl.h>
|
#include <sys/sysctl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/var.c,v 1.178 2014/05/27 13:22:46 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/var.c,v 1.179 2014/06/09 11:13:19 tg Exp $");
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Variables
|
* Variables
|
||||||
@ -1494,6 +1494,7 @@ set_array(const char *var, bool reset, const char **vals)
|
|||||||
afree(cp, ATEMP);
|
afree(cp, ATEMP);
|
||||||
}
|
}
|
||||||
while ((ccp = vals[i])) {
|
while ((ccp = vals[i])) {
|
||||||
|
#if 0 /* temporarily taken out due to regression */
|
||||||
if (*ccp == '[') {
|
if (*ccp == '[') {
|
||||||
int level = 0;
|
int level = 0;
|
||||||
|
|
||||||
@ -1514,6 +1515,7 @@ set_array(const char *var, bool reset, const char **vals)
|
|||||||
} else
|
} else
|
||||||
ccp = vals[i];
|
ccp = vals[i];
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
vq = arraysearch(vp, j);
|
vq = arraysearch(vp, j);
|
||||||
/* would be nice to deal with errors here... (see above) */
|
/* would be nice to deal with errors here... (see above) */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user