[Bug #1442] indentation check and coverage for toplevel do not work


#1

Bug #1442: indentation check and coverage for toplevel do not work
http://redmine.ruby-lang.org/issues/show/1442

e$B5/I<<Te(B: Yusuke E.
e$B%9%F!<%?%9e(B: Open, e$BM%@hEYe(B: Normal
e$B%+%F%4%je(B: core
ruby -v: ruby 1.9.2dev (2009-05-07 trunk 23361) [i686-linux]

e$B1sF#$G$9!#e(B

[ruby-dev:38050] e$B$re(B redmine e$B$KEPO?$7$^$9!#e(B


e$B%H%C%W%l%Y%k$N%U%!%$%k$KBP$7$F%$%s%G%s%HBP1~%A%’%C%/$He(B coverage
e$B$,e(B
e$BF0$-$^$;$s!#e(B

$ cat test.rb
begin
end

$ ./ruby -vw test.rb
ruby 1.9.2dev (2009-02-19 trunk 22427) [i686-linux]

$

require e$B$7$?%U%!%$%k$G$"$l$PF0$-$^$9!#e(B

$ ./ruby -wr test.rb -e ‘’
/home/mame/work/ruby19/ruby/test.rb:2: warning: mismatched
indentations at ‘end’ with ‘begin’ at 1

r21079 e$B$+$ie(B r21571 e$B$"$?$j$Ne(B ruby.c
e$B$X$NJQ99$G!"%H%C%W%l%Y%k$,e(B
eval e$BAjEv$GI>2A$5$l$k$h$&$K$J$C$?$3$H$,860x$N$h$&$G$9!#e(B


e$B$3$l$K$"$o$;$F!"0J2<$N%F%9%H$rDI2C$7$h$&$H;W$$$^$9!#e(B

Index: test/ruby/test_rubyoptions.rb

— test/ruby/test_rubyoptions.rb (revision 23361)
+++ test/ruby/test_rubyoptions.rb (working copy)
@@ -284,4 +284,15 @@
assert_in_out_err(%w(- -#=foo), “#!ruby -s\n”, [],
/invalid name for global variable - -#
(NameError)/)
end
+

  • def test_indentation_check
  • t = Tempfile.new([“test_ruby_test_rubyoption”, “.rb”])
  • t.puts “begin”
  • t.puts " end"
  • t.close
  • assert_in_out_err(["-w", t.path], “”, [], /:2: warning: mismatched
    indentations at ‘end’ with ‘begin’ at 1/)
  • assert_in_out_err(["-wr", t.path, “-e”, “”], “”, [], /:2: warning:
    mismatched indentations at ‘end’ with ‘begin’ at 1/)
  • ensure
  • t.close(true) if t
  • end
    end


Yusuke ENDOH removed_email_address@domain.invalid


#2

e$B%A%1%C%He(B #1442 e$B$,99?7$5$l$^$7$?!#e(B (by Yusuke E.)

e$B%9%F!<%?%9e(B Opene$B$+$ie(BClosede$B$KJQ99e(B
e$B?JD=e(B % 0e$B$+$ie(B100e$B$KJQ99e(B

Applied in changeset r23362.

http://redmine.ruby-lang.org/issues/show/1442


#3

e$B%A%1%C%He(B #1442 e$B$,99?7$5$l$^$7$?!#e(B (by Yusuke E.)

e$B%9%F!<%?%9e(B Closede$B$+$ie(BOpene$B$KJQ99e(B

e$B$9$_$^$;$s!"%F%9%H$rDI2C$7$?$C$F0UL#$Ge(B ChangeLog e$B$Ke(B ML
e$BHV9f$re(B
e$B=q$$$?$ie(B Close e$B$7$F$7$^$$$^$7$?!#e(B
e$B=$@5$O$7$F$$$^$;$s$N$Ge(B Open e$B$K$7$^$9!#e(B

http://redmine.ruby-lang.org/issues/show/1442


#4

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:38384] Bug #1442 indentation check and
coverage for toplevel do not work”
on Thu, 7 May 2009 22:56:19 +0900, Yusuke E.
removed_email_address@domain.invalid writes:

|e$B%9%F!<%?%9e(B Closede$B$+$ie(BOpene$B$KJQ99e(B
|
|e$B$9$_$^$;$s!"%F%9%H$rDI2C$7$?$C$F0UL#$Ge(B ChangeLog e$B$Ke(B ML e$BHV9f$re(B
|e$B=q$$$?$ie(B Close e$B$7$F$7$^$$$^$7$?!#e(B

e$B$?$V$s!"e(Brefe$B$r;H$&$s$@$H;W$$$^$9!#e(B

|e$B=$@5$O$7$F$$$^$;$s$N$Ge(B Open e$B$K$7$^$9!#e(B

e$B%3%_%C%H$7$F$/$@$5$C$F$b$+$^$o$J$$$H;W$$$^$9!#e(B


#5

e$B%A%1%C%He(B #1442 e$B$,99?7$5$l$^$7$?!#e(B (by Nobuyoshi N.)

e$B%9%F!<%?%9e(B Opene$B$+$ie(BClosede$B$KJQ99e(B

Applied in changeset r23474.

http://redmine.ruby-lang.org/issues/show/1442