From 3dd4ba67bfbd8b9965e4575f2fa108883f4b9f2e Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Thu, 31 Jul 2025 10:05:55 -0600 Subject: [PATCH] test: Make issue_9 more closely match its original output --- tests/color/issue_9.rs | 22 +++++++++++----------- tests/color/issue_9.term.svg | 28 +++++++++++----------------- 2 files changed, 22 insertions(+), 28 deletions(-) diff --git a/tests/color/issue_9.rs b/tests/color/issue_9.rs index 0ac5d4d..162a9c4 100644 --- a/tests/color/issue_9.rs +++ b/tests/color/issue_9.rs @@ -4,22 +4,22 @@ use snapbox::{assert_data_eq, file}; #[test] fn case() { + let source = r#"let x = vec![1]; + + +let y = x; + +x; +"#; + let input = &[Group::with_title(Level::ERROR.title("expected one of `.`, `;`, `?`, or an operator, found `for`")) .element( - Snippet::source("let x = vec![1];") + Snippet::source(source) .path("/code/rust/src/test/ui/annotate-snippet/suggestion.rs") .line_start(4) .annotation(AnnotationKind::Context.span(4..5).label("move occurs because `x` has type `std::vec::Vec`, which does not implement the `Copy` trait")) - ) - .element( - Snippet::source("let y = x;") - .line_start(7) - .annotation(AnnotationKind::Context.span(8..9).label("value moved here")) - ) - .element( - Snippet::source("x;") - .line_start(9) - .annotation(AnnotationKind::Primary.span(0..1).label("value used here after move")) + .annotation(AnnotationKind::Context.span(27..28).label("value moved here")) + .annotation(AnnotationKind::Primary.span(31..32).label("value used here after move")) ) ]; let expected = file!["issue_9.term.svg"]; diff --git a/tests/color/issue_9.term.svg b/tests/color/issue_9.term.svg index da58ee8..7e094b1 100644 --- a/tests/color/issue_9.term.svg +++ b/tests/color/issue_9.term.svg @@ -1,4 +1,4 @@ - +