Bugs: Browse | Submit New | Admin

[#10620] TestReadline fails depending on the terminal in which the test is run.

Date:
2007-05-05 19:43
Priority:
3
Submitted By:
Hans de Graaff (graaff)
Assigned To:
Akinori MUSHA (knu)
Category:
Files / Dirs / IO
State:
Open
Platform:
 
Summary:
TestReadline fails depending on the terminal in which the test is run.

Detailed description
This issue has been described in more detail as Gentoo bug https://bugs.gentoo.org/show_bug.cgi?id=143341 (but note
that there are also other testing bugs mentioned there)

The symptom is this:

  1) Failure:
test_readline(TestReadline) [./readline/test_readline.rb:25]:
<"> "> expected but was
<"\e[">.

After some additional investigation I found that some terminals (I tested with gnome-terminal, with TERM=xterm) insert
an escape code in the stdout file that is used by the test, so instead of the expected "> " prompt the
escape code is found. Here is the hex dump of the stdout file:

00000000  1b 5b 3f 31 30 33 34 68  3e 20 68 65 6c 6c 6f 0a  |.[?1034h> hello.|
00000010

I could run the process without any problem by using a more conservative terminal, e.g. this passes the tests:

  TERM=vt100 ruby -C . runner.rb -t TestReadline -v

Perhaps the test should be adjusted to always enforce a conservative terminal, e.g. by setting ENV['TERM'] at the beginning
of the test_readline method. This fixes the problem for me.

Add A Comment: Notepad

Please login


Followup

No Followups Have Been Posted

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

Field Old Value Date By
assigned_tonone2007-06-12 01:22zenspider
category_idMisc / Other Standard Library2007-05-29 21:41zenspider
category_idLanguage / Runtime / Core Libraries2007-05-29 15:55zenspider