Open luislavena opened 13 years ago
The problem isn't as simple as adding HISTORY.clear which is easily done by calling Rbreadline.clear_history
or raising NotImplementedError
. On 1.9 there are encoding issues and the test wants HISTORY a module, rather than a class.
Thank you @rocky !
I put this after giving a whirl to latest ruby-head and RubyInstaller with rb-readline. I knew it will have bigger implications that the current codebase do not provide or support.
Since is a new feature, perhaps we should discuss about it?
On Mon, May 9, 2011 at 4:47 PM, luislavena < reply@reply.github.com>wrote:
Thank you @rocky !
I put this after giving a whirl to latest ruby-head and RubyInstaller with rb-readline. I knew it will have bigger implications that the current codebase do not provide or support.
Since is a new feature, perhaps we should discuss about it?
Discussing is good. Suggest something.
Reply to this email directly or view it on GitHub: https://github.com/luislavena/rb-readline/issues/41#comment_1126178
Cool - I didn't realise those tests were even there!
It would be nice to include them in the rb-readline repository (perhaps once we make them pass). Of course, this would introduces a slight headache to keep them up-to-date, but I think the benefits would outweigh that. What do you think?
Well, test_readline.rb and test_readline_history.rb will not work directly with rb-readline because is expecting that readline works with redirected STDIN, something that rb-readline do not support, at least on Windows.
But, is worth the shot.
@rocky, as for the suggestion, I had discussed in the past having readline tests for rb-readline, but due the above issue was not possible.
Need to think a bit more on this but I'm leaving the door open for you guys to propose ideas :-)
Well, test_readline.rb and test_readline_history.rb will not work directly with rb-readline because is expecting that readline works with redirected STDIN, something that rb-readline do not support, at least on Windows.
Although something may not work everywhere, that is no reason not to use if it is useful somewhere. And as we have seen, the tests do not work even on platforms where STDIN is not a problem. So a suggestion is to use the tests when they can be run to help make better compatibility. Later, hopefully we will figure out either how to improve the code or the tests (or both) so they work on more platforms.
In my own projects I often have to take this approach: the solution I come up with is far from perfect or general. But it it is better than what was there or no solution. Later releases invariably hide the glaring flakiness or flaws in reasoning and glaring omissions. That is one reason I dislike looking at early releases of my code: they reflect how little I understood the problem and how poorly I coded the solution.
But in this way progress is made. Too often I have seen projects get stalled with no progress because one can not come up with a universal solution initially.
@luislavena you can force windows rbreadline to read from stdin...see my other comments...
Right now testing against Ruby-trunk fails:
Either implement it or raise
NotImplementedError
.