Bug #1442
closedindentation check and coverage for toplevel do not work
Description
=begin
遠藤です。
[ruby-dev:38050] を redmine に登録します。
トップレベルのファイルに対してインデント対応チェックと coverage が
動きません。
$ cat test.rb
begin
end
$ ./ruby -vw test.rb
ruby 1.9.2dev (2009-02-19 trunk 22427) [i686-linux]
$
require したファイルであれば動きます。
$ ./ruby -wr test.rb -e ''
/home/mame/work/ruby19/ruby/test.rb:2: warning: mismatched
indentations at 'end' with 'begin' at 1
r21079 から r21571 あたりの ruby.c への変更で、トップレベルが
eval 相当で評価されるようになったことが原因のようです。
これにあわせて、以下のテストを追加しようと思います。
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 [email protected]
=end
Updated by mame (Yusuke Endoh) about 16 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
=begin
Applied in changeset r23362.
=end
Updated by mame (Yusuke Endoh) about 16 years ago
- Status changed from Closed to Open
=begin
すみません、テストを追加したって意味で ChangeLog に ML 番号を
書いたら Close してしまいました。
修正はしていませんので Open にします。
=end
Updated by matz (Yukihiro Matsumoto) about 16 years ago
=begin
まつもと ゆきひろです
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 Endoh [email protected] writes:
|ステータス ClosedからOpenに変更
|
|すみません、テストを追加したって意味で ChangeLog に ML 番号を
|書いたら Close してしまいました。
たぶん、refを使うんだと思います。
|修正はしていませんので Open にします。
コミットしてくださってもかまわないと思います。
=end
Updated by nobu (Nobuyoshi Nakada) about 16 years ago
- Status changed from Open to Closed
=begin
Applied in changeset r23474.
=end