Implement native PDF links and vertical discard lists

This commit is contained in:
gloamxun committed 2026-11-18 23:39:45 +08:00
1 parent b6567f67e2
commit a53d9c9bf9
29 files changed
+980 -109

No files matched your search

@@ -77,6 +77,35 @@ fn quantity_scopes_aliases_state_reads_and_snapshot_restore() {
assert_eq!(messages(&e), ["0.0pt"]);
}
#[test]
fn shorthand_definition_binds_relax_during_the_operand_scan() {
let source = include_str!("fixtures/shorthand/self-referencing.tex");
let native = run(source);
let directory = std::env::temp_dir().join(format!("texrra-shorthand-{}", std::process::id()));
fs::create_dir_all(&directory).unwrap();
fs::write(directory.join("probe.tex"), source).unwrap();
let output = Command::new("pdftex")
.args([
"-ini",
"-etex",
"-interaction=nonstopmode",
"-halt-on-error",
"probe.tex",
])
.current_dir(&directory)
.output()
.unwrap();
let reference = fs::read_to_string(directory.join("probe.log")).unwrap();
assert!(output.status.success(), "{reference}");
let expected: Vec<_> = reference
.match_indices("SHORTHAND-")
.map(|(start, _)| reference[start..].split_inclusive(']').next().unwrap())
.collect();
assert_eq!(expected.len(), 6, "{reference}");
assert_eq!(messages(&native), expected);
fs::remove_dir_all(directory).unwrap();
}
#[test]
fn invalid_quantities_overflows_units_and_readonly_positions_fail() {
let relative = run(r"\dimen0=1em");