diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2025-04-10 02:00:58 +0300 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2025-04-10 03:16:18 +0300 |
commit | c462509adfd68e8b849b8a6713360fb4f9026578 (patch) | |
tree | 98dc8d67d573cef516d405c1f35e1e93dbc771a5 /tests | |
parent | 72aa210cc103af971c7a77660f014b11475af3aa (diff) | |
download | sciteco-c462509adfd68e8b849b8a6713360fb4f9026578.tar.gz |
fixed formatting of the smallest possible integer
* In other words, fixed `-9223372036854775808\` on --with-teco-integer=64
(which is the default).
* The reason is that ABS(G_MININT64) == G_MININT64 since -G_MININT64 == G_MININT64.
It is therefore important not to call ABS() on arbitrary teco_int_t's.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/atlocal.in | 7 | ||||
-rw-r--r-- | tests/testsuite.at | 9 |
2 files changed, 16 insertions, 0 deletions
diff --git a/tests/atlocal.in b/tests/atlocal.in index 8465f96..1992c54 100644 --- a/tests/atlocal.in +++ b/tests/atlocal.in @@ -26,6 +26,13 @@ ESCAPE=`printf '\33'` # is used. SCITECOPATH="@abs_top_srcdir@/lib" +TECO_INTEGER=@TECO_INTEGER@ + +MAXINT32=2147483647 +MININT32=-2147483648 +MAXINT64=9223372036854775807 +MININT64=-9223372036854775808 + GREP="@GREP@" # Glib debug options diff --git a/tests/testsuite.at b/tests/testsuite.at index 20a76c5..d8d88e1 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -117,6 +117,15 @@ AT_CHECK([$SCITECO -e "[[\$ @FG'..' ]]\$ :Q\$-1Q\$-^^r\"=(0/0)'"], 0, ignore, ig AT_CHECK([$SCITECO -e "[[: @I/XXX/ ]]: .\"N(0/0)'"], 0, ignore, ignore) AT_CLEANUP +AT_SETUP([Formatting numbers]) +# MAXINT32/MININT32: should always work. +AT_CHECK([$SCITECO -e "$MAXINT32\\ J::@S/$MAXINT32/\"F(0/0)'"], 0, ignore, ignore) +AT_CHECK([$SCITECO -e "$MININT32\\ J::@S/$MININT32/\"F(0/0)'"], 0, ignore, ignore) +AT_SKIP_IF([test $TECO_INTEGER -lt 64]) +AT_CHECK([$SCITECO -e "$MAXINT64\\ J::@S/$MAXINT64/\"F(0/0)'"], 0, ignore, ignore) +AT_CHECK([$SCITECO -e "$MININT64\\ J::@S/$MININT64/\"F(0/0)'"], 0, ignore, ignore) +AT_CLEANUP + AT_SETUP([Convert between line and glyph positions]) AT_CHECK([$SCITECO -e "@I/1^J2^J3/J 2^QC :^Q-3\"N(0/0)'"], 0, ignore, ignore) AT_CLEANUP |