The doc tests fail because `extern crate rand;` picks up the `rand` crate built-in to the compiler, not this one, meaning things like `random` don't exist.