Share scanned source storage across native publications

This commit is contained in:
gloamxun committed 2026-11-28 23:25:29 +08:00
1 parent c09d545da6
commit d6ab5a025f
6 files changed
+46 -10

No files matched your search

+11
View File
@@ -1754,6 +1754,17 @@ fn generated_input_change_uses_a_checkpoint_before_the_read() {
assert_eq!(updated.source_map.sources, full.source_map.sources);
assert_eq!(updated.source_map.pages, full.source_map.pages);
assert!(updated.execution.execution == full.execution.execution);
let aux_source = |result: &CompiledDocument| {
let (id, source) = result.execution.execution.sources.iter().enumerate()
.find(|(_, source)| Path::new(&source.name) == aux).unwrap();
(source.clone(), result.execution.source_versions[id].clone())
};
let (old_source, old_version) = aux_source(&original);
let (current_source, current_version) = aux_source(&updated);
assert!(!Arc::ptr_eq(&old_source, &current_source));
assert_eq!(old_source.data, b"\\def\\widthfromaux{11}\n");
assert_eq!(current_source.data, b"\\def\\widthfromaux{22}\n");
assert_ne!(old_version, current_version);
assert_eq!(fs::read(&aux).unwrap(), b"\\def\\widthfromaux{22}\n");
}