Share packed box diagnostics across native execution
This commit is contained in:
1 parent
526ec9b3b0
commit
ca3730338e
13 files changed
+126
-22
No files matched your search
@@ -306,6 +306,44 @@ fn local_switches_failures_sink_errors_and_unknown_host_metrics_are_not_silenced
|
||||
fs::remove_dir_all(p).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn nested_box_views_share_diagnostic_storage_at_the_node_limit() {
|
||||
let p = directory();
|
||||
let material = r"\kern1sp ".repeat(96);
|
||||
let wrapping = r"\setbox0=\hbox{\box0}".repeat(16);
|
||||
let source = format!(r"{HEADER}\setbox0=\hbox{{{material}}}{wrapping}\shipout\box0\end");
|
||||
let mut files = Files::new(&p);
|
||||
let execution = Executor::new(
|
||||
State::initex().with_etex(),
|
||||
Limits {
|
||||
tokens: 1024,
|
||||
..Limits::default()
|
||||
},
|
||||
)
|
||||
.with_native_pages()
|
||||
.run(
|
||||
SourceFile {
|
||||
name: "probe.tex".into(),
|
||||
data: source.into_bytes(),
|
||||
},
|
||||
&mut files,
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
let boxes = execution
|
||||
.events
|
||||
.iter()
|
||||
.filter_map(|event| match event {
|
||||
Event::Shipout(page) => Some(&page.box_node),
|
||||
_ => None,
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
assert_eq!(boxes.len(), 1);
|
||||
assert_eq!(boxes[0].width, 96);
|
||||
assert_eq!(boxes[0].node_count(), 129);
|
||||
fs::remove_dir_all(p).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn statistics_observe_real_paragraph_math_output_and_language_data_without_rewriting_lists() {
|
||||
let p = directory();
|
||||
|
||||
Reference in new issue
Block a user