Honor e-TeX split shrink masks on native vertical lists
This commit is contained in:
1 parent
69efe0b895
commit
34325317d2
11 files changed
+187
-28
No files matched your search
@@ -204,6 +204,44 @@ fn local_trace_switches_channels_and_disabled_diagnostics_preserve_actual_pages(
|
||||
);
|
||||
fs::remove_dir_all(p).unwrap();
|
||||
}
|
||||
#[test]
|
||||
fn ignored_insertion_shrink_is_log_only_and_follows_page_observation_order() {
|
||||
let s = r"\catcode123=1 \catcode125=2
|
||||
\tracingpages=1 \tracingonline=1 \ignoreprimitiveerror=1
|
||||
\vsize=60pt \topskip=0pt \maxdepth=0pt
|
||||
\splittopskip=0pt \splitmaxdepth=0pt
|
||||
\count1=1000 \dimen1=25pt \skip1=0pt
|
||||
\output={\shipout\vbox{\unvbox255\ifvoid1\else\box1\fi}}
|
||||
\hrule height4pt width8pt
|
||||
\insert1{\hrule height8pt width8pt \vskip2pt minus1fil
|
||||
\hrule height8pt width8pt \vskip4pt minus2fill
|
||||
\hrule height8pt width8pt}
|
||||
\penalty-10000 \end";
|
||||
let mut host = Host::default();
|
||||
native(s, &mut host).unwrap();
|
||||
let records: Vec<_> = host
|
||||
.lines
|
||||
.iter()
|
||||
.map(|(destination, text)| (*destination, text.trim()))
|
||||
.filter(|(_, text)| {
|
||||
text.starts_with("%% goal height=")
|
||||
|| text.starts_with("ignored:")
|
||||
|| text.starts_with("% split")
|
||||
})
|
||||
.collect();
|
||||
const IGNORED: &str = "ignored: Infinite glue shrinkage found in box being split";
|
||||
assert_eq!(
|
||||
records,
|
||||
[
|
||||
(WriteDestination::TerminalAndLog, "%% goal height=60.0, max depth=0.0"),
|
||||
(WriteDestination::Log, IGNORED),
|
||||
(WriteDestination::Log, IGNORED),
|
||||
(WriteDestination::TerminalAndLog, "% split1 to 25.0,18.0 p=0"),
|
||||
(WriteDestination::TerminalAndLog, "%% goal height=60.0, max depth=0.0"),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn page_diagnostic_sink_failures_and_capacity_errors_do_not_become_success() {
|
||||
let s = format!(r"{HEADER}\vsize=20pt\tracingpages=1\copy0\vskip2pt\copy0\end");
|
||||
|
||||
@@ -162,6 +162,26 @@ fn legal_breaks_costs_ties_and_forced_stops_match_actual_initex() {
|
||||
compare(&cases);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn ignored_split_shrink_changes_only_glue_visited_by_vertical_break() {
|
||||
let cases = [
|
||||
format!(
|
||||
r"\ignoreprimitiveerror=3\splittopskip=0pt\splitmaxdepth=0pt\setbox1=\vbox{{\hrule width8pt height8pt\marks3{{FIRST}}\vskip2pt minus1fil\hrule width8pt height8pt\leaders\hrule width4pt height1pt\vskip4pt minus2fill\marks3{{LAST}}\hrule width8pt height8pt}}\setbox0=\vsplit1 to29pt{}",
|
||||
observe(r"MASK:\the\ignoreprimitiveerror/\splitfirstmarks3/\splitbotmarks3")
|
||||
),
|
||||
r"\ignoreprimitiveerror=1\setbox1=\vbox{\baselineskip=12pt minus1fil\hbox{A}\hbox{B}}\setbox0=\vsplit1 to18pt".into(),
|
||||
r"\ignoreprimitiveerror=2\splittopskip=0pt\setbox1=\vbox{\hrule width8pt height8pt\penalty-10000\hrule width8pt height8pt\vskip4pt minus2fill\hrule width8pt height8pt}\setbox0=\vsplit1 to8pt".into(),
|
||||
];
|
||||
let execution = compare(&cases);
|
||||
assert!(execution
|
||||
.reads
|
||||
.contains(&Dependency::Parameter(Parameter::Ignoreprimitiveerror)));
|
||||
assert_eq!(
|
||||
execution.state.parameter(Parameter::Ignoreprimitiveerror).width(),
|
||||
0
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn split_marks_are_global_expanded_tokens_per_class_and_clear_on_void() {
|
||||
let mut cases = Vec::new();
|
||||
@@ -282,6 +302,7 @@ fn invalid_split_modes_classes_glue_and_real_capacity_fail_explicitly() {
|
||||
r"\marks32768{A}",
|
||||
r"\message{\splitfirstmarks32768}",
|
||||
r"\setbox1=\vbox{\hbox{A}\vskip0pt minus1fil\hbox{B}}\setbox0=\vsplit1 to100pt",
|
||||
r"\ignoreprimitiveerror=2\setbox1=\vbox{\hbox{A}\vskip0pt minus1fil\hbox{B}}\setbox0=\vsplit1 to100pt",
|
||||
r"\setbox1=\vbox{\hbox{A}}$a^\vsplit1 to5pt$",
|
||||
r"\hbox{\discretionary{\mark{A}}{}{}}",
|
||||
r"\hbox{\discretionary{}{\marks1{B}}{}}",
|
||||
|
||||
Reference in new issue
Block a user