[ruby/openssl] Exact checks with `assert_include`

Where `assert_match` converts string matcher argument to regexp first
with escaping, `assert_include` does the same thing simpler.

https://github.com/ruby/openssl/commit/81007e0a49
This commit is contained in:
Nobuyoshi Nakada 2023-10-06 17:38:56 +09:00 коммит произвёл git
Родитель 95ced6d8d2
Коммит 723318f5d7
1 изменённых файлов: 6 добавлений и 8 удалений

Просмотреть файл

@ -50,18 +50,16 @@ class OpenSSL::TestX509Extension < OpenSSL::TestCase
cdp = ef.create_extension("crlDistributionPoints", "@crlDistPts")
assert_equal(false, cdp.critical?)
assert_equal("crlDistributionPoints", cdp.oid)
assert_match(%{URI:http://www\.example\.com/crl}, cdp.value)
assert_match(
%r{URI:ldap://ldap\.example\.com/cn=ca\?certificateRevocationList;binary},
cdp.value)
assert_include(cdp.value, "URI:http://www.example.com/crl")
assert_include(cdp.value,
"URI:ldap://ldap.example.com/cn=ca?certificateRevocationList;binary")
cdp = ef.create_extension("crlDistributionPoints", "critical, @crlDistPts")
assert_equal(true, cdp.critical?)
assert_equal("crlDistributionPoints", cdp.oid)
assert_match(%{URI:http://www.example.com/crl}, cdp.value)
assert_match(
%r{URI:ldap://ldap.example.com/cn=ca\?certificateRevocationList;binary},
cdp.value)
assert_include(cdp.value, "URI:http://www.example.com/crl")
assert_include(cdp.value,
"URI:ldap://ldap.example.com/cn=ca?certificateRevocationList;binary")
cp = ef.create_extension("certificatePolicies", "@certPolicies")
assert_equal(false, cp.critical?)