1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

test_ruby_mode.rb: save-buffer 0

* test/misc/test_ruby_mode.rb (EXPR_SAVE): use a numeric prefix
  argument of 0, not to make the previous version into a backup
  file, instead of backup-inhibited.
* test/misc/test_ruby_mode.rb (run_emacs): always save the buffer
  if modified.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56222 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2016-09-24 01:18:34 +00:00
parent 5a121a4f0b
commit 569d006295
2 changed files with 12 additions and 7 deletions

View file

@ -1,3 +1,12 @@
Sat Sep 24 10:18:33 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
* test/misc/test_ruby_mode.rb (EXPR_SAVE): use a numeric prefix
argument of 0, not to make the previous version into a backup
file, instead of backup-inhibited.
* test/misc/test_ruby_mode.rb (run_emacs): always save the buffer
if modified.
Fri Sep 23 23:57:40 2016 Shugo Maeda <shugo@ruby-lang.org>
* vm_method.c (make_method_entry_refined): fix wrong use of ||.

View file

@ -18,12 +18,8 @@ end
class TestRubyMode
EVAL_OPT = "--eval"
EXPR_SAVE = "(save-buffer)"
EXPR_SAVE = "(save-buffer 0)"
EXPR_RUBYMODE = "(ruby-mode)"
EXPR_NOBACKUP = "(progn" \
" (set (make-local-variable \'backup-inhibited) t)" \
" (set-buffer-modified-p t)" \
")"
def run_emacs(src, *exprs)
tmp = Tempfile.new(%w"ruby-mode.test. .rb")
@ -31,7 +27,7 @@ class TestRubyMode
tmp.close
exprs = exprs.map {|expr| [EVAL_OPT, expr]}.flatten
exprs.unshift(EVAL_OPT, EXPR_RUBYMODE)
exprs.unshift(EVAL_OPT, EXPR_NOBACKUP)
exprs.push(EVAL_OPT, EXPR_SAVE)
output = IO.popen([*EMACS, tmp.path, *exprs, err:[:child, :out]], "r") {|e| e.read}
tmp.open
result = tmp.read
@ -49,7 +45,7 @@ class TestRubyMode
expected.gsub!(space, '')
source.gsub!(space, '')
end
result, output = run_emacs(source, EXPR_INDENT, EXPR_SAVE)
result, output = run_emacs(source, EXPR_INDENT)
assert_match(/^Wrote /, output)
assert_equal(expected, result, message(*message) {diff expected, result})
end