diff options
author | Andrew Gallant <jamslam@gmail.com> | 2016-09-09 22:58:30 -0400 |
---|---|---|
committer | Andrew Gallant <jamslam@gmail.com> | 2016-09-09 22:58:30 -0400 |
commit | f83cd63b11f3fa6e85cd5bb0f803a69fa05efa84 (patch) | |
tree | 6f2a426b7e0e1ea92844cc915a38972585608319 /tests/hay.rs | |
parent | 9a4527d1076cfec4d3856a40d73b1b82ea1033aa (diff) |
Add integration tests.
Diffstat (limited to 'tests/hay.rs')
-rw-r--r-- | tests/hay.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/hay.rs b/tests/hay.rs new file mode 100644 index 00000000..74d2f6cc --- /dev/null +++ b/tests/hay.rs @@ -0,0 +1,24 @@ +pub const SHERLOCK: &'static str = "\ +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. +"; + +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\"); +} +"; |