aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorRobin Haberkorn <rhaberkorn@fmsbw.de>2026-11-22 16:53:08 +0100
committerRobin Haberkorn <rhaberkorn@fmsbw.de>2026-11-22 19:51:04 +0100
commit910d8a61772570198eb12f752c5b7f8fcd006dc2 (patch)
tree13fcd9805c3a82e8b39691a1e6b5d2e81662f784 /tests
parentb283996b6ecffc3a1d05c52df02c89ec86cafa96 (diff)
implemented the FQq (free Q-register) command and extended EF
Since Q-registers can be dynamically allocated, we must have a command for freeing them as well. This is especially important when using long Q-register names to implement arrays and other complex data structures. To ease freeing entire arrays, the :FQ[array.] modification can be used -- this will free all registers with the given prefix efficiently. There is currently no variant that tells you whether the register actually existed -- you can first check with :Qq if that is important. EF has also been extended to free the currently edited register - which is also what Video TECO appeared to do. If the currently edited register is freed, we edit the current buffer again.
Diffstat (limited to 'tests')
-rw-r--r--tests/testsuite.at12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/testsuite.at b/tests/testsuite.at
index b0a3c55..ff6f509 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -227,6 +227,18 @@ TE_CHECK([[ [: @I/XXX/ ]: ."N(0/0)']], 0, ignore, ignore)
TE_CHECK([[ [a :]a"F(0/0)' ![! :]a"S(0/0)']], 0, ignore, ignore)
AT_CLEANUP
+AT_SETUP([Freeing Q-Registers])
+TE_CHECK([[FQa :Qa"U(0/0)']], 0, ignore, ignore)
+TE_CHECK([[10<QaU[array.^E\a] %a> :FQ[array.] :Q[array.8]"U(0/0)']], 0, ignore, ignore)
+# Some register is always internal and forbidden to free.
+TE_CHECK([[:FQ[] ]], 1, ignore, ignore)
+TE_CHECK([[@I/ABC/ @EQa// FQa Z-3"N(0/0)']], 0, ignore, ignore)
+TE_CHECK([[@I/ABC/ @EQa// EF Z-3"N(0/0)']], 0, ignore, ignore)
+# Undoing local Q-reg operations is a common source of bugs.
+TE_CHECK_CMDLINE([[@^Um{FQ.a} Mm{-2D}]], 0, ignore, stderr)
+AT_FAIL_IF([$GREP "^Error:" stderr])
+AT_CLEANUP
+
m4_define([TE_MAXINT32], [2147483647])
m4_define([TE_MININT32], [-2147483648])
m4_define([TE_MAXINT64], [9223372036854775807])