diff --git a/tests/src/collect.rs b/tests/src/collect.rs index 0745bb36a..97f168b34 100644 --- a/tests/src/collect.rs +++ b/tests/src/collect.rs @@ -12,8 +12,6 @@ use typst_syntax::{ }; use unscanny::Scanner; -use crate::world::{read, system_path}; - /// Collects all tests from all files. /// /// Returns: @@ -390,9 +388,17 @@ impl<'a> Parser<'a> { }) } + #[cfg(not(feature = "default"))] + fn parse_range_external(&mut self, _file: FileId) -> Option> { + panic!("external file ranges are not expected when testing `typst_syntax`"); + } + /// Parse a range in an external file, optionally abbreviated as just a position /// if the range is empty. + #[cfg(feature = "default")] fn parse_range_external(&mut self, file: FileId) -> Option> { + use crate::world::{read, system_path}; + let path = match system_path(file) { Ok(path) => path, Err(err) => {