Skip to content

Commit 5411a43

Browse files
sophiajtnikomatsakis
authored andcommitted
---
yaml --- r: 277952 b: refs/heads/auto c: f359aa2 h: refs/heads/master
1 parent dec61fc commit 5411a43

File tree

2 files changed

+16
-18
lines changed

2 files changed

+16
-18
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
88
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
99
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1010
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
11-
refs/heads/auto: 64e0819fc2681be7d3f0e61f8b0f61eca67ad3fb
11+
refs/heads/auto: f359aa276216aa74868b4ead5fea9a83a8397b27
1212
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1313
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
1414
refs/tags/0.2: 1754d02027f2924bed83b0160ee340c7f41d5ea1

branches/auto/src/test/run-make/unicode-input/span_length.rs

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ fn main() {
6565

6666
let err = String::from_utf8_lossy(&result.stderr);
6767

68-
// the span should end the line (e.g no extra ^'s)
69-
let expected_span = format!("^{}\n", repeat("^").take(n - 1)
68+
// the span should end the line (e.g no extra ~'s)
69+
let expected_span = format!("^{}\n", repeat("~").take(n - 1)
7070
.collect::<String>());
7171
assert!(err.contains(&expected_span));
7272
}
@@ -91,19 +91,17 @@ fn main() {
9191

9292
// Test both the length of the snake and the leading spaces up to it
9393

94-
// First snake is 9 ^s long.
95-
let expected_1 = r#"
96-
1 |> extern "路濫狼á́́" fn foo() {} extern "路濫狼á́" fn bar() {}
97-
|> ^^^^^^^^^
98-
"#;
99-
assert!(err.contains(&expected_1));
100-
101-
// Second snake is only 8 ^s long, because rustc counts chars()
102-
// now rather than width(). This is because width() functions are
103-
// to be removed from librustc_unicode
104-
let expected_2 = r#"
105-
1 |> extern "路濫狼á́́" fn foo() {} extern "路濫狼á́" fn bar() {}
106-
|> ^^^^^^^^
107-
"#;
108-
assert!(err.contains(&expected_2));
94+
// First snake is 8 ~s long, with 7 preceding spaces (excluding file name/line offset)
95+
let expected_span = format!("\n{}^{}\n",
96+
repeat(" ").take(offset + 7).collect::<String>(),
97+
repeat("~").take(8).collect::<String>());
98+
assert!(err.contains(&expected_span));
99+
// Second snake is only 7 ~s long, with 36 preceding spaces,
100+
// because rustc counts chars() now rather than width(). This
101+
// is because width() functions are to be removed from
102+
// librustc_unicode
103+
let expected_span = format!("\n{}^{}\n",
104+
repeat(" ").take(offset + 36).collect::<String>(),
105+
repeat("~").take(7).collect::<String>());
106+
assert!(err.contains(&expected_span));
109107
}

0 commit comments

Comments
 (0)