Skip to content

Commit b171518

Browse files
sophiajtnikomatsakis
authored andcommitted
---
yaml --- r: 277561 b: refs/heads/try c: f359aa2 h: refs/heads/master i: 277559: 844ce88
1 parent 3669186 commit b171518

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
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 6dbb0e86aec11050480beb76eade6fb805010ba7
33
refs/heads/snap-stage3: 235d77457d80b549dad3ac36d94f235208a1eafb
4-
refs/heads/try: 64e0819fc2681be7d3f0e61f8b0f61eca67ad3fb
4+
refs/heads/try: f359aa276216aa74868b4ead5fea9a83a8397b27
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/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)