[前][次][番号順一覧][スレッド一覧]

ruby-changes:44151

From: nobu <ko1@a...>
Date: Sat, 24 Sep 2016 10:20:04 +0900 (JST)
Subject: [ruby-changes:44151] nobu:r56224 (trunk): test_ruby_mode.rb: fix for Emacs 25.1

nobu	2016-09-24 10:19:43 +0900 (Sat, 24 Sep 2016)

  New Revision: 56224

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=56224

  Log:
    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]

  Modified files:
    trunk/ChangeLog
    trunk/test/misc/test_ruby_mode.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 56223)
+++ ChangeLog	(revision 56224)
@@ -1,4 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
-Sat Sep 24 10:18:33 2016  Nobuyoshi Nakada  <nobu@r...>
+Sat Sep 24 10:19:41 2016  Nobuyoshi Nakada  <nobu@r...>
+
+	* 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
 	  argument of 0, not to make the previous version into a backup
Index: test/misc/test_ruby_mode.rb
===================================================================
--- test/misc/test_ruby_mode.rb	(revision 56223)
+++ test/misc/test_ruby_mode.rb	(revision 56224)
@@ -19,6 +19,9 @@ end https://github.com/ruby/ruby/blob/trunk/test/misc/test_ruby_mode.rb#L19
 class TestRubyMode
   EVAL_OPT = "--eval"
   EXPR_SAVE = "(save-buffer 0)"
+  finish_mark = "ok-#{$$}"
+  FINISH_MARK = /^#{finish_mark}$/
+  EXPR_FINISH = "(print \'#{finish_mark})"
   EXPR_RUBYMODE = "(ruby-mode)"
 
   def run_emacs(src, *exprs)
@@ -28,6 +31,7 @@ class TestRubyMode https://github.com/ruby/ruby/blob/trunk/test/misc/test_ruby_mode.rb#L31
     exprs = exprs.map {|expr| [EVAL_OPT, expr]}.flatten
     exprs.unshift(EVAL_OPT, EXPR_RUBYMODE)
     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}
     tmp.open
     result = tmp.read
@@ -46,7 +50,7 @@ class TestRubyMode https://github.com/ruby/ruby/blob/trunk/test/misc/test_ruby_mode.rb#L50
         source.gsub!(space, '')
       end
       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})
     end
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]