Issue #15853 has been updated by aycabta (aycabta .).


The condition was for GNU Readline 4.3's bug but the deletion is my mistake. I agreed with your first proposal. But the first patch is not correct. The `defined?(Reline)` doesn't mean that Reline is as Readline so I added a condition that checks `Readline` constant is the same as `Reline`. It's `!defined?(Reline) or Readline != Reline`. So please fix your patch.

The details of the GNU Readline 4.3's bug are as follows.

@naruse mentioned it at a comment in #5785
https://bugs.ruby-lang.org/issues/5785#note-8
and added a commit 2418f9cc5559ff9d9d62f2139ee7d7a971e7be20
https://bugs.ruby-lang.org/projects/ruby-trunk/repository/git/revisions/2418f9cc5559ff9d9d62f2139ee7d7a971e7be20
and showed log.
http://www.rubyist.net/%7Eakr/chkbuild/debian/ruby-trunk/log/20120501T132800Z.diff.html.gz

> ```
> + <n>) Failure:
> +test_modify_text_in_pre_input_hook(TestReadline) [/extdisk/chkbuild/chkbuild/tmp/build/<buildtime>/ruby/test/readline/test_readline.rb:386]:
> +<"> hello world\n"> expected but was
> +<"> ">.
> ```

It's a strange behavior and I think it's a GNU Readline's bug. For your information, rlwrap refer to that:
https://github.com/hanslub42/rlwrap/blob/2aea6fc26c5448c16d482f7ec6b1e16adfee0d17/BUGS#L29-L37

> Christoffer Dam Bruun reported:
> 
>   "I have just installed rlwrap along with readline on Solaris 8 and
>   found that rlwrap did not work properly with readline 4.3. After
>   linking rlwrap with readline 4.2 it works correctly.
> 
>   What happended using readline 4.3 was that an extra prompt would be 
>   written after the first letter on a line, e.g. with a sqlplus prompt:
>   SQL>
>   (now writing select )
> SQL> sSQL> select"

GNU Readline 4.3 has many output bugs.
http://git.savannah.gnu.org/cgit/readline.git/tree/CHANGES?id=bcd7f75a2bc2f7c67c9cd6899ff546afa45cbba4

----------------------------------------
Bug #15853: Fix readline test regression when using Readline 4.3
https://bugs.ruby-lang.org/issues/15853#change-78052

* Author: jeremyevans0 (Jeremy Evans)
* Status: Open
* Priority: Normal
* Assignee: aycabta (aycabta .)
* Target version: 
* ruby -v: 
* Backport: 2.4: DONTNEED, 2.5: DONTNEED, 2.6: DONTNEED
----------------------------------------
commit:c754e979d3eeca51f1b13778f19f347df3da656e removed the check for Readline 4.3 in a test.  Previously, the whole test was skipped on Readline 4.3.  However, it turns out that Readline 4.3 runs the test correctly if you skip the same assertion that is skipped when Reline is used.  The attached patch skips that assertion when `Readline::VERSION` is 4.3.

We may want to consider dropping this assertion completely, it seems to be readline implementation and version dependent behavior.

---Files--------------------------------
fix-readline-4.3-test-regression.patch (1.3 KB)
fix-readline-4.3-test-regression-v2.patch (1.28 KB)


-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>