From: zhuk Date: Fri, 5 Mar 2021 15:24:37 +0000 (+0000) Subject: Test case for read-only array being not that read-only in ksh. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=5c6f3d6f2747c1eaba1d6fc7e2b9295ba11bdebc;p=openbsd Test case for read-only array being not that read-only in ksh. okay tb@ --- diff --git a/regress/bin/ksh/obsd-regress.t b/regress/bin/ksh/obsd-regress.t index b9b33d17655..a2121e82a08 100644 --- a/regress/bin/ksh/obsd-regress.t +++ b/regress/bin/ksh/obsd-regress.t @@ -1,4 +1,4 @@ -# $OpenBSD: obsd-regress.t,v 1.12 2020/07/07 10:33:58 jca Exp $ +# $OpenBSD: obsd-regress.t,v 1.13 2021/03/05 15:24:37 zhuk Exp $ # # ksh regression tests from OpenBSD @@ -602,3 +602,16 @@ stdin: wait $p expected-exit: e == 1 --- + +name: overwrite-ro-array +description: + do not allow to override first element of a read-only array + via the non-array access. +stdin: + arr[0]=foo + readonly arr + arr=bar +expected-exit: e == 1 +expected-stderr-pattern: + /: arr: is read only$/ +---