[latex3-commits] [git/LaTeX3-latex3-latex3] l3text: Add tests for \text_expand:n (c84fab9a1)
Joseph Wright
joseph.wright at morningstar2.co.uk
Sat Nov 30 11:38:23 CET 2019
Repository : https://github.com/latex3/latex3
On branch : l3text
Link : https://github.com/latex3/latex3/commit/c84fab9a1a7fe74ce6b1909fd30b9fa8e2e771a8
>---------------------------------------------------------------
commit c84fab9a1a7fe74ce6b1909fd30b9fa8e2e771a8
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Sat Nov 30 10:36:53 2019 +0000
Add tests for \text_expand:n
>---------------------------------------------------------------
c84fab9a1a7fe74ce6b1909fd30b9fa8e2e771a8
l3kernel/testfiles/m3text001.lvt | 65 ++++++++++++++++++++++
.../testfiles/{m3tl013.ptex.tlg => m3text001.tlg} | 48 +++++++---------
2 files changed, 86 insertions(+), 27 deletions(-)
diff --git a/l3kernel/testfiles/m3text001.lvt b/l3kernel/testfiles/m3text001.lvt
new file mode 100644
index 000000000..4031cb9bb
--- /dev/null
+++ b/l3kernel/testfiles/m3text001.lvt
@@ -0,0 +1,65 @@
+%
+% Copyright (C) 2019 LaTeX3 Project
+%
+\input{regression-test}
+
+\RequirePackage[enable-debug]{expl3}
+\ExplSyntaxOn
+\debug_on:n { check-declarations , deprecation , log-functions }
+\ExplSyntaxOff
+
+\START
+\AUTHOR{Joseph Wright}
+\ExplSyntaxOn
+
+\OMIT
+ \tl_set:Nn \l_tmpa_tl { Hello }
+ \tl_set:Nn \l_tmpb_tl { \l_tmpa_tl }
+ \cs_set_protected:Npn \cs_tmp:w { \l_tmpa_tl }
+\TIMO
+
+\TESTEXP { Expanding~content }
+ {
+ \text_expand:n { Some~text~\l_tmpa_tl }
+ \NEWLINE
+ \text_expand:n { \l_tmpa_tl \c_space_tl some text }
+ \NEWLINE
+ \text_expand:n { Some~text~\l_tmpb_tl }
+ \NEWLINE
+ \text_expand:n { \l_tmpb_tl \c_space_tl some text }
+ \NEWLINE
+ \text_expand:n { Some~text~\cs_tmp:w }
+ \NEWLINE
+ \text_expand:n { \cs_tmp:w \c_space_tl some text }
+ }
+
+\TESTEXP { Expansion~in~braces }
+ {
+ \text_expand:n { { \l_tmpa_tl }~world~\par with~\ERROR & # }
+ }
+
+\TESTEXP { Expansion~exclusions }
+ {
+ \text_expand:n { FOO~\cite { \l_tmpa_tl } ~ { BAZ } }
+ \NEWLINE
+ \text_expand:n { \emph { BAR } ~ { BAZ } }
+ }
+
+\TESTEXP { Math-mode~escape }
+ {
+ \text_expand:n { Some~text~$y~=~\sin \theta$ }
+ \NEWLINE
+ \text_expand:n { Opps~not~close~token~in~$y~=~\sin \theta }
+ }
+
+\TESTEXP { Letter-like~commands }
+ {
+ \text_expand:n { \AA \aa \J \ae \dh \ss \l \O }
+ }
+
+\TESTEXP { Accents }
+ {
+ \text_expand:n { \"{a} \u{e} \H{i} \v{o} \.{u} }
+ }
+
+\END
diff --git a/l3kernel/testfiles/m3tl013.ptex.tlg b/l3kernel/testfiles/m3text001.tlg
similarity index 63%
copy from l3kernel/testfiles/m3tl013.ptex.tlg
copy to l3kernel/testfiles/m3text001.tlg
index 789dd2bde..66b9aba64 100644
--- a/l3kernel/testfiles/m3tl013.ptex.tlg
+++ b/l3kernel/testfiles/m3text001.tlg
@@ -2,45 +2,39 @@ This is a generated file for the LaTeX (2e + expl3) validation system.
Don't change this file in any respect.
Author: Joseph Wright
============================================================
-TEST 1: Basic case changing
+TEST 1: Expanding content
============================================================
-hello world \par with \ERROR &##
-HELLO WORLD \par WITH \ERROR &##
-Hello world \par with \ERROR &##
+Some text Hello
+Hello sometext
+Some text Hello
+Hello sometext
+Some text \cs_tmp:w
+\cs_tmp:w sometext
============================================================
============================================================
-TEST 2: Case changes in braces
+TEST 2: Expansion in braces
============================================================
-{hello} world \par with \ERROR &##
-{HELLO} WORLD \par WITH \ERROR &##
{Hello} world \par with \ERROR &##
============================================================
============================================================
-TEST 3: Mixed case basics
+TEST 3: Expansion exclusions
============================================================
-Hello world
-Hello world
-" Hello world"
-" Hello world"
-{H}ello world
-{H}ello world
-{}helloworld
-{}helloworld
+FOO \cite {\l_tmpa_tl } {BAZ}
+\emph {BAR} {BAZ}
============================================================
============================================================
-TEST 4: Mixed case skipping chars
+TEST 4: Math-mode escape
============================================================
-`Hic sunt leones'
-``Hic sunt leones''
-([Hic sunt leones])
+Some text $y = \sin \theta $
+Opps not close token in $y = \sin \theta
============================================================
============================================================
-TEST 5: Language based case changing but nothing
+TEST 5: Letter-like commands
============================================================
-no problems
-NO PROBLEMS
-No problems
-no problems
-NO PROBLEMS
-No problems
+\AA \aa \J \ae \dh \ss \l \O
+============================================================
+============================================================
+TEST 6: Accents
+============================================================
+\"{a}\u {e}\H {i}\v {o}\.{u}
============================================================
More information about the latex3-commits
mailing list