fix(test): running test as root (#1817)

* fix(test): running test as root

The dummy root path /root conflicts with root user's home directory on Linux and redacts incorrectly. Our downstream CI environment builds tinymist in docker as root and encounters the problem. Change the path to `/dummy-root` fixes it. To ensure consistency, other similar occurences are also prefixed with `dummy-`.

* dev: deduplicate a bit

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
This commit is contained in:
Eric Long 2025-06-16 13:01:25 +08:00 committed by GitHub
parent c0d5f0c800
commit 9d9d360db9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 32 additions and 40 deletions

View file

@ -52,9 +52,9 @@ pub fn run_with_sources<T>(source: &str, f: impl FnOnce(&mut LspUniverse, PathBu
});
let root = if cfg!(windows) {
PathBuf::from("C:\\root")
PathBuf::from("C:\\dummy-root")
} else {
PathBuf::from("/root")
PathBuf::from("/dummy-root")
};
let mut verse = LspUniverseBuilder::build(
EntryState::new_rooted(root.as_path().into(), None),