-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #74175 - nnethercote:more-static-symbols, r=oli-obk
More static symbols These commits add some more static symbols and convert lots of places to use them. r? @oli-obk
- Loading branch information
Showing
67 changed files
with
991 additions
and
745 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,58 @@ | ||
use super::*; | ||
use crate::with_default_session_globals; | ||
|
||
#[test] | ||
fn test_block_doc_comment_1() { | ||
let comment = "/**\n * Test \n ** Test\n * Test\n*/"; | ||
let stripped = strip_doc_comment_decoration(comment); | ||
assert_eq!(stripped, " Test \n* Test\n Test"); | ||
with_default_session_globals(|| { | ||
let comment = "/**\n * Test \n ** Test\n * Test\n*/"; | ||
let stripped = strip_doc_comment_decoration(Symbol::intern(comment)); | ||
assert_eq!(stripped, " Test \n* Test\n Test"); | ||
}) | ||
} | ||
|
||
#[test] | ||
fn test_block_doc_comment_2() { | ||
let comment = "/**\n * Test\n * Test\n*/"; | ||
let stripped = strip_doc_comment_decoration(comment); | ||
assert_eq!(stripped, " Test\n Test"); | ||
with_default_session_globals(|| { | ||
let comment = "/**\n * Test\n * Test\n*/"; | ||
let stripped = strip_doc_comment_decoration(Symbol::intern(comment)); | ||
assert_eq!(stripped, " Test\n Test"); | ||
}) | ||
} | ||
|
||
#[test] | ||
fn test_block_doc_comment_3() { | ||
let comment = "/**\n let a: *i32;\n *a = 5;\n*/"; | ||
let stripped = strip_doc_comment_decoration(comment); | ||
assert_eq!(stripped, " let a: *i32;\n *a = 5;"); | ||
with_default_session_globals(|| { | ||
let comment = "/**\n let a: *i32;\n *a = 5;\n*/"; | ||
let stripped = strip_doc_comment_decoration(Symbol::intern(comment)); | ||
assert_eq!(stripped, " let a: *i32;\n *a = 5;"); | ||
}) | ||
} | ||
|
||
#[test] | ||
fn test_block_doc_comment_4() { | ||
let comment = "/*******************\n test\n *********************/"; | ||
let stripped = strip_doc_comment_decoration(comment); | ||
assert_eq!(stripped, " test"); | ||
with_default_session_globals(|| { | ||
let comment = "/*******************\n test\n *********************/"; | ||
let stripped = strip_doc_comment_decoration(Symbol::intern(comment)); | ||
assert_eq!(stripped, " test"); | ||
}) | ||
} | ||
|
||
#[test] | ||
fn test_line_doc_comment() { | ||
let stripped = strip_doc_comment_decoration("/// test"); | ||
assert_eq!(stripped, " test"); | ||
let stripped = strip_doc_comment_decoration("///! test"); | ||
assert_eq!(stripped, " test"); | ||
let stripped = strip_doc_comment_decoration("// test"); | ||
assert_eq!(stripped, " test"); | ||
let stripped = strip_doc_comment_decoration("// test"); | ||
assert_eq!(stripped, " test"); | ||
let stripped = strip_doc_comment_decoration("///test"); | ||
assert_eq!(stripped, "test"); | ||
let stripped = strip_doc_comment_decoration("///!test"); | ||
assert_eq!(stripped, "test"); | ||
let stripped = strip_doc_comment_decoration("//test"); | ||
assert_eq!(stripped, "test"); | ||
with_default_session_globals(|| { | ||
let stripped = strip_doc_comment_decoration(Symbol::intern("/// test")); | ||
assert_eq!(stripped, " test"); | ||
let stripped = strip_doc_comment_decoration(Symbol::intern("///! test")); | ||
assert_eq!(stripped, " test"); | ||
let stripped = strip_doc_comment_decoration(Symbol::intern("// test")); | ||
assert_eq!(stripped, " test"); | ||
let stripped = strip_doc_comment_decoration(Symbol::intern("// test")); | ||
assert_eq!(stripped, " test"); | ||
let stripped = strip_doc_comment_decoration(Symbol::intern("///test")); | ||
assert_eq!(stripped, "test"); | ||
let stripped = strip_doc_comment_decoration(Symbol::intern("///!test")); | ||
assert_eq!(stripped, "test"); | ||
let stripped = strip_doc_comment_decoration(Symbol::intern("//test")); | ||
assert_eq!(stripped, "test"); | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.