Skip to content

Commit 9c166d2

Browse files
nobumatzbot
authored andcommitted
[ruby/uri] Test in exponential scale with rehearsal
ruby/uri@be35e0b4d8
1 parent b438915 commit 9c166d2

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

test/uri/test_mailto.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,15 +213,16 @@ def test_check_to
213213
def test_email_regexp
214214
re = URI::MailTo::EMAIL_REGEXP
215215

216-
rate = 1000
217216
longlabel = '.' + 'invalid'.ljust(63, 'd')
218217
endlabel = ''
219-
pre = ->(n) {'a@invalid' + longlabel*(n*rate) + endlabel}
220-
assert_linear_performance(1..10, pre: pre) do |to|
218+
seq = (1..5).map {|i| 5**i}
219+
rehearsal = 100
220+
pre = ->(n) {'a@invalid' + longlabel*(n) + endlabel}
221+
assert_linear_performance(seq, rehearsal: rehearsal, pre: pre) do |to|
221222
re =~ to or flunk
222223
end
223224
endlabel = '.' + 'email'.rjust(64, 'd')
224-
assert_linear_performance(1..10, pre: pre) do |to|
225+
assert_linear_performance(seq, rehearsal: rehearsal, pre: pre) do |to|
225226
re =~ to and flunk
226227
end
227228
end

0 commit comments

Comments
 (0)