Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add some comments for magic numbers + Add tests
- Loading branch information
1 parent
6b25c50
commit a7eabec
Showing
5 changed files
with
84 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// check-pass | ||
// aux-build:test-macros.rs | ||
|
||
// Anonymize unstable non-dummy spans while still showing dummy spans `0..0`. | ||
// normalize-stdout-test "bytes\([^0]\w*\.\.(\w+)\)" -> "bytes(LO..$1)" | ||
// normalize-stdout-test "bytes\((\w+)\.\.[^0]\w*\)" -> "bytes($1..HI)" | ||
|
||
#[macro_use] | ||
extern crate test_macros; | ||
|
||
print_bang! { | ||
|
||
/** | ||
******* | ||
* DOC * | ||
* DOC * | ||
* DOC * | ||
******* | ||
*/ | ||
pub struct S; | ||
|
||
} | ||
|
||
fn main() {} |
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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
PRINT-BANG INPUT (DISPLAY): /** | ||
******* | ||
* DOC * | ||
* DOC * | ||
* DOC * | ||
******* | ||
*/ | ||
pub struct S ; | ||
PRINT-BANG RE-COLLECTED (DISPLAY): #[doc = "\n*******\n* DOC *\n* DOC *\n* DOC *\n*******\n"] pub struct S ; | ||
PRINT-BANG INPUT (DEBUG): TokenStream [ | ||
Punct { | ||
ch: '#', | ||
spacing: Alone, | ||
span: #0 bytes(LO..HI), | ||
}, | ||
Group { | ||
delimiter: Bracket, | ||
stream: TokenStream [ | ||
Ident { | ||
ident: "doc", | ||
span: #0 bytes(LO..HI), | ||
}, | ||
Punct { | ||
ch: '=', | ||
spacing: Alone, | ||
span: #0 bytes(LO..HI), | ||
}, | ||
Literal { | ||
kind: Str, | ||
symbol: "\n*******\n* DOC *\n* DOC *\n* DOC *\n*******\n", | ||
suffix: None, | ||
span: #0 bytes(LO..HI), | ||
}, | ||
], | ||
span: #0 bytes(LO..HI), | ||
}, | ||
Ident { | ||
ident: "pub", | ||
span: #0 bytes(LO..HI), | ||
}, | ||
Ident { | ||
ident: "struct", | ||
span: #0 bytes(LO..HI), | ||
}, | ||
Ident { | ||
ident: "S", | ||
span: #0 bytes(LO..HI), | ||
}, | ||
Punct { | ||
ch: ';', | ||
spacing: Alone, | ||
span: #0 bytes(LO..HI), | ||
}, | ||
] |
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