summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/cals/test/decoration
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/cals/test/decoration
Initial commit
Diffstat (limited to 'macros/latex/contrib/cals/test/decoration')
-rw-r--r--macros/latex/contrib/cals/test/decoration/test_10_withwidth2.chk7
-rw-r--r--macros/latex/contrib/cals/test/decoration/test_10_withwidth2.tex32
-rw-r--r--macros/latex/contrib/cals/test/decoration/test_20_withcolor2.chk4
-rw-r--r--macros/latex/contrib/cals/test/decoration/test_20_withcolor2.tex23
-rw-r--r--macros/latex/contrib/cals/test/decoration/test_30_halfwidth.chk3
-rw-r--r--macros/latex/contrib/cals/test/decoration/test_30_halfwidth.tex9
-rw-r--r--macros/latex/contrib/cals/test/decoration/test_50_maxwidth.chk9
-rw-r--r--macros/latex/contrib/cals/test/decoration/test_50_maxwidth.tex28
-rw-r--r--macros/latex/contrib/cals/test/decoration/test_60_row.chk54
-rw-r--r--macros/latex/contrib/cals/test/decoration/test_60_row.tex65
-rw-r--r--macros/latex/contrib/cals/test/decoration/test_70_align.chk8
-rw-r--r--macros/latex/contrib/cals/test/decoration/test_70_align.tex15
12 files changed, 257 insertions, 0 deletions
diff --git a/macros/latex/contrib/cals/test/decoration/test_10_withwidth2.chk b/macros/latex/contrib/cals/test/decoration/test_10_withwidth2.chk
new file mode 100644
index 0000000000..8921cc46ba
--- /dev/null
+++ b/macros/latex/contrib/cals/test/decoration/test_10_withwidth2.chk
@@ -0,0 +1,7 @@
+user width: 5pt
+no width
+default width: 2pt
+no width
+> \boxXX=
+\hbox(0.0+0.0)x0.0
+.\hbox(0.0+0.0)x0.0
diff --git a/macros/latex/contrib/cals/test/decoration/test_10_withwidth2.tex b/macros/latex/contrib/cals/test/decoration/test_10_withwidth2.tex
new file mode 100644
index 0000000000..40f4832b87
--- /dev/null
+++ b/macros/latex/contrib/cals/test/decoration/test_10_withwidth2.tex
@@ -0,0 +1,32 @@
+\cals@withWidthII{1pt}{5pt}\iftrue
+ \PackageInfo{test}{user width: \cals@width}
+\else
+ \PackageInfo{test}{fail}
+\fi
+
+\def\defaultDimen{2pt}
+\cals@withWidthII\defaultDimen{0pt}\iftrue
+ \PackageInfo{test}{fail}
+\else
+ \PackageInfo{test}{no width}
+\fi
+
+\cals@withWidthII\defaultDimen\relax\iftrue
+ \PackageInfo{test}{default width: \cals@width}
+\else
+ \PackageInfo{test}{fail}
+\fi
+
+\cals@withWidthII{0pt}\relax\iftrue
+ \PackageInfo{test}{fail}
+\else
+ \PackageInfo{test}{no width}
+\fi
+
+%
+% Bug hunting: a space
+%
+\def\cals@default@cs@width{4pt}
+\setbox0=\hbox{\hbox{}%
+\cals@withWidthII\cals@default@cs@width\relax\iftrue \fi}
+\showbox0
diff --git a/macros/latex/contrib/cals/test/decoration/test_20_withcolor2.chk b/macros/latex/contrib/cals/test/decoration/test_20_withcolor2.chk
new file mode 100644
index 0000000000..a959bc92cf
--- /dev/null
+++ b/macros/latex/contrib/cals/test/decoration/test_20_withcolor2.chk
@@ -0,0 +1,4 @@
+user color: blue
+(user) no color
+default color: black
+(default) no color
diff --git a/macros/latex/contrib/cals/test/decoration/test_20_withcolor2.tex b/macros/latex/contrib/cals/test/decoration/test_20_withcolor2.tex
new file mode 100644
index 0000000000..9bb4c78f4d
--- /dev/null
+++ b/macros/latex/contrib/cals/test/decoration/test_20_withcolor2.tex
@@ -0,0 +1,23 @@
+\cals@withColorII{black}{blue}\iftrue
+ \PackageInfo{test}{user color: \cals@color }
+\else
+ \PackageInfo{test}{fail}
+\fi
+
+\cals@withColorII{black}{}\iftrue
+ \PackageInfo{test}{fail}
+\else
+ \PackageInfo{test}{(user) no color}
+\fi
+
+\cals@withColorII{black}\relax\iftrue
+ \PackageInfo{test}{default color: \cals@color}
+\else
+ \PackageInfo{test}{fail}
+\fi
+
+\cals@withColorII{}\relax\iftrue
+ \PackageInfo{test}{fail}
+\else
+ \PackageInfo{test}{(default) no color}
+\fi
diff --git a/macros/latex/contrib/cals/test/decoration/test_30_halfwidth.chk b/macros/latex/contrib/cals/test/decoration/test_30_halfwidth.chk
new file mode 100644
index 0000000000..7f00f1944e
--- /dev/null
+++ b/macros/latex/contrib/cals/test/decoration/test_30_halfwidth.chk
@@ -0,0 +1,3 @@
+half of 200pt: 100.0pt
+half of 0pt: 0.0pt
+half of 100pt: 50.0pt
diff --git a/macros/latex/contrib/cals/test/decoration/test_30_halfwidth.tex b/macros/latex/contrib/cals/test/decoration/test_30_halfwidth.tex
new file mode 100644
index 0000000000..a9aee3cab4
--- /dev/null
+++ b/macros/latex/contrib/cals/test/decoration/test_30_halfwidth.tex
@@ -0,0 +1,9 @@
+\def\cals@width{200pt}
+\cals@halfWidthToDimen0 \cals@width
+\PackageInfo{test}{half of 200pt: \the\dimen0}
+
+\cals@halfWidthToDimen0 {0pt}
+\PackageInfo{test}{half of 0pt: \the\dimen0}
+
+\cals@halfWidthToDimen2{100pt}
+\PackageInfo{test}{half of 100pt: \the\dimen2}
diff --git a/macros/latex/contrib/cals/test/decoration/test_50_maxwidth.chk b/macros/latex/contrib/cals/test/decoration/test_50_maxwidth.chk
new file mode 100644
index 0000000000..33b32e6078
--- /dev/null
+++ b/macros/latex/contrib/cals/test/decoration/test_50_maxwidth.chk
@@ -0,0 +1,9 @@
+10pt vs relax: 10pt
+relax vs 20pt: 20pt
+relax vs relax: \cals@width
+30pt vs 40pt: 40pt
+60pt vs 50pt: 60pt
+70pt vs 70pt: 70pt
+regression, recursion avoid: 50pt
+regression, recursion avoid: 50pt
+regression, recursion avoid: 50pt
diff --git a/macros/latex/contrib/cals/test/decoration/test_50_maxwidth.tex b/macros/latex/contrib/cals/test/decoration/test_50_maxwidth.tex
new file mode 100644
index 0000000000..e3e899c1f8
--- /dev/null
+++ b/macros/latex/contrib/cals/test/decoration/test_50_maxwidth.tex
@@ -0,0 +1,28 @@
+\cals@maxWidth{10pt}\relax
+\PackageInfo{test}{10pt vs relax: \cals@width}
+
+\cals@maxWidth\relax{20pt}
+\PackageInfo{test}{relax vs 20pt: \cals@width}
+
+\cals@maxWidth\relax\relax
+\PackageInfo{test}{relax vs relax: \cals@width}
+
+\cals@maxWidth{30pt}{40pt}
+\PackageInfo{test}{30pt vs 40pt: \cals@width}
+
+\cals@maxWidth{60pt}{50pt}
+\PackageInfo{test}{60pt vs 50pt: \cals@width}
+
+\cals@maxWidth{70pt}{70pt}
+\PackageInfo{test}{70pt vs 70pt: \cals@width}
+
+%
+% Regression test: avoid recursion
+%
+\def\cals@width{50pt}
+\cals@maxWidth{10pt}\cals@width
+\PackageInfo{test}{regression, recursion avoid: \cals@width}
+\cals@maxWidth\cals@width{10pt}
+\PackageInfo{test}{regression, recursion avoid: \cals@width}
+\cals@maxWidth\cals@width\cals@width
+\PackageInfo{test}{regression, recursion avoid: \cals@width}
diff --git a/macros/latex/contrib/cals/test/decoration/test_60_row.chk b/macros/latex/contrib/cals/test/decoration/test_60_row.chk
new file mode 100644
index 0000000000..6c96c188b8
--- /dev/null
+++ b/macros/latex/contrib/cals/test/decoration/test_60_row.chk
@@ -0,0 +1,54 @@
+%
+% Empty row
+%
+> \boxXX=
+\hbox(0.0+0.0)x0.0
+> \cals@current@rs@above=macro:
+->.
+> \cals@current@rs@below=macro:
+->.
+%
+% One cell
+%
+> \boxXX=
+\hbox(0.0+0.0)x100.0
+.\glue 100.0
+> \cals@current@rs@above=macro:
+->{{100pt}{0pt}{0pt}\relax }.
+> \cals@current@rs@below=macro:
+->{{100pt}{0pt}{0pt}\relax }.
+%
+% Two cells, no overrides
+%
+> \boxXX=
+\hbox(0.0+0.0)x300.0
+.\glue 100.0
+.\glue -1.0
+.\rule(*+0.0)x2.0
+.\glue -1.0
+.\glue 200.0
+> \cals@current@rs@above=macro:
+->{{100pt}{0pt}{2pt}\relax }{{200pt}{2pt}{0pt}\relax }.
+> \cals@current@rs@below=macro:
+->{{100pt}{0pt}{2pt}\relax }{{200pt}{2pt}{0pt}\relax }.
+%
+% Two cells, no overrides
+%
+> \boxXX=
+\hbox(0.0+0.0)x300.0
+.\pdfcolorstack 0 push {0 1 0 rg 0 1 0 RG}
+.\rule(*+0.0)x100.0
+.\pdfcolorstack 0 pop
+.\glue -100.0
+.\glue -2.0
+.\rule(*+0.0)x4.0
+.\glue -2.0
+.\glue 100.0
+.\glue -3.0
+.\rule(*+0.0)x6.0
+.\glue -3.0
+.\glue 200.0
+> \cals@current@rs@above=macro:
+->{{100pt}{4pt}{6pt}\relax }{{200pt}{6pt}{0pt}{8pt}}.
+> \cals@current@rs@below=macro:
+->{{100pt}{4pt}{6pt}\relax }{{200pt}{6pt}{0pt}{10pt}}.
diff --git a/macros/latex/contrib/cals/test/decoration/test_60_row.tex b/macros/latex/contrib/cals/test/decoration/test_60_row.tex
new file mode 100644
index 0000000000..0ee4395383
--- /dev/null
+++ b/macros/latex/contrib/cals/test/decoration/test_60_row.tex
@@ -0,0 +1,65 @@
+\def\contentI{\noindent\vrule height10pt depth0pt width30pt\hfil}
+\def\contentII{\noindent\vrule height20pt depth2pt width60pt\hfil}
+
+\def\cals@cs@width{2pt}
+\def\cals@framecs@width{0pt}
+\def\cals@bgcolor{}
+
+\def\wC{100pt}
+\def\wCC{200pt}
+
+%
+% Empty row
+%
+\cals@decor@begin
+\cals@decor@end
+\showbox\cals@current@cs
+\show\cals@current@rs@above
+\show\cals@current@rs@below
+
+%
+% One cell, no overrides
+%
+\cals@decor@begin
+\let\cals@borderL=\relax
+\let\cals@borderR=\relax
+\let\cals@borderT=\relax
+\let\cals@borderB=\relax
+\def\cals@bgcolor{}
+\cals@decor@next\wC{\contentI}
+\cals@decor@end
+\showbox\cals@current@cs
+\show\cals@current@rs@above
+\show\cals@current@rs@below
+
+%
+% Two cells, no overrides
+%
+\cals@decor@begin
+\cals@decor@next\wC{\contentI}
+\cals@decor@next\wCC{\contentII}
+\cals@decor@end
+\showbox\cals@current@cs
+\show\cals@current@rs@above
+\show\cals@current@rs@below
+
+%
+% Two cells, overrides
+%
+\cals@decor@begin
+\def\cals@borderL{4pt}
+\def\cals@borderR{6pt}
+\let\cals@borderT=\relax
+\let\cals@borderB=\relax
+\def\cals@bgcolor{green}
+\cals@decor@next\wC{\contentI}
+\let\cals@borderL=\relax
+\let\cals@borderR=\relax
+\def\cals@borderT{8pt}
+\def\cals@borderB{10pt}
+\def\cals@bgcolor{}
+\cals@decor@next\wCC{\contentII}
+\cals@decor@end
+\showbox\cals@current@cs
+\show\cals@current@rs@above
+\show\cals@current@rs@below
diff --git a/macros/latex/contrib/cals/test/decoration/test_70_align.chk b/macros/latex/contrib/cals/test/decoration/test_70_align.chk
new file mode 100644
index 0000000000..7213fce686
--- /dev/null
+++ b/macros/latex/contrib/cals/test/decoration/test_70_align.chk
@@ -0,0 +1,8 @@
+> 2.0pt plus 1.0fill.
+> 4.0pt plus 1.0fill.
+%
+> 2.0pt plus 1.0fill.
+> 4.0pt.
+%
+> 2.0pt.
+> 4.0pt.
diff --git a/macros/latex/contrib/cals/test/decoration/test_70_align.tex b/macros/latex/contrib/cals/test/decoration/test_70_align.tex
new file mode 100644
index 0000000000..a34b3058e3
--- /dev/null
+++ b/macros/latex/contrib/cals/test/decoration/test_70_align.tex
@@ -0,0 +1,15 @@
+\cals@paddingL=2pt \relax
+\cals@paddingR=4pt \relax
+
+
+\alignC
+\showthe\cals@paddingL
+\showthe\cals@paddingR
+
+\alignR
+\showthe\cals@paddingL
+\showthe\cals@paddingR
+
+\alignL
+\showthe\cals@paddingL
+\showthe\cals@paddingR