d4ed5eb2d350f8e39b75343bb38c4a8ff917a47c — Simon Ser 10 days ago 82d450d
test: add basic readonly test

The second test is disabled for now because of memory leaks on error.
2 files changed, 10 insertions(+), 0 deletions(-)

M test/meson.build
A test/readonly.sh
M test/meson.build => test/meson.build +1 -0
@@ 12,6 12,7 @@ test_files = [
 	'function.sh',
 	'loop.sh',
 	'pipeline.sh',
+	'readonly.sh',
 	'return.sh',
 	'subshell.sh',
 	'syntax.sh',

A test/readonly.sh => test/readonly.sh +9 -0
@@ 0,0 1,9 @@
+#!/bin/sh
+
+echo "Print read-only parameters after setting one"
+readonly mrsh_readonly_param=b
+readonly -p | grep mrsh_readonly_param
+
+#echo "Try setting a read-only parameter"
+#(mrsh_readonly_param=c) 2>/dev/null
+#echo $?