Skip to content

Commit a032cb8

Browse files
committed
Auto merge of #42247 - durka:patch-41, r=arielb1
add playbot jokes to run-pass test Some funny expressions that people pull out on IRC, that might actually be useful to test pathological parser behavior.
2 parents e1293ec + 9d67dfe commit a032cb8

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

src/test/run-pass/weird-exprs.rs

+33
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,36 @@ fn angrydome() {
7777

7878
fn evil_lincoln() { let _evil = println!("lincoln"); }
7979

80+
fn dots() {
81+
assert_eq!(String::from(".................................................."),
82+
format!("{:?}", .. .. .. .. .. .. .. .. .. .. .. .. ..
83+
.. .. .. .. .. .. .. .. .. .. .. ..));
84+
}
85+
86+
fn you_eight() {
87+
assert_eq!(8, {
88+
macro_rules! u8 {
89+
(u8) => {
90+
mod u8 {
91+
pub fn u8<'u8>(u8: &'u8 u8) -> &'u8 u8 {
92+
"u8";
93+
u8
94+
}
95+
}
96+
};
97+
}
98+
99+
u8!(u8);
100+
let &u8: &u8 = u8::u8(&8u8);
101+
u8
102+
});
103+
}
104+
105+
fn fishy() {
106+
assert_eq!(String::from("><>"),
107+
String::<>::from::<>("><>").chars::<>().rev::<>().collect::<String>());
108+
}
109+
80110
pub fn main() {
81111
strange();
82112
funny();
@@ -86,4 +116,7 @@ pub fn main() {
86116
canttouchthis();
87117
angrydome();
88118
evil_lincoln();
119+
dots();
120+
you_eight();
121+
fishy();
89122
}

0 commit comments

Comments
 (0)