From 24ccb54876753526adba34b374f0d6360ee0070b Mon Sep 17 00:00:00 2001 From: Oldes Huhuman Date: Wed, 24 Apr 2024 19:28:31 +0200 Subject: [PATCH] TEST: https://github.com/Oldes/Rebol-issues/issues/1747 --- src/tests/units/protect-test.r3 | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/tests/units/protect-test.r3 b/src/tests/units/protect-test.r3 index fea8da1f59..becb66b9fd 100644 --- a/src/tests/units/protect-test.r3 +++ b/src/tests/units/protect-test.r3 @@ -145,6 +145,28 @@ Rebol [ ;@@ https://github.com/Oldes/Rebol-issues/issues/1764 --assert is-locked-error? [new-block: reduce [1 2 protect/deep 'new-block 3 4]] + --test-- "protect paths" + ;@@ https://github.com/Oldes/Rebol-issues/issues/1747 + o: context [a: "aha"] p: 'o/a + ;; by default it protects the value it points to + --assert all [ + 'o/a = protect p + is-locked-error? [o/a: none] + ] + ;; to protect the path value... + o: context [a: "aha"] p: 'o/a + --assert all [ + 'o/a = protect/values p + none? try [o/a: none] + is-protected-error? [append p 'x] + ] + p: quote :o/a + --assert all [ + (quote :o/a) = protect/values p + none? try [o/a: none] + is-protected-error? [append p 'x] + ] + ===end-group===