diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2017-06-12 15:54:04 -0700 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2017-06-15 11:21:19 -0700 |
| commit | 8074a88787de412a341e99ea16c88784ecf915a0 (patch) | |
| tree | c9592df64378fc409534a50711a2b39d6325a199 /src/libsyntax | |
| parent | 5aa34038ffd8c30ebdce5518a312a187385d3216 (diff) | |
| download | rust-8074a88787de412a341e99ea16c88784ecf915a0.tar.gz rust-8074a88787de412a341e99ea16c88784ecf915a0.zip | |
Position span label correctly when it isn't last
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/test_snippet.rs | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/libsyntax/test_snippet.rs b/src/libsyntax/test_snippet.rs index b3fa1e97376..4fae2ff9814 100644 --- a/src/libsyntax/test_snippet.rs +++ b/src/libsyntax/test_snippet.rs @@ -736,6 +736,49 @@ error: foo } #[test] +fn multiple_labels_secondary_without_message_3() { + test_harness(r#" +fn foo() { + a bc d +} +"#, + vec![ + SpanLabel { + start: Position { + string: "a", + count: 1, + }, + end: Position { + string: "b", + count: 1, + }, + label: "`a` is a good letter", + }, + SpanLabel { + start: Position { + string: "c", + count: 1, + }, + end: Position { + string: "d", + count: 1, + }, + label: "", + }, + ], + r#" +error: foo + --> test.rs:3:3 + | +3 | a bc d + | ^^^^---- + | | + | `a` is a good letter + +"#); +} + +#[test] fn multiple_labels_without_message() { test_harness(r#" fn foo() { |
