From 442268285a5f8b1d53052b6c7b0566d9200e71c7 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Sun, 1 Jun 2025 02:38:25 +0300 Subject: and now return -1 in case the index n is out of range * The old behavior of throwing an error was inherited from Video TECO. * The command is now more similar to TECO-11. * Since -1 is taken, invalid and incomplete UTF-8 byte sequences are now reported as -2/-3. I wasn't really able to provoke -3, though. --- tests/testsuite.at | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests') diff --git a/tests/testsuite.at b/tests/testsuite.at index dddb1f0..fd93aa4 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -242,6 +242,11 @@ TE_CHECK([[@I/TEST/ @EW/юникод.txt/]], 0, ignore, ignore) AT_CHECK([[test -f юникод.txt]], 0, ignore, ignore) TE_CHECK([[^^ß-223"N(0/0)' 23Uъ Q[Ъ]-23"N(0/0)']], 0, ignore, ignore) TE_CHECK([[@O/метка/ !метка!]], 0, ignore, ignore) + +# Test the "error" return codes of : +TE_CHECK([[0EE 255@I/A/J 65001EE 0A-(-2)"N(0/0)' 1A-^^A"N(0/0)' 2A-(-1)"N(0/0)']], 0, ignore, ignore) +# FIXME: Byte 128 should probably return -3 (incomplete sequence). +TE_CHECK([[@EQa// 0EE 128@I/A/J 65001EE 0Qa-(-2)"N(0/0)' 1Qa-^^A"N(0/0)' 2Qa-(-1)"N(0/0)']], 0, ignore, ignore) AT_CLEANUP AT_SETUP([Automatic EOL normalization]) -- cgit v1.2.3