From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- .../fixtures/no-color/multiline_annotation.toml | 40 ++++++++++++++++++++++ .../fixtures/no-color/multiline_annotation.txt | 14 ++++++++ .../fixtures/no-color/multiline_annotation2.toml | 18 ++++++++++ .../fixtures/no-color/multiline_annotation2.txt | 9 +++++ .../fixtures/no-color/multiline_annotation3.toml | 18 ++++++++++ .../fixtures/no-color/multiline_annotation3.txt | 9 +++++ .../fixtures/no-color/multiple_annotations.toml | 25 ++++++++++++++ .../fixtures/no-color/multiple_annotations.txt | 14 ++++++++ .../tests/fixtures/no-color/simple.toml | 18 ++++++++++ .../tests/fixtures/no-color/simple.txt | 9 +++++ 10 files changed, 174 insertions(+) create mode 100644 vendor/annotate-snippets-0.8.0/tests/fixtures/no-color/multiline_annotation.toml create mode 100644 vendor/annotate-snippets-0.8.0/tests/fixtures/no-color/multiline_annotation.txt create mode 100644 vendor/annotate-snippets-0.8.0/tests/fixtures/no-color/multiline_annotation2.toml create mode 100644 vendor/annotate-snippets-0.8.0/tests/fixtures/no-color/multiline_annotation2.txt create mode 100644 vendor/annotate-snippets-0.8.0/tests/fixtures/no-color/multiline_annotation3.toml create mode 100644 vendor/annotate-snippets-0.8.0/tests/fixtures/no-color/multiline_annotation3.txt create mode 100644 vendor/annotate-snippets-0.8.0/tests/fixtures/no-color/multiple_annotations.toml create mode 100644 vendor/annotate-snippets-0.8.0/tests/fixtures/no-color/multiple_annotations.txt create mode 100644 vendor/annotate-snippets-0.8.0/tests/fixtures/no-color/simple.toml create mode 100644 vendor/annotate-snippets-0.8.0/tests/fixtures/no-color/simple.txt (limited to 'vendor/annotate-snippets-0.8.0/tests/fixtures/no-color') diff --git a/vendor/annotate-snippets-0.8.0/tests/fixtures/no-color/multiline_annotation.toml b/vendor/annotate-snippets-0.8.0/tests/fixtures/no-color/multiline_annotation.toml new file mode 100644 index 000000000..bdb577f46 --- /dev/null +++ b/vendor/annotate-snippets-0.8.0/tests/fixtures/no-color/multiline_annotation.toml @@ -0,0 +1,40 @@ +[[slices]] +source = """ +) -> Option { + for ann in annotations { + match (ann.range.0, ann.range.1) { + (None, None) => continue, + (Some(start), Some(end)) if start > end_index || end < start_index => continue, + (Some(start), Some(end)) if start >= start_index && end <= end_index => { + let label = if let Some(ref label) = ann.label { + format!(" {}", label) + } else { + String::from("") + }; + + return Some(format!( + "{}{}{}", + " ".repeat(start - start_index), + "^".repeat(end - start), + label + )); + } + _ => continue, + } + } +""" +line_start = 51 +origin = "src/format.rs" +fold = true +[[slices.annotations]] +label = "expected `std::option::Option` because of return type" +annotation_type = "Warning" +range = [5, 19] +[[slices.annotations]] +label = "expected enum `std::option::Option`, found ()" +annotation_type = "Error" +range = [22, 765] +[title] +label = "mismatched types" +id = "E0308" +annotation_type = "Error" diff --git a/vendor/annotate-snippets-0.8.0/tests/fixtures/no-color/multiline_annotation.txt b/vendor/annotate-snippets-0.8.0/tests/fixtures/no-color/multiline_annotation.txt new file mode 100644 index 000000000..bacdec10d --- /dev/null +++ b/vendor/annotate-snippets-0.8.0/tests/fixtures/no-color/multiline_annotation.txt @@ -0,0 +1,14 @@ +error[E0308]: mismatched types + --> src/format.rs:51:6 + | +51 | ) -> Option { + | -------------- expected `std::option::Option` because of return type +52 | / for ann in annotations { +53 | | match (ann.range.0, ann.range.1) { +54 | | (None, None) => continue, +55 | | (Some(start), Some(end)) if start > end_index || end < start_index => continue, +... | +71 | | } +72 | | } + | |_____^ expected enum `std::option::Option`, found () + | diff --git a/vendor/annotate-snippets-0.8.0/tests/fixtures/no-color/multiline_annotation2.toml b/vendor/annotate-snippets-0.8.0/tests/fixtures/no-color/multiline_annotation2.toml new file mode 100644 index 000000000..6ec0b1fe8 --- /dev/null +++ b/vendor/annotate-snippets-0.8.0/tests/fixtures/no-color/multiline_annotation2.toml @@ -0,0 +1,18 @@ +[[slices]] +source = """ + if let DisplayLine::Source { + ref mut inline_marks, + } = body[body_idx] +""" +line_start = 139 +origin = "src/display_list.rs" +fold = false +[[slices.annotations]] +label = "missing fields `lineno`, `content`" +annotation_type = "Error" +range = [31, 127] + +[title] +label = "pattern does not mention fields `lineno`, `content`" +id = "E0027" +annotation_type = "Error" diff --git a/vendor/annotate-snippets-0.8.0/tests/fixtures/no-color/multiline_annotation2.txt b/vendor/annotate-snippets-0.8.0/tests/fixtures/no-color/multiline_annotation2.txt new file mode 100644 index 000000000..8a00bfa20 --- /dev/null +++ b/vendor/annotate-snippets-0.8.0/tests/fixtures/no-color/multiline_annotation2.txt @@ -0,0 +1,9 @@ +error[E0027]: pattern does not mention fields `lineno`, `content` + --> src/display_list.rs:139:32 + | +139 | if let DisplayLine::Source { + | ________________________________^ +140 | | ref mut inline_marks, +141 | | } = body[body_idx] + | |_________________________^ missing fields `lineno`, `content` + | diff --git a/vendor/annotate-snippets-0.8.0/tests/fixtures/no-color/multiline_annotation3.toml b/vendor/annotate-snippets-0.8.0/tests/fixtures/no-color/multiline_annotation3.toml new file mode 100644 index 000000000..21bbcd857 --- /dev/null +++ b/vendor/annotate-snippets-0.8.0/tests/fixtures/no-color/multiline_annotation3.toml @@ -0,0 +1,18 @@ +[[slices]] +source = """ +This is an exampl +e of an edge case of an annotation overflowing +to exactly one character on next line. +""" +line_start = 26 +origin = "foo.txt" +fold = false +[[slices.annotations]] +label = "this should not be on separate lines" +annotation_type = "Error" +range = [11, 18] + +[title] +label = "spacing error found" +id = "E####" +annotation_type = "Error" diff --git a/vendor/annotate-snippets-0.8.0/tests/fixtures/no-color/multiline_annotation3.txt b/vendor/annotate-snippets-0.8.0/tests/fixtures/no-color/multiline_annotation3.txt new file mode 100644 index 000000000..12e174c56 --- /dev/null +++ b/vendor/annotate-snippets-0.8.0/tests/fixtures/no-color/multiline_annotation3.txt @@ -0,0 +1,9 @@ +error[E####]: spacing error found + --> foo.txt:26:12 + | +26 | This is an exampl + | ____________^ +27 | | e of an edge case of an annotation overflowing + | |_^ this should not be on separate lines +28 | to exactly one character on next line. + | \ No newline at end of file diff --git a/vendor/annotate-snippets-0.8.0/tests/fixtures/no-color/multiple_annotations.toml b/vendor/annotate-snippets-0.8.0/tests/fixtures/no-color/multiple_annotations.toml new file mode 100644 index 000000000..84efc5f17 --- /dev/null +++ b/vendor/annotate-snippets-0.8.0/tests/fixtures/no-color/multiple_annotations.toml @@ -0,0 +1,25 @@ +[[slices]] +source = """ +fn add_title_line(result: &mut Vec, main_annotation: Option<&Annotation>) { + if let Some(annotation) = main_annotation { + result.push(format_title_line( + &annotation.annotation_type, + None, + &annotation.label, + )); + } +} +""" +line_start = 96 +[[slices.annotations]] +label = "Variable defined here" +annotation_type = "Error" +range = [100, 110] +[[slices.annotations]] +label = "Referenced here" +annotation_type = "Error" +range = [184, 194] +[[slices.annotations]] +label = "Referenced again here" +annotation_type = "Error" +range = [243, 253] diff --git a/vendor/annotate-snippets-0.8.0/tests/fixtures/no-color/multiple_annotations.txt b/vendor/annotate-snippets-0.8.0/tests/fixtures/no-color/multiple_annotations.txt new file mode 100644 index 000000000..26c677f7e --- /dev/null +++ b/vendor/annotate-snippets-0.8.0/tests/fixtures/no-color/multiple_annotations.txt @@ -0,0 +1,14 @@ + | + 96 | fn add_title_line(result: &mut Vec, main_annotation: Option<&Annotation>) { + 97 | if let Some(annotation) = main_annotation { + | ^^^^^^^^^^ Variable defined here + 98 | result.push(format_title_line( + 99 | &annotation.annotation_type, + | ^^^^^^^^^^ Referenced here +100 | None, +101 | &annotation.label, + | ^^^^^^^^^^ Referenced again here +102 | )); +103 | } +104 | } + | diff --git a/vendor/annotate-snippets-0.8.0/tests/fixtures/no-color/simple.toml b/vendor/annotate-snippets-0.8.0/tests/fixtures/no-color/simple.toml new file mode 100644 index 000000000..6c38674ac --- /dev/null +++ b/vendor/annotate-snippets-0.8.0/tests/fixtures/no-color/simple.toml @@ -0,0 +1,18 @@ +[[slices]] +source = """ + }) + + for line in &self.body {""" +line_start = 169 +origin = "src/format_color.rs" +[[slices.annotations]] +label = "unexpected token" +annotation_type = "Error" +range = [20, 23] +[[slices.annotations]] +label = "expected one of `.`, `;`, `?`, or an operator here" +annotation_type = "Warning" +range = [10, 11] +[title] +label = "expected one of `.`, `;`, `?`, or an operator, found `for`" +annotation_type = "Error" diff --git a/vendor/annotate-snippets-0.8.0/tests/fixtures/no-color/simple.txt b/vendor/annotate-snippets-0.8.0/tests/fixtures/no-color/simple.txt new file mode 100644 index 000000000..752cc890f --- /dev/null +++ b/vendor/annotate-snippets-0.8.0/tests/fixtures/no-color/simple.txt @@ -0,0 +1,9 @@ +error: expected one of `.`, `;`, `?`, or an operator, found `for` + --> src/format_color.rs:171:9 + | +169 | }) + | - expected one of `.`, `;`, `?`, or an operator here +170 | +171 | for line in &self.body { + | ^^^ unexpected token + | -- cgit v1.2.3