summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-07-18 20:11:31 +0200
committerLaurenz <laurmaedje@gmail.com>2023-07-18 21:04:46 +0200
commitf5953887c9ae0b40a0c3e0ab516daf425c5a598c (patch)
treeb517ca68517e49bdf458bfa92036a8ff855c72f6 /tests
parent7dc605307cf7d69a3476b8b6fc4786f683c3289b (diff)
Extract syntax module into typst-syntax crate
Diffstat (limited to 'tests')
-rw-r--r--tests/src/benches.rs3
-rw-r--r--tests/src/tests.rs5
2 files changed, 3 insertions, 5 deletions
diff --git a/tests/src/benches.rs b/tests/src/benches.rs
index 9ee7a2f3..8e70ffd7 100644
--- a/tests/src/benches.rs
+++ b/tests/src/benches.rs
@@ -2,10 +2,9 @@ use comemo::{Prehashed, Track, Tracked};
use iai::{black_box, main, Iai};
use typst::diag::FileResult;
use typst::eval::{Datetime, Library};
-use typst::file::FileId;
use typst::font::{Font, FontBook};
use typst::geom::Color;
-use typst::syntax::Source;
+use typst::syntax::{FileId, Source};
use typst::util::Bytes;
use typst::World;
use unscanny::Scanner;
diff --git a/tests/src/tests.rs b/tests/src/tests.rs
index b2a87a5c..ee9ae9f9 100644
--- a/tests/src/tests.rs
+++ b/tests/src/tests.rs
@@ -17,7 +17,6 @@ use oxipng::{InFile, Options, OutFile};
use rayon::iter::{ParallelBridge, ParallelIterator};
use std::cell::OnceCell;
use tiny_skia as sk;
-use typst::file::FileId;
use unscanny::Scanner;
use walkdir::WalkDir;
@@ -26,7 +25,7 @@ use typst::doc::{Document, Frame, FrameItem, Meta};
use typst::eval::{eco_format, func, Datetime, Library, NoneValue, Value};
use typst::font::{Font, FontBook};
use typst::geom::{Abs, Color, RgbaColor, Smart};
-use typst::syntax::{Source, Span, SyntaxNode};
+use typst::syntax::{FileId, Source, Span, SyntaxNode};
use typst::util::{Bytes, PathExt};
use typst::World;
use typst_library::layout::{Margin, PageElem};
@@ -541,7 +540,7 @@ fn test_part(
.inspect(|error| assert!(!error.span.is_detached()))
.filter(|error| error.span.id() == source.id())
.flat_map(|error| {
- let range = error.span.range(world);
+ let range = world.range(error.span);
let output_error =
UserOutput::Error(range.clone(), error.message.replace('\\', "/"));
let hints = error