Skip to content

Commit

Permalink
Auto merge of #42247 - durka:patch-41, r=arielb1
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bors committed Jun 6, 2017
2 parents e1293ec + 9d67dfe commit a032cb8
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions src/test/run-pass/weird-exprs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,36 @@ fn angrydome() {

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

fn dots() {
assert_eq!(String::from(".................................................."),
format!("{:?}", .. .. .. .. .. .. .. .. .. .. .. .. ..
.. .. .. .. .. .. .. .. .. .. .. ..));
}

fn you_eight() {
assert_eq!(8, {
macro_rules! u8 {
(u8) => {
mod u8 {
pub fn u8<'u8>(u8: &'u8 u8) -> &'u8 u8 {
"u8";
u8
}
}
};
}

u8!(u8);
let &u8: &u8 = u8::u8(&8u8);
u8
});
}

fn fishy() {
assert_eq!(String::from("><>"),
String::<>::from::<>("><>").chars::<>().rev::<>().collect::<String>());
}

pub fn main() {
strange();
funny();
Expand All @@ -86,4 +116,7 @@ pub fn main() {
canttouchthis();
angrydome();
evil_lincoln();
dots();
you_eight();
fishy();
}

0 comments on commit a032cb8

Please sign in to comment.