mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
internal: Thread edition through to parsing/tt-to-syntax-tree routines for macros
This commit is contained in:
parent
83370fe5d7
commit
a483d3bc37
39 changed files with 187 additions and 145 deletions
|
@ -174,6 +174,7 @@ fn test_doc_comment_none() {
|
|||
// non-doc
|
||||
mod foo {}
|
||||
"#,
|
||||
parser::Edition::CURRENT,
|
||||
)
|
||||
.ok()
|
||||
.unwrap();
|
||||
|
@ -189,6 +190,7 @@ fn test_outer_doc_comment_of_items() {
|
|||
// non-doc
|
||||
mod foo {}
|
||||
"#,
|
||||
parser::Edition::CURRENT,
|
||||
)
|
||||
.ok()
|
||||
.unwrap();
|
||||
|
@ -204,6 +206,7 @@ fn test_inner_doc_comment_of_items() {
|
|||
// non-doc
|
||||
mod foo {}
|
||||
"#,
|
||||
parser::Edition::CURRENT,
|
||||
)
|
||||
.ok()
|
||||
.unwrap();
|
||||
|
@ -218,6 +221,7 @@ fn test_doc_comment_of_statics() {
|
|||
/// Number of levels
|
||||
static LEVELS: i32 = 0;
|
||||
"#,
|
||||
parser::Edition::CURRENT,
|
||||
)
|
||||
.ok()
|
||||
.unwrap();
|
||||
|
@ -237,6 +241,7 @@ fn test_doc_comment_preserves_indents() {
|
|||
/// ```
|
||||
mod foo {}
|
||||
"#,
|
||||
parser::Edition::CURRENT,
|
||||
)
|
||||
.ok()
|
||||
.unwrap();
|
||||
|
@ -257,6 +262,7 @@ fn test_doc_comment_preserves_newlines() {
|
|||
/// foo
|
||||
mod foo {}
|
||||
"#,
|
||||
parser::Edition::CURRENT,
|
||||
)
|
||||
.ok()
|
||||
.unwrap();
|
||||
|
@ -271,6 +277,7 @@ fn test_doc_comment_single_line_block_strips_suffix() {
|
|||
/** this is mod foo*/
|
||||
mod foo {}
|
||||
"#,
|
||||
parser::Edition::CURRENT,
|
||||
)
|
||||
.ok()
|
||||
.unwrap();
|
||||
|
@ -285,6 +292,7 @@ fn test_doc_comment_single_line_block_strips_suffix_whitespace() {
|
|||
/** this is mod foo */
|
||||
mod foo {}
|
||||
"#,
|
||||
parser::Edition::CURRENT,
|
||||
)
|
||||
.ok()
|
||||
.unwrap();
|
||||
|
@ -303,6 +311,7 @@ fn test_doc_comment_multi_line_block_strips_suffix() {
|
|||
*/
|
||||
mod foo {}
|
||||
"#,
|
||||
parser::Edition::CURRENT,
|
||||
)
|
||||
.ok()
|
||||
.unwrap();
|
||||
|
@ -316,7 +325,7 @@ fn test_doc_comment_multi_line_block_strips_suffix() {
|
|||
#[test]
|
||||
fn test_comments_preserve_trailing_whitespace() {
|
||||
let file = SourceFile::parse(
|
||||
"\n/// Representation of a Realm. \n/// In the specification these are called Realm Records.\nstruct Realm {}",
|
||||
"\n/// Representation of a Realm. \n/// In the specification these are called Realm Records.\nstruct Realm {}", parser::Edition::CURRENT,
|
||||
)
|
||||
.ok()
|
||||
.unwrap();
|
||||
|
@ -335,6 +344,7 @@ fn test_four_slash_line_comment() {
|
|||
/// doc comment
|
||||
mod foo {}
|
||||
"#,
|
||||
parser::Edition::CURRENT,
|
||||
)
|
||||
.ok()
|
||||
.unwrap();
|
||||
|
@ -360,6 +370,7 @@ where
|
|||
for<'a> F: Fn(&'a str)
|
||||
{}
|
||||
"#,
|
||||
parser::Edition::CURRENT,
|
||||
)
|
||||
.ok()
|
||||
.unwrap();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue