[latex3-commits] [latex3/latex3] gh940-keys-meta, main: Correct arg. expansion for \str_mdfive_hash:n (7a4db194e)

github at latex-project.org github at latex-project.org
Fri May 19 14:11:15 CEST 2023


Repository : https://github.com/latex3/latex3
On branches: gh940-keys-meta,main
Link       : https://github.com/latex3/latex3/commit/7a4db194edcdc5abf8b4f4a95f7fa37db2366a87

>---------------------------------------------------------------

commit 7a4db194edcdc5abf8b4f4a95f7fa37db2366a87
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Fri May 19 12:21:09 2023 +0100

    Correct arg. expansion for \str_mdfive_hash:n


>---------------------------------------------------------------

7a4db194edcdc5abf8b4f4a95f7fa37db2366a87
 l3kernel/l3str.dtx                     | 12 +++++++-----
 l3kernel/testfiles/m3str002.luatex.tlg |  6 +++++-
 l3kernel/testfiles/m3str002.lvt        | 13 +++++++++++++
 l3kernel/testfiles/m3str002.ptex.tlg   |  4 ++++
 l3kernel/testfiles/m3str002.tlg        |  4 ++++
 l3kernel/testfiles/m3str002.uptex.tlg  |  4 ++++
 l3kernel/testfiles/m3str002.xetex.tlg  |  4 ++++
 7 files changed, 41 insertions(+), 6 deletions(-)

diff --git a/l3kernel/l3str.dtx b/l3kernel/l3str.dtx
index 6ccb43b3d..14f34fa6b 100644
--- a/l3kernel/l3str.dtx
+++ b/l3kernel/l3str.dtx
@@ -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}
@@ -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}
 %
diff --git a/l3kernel/testfiles/m3str002.luatex.tlg b/l3kernel/testfiles/m3str002.luatex.tlg
index 8b7ed176b..1a3da1d8a 100644
--- a/l3kernel/testfiles/m3str002.luatex.tlg
+++ b/l3kernel/testfiles/m3str002.luatex.tlg
@@ -33,5 +33,9 @@ TRUE
 TEST 5: MD5 hash
 ============================================================
 ACBD18DB4CC2F85CEDEF654FCCC4A4D8
-ACCFBEFDEAC67A70FBD55DFAA45CA92F
+2EE44D8E2EBA7C35496E4A82CFD620A0
+C3776EC7ED6D262C7A74B09E446A7AA1
+3440094ABA126C1E66A4CF632E30A6CE
+D41D8CD98F00B204E9800998ECF8427E
+D41D8CD98F00B204E9800998ECF8427E
 ============================================================
diff --git a/l3kernel/testfiles/m3str002.lvt b/l3kernel/testfiles/m3str002.lvt
index 904516010..6e4c82f39 100644
--- a/l3kernel/testfiles/m3str002.lvt
+++ b/l3kernel/testfiles/m3str002.lvt
@@ -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 }
   }
 
 
diff --git a/l3kernel/testfiles/m3str002.ptex.tlg b/l3kernel/testfiles/m3str002.ptex.tlg
index 2cf6980e6..ad255967e 100644
--- a/l3kernel/testfiles/m3str002.ptex.tlg
+++ b/l3kernel/testfiles/m3str002.ptex.tlg
@@ -34,4 +34,8 @@ TEST 5: MD5 hash
 ============================================================
 ACBD18DB4CC2F85CEDEF654FCCC4A4D8
 2EE44D8E2EBA7C35496E4A82CFD620A0
+C3776EC7ED6D262C7A74B09E446A7AA1
+3440094ABA126C1E66A4CF632E30A6CE
+D41D8CD98F00B204E9800998ECF8427E
+D41D8CD98F00B204E9800998ECF8427E
 ============================================================
diff --git a/l3kernel/testfiles/m3str002.tlg b/l3kernel/testfiles/m3str002.tlg
index 1bcd11edf..e3df5afcd 100644
--- a/l3kernel/testfiles/m3str002.tlg
+++ b/l3kernel/testfiles/m3str002.tlg
@@ -34,4 +34,8 @@ TEST 5: MD5 hash
 ============================================================
 ACBD18DB4CC2F85CEDEF654FCCC4A4D8
 2EE44D8E2EBA7C35496E4A82CFD620A0
+C3776EC7ED6D262C7A74B09E446A7AA1
+3440094ABA126C1E66A4CF632E30A6CE
+D41D8CD98F00B204E9800998ECF8427E
+D41D8CD98F00B204E9800998ECF8427E
 ============================================================
diff --git a/l3kernel/testfiles/m3str002.uptex.tlg b/l3kernel/testfiles/m3str002.uptex.tlg
index e470f77ad..4c4509cfb 100644
--- a/l3kernel/testfiles/m3str002.uptex.tlg
+++ b/l3kernel/testfiles/m3str002.uptex.tlg
@@ -34,4 +34,8 @@ TEST 5: MD5 hash
 ============================================================
 ACBD18DB4CC2F85CEDEF654FCCC4A4D8
 2EE44D8E2EBA7C35496E4A82CFD620A0
+C3776EC7ED6D262C7A74B09E446A7AA1
+3440094ABA126C1E66A4CF632E30A6CE
+D41D8CD98F00B204E9800998ECF8427E
+D41D8CD98F00B204E9800998ECF8427E
 ============================================================
diff --git a/l3kernel/testfiles/m3str002.xetex.tlg b/l3kernel/testfiles/m3str002.xetex.tlg
index f80fc052b..1a3da1d8a 100644
--- a/l3kernel/testfiles/m3str002.xetex.tlg
+++ b/l3kernel/testfiles/m3str002.xetex.tlg
@@ -34,4 +34,8 @@ TEST 5: MD5 hash
 ============================================================
 ACBD18DB4CC2F85CEDEF654FCCC4A4D8
 2EE44D8E2EBA7C35496E4A82CFD620A0
+C3776EC7ED6D262C7A74B09E446A7AA1
+3440094ABA126C1E66A4CF632E30A6CE
+D41D8CD98F00B204E9800998ECF8427E
+D41D8CD98F00B204E9800998ECF8427E
 ============================================================





More information about the latex3-commits mailing list.