Do not run the same tests twice
This commit is contained in:
parent
fb532d801c
commit
47a05f7c09
@ -97,6 +97,8 @@ class TestString < Test::Unit::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_initialize_memory_leak
|
def test_initialize_memory_leak
|
||||||
|
return unless @cls == String
|
||||||
|
|
||||||
assert_no_memory_leak([], <<-PREP, <<-CODE, rss: true)
|
assert_no_memory_leak([], <<-PREP, <<-CODE, rss: true)
|
||||||
code = proc {('x'*100000).__send__(:initialize, '')}
|
code = proc {('x'*100000).__send__(:initialize, '')}
|
||||||
1_000.times(&code)
|
1_000.times(&code)
|
||||||
@ -107,6 +109,8 @@ CODE
|
|||||||
|
|
||||||
# Bug #18154
|
# Bug #18154
|
||||||
def test_initialize_nofree_memory_leak
|
def test_initialize_nofree_memory_leak
|
||||||
|
return unless @cls == String
|
||||||
|
|
||||||
assert_no_memory_leak([], <<-PREP, <<-CODE, rss: true)
|
assert_no_memory_leak([], <<-PREP, <<-CODE, rss: true)
|
||||||
code = proc {0.to_s.__send__(:initialize, capacity: 10000)}
|
code = proc {0.to_s.__send__(:initialize, capacity: 10000)}
|
||||||
1_000.times(&code)
|
1_000.times(&code)
|
||||||
@ -1764,6 +1768,8 @@ CODE
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_fs
|
def test_fs
|
||||||
|
return unless @cls == String
|
||||||
|
|
||||||
assert_raise_with_message(TypeError, /\$;/) {
|
assert_raise_with_message(TypeError, /\$;/) {
|
||||||
$; = []
|
$; = []
|
||||||
}
|
}
|
||||||
@ -2419,6 +2425,8 @@ CODE
|
|||||||
class S2 < String
|
class S2 < String
|
||||||
end
|
end
|
||||||
def test_str_new4
|
def test_str_new4
|
||||||
|
return unless @cls == String
|
||||||
|
|
||||||
s = (0..54).to_a.join # length = 100
|
s = (0..54).to_a.join # length = 100
|
||||||
s2 = S2.new(s[10,90])
|
s2 = S2.new(s[10,90])
|
||||||
s3 = s2[10,80]
|
s3 = s2[10,80]
|
||||||
@ -2621,10 +2629,13 @@ CODE
|
|||||||
assert_equal([S("abcdb"), S("c"), S("e")], S("abcdbce").rpartition(/b\Kc/))
|
assert_equal([S("abcdb"), S("c"), S("e")], S("abcdbce").rpartition(/b\Kc/))
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_setter
|
def test_fs_setter
|
||||||
|
return unless @cls == String
|
||||||
|
|
||||||
assert_raise(TypeError) { $/ = 1 }
|
assert_raise(TypeError) { $/ = 1 }
|
||||||
name = "\u{5206 884c}"
|
name = "\u{5206 884c}"
|
||||||
assert_separately([], <<-"end;") # do
|
assert_separately([], "#{<<~"do;"}\n#{<<~"end;"}")
|
||||||
|
do;
|
||||||
alias $#{name} $/
|
alias $#{name} $/
|
||||||
assert_raise_with_message(TypeError, /\\$#{name}/) { $#{name} = 1 }
|
assert_raise_with_message(TypeError, /\\$#{name}/) { $#{name} = 1 }
|
||||||
end;
|
end;
|
||||||
@ -3127,6 +3138,8 @@ CODE
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_eq_tilde_can_be_overridden
|
def test_eq_tilde_can_be_overridden
|
||||||
|
return unless @cls == String
|
||||||
|
|
||||||
assert_separately([], <<-RUBY)
|
assert_separately([], <<-RUBY)
|
||||||
class String
|
class String
|
||||||
undef =~
|
undef =~
|
||||||
@ -3154,6 +3167,7 @@ CODE
|
|||||||
|
|
||||||
def test_LSHIFT_neary_long_max
|
def test_LSHIFT_neary_long_max
|
||||||
return unless @cls == String
|
return unless @cls == String
|
||||||
|
|
||||||
assert_ruby_status([], <<-'end;', '[ruby-core:61886] [Bug #9709]', timeout: 20)
|
assert_ruby_status([], <<-'end;', '[ruby-core:61886] [Bug #9709]', timeout: 20)
|
||||||
begin
|
begin
|
||||||
a = "a" * 0x4000_0000
|
a = "a" * 0x4000_0000
|
||||||
@ -3188,6 +3202,8 @@ CODE
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_uminus_frozen
|
def test_uminus_frozen
|
||||||
|
return unless @cls == String
|
||||||
|
|
||||||
# embedded
|
# embedded
|
||||||
str1 = ("foobar" * 3).freeze
|
str1 = ("foobar" * 3).freeze
|
||||||
str2 = ("foobar" * 3).freeze
|
str2 = ("foobar" * 3).freeze
|
||||||
|
Loading…
x
Reference in New Issue
Block a user