summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/typ/code/let.typ1
-rw-r--r--tests/typeset.rs12
2 files changed, 11 insertions, 2 deletions
diff --git a/tests/typ/code/let.typ b/tests/typ/code/let.typ
index a95d651a..d4765ea5 100644
--- a/tests/typ/code/let.typ
+++ b/tests/typ/code/let.typ
@@ -59,6 +59,7 @@ Three
// Error: 18 expected expression
// Error: 18 expected closing paren
#let v5 = (1, 2 + ; Five
+ ^^^^^ + \r\n
---
// Error: 13 expected body
diff --git a/tests/typeset.rs b/tests/typeset.rs
index f23de5cd..aa3bcf9d 100644
--- a/tests/typeset.rs
+++ b/tests/typeset.rs
@@ -412,6 +412,15 @@ fn test_reparse(src: &str, i: usize, rng: &mut LinearShift) -> bool {
let apply = |replace: std::ops::Range<usize>, with| {
let mut incr_source = SourceFile::detached(src);
+ if incr_source.root().len() != src.len() {
+ println!(
+ " Subtest {} tree length {} does not match string length {} ❌",
+ i,
+ incr_source.root().len(),
+ src.len(),
+ );
+ return false;
+ }
incr_source.edit(replace.clone(), with);
let edited_src = incr_source.src();
@@ -428,7 +437,7 @@ fn test_reparse(src: &str, i: usize, rng: &mut LinearShift) -> bool {
"\n Expected reference tree:\n{:#?}\n\n Found incremental tree:\n{:#?}",
ref_root, incr_root
);
- println!("Full source ({}):\n\"{}\"", edited_src.len(), edited_src);
+ println!("Full source ({}):\n\"{:?}\"", edited_src.len(), edited_src);
false
} else {
true
@@ -454,7 +463,6 @@ fn test_reparse(src: &str, i: usize, rng: &mut LinearShift) -> bool {
if !apply(start .. end, supplement) {
println!("original tree: {:#?}", SourceFile::detached(src).root());
-
ok = false;
}
}