summaryrefslogtreecommitdiff
diff options
authorNobuyoshi Nakada <[email protected]>2025-07-13 13:18:15 +0900
committergit <[email protected]>2025-07-13 04:37:15 +0000
commitf03cc0b514e400c4ea1428103e1f1f601c22fa86 (patch)
tree32fb806076a330e1ec33a6a9fe730504bc6dd8c8
parent9c166d26b2e52fcddc29cc18d4017118689caf98 (diff)
[ruby/uri] Repeat matching to reduce deviationsHEADmaster
https://github.com/ruby/uri/commit/fa49e5b8ae
-rw-r--r--test/uri/test_mailto.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/uri/test_mailto.rb b/test/uri/test_mailto.rb
index e5bed5bdab..59bb5ded09 100644
--- a/test/uri/test_mailto.rb
+++ b/test/uri/test_mailto.rb
@@ -213,17 +213,18 @@ class URI::TestMailTo < Test::Unit::TestCase
def test_email_regexp
re = URI::MailTo::EMAIL_REGEXP
+ repeat = 10
longlabel = '.' + 'invalid'.ljust(63, 'd')
endlabel = ''
- seq = (1..5).map {|i| 5**i}
- rehearsal = 100
+ seq = (1..3).map {|i| 10**i}
+ rehearsal = 10
pre = ->(n) {'a@invalid' + longlabel*(n) + endlabel}
assert_linear_performance(seq, rehearsal: rehearsal, pre: pre) do |to|
- re =~ to or flunk
+ repeat.times {re =~ to or flunk}
end
endlabel = '.' + 'email'.rjust(64, 'd')
assert_linear_performance(seq, rehearsal: rehearsal, pre: pre) do |to|
- re =~ to and flunk
+ repeat.times {re =~ to and flunk}
end
end
close