Skip to content

Commit 7d5b7c1

Browse files
authored
Merge pull request #259 from Muscraft/cleanup-old-test
test: Make issue_9 more closely match its original output
2 parents d6c6bbd + 3dd4ba6 commit 7d5b7c1

File tree

2 files changed

+22
-28
lines changed

2 files changed

+22
-28
lines changed

tests/color/issue_9.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@ use snapbox::{assert_data_eq, file};
44

55
#[test]
66
fn case() {
7+
let source = r#"let x = vec![1];
8+
9+
10+
let y = x;
11+
12+
x;
13+
"#;
14+
715
let input = &[Group::with_title(Level::ERROR.title("expected one of `.`, `;`, `?`, or an operator, found `for`"))
816
.element(
9-
Snippet::source("let x = vec![1];")
17+
Snippet::source(source)
1018
.path("/code/rust/src/test/ui/annotate-snippet/suggestion.rs")
1119
.line_start(4)
1220
.annotation(AnnotationKind::Context.span(4..5).label("move occurs because `x` has type `std::vec::Vec<i32>`, which does not implement the `Copy` trait"))
13-
)
14-
.element(
15-
Snippet::source("let y = x;")
16-
.line_start(7)
17-
.annotation(AnnotationKind::Context.span(8..9).label("value moved here"))
18-
)
19-
.element(
20-
Snippet::source("x;")
21-
.line_start(9)
22-
.annotation(AnnotationKind::Primary.span(0..1).label("value used here after move"))
21+
.annotation(AnnotationKind::Context.span(27..28).label("value moved here"))
22+
.annotation(AnnotationKind::Primary.span(31..32).label("value used here after move"))
2323
)
2424
];
2525
let expected = file!["issue_9.term.svg"];

tests/color/issue_9.term.svg

Lines changed: 11 additions & 17 deletions
Loading

0 commit comments

Comments
 (0)