Resolve ordinary leaves under verified project parents directly

This commit is contained in:
gloamxun committed 2026-12-02 04:59:17 +08:00
1 parent 7164b1915a
commit 128f0681f6
2 files changed
+69 -14

No files matched your search

@@ -247,6 +247,9 @@ fn directory_aliases_parent_components_and_unknown_universe_follow_declared_name
file(&mut d, p.join("real/parent.tex"), b"RIGHT");
file(&mut d, p.join("parent.tex"), b"WRONG");
d.aliases.insert(p.join("link"), "real/child".into());
#[cfg(unix)]
d.aliases
.insert(p.join("file-alias.tex"), "real/parent.tex".into());
d.aliases
.insert(p.join("file-dot"), "real/parent.tex/.".into());
d.aliases
@@ -285,6 +288,28 @@ fn directory_aliases_parent_components_and_unknown_universe_follow_declared_name
w.read(ResourceKind::Tex, "./real/parent.tex/", &p.join("main.tex"))
.is_err()
);
#[cfg(unix)]
{
let canonical = p.join("real/parent.tex");
for spelling in [
"real/parent.tex",
"real//parent.tex",
"real/./parent.tex",
"file-alias.tex",
] {
let raw = p.join(spelling);
let resource = w
.read(ResourceKind::Tex, raw.to_str().unwrap(), &p.join("main.tex"))
.unwrap();
assert_eq!(resource.data, b"RIGHT");
let lookup = w.trace().lookups.last().unwrap();
assert_eq!(lookup.candidates[0].as_os_str(), raw.as_os_str());
assert_eq!(
lookup.resolved.as_deref().unwrap().as_os_str(),
canonical.as_os_str()
);
}
}
for name in ["./real/parent.tex/.", "file-dot", "file-slash"] {
assert!(
w.read(ResourceKind::Tex, name, &p.join("main.tex"))