From 4cb04fd41c92e5b63ddbbb5f55f82a48a8140c5d Mon Sep 17 00:00:00 2001 From: Tobias Schmitz Date: Tue, 20 May 2025 15:46:13 +0200 Subject: [PATCH] test: hack to support compiling with --no-default-features --- tests/src/collect.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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) => {