зеркало из https://github.com/github/ruby.git
* test/readline/test_readline.rb (test_completion_proc_empty_result):
ensure clearance of Readline's line_buffer after the test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
0e454c1818
Коммит
2afa0b4cca
|
@ -1,3 +1,8 @@
|
|||
Wed Jan 11 22:36:43 2012 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
|
||||
|
||||
* test/readline/test_readline.rb (test_completion_proc_empty_result):
|
||||
ensure clearance of Readline's line_buffer after the test.
|
||||
|
||||
Tue Jan 10 21:57:38 2012 Hiroshi Shirosaki <h.shirosaki@gmail.com>
|
||||
|
||||
* ext/dbm/dbm.c (Init_dbm): fix a build error on mswin32.
|
||||
|
|
|
@ -208,11 +208,19 @@ class TestReadline < Test::Unit::TestCase
|
|||
stdin.write("first\t")
|
||||
stdin.flush
|
||||
Readline.completion_proc = ->(text) {[]}
|
||||
line = nil
|
||||
line1 = line2 = nil
|
||||
replace_stdio(stdin.path, stdout.path) {
|
||||
assert_nothing_raised(NoMemoryError) {line = Readline.readline("> ")}
|
||||
assert_nothing_raised(NoMemoryError) {line1 = Readline.readline("> ")}
|
||||
stdin.write("\n")
|
||||
stdin.flush
|
||||
assert_nothing_raised(NoMemoryError) {line2 = Readline.readline("> ")}
|
||||
}
|
||||
assert_equal("first", line)
|
||||
assert_equal("first", line1)
|
||||
assert_equal("", line2)
|
||||
begin
|
||||
assert_equal("", Readline.line_buffer)
|
||||
rescue NotimplementedError
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче