diff options
| author | Laurenz <laurmaedje@gmail.com> | 2020-07-29 18:09:51 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2020-07-29 18:09:51 +0200 |
| commit | bbcdeb128cce04cd95714b7bc7af5a23a7e38bd2 (patch) | |
| tree | e0a1620d335982669cd7671cbd71df46d100e9ea /tests/src | |
| parent | f34ba3dcda182d9b9c14cc94fdb48810bf18bef0 (diff) | |
Move, rename and switch some things (boring) 🚚
- Problems -> Diagnostics
- Position -> Pos
- offset_spans -> Offset trait
- Size -> Length (and some more size types renamed)
- Paper into its own module
- scope::Parser -> parsing::CallParser
- Create `Decorations` alias
- Remove lots of double newlines
- Switch from f32 to f64
Diffstat (limited to 'tests/src')
| -rw-r--r-- | tests/src/typeset.rs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/src/typeset.rs b/tests/src/typeset.rs index 8a4cf828..2126615e 100644 --- a/tests/src/typeset.rs +++ b/tests/src/typeset.rs @@ -12,13 +12,13 @@ use futures_executor::block_on; use typstc::{Typesetter, DebugErrorProvider}; use typstc::layout::MultiLayout; -use typstc::size::{Size, Size2D, ValueBox}; -use typstc::style::{PageStyle, PaperClass}; +use typstc::length::{Length, Size, Value4}; +use typstc::style::PageStyle; +use typstc::paper::PaperClass; use typstc::export::pdf; use toddle::query::FontIndex; use toddle::query::fs::EagerFsProvider; - type DynResult<T> = Result<T, Box<dyn Error>>; fn main() -> DynResult<()> { @@ -72,8 +72,8 @@ fn test(name: &str, src: &str) -> DynResult<()> { typesetter.set_page_style(PageStyle { class: PaperClass::Custom, - dimensions: Size2D::with_all(Size::pt(250.0)), - margins: ValueBox::with_all(None), + dimensions: Size::with_all(Length::pt(250.0)), + margins: Value4::with_all(None), }); let layouts = compile(&typesetter, src); @@ -123,14 +123,14 @@ fn test(name: &str, src: &str) -> DynResult<()> { fn compile(typesetter: &Typesetter, src: &str) -> MultiLayout { if cfg!(debug_assertions) { let typeset = block_on(typesetter.typeset(src)); - let problems = typeset.feedback.problems; + let diagnostics = typeset.feedback.diagnostics; - if !problems.is_empty() { - for problem in problems { + if !diagnostics.is_empty() { + for diagnostic in diagnostics { println!(" {:?} {:?}: {}", - problem.v.severity, - problem.span, - problem.v.message + diagnostic.v.level, + diagnostic.span, + diagnostic.v.message ); } } |
