From 16ac3f3ebc49c5a6e3f61d8546f2f187b191c346 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Tue, 26 Jan 2021 13:49:04 +0100 Subject: =?UTF-8?q?Small=20improvements=20=E2=99=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/lang/typ/if.typ | 4 ++-- tests/lang/typ/let.typ | 6 +++++- tests/typeset.rs | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/lang/typ/if.typ b/tests/lang/typ/if.typ index 5f4c986a..f7de7716 100644 --- a/tests/lang/typ/if.typ +++ b/tests/lang/typ/if.typ @@ -18,7 +18,7 @@ "Fi" + "ve" } -// Spacing is somewhat delicated. We only want to have spacing in the output if +// Spacing is somewhat delicate. We only want to have spacing in the output if // there was whitespace before/after the full if-else statement. In particular, // spacing after a simple if should be retained, but spacing between the first // body and the else should be ignored. @@ -53,7 +53,7 @@ a#if true {} a#if true [b] #else c // Lone else. -// Error: 2:1-2:6 unexpected else keyword +// Error: 2:1-2:6 unexpected keyword `else` // Error: 1:8-1:8 expected function name #else [] diff --git a/tests/lang/typ/let.typ b/tests/lang/typ/let.typ index 7e9246bb..b3eadeaa 100644 --- a/tests/lang/typ/let.typ +++ b/tests/lang/typ/let.typ @@ -28,11 +28,15 @@ // Error: 1:6-1:7 expected identifier, found integer #let 1 = 2 -// Terminated by end of line before binding name. +// Missing binding name. // Error: 1:5-1:5 expected identifier #let x = 5 +// Missing right-hand side. +// Error: 1:9-1:9 expected expression +#let a = + // No name at all. // Error: 1:11-1:11 expected identifier The Fi#let;rst diff --git a/tests/typeset.rs b/tests/typeset.rs index dbcb6517..620e11a6 100644 --- a/tests/typeset.rs +++ b/tests/typeset.rs @@ -254,7 +254,7 @@ fn parse_metadata(src: &str, map: &LineMap) -> (bool, SpanVec) { let pos = |s: &mut Scanner| -> Pos { let (delta, _, column) = (num(s), s.eat_assert(':'), num(s)); let line = i as u32 + 1 + delta; - map.pos(Location { line, column }).unwrap() + map.pos(Location::new(line, column)).unwrap() }; let mut s = Scanner::new(rest); -- cgit v1.2.3