trick ruby-mode.el by heredocs
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f1b7bf1047
commit
e97cc46460
@ -2535,7 +2535,8 @@ End
|
|||||||
|
|
||||||
assert_in_out_err([], "$> = $stderr\nputs 'foo'", [], %w(foo))
|
assert_in_out_err([], "$> = $stderr\nputs 'foo'", [], %w(foo))
|
||||||
|
|
||||||
assert_separately(%w[-Eutf-8], <<-"end;") # do
|
assert_separately(%w[-Eutf-8], "#{<<~"begin;"}\n#{<<~"end;"}")
|
||||||
|
begin;
|
||||||
alias $\u{6a19 6e96 51fa 529b} $stdout
|
alias $\u{6a19 6e96 51fa 529b} $stdout
|
||||||
x = eval("class X\u{307b 3052}; self; end".encode("euc-jp"))
|
x = eval("class X\u{307b 3052}; self; end".encode("euc-jp"))
|
||||||
assert_raise_with_message(TypeError, /\\$\u{6a19 6e96 51fa 529b} must.*, X\u{307b 3052} given/) do
|
assert_raise_with_message(TypeError, /\\$\u{6a19 6e96 51fa 529b} must.*, X\u{307b 3052} given/) do
|
||||||
|
@ -2121,12 +2121,14 @@ EOT
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_bom_too_long_utfname
|
def test_bom_too_long_utfname
|
||||||
assert_separately([], <<-'end;') # do
|
assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}")
|
||||||
|
begin;
|
||||||
assert_warn(/Unsupported encoding/) {
|
assert_warn(/Unsupported encoding/) {
|
||||||
open(IO::NULL, "r:bom|utf-" + "x" * 10000) {}
|
open(IO::NULL, "r:bom|utf-" + "x" * 10000) {}
|
||||||
}
|
}
|
||||||
end;
|
end;
|
||||||
assert_separately([], <<-'end;') # do
|
assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}")
|
||||||
|
begin;
|
||||||
assert_warn(/Unsupported encoding/) {
|
assert_warn(/Unsupported encoding/) {
|
||||||
open(IO::NULL, encoding: "bom|utf-" + "x" * 10000) {}
|
open(IO::NULL, encoding: "bom|utf-" + "x" * 10000) {}
|
||||||
}
|
}
|
||||||
|
@ -246,11 +246,14 @@ class TestProcess < Test::Unit::TestCase
|
|||||||
assert_raise(ArgumentError) do
|
assert_raise(ArgumentError) do
|
||||||
system(RUBY, '-e', 'exit', 'rlimit_bogus'.to_sym => 123)
|
system(RUBY, '-e', 'exit', 'rlimit_bogus'.to_sym => 123)
|
||||||
end
|
end
|
||||||
assert_separately([],<<-"end;") # [ruby-core:82033] [Bug #13744]
|
assert_separately([],"#{<<-"begin;"}\n#{<<~'end;'}")
|
||||||
|
BUG = "[ruby-core:82033] [Bug #13744]"
|
||||||
|
RUBY = "#{RUBY}"
|
||||||
|
begin;
|
||||||
assert(system("#{RUBY}", "-e",
|
assert(system("#{RUBY}", "-e",
|
||||||
"exit([3600,3600] == Process.getrlimit(:CPU))",
|
"exit([3600,3600] == Process.getrlimit(:CPU))",
|
||||||
'rlimit_cpu'.to_sym => 3600))
|
'rlimit_cpu'.to_sym => 3600), BUG)
|
||||||
assert_raise(ArgumentError) do
|
assert_raise(ArgumentError, BUG) do
|
||||||
system("#{RUBY}", '-e', 'exit', :rlimit_bogus => 123)
|
system("#{RUBY}", '-e', 'exit', :rlimit_bogus => 123)
|
||||||
end
|
end
|
||||||
end;
|
end;
|
||||||
|
@ -659,7 +659,9 @@ CODE
|
|||||||
assert_raise(ArgumentError) {S("mypassword".encode(enc)).crypt(S("aa"))}
|
assert_raise(ArgumentError) {S("mypassword".encode(enc)).crypt(S("aa"))}
|
||||||
end
|
end
|
||||||
|
|
||||||
@cls == String and assert_no_memory_leak([], 's = ""', <<~'end;') # do
|
@cls == String and
|
||||||
|
assert_no_memory_leak([], 's = ""', "#{<<~"begin;"}\n#{<<~'end;'}")
|
||||||
|
begin;
|
||||||
1000.times { s.crypt(-"..").clear }
|
1000.times { s.crypt(-"..").clear }
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user