diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2025-07-21 00:19:52 +0300 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2025-07-21 00:33:13 +0300 |
commit | 48dcfd22f9c2db5cf6745eaec0ff28895858c638 (patch) | |
tree | 0eb2c9658df557b8418d4bbdc8b9aa25fb15cd6d /tests | |
parent | 9903c408f2ffc7a42f4fcead54eadc567c0f3669 (diff) | |
download | sciteco-48dcfd22f9c2db5cf6745eaec0ff28895858c638.tar.gz |
support <==> and <===> for printing octal and hexadecimal numbers
* These are famously in DEC TECO-11, but also in Video TECO.
* The implementation is tricky. They need to use lookahead states,
but this would be inacceptable during interactive execution.
Therefore only if executing from the end of the command line
`==` and `===` are allowed to print multiple values.
The number is therefore also not popped form the stack immediately
but only peeked. It's popped only when it has been decided that
the command has ended.
* This may break existing macros that use multiple `=` in a row
to print multiple values from the stack.
You will now e.g. have to insert whitespace to separate such `=` commands.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/testsuite.at | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/testsuite.at b/tests/testsuite.at index a199f62..f7a8423 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -52,7 +52,7 @@ TE_CHECK([[2%a,%a - 3"N(0/0)' $]], 0, ignore, ignore) # c) The empty "list" element is equivalent to 0, so # "1,,2" is equivalent to "1,0,2" and (1,) to (1,0). TE_CHECK([[(1,) "~|(0/0)']], 0, ignore, ignore) -TE_CHECK([[1,(2)==]], 0, ignore, ignore) +TE_CHECK([[1,(2)= =]], 0, ignore, ignore) AT_CLEANUP AT_SETUP([Exit status]) @@ -174,6 +174,15 @@ TE_CHECK([[(]]TE_MAXINT64[[)-(]]TE_MAXINT64[[)"N(0/0)']], 0, ignore, ignore) TE_CHECK([[(]]TE_MININT64[[)-(]]TE_MININT64[[)"N(0/0)']], 0, ignore, ignore) AT_CLEANUP +AT_SETUP([Printing numbers]) +# Must print only one hexadecimal number. +TE_CHECK([[255===]], 0, stdout, ignore) +AT_FAIL_IF([test `$GREP -v "^Info:" stdout | wc -l` -ne 1], 0, ignore, ignore) +# Will print a decimal, octal and 2 hexadecimal numbers. +TE_CHECK_CMDLINE([[2<255===>]], 0, stdout, ignore) +AT_FAIL_IF([test `$GREP -v "^Info:" stdout | wc -l` -ne 4], 0, ignore, ignore) +AT_CLEANUP + AT_SETUP([Convert between line and glyph positions]) TE_CHECK([[@I/1^J2^J3/J 2^QC :^Q-3"N(0/0)']], 0, ignore, ignore) AT_CLEANUP |