Bugs item #10620, was opened at 2007-05-05 12:43
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=1698&aid=10620&group_id=426

>Category: Triage (do not select)
Group: 1.8.6
Status: Open
Resolution: None
Priority: 3
Submitted By: Hans de Graaff (graaff)
Assigned to: Nobody (None)
Summary: TestReadline fails depending on the terminal in which the test is run.

Initial Comment:
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.


----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=1698&aid=10620&group_id=426