diff --git a/test/readline/test_readline.rb b/test/readline/test_readline.rb index 0e64b1f027..f659ba24c5 100644 --- a/test/readline/test_readline.rb +++ b/test/readline/test_readline.rb @@ -4,6 +4,7 @@ rescue LoadError else require "test/unit" require "tempfile" + require "timeout" end class TestReadline < Test::Unit::TestCase @@ -398,7 +399,9 @@ class TestReadline < Test::Unit::TestCase w << "\cr\u3042\u3093" w.reopen(IO::NULL) assert_equal("\u3046\u3093", Readline.readline("", true), bug6602) - assert_equal("\u3042\u3093", Readline.readline("", true), bug6602) + Timeout.(2) do + assert_equal("\u3042\u3093", Readline.readline("", true), bug6602) + end assert_equal(nil, Readline.readline("", true), bug6602) end end