mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/readline/test_readline.rb (test_line_buffer__point): use
lambda not to exit entire method by "return". or "next" for proc. [ruby-dev:45042] [Bug #5802] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34115 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
db9657a8bf
commit
8397134330
2 changed files with 28 additions and 2 deletions
|
@ -1,3 +1,9 @@
|
|||
Sat Dec 24 06:59:49 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* test/readline/test_readline.rb (test_line_buffer__point): use
|
||||
lambda not to exit entire method by "return". or "next" for
|
||||
proc. [ruby-dev:45042] [Bug #5802]
|
||||
|
||||
Sat Dec 24 01:20:39 2011 Kazuki Tsujimoto <kazuki@callcc.net>
|
||||
|
||||
* vm_eval.c (send_internal): PASS_PASSED_BLOCK_TH must be placed
|
||||
|
|
|
@ -136,20 +136,40 @@ class TestReadline < Test::Unit::TestCase
|
|||
actual_text = nil
|
||||
actual_line_buffer = nil
|
||||
actual_point = nil
|
||||
Readline.completion_proc = proc { |text|
|
||||
Readline.completion_proc = ->(text) {
|
||||
actual_text = text
|
||||
actual_point = Readline.point
|
||||
actual_buffer_line = Readline.line_buffer
|
||||
actual_line_buffer = Readline.line_buffer
|
||||
stdin.write(" finish\n")
|
||||
stdin.close
|
||||
stdout.close
|
||||
return ["complete"]
|
||||
}
|
||||
|
||||
stdin.write("first second\t")
|
||||
stdin.flush
|
||||
Readline.completion_append_character = " "
|
||||
line = replace_stdio(stdin.path, stdout.path) {
|
||||
Readline.readline("> ", false)
|
||||
}
|
||||
assert_equal("second", actual_text)
|
||||
assert_equal("first second", actual_line_buffer)
|
||||
assert_equal(12, actual_point)
|
||||
assert_equal("first complete finish", Readline.line_buffer)
|
||||
assert_equal(Encoding.find("locale"), Readline.line_buffer.encoding)
|
||||
assert_equal(true, Readline.line_buffer.tainted?)
|
||||
assert_equal(22, Readline.point)
|
||||
|
||||
stdin.open
|
||||
stdout.open
|
||||
|
||||
stdin.write("first second\t")
|
||||
stdin.flush
|
||||
Readline.completion_append_character = nil
|
||||
line = replace_stdio(stdin.path, stdout.path) {
|
||||
Readline.readline("> ", false)
|
||||
}
|
||||
assert_equal("second", actual_text)
|
||||
assert_equal("first second", actual_line_buffer)
|
||||
assert_equal(12, actual_point)
|
||||
assert_equal("first complete finish", Readline.line_buffer)
|
||||
|
|
Loading…
Add table
Reference in a new issue