Closed
Description
$ cat confuse.md
```rust
// pub fn mai
```
$ rustdoc --test confuse.md
running 1 test
test _0 ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
$ sed -i 's/mai/main/' confuse.md
$ rustdoc --test confuse.md
running 1 test
test _0 ... FAILED
failures:
---- _0 stdout ----
error: main function not found
error: aborting due to previous error
thread '_0' panicked at 'Box<Any>', /home/aidanhs/Desktop/rust/rust/src/libsyntax/diagnostic.rs:144
failures:
_0
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured
thread '<unnamed>' panicked at 'Some tests failed', /home/aidanhs/Desktop/rust/rust/src/libtest/lib.rs:265
thread '<main>' panicked at 'called `Result::unwrap()` on an `Err` value: ()', /home/aidanhs/Desktop/rust/rust/src/libcore/result.rs:746
Per http://doc.rust-lang.org/rustdoc.html, "Given a code block, if it does not contain fn main, it is wrapped in fn main() { your_code }"
Can it not be "does not contain 'fn main (' outside of a comment"?