test_ruby_mode.rb: fix for Emacs 25.1
* test/misc/test_ruby_mode.rb (assert_indent): since write-region in Emacs 25.1 no longer displays the "Wrote file" message, shows the explicit message to check if successfully finished. [ruby-core:77355] [Bug #12785] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1181ecbbd1
commit
967c013391
@ -1,4 +1,9 @@
|
|||||||
Sat Sep 24 10:18:33 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Sat Sep 24 10:19:41 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* test/misc/test_ruby_mode.rb (assert_indent): since write-region
|
||||||
|
in Emacs 25.1 no longer displays the "Wrote file" message, shows
|
||||||
|
the explicit message to check if successfully finished.
|
||||||
|
[ruby-core:77355] [Bug #12785]
|
||||||
|
|
||||||
* test/misc/test_ruby_mode.rb (EXPR_SAVE): use a numeric prefix
|
* test/misc/test_ruby_mode.rb (EXPR_SAVE): use a numeric prefix
|
||||||
argument of 0, not to make the previous version into a backup
|
argument of 0, not to make the previous version into a backup
|
||||||
|
@ -19,6 +19,9 @@ end
|
|||||||
class TestRubyMode
|
class TestRubyMode
|
||||||
EVAL_OPT = "--eval"
|
EVAL_OPT = "--eval"
|
||||||
EXPR_SAVE = "(save-buffer 0)"
|
EXPR_SAVE = "(save-buffer 0)"
|
||||||
|
finish_mark = "ok-#{$$}"
|
||||||
|
FINISH_MARK = /^#{finish_mark}$/
|
||||||
|
EXPR_FINISH = "(print \'#{finish_mark})"
|
||||||
EXPR_RUBYMODE = "(ruby-mode)"
|
EXPR_RUBYMODE = "(ruby-mode)"
|
||||||
|
|
||||||
def run_emacs(src, *exprs)
|
def run_emacs(src, *exprs)
|
||||||
@ -28,6 +31,7 @@ class TestRubyMode
|
|||||||
exprs = exprs.map {|expr| [EVAL_OPT, expr]}.flatten
|
exprs = exprs.map {|expr| [EVAL_OPT, expr]}.flatten
|
||||||
exprs.unshift(EVAL_OPT, EXPR_RUBYMODE)
|
exprs.unshift(EVAL_OPT, EXPR_RUBYMODE)
|
||||||
exprs.push(EVAL_OPT, EXPR_SAVE)
|
exprs.push(EVAL_OPT, EXPR_SAVE)
|
||||||
|
exprs.push(EVAL_OPT, EXPR_FINISH)
|
||||||
output = IO.popen([*EMACS, tmp.path, *exprs, err:[:child, :out]], "r") {|e| e.read}
|
output = IO.popen([*EMACS, tmp.path, *exprs, err:[:child, :out]], "r") {|e| e.read}
|
||||||
tmp.open
|
tmp.open
|
||||||
result = tmp.read
|
result = tmp.read
|
||||||
@ -46,7 +50,7 @@ class TestRubyMode
|
|||||||
source.gsub!(space, '')
|
source.gsub!(space, '')
|
||||||
end
|
end
|
||||||
result, output = run_emacs(source, EXPR_INDENT)
|
result, output = run_emacs(source, EXPR_INDENT)
|
||||||
assert_match(/^Wrote /, output)
|
assert_match(FINISH_MARK, output)
|
||||||
assert_equal(expected, result, message(*message) {diff expected, result})
|
assert_equal(expected, result, message(*message) {diff expected, result})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user