From 0ea082b74414696a7800455a437656fca2886f6d Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Sat, 26 Jul 2025 16:30:17 +0300 Subject: properly document some functions in expressions.c and simplified code * Practically all calls to teco_expressions_args() must be preceded by teco_expressions_eval(). * In code paths where we know that teco_expressions_args() > 0, it is safe to call teco_expressions_pop_num(0) instead of teco_expressions_pop_num_calc(). This is both easier and faster. * teco_expressions_pop_num_calc() is for simple applications where you just want to get a command argument with default (implied) values. Since it includes teco_expressions_eval(), we can avoid superfluous calls. * -EC...$ turned out to be broken and is fixed now. A test case has been added. --- tests/testsuite.at | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests') diff --git a/tests/testsuite.at b/tests/testsuite.at index ae90b72..f24b58b 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -342,6 +342,8 @@ AT_SETUP([Execute external command]) # So we have to wait until SciTECO supports a random number generator. TE_CHECK([[@EC'dd if=/dev/zero bs=512 count=1' Z= Z-512"N(0/0)']], 0, ignore, ignore) TE_CHECK([[0,128ED @EC'dd if=/dev/zero bs=512 count=1' Z= Z-512"N(0/0)']], 0, ignore, ignore) +TE_CHECK([[@I/hello/ H@EC'tr a-z A-Z' J<0A"V(0/0)' :C;>]], 0, ignore, ignore) +TE_CHECK([[@I/hello^J/ -@EC'tr a-z A-Z' J<0A"V(0/0)' :C;>]], 0, ignore, ignore) AT_CLEANUP AT_SETUP([Timestamps]) -- cgit v1.2.3