diff options
Diffstat (limited to 'compiler/rustc_parse/src/parser/tests.rs')
| -rw-r--r-- | compiler/rustc_parse/src/parser/tests.rs | 100 |
1 files changed, 94 insertions, 6 deletions
diff --git a/compiler/rustc_parse/src/parser/tests.rs b/compiler/rustc_parse/src/parser/tests.rs index 8703d5b8490..cf791d332a2 100644 --- a/compiler/rustc_parse/src/parser/tests.rs +++ b/compiler/rustc_parse/src/parser/tests.rs @@ -1541,11 +1541,36 @@ fn debug_lookahead() { ctxt: #0, }, }, - tokens: [], + tokens: [ + Ident( + \"fn\", + No, + ), + Ident( + \"f\", + No, + ), + OpenDelim( + Parenthesis, + ), + Ident( + \"x\", + No, + ), + Colon, + Ident( + \"u32\", + No, + ), + CloseDelim( + Parenthesis, + ), + ], approx_token_stream_pos: 1, .. }" ); + // There are 13 tokens. We request 15, get 14; the last one is `Eof`. assert_eq!( &format!("{:#?}", p.debug_lookahead(15)), "Parser { @@ -1561,7 +1586,51 @@ fn debug_lookahead() { ctxt: #0, }, }, - tokens: [], + tokens: [ + Ident( + \"fn\", + No, + ), + Ident( + \"f\", + No, + ), + OpenDelim( + Parenthesis, + ), + Ident( + \"x\", + No, + ), + Colon, + Ident( + \"u32\", + No, + ), + CloseDelim( + Parenthesis, + ), + OpenDelim( + Brace, + ), + Ident( + \"x\", + No, + ), + CloseDelim( + Brace, + ), + Ident( + \"struct\", + No, + ), + Ident( + \"S\", + No, + ), + Semi, + Eof, + ], approx_token_stream_pos: 1, .. }" @@ -1588,7 +1657,12 @@ fn debug_lookahead() { ctxt: #0, }, }, - tokens: [], + tokens: [ + Ident( + \"x\", + No, + ), + ], approx_token_stream_pos: 9, .. }" @@ -1610,7 +1684,23 @@ fn debug_lookahead() { ctxt: #0, }, }, - tokens: [], + tokens: [ + Ident( + \"x\", + No, + ), + CloseDelim( + Brace, + ), + Ident( + \"struct\", + No, + ), + Ident( + \"S\", + No, + ), + ], approx_token_stream_pos: 9, .. }" @@ -1637,8 +1727,6 @@ fn debug_lookahead() { }, tokens: [ Eof, - Eof, - Eof, ], approx_token_stream_pos: 15, .. |
