diff --git a/spec/datadog/tracing/contrib/utils/quantization/http_spec.rb b/spec/datadog/tracing/contrib/utils/quantization/http_spec.rb index d3f3f05a615..b68999f736d 100644 --- a/spec/datadog/tracing/contrib/utils/quantization/http_spec.rb +++ b/spec/datadog/tracing/contrib/utils/quantization/http_spec.rb @@ -3,6 +3,19 @@ require 'datadog/tracing/contrib/utils/quantization/http' RSpec.describe Datadog::Tracing::Contrib::Utils::Quantization::HTTP do + describe 'RFC3986_URL_BASE' do + let(:regex) { described_class::RFC3986_URL_BASE } + + it 'matches in linear time' do + if !Regexp.respond_to?(:linear_time?) + skip 'Regexp.linear_time? method is only available on Ruby 3.3+' + else + pending + expect(Regexp.linear_time?(regex)).to be true + end + end + end + describe '#url' do subject(:result) { described_class.url(url, options) } @@ -569,6 +582,14 @@ } # rubocop:enable Layout/LineLength + it 'matches in linear time' do + if !Regexp.respond_to?(:linear_time?) + skip 'Regexp.linear_time? method is only available on Ruby 3.3+' + else + expect(Regexp.linear_time?(regex)).to be true + end + end + key_matches.each do |key| context "given query string key #{key.inspect} and its value" do let(:str) { format('%s=foo', { key: key }) }