Skip to content

Commit

Permalink
Use sigil for charlists in doctests (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomciopp authored Jun 25, 2024
1 parent b494ef5 commit 7ab3746
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions lib/x509/certificate/extension.ex
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,11 @@ defmodule X509.Certificate.Extension do
iex> X509.Certificate.Extension.subject_alt_name(["www.example.com", "example.com"])
{:Extension, {2, 5, 29, 17}, false,
[dNSName: 'www.example.com', dNSName: 'example.com']}
[dNSName: ~c"www.example.com", dNSName: ~c"example.com"]}
iex> X509.Certificate.Extension.subject_alt_name(emailAddress: '[email protected]')
iex> X509.Certificate.Extension.subject_alt_name(emailAddress: ~c"[email protected]")
{:Extension, {2, 5, 29, 17}, false,
[emailAddress: '[email protected]']}
[emailAddress: ~c"[email protected]"]}
"""
@spec subject_alt_name([san_value()]) :: t()
def subject_alt_name(value) do
Expand Down Expand Up @@ -289,7 +289,7 @@ defmodule X509.Certificate.Extension do
{:Extension, {2, 5, 29, 31}, false,
[
{:DistributionPoint,
{:fullName, [uniformResourceIdentifier: 'http://crl.example.org/root.crl']},
{:fullName, [uniformResourceIdentifier: ~c"http://crl.example.org/root.crl"]},
:asn1_NOVALUE, :asn1_NOVALUE}
]}
"""
Expand Down
6 changes: 3 additions & 3 deletions lib/x509/certificate/validity.ex
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ defmodule X509.Certificate.Validity do
iex> {:ok, not_before, 0} = DateTime.from_iso8601("2018-01-01T00:00:00Z")
iex> {:ok, not_after, 0} = DateTime.from_iso8601("2018-12-31T23:59:59Z")
iex> X509.Certificate.Validity.new(not_before, not_after)
{:Validity, {:utcTime, '180101000000Z'}, {:utcTime, '181231235959Z'}}
{:Validity, {:utcTime, ~c"180101000000Z"}, {:utcTime, ~c"181231235959Z"}}
iex> {:ok, not_before, 0} = DateTime.from_iso8601("2051-01-01T00:00:00Z")
iex> {:ok, not_after, 0} = DateTime.from_iso8601("2051-12-31T23:59:59Z")
iex> X509.Certificate.Validity.new(not_before, not_after)
{:Validity, {:generalTime, '20510101000000Z'},
{:generalTime, '20511231235959Z'}}
{:Validity, {:generalTime, ~c"20510101000000Z"},
{:generalTime, ~c"20511231235959Z"}}
"""
@spec new(DateTime.t(), DateTime.t()) :: t()
def new(%DateTime{} = not_before, %DateTime{} = not_after) do
Expand Down

0 comments on commit 7ab3746

Please sign in to comment.