diff options
| author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2025-07-12 20:05:48 +0900 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2025-07-13 04:37:15 +0000 |
| commit | 9c166d26b2e52fcddc29cc18d4017118689caf98 (patch) | |
| tree | d205b23e9ac07237ef47f1f14239d3962e874e16 | |
| parent | b438915f0aa69e15b7742d8d70f5e6288a7a88f9 (diff) | |
[ruby/uri] Test in exponential scale with rehearsal
https://github.com/ruby/uri/commit/be35e0b4d8
| -rw-r--r-- | test/uri/test_mailto.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/test/uri/test_mailto.rb b/test/uri/test_mailto.rb index 66f3edd05f..e5bed5bdab 100644 --- a/test/uri/test_mailto.rb +++ b/test/uri/test_mailto.rb @@ -213,15 +213,16 @@ class URI::TestMailTo < Test::Unit::TestCase def test_email_regexp re = URI::MailTo::EMAIL_REGEXP - rate = 1000 longlabel = '.' + 'invalid'.ljust(63, 'd') endlabel = '' - pre = ->(n) {'a@invalid' + longlabel*(n*rate) + endlabel} - assert_linear_performance(1..10, pre: pre) do |to| + seq = (1..5).map {|i| 5**i} + rehearsal = 100 + pre = ->(n) {'a@invalid' + longlabel*(n) + endlabel} + assert_linear_performance(seq, rehearsal: rehearsal, pre: pre) do |to| re =~ to or flunk end endlabel = '.' + 'email'.rjust(64, 'd') - assert_linear_performance(1..10, pre: pre) do |to| + assert_linear_performance(seq, rehearsal: rehearsal, pre: pre) do |to| re =~ to and flunk end end |
