tcsh-org / tcsh

This is a read-only mirror of the tcsh code repository.
https://www.tcsh.org/
Other
232 stars 42 forks source link

Character range test case suggestion #44

Closed oddhack closed 2 years ago

oddhack commented 2 years ago

I ran into a bug on Debian bullseye with tcsh 6.21.00 not properly expanding character classes, e.g.

mkdir a ; touch a/a a/B
echo a/[a-z]
a/a a/B

(should just echo 'a/a'). This is not locale-related (occurs in locale "C" as well as "en_US.UTF-8").

While the problem is fixed in TCSH6_23_00, and I've recommended this to Debian as a fix, it would be useful to add this to the test suite if you have time.

Note: I can't verify if this is a problem specifically in the Debian build or in general with 6.21.00, because trying to build from this repository at tag TCSH6_21_00 generates a link error:

/usr/bin/ld: tc.sig.o:/home/jon/tools/tcsh/tc.sig.c:59: multiple definition of `handle_interrupt'; sh.o:/home/jon/tools/tcsh/sh.h:569: first defined here
collect2: error: ld returned 1 exit status
make: *** [Makefile:434: tcsh] Error 1

Building from the Debian source package does succeed. But whatever the configuration issue was, apparently it has been fixed in TCSH6_23_00 which builds successfully for me on bullseye.

suominen commented 2 years ago

Adding a test is a good idea. Would you like to create one for us?

Debian is often reluctant to go with version upgrades, but they might agree to these:

All apply cleanly on top of tcsh-6.21.00.tar.gz.

Submitted to Debian bug 999754 as well.

oddhack commented 2 years ago

Thanks for submitting to the Debian bug! Regarding a test, the actual test cases are straightforward, but I'm unfamiliar with the test framework being used. Is there documentation on how to write a new test, or at least on the AT_ macros used in the tests/.at files?

suominen commented 2 years ago

The tests use the Autotest macros from Autoconf. The version of Autoconf that ships with Debian 11 is 2.69, so that's probably a good version to look at, so that the tests could run successfully on Travis CI.

Documentation: https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Using-Autotest.html

suominen commented 2 years ago

I noticed that we already had a test for Filename substitution (yeah, I haven't looked at all the tests that closely), so I added coverage for this issue to it in 1031f2a3fb430e5fc651be84bdad375ddadf0f26.

oddhack commented 2 years ago

Thank you!