Skip to content

Commit 1561721

Browse files
committed
fix: add run-pass directive and restore embedded whitespace bytes
1 parent f7a598b commit 1561721

2 files changed

Lines changed: 12 additions & 11 deletions

File tree

tests/ui/whitespace/ascii_whitespace_excludes_vertical_tab.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//@ run-pass
12
// This test checks that split_ascii_whitespace does NOT split on
23
// vertical tab (\x0B), because the standard library uses the WhatWG
34
// Infra Standard definition of ASCII whitespace, which excludes

tests/ui/whitespace/vertical_tab_lexer.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//@ run-pass
12
// ignore-tidy-tab
23
//
34
// Tests that the Rust lexer accepts Unicode Pattern_White_Space characters.
@@ -15,34 +16,33 @@
1516

1617
#[rustfmt::skip]
1718
fn main() {
18-
// tab (\x09) between `let` and the name
19+
// tab (\x09) between let and the name
1920
let _ws1 = 1_i32;
2021

21-
// vertical tab (\x0B) between `let` and the name
22+
// vertical tab (\x0B) between let and the name
2223
// this is the one is_ascii_whitespace gets wrong
23-
let_ws2 = 2_i32;
24+
let _ws2 = 2_i32;
2425

25-
// form feed (\x0C) between `let` and the name
26-
let_ws3 = 3_i32;
26+
// form feed (\x0C) between let and the name
27+
let _ws3 = 3_i32;
2728

2829
// plain space (\x20), here just so every character is represented
2930
let _ws4 = 4_i32;
3031

31-
// NEL (\u{85}) between `let` and the name
32-
let_ws5 = 5_i32;
32+
// NEL (\u{85}) between let and the name
33+
let…_ws5 = 5_i32;
3334

34-
// left-to-right mark (\u{200E}) between `let` and the name
35+
// left-to-right mark (\u{200E}) between let and the name
3536
let‎_ws6 = 6_i32;
3637

37-
// right-to-left mark (\u{200F}) between `let` and the name
38+
// right-to-left mark (\u{200F}) between let and the name
3839
let‏_ws7 = 7_i32;
3940

4041
// \x0A, \x0D, \u{2028}, \u{2029} are also Pattern_White_Space but they
4142
// act as line endings, so you can't stick them in the middle of a statement.
4243
// The lexer still handles them correctly at line boundaries.
4344

44-
// These are Unicode White_Space but NOT Pattern_White_Space, so the Rust
45-
// lexer won't accept them between tokens:
45+
// These are Unicode White_Space but NOT Pattern_White_Space:
4646
// \u{A0} no-break space \u{1680} ogham space mark
4747
// \u{2000} en quad \u{2001} em quad
4848
// \u{2002} en space \u{2003} em space

0 commit comments

Comments
 (0)