Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redefinitions #2343

Merged
merged 4 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add (convoluted) test case to test definition locks
  • Loading branch information
brucemiller committed Apr 3, 2024
commit cc8131808d7c8599fcd6fc20695aeda295d68cb7
6 changes: 6 additions & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -983,6 +983,12 @@ t/daemon/api/port.xml
t/daemon/citations.tex
t/daemon/complex/exhaustive.spec
t/daemon/complex/exhaustive.xml
t/daemon/complex/testlocks.spec
t/daemon/complex/testlocks.tex
t/daemon/complex/testlocks.xml
t/daemon/complex/testlocks.sty.ltxml
t/daemon/complex/testlocks-a.sty
t/daemon/complex/testlocks-b.sty.ltxml
t/daemon/document.tex
t/daemon/fatal_100.tex
t/daemon/fatal_misdefined.tex
Expand Down
4 changes: 4 additions & 0 deletions t/daemon/complex/testlocks-a.sty
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

% Ignored attempt to redefine \fooC
\def\fooC{testlocks-a FOO-C}
\RequirePackage{testlocks-b};
12 changes: 12 additions & 0 deletions t/daemon/complex/testlocks-b.sty.ltxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package LaTeXML::Package::Pool;
use strict;
use warnings;
use LaTeXML::Package;

# RE-defintions (allowed)
DefMacro('\fooD', "testlocks-b FOO-D", locked => 1);

# Definition, BUT will be RE-defined by testlocks.sty
DefMacro('\fooE', "testlocks-b FOO-E", locked => 1);

1;
3 changes: 3 additions & 0 deletions t/daemon/complex/testlocks.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
preload = testlocks.sty
source = testlocks.tex
format = xml
16 changes: 16 additions & 0 deletions t/daemon/complex/testlocks.sty.ltxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package LaTeXML::Package::Pool;
use strict;
use warnings;
use LaTeXML::Package;

DefMacro('\fooA', "testlocks FOO-A", locked => 1);
DefMacro('\fooB', "testlocks FOO-B", locked => 1);
DefMacro('\fooC', "testlocks FOO-C", locked => 1);
DefMacro('\fooD', "testlocks FOO-D", locked => 1);

InputDefinitions("testlocks-a", type => 'sty', noltxml => 1);

# This gets defined in testlocks-b.sty.ltxml, input from testlocks-a.sty
DefMacro('\fooE', "testlocks FOO-E", locked => 1);

1;
16 changes: 16 additions & 0 deletions t/daemon/complex/testlocks.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
\documentclass{article}
%\usepackage{testlocks}
% Ignored re-definition
\def\fooB{Locak FOO-B}
\begin{document}
testlocks FOO-A:\fooA

testlocks FOO-B:\fooB

testlocks FOO-C:\fooC

testlocks-b FOO-D:\fooD

testlocks FOO-E:\fooE

\end{document}
23 changes: 23 additions & 0 deletions t/daemon/complex/testlocks.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<?latexml package="testlocks"?>
<?latexml class="article"?>
<?latexml RelaxNGSchema="LaTeXML"?>
<document xmlns="http://dlmf.nist.gov/LaTeXML">
<resource src="LaTeXML.css" type="text/css"/>
<resource src="ltx-article.css" type="text/css"/>
<para xml:id="p1">
<p>testlocks FOO-A:testlocks FOO-A</p>
</para>
<para xml:id="p2">
<p>testlocks FOO-B:testlocks FOO-B</p>
</para>
<para xml:id="p3">
<p>testlocks FOO-C:testlocks FOO-C</p>
</para>
<para xml:id="p4">
<p>testlocks-b FOO-D:testlocks-b FOO-D</p>
</para>
<para xml:id="p5">
<p>testlocks FOO-E:testlocks FOO-E</p>
</para>
</document>
Loading