typos/benches/data.rs

41 lines
1.3 KiB
Rust
Raw Permalink Normal View History

2021-02-05 22:38:44 -05:00
pub static EMPTY: &str = "";
2019-01-22 17:01:33 -05:00
2021-02-05 22:38:44 -05:00
pub static NO_TOKENS: &str = " ";
2019-01-22 17:01:33 -05:00
2021-02-05 22:38:44 -05:00
pub static SINGLE_TOKEN: &str = "success";
2019-01-22 17:01:33 -05:00
// Stolen from https://github.com/BurntSushi/ripgrep/blob/master/grep-searcher/src/searcher/glue.rs
2021-02-06 12:19:08 -05:00
pub static SHERLOCK: &str = "\
2019-01-22 17:01:33 -05:00
For the Doctor Watsons of this world, as opposed to the Sherlock
Holmeses, success in the province of detective work must always
be, to a very large extent, the result of luck. Sherlock Holmes
can extract a clew from a wisp of straw or a flake of cigar ash;
but Doctor Watson has to have it taken out for him and dusted,
and exhibited clearly, with a label attached.\
";
// Stolen from https://github.com/BurntSushi/ripgrep/blob/master/grep-searcher/src/searcher/glue.rs
2021-02-06 12:19:08 -05:00
pub static CODE: &str = "\
2019-01-22 17:01:33 -05:00
extern crate snap;
use std::io;
fn main() {
let stdin = io::stdin();
let stdout = io::stdout();
// Wrap the stdin reader in a Snappy reader.
let mut rdr = snap::Reader::new(stdin.lock());
let mut wtr = stdout.lock();
io::copy(&mut rdr, &mut wtr).expect(\"I/O operation failed\");
}
";
2021-02-05 22:38:44 -05:00
pub static CORPUS: &str = include_str!("../crates/typos-dict/assets/words.csv");
pub static DATA: &[(&str, &str)] = &[
("empty", EMPTY),
("no_tokens", NO_TOKENS),
("single_token", SINGLE_TOKEN),
("sherlock", SHERLOCK),
("code", CODE),
("corpus", CORPUS),
];