summaryrefslogtreecommitdiffstats
path: root/tests/hay.rs
diff options
context:
space:
mode:
authorAndrew Gallant <jamslam@gmail.com>2018-08-06 20:11:58 -0400
committerAndrew Gallant <jamslam@gmail.com>2018-08-20 07:10:19 -0400
commiteb184d7711a3d01b2fd3a4281b193f39f7e9a2c5 (patch)
tree6531c55af7eae5670d224d347763ad1e3216e8b4 /tests/hay.rs
parentbb110c1ebeeda452046830b3991f705f5759da92 (diff)
tests: re-tool integration tests
This basically rewrites every integration test. We reduce the amount of magic involved here in terms of which arguments are being passed to ripgrep processes. To make up for the boiler plate saved by the magic, we make the Dir (formerly WorkDir) type a bit nicer to use, along with a new TestCommand that wraps a std::process::Command. In exchange, we get tests that are easier to read and write. We also run every test with the `--pcre2` flag to make sure that works, when PCRE2 is available.
Diffstat (limited to 'tests/hay.rs')
-rw-r--r--tests/hay.rs21
1 files changed, 7 insertions, 14 deletions
diff --git a/tests/hay.rs b/tests/hay.rs
index 74d2f6cc..15a53b15 100644
--- a/tests/hay.rs
+++ b/tests/hay.rs
@@ -7,18 +7,11 @@ but Doctor Watson has to have it taken out for him and dusted,
and exhibited clearly, with a label attached.
";
-pub const CODE: &'static str = "\
-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\");
-}
+pub const SHERLOCK_CRLF: &'static str = "\
+For the Doctor Watsons of this world, as opposed to the Sherlock\r
+Holmeses, success in the province of detective work must always\r
+be, to a very large extent, the result of luck. Sherlock Holmes\r
+can extract a clew from a wisp of straw or a flake of cigar ash;\r
+but Doctor Watson has to have it taken out for him and dusted,\r
+and exhibited clearly, with a label attached.\r
";