Skip to content

Commit

Permalink
Correct arg. expansion for \str_mdfive_hash:n
Browse files Browse the repository at this point in the history
  • Loading branch information
josephwright committed May 19, 2023
1 parent b34b314 commit 7a4db19
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 6 deletions.
12 changes: 7 additions & 5 deletions l3kernel/l3str.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -787,11 +787,12 @@
% not to \texttt{\i}).
% \end{function}
%
% \begin{function}[added = 2023-05-19, EXP]{\str_mdfive_hash:n}
% \begin{function}[added = 2023-05-19, EXP]{\str_mdfive_hash:n, \str_mdfive_hash:e}
% \begin{syntax}
% \cs{str_mdfive_hash:n} \Arg{str}
% \cs{str_mdfive_hash:n} \Arg{tl}
% \end{syntax}
% Expands to the MD5 sum generated from the \meta{str}.
% Expands to the MD5 sum generated from the \meta{tl}, which is converted
% to a \meta{string} as described for \cs{tl_to_str:n}.
% \end{function}
%
% \section{Viewing strings}
Expand Down Expand Up @@ -2088,9 +2089,10 @@
% \end{macro}
% \end{macro}
%
% \begin{macro}[EXP]{\str_mdfive_hash:n}
% \begin{macro}[EXP]{\str_mdfive_hash:n, \str_mdfive_hash:e}
% \begin{macrocode}
\cs_new:Npn \str_mdfive_hash:n #1 { \tex_mdfivesum:D {#1} }
\cs_new:Npn \str_mdfive_hash:n #1 { \tex_mdfivesum:D { \tl_to_str:n {#1} } }
\cs_new:Npn \str_mdfive_hash:e #1 { \tex_mdfivesum:D {#1} }
% \end{macrocode}
% \end{macro}
%
Expand Down
6 changes: 5 additions & 1 deletion l3kernel/testfiles/m3str002.luatex.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,9 @@ TRUE
TEST 5: MD5 hash
============================================================
ACBD18DB4CC2F85CEDEF654FCCC4A4D8
ACCFBEFDEAC67A70FBD55DFAA45CA92F
2EE44D8E2EBA7C35496E4A82CFD620A0
C3776EC7ED6D262C7A74B09E446A7AA1
3440094ABA126C1E66A4CF632E30A6CE
D41D8CD98F00B204E9800998ECF8427E
D41D8CD98F00B204E9800998ECF8427E
============================================================
13 changes: 13 additions & 0 deletions l3kernel/testfiles/m3str002.lvt
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,24 @@
\tl_if_eq:NNTF \l_tmpa_tl \l_tmpb_tl \TRUE \FALSE
}

\OMIT
\tl_set:N \l_tmpa_tl { a }
\tl_set:N \l_tmpb_tl { a }
\TIMO

\TESTEXP { MD5~hash }
{
\str_mdfive_hash:n { foo }
\NEWLINE
\str_mdfive_hash:n { & \par ! ## }
\NEWLINE
\str_mdfive_hash:n { \l_tmpa_tl }
\NEWLINE
\str_mdfive_hash:n { \l_tmpb_tl }
\NEWLINE
\str_mdfive_hash:e { \l_tmpa_tl }
\NEWLINE
\str_mdfive_hash:e { \l_tmpb_tl }
}


Expand Down
4 changes: 4 additions & 0 deletions l3kernel/testfiles/m3str002.ptex.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,8 @@ TEST 5: MD5 hash
============================================================
ACBD18DB4CC2F85CEDEF654FCCC4A4D8
2EE44D8E2EBA7C35496E4A82CFD620A0
C3776EC7ED6D262C7A74B09E446A7AA1
3440094ABA126C1E66A4CF632E30A6CE
D41D8CD98F00B204E9800998ECF8427E
D41D8CD98F00B204E9800998ECF8427E
============================================================
4 changes: 4 additions & 0 deletions l3kernel/testfiles/m3str002.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,8 @@ TEST 5: MD5 hash
============================================================
ACBD18DB4CC2F85CEDEF654FCCC4A4D8
2EE44D8E2EBA7C35496E4A82CFD620A0
C3776EC7ED6D262C7A74B09E446A7AA1
3440094ABA126C1E66A4CF632E30A6CE
D41D8CD98F00B204E9800998ECF8427E
D41D8CD98F00B204E9800998ECF8427E
============================================================
4 changes: 4 additions & 0 deletions l3kernel/testfiles/m3str002.uptex.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,8 @@ TEST 5: MD5 hash
============================================================
ACBD18DB4CC2F85CEDEF654FCCC4A4D8
2EE44D8E2EBA7C35496E4A82CFD620A0
C3776EC7ED6D262C7A74B09E446A7AA1
3440094ABA126C1E66A4CF632E30A6CE
D41D8CD98F00B204E9800998ECF8427E
D41D8CD98F00B204E9800998ECF8427E
============================================================
4 changes: 4 additions & 0 deletions l3kernel/testfiles/m3str002.xetex.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,8 @@ TEST 5: MD5 hash
============================================================
ACBD18DB4CC2F85CEDEF654FCCC4A4D8
2EE44D8E2EBA7C35496E4A82CFD620A0
C3776EC7ED6D262C7A74B09E446A7AA1
3440094ABA126C1E66A4CF632E30A6CE
D41D8CD98F00B204E9800998ECF8427E
D41D8CD98F00B204E9800998ECF8427E
============================================================

0 comments on commit 7a4db19

Please sign in to comment.