]>
Commit | Line | Data |
---|---|---|
7453a54e SL |
1 | // Copyright 2015 The Rust Project Developers. See the COPYRIGHT |
2 | // file at the top-level directory of this distribution and at | |
3 | // http://rust-lang.org/COPYRIGHT. | |
4 | // | |
5 | // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | |
6 | // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | |
7 | // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | |
8 | // option. This file may not be copied, modified, or distributed | |
9 | // except according to those terms. | |
10 | ||
b7449926 | 11 | // run-pass |
7453a54e SL |
12 | // The number of `#`s used to wrap the documentation comment should differ regarding the content. |
13 | // | |
14 | // Related issue: #27489 | |
15 | ||
16 | macro_rules! homura { | |
17 | ($x:expr, #[$y:meta]) => (assert_eq!($x, stringify!($y))) | |
18 | } | |
19 | ||
20 | fn main() { | |
21 | homura! { | |
22 | r#"doc = r" Madoka""#, | |
23 | /// Madoka | |
24 | }; | |
25 | ||
26 | homura! { | |
27 | r##"doc = r#" One quote mark: ["]"#"##, | |
28 | /// One quote mark: ["] | |
29 | }; | |
30 | ||
31 | homura! { | |
32 | r##"doc = r#" Two quote marks: [""]"#"##, | |
33 | /// Two quote marks: [""] | |
34 | }; | |
35 | ||
36 | homura! { | |
37 | r#####"doc = r####" Raw string ending sequences: ["###]"####"#####, | |
38 | /// Raw string ending sequences: ["###] | |
39 | }; | |
40 | } |