summaryrefslogtreecommitdiff
path: root/test/test_time.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_time.rb')
-rw-r--r--test/test_time.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/test_time.rb b/test/test_time.rb
index b50d8417cf..23e8e104a1 100644
--- a/test/test_time.rb
+++ b/test/test_time.rb
@@ -62,6 +62,15 @@ class TestTimeExtension < Test::Unit::TestCase # :nodoc:
assert_equal(true, t.utc?)
end
+ def test_rfc2822_nonlinear
+ pre = ->(n) {"0 Feb 00 00 :00" + " " * n}
+ assert_linear_performance([100, 500, 5000, 50_000], pre: pre) do |s|
+ assert_raise(ArgumentError) do
+ Time.rfc2822(s)
+ end
+ end
+ end
+
if defined?(Ractor)
def test_rfc2822_ractor
assert_ractor(<<~RUBY, require: 'time')